builder

package
v0.0.0-...-78810ce Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetTxInputOptions

func SetTxInputOptions(txInput xc.TxInput, options TransactionOptions, amount xc.AmountBlockchain)

Previously the crosschain abstraction would require callers to set options directly on the transaction input, if the interface was implemented on the input type. However, this is very clear or easy to use. This function bridges the gap, to allow callers to use a more natural interface with options. Chain transaction builders can call this to safely set provided options on the old transaction input setters.

Types

type BuilderOption

type BuilderOption func(opts *builderOptions) error

func OptionMemo

func OptionMemo(memo string) BuilderOption

func OptionPriority

func OptionPriority(priority xc.GasFeePriority) BuilderOption

func OptionPublicKey

func OptionPublicKey(publicKey []byte) BuilderOption

func OptionStakeAccount

func OptionStakeAccount(account string) BuilderOption

func OptionStakeOwner

func OptionStakeOwner(owner xc.Address) BuilderOption

Set an alternative owner of the stake from the from address

func OptionTimestamp

func OptionTimestamp(ts int64) BuilderOption

func OptionValidator

func OptionValidator(validator string) BuilderOption

type FullBuilder

type FullBuilder interface {
	FullTransferBuilder
	Staking
}

type FullTransferBuilder

type FullTransferBuilder interface {
	Transfer
	xc.TxBuilder
}

type StakeArgs

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

func NewStakeArgs

func NewStakeArgs(chain xc.NativeAsset, from xc.Address, amount xc.AmountBlockchain, options ...BuilderOption) (StakeArgs, error)

func (*StakeArgs) GetAmount

func (args *StakeArgs) GetAmount() xc.AmountBlockchain

func (*StakeArgs) GetFrom

func (args *StakeArgs) GetFrom() xc.Address

Staking arguments

func (*StakeArgs) GetMemo

func (args *StakeArgs) GetMemo() (string, bool)

Exposed options

func (*StakeArgs) GetPriority

func (args *StakeArgs) GetPriority() (xc.GasFeePriority, bool)

func (*StakeArgs) GetPublicKey

func (args *StakeArgs) GetPublicKey() ([]byte, bool)

func (*StakeArgs) GetStakeAccount

func (args *StakeArgs) GetStakeAccount() (string, bool)

func (*StakeArgs) GetStakeOwner

func (args *StakeArgs) GetStakeOwner() (xc.Address, bool)

func (*StakeArgs) GetTimestamp

func (args *StakeArgs) GetTimestamp() (int64, bool)

func (*StakeArgs) GetValidator

func (args *StakeArgs) GetValidator() (string, bool)

Staking options

type Staking

type Staking interface {
	Stake(stakingArgs StakeArgs, input xc.StakeTxInput) (xc.Tx, error)
	Unstake(stakingArgs StakeArgs, input xc.UnstakeTxInput) (xc.Tx, error)
	Withdraw(stakingArgs StakeArgs, input xc.WithdrawTxInput) (xc.Tx, error)
}

type TransactionOptions

type TransactionOptions interface {
	GetMemo() (string, bool)
	GetTimestamp() (int64, bool)
	GetPriority() (xc.GasFeePriority, bool)
	GetPublicKey() ([]byte, bool)
}

All ArgumentBuilders should provide base arguments for transactions

type Transfer

type Transfer interface {
	Transfer(args TransferArgs, input xc.TxInput) (xc.Tx, error)
}

type TransferArgs

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

func NewTransferArgs

func NewTransferArgs(from xc.Address, to xc.Address, amount xc.AmountBlockchain, options ...BuilderOption) (TransferArgs, error)

func (*TransferArgs) GetAmount

func (args *TransferArgs) GetAmount() xc.AmountBlockchain

func (*TransferArgs) GetFrom

func (args *TransferArgs) GetFrom() xc.Address

Transfer relevant arguments

func (*TransferArgs) GetMemo

func (args *TransferArgs) GetMemo() (string, bool)

Exposed options

func (*TransferArgs) GetPriority

func (args *TransferArgs) GetPriority() (xc.GasFeePriority, bool)

func (*TransferArgs) GetPublicKey

func (args *TransferArgs) GetPublicKey() ([]byte, bool)

func (*TransferArgs) GetTimestamp

func (args *TransferArgs) GetTimestamp() (int64, bool)

func (*TransferArgs) GetTo

func (args *TransferArgs) GetTo() xc.Address

type TxCommonOptions

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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