Documentation ¶
Index ¶
- Constants
- Variables
- type BroadcastOption
- func WithConfirmFn(val ConfirmFn) BroadcastOption
- func WithFees(val string) BroadcastOption
- func WithGas(val flags.GasSetting) BroadcastOption
- func WithGasAdjustment(val float64) BroadcastOption
- func WithGasPrices(val string) BroadcastOption
- func WithNote(val string) BroadcastOption
- func WithResultCodeAsError() BroadcastOption
- func WithSkipConfirm(val bool) BroadcastOption
- func WithTimeoutHeight(val uint64) BroadcastOption
- type BroadcastOptions
- type Client
- type ClientOption
- type ClientOptions
- type ConfirmFn
- type NodeClient
- type QueryClient
- type TxClient
Constants ¶
const ( BroadcastDefaultTimeout = 30 * time.Second BroadcastBlockRetryTimeout = 300 * time.Second )
Variables ¶
var ( // ErrClientNotFound is a new error with message "Client not found" ErrClientNotFound = errors.New("client not found") ErrNodeNotSynced = errors.New("rpc node is not catching up") )
var ( ErrNotRunning = errors.New("tx client: not running") ErrSyncTimedOut = errors.New("tx client: timed-out waiting for sequence sync") ErrNodeCatchingUp = errors.New("tx client: cannot sync from catching up node") ErrSimulateOffline = errors.New("tx client: cannot simulate tx in offline mode") ErrBroadcastOffline = errors.New("tx client: cannot broadcast tx in offline mode") ErrTxCanceledByUser = errors.New("tx client: transaction declined by user input") )
Functions ¶
This section is empty.
Types ¶
type BroadcastOption ¶
type BroadcastOption func(*BroadcastOptions) error
BroadcastOption is a function that takes as first argument a pointer to BroadcastOptions and returns an error if the option cannot be configured. A number of BroadcastOption functions are available in this package.
func WithConfirmFn ¶
func WithConfirmFn(val ConfirmFn) BroadcastOption
WithConfirmFn returns a BroadcastOption that sets the ConfirmFn function configuration for the transaction.
func WithFees ¶
func WithFees(val string) BroadcastOption
WithFees returns a BroadcastOption that sets the fees configuration for the transaction.
func WithGas ¶
func WithGas(val flags.GasSetting) BroadcastOption
WithGas returns a BroadcastOption that sets the gas setting configuration for the transaction.
func WithGasAdjustment ¶
func WithGasAdjustment(val float64) BroadcastOption
WithGasAdjustment returns a BroadcastOption that sets the gas adjustment configuration for the transaction.
func WithGasPrices ¶
func WithGasPrices(val string) BroadcastOption
WithGasPrices returns a BroadcastOption that sets the gas price configuration for the transaction. Gas price is a string of the amount. E.g. "0.25uakt".
func WithNote ¶
func WithNote(val string) BroadcastOption
WithNote returns a BroadcastOption that sets the note configuration for the transaction.
func WithResultCodeAsError ¶
func WithResultCodeAsError() BroadcastOption
WithResultCodeAsError returns a BroadcastOption that enables the result code as error configuration for the transaction.
func WithSkipConfirm ¶
func WithSkipConfirm(val bool) BroadcastOption
WithSkipConfirm returns a BroadcastOption that sets whether to skip or not the confirmation for the transaction.
func WithTimeoutHeight ¶
func WithTimeoutHeight(val uint64) BroadcastOption
WithTimeoutHeight returns a BroadcastOption that sets the timeout height configuration for the transaction.
type BroadcastOptions ¶
type BroadcastOptions struct {
// contains filtered or unexported fields
}
BroadcastOptions defines the options allowed to configure a transaction broadcast.
type Client ¶
type Client interface { Query() QueryClient Tx() TxClient Node() NodeClient ClientContext() sdkclient.Context PrintMessage(interface{}) error }
Client is the umbrella interface that exposes every other client's modules.
type ClientOption ¶
type ClientOption func(*ClientOptions) *ClientOptions
type ClientOptions ¶
type ClientOptions struct {
// contains filtered or unexported fields
}
type NodeClient ¶
type QueryClient ¶
type QueryClient interface { dtypes.QueryClient mtypes.QueryClient ptypes.QueryClient atypes.QueryClient ctypes.QueryClient Auth() authtypes.QueryClient Authz() authz.QueryClient Bank() banktypes.QueryClient Distribution() disttypes.QueryClient Evidence() evdtypes.QueryClient Feegrant() feegranttypes.QueryClient Gov() govtypes.QueryClient Mint() minttypes.QueryClient Params() paramtypes.QueryClient Slashing() slashtypes.QueryClient Staking() staketypes.QueryClient Upgrade() upgradetypes.QueryClient ClientContext() sdkclient.Context }
QueryClient is the interface that exposes query modules.
func NewQueryClient ¶
func NewQueryClient(cctx sdkclient.Context) QueryClient
NewQueryClient creates new query client instance based on a Cosmos SDK client context.
type TxClient ¶
type TxClient interface {
Broadcast(context.Context, []sdk.Msg, ...BroadcastOption) (interface{}, error)
}
TxClient is the interface that wraps the Broadcast method. Broadcast broadcasts a transaction. A transaction is composed of 1 or many messages. This allows several operations to be performed in a single transaction. A transaction broadcast can be configured with an arbitrary number of BroadcastOption.