v1beta2

package
v0.0.72 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 44 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	BroadcastDefaultTimeout    = 30 * time.Second
	BroadcastBlockRetryTimeout = 300 * time.Second
)

Variables

View Source
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")
)
View Source
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.

func NewClient

func NewClient(ctx context.Context, cctx sdkclient.Context, opts ...cltypes.ClientOption) (Client, error)

NewClient creates a new client.

type ClientOption

type ClientOption func(*ClientOptions) *ClientOptions

type ClientOptions

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

type ConfirmFn

type ConfirmFn func(string) (bool, error)

type NodeClient

type NodeClient interface {
	SyncInfo(ctx context.Context) (*tmrpc.SyncInfo, error)
}

type QueryClient

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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