Skip to content

Commit

Permalink
chore: expose slip utils
Browse files Browse the repository at this point in the history
  • Loading branch information
0xApotheosis committed Apr 30, 2024
1 parent 524a578 commit 338f776
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/hdwallet-core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export function base64toHEX(base64: string): string {
}

// https://github.com/satoshilabs/slips/blob/master/slip-0044.md
const slip44Table = Object.freeze({
export const slip44Table = Object.freeze({
Bitcoin: 0,
Testnet: 1,
BitcoinCash: 145,
Expand Down Expand Up @@ -159,7 +159,9 @@ const slip44Table = Object.freeze({
Arbitrum: 60,
ArbitrumNova: 60,
} as const);
type Slip44ByCoin<T> = T extends keyof typeof slip44Table ? typeof slip44Table[T] : number | undefined;

export type Slip44ByCoin<T> = T extends keyof typeof slip44Table ? typeof slip44Table[T] : number | undefined;

export function slip44ByCoin<T extends Coin>(coin: T): Slip44ByCoin<T> {
return (slip44Table as any)[coin];
}
Expand Down

0 comments on commit 338f776

Please sign in to comment.