Documentation
¶
Index ¶
- Constants
- Variables
- func Addresses(addresses []types.Address, height int) (*[]AddressesResponse, error)
- func CalcTxCommission(gasCoin string, txType string, payload []byte, mtxs int64, height int) (string, error)
- func Candidates(height int, includeStakes bool) (*[]CandidateResponse, error)
- func CustomCoinBipBalance(coinToSell types.CoinSymbol, valueToSell *big.Int, cState *state.CheckState) *big.Int
- func DurationTime(height int64, count int64) time.Duration
- func Genesis() (*core_types.ResultGenesis, error)
- func GetStateForHeight(height int) (*state.CheckState, error)
- func Handler(h http.Handler) http.Handler
- func HeightByTime(query string, height int64) (int64, error)
- func MaxGas(height int) (*uint64, error)
- func MinGasPrice() (uint64, error)
- func NetInfo() (*core_types.ResultNetInfo, error)
- func RegisterCryptoAmino(cdc *amino.Codec)
- func RegisterEvidenceMessages(cdc *amino.Codec)
- func RunAPI(b *minter.Blockchain, tmRPC *rpc.Local, cfg *config.Config, logger log.Logger)
- func SendTransaction(tx []byte) (*core_types.ResultBroadcastTx, error)
- func TotalSlashed(height int) (*big.Int, error)
- func Transactions(query string, page, perPage int) (*[]TransactionResponse, error)
- func UnconfirmedTxs(limit int) (*core_types.ResultUnconfirmedTxs, error)
- func UserStakes(c types.Pubkey, address types.Address, state *state.CheckState) map[types.CoinSymbol]*UserStake
- type AddressBalanceResponse
- type AddressResponse
- type AddressesBalancesResponse
- type AddressesResponse
- type BlockResponse
- type BlockTransactionResponse
- type BlockValidatorResponse
- type CStake
- type CandidateResponse
- type CandidateResponseAlt
- type CoinBalance
- type CoinInfoResponse
- type EstimateCoinBuyResponse
- type EstimateCoinSellAllResponse
- type EstimateCoinSellResponse
- type EventsResponse
- type EventsResponseValidator
- type FindEventsResponse
- type FrozInfo
- type MissBlock
- type MissedBlocksResponse
- type Response
- type ResponseValidators
- type ResultTxSearch
- type Stake
- type StatusResponse
- type TransactionResponse
- type TransactionsResponse
- type TxCommissionResponse
- type UseMaxResponse
- type UserStake
- type ValidatorResponse
Constants ¶
View Source
const ( // CandidateOff = 0x01 // CandidateOn = 0x02 ValidatorOn = 0x03 ValidatorsMaxSlots = 1000 )
Variables ¶
View Source
var Routes = map[string]*rpcserver.RPCFunc{ "status": rpcserver.NewRPCFunc(Status, ""), "candidates": rpcserver.NewRPCFunc(Candidates, "height,include_stakes"), "candidate": rpcserver.NewRPCFunc(Candidate, "pub_key,height"), "validators": rpcserver.NewRPCFunc(Validators, "height,page,perPage"), "address": rpcserver.NewRPCFunc(Address, "address,height"), "addresses": rpcserver.NewRPCFunc(Addresses, "addresses,height"), "send_transaction": rpcserver.NewRPCFunc(SendTransaction, "tx"), "transaction": rpcserver.NewRPCFunc(Transaction, "hash"), "transactions": rpcserver.NewRPCFunc(Transactions, "query,page,perPage"), "block": rpcserver.NewRPCFunc(Block, "height"), "events": rpcserver.NewRPCFunc(Events, "height"), "net_info": rpcserver.NewRPCFunc(NetInfo, ""), "coin_info": rpcserver.NewRPCFunc(CoinInfo, "symbol,height"), "estimate_coin_sell": rpcserver.NewRPCFunc(EstimateCoinSell, "coin_to_sell,coin_to_buy,value_to_sell,height"), "estimate_coin_sell_all": rpcserver.NewRPCFunc(EstimateCoinSellAll, "coin_to_sell,coin_to_buy,value_to_sell,gas_price,height"), "estimate_coin_buy": rpcserver.NewRPCFunc(EstimateCoinBuy, "coin_to_sell,coin_to_buy,value_to_buy,height"), "estimate_tx_commission": rpcserver.NewRPCFunc(EstimateTxCommission, "tx,height"), "unconfirmed_txs": rpcserver.NewRPCFunc(UnconfirmedTxs, "limit"), "max_gas": rpcserver.NewRPCFunc(MaxGas, "height"), "min_gas_price": rpcserver.NewRPCFunc(MinGasPrice, ""), "genesis": rpcserver.NewRPCFunc(Genesis, ""), "missed_blocks": rpcserver.NewRPCFunc(MissedBlocks, "pub_key,height"), "get_stakes": rpcserver.NewRPCFunc(GetStakes, "pub_key,coin,address,height"), "total_slashed": rpcserver.NewRPCFunc(TotalSlashed, "height"), "height_by_time": rpcserver.NewRPCFunc(HeightByTime, "query,height"), "frozzed": rpcserver.NewRPCFunc(FrozzedFunds, "address,coin"), "calc_tx_commission": rpcserver.NewRPCFunc(CalcTxCommission, "gas_coin,tx_type,payload,mtxs,height"), "calc_tx_free_coin": rpcserver.NewRPCFunc(CalcFreeCoinForTx, "gas_coin,gas_coin_amount,tx_type,payload,mtxs,height"), "address_balance": rpcserver.NewRPCFunc(MakeAddressBalance, "address,height"), "txs_from_block": rpcserver.NewRPCFunc(TxsFromBlock, "height"), "candidate_info": rpcserver.NewRPCFunc(CandidateAlt, "pub_key,height"), "candidates_info": rpcserver.NewRPCFunc(CandidatesAlt, "status,height"), "nosign": rpcserver.NewRPCFunc(NoSign, "height"), "find_events": rpcserver.NewRPCFunc(FindEvents, "search,height"), }
Functions ¶
func Addresses ¶ added in v0.14.1
func Addresses(addresses []types.Address, height int) (*[]AddressesResponse, error)
func CalcTxCommission ¶
func Candidates ¶ added in v0.8.0
func Candidates(height int, includeStakes bool) (*[]CandidateResponse, error)
func CustomCoinBipBalance ¶
func CustomCoinBipBalance(coinToSell types.CoinSymbol, valueToSell *big.Int, cState *state.CheckState) *big.Int
func Genesis ¶ added in v0.16.0
func Genesis() (*core_types.ResultGenesis, error)
func GetStateForHeight ¶ added in v0.8.0
func GetStateForHeight(height int) (*state.CheckState, error)
func MinGasPrice ¶ added in v0.10.0
func NetInfo ¶ added in v0.1.2
func NetInfo() (*core_types.ResultNetInfo, error)
func RegisterCryptoAmino ¶ added in v0.8.0
func RegisterCryptoAmino(cdc *amino.Codec)
RegisterAmino registers all crypto related types in the given (amino) codec.
func RegisterEvidenceMessages ¶ added in v0.14.1
func RegisterEvidenceMessages(cdc *amino.Codec)
func SendTransaction ¶
func SendTransaction(tx []byte) (*core_types.ResultBroadcastTx, error)
func Transactions ¶
func Transactions(query string, page, perPage int) (*[]TransactionResponse, error)
func UnconfirmedTxs ¶ added in v0.8.0
func UnconfirmedTxs(limit int) (*core_types.ResultUnconfirmedTxs, error)
func UserStakes ¶
func UserStakes(c types.Pubkey, address types.Address, state *state.CheckState) map[types.CoinSymbol]*UserStake
Types ¶
type AddressBalanceResponse ¶
type AddressBalanceResponse struct {
Freecoins []*CoinBalance `json:"freecoins"`
Delegated []*CoinBalance `json:"delegated"`
Total []*CoinBalance `json:"total"`
TransactionCount uint64 `json:"transaction_count"`
Bipvalue string `json:"bipvalue"`
}
func MakeAddressBalance ¶
func MakeAddressBalance(address types.Address, height int) (*AddressBalanceResponse, error)
type AddressResponse ¶ added in v0.8.0
type AddressesBalancesResponse ¶
type AddressesBalancesResponse struct {
Address types.Address `json:"address"`
Balance *AddressBalanceResponse `json:"balance"`
}
type AddressesResponse ¶ added in v0.14.1
type BlockResponse ¶
type BlockResponse struct {
Hash string `json:"hash"`
Height int64 `json:"height"`
Time time.Time `json:"time"`
NumTxs int64 `json:"num_txs"`
Transactions []BlockTransactionResponse `json:"transactions"`
BlockReward string `json:"block_reward"`
Size int `json:"size"`
Proposer *string `json:"proposer,omitempty"`
Validators []BlockValidatorResponse `json:"validators,omitempty"`
Evidence tmTypes.EvidenceData `json:"evidence,omitempty"`
}
func Block ¶
func Block(height int64) (*BlockResponse, error)
type BlockTransactionResponse ¶
type BlockTransactionResponse struct {
Hash string `json:"hash"`
RawTx string `json:"raw_tx"`
From string `json:"from"`
Nonce uint64 `json:"nonce"`
GasPrice uint32 `json:"gas_price"`
Type uint8 `json:"type"`
Data json.RawMessage `json:"data"`
Payload []byte `json:"payload"`
ServiceData []byte `json:"service_data"`
Gas int64 `json:"gas"`
GasCoin string `json:"gas_coin"`
Tags map[string]string `json:"tags"`
Code uint32 `json:"code,omitempty"`
Log string `json:"log,omitempty"`
}
type BlockValidatorResponse ¶ added in v0.8.0
type CStake ¶
type CStake struct {
Address string `json:"address"`
PubKey string `json:"pub_key"`
Coin string `json:"coin"`
Value string `json:"value"`
BipValue string `json:"bip_value"`
}
func ResponseStakes ¶
func ResponseStakes(state *state.CheckState, c *candidates.Candidate, coin string, address types.Address) []*CStake
type CandidateResponse ¶ added in v0.8.0
type CandidateResponseAlt ¶
type CandidateResponseAlt struct {
PubKey string `json:"pub_key"`
TotalStake string `json:"total_stake"`
Commission uint `json:"commission"`
UsedSlots int `json:"used_slots"`
UniqUsers int `json:"uniq_users"`
MinStake string `json:"minstake"`
Status byte `json:"status"`
}
func CandidateAlt ¶
func CandidateAlt(pubkey types.Pubkey, height int) (*CandidateResponseAlt, error)
func CandidatesAlt ¶
func CandidatesAlt(status int, height int) ([]*CandidateResponseAlt, error)
func ResponseCandidateAlt ¶
func ResponseCandidateAlt(c *candidates.Candidate, state *state.CheckState) *CandidateResponseAlt
type CoinBalance ¶
type CoinInfoResponse ¶
type EstimateCoinBuyResponse ¶ added in v0.1.2
type EstimateCoinBuyResponse struct {
WillPay string `json:"will_pay"`
Commission string `json:"commission"`
}
func EstimateCoinBuy ¶ added in v0.0.6
type EstimateCoinSellAllResponse ¶ added in v0.18.0
type EstimateCoinSellAllResponse struct {
WillGet string `json:"will_get"`
}
func EstimateCoinSellAll ¶ added in v0.18.0
type EstimateCoinSellResponse ¶ added in v0.1.2
type EstimateCoinSellResponse struct {
WillGet string `json:"will_get"`
Commission string `json:"commission"`
}
func EstimateCoinSell ¶ added in v0.0.6
type EventsResponse ¶ added in v0.8.0
func Events ¶ added in v0.8.0
func Events(height uint64) (*EventsResponse, error)
type EventsResponseValidator ¶
type EventsResponseValidator struct {
Pubkey string `json:"pub_key"`
DaoRole string `json:"dao"`
DeveloperRole string `json:"developers"`
ValidatorRole string `json:"validator"`
DelegatorRole string `json:"delegator"`
}
func GroupedEvents ¶
func GroupedEvents(height int64) ([]*EventsResponseValidator, error)
type FindEventsResponse ¶
func FindEvents ¶
func FindEvents(search []string, height uint64) (*FindEventsResponse, error)
type FrozInfo ¶
type MissBlock ¶
type MissedBlocksResponse ¶ added in v1.0.2
type MissedBlocksResponse struct {
MissedBlocks *types.BitArray `json:"missed_blocks"`
MissedBlocksCount int `json:"missed_blocks_count"`
}
func MissedBlocks ¶ added in v1.0.2
func MissedBlocks(pubkey types.Pubkey, height int) (*MissedBlocksResponse, error)
type ResponseValidators ¶ added in v0.8.0
type ResponseValidators []ValidatorResponse
func Validators ¶ added in v0.8.0
func Validators(height uint64, page, perPage int) (*ResponseValidators, error)
type ResultTxSearch ¶
type ResultTxSearch struct {
Txs []*core_types.ResultTx `json:"txs"`
TotalCount int `json:"total_count"`
}
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"`
KeepLastStates int64 `json:"keep_last_states"`
TmStatus *core_types.ResultStatus `json:"tm_status"`
}
func Status ¶
func Status() (*StatusResponse, error)
type TransactionResponse ¶
type TransactionResponse struct {
Hash string `json:"hash"`
RawTx string `json:"raw_tx"`
Height int64 `json:"height"`
Index uint32 `json:"index"`
From string `json:"from"`
Nonce uint64 `json:"nonce"`
Gas int64 `json:"gas"`
GasPrice uint32 `json:"gas_price"`
GasCoin string `json:"gas_coin"`
Type uint8 `json:"type"`
Data json.RawMessage `json:"data"`
Payload []byte `json:"payload"`
Tags map[string]string `json:"tags"`
Code uint32 `json:"code,omitempty"`
Log string `json:"log,omitempty"`
}
func Transaction ¶
func Transaction(hash []byte) (*TransactionResponse, error)
type TransactionsResponse ¶
type TransactionsResponse struct {
Height int64 `json:"height"`
Time time.Time `json:"time"`
Hash string `json:"hash"`
Type uint8 `json:"type"`
From string `json:"from"`
Nonce uint64 `json:"nonce"`
Data json.RawMessage `json:"data"`
Payload []byte `json:"payload"`
ServiceData []byte `json:"service_data"`
Gas int64 `json:"gas"`
GasCoin string `json:"gas_coin"`
Code uint32 `json:"code,omitempty"`
Log string `json:"log,omitempty"`
}
func TxsFromBlock ¶
func TxsFromBlock(height int64) ([]*TransactionsResponse, error)
type TxCommissionResponse ¶ added in v0.8.0
type TxCommissionResponse struct {
Commission string `json:"commission"`
}
func EstimateTxCommission ¶ added in v0.2.0
func EstimateTxCommission(tx []byte, height int) (*TxCommissionResponse, error)
type UseMaxResponse ¶
type UseMaxResponse struct {
GasCoin string `json:"gascoin"`
StartValue string `json:"startvalue"`
TXComissionValue string `json:"txvalue"`
EndValue string `json:"endvalue"`
}
func CalcFreeCoinForTx ¶
type ValidatorResponse ¶ added in v0.8.0
Source Files
¶
- address.go
- addresses.go
- addresses_full_balances.go
- api.go
- block.go
- calc_comission.go
- candidate.go
- candidates.go
- candidates_alt.go
- coin_info.go
- estimate_coin_buy.go
- estimate_coin_sell.go
- estimate_coin_sell_all.go
- estimate_tx_commission.go
- events.go
- find_events.go
- frozzen.go
- genesis.go
- get_stakes.go
- grouped_events.go
- heigt_by_time.go
- maxgas.go
- min_gas_price.go
- missed_blocks.go
- net_info.go
- nosign.go
- send_transaction.go
- slashed.go
- status.go
- transaction.go
- transactions.go
- tx_from_block.go
- unconfirmed_txs.go
- validators.go
Click to show internal directories.
Click to hide internal directories.