cosmosapp

package
v1.3.24 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ERR_CODE_ACCOUNT_NOT_FOUND = 2
View Source
const ERR_CODE_ACCOUNT_NO_DELEGATION = 5

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	// Common fields
	Type string `json:"@type"`

	// Module account
	MaybeName        *string      `json:"name"`
	MaybeBaseAccount *BaseAccount `json:"base_account"`
	MaybePermissions []string     `json:"permissions"`

	// Vesting account common fields
	MaybeBaseVestingAccount *BaseVestingAccount `json:"base_vesting_account"`
	// Continuous vesting account
	MaybeStartTime *string `json:"start_time"`
	// Periodic vesting account
	MaybeVestingPeriods []cosmosapp_interface.VestingPeriod `json:"vesting_periods"`

	// User account
	MaybeAddress       *string                     `json:"address"`
	MaybePubKey        *cosmosapp_interface.PubKey `json:"pub_key"`
	MaybeAccountNumber *string                     `json:"account_number"`
	MaybeSequence      *string                     `json:"sequence"`
}

type AccountResp

type AccountResp struct {
	Account Account
}

type AnnualProvisionsResp

type AnnualProvisionsResp struct {
	AnnualProvisions string `json:"annual_provisions"`
}

type BankBalance

type BankBalance struct {
	Amount string `json:"amount"`
	Denom  string `json:"denom"`
}

type BankBalancesResp

type BankBalancesResp struct {
	BankBalanceResponses []BankBalance `json:"balances"`
	Pagination           Pagination    `json:"pagination"`
}

type BaseAccount

type BaseAccount struct {
	Address       string                      `json:"address"`
	MaybePubKey   *cosmosapp_interface.PubKey `json:"pub_key"`
	AccountNumber string                      `json:"account_number"`
	Sequence      string                      `json:"sequence"`
}

type BaseVestingAccount

type BaseVestingAccount struct {
	BaseAccount      BaseAccount                          `json:"base_account"`
	OriginalVesting  []cosmosapp_interface.VestingBalance `json:"original_vesting"`
	DelegatedFree    []cosmosapp_interface.VestingBalance `json:"delegated_free"`
	DelegatedVesting []cosmosapp_interface.VestingBalance `json:"delegated_vesting"`
	EndTime          string                               `json:"end_time"`
}

type DelegationsResp

type DelegationsResp struct {
	MaybeDelegationResponses []cosmosapp_interface.DelegationResponse `json:"delegation_responses"`
	MaybePagination          *Pagination                              `json:"pagination"`
	// On error
	MaybeCode    *int    `json:"code"`
	MaybeMessage *string `json:"message"`
}

type DelegatorReward

type DelegatorReward struct {
	ValidatorAddress string           `json:"validator_address"`
	Reward           []DelegatorTotal `json:"reward"`
}

type DelegatorRewardResp

type DelegatorRewardResp struct {
	Rewards []DelegatorReward `json:"rewards"`
	Total   []DelegatorTotal  `json:"total"`
}

type DelegatorTotal

type DelegatorTotal struct {
	Denom  string `json:"denom"`
	Amount string `json:"amount"`
}

type HTTPClient

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

func NewHTTPClient

func NewHTTPClient(rpcUrl string, bondingDenom string) *HTTPClient

NewHTTPClient returns a new HTTPClient for tendermint request

func NewInsecureHTTPClient

func NewInsecureHTTPClient(rpcUrl string, bondingDenom string) *HTTPClient

func (*HTTPClient) Account

func (client *HTTPClient) Account(accountAddress string) (*cosmosapp_interface.Account, error)

func (*HTTPClient) AnnualProvisions

func (client *HTTPClient) AnnualProvisions() (coin.DecCoin, error)

func (*HTTPClient) Balances

func (client *HTTPClient) Balances(accountAddress string) (coin.Coins, error)

func (*HTTPClient) BondedBalance

func (client *HTTPClient) BondedBalance(accountAddress string) (coin.Coins, error)

func (*HTTPClient) Commission

func (client *HTTPClient) Commission(validatorAddress string) (coin.DecCoins, error)

func (*HTTPClient) Delegation

func (client *HTTPClient) Delegation(
	delegator string, validator string,
) (*cosmosapp_interface.DelegationResponse, error)

func (*HTTPClient) ProposalById

func (client *HTTPClient) ProposalById(id string) (cosmosapp_interface.Proposal, error)

func (*HTTPClient) ProposalTally

func (client *HTTPClient) ProposalTally(id string) (cosmosapp_interface.Tally, error)

func (*HTTPClient) Proposals

func (client *HTTPClient) Proposals() ([]cosmosapp_interface.Proposal, error)

func (*HTTPClient) RedelegatingBalance

func (client *HTTPClient) RedelegatingBalance(accountAddress string) (coin.Coins, error)

func (*HTTPClient) TotalBondedBalance

func (client *HTTPClient) TotalBondedBalance() (coin.Coin, error)

func (*HTTPClient) TotalRewards

func (client *HTTPClient) TotalRewards(accountAddress string) (coin.DecCoins, error)

func (*HTTPClient) UnbondingBalance

func (client *HTTPClient) UnbondingBalance(accountAddress string) (coin.Coins, error)

func (*HTTPClient) Validator

func (client *HTTPClient) Validator(validatorAddress string) (*cosmosapp_interface.Validator, error)

type Pagination

type Pagination struct {
	MaybeNextKey *string `json:"next_key"`
	Total        string  `json:"total"`
}

type ProposalResp

type ProposalResp struct {
	Proposal cosmosapp_interface.Proposal `json:"proposal"`
}

type ProposalsResp

type ProposalsResp struct {
	MaybeProposalsResponse []cosmosapp_interface.Proposal `json:"proposals"`
	MaybePagination        *Pagination                    `json:"pagination"`
	// On error
	MaybeCode    *int    `json:"code"`
	MaybeMessage *string `json:"message"`
}

type TallyResp

type TallyResp struct {
	Tally cosmosapp_interface.Tally `json:"tally"`
}

type UnbondingEntry

type UnbondingEntry struct {
	CreationHeight string `json:"creation_height"`
	CompletionTime string `json:"completion_time"`
	InitialBalance string `json:"initial_balance"`
	Balance        string `json:"balance"`
}

type UnbondingResp

type UnbondingResp struct {
	UnbondingResponses []UnbondingResponse `json:"unbonding_responses"`
	Pagination         Pagination          `json:"pagination"`
}

type UnbondingResponse

type UnbondingResponse struct {
	DelegatorAddress string           `json:"delegator_address"`
	ValidatorAddress string           `json:"validator_address"`
	Entries          []UnbondingEntry `json:"entries"`
}

type ValidatorCommission

type ValidatorCommission struct {
	Denom  string `json:"denom"`
	Amount string `json:"amount"`
}

type ValidatorCommissionResp

type ValidatorCommissionResp struct {
	Commissions ValidatorCommissions `json:"commission"`
}

type ValidatorCommissions

type ValidatorCommissions struct {
	Commission []ValidatorCommission `json:"commission"`
}

type ValidatorResp

type ValidatorResp struct {
	Validator cosmosapp_interface.Validator `json:"validator"`
}

type ValidatorsResp

type ValidatorsResp struct {
	MaybeValidatorResponse []cosmosapp_interface.Validator `json:"validators"`
	MaybePagination        *Pagination                     `json:"pagination"`
	// On error
	MaybeCode    *int    `json:"code"`
	MaybeMessage *string `json:"message"`
}

Jump to

Keyboard shortcuts

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