rpc

package
v0.0.0-...-549eef2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2019 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetBalanceReply

type GetBalanceReply struct {
	Unspent int64 `json:"unspent"`
	Frozen  int64 `json:"frozen"`
}

type GetBlockReply

type GetBlockReply struct {
	Difficulty       string  `json:"bits"`
	Hash             string  `json:"hash"`
	MerkleTreeHash   string  `json:"merkle_tree_hash"`
	Nonce            string  `json:"nonce"`
	PrevHash         string  `json:"previous_block_hash"`
	TimeStamp        uint32  `json:"time_stamp"`
	Version          int32   `json:"version"`
	Mixhash          string  `json:"mixhash"`
	Number           int64   `json:"number"`
	TransactionCount int32   `json:"transaction_count"`
	Transactions     []MVSTx `json:"transactions"`
}

type GetBlockReplyPart

type GetBlockReplyPart struct {
	Number     uint64 `json:"number"`
	Difficulty string `json:"bits"`
}

type GetPeerCountReply

type GetPeerCountReply struct {
	Peers []string `json:"peers"`
}

type JSONRpcResp

type JSONRpcResp struct {
	Id     *json.RawMessage       `json:"id"`
	Result *json.RawMessage       `json:"result"`
	Error  map[string]interface{} `json:"error"`
}

type MVSSignRawTxReply

type MVSSignRawTxReply struct {
	Hash  string `json:"hash"`
	RawTx string `json:"rawtx"`
}

type MVSTx

type MVSTx struct {
	Hash     string        `json:"hash"`
	Locktime string        `json:"lock_time"`
	Version  string        `json:"version"`
	Outputs  []MVSTxOutput `json:"outputs"`
}

type MVSTxOutput

type MVSTxOutput struct {
	Address string `json:"address"`
	Value   int64  `json:"value"`
}

type RPCClient

type RPCClient struct {
	sync.RWMutex
	Url      string
	Name     string
	Account  string
	Password string
	// contains filtered or unexported fields
}

func NewRPCClient

func NewRPCClient(name, url, account, password, timeout string) *RPCClient

func (*RPCClient) Check

func (r *RPCClient) Check() bool

func (*RPCClient) GetBalance

func (r *RPCClient) GetBalance(address string) (*big.Int, error)

func (*RPCClient) GetBlockByHash

func (r *RPCClient) GetBlockByHash(hash string) (*GetBlockReply, error)

func (*RPCClient) GetBlockByHeight

func (r *RPCClient) GetBlockByHeight(height int64) (*GetBlockReply, error)

func (*RPCClient) GetHeight

func (r *RPCClient) GetHeight() (int64, error)

func (*RPCClient) GetPeerCount

func (r *RPCClient) GetPeerCount() (int64, error)

func (*RPCClient) GetPendingBlock

func (r *RPCClient) GetPendingBlock() (*GetBlockReplyPart, error)

func (*RPCClient) GetTxReceipt

func (r *RPCClient) GetTxReceipt(hash string) (*TxReceipt, error)

func (*RPCClient) GetUncleByBlockNumberAndIndex

func (r *RPCClient) GetUncleByBlockNumberAndIndex(height int64, index int) (*GetBlockReply, error)

func (*RPCClient) GetWork

func (r *RPCClient) GetWork() ([]string, error)

func (*RPCClient) SendMore

func (r *RPCClient) SendMore(from string, receivers map[string]int64) (string, error)

func (*RPCClient) SendTransaction

func (r *RPCClient) SendTransaction(from, to, value string) (string, error)

func (*RPCClient) SetAddress

func (r *RPCClient) SetAddress(address string) (string, error)

func (*RPCClient) Sick

func (r *RPCClient) Sick() bool

func (*RPCClient) Sign

func (r *RPCClient) Sign(from string, s string) (string, error)

func (*RPCClient) SubmitBlock

func (r *RPCClient) SubmitBlock(params []string) (bool, error)

type TxReceipt

type TxReceipt struct {
	TxHash string `json:"hash"`
	Height int64  `json:"height"`
}

func (*TxReceipt) Confirmed

func (r *TxReceipt) Confirmed() bool

func (*TxReceipt) Successful

func (r *TxReceipt) Successful() bool

Use with previous method

Jump to

Keyboard shortcuts

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