import type { RpcTypes } from '../rpc/Rpc'; import { TPlatform } from './TPlatform'; export declare namespace TEth { type Hex = `0x${string}`; type HexRaw = `${string}`; type Address = `0x${string}`; type BufferLike = Hex | Uint8Array; interface Block = Hex | Partial> { hash: Hex; parentHash: Hex; sha3Uncles: Hex; miner: Address; stateRoot: Hex; transactionsRoot: Hex; receiptsRoot: Hex; logsBloom: Hex; difficulty: bigint; number: number; gasLimit: bigint; gasUsed: bigint; timestamp: number; extraData: Hex; mixHash: Hex; nonce: Hex; totalDifficulty: bigint; baseFeePerGas: bigint; withdrawalsRoot: Hex; size: bigint; transactions: TxType[]; withdrawals: { index: bigint; validatorIndex: bigint; address: Address; amount: bigint; }[]; uncles: Hex[]; } interface Tx { type?: 0 | 1 | 2 | number; hash?: Hex; blockNumber?: number; nonce: number; to?: Address; from?: Address; gas?: bigint; value?: bigint; input?: Hex; data?: Hex; gasPrice?: bigint; maxPriorityFeePerGas?: bigint; maxFeePerGas?: bigint; accessList?: AccessListItem[]; chainId: number; } type TxLike = DataLike; interface TxSigned extends Tx { yParity?: number; v?: number; r: Hex; s: Hex; } interface TxReceipt { status: 0 | 1 | number; transactionHash: Hex; transactionIndex: bigint; blockHash: Hex; blockNumber: number; from: Address; to: Address; contractAddress?: Address; cumulativeGasUsed: bigint; gasUsed: bigint; effectiveGasPrice: bigint; logs: Log[]; logsBloom: Hex; events?: { [eventName: string]: EventLog; }; } interface EventLog { event: string; address: Address; returnValues: any; logIndex: number; transactionIndex: number; transactionHash: Hex; blockHash: Hex; blockNumber: number; raw?: { data: string; topics: any[]; }; } interface Log { address: Address; data: Hex; topics: Hex[]; logIndex: number; transactionIndex: number; transactionHash: Hex; blockHash: Hex; blockNumber: number; } interface AccessListItem { address: Address; storageKeys: Hex[]; } type Platform = 'eth' | 'eth:goerli' | 'bsc' | 'polygon' | 'arbitrum' | 'xdai' | 'boba' | 'hardhat' | 'optimism' | 'avalanche' | string; interface IAccount { type?: 'eoa' | 'safe' | 'erc4337' | 'timelock' | 'impersonated'; name?: string; address?: Address; platform?: Platform; } interface EoAccount extends IAccount { type?: 'eoa' | 'impersonated'; key?: TEth.Hex | `p1:0x${string}`; signer?: IRpcSigner; } interface IRpcSigner { eth_sign(account: TEth.Address, data: TEth.Hex): Promise; eth_signTransaction(tx: TEth.TxLike): Promise; eth_signTypedData_v4(address: TEth.Address, typedData: Partial): Promise; personal_sign(challenge: string, address: TEth.Address): Promise; } interface SafeAccount extends IAccount { type: 'safe'; provider?: 'gnosis'; platform: TPlatform; /** * @deprecated backcomp. Use `address` prop */ safeAddress?: Address; operator: EoAccount; } interface Erc4337Account extends IAccount { type: 'erc4337'; provider?: 'default' | string; platform: TPlatform; operator: EoAccount; } type DataLike = { [P in keyof T]?: T[P] extends bigint ? bigint | number | string | TEth.Hex : (T[P] extends number ? number | TEth.Hex | bigint : (T[P] extends [] ? DataLike[] : DataLike)); }; namespace Abi { type Type = 'function' | 'constructor' | 'event' | 'error' | 'fallback' | 'receive'; type StateMutabilityType = 'constant' | 'pure' | 'view' | 'nonpayable' | 'payable'; interface Item { anonymous?: boolean; constant?: boolean; inputs?: Input[]; name?: string; outputs?: Output[]; payable?: boolean; stateMutability?: StateMutabilityType; type: Type; gas?: number; signature?: string; } interface Input { name?: string; type: string; indexed?: boolean; components?: Input[]; internalType?: string; } interface Output { name?: string; type: string; components?: Output[]; internalType?: string; } } }