@herond/tkey
TypeScript icon, indicating that this package has built-in type declarations

1.0.47 • Public • Published

ShareA is stored on the user’s device ShareB is managed and split across Web3Auth's Auth Network ShareC is a recovery share

Usage

import HerondTKey from '@herond/tkey'

const _tKey = new HerondTKey({
    enableLogging: true,
    clientId: 'BHSdp-IiAoEUV6fpvMFZL12WNk0cXKx0-EKdeJBdVCMtG2LBFED-ice9-0xUnwd4o09Qj7PGnidBJJNqXWt4eU4',
    hostUrl: 'https://metadata.tor.us',
    network: 'testnet',
    networkUrl: 'https://small-long-brook.ropsten.quiknode.pro/e2fd2eb01412e80623787d1c40094465aa67624a',
    verifier: 'herond-jwt',
})

res = await tKey.login({
    idToken,
    deviceShare
})

Methods:

Methods Params Response
login Request login to torus network, response shareB if succeed {idToken, inputShare?} LoginResponse{succeed, code, shareDevice, shareEmail}
loginUsingRecoveryShare Need trigger "login" once before run this method, this method does not call to torus network, it simply try to reconstruct key using shareB from previous step and an input share, this can be use to generate new device share {idToken, inputShare, createDeviceShare} LoginResponse{succeed, code, shareDevice, shareEmail}
getSeedPhrases Get seed phrases from storage ISeedPhraseStore[]
generateSeedPhrase Generate new seed phrase with type HD Key Tree {newSeedPhrase: ISeedPhraseStore, seedPhrases: ISeedPhraseStore[]}
setSeedPhrase Add seed phrase to storage seedPhraseType: string, seedPhrase: string {newSeedPhrase: ISeedPhraseStore, seedPhrases: ISeedPhraseStore[]}
deleteSeedPhrase Delete a seed phrase from storage seedPhrase: string ISeedPhraseStore[]
migrateSeedPhrase Merge list of seed phrase with existed in storage seedPhrase: string {newSeedPhrase: ISeedPhraseStore, seedPhrases: ISeedPhraseStore[]}
getPrivateKeys Get additional private keys from storage IPrivateKeyStorage[]
setPrivateKey Add additional private keys to storage {newPrivateKey:IPrivateKeyStorage, privateKeys:IPrivateKeyStorage[]}
deletePrivateKey Delete a seed phrase from storage privateKeyType: string, privateKey: string IPrivateKeyStorage[]
requestShareTransfer Request new share transfer session currentEncPubKeyX: string
getShareTransferFromApproval Get share after approval successfully currentEncPubKeyX: string share: string
getPendingShareTransferRequests Get list of pendding share transfer requests ShareTransferStore[]
approveShareTransfer Approve a share transfer request encPubKeyX: string, userAgent: string

Readme

Keywords

none

Package Sidebar

Install

npm i @herond/tkey

Weekly Downloads

1

Version

1.0.47

License

ISC

Unpacked Size

51.4 kB

Total Files

18

Last publish

Collaborators

  • minhnd410