types

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBig

func DecodeBig(s string) (*big.Int, error)

DecodeBig decodes either - a hex with 0x prefix - a decimal - "" (decoded to <nil>)

func EncodeBig

func EncodeBig(b *big.Int) string

EncodeBig encodes either - >0 to a hex with 0x prefix - <0 to a hex with -0x prefix - <nil> to ""

func FromBlockNumArg

func FromBlockNumArg(s string) (*big.Int, error)

FromBlockNumArg decodes a string into a big.Int block number

func Has0xPrefix

func Has0xPrefix(input string) bool

Has0xPrefix returns either input starts with a 0x prefix

func ToBlockNumArg

func ToBlockNumArg(number *big.Int) string

ToBlockNumArg transforms a big.Int into a block string representation

Types

type CallOpts

type CallOpts struct {
	Pending     bool               // Whether to operate on the pending state or the last known one
	From        gethcommon.Address // Optional the sender address, otherwise the first account is used
	BlockNumber *big.Int           // Optional the block number on which the call should be performed
}

CallOpts is a set of option to fine tune a contract call request

func (*CallOpts) ToOpts

func (opts *CallOpts) ToOpts(ctx context.Context) *gethbind.CallOpts

type RPCBlock added in v0.4.0

type RPCBlock struct {
	Hash         common.Hash      `json:"hash"`
	Transactions []RPCTransaction `json:"transactions"`
	UncleHashes  []common.Hash    `json:"uncles"`
}

type RPCTransaction added in v0.4.0

type RPCTransaction struct {
	Tx *types.Transaction
	// contains filtered or unexported fields
}

func (*RPCTransaction) UnmarshalJSON added in v0.4.0

func (tx *RPCTransaction) UnmarshalJSON(msg []byte) error

type SignTxFunc

type SignTxFunc func(ctx context.Context, addr gethcommon.Address, tx *gethtypes.Transaction, chainID *big.Int) (*gethtypes.Transaction, error)

type TransactOpts

type TransactOpts struct {
	From gethcommon.Address // Ethereum account to send the transaction from

	Nonce     *big.Int // Nonce to use for the transaction execution (nil = use pending state)
	Value     *big.Int // Funds to transfer along the transaction (nil = 0 = no funds)
	GasPrice  *big.Int // Gas price to use for the transaction execution (nil = gas price oracle)
	GasFeeCap *big.Int // Gas fee cap to use for the 1559 transaction execution (nil = gas price oracle)
	GasTipCap *big.Int // Gas priority fee cap to use for the 1559 transaction execution (nil = gas price oracle)
	GasLimit  uint64   // Gas limit to set for the transaction execution (0 = estimate)

	NoSign bool // Do all transact steps and stops before signing
	Send   bool // Do all transact steps and send the transaction (can not be true if NoSign is true)
}

TransactOpts is a set of option to fine tune the creation of a valid Ethereum transaction.

func (*TransactOpts) ToOpts

func (opts *TransactOpts) ToOpts(ctx context.Context, chainID *big.Int, signTx SignTxFunc) *gethbind.TransactOpts

Jump to

Keyboard shortcuts

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