Documentation ¶
Index ¶
- func AsMessage(txn *types.Transaction) (*core.Message, error)
- func AsMessageWithSigner(txn *types.Transaction, signer types.Signer, baseFee *big.Int) (*core.Message, error)
- func NewTransaction(ctx context.Context, provider *ethrpc.Provider, txnRequest *TransactionRequest) (*types.Transaction, error)
- type TransactionRequest
- type WaitReceipt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsMessageWithSigner ¶ added in v1.17.7
func AsMessageWithSigner(txn *types.Transaction, signer types.Signer, baseFee *big.Int) (*core.Message, error)
AsMessageWithSigner decodes a transaction payload, and will check v, r, s values and skips zero'd numbers which is the case for Polygon state sync transactions: https://wiki.polygon.technology/docs/pos/state-sync/how-state-sync-works#state-sync-logs-and-bor-block-receipt
func NewTransaction ¶
func NewTransaction(ctx context.Context, provider *ethrpc.Provider, txnRequest *TransactionRequest) (*types.Transaction, error)
NewTransaction prepares a transaction for delivery, however the transaction still needs to be signed before it can be sent.
Types ¶
type TransactionRequest ¶
type TransactionRequest struct { // Ethereum account to send the transaction from. Optional, will automatically be set. From common.Address // To is the recipient address, can be account, contract or nil. If `to` is nil, it will assume contract creation To *common.Address // Nonce is the nonce of the transaction for the sender. If this value is left empty (nil), it will // automatically be assigned. Nonce *big.Int // GasLimit is the total gas the transaction is expected the consume. If this value is left empty (0), it will // automatically be estimated and assigned. GasLimit uint64 // GasPrice (in WEI) offering to pay for per unit of gas. If this value is left empty (nil), it will // automatically be sampled and assigned. // Used as GasFeeCap, but name kept for compatibility reasons GasPrice *big.Int // GasTip (in WEI) optional offering to pay for per unit of gas to the miner. // If this value is left empty (nil), it will be considered a pre-EIP1559 or "legacy" transaction GasTip *big.Int // AccessList optional key-values to pre-import // saves cost by pre-importing storage related values before executing the tx AccessList types.AccessList // ETHValue (in WEI) amount of ETH currency to send with this transaction. Optional. ETHValue *big.Int // Data is calldata / input when calling or creating a contract. Optional. Data []byte }
type WaitReceipt ¶
func SendTransaction ¶
func SendTransaction(ctx context.Context, provider *ethrpc.Provider, signedTx *types.Transaction) (*types.Transaction, WaitReceipt, error)
Click to show internal directories.
Click to hide internal directories.