import type * as EthSigUtil from "eth-sig-util"; import type * as TransactionTypes from "@ganache/ethereum-transaction"; import type * as UtilTypes from "@ganache/ethereum-utils"; import type { EthereumProvider, Externalize } from "./provider"; import { BlockHeader, Withdrawal } from "@ganache/ethereum-block"; import { Data, Quantity } from "@ganache/utils"; import { CallOverrides } from "./helpers/run-call"; import { Log, InternalTag } from "@ganache/ethereum-utils"; type EthSignedDataParams = Parameters[1]["data"]; type AsCall = Flatten & { readonly from?: string; }>; type AsPooled = Flatten & { blockNumber: null; blockHash: null; transactionIndex: null; }>; type PublicPrivate = "public" | "private"; /** * Since our types come from all over the place and get smushed together and * pulled apart, we "Flatten" (there is probably a * better word) these type complexities by using a TypeScript trick: * `Pick`. This picks all the keys (and their values) from T, * resulting in the same type shape, but the intermediate types are all skipped * and intersections are simplified. * * ``` * type SomeTypes = {prop: string, prop2: number}; * type Thing = Omit & {addProp: true}; * ``` * gets turned into * ``` * type Thing = {prop: string, addProp: true} * ``` */ type Flatten = Pick; /** Public types */ export declare namespace Ethereum { type Provider = EthereumProvider; type Tag = keyof typeof InternalTag; type TraceTransactionOptions = UtilTypes.TraceTransactionOptions; type TraceTransactionResult

= P extends "public" ? Externalize> : UtilTypes.TraceTransactionResult; type StorageRangeAtResult

= P extends "public" ? Externalize> : UtilTypes.StorageRangeAtResult; type SubscriptionOptions = UtilTypes.BaseFilterArgs; type LogsFilter = UtilTypes.FilterArgs; type Filter = UtilTypes.RangeFilterArgs; type SubscriptionName = UtilTypes.SubscriptionName; type SubscriptionId = UtilTypes.SubscriptionId; type Logs = Log[]; namespace Transaction { type Legacy = Flatten; type EIP1559 = Flatten; type EIP2930 = Flatten; /** * Transaction receipt returned from `eth_getTransactionReceipt` */ type Receipt

= P extends "public" ? Externalize> : TransactionTypes.TransactionReceipt; } /** * Transaction types sent to `eth_sendTransaction` and * `personal_sendTransaction` */ type Transaction = Ethereum.Transaction.Legacy | Ethereum.Transaction.EIP1559 | Ethereum.Transaction.EIP2930; namespace Call { namespace Transaction { type Legacy = AsCall; type EIP1559 = AsCall; type EIP2930 = AsCall; } type Transaction = Ethereum.Call.Transaction.Legacy | Ethereum.Call.Transaction.EIP1559 | Ethereum.Call.Transaction.EIP2930; type Overrides = CallOverrides; } namespace Pool { namespace Transaction { type Legacy = AsPooled; type EIP1559 = AsPooled; type EIP2930 = AsPooled; } /** * Pending and Executable transactions that are still in the transaction pool * and do not yet have a blockNumber, blockHash, and transactionIndex. */ type Transaction

= AsPooled>; type Content

= { pending: Record>>; queued: Record>>; }; } namespace Block { type Header

= P extends "public" ? Externalize> : BlockHeader; namespace Transaction { type Legacy = Externalize; type EIP2930 = Externalize; type EIP1559 = Externalize; } type Transaction

= P extends "public" ? Externalize> : TransactionTypes.LegacyTransactionJSON | TransactionTypes.EIP2930AccessListTransactionJSON | TransactionTypes.EIP1559FeeMarketTransactionJSON; } /** * A Block as it is returned from eth_getBlockByNumber and eth_getBlockByHash. */ type Block = P extends "public" ? Externalize> : { hash: Data; size: Quantity; transactions: IncludeTransactions extends true ? (Ethereum.Block.Transaction

| Ethereum.Pool.Transaction

)[] : Data[]; uncles: Data[]; withdrawals?: Withdrawal[]; } & Ethereum.Block.Header

; type MineOptions = { timestamp?: number; blocks?: number; }; type TypedData = Exclude; type WhisperPostObject = UtilTypes.WhisperPostObject; type FeeHistory

= P extends "public" ? Externalize> : UtilTypes.FeeHistory; type AccountProof

= P extends "public" ? Externalize> : UtilTypes.AccountProof; } export {}; //# sourceMappingURL=api-types.d.ts.map