diff --git a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js index b1d5fd6cd..3c5ca14de 100644 --- a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js @@ -4,10 +4,9 @@ async function serialSigner(path) { name: 'serial-signer', template: t, - props: ['sats-denominated'], + props: ['sats-denominated', 'network'], data: function () { return { - network: 'Mainnet', // todo: hardcoded for now selectedPort: null, writableStreamClosed: null, writer: null, @@ -463,6 +462,7 @@ async function serialSigner(path) { }, hwwXpub: async function (path) { try { + console.log('### hwwXpub', COMMAND_XPUB + ' ' + this.network + ' ' + path) await this.writer.write( COMMAND_XPUB + ' ' + this.network + ' ' + path + '\n' ) diff --git a/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.js b/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.js index 227dc9556..84bf0db97 100644 --- a/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.js +++ b/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.js @@ -32,22 +32,26 @@ async function walletList(path) { { label: 'Pay-to-pubkey-hash scripts (P2PKH)', value: 'pkh', - path: "m/44'/0'/0'" + pathMainnet: "m/44'/0'/0'", + pathTestnet: "m/44'/1'/0'" }, { label: 'Pay-to-witness-pubkey-hash scripts (P2WPKH)', value: 'wpkh', - path: "m/84'/0'/0'" + pathMainnet: "m/84'/0'/0'", + pathTestnet: "m/84'/1'/0'", }, { label: 'Pay-to-script-hash scripts (P2SH-P2WPKH)', value: 'sh', - path: "m/49'/0'/0'" + pathMainnet: "m/49'/0'/0'", + pathTestnet: "m/49'/1'/0'" }, { label: 'Pay-to-taproot outputs (P2TR)', value: 'tr', - path: "m/86'/0'/0'" + pathMainnet: "m/86'/0'/0'", + pathTestnet: "m/86'/1'/0'" } ], @@ -265,7 +269,7 @@ async function walletList(path) { handleAddressTypeChanged: function (value) { const addressType = this.addressTypeOptions.find(t => t.value === value) || {} - this.accountPath = addressType.path + this.accountPath = addressType[`path${this.network}`] } }, created: async function () { diff --git a/lnbits/extensions/watchonly/templates/watchonly/index.html b/lnbits/extensions/watchonly/templates/watchonly/index.html index ec605e18e..be39ddf4c 100644 --- a/lnbits/extensions/watchonly/templates/watchonly/index.html +++ b/lnbits/extensions/watchonly/templates/watchonly/index.html @@ -10,6 +10,7 @@