tx

package
v0.0.0-...-ef7a112 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidSendTxArgs is returned when the structure of SendTxArgs is ambigious.
	ErrInvalidSendTxArgs = errors.New("transaction arguments are invalid")
	// ErrUnexpectedArgs is returned when args are of unexpected length.
	ErrUnexpectedArgs = errors.New("unexpected args")
	//ErrInvalidTxSender is returned when selected account is different than From field.
	ErrInvalidTxSender = errors.New("transaction can only be send by its creator")
	//ErrAccountDoesntExist is sent when provided sub-account is not stored in database.
	ErrAccountDoesntExist = errors.New("account doesn't exist")
)

Functions

This section is empty.

Types

type GasCalculator

type GasCalculator interface {
	ethereum.GasEstimator
	ethereum.GasPricer
}

GasCalculator provides methods for estimating and pricing gas.

type PendingNonceProvider

type PendingNonceProvider interface {
	PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
}

PendingNonceProvider provides information about nonces.

type SendTxArgs

type SendTxArgs struct {
	From                 common.Address  `json:"from"`
	To                   *common.Address `json:"to"`
	Gas                  *hexutil.Uint64 `json:"gas"`
	GasPrice             *hexutil.Big    `json:"gasPrice"`
	Value                *hexutil.Big    `json:"value"`
	Nonce                *hexutil.Uint64 `json:"nonce"`
	MaxFeePerGas         *hexutil.Big    `json:"maxFeePerGas"`
	MaxPriorityFeePerGas *hexutil.Big    `json:"maxPriorityFeePerGas"`
	// We keep both "input" and "data" for backward compatibility.
	// "input" is a preferred field.
	Input hexutil.Bytes `json:"input"`
	Data  hexutil.Bytes `json:"data"`
}

SendTxArgs represents the arguments to submit a new transaction into the transaction pool. This struct is based on go-ethereum's type in internal/ethapi/api.go, but we have freedom over the exact layout of this struct.

func (SendTxArgs) GetInput

func (args SendTxArgs) GetInput() hexutil.Bytes

GetInput returns either Input or Data field's value dependent on what is filled.

func (SendTxArgs) IsDynamicFeeTx

func (args SendTxArgs) IsDynamicFeeTx() bool

IsDynamicFeeTx checks whether dynamic fee parameters are set for the tx

func (SendTxArgs) ToTransactOpts

func (args SendTxArgs) ToTransactOpts(key, password string, chainID uint64) *bind.TransactOpts

func (SendTxArgs) Valid

func (args SendTxArgs) Valid() bool

Valid checks whether this structure is filled in correctly.

Jump to

Keyboard shortcuts

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