mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-01-19 05:45:15 +01:00
WIP: preping watch-only wallets
This commit is contained in:
parent
61294450df
commit
67c9e35497
@ -61,7 +61,7 @@ export class HDLegacyBreadwalletWallet extends HDSegwitP2SHWallet {
|
||||
let mnemonic = this.secret;
|
||||
let seed = bip39.mnemonicToSeed(mnemonic);
|
||||
let root = bitcoin.HDNode.fromSeedBuffer(seed);
|
||||
let path = "m/0'/1/" + index;
|
||||
let path = "m/0'/0/" + index;
|
||||
let child = root.derivePath(path);
|
||||
return child.keyPair.toWIF();
|
||||
}
|
||||
|
@ -7,3 +7,4 @@ export * from './segwit-p2sh-wallet';
|
||||
export * from './hd-segwit-p2sh-wallet';
|
||||
export * from './hd-legacy-breadwallet-wallet';
|
||||
export * from './hd-legacy-p2pkh-wallet';
|
||||
export * from './watch-only-wallet';
|
||||
|
24
class/watch-only-wallet.js
Normal file
24
class/watch-only-wallet.js
Normal file
@ -0,0 +1,24 @@
|
||||
import { LegacyWallet } from './legacy-wallet';
|
||||
|
||||
export class WatchOnlyWallet extends LegacyWallet {
|
||||
constructor() {
|
||||
super();
|
||||
this.type = 'watchOnly';
|
||||
}
|
||||
|
||||
getTypeReadable() {
|
||||
return 'Watch-only';
|
||||
}
|
||||
|
||||
allowSend() {
|
||||
return false;
|
||||
}
|
||||
|
||||
getAddress() {
|
||||
return this.secret;
|
||||
}
|
||||
|
||||
createTx(utxos, amount, fee, toAddress, memo) {
|
||||
throw new Error('Not supported');
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user