@ton-keychain/core
Version:
SDK for creating multi account mnemonics
39 lines (35 loc) • 1.49 kB
TypeScript
declare class KeychainTonAccount {
readonly mnemonics: string[];
readonly privateKey: string;
readonly publicKey: string;
readonly entropy: Buffer;
static MNEMONICS_WORDS_NUMBER: number;
static fromMnemonic(mnemonics: string[]): Promise<KeychainTonAccount>;
constructor(mnemonics: string[], privateKey: string, publicKey: string, entropy: Buffer);
}
declare class TonKeychainRoot {
readonly mnemonic: string[];
readonly id: string;
private static ID_PREFIX;
static generate(wordsCount?: number): Promise<TonKeychainRoot>;
static fromMnemonic(mnemonic: string[], options?: {
allowLegacyMnemonic?: boolean;
}): Promise<TonKeychainRoot>;
/**
* @description DANGER
* Should only be used to process legacy already created mnemonics
* @param mnemonic
*/
static isValidMnemonicLegacy(mnemonic: string[]): Promise<boolean>;
static isValidMnemonic(mnemonic: string[]): Promise<boolean>;
private static calculateId;
private ACCOUNT_LABEL;
private SUB_ROOT_ACCOUNT_LABEL;
private constructor();
getTonAccount: (index: number) => Promise<KeychainTonAccount>;
getSubRootAccount: (index: number) => Promise<TonKeychainRoot>;
private entropyToTonCompatibleSeed;
private entropyToRootCompatibleSeed;
}
declare function getNthAccountTon(rootMnemonic: string[], childIndex: number): Promise<KeychainTonAccount>;
export { KeychainTonAccount, TonKeychainRoot, getNthAccountTon };