The tKey Seed Phrase Module helps you add or remove the and password as a share for tkey. This module is the part of the tKey SDK.
npm install --save @tkey/seed-phrase
import SeedPhraseModule from "@tkey/seed-phrase";
const seedPhraseModule = new SeedPhraseModule();
The SeedPhraseModule
class returns an object with the following properties:
declare class SeedPhraseModule implements IModule {
moduleName: string;
tbSDK: ITKeyApi;
seedPhraseFormats: ISeedPhraseFormat[];
constructor(formats: ISeedPhraseFormat[]);
setModuleReferences(tbSDK: ITKeyApi): void;
initialize(): Promise<void>;
setSeedPhrase(seedPhraseType: string, seedPhrase?: string): Promise<void>;
setSeedPhraseStoreItem(partialStore: ISeedPhraseStore): Promise<void>;
CRITICAL_changeSeedPhrase(oldSeedPhrase: string, newSeedPhrase: string): Promise<void>;
getSeedPhrases(): Promise<ISeedPhraseStore[]>;
getSeedPhrasesWithAccounts(): Promise<ISeedPhraseStoreWithKeys[]>;
getAccounts(): Promise<BN[]>;
}
With the SeedPhraseModule
, you've access to the following functions:
-
seedPhraseType
: The type of seed phrase to set. -
seedPhrase
: The seed phrase to set.
-
partialStore
: The partial store to set.
-
Promise<ISeedPhraseStore[]>
: A list of seed phrases.
-
Promise<ISeedPhraseStoreWithKeys[]>
: A list of seed phrases with accounts.