restclient

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const ERR_emptyqcp = "empty qcp transaction"

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTP

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

HTTP rpc http 接口调用客户端封装

func (*HTTP) ABCIQuery

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

ABCIQuery abci query 标准接口

func (*HTTP) BroadcastTxSync

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

BroadcastTxSync 同步交易广播调用接口

type HTTPClient

type HTTPClient interface {
	Call(method string, params map[string]interface{}, result interface{}) (interface{}, error)
	Codec() *amino.Codec
	SetCodec(*amino.Codec)
}

HTTPClient is a common interface for JSONRPCClient and URIClient.

type JSONRPCClient

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

JSONRPCClient takes params as a slice

func NewJSONRPCClient

func NewJSONRPCClient(remote string) *JSONRPCClient

NewJSONRPCClient returns a JSONRPCClient pointed at the given address.

func (*JSONRPCClient) Call

func (c *JSONRPCClient) Call(method string, params map[string]interface{}, result interface{}) (interface{}, error)

func (*JSONRPCClient) Codec

func (c *JSONRPCClient) Codec() *amino.Codec

func (*JSONRPCClient) SetCodec

func (c *JSONRPCClient) SetCodec(cdc *amino.Codec)

type RestClient

type RestClient struct {
	// *client.HTTP
	*HTTP
	// contains filtered or unexported fields
}

RestClient rpc 远程访问客户端

func NewRestClient

func NewRestClient(remote string) *RestClient

NewRestClient 创建 rpc 远程访问客户端

func (*RestClient) GetSequence

func (r *RestClient) GetSequence(chainID string, outin string) (int64, error)

GetSequence 查询交易序列号

func (*RestClient) GetTxQcp

func (r *RestClient) GetTxQcp(chainID string, sequence int64) (*txs.TxQcp, error)

GetTxQcp 查询指定交易,查询键值参考

func (*RestClient) PostTxQcp

func (r *RestClient) PostTxQcp(chainID string, qcp *txs.TxQcp) error

PostTxQcp 广播交易

type URIClient

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

URI takes params as a map

func NewURIClient

func NewURIClient(remote string) *URIClient

func (*URIClient) Call

func (c *URIClient) Call(method string, params map[string]interface{}, result interface{}) (interface{}, error)

func (*URIClient) Codec

func (c *URIClient) Codec() *amino.Codec

func (*URIClient) SetCodec

func (c *URIClient) SetCodec(cdc *amino.Codec)

Jump to

Keyboard shortcuts

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