types

package
v1.2.12 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildTxResult

type BuildTxResult struct {
	SignedTx *types.Transaction
	TxHex    string
}

type CallMethodOpts

type CallMethodOpts struct {
	Nonce                int64
	Value                string
	GasPrice             string // MaxFeePerGas
	GasLimit             string
	IsPredictError       bool
	MaxPriorityFeePerGas string
}

type CallMethodOptsBigInt

type CallMethodOptsBigInt struct {
	Nonce                uint64
	Value                *big.Int
	GasPrice             *big.Int // MaxFeePerGas
	GasLimit             uint64
	IsPredictError       bool
	MaxPriorityFeePerGas *big.Int
}

type CallMsg

type CallMsg struct {
	Msg ethereum.CallMsg
}

CallMsg contains parameters for contract calls.

func NewCallMsg

func NewCallMsg() *CallMsg

NewCallMsg creates an empty contract call parameter list.

func (*CallMsg) GetData

func (msg *CallMsg) GetData() []byte

func (*CallMsg) GetDataHex

func (msg *CallMsg) GetDataHex() string

func (*CallMsg) GetFrom

func (msg *CallMsg) GetFrom() string

func (*CallMsg) GetGasLimit

func (msg *CallMsg) GetGasLimit() string

func (*CallMsg) GetGasPrice

func (msg *CallMsg) GetGasPrice() string

func (*CallMsg) GetTo

func (msg *CallMsg) GetTo() string

func (*CallMsg) GetValue

func (msg *CallMsg) GetValue() string

func (*CallMsg) SetData

func (msg *CallMsg) SetData(data []byte)

func (*CallMsg) SetDataHex

func (msg *CallMsg) SetDataHex(hex string)

func (*CallMsg) SetFrom

func (msg *CallMsg) SetFrom(address string)

func (*CallMsg) SetGasLimit

func (msg *CallMsg) SetGasLimit(gas string)

func (*CallMsg) SetGasPrice

func (msg *CallMsg) SetGasPrice(price string)

func (*CallMsg) SetTo

func (msg *CallMsg) SetTo(address string)

func (*CallMsg) SetValue

func (msg *CallMsg) SetValue(value string)

Set amount with decimal number

func (*CallMsg) SetValueHex

func (msg *CallMsg) SetValueHex(hex string)

Set amount with hexadecimal number

func (*CallMsg) TransferToTransaction

func (msg *CallMsg) TransferToTransaction() *Transaction

type Erc20TxParams

type Erc20TxParams struct {
	ToAddress string `json:"toAddress"`
	Amount    string `json:"amount"`
	Method    string `json:"method"`
}

type Transaction

type Transaction struct {
	Nonce    string // nonce of sender account
	GasPrice string // wei per gas
	GasLimit string // gas limit
	To       string // receiver
	Value    string // wei amount
	Data     string // contract invocation input data

	// EIP1559, Default is ""
	MaxPriorityFeePerGas string
}

func NewTransaction

func NewTransaction(nonce, gasPrice, gasLimit, maxPriorityFeePerGas, to, value, data string) *Transaction

func NewTransactionFromHex

func NewTransactionFromHex(hexData string) (*Transaction, error)

func (*Transaction) GetRawTx

func (tx *Transaction) GetRawTx() (*types.Transaction, error)

func (*Transaction) MaxFee

func (tx *Transaction) MaxFee() string

This is an alias property for GasPrice in order to support EIP1559

func (*Transaction) SetMaxFee

func (tx *Transaction) SetMaxFee(maxFee string)

This is an alias property for GasPrice in order to support EIP1559

func (*Transaction) TotalAmount

func (tx *Transaction) TotalAmount() string

@return gasPrice * gasLimit + value

type TransactionByHashResult

type TransactionByHashResult struct {
	SignedTx    *types.Transaction
	From        common.Address
	IsPending   bool   // 交易是否处于Pending状态
	Status      string // 0: 交易失败, 1: 交易成功
	GasUsed     string // 实际花费gas
	BlockNumber string // 区块高度
}

type UrlParam

type UrlParam struct {
	RpcUrl string
	WsUrl  string
}

Jump to

Keyboard shortcuts

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