The tKey Private Key Module helps you add or remove the and password as a share for tkey. This module is the part of the tKey SDK.
npm install --save @tkey-mpc/private-keys
import PrivateKeyModule from "@tkey-mpc/private-keys";
const privateKeyModule = new PrivateKeyModule();
The PrivateKeyModule
class returns an object with the following properties:
declare class PrivateKeyModule implements IModule {
moduleName: string;
tbSDK: ITKeyApi;
privateKeyFormats: IPrivateKeyFormat[];
constructor(formats: IPrivateKeyFormat[]);
setModuleReferences(tbSDK: ITKeyApi): void;
initialize(): Promise<void>;
setPrivateKey(privateKeyType: string, privateKey?: BN): Promise<void>;
getPrivateKeys(): Promise<IPrivateKeyStore[]>;
getAccounts(): Promise<BN[]>;
}
With the PrivateKeyModule
, you've access to the following functions:
-
privateKeyType
: The type of private key to set. -
privateKey
: The private key to set.
-
Promise<IPrivateKeyStore[]>
- The private keys stored.