tx

package
v0.0.0-...-a3238b4 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0, MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ERC20 abi.ABI

Functions

func BuildERC20Payload

func BuildERC20Payload(to xc.Address, amount xc.AmountBlockchain) ([]byte, error)

func BuildSmartAccountPayload

func BuildSmartAccountPayload(packedCalls []byte, signature xc.TxSignature) ([]byte, error)

func EvmDestinationAndAmountAndData

func EvmDestinationAndAmountAndData(to xc.Address, amount xc.AmountBlockchain, contractMaybe contractGetter) (common.Address, *big.Int, []byte, error)

On EVM the destination address is the recipient of an ether transfer, but for token transfers, it is the token contract address (the token recipient is then in the data). The .amount field similarly must be in native transaction or in the data for a token transfer.

func Fee

func Fee(gasTipCap xc.AmountBlockchain, gasPrice xc.AmountBlockchain, baseFeeUint uint64, gasUsedUint uint64) xc.AmountBlockchain

Fee returns the fee associated to the tx

func GetChainId

func GetChainId(chain *xc.ChainBaseConfig, input *tx_input.TxInput) uint256.Int

func GetEthSigner

func GetEthSigner(chain *xc.ChainBaseConfig, input *tx_input.TxInput) types.Signer

func NewCustomTx

func NewCustomTx(input *tx_input.TxInput, chain *xc.ChainBaseConfig, ethTx *types.Transaction) xc.Tx

Types

type CustomTx

type CustomTx struct {
	// contains filtered or unexported fields
}

func (*CustomTx) AddSignatures

func (tx *CustomTx) AddSignatures(signatures []*xc.SignatureResponse)

func (*CustomTx) AdditionalSighashes

func (tx *CustomTx) AdditionalSighashes() ([]*xc.SignatureRequest, error)

func (*CustomTx) BuildEthTx

func (tx *CustomTx) BuildEthTx() (*types.Transaction, error)

func (*CustomTx) Serialize

func (tx *CustomTx) Serialize() ([]byte, error)

func (*CustomTx) Sighashes

func (tx *CustomTx) Sighashes() ([]*xc.SignatureRequest, error)

type FeePayerTx

type FeePayerTx struct {
	// contains filtered or unexported fields
}

func NewFeePayerTx

func NewFeePayerTx(args xcbuilder.MultiTransferArgs, input *tx_input.TxInput, chain *xc.ChainBaseConfig) *FeePayerTx

func (*FeePayerTx) AddSignatures

func (tx *FeePayerTx) AddSignatures(signatures []*xc.SignatureResponse)

func (*FeePayerTx) AdditionalSighashes

func (tx *FeePayerTx) AdditionalSighashes() ([]*xc.SignatureRequest, error)

func (*FeePayerTx) BuildEthTx

func (tx *FeePayerTx) BuildEthTx() (*types.Transaction, error)

func (*FeePayerTx) BuildPackedCalls

func (tx *FeePayerTx) BuildPackedCalls() ([]byte, error)

func (*FeePayerTx) Serialize

func (tx *FeePayerTx) Serialize() ([]byte, error)

func (*FeePayerTx) Sighashes

func (tx *FeePayerTx) Sighashes() ([]*xc.SignatureRequest, error)

type LegacyTx

type LegacyTx struct {
	// contains filtered or unexported fields
}

func NewLegacyTx

func NewLegacyTx(args xcbuilder.TransferArgs, input *tx_input.TxInput, chain *xc.ChainBaseConfig) *LegacyTx

func (*LegacyTx) AddSignatures

func (tx *LegacyTx) AddSignatures(signatures []*xc.SignatureResponse)

func (*LegacyTx) AdditionalSighashes

func (tx *LegacyTx) AdditionalSighashes() ([]*xc.SignatureRequest, error)

func (*LegacyTx) BuildEthTx

func (tx *LegacyTx) BuildEthTx() (*types.Transaction, error)

func (*LegacyTx) Serialize

func (tx *LegacyTx) Serialize() ([]byte, error)

func (*LegacyTx) Sighashes

func (tx *LegacyTx) Sighashes() ([]*xc.SignatureRequest, error)

type SingleTx

type SingleTx struct {
	// contains filtered or unexported fields
}

func NewSingleTx

func NewSingleTx(args xcbuilder.TransferArgs, input *tx_input.TxInput, chain *xc.ChainBaseConfig) *SingleTx

func (*SingleTx) AddSignatures

func (tx *SingleTx) AddSignatures(signatures []*xc.SignatureResponse)

func (*SingleTx) AdditionalSighashes

func (tx *SingleTx) AdditionalSighashes() ([]*xc.SignatureRequest, error)

func (*SingleTx) BuildEthTx

func (tx *SingleTx) BuildEthTx() (*types.Transaction, error)

func (*SingleTx) Serialize

func (tx *SingleTx) Serialize() ([]byte, error)

func (*SingleTx) Sighashes

func (tx *SingleTx) Sighashes() ([]*xc.SignatureRequest, error)

type SmartAccountCall

type SmartAccountCall struct {
	To    common.Address
	Value *big.Int
	Data  []byte
}

type SourcesAndDests

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

func ParseTokenLogs

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

ParseTransfer parses a tx and extracts higher-level transfer information

type Tx

type Tx struct {
	// contains filtered or unexported fields
}

Tx for EVM

func NewMultiTx

func NewMultiTx(chain *xc.ChainBaseConfig, args xcbuilder.MultiTransferArgs, input *tx_input.TxInput) (*Tx, error)

func NewTx

func NewTx(chain *xc.ChainBaseConfig, args xcbuilder.TransferArgs, input *tx_input.TxInput, legacy bool) (*Tx, error)

func (Tx) AdditionalSighashes

func (tx Tx) AdditionalSighashes() ([]*xc.SignatureRequest, error)

func (Tx) GetMockEthTx

func (tx Tx) GetMockEthTx() *types.Transaction

func (Tx) Hash

func (tx Tx) Hash() xc.TxHash

Hash returns the tx hash or id

func (Tx) Serialize

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

Serialize returns the serialized tx

func (*Tx) SetSignatures

func (tx *Tx) SetSignatures(signatures ...*xc.SignatureResponse) error

SetSignatures adds a signature to Tx

func (Tx) Sighashes

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

Sighashes returns the tx payload to sign, aka sighash

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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