tx

package
v0.0.0-...-fa9a987 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ERC20 abi.ABI

Functions

This section is empty.

Types

type SourcesAndDests

type SourcesAndDests struct {
	Sources      []*xc.LegacyTxInfoEndpoint
	Destinations []*xc.LegacyTxInfoEndpoint
}

type Tx

type Tx struct {
	EthTx      *types.Transaction
	Signer     types.Signer
	Signatures []xc.TxSignature
}

Tx for EVM

func (*Tx) AddSignatures

func (tx *Tx) AddSignatures(signatures ...xc.TxSignature) error

AddSignatures adds a signature to Tx

func (Tx) Amount

func (tx Tx) Amount() xc.AmountBlockchain

Amount returns the tx amount

func (Tx) ContractAddress

func (tx Tx) ContractAddress() xc.ContractAddress

ContractAddress returns the contract address for a token transfer

func (Tx) Fee

func (tx Tx) Fee(baseFeeUint uint64, gasUsedUint uint64) xc.AmountBlockchain

Fee returns the fee associated to the tx

func (Tx) From

func (tx Tx) From() xc.Address

From is the sender of a transfer

func (Tx) GetSignatures

func (tx Tx) GetSignatures() []xc.TxSignature

func (Tx) Hash

func (tx Tx) Hash() xc.TxHash

Hash returns the tx hash or id

func (Tx) IsContract

func (tx Tx) IsContract() bool

IsContract returns whether a tx is a contract or native transfer

func (Tx) ParseERC20TransferTx

func (tx Tx) ParseERC20TransferTx(nativeAsset xc.NativeAsset) (SourcesAndDests, error)

ParseERC20TransferTx parses the tx payload as ERC20 transfer

func (*Tx) ParseTokenLogs

func (tx *Tx) ParseTokenLogs(receipt *types.Receipt, nativeAsset xc.NativeAsset) SourcesAndDests

ParseTransfer parses a tx and extracts higher-level transfer information

func (Tx) Serialize

func (tx Tx) Serialize() ([]byte, error)

Serialize returns the serialized tx

func (Tx) Sighashes

func (tx Tx) Sighashes() ([]xc.TxDataToSign, error)

Sighashes returns the tx payload to sign, aka sighash

func (Tx) To

func (tx Tx) To() xc.Address

To is the account receiving a transfer

Jump to

Keyboard shortcuts

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