builder

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: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultMaxTipCapGwei uint64 = 5

Functions

func BuildERC20Payload

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

func GweiToWei

func GweiToWei(gwei uint64) xc.AmountBlockchain

Types

type EvmTxBuilder

type EvmTxBuilder struct {
}

supports evm after london merge

func NewEvmTxBuilder

func NewEvmTxBuilder() *EvmTxBuilder

func (*EvmTxBuilder) BuildTxWithPayload

func (*EvmTxBuilder) BuildTxWithPayload(chain *xc.ChainConfig, to xc.Address, value xc.AmountBlockchain, data []byte, inputRaw xc.TxInput) (xc.Tx, error)

type GethTxBuilder

type GethTxBuilder interface {
	BuildTxWithPayload(chain *xc.ChainConfig, to xc.Address, value xc.AmountBlockchain, data []byte, input xc.TxInput) (xc.Tx, error)
}

type TxBuilder

type TxBuilder struct {
	Asset xc.ITask
	// contains filtered or unexported fields
}

TxBuilder for EVM

func NewTxBuilder

func NewTxBuilder(asset xc.ITask) (TxBuilder, error)

NewTxBuilder creates a new EVM TxBuilder

func (TxBuilder) BuildProxyPayload

func (txBuilder TxBuilder) BuildProxyPayload(contract xc.ContractAddress, to xc.Address, amount xc.AmountBlockchain) ([]byte, error)

func (TxBuilder) BuildTaskPayload

func (txBuilder TxBuilder) BuildTaskPayload(taskFrom xc.Address, taskTo xc.Address, taskAmount xc.AmountBlockchain, input *tx_input.TxInput) (string, xc.AmountBlockchain, []byte, error)

func (TxBuilder) BuildTaskTx

func (txBuilder TxBuilder) BuildTaskTx(from xc.Address, to xc.Address, amount xc.AmountBlockchain, input xc.TxInput) (xc.Tx, error)

func (TxBuilder) BuildWormholePayload

func (txBuilder TxBuilder) BuildWormholePayload(taskFrom xc.Address, taskTo xc.Address, taskAmount xc.AmountBlockchain, txInput *tx_input.TxInput) (string, xc.AmountBlockchain, []byte, error)

func (TxBuilder) BuildWormholeTransferTx

func (txBuilder TxBuilder) BuildWormholeTransferTx(from xc.Address, to xc.Address, amount xc.AmountBlockchain, input xc.TxInput) (xc.Tx, error)

func (TxBuilder) NewNativeTransfer

func (txBuilder TxBuilder) NewNativeTransfer(from xc.Address, to xc.Address, amount xc.AmountBlockchain, input xc.TxInput) (xc.Tx, error)

NewNativeTransfer creates a new transfer for a native asset

func (TxBuilder) NewTask

func (txBuilder TxBuilder) NewTask(from xc.Address, to xc.Address, amount xc.AmountBlockchain, input xc.TxInput) (xc.Tx, error)

func (TxBuilder) NewTokenTransfer

func (txBuilder TxBuilder) NewTokenTransfer(from xc.Address, to xc.Address, amount xc.AmountBlockchain, input xc.TxInput) (xc.Tx, error)

NewTokenTransfer creates a new transfer for a token asset

func (TxBuilder) NewTransfer

func (txBuilder TxBuilder) NewTransfer(from xc.Address, to xc.Address, amount xc.AmountBlockchain, input xc.TxInput) (xc.Tx, error)

func (TxBuilder) Stake

func (txBuilder TxBuilder) Stake(stakeArgs xcbuilder.StakeArgs, input xc.StakeTxInput) (xc.Tx, error)

func (TxBuilder) Transfer

func (txBuilder TxBuilder) Transfer(args xcbuilder.TransferArgs, input xc.TxInput) (xc.Tx, error)

NewTransfer creates a new transfer for an Asset, either native or token

func (TxBuilder) Unstake

func (txBuilder TxBuilder) Unstake(stakeArgs xcbuilder.StakeArgs, input xc.UnstakeTxInput) (xc.Tx, error)

func (TxBuilder) WithTxBuilder

func (txBuilder TxBuilder) WithTxBuilder(buider GethTxBuilder) TxBuilder

func (TxBuilder) Withdraw

func (txBuilder TxBuilder) Withdraw(stakeArgs xcbuilder.StakeArgs, input xc.WithdrawTxInput) (xc.Tx, error)

type TxInputWithPricing

type TxInputWithPricing interface {
	SetUsdPrice(nativeAsset xc.NativeAsset, contract string, priceUsd xc.AmountHumanReadable)
	GetUsdPrice(nativeAsset xc.NativeAsset, contract string) (xc.AmountHumanReadable, bool)
}

Legacy

Jump to

Keyboard shortcuts

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