Documentation
¶
Index ¶
- Constants
- Variables
- func AddAppTxFlags(fs *flag.FlagSet)
- func BroadcastAppTx(tx *btypes.AppTx) (*ctypes.ResultBroadcastTxCommit, error)
- func ParseHexFlag(flag string) ([]byte, error)
- func ReadAppTxFlags() (gas int64, fee btypes.Coin, txInput btypes.TxInput, err error)
- type AppTx
- type BaseTxPresenter
- type SendTx
Constants ¶
const ( FlagTo = "to" FlagAmount = "amount" FlagFee = "fee" FlagGas = "gas" FlagSequence = "sequence" )
nolint
const (
FlagOutput = "file"
)
Variables ¶
var AccountQueryCmd = &cobra.Command{ Use: "account [address]", Short: "Get details of an account, with proof", RunE: lcmd.RequireInit(doAccountQuery), }
var AutoCompleteCmd = &cobra.Command{
Use: "complete",
Short: "generate bash autocompletions",
RunE: doAutoComplete,
}
var SendTxCmd = &cobra.Command{ Use: "send", Short: "send tokens from one account to another", RunE: commands.RequireInit(doSendTx), }
SendTxCmd is CLI command to send tokens between basecoin accounts
Functions ¶
func AddAppTxFlags ¶
AddAppTxFlags adds flags required by apptx
func BroadcastAppTx ¶
func BroadcastAppTx(tx *btypes.AppTx) (*ctypes.ResultBroadcastTxCommit, error)
BroadcastAppTx wraps, signs, and executes an app tx basecoin transaction
func ParseHexFlag ¶
ParseHexFlag parses a flag string to byte array
Types ¶
type AppTx ¶
AppTx Application transaction structure for client
func (*AppTx) Sign ¶
Sign will add a signature and pubkey.
Depending on the Signable, one may be able to call this multiple times for multisig Returns error if called with invalid data or too many times
func (*AppTx) Signers ¶
Signers will return the public key(s) that signed if the signature is valid, or an error if there is any issue with the signature, including if there are no signatures
func (*AppTx) TxBytes ¶
TxBytes returns the transaction data as well as all signatures It should return an error if Sign was never called
func (*AppTx) ValidateBasic ¶
TODO: this should really be in the basecoin.types SendTx, but that code is too ugly now, needs refactor..
type BaseTxPresenter ¶
type BaseTxPresenter struct {
proofs.RawPresenter // this handles MakeKey as hex bytes
}
BaseTxPresenter this decodes all basecoin tx
func (BaseTxPresenter) ParseData ¶
func (_ BaseTxPresenter) ParseData(raw []byte) (interface{}, error)
type SendTx ¶
func (*SendTx) AddSigner ¶
AddSigner sets address and pubkey info on the tx based on the key that will be used for signing
func (*SendTx) Sign ¶
Sign will add a signature and pubkey.
Depending on the Signable, one may be able to call this multiple times for multisig Returns error if called with invalid data or too many times
func (*SendTx) Signers ¶
Signers will return the public key(s) that signed if the signature is valid, or an error if there is any issue with the signature, including if there are no signatures
func (*SendTx) TxBytes ¶
TxBytes returns the transaction data as well as all signatures It should return an error if Sign was never called
func (*SendTx) ValidateBasic ¶
TODO: this should really be in the basecoin.types SendTx, but that code is too ugly now, needs refactor..