1.0.12 • Published 11 months ago

@thresholdkey/seed-phrase v1.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

tKey Seed Phrase Module

npm version minzip

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.

Installation

npm install --save @thresholdkey/seed-phrase

Initialization

Import the SeedPhraseModule class from @thresholdkey/seed-phrase

import SeedPhraseModule from "@thresholdkey/seed-phrase";

Assign the SeedPhraseModule class to a variable

const seedPhraseModule = new SeedPhraseModule();

Returns

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[]>;
}

Usage

With the SeedPhraseModule, you've access to the following functions:

Set Seed Phrase

setSeedPhrase(seedPhraseType: string, seedPhrase?: string)

  • seedPhraseType: The type of seed phrase to set.
  • seedPhrase: The seed phrase to set.

Set Seed Phrase Store Item

setSeedPhraseStoreItem(partialStore: ISeedPhraseStore)

  • partialStore: The partial store to set.

Get Seed Phrase

getSeedPhrases()

Return

  • Promise<ISeedPhraseStore[]>: A list of seed phrases.

Get Seed Phrase With Accounts

getSeedPhrasesWithAccounts()

Return

  • Promise<ISeedPhraseStoreWithKeys[]>: A list of seed phrases with accounts.
1.0.12

11 months ago

1.0.11

11 months ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago