transaction

package
v0.0.0-...-afe9103 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Seperator  = "\n\n==========================================\n"
	DefaultGas = 200000
)

Functions

func BankSend

func BankSend(keyName string, bankSendOpt BankSendOption, gas uint64) (string, error)

func BroadcastTx

func BroadcastTx(clientCtx client.Context, txf clienttx.Factory, msgs ...sdk.Msg) (uint32, string, string, error)

BroadcastTx attempts to generate, sign and broadcast a transaction with the given set of messages. It will also simulate gas requirements if necessary. It will return an error upon failure.

func ClaimReward

func ClaimReward(keyName string, gas uint64) (string, error)

func Delegate

func Delegate(keyName string, delegateOpt DelegateOption, gas uint64) (string, error)

func HandleTx

func HandleTx(tx Tx) error

func HandleTxs

func HandleTxs(txs Txs) error

func JoinPool

func JoinPool(keyName string, joinPoolOpt JoinPoolOption, gas uint64) (string, error)

func Lock

func Lock(keyName string, lockOpt LockOption, gas uint64) (string, error)

func NewMsgJoinPool

func NewMsgJoinPool(fromAddr sdk.AccAddress, poolId uint64, shareOutAmount sdk.Int, maxAmountsIn sdk.Coins) sdk.Msg

func NewMsgSwapExactAmountIn

func NewMsgSwapExactAmountIn(fromAddr sdk.AccAddress, swapOpt SwapOption) (sdk.Msg, error)

func NewTxFactoryFromClientCtx

func NewTxFactoryFromClientCtx(clientCtx client.Context) tx.Factory

func SetKeyNameToContext

func SetKeyNameToContext(clientCtx client.Context, keyName string) (client.Context, error)

set fields in client context with keyname

func Swap

func Swap(keyName string, swapOpt SwapOption, gas uint64) (string, error)

func SwapAndPool

func SwapAndPool(keyName string, swapAndPoolOption SwapAndPoolOption, gas uint64) (string, error)

Types

type BankSendOption

type BankSendOption struct {
	ToAddr sdk.AccAddress
	Denom  string
	Amount sdk.Int
}

type BankSendTx

type BankSendTx struct {
	BankSendOpt BankSendOption
	KeyName     string
	Hash        string
}

func (BankSendTx) Execute

func (bankSendTx BankSendTx) Execute() (string, error)

func (BankSendTx) Prompt

func (bankSendTx BankSendTx) Prompt()

func (BankSendTx) Report

func (bankSendTx BankSendTx) Report(reportPath string)

type ClaimTx

type ClaimTx struct {
	KeyName string
	Hash    string
}

func (ClaimTx) Execute

func (claimTx ClaimTx) Execute() (string, error)

func (ClaimTx) Prompt

func (claimTx ClaimTx) Prompt()

func (ClaimTx) Report

func (claimTx ClaimTx) Report(reportPath string)

type DelegateOption

type DelegateOption struct {
	ValAddr sdk.ValAddress
	Denom   string
	Amount  sdk.Int
}

type DelegateTx

type DelegateTx struct {
	KeyName     string
	DelegateOpt DelegateOption
	Hash        string
}

func (DelegateTx) Execute

func (delegateTx DelegateTx) Execute() (string, error)

func (DelegateTx) Prompt

func (delegateTx DelegateTx) Prompt()

func (DelegateTx) Report

func (delegateTx DelegateTx) Report(reportPath string)

type JoinPoolOption

type JoinPoolOption struct {
	PoolId         uint64
	ShareOutAmount sdk.Int
	MaxAmountsIn   sdk.Coins
}

type JoinPoolTx

type JoinPoolTx struct {
	KeyName     string
	JoinPoolOpt JoinPoolOption
	Hash        string
}

func (JoinPoolTx) Execute

func (joinPoolTx JoinPoolTx) Execute() (string, error)

func (JoinPoolTx) Prompt

func (joinPoolTx JoinPoolTx) Prompt()

func (JoinPoolTx) Report

func (joinPoolTx JoinPoolTx) Report(reportPath string)

type LockOption

type LockOption struct {
	Duration string
	Amount   sdk.Int
	Denom    string
}

type LockTx

type LockTx struct {
	KeyName string
	LockOpt LockOption
	Hash    string
}

func (LockTx) Execute

func (lockTx LockTx) Execute() (string, error)

func (LockTx) Prompt

func (lockTx LockTx) Prompt()

func (LockTx) Report

func (lockTx LockTx) Report(reportPath string)

type SwapAndPoolOption

type SwapAndPoolOption struct {
	PoolId            uint64
	TokenInAmount     sdk.Int
	TokenInDenom      string
	ShareOutMinAmount sdk.Int
}

type SwapAndPoolTx

type SwapAndPoolTx struct {
	KeyName        string
	SwapAndPoolOpt SwapAndPoolOption
	Hash           string
}

func (SwapAndPoolTx) Execute

func (swapAndPoolTx SwapAndPoolTx) Execute() (string, error)

func (SwapAndPoolTx) Prompt

func (swapAndPoolTx SwapAndPoolTx) Prompt()

func (SwapAndPoolTx) Report

func (swapAndPoolTx SwapAndPoolTx) Report(reportPath string)

type SwapOption

type SwapOption struct {
	SwapRoutePoolIds []int
	SwapRouteDenoms  []string
	TokenInAmount    sdk.Int
	TokenInDenom     string
	TokenOutMinAmt   sdk.Int
}

type SwapTx

type SwapTx struct {
	KeyName string
	SwapOpt SwapOption
	Hash    string
}

func (SwapTx) Execute

func (swapTx SwapTx) Execute() (string, error)

func (SwapTx) Prompt

func (swapTx SwapTx) Prompt()

func (SwapTx) Report

func (swapTx SwapTx) Report(reportPath string)

type Tx

type Tx interface {
	Execute() (string, error)
	Report(string)
	Prompt()
}

type Txs

type Txs []Tx

Jump to

Keyboard shortcuts

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