rpc

package
v0.0.0-...-60c3643 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2018 License: GPL-3.0 Imports: 6 Imported by: 2

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"`
}

type GetBlockReply

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

func (*GetBlockReply) Confirmed

func (r *GetBlockReply) Confirmed() bool

type JSONRpcResp

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

type MVSTx

type MVSTx struct {
	Hash     string        `json:"hash"`
	Locktime string        `json:"lock_time"`
	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) (*GetBalanceReply, error)

func (*RPCClient) GetBlockBy

func (r *RPCClient) GetBlockBy(method string, params []interface{}) (*GetBlockReply, 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) GetBlockTxs

func (r *RPCClient) GetBlockTxs(height uint64) (*GetBlockReply, error)

func (*RPCClient) GetHeight

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

func (*RPCClient) GetPeerCount

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

func (*RPCClient) GetPendingBlock

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

func (*RPCClient) GetTransaction

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

func (*RPCClient) GetWork

func (r *RPCClient) GetWork() ([]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) SubmitWork

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

func (*RPCClient) ValidateAddress

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

type ValidateAddress

type ValidateAddress struct {
	IsValid bool `json:"is_valid"`
	TestNet bool `json:"testnet"`
}

func (*ValidateAddress) Valid

func (r *ValidateAddress) Valid() bool

Jump to

Keyboard shortcuts

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