rpc

package
v0.0.0-...-a1f348d Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 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 BalanceReply

type BalanceReply struct {
	Confirmed      string `json:"confirmed"`
	Unconfirmed    string `json:"unconfirmed"`
	Collateralized string `json:"collateralized"`
	Unlockable     string `json:"unlockable"`
}

type BcBlockReply

type BcBlockReply struct {
	Hash                       string              `json:"hash"`
	PreviousHash               string              `json:"previousHash"`
	Version                    uint64              `json:"version"`
	SchemaVersion              uint64              `json:"schemaVersion"`
	Height                     uint64              `json:"height"`
	Difficulty                 string              `json:"difficulty"`
	Timestamp                  uint64              `json:"timestamp"`
	MerkleRoot                 string              `json:"merkleRoot"`
	ChainRoot                  string              `json:"chainRoot"`
	Distance                   string              `json:"distance"`
	TotalDistance              string              `json:"totalDistance"`
	Nonce                      string              `json:"nonce"`
	NrgGrant                   float64             `json:"nrgGrant"`
	EmblemWeight               float64             `json:"emblemWeight"`
	EmblemChainFingerprintRoot string              `json:"emblemChainFingerprintRoot"`
	EmblemChainAddress         string              `json:"emblemChainAddress"`
	TxCount                    uint64              `json:"txCount"`
	TxsList                    []BcTransaction     `json:"txsList"`
	TxFeeBase                  uint64              `json:"txFeeBase"`
	TxDistanceSumLimit         uint64              `json:"txDistanceSumLimit"`
	BlockchainHeadersCount     uint64              `json:"blockchainHeadersCount"`
	BlockchainHeaders          BcChildBlockHeaders `json:"blockchainHeaders"`
}

type BcChildBlockHeader

type BcChildBlockHeader struct {
	Blockchain                           string   `json:"blockchain"`
	Hash                                 string   `json:"hash"`
	PreviousHash                         string   `json:"previousHash"`
	Timestamp                            uint64   `json:"timestamp"`
	Height                               uint64   `json:"height"`
	MerkleRoot                           string   `json:"merkleRoot"`
	BlockchainConfirmationsInParentCount uint64   `json:"blockchainConfirmationsInParentCount"`
	MarkedTxsList                        []string `json:"-"` // fill out later!
	MarkedTxCount                        uint64   `json:"markedTxCount"`
}

type BcChildBlockHeaders

type BcChildBlockHeaders struct {
	BtcList                    []BcChildBlockHeader `json:"btcList"`
	EthList                    []BcChildBlockHeader `json:"ethList"`
	LskList                    []BcChildBlockHeader `json:"lskList"`
	NeoList                    []BcChildBlockHeader `json:"neoList"`
	WavList                    []BcChildBlockHeader `json:"wavList"`
	BlockchainFingerprintsRoot string               `json:"blockchainFingerprintsRoot"`
}

type BcRpcError

type BcRpcError struct {
	Details string `json:"details"`
}

type BcTransaction

type BcTransaction struct {
	Version     uint64       `json:"version"`
	Nonce       string       `json:"nonce"`
	Hash        string       `json:"hash"`
	Overline    string       `json:"overline"`
	NinCount    uint64       `json:"ninCount"`
	NoutCount   uint64       `json:"noutCount"`
	InputsList  []BcTxInput  `json:"inputsList"`
	OutputsList []BcTxOutput `json:"outputsList"`
	LockTime    uint64       `json:"lockTime"`
}

type BcTransactionResponse

type BcTransactionResponse struct {
	Status uint64 `json:"status"`
	TxHash string `json:"txHash"`
	Error  string `json:"error"`
}

type BcTxInput

type BcTxInput struct {
	OutPoint     BcTxOutPoint `json:"outPoint"`
	ScriptLength uint64       `json:"scriptLength"`
	InputScript  string       `json:"inputScript"`
}

type BcTxOutPoint

type BcTxOutPoint struct {
	Value string `json:"value"`
	Hash  string `json:"hash"`
	Index int64  `json:"index"`
}

type BcTxOutput

type BcTxOutput struct {
	Value        string `json:"value"`
	Unit         string `json:"unit"`
	ScriptLength uint64 `json:"scriptLength"`
	OutputScript string `json:"outputScript"`
}

type GetBlockReply

type GetBlockReply struct {
	Number       json.Number `json:"height,Number"`
	Hash         string      `json:"hash"`
	Nonce        string      `json:"nonce"`
	Distance     string      `json:"distance"`
	Miner        string      `json:"miner"`
	Difficulty   string      `json:"difficulty"`
	GasLimit     string
	GasUsed      string
	Transactions []Tx `json:"txsList"`
	Uncles       []string
	// https://github.com/ethereum/EIPs/issues/95
	SealFields []string
}

type GetBlockReplyPart

type GetBlockReplyPart struct {
	Number     json.Number `json:"height"`
	Difficulty string      `json:"difficulty"`
	Hash       string      `json:"hash"`
	Distance   string      `json:"distance"`
}

type JSONRpcResp

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

type RPCClient

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

func NewRPCClient

func NewRPCClient(name, url, scookie, 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) (*BcBlockReply, error)

func (*RPCClient) GetBlockByHeight

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

func (*RPCClient) GetLatestBlock

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

func (*RPCClient) GetPeerCount

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

func (*RPCClient) GetTxReceipt

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

func (*RPCClient) GetUncleByBlockNumberAndIndex

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

func (*RPCClient) GetWork

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

func (*RPCClient) SendTransaction

func (r *RPCClient) SendTransaction(from, to, valueInWei, pkey 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 Tx

type Tx struct {
	Gas      string
	GasPrice string
	Hash     string `json:"hash"`
	Nonce    string `json:"nonce"`
}

type TxReceipt

type TxReceipt struct {
	TxHash    string `json:"hash"`
	GasUsed   string `json:"overline"`
	Nonce     string `json:"nonce"`
	BlockHash string
	Status    string `json:"nonce"`
}

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