@oraichain/share-serialization v2.0.2-beta.0
oKey Share Serialization Module
The Share Serialization Module helps you add or remove the and password as a share for oKey. This module is the part of the oKey SDK.
Installation
npm install --save @oraichain/share-serialization
Initialization
Import the ShareSerializationModule
class from @oraichain/share-serialization
import ShareSerializationModule from "@oraichain/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.
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago