spec

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 11 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessListEntry

type AccessListEntry struct {
	Address     []byte
	StorageKeys [][]byte
}

AccessListEntry contains a single entry in an access list.

func (*AccessListEntry) MarshalJSON

func (a *AccessListEntry) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*AccessListEntry) String

func (a *AccessListEntry) String() string

String returns a string version of the structure.

func (*AccessListEntry) UnmarshalJSON

func (a *AccessListEntry) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type BerlinBlock added in v0.7.0

type BerlinBlock struct {
	Difficulty       uint64
	ExtraData        []byte
	GasLimit         uint32
	GasUsed          uint32
	Hash             types.Hash
	LogsBloom        []byte
	Miner            types.Address
	MixHash          types.Hash
	Nonce            []byte
	Number           uint32
	ParentHash       types.Hash
	ReceiptsRoot     types.Root
	SHA3Uncles       []byte
	Size             uint32
	StateRoot        types.Root
	Timestamp        time.Time
	TotalDifficulty  *big.Int
	Transactions     []*Transaction
	TransactionsRoot types.Root
	Uncles           []types.Hash
}

BerlinBlock contains a block after the Berlin hardfork.

func (*BerlinBlock) MarshalJSON added in v0.7.0

func (b *BerlinBlock) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*BerlinBlock) String added in v0.7.0

func (b *BerlinBlock) String() string

String returns a string version of the structure.

func (*BerlinBlock) UnmarshalJSON added in v0.7.0

func (b *BerlinBlock) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type BerlinTransactionEvent added in v0.7.0

type BerlinTransactionEvent struct {
	Address          types.Address
	BlockHash        types.Hash
	BlockNumber      uint32
	Data             []byte
	Index            uint32
	Removed          bool
	Topics           []types.Hash
	TransactionHash  types.Hash
	TransactionIndex uint32
}

BerlinTransactionEvent contains a transaction event.

func (*BerlinTransactionEvent) MarshalJSON added in v0.7.0

func (t *BerlinTransactionEvent) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*BerlinTransactionEvent) String added in v0.7.0

func (t *BerlinTransactionEvent) String() string

String returns a string version of the structure.

func (*BerlinTransactionEvent) UnmarshalJSON added in v0.7.0

func (t *BerlinTransactionEvent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type BerlinTransactionReceipt added in v0.7.0

type BerlinTransactionReceipt struct {
	BlockHash         types.Hash
	BlockNumber       uint32
	ContractAddress   *types.Address
	CumulativeGasUsed uint32
	From              types.Address
	GasUsed           uint32
	Logs              []*BerlinTransactionEvent
	LogsBloom         []byte
	Status            uint32
	To                *types.Address
	TransactionHash   types.Hash
	TransactionIndex  uint32
	Type              TransactionType
}

BerlinTransactionReceipt contains a transaction receipt.

func (*BerlinTransactionReceipt) MarshalJSON added in v0.7.0

func (t *BerlinTransactionReceipt) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*BerlinTransactionReceipt) String added in v0.7.0

func (t *BerlinTransactionReceipt) String() string

String returns a string version of the structure.

func (*BerlinTransactionReceipt) UnmarshalJSON added in v0.7.0

func (t *BerlinTransactionReceipt) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Block

type Block struct {
	Fork     Fork
	Berlin   *BerlinBlock
	London   *LondonBlock
	Shanghai *ShanghaiBlock
	Cancun   *CancunBlock
}

Block is a struct that covers versioned blocks.

func (*Block) BaseFeePerGas added in v0.7.0

func (b *Block) BaseFeePerGas() uint64

BaseFeePerGas returns the base fee per gas of the block. This value will be 0 if the block does not use base fee (e.g. pre-London).

func (*Block) BlobGasUsed added in v0.9.0

func (b *Block) BlobGasUsed() (uint64, bool)

BlobGasUsed returns the blob gas used of the block. This is not available in all forks, so also returns a presence flag.

func (*Block) Difficulty added in v0.7.0

func (b *Block) Difficulty() uint64

Difficulty returns the difficulty of the block.

func (*Block) ExcessBlobGas added in v0.9.0

func (b *Block) ExcessBlobGas() (uint64, bool)

ExcessBlobGas returns the excess blob gas of the block. This is not available in all forks, so also returns a presence flag.

func (*Block) ExtraData added in v0.7.0

func (b *Block) ExtraData() []byte

ExtraData returns the extra data of the block.

func (*Block) FeeRecipient added in v0.7.0

func (b *Block) FeeRecipient() types.Address

FeeRecipient returns the fee recipient of the block. This will return the miner for pre-paris blocks.

func (*Block) GasLimit added in v0.7.0

func (b *Block) GasLimit() uint32

GasLimit returns the gas limit of the block.

func (*Block) GasUsed added in v0.7.0

func (b *Block) GasUsed() uint32

GasUsed returns the gas used of the block.

func (*Block) Hash added in v0.7.0

func (b *Block) Hash() types.Hash

Hash returns the hash of the block.

func (*Block) LogsBloom added in v0.7.0

func (b *Block) LogsBloom() []byte

LogsBloom returns the logs bloom of the block.

func (*Block) MarshalJSON added in v0.7.0

func (b *Block) MarshalJSON() ([]byte, error)

MarshalJSON marshals a typed transaction.

func (*Block) Miner added in v0.7.0

func (b *Block) Miner() types.Address

Miner returns the miner of the block. This will return fee recipient for post-london blocks.

func (*Block) MixHash added in v0.7.0

func (b *Block) MixHash() types.Hash

MixHash returns the mix hash of the block.

func (*Block) Nonce added in v0.7.0

func (b *Block) Nonce() []byte

Nonce returns the nonce of the block.

func (*Block) Number added in v0.7.0

func (b *Block) Number() uint32

Number returns the number of the block.

func (*Block) ParentBeaconBlockRoot added in v0.8.6

func (b *Block) ParentBeaconBlockRoot() (types.Root, bool)

ParentBeaconBlockRoot returns the parent beacon block root of the block. This is not available in all forks, so also returns a presence flag.

func (*Block) ParentHash added in v0.7.0

func (b *Block) ParentHash() types.Hash

ParentHash returns the parent hash of the block.

func (*Block) ReceiptsRoot added in v0.7.0

func (b *Block) ReceiptsRoot() types.Root

ReceiptsRoot returns the receipts root of the block.

func (*Block) SHA3Uncles added in v0.7.0

func (b *Block) SHA3Uncles() []byte

SHA3Uncles returns the SHA3 hash of the uncles of the block.

func (*Block) Size added in v0.7.0

func (b *Block) Size() uint32

Size returns the size of the block.

func (*Block) StateRoot added in v0.7.0

func (b *Block) StateRoot() types.Root

StateRoot returns the state root of the block.

func (*Block) String added in v0.7.0

func (b *Block) String() string

String returns a string version of the structure.

func (*Block) Timestamp added in v0.7.0

func (b *Block) Timestamp() time.Time

Timestamp returns the timestamp of the block.

func (*Block) TotalDifficulty added in v0.7.0

func (b *Block) TotalDifficulty() *big.Int

TotalDifficulty returns the total difficulty of the block.

func (*Block) Transactions added in v0.7.0

func (b *Block) Transactions() []*Transaction

Transactions returns the transactions of the block.

func (*Block) TransactionsRoot added in v0.7.0

func (b *Block) TransactionsRoot() types.Root

TransactionsRoot returns the transactions root of the block.

func (*Block) Uncles added in v0.7.0

func (b *Block) Uncles() []types.Hash

Uncles returns the hashes of the uncles of the block.

func (*Block) UnmarshalJSON added in v0.7.0

func (b *Block) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*Block) Withdrawals added in v0.8.5

func (b *Block) Withdrawals() ([]*Withdrawal, bool)

Withdrawals returns the withdrawals of the block. This is not available in all forks, so also returns a presence flag.

func (*Block) WithdrawalsRoot added in v0.8.5

func (b *Block) WithdrawalsRoot() (types.Root, bool)

WithdrawalsRoot returns the withdrawals root of the block. This is not available in all forks, so also returns a presence flag.

type CancunBlock added in v0.8.4

type CancunBlock struct {
	BaseFeePerGas         uint64
	BlobGasUsed           uint64
	Difficulty            uint64
	ExcessBlobGas         uint64
	ExtraData             []byte
	GasLimit              uint32
	GasUsed               uint32
	Hash                  types.Hash
	LogsBloom             []byte
	Miner                 types.Address
	MixHash               types.Hash
	Nonce                 []byte
	Number                uint32
	ParentBeaconBlockRoot types.Root
	ParentHash            types.Hash
	ReceiptsRoot          types.Root
	SHA3Uncles            []byte
	Size                  uint32
	StateRoot             types.Root
	Timestamp             time.Time
	TotalDifficulty       *big.Int
	Transactions          []*Transaction
	TransactionsRoot      types.Root
	Uncles                []types.Hash
	Withdrawals           []*Withdrawal
	WithdrawalsRoot       types.Root
}

CancunBlock contains a block after the Cancun hardfork.

func (*CancunBlock) MarshalJSON added in v0.8.4

func (b *CancunBlock) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*CancunBlock) String added in v0.8.4

func (b *CancunBlock) String() string

String returns a string version of the structure.

func (*CancunBlock) UnmarshalJSON added in v0.8.4

func (b *CancunBlock) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CancunTransactionReceipt added in v0.9.0

type CancunTransactionReceipt struct {
	BlobGasPrice      *big.Int
	BlobGasUsed       uint32
	BlockHash         types.Hash
	BlockNumber       uint32
	ContractAddress   *types.Address
	CumulativeGasUsed uint32
	EffectiveGasPrice uint64
	From              types.Address
	GasUsed           uint32
	Logs              []*BerlinTransactionEvent
	LogsBloom         []byte
	Status            uint32
	To                *types.Address
	TransactionHash   types.Hash
	TransactionIndex  uint32
	Type              TransactionType
}

CancunTransactionReceipt contains a transaction receipt.

func (*CancunTransactionReceipt) MarshalJSON added in v0.9.0

func (t *CancunTransactionReceipt) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*CancunTransactionReceipt) String added in v0.9.0

func (t *CancunTransactionReceipt) String() string

String returns a string version of the structure.

func (*CancunTransactionReceipt) UnmarshalJSON added in v0.9.0

func (t *CancunTransactionReceipt) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Fork added in v0.7.0

type Fork int

Fork defines the fork version of a response.

const (
	// ForkUnknown is an unknown fork.
	ForkUnknown Fork = iota
	// ForkBerlin is the Berlin fork.
	ForkBerlin
	// ForkLondon is the London fork.
	ForkLondon
	// ForkShanghai is the Shanghai fork.
	ForkShanghai
	// ForkCancun is the Cancun fork.
	ForkCancun
)

func (*Fork) MarshalJSON added in v0.7.0

func (d *Fork) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (Fork) String added in v0.7.0

func (d Fork) String() string

String returns a string representation of the item.

func (*Fork) UnmarshalJSON added in v0.7.0

func (d *Fork) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type LondonBlock

type LondonBlock struct {
	BaseFeePerGas    uint64
	Difficulty       uint64
	ExtraData        []byte
	GasLimit         uint32
	GasUsed          uint32
	Hash             types.Hash
	LogsBloom        []byte
	Miner            types.Address
	MixHash          types.Hash
	Nonce            []byte
	Number           uint32
	ParentHash       types.Hash
	ReceiptsRoot     types.Root
	SHA3Uncles       []byte
	Size             uint32
	StateRoot        types.Root
	Timestamp        time.Time
	TotalDifficulty  *big.Int
	Transactions     []*Transaction
	TransactionsRoot types.Root
	Uncles           []types.Hash
}

LondonBlock contains a block after the London hardfork.

func (*LondonBlock) MarshalJSON

func (b *LondonBlock) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*LondonBlock) String added in v0.7.0

func (b *LondonBlock) String() string

String returns a string version of the structure.

func (*LondonBlock) UnmarshalJSON

func (b *LondonBlock) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type LondonTransactionReceipt added in v0.7.0

type LondonTransactionReceipt struct {
	BlockHash         types.Hash
	BlockNumber       uint32
	ContractAddress   *types.Address
	CumulativeGasUsed uint32
	EffectiveGasPrice uint64
	From              types.Address
	GasUsed           uint32
	Logs              []*BerlinTransactionEvent
	LogsBloom         []byte
	Status            uint32
	To                *types.Address
	TransactionHash   types.Hash
	TransactionIndex  uint32
	Type              TransactionType
}

LondonTransactionReceipt contains a transaction receipt.

func (*LondonTransactionReceipt) MarshalJSON added in v0.7.0

func (t *LondonTransactionReceipt) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*LondonTransactionReceipt) String added in v0.7.0

func (t *LondonTransactionReceipt) String() string

String returns a string version of the structure.

func (*LondonTransactionReceipt) UnmarshalJSON added in v0.7.0

func (t *LondonTransactionReceipt) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ShanghaiBlock added in v0.7.7

type ShanghaiBlock struct {
	BaseFeePerGas    uint64
	Difficulty       uint64
	ExtraData        []byte
	GasLimit         uint32
	GasUsed          uint32
	Hash             types.Hash
	LogsBloom        []byte
	Miner            types.Address
	MixHash          types.Hash
	Nonce            []byte
	Number           uint32
	ParentHash       types.Hash
	ReceiptsRoot     types.Root
	SHA3Uncles       []byte
	Size             uint32
	StateRoot        types.Root
	Timestamp        time.Time
	TotalDifficulty  *big.Int
	Transactions     []*Transaction
	TransactionsRoot types.Root
	Uncles           []types.Hash
	Withdrawals      []*Withdrawal
	WithdrawalsRoot  types.Root
}

ShanghaiBlock contains a block after the Shanghai hardfork.

func (*ShanghaiBlock) MarshalJSON added in v0.7.7

func (b *ShanghaiBlock) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*ShanghaiBlock) String added in v0.7.7

func (b *ShanghaiBlock) String() string

String returns a string version of the structure.

func (*ShanghaiBlock) UnmarshalJSON added in v0.7.7

func (b *ShanghaiBlock) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Transaction

type Transaction struct {
	Type             TransactionType
	Type0Transaction *Type0Transaction
	Type1Transaction *Type1Transaction
	Type2Transaction *Type2Transaction
	Type3Transaction *Type3Transaction
}

Transaction is a struct that covers all transaction types.

func (*Transaction) AccessList added in v0.4.0

func (t *Transaction) AccessList() []*AccessListEntry

AccessList returns the access list of the transaction. This value can be nil, if the transaction does not support access lists.

func (*Transaction) BlobGasUsed added in v0.9.0

func (t *Transaction) BlobGasUsed() *uint32

BlobGasUsed returns the blob gas used by the transaction. This value can be nil, if the transaction does not support this (e.g. type 0 transactions).

func (*Transaction) BlobVersionedHashes added in v0.9.0

func (t *Transaction) BlobVersionedHashes() []types.VersionedHash

BlobVersionedHashes returns the blob versioned hashes of the transaction. This value can be nil, if the transaction is not a blob transaction.

func (*Transaction) BlockHash added in v0.4.0

func (t *Transaction) BlockHash() *types.Hash

BlockHash returns the block hash of the transaction. This value can be nil, if the transaction is not included in a block.

func (*Transaction) BlockNumber added in v0.4.0

func (t *Transaction) BlockNumber() *uint32

BlockNumber returns the block number of the transaction. This value can be nil, if the transaction is not included in a block.

func (*Transaction) From added in v0.4.0

func (t *Transaction) From() types.Address

From returns the sender of the transaction.

func (*Transaction) Gas added in v0.4.0

func (t *Transaction) Gas() uint32

Gas returns the gas limit of the transaction.

func (*Transaction) GasPrice added in v0.4.0

func (t *Transaction) GasPrice() uint64

GasPrice returns the gas price of the transaction. This will be 0 for transactions that do not have an individual gas price, for example type 2 transactions.

func (*Transaction) Hash added in v0.4.0

func (t *Transaction) Hash() types.Hash

Hash returns the hash of the transaction.

func (*Transaction) Input added in v0.4.0

func (t *Transaction) Input() []byte

Input returns the input data of the transaction.

func (*Transaction) MarshalJSON added in v0.4.0

func (t *Transaction) MarshalJSON() ([]byte, error)

MarshalJSON marshals a typed transaction.

func (*Transaction) MaxFeePerBlobGas added in v0.9.0

func (t *Transaction) MaxFeePerBlobGas() uint64

MaxFeePerBlobGas returns the maximum fee per blob gas paid by the transaction. This value can be 0, if the transaction does not support this (e.g. type 0 transactions).

func (*Transaction) MaxFeePerGas added in v0.4.0

func (t *Transaction) MaxFeePerGas() uint64

MaxFeePerGas returns the maximum fee per gas paid by the transaction. This value can be 0, if the transaction does not support this (e.g. type 0 transactions).

func (*Transaction) MaxPriorityFeePerGas added in v0.4.0

func (t *Transaction) MaxPriorityFeePerGas() uint64

MaxPriorityFeePerGas returns the maximum priority fee per gas paid by the transaction. This value can be 0, if the transaction does not support this (e.g. type 0 transactions).

func (*Transaction) Nonce added in v0.4.0

func (t *Transaction) Nonce() uint64

Nonce returns the nonce of the transaction.

func (*Transaction) R added in v0.4.0

func (t *Transaction) R() *big.Int

R returns the R portion of the signature of the transaction.

func (*Transaction) S added in v0.4.0

func (t *Transaction) S() *big.Int

S returns the S portion of the signature of the transaction.

func (*Transaction) String added in v0.4.0

func (t *Transaction) String() string

String returns a string version of the structure.

func (*Transaction) To added in v0.4.0

func (t *Transaction) To() *types.Address

To returns the recipient of the transaction. This can be nil, for example on contract creation.

func (*Transaction) TransactionIndex added in v0.4.0

func (t *Transaction) TransactionIndex() *uint32

TransactionIndex returns the index of the transaction in its block. This value can be nil, if the transaction is not included in a block.

func (*Transaction) UnmarshalJSON added in v0.4.0

func (t *Transaction) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*Transaction) V added in v0.4.0

func (t *Transaction) V() *big.Int

V returns the V portion of the signature of the transaction.

func (*Transaction) Value added in v0.4.0

func (t *Transaction) Value() *big.Int

Value returns the value of the transaction.

type TransactionReceipt

type TransactionReceipt struct {
	Fork                     Fork
	BerlinTransactionReceipt *BerlinTransactionReceipt
	LondonTransactionReceipt *LondonTransactionReceipt
	CancunTransactionReceipt *CancunTransactionReceipt
}

TransactionReceipt is a struct that covers all transaction receipt versions.

func (*TransactionReceipt) BlobGasPrice added in v0.9.0

func (t *TransactionReceipt) BlobGasPrice() *big.Int

BlobGasPrice returns the blob gas price of the transaction receipt.

func (*TransactionReceipt) BlobGasUsed added in v0.9.0

func (t *TransactionReceipt) BlobGasUsed() uint32

BlobGasUsed returns the blob gas used of the transaction receipt.

func (*TransactionReceipt) BlockHash

func (t *TransactionReceipt) BlockHash() types.Hash

BlockHash returns the block hash of the transaction receipt.

func (*TransactionReceipt) BlockNumber

func (t *TransactionReceipt) BlockNumber() uint32

BlockNumber returns the block number of the transaction receipt.

func (*TransactionReceipt) ContractAddress

func (t *TransactionReceipt) ContractAddress() *types.Address

ContractAddress returns the contract address of the transaction receipt. This will be nil for transactions that did not create a contract.

func (*TransactionReceipt) CumulativeGasUsed

func (t *TransactionReceipt) CumulativeGasUsed() uint32

CumulativeGasUsed returns the cumulative gas used in the block up to this receipt.

func (*TransactionReceipt) EffectiveGasPrice added in v0.7.0

func (t *TransactionReceipt) EffectiveGasPrice() uint64

EffectiveGasPrice returns the effective gas price of the transaction. This will return 0 for pre-London transactions.

func (*TransactionReceipt) From

func (t *TransactionReceipt) From() types.Address

From returns the sender of the transaction receipt.

func (*TransactionReceipt) GasUsed

func (t *TransactionReceipt) GasUsed() uint32

GasUsed returns the gas used by the transaction.

func (*TransactionReceipt) Logs

Logs returns the logs generated by the transaction.

func (*TransactionReceipt) LogsBloom

func (t *TransactionReceipt) LogsBloom() []byte

LogsBloom returns the logs bloom generated by the transaction.

func (*TransactionReceipt) MarshalJSON

func (t *TransactionReceipt) MarshalJSON() ([]byte, error)

MarshalJSON marshals a typed transaction.

func (*TransactionReceipt) Status

func (t *TransactionReceipt) Status() uint32

Status returns the status returned by the transaction.

func (*TransactionReceipt) String

func (t *TransactionReceipt) String() string

String returns a string version of the structure.

func (*TransactionReceipt) To

func (t *TransactionReceipt) To() *types.Address

To returns the recipient of the transaction receipt. This value will be nil for contract creation.

func (*TransactionReceipt) TransactionHash

func (t *TransactionReceipt) TransactionHash() types.Hash

TransactionHash returns the hash of the transaction.

func (*TransactionReceipt) TransactionIndex

func (t *TransactionReceipt) TransactionIndex() uint32

TransactionIndex returns the index of the transaction in the block.

func (*TransactionReceipt) Type

Type returns the type of the transaction in the block.

func (*TransactionReceipt) UnmarshalJSON

func (t *TransactionReceipt) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type TransactionSubmission added in v0.8.9

type TransactionSubmission struct {
	Type                 TransactionType
	ChainID              *big.Int
	From                 types.Address
	Nonce                *uint64
	To                   *types.Address
	Input                []byte
	Gas                  *big.Int
	GasPrice             *big.Int
	MaxFeePerGas         *big.Int
	MaxPriorityFeePerGas *big.Int
	MaxFeePerBlobGas     *big.Int
	Value                *big.Int
	AccessList           []*AccessListEntry
	BlobVersionedHashes  []types.VersionedHash
	Blobs                []types.Blob
}

TransactionSubmission provides the partial details of a transaction to submit to the network.

type TransactionType added in v0.7.0

type TransactionType int

TransactionType defines the spec version of a transaction.

const (
	// TransactionType0 is a legacy transaction.
	TransactionType0 TransactionType = iota
	// TransactionType1 is an access list transaction.
	TransactionType1
	// TransactionType2 is an EIP-1559 transaction.
	TransactionType2
	// TransactionType3 is a data blob transaction.
	TransactionType3
)

func (*TransactionType) MarshalJSON added in v0.7.0

func (d *TransactionType) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (TransactionType) String added in v0.7.0

func (d TransactionType) String() string

String returns a string representation of the item.

func (*TransactionType) UnmarshalJSON added in v0.7.0

func (d *TransactionType) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Type0Transaction

type Type0Transaction struct {
	BlockHash        *types.Hash
	BlockNumber      *uint32
	ChainID          *big.Int
	From             types.Address
	Gas              uint32
	GasPrice         uint64
	Hash             types.Hash
	Input            []byte
	Nonce            uint64
	R                *big.Int
	S                *big.Int
	To               *types.Address
	TransactionIndex *uint32
	V                *big.Int
	Value            *big.Int
}

Type0Transaction is the spec representation of a type 0 transaction.

func (*Type0Transaction) MarshalJSON

func (t *Type0Transaction) MarshalJSON() ([]byte, error)

MarshalJSON marshals a type 0 transaction.

func (*Type0Transaction) MarshalRLP added in v0.7.0

func (t *Type0Transaction) MarshalRLP() ([]byte, error)

MarshalRLP returns an RLP representation of the transaction.

func (*Type0Transaction) String

func (t *Type0Transaction) String() string

String returns a string version of the structure.

func (*Type0Transaction) UnmarshalJSON

func (t *Type0Transaction) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Type1Transaction

type Type1Transaction struct {
	AccessList       []*AccessListEntry
	BlockHash        *types.Hash
	BlockNumber      *uint32
	ChainID          *big.Int
	From             types.Address
	Gas              uint32
	GasPrice         uint64
	Hash             types.Hash
	Input            []byte
	Nonce            uint64
	R                *big.Int
	S                *big.Int
	To               *types.Address
	TransactionIndex *uint32
	V                *big.Int
	Value            *big.Int
}

Type1Transaction is the type 1 transaction.

func (*Type1Transaction) MarshalJSON

func (t *Type1Transaction) MarshalJSON() ([]byte, error)

MarshalJSON marshals a type 1 transaction.

func (*Type1Transaction) MarshalRLP added in v0.7.0

func (t *Type1Transaction) MarshalRLP() ([]byte, error)

MarshalRLP returns an RLP representation of the transaction.

func (*Type1Transaction) String

func (t *Type1Transaction) String() string

String returns a string version of the structure.

func (*Type1Transaction) UnmarshalJSON

func (t *Type1Transaction) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Type2Transaction

type Type2Transaction struct {
	AccessList []*AccessListEntry
	// BlockHash is only available for transactions included in a block, so optional.
	BlockHash *types.Hash
	// BlockNumber is only available for transactions included in a block, so optional.
	BlockNumber *uint32
	ChainID     *big.Int
	From        types.Address
	Gas         uint32
	// GasPrice is only available for transactions included in a block, so optional.
	GasPrice             *uint64
	Hash                 types.Hash
	Input                []byte
	MaxFeePerGas         uint64
	MaxPriorityFeePerGas uint64
	Nonce                uint64
	R                    *big.Int
	S                    *big.Int
	To                   *types.Address
	// TransactionIndex is only available for transactions included in a block, so optional.
	TransactionIndex *uint32
	V                *big.Int
	Value            *big.Int
}

Type2Transaction is a London type 2 transaction.

func (*Type2Transaction) MarshalJSON

func (t *Type2Transaction) MarshalJSON() ([]byte, error)

MarshalJSON marshals a type 2 transaction.

func (*Type2Transaction) MarshalRLP added in v0.7.0

func (t *Type2Transaction) MarshalRLP() ([]byte, error)

MarshalRLP returns an RLP representation of the transaction.

func (*Type2Transaction) String

func (t *Type2Transaction) String() string

String returns a string version of the structure.

func (*Type2Transaction) UnmarshalJSON

func (t *Type2Transaction) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Type3Transaction added in v0.8.4

type Type3Transaction struct {
	AccessList []*AccessListEntry
	// BlobGasPrice is only available for transactions included in a block, so optional.
	BlobGasPrice *big.Int
	// BlobGasUsed is only available for transactions included in a block, so optional.
	BlobGasUsed         *uint32
	BlobVersionedHashes []types.VersionedHash
	// BlockHash is only available for transactions included in a block, so optional.
	BlockHash *types.Hash
	// BlockNumber is only available for transactions included in a block, so optional.
	BlockNumber *uint32
	ChainID     *big.Int
	From        types.Address
	Gas         uint32
	// GasPrice is only available for transactions included in a block, so optional.
	GasPrice             *uint64
	Hash                 types.Hash
	Input                []byte
	MaxFeePerBlobGas     uint64
	MaxFeePerGas         uint64
	MaxPriorityFeePerGas uint64
	Nonce                uint64
	R                    *big.Int
	S                    *big.Int
	To                   *types.Address
	// TransactionIndex is only available for transactions included in a block, so optional.
	TransactionIndex *uint32
	V                *big.Int
	Value            *big.Int
}

Type3Transaction is a Cancun type 3 transaction.

func (*Type3Transaction) MarshalJSON added in v0.8.4

func (t *Type3Transaction) MarshalJSON() ([]byte, error)

MarshalJSON marshals a type 3 transaction.

func (*Type3Transaction) MarshalRLP added in v0.8.4

func (t *Type3Transaction) MarshalRLP() ([]byte, error)

MarshalRLP returns an RLP representation of the transaction.

func (*Type3Transaction) String added in v0.8.4

func (t *Type3Transaction) String() string

String returns a string version of the structure.

func (*Type3Transaction) UnmarshalJSON added in v0.8.4

func (t *Type3Transaction) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Withdrawal added in v0.7.7

type Withdrawal struct {
	Index          uint64
	ValidatorIndex uint64
	Address        types.Address
	Amount         *big.Int
}

Withdrawal is the spec representation of a withdrawal.

func (*Withdrawal) MarshalJSON added in v0.7.7

func (w *Withdrawal) MarshalJSON() ([]byte, error)

MarshalJSON marshals a type 0 transaction.

func (*Withdrawal) String added in v0.7.7

func (w *Withdrawal) String() string

String returns a string version of the structure.

func (*Withdrawal) UnmarshalJSON added in v0.7.7

func (w *Withdrawal) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

Jump to

Keyboard shortcuts

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