types

package
v0.0.0-...-80ff8fe Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallMsgFromTx

func CallMsgFromTx(tx *coretypes.Transaction) *ethereum.CallMsg

CallMsgFromTx creates a new ethereum.CallMsg from a coretypes.Transaction.

Types

type Packer

type Packer struct {
	*bind.MetaData
}

Packer struct for packing metadata.

func (*Packer) CreateRequest

func (p *Packer) CreateRequest(
	msgID string,
	to common.Address,
	value *big.Int,
	gasTipCap *big.Int,
	gasFeeCap *big.Int,
	gasLimit uint64,
	method string,
	args ...any,
) (*Request, error)

CreateRequest function for creating transaction request.

func (*Packer) GetCallResult

func (p *Packer) GetCallResult(method string, ret []byte) ([]any, error)

GetCallResult function for unpacking the return data from a call result.

func (*Packer) MustGetEventSig

func (p *Packer) MustGetEventSig(eventName string) common.Hash

MustGetEventSig returns the event signature for the given event name in the packer's ABI.

type PreconfirmedState

type PreconfirmedState uint8

PreconfirmedStates are used for messages before the tx status is confirmed by the chain.

const (
	// The message is not being tracked by the transactor.
	StateUnknown PreconfirmedState = iota
	// The message is sitting in the queue, waiting to be acquired into a tx.
	StateQueued
	// The message is being built into a tx.
	StateBuilding
	// The tx containing the message is sending (or retrying) -- noncer marked as "acquired".
	StateSending
	// The tx containing the message has been sent -- noncer marked as "inFlight".
	StateInFlight
)

type Request

type Request struct {
	// CallMsg is used to provide the basic tx data. The From field is ignored for txs, only used
	// for eth calls.
	*ethereum.CallMsg

	// MsgID is the (optional) user-provided string id for this tx request.
	MsgID string
	// contains filtered or unexported fields
}

Request is a transaction request, using the go-ethereum call msg.

func NewRequest

func NewRequest(
	to common.Address, gasLimit uint64, gasFeeCap, gasTipCap, value *big.Int, data []byte,
	msgID ...string,
) *Request

NewRequest returns a new transaction request with the given input data. The ID is optional, but at most 1 is allowed per tx request.

func (Request) Marshal

func (r Request) Marshal() ([]byte, error)

NewTxRequest returns a new Request with the given type and error.

func (Request) New

func (Request) New() types.Marshallable

New returns a new empty Request.

func (*Request) String

func (r *Request) String() string

String() implements fmt.Stringer.

func (*Request) Time

func (r *Request) Time() time.Time

Time returns the time this tx was initially requested.

func (*Request) Unmarshal

func (r *Request) Unmarshal(data []byte) error

Unmarshal unmarshals a Request from the given data.

func (*Request) Validate

func (r *Request) Validate() error

Validate ensures that the initialTime is set on the tx request.

type Requests

type Requests []*Request

Requests is a list of requests.

func (Requests) Messages

func (rs Requests) Messages() []*ethereum.CallMsg

func (Requests) MsgIDs

func (rs Requests) MsgIDs() []string

func (Requests) Times

func (rs Requests) Times() []time.Time

Jump to

Keyboard shortcuts

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