feature(tour): fetch USDBTC rate for tour graphic

This commit is contained in:
Jason Dreyzehner 2016-10-04 23:42:39 -04:00
commit 6efb17515a
2 changed files with 10 additions and 2 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('tourController',
function($scope, $state, $log, $timeout, ongoingProcess, profileService) {
function($scope, $state, $log, $timeout, $filter, ongoingProcess, profileService, rateService) {
var tries = 0;
@ -17,6 +17,14 @@ angular.module('copayApp.controllers').controller('tourController',
}
};
rateService.whenAvailable(function() {
var localCurrency = 'USD';
var btcAmount = 1;
var rate = rateService.toFiat(btcAmount * 1e8, localCurrency);
$scope.localCurrencySymbol = '$';
$scope.localCurrencyPerBtc = $filter('formatFiatAmount')(parseFloat(rate.toFixed(2), 10));
});
$scope.createDefaultWallet = function() {
ongoingProcess.set('creatingWallet', true);
profileService.createDefaultWallet(function(err, walletClient) {