import { Signer, providers } from 'ethers'; import { ReadTransaction, WriteTransaction, IBlock, ISigner, ITransactionResponse, ITransactionReceipt } from '../types'; export { SyncProvider } from './eth'; export declare const SupportedVms: { readonly evm: "evm"; readonly tvm: "tvm"; readonly svm: "svm"; }; export type SupportedVm = (typeof SupportedVms)[keyof typeof SupportedVms]; export declare const MAX_CONFIRMATION = 10000; export interface SignerTypeMaps { [SupportedVms.evm]: Signer; } export interface BlockTypeMap { [SupportedVms.evm]: providers.Block; } export interface TransactionRequestTypeMap { [SupportedVms.evm]: providers.TransactionRequest; } export interface TransactionResponseTypeMap { [SupportedVms.evm]: providers.TransactionResponse; } export interface TransactionReceiptTypeMap { [SupportedVms.evm]: providers.TransactionReceipt; } /** * Defines the interface for a generic RPC provider for a given VM * S = Signer type for the transaction (whats used to sign + send a transaction) * B = Block type for the chain (whats returned when block is fetched) * T = TransactionResponse type for the chain (whats returned when transaction is submitted) * R = TransactionReceipt type for the chain (whats returned when transaction is mined) */ export type RpcProvider = { name: string; priority: number; lag: number; synced: boolean; reliability: number; latency: number; cps: number; syncedBlockNumber: number; sync(): Promise; call: (tx: ReadTransaction, block: number | string) => Promise; send: (method: string, params: unknown[]) => Promise; getTransaction: (hash: string) => Promise; prepareRequest: (method: string, params: unknown) => [string, unknown[]]; estimateGas: (tx: ReadTransaction | WriteTransaction) => Promise; getTransactionReceipt: (hash: string) => Promise; getGasPrice: () => Promise; getBlock: (block: number | string) => Promise; getBlockNumber: () => Promise; getCode: (address: string) => Promise; getBalance: (address: string, assetId: string) => Promise; getDecimals: (address: string) => Promise; getTransactionCount: (address: string, block: number | string) => Promise; getSigner: (signer: string | ISigner) => Promise; connect: (signer: ISigner | string) => Promise; }; /** * Get the VM type from a domain id * TODO: should likely move to utils? */ export declare const getVmFromDomainId: (domainId: number) => SupportedVm; /** * Returns an RPC provider for the given domain. Must pass in a qualified URL * for the given domain. */ export declare const getRpcClient: (domainId: number, url: string) => RpcProvider; //# sourceMappingURL=index.d.ts.map