From b6f36a658d3dfeed3f451d348614e32521bb3a3a Mon Sep 17 00:00:00 2001 From: Kadir Sekha Date: Thu, 19 Oct 2017 17:53:30 +0900 Subject: [PATCH] convert tarascash style bitcoin cash wallet to copay style bitcoin cash wallet --- src/js/services/profileService.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index af6f43582..a03d5f630 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -72,8 +72,22 @@ angular.module('copayApp.services') return cb(hideBalance); }); }; + + // Convert tarascash style bch wallet to copay style + function convertToNewCashWallet(wallet) { + var baseUrl = bwcService.getClient(null, null).baseUrl; + wallet.baseUrl = baseUrl; + wallet.credentials.coin = 'bch'; + wallet.credentials.network = 'livenet'; + } + // Adds a wallet client to profileService root.bindWalletClient = function(wallet, opts) { + + if (wallet.credentials.network == 'bcclivenet') { + convertToNewCashWallet(wallet); + } + var opts = opts || {}; var walletId = wallet.credentials.walletId;