Documentation ¶
Index ¶
- Variables
- type Address
- func (addr Address) MarshalJSON() ([]byte, error)
- func (addr Address) MarshalText() (text []byte, err error)
- func (addr *Address) Scan(value interface{}) error
- func (address Address) String() string
- func (addr *Address) UnmarshalJSON(data []byte) error
- func (addr *Address) UnmarshalText(text []byte) error
- func (addr Address) Value() (driver.Value, error)
- type BlockHeader
- type BlockNonce
- type Hash
- func (hash Hash) MarshalJSON() ([]byte, error)
- func (hash Hash) MarshalText() (text []byte, err error)
- func (hash *Hash) Scan(value interface{}) error
- func (hash Hash) String() string
- func (addr *Hash) UnmarshalJSON(data []byte) error
- func (hash *Hash) UnmarshalText(text []byte) error
- func (hash Hash) Value() (driver.Value, error)
- type Log
- type Receipt
- type StakingEvent
- type Transaction
Constants ¶
This section is empty.
Variables ¶
var ZeroAddress = AddressFromString("0x0000000000000000000000000000000000000000")
ZeroAddress for minting or burning or nil values
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
these are unexported to force users to go through our normalisation methods
func AddressFromString ¶
AddressFromString, taking the string and making it lowercase then coercing, does no safety checks!
func (Address) MarshalJSON ¶
MarshalJSON and UnmarshalJSON implement the json interface, allowing us to pass this over rabbit and redis
func (Address) MarshalText ¶
func (*Address) UnmarshalJSON ¶
func (*Address) UnmarshalText ¶
type BlockHeader ¶
type BlockHeader struct { BlockHash Hash `json:"block_hash"` ParentHash Hash `json:"parent_hash"` UncleHash Hash `json:"uncle_hash"` Coinbase Address `json:"coinbase"` Root Hash `json:"root"` TransactionHash Hash `json:"transaction_hash"` Bloom misc.Blob `json:"bloom"` Difficulty misc.BigInt `json:"difficulty"` Number misc.BigInt `json:"number"` GasLimit misc.BigInt `json:"gas_limit"` GasUsed misc.BigInt `json:"gas_used"` Time uint64 `json:"time"` Extra misc.Blob `json:"extra"` MixDigest Hash `json:"mix_digest"` Nonce BlockNonce `json:"nonce"` ReceiptHash Hash `json:"receipt_hash"` BaseFee misc.BigInt `json:"base_fee"` }
BlockHeader contained within a block on Ethereum, may be forked
func (BlockHeader) MarshalBinary ¶
func (blockHeader BlockHeader) MarshalBinary() ([]byte, error)
type BlockNonce ¶
type BlockNonce []byte
Some of the less complicated types that shadow the definition provided by Go Ethereum.
type Hash ¶
type Hash struct {
// contains filtered or unexported fields
}
Some of the less complicated types that shadow the definition provided by Go Ethereum.
func HashFromString ¶
HashFromString, taking the string and making it lowercase then coercing
func (Hash) MarshalJSON ¶
func (Hash) MarshalText ¶
func (*Hash) UnmarshalJSON ¶
func (*Hash) UnmarshalText ¶
type Log ¶
type Log struct { // address of the contract that generated the event Address Address `json:"address"` // list of topics provided by the contract. Topics []Hash `json:"topics"` // supplied by the contract, usually ABI-encoded Data misc.Blob `json:"data"` // block in which the transaction was included BlockNumber misc.BigInt `json:"block_number"` // hash of the transaction TxHash Hash `json:"transaction_hash"` // index of the transaction in the block TxIndex misc.BigInt `json:"transaction_index"` // hash of the block in which the transaction was included BlockHash Hash `json:"block_hash"` // index of the log in the block Index misc.BigInt `json:"log_index"` // whether the log was removed due to a chain reorganisation! Removed bool `json:"removed"` }
Log represents a contract event log that we have confirmed isn't removed
func (Log) MarshalBinary ¶
type Receipt ¶
type Receipt struct { Type uint8 `json:"type"` PostState misc.Blob `json:"root"` Status uint64 `json:"status"` CumulativeGasUsed uint64 `json:"cumulative_gas_used"` Bloom misc.Blob `json:"logs_bloom"` Logs []Log `json:"logs"` TransactionHash Hash `json:"transaction_hash"` ContractAddress Address `json:"contract_address"` GasUsed misc.BigInt `json:"gas_used"` BlockHash Hash `json:"block_hash"` BlockNumber misc.BigInt `json:"block_number"` TransactionIndex uint `json:"transaction_index"` }
Receipt is the type returned when you use ethclient TransactionReceipt on a transaction
func (Receipt) MarshalBinary ¶
type StakingEvent ¶
type Transaction ¶
type Transaction struct { BlockHash Hash `json:"block_hash"` Data misc.Blob `json:"data"` // GasLimit could be set by transactions prior to London GasLimit misc.BigInt `json:"gas"` // GasFeeCap is the maxFeePerGas GasFeeCap misc.BigInt `json:"gas_fee_cap"` // GasTipCap is the maxPriorityFeePerGas GasTipCap misc.BigInt `json:"gas_tip_cap"` GasPrice misc.BigInt `json:"gas_price"` Hash Hash `json:"hash"` To Address `json:"to"` From Address `json:"from"` Type uint8 `json:"type"` }
Transaction made on Ethereum, may be forked
func (Transaction) MarshalBinary ¶
func (transaction Transaction) MarshalBinary() ([]byte, error)