explorer

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Code generated by idl2go from JSON generated by Barrister v0.1.6

Index

Constants

View Source
const BarristerChecksum string = "0f6bf284ad39053040811ee110998a4d"
View Source
const BarristerDateGenerated int64 = 1553297260246000000
View Source
const BarristerVersion string = "0.1.6"

Variables

View Source
var IdlJsonRaw = `` /* 70855-byte string literal not displayed */

Functions

func NewJSONServer

func NewJSONServer(idl *barrister.Idl, forceASCII bool, explorer Explorer) barrister.Server

func NewServer

func NewServer(idl *barrister.Idl, ser barrister.Serializer, explorer Explorer) barrister.Server

Types

type AddressDetails

type AddressDetails struct {
	Address      string `json:"address"`
	TotalBalance string `json:"totalBalance"`
	Nonce        int64  `json:"nonce"`
	PendingNonce int64  `json:"pendingNonce"`
	IsCandidate  bool   `json:"isCandidate"`
}

type Block

type Block struct {
	ID               string         `json:"ID"`
	Height           int64          `json:"height"`
	Timestamp        int64          `json:"timestamp"`
	Transfers        int64          `json:"transfers"`
	Votes            int64          `json:"votes"`
	Executions       int64          `json:"executions"`
	GenerateBy       BlockGenerator `json:"generateBy"`
	Amount           string         `json:"amount"`
	Size             int64          `json:"size"`
	TxRoot           string         `json:"txRoot"`
	DeltaStateDigest string         `json:"deltaStateDigest"`
}

type BlockGenerator

type BlockGenerator struct {
	Name    string `json:"name"`
	Address string `json:"address"`
}

type Candidate added in v0.3.0

type Candidate struct {
	Address    string `json:"address"`
	PubKey     string `json:"pubKey"`
	TotalVote  string `json:"totalVote"`
	IsDelegate bool   `json:"isDelegate"`
	IsProducer bool   `json:"isProducer"`
}

type CandidateMetrics added in v0.3.0

type CandidateMetrics struct {
	Candidates   []Candidate `json:"candidates"`
	LatestEpoch  int64       `json:"latestEpoch"`
	LatestHeight int64       `json:"latestHeight"`
}

type CoinStatistic

type CoinStatistic struct {
	Height     int64  `json:"height"`
	Supply     string `json:"supply"`
	Transfers  int64  `json:"transfers"`
	Votes      int64  `json:"votes"`
	Executions int64  `json:"executions"`
	Aps        int64  `json:"aps"`
}

type ConsensusMetrics

type ConsensusMetrics struct {
	LatestEpoch         int64    `json:"latestEpoch"`
	LatestDelegates     []string `json:"latestDelegates"`
	LatestBlockProducer string   `json:"latestBlockProducer"`
	Candidates          []string `json:"candidates"`
}

type CreateDeposit added in v0.4.0

type CreateDeposit struct {
	Version      int64  `json:"version"`
	ID           string `json:"ID"`
	Nonce        int64  `json:"nonce"`
	Sender       string `json:"sender"`
	Recipient    string `json:"recipient"`
	Amount       string `json:"amount"`
	SenderPubKey string `json:"senderPubKey"`
	Signature    string `json:"signature"`
	GasLimit     int64  `json:"gasLimit"`
	GasPrice     string `json:"gasPrice"`
	Fee          string `json:"fee"`
	Timestamp    int64  `json:"timestamp"`
	BlockID      string `json:"blockID"`
	IsPending    bool   `json:"isPending"`
}

type CreateDepositRequest added in v0.4.0

type CreateDepositRequest struct {
	Version      int64  `json:"version"`
	Nonce        int64  `json:"nonce"`
	ChainID      int64  `json:"chainID"`
	Sender       string `json:"sender"`
	SenderPubKey string `json:"senderPubKey"`
	Recipient    string `json:"recipient"`
	Amount       string `json:"amount"`
	Signature    string `json:"signature"`
	GasLimit     int64  `json:"gasLimit"`
	GasPrice     string `json:"gasPrice"`
}

type CreateDepositResponse added in v0.4.0

type CreateDepositResponse struct {
	Hash string `json:"hash"`
}

type Deposit added in v0.4.0

type Deposit struct {
	Amount    string `json:"amount"`
	Address   string `json:"address"`
	Confirmed bool   `json:"confirmed"`
}

type Execution added in v0.3.0

type Execution struct {
	Version        int64  `json:"version"`
	ID             string `json:"ID"`
	Nonce          int64  `json:"nonce"`
	Executor       string `json:"executor"`
	Contract       string `json:"contract"`
	Amount         string `json:"amount"`
	ExecutorPubKey string `json:"executorPubKey"`
	Signature      string `json:"signature"`
	GasLimit       int64  `json:"gasLimit"`
	GasPrice       string `json:"gasPrice"`
	Timestamp      int64  `json:"timestamp"`
	Data           string `json:"data"`
	BlockID        string `json:"blockID"`
	IsPending      bool   `json:"isPending"`
}

type Explorer

type Explorer interface {
	GetBlockchainHeight() (int64, error)
	GetAddressBalance(address string) (string, error)
	GetAddressDetails(address string) (AddressDetails, error)
	GetCreateDeposit(createDepositID string) (CreateDeposit, error)
	GetCreateDepositsByAddress(address string, offset int64, limit int64) ([]CreateDeposit, error)
	GetSettleDeposit(settleDepositID string) (SettleDeposit, error)
	GetSettleDepositsByAddress(address string, offset int64, limit int64) ([]SettleDeposit, error)
	GetLastBlocksByRange(offset int64, limit int64) ([]Block, error)
	GetBlockByID(blkID string) (Block, error)
	GetCoinStatistic() (CoinStatistic, error)
	GetConsensusMetrics() (ConsensusMetrics, error)
	GetCandidateMetrics() (CandidateMetrics, error)
	GetCandidateMetricsByHeight(h int64) (CandidateMetrics, error)
	SendTransfer(request SendTransferRequest) (SendTransferResponse, error)
	SendVote(request SendVoteRequest) (SendVoteResponse, error)
	SendSmartContract(request Execution) (SendSmartContractResponse, error)
	PutSubChainBlock(request PutSubChainBlockRequest) (PutSubChainBlockResponse, error)
	SendAction(request SendActionRequest) (SendActionResponse, error)
	GetPeers() (GetPeersResponse, error)
	GetReceiptByExecutionID(id string) (Receipt, error)
	GetReceiptByActionID(id string) (Receipt, error)
	ReadExecutionState(request Execution) (string, error)
	GetBlockOrActionByHash(hashStr string) (GetBlkOrActResponse, error)
	CreateDeposit(request CreateDepositRequest) (CreateDepositResponse, error)
	GetDeposits(subChainID int64, offset int64, limit int64) ([]Deposit, error)
	SettleDeposit(request SettleDepositRequest) (SettleDepositResponse, error)
	SuggestGasPrice() (int64, error)
	EstimateGasForTransfer(request SendTransferRequest) (int64, error)
	EstimateGasForVote() (int64, error)
	EstimateGasForSmartContract(request Execution) (int64, error)
	GetStateRootHash(blockHeight int64) (string, error)
}

func NewExplorerProxy

func NewExplorerProxy(c barrister.Client) Explorer

type ExplorerProxy

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

func (ExplorerProxy) CreateDeposit added in v0.4.0

func (_p ExplorerProxy) CreateDeposit(request CreateDepositRequest) (CreateDepositResponse, error)

func (ExplorerProxy) EstimateGasForSmartContract added in v0.4.4

func (_p ExplorerProxy) EstimateGasForSmartContract(request Execution) (int64, error)

func (ExplorerProxy) EstimateGasForTransfer added in v0.4.4

func (_p ExplorerProxy) EstimateGasForTransfer(request SendTransferRequest) (int64, error)

func (ExplorerProxy) EstimateGasForVote added in v0.4.4

func (_p ExplorerProxy) EstimateGasForVote() (int64, error)

func (ExplorerProxy) GetAddressBalance

func (_p ExplorerProxy) GetAddressBalance(address string) (string, error)

func (ExplorerProxy) GetAddressDetails

func (_p ExplorerProxy) GetAddressDetails(address string) (AddressDetails, error)

func (ExplorerProxy) GetBlockByID

func (_p ExplorerProxy) GetBlockByID(blkID string) (Block, error)

func (ExplorerProxy) GetBlockOrActionByHash added in v0.4.0

func (_p ExplorerProxy) GetBlockOrActionByHash(hashStr string) (GetBlkOrActResponse, error)

func (ExplorerProxy) GetBlockchainHeight

func (_p ExplorerProxy) GetBlockchainHeight() (int64, error)

func (ExplorerProxy) GetCandidateMetrics added in v0.3.0

func (_p ExplorerProxy) GetCandidateMetrics() (CandidateMetrics, error)

func (ExplorerProxy) GetCandidateMetricsByHeight added in v0.4.0

func (_p ExplorerProxy) GetCandidateMetricsByHeight(h int64) (CandidateMetrics, error)

func (ExplorerProxy) GetCoinStatistic

func (_p ExplorerProxy) GetCoinStatistic() (CoinStatistic, error)

func (ExplorerProxy) GetConsensusMetrics

func (_p ExplorerProxy) GetConsensusMetrics() (ConsensusMetrics, error)

func (ExplorerProxy) GetCreateDeposit added in v0.4.0

func (_p ExplorerProxy) GetCreateDeposit(createDepositID string) (CreateDeposit, error)

func (ExplorerProxy) GetCreateDepositsByAddress added in v0.4.0

func (_p ExplorerProxy) GetCreateDepositsByAddress(address string, offset int64, limit int64) ([]CreateDeposit, error)

func (ExplorerProxy) GetDeposits added in v0.4.0

func (_p ExplorerProxy) GetDeposits(subChainID int64, offset int64, limit int64) ([]Deposit, error)

func (ExplorerProxy) GetLastBlocksByRange

func (_p ExplorerProxy) GetLastBlocksByRange(offset int64, limit int64) ([]Block, error)

func (ExplorerProxy) GetPeers added in v0.3.0

func (_p ExplorerProxy) GetPeers() (GetPeersResponse, error)

func (ExplorerProxy) GetReceiptByActionID added in v0.4.4

func (_p ExplorerProxy) GetReceiptByActionID(id string) (Receipt, error)

func (ExplorerProxy) GetReceiptByExecutionID added in v0.3.0

func (_p ExplorerProxy) GetReceiptByExecutionID(id string) (Receipt, error)

func (ExplorerProxy) GetSettleDeposit added in v0.4.0

func (_p ExplorerProxy) GetSettleDeposit(settleDepositID string) (SettleDeposit, error)

func (ExplorerProxy) GetSettleDepositsByAddress added in v0.4.0

func (_p ExplorerProxy) GetSettleDepositsByAddress(address string, offset int64, limit int64) ([]SettleDeposit, error)

func (ExplorerProxy) GetStateRootHash added in v0.4.4

func (_p ExplorerProxy) GetStateRootHash(blockHeight int64) (string, error)

func (ExplorerProxy) PutSubChainBlock added in v0.4.0

func (_p ExplorerProxy) PutSubChainBlock(request PutSubChainBlockRequest) (PutSubChainBlockResponse, error)

func (ExplorerProxy) ReadExecutionState added in v0.3.0

func (_p ExplorerProxy) ReadExecutionState(request Execution) (string, error)

func (ExplorerProxy) SendAction added in v0.4.0

func (_p ExplorerProxy) SendAction(request SendActionRequest) (SendActionResponse, error)

func (ExplorerProxy) SendSmartContract added in v0.3.0

func (_p ExplorerProxy) SendSmartContract(request Execution) (SendSmartContractResponse, error)

func (ExplorerProxy) SendTransfer added in v0.3.0

func (_p ExplorerProxy) SendTransfer(request SendTransferRequest) (SendTransferResponse, error)

func (ExplorerProxy) SendVote added in v0.3.0

func (_p ExplorerProxy) SendVote(request SendVoteRequest) (SendVoteResponse, error)

func (ExplorerProxy) SettleDeposit added in v0.4.0

func (_p ExplorerProxy) SettleDeposit(request SettleDepositRequest) (SettleDepositResponse, error)

func (ExplorerProxy) SuggestGasPrice added in v0.4.4

func (_p ExplorerProxy) SuggestGasPrice() (int64, error)

type GetBlkOrActResponse added in v0.4.0

type GetBlkOrActResponse struct {
	Block     *Block          `json:"block,omitempty"`
	Transfer  *Transfer       `json:"transfer,omitempty"`
	Vote      *Vote           `json:"vote,omitempty"`
	Execution *Execution      `json:"execution,omitempty"`
	Address   *AddressDetails `json:"address,omitempty"`
}

type GetPeersResponse added in v0.3.0

type GetPeersResponse struct {
	Self  Node   `json:"Self"`
	Peers []Node `json:"Peers"`
}

type Log added in v0.3.0

type Log struct {
	Address     string   `json:"address"`
	Topics      []string `json:"topics"`
	Data        string   `json:"data"`
	BlockNumber int64    `json:"blockNumber"`
	TxnHash     string   `json:"txnHash"`
	Index       int64    `json:"index"`
}

type Node added in v0.3.0

type Node struct {
	Address string `json:"address"`
}

type PutSubChainBlockMerkelRoot added in v0.4.0

type PutSubChainBlockMerkelRoot struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type PutSubChainBlockRequest added in v0.4.0

type PutSubChainBlockRequest struct {
	Version         int64                        `json:"version"`
	Nonce           int64                        `json:"nonce"`
	SenderAddress   string                       `json:"senderAddress"`
	SubChainAddress string                       `json:"subChainAddress"`
	Height          int64                        `json:"height"`
	Roots           []PutSubChainBlockMerkelRoot `json:"roots"`
	SenderPubKey    string                       `json:"senderPubKey"`
	Signature       string                       `json:"signature"`
	GasLimit        int64                        `json:"gasLimit"`
	GasPrice        string                       `json:"gasPrice"`
}

type PutSubChainBlockResponse added in v0.4.0

type PutSubChainBlockResponse struct {
	Hash string `json:"hash"`
}

type Receipt added in v0.3.0

type Receipt struct {
	ReturnValue     string `json:"returnValue"`
	Status          int64  `json:"status"`
	Hash            string `json:"hash"`
	GasConsumed     int64  `json:"gasConsumed"`
	ContractAddress string `json:"contractAddress"`
	Logs            []Log  `json:"logs"`
}

type SendActionRequest added in v0.4.0

type SendActionRequest struct {
	Payload string `json:"payload"`
}

type SendActionResponse added in v0.4.0

type SendActionResponse struct {
	Payload string `json:"payload"`
}

type SendExecutionResponse added in v0.3.0

type SendExecutionResponse struct {
	Receipt Receipt `json:"receipt"`
}

type SendSmartContractResponse added in v0.3.0

type SendSmartContractResponse struct {
	Hash string `json:"hash"`
}

type SendTransferRequest added in v0.3.0

type SendTransferRequest struct {
	Version      int64  `json:"version"`
	Nonce        int64  `json:"nonce"`
	Sender       string `json:"sender"`
	Recipient    string `json:"recipient"`
	Amount       string `json:"amount"`
	SenderPubKey string `json:"senderPubKey"`
	Signature    string `json:"signature"`
	Payload      string `json:"payload"`
	GasLimit     int64  `json:"gasLimit"`
	GasPrice     string `json:"gasPrice"`
	IsCoinbase   bool   `json:"isCoinbase"`
}

type SendTransferResponse added in v0.3.0

type SendTransferResponse struct {
	Hash string `json:"hash"`
}

type SendVoteRequest added in v0.3.0

type SendVoteRequest struct {
	Version     int64  `json:"version"`
	Nonce       int64  `json:"nonce"`
	Voter       string `json:"voter"`
	Votee       string `json:"votee"`
	VoterPubKey string `json:"voterPubKey"`
	GasLimit    int64  `json:"gasLimit"`
	GasPrice    string `json:"gasPrice"`
	Signature   string `json:"signature"`
}

type SendVoteResponse added in v0.3.0

type SendVoteResponse struct {
	Hash string `json:"hash"`
}

type SettleDeposit added in v0.4.0

type SettleDeposit struct {
	Version      int64  `json:"version"`
	ID           string `json:"ID"`
	Nonce        int64  `json:"nonce"`
	Sender       string `json:"sender"`
	Recipient    string `json:"recipient"`
	Amount       string `json:"amount"`
	Index        int64  `json:"index"`
	SenderPubKey string `json:"senderPubKey"`
	Signature    string `json:"signature"`
	GasLimit     int64  `json:"gasLimit"`
	GasPrice     string `json:"gasPrice"`
	Fee          string `json:"fee"`
	Timestamp    int64  `json:"timestamp"`
	BlockID      string `json:"blockID"`
	IsPending    bool   `json:"isPending"`
}

type SettleDepositRequest added in v0.4.0

type SettleDepositRequest struct {
	Version      int64  `json:"version"`
	Nonce        int64  `json:"nonce"`
	Sender       string `json:"sender"`
	SenderPubKey string `json:"senderPubKey"`
	Recipient    string `json:"recipient"`
	Amount       string `json:"amount"`
	Index        int64  `json:"index"`
	Signature    string `json:"signature"`
	GasLimit     int64  `json:"gasLimit"`
	GasPrice     string `json:"gasPrice"`
}

type SettleDepositResponse added in v0.4.0

type SettleDepositResponse struct {
	Hash string `json:"hash"`
}

type Transfer

type Transfer struct {
	Version      int64  `json:"version"`
	ID           string `json:"ID"`
	Nonce        int64  `json:"nonce"`
	Sender       string `json:"sender"`
	Recipient    string `json:"recipient"`
	Amount       string `json:"amount"`
	SenderPubKey string `json:"senderPubKey"`
	Signature    string `json:"signature"`
	Payload      string `json:"payload"`
	GasLimit     int64  `json:"gasLimit"`
	GasPrice     string `json:"gasPrice"`
	IsCoinbase   bool   `json:"isCoinbase"`
	Fee          string `json:"fee"`
	Timestamp    int64  `json:"timestamp"`
	BlockID      string `json:"blockID"`
	IsPending    bool   `json:"isPending"`
}

type Vote

type Vote struct {
	Version     int64  `json:"version"`
	ID          string `json:"ID"`
	Nonce       int64  `json:"nonce"`
	Timestamp   int64  `json:"timestamp"`
	Voter       string `json:"voter"`
	Votee       string `json:"votee"`
	VoterPubKey string `json:"voterPubKey"`
	GasLimit    int64  `json:"gasLimit"`
	GasPrice    string `json:"gasPrice"`
	Signature   string `json:"signature"`
	BlockID     string `json:"blockID"`
	IsPending   bool   `json:"isPending"`
}

Jump to

Keyboard shortcuts

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