10.0.0 • Published 8 months ago

@tkey-mpc/share-serialization v10.0.0

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

tKey Share Serialization Module

npm version minzip

The Share Serialization 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 @tkey-mpc/share-serialization

Initialization

Import the ShareSerializationModule class from @tkey-mpc/share-serialization

import ShareSerializationModule from "@tkey-mpc/share-serialization";

Assign the ShareSerializationModule class to a variable

const shareSerializationModule = new ShareSerializationModule();

Returns

The ShareSerializationModule class returns an object with the following properties:

declare class ShareSerializationModule implements IModule {
  moduleName: string;
  tbSDK: ITKeyApi;
  constructor();
  static serializeMnemonic(share: BN): string;
  static deserializeMnemonic(share: string): BN;
  setModuleReferences(tbSDK: ITKeyApi): void;
  initialize(): Promise<void>;
  serialize(share: BN, type: string): Promise<unknown>;
  deserialize(serializedShare: unknown, type: string): Promise<BN>;
}

Usage

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

Serialize a share

serialize(share: BN, type: string)

  • share: The share to serialize.
  • type: The type of share to serialize.

Deserialize a share

deserialize(serializedShare: unknown, type: string)

Return

  • Promise<BN>: The deserialized share.
9.2.3

9 months ago

10.0.0

8 months ago

10.0.0-alpha.0

9 months ago

9.2.0

1 year ago

9.1.0

1 year ago

9.0.2

2 years ago

9.0.1

2 years ago

9.0.0

2 years ago

8.2.2

2 years ago

8.2.0

2 years ago

8.1.0

2 years ago