client

package
v0.0.0-...-3154539 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: GPL-3.0 Imports: 53 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(k keyring.Keyring, fromName, gasPrice, accountPrefix string, endPointList []string, logger log.Logger) (*Client, error)

func (*Client) BroadcastTx

func (c *Client) BroadcastTx(tx []byte) (string, error)

func (*Client) CalculateGas

func (c *Client) CalculateGas(txf clientTx.Factory, msgs ...types.Msg) (uint64, error)

func (*Client) ChangeEndpoint

func (c *Client) ChangeEndpoint()

func (*Client) ConstructAndSignTx

func (c *Client) ConstructAndSignTx(msgs ...types.Msg) ([]byte, error)

func (*Client) Ctx

func (c *Client) Ctx() client.Context

func (*Client) CurrentEndpointIndex

func (c *Client) CurrentEndpointIndex() int

func (*Client) GetAccount

func (c *Client) GetAccount() (client.Account, error)

func (*Client) GetAccountPrefix

func (c *Client) GetAccountPrefix() string

func (*Client) GetBlockTxs

func (c *Client) GetBlockTxs(height int64) ([]*types.TxResponse, error)

func (*Client) GetBlockTxsWithParseErrSkip

func (c *Client) GetBlockTxsWithParseErrSkip(height int64) ([]*types.TxResponse, error)

GetBlockTxsWithParseErrSkip will skip txs that parse failed

func (*Client) GetChainId

func (c *Client) GetChainId() (string, error)

func (*Client) GetCurrentBLockAndTimestamp

func (c *Client) GetCurrentBLockAndTimestamp() (int64, int64, error)

func (*Client) GetCurrentBlockHeight

func (c *Client) GetCurrentBlockHeight() (int64, error)

func (*Client) GetDenom

func (c *Client) GetDenom() string

func (*Client) GetFromAddress

func (c *Client) GetFromAddress() types.AccAddress

func (*Client) GetFromName

func (c *Client) GetFromName() string

func (*Client) GetLegacyAmino

func (c *Client) GetLegacyAmino() *codec.LegacyAmino

func (*Client) GetRpcClient

func (c *Client) GetRpcClient() *rpcClient.Client

func (*Client) GetSequence

func (c *Client) GetSequence(height int64, addr types.AccAddress) (uint64, error)

func (*Client) GetTxConfig

func (c *Client) GetTxConfig() client.TxConfig

func (*Client) GetTxs

func (c *Client) GetTxs(events []string, page, limit int, orderBy string) (*types.SearchTxsResult, error)

func (*Client) GetTxsWithParseErrSkip

func (c *Client) GetTxsWithParseErrSkip(events []string, page, limit int, orderBy string) (*types.SearchTxsResult, int, error)

func (*Client) QueryAccount

func (c *Client) QueryAccount(addr types.AccAddress) (client.Account, error)

func (*Client) QueryBalance

func (c *Client) QueryBalance(addr types.AccAddress, denom string, height int64) (*xBankTypes.QueryBalanceResponse, error)

func (*Client) QueryBlock

func (c *Client) QueryBlock(height int64) (*ctypes.ResultBlock, error)

func (*Client) QueryBondedDenom

func (c *Client) QueryBondedDenom() (*xStakeTypes.QueryParamsResponse, error)

func (*Client) QuerySmartContractState

func (c *Client) QuerySmartContractState(contract string, req []byte) (*xWasmTypes.QuerySmartContractStateResponse, error)

func (*Client) QuerySmartContractStateWithHeight

func (c *Client) QuerySmartContractStateWithHeight(contract string, req []byte, height int64) (*xWasmTypes.QuerySmartContractStateResponse, error)

func (*Client) QueryTxByHash

func (c *Client) QueryTxByHash(hashHexStr string) (*types.TxResponse, error)

no 0x prefix

func (*Client) Retry

func (c *Client) Retry(f func() (interface{}, error)) (interface{}, error)

func (*Client) SendContractExecuteMsg

func (c *Client) SendContractExecuteMsg(contract string, msg []byte, amount types.Coins) (string, error)

func (*Client) SetAccountPrefix

func (c *Client) SetAccountPrefix(prefix string)

func (*Client) SetFromName

func (c *Client) SetFromName(fromName string) error

SetFromName update clientCtx.FromName and clientCtx.FromAddress

func (*Client) SetGasPrice

func (c *Client) SetGasPrice(gasPrice string) error

func (*Client) Sign

func (c *Client) Sign(fromName string, toBeSigned []byte) ([]byte, cryptoTypes.PubKey, error)

func (*Client) SingleTransferTo

func (c *Client) SingleTransferTo(toAddr types.AccAddress, amount types.Coins) error

type EncodingConfig

type EncodingConfig struct {
	InterfaceRegistry types.InterfaceRegistry
	Marshaler         codec.Codec
	TxConfig          client.TxConfig
	Amino             *codec.LegacyAmino
}

EncodingConfig specifies the concrete encoding types to use for a given app. This is provided for compatibility between protobuf and amino implementations.

func MakeEncodingConfig

func MakeEncodingConfig() EncodingConfig

TODO: clean codec MakeEncodingConfig creates an EncodingConfig for testing

Jump to

Keyboard shortcuts

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