Fix hdPaths runtime error with proper defaultOptions and options merging
This commit is contained in:
parent
7da03ad80f
commit
cdaadd4ed0
@ -91,7 +91,11 @@ export class DirectSecp256k1HdWallet implements OfflineDirectSigner {
|
||||
private readonly accounts: readonly Secp256k1Derivation[];
|
||||
|
||||
protected constructor(mnemonic: EnglishMnemonic, options: DirectSecp256k1HdWalletConstructorOptions) {
|
||||
const { seed, hdPaths, prefix } = { ...defaultOptions, ...options };
|
||||
const { seed, hdPaths, prefix } = {
|
||||
seed: options.seed,
|
||||
prefix: options.prefix ?? defaultOptions.prefix,
|
||||
hdPaths: options.hdPaths ?? defaultOptions.hdPaths,
|
||||
};
|
||||
this.secret = mnemonic;
|
||||
this.seed = seed;
|
||||
this.accounts = hdPaths.map((hdPath) => ({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user