client

package
v0.0.0-...-8377674 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BTCTools

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

func NewBtcTools

func NewBtcTools(c *conf.Config) *BTCTools

func (*BTCTools) GetBlock

func (self *BTCTools) GetBlock(hash string) (*btcjson.BlockDetails, error)

func (*BTCTools) GetBlockHash

func (self *BTCTools) GetBlockHash(height uint32) (string, error)

func (*BTCTools) GetBlockHeader

func (self *BTCTools) GetBlockHeader(hash string) (*wire.BlockHeader, error)

func (*BTCTools) GetBlockHeaderByHeight

func (self *BTCTools) GetBlockHeaderByHeight(height uint32) (*wire.BlockHeader, error)

func (*BTCTools) GetCurrentHeight

func (self *BTCTools) GetCurrentHeight() (uint32, error)

func (*BTCTools) GetTx

func (self *BTCTools) GetTx(hash string) (*btcjson.TxRawResult, error)

func (*BTCTools) GetTxOut

func (self *BTCTools) GetTxOut(hash string, vout uint32) (*btcjson.GetTxOutResult, error)

func (*BTCTools) PaserRawTx

func (self *BTCTools) PaserRawTx(rawTx []byte) (*wire.MsgTx, string, error)

type BlockHeader

type BlockHeader struct {
	Hash   string `json:"hash"`
	Time   uint32 `json:"time"`
	Height uint32 `json:"height"`
}

type Request

type Request struct {
	Jsonrpc string        `json:"jsonrpc"`
	Method  string        `json:"method"`
	Params  []interface{} `json:"params"`
	Id      int           `json:"id"`
}

type Response

type Response struct {
	Result json.RawMessage   `json:"result"`
	Error  *btcjson.RPCError `json:"error"` //maybe wrong
	Id     int               `json:"id"`
}

type RestClient

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

func NewRestClient

func NewRestClient() *RestClient

func (*RestClient) SendRestRequest

func (self *RestClient) SendRestRequest(data []byte) ([]byte, error)

func (*RestClient) SendRestRequestWithAuth

func (self *RestClient) SendRestRequestWithAuth(data []byte) ([]byte, error)

func (*RestClient) SetAddr

func (self *RestClient) SetAddr(addr string) *RestClient

func (*RestClient) SetAuth

func (self *RestClient) SetAuth(user string, passwd string) *RestClient

func (*RestClient) SetRestClient

func (self *RestClient) SetRestClient(restClient *http.Client) *RestClient

Jump to

Keyboard shortcuts

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