explorer

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2018 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 = "36492a98d3500e3c09b3006762827614"
View Source
const BarristerDateGenerated int64 = 1542012010006000000
View Source
const BarristerVersion string = "0.1.6"

Variables

View Source
var IdlJsonRaw = `` /* 83950-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"`
	Forged     int64          `json:"forged"`
	Size       int64          `json:"size"`
}

type BlockGenerator

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

type Candidate

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

type CandidateMetrics

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

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

type CreateDepositRequest 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"`
	Signature    string `json:"signature"`
	GasLimit     int64  `json:"gasLimit"`
	GasPrice     string `json:"gasPrice"`
}

type CreateDepositResponse

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

type Deposit

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

type Execution

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)
	GetLastTransfersByRange(startBlockHeight int64, offset int64, limit int64, showCoinBase bool) ([]Transfer, error)
	GetTransferByID(transferID string) (Transfer, error)
	GetTransfersByAddress(address string, offset int64, limit int64) ([]Transfer, error)
	GetUnconfirmedTransfersByAddress(address string, offset int64, limit int64) ([]Transfer, error)
	GetTransfersByBlockID(blkID string, offset int64, limit int64) ([]Transfer, error)
	GetLastVotesByRange(startBlockHeight int64, offset int64, limit int64) ([]Vote, error)
	GetVoteByID(voteID string) (Vote, error)
	GetVotesByAddress(address string, offset int64, limit int64) ([]Vote, error)
	GetUnconfirmedVotesByAddress(address string, offset int64, limit int64) ([]Vote, error)
	GetVotesByBlockID(blkID string, offset int64, limit int64) ([]Vote, error)
	GetLastExecutionsByRange(startBlockHeight int64, offset int64, limit int64) ([]Execution, error)
	GetExecutionByID(executionID string) (Execution, error)
	GetExecutionsByAddress(address string, offset int64, limit int64) ([]Execution, error)
	GetUnconfirmedExecutionsByAddress(address string, offset int64, limit int64) ([]Execution, error)
	GetExecutionsByBlockID(blkID string, offset int64, limit int64) ([]Execution, 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)
	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)
}

func NewExplorerProxy

func NewExplorerProxy(c barrister.Client) Explorer

type ExplorerProxy

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

func (ExplorerProxy) CreateDeposit

func (_p ExplorerProxy) CreateDeposit(request CreateDepositRequest) (CreateDepositResponse, 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

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

func (ExplorerProxy) GetBlockchainHeight

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

func (ExplorerProxy) GetCandidateMetrics

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

func (ExplorerProxy) GetCandidateMetricsByHeight

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

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

func (ExplorerProxy) GetCreateDepositsByAddress

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

func (ExplorerProxy) GetDeposits

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

func (ExplorerProxy) GetExecutionByID

func (_p ExplorerProxy) GetExecutionByID(executionID string) (Execution, error)

func (ExplorerProxy) GetExecutionsByAddress

func (_p ExplorerProxy) GetExecutionsByAddress(address string, offset int64, limit int64) ([]Execution, error)

func (ExplorerProxy) GetExecutionsByBlockID

func (_p ExplorerProxy) GetExecutionsByBlockID(blkID string, offset int64, limit int64) ([]Execution, error)

func (ExplorerProxy) GetLastBlocksByRange

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

func (ExplorerProxy) GetLastExecutionsByRange

func (_p ExplorerProxy) GetLastExecutionsByRange(startBlockHeight int64, offset int64, limit int64) ([]Execution, error)

func (ExplorerProxy) GetLastTransfersByRange

func (_p ExplorerProxy) GetLastTransfersByRange(startBlockHeight int64, offset int64, limit int64, showCoinBase bool) ([]Transfer, error)

func (ExplorerProxy) GetLastVotesByRange

func (_p ExplorerProxy) GetLastVotesByRange(startBlockHeight int64, offset int64, limit int64) ([]Vote, error)

func (ExplorerProxy) GetPeers

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

func (ExplorerProxy) GetReceiptByExecutionID

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

func (ExplorerProxy) GetSettleDeposit

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

func (ExplorerProxy) GetSettleDepositsByAddress

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

func (ExplorerProxy) GetTransferByID

func (_p ExplorerProxy) GetTransferByID(transferID string) (Transfer, error)

func (ExplorerProxy) GetTransfersByAddress

func (_p ExplorerProxy) GetTransfersByAddress(address string, offset int64, limit int64) ([]Transfer, error)

func (ExplorerProxy) GetTransfersByBlockID

func (_p ExplorerProxy) GetTransfersByBlockID(blkID string, offset int64, limit int64) ([]Transfer, error)

func (ExplorerProxy) GetUnconfirmedExecutionsByAddress

func (_p ExplorerProxy) GetUnconfirmedExecutionsByAddress(address string, offset int64, limit int64) ([]Execution, error)

func (ExplorerProxy) GetUnconfirmedTransfersByAddress

func (_p ExplorerProxy) GetUnconfirmedTransfersByAddress(address string, offset int64, limit int64) ([]Transfer, error)

func (ExplorerProxy) GetUnconfirmedVotesByAddress

func (_p ExplorerProxy) GetUnconfirmedVotesByAddress(address string, offset int64, limit int64) ([]Vote, error)

func (ExplorerProxy) GetVoteByID

func (_p ExplorerProxy) GetVoteByID(voteID string) (Vote, error)

func (ExplorerProxy) GetVotesByAddress

func (_p ExplorerProxy) GetVotesByAddress(address string, offset int64, limit int64) ([]Vote, error)

func (ExplorerProxy) GetVotesByBlockID

func (_p ExplorerProxy) GetVotesByBlockID(blkID string, offset int64, limit int64) ([]Vote, error)

func (ExplorerProxy) PutSubChainBlock

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

func (ExplorerProxy) ReadExecutionState

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

func (ExplorerProxy) SendAction

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

func (ExplorerProxy) SendSmartContract

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

func (ExplorerProxy) SendTransfer

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

func (ExplorerProxy) SendVote

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

func (ExplorerProxy) SettleDeposit

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

type GetBlkOrActResponse

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

type GetPeersResponse

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

type Log

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

type Node

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

type PutSubChainBlockMerkelRoot

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

type PutSubChainBlockRequest

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

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

type Receipt

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

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

type SendActionResponse

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

type SendExecutionResponse

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

type SendSmartContractResponse

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

type SendTransferRequest

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

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

type SendVoteRequest

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

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

type SettleDeposit

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

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

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