builder

package
v0.0.0-...-cc9b5da Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0, MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultMaxTotalFeeHuman, _ = xc.NewAmountHumanReadableFromStr("2")

Functions

func DefaultMaxGasPrice

func DefaultMaxGasPrice(nativeAsset *xc.ChainConfig) float64

func GetTaxFrom

func GetTaxFrom(amount xc.AmountBlockchain, tax float64) xc.AmountBlockchain

Returns the amount in blockchain that is percentage of amount. E.g. amount = 100, tax = 0.05, returns 5.

Types

type TxBuilder

type TxBuilder struct {
	xc.TxBuilder
	Asset          xc.ITask
	CosmosTxConfig client.TxConfig
}

TxBuilder for Cosmos

func NewTxBuilder

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

NewTxBuilder creates a new Cosmos TxBuilder

func (TxBuilder) GetDenom

func (txBuilder TxBuilder) GetDenom() string

func (TxBuilder) NewBankTransfer

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

x/bank MsgSend transfer

func (TxBuilder) NewCW20Transfer

func (txBuilder TxBuilder) NewCW20Transfer(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)

See NewTransfer

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)

See NewTransfer

func (TxBuilder) NewTransfer

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

Old transfer interface

func (TxBuilder) Stake

func (txBuilder TxBuilder) Stake(args 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(args xcbuilder.StakeArgs, input xc.UnstakeTxInput) (xc.Tx, error)

func (TxBuilder) Withdraw

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

Jump to

Keyboard shortcuts

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