cosmosapp

package
v1.7.36 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 17 Imported by: 4

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

func ParseTxsResp added in v1.5.1

func ParseTxsResp(rawRespReader io.Reader) (*model.Tx, error)

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 DistributionParams added in v1.7.15

type DistributionParams struct {
	CommunityTax string `json:"community_tax"`
}

type DistributionParamsResp added in v1.7.15

type DistributionParamsResp struct {
	Params DistributionParams `json:"params"`
}

A simplified distribution params response data schema

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) CommunityTax added in v1.7.15

func (client *HTTPClient) CommunityTax() (*big.Float, 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) SetAuthQueryKV added in v1.7.8

func (client *HTTPClient) SetAuthQueryKV(authKV HTTPClientAuthKV)

func (*HTTPClient) TotalBondedBalance

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

func (*HTTPClient) TotalRewards

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

func (*HTTPClient) Tx added in v1.5.1

func (client *HTTPClient) Tx(hash string) (*model.Tx, 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 HTTPClientAuthKV added in v1.7.8

type HTTPClientAuthKV struct {
	Key   string
	Value string
}

type Pagination

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

type Pool added in v1.7.12

type Pool struct {
	NotBondedTokens string `json:"not_bonded_tokens"`
	BondedTokens    string `json:"bonded_tokens"`
}

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 StakingPoolResp added in v1.7.12

type StakingPoolResp struct {
	Pool Pool `json:"pool"`
}

type TallyResp

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

type TxResponse added in v1.5.1

type TxResponse struct {
	Height    string             `json:"height,omitempty"`
	TxHash    string             `json:"txhash,omitempty"`
	Codespace string             `json:"codespace,omitempty"`
	Code      uint32             `json:"code,omitempty"`
	Data      string             `json:"data,omitempty"`
	RawLog    string             `json:"raw_log,omitempty"`
	Logs      []TxResponseLog    `json:"logs"`
	Info      string             `json:"info,omitempty"`
	GasWanted string             `json:"gas_wanted,omitempty"`
	GasUsed   string             `json:"gas_used,omitempty"`
	Tx        TxResponseTx       `json:"tx,omitempty"`
	Timestamp string             `json:"timestamp,omitempty"`
	Events    []model.BlockEvent `json:"events"`
}

type TxResponseLog added in v1.5.1

type TxResponseLog struct {
	MsgIndex uint32             `json:"msg_index,omitempty"`
	Log      string             `json:"log,omitempty"`
	Events   []model.BlockEvent `json:"events"`
}

type TxResponseTx added in v1.5.1

type TxResponseTx struct {
	Type string `json:"@type"`
	model.CosmosTx
}

type TxsResp added in v1.5.1

type TxsResp struct {
	Tx         model.CosmosTx `json:"tx"`
	TxResponse TxResponse     `json:"tx_response"`
}

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