1.0.12 • Published 11 months ago

@thresholdkey/chrome-storage v1.0.12

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

tKey Chrome Storage Module

npm version minzip

The tKey Chrome Storage Module helps you store and recall key shares in the chrome extension storage. This module is the part of the tKey SDK.

Installation

npm install --save @thresholdkey/chrome-storage

Initialization

Import the ChromeExtensionStorageModule class from @thresholdkey/chrome-storage

import ChromeExtensionStorageModule from "@thresholdkey/chrome-storage";

Assign the ChromeExtensionStorageModule class to a variable

const chromeStorageModule = new ChromeExtensionStorageModule();

Returns

The ChromeExtensionStorageModule class returns an object with the following properties:

class ChromeExtensionStorageModule implements IModule {
  moduleName: string;
  tbSDK: ITKeyApi;
  constructor();
  setModuleReferences(tbSDK: ITKeyApi): void;
  initialize(): Promise<void>;
  storeDeviceShare(deviceShareStore: ShareStore, customDeviceInfo?: StringifiedType): Promise<void>;
  storeShareOnChromeExtensionStorage(share: ShareStore): Promise<void>;
  getStoreFromChromeExtensionStorage(): Promise<ShareStore>;
  inputShareFromChromeExtensionStorage(): Promise<void>;
}

Usage

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

Storing a Device Share

storeDeviceShare(deviceShareStore, customDeviceInfo?)

  • deviceShareStore: The ShareStore object to store.
  • customDeviceInfo?: Information about the device to store.

ShareStore

class ShareStore implements ISerializable {
  share: Share;
  polynomialID: PolynomialID;
  constructor(share: Share, polynomialID: PolynomialID);
  static fromJSON(value: StringifiedType): ShareStore;
  toJSON(): StringifiedType;
}
interface ISerializable {
  toJSON(): StringifiedType;
}

Storing a Share on Chrome Extension Storage

storeShareOnChromeExtensionStorage(share)

Get a ShareStore from Chrome Extension Storage

getStoreFromChromeExtensionStorage()

Return

1.0.12

11 months ago

1.0.11

11 months ago

1.0.10

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