add support for fee customization
Signed-off-by: Matias Alejo Garcia <ematiu@gmail.com>
This commit is contained in:
parent
7e23bd3406
commit
67ba30a20e
8 changed files with 74 additions and 2 deletions
|
|
@ -443,7 +443,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
self.availableBalanceBTC = strip(self.availableBalanceBTC / COIN);
|
||||
|
||||
// KB to send max
|
||||
self.feePerKbSat = config.feePerKbSat || 10000;
|
||||
self.feePerKbSat = config.feeValue || 10000;
|
||||
if (balance.totalKbToSendMax) {
|
||||
var feeToSendMaxSat = balance.totalKbToSendMax * self.feePerKbSat;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ angular.module('copayApp.controllers').controller('preferencesController',
|
|||
function($scope, $rootScope, $filter, $timeout, $modal, $log, lodash, configService, profileService) {
|
||||
var config = configService.getSync();
|
||||
this.unitName = config.wallet.settings.unitName;
|
||||
this.feeName = config.wallet.settings.feeName || 'Priority';
|
||||
this.bwsurl = config.bws.url;
|
||||
this.selectedAlternative = {
|
||||
name: config.wallet.settings.alternativeName,
|
||||
|
|
|
|||
35
src/js/controllers/preferencesFee.js
Normal file
35
src/js/controllers/preferencesFee.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesFeeController',
|
||||
function($rootScope, $scope, configService, go) {
|
||||
var config = configService.getSync();
|
||||
this.feeName = config.wallet.settings.feeName || 'Priority';
|
||||
this.feeOpts = [{
|
||||
name: 'Priority',
|
||||
value: 100,
|
||||
}, {
|
||||
name: 'Normal',
|
||||
value: 50,
|
||||
}, {
|
||||
name: 'Economy',
|
||||
value: 10,
|
||||
}];
|
||||
|
||||
this.save = function(newFee) {
|
||||
var opts = {
|
||||
wallet: {
|
||||
settings: {
|
||||
feeName: newFee.name,
|
||||
feeValue: newFee.value * 100,
|
||||
}
|
||||
}
|
||||
};
|
||||
this.feeName = newFee.name;
|
||||
|
||||
configService.set(opts, function(err) {
|
||||
if (err) console.log(err);
|
||||
$scope.$emit('Local/UnitSettingUpdated');
|
||||
});
|
||||
|
||||
};
|
||||
});
|
||||
|
|
@ -608,6 +608,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
|||
amount: amount,
|
||||
message: comment,
|
||||
payProUrl: paypro ? paypro.url : null,
|
||||
feePerKb: config.feeValue || 10000,
|
||||
}, function(err, txp) {
|
||||
if (err) {
|
||||
self.setOngoingProcess();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue