Documentation
¶
Index ¶
- Constants
- Variables
- func Precision(amount decimal.Decimal) decimal.Decimal
- type API
- func (api API) GetBalance(address string) (amount decimal.Decimal, err error)
- func (api API) GetBalances(address string) (result AmountResult, err error)
- func (api API) GetBlock(id uint64) (result Block, err error)
- func (api API) GetCommunityPoolAmount() (amount decimal.Decimal, err error)
- func (api API) GetDelegatorValidatorStake(delegator string, validator string) (amount decimal.Decimal, err error)
- func (api API) GetInflation() (amount decimal.Decimal, err error)
- func (api API) GetProposals() (proposals ProposalsResult, err error)
- func (api API) GetStake(address string) (amount decimal.Decimal, err error)
- func (api API) GetStakeRewards(address string) (amount decimal.Decimal, err error)
- func (api API) GetStakingPool() (sp StakingPool, err error)
- func (api API) GetTotalSupply() (amount decimal.Decimal, err error)
- func (api API) GetTransaction(hash string) (result TxResult, err error)
- func (api API) GetUnbonding(address string) (amount decimal.Decimal, err error)
- func (api API) GetValidators() (items []Validator, err error)
- func (api API) ProposalTallyResult(id uint64) (result ProposalTallyResult, err error)
- type Amount
- type AmountResult
- type Block
- type CommunityPool
- type DelegatorRewards
- type DelegatorValidatorStakeResult
- type Inflation
- type ProposalProposer
- type ProposalTallyResult
- type ProposalVotersResult
- type ProposalsResult
- type StakeResult
- type StakingPool
- type Supply
- type TxResult
- type UnbondingResult
- type Validator
- type Validators
Constants ¶
View Source
const ( DepositPeriodProposalStatus = "PROPOSAL_STATUS_DEPOSIT_PERIOD" VotingPeriodProposalStatus = "PROPOSAL_STATUS_VOTING_PERIOD" PassedProposalStatus = "PROPOSAL_STATUS_PASSED" RejectedProposalStatus = "PROPOSAL_STATUS_REJECTED" FailedProposalStatus = "PROPOSAL_STATUS_FAILED" MainUnit = "uatom" )
Variables ¶
View Source
var PrecisionDiv = decimal.New(1, precision)
Functions ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (API) GetBalance ¶
func (API) GetBalances ¶
func (api API) GetBalances(address string) (result AmountResult, err error)
func (API) GetCommunityPoolAmount ¶
func (API) GetDelegatorValidatorStake ¶
func (API) GetProposals ¶
func (api API) GetProposals() (proposals ProposalsResult, err error)
func (API) GetStakeRewards ¶
func (API) GetStakingPool ¶
func (api API) GetStakingPool() (sp StakingPool, err error)
func (API) GetUnbonding ¶
func (API) GetValidators ¶
func (API) ProposalTallyResult ¶
func (api API) ProposalTallyResult(id uint64) (result ProposalTallyResult, err error)
type AmountResult ¶
type Block ¶
type Block struct {
BlockID struct {
Hash string `json:"hash"`
PartSetHeader struct {
Total int `json:"total"`
Hash string `json:"hash"`
} `json:"part_set_header"`
} `json:"block_id"`
Block struct {
Header struct {
Version struct {
Block string `json:"block"`
App string `json:"app"`
} `json:"version"`
ChainID string `json:"chain_id"`
Height uint64 `json:"height,string"`
Time time.Time `json:"time"`
LastBlockID struct {
Hash string `json:"hash"`
PartSetHeader struct {
Total int `json:"total"`
Hash string `json:"hash"`
} `json:"part_set_header"`
} `json:"last_block_id"`
LastCommitHash string `json:"last_commit_hash"`
DataHash string `json:"data_hash"`
ValidatorsHash string `json:"validators_hash"`
NextValidatorsHash string `json:"next_validators_hash"`
ConsensusHash string `json:"consensus_hash"`
AppHash string `json:"app_hash"`
LastResultsHash string `json:"last_results_hash"`
EvidenceHash string `json:"evidence_hash"`
ProposerAddress string `json:"proposer_address"`
} `json:"header"`
Data struct {
Txs []string `json:"txs"`
} `json:"data"`
} `json:"block"`
}
type CommunityPool ¶
type DelegatorRewards ¶
type DelegatorValidatorStakeResult ¶
type DelegatorValidatorStakeResult struct {
DelegationResponse struct {
Delegation struct {
DelegatorAddress string `json:"delegator_address"`
ValidatorAddress string `json:"validator_address"`
Shares decimal.Decimal `json:"shares"`
} `json:"delegation"`
Balance struct {
Denom string `json:"denom"`
Amount decimal.Decimal `json:"amount"`
} `json:"balance"`
} `json:"delegation_response"`
}
type ProposalProposer ¶
type ProposalTallyResult ¶
type ProposalVotersResult ¶
type ProposalsResult ¶
type ProposalsResult struct {
Proposals []struct {
Content struct {
Type string `json:"@type"`
Title string `json:"title"`
Description string `json:"description"`
} `json:"content"`
ProposalID uint64 `json:"proposal_id,string"`
Status string `json:"status"`
FinalTallyResult struct {
Yes int64 `json:"yes,string"`
Abstain int64 `json:"abstain,string"`
No int64 `json:"no,string"`
NoWithVeto int64 `json:"no_with_veto,string"`
} `json:"final_tally_result"`
SubmitTime time.Time `json:"submit_time"`
DepositEndTime time.Time `json:"deposit_end_time"`
TotalDeposit []struct {
Amount decimal.Decimal `json:"amount"`
} `json:"total_deposit"`
VotingStartTime time.Time `json:"voting_start_time"`
VotingEndTime time.Time `json:"voting_end_time"`
} `json:"proposals"`
}
type StakeResult ¶
type StakingPool ¶
type TxResult ¶
type TxResult struct {
Tx struct {
Type string `json:"@type"`
Body struct {
Messages []json.RawMessage `json:"messages"`
Memo string `json:"memo"`
TimeoutHeight string `json:"timeout_height"`
ExtensionOptions []struct {
TypeURL string `json:"type_url"`
Value string `json:"value"`
} `json:"extension_options"`
NonCriticalExtensionOptions []struct {
TypeURL string `json:"type_url"`
Value string `json:"value"`
} `json:"non_critical_extension_options"`
} `json:"body"`
AuthInfo struct {
SignerInfos []struct {
PublicKey struct {
TypeURL string `json:"type_url"`
Value string `json:"value"`
} `json:"public_key"`
ModeInfo struct {
Single struct {
Mode string `json:"mode"`
} `json:"single"`
Multi struct {
Bitarray struct {
ExtraBitsStored int `json:"extra_bits_stored"`
Elems string `json:"elems"`
} `json:"bitarray"`
ModeInfos []interface{} `json:"mode_infos"`
} `json:"multi"`
} `json:"mode_info"`
Sequence string `json:"sequence"`
} `json:"signer_infos"`
Fee struct {
Amount []struct {
Denom string `json:"denom"`
Amount decimal.Decimal `json:"amount"`
} `json:"amount"`
GasLimit decimal.Decimal `json:"gas_limit"`
Payer string `json:"payer"`
Granter string `json:"granter"`
} `json:"fee"`
} `json:"auth_info"`
Signatures []string `json:"signatures"`
} `json:"tx"`
TxResponse struct {
Height uint64 `json:"height,string"`
Txhash string `json:"txhash"`
Codespace string `json:"codespace"`
Code int `json:"code"`
Data string `json:"data"`
RawLog string `json:"raw_log"`
Logs []struct {
MsgIndex int `json:"msg_index"`
Log string `json:"log"`
Events []struct {
Type string `json:"type"`
Attributes []struct {
Key string `json:"key"`
Value string `json:"value"`
} `json:"attributes"`
} `json:"events"`
} `json:"logs"`
Info string `json:"info"`
GasWanted uint64 `json:"gas_wanted,string"`
GasUsed uint64 `json:"gas_used,string"`
Tx struct {
TypeURL string `json:"type_url"`
Value string `json:"value"`
} `json:"tx"`
Timestamp time.Time `json:"timestamp"`
} `json:"tx_response"`
}
type UnbondingResult ¶
type Validator ¶
type Validator struct {
OperatorAddress string `json:"operator_address"`
ConsensusPubkey struct {
Type string `json:"@type"`
Key string `json:"key"`
} `json:"consensus_pubkey"`
Tokens uint64 `json:"tokens,string"`
Description struct {
Moniker string `json:"moniker"`
Identity string `json:"identity"`
Website string `json:"website"`
Details string `json:"details"`
} `json:"description"`
UnbondingHeight uint64 `json:"unbonding_height,string"`
UnbondingTime time.Time `json:"unbonding_time"`
Commission struct {
CommissionRates struct {
Rate decimal.Decimal `json:"rate"`
MaxRate decimal.Decimal `json:"max_rate"`
MaxChangeRate decimal.Decimal `json:"max_change_rate"`
} `json:"commission_rates"`
} `json:"commission"`
MaxChangeRate decimal.Decimal `json:"max_change_rate"`
}
type Validators ¶
type Validators struct {
Validators []Validator `json:"validators"`
}
Click to show internal directories.
Click to hide internal directories.