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.
npm install --save @tkey/chrome-storage
import ChromeExtensionStorageModule from "@tkey/chrome-storage";
const chromeStorageModule = new ChromeExtensionStorageModule();
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>;
}
With the ChromeExtensionStorageModule
, you've access to the following functions:
-
deviceShareStore
: TheShareStore
object to store. -
customDeviceInfo?
: Information about the device to store.
class ShareStore implements ISerializable {
share: Share;
polynomialID: PolynomialID;
constructor(share: Share, polynomialID: PolynomialID);
static fromJSON(value: StringifiedType): ShareStore;
toJSON(): StringifiedType;
}
interface ISerializable {
toJSON(): StringifiedType;
}
-
share
: TheShareStore
object to store.
-
Promise<ShareStore>
: TheShareStore
object.