Approve a request.
Approves the request with the given ID and sets the response if provided.
The ID of the request to approve.
Optional
data: Record<string, Json>The response to the request (optional).
A promise that resolves when the request is successfully approved.
Create an account.
Creates a new account with optional, keyring-defined, account options.
Optional
options: Record<string, Json>Keyring-defined options for the account (optional).
A promise that resolves to the newly created KeyringAccount object without any private information.
Exports an account's private key.
If the keyring cannot export a private key, this function should throw an error.
The ID of the account to export.
A promise that resolves to the exported account.
Filter supported chains for a given account.
ID of the account to be checked.
List of chains (CAIP-2) to be checked.
A Promise that resolves to a filtered list of CAIP-2 IDs representing the supported chains.
Get an account.
Retrieves the KeyringAccount object for the given account ID.
The ID of the account to retrieve.
A promise that resolves to the KeyringAccount object if found, or undefined otherwise.
Retrieve the balances of a given account.
This method fetches the balances of specified assets for a given account ID. It returns a promise that resolves to an object where the keys are asset types and the values are balance objects containing the amount and unit.
ID of the account to retrieve the balances for.
Array of asset types (CAIP-19) to retrieve balances for.
A promise that resolves to an object mapping asset types to their respective balances.
await keyring.getAccountBalances(
'43550276-c7d6-4fac-87c7-00390ad0ce90',
['bip122:000000000019d6689c085ae165831e93/slip44:0']
);
// Returns something similar to:
// {
// 'bip122:000000000019d6689c085ae165831e93/slip44:0': {
// amount: '0.0001',
// unit: 'BTC',
// }
// }
Get a request.
Retrieves the KeyringRequest object for the given request ID.
The ID of the request to retrieve.
A promise that resolves to the KeyringRequest object if found, or undefined otherwise.
List accounts.
Retrieves an array of KeyringAccount objects representing the available accounts.
A promise that resolves to an array of KeyringAccount objects.
List all submitted requests.
Retrieves an array of KeyringRequest objects representing the submitted requests.
A promise that resolves to an array of KeyringRequest objects.
Submit a request.
Submits the given KeyringRequest object.
The KeyringRequest object to submit.
Account ID (UUIDv4).
Keyring request ID (UUIDv4).
Inner request sent by the client application.
Optional
params?: Json[] | Record<string, Json>Request's scope (CAIP-2 chain ID).
A promise that resolves to the request response.
Update an account.
Updates the account with the given account object. Does nothing if the account does not exist.
The updated account object.
Account main address.
Account ID (UUIDv4).
Account supported methods.
Account options.
Account type.
A promise that resolves when the account is successfully updated.
Keyring interface.
Represents the functionality and operations related to managing accounts and handling requests.