mirror of
https://github.com/hanzo-labs/arcadia.git
synced 2026-10-30 18:55:41 +00:00
51 lines
1.6 KiB
JavaScript
51 lines
1.6 KiB
JavaScript
'use strict';
|
|
var walletBalanceCtrl = function($scope, $sce) {
|
|
$scope.ajaxReq = ajaxReq;
|
|
$scope.tokensLoaded = true;
|
|
$scope.localToken = {
|
|
contractAdd: "",
|
|
symbol: "",
|
|
decimals: "",
|
|
type: "custom",
|
|
};
|
|
$scope.customTokenField = false;
|
|
$scope.saveTokenToLocal = function() {
|
|
globalFuncs.saveTokenToLocal($scope.localToken, function(data) {
|
|
if (!data.error) {
|
|
$scope.localToken = {
|
|
contractAdd: "",
|
|
symbol: "",
|
|
decimals: "",
|
|
type: "custom"
|
|
};
|
|
$scope.wallet.setTokens();
|
|
$scope.validateLocalToken = $sce.trustAsHtml('');
|
|
$scope.customTokenField = false;
|
|
} else {
|
|
$scope.notifier.danger(data.msg);
|
|
}
|
|
});
|
|
}
|
|
/*
|
|
$scope.$watch('wallet', function() {
|
|
if ($scope.wallet) $scope.reverseLookup();
|
|
});
|
|
$scope.reverseLookup = function() {
|
|
var _ens = new ens();
|
|
_ens.getName($scope.wallet.getAddressString().substring(2) + '.addr.reverse', function(data) {
|
|
if (data.error) uiFuncs.notifier.danger(data.msg);
|
|
else if (data.data == '0x') {
|
|
$scope.showens = false;
|
|
} else {
|
|
$scope.ensAddress = data.data;
|
|
$scope.showens = true;
|
|
}
|
|
});
|
|
}
|
|
*/
|
|
$scope.removeTokenFromLocal = function(tokenSymbol) {
|
|
globalFuncs.removeTokenFromLocal(tokenSymbol, $scope.wallet.tokenObjs);
|
|
}
|
|
};
|
|
module.exports = walletBalanceCtrl;
|