diff --git a/package.json b/package.json index d42a9d3..8b071dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@leapwallet/leap-keychain", - "version": "0.3.3-beta.1", + "version": "0.3.3-beta.2", "description": "A javascript library for crypto key management", "scripts": { "test:coverage": "nyc mocha", diff --git a/src/keychain/keychain.ts b/src/keychain/keychain.ts index ba8f721..2cf1a6c 100644 --- a/src/keychain/keychain.ts +++ b/src/keychain/keychain.ts @@ -118,7 +118,7 @@ export class KeyChain { const pubKeys: Record = {}; for (const chainInfo of chainInfos) { if (chainInfo.customKeygenfn) { - const key = await chainInfo.customKeygenfn(privateKey, getFullHDPath('44', chainInfo.coinType)); + const key = await chainInfo.customKeygenfn(privateKey, getFullHDPath('44', chainInfo.coinType), 'privateKey'); addresses[chainInfo.key] = key.address; pubKeys[chainInfo.key] = key.pubkey; continue; @@ -324,6 +324,7 @@ export class KeyChain { const key = await chainInfo.customKeygenfn( mnemonic, getFullHDPath(purpose, chainInfo.coinType, addressIndex.toString()), + 'seedPhrase', ); addresses[chainInfo.key] = key.address; pubKeys[chainInfo.key] = key.pubkey; diff --git a/src/types/keychain.ts b/src/types/keychain.ts index bf1f3f2..c6a2fa3 100644 --- a/src/types/keychain.ts +++ b/src/types/keychain.ts @@ -39,6 +39,7 @@ export type ChainInfo = { customKeygenfn?: ( key: string, path: string, + keyType: 'privateKey' | 'seedPhrase', ) => Promise<{ address: string; pubkey: string;