Fix btc/bch icons. Adds coin param to createWallet method
This commit is contained in:
parent
ef8302f854
commit
ac5ede702d
20 changed files with 36 additions and 20 deletions
|
|
@ -27,6 +27,7 @@ angular.module('copayApp.controllers').controller('createController',
|
|||
$scope.formData.bwsurl = defaults.bws.url;
|
||||
$scope.TCValues = lodash.range(2, defaults.limits.totalCopayers + 1);
|
||||
$scope.formData.derivationPath = derivationPathHelper.default;
|
||||
$scope.formData.coin = 'btc';
|
||||
$scope.setTotalCopayers(tc);
|
||||
updateRCSelect(tc);
|
||||
resetPasswordFields();
|
||||
|
|
@ -137,6 +138,7 @@ angular.module('copayApp.controllers').controller('createController',
|
|||
bwsurl: $scope.formData.bwsurl,
|
||||
singleAddress: $scope.formData.singleAddressEnabled,
|
||||
walletPrivKey: $scope.formData._walletPrivKey, // Only for testing
|
||||
coin: $scope.formData.coin
|
||||
};
|
||||
|
||||
var setSeed = $scope.formData.seedSource.id == 'set';
|
||||
|
|
|
|||
|
|
@ -89,7 +89,10 @@ angular.module('copayApp.services')
|
|||
wallet.copayerId = wallet.credentials.copayerId;
|
||||
wallet.m = wallet.credentials.m;
|
||||
wallet.n = wallet.credentials.n;
|
||||
wallet.chain = wallet.credentials.chain;
|
||||
wallet.chain = wallet.credentials.chain ? (wallet.credentials.chain).toUpperCase() : 'BTC';
|
||||
|
||||
// TODO: Should return "chain" = "BTC" or "BCH"
|
||||
client.credentials.chain = 'BTC';
|
||||
|
||||
root.updateWalletSettings(wallet);
|
||||
root.wallet[walletId] = wallet;
|
||||
|
|
@ -227,8 +230,7 @@ angular.module('copayApp.services')
|
|||
bwsurl: getBWSURL(credentials.walletId),
|
||||
});
|
||||
|
||||
// TODO: Should return "chain" = "BTC" or "BCH"
|
||||
client.credentials.chain = 'BTC';
|
||||
|
||||
|
||||
var skipKeyValidation = shouldSkipValidation(credentials.walletId);
|
||||
if (!skipKeyValidation)
|
||||
|
|
@ -395,6 +397,7 @@ angular.module('copayApp.services')
|
|||
network: opts.networkName,
|
||||
singleAddress: opts.singleAddress,
|
||||
walletPrivKey: opts.walletPrivKey,
|
||||
coin: opts.coin
|
||||
}, function(err, secret) {
|
||||
if (err) return bwcError.cb(err, gettextCatalog.getString('Error creating wallet'), cb);
|
||||
return cb(null, walletClient, secret);
|
||||
|
|
@ -687,6 +690,7 @@ angular.module('copayApp.services')
|
|||
opts.m = 1;
|
||||
opts.n = 1;
|
||||
opts.networkName = 'livenet';
|
||||
opts.coin = 'btc';
|
||||
root.createWallet(opts, cb);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
<div class="label" translate>From</div>
|
||||
<div class="wallet">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
<img ng-src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
</i>
|
||||
{{wallet ? wallet.name : '...'}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
<div class="label">Receive in</div>
|
||||
<div class="wallet">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
<img ng-src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
</i>
|
||||
{{wallet ? wallet.name : '...'}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
<div class="label">Receive in</div>
|
||||
<div class="wallet">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
<img ng-src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
</i>
|
||||
{{wallet ? wallet.name : '...'}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
<div class="label" translate>From</div>
|
||||
<div class="wallet">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
<img ng-src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
</i>
|
||||
{{wallet ? wallet.name : '...'}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
<div class="item single-line">
|
||||
<div class="wallet">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
<img ng-src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
</i>
|
||||
{{wallet.name}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<div class="wallet-item">
|
||||
<i class="icon big-icon-svg circle">
|
||||
<img src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg"/>
|
||||
<img ng-src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg"/>
|
||||
</i>
|
||||
<div class="name">
|
||||
{{wallet.name || wallet.id}}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
ng-click="selectWallet(w)"
|
||||
>
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/{{w.network == 'testnet' ? 'icon-wallet-testnet' : (w.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !w.color}" ng-style="{'background-color': w.color}" class="bg">
|
||||
<img ng-src="img/{{w.network == 'testnet' ? 'icon-wallet-testnet' : (w.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !w.color}" ng-style="{'background-color': w.color}" class="bg">
|
||||
</i>
|
||||
<div class="wallet-inner">
|
||||
<div class="wallet-details">
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@
|
|||
<span class="label" translate>From</span>
|
||||
<div class="wallet">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg"/>
|
||||
<img ng-src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg"/>
|
||||
</i>
|
||||
<div>{{wallet.name}}</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<div class="list card" ng-click="showWalletSelector()" ng-if="wallets[0]">
|
||||
<a ng-if="wallet" class="item item-sub item-icon-left item-big-icon-left item-icon-right">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg wallet"/>
|
||||
<img ng-src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg wallet"/>
|
||||
</i>
|
||||
<span>
|
||||
{{wallet.name || wallet.id}}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
<div class="label">From</div>
|
||||
<div class="wallet">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
<img ng-src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
</i>
|
||||
{{wallet ? wallet.name : '...'}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
<div class="label">From</div>
|
||||
<div class="wallet">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
<img ng-src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
</i>
|
||||
{{wallet ? wallet.name : '...'}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,16 @@
|
|||
required>
|
||||
</label>
|
||||
|
||||
<label class="item item-input item-select">
|
||||
<div class="input-label" translate>
|
||||
Coin
|
||||
</div>
|
||||
<select ng-model="formData.coin">
|
||||
<option value="btc">BTC</option>
|
||||
<option value="bch">BCH</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<div class="item item-divider"></div>
|
||||
|
||||
<a class="item" ng-click="showAdvChange()">
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@
|
|||
class="item item-sub item-icon-left item-big-icon-left item-icon-right wallet"
|
||||
ng-click="openWallet(wallet)">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg wallet"/>
|
||||
<img ng-src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg wallet"/>
|
||||
</i>
|
||||
<span>
|
||||
{{wallet.name || wallet.id}}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
<div class="wallet-selector" ng-click="showWalletSelector()" ng-if="wallets[0] && wallet">
|
||||
<a ng-if="wallet" class="item item-sub item-icon-left item-big-icon-left item-icon-right">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg wallet"/>
|
||||
<img ng-src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg wallet"/>
|
||||
</i>
|
||||
<span>
|
||||
{{wallet.name || wallet.id}}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@
|
|||
<div class="list">
|
||||
<a class="item item-icon-left item-icon-right" ng-repeat="item in list" ng-if="hasWallets && item.recipientType == 'wallet'" ng-click="goToAmount(item)">
|
||||
<i class="icon big-icon-svg" ng-if="item.recipientType == 'wallet'">
|
||||
<img src="img/{{item.network == 'testnet' ? 'icon-wallet-testnet' : (item.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !item.color}" ng-style="{'background-color': item.color}" class="bg"/>
|
||||
<img ng-src="img/{{item.network == 'testnet' ? 'icon-wallet-testnet' : (item.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !item.color}" ng-style="{'background-color': item.color}" class="bg"/>
|
||||
</i>
|
||||
{{item.name}}
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@
|
|||
ui-sref="tabs.preferences({'walletId': item.id})"
|
||||
ng-repeat="item in wallets track by $index">
|
||||
<i class="icon big-icon-svg circle">
|
||||
<img src="img/{{item.network == 'testnet' ? 'icon-wallet-testnet' : (item.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !item.color}" ng-style="{'background-color': item.color}" class="bg"/>
|
||||
<img ng-src="img/{{item.network == 'testnet' ? 'icon-wallet-testnet' : (item.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !item.color}" ng-style="{'background-color': item.color}" class="bg"/>
|
||||
</i>
|
||||
<span>
|
||||
{{item.name || item.id}}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<div class="label" translate>From {{wallet.chain}}</div>
|
||||
<div class="wallet">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
<img ng-src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
</i>
|
||||
{{wallet ? wallet.name : '...'}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
<span class="label" ng-if="btx.action !== 'sent'" translate>To</span>
|
||||
<div class="wallet">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg"/>
|
||||
<img ng-src="img/{{wallet.network == 'testnet' ? 'icon-wallet-testnet' : (wallet.chain == 'BTC' ? 'icon-btc' : 'icon-bch')}}.svg" ng-class="{'wallet-background-color-default': !wallet.color}" ng-style="{'background-color': wallet.color}" class="bg"/>
|
||||
</i>
|
||||
<div>{{wallet.name}}</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue