import type { Address } from 'abitype'; import type { BlobSidecar } from './eip4844.js'; import type { FeeValuesEIP1559, FeeValuesEIP4844, FeeValuesLegacy } from './fee.js'; import type { Kzg } from './kzg.js'; import type { Log } from './log.js'; import type { ByteArray, Hash, Hex, Signature } from './misc.js'; import type { Branded, ExactPartial, IsNever, Omit, OneOf, RequiredBy } from './utils.js'; export type AccessList = readonly { address: Address; storageKeys: readonly Hex[]; }[]; export type TransactionType = 'legacy' | 'eip1559' | 'eip2930' | 'eip4844' | (string & {}); export type TransactionReceipt = { /** The actual value per gas deducted from the sender's account for blob gas. Only specified for blob transactions as defined by EIP-4844. */ blobGasPrice?: quantity | undefined; /** The amount of blob gas used. Only specified for blob transactions as defined by EIP-4844. */ blobGasUsed?: quantity | undefined; /** Hash of block containing this transaction */ blockHash: Hash; /** Number of block containing this transaction */ blockNumber: quantity; /** Address of new contract or `null` if no contract was created */ contractAddress: Address | null | undefined; /** Gas used by this and all preceding transactions in this block */ cumulativeGasUsed: quantity; /** Pre-London, it is equal to the transaction's gasPrice. Post-London, it is equal to the actual gas price paid for inclusion. */ effectiveGasPrice: quantity; /** Transaction sender */ from: Address; /** Gas used by this transaction */ gasUsed: quantity; /** List of log objects generated by this transaction */ logs: Log[]; /** Logs bloom filter */ logsBloom: Hex; /** The post-transaction state root. Only specified for transactions included before the Byzantium upgrade. */ root?: Hash | undefined; /** `success` if this transaction was successful or `reverted` if it failed */ status: status; /** Transaction recipient or `null` if deploying a contract */ to: Address | null; /** Hash of this transaction */ transactionHash: Hash; /** Index of this transaction in the block */ transactionIndex: index; /** Transaction type */ type: type; }; export type TransactionBase = { /** Hash of block containing this transaction or `null` if pending */ blockHash: isPending extends true ? null : Hash; /** Number of block containing this transaction or `null` if pending */ blockNumber: isPending extends true ? null : quantity; /** Transaction sender */ from: Address; /** Gas provided for transaction execution */ gas: quantity; /** Hash of this transaction */ hash: Hash; /** Contract code or a hashed method call */ input: Hex; /** Unique number identifying this transaction */ nonce: index; /** ECDSA signature r */ r: Hex; /** ECDSA signature s */ s: Hex; /** Transaction recipient or `null` if deploying a contract */ to: Address | null; /** Index of this transaction in the block or `null` if pending */ transactionIndex: isPending extends true ? null : index; /** The type represented as hex. */ typeHex: Hex | null; /** ECDSA recovery ID */ v: quantity; /** Value in wei sent with this transaction */ value: quantity; /** The parity of the y-value of the secp256k1 signature. */ yParity: index; }; export type TransactionLegacy = Omit, 'yParity'> & { /** EIP-2930 Access List. */ accessList?: undefined; blobVersionedHashes?: undefined; /** Chain ID that this transaction is valid on. */ chainId?: index | undefined; yParity?: undefined; type: type; } & FeeValuesLegacy; export type TransactionEIP2930 = TransactionBase & { /** EIP-2930 Access List. */ accessList: AccessList; blobVersionedHashes?: undefined; /** Chain ID that this transaction is valid on. */ chainId: index; type: type; } & FeeValuesLegacy; export type TransactionEIP1559 = TransactionBase & { /** EIP-2930 Access List. */ accessList: AccessList; blobVersionedHashes?: undefined; /** Chain ID that this transaction is valid on. */ chainId: index; type: type; } & FeeValuesEIP1559; export type TransactionEIP4844 = TransactionBase & { /** EIP-2930 Access List. */ accessList: AccessList; /** List of versioned blob hashes associated with the transaction's blobs. */ blobVersionedHashes: readonly Hex[]; /** Chain ID that this transaction is valid on. */ chainId: index; type: type; } & FeeValuesEIP4844; export type Transaction = OneOf | TransactionEIP2930 | TransactionEIP1559 | TransactionEIP4844>; export type TransactionRequestBase = { /** Contract code or a hashed method call with encoded args */ data?: Hex | undefined; /** Transaction sender */ from: Address; /** Gas provided for transaction execution */ gas?: quantity | undefined; /** Unique number identifying this transaction */ nonce?: index | undefined; /** Transaction recipient */ to?: Address | null | undefined; /** Value in wei sent with this transaction */ value?: quantity | undefined; }; export type TransactionRequestLegacy = TransactionRequestBase & { accessList?: undefined; blobs?: undefined; type?: type | undefined; } & ExactPartial>; export type TransactionRequestEIP2930 = TransactionRequestBase & { accessList?: AccessList | undefined; blobs?: undefined; type?: type | undefined; } & ExactPartial>; export type TransactionRequestEIP1559 = TransactionRequestBase & ExactPartial> & { accessList?: AccessList | undefined; blobs?: undefined; type?: type | undefined; }; export type TransactionRequestEIP4844 = RequiredBy, 'to'> & { accessList?: AccessList | undefined; /** The blobs associated with this transaction. */ blobs: readonly Hex[] | readonly ByteArray[]; blobVersionedHashes?: readonly Hex[] | undefined; kzg?: Kzg | undefined; sidecars?: readonly BlobSidecar[] | undefined; type?: type | undefined; } & RequiredBy>, 'maxFeePerBlobGas'>; export type TransactionRequest = OneOf | TransactionRequestEIP2930 | TransactionRequestEIP1559 | TransactionRequestEIP4844>; export type TransactionRequestGeneric = TransactionRequestBase & { accessList?: AccessList | undefined; blobs?: readonly Hex[] | readonly ByteArray[] | undefined; blobVersionedHashes?: readonly Hex[] | undefined; gasPrice?: quantity | undefined; maxFeePerBlobGas?: quantity | undefined; maxFeePerGas?: quantity | undefined; maxPriorityFeePerGas?: quantity | undefined; type?: string | undefined; }; export type TransactionSerializedEIP1559 = `0x02${string}`; export type TransactionSerializedEIP2930 = `0x01${string}`; export type TransactionSerializedEIP4844 = `0x03${string}`; export type TransactionSerializedLegacy = Branded<`0x${string}`, 'legacy'>; export type TransactionSerializedGeneric = `0x${string}`; export type TransactionSerialized = IsNever extends true ? TransactionSerializedGeneric : result; export type TransactionSerializableBase = Omit, 'from'> & ExactPartial; export type TransactionSerializableLegacy = TransactionSerializableBase & { accessList?: undefined; blobs?: undefined; blobVersionedHashes?: undefined; chainId?: number | undefined; type?: 'legacy' | undefined; } & ExactPartial>; export type TransactionSerializableEIP2930 = TransactionSerializableBase & { accessList?: AccessList | undefined; blobs?: undefined; blobVersionedHashes?: undefined; chainId: number; type?: 'eip2930' | undefined; yParity?: number | undefined; } & ExactPartial>; export type TransactionSerializableEIP1559 = TransactionSerializableBase & { accessList?: AccessList | undefined; blobs?: undefined; blobVersionedHashes?: undefined; chainId: number; type?: 'eip1559' | undefined; yParity?: number | undefined; } & ExactPartial>; export type TransactionSerializableEIP4844 = TransactionSerializableBase & { accessList?: AccessList | undefined; chainId: number; sidecars?: readonly BlobSidecar[] | false | undefined; type?: 'eip4844' | undefined; yParity?: number | undefined; } & ExactPartial> & OneOf<{ blobs?: readonly Hex[] | readonly ByteArray[] | undefined; blobVersionedHashes: readonly Hex[]; } | { blobs: readonly Hex[] | readonly ByteArray[]; blobVersionedHashes?: readonly Hex[] | undefined; kzg: Kzg; }>; export type TransactionSerializable = OneOf | TransactionSerializableEIP2930 | TransactionSerializableEIP1559 | TransactionSerializableEIP4844>; export type TransactionSerializableGeneric = TransactionSerializableBase & { accessList?: AccessList | undefined; blobs?: readonly Hex[] | readonly ByteArray[] | undefined; blobVersionedHashes?: readonly Hex[] | undefined; chainId?: number | undefined; gasPrice?: quantity | undefined; maxFeePerBlobGas?: quantity | undefined; maxFeePerGas?: quantity | undefined; maxPriorityFeePerGas?: quantity | undefined; sidecars?: readonly BlobSidecar[] | false | undefined; type?: string | undefined; }; //# sourceMappingURL=transaction.d.ts.map