Skip to content

Commit

Permalink
Merge pull request #53 from leapwallet/add/move-evm-signer
Browse files Browse the repository at this point in the history
pass keytype in custom keygen function
  • Loading branch information
baryon2 authored Dec 24, 2024
2 parents 93a56b1 + 1ff0e55 commit 3f6d0ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/keychain/keychain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class KeyChain {
const pubKeys: Record<string, string> = {};
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;
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/types/keychain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export type ChainInfo = {
customKeygenfn?: (
key: string,
path: string,
keyType: 'privateKey' | 'seedPhrase',
) => Promise<{
address: string;
pubkey: string;
Expand Down

0 comments on commit 3f6d0ab

Please sign in to comment.