import type { MultichainCore } from '@metamask/connect-multichain'; export type Hex = `0x${string}`; export type Address = Hex; export type CaipAccountId = `${string}:${string}:${string}`; export type CaipChainId = `${string}:${string}`; export type EIP1193ProviderEvents = { connect: [{ chainId: Hex; accounts: Address[]; }]; disconnect: []; accountsChanged: [Address[]]; chainChanged: [Hex]; message: [{ type: string; data: unknown; }]; /** * Emitted when a QR code URI is available for display. * This allows consumers to show their own custom QR code UI. */ display_uri: [string]; connectAndSign: [ { accounts: readonly Address[]; chainId: Hex; signature: string; } ]; connectWith: [ { accounts: readonly Address[]; chainId: Hex; result: unknown; } ]; }; export type EventHandlers = { connect: (result: { chainId: string; accounts: Address[]; }) => void; disconnect: () => void; accountsChanged: (accounts: Address[]) => void; chainChanged: (chainId: Hex) => void; displayUri: (uri: string) => void; connectAndSign: (result: { accounts: readonly Address[]; chainId: Hex; signature: string; }) => void; connectWith: (result: { accounts: readonly Address[]; chainId: Hex; result: unknown; }) => void; }; export type MetamaskConnectEVMOptions = { core: MultichainCore; eventHandlers?: Partial; notificationQueue?: unknown[]; supportedNetworks?: Record; }; export type AddEthereumChainParameter = { chainId?: string; chainName?: string; nativeCurrency?: { name?: string; symbol?: string; decimals?: number; }; rpcUrls?: string[]; blockExplorerUrls?: string[]; iconUrls?: string[]; }; type ConnectRequest = { method: 'wallet_requestPermissions' | 'eth_requestAccounts'; params: [chainId?: Hex, account?: string]; }; type RevokePermissionsRequest = { method: 'wallet_revokePermissions'; params: unknown[]; }; type SwitchEthereumChainRequest = { method: 'wallet_switchEthereumChain'; params: [{ chainId: string; }]; }; type AddEthereumChainRequest = { method: 'wallet_addEthereumChain'; params: [AddEthereumChainParameter]; }; type AccountsRequest = { method: 'eth_accounts' | 'eth_coinbase'; params: []; }; type GenericProviderRequest = { method: Exclude; params?: unknown; }; export type ProviderRequest = ConnectRequest | RevokePermissionsRequest | SwitchEthereumChainRequest | AddEthereumChainRequest | AccountsRequest | GenericProviderRequest; export type ProviderRequestInterceptor = (req: ProviderRequest) => Promise; export type JsonRpcRequest = { id?: number | string; jsonrpc?: '2.0'; method: string; params?: T; }; export type JsonRpcResponse = { id: number | string; jsonrpc: '2.0'; result?: T; error?: { code: number; message: string; data?: unknown; }; }; export type JsonRpcCallback = (error: Error | null, response: JsonRpcResponse | null) => void; export {}; //# sourceMappingURL=types.d.ts.map