rpc

package
v0.0.0-...-c446ffb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 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:"previous_hash"`
	Version                    uint64              `json:"version"`
	SchemaVersion              uint64              `json:"schema_version"`
	Height                     uint64              `json:"height"`
	Difficulty                 string              `json:"difficulty"`
	Timestamp                  uint64              `json:"timestamp"`
	MerkleRoot                 string              `json:"merkle_root"`
	ChainRoot                  string              `json:"chain_root"`
	Distance                   string              `json:"distance"`
	TotalDistance              string              `json:"total_distance"`
	Nonce                      string              `json:"nonce"`
	NrgGrant                   float64             `json:"nrg_grant"`
	EmblemWeight               float64             `json:"emblem_weight"`
	EmblemChainFingerprintRoot string              `json:"emblem_chain_fingerprint_Root"`
	EmblemChainAddress         string              `json:"emblem_chain_address"`
	TxCount                    uint64              `json:"tx_Count"`
	TxsList                    []BcTransaction     `json:"txs"`
	TxFeeBase                  uint64              `json:"txFeeBase"`
	TxDistanceSumLimit         uint64              `json:"txDistanceSumLimit"`
	BlockchainHeadersCount     uint64              `json:"blockchain_headers_count"`
	BlockchainHeaders          BcChildBlockHeaders `json:"blockchain_headers"`
}

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:"nin_count"`
	NoutCount   uint64       `json:"nout_Count"`
	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:"script_Length"`
	InputScript  string       `json:"input_Script"`
}

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:"script_Length"`
	OutputScript string `json:"output_Script"`
}

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
	Urlgool string
	Name    string
	SCookie string
	// contains filtered or unexported fields
}

func NewRPCClient

func NewRPCClient(name, url, urlgool, 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)

unused if i see correctly

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