File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
packages/neuron-wallet/src/services/hardware Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import { AccountExtendedPublicKey } from 'models/keys/key'
1212export abstract class Hardware {
1313 public deviceInfo : DeviceInfo
1414 public isConnected : boolean
15- protected defaultAddress = AccountExtendedPublicKey . ckbAccountPath
15+ protected defaultPath = AccountExtendedPublicKey . ckbAccountPath
1616
1717 constructor ( device : DeviceInfo ) {
1818 this . deviceInfo = device
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export default class Ledger extends Hardware {
4646 }
4747
4848 public async getExtendedPublicKey ( ) : Promise < ExtendedPublicKey > {
49- const { public_key, chain_code } = await this . ledgerCKB ! . getWalletExtendedPublicKey ( this . defaultAddress )
49+ const { public_key, chain_code } = await this . ledgerCKB ! . getWalletExtendedPublicKey ( this . defaultPath )
5050 return {
5151 publicKey : public_key ,
5252 chainCode : chain_code
@@ -63,19 +63,19 @@ export default class Ledger extends Hardware {
6363 }
6464
6565 const signature = await this . ledgerCKB ! . signTransaction (
66- path === Address . pathForReceiving ( 0 ) ? this . defaultAddress : path ,
66+ path === Address . pathForReceiving ( 0 ) ? this . defaultPath : path ,
6767 rawTx ,
6868 witnesses ,
6969 context ,
70- this . defaultAddress ,
70+ this . defaultPath ,
7171 )
7272
7373 return signature
7474 }
7575
7676 async signMessage ( path : string , messageHex : string ) {
7777 const message = HexUtils . removePrefix ( messageHex )
78- const signed = await this . ledgerCKB ! . signMessage ( path , message , false )
78+ const signed = await this . ledgerCKB ! . signMessage ( path === Address . pathForReceiving ( 0 ) ? this . defaultPath : path , message , false )
7979 return HexUtils . addPrefix ( signed )
8080 }
8181
You can’t perform that action at this time.
0 commit comments