types

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LatestBlockNumber mapping from "latest" to 0 for tm query
	LatestBlockNumber = BlockNumber(-2)

	// PendingBlockNumber mapping from "pending" to -1 for tm query
	PendingBlockNumber = BlockNumber(-1)

	// EarliestBlockNumber mapping from "earliest" to 1 for tm query (earliest query not supported)
	EarliestBlockNumber = BlockNumber(1)
)
View Source
const (

	// ProtocolVersion is the latest supported version of the eth protocol.
	ProtocolVersion = eth65

	// consider a filter inactive if it has not been polled for within deadline
	Deadline = 5 * time.Minute
)

Constants to match up protocol versions and messages

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Nonce     *hexutil.Uint64              `json:"nonce"`
	Code      *hexutil.Bytes               `json:"code"`
	Balance   **hexutil.Big                `json:"balance"`
	State     *map[common.Hash]common.Hash `json:"state"`
	StateDiff *map[common.Hash]common.Hash `json:"stateDiff"`
}

Account indicates the overriding fields of account during the execution of a message call. NOTE: state and stateDiff can't be specified at the same time. If state is set, message execution will only use the data in the given state. Otherwise if statDiff is set, all diff will be applied first and then execute the call message.

type BlockNumber

type BlockNumber int64

BlockNumber represents decoding hex string to block values

func NewBlockNumber

func NewBlockNumber(n *big.Int) BlockNumber

NewBlockNumber creates a new BlockNumber instance.

func (BlockNumber) Int64

func (bn BlockNumber) Int64() int64

Int64 converts block number to primitive type

func (*BlockNumber) UnmarshalJSON

func (bn *BlockNumber) UnmarshalJSON(data []byte) error

UnmarshalJSON parses the given JSON fragment into a BlockNumber. It supports: - "latest", "earliest" or "pending" as string arguments - the block number Returned errors: - an invalid block number error when the given argument isn't a known strings - an out of range error when the given block number is either too little or too large

type BlockNumberOrHash

type BlockNumberOrHash struct {
	BlockNumber *BlockNumber `json:"blockNumber,omitempty"`
	BlockHash   *common.Hash `json:"blockHash,omitempty"`
}

BlockNumberOrHash supports querying data through block height or block hash

func BlockNumberOrHashWithHash

func BlockNumberOrHashWithHash(hash common.Hash, canonical bool) BlockNumberOrHash

func BlockNumberOrHashWithNumber

func BlockNumberOrHashWithNumber(blockNr BlockNumber) BlockNumberOrHash

func (*BlockNumberOrHash) Hash

func (bnh *BlockNumberOrHash) Hash() (common.Hash, bool)

func (*BlockNumberOrHash) Number

func (bnh *BlockNumberOrHash) Number() (BlockNumber, bool)

func (*BlockNumberOrHash) String

func (bnh *BlockNumberOrHash) String() string

func (*BlockNumberOrHash) UnmarshalJSON

func (bnh *BlockNumberOrHash) UnmarshalJSON(data []byte) error

type DecimalOrHex

type DecimalOrHex uint64

DecimalOrHex unmarshals a non-negative decimal or hex parameter into a uint64.

func (*DecimalOrHex) UnmarshalJSON

func (dh *DecimalOrHex) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RPCTransaction

type RPCTransaction struct {
	BlockHash        *common.Hash      `json:"blockHash"`
	BlockNumber      *hexutil.Big      `json:"blockNumber"`
	From             common.Address    `json:"from"`
	Gas              hexutil.Uint64    `json:"gas"`
	GasPrice         *hexutil.Big      `json:"gasPrice"`
	GasFeeCap        *hexutil.Big      `json:"maxFeePerGas,omitempty"`
	GasTipCap        *hexutil.Big      `json:"maxPriorityFeePerGas,omitempty"`
	Hash             common.Hash       `json:"hash"`
	Input            hexutil.Bytes     `json:"input"`
	Nonce            hexutil.Uint64    `json:"nonce"`
	To               *common.Address   `json:"to"`
	TransactionIndex *hexutil.Uint64   `json:"transactionIndex"`
	Value            *hexutil.Big      `json:"value"`
	Type             hexutil.Uint64    `json:"type"`
	Accesses         *types.AccessList `json:"accessList,omitempty"`
	ChainID          *hexutil.Big      `json:"chainId,omitempty"`
	V                *hexutil.Big      `json:"v"`
	R                *hexutil.Big      `json:"r"`
	S                *hexutil.Big      `json:"s"`
}

RPCTransaction represents a transaction that will serialize to the RPC representation of a transaction

Jump to

Keyboard shortcuts

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