qstarscli

package
v0.0.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOption

func NewOption(fs ...SetOption) (*option, error)

NewOption 创建可选参数

func NewTestQstarsServer

func NewTestQstarsServer() *testQstarsServer

Types

type Client

type Client struct {

	//NodeVersion     *nodeVersionService
	//Version         *versionService
	//Accounts        *accountsService
	//KV              *kvService
	TransferService *transferService
	// contains filtered or unexported fields
}

Client 客户端结构

func NewClient

func NewClient(opt *option) *Client

NewClient 创建tendermint Client

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*http.Response, error)

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it. If rate limit is exceeded and reset time is in the future, Do returns *RateLimitError immediately without making a network API call.

The provided ctx must be non-nil. If it is canceled or times out, ctx.Err() will be returned.

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.

type SendResult added in v0.0.4

type SendResult struct {
	Hash   string `json:"hash"`
	Error  string `json:"error"`
	Code   string `json:"code"`
	Result string `json:"result"`
	Heigth string `json:"heigth"`
}

type SetOption

type SetOption func(options *option) error

func SetOptionHost

func SetOptionHost(host string) SetOption

SetOptionHost 设置可选参数host

type TransferBody

type TransferBody struct {
	Address       string `json:"-"`
	Amount        string `json:"amount"`
	PirvateKey    string `json:"privatekey"`
	ChainID       string `json:"chain_id"`
	AccountNumber int64  `json:"-"`
	Sequence      int64  `json:"-"`
	Gas           int64  `json:"-"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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