Skip to main content
Version: near-api-js@1.1.0

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

connect

Hierarchy

Constructors

constructor

new MergeKeyStore(keyStores, options?)

Parameters

NameTypeDescription
keyStoresKeyStore[]read calls are attempted from start to end of array
optionsMergeKeyStoreOptions-

Overrides

KeyStore.constructor

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

KeyStore.clear

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

NameTypeDescription
networkIdstringThe targeted network. (ex. default, betanet, etc…)

Returns

Promise<string[]>

Overrides

KeyStore.getAccounts

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

NameTypeDescription
networkIdstringThe targeted network. (ex. default, betanet, etc…)
accountIdstringThe NEAR account tied to the key pair

Returns

Promise<KeyPair>

Overrides

KeyStore.getKey

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

KeyStore.getNetworks

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

NameTypeDescription
networkIdstringThe targeted network. (ex. default, betanet, etc…)
accountIdstringThe NEAR account tied to the key pair

Returns

Promise<void>

Overrides

KeyStore.removeKey

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

NameTypeDescription
networkIdstringThe targeted network. (ex. default, betanet, etc…)
accountIdstringThe NEAR account tied to the key pair
keyPairKeyPairThe key pair to store in local storage

Returns

Promise<void>

Overrides

KeyStore.setKey

Defined in

key_stores/merge_key_store.ts:62