-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: nicer HWW derivation path selection
- Loading branch information
1 parent
a162f67
commit 0d553ef
Showing
5 changed files
with
227 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
import type { JsonRpcProvider } from "ethers"; | ||
|
||
export const derivationPaths = { | ||
Ethereum: "44'/60'/0'/0/0", | ||
Ethereum: "44'/60'/0'/0", | ||
}; | ||
|
||
export const derivationPathsMainnet = { | ||
RSK: "44'/137'/0'/0/0", | ||
RSK: "44'/137'/0'", | ||
}; | ||
|
||
export const derivationPathsTestnet = { | ||
["RSK Testnet"]: "44'/37310'/0'/0/0", | ||
["RSK Testnet"]: "44'/37310'/0'", | ||
}; | ||
|
||
export type DerivedAddress = { | ||
path: string; | ||
address: string; | ||
}; | ||
|
||
export interface HardwareSigner { | ||
getProvider(): JsonRpcProvider; | ||
|
||
deriveAddresses(basePath: string, limit: number): Promise<DerivedAddress[]>; | ||
|
||
getDerivationPath(): string; | ||
setDerivationPath(path: string): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.