This commit is contained in:
Overtorment 2018-07-14 21:15:55 +01:00
parent 7ba781db51
commit 74f0226c15
2 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,5 @@
import { AsyncStorage } from 'react-native';
import { LegacyWallet, SegwitP2SHWallet, SegwitBech32Wallet } from './';
import { WatchOnlyWallet, LegacyWallet, SegwitP2SHWallet, SegwitBech32Wallet } from './';
let encryption = require('../encryption');
export class AppStorage {
@ -127,6 +127,9 @@ export class AppStorage {
case 'segwitP2SH':
unserializedWallet = SegwitP2SHWallet.fromJson(key);
break;
case 'watchOnly':
unserializedWallet = WatchOnlyWallet.fromJson(key);
break;
case 'legacy':
default:
unserializedWallet = LegacyWallet.fromJson(key);

View File

@ -92,7 +92,7 @@ export class LegacyWallet extends AbstractWallet {
);
let json = response.body;
if (typeof json === 'undefined' || typeof json.final_balance === 'undefined') {
throw new Error('Could not fetch UTXO from API' + response.err);
throw new Error('Could not fetch balance from API: ' + response.err + ' ' + JSON.stringify(response.body));
}
this.balance = new BigNumber(json.final_balance);