Documentation ¶
Overview ¶
Package w3types implements common types.
Index ¶
- type Account
- type Callerdeprecated
- type CallerFactorydeprecated
- type Func
- type Message
- func (msg *Message) MarshalJSON() ([]byte, error)
- func (msg *Message) MustSetTx(tx *types.Transaction, signer types.Signer) *Message
- func (msg *Message) Set(msg2 *Message) *Message
- func (msg *Message) SetCallMsg(callMsg ethereum.CallMsg) *Message
- func (msg *Message) SetTx(tx *types.Transaction, signer types.Signer) (*Message, error)
- func (msg *Message) UnmarshalJSON(data []byte) error
- type RPCCaller
- type RPCCallerFactory
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { Nonce uint64 Balance *big.Int Code []byte Storage map[common.Hash]common.Hash // contains filtered or unexported fields }
func (*Account) MarshalJSON ¶
MarshalJSON implements the json.Marshaler.
type CallerFactory
deprecated
type CallerFactory[T any] interface { // Returns given argument points to the variable in which to store the // calls result. Returns(*T) Caller }
CallerFactory is the interface that wraps the basic Returns method.
Deprecated: Use the RPCCallerFactory interface instead.
type Func ¶
type Func interface { // EncodeArgs ABI-encodes the given args and prepends the Func's 4-byte // selector. EncodeArgs(args ...any) (input []byte, err error) // DecodeArgs ABI-decodes the given input to the given args. DecodeArgs(input []byte, args ...any) (err error) // DecodeReturns ABI-decodes the given output to the given returns. DecodeReturns(output []byte, returns ...any) (err error) }
Func is the interface that wraps the methods for ABI encoding and decoding.
type Message ¶
type Message struct { From common.Address // Sender To *common.Address // Recipient Nonce uint64 GasPrice *big.Int GasFeeCap *big.Int GasTipCap *big.Int Gas uint64 Value *big.Int Input []byte // Input data AccessList types.AccessList BlobGasFeeCap *big.Int BlobHashes []common.Hash Func Func // Func to encode Args []any // Arguments for Func }
Message represents a transaction without the signature.
If no input data is given, but Func is not null, the input data is automatically encoded from the given Func and Args arguments by many functions that accept a Message struct as an argument.
func (*Message) MarshalJSON ¶
MarshalJSON implements the json.Marshaler.
func (*Message) SetCallMsg ¶
SetCallMsg sets msg to the ethereum.CallMsg callMsg and returns msg.
func (*Message) SetTx ¶
SetTx sets msg to the types.Transaction tx and returns msg.
func (*Message) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler.
type RPCCaller ¶
type RPCCaller interface { // Create a new rpc.BatchElem for doing the RPC call. CreateRequest() (elem rpc.BatchElem, err error) // Handle the response from the rpc.BatchElem to handle its result. HandleResponse(elem rpc.BatchElem) (err error) }
RPCCaller is the interface that groups the basic CreateRequest and HandleResponse methods.
type RPCCallerFactory ¶
type RPCCallerFactory[T any] interface { // Returns given argument points to the variable in which to store the // calls result. Returns(*T) RPCCaller }
RPCCallerFactory is the interface that wraps the basic Returns method.
type State ¶
func (State) SetGenesisAlloc ¶
func (s State) SetGenesisAlloc(alloc core.GenesisAlloc) State
SetGenesisAlloc copies the given core.GenesisAlloc to the state and returns it.