Versions in this module Expand all Collapse all v0 v0.0.5 Jul 1, 2023 v0.0.4 Jul 1, 2023 v0.0.2 Jul 1, 2023 v0.0.1 Jul 1, 2023 v0.0.0 Jul 1, 2023 Changes in this version + const AccountStoreName + const AtomicSwapStoreName + const EmptyRequest + const ParamABCIPrefix + const TimeLockMsgRoute + const TimeLockrcNotFoundErrorCode + var DefaultTimeout = 5 * time.Second + var DepthLevelExceedRangeError = fmt.Errorf("the level is out of range [%d, %d]", 0, maxDepthLevel) + var ExceedABCIDataLengthError = fmt.Errorf("the abci data exceed max length %d ", maxABCIDataLength) + var ExceedABCIPathLengthError = fmt.Errorf("the abci path exceed max length %d ", maxABCIPathLength) + var ExceedABCIQueryStrLengthError = fmt.Errorf("the query string exceed max length %d ", maxABCIPathLength) + var ExceedMaxUnConfirmedTxsNumError = fmt.Errorf("the limit of unConfirmed tx exceed max limit %d ", maxUnConfirmedTxs) + var ExceedTxLengthError = fmt.Errorf("the tx data exceed max length %d ", maxTxLength) + var ExceedTxSearchQueryStrLengthError = fmt.Errorf("the query string exceed max length %d ", maxTxSearchStrLength) + var HashLengthError = fmt.Errorf("the length of hash is not 32") + var HeightNegativeError = fmt.Errorf("the height can't be negative") + var KeyMissingError = fmt.Errorf("BaseAssetSymbol or QuoteAssetSymbol is missing. ") + var LimitNegativeError = fmt.Errorf("the limit can't be negative") + var MaxMinHeightConflictError = fmt.Errorf("the min height can't be larger than max height") + var OffsetNegativeError = fmt.Errorf("offset can't be less than 0") + var PairFormatError = fmt.Errorf("the pair should in format 'symbol1_symbol2'") + var SymbolLengthExceedRangeError = fmt.Errorf("length of symbol should be in range [%d,%d]", tokenSymbolMinLen, ...) + func ParseTx(cdc *amino.Codec, txBytes []byte) (tx.Tx, error) + func ValidateABCIData(data libbytes.HexBytes) error + func ValidateABCIPath(path string) error + func ValidateABCIQueryStr(query string) error + func ValidateDepthLevel(level int) error + func ValidateHash(hash []byte) error + func ValidateHeight(height *int64) error + func ValidateHeightRange(from int64, to int64) error + func ValidateLimit(limit int) error + func ValidateOffset(offset int) error + func ValidatePair(pair string) error + func ValidateSymbol(symbol string) error + func ValidateTx(tx types.Tx) error + func ValidateTxSearchQueryStr(query string) error + func ValidateUnConfirmedTxsLimit(limit int) error + type ABCIClient interface + ABCIInfo func() (*ctypes.ResultABCIInfo, error) + ABCIQuery func(path string, data libbytes.HexBytes) (*ctypes.ResultABCIQuery, error) + ABCIQueryWithOptions func(path string, data libbytes.HexBytes, opts client.ABCIQueryOptions) (*ctypes.ResultABCIQuery, error) + BroadcastTxAsync func(tx types.Tx) (*ctypes.ResultBroadcastTx, error) + BroadcastTxCommit func(tx types.Tx) (*ResultBroadcastTxCommit, error) + BroadcastTxSync func(tx types.Tx) (*ctypes.ResultBroadcastTx, error) + type ABCIResponses struct + BeginBlock *ResponseBeginBlock + DeliverTx []*ResponseDeliverTx + EndBlock *ResponseEndBlock + type Client interface + type DexClient interface + CancelOrder func(baseAssetSymbol, quoteAssetSymbol, refId string, syncType SyncType, ...) (*core_types.ResultBroadcastTx, error) + ClaimHTLT func(swapID []byte, randomNumber []byte, syncType SyncType, options ...tx.Option) (*core_types.ResultBroadcastTx, error) + CreateOrder func(baseAssetSymbol, quoteAssetSymbol string, op int8, price, quantity int64, ...) (*core_types.ResultBroadcastTx, error) + DepositHTLT func(recipient types.AccAddress, swapID []byte, amount types.Coins, ...) (*core_types.ResultBroadcastTx, error) + GetAccount func(addr types.AccAddress) (acc types.Account, err error) + GetBalance func(addr types.AccAddress, symbol string) (*types.TokenBalance, error) + GetBalances func(addr types.AccAddress) ([]types.TokenBalance, error) + GetCommitAccount func(addr types.AccAddress) (acc types.Account, err error) + GetDepth func(tradePair string, level int) (*types.OrderBook, error) + GetFee func() ([]types.FeeParam, error) + GetOpenOrders func(addr types.AccAddress, pair string) ([]types.OpenOrder, error) + GetProposal func(proposalId int64) (types.Proposal, error) + GetProposals func(status types.ProposalStatus, numLatest int64) ([]types.Proposal, error) + GetSwapByCreator func(creatorAddr string, offset int64, limit int64) ([]types.SwapBytes, error) + GetSwapByID func(swapID types.SwapBytes) (types.AtomicSwap, error) + GetSwapByRecipient func(recipientAddr string, offset int64, limit int64) ([]types.SwapBytes, error) + GetTimelock func(addr types.AccAddress, recordID int64) (*types.TimeLockRecord, error) + GetTimelocks func(addr types.AccAddress) ([]types.TimeLockRecord, error) + GetTokenInfo func(symbol string) (*types.Token, error) + GetTradingPairs func(offset int, limit int) ([]types.TradingPair, error) + HTLT func(recipient types.AccAddress, recipientOtherChain, senderOtherChain string, ...) (*core_types.ResultBroadcastTx, error) + ListAllTokens func(offset int, limit int) ([]types.Token, error) + RefundHTLT func(swapID []byte, syncType SyncType, options ...tx.Option) (*core_types.ResultBroadcastTx, error) + SendToken func(transfers []msg.Transfer, syncType SyncType, options ...tx.Option) (*core_types.ResultBroadcastTx, error) + SetKeyManager func(k keys.KeyManager) + TxInfoSearch func(query string, prove bool, page, perPage int) ([]Info, error) + type EventsClient interface + Subscribe func(query string, outCapacity ...int) (out chan ctypes.ResultEvent, err error) + Unsubscribe func(query string) error + UnsubscribeAll func() error + type HTTP struct + func NewHTTP(remote, wsEndpoint string) *HTTP + func NewRPCClient(nodeURI string, network ntypes.ChainNetwork) *HTTP + func (c *HTTP) ABCIInfo() (*ctypes.ResultABCIInfo, error) + func (c *HTTP) ABCIQuery(path string, data libbytes.HexBytes) (*ctypes.ResultABCIQuery, error) + func (c *HTTP) ABCIQueryWithOptions(path string, data libbytes.HexBytes, opts client.ABCIQueryOptions) (*ctypes.ResultABCIQuery, error) + func (c *HTTP) Block(height *int64) (*ctypes.ResultBlock, error) + func (c *HTTP) BlockResults(height *int64) (*ResultBlockResults, error) + func (c *HTTP) BlockchainInfo(minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error) + func (c *HTTP) BroadcastTxAsync(tx types.Tx) (*ctypes.ResultBroadcastTx, error) + func (c *HTTP) BroadcastTxCommit(tx types.Tx) (*ResultBroadcastTxCommit, error) + func (c *HTTP) BroadcastTxSync(tx types.Tx) (*ctypes.ResultBroadcastTx, error) + func (c *HTTP) CancelOrder(baseAssetSymbol, quoteAssetSymbol, refId string, syncType SyncType, ...) (*core_types.ResultBroadcastTx, error) + func (c *HTTP) ClaimHTLT(swapID []byte, randomNumber []byte, syncType SyncType, options ...tx.Option) (*core_types.ResultBroadcastTx, error) + func (c *HTTP) Commit(height *int64) (*ctypes.ResultCommit, error) + func (c *HTTP) ConsensusState() (*ctypes.ResultConsensusState, error) + func (c *HTTP) CreateOrder(baseAssetSymbol, quoteAssetSymbol string, op int8, price, quantity int64, ...) (*core_types.ResultBroadcastTx, error) + func (c *HTTP) DepositHTLT(recipient types.AccAddress, swapID []byte, amount types.Coins, ...) (*core_types.ResultBroadcastTx, error) + func (c *HTTP) DumpConsensusState() (*ctypes.ResultDumpConsensusState, error) + func (c *HTTP) Genesis() (*ctypes.ResultGenesis, error) + func (c *HTTP) GetAccount(addr types.AccAddress) (acc types.Account, err error) + func (c *HTTP) GetBalance(addr types.AccAddress, symbol string) (*types.TokenBalance, error) + func (c *HTTP) GetBalances(addr types.AccAddress) ([]types.TokenBalance, error) + func (c *HTTP) GetCommitAccount(addr types.AccAddress) (acc types.Account, err error) + func (c *HTTP) GetDelegatorUnbondingDelegations(delegatorAddr types.AccAddress) ([]types.UnbondingDelegation, error) + func (c *HTTP) GetDepth(tradePair string, level int) (*types.OrderBook, error) + func (c *HTTP) GetFee() ([]types.FeeParam, error) + func (c *HTTP) GetOpenOrders(addr types.AccAddress, pair string) ([]types.OpenOrder, error) + func (c *HTTP) GetProposal(proposalId int64) (types.Proposal, error) + func (c *HTTP) GetProposals(status types.ProposalStatus, numLatest int64) ([]types.Proposal, error) + func (c *HTTP) GetStakeValidators() ([]types.Validator, error) + func (c *HTTP) GetSwapByCreator(creatorAddr string, offset int64, limit int64) ([]types.SwapBytes, error) + func (c *HTTP) GetSwapByID(swapID types.SwapBytes) (types.AtomicSwap, error) + func (c *HTTP) GetSwapByRecipient(recipientAddr string, offset int64, limit int64) ([]types.SwapBytes, error) + func (c *HTTP) GetTimelock(addr types.AccAddress, recordID int64) (*types.TimeLockRecord, error) + func (c *HTTP) GetTimelocks(addr types.AccAddress) ([]types.TimeLockRecord, error) + func (c *HTTP) GetTokenInfo(symbol string) (*types.Token, error) + func (c *HTTP) GetTradingPairs(offset int, limit int) ([]types.TradingPair, error) + func (c *HTTP) HTLT(recipient types.AccAddress, recipientOtherChain, senderOtherChain string, ...) (*core_types.ResultBroadcastTx, error) + func (c *HTTP) Health() (*ctypes.ResultHealth, error) + func (c *HTTP) IsActive() bool + func (c *HTTP) ListAllTokens(offset int, limit int) ([]types.Token, error) + func (c *HTTP) NetInfo() (*ctypes.ResultNetInfo, error) + func (c *HTTP) NumUnconfirmedTxs() (*ctypes.ResultUnconfirmedTxs, error) + func (c *HTTP) QueryStore(key libbytes.HexBytes, storeName string) ([]byte, error) + func (c *HTTP) RefundHTLT(swapID []byte, syncType SyncType, options ...tx.Option) (*core_types.ResultBroadcastTx, error) + func (c *HTTP) SendToken(transfers []msg.Transfer, syncType SyncType, options ...tx.Option) (*core_types.ResultBroadcastTx, error) + func (c *HTTP) SetKeyManager(k keys.KeyManager) + func (c *HTTP) Status() (*ctypes.ResultStatus, error) + func (c *HTTP) Tx(hash []byte, prove bool) (*ResultTx, error) + func (c *HTTP) TxInfoSearch(query string, prove bool, page, perPage int) ([]Info, error) + func (c *HTTP) TxSearch(query string, prove bool, page, perPage int) (*ResultTxSearch, error) + func (c *HTTP) UnconfirmedTxs(limit int) (*ctypes.ResultUnconfirmedTxs, error) + func (c *HTTP) Validators(height *int64) (*ctypes.ResultValidators, error) + type Info struct + Hash libbytes.HexBytes + Height int64 + Result ResponseDeliverTx + Tx tx.Tx + func FormatTxResults(cdc *amino.Codec, res []*ResultTx) ([]Info, error) + type OpsClient interface + GetDelegatorUnbondingDelegations func(delegatorAddr types.AccAddress) ([]types.UnbondingDelegation, error) + GetStakeValidators func() ([]types.Validator, error) + IsActive func() bool + type ResponseBeginBlock struct + Events []types.Event + Tags []libkv.KVPair + type ResponseCheckTx struct + Code uint32 + Codespace string + Data []byte + Events []types.Event + GasUsed int64 + GasWanted int64 + Info string + Log string + Tags []libkv.KVPair + func (r ResponseCheckTx) IsErr() bool + type ResponseDeliverTx struct + Code uint32 + Codespace string + Data []byte + Events []types.Event + GasUsed int64 + GasWanted int64 + Info string + Log string + Tags []libkv.KVPair + type ResponseEndBlock struct + ConsensusParamUpdates *types.ConsensusParams + Events []types.Event + Tags []libkv.KVPair + ValidatorUpdates []types.ValidatorUpdate + type ResultBlockResults struct + Height int64 + Results *ABCIResponses + type ResultBroadcastTxCommit struct + CheckTx ResponseCheckTx + DeliverTx ResponseDeliverTx + Hash libbytes.HexBytes + Height int64 + type ResultTx struct + Hash libbytes.HexBytes + Height int64 + Index uint32 + Proof abci.TxProof + Tx abci.Tx + TxResult ResponseDeliverTx + type ResultTxSearch struct + TotalCount int + Txs []*ResultTx + type SignClient interface + Block func(height *int64) (*ctypes.ResultBlock, error) + BlockResults func(height *int64) (*ResultBlockResults, error) + Commit func(height *int64) (*ctypes.ResultCommit, error) + Tx func(hash []byte, prove bool) (*ResultTx, error) + TxSearch func(query string, prove bool, page, perPage int) (*ResultTxSearch, error) + Validators func(height *int64) (*ctypes.ResultValidators, error) + type SyncType int + const Async + const Commit + const Sync + type WSClient struct + Address string + Dialer func(string, string) (net.Conn, error) + Endpoint string + func NewWSClient(remoteAddr, endpoint string, responsesCh chan<- rpctypes.RPCResponse, ...) *WSClient + func (c *WSClient) ABCIInfo(ctx context.Context, id rpctypes.JSONRPCStringID) error + func (c *WSClient) ABCIQueryWithOptions(ctx context.Context, id rpctypes.JSONRPCStringID, path string, ...) error + func (c *WSClient) Block(ctx context.Context, id rpctypes.JSONRPCStringID, height *int64) error + func (c *WSClient) BlockResults(ctx context.Context, id rpctypes.JSONRPCStringID, height *int64) error + func (c *WSClient) BlockchainInfo(ctx context.Context, id rpctypes.JSONRPCStringID, minHeight, maxHeight int64) error + func (c *WSClient) BroadcastTx(ctx context.Context, id rpctypes.JSONRPCStringID, route string, tx types.Tx) error + func (c *WSClient) BroadcastTxCommit(ctx context.Context, id rpctypes.JSONRPCStringID, tx types.Tx) error + func (c *WSClient) Call(ctx context.Context, method string, id rpctypes.JSONRPCStringID, ...) error + func (c *WSClient) Codec() *amino.Codec + func (c *WSClient) Commit(ctx context.Context, id rpctypes.JSONRPCStringID, height *int64) error + func (c *WSClient) ConsensusState(ctx context.Context, id rpctypes.JSONRPCStringID) error + func (c *WSClient) DumpConsensusState(ctx context.Context, id rpctypes.JSONRPCStringID) error + func (c *WSClient) GenRequestId() (rpctypes.JSONRPCStringID, error) + func (c *WSClient) Genesis(ctx context.Context, id rpctypes.JSONRPCStringID) error + func (c *WSClient) Health(ctx context.Context, id rpctypes.JSONRPCStringID) error + func (c *WSClient) IsActive() bool + func (c *WSClient) IsDialing() bool + func (c *WSClient) NetInfo(ctx context.Context, id rpctypes.JSONRPCStringID) error + func (c *WSClient) NumUnconfirmedTxs(ctx context.Context, id rpctypes.JSONRPCStringID) error + func (c *WSClient) OnStart() error + func (c *WSClient) OnStop() + func (c *WSClient) Send(ctx context.Context, request rpctypes.RPCRequest) error + func (c *WSClient) SetCodec(cdc *amino.Codec) + func (c *WSClient) Status(ctx context.Context, id rpctypes.JSONRPCStringID) error + func (c *WSClient) String() string + func (c *WSClient) Subscribe(ctx context.Context, id rpctypes.JSONRPCStringID, query string) error + func (c *WSClient) Tx(ctx context.Context, id rpctypes.JSONRPCStringID, hash []byte, prove bool) error + func (c *WSClient) TxSearch(ctx context.Context, id rpctypes.JSONRPCStringID, query string, prove bool, ...) error + func (c *WSClient) UnconfirmedTxs(ctx context.Context, id rpctypes.JSONRPCStringID, limit int) error + func (c *WSClient) Unsubscribe(ctx context.Context, id rpctypes.JSONRPCStringID, query string) error + func (c *WSClient) UnsubscribeAll(ctx context.Context, id rpctypes.JSONRPCStringID) error + func (c *WSClient) Validators(ctx context.Context, id rpctypes.JSONRPCStringID, height *int64) error + type WSEvents struct + func (c *WSEvents) IsActive() bool + func (w *WSEvents) ABCIInfo() (*ctypes.ResultABCIInfo, error) + func (w *WSEvents) ABCIQueryWithOptions(path string, data libbytes.HexBytes, opts client.ABCIQueryOptions) (*ctypes.ResultABCIQuery, error) + func (w *WSEvents) Block(height *int64) (*ctypes.ResultBlock, error) + func (w *WSEvents) BlockResults(height *int64) (*ResultBlockResults, error) + func (w *WSEvents) BlockchainInfo(minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error) + func (w *WSEvents) BroadcastTx(route string, tx types.Tx) (*ctypes.ResultBroadcastTx, error) + func (w *WSEvents) BroadcastTxCommit(tx types.Tx) (*ResultBroadcastTxCommit, error) + func (w *WSEvents) Commit(height *int64) (*ctypes.ResultCommit, error) + func (w *WSEvents) ConsensusState() (*ctypes.ResultConsensusState, error) + func (w *WSEvents) DumpConsensusState() (*ctypes.ResultDumpConsensusState, error) + func (w *WSEvents) Genesis() (*ctypes.ResultGenesis, error) + func (w *WSEvents) Health() (*ctypes.ResultHealth, error) + func (w *WSEvents) NetInfo() (*ctypes.ResultNetInfo, error) + func (w *WSEvents) NewContext() (context.Context, context.CancelFunc) + func (w *WSEvents) NumUnconfirmedTxs() (*ctypes.ResultUnconfirmedTxs, error) + func (w *WSEvents) OnStart() error + func (w *WSEvents) OnStop() + func (w *WSEvents) PendingRequest() int + func (w *WSEvents) SetLogger(logger log.Logger) + func (w *WSEvents) SetTimeOut(timeout time.Duration) + func (w *WSEvents) SimpleCall(doRpc func(ctx context.Context, id rpctypes.JSONRPCStringID) error, ...) error + func (w *WSEvents) Status() (*ctypes.ResultStatus, error) + func (w *WSEvents) Subscribe(query string, outCapacity ...int) (out chan ctypes.ResultEvent, err error) + func (w *WSEvents) Tx(hash []byte, prove bool) (*ResultTx, error) + func (w *WSEvents) TxInfoSearch(query string, prove bool, page, perPage int) ([]Info, error) + func (w *WSEvents) TxSearch(query string, prove bool, page, perPage int) (*ResultTxSearch, error) + func (w *WSEvents) UnconfirmedTxs(limit int) (*ctypes.ResultUnconfirmedTxs, error) + func (w *WSEvents) Unsubscribe(query string) error + func (w *WSEvents) UnsubscribeAll() error + func (w *WSEvents) Validators(height *int64) (*ctypes.ResultValidators, error) + func (w *WSEvents) WaitForEventResponse(requestId interface{}, in chan rpctypes.RPCResponse, ...) + func (w *WSEvents) WaitForResponse(ctx context.Context, outChan chan rpctypes.RPCResponse, result interface{}, ...) error