@metamask/keyring-api
Version:
MetaMask Keyring API
1,047 lines • 45.5 kB
text/typescript
import type { Infer } from "@metamask/superstruct";
/**
* Keyring RPC methods used by the API.
*/
export declare enum KeyringRpcMethod {
ListAccounts = "keyring_listAccounts",
GetAccount = "keyring_getAccount",
CreateAccount = "keyring_createAccount",
DiscoverAccounts = "keyring_discoverAccounts",
ListAccountAssets = "keyring_listAccountAssets",
ListAccountTransactions = "keyring_listAccountTransactions",
GetAccountBalances = "keyring_getAccountBalances",
ResolveAccountAddress = "keyring_resolveAccountAddress",
FilterAccountChains = "keyring_filterAccountChains",
UpdateAccount = "keyring_updateAccount",
DeleteAccount = "keyring_deleteAccount",
ExportAccount = "keyring_exportAccount",
ListRequests = "keyring_listRequests",
GetRequest = "keyring_getRequest",
SubmitRequest = "keyring_submitRequest",
ApproveRequest = "keyring_approveRequest",
RejectRequest = "keyring_rejectRequest",
SetSelectedAccounts = "keyring_setSelectedAccounts"
}
/**
* Check if a method is a keyring RPC method.
*
* @param method - Method to check.
* @returns Whether the method is a keyring RPC method.
*/
export declare function isKeyringRpcMethod(method: string): boolean;
export declare const ListAccountsRequestStruct: import("@metamask/superstruct").Struct<{
method: "keyring_listAccounts";
id: string | number | null;
jsonrpc: "2.0";
}, {
method: import("@metamask/superstruct").Struct<"keyring_listAccounts", "keyring_listAccounts">;
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
}>;
export type ListAccountsRequest = Infer<typeof ListAccountsRequestStruct>;
export declare const ListAccountsResponseStruct: import("@metamask/superstruct").Struct<{
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
id: string;
options: Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
};
exportable?: boolean;
};
address: string;
scopes: `${string}:${string}`[];
methods: string[];
}[], import("@metamask/superstruct").Struct<{
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
id: string;
options: Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
};
exportable?: boolean;
};
address: string;
scopes: `${string}:${string}`[];
methods: string[];
}, {
id: import("@metamask/superstruct").Struct<string, null>;
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
"eip155:eoa": "eip155:eoa";
"eip155:erc4337": "eip155:erc4337";
"bip122:p2pkh": "bip122:p2pkh";
"bip122:p2sh": "bip122:p2sh";
"bip122:p2wpkh": "bip122:p2wpkh";
"bip122:p2tr": "bip122:p2tr";
"solana:data-account": "solana:data-account";
"tron:eoa": "tron:eoa";
"any:account": "any:account";
}>;
address: import("@metamask/superstruct").Struct<string, null>;
scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
};
exportable?: boolean;
}, null>;
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
}>>;
export type ListAccountsResponse = Infer<typeof ListAccountsResponseStruct>;
export declare const GetAccountRequestStruct: import("@metamask/superstruct").Struct<{
method: "keyring_getAccount";
id: string | number | null;
jsonrpc: "2.0";
params: {
id: string;
};
}, {
method: import("@metamask/superstruct").Struct<"keyring_getAccount", "keyring_getAccount">;
params: import("@metamask/superstruct").Struct<{
id: string;
}, {
id: import("@metamask/superstruct").Struct<string, null>;
}>;
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
}>;
export type GetAccountRequest = Infer<typeof GetAccountRequestStruct>;
export declare const GetAccountResponseStruct: import("@metamask/superstruct").Struct<{
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
id: string;
options: Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
};
exportable?: boolean;
};
address: string;
scopes: `${string}:${string}`[];
methods: string[];
}, {
id: import("@metamask/superstruct").Struct<string, null>;
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
"eip155:eoa": "eip155:eoa";
"eip155:erc4337": "eip155:erc4337";
"bip122:p2pkh": "bip122:p2pkh";
"bip122:p2sh": "bip122:p2sh";
"bip122:p2wpkh": "bip122:p2wpkh";
"bip122:p2tr": "bip122:p2tr";
"solana:data-account": "solana:data-account";
"tron:eoa": "tron:eoa";
"any:account": "any:account";
}>;
address: import("@metamask/superstruct").Struct<string, null>;
scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
};
exportable?: boolean;
}, null>;
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
}>;
export type GetAccountResponse = Infer<typeof GetAccountResponseStruct>;
export declare const CreateAccountRequestStruct: import("@metamask/superstruct").Struct<{
method: "keyring_createAccount";
id: string | number | null;
jsonrpc: "2.0";
params: {
options: Record<string, import("@metamask/utils").Json>;
};
}, {
method: import("@metamask/superstruct").Struct<"keyring_createAccount", "keyring_createAccount">;
params: import("@metamask/superstruct").Struct<{
options: Record<string, import("@metamask/utils").Json>;
}, {
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
}>;
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
}>;
export type CreateAccountRequest = Infer<typeof CreateAccountRequestStruct>;
export declare const CreateAccountResponseStruct: import("@metamask/superstruct").Struct<{
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
id: string;
options: Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
};
exportable?: boolean;
};
address: string;
scopes: `${string}:${string}`[];
methods: string[];
}, {
id: import("@metamask/superstruct").Struct<string, null>;
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
"eip155:eoa": "eip155:eoa";
"eip155:erc4337": "eip155:erc4337";
"bip122:p2pkh": "bip122:p2pkh";
"bip122:p2sh": "bip122:p2sh";
"bip122:p2wpkh": "bip122:p2wpkh";
"bip122:p2tr": "bip122:p2tr";
"solana:data-account": "solana:data-account";
"tron:eoa": "tron:eoa";
"any:account": "any:account";
}>;
address: import("@metamask/superstruct").Struct<string, null>;
scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
};
exportable?: boolean;
}, null>;
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
}>;
export type CreateAccountResponse = Infer<typeof CreateAccountResponseStruct>;
export declare const SetSelectedAccountsRequestStruct: import("@metamask/superstruct").Struct<{
method: "keyring_setSelectedAccounts";
id: string | number | null;
jsonrpc: "2.0";
params: {
accounts: string[];
};
}, {
method: import("@metamask/superstruct").Struct<"keyring_setSelectedAccounts", "keyring_setSelectedAccounts">;
params: import("@metamask/superstruct").Struct<{
accounts: string[];
}, {
accounts: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
}>;
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
}>;
export type SetSelectedAccountsRequest = Infer<typeof SetSelectedAccountsRequestStruct>;
export declare const SetSelectedAccountsResponseStruct: import("@metamask/superstruct").Struct<null, null>;
export type SetSelectedAccountsResponse = Infer<typeof SetSelectedAccountsResponseStruct>;
export declare const DiscoverAccountsRequestStruct: import("@metamask/superstruct").Struct<{
method: "keyring_discoverAccounts";
id: string | number | null;
jsonrpc: "2.0";
params: {
groupIndex: number;
scopes: `${string}:${string}`[];
entropySource: string;
};
}, {
method: import("@metamask/superstruct").Struct<"keyring_discoverAccounts", "keyring_discoverAccounts">;
params: import("@metamask/superstruct").Struct<{
groupIndex: number;
scopes: `${string}:${string}`[];
entropySource: string;
}, {
scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
entropySource: import("@metamask/superstruct").Struct<string, null>;
groupIndex: import("@metamask/superstruct").Struct<number, null>;
}>;
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
}>;
export type DiscoverAccountsRequest = Infer<typeof DiscoverAccountsRequestStruct>;
export declare const DiscoverAccountsResponseStruct: import("@metamask/superstruct").Struct<{
type: "bip44";
derivationPath: `m/${string}`;
scopes: `${string}:${string}`[];
}[], import("@metamask/superstruct").Struct<{
type: "bip44";
derivationPath: `m/${string}`;
scopes: `${string}:${string}`[];
}, {
type: import("@metamask/superstruct").Struct<"bip44", "bip44">;
scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
derivationPath: import("@metamask/superstruct").Struct<`m/${string}`, null>;
}>>;
export type DiscoverAccountsResponse = Infer<typeof DiscoverAccountsResponseStruct>;
export declare const ListAccountTransactionsRequestStruct: import("@metamask/superstruct").Struct<{
method: "keyring_listAccountTransactions";
id: string | number | null;
jsonrpc: "2.0";
params: {
id: string;
pagination: {
limit: number;
next?: string | null;
};
};
}, {
method: import("@metamask/superstruct").Struct<"keyring_listAccountTransactions", "keyring_listAccountTransactions">;
params: import("@metamask/superstruct").Struct<{
id: string;
pagination: {
limit: number;
next?: string | null;
};
}, {
id: import("@metamask/superstruct").Struct<string, null>;
pagination: import("@metamask/superstruct").Struct<{
limit: number;
next?: string | null;
}, {
limit: import("@metamask/superstruct").Struct<number, null>;
next: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag | null, null>;
}>;
}>;
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
}>;
export type ListAccountTransactionsRequest = Infer<typeof ListAccountTransactionsRequestStruct>;
export declare const ListAccountTransactionsResponseStruct: import("@metamask/superstruct").Struct<{
data: {
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw";
id: string;
from: {
address: string;
asset: {
unit: string;
type: `${string}:${string}/${string}:${string}`;
amount: string;
fungible: true;
} | {
id: `${string}:${string}/${string}:${string}/${string}`;
fungible: false;
} | null;
}[];
events: {
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
timestamp: number | null;
}[];
chain: `${string}:${string}`;
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
account: string;
timestamp: number | null;
to: {
address: string;
asset: {
unit: string;
type: `${string}:${string}/${string}:${string}`;
amount: string;
fungible: true;
} | {
id: `${string}:${string}/${string}:${string}/${string}`;
fungible: false;
} | null;
}[];
fees: {
type: "base" | "priority";
asset: {
unit: string;
type: `${string}:${string}/${string}:${string}`;
amount: string;
fungible: true;
} | {
id: `${string}:${string}/${string}:${string}/${string}`;
fungible: false;
};
}[];
}[];
next: string | null;
}, {
data: import("@metamask/superstruct").Struct<{
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw";
id: string;
from: {
address: string;
asset: {
unit: string;
type: `${string}:${string}/${string}:${string}`;
amount: string;
fungible: true;
} | {
id: `${string}:${string}/${string}:${string}/${string}`;
fungible: false;
} | null;
}[];
events: {
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
timestamp: number | null;
}[];
chain: `${string}:${string}`;
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
account: string;
timestamp: number | null;
to: {
address: string;
asset: {
unit: string;
type: `${string}:${string}/${string}:${string}`;
amount: string;
fungible: true;
} | {
id: `${string}:${string}/${string}:${string}/${string}`;
fungible: false;
} | null;
}[];
fees: {
type: "base" | "priority";
asset: {
unit: string;
type: `${string}:${string}/${string}:${string}`;
amount: string;
fungible: true;
} | {
id: `${string}:${string}/${string}:${string}/${string}`;
fungible: false;
};
}[];
}[], import("@metamask/superstruct").Struct<{
type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw";
id: string;
from: {
address: string;
asset: {
unit: string;
type: `${string}:${string}/${string}:${string}`;
amount: string;
fungible: true;
} | {
id: `${string}:${string}/${string}:${string}/${string}`;
fungible: false;
} | null;
}[];
events: {
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
timestamp: number | null;
}[];
chain: `${string}:${string}`;
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
account: string;
timestamp: number | null;
to: {
address: string;
asset: {
unit: string;
type: `${string}:${string}/${string}:${string}`;
amount: string;
fungible: true;
} | {
id: `${string}:${string}/${string}:${string}/${string}`;
fungible: false;
} | null;
}[];
fees: {
type: "base" | "priority";
asset: {
unit: string;
type: `${string}:${string}/${string}:${string}`;
amount: string;
fungible: true;
} | {
id: `${string}:${string}/${string}:${string}/${string}`;
fungible: false;
};
}[];
}, {
id: import("@metamask/superstruct").Struct<string, null>;
chain: import("@metamask/superstruct").Struct<`${string}:${string}`, null>;
account: import("@metamask/superstruct").Struct<string, null>;
status: import("@metamask/superstruct").Struct<"submitted" | "unconfirmed" | "confirmed" | "failed", {
submitted: "submitted";
unconfirmed: "unconfirmed";
confirmed: "confirmed";
failed: "failed";
}>;
timestamp: import("@metamask/superstruct").Struct<number | null, null>;
type: import("@metamask/superstruct").Struct<"unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw", {
unknown: "unknown";
send: "send";
receive: "receive";
swap: "swap";
"bridge:send": "bridge:send";
"bridge:receive": "bridge:receive";
"stake:deposit": "stake:deposit";
"stake:withdraw": "stake:withdraw";
}>;
from: import("@metamask/superstruct").Struct<{
address: string;
asset: {
unit: string;
type: `${string}:${string}/${string}:${string}`;
amount: string;
fungible: true;
} | {
id: `${string}:${string}/${string}:${string}/${string}`;
fungible: false;
} | null;
}[], import("@metamask/superstruct").Struct<{
address: string;
asset: {
unit: string;
type: `${string}:${string}/${string}:${string}`;
amount: string;
fungible: true;
} | {
id: `${string}:${string}/${string}:${string}/${string}`;
fungible: false;
} | null;
}, {
address: import("@metamask/superstruct").Struct<string, null>;
asset: import("@metamask/superstruct").Struct<{
unit: string;
type: `${string}:${string}/${string}:${string}`;
amount: string;
fungible: true;
} | {
id: `${string}:${string}/${string}:${string}/${string}`;
fungible: false;
} | null, null>;
}>>;
to: import("@metamask/superstruct").Struct<{
address: string;
asset: {
unit: string;
type: `${string}:${string}/${string}:${string}`;
amount: string;
fungible: true;
} | {
id: `${string}:${string}/${string}:${string}/${string}`;
fungible: false;
} | null;
}[], import("@metamask/superstruct").Struct<{
address: string;
asset: {
unit: string;
type: `${string}:${string}/${string}:${string}`;
amount: string;
fungible: true;
} | {
id: `${string}:${string}/${string}:${string}/${string}`;
fungible: false;
} | null;
}, {
address: import("@metamask/superstruct").Struct<string, null>;
asset: import("@metamask/superstruct").Struct<{
unit: string;
type: `${string}:${string}/${string}:${string}`;
amount: string;
fungible: true;
} | {
id: `${string}:${string}/${string}:${string}/${string}`;
fungible: false;
} | null, null>;
}>>;
fees: import("@metamask/superstruct").Struct<{
type: "base" | "priority";
asset: {
unit: string;
type: `${string}:${string}/${string}:${string}`;
amount: string;
fungible: true;
} | {
id: `${string}:${string}/${string}:${string}/${string}`;
fungible: false;
};
}[], import("@metamask/superstruct").Struct<{
type: "base" | "priority";
asset: {
unit: string;
type: `${string}:${string}/${string}:${string}`;
amount: string;
fungible: true;
} | {
id: `${string}:${string}/${string}:${string}/${string}`;
fungible: false;
};
}, {
type: import("@metamask/superstruct").Struct<"base" | "priority", {
base: "base";
priority: "priority";
}>;
asset: import("@metamask/superstruct").Struct<{
unit: string;
type: `${string}:${string}/${string}:${string}`;
amount: string;
fungible: true;
} | {
id: `${string}:${string}/${string}:${string}/${string}`;
fungible: false;
}, null>;
}>>;
events: import("@metamask/superstruct").Struct<{
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
timestamp: number | null;
}[], import("@metamask/superstruct").Struct<{
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
timestamp: number | null;
}, {
status: import("@metamask/superstruct").Struct<"submitted" | "unconfirmed" | "confirmed" | "failed", {
submitted: "submitted";
unconfirmed: "unconfirmed";
confirmed: "confirmed";
failed: "failed";
}>;
timestamp: import("@metamask/superstruct").Struct<number | null, null>;
}>>;
}>>;
next: import("@metamask/superstruct").Struct<string | null, null>;
}>;
export type ListAccountTransactionsResponse = Infer<typeof ListAccountTransactionsResponseStruct>;
export declare const ListAccountAssetsRequestStruct: import("@metamask/superstruct").Struct<{
method: "keyring_listAccountAssets";
id: string | number | null;
jsonrpc: "2.0";
params: {
id: string;
};
}, {
method: import("@metamask/superstruct").Struct<"keyring_listAccountAssets", "keyring_listAccountAssets">;
params: import("@metamask/superstruct").Struct<{
id: string;
}, {
id: import("@metamask/superstruct").Struct<string, null>;
}>;
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
}>;
export type ListAccountAssetsRequest = Infer<typeof ListAccountAssetsRequestStruct>;
export declare const ListAccountAssetsResponseStruct: import("@metamask/superstruct").Struct<(`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[], import("@metamask/superstruct").Struct<`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`, null>>;
export type ListAccountAssetsResponse = Infer<typeof ListAccountAssetsResponseStruct>;
export declare const GetAccountBalancesRequestStruct: import("@metamask/superstruct").Struct<{
method: "keyring_getAccountBalances";
id: string | number | null;
jsonrpc: "2.0";
params: {
id: string;
assets: `${string}:${string}/${string}:${string}`[];
};
}, {
method: import("@metamask/superstruct").Struct<"keyring_getAccountBalances", "keyring_getAccountBalances">;
params: import("@metamask/superstruct").Struct<{
id: string;
assets: `${string}:${string}/${string}:${string}`[];
}, {
id: import("@metamask/superstruct").Struct<string, null>;
assets: import("@metamask/superstruct").Struct<`${string}:${string}/${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}/${string}:${string}`, null>>;
}>;
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
}>;
export type GetAccountBalancesRequest = Infer<typeof GetAccountBalancesRequestStruct>;
export declare const GetAccountBalancesResponseStruct: import("@metamask/superstruct").Struct<Record<`${string}:${string}/${string}:${string}`, {
unit: string;
amount: string;
}>, null>;
export type GetAccountBalancesResponse = Infer<typeof GetAccountBalancesResponseStruct>;
export declare const ResolveAccountAddressRequestStruct: import("@metamask/superstruct").Struct<{
method: "keyring_resolveAccountAddress";
id: string | number | null;
jsonrpc: "2.0";
params: {
request: {
method: string;
id: string | number | null;
jsonrpc: "2.0";
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
};
scope: `${string}:${string}`;
};
}, {
method: import("@metamask/superstruct").Struct<"keyring_resolveAccountAddress", "keyring_resolveAccountAddress">;
params: import("@metamask/superstruct").Struct<{
request: {
method: string;
id: string | number | null;
jsonrpc: "2.0";
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
};
scope: `${string}:${string}`;
}, {
scope: import("@metamask/superstruct").Struct<`${string}:${string}`, null>;
request: import("@metamask/superstruct").Struct<{
method: string;
id: string | number | null;
jsonrpc: "2.0";
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
}, {
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
method: import("@metamask/superstruct").Struct<string, null>;
params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[] | import("@metamask/keyring-utils").ExactOptionalTag, null>;
}>;
}>;
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
}>;
export type ResolveAccountAddressRequest = Infer<typeof ResolveAccountAddressRequestStruct>;
export declare const ResolveAccountAddressResponseStruct: import("@metamask/superstruct").Struct<{
address: `${string}:${string}:${string}`;
} | null, {
address: import("@metamask/superstruct").Struct<`${string}:${string}:${string}`, null>;
}>;
export type ResolveAccountAddressResponse = Infer<typeof ResolveAccountAddressResponseStruct>;
export declare const FilterAccountChainsStruct: import("@metamask/superstruct").Struct<{
method: "keyring_filterAccountChains";
id: string | number | null;
jsonrpc: "2.0";
params: {
id: string;
chains: string[];
};
}, {
method: import("@metamask/superstruct").Struct<"keyring_filterAccountChains", "keyring_filterAccountChains">;
params: import("@metamask/superstruct").Struct<{
id: string;
chains: string[];
}, {
id: import("@metamask/superstruct").Struct<string, null>;
chains: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
}>;
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
}>;
export type FilterAccountChainsRequest = Infer<typeof FilterAccountChainsStruct>;
export declare const FilterAccountChainsResponseStruct: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
export type FilterAccountChainsResponse = Infer<typeof FilterAccountChainsResponseStruct>;
export declare const UpdateAccountRequestStruct: import("@metamask/superstruct").Struct<{
method: "keyring_updateAccount";
id: string | number | null;
jsonrpc: "2.0";
params: {
account: {
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
id: string;
options: Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
};
exportable?: boolean;
};
address: string;
scopes: `${string}:${string}`[];
methods: string[];
};
};
}, {
method: import("@metamask/superstruct").Struct<"keyring_updateAccount", "keyring_updateAccount">;
params: import("@metamask/superstruct").Struct<{
account: {
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
id: string;
options: Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
};
exportable?: boolean;
};
address: string;
scopes: `${string}:${string}`[];
methods: string[];
};
}, {
account: import("@metamask/superstruct").Struct<{
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
id: string;
options: Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
};
exportable?: boolean;
};
address: string;
scopes: `${string}:${string}`[];
methods: string[];
}, {
id: import("@metamask/superstruct").Struct<string, null>;
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
"eip155:eoa": "eip155:eoa";
"eip155:erc4337": "eip155:erc4337";
"bip122:p2pkh": "bip122:p2pkh";
"bip122:p2sh": "bip122:p2sh";
"bip122:p2wpkh": "bip122:p2wpkh";
"bip122:p2tr": "bip122:p2tr";
"solana:data-account": "solana:data-account";
"tron:eoa": "tron:eoa";
"any:account": "any:account";
}>;
address: import("@metamask/superstruct").Struct<string, null>;
scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
};
exportable?: boolean;
}, null>;
methods: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
}>;
}>;
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
}>;
export type UpdateAccountRequest = Infer<typeof UpdateAccountRequestStruct>;
export declare const UpdateAccountResponseStruct: import("@metamask/superstruct").Struct<null, null>;
export type UpdateAccountResponse = Infer<typeof UpdateAccountResponseStruct>;
export declare const DeleteAccountRequestStruct: import("@metamask/superstruct").Struct<{
method: "keyring_deleteAccount";
id: string | number | null;
jsonrpc: "2.0";
params: {
id: string;
};
}, {
method: import("@metamask/superstruct").Struct<"keyring_deleteAccount", "keyring_deleteAccount">;
params: import("@metamask/superstruct").Struct<{
id: string;
}, {
id: import("@metamask/superstruct").Struct<string, null>;
}>;
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
}>;
export type DeleteAccountRequest = Infer<typeof DeleteAccountRequestStruct>;
export declare const DeleteAccountResponseStruct: import("@metamask/superstruct").Struct<null, null>;
export type DeleteAccountResponse = Infer<typeof DeleteAccountResponseStruct>;
export declare const ExportAccountRequestStruct: import("@metamask/superstruct").Struct<{
method: "keyring_exportAccount";
id: string | number | null;
jsonrpc: "2.0";
params: {
id: string;
};
}, {
method: import("@metamask/superstruct").Struct<"keyring_exportAccount", "keyring_exportAccount">;
params: import("@metamask/superstruct").Struct<{
id: string;
}, {
id: import("@metamask/superstruct").Struct<string, null>;
}>;
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
}>;
export type ExportAccountRequest = Infer<typeof ExportAccountRequestStruct>;
export declare const ExportAccountResponseStruct: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
export type ExportAccountResponse = Infer<typeof ExportAccountResponseStruct>;
export declare const ListRequestsRequestStruct: import("@metamask/superstruct").Struct<{
method: "keyring_listRequests";
id: string | number | null;
jsonrpc: "2.0";
}, {
method: import("@metamask/superstruct").Struct<"keyring_listRequests", "keyring_listRequests">;
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
}>;
export type ListRequestsRequest = Infer<typeof ListRequestsRequestStruct>;
export declare const ListRequestsResponseStruct: import("@metamask/superstruct").Struct<{
id: string;
origin: string;
request: {
method: string;
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
};
scope: string;
account: string;
}[], import("@metamask/superstruct").Struct<{
id: string;
origin: string;
request: {
method: string;
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
};
scope: string;
account: string;
}, {
id: import("@metamask/superstruct").Struct<string, null>;
scope: import("@metamask/superstruct").Struct<string, null>;
account: import("@metamask/superstruct").Struct<string, null>;
origin: import("@metamask/superstruct").Struct<string, null>;
request: import("@metamask/superstruct").Struct<{
method: string;
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
}, {
method: import("@metamask/superstruct").Struct<string, null>;
params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[] | import("@metamask/keyring-utils").ExactOptionalTag, null>;
}>;
}>>;
export type ListRequestsResponse = Infer<typeof ListRequestsResponseStruct>;
export declare const GetRequestRequestStruct: import("@metamask/superstruct").Struct<{
method: "keyring_getRequest";
id: string | number | null;
jsonrpc: "2.0";
params: {
id: string;
};
}, {
method: import("@metamask/superstruct").Struct<"keyring_getRequest", "keyring_getRequest">;
params: import("@metamask/superstruct").Struct<{
id: string;
}, {
id: import("@metamask/superstruct").Struct<string, null>;
}>;
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
}>;
export type GetRequestRequest = Infer<typeof GetRequestRequestStruct>;
export declare const GetRequestResponseStruct: import("@metamask/superstruct").Struct<{
id: string;
origin: string;
request: {
method: string;
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
};
scope: string;
account: string;
}, {
id: import("@metamask/superstruct").Struct<string, null>;
scope: import("@metamask/superstruct").Struct<string, null>;
account: import("@metamask/superstruct").Struct<string, null>;
origin: import("@metamask/superstruct").Struct<string, null>;
request: import("@metamask/superstruct").Struct<{
method: string;
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
}, {
method: import("@metamask/superstruct").Struct<string, null>;
params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[] | import("@metamask/keyring-utils").ExactOptionalTag, null>;
}>;
}>;
export type GetRequestResponse = Infer<typeof GetRequestResponseStruct>;
export declare const SubmitRequestRequestStruct: import("@metamask/superstruct").Struct<{
method: "keyring_submitRequest";
id: string | number | null;
jsonrpc: "2.0";
params: {
id: string;
origin: string;
request: {
method: string;
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
};
scope: string;
account: string;
};
}, {
method: import("@metamask/superstruct").Struct<"keyring_submitRequest", "keyring_submitRequest">;
params: import("@metamask/superstruct").Struct<{
id: string;
origin: string;
request: {
method: string;
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
};
scope: string;
account: string;
}, {
id: import("@metamask/superstruct").Struct<string, null>;
scope: import("@metamask/superstruct").Struct<string, null>;
account: import("@metamask/superstruct").Struct<string, null>;
origin: import("@metamask/superstruct").Struct<string, null>;
request: import("@metamask/superstruct").Struct<{
method: string;
params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
}, {
method: import("@metamask/superstruct").Struct<string, null>;
params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[] | import("@metamask/keyring-utils").ExactOptionalTag, null>;
}>;
}>;
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
}>;
export type SubmitRequestRequest = Infer<typeof SubmitRequestRequestStruct>;
export declare const SubmitRequestResponseStruct: import("@metamask/superstruct").Struct<{
pending: true;
redirect?: {
message?: string;
url?: string;
};
} | {
result: import("@metamask/utils").Json;
pending: false;
}, null>;
export type SubmitRequestResponse = Infer<typeof SubmitRequestResponseStruct>;
export declare const ApproveRequestRequestStruct: import("@metamask/superstruct").Struct<{
method: "keyring_approveRequest";
id: string | number | null;
jsonrpc: "2.0";
params: {
data: Record<string, import("@metamask/utils").Json>;
id: string;
};
}, {
method: import("@metamask/superstruct").Struct<"keyring_approveRequest", "keyring_approveRequest">;
params: import("@metamask/superstruct").Struct<{
data: Record<string, import("@metamask/utils").Json>;
id: string;
}, {
id: import("@metamask/superstruct").Struct<string, null>;
data: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
}>;
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
}>;
export type ApproveRequestRequest = Infer<typeof ApproveRequestRequestStruct>;
export declare const ApproveRequestResponseStruct: import("@metamask/superstruct").Struct<null, null>;
export type ApproveRequestResponse = Infer<typeof ApproveRequestResponseStruct>;
export declare const RejectRequestRequestStruct: import("@metamask/superstruct").Struct<{
method: "keyring_rejectRequest";
id: string | number | null;
jsonrpc: "2.0";
params: {
id: string;
};
}, {
method: import("@metamask/superstruct").Struct<"keyring_rejectRequest", "keyring_rejectRequest">;
params: import("@metamask/superstruct").Struct<{
id: string;
}, {
id: import("@metamask/superstruct").Struct<string, null>;
}>;
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
id: import("@metamask/superstruct").Struct<string | number | null, null>;
}>;
export type RejectRequestRequest = Infer<typeof RejectRequestRequestStruct>;
export declare const RejectRequestResponseStruct: import("@metamask/superstruct").Struct<null, null>;
export type RejectRequestResponse = Infer<typeof RejectRequestResponseStruct>;
//# sourceMappingURL=rpc.d.mts.map