Fix rateService. Add usd rates

This commit is contained in:
Gustavo Maximiliano Cortez 2017-08-28 15:51:13 -03:00
commit a5a80684eb
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
19 changed files with 87 additions and 80 deletions

View file

@ -3,6 +3,7 @@
angular.module('copayApp.controllers').controller('topUpController', function($scope, $log, $state, $timeout, $ionicHistory, $ionicConfig, lodash, popupService, profileService, ongoingProcess, walletService, configService, platformInfo, bitpayService, bitpayCardService, payproService, bwcError, txFormatService, sendMaxService, gettextCatalog) {
$scope.isCordova = platformInfo.isCordova;
var coin = 'btc';
var cardId;
var useSendMax;
var amount;
@ -36,7 +37,7 @@ angular.module('copayApp.controllers').controller('topUpController', function($s
};
var satToFiat = function(sat, cb) {
txFormatService.toFiat(sat, $scope.currencyIsoCode, function(value) {
txFormatService.toFiat(coin, sat, $scope.currencyIsoCode, function(value) {
return cb(value);
});
};
@ -218,7 +219,7 @@ angular.module('copayApp.controllers').controller('topUpController', function($s
// Save TX in memory
createdTx = ctxp;
$scope.totalAmountStr = txFormatService.formatAmountStr(wallet, ctxp.amount);
$scope.totalAmountStr = txFormatService.formatAmountStr(coin, ctxp.amount);
setTotalAmount(parsedAmount.amountSat, invoiceFeeSat, ctxp.fee);
@ -257,7 +258,7 @@ angular.module('copayApp.controllers').controller('topUpController', function($s
onlyComplete: true,
network: bitpayService.getEnvironment().network,
hasFunds: true,
coin: 'btc'
coin: coin
});
if (lodash.isEmpty($scope.wallets)) {
@ -320,7 +321,7 @@ angular.module('copayApp.controllers').controller('topUpController', function($s
});
return;
}
var parsedAmount = txFormatService.parseAmount(wallet, a, c);
var parsedAmount = txFormatService.parseAmount(coin, a, c);
initializeTopUp(wallet, parsedAmount);
});
};