ethers.js/packages/wallet/lib/hdwallet.d.ts
2022-04-11 17:14:19 -04:00

60 lines
2.7 KiB
TypeScript

import { VoidSigner } from "@ethersproject/providers";
import { SigningKey } from "@ethersproject/signing-key";
import { Mnemonic } from "./mnemonic.js";
import { BaseWallet } from "./base-wallet.js";
import type { BytesLike, Numeric } from "@ethersproject/logger";
import type { Provider } from "@ethersproject/providers";
import type { Wordlist } from "@ethersproject/wordlists";
export declare const defaultPath = "m/44'/60'/0'/0/0";
export interface HDNodeWithPath {
path: string;
}
export declare class HDNodeWallet extends BaseWallet {
#private;
readonly publicKey: string;
readonly fingerprint: string;
readonly parentFingerprint: string;
readonly mnemonic: null | Mnemonic;
readonly chainCode: string;
readonly path: null | string;
readonly index: number;
readonly depth: number;
constructor(guard: any, signingKey: SigningKey, parentFingerprint: string, chainCode: string, path: null | string, index: number, depth: number, mnemonic: null | Mnemonic, provider: null | Provider);
connect(provider: null | Provider): HDNodeWallet;
get extendedKey(): string;
hasPath(): this is {
path: string;
};
neuter(): HDNodeVoidWallet;
deriveChild(_index: Numeric): HDNodeWallet;
derivePath(path: string): HDNodeWallet;
static fromSeed(seed: BytesLike): HDNodeWallet;
static fromPhrase(phrase: string, password?: string, path?: null | string, wordlist?: Wordlist): HDNodeWallet;
static fromMnemonic(mnemonic: Mnemonic, path?: null | string): HDNodeWallet;
static fromExtendedKey(extendedKey: string): HDNodeWallet | HDNodeVoidWallet;
static createRandom(password?: string, path?: null | string, wordlist?: Wordlist): HDNodeWallet;
}
export declare class HDNodeVoidWallet extends VoidSigner {
readonly publicKey: string;
readonly fingerprint: string;
readonly parentFingerprint: string;
readonly chainCode: string;
readonly path: null | string;
readonly index: number;
readonly depth: number;
constructor(guard: any, address: string, publicKey: string, parentFingerprint: string, chainCode: string, path: null | string, index: number, depth: number, provider: null | Provider);
connect(provider: null | Provider): HDNodeVoidWallet;
get extendedKey(): string;
hasPath(): this is {
path: string;
};
deriveChild(_index: Numeric): HDNodeVoidWallet;
derivePath(path: string): HDNodeVoidWallet;
}
export declare class HDNodeWalletManager {
#private;
constructor(phrase: string, password?: string, path?: string, locale?: Wordlist);
getSigner(index?: number): HDNodeWallet;
}
export declare function getAccountPath(_index: Numeric): string;
//# sourceMappingURL=hdwallet.d.ts.map