client

package
v0.18.15 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package client holds data for access to our RPC interface

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyQuery    = errors.New("empty query path")
	ErrEmptyResponse = errors.New("empty response")
)
View Source
var ErrEmptyTransaction = errors.New("empty transaction")

Functions

This section is empty.

Types

type AddAccountReply added in v0.10.8

type AddAccountReply struct {
	Account accounts.Account `json:"account"`
}

type AddAccountRequest added in v0.10.8

type AddAccountRequest = accounts.Account

type AllegationReply added in v0.16.1

type AllegationReply struct {
	RawTx []byte `json:"rawTx"`
}

type AllegationRequest added in v0.16.1

type AllegationRequest struct {
	Address          keys.Address `json:"address"`
	MaliciousAddress keys.Address `json:"maliciousAddress"`
	BlockHeight      int64        `json:"blockHeight"`
	ProofMsg         string       `json:"proofMsg"`
}

type BTCGetTrackerReply added in v0.13.0

type BTCGetTrackerReply struct {
	TrackerData string `json:"tracker"`
}

type BTCGetTrackerRequest added in v0.13.0

type BTCGetTrackerRequest struct {
	Name string `json:"name"`
}

type BTCLockPrepareRequest added in v0.13.0

type BTCLockPrepareRequest struct {
	Inputs           []InputTransaction `json:"inputs"`
	AmountSatoshi    int64              `json:"amount"`
	FeeRate          int64              `json:"fee_rate"`
	ReturnAddressStr string             `json:"return_address"`
}

type BTCLockPrepareResponse added in v0.13.0

type BTCLockPrepareResponse struct {
	Txn         string `json:"txn"`
	TrackerName string `json:"trackerName"`
}

type BTCLockRequest added in v0.13.0

type BTCLockRequest struct {
	Txn         []byte        `json:"txn"`
	Address     keys.Address  `json:"address"`
	TrackerName string        `json:"trackerName"`
	GasPrice    action.Amount `json:"gasPrice"`
	Gas         int64         `json:"gas"`
}

type BTCRedeemPrepareResponse added in v0.13.0

type BTCRedeemPrepareResponse struct {
	RawTx       []byte `json:"rawTx"`
	TrackerName string `json:"trackerName"`
}

type BTCRedeemRequest added in v0.13.0

type BTCRedeemRequest struct {
	Address    keys.Address  `json:"address"`
	BTCAddress string        `json:"addressBTC"`
	Amount     int64         `json:"amount"`
	FeesBTC    int64         `json:"feesBTC"`
	GasPrice   action.Amount `json:"gasPrice"`
	Gas        int64         `json:"gas"`
}

type BalancePoolRequest added in v0.14.4

type BalancePoolRequest struct {
	Poolname string `json:"poolname"`
}

type BalanceReply added in v0.10.8

type BalanceReply struct {
	// The balance of the account. Returns an empty balance
	// if the account is not found
	Balance string `json:"balance"`
	// The height when this balance was recorded
	Height int64 `json:"height"`
}

type BalanceRequest added in v0.10.8

type BalanceRequest struct {
	Address keys.Address `json:"address"`
}

Blockchain service

type BatchHTTP added in v0.18.15

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

BatchHTTP provides the same interface as `HTTP`, but allows for batching of requests (as per https://www.jsonrpc.org/specification#batch). Do not instantiate directly - rather use the HTTP.NewBatch() method to create an instance of this struct.

Batching of HTTP requests is thread-safe in the sense that multiple goroutines can each create their own batches and send them using the same HTTP client. Multiple goroutines could also enqueue transactions in a single batch, but ordering of transactions in the batch cannot be guaranteed in such an example.

func (BatchHTTP) ABCIInfo added in v0.18.15

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

func (BatchHTTP) ABCIQuery added in v0.18.15

func (c BatchHTTP) ABCIQuery(path string, data bytes.HexBytes) (*ctypes.ResultABCIQuery, error)

func (BatchHTTP) ABCIQueryWithOptions added in v0.18.15

func (c BatchHTTP) ABCIQueryWithOptions(
	path string,
	data bytes.HexBytes,
	opts client.ABCIQueryOptions) (*ctypes.ResultABCIQuery, error)

func (BatchHTTP) Block added in v0.18.15

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

func (BatchHTTP) BlockByHash added in v0.18.15

func (c BatchHTTP) BlockByHash(hash []byte) (*ctypes.ResultBlock, error)

func (BatchHTTP) BlockResults added in v0.18.15

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

func (BatchHTTP) BlockchainInfo added in v0.18.15

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

func (BatchHTTP) BroadcastEvidence added in v0.18.15

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

func (BatchHTTP) BroadcastTxAsync added in v0.18.15

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

func (BatchHTTP) BroadcastTxCommit added in v0.18.15

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

func (BatchHTTP) BroadcastTxSync added in v0.18.15

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

func (*BatchHTTP) Clear added in v0.18.15

func (b *BatchHTTP) Clear() int

Clear will empty out this batch of requests and return the number of requests that were cleared out.

func (BatchHTTP) Commit added in v0.18.15

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

func (BatchHTTP) ConsensusParams added in v0.18.15

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

func (BatchHTTP) ConsensusState added in v0.18.15

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

func (*BatchHTTP) Count added in v0.18.15

func (b *BatchHTTP) Count() int

Count returns the number of enqueued requests waiting to be sent.

func (BatchHTTP) DumpConsensusState added in v0.18.15

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

func (BatchHTTP) Genesis added in v0.18.15

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

func (BatchHTTP) Health added in v0.18.15

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

func (BatchHTTP) NetInfo added in v0.18.15

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

func (BatchHTTP) NumUnconfirmedTxs added in v0.18.15

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

func (*BatchHTTP) Send added in v0.18.15

func (b *BatchHTTP) Send() ([]interface{}, error)

Send is a convenience function for an HTTP batch that will trigger the compilation of the batched requests and send them off using the client as a single request. On success, this returns a list of the deserialized results from each request in the sent batch.

func (BatchHTTP) Status added in v0.18.15

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

func (BatchHTTP) Tx added in v0.18.15

func (c BatchHTTP) Tx(hash []byte, prove bool) (*ctypes.ResultTx, error)

func (BatchHTTP) TxSearch added in v0.18.15

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

func (BatchHTTP) UnconfirmedTxs added in v0.18.15

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

func (BatchHTTP) Validators added in v0.18.15

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

type BroadcastMode added in v0.10.8

type BroadcastMode string
const (
	BROADCASTASYNC  BroadcastMode = "async"
	BROADCASTSYNC   BroadcastMode = "sync"
	BROADCASTCOMMIT BroadcastMode = "commit"
)

type BroadcastMtSigRequest added in v0.14.3

type BroadcastMtSigRequest struct {
	RawTx      []byte             `json:"rawTx"`
	Signatures []action.Signature `json:"signatures"`
}

type BroadcastReply added in v0.10.8

type BroadcastReply struct {
	TxHash bytes.HexBytes `json:"txHash"`
	// OK indicates whether this broadcast was a request.
	// For TxSync, it indicates success of CheckTx. Does not guarantee inclusion of a block
	// For TxAsync, it always returns true
	// For TxCommit, it indicates the success of both CheckTx and DeliverTx. If the broadcast fails is false.
	OK     bool   `json:"ok"`
	Height *int64 `json:"height,omitempty"`
	Log    string `json:"log"`
}

func (*BroadcastReply) FromResultBroadcastTx added in v0.10.8

func (reply *BroadcastReply) FromResultBroadcastTx(result *ctypes.ResultBroadcastTx)

func (*BroadcastReply) FromResultBroadcastTxCommit added in v0.10.8

func (reply *BroadcastReply) FromResultBroadcastTxCommit(result *ctypes.ResultBroadcastTxCommit)

type BroadcastRequest added in v0.10.8

type BroadcastRequest struct {
	RawTx     []byte         `json:"rawTx"`
	Signature []byte         `json:"signature"`
	PublicKey keys.PublicKey `json:"publicKey"`
}

type CancelProposalRequest added in v0.14.3

type CancelProposalRequest struct {
	ProposalId governance.ProposalID `json:"proposalId"`
	Proposer   keys.Address          `json:"proposer"`
	Reason     string                `json:"reason"`
	GasPrice   action.Amount         `json:"gasPrice"`
	Gas        int64                 `json:"gas"`
}

type Client added in v0.18.15

type Client interface {
	client.Client
	ExtendedSignCLient
}

Client wraps most important rpc calls a client would make if you want to listen for events, test if it also implements events.EventSwitch.

type CreateProposalRequest added in v0.14.3

type CreateProposalRequest struct {
	ProposalID      string          `json:"proposalId"`
	ProposalType    string          `json:"proposalType"`
	Headline        string          `json:"headline"`
	Description     string          `json:"description"`
	Proposer        keys.Address    `json:"proposer"`
	InitialFunding  action.Amount   `json:"initialFunding"`
	GasPrice        action.Amount   `json:"gasPrice"`
	Gas             int64           `json:"gas"`
	FundingDeadline int64           `json:"fundingDeadline"`
	FundingGoal     *balance.Amount `json:"fundingGoal"`
	VotingDeadline  int64           `json:"votingDeadline"`
	PassPercentage  int             `json:"passPercentage"`
	ConfigUpdate    string          `json:"configUpdate"`
}

type CreateTxReply added in v0.14.0

type CreateTxReply struct {
	RawTx []byte `json:"rawTx"`
}

type CurrencyBalanceReply added in v0.13.0

type CurrencyBalanceReply struct {
	Currency string `json:"currency"`
	Balance  string `json:"balance"`
	// The height when this balance was recorded
	Height int64 `json:"height"`
}

type CurrencyBalanceRequest added in v0.13.0

type CurrencyBalanceRequest struct {
	Currency string       `json:"currency"`
	Address  keys.Address `json:"address"`
}

type DelegRewardsStats added in v0.16.1

type DelegRewardsStats struct {
	Active  balance.Amount `json:"active"`
	Pending balance.Amount `json:"pending"`
}

type DelegStats added in v0.16.1

type DelegStats struct {
	Active  balance.Amount `json:"active"`
	Pending balance.Amount `json:"pending"`
}

type DelegationStatusReply added in v0.14.3

type DelegationStatusReply struct {
	Balance                   string                   `json:"balance"`
	EffectiveDelegationAmount string                   `json:"effectiveDelegationAmount"`
	WithdrawableAmount        string                   `json:"withdrawableAmount"`
	MaturedAmounts            []*delegation.MatureData `json:"maturedAmount"`
}

type DelegationStatusRequest added in v0.14.3

type DelegationStatusRequest struct {
	Address keys.Address `json:"address"`
}

type DeleteAccountReply added in v0.10.8

type DeleteAccountReply struct {
	Deleted bool `json:"deleted"`
}

type DeleteAccountRequest added in v0.10.8

type DeleteAccountRequest struct {
	Address keys.Address `json:"address"`
}

type ETHLockRequest added in v0.13.0

type ETHLockRequest struct {
	Txn     []byte
	Address keys.Address
	Fee     action.Amount `json:"fee"`
	Gas     int64         `json:"gas"`
}

type EmptyRequest added in v0.14.0

type EmptyRequest struct {
}

type ExtServiceContext added in v0.10.8

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

ExtServiceContext holds clients for making requests to external services

func NewExtServiceContext added in v0.10.8

func NewExtServiceContext(rpcAddress, sdkAddress string) (cliCtx ExtServiceContext, err error)

Generators

func (ExtServiceContext) Block added in v0.10.8

func (ctx ExtServiceContext) Block(height int64) (res *ctypes.ResultBlock)

func (ExtServiceContext) BroadcastTxAsync added in v0.10.8

func (ctx ExtServiceContext) BroadcastTxAsync(packet []byte) (res *ctypes.ResultBroadcastTx, err error)

func (ExtServiceContext) BroadcastTxCommit added in v0.10.8

func (ctx ExtServiceContext) BroadcastTxCommit(packet []byte) (res *ctypes.ResultBroadcastTxCommit, err error)

func (ExtServiceContext) BroadcastTxSync added in v0.10.8

func (ctx ExtServiceContext) BroadcastTxSync(packet []byte) (res *ctypes.ResultBroadcastTx, err error)

func (*ExtServiceContext) FullNodeClient added in v0.10.8

func (ctx *ExtServiceContext) FullNodeClient() *ServiceClient

func (ExtServiceContext) Query added in v0.10.8

func (ctx ExtServiceContext) Query(serviceMethod string, args interface{}, response interface{}) error

func (*ExtServiceContext) RPCClient added in v0.18.15

func (ctx *ExtServiceContext) RPCClient() Client

func (ExtServiceContext) Search added in v0.10.8

func (ctx ExtServiceContext) Search(query string, prove bool, page, perPage int, orderBy string) (res *ctypes.ResultTxSearch)

func (ExtServiceContext) Tx added in v0.10.8

func (ctx ExtServiceContext) Tx(hash []byte, prove bool) (res *ctypes.ResultTx, err error)

type ExtendedSignCLient added in v0.18.15

type ExtendedSignCLient interface {
	BlockByHash(hash []byte) (*ctypes.ResultBlock, error)
}

type FeeOptionsReply added in v0.14.0

type FeeOptionsReply struct {
	FeeOption fees.FeeOption `json:"feeOption"`
}

type FinalizeProposalRequest added in v0.14.3

type FinalizeProposalRequest struct {
	ProposalId governance.ProposalID `json:"proposalId"`
	Proposer   action.Address        `json:"proposer"`
	GasPrice   action.Amount         `json:"gasPrice"`
	Gas        int64                 `json:"gas"`
}

type FullDelegStats added in v0.16.1

type FullDelegStats struct {
	DelegAddress      keys.Address      `json:"delegationAddress"`
	DelegStats        DelegStats        `json:"delegationStats"`
	DelegRewardsStats DelegRewardsStats `json:"delegationRewardsStats"`
}

type FundProposalRequest added in v0.14.3

type FundProposalRequest struct {
	ProposalId    governance.ProposalID `json:"proposalId"`
	FundValue     action.Amount         `json:"fundValue"`
	FunderAddress action.Address        `json:"funderAddress"`
	GasPrice      action.Amount         `json:"gasPrice"`
	Gas           int64                 `json:"gas"`
}

type GenerateAccountRequest added in v0.10.8

type GenerateAccountRequest struct {
	Name string `json:"name"`
}

type GetDelegRewardsReply added in v0.16.1

type GetDelegRewardsReply struct {
	Balance balance.Amount                       `json:"balance"`
	Pending []*network_delegation.PendingRewards `json:"pending"`
	//Matured balance.Amount                       `json:"matured"`
	Height int64 `json:"height"`
}

type GetDelegRewardsRequest added in v0.16.1

type GetDelegRewardsRequest struct {
	Delegator   keys.Address `json:"delegator"`
	InclPending bool         `json:"inclPending"`
}

type GetFundsForProposalByFunderReply added in v0.14.3

type GetFundsForProposalByFunderReply struct {
	Amount balance.Amount `json:"amount"`
}

type GetFundsForProposalByFunderRequest added in v0.14.3

type GetFundsForProposalByFunderRequest struct {
	ProposalId governance.ProposalID `json:"proposalId"`
	Funder     keys.Address          `json:"funderAddress"`
}

type GetProposalOptionsReply added in v0.14.3

type GetProposalOptionsReply struct {
	ProposalOptions governance.ProposalOptionSet `json:"proposalOptions"`
	Height          int64                        `json:"height"`
}

type GetProposalOptionsRequest added in v0.14.3

type GetProposalOptionsRequest struct{}

type GetTotalDelegRewardsReply added in v0.16.1

type GetTotalDelegRewardsReply struct {
	TotalRewards balance.Amount `json:"totalRewards"`
	Height       int64          `json:"height"`
}

type GetTotalDelegRewardsRequest added in v0.16.1

type GetTotalDelegRewardsRequest struct{}

type GetTotalNetwkDelegation added in v0.16.1

type GetTotalNetwkDelegation struct {
	OnlyActive int `json:"onlyActive"`
}

type GetTotalNetwkDelgReply added in v0.16.1

type GetTotalNetwkDelgReply struct {
	ActiveAmount  balance.Amount `json:"activeAmount"`
	PendingAmount balance.Amount `json:"pendingAmount"`
	TotalAmount   balance.Amount `json:"totalAmount"`
	Height        int64          `json:"height"`
}

type GetUndelegatedReply added in v0.16.1

type GetUndelegatedReply struct {
	PendingAmounts []SinglePendingAmount `json:"pendingAmount"`
	TotalAmount    balance.Amount        `json:"totalAmount"`
	Height         int64                 `json:"height"`
}

type GetUndelegatedRequest added in v0.16.1

type GetUndelegatedRequest struct {
	Delegator keys.Address `json:"delegator"`
}

-------------query

type GovernanceOptionsReply added in v0.14.3

type GovernanceOptionsReply struct {
	GovOptions       governance.GovernanceState `json:"govOptions"`
	LastUpdateHeight LastUpdateHeights          `json:"lastUpdateHeight"`
}

type GovernanceOptionsRequest added in v0.14.3

type GovernanceOptionsRequest struct {
}

type HTTP added in v0.18.15

type HTTP struct {
	*WSEvents
	// contains filtered or unexported fields
}

HTTP is a Client implementation that communicates with a Tendermint node over JSON RPC and WebSockets.

This is the main implementation you probably want to use in production code. There are other implementations when calling the Tendermint node in-process (Local), or when you want to mock out the server for test code (mock).

You can subscribe for any event published by Tendermint using Subscribe method. Note delivery is best-effort. If you don't read events fast enough or network is slow, Tendermint might cancel the subscription. The client will attempt to resubscribe (you don't need to do anything). It will keep trying every second indefinitely until successful.

Request batching is available for JSON RPC requests over HTTP, which conforms to the JSON RPC specification (https://www.jsonrpc.org/specification#batch). See the example for more details.

func NewHTTP added in v0.18.15

func NewHTTP(remote, wsEndpoint string) (*HTTP, error)

NewHTTP takes a remote endpoint in the form <protocol>://<host>:<port> and the websocket path (which always seems to be "/websocket") An error is returned on invalid remote. The function panics when remote is nil.

func NewHTTPWithClient added in v0.18.15

func NewHTTPWithClient(remote, wsEndpoint string, client *http.Client) (*HTTP, error)

NewHTTPWithClient allows for setting a custom http client (See NewHTTP). An error is returned on invalid remote. The function panics when remote is nil.

func NewHTTPWithTimeout added in v0.18.15

func NewHTTPWithTimeout(remote, wsEndpoint string, timeout uint) (*HTTP, error)

Create timeout enabled http client

func (HTTP) ABCIInfo added in v0.18.15

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

func (HTTP) ABCIQuery added in v0.18.15

func (c HTTP) ABCIQuery(path string, data bytes.HexBytes) (*ctypes.ResultABCIQuery, error)

func (HTTP) ABCIQueryWithOptions added in v0.18.15

func (c HTTP) ABCIQueryWithOptions(
	path string,
	data bytes.HexBytes,
	opts client.ABCIQueryOptions) (*ctypes.ResultABCIQuery, error)

func (HTTP) Block added in v0.18.15

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

func (HTTP) BlockByHash added in v0.18.15

func (c HTTP) BlockByHash(hash []byte) (*ctypes.ResultBlock, error)

func (HTTP) BlockResults added in v0.18.15

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

func (HTTP) BlockchainInfo added in v0.18.15

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

func (HTTP) BroadcastEvidence added in v0.18.15

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

func (HTTP) BroadcastTxAsync added in v0.18.15

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

func (HTTP) BroadcastTxCommit added in v0.18.15

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

func (HTTP) BroadcastTxSync added in v0.18.15

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

func (HTTP) Commit added in v0.18.15

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

func (HTTP) ConsensusParams added in v0.18.15

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

func (HTTP) ConsensusState added in v0.18.15

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

func (HTTP) DumpConsensusState added in v0.18.15

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

func (HTTP) Genesis added in v0.18.15

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

func (HTTP) Health added in v0.18.15

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

func (HTTP) NetInfo added in v0.18.15

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

func (*HTTP) NewBatch added in v0.18.15

func (c *HTTP) NewBatch() *BatchHTTP

NewBatch creates a new batch client for this HTTP client.

func (HTTP) NumUnconfirmedTxs added in v0.18.15

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

func (*HTTP) Remote added in v0.18.15

func (c *HTTP) Remote() string

Remote returns the remote network address in a string form.

func (*HTTP) SetLogger added in v0.18.15

func (c *HTTP) SetLogger(l log.Logger)

SetLogger sets a logger.

func (HTTP) Status added in v0.18.15

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

func (HTTP) Tx added in v0.18.15

func (c HTTP) Tx(hash []byte, prove bool) (*ctypes.ResultTx, error)

func (HTTP) TxSearch added in v0.18.15

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

func (HTTP) UnconfirmedTxs added in v0.18.15

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

func (HTTP) Validators added in v0.18.15

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

type InputTransaction added in v0.14.0

type InputTransaction struct {
	Hash  string `json:"hash"`
	Index uint32 `json:"index"`
}

type LastUpdateHeights added in v0.15.1

type LastUpdateHeights struct {
	Proposal int64 `json:"proposal"`
	Rewards  int64 `json:"rewards"`
	Ons      int64 `json:"ons"`
	Eth      int64 `json:"eth"`
	Btc      int64 `json:"btc"`
	Staking  int64 `json:"staking"`
	Currency int64 `json:"currency"`
	Fee      int64 `json:"fee"`
	Evidence int64 `json:"evidence"`
}

type ListAccountAddressesReply added in v0.10.8

type ListAccountAddressesReply struct {
	Addresses []string `json:"addresses"`
}

type ListAccountsReply added in v0.10.8

type ListAccountsReply struct {
	Accounts []accounts.Account `json:"accounts"`
}

type ListAccountsRequest added in v0.10.8

type ListAccountsRequest struct{}

type ListCurrenciesReply added in v0.10.8

type ListCurrenciesReply struct {
	Currencies balance.Currencies `json:"currencies"`
}

type ListCurrenciesRequest added in v0.10.8

type ListCurrenciesRequest struct{}

type ListDelegationReply added in v0.16.1

type ListDelegationReply struct {
	AllDelegStats []*FullDelegStats `json:"allDelegStats"`
	Height        int64             `json:"height"`
}

type ListDelegationRequest added in v0.16.1

type ListDelegationRequest struct {
	DelegationAddresses []keys.Address `json:"delegationAddresses"`
}

type ListProposalRequest added in v0.14.3

type ListProposalRequest struct {
	ProposalId governance.ProposalID `json:"proposalId"`
}

type ListProposalsReply added in v0.14.3

type ListProposalsReply struct {
	ProposalStats []ProposalStat `json:"proposalStats"`
	Height        int64          `json:"height"`
}

type ListProposalsRequest added in v0.14.3

type ListProposalsRequest struct {
	State        governance.ProposalState `json:"state"`
	Proposer     keys.Address             `json:"proposer"`
	ProposalType governance.ProposalType  `json:"proposalType"`
}

type ListRewardsReply added in v0.14.3

type ListRewardsReply struct {
	Validator keys.Address   `json:"validator"`
	Rewards   []RewardRecord `json:"rewards"`
	Height    int64          `json:"height"`
}

type ListRewardsRequest added in v0.14.4

type ListRewardsRequest struct{}

type ListTxTypesReply added in v0.14.0

type ListTxTypesReply struct {
	TxTypes []action.TxTypeDescribe `json:"txTypes"`
}

type ListTxTypesRequest added in v0.14.0

type ListTxTypesRequest struct{}

type ListValidatorsReply added in v0.10.8

type ListValidatorsReply struct {
	// The list of active validators
	Validators []identity.Validator `json:"validators"`
	// Height at which this validator set was active
	Height int64           `json:"height"`
	VMap   map[string]bool `json:"vmap"`
	FMap   map[string]bool `json:"fmap"`
}

type ListValidatorsRequest added in v0.10.8

type ListValidatorsRequest struct{}

type ListWitnessesReply added in v0.14.2

type ListWitnessesReply struct {
	// The list of active witnesses
	Witnesses []keys.Address `json:"witnesses"`
	// Height at which this witness set was active
	Height int64 `json:"height"`
}

type ListWitnessesRequest added in v0.14.2

type ListWitnessesRequest struct {
	ChainType chain.Type `json:"chainType"`
}

type MaxTrackerBalanceReply added in v0.14.0

type MaxTrackerBalanceReply struct {
	MaxBalance int64 `json:"max_balance"`
}

type NetUndelegateRequest added in v0.16.1

type NetUndelegateRequest struct {
	Delegator keys.Address  `json:"delegator"`
	Amount    action.Amount `json:"amount"`
	GasPrice  action.Amount `json:"gasPrice"`
	Gas       int64         `json:"gas"`
}

type NetworkDelegateRequest added in v0.16.1

type NetworkDelegateRequest struct {
	DelegationAddress keys.Address  `json:"delegationAddress"`
	Amount            action.Amount `json:"amount"`
	GasPrice          action.Amount `json:"gasPrice"`
	Gas               int64         `json:"gas"`
}

-------------TX

type NewAccountReply added in v0.10.8

type NewAccountReply struct {
	Account accounts.Account `json:"account"`
}

type NewAccountRequest added in v0.10.8

type NewAccountRequest struct {
	Name string `json:"name"`
}

type NodeAddressReply added in v0.10.8

type NodeAddressReply struct {
	Address keys.Address `json:"address"`
}

type NodeAddressRequest added in v0.10.8

type NodeAddressRequest struct{}

type NodeIDReply added in v0.10.8

type NodeIDReply struct {
	PublicKey string `json:"publicKey"`
	Id        string `json:"id"`
}

type NodeIDRequest added in v0.10.8

type NodeIDRequest struct {
	ShouldShowIP bool `json:"shouldShowIP,omitempty"`
}

type NodeNameReply added in v0.10.8

type NodeNameReply struct {
	Name string `json:"name"`
}

type NodeNameRequest added in v0.10.8

type NodeNameRequest struct{}

type ONSCreateRequest added in v0.10.8

type ONSCreateRequest struct {
	Owner       keys.Address  `json:"owner"`
	Account     keys.Address  `json:"account"`
	Name        string        `json:"name"`
	Uri         string        `json:"uri"`
	BuyingPrice action.Amount `json:"buyingPrice"`
	GasPrice    action.Amount `json:"gasPrice"`
	Gas         int64         `json:"gas"`
}

ONS Request Types

type ONSCreateSubRequest added in v0.14.0

type ONSCreateSubRequest struct {
	Owner       keys.Address  `json:"owner"`
	Account     keys.Address  `json:"account"`
	Name        string        `json:"name"`
	Uri         string        `json:"uri"`
	BuyingPrice action.Amount `json:"buyingPrice"`
	GasPrice    action.Amount `json:"gasPrice"`
	Gas         int64         `json:"gas"`
}

type ONSDeleteSubRequest added in v0.14.0

type ONSDeleteSubRequest struct {
	Name     string        `json:"name"`
	Owner    keys.Address  `json:"owner"`
	GasPrice action.Amount `json:"gasPrice"`
	Gas      int64         `json:"gas"`
}

type ONSGetDomainsReply added in v0.10.8

type ONSGetDomainsReply struct {
	Domains []ons.Domain `json:"domains"`
	Height  int64        `json:"height"`
}

type ONSGetDomainsRequest added in v0.10.8

type ONSGetDomainsRequest struct {
	Name        string       `json:"name"`
	Owner       keys.Address `json:"owner"`
	OnSale      bool         `json:"onSale"`
	Beneficiary keys.Address `json:"beneficiary"`
}

type ONSGetOptionsReply added in v0.14.0

type ONSGetOptionsReply struct {
	ons.Options `json:"options"`
}

type ONSPurchaseRequest added in v0.10.8

type ONSPurchaseRequest struct {
	Name     string        `json:"name"`
	Buyer    keys.Address  `json:"buyer"`
	Account  keys.Address  `json:"account"`
	Offering action.Amount `json:"offering"`
	GasPrice action.Amount `json:"gasPrice"`
	Gas      int64         `json:"gas"`
}

type ONSRenewRequest added in v0.14.0

type ONSRenewRequest struct {
	Owner       keys.Address  `json:"owner"`
	Account     keys.Address  `json:"account"`
	Name        string        `json:"name"`
	BuyingPrice action.Amount `json:"buyingPrice"`
	GasPrice    action.Amount `json:"gasPrice"`
	Gas         int64         `json:"gas"`
}

type ONSSaleRequest added in v0.10.8

type ONSSaleRequest struct {
	Name         string        `json:"name"`
	OwnerAddress keys.Address  `json:"owner"`
	Price        action.Amount `json:"price"`
	CancelSale   bool          `json:"cancelSale"`
	GasPrice     action.Amount `json:"gasPrice"`
	Gas          int64         `json:"gas"`
}

type ONSSendRequest added in v0.10.8

type ONSSendRequest struct {
	From     keys.Address  `json:"from"`
	Name     string        `json:"name"`
	Amount   action.Amount `json:"amount"`
	GasPrice action.Amount `json:"gasPrice"`
	Gas      int64         `json:"gas"`
}

type ONSUpdateRequest added in v0.10.8

type ONSUpdateRequest struct {
	Owner    keys.Address  `json:"owner"`
	Account  keys.Address  `json:"account"`
	Name     string        `json:"name"`
	Active   bool          `json:"active"`
	Uri      string        `json:"uri"`
	GasPrice action.Amount `json:"gasPrice"`
	Gas      int64         `json:"gas"`
}

type ProposalStat added in v0.14.3

type ProposalStat struct {
	Proposal governance.Proposal   `json:"proposal"`
	Funds    balance.Amount        `json:"funds"`
	Votes    governance.VoteStatus `json:"votes"`
}

type ReinvestDelegRewardsRequest added in v0.16.1

type ReinvestDelegRewardsRequest struct {
	Delegator keys.Address  `json:"delegator"`
	Amount    action.Amount `json:"amount"`
}

type ReleaseReply added in v0.16.1

type ReleaseReply struct {
	RawTx []byte `json:"rawTx"`
}

type ReleaseRequest added in v0.16.1

type ReleaseRequest struct {
	Address keys.Address `json:"address"`
}

type RewardRecord added in v0.16.1

type RewardRecord struct {
	Index  int64
	Amount balance.Amount
}

type RewardStat added in v0.14.3

type RewardStat struct {
	Validators   []ValidatorRewardStats `json:"validators"`
	TotalRewards balance.Amount         `json:"totalRewards"`
	Height       int64                  `json:"height"`
}

type RewardsRequest added in v0.14.3

type RewardsRequest struct {
	Validator string `json:"validator"`
}

type SecureSignRawTxRequest added in v0.16.1

type SecureSignRawTxRequest struct {
	RawTx    []byte         `json:"rawTx"`
	Address  action.Address `json:"address"`
	Password string         `json:"password"`
	KeyPath  string         `json:"keyPath"`
}

type SendPoolTxRequest added in v0.14.3

type SendPoolTxRequest struct {
	From     action.Address `json:"from"`
	PoolName string         `json:"to"`
	Amount   action.Amount  `json:"amount"`
	GasPrice action.Amount  `json:"gasPrice"`
	Gas      int64          `json:"gas"`
}

type SendTxRequest added in v0.10.8

type SendTxRequest struct {
	From     keys.Address  `json:"from"`
	To       keys.Address  `json:"to,omitempty"`
	Amount   action.Amount `json:"amount"`
	GasPrice action.Amount `json:"gasPrice"`
	Gas      int64         `json:"gas"`
}

type ServiceClient added in v0.10.8

type ServiceClient struct {
	*rpc.Client
}

A type-safe client for accessing rpc services. Eventually each service will be broken out onto its own type TODO: The methods defined here should handle context.Context

func NewServiceClient added in v0.10.8

func NewServiceClient(conn string) (*ServiceClient, error)

func (*ServiceClient) AddAccount added in v0.10.8

func (c *ServiceClient) AddAccount(req AddAccountRequest) (out AddAccountReply, err error)

func (*ServiceClient) Allegation added in v0.16.1

func (c *ServiceClient) Allegation(req AllegationRequest) (out AllegationReply, err error)

func (*ServiceClient) Balance added in v0.10.8

func (c *ServiceClient) Balance(addr keys.Address) (out BalanceReply, err error)

func (*ServiceClient) BalancePool added in v0.14.4

func (c *ServiceClient) BalancePool(poolname string) (out BalanceReply, err error)

func (*ServiceClient) CheckCommitResult added in v0.15.1

func (c *ServiceClient) CheckCommitResult(hash string, prove bool) (reply TxResponse, err error)

func (*ServiceClient) CreateRawSend added in v0.10.8

func (c *ServiceClient) CreateRawSend(req SendTxRequest) (out *CreateTxReply, err error)

func (*ServiceClient) CreateRawSendPool added in v0.14.4

func (c *ServiceClient) CreateRawSendPool(req SendPoolTxRequest) (out *CreateTxReply, err error)

func (*ServiceClient) CurrBalance added in v0.13.0

func (c *ServiceClient) CurrBalance(addr keys.Address, currency string) (out CurrencyBalanceReply, err error)

func (*ServiceClient) DelegationStatus added in v0.14.3

func (c *ServiceClient) DelegationStatus(request DelegationStatusRequest) (out DelegationStatusReply, err error)

func (*ServiceClient) DeleteAccount added in v0.10.8

func (c *ServiceClient) DeleteAccount(req DeleteAccountRequest) (out DeleteAccountReply, err error)

func (*ServiceClient) GetTotalNetwkDelegation added in v0.16.1

func (c *ServiceClient) GetTotalNetwkDelegation(onlyActive int) (reply GetTotalNetwkDelgReply, err error)

func (*ServiceClient) GetTracker added in v0.13.0

func (c *ServiceClient) GetTracker(name string) (out BTCGetTrackerReply, err error)

func (*ServiceClient) ListAccountAddresses added in v0.10.8

func (c *ServiceClient) ListAccountAddresses() (out ListAccountAddressesReply, err error)

func (*ServiceClient) ListAccounts added in v0.10.8

func (c *ServiceClient) ListAccounts() (out ListAccountsReply, err error)

func (*ServiceClient) ListCurrencies added in v0.10.8

func (c *ServiceClient) ListCurrencies() (out *ListCurrenciesReply, err error)

func (*ServiceClient) ListDelegation added in v0.16.1

func (c *ServiceClient) ListDelegation(delegationAddresses []keys.Address) (reply ListDelegationReply, err error)

func (*ServiceClient) ListProposal added in v0.14.3

func (c *ServiceClient) ListProposal(req ListProposalRequest) (out *ListProposalsReply, err error)

func (*ServiceClient) ListProposals added in v0.14.3

func (c *ServiceClient) ListProposals(req ListProposalsRequest) (out *ListProposalsReply, err error)

func (*ServiceClient) ListRewards added in v0.14.3

func (c *ServiceClient) ListRewards(req RewardsRequest) (out *ListRewardsReply, err error)

func (*ServiceClient) ListValidators added in v0.10.8

func (c *ServiceClient) ListValidators() (out ListValidatorsReply, err error)

func (*ServiceClient) ListWitnesses added in v0.14.2

func (c *ServiceClient) ListWitnesses(req ListWitnessesRequest) (out ListWitnessesReply, err error)

func (*ServiceClient) NodeAddress added in v0.10.8

func (c *ServiceClient) NodeAddress() (out NodeAddressReply, err error)

func (*ServiceClient) NodeID added in v0.10.8

func (c *ServiceClient) NodeID(req NodeIDRequest) (out NodeIDReply, err error)

func (*ServiceClient) NodeName added in v0.10.8

func (c *ServiceClient) NodeName() (out NodeNameReply, err error)

func (*ServiceClient) ONS_CreateRawBuy added in v0.10.8

func (c *ServiceClient) ONS_CreateRawBuy(req ONSPurchaseRequest) (out CreateTxReply, err error)

func (*ServiceClient) ONS_CreateRawCreate added in v0.10.8

func (c *ServiceClient) ONS_CreateRawCreate(req ONSCreateRequest) (out CreateTxReply, err error)

ONS

func (*ServiceClient) ONS_CreateRawSale added in v0.10.8

func (c *ServiceClient) ONS_CreateRawSale(req ONSSaleRequest) (out CreateTxReply, err error)

func (*ServiceClient) ONS_CreateRawSend added in v0.10.8

func (c *ServiceClient) ONS_CreateRawSend(req ONSSendRequest) (out CreateTxReply, err error)

func (*ServiceClient) ONS_CreateRawUpdate added in v0.10.8

func (c *ServiceClient) ONS_CreateRawUpdate(req ONSUpdateRequest) (out CreateTxReply, err error)

func (*ServiceClient) Release added in v0.16.1

func (c *ServiceClient) Release(req ReleaseRequest) (out ReleaseReply, err error)

func (*ServiceClient) SendTx added in v0.10.8

func (c *ServiceClient) SendTx(req SendTxRequest) (out CreateTxReply, err error)

func (*ServiceClient) Stake added in v0.14.3

func (c *ServiceClient) Stake(req StakeRequest) (out StakeReply, err error)

func (*ServiceClient) TxAsync added in v0.10.8

func (c *ServiceClient) TxAsync(req BroadcastRequest) (out BroadcastReply, err error)

Broadcast

func (*ServiceClient) TxCommit added in v0.10.8

func (c *ServiceClient) TxCommit(req BroadcastRequest) (out BroadcastReply, err error)

func (*ServiceClient) TxSync added in v0.10.8

func (c *ServiceClient) TxSync(req BroadcastRequest) (out BroadcastReply, err error)

func (*ServiceClient) Unstake added in v0.14.3

func (c *ServiceClient) Unstake(req UnstakeRequest) (out UnstakeReply, err error)

func (*ServiceClient) ValidatorStatus added in v0.14.3

func (c *ServiceClient) ValidatorStatus(request ValidatorStatusRequest) (out ValidatorStatusReply, err error)

func (*ServiceClient) Vote added in v0.16.1

func (c *ServiceClient) Vote(req VoteRequest) (out VoteReply, err error)

func (*ServiceClient) VoteProposal added in v0.14.3

func (c *ServiceClient) VoteProposal(req VoteProposalRequest) (out *VoteProposalReply, err error)

Governance

func (*ServiceClient) VoteRequests added in v0.16.1

func (c *ServiceClient) VoteRequests(req VoteRequestRequest) (out VoteRequestReply, err error)

func (*ServiceClient) Withdraw added in v0.14.3

func (c *ServiceClient) Withdraw(req WithdrawRequest) (out WithdrawReply, err error)

func (*ServiceClient) WithdrawRewards added in v0.14.3

func (c *ServiceClient) WithdrawRewards(req WithdrawRewardsRequest) (out WithdrawRewardsReply, err error)

type SignRawTxRequest added in v0.10.8

type SignRawTxRequest struct {
	RawTx   []byte         `json:"rawTx"`
	Address action.Address `json:"address"`
}

type SignRawTxResponse added in v0.10.8

type SignRawTxResponse struct {
	Signature action.Signature `json:"signature"`
}

type SinglePendingAmount added in v0.16.1

type SinglePendingAmount struct {
	Amount       balance.Amount `json:"amount"`
	MatureHeight int64          `json:"matureHeight"`
}

type StakeReply added in v0.14.3

type StakeReply struct {
	RawTx []byte `json:"rawTx"`
}

type StakeRequest added in v0.14.3

type StakeRequest struct {
	Address      keys.Address   `json:"address"`
	Amount       balance.Amount `json:"amount"`
	Name         string         `json:"name"`
	TmPubKeyType string         `json:"tmPubKeyType"`
	TmPubKey     []byte         `json:"tmPubKey"`
}

type TxRequest added in v0.14.0

type TxRequest struct {
	Hash  string `json:"hash"`
	Prove bool   `json:"prove"`
}

type TxResponse added in v0.14.0

type TxResponse struct {
	Result ctypes.ResultTx `json:"result"`
}

type UnstakeReply added in v0.14.3

type UnstakeReply struct {
	RawTx []byte `json:"rawTx"`
}

type UnstakeRequest added in v0.14.3

type UnstakeRequest struct {
	Address keys.Address   `json:"address"`
	Amount  balance.Amount `json:"amount"`
}

type ValidatorRewardStats added in v0.14.3

type ValidatorRewardStats struct {
	Address         keys.Address   `json:"address"`
	PendingAmount   balance.Amount `json:"pendingAmount"`
	WithdrawnAmount balance.Amount `json:"withdrawnAmount"`
	MatureBalance   balance.Amount `json:"matureBalance"`
	TotalAmount     balance.Amount `json:"totalAmount"`
}

type ValidatorStatusReply added in v0.14.3

type ValidatorStatusReply struct {
	Height                int64  `json:"height"`
	Power                 int64  `json:"power"`
	Staking               string `json:"staking"`
	TotalDelegationAmount string `json:"totalDelegationAmount"`
	SelfDelegationAmount  string `json:"selfDelegationAmount"`
	DelegationAmount      string `json:"delegationAmount"`
	Exists                bool   `json:"exists"`
}

type ValidatorStatusRequest added in v0.14.3

type ValidatorStatusRequest struct {
	Address keys.Address `json:"address"`
}

type VoteProposalReply added in v0.14.3

type VoteProposalReply struct {
	RawTx     []byte           `json:"rawTx"`
	Signature action.Signature `json:"signature"`
}

type VoteProposalRequest added in v0.14.3

type VoteProposalRequest struct {
	ProposalId string                 `json:"proposalId"`
	Opinion    governance.VoteOpinion `json:"opinion"`
	Address    keys.Address           `json:"address"`
	GasPrice   action.Amount          `json:"gasPrice"`
	Gas        int64                  `json:"gas"`
}

type VoteReply added in v0.16.1

type VoteReply struct {
	RawTx []byte `json:"rawTx"`
}

type VoteRequest added in v0.16.1

type VoteRequest struct {
	Address   keys.Address `json:"address"`
	RequestID string       `json:"requestID"`
	Choice    int8         `json:"choice"`
}

type VoteRequestReply added in v0.16.1

type VoteRequestReply struct {
	Requests []evidence.AllegationRequest
}

type VoteRequestRequest added in v0.16.1

type VoteRequestRequest struct {
	Address keys.Address `json:"address"`
}

type WSEvents added in v0.18.15

type WSEvents struct {
	service.BaseService
	// contains filtered or unexported fields
}

func (*WSEvents) OnStart added in v0.18.15

func (w *WSEvents) OnStart() (err error)

OnStart implements service.Service by starting WSClient and event loop.

func (*WSEvents) OnStop added in v0.18.15

func (w *WSEvents) OnStop()

OnStop implements service.Service by stopping WSClient.

func (*WSEvents) Subscribe added in v0.18.15

func (w *WSEvents) Subscribe(ctx context.Context, subscriber, query string,
	outCapacity ...int) (out <-chan ctypes.ResultEvent, err error)

Subscribe implements EventsClient by using WSClient to subscribe given subscriber to query. By default, returns a channel with cap=1. Error is returned if it fails to subscribe. Channel is never closed to prevent clients from seeing an erroneus event.

func (*WSEvents) Unsubscribe added in v0.18.15

func (w *WSEvents) Unsubscribe(ctx context.Context, subscriber, query string) error

Unsubscribe implements EventsClient by using WSClient to unsubscribe given subscriber from query.

func (*WSEvents) UnsubscribeAll added in v0.18.15

func (w *WSEvents) UnsubscribeAll(ctx context.Context, subscriber string) error

UnsubscribeAll implements EventsClient by using WSClient to unsubscribe given subscriber from all the queries.

type WithdrawDelegRewardsRequest added in v0.16.1

type WithdrawDelegRewardsRequest struct {
	Delegator keys.Address  `json:"delegator"`
	Amount    action.Amount `json:"amount"`
}

type WithdrawFundsRequest added in v0.14.3

type WithdrawFundsRequest struct {
	ProposalID    governance.ProposalID `json:"proposalId"`
	Funder        keys.Address          `json:"funderAddress"`
	WithdrawValue action.Amount         `json:"withdrawValue"`
	Beneficiary   keys.Address          `json:"beneficiaryAddress"`
	GasPrice      action.Amount         `json:"gasPrice"`
	Gas           int64                 `json:"gas"`
}

type WithdrawReply added in v0.14.3

type WithdrawReply struct {
	RawTx []byte `json:"rawTx"`
}

type WithdrawRequest added in v0.14.3

type WithdrawRequest struct {
	Address keys.Address   `json:"address"`
	Amount  balance.Amount `json:"amount"`
}

type WithdrawRewardsReply added in v0.14.3

type WithdrawRewardsReply struct {
	RawTx []byte `json:"rawTx"`
}

type WithdrawRewardsRequest added in v0.14.3

type WithdrawRewardsRequest struct {
	ValidatorAddress keys.Address   `json:"validatorSigningAddress"`
	WithdrawAmount   balance.Amount `json:"withdrawAmount"`
}

Jump to

Keyboard shortcuts

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