@celo/keystores › "inmemory-keystore" › InMemoryKeystore
Class: InMemoryKeystore
Hierarchy
↳ InMemoryKeystore
Index
Methods
- changeKeystorePassphrase
- deleteKeystore
- getAddress
- getAddressMap
- getAllKeystoreNames
- getKeystoreName
- getPrivateKey
- getRawKeystore
- importPrivateKey
- listKeystoreAddresses
- persistKeystore
- removeKeystore
Methods
changeKeystorePassphrase
▸ changeKeystorePassphrase(address
: string, oldPassphrase
: string, newPassphrase
: string): Promise‹void›
Inherited from KeystoreBase.changeKeystorePassphrase
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›
Inherited from KeystoreBase.deleteKeystore
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
Inherited from KeystoreBase.getAddress
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››
Inherited from KeystoreBase.getAddressMap
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
getAllKeystoreNames
▸ getAllKeystoreNames(): Promise‹string[]›
Overrides KeystoreBase.getAllKeystoreNames
Defined in inmemory-keystore.ts:18
Returns: Promise‹string[]›
getKeystoreName
▸ getKeystoreName(address
: string): Promise‹string›
Inherited from KeystoreBase.getKeystoreName
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›
Inherited from KeystoreBase.getPrivateKey
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›
getRawKeystore
▸ getRawKeystore(keystoreName
: string): string
Overrides KeystoreBase.getRawKeystore
Defined in inmemory-keystore.ts:14
Parameters:
Name | Type |
---|---|
keystoreName |
string |
Returns: string
importPrivateKey
▸ importPrivateKey(privateKey
: string, passphrase
: string): Promise‹void›
Inherited from KeystoreBase.importPrivateKey
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[]›
Inherited from KeystoreBase.listKeystoreAddresses
Defined in keystore-base.ts:64
Gets a list of all account addresses in the keystore
Returns: Promise‹string[]›
List of account address strings
persistKeystore
▸ persistKeystore(keystoreName
: string, keystore
: string): void
Overrides KeystoreBase.persistKeystore
Defined in inmemory-keystore.ts:10
Parameters:
Name | Type |
---|---|
keystoreName |
string |
keystore |
string |
Returns: void
removeKeystore
▸ removeKeystore(keystoreName
: string): void
Overrides KeystoreBase.removeKeystore
Defined in inmemory-keystore.ts:22
Parameters:
Name | Type |
---|---|
keystoreName |
string |
Returns: void