fix: testnet is in the bip32 derivation path
This commit is contained in:
parent
2ac8ee95b0
commit
f202d80241
3 changed files with 12 additions and 7 deletions
|
|
@ -4,10 +4,9 @@ async function serialSigner(path) {
|
||||||
name: 'serial-signer',
|
name: 'serial-signer',
|
||||||
template: t,
|
template: t,
|
||||||
|
|
||||||
props: ['sats-denominated'],
|
props: ['sats-denominated', 'network'],
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
network: 'Mainnet', // todo: hardcoded for now
|
|
||||||
selectedPort: null,
|
selectedPort: null,
|
||||||
writableStreamClosed: null,
|
writableStreamClosed: null,
|
||||||
writer: null,
|
writer: null,
|
||||||
|
|
@ -463,6 +462,7 @@ async function serialSigner(path) {
|
||||||
},
|
},
|
||||||
hwwXpub: async function (path) {
|
hwwXpub: async function (path) {
|
||||||
try {
|
try {
|
||||||
|
console.log('### hwwXpub', COMMAND_XPUB + ' ' + this.network + ' ' + path)
|
||||||
await this.writer.write(
|
await this.writer.write(
|
||||||
COMMAND_XPUB + ' ' + this.network + ' ' + path + '\n'
|
COMMAND_XPUB + ' ' + this.network + ' ' + path + '\n'
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -32,22 +32,26 @@ async function walletList(path) {
|
||||||
{
|
{
|
||||||
label: 'Pay-to-pubkey-hash scripts (P2PKH)',
|
label: 'Pay-to-pubkey-hash scripts (P2PKH)',
|
||||||
value: 'pkh',
|
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)',
|
label: 'Pay-to-witness-pubkey-hash scripts (P2WPKH)',
|
||||||
value: 'wpkh',
|
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)',
|
label: 'Pay-to-script-hash scripts (P2SH-P2WPKH)',
|
||||||
value: 'sh',
|
value: 'sh',
|
||||||
path: "m/49'/0'/0'"
|
pathMainnet: "m/49'/0'/0'",
|
||||||
|
pathTestnet: "m/49'/1'/0'"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Pay-to-taproot outputs (P2TR)',
|
label: 'Pay-to-taproot outputs (P2TR)',
|
||||||
value: 'tr',
|
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) {
|
handleAddressTypeChanged: function (value) {
|
||||||
const addressType =
|
const addressType =
|
||||||
this.addressTypeOptions.find(t => t.value === value) || {}
|
this.addressTypeOptions.find(t => t.value === value) || {}
|
||||||
this.accountPath = addressType.path
|
this.accountPath = addressType[`path${this.network}`]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created: async function () {
|
created: async function () {
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
<template v-slot:serial>
|
<template v-slot:serial>
|
||||||
<serial-signer
|
<serial-signer
|
||||||
ref="serialSigner"
|
ref="serialSigner"
|
||||||
|
:network="config.network"
|
||||||
:sats-denominated="config.sats_denominated"
|
:sats-denominated="config.sats_denominated"
|
||||||
@signed:psbt="updateSignedPsbt"
|
@signed:psbt="updateSignedPsbt"
|
||||||
></serial-signer>
|
></serial-signer>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue