import { KeyPair } from '@meer-js/crypto'; import { KeyStore } from './keystore.js'; /** * Simple in-memory keystore for mainly for testing purposes. * * @see [https://docs.near.org/docs/develop/front-end/naj-quick-reference#key-store](https://docs.near.org/docs/develop/front-end/naj-quick-reference#key-store) * @example * ```js * import { connect, keyStores, utils } from 'meer-api-js'; * * const privateKey = '.......'; * const keyPair = utils.KeyPair.fromString(privateKey); * * const keyStore = new keyStores.InMemoryKeyStore(); * keyStore.setKey('testnet', 'example-account.testnet', keyPair); * * const config = { * keyStore, // instance of InMemoryKeyStore * networkId: 'testnet', * nodeUrl: 'https://rpc.testnet.near.org', * walletUrl: 'https://wallet.testnet.near.org', * helperUrl: 'https://helper.testnet.near.org', * explorerUrl: 'https://explorer.testnet.near.org' * }; * * // inside an async function * const near = await connect(config) * ``` */ export declare class InMemoryKeyStore extends KeyStore { /** @hidden */ private keys; constructor(); /** * Stores a {@link KeyPair} in in-memory storage item * @param networkId The targeted network. (ex. default, betanet, etc…) * @param accountId The NEAR account tied to the key pair * @param keyPair The key pair to store in local storage */ setKey(networkId: string, accountId: string, keyPair: KeyPair): Promise; /** * Gets a {@link KeyPair} from in-memory storage * @param networkId The targeted network. (ex. default, betanet, etc…) * @param accountId The NEAR account tied to the key pair * @returns {Promise} */ getKey(networkId: string, accountId: string): Promise; /** * Removes a {@link KeyPair} from in-memory storage * @param networkId The targeted network. (ex. default, betanet, etc…) * @param accountId The NEAR account tied to the key pair */ removeKey(networkId: string, accountId: string): Promise; /** * Removes all {@link KeyPair} from in-memory storage */ clear(): Promise; /** * Get the network(s) from in-memory storage * @returns {Promise} */ getNetworks(): Promise; /** * Gets the account(s) from in-memory storage * @param networkId The targeted network. (ex. default, betanet, etc…) */ getAccounts(networkId: string): Promise; /** @hidden */ toString(): string; } //# sourceMappingURL=in_memory_key_store.d.ts.map