evm

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 4 Imported by: 6

Documentation

Index

Constants

View Source
const AddressLength = 20
View Source
const HashLength = 32

Variables

This section is empty.

Functions

This section is empty.

Types

type ABIPayload

type ABIPayload = []byte

represents solidity-spec abi encoded bytes

type Address

type Address = [AddressLength]byte

represents evm-style address

type BalanceAtReply added in v0.9.0

type BalanceAtReply struct {
	Balance *big.Int
}

type BalanceAtRequest added in v0.9.0

type BalanceAtRequest struct {
	Address         Address
	BlockNumber     *big.Int
	ConfidenceLevel primitives.ConfidenceLevel
}

type CallContractReply added in v0.9.0

type CallContractReply struct {
	Data []byte
}

type CallContractRequest added in v0.9.0

type CallContractRequest struct {
	Msg             *CallMsg
	BlockNumber     *big.Int
	ConfidenceLevel primitives.ConfidenceLevel
	IsExternal      bool // if true, limits like response size limit may be applied
}

type CallMsg

type CallMsg struct {
	To   Address
	From Address // from field is needed if contract read depends on msg.sender
	Data ABIPayload
}

matches simplifie evm-style callMsg for reads/EstimateGas

type FilterLogsReply added in v0.9.0

type FilterLogsReply struct {
	Logs []*Log
}

type FilterLogsRequest added in v0.9.0

type FilterLogsRequest struct {
	FilterQuery     FilterQuery
	ConfidenceLevel primitives.ConfidenceLevel
	IsExternal      bool // if true, limits like response size limit may be applied
}

type FilterQuery

type FilterQuery struct {
	BlockHash Hash      // for filter by exact block, if not empty can't use from/to
	FromBlock *big.Int  // start block range
	ToBlock   *big.Int  // end block range
	Addresses []Address // contract(s) to filter logs from

	// The Topic list restricts matches to particular event topics. Each event has a list
	// of topics. Topics matches a prefix of that list. An empty element slice matches any
	// topic. Non-empty elements represent an alternative that matches any of the
	// contained topics.
	//
	// Examples:
	// {} or nil          matches any topic list
	// {{A}}              matches topic A in first position
	// {{}, {B}}          matches any topic in first position AND B in second position
	// {{A}, {B}}         matches topic A in first position AND B in second position
	// {{A, B}, {C, D}}   matches topic (A OR B) in first position AND (C OR D) in second position
	Topics [][]Hash // filter log by event sigs and indexed args
}

matches evm-style eth_getLogs filterQuery

type GasConfig

type GasConfig struct {
	// Default to nil. If not specified the value configured in GasEstimator will be used
	GasLimit *uint64
	// Default to nil. If not specified the value configured in GasEstimator will be used
	MaxGasPrice *big.Int
}

type GeTransactionReceiptRequest added in v0.9.0

type GeTransactionReceiptRequest struct {
	Hash       Hash
	IsExternal bool // if true, limits like response size limit may be applied
}

type GetTransactionByHashRequest added in v0.9.0

type GetTransactionByHashRequest struct {
	Hash       Hash
	IsExternal bool // if true, limits like response size limit may be applied
}

type Hash

type Hash = [HashLength]byte

represents evm-style hash

type Header struct {
	Timestamp  uint64 // time in seconds
	Hash       Hash
	ParentHash Hash
	Number     *big.Int
}

matches simplified evm-style head

type HeaderByNumberReply added in v0.9.0

type HeaderByNumberReply struct {
	Header *Header
}

type HeaderByNumberRequest added in v0.9.0

type HeaderByNumberRequest struct {
	Number          *big.Int
	ConfidenceLevel primitives.ConfidenceLevel
	IsExternal      bool // if true, limits like response size limit may be applied
}

type LPBlock added in v0.9.7

type LPBlock struct {
	BlockHash            Hash
	LatestBlockNumber    int64
	BlockTimestamp       uint64
	FinalizedBlockNumber int64
	SafeBlockNumber      int64
}

matches LP Block ths block shows the Latest,Finalized,Safe blocks from LogPoller's perspective

type LPFilterQuery

type LPFilterQuery struct {
	Name         string        // filter identifier, used to remove filter
	Addresses    []Address     // list of addresses to include
	EventSigs    []Hash        // list of possible signatures
	Topic2       []Hash        // list of possible values for topic2
	Topic3       []Hash        // list of possible values for topic3
	Topic4       []Hash        // list of possible values for topic3
	Retention    time.Duration // maximum amount of time to retain
	MaxLogsKept  uint64        // maximum number of logs to retain ( 0 = unlimited )
	LogsPerBlock uint64        // rate limit ( maximum # of logs per block, 0 = unlimited )
}

matches cache-filter this filter defines what logs should be cached cached logs can be retrieved with [types.EVMService.QueryLogsFromCache]

type Log

type Log struct {
	LogIndex    uint32     // index of the log inside of the block
	BlockHash   Hash       // hash of the block containing this log
	BlockNumber *big.Int   // number of the block containing this log
	Topics      []Hash     // indexed fields of the log
	EventSig    Hash       // keccak256 hash of log event signature
	Address     Address    // address of the contract that emmited the log
	TxHash      Hash       // hash of the transaction this log is produced by
	Data        ABIPayload // abi encoded data of the log
	Removed     bool       // flag if log was removed during reorg
}

matches evm-style logs

type Receipt

type Receipt struct {
	Status            uint64   // 1 for success 0 for revert
	Logs              []*Log   // logs emmited by the transaction
	TxHash            Hash     // hash of the transaction this receipt is for
	ContractAddress   Address  // Address of the contract if one was created by this transaction
	GasUsed           uint64   // actual gas used during execution in gas units
	BlockHash         Hash     // hash of the block containing this receipt
	BlockNumber       *big.Int // number of the block containing this receipt
	TransactionIndex  uint64   // index of the transaction inside of the block
	EffectiveGasPrice *big.Int // actual price in wei paid per gas unit
}

matches evm-style receipt

type ReceiptGasInfo

type ReceiptGasInfo struct {
	GasUsed           uint64   // actual gas used during execution in gas units
	EffectiveGasPrice *big.Int // actual price in wei paid per gas unit
}

type SignedReport

type SignedReport struct {
	RawReport     []byte
	ReportContext []byte
	Signatures    [][]byte
	ID            []byte
}

type SubmitTransactionRequest

type SubmitTransactionRequest struct {
	To   Address
	Data ABIPayload
	// Default to nil. If not specified the configured gas estimator config will be used
	GasConfig *GasConfig
}

type Transaction

type Transaction struct {
	To       Address    // receipient address
	Data     ABIPayload // input data for func call payload
	Hash     Hash       // derived from transaction structure
	Nonce    uint64     // number of txs sent from sender
	Gas      uint64     // max gas allowed per execution (in gas units)
	GasPrice *big.Int   // price for a single gas unit in wei
	Value    *big.Int   // amount of eth sent in wei
}

matches evm-style transaction

type TransactionFee

type TransactionFee struct {
	TransactionFee *big.Int // Cost of transaction in wei
}

type TransactionResult

type TransactionResult struct {
	TxStatus         TransactionStatus
	TxHash           Hash
	TxIdempotencyKey string // Idempotency key used for tracking purposes of transactions.
}

type TransactionStatus

type TransactionStatus int

TransactionStatus is the result of the transaction sent to the chain

const (
	// Transaction processing failed due to a network issue, RPC issue, or other fatal error
	TxFatal TransactionStatus = iota
	// Transaction was sent successfully to the chain but the smart contract execution reverted
	TxReverted
	// Transaction was sent successfully to the chain, smart contract executed successfully and mined into a block.
	TxSuccess
)

type TxError

type TxError struct {
	// Internal ID used for tracking purposes of transactions.
	TxID string
}

func (*TxError) Error

func (e *TxError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL