Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@tkey/share-transfer
Advanced tools
The Share Transfer 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/share-transfer
ShareTransferModule
class from @tkey/share-transfer
import ShareTransferModule from "@tkey/share-transfer";
ShareTransferModule
class to a variableconst shareTransferModule = new ShareTransferModule();
The ShareTransferModule
class returns an object with the following properties:
declare class ShareTransferModule implements IModule {
moduleName: string;
tbSDK: ITKeyApi;
currentEncKey: BN;
requestStatusCheckId: number;
requestStatusCheckInterval: number;
constructor();
static refreshShareTransferMiddleware(
generalStore: unknown,
oldShareStores: ShareStoreMap,
newShareStores: ShareStoreMap
): ShareTransferStorePointer;
setModuleReferences(tbSDK: ITKeyApi): void;
setRequestStatusCheckInterval(interval: number): void;
initialize(): Promise<void>;
requestNewShare(
userAgent: string,
availableShareIndexes: Array<string>,
callback?: (err?: ITkeyError, shareStore?: ShareStore) => void
): Promise<string>;
addCustomInfoToShareRequest(encPubKeyX: string, customInfo: string): Promise<void>;
lookForRequests(): Promise<Array<string>>;
approveRequest(encPubKeyX: string, shareStore?: ShareStore): Promise<void>;
approveRequestWithShareIndex(encPubKeyX: string, shareIndex: string): Promise<void>;
getShareTransferStore(): Promise<ShareTransferStore>;
setShareTransferStore(shareTransferStore: ShareTransferStore): Promise<void>;
startRequestStatusCheck(encPubKeyX: string, deleteRequestAfterCompletion: boolean): Promise<ShareStore>;
cancelRequestStatusCheck(): Promise<void>;
deleteShareTransferStore(encPubKey: string): Promise<void>;
resetShareTransferStore(): Promise<void>;
private _cleanUpCurrentRequest;
}
With the ShareTransferModule
, you've access to the following functions:
requestNewShare(userAgent: string, availableShareIndexes: Array<string>, callback?: (err?: ITkeyError, shareStore?: ShareStore) => void)
userAgent
: The user agent of the client that is requesting a new share.availableShareIndexes
: An array of share indexes that are available for the client.callback
: A callback function that is called when the request is complete.Promise<string>
: Share index of the new share.addCustomInfoToShareRequest(encPubKeyX: string, customInfo: string)
encPubKeyX
: The public key of the share that is being requested.customInfo
: The custom info that is being added to the share request.lookForRequests()
Promise<Array<string>>
: An array of indexes of pending requestsapproveRequest(encPubKeyX: string, shareStore?: ShareStore)
encPubKeyX
: The public key of the share that is being approved.shareStore
: The share store that is being approved.approveRequestWithShareIndex(encPubKeyX: string, shareIndex: string)
encPubKeyX
: The public key of the share that is being approved.shareIndex
: The share index that is being approved.getShareTransferStore()
Promise<ShareTransferStore>
: The share transfer store.setShareTransferStore(shareTransferStore: ShareTransferStore)
shareTransferStore
: The share transfer store.startRequestStatusCheck(encPubKeyX: string, deleteRequestAfterCompletion: boolean)
encPubKeyX
: The public key of the share that is being checked.deleteRequestAfterCompletion
: Whether or not to delete the request after it is completed.Promise<ShareStore>
: The share store.cancelRequestStatusCheck()
deleteShareTransferStore(encPubKey: string)
encPubKey
: The public key of the share that is being deleted.resetShareTransferStore()
FAQs
TKey Share Transfer Module
We found that @tkey/share-transfer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.