UNPKG

@turnkey/eip-1193-provider

Version:

EIP-1193 Provider for Turnkey.

18 lines 1.3 kB
import { AddEthereumChainParameter, Chain, RpcTransactionRequest } from "viem"; import type { WalletAddEthereumChain } from "./types"; export declare const preprocessTransaction: ({ from, ...transaction }: RpcTransactionRequest) => string; export declare const isValidUrl: (url: string) => boolean; export declare const validateBlockExplorerUrls: (blockExplorerUrls: WalletAddEthereumChain["blockExplorerUrls"], chainName: string) => Chain["blockExplorers"]; /** * Validates the array of RPC URLs provided in the AddEthereumChainParameter. * It checks if the array is not empty and if every URL in the array starts with "https://". * Throws an RpcUrlsRequiredError if the array is empty or undefined. * Throws an InvalidRpcUrlError if any URL in the array does not start with "https://". * * @param {AddEthereumChainParameter['rpcUrls']} rpcUrls - The array of RPC URLs to validate. * @throws {RpcUrlsRequiredError} If the rpcUrls array is empty or undefined. * @throws {InvalidRpcUrlError} If any URL in the rpcUrls array is invalid. */ export declare const validateRpcUrls: (rpcUrls: AddEthereumChainParameter["rpcUrls"]) => void; export declare const validateChain: (chain: AddEthereumChainParameter, addedChains: AddEthereumChainParameter[]) => void; //# sourceMappingURL=utils.d.ts.map