@celo/keystores"keystore-base"KeystoreBase

Class: KeystoreBase

Hierarchy

  • KeystoreBase

FileKeystore

InMemoryKeystore

Index

Methods

Methods

changeKeystorePassphrase

changeKeystorePassphrase(address: string, oldPassphrase: string, newPassphrase: string): Promise‹void›

Defined in keystore-base.ts:132

Change secret phrase used to encrypt the private key of an address

Parameters:

Name Type Description
address string Account address
oldPassphrase string Secret phrase used to encrypt the private key
newPassphrase string New secret phrase to re-encrypt the private key

Returns: Promise‹void›


deleteKeystore

deleteKeystore(address: string): Promise‹void›

Defined in keystore-base.ts:145

Permanently removes keystore entry from keystore

Parameters:

Name Type Description
address string Account address of keystore to be deleted

Returns: Promise‹void›


getAddress

getAddress(keystoreName: string): string

Defined in keystore-base.ts:51

Gets the address corresponding to a particular keystore entry

Parameters:

Name Type Description
keystoreName string Name of keystore entry belonging to the address

Returns: string

Account address


getAddressMap

getAddressMap(): Promise‹Record‹string, string››

Defined in keystore-base.ts:72

Maps account addresses to their respective keystore entries (names)

Returns: Promise‹Record‹string, string››

Record with account addresses as keys, keystore entry names as values


Abstract getAllKeystoreNames

getAllKeystoreNames(): Promise‹string[]›

Defined in keystore-base.ts:38

Gets a list of the names of each entry in the keystore

Returns: Promise‹string[]›


getKeystoreName

getKeystoreName(address: string): Promise‹string›

Defined in keystore-base.ts:106

Gets name of keystore entry corresponding to an address

Parameters:

Name Type Description
address string Account address

Returns: Promise‹string›

Name of corresponding keystore entry


getPrivateKey

getPrivateKey(address: string, passphrase: string): Promise‹string›

Defined in keystore-base.ts:120

Gets decrypted (plaintext) private key for an account address

Parameters:

Name Type Description
address string Account address
passphrase string Secret phrase used to encrypt the private key

Returns: Promise‹string›


Abstract getRawKeystore

getRawKeystore(keystoreName: string): string

Defined in keystore-base.ts:33

Returns raw encrypted keystore entry string by name

Parameters:

Name Type Description
keystoreName string Name of keystore entry to retrieve

Returns: string


importPrivateKey

importPrivateKey(privateKey: string, passphrase: string): Promise‹void›

Defined in keystore-base.ts:86

Encrypts and stores a private key as a new keystore entry

Parameters:

Name Type Description
privateKey string Private key to encrypted
passphrase string Secret string to encrypt private key

Returns: Promise‹void›


listKeystoreAddresses

listKeystoreAddresses(): Promise‹string[]›

Defined in keystore-base.ts:64

Gets a list of all account addresses in the keystore

Returns: Promise‹string[]›

List of account address strings


Abstract persistKeystore

persistKeystore(keystoreName: string, keystore: string): void

Defined in keystore-base.ts:27

Saves encrypted keystore entry (i.e. to disk, database, ...). Must be implemented by subclass.

Parameters:

Name Type Description
keystoreName string Name of keystore entry to be saved
keystore string encrypted V3Keystore string entry

Returns: void


Abstract removeKeystore

removeKeystore(keystoreName: string): void

Defined in keystore-base.ts:44

Removes keystore entry from keystore permanently

Parameters:

Name Type Description
keystoreName string Name of keystore entry to remove

Returns: void