Class: MergeKeyStore
key_stores/merge_key_store.MergeKeyStore
KeyStores are passed to Near via NearConfig and are used by the InMemorySigner to sign transactions.
See
Hierarchy
↳
MergeKeyStore
Constructors
constructor
new MergeKeyStore(keyStores, options?)
Parameters
| Name | Type | Description |
|---|---|---|
keyStores | KeyStore[] | read calls are attempted from start to end of array |
options | MergeKeyStoreOptions | - |
Overrides
Defined in
key_stores/merge_key_store.ts:50
Properties
keyStores
keyStores: KeyStore[]
Defined in
key_stores/merge_key_store.ts:44
options
Private options: MergeKeyStoreOptions
Defined in
key_stores/merge_key_store.ts:43
Methods
clear
clear(): Promise<void>
Removes all items from each key store
Returns
Promise<void>
Overrides
Defined in
key_stores/merge_key_store.ts:96
getAccounts
getAccounts(networkId): Promise<string[]>
Gets the account(s) from the array of key stores
Parameters
| Name | Type | Description |
|---|---|---|
networkId | string | The targeted network. (ex. default, betanet, etc…) |
Returns
Promise<string[]>
Overrides
Defined in
key_stores/merge_key_store.ts:120
getKey
getKey(networkId, accountId): Promise<KeyPair>
Gets a KeyPair from the array of key stores
Parameters
| Name | Type | Description |
|---|---|---|
networkId | string | The targeted network. (ex. default, betanet, etc…) |
accountId | string | The NEAR account tied to the key pair |
Returns
Promise<KeyPair>
Overrides
Defined in
key_stores/merge_key_store.ts:72
getNetworks
getNetworks(): Promise<string[]>
Get the network(s) from the array of key stores
Returns
Promise<string[]>
Overrides
Defined in
key_stores/merge_key_store.ts:106
removeKey
removeKey(networkId, accountId): Promise<void>
Removes a KeyPair from the array of key stores
Parameters
| Name | Type | Description |
|---|---|---|
networkId | string | The targeted network. (ex. default, betanet, etc…) |
accountId | string | The NEAR account tied to the key pair |
Returns
Promise<void>
Overrides
Defined in
key_stores/merge_key_store.ts:87
setKey
setKey(networkId, accountId, keyPair): Promise<void>
Store a KeyPair to the first index of a key store array
Parameters
| Name | Type | Description |
|---|---|---|
networkId | string | The targeted network. (ex. default, betanet, etc…) |
accountId | string | The NEAR account tied to the key pair |
keyPair | KeyPair | The key pair to store in local storage |
Returns
Promise<void>