Versions in this module Expand all Collapse all v1 v1.1.3 Jan 20, 2025 v1.1.2 Jan 20, 2025 Changes in this version + const BlockHashKey + const BlockNumberKey + const DefaultErrorCode + const Earliest + const EarliestBatchNumber + const EarliestBlockNumber + const Finalized + const FinalizedBatchNumber + const FinalizedBlockNumber + const InvalidParamsErrorCode + const InvalidRequestErrorCode + const Latest + const LatestBatchNumber + const LatestBlockNumber + const NotFoundErrorCode + const ParserErrorCode + const Pending + const PendingBatchNumber + const PendingBlockNumber + const RequireCanonicalKey + const RevertedErrorCode + const Safe + const SafeBatchNumber + const SafeBlockNumber + var ErrBatchRequestsDisabled = fmt.Errorf("batch requests are disabled") + var ErrBatchRequestsLimitExceeded = fmt.Errorf("batch requests limit exceeded") + type ArgAddress common.Address + func (arg *ArgAddress) Address() common.Address + func (b *ArgAddress) UnmarshalText(input []byte) error + type ArgBig big.Int + func (a *ArgBig) UnmarshalText(input []byte) error + func (a ArgBig) MarshalText() ([]byte, error) + func (b ArgBig) Hex() string + type ArgBytes []byte + func ArgBytesPtr(b []byte) *ArgBytes + func (b *ArgBytes) UnmarshalText(input []byte) error + func (b ArgBytes) Hex() string + func (b ArgBytes) MarshalText() ([]byte, error) + type ArgHash common.Hash + func (arg *ArgHash) Hash() common.Hash + func (arg *ArgHash) UnmarshalText(input []byte) error + type ArgUint64 uint64 + func ArgUint64Ptr(a ArgUint64) *ArgUint64 + func (b *ArgUint64) UnmarshalText(input []byte) error + func (b ArgUint64) Hex() string + func (b ArgUint64) MarshalText() ([]byte, error) + type Batch struct + AccInputHash common.Hash + BatchL2Data ArgBytes + Blocks []BlockOrHash + Closed bool + Coinbase common.Address + ForcedBatchNumber *ArgUint64 + GlobalExitRoot common.Hash + LocalExitRoot common.Hash + MainnetExitRoot common.Hash + Number ArgUint64 + RollupExitRoot common.Hash + SendSequencesTxHash *common.Hash + StateRoot common.Hash + Timestamp ArgUint64 + Transactions []TransactionOrHash + VerifyBatchTxHash *common.Hash + func NewBatch(ctx context.Context, st StateInterface, batch *state.Batch, ...) (*Batch, error) + type BatchNumber int64 + func (b *BatchNumber) GetNumericBatchNumber(ctx context.Context, s StateInterface, e EthermanInterface, dbTx pgx.Tx) (uint64, Error) + func (b *BatchNumber) StringOrHex() string + func (b *BatchNumber) UnmarshalJSON(buffer []byte) error + type Block struct + BlockInfoRoot *common.Hash + Difficulty ArgUint64 + ExtraData ArgBytes + GasLimit ArgUint64 + GasUsed ArgUint64 + GlobalExitRoot *common.Hash + Hash *common.Hash + LogsBloom types.Bloom + Miner *common.Address + MixHash common.Hash + Nonce *ArgBytes + Number ArgUint64 + ParentHash common.Hash + ReceiptsRoot common.Hash + Sha3Uncles common.Hash + Size ArgUint64 + StateRoot common.Hash + Timestamp ArgUint64 + TotalDifficulty *ArgUint64 + Transactions []TransactionOrHash + TxRoot common.Hash + Uncles []common.Hash + func NewBlock(ctx context.Context, st StateInterface, hash *common.Hash, b *state.L2Block, ...) (*Block, error) + type BlockNumber int64 + func StringToBlockNumber(str string) (BlockNumber, error) + func (b *BlockNumber) GetNumericBlockNumber(ctx context.Context, s StateInterface, e EthermanInterface, dbTx pgx.Tx) (uint64, Error) + func (b *BlockNumber) StringOrHex() string + func (b *BlockNumber) UnmarshalJSON(buffer []byte) error + type BlockNumberOrHash struct + func (b *BlockNumberOrHash) Hash() *ArgHash + func (b *BlockNumberOrHash) IsHash() bool + func (b *BlockNumberOrHash) IsNumber() bool + func (b *BlockNumberOrHash) Number() *BlockNumber + func (b *BlockNumberOrHash) SetHash(hash ArgHash, requireCanonical bool) + func (b *BlockNumberOrHash) SetNumber(number BlockNumber) + func (b *BlockNumberOrHash) UnmarshalJSON(buffer []byte) error + type BlockOrHash struct + Block *Block + Hash *common.Hash + func (bh *BlockOrHash) UnmarshalJSON(input []byte) error + func (bh BlockOrHash) MarshalJSON() ([]byte, error) + type Error interface + Error func() string + ErrorCode func() int + ErrorData func() []byte + type ErrorObject struct + Code int + Data *ArgBytes + Message string + func (e *ErrorObject) RPCError() RPCError + type EthermanInterface interface + GetFinalizedBlockNumber func(ctx context.Context) (uint64, error) + GetSafeBlockNumber func(ctx context.Context) (uint64, error) + type ExitRoots struct + BlockNumber ArgUint64 + MainnetExitRoot common.Hash + RollupExitRoot common.Hash + Timestamp ArgUint64 + type Index int64 + func (i *Index) UnmarshalJSON(buffer []byte) error + type Log struct + Address common.Address + BlockHash common.Hash + BlockNumber ArgUint64 + Data ArgBytes + LogIndex ArgUint64 + Removed bool + Topics []common.Hash + TxHash common.Hash + TxIndex ArgUint64 + func NewLog(l types.Log) Log + type LogFilterRequest struct + Address interface{} + BlockHash *common.Hash + FromBlock *string + ToBlock *string + Topics []interface{} + type PoolInterface interface + AddTx func(ctx context.Context, tx types.Transaction, ip string) error + CalculateEffectiveGasPrice func(rawTx []byte, txGasPrice *big.Int, txGasUsed uint64, l1GasPrice uint64, ...) (*big.Int, error) + CountPendingTransactions func(ctx context.Context) (uint64, error) + EffectiveGasPriceEnabled func() bool + GetGasPrices func(ctx context.Context) (pool.GasPrices, error) + GetNonce func(ctx context.Context, address common.Address) (uint64, error) + GetPendingTxHashesSince func(ctx context.Context, since time.Time) ([]common.Hash, error) + GetPendingTxs func(ctx context.Context, limit uint64) ([]pool.Transaction, error) + GetTransactionByHash func(ctx context.Context, hash common.Hash) (*pool.Transaction, error) + GetTransactionByL2Hash func(ctx context.Context, hash common.Hash) (*pool.Transaction, error) + type RPCError struct + func NewRPCError(code int, err string, args ...interface{}) *RPCError + func NewRPCErrorWithData(code int, err string, data []byte, args ...interface{}) *RPCError + func (e *RPCError) ErrorCode() int + func (e *RPCError) ErrorData() []byte + func (e RPCError) Error() string + type Receipt struct + BlockHash common.Hash + BlockNumber ArgUint64 + ContractAddress *common.Address + CumulativeGasUsed ArgUint64 + EffectiveGasPrice *ArgBig + FromAddr common.Address + GasUsed ArgUint64 + Logs []*types.Log + LogsBloom types.Bloom + Root *common.Hash + Status ArgUint64 + ToAddr *common.Address + TxHash common.Hash + TxIndex ArgUint64 + TxL2Hash *common.Hash + Type ArgUint64 + func NewReceipt(tx types.Transaction, r *types.Receipt, l2Hash *common.Hash) (Receipt, error) + type Request struct + ID interface{} + JSONRPC string + Method string + Params json.RawMessage + type Response struct + Error *ErrorObject + ID interface{} + JSONRPC string + Result json.RawMessage + func NewResponse(req Request, reply []byte, err Error) Response + func (r Response) MarshalJSON() ([]byte, error) + func (s Response) Bytes() ([]byte, error) + type RevertInfo struct + Data *ArgBytes + Message string + type StateInterface interface + BatchNumberByL2BlockNumber func(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (uint64, error) + BeginStateTransaction func(ctx context.Context) (pgx.Tx, error) + DebugTransaction func(ctx context.Context, transactionHash common.Hash, ...) (*runtime.ExecutionResult, error) + EstimateGas func(transaction *types.Transaction, senderAddress common.Address, ...) (uint64, []byte, error) + GetBalance func(ctx context.Context, address common.Address, root common.Hash) (*big.Int, error) + GetBatchByNumber func(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (*state.Batch, error) + GetBatchTimestamp func(ctx context.Context, batchNumber uint64, forcedForkId *uint64, dbTx pgx.Tx) (*time.Time, error) + GetCode func(ctx context.Context, address common.Address, root common.Hash) ([]byte, error) + GetExitRootByGlobalExitRoot func(ctx context.Context, ger common.Hash, dbTx pgx.Tx) (*state.GlobalExitRoot, error) + GetL2BlockByHash func(ctx context.Context, hash common.Hash, dbTx pgx.Tx) (*state.L2Block, error) + GetL2BlockByNumber func(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (*state.L2Block, error) + GetL2BlockHashesSince func(ctx context.Context, since time.Time, dbTx pgx.Tx) ([]common.Hash, error) + GetL2BlockHeaderByNumber func(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (*state.L2Header, error) + GetL2BlockTransactionCountByHash func(ctx context.Context, hash common.Hash, dbTx pgx.Tx) (uint64, error) + GetL2BlockTransactionCountByNumber func(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (uint64, error) + GetL2BlocksByBatchNumber func(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) ([]state.L2Block, error) + GetL2TxHashByTxHash func(ctx context.Context, hash common.Hash, dbTx pgx.Tx) (*common.Hash, error) + GetLastBatchNumber func(ctx context.Context, dbTx pgx.Tx) (uint64, error) + GetLastClosedBatchNumber func(ctx context.Context, dbTx pgx.Tx) (uint64, error) + GetLastConsolidatedL2BlockNumber func(ctx context.Context, dbTx pgx.Tx) (uint64, error) + GetLastL2Block func(ctx context.Context, dbTx pgx.Tx) (*state.L2Block, error) + GetLastL2BlockNumber func(ctx context.Context, dbTx pgx.Tx) (uint64, error) + GetLastVerifiedBatch func(ctx context.Context, dbTx pgx.Tx) (*state.VerifiedBatch, error) + GetLastVerifiedBatchNumberUntilL1Block func(ctx context.Context, l1BlockNumber uint64, dbTx pgx.Tx) (uint64, error) + GetLastVerifiedL2BlockNumberUntilL1Block func(ctx context.Context, l1FinalizedBlockNumber uint64, dbTx pgx.Tx) (uint64, error) + GetLastVirtualBatchNum func(ctx context.Context, dbTx pgx.Tx) (uint64, error) + GetLastVirtualizedL2BlockNumber func(ctx context.Context, dbTx pgx.Tx) (uint64, error) + GetLatestBatchGlobalExitRoot func(ctx context.Context, dbTx pgx.Tx) (common.Hash, error) + GetLogs func(ctx context.Context, fromBlock uint64, toBlock uint64, ...) ([]*types.Log, error) + GetNativeBlockHashesInRange func(ctx context.Context, fromBlockNumber uint64, toBlockNumber uint64, dbTx pgx.Tx) ([]common.Hash, error) + GetNonce func(ctx context.Context, address common.Address, root common.Hash) (uint64, error) + GetStorageAt func(ctx context.Context, address common.Address, position *big.Int, ...) (*big.Int, error) + GetSyncingInfo func(ctx context.Context, dbTx pgx.Tx) (state.SyncingInfo, error) + GetTransactionByHash func(ctx context.Context, transactionHash common.Hash, dbTx pgx.Tx) (*types.Transaction, error) + GetTransactionByL2BlockHashAndIndex func(ctx context.Context, blockHash common.Hash, index uint64, dbTx pgx.Tx) (*types.Transaction, error) + GetTransactionByL2BlockNumberAndIndex func(ctx context.Context, blockNumber uint64, index uint64, dbTx pgx.Tx) (*types.Transaction, error) + GetTransactionByL2Hash func(ctx context.Context, transactionHash common.Hash, dbTx pgx.Tx) (*types.Transaction, error) + GetTransactionReceipt func(ctx context.Context, transactionHash common.Hash, dbTx pgx.Tx) (*types.Receipt, error) + GetTransactionsByBatchNumber func(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (txs []types.Transaction, effectivePercentages []uint8, err error) + GetVerifiedBatch func(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (*state.VerifiedBatch, error) + GetVirtualBatch func(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (*state.VirtualBatch, error) + IsL2BlockConsolidated func(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (bool, error) + IsL2BlockVirtualized func(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (bool, error) + PreProcessUnsignedTransaction func(ctx context.Context, tx *types.Transaction, sender common.Address, ...) (*state.ProcessBatchResponse, error) + ProcessUnsignedTransaction func(ctx context.Context, tx *types.Transaction, senderAddress common.Address, ...) (*runtime.ExecutionResult, error) + RegisterNewL2BlockEventHandler func(h state.NewL2BlockEventHandler) + StartToMonitorNewL2Blocks func() + type SubscriptionResponse struct + JSONRPC string + Method string + Params SubscriptionResponseParams + func (s SubscriptionResponse) Bytes() ([]byte, error) + type SubscriptionResponseParams struct + Result json.RawMessage + Subscription string + type Transaction struct + BlockHash *common.Hash + BlockNumber *ArgUint64 + ChainID ArgBig + From common.Address + Gas ArgUint64 + GasPrice ArgBig + Hash common.Hash + Input ArgBytes + L2Hash *common.Hash + Nonce ArgUint64 + R ArgBig + Receipt *Receipt + S ArgBig + To *common.Address + TxIndex *ArgUint64 + Type ArgUint64 + V ArgBig + Value ArgBig + func NewTransaction(tx types.Transaction, receipt *types.Receipt, includeReceipt bool, ...) (*Transaction, error) + func (t Transaction) CoreTx() *types.Transaction + type TransactionOrHash struct + Hash *common.Hash + Tx *Transaction + func (th *TransactionOrHash) UnmarshalJSON(input []byte) error + func (th TransactionOrHash) MarshalJSON() ([]byte, error) + type TxArgs struct + Data *ArgBytes + From *common.Address + Gas *ArgUint64 + GasPrice *ArgBytes + Input *ArgBytes + Nonce *ArgUint64 + To *common.Address + Value *ArgBytes + func (args *TxArgs) ToTransaction(ctx context.Context, st StateInterface, maxCumulativeGasUsed uint64, ...) (common.Address, *types.Transaction, error) + type ZKCounters struct + GasUsed ArgUint64 + UsedArithmetics ArgUint64 + UsedBinaries ArgUint64 + UsedKeccakHashes ArgUint64 + UsedMemAligns ArgUint64 + UsedPoseidonHashes ArgUint64 + UsedPoseidonPaddings ArgUint64 + UsedSHA256Hashes ArgUint64 + UsedSteps ArgUint64 + type ZKCountersLimits struct + MaxArithmetics ArgUint64 + MaxBinaries ArgUint64 + MaxGasUsed ArgUint64 + MaxKeccakHashes ArgUint64 + MaxMemAligns ArgUint64 + MaxPoseidonHashes ArgUint64 + MaxPoseidonPaddings ArgUint64 + MaxSHA256Hashes ArgUint64 + MaxSteps ArgUint64 + type ZKCountersResponse struct + CountersLimits ZKCountersLimits + CountersUsed ZKCounters + OOCError *string + Revert *RevertInfo + func NewZKCountersResponse(zkCounters state.ZKCounters, limits ZKCountersLimits, revert *RevertInfo, ...) ZKCountersResponse