UNPKG

@turnkey/eip-1193-provider

Version:

EIP-1193 Provider for Turnkey.

476 lines 19.5 kB
/// <reference types="node" /> import { type AddEthereumChainParameter } from "viem"; import EventEmitter from "events"; import type { TurnkeyEIP1193Provider, TurnkeyEIP1193ProviderOptions } from "./types"; export { TurnkeyEIP1193Provider }; export declare const createEIP1193Provider: (options: TurnkeyEIP1193ProviderOptions) => Promise<{ on: (eventName: string | symbol, listener: (...args: any[]) => void) => EventEmitter; removeListener: (eventName: string | symbol, listener: (...args: any[]) => void) => EventEmitter; request: import("viem").EIP1193RequestFn<[{ Method: "web3_clientVersion"; Parameters?: undefined; ReturnType: string; }, { Method: "web3_sha3"; Parameters: [data: `0x${string}`]; ReturnType: string; }, { Method: "net_listening"; Parameters?: undefined; ReturnType: boolean; }, { Method: "net_peerCount"; Parameters?: undefined; ReturnType: `0x${string}`; }, { Method: "net_version"; Parameters?: undefined; ReturnType: `0x${string}`; }, { Method: "eth_blobGasPrice"; Parameters?: undefined; ReturnType: `0x${string}`; }, { Method: "eth_blockNumber"; Parameters?: undefined; ReturnType: `0x${string}`; }, { Method: "eth_call"; Parameters: [transaction: Partial<import("viem").RpcTransactionRequest>] | [transaction: Partial<import("viem").RpcTransactionRequest>, block: `0x${string}` | import("viem").BlockTag | import("viem").RpcBlockIdentifier] | [transaction: Partial<import("viem").RpcTransactionRequest>, block: `0x${string}` | import("viem").BlockTag | import("viem").RpcBlockIdentifier, stateOverrideSet: import("viem").RpcStateOverride]; ReturnType: `0x${string}`; }, { Method: "eth_chainId"; Parameters?: undefined; ReturnType: `0x${string}`; }, { Method: "eth_coinbase"; Parameters?: undefined; ReturnType: `0x${string}`; }, { Method: "eth_estimateGas"; Parameters: [transaction: import("viem").RpcTransactionRequest] | [transaction: import("viem").RpcTransactionRequest, block: `0x${string}` | import("viem").BlockTag]; ReturnType: `0x${string}`; }, { Method: "eth_feeHistory"; Parameters: [blockCount: `0x${string}`, newestBlock: `0x${string}` | import("viem").BlockTag, rewardPercentiles: number[] | undefined]; ReturnType: import("viem").RpcFeeHistory; }, { Method: "eth_gasPrice"; Parameters?: undefined; ReturnType: `0x${string}`; }, { Method: "eth_getBalance"; Parameters: [address: `0x${string}`, block: `0x${string}` | import("viem").BlockTag | import("viem").RpcBlockIdentifier]; ReturnType: `0x${string}`; }, { Method: "eth_getBlockByHash"; Parameters: [hash: `0x${string}`, includeTransactionObjects: boolean]; ReturnType: import("viem").RpcBlock | null; }, { Method: "eth_getBlockByNumber"; Parameters: [block: `0x${string}` | import("viem").BlockTag, includeTransactionObjects: boolean]; ReturnType: import("viem").RpcBlock | null; }, { Method: "eth_getBlockTransactionCountByHash"; Parameters: [hash: `0x${string}`]; ReturnType: `0x${string}`; }, { Method: "eth_getBlockTransactionCountByNumber"; Parameters: [block: `0x${string}` | import("viem").BlockTag]; ReturnType: `0x${string}`; }, { Method: "eth_getCode"; Parameters: [address: `0x${string}`, block: `0x${string}` | import("viem").BlockTag | import("viem").RpcBlockIdentifier]; ReturnType: `0x${string}`; }, { Method: "eth_getFilterChanges"; Parameters: [filterId: `0x${string}`]; ReturnType: import("viem").RpcLog[] | `0x${string}`[]; }, { Method: "eth_getFilterLogs"; Parameters: [filterId: `0x${string}`]; ReturnType: import("viem").RpcLog[]; }, { Method: "eth_getLogs"; Parameters: [{ address?: `0x${string}` | `0x${string}`[]; topics?: import("viem").LogTopic[]; } & ({ fromBlock?: `0x${string}` | import("viem").BlockTag; toBlock?: `0x${string}` | import("viem").BlockTag; blockHash?: never; } | { fromBlock?: never; toBlock?: never; blockHash?: `0x${string}`; })]; ReturnType: import("viem").RpcLog[]; }, { Method: "eth_getProof"; Parameters: [address: `0x${string}`, storageKeys: `0x${string}`[], block: `0x${string}` | import("viem").BlockTag]; ReturnType: import("viem").RpcProof; }, { Method: "eth_getStorageAt"; Parameters: [address: `0x${string}`, index: `0x${string}`, block: `0x${string}` | import("viem").BlockTag | import("viem").RpcBlockIdentifier]; ReturnType: `0x${string}`; }, { Method: "eth_getTransactionByBlockHashAndIndex"; Parameters: [hash: `0x${string}`, index: `0x${string}`]; ReturnType: import("viem").RpcTransaction | null; }, { Method: "eth_getTransactionByBlockNumberAndIndex"; Parameters: [block: `0x${string}` | import("viem").BlockTag, index: `0x${string}`]; ReturnType: import("viem").RpcTransaction | null; }, { Method: "eth_getTransactionByHash"; Parameters: [hash: `0x${string}`]; ReturnType: import("viem").RpcTransaction | null; }, { Method: "eth_getTransactionCount"; Parameters: [address: `0x${string}`, block: `0x${string}` | import("viem").BlockTag | import("viem").RpcBlockIdentifier]; ReturnType: `0x${string}`; }, { Method: "eth_getTransactionReceipt"; Parameters: [hash: `0x${string}`]; ReturnType: import("viem").RpcTransactionReceipt | null; }, { Method: "eth_getUncleByBlockHashAndIndex"; Parameters: [hash: `0x${string}`, index: `0x${string}`]; ReturnType: import("viem").RpcUncle | null; }, { Method: "eth_getUncleByBlockNumberAndIndex"; Parameters: [block: `0x${string}` | import("viem").BlockTag, index: `0x${string}`]; ReturnType: import("viem").RpcUncle | null; }, { Method: "eth_getUncleCountByBlockHash"; Parameters: [hash: `0x${string}`]; ReturnType: `0x${string}`; }, { Method: "eth_getUncleCountByBlockNumber"; Parameters: [block: `0x${string}` | import("viem").BlockTag]; ReturnType: `0x${string}`; }, { Method: "eth_maxPriorityFeePerGas"; Parameters?: undefined; ReturnType: `0x${string}`; }, { Method: "eth_newBlockFilter"; Parameters?: undefined; ReturnType: `0x${string}`; }, { Method: "eth_newFilter"; Parameters: [filter: { fromBlock?: `0x${string}` | import("viem").BlockTag; toBlock?: `0x${string}` | import("viem").BlockTag; address?: `0x${string}` | `0x${string}`[]; topics?: import("viem").LogTopic[]; }]; ReturnType: `0x${string}`; }, { Method: "eth_newPendingTransactionFilter"; Parameters?: undefined; ReturnType: `0x${string}`; }, { Method: "eth_protocolVersion"; Parameters?: undefined; ReturnType: string; }, { Method: "eth_sendRawTransaction"; Parameters: [signedTransaction: `0x${string}`]; ReturnType: `0x${string}`; }, { Method: "eth_uninstallFilter"; Parameters: [filterId: `0x${string}`]; ReturnType: boolean; }, { Method: "eth_accounts"; Parameters?: undefined; ReturnType: `0x${string}`[]; }, { Method: "eth_chainId"; Parameters?: undefined; ReturnType: `0x${string}`; }, { Method: "eth_estimateGas"; Parameters: [transaction: import("viem").RpcTransactionRequest] | [transaction: import("viem").RpcTransactionRequest, block: `0x${string}` | import("viem").BlockTag]; ReturnType: `0x${string}`; }, { Method: "eth_requestAccounts"; Parameters?: undefined; ReturnType: `0x${string}`[]; }, { Method: "eth_sendTransaction"; Parameters: [transaction: import("viem").RpcTransactionRequest]; ReturnType: `0x${string}`; }, { Method: "eth_sendRawTransaction"; Parameters: [signedTransaction: `0x${string}`]; ReturnType: `0x${string}`; }, { Method: "eth_sign"; Parameters: [address: `0x${string}`, data: `0x${string}`]; ReturnType: `0x${string}`; }, { Method: "eth_signTransaction"; Parameters: [request: import("viem").RpcTransactionRequest]; ReturnType: `0x${string}`; }, { Method: "eth_signTypedData_v4"; Parameters: [address: `0x${string}`, message: string]; ReturnType: `0x${string}`; }, { Method: "eth_syncing"; Parameters?: undefined; ReturnType: false | import("viem").NetworkSync; }, { Method: "personal_sign"; Parameters: [data: `0x${string}`, address: `0x${string}`]; ReturnType: `0x${string}`; }, { Method: "wallet_addEthereumChain"; Parameters: [chain: AddEthereumChainParameter]; ReturnType: null; }, { Method: "wallet_getPermissions"; Parameters?: undefined; ReturnType: import("viem").WalletPermission[]; }, { Method: "wallet_requestPermissions"; Parameters: [permissions: { eth_accounts: Record<string, any>; }]; ReturnType: import("viem").WalletPermission[]; }, { Method: "wallet_switchEthereumChain"; Parameters: [chain: { chainId: string; }]; ReturnType: null; }, { Method: "wallet_watchAsset"; Parameters: import("viem").WatchAssetParams; ReturnType: boolean; }, { Method: "eth_signTypedData_v4"; Parameters: [address: `0x${string}`, typedData: { types: { [x: string]: readonly import("viem").TypedDataParameter[]; [x: `string[${string}]`]: undefined; [x: `function[${string}]`]: undefined; [x: `address[${string}]`]: undefined; [x: `bool[${string}]`]: undefined; [x: `bytes[${string}]`]: undefined; [x: `bytes5[${string}]`]: undefined; [x: `bytes3[${string}]`]: undefined; [x: `bytes16[${string}]`]: undefined; [x: `bytes1[${string}]`]: undefined; [x: `bytes2[${string}]`]: undefined; [x: `bytes4[${string}]`]: undefined; [x: `bytes6[${string}]`]: undefined; [x: `bytes7[${string}]`]: undefined; [x: `bytes8[${string}]`]: undefined; [x: `bytes9[${string}]`]: undefined; [x: `bytes10[${string}]`]: undefined; [x: `bytes11[${string}]`]: undefined; [x: `bytes12[${string}]`]: undefined; [x: `bytes13[${string}]`]: undefined; [x: `bytes14[${string}]`]: undefined; [x: `bytes15[${string}]`]: undefined; [x: `bytes17[${string}]`]: undefined; [x: `bytes18[${string}]`]: undefined; [x: `bytes19[${string}]`]: undefined; [x: `bytes20[${string}]`]: undefined; [x: `bytes21[${string}]`]: undefined; [x: `bytes22[${string}]`]: undefined; [x: `bytes23[${string}]`]: undefined; [x: `bytes24[${string}]`]: undefined; [x: `bytes25[${string}]`]: undefined; [x: `bytes26[${string}]`]: undefined; [x: `bytes27[${string}]`]: undefined; [x: `bytes28[${string}]`]: undefined; [x: `bytes29[${string}]`]: undefined; [x: `bytes30[${string}]`]: undefined; [x: `bytes31[${string}]`]: undefined; [x: `bytes32[${string}]`]: undefined; [x: `int[${string}]`]: undefined; [x: `int40[${string}]`]: undefined; [x: `int16[${string}]`]: undefined; [x: `int56[${string}]`]: undefined; [x: `int8[${string}]`]: undefined; [x: `int24[${string}]`]: undefined; [x: `int32[${string}]`]: undefined; [x: `int48[${string}]`]: undefined; [x: `int64[${string}]`]: undefined; [x: `int72[${string}]`]: undefined; [x: `int80[${string}]`]: undefined; [x: `int88[${string}]`]: undefined; [x: `int96[${string}]`]: undefined; [x: `int104[${string}]`]: undefined; [x: `int112[${string}]`]: undefined; [x: `int120[${string}]`]: undefined; [x: `int128[${string}]`]: undefined; [x: `int136[${string}]`]: undefined; [x: `int144[${string}]`]: undefined; [x: `int152[${string}]`]: undefined; [x: `int160[${string}]`]: undefined; [x: `int168[${string}]`]: undefined; [x: `int176[${string}]`]: undefined; [x: `int184[${string}]`]: undefined; [x: `int192[${string}]`]: undefined; [x: `int200[${string}]`]: undefined; [x: `int208[${string}]`]: undefined; [x: `int216[${string}]`]: undefined; [x: `int224[${string}]`]: undefined; [x: `int232[${string}]`]: undefined; [x: `int240[${string}]`]: undefined; [x: `int248[${string}]`]: undefined; [x: `int256[${string}]`]: undefined; [x: `uint[${string}]`]: undefined; [x: `uint40[${string}]`]: undefined; [x: `uint16[${string}]`]: undefined; [x: `uint56[${string}]`]: undefined; [x: `uint8[${string}]`]: undefined; [x: `uint24[${string}]`]: undefined; [x: `uint32[${string}]`]: undefined; [x: `uint48[${string}]`]: undefined; [x: `uint64[${string}]`]: undefined; [x: `uint72[${string}]`]: undefined; [x: `uint80[${string}]`]: undefined; [x: `uint88[${string}]`]: undefined; [x: `uint96[${string}]`]: undefined; [x: `uint104[${string}]`]: undefined; [x: `uint112[${string}]`]: undefined; [x: `uint120[${string}]`]: undefined; [x: `uint128[${string}]`]: undefined; [x: `uint136[${string}]`]: undefined; [x: `uint144[${string}]`]: undefined; [x: `uint152[${string}]`]: undefined; [x: `uint160[${string}]`]: undefined; [x: `uint168[${string}]`]: undefined; [x: `uint176[${string}]`]: undefined; [x: `uint184[${string}]`]: undefined; [x: `uint192[${string}]`]: undefined; [x: `uint200[${string}]`]: undefined; [x: `uint208[${string}]`]: undefined; [x: `uint216[${string}]`]: undefined; [x: `uint224[${string}]`]: undefined; [x: `uint232[${string}]`]: undefined; [x: `uint240[${string}]`]: undefined; [x: `uint248[${string}]`]: undefined; [x: `uint256[${string}]`]: undefined; string?: never; address?: never; bool?: never; bytes?: never; bytes5?: never; bytes3?: never; bytes16?: never; bytes1?: never; bytes2?: never; bytes4?: never; bytes6?: never; bytes7?: never; bytes8?: never; bytes9?: never; bytes10?: never; bytes11?: never; bytes12?: never; bytes13?: never; bytes14?: never; bytes15?: never; bytes17?: never; bytes18?: never; bytes19?: never; bytes20?: never; bytes21?: never; bytes22?: never; bytes23?: never; bytes24?: never; bytes25?: never; bytes26?: never; bytes27?: never; bytes28?: never; bytes29?: never; bytes30?: never; bytes31?: never; bytes32?: never; int40?: never; int16?: never; int56?: never; int8?: never; int24?: never; int32?: never; int48?: never; int64?: never; int72?: never; int80?: never; int88?: never; int96?: never; int104?: never; int112?: never; int120?: never; int128?: never; int136?: never; int144?: never; int152?: never; int160?: never; int168?: never; int176?: never; int184?: never; int192?: never; int200?: never; int208?: never; int216?: never; int224?: never; int232?: never; int240?: never; int248?: never; int256?: never; uint40?: never; uint16?: never; uint56?: never; uint8?: never; uint24?: never; uint32?: never; uint48?: never; uint64?: never; uint72?: never; uint80?: never; uint88?: never; uint96?: never; uint104?: never; uint112?: never; uint120?: never; uint128?: never; uint136?: never; uint144?: never; uint152?: never; uint160?: never; uint168?: never; uint176?: never; uint184?: never; uint192?: never; uint200?: never; uint208?: never; uint216?: never; uint224?: never; uint232?: never; uint240?: never; uint248?: never; uint256?: never; }; } & { primaryType: string; domain?: { chainId?: number | undefined; name?: string | undefined; salt?: `0x${string}` | undefined; verifyingContract?: `0x${string}` | undefined; version?: string | undefined; } | undefined; message: Record<string, unknown>; }]; ReturnType: Promise<`0x${string}`>; }]>; }>; //# sourceMappingURL=index.d.ts.map