node

package
v0.0.0-...-e01acf0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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"
)

Variables

View Source
var PrecisionDiv = decimal.New(1, precision)

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI(cfg config.Config) *API

func (API) GetBalance

func (api API) GetBalance(address string) (amount decimal.Decimal, err error)

func (API) GetCommunityPoolAmount

func (api API) GetCommunityPoolAmount() (amount decimal.Decimal, err error)

func (API) GetDelegatorValidatorStake

func (api API) GetDelegatorValidatorStake(delegator string, validator string) (amount decimal.Decimal, err error)

func (API) GetInflation

func (api API) GetInflation() (amount decimal.Decimal, err error)

func (API) GetProposals

func (api API) GetProposals() (proposals ProposalsResult, err error)

func (API) GetStake

func (api API) GetStake(address string) (amount decimal.Decimal, err error)

func (API) GetStakingPool

func (api API) GetStakingPool() (sp StakingPool, err error)

func (API) GetTotalSupply

func (api API) GetTotalSupply() (amount decimal.Decimal, err error)

func (API) GetUnbonding

func (api API) GetUnbonding(address string) (amount decimal.Decimal, err error)

func (API) GetValidators

func (api API) GetValidators() (items []Validator, err error)

func (API) ProposalTallyResult

func (api API) ProposalTallyResult(id uint64) (result ProposalTallyResult, err error)

type AmountResult

type AmountResult struct {
	Balances []struct {
		Denom  string          `json:"denom"`
		Amount decimal.Decimal `json:"amount"`
	} `json:"balances"`
}

type CommunityPool

type CommunityPool struct {
	Pool []struct {
		Denom  string          `json:"denom"`
		Amount decimal.Decimal `json:"amount"`
	} `json:"pool"`
}

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 Inflation

type Inflation struct {
	Inflation decimal.Decimal `json:"inflation"`
}

type ProposalProposer

type ProposalProposer struct {
	Proposal struct {
		ProposalID uint64 `json:"proposal_id,string"`
		Proposer   string `json:"proposer"`
	} `json:"proposal"`
}

type ProposalTallyResult

type ProposalTallyResult struct {
	Tally struct {
		Yes        int64 `json:"yes,string"`
		Abstain    int64 `json:"abstain,string"`
		No         int64 `json:"no,string"`
		NoWithVeto int64 `json:"no_with_veto,string"`
	} `json:"tally"`
}

type ProposalVotersResult

type ProposalVotersResult struct {
	Result []struct {
		ProposalID uint64 `json:"proposal_id,string"`
		Voter      string `json:"voter"`
		Option     string `json:"option"`
	} `json:"result"`
}

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 StakeResult struct {
	DelegationResponses []struct {
		Delegation struct {
			DelegatorAddress string          `json:"delegator_address"`
			ValidatorAddress string          `json:"validator_address"`
			Shares           decimal.Decimal `json:"shares"`
		} `json:"delegation"`
	} `json:"delegation_responses"`
}

type StakingPool

type StakingPool struct {
	Pool struct {
		NotBondedTokens decimal.Decimal `json:"not_bonded_tokens"`
		BondedTokens    decimal.Decimal `json:"bonded_tokens"`
	} `json:"pool"`
}

type Supply

type Supply struct {
	Amount struct {
		Denom  string          `json:"denom"`
		Amount decimal.Decimal `json:"amount"`
	} `json:"amount"`
}

type UnbondingResult

type UnbondingResult struct {
	UnbondingResponses []struct {
		DelegatorAddress string `json:"delegator_address"`
		ValidatorAddress string `json:"validator_address"`
		Entries          []struct {
			Balance decimal.Decimal `json:"balance"`
		} `json:"entries"`
	} `json:"unbonding_responses"`
}

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"`
	DelegatorShares decimal.Decimal `json:"delegator_shares"`
	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"`
}

Jump to

Keyboard shortcuts

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