cosmos-sdk: Index | Files | Directories

package client

import ""


Package Files

query.go tx.go


var Codec codec.Marshaler

Codec defines the x/auth account codec to be used for use with the AccountRetriever. The application must be sure to set this to their respective codec that implements the Codec interface and must be the same codec that passed to the x/auth module.

TODO:/XXX: Using a package-level global isn't ideal and we should consider refactoring the module manager to allow passing in the correct module codec.

func GetTxEncoder Uses

func GetTxEncoder(cdc *codec.LegacyAmino) (encoder sdk.TxEncoder)

GetTxEncoder return tx encoder from global sdk configuration if ones is defined. Otherwise returns encoder with default logic.

func ParseQueryResponse Uses

func ParseQueryResponse(bz []byte) (sdk.SimulationResponse, error)

func PrintUnsignedStdTx Uses

func PrintUnsignedStdTx(txBldr tx.Factory, clientCtx client.Context, msgs []sdk.Msg) error

PrintUnsignedStdTx builds an unsigned StdTx and prints it to os.Stdout.

func QueryTx Uses

func QueryTx(clientCtx client.Context, hashHexStr string) (*sdk.TxResponse, error)

QueryTx queries for a single transaction by a hash string in hex format. An error is returned if the transaction does not exist or cannot be queried.

func QueryTxsByEvents Uses

func QueryTxsByEvents(clientCtx client.Context, events []string, page, limit int, orderBy string) (*sdk.SearchTxsResult, error)

QueryTxsByEvents performs a search for transactions for a given set of events via the Tendermint RPC. An event takes the form of: "{eventAttribute}.{attributeKey} = '{attributeValue}'". Each event is concatenated with an 'AND' operand. It returns a slice of Info object containing txs and metadata. An error is returned if the query fails. If an empty string is provided it will order txs by asc

func ReadTxFromFile Uses

func ReadTxFromFile(ctx client.Context, filename string) (tx sdk.Tx, err error)

Read and decode a StdTx from the given filename. Can pass "-" to read from stdin.

func SignTx Uses

func SignTx(txFactory tx.Factory, clientCtx client.Context, name string, stdTx client.TxBuilder, offline bool) error

SignTx appends a signature to a transaction. If appendSig is false, it replaces the signatures already attached with the new signature. Don't perform online validation or lookups if offline is true.

func SignTxWithSignerAddress Uses

func SignTxWithSignerAddress(txFactory tx.Factory, clientCtx client.Context, addr sdk.AccAddress,
    name string, txBuilder client.TxBuilder, offline bool) (err error)

SignTxWithSignerAddress attaches a signature to a transaction. Don't perform online validation or lookups if offline is true, else populate account and sequence numbers from a foreign account.

type BatchScanner Uses

type BatchScanner struct {
    // contains filtered or unexported fields

BatchScanner provides a convenient interface for reading batch data such as a file of newline-delimited JSON encoded StdTx.

func NewBatchScanner Uses

func NewBatchScanner(cfg client.TxConfig, r io.Reader) *BatchScanner

NewBatchScanner returns a new BatchScanner to read newline-delimited StdTx transactions from r.

func (*BatchScanner) Scan Uses

func (bs *BatchScanner) Scan() bool

Scan advances the Scanner to the next line.

func (BatchScanner) Tx Uses

func (bs BatchScanner) Tx() sdk.Tx

Tx returns the most recent Tx unmarshalled by a call to Scan.

func (BatchScanner) UnmarshalErr Uses

func (bs BatchScanner) UnmarshalErr() error

UnmarshalErr returns the first unmarshalling error that was encountered by the scanner.

type GasEstimateResponse Uses

type GasEstimateResponse struct {
    GasEstimate uint64 `json:"gas_estimate" yaml:"gas_estimate"`

GasEstimateResponse defines a response definition for tx gas estimation.

func (GasEstimateResponse) String Uses

func (gr GasEstimateResponse) String() string



Package client imports 19 packages (graph) and is imported by 15 packages. Updated 2020-09-22. Refresh now. Tools for package owners.