api

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2018 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Block

func Block(w http.ResponseWriter, r *http.Request)

func EstimateCoinBuy added in v0.0.6

func EstimateCoinBuy(w http.ResponseWriter, r *http.Request)

func EstimateCoinSell added in v0.0.6

func EstimateCoinSell(w http.ResponseWriter, r *http.Request)

func EstimateTxCommission added in v0.2.0

func EstimateTxCommission(w http.ResponseWriter, r *http.Request)

func GetBalance

func GetBalance(w http.ResponseWriter, r *http.Request)

func GetBalanceWatcher

func GetBalanceWatcher(w http.ResponseWriter, r *http.Request)

func GetBipVolume

func GetBipVolume(w http.ResponseWriter, r *http.Request)

func GetCandidate

func GetCandidate(w http.ResponseWriter, r *http.Request)

func GetCandidates added in v0.2.0

func GetCandidates(w http.ResponseWriter, r *http.Request)

func GetCoinInfo

func GetCoinInfo(w http.ResponseWriter, r *http.Request)

func GetStateForRequest

func GetStateForRequest(r *http.Request) *state.StateDB

func GetTransactionCount

func GetTransactionCount(w http.ResponseWriter, r *http.Request)

func GetValidators

func GetValidators(w http.ResponseWriter, r *http.Request)

func NetInfo added in v0.1.2

func NetInfo(w http.ResponseWriter, r *http.Request)

func RunApi

func RunApi(b *minter.Blockchain, node *node.Node)

func SendTransaction

func SendTransaction(w http.ResponseWriter, r *http.Request)

func SendTransactionAsync

func SendTransactionAsync(w http.ResponseWriter, r *http.Request)

func SendTransactionSync

func SendTransactionSync(w http.ResponseWriter, r *http.Request)

func Status

func Status(w http.ResponseWriter, r *http.Request)

func Transaction

func Transaction(w http.ResponseWriter, r *http.Request)

func Transactions

func Transactions(w http.ResponseWriter, r *http.Request)

Types

type BalanceRequest

type BalanceRequest struct {
	Address types.Address    `json:"address"`
	Coin    types.CoinSymbol `json:"coin"`
}

type BalanceResponse

type BalanceResponse struct {
	Balance map[string]string `json:"balance"`
}

type BipVolumeResult added in v0.1.2

type BipVolumeResult struct {
	Volume string `json:"volume"`
}

type BlockResponse

type BlockResponse struct {
	Hash         common.HexBytes            `json:"hash"`
	Height       int64                      `json:"height"`
	Time         time.Time                  `json:"time"`
	NumTxs       int64                      `json:"num_txs"`
	TotalTxs     int64                      `json:"total_txs"`
	Transactions []BlockTransactionResponse `json:"transactions"`
	Events       json.RawMessage            `json:"events,omitempty"`
	Precommits   json.RawMessage            `json:"precommits"`
	BlockReward  string                     `json:"block_reward"`
	Size         int                        `json:"size"`
}

type BlockTransactionResponse

type BlockTransactionResponse struct {
	Hash        string            `json:"hash"`
	RawTx       string            `json:"raw_tx"`
	From        string            `json:"from"`
	Nonce       uint64            `json:"nonce"`
	GasPrice    *big.Int          `json:"gas_price"`
	Type        byte              `json:"type"`
	Data        transaction.Data  `json:"data"`
	Payload     []byte            `json:"payload"`
	ServiceData []byte            `json:"service_data"`
	Gas         int64             `json:"gas"`
	GasCoin     types.CoinSymbol  `json:"gas_coin"`
	GasUsed     int64             `json:"gas_used"`
	Tags        map[string]string `json:"tags"`
	Code        uint32            `json:"code,omitempty"`
	Log         string            `json:"log,omitempty"`
}

type Candidate

type Candidate struct {
	CandidateAddress types.Address `json:"candidate_address"`
	TotalStake       string        `json:"total_stake"`
	PubKey           string        `json:"pub_key"`
	Commission       uint          `json:"commission"`
	Stakes           []Stake       `json:"stakes"`
	CreatedAtBlock   uint          `json:"created_at_block"`
	Status           byte          `json:"status"`
}

type CoinInfoResponse

type CoinInfoResponse struct {
	Name           string           `json:"name"`
	Symbol         types.CoinSymbol `json:"symbol"`
	Volume         string           `json:"volume"`
	Crr            uint             `json:"crr"`
	ReserveBalance string           `json:"reserve_balance"`
	Creator        types.Address    `json:"creator"`
}

type EstimateCoinBuyResponse added in v0.1.2

type EstimateCoinBuyResponse struct {
	WillPay    string `json:"will_pay"`
	Commission string `json:"commission"`
}

type EstimateCoinSellResponse added in v0.1.2

type EstimateCoinSellResponse struct {
	WillGet    string `json:"will_get"`
	Commission string `json:"commission"`
}

type Response

type Response struct {
	Code   uint32      `json:"code"`
	Result interface{} `json:"result,omitempty"`
	Log    string      `json:"log,omitempty"`
}

type ResultTxSearch

type ResultTxSearch struct {
	Txs        []*core_types.ResultTx `json:"txs"`
	TotalCount int                    `json:"total_count"`
}

type SendTransactionRequest

type SendTransactionRequest struct {
	Transaction string `json:"transaction"`
}

type SendTransactionResponse added in v0.1.2

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

type Stake added in v0.2.0

type Stake struct {
	Owner    types.Address    `json:"owner"`
	Coin     types.CoinSymbol `json:"coin"`
	Value    string           `json:"value"`
	BipValue string           `json:"bip_value"`
}

type StatusResponse

type StatusResponse struct {
	MinterVersion     string                   `json:"version"`
	LatestBlockHash   string                   `json:"latest_block_hash"`
	LatestAppHash     string                   `json:"latest_app_hash"`
	LatestBlockHeight int64                    `json:"latest_block_height"`
	LatestBlockTime   time.Time                `json:"latest_block_time"`
	TmStatus          *core_types.ResultStatus `json:"tm_status"`
}

type TransactionCountResponse

type TransactionCountResponse struct {
	Count uint64 `json:"count"`
}

type TransactionResponse

type TransactionResponse struct {
	Hash     common.HexBytes   `json:"hash"`
	RawTx    string            `json:"raw_tx"`
	Height   int64             `json:"height"`
	Index    uint32            `json:"index"`
	From     string            `json:"from"`
	Nonce    uint64            `json:"nonce"`
	GasPrice *big.Int          `json:"gas_price"`
	GasCoin  types.CoinSymbol  `json:"gas_coin"`
	GasUsed  int64             `json:"gas_used"`
	Type     byte              `json:"type"`
	Data     transaction.Data  `json:"data"`
	Payload  []byte            `json:"payload"`
	Tags     map[string]string `json:"tags"`
	Code     uint32            `json:"code,omitempty"`
	Log      string            `json:"log,omitempty"`
}

type Validator added in v0.2.0

type Validator struct {
	AccumReward string    `json:"accumulated_reward"`
	AbsentTimes uint      `json:"absent_times"`
	Candidate   Candidate `json:"candidate"`
}

Jump to

Keyboard shortcuts

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