import { TypedTransaction } from "@nomicfoundation/ethereumjs-tx"; import { List as ImmutableList, Map as ImmutableMap, Record as ImmutableRecord, } from "immutable"; import * as BigIntUtils from "../../util/bigint"; export interface OrderedTransaction { orderId: number; data: TypedTransaction; } interface ImmutableOrderedTransaction { orderId: number; fakeFrom: string | undefined; data: string; txType: number; } export const makeSerializedTransaction = ImmutableRecord({ orderId: 0, fakeFrom: undefined, data: "", txType: 0, }); export type SerializedTransaction = ImmutableRecord; export type SenderTransactions = ImmutableList; export type AddressToTransactions = ImmutableMap; export type HashToTransaction = ImmutableMap; export interface PoolState { pendingTransactions: AddressToTransactions; // address => list of serialized pending Transactions queuedTransactions: AddressToTransactions; // address => list of serialized queued Transactions hashToTransaction: HashToTransaction; blockGasLimit: string; } export const makePoolState = ImmutableRecord({ pendingTransactions: ImmutableMap(), queuedTransactions: ImmutableMap(), hashToTransaction: ImmutableMap(), blockGasLimit: BigIntUtils.toHex(9500000), });