ethers.js/packages/hdnode/lib.esm/index.d.ts

43 lines
1.9 KiB
TypeScript
Raw Permalink Normal View History

2019-05-14 18:48:48 -04:00
import { ExternallyOwnedAccount } from "@ethersproject/abstract-signer";
import { BytesLike } from "@ethersproject/bytes";
2019-06-12 09:38:15 -04:00
import { Wordlist } from "@ethersproject/wordlists";
2019-05-14 18:48:48 -04:00
export declare const defaultPath = "m/44'/60'/0'/0/0";
2020-01-18 21:48:12 -05:00
export interface Mnemonic {
readonly phrase: string;
readonly path: string;
readonly locale: string;
}
2019-05-14 18:48:48 -04:00
export declare class HDNode implements ExternallyOwnedAccount {
readonly privateKey: string;
readonly publicKey: string;
readonly fingerprint: string;
readonly parentFingerprint: string;
readonly address: string;
2020-01-18 21:48:12 -05:00
readonly mnemonic?: Mnemonic;
2019-05-14 18:48:48 -04:00
readonly path: string;
readonly chainCode: string;
readonly index: number;
readonly depth: number;
/**
* This constructor should not be called directly.
*
* Please use:
* - fromMnemonic
* - fromSeed
*/
2020-01-18 21:48:12 -05:00
constructor(constructorGuard: any, privateKey: string, publicKey: string, parentFingerprint: string, chainCode: string, index: number, depth: number, mnemonicOrPath: Mnemonic | string);
get extendedKey(): string;
2019-05-14 18:48:48 -04:00
neuter(): HDNode;
private _derive;
derivePath(path: string): HDNode;
2020-01-18 21:48:12 -05:00
static _fromSeed(seed: BytesLike, mnemonic: Mnemonic): HDNode;
static fromMnemonic(mnemonic: string, password?: string, wordlist?: string | Wordlist): HDNode;
2019-05-14 18:48:48 -04:00
static fromSeed(seed: BytesLike): HDNode;
static fromExtendedKey(extendedKey: string): HDNode;
}
export declare function mnemonicToSeed(mnemonic: string, password?: string): string;
2020-01-18 21:48:12 -05:00
export declare function mnemonicToEntropy(mnemonic: string, wordlist?: string | Wordlist): string;
export declare function entropyToMnemonic(entropy: BytesLike, wordlist?: string | Wordlist): string;
2019-05-14 18:48:48 -04:00
export declare function isValidMnemonic(mnemonic: string, wordlist?: Wordlist): boolean;
2021-05-17 16:19:36 -04:00
export declare function getAccountPath(index: number): string;
//# sourceMappingURL=index.d.ts.map