transaction

package
v0.0.0-...-8551cdf Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagPayer = "fee-payer"
)

Variables

View Source
var (
	NewStdTx  = types.NewStdTx
	NewStdFee = types.NewStdFee
)

Functions

This section is empty.

Types

type StdSignMsg

type StdSignMsg = types.StdSignMsg

type StdSignature

type StdSignature = types.StdSignature

func MakeSignature

func MakeSignature(keybase crkeys.Keybase, name, passphrase string,
	msg StdSignMsg) (sig StdSignature, err error)

MakeSignature builds a StdSignature given keybase, key name, passphrase, and a StdSignMsg.

type StdTx

type StdTx = types.StdTx

type TxBuilder

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

TxBuilder implements a transaction context created in SDK modules.

func NewTxBuilder

func NewTxBuilder(
	txEncoder sdk.TxEncoder, accNumber, seq, gas uint64, gasAdj float64,
	simulateAndExecute bool, chainID, memo string, fees sdk.Coins, gasPrices sdk.DecCoins,
) TxBuilder

NewTxBuilder returns a new initialized TxBuilder.

func NewTxBuilderFromCLI

func NewTxBuilderFromCLI(input io.Reader) TxBuilder

NewTxBuilderFromCLI returns a new initialized TxBuilder with parameters from the command line using Viper.

func (TxBuilder) AccountNumber

func (bldr TxBuilder) AccountNumber() uint64

AccountNumber returns the account number

func (TxBuilder) BuildAndSign

func (bldr TxBuilder) BuildAndSign(name, passphrase string, msgs []sdk.Msg) ([]byte, error)

BuildAndSign builds a single message to be signed, and signs a transaction with the built message given a name, passphrase, and a set of messages.

func (TxBuilder) BuildSignMsg

func (bldr TxBuilder) BuildSignMsg(msgs []sdk.Msg) (StdSignMsg, error)

BuildSignMsg builds a single message to be signed from a TxBuilder given a set of messages. It returns an error if a fee is supplied but cannot be parsed.

func (TxBuilder) BuildTxForSim

func (bldr TxBuilder) BuildTxForSim(msgs []sdk.Msg) ([]byte, error)

BuildTxForSim creates a StdSignMsg and encodes a transaction with the StdSignMsg with a single empty StdSignature for tx simulation.

func (TxBuilder) ChainID

func (bldr TxBuilder) ChainID() string

ChainID returns the chain id

func (TxBuilder) FeePayer

func (bldr TxBuilder) FeePayer() types.AccountID

FeePayer returns fee payer name

func (TxBuilder) Fees

func (bldr TxBuilder) Fees() sdk.Coins

Fees returns the fees for the transaction

func (TxBuilder) Gas

func (bldr TxBuilder) Gas() uint64

Gas returns the gas for the transaction

func (TxBuilder) GasAdjustment

func (bldr TxBuilder) GasAdjustment() float64

GasAdjustment returns the gas adjustment

func (TxBuilder) GasPrices

func (bldr TxBuilder) GasPrices() sdk.DecCoins

GasPrices returns the gas prices set for the transaction, if any.

func (TxBuilder) Keybase

func (bldr TxBuilder) Keybase() crkeys.Keybase

Keybase returns the keybase

func (TxBuilder) Memo

func (bldr TxBuilder) Memo() string

Memo returns the memo message

func (TxBuilder) Sequence

func (bldr TxBuilder) Sequence() uint64

Sequence returns the transaction sequence

func (TxBuilder) Sign

func (bldr TxBuilder) Sign(name, passphrase string, msg StdSignMsg) ([]byte, error)

Sign signs a transaction given a name, passphrase, and a single message to signed. An error is returned if signing fails.

func (TxBuilder) SignStdTx

func (bldr TxBuilder) SignStdTx(name, passphrase string, stdTx StdTx, appendSig bool) (signedStdTx StdTx, err error)

SignStdTx appends a signature to a StdTx and returns a copy of it. If append is false, it replaces the signatures already attached with the new signature.

func (TxBuilder) SimulateAndExecute

func (bldr TxBuilder) SimulateAndExecute() bool

SimulateAndExecute returns the option to simulate and then execute the transaction using the gas from the simulation results

func (TxBuilder) TxEncoder

func (bldr TxBuilder) TxEncoder() sdk.TxEncoder

TxEncoder returns the transaction encoder

func (TxBuilder) WithAccountNumber

func (bldr TxBuilder) WithAccountNumber(accnum uint64) TxBuilder

WithAccountNumber returns a copy of the context with an account number.

func (TxBuilder) WithChainID

func (bldr TxBuilder) WithChainID(chainID string) TxBuilder

WithChainID returns a copy of the context with an updated chainID.

func (TxBuilder) WithFees

func (bldr TxBuilder) WithFees(fees string) TxBuilder

WithFees returns a copy of the context with an updated fee.

func (TxBuilder) WithGas

func (bldr TxBuilder) WithGas(gas uint64) TxBuilder

WithGas returns a copy of the context with an updated gas.

func (TxBuilder) WithGasPrices

func (bldr TxBuilder) WithGasPrices(gasPrices string) TxBuilder

WithGasPrices returns a copy of the context with updated gas prices.

func (TxBuilder) WithKeybase

func (bldr TxBuilder) WithKeybase(keybase crkeys.Keybase) TxBuilder

WithKeybase returns a copy of the context with updated keybase.

func (TxBuilder) WithMemo

func (bldr TxBuilder) WithMemo(memo string) TxBuilder

WithMemo returns a copy of the context with an updated memo.

func (TxBuilder) WithPayer

func (bldr TxBuilder) WithPayer(acc string) TxBuilder

WithPayer return a copy of the context with a payer

func (TxBuilder) WithSequence

func (bldr TxBuilder) WithSequence(sequence uint64) TxBuilder

WithSequence returns a copy of the context with an updated sequence number.

func (TxBuilder) WithTxEncoder

func (bldr TxBuilder) WithTxEncoder(txEncoder sdk.TxEncoder) TxBuilder

WithTxEncoder returns a copy of the context with an updated codec.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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