UNPKG

@metamask/keyring-snap-client

Version:
29 lines 1.46 kB
import type { KeyringAccount, KeyringRequest } from "@metamask/keyring-api"; import { KeyringRpcMethod } from "@metamask/keyring-api/v2"; import type { CreateAccountOptions, ExportAccountOptions, ExportedAccount, KeyringRpc, KeyringRpcRequest } from "@metamask/keyring-api/v2"; import type { AccountId } from "@metamask/keyring-utils"; import type { Json } from "@metamask/utils"; import type { Sender } from "../KeyringClient.cjs"; export declare class KeyringClient implements KeyringRpc { #private; /** * Create a new instance of `KeyringClient`. * * @param sender - The `Sender` instance to use to send requests to the snap. */ constructor(sender: Sender); /** * Send a request to the Snap and return the response. * * @param request - A partial JSON-RPC request (method and params). * @returns A promise that resolves to the response to the request. */ protected send<RequestMethod extends KeyringRpcMethod>(request: KeyringRpcRequest<RequestMethod>): Promise<Json>; getAccounts(): Promise<KeyringAccount[]>; getAccount(id: string): Promise<KeyringAccount>; createAccounts(params: CreateAccountOptions): Promise<KeyringAccount[]>; exportAccount(id: AccountId, options?: ExportAccountOptions): Promise<ExportedAccount>; deleteAccount(id: AccountId): Promise<void>; submitRequest(request: KeyringRequest): Promise<Json>; } //# sourceMappingURL=KeyringClient.d.cts.map