jsonrpc

package
v3.1.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 36 Imported by: ? 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 DefGasLimit int64 = 200000

Variables

This section is empty.

Functions

This section is empty.

Types

type FastClient

type FastClient struct {
	Remote string

	log.Logger
	// contains filtered or unexported fields
}

FastClient implement jsonRPCCaller

func NewFastClient

func NewFastClient(remote string) *FastClient

func (*FastClient) Call

func (cli *FastClient) Call(ctx context.Context, method string, params map[string]interface{}, result interface{}) (err error)

func (*FastClient) SetTimeout

func (cli *FastClient) SetTimeout(t time.Duration)

type NodeRPC

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

func NewNodeRPC

func NewNodeRPC(caller jsonRPCCaller) *NodeRPC

func (*NodeRPC) ABCIInfo

func (c *NodeRPC) ABCIInfo() (*ctypes.ResultABCIInfo, error)

func (*NodeRPC) ABCIQuery

func (c *NodeRPC) ABCIQuery(path string, data tmbytes.HexBytes) (*ctypes.ResultABCIQuery, error)

func (*NodeRPC) ABCIQueryIsOk

func (c *NodeRPC) ABCIQueryIsOk(path string, data tmbytes.HexBytes) (*ctypes.ResultABCIQuery, error)

func (*NodeRPC) AppVersion

func (c *NodeRPC) AppVersion() (string, error)

func (*NodeRPC) Block

func (c *NodeRPC) Block(height int64) (*ctypes.ResultBlock, error)

func (*NodeRPC) BlockResults

func (c *NodeRPC) BlockResults(height int64) (*ctypes.ResultBlockResults, error)

func (*NodeRPC) BlockchainInfo

func (c *NodeRPC) BlockchainInfo(minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error)

func (*NodeRPC) BroadcastEvidence

func (c *NodeRPC) BroadcastEvidence(ev types.Evidence) (*ctypes.ResultBroadcastEvidence, error)

func (*NodeRPC) BroadcastTx

func (c *NodeRPC) BroadcastTx(txRaw *tx.TxRaw, mode ...tx.BroadcastMode) (*sdk.TxResponse, error)

func (*NodeRPC) BroadcastTxAsync

func (c *NodeRPC) BroadcastTxAsync(tx types.Tx) (*ctypes.ResultBroadcastTx, error)

func (*NodeRPC) BroadcastTxCommit

func (c *NodeRPC) BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error)

func (*NodeRPC) BroadcastTxRawCommit

func (c *NodeRPC) BroadcastTxRawCommit(txRaw *tx.TxRaw) (*ctypes.ResultBroadcastTxCommit, error)

func (*NodeRPC) BroadcastTxSync

func (c *NodeRPC) BroadcastTxSync(tx types.Tx) (*ctypes.ResultBroadcastTx, error)

func (*NodeRPC) BuildTx

func (c *NodeRPC) BuildTx(privKey cryptotypes.PrivKey, msgs []sdk.Msg) (*tx.TxRaw, error)

func (*NodeRPC) Commit

func (c *NodeRPC) Commit(height int64) (*ctypes.ResultCommit, error)

func (*NodeRPC) ConsensusParams

func (c *NodeRPC) ConsensusParams(height int64) (*ctypes.ResultConsensusParams, error)

func (*NodeRPC) ConsensusState

func (c *NodeRPC) ConsensusState() (*ctypes.ResultConsensusState, error)

func (*NodeRPC) DumpConsensusState

func (c *NodeRPC) DumpConsensusState() (*ctypes.ResultDumpConsensusState, error)

func (*NodeRPC) EstimatingGas

func (c *NodeRPC) EstimatingGas(raw *tx.TxRaw) (*sdk.GasInfo, error)

func (*NodeRPC) Genesis

func (c *NodeRPC) Genesis() (*ctypes.ResultGenesis, error)

func (*NodeRPC) GetAddressPrefix

func (c *NodeRPC) GetAddressPrefix() (prefix string, err error)

func (*NodeRPC) GetBlockHeight

func (c *NodeRPC) GetBlockHeight() (int64, error)

func (*NodeRPC) GetChainId

func (c *NodeRPC) GetChainId() (chain string, err error)

func (*NodeRPC) GetGasPrices

func (c *NodeRPC) GetGasPrices() (sdk.Coins, error)

func (*NodeRPC) GetGravityAttestation deprecated

func (c *NodeRPC) GetGravityAttestation(cdc codec.Codec, id []byte) (*gravitytypes.Attestation, error)

Deprecated: GetGravityAttestation

func (*NodeRPC) GetGravityLastObservedEventNonce deprecated

func (c *NodeRPC) GetGravityLastObservedEventNonce() (uint64, error)

Deprecated: GetGravityLastObservedEventNonce

func (*NodeRPC) GetMintDenom

func (c *NodeRPC) GetMintDenom() (denom string, err error)

func (*NodeRPC) GetStakeValidators

func (c *NodeRPC) GetStakeValidators(status stakingtypes.BondStatus) (stakingtypes.Validators, error)

func (*NodeRPC) Health

func (c *NodeRPC) Health() (*ctypes.ResultHealth, error)

func (*NodeRPC) NetInfo

func (c *NodeRPC) NetInfo() (*ctypes.ResultNetInfo, error)

func (*NodeRPC) NumUnconfirmedTxs

func (c *NodeRPC) NumUnconfirmedTxs() (*ctypes.ResultUnconfirmedTxs, error)

func (*NodeRPC) PeersByAddressPort

func (c *NodeRPC) PeersByAddressPort(port string) (*ctypes.ResultABCIQuery, error)

func (*NodeRPC) PeersById

func (c *NodeRPC) PeersById(id string) (*ctypes.ResultABCIQuery, error)

func (*NodeRPC) QueryAccount

func (c *NodeRPC) QueryAccount(address string) (authtypes.AccountI, error)

func (*NodeRPC) QueryBalance

func (c *NodeRPC) QueryBalance(address string, denom string) (sdk.Coin, error)

func (*NodeRPC) QueryBalances

func (c *NodeRPC) QueryBalances(address string) (sdk.Coins, error)

func (*NodeRPC) QuerySupply

func (c *NodeRPC) QuerySupply() (sdk.Coins, error)

func (*NodeRPC) Status

func (c *NodeRPC) Status() (*ctypes.ResultStatus, error)

func (*NodeRPC) Store

func (c *NodeRPC) Store(path string) (*ctypes.ResultABCIQuery, error)

func (*NodeRPC) Tx

func (c *NodeRPC) Tx(hash []byte) (*ctypes.ResultTx, error)

func (*NodeRPC) TxByHash

func (c *NodeRPC) TxByHash(txHash string) (*sdk.TxResponse, error)

func (*NodeRPC) TxSearch

func (c *NodeRPC) TxSearch(query string, page, perPage int, orderBy string) (
	*ctypes.ResultTxSearch, error,
)

func (*NodeRPC) UnconfirmedTxs

func (c *NodeRPC) UnconfirmedTxs(limit int) (*ctypes.ResultUnconfirmedTxs, error)

func (*NodeRPC) Validators

func (c *NodeRPC) Validators(height int64, page, perPage int) (*ctypes.ResultValidators, error)

func (*NodeRPC) WithContext

func (c *NodeRPC) WithContext(ctx context.Context) *NodeRPC

func (*NodeRPC) WithGasPrices

func (c *NodeRPC) WithGasPrices(gasPrices sdk.Coins) *NodeRPC

func (*NodeRPC) WithHeight

func (c *NodeRPC) WithHeight(height int64) *NodeRPC

type RPCError

type RPCError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    string `json:"data,omitempty"`
}

func (RPCError) ServerExit

func (err RPCError) ServerExit() bool

func (RPCError) String

func (err RPCError) String() string

type RPCRequest

type RPCRequest struct {
	JSONRPC string          `json:"jsonrpc"`
	ID      string          `json:"id,omitempty"`
	Method  string          `json:"method"`
	Params  json.RawMessage `json:"params"` // must be map[string]interface{} or []interface{}
}

func NewRPCRequest

func NewRPCRequest(id, method string, params json.RawMessage) RPCRequest

type RPCResponse

type RPCResponse struct {
	JSONRPC string          `json:"jsonrpc"`
	ID      string          `json:"id,omitempty"`
	Result  json.RawMessage `json:"result,omitempty"`
	Error   *RPCError       `json:"error,omitempty"`
}

type WSClient

type WSClient struct {
	log.Logger
	// contains filtered or unexported fields
}

WSClient implement jsonRPCCaller

func NewWsClient

func NewWsClient(ctx context.Context, url string) (*WSClient, error)

func (*WSClient) ABCIQuery

func (ws *WSClient) ABCIQuery(path string, data tmbytes.HexBytes) (*ctypes.ResultABCIQuery, error)

func (*WSClient) BlockResults

func (ws *WSClient) BlockResults(height int64) (*ctypes.ResultBlockResults, error)

func (*WSClient) Call

func (ws *WSClient) Call(ctx context.Context, method string, params map[string]interface{}, result interface{}) (err error)

func (*WSClient) Close

func (ws *WSClient) Close()

func (*WSClient) ExitCh

func (ws *WSClient) ExitCh() <-chan struct{}

func (*WSClient) Status

func (ws *WSClient) Status() (*ctypes.ResultStatus, error)

func (*WSClient) Subscribe

func (ws *WSClient) Subscribe(ctx context.Context, query string, resp chan RPCResponse) (id string, err error)

func (*WSClient) SubscribeEvent

func (ws *WSClient) SubscribeEvent(ctx context.Context, query string, event chan<- ctypes.ResultEvent) (err error)

SubscribeEvent Experiment

func (*WSClient) TxSearch

func (ws *WSClient) TxSearch(
	query string,
	prove bool,
	page,
	perPage *int,
	orderBy string,
) (*ctypes.ResultTxSearch, error)

func (*WSClient) Unsubscribe

func (ws *WSClient) Unsubscribe(subId string)

Jump to

Keyboard shortcuts

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