Documentation ¶
Index ¶
- Constants
- type AddressResponse
- type AddressResult
- type AddressesResponse
- type AddressesResult
- type Api
- func (a *Api) Address(address string) (*AddressResult, error)
- func (a *Api) AddressAtHeight(address string, height int) (*AddressResult, error)
- func (a *Api) Addresses(addresses []string, height int) ([]*AddressesResult, error)
- func (a *Api) Balance(address string) (map[string]string, error)
- func (a *Api) BalanceAtHeight(address string, height int) (map[string]string, error)
- func (a *Api) Block(height int) (*BlockResult, error)
- func (a *Api) Candidate(pubKey string) (*CandidateResult, error)
- func (a *Api) CandidateAtHeight(pubKey string, height int) (*CandidateResult, error)
- func (a *Api) Candidates(includeStakes bool) ([]*CandidateResult, error)
- func (a *Api) CandidatesAtHeight(height int, includeStakes bool) ([]*CandidateResult, error)
- func (a *Api) CoinInfo(symbol string) (*CoinInfoResult, error)
- func (a *Api) CoinInfoAtHeight(symbol string, height int) (*CoinInfoResult, error)
- func (a *Api) EstimateCoinBuy(coinToSell string, valueToBuy string, coinToBuy string) (*EstimateCoinBuyResult, error)
- func (a *Api) EstimateCoinBuyAtHeight(coinToSell string, valueToBuy string, coinToBuy string, height int) (*EstimateCoinBuyResult, error)
- func (a *Api) EstimateCoinSell(coinToSell string, valueToSell string, coinToBuy string) (*EstimateCoinSellResult, error)
- func (a *Api) EstimateCoinSellAll(coinToSell string, coinToBuy string, valueToSell string, gasPrice int) (*EstimateCoinSellAllResult, error)
- func (a *Api) EstimateCoinSellAllAtHeight(coinToSell string, coinToBuy string, valueToSell string, gasPrice int, ...) (*EstimateCoinSellAllResult, error)
- func (a *Api) EstimateCoinSellAtHeight(coinToSell string, valueToSell string, coinToBuy string, height int) (*EstimateCoinSellResult, error)
- func (a *Api) EstimateTxCommission(transaction transaction.EncodeInterface) (*EstimateTxCommissionResult, error)
- func (a *Api) Events() (*EventsResult, error)
- func (a *Api) EventsAtHeight(height int) (*EventsResult, error)
- func (a *Api) MaxGas() (string, error)
- func (a *Api) MinGasPrice() (string, error)
- func (a *Api) MissedBlocks(pubKey string) (*MissedBlocksResult, error)
- func (a *Api) MissedBlocksAtHeight(pubKey string, height int) (*MissedBlocksResult, error)
- func (a *Api) Nonce(address string) (uint64, error)
- func (a *Api) SendRawTransaction(tx string) (*SendTransactionResult, error)
- func (a *Api) SendTransaction(transaction transaction.SignedTransaction) (*SendTransactionResult, error)
- func (a *Api) Status() (*StatusResult, error)
- func (a *Api) Transaction(hash string) (*TransactionResult, error)
- func (a *Api) Transactions(query string, page int, perPage int) ([]*TransactionResult, error)
- func (a *Api) UnconfirmedTxs(limit int) (*UnconfirmedTxsResult, error)
- func (a *Api) Validators() ([]*ValidatorResult, error)
- func (a *Api) ValidatorsAtHeight(height int) ([]*ValidatorResult, error)
- func (a *Api) ValidatorsPage(height, page, perPage int) ([]*ValidatorResult, error)
- type BlockResponse
- type BlockResult
- type BuyCoinData
- type CandidateResponse
- type CandidateResult
- type CandidatesResponse
- type CoinInfoResponse
- type CoinInfoResult
- type CreateCoinData
- type CreateMultisigData
- type DeclareCandidacyData
- type DelegateData
- type EditCandidateData
- type Error
- type EstimateCoinBuyResponse
- type EstimateCoinBuyResult
- type EstimateCoinSellAllResponse
- type EstimateCoinSellAllResult
- type EstimateCoinSellResponse
- type EstimateCoinSellResult
- type EstimateTxCommissionResponse
- type EstimateTxCommissionResult
- type Event
- type EventsResponse
- type EventsResult
- type MaxGasResponse
- type MinGasPriceResponse
- type MissedBlocksResponse
- type MissedBlocksResult
- type MultisendData
- type MultisendDataItem
- type RedeemCheckData
- type ResponseError
- type RewardEventValue
- type SellAllCoinData
- type SellCoinData
- type SendData
- type SendTransactionResponse
- type SendTransactionResult
- type SetCandidateOffData
- type SetCandidateOnData
- type SlashEventValue
- type StatusResponse
- type StatusResult
- type TransactionResponse
- type TransactionResult
- type TransactionsResponse
- type TxError
- type UnbondData
- type UnbondEventValue
- type UnconfirmedTxsResponse
- type UnconfirmedTxsResult
- type ValidatorResult
- type ValidatorsResponse
Constants ¶
const LatestBlockHeight = 0
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressResponse ¶
type AddressResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id,omitempty"` Result *AddressResult `json:"result,omitempty"` Error *Error `json:"error,omitempty"` }
type AddressResult ¶
type AddressesResponse ¶
type AddressesResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id,omitempty"` Result []*AddressesResult `json:"result,omitempty"` Error *Error `json:"error,omitempty"` }
type AddressesResult ¶
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
func NewApiWithClient ¶
Create MinterAPI instance with custom client
func (*Api) Address ¶
func (a *Api) Address(address string) (*AddressResult, error)
Returns coins list, balance and transaction count (for nonce) of an address.
func (*Api) AddressAtHeight ¶
func (a *Api) AddressAtHeight(address string, height int) (*AddressResult, error)
Returns coins list, balance and transaction count (for nonce) of an address.
func (*Api) Addresses ¶
func (a *Api) Addresses(addresses []string, height int) ([]*AddressesResult, error)
func (*Api) BalanceAtHeight ¶
Returns balance of an address.
func (*Api) Block ¶
func (a *Api) Block(height int) (*BlockResult, error)
Returns block data at given height.
func (*Api) Candidate ¶
func (a *Api) Candidate(pubKey string) (*CandidateResult, error)
Returns candidate’s info by provided public_key. It will respond with 404 code if candidate is not found.
func (*Api) CandidateAtHeight ¶
func (a *Api) CandidateAtHeight(pubKey string, height int) (*CandidateResult, error)
Returns candidate’s info by provided public_key. It will respond with 404 code if candidate is not found.
func (*Api) Candidates ¶
func (a *Api) Candidates(includeStakes bool) ([]*CandidateResult, error)
Returns list of candidates.
func (*Api) CandidatesAtHeight ¶
func (a *Api) CandidatesAtHeight(height int, includeStakes bool) ([]*CandidateResult, error)
Returns list of candidates.
func (*Api) CoinInfo ¶
func (a *Api) CoinInfo(symbol string) (*CoinInfoResult, error)
Returns information about coin. Note: this method does not return information about base coins (MNT and BIP).
func (*Api) CoinInfoAtHeight ¶
func (a *Api) CoinInfoAtHeight(symbol string, height int) (*CoinInfoResult, error)
Returns information about coin. Note: this method does not return information about base coins (MNT and BIP).
func (*Api) EstimateCoinBuy ¶
func (a *Api) EstimateCoinBuy(coinToSell string, valueToBuy string, coinToBuy string) (*EstimateCoinBuyResult, error)
Return estimate of buy coin transaction.
func (*Api) EstimateCoinBuyAtHeight ¶
func (a *Api) EstimateCoinBuyAtHeight(coinToSell string, valueToBuy string, coinToBuy string, height int) (*EstimateCoinBuyResult, error)
Return estimate of buy coin transaction.
func (*Api) EstimateCoinSell ¶
func (a *Api) EstimateCoinSell(coinToSell string, valueToSell string, coinToBuy string) (*EstimateCoinSellResult, error)
Return estimate of sell coin transaction.
func (*Api) EstimateCoinSellAll ¶
func (*Api) EstimateCoinSellAllAtHeight ¶
func (*Api) EstimateCoinSellAtHeight ¶
func (a *Api) EstimateCoinSellAtHeight(coinToSell string, valueToSell string, coinToBuy string, height int) (*EstimateCoinSellResult, error)
Return estimate of sell coin transaction.
func (*Api) EstimateTxCommission ¶
func (a *Api) EstimateTxCommission(transaction transaction.EncodeInterface) (*EstimateTxCommissionResult, error)
Return estimate of transaction.
func (*Api) EventsAtHeight ¶
func (a *Api) EventsAtHeight(height int) (*EventsResult, error)
Returns events at given height.
func (*Api) MinGasPrice ¶
Returns current min gas price.
func (*Api) MissedBlocks ¶
func (a *Api) MissedBlocks(pubKey string) (*MissedBlocksResult, error)
Returns missed blocks by validator public key.
func (*Api) MissedBlocksAtHeight ¶
func (a *Api) MissedBlocksAtHeight(pubKey string, height int) (*MissedBlocksResult, error)
Returns missed blocks by validator public key.
func (*Api) SendRawTransaction ¶
func (a *Api) SendRawTransaction(tx string) (*SendTransactionResult, error)
Returns the result of raw tx.
func (*Api) SendTransaction ¶
func (a *Api) SendTransaction(transaction transaction.SignedTransaction) (*SendTransactionResult, error)
Returns the result of sending signed tx.
func (*Api) Transaction ¶
func (a *Api) Transaction(hash string) (*TransactionResult, error)
Returns transaction info.
func (*Api) Transactions ¶
Return transactions by query.
func (*Api) UnconfirmedTxs ¶
func (a *Api) UnconfirmedTxs(limit int) (*UnconfirmedTxsResult, error)
Returns unconfirmed transactions.
func (*Api) Validators ¶
func (a *Api) Validators() ([]*ValidatorResult, error)
Returns list of active validators.
func (*Api) ValidatorsAtHeight ¶
func (a *Api) ValidatorsAtHeight(height int) ([]*ValidatorResult, error)
Returns list of active validators.
func (*Api) ValidatorsPage ¶
func (a *Api) ValidatorsPage(height, page, perPage int) ([]*ValidatorResult, error)
Returns list of active validators with custom paging.
type BlockResponse ¶
type BlockResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id,omitempty"` Result *BlockResult `json:"result,omitempty"` Error *Error `json:"error,omitempty"` }
type BlockResult ¶
type BlockResult struct { Hash string `json:"hash"` Height string `json:"height"` Time time.Time `json:"time"` NumTxs string `json:"num_txs"` TotalTxs string `json:"total_txs"` Transactions []TransactionResult `json:"transactions"` BlockReward string `json:"block_reward"` Size string `json:"size"` Proposer string `json:"proposer"` Validators []struct { PubKey string `json:"pub_key"` Signed bool `json:"signed"` } `json:"validators"` }
type BuyCoinData ¶
type CandidateResponse ¶
type CandidateResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id,omitempty"` Result *CandidateResult `json:"result,omitempty"` Error *Error `json:"error,omitempty"` }
type CandidateResult ¶
type CandidateResult struct { RewardAddress string `json:"reward_address"` OwnerAddress string `json:"owner_address"` TotalStake string `json:"total_stake"` PubKey string `json:"pub_key"` Commission string `json:"commission"` Stakes []struct { Owner string `json:"owner"` Coin string `json:"coin"` Value string `json:"value"` BipValue string `json:"bip_value"` } `json:"stakes"` Status int `json:"status"` }
type CandidatesResponse ¶
type CandidatesResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id,omitempty"` Result []*CandidateResult `json:"result,omitempty"` Error *Error `json:"error,omitempty"` }
type CoinInfoResponse ¶
type CoinInfoResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id,omitempty"` Result *CoinInfoResult `json:"result,omitempty"` Error *Error `json:"error,omitempty"` }
type CoinInfoResult ¶
type CreateCoinData ¶
type CreateMultisigData ¶
type DeclareCandidacyData ¶
type DelegateData ¶
type EditCandidateData ¶
type Error ¶
type EstimateCoinBuyResponse ¶
type EstimateCoinBuyResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id,omitempty"` Result *EstimateCoinBuyResult `json:"result,omitempty"` Error *Error `json:"error,omitempty"` }
type EstimateCoinBuyResult ¶
type EstimateCoinSellAllResponse ¶
type EstimateCoinSellAllResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id,omitempty"` Result *EstimateCoinSellAllResult `json:"result,omitempty"` Error *Error `json:"error,omitempty"` }
type EstimateCoinSellAllResult ¶
type EstimateCoinSellAllResult struct {
WillGet string `json:"will_get"`
}
type EstimateCoinSellResponse ¶
type EstimateCoinSellResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id,omitempty"` Result *EstimateCoinSellResult `json:"result,omitempty"` Error *Error `json:"error,omitempty"` }
type EstimateCoinSellResult ¶
type EstimateTxCommissionResponse ¶
type EstimateTxCommissionResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id,omitempty"` Result *EstimateTxCommissionResult `json:"result,omitempty"` Error *Error `json:"error,omitempty"` }
type EstimateTxCommissionResult ¶
type EstimateTxCommissionResult struct {
Commission string `json:"commission"`
}
type Event ¶
func (*Event) ValueStruct ¶
Converting event map data to the structure interface regarding event type
type EventsResponse ¶
type EventsResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id,omitempty"` Result *EventsResult `json:"result,omitempty"` Error *Error `json:"error,omitempty"` }
type EventsResult ¶
type EventsResult struct {
Events []Event `json:"events"`
}
type MaxGasResponse ¶
type MinGasPriceResponse ¶
type MissedBlocksResponse ¶
type MissedBlocksResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id,omitempty"` Result *MissedBlocksResult `json:"result,omitempty"` Error *Error `json:"error,omitempty"` }
type MissedBlocksResult ¶
type MultisendData ¶
type MultisendData struct {
List []MultisendDataItem
}
type MultisendDataItem ¶
type MultisendDataItem SendData
type RedeemCheckData ¶
type ResponseError ¶
type ResponseError struct {
*resty.Response
}
func NewResponseError ¶
func NewResponseError(response *resty.Response) *ResponseError
func (*ResponseError) Error ¶
func (res *ResponseError) Error() string
type RewardEventValue ¶
type SellAllCoinData ¶
type SellCoinData ¶
type SendTransactionResponse ¶
type SendTransactionResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id,omitempty"` Result *SendTransactionResult `json:"result,omitempty"` Error *TxError `json:"error,omitempty"` }
type SendTransactionResult ¶
type SetCandidateOffData ¶
type SetCandidateOffData struct {
PubKey string `json:"pub_key"`
}
type SetCandidateOnData ¶
type SetCandidateOnData struct {
PubKey string `json:"pub_key"`
}
type SlashEventValue ¶
type StatusResponse ¶
type StatusResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id,omitempty"` Result *StatusResult `json:"result,omitempty"` Error *Error `json:"error,omitempty"` }
type StatusResult ¶
type StatusResult struct { Version string `json:"version"` LatestBlockHash string `json:"latest_block_hash"` LatestAppHash string `json:"latest_app_hash"` LatestBlockHeight string `json:"latest_block_height"` LatestBlockTime time.Time `json:"latest_block_time"` StateHistory string `json:"state_history"` TmStatus struct { NodeInfo struct { ProtocolVersion struct { P2P string `json:"p2p"` Block string `json:"block"` App string `json:"app"` } `json:"protocol_version"` ID string `json:"id,omitempty"` ListenAddr string `json:"listen_addr"` Network string `json:"network"` Version string `json:"version"` Channels string `json:"channels"` Moniker string `json:"moniker"` Other struct { TxIndex string `json:"tx_index"` RPCAddress string `json:"rpc_address"` } `json:"other"` } `json:"node_info"` SyncInfo struct { LatestBlockHash string `json:"latest_block_hash"` LatestAppHash string `json:"latest_app_hash"` LatestBlockHeight string `json:"latest_block_height"` LatestBlockTime time.Time `json:"latest_block_time"` CatchingUp bool `json:"catching_up"` } `json:"sync_info"` ValidatorInfo struct { Address string `json:"address"` PubKey struct { Type string `json:"type"` Value string `json:"value"` } `json:"pub_key"` VotingPower string `json:"voting_power"` } `json:"validator_info"` } `json:"tm_status"` }
type TransactionResponse ¶
type TransactionResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id,omitempty"` Result *TransactionResult `json:"result,omitempty"` Error *Error `json:"error,omitempty"` }
type TransactionResult ¶
type TransactionResult struct { Hash string `json:"hash"` RawTx string `json:"raw_tx"` Height string `json:"height"` Index int `json:"index,omitempty"` From string `json:"from"` Nonce string `json:"nonce"` Gas string `json:"gas"` GasPrice int `json:"gas_price"` GasCoin string `json:"gas_coin"` Type int `json:"type"` Data transactionData `json:"data"` Payload []byte `json:"payload"` ServiceData []byte `json:"service_data"` Tags struct { TxCoinToBuy string `json:"tx.coin_to_buy,omitempty"` TxCoinToSell string `json:"tx.coin_to_sell,omitempty"` TxReturn string `json:"tx.return,omitempty"` TxType string `json:"tx.type,omitempty"` TxFrom string `json:"tx.from,omitempty"` TxTo string `json:"tx.to,omitempty"` TxCoin string `json:"tx.coin,omitempty"` TxSellAmount string `json:"tx.sell_amount,omitempty"` TxCreatedMultisig string `json:"tx.created_multisig,omitempty"` } `json:"tags,omitempty"` Code uint32 `json:"code,omitempty"` Log string `json:"log,omitempty"` }
func (*TransactionResult) DataStruct ¶
func (t *TransactionResult) DataStruct() (tdi, error)
Converting transaction map data to the structure interface regarding transaction type
func (*TransactionResult) ErrorLog ¶
func (t *TransactionResult) ErrorLog() error
func (*TransactionResult) IsValid ¶
func (t *TransactionResult) IsValid() bool
type TransactionsResponse ¶
type TransactionsResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id,omitempty"` Result []*TransactionResult `json:"result,omitempty"` Error *Error `json:"error,omitempty"` }
type TxError ¶
type UnbondData ¶
type UnbondEventValue ¶
type UnconfirmedTxsResponse ¶
type UnconfirmedTxsResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id,omitempty"` Result *UnconfirmedTxsResult `json:"result,omitempty"` Error *Error `json:"error,omitempty"` }
type UnconfirmedTxsResult ¶
type ValidatorResult ¶
type ValidatorsResponse ¶
type ValidatorsResponse struct { Jsonrpc string `json:"jsonrpc"` ID string `json:"id,omitempty"` Result []*ValidatorResult `json:"result,omitempty"` Error *Error `json:"error,omitempty"` }
Source Files ¶
- address.go
- addresses.go
- api.go
- block.go
- candidate.go
- candidates.go
- coin_info.go
- estimate_coin_buy.go
- estimate_coin_sell.go
- estimate_coin_sell_all.go
- estimate_tx_commission.go
- events.go
- max_gas.go
- min_gas_price.go
- missed_blocks.go
- send_transaction.go
- status.go
- transaction.go
- transactions.go
- unconfirmed_txs.go
- validators.go
Directories ¶
Path | Synopsis |
---|---|
This package is used to call gRPC methods here https://pkg.go.dev/github.com/MinterTeam/node-grpc-gateway@v1.1.1/api_pb?tab=doc.
|
This package is used to call gRPC methods here https://pkg.go.dev/github.com/MinterTeam/node-grpc-gateway@v1.1.1/api_pb?tab=doc. |