model

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Name        string
	Address     string
	Chain       Chain
	BlockTime   time.Time
	BlockHeight string
	TokensEntry []TokenEntry
}

type Accounts

type Accounts struct {
	Entries []*Account
}

type AuthResponse added in v0.1.10

type AuthResponse struct {
	Account struct {
		Type               string `json:"@type"`
		BaseVestingAccount struct {
			BaseAccount struct {
				Address       string `json:"address,omitempty"`
				PubKey        string `json:"public_key,omitempty"`
				AccountNumber string `json:"account_number,omitempty"`
				Sequence      string `json:"sequence,omitempty"`
			}
			OriginalVesting []struct {
				Denom  string `json:"denom"`
				Amount string `json:"amount"`
			} `json:"original_vesting"`
			DelegatedFree []struct {
				Denom  string `json:"denom"`
				Amount string `json:"amount"`
			} `json:"delegated_free"`
			DelegatedVesting []struct {
				Denom  string `json:"denom"`
				Amount string `json:"amount"`
			} `json:"delegated_vesting"`
			EndTime string `json:"end_time"`
		} `json:"base_vesting_account"`
		StartTime      string `json:"start_time"`
		VestingPeriods []struct {
			Length string `json:"length"`
			Amount []struct {
				Denom  string `json:"denom"`
				Amount string `json:"amount"`
			} `json:"amount"`
		} `json:"vesting_periods"`
	} `json:"account"`
}

type BalancesResponse added in v0.1.10

type BalancesResponse struct {
	Balances []struct {
		Denom  string `json:"denom"`
		Amount string `json:"amount"`
	} `json:"balances"`
	Pagination struct {
		NextKey interface{} `json:"next_key"`
		Total   string      `json:"total"`
	} `json:"pagination"`
}

type BlockResponse added in v0.1.10

type BlockResponse 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      string    `json:"height"`
			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"`
		Evidence struct {
			Evidence []struct {
				DuplicateVoteEvidence struct {
					VoteA struct {
						Type    string `json:"type"`
						Height  string `json:"height"`
						Round   int    `json:"round"`
						BlockID struct {
							Hash          string `json:"hash"`
							PartSetHeader struct {
								Total int    `json:"total"`
								Hash  string `json:"hash"`
							} `json:"part_set_header"`
						} `json:"block_id"`
						Timestamp        time.Time `json:"timestamp"`
						ValidatorAddress string    `json:"validator_address"`
						ValidatorIndex   int       `json:"validator_index"`
						Signature        string    `json:"signature"`
					} `json:"vote_a"`
					VoteB struct {
						Type    string `json:"type"`
						Height  string `json:"height"`
						Round   int    `json:"round"`
						BlockID struct {
							Hash          string `json:"hash"`
							PartSetHeader struct {
								Total int    `json:"total"`
								Hash  string `json:"hash"`
							} `json:"part_set_header"`
						} `json:"block_id"`
						Timestamp        time.Time `json:"timestamp"`
						ValidatorAddress string    `json:"validator_address"`
						ValidatorIndex   int       `json:"validator_index"`
						Signature        string    `json:"signature"`
					} `json:"vote_b"`
					TotalVotingPower string    `json:"total_voting_power"`
					ValidatorPower   string    `json:"validator_power"`
					Timestamp        time.Time `json:"timestamp"`
				} `json:"duplicate_vote_evidence"`
				LightClientAttackEvidence struct {
					ConflictingBlock struct {
						SignedHeader struct {
							Header struct {
								Version struct {
									Block string `json:"block"`
									App   string `json:"app"`
								} `json:"version"`
								ChainID     string    `json:"chain_id"`
								Height      string    `json:"height"`
								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"`
							Commit struct {
								Height  string `json:"height"`
								Round   int    `json:"round"`
								BlockID struct {
									Hash          string `json:"hash"`
									PartSetHeader struct {
										Total int    `json:"total"`
										Hash  string `json:"hash"`
									} `json:"part_set_header"`
								} `json:"block_id"`
								Signatures []struct {
									BlockIDFlag      string    `json:"block_id_flag"`
									ValidatorAddress string    `json:"validator_address"`
									Timestamp        time.Time `json:"timestamp"`
									Signature        string    `json:"signature"`
								} `json:"signatures"`
							} `json:"commit"`
						} `json:"signed_header"`
						ValidatorSet struct {
							Validators []struct {
								Address string `json:"address"`
								PubKey  struct {
									Ed25519   string `json:"ed25519"`
									Secp256K1 string `json:"secp256k1"`
								} `json:"pub_key"`
								VotingPower      string `json:"voting_power"`
								ProposerPriority string `json:"proposer_priority"`
							} `json:"validators"`
							Proposer struct {
								Address string `json:"address"`
								PubKey  struct {
									Ed25519   string `json:"ed25519"`
									Secp256K1 string `json:"secp256k1"`
								} `json:"pub_key"`
								VotingPower      string `json:"voting_power"`
								ProposerPriority string `json:"proposer_priority"`
							} `json:"proposer"`
							TotalVotingPower string `json:"total_voting_power"`
						} `json:"validator_set"`
					} `json:"conflicting_block"`
					CommonHeight        string `json:"common_height"`
					ByzantineValidators []struct {
						Address string `json:"address"`
						PubKey  struct {
							Ed25519   string `json:"ed25519"`
							Secp256K1 string `json:"secp256k1"`
						} `json:"pub_key"`
						VotingPower      string `json:"voting_power"`
						ProposerPriority string `json:"proposer_priority"`
					} `json:"byzantine_validators"`
					TotalVotingPower string    `json:"total_voting_power"`
					Timestamp        time.Time `json:"timestamp"`
				} `json:"light_client_attack_evidence"`
			} `json:"evidence"`
		} `json:"evidence"`
		LastCommit struct {
			Height  string `json:"height"`
			Round   int    `json:"round"`
			BlockID struct {
				Hash          string `json:"hash"`
				PartSetHeader struct {
					Total int    `json:"total"`
					Hash  string `json:"hash"`
				} `json:"part_set_header"`
			} `json:"block_id"`
			Signatures []struct {
				BlockIDFlag      string    `json:"block_id_flag"`
				ValidatorAddress string    `json:"validator_address"`
				Timestamp        time.Time `json:"timestamp"`
				Signature        string    `json:"signature"`
			} `json:"signatures"`
		} `json:"last_commit"`
	} `json:"block"`
}

type Chain

type Chain struct {
	ID       string
	LCD      string
	Denom    string
	Exponent int
}

type Chains

type Chains struct {
	Entries []Chain
}

type CommissionResponse added in v0.1.10

type CommissionResponse struct {
	Commissions struct {
		Commission []struct {
			Denom  string `json:"denom"`
			Amount string `json:"amount"`
		} `json:"commission"`
	} `json:"commission"`
}

type Config added in v0.1.2

type Config struct {
	Accounts   Accounts
	Validators ValidatorList
	Chains     Chains
	Zabbix     ZabbixConfig
}

type Delegations added in v0.1.10

type Delegations struct {
	DelegationResponses []struct {
		Delegation struct {
			DelegatorAddress string `json:"delegator_address"`
			ValidatorAddress string `json:"validator_address"`
			Shares           string `json:"shares"`
		} `json:"delegation"`
		Balance struct {
			Denom  string `json:"denom"`
			Amount string `json:"amount"`
		} `json:"balance"`
	} `json:"delegation_responses"`
	Pagination struct {
		NextKey interface{} `json:"next_key"`
		Total   string      `json:"total"`
	} `json:"pagination"`
}

type DenomMetadataResponse added in v0.1.10

type DenomMetadataResponse struct {
	Metadata struct {
		Description string `json:"description"`
		DenomUnits  []struct {
			Denom    string   `json:"denom"`
			Exponent int      `json:"exponent"`
			Aliases  []string `json:"aliases"`
		} `json:"denom_units"`
		Base    string `json:"base"`
		Display string `json:"display"`
	} `json:"metadata"`
}

type Params added in v0.1.10

type Params struct {
	ParamsResponse struct {
		UnbondingTime     string `json:"unbonding_time"`
		MaxValidators     int    `json:"max_validators"`
		MaxEntries        int    `json:"max_entries"`
		HistoricalEntries int    `json:"historical_entries"`
		BondDenom         string `json:"bond_denom"`
		MinCommissionRate string `json:"min_commission_rate"`
	} `json:"params"`
}

type RewardsResponse added in v0.1.10

type RewardsResponse struct {
	Rewards []struct {
		ValidatorAddress string `json:"validator_address"`
		Reward           []struct {
			Denom  string `json:"denom"`
			Amount string `json:"amount"`
		} `json:"reward"`
	} `json:"rewards"`
	Total []struct {
		Denom  string `json:"denom"`
		Amount string `json:"amount"`
	} `json:"total"`
}

type TokenEntry

type TokenEntry struct {
	DisplayName      string
	Denom            string
	Balance          float64
	Reward           float64
	Delegation       float64
	Unbonding        float64
	Commission       float64
	Vesting          float64
	DelegatedVesting float64
}

type Unbondings added in v0.1.10

type Unbondings struct {
	UnbondingResponses []struct {
		DelegatorAddress string `json:"delegator_address"`
		ValidatorAddress string `json:"validator_address"`
		Entries          []struct {
			CreationHeight string    `json:"creation_height"`
			CompletionTime time.Time `json:"completion_time"`
			InitialBalance string    `json:"initial_balance"`
			Balance        string    `json:"balance"`
		} `json:"entries"`
	} `json:"unbonding_responses"`
	Pagination struct {
		NextKey interface{} `json:"next_key"`
		Total   string      `json:"total"`
	} `json:"pagination"`
}

type Validator added in v0.1.2

type Validator struct {
	Moniker        string
	ValoperAddress string
	Chain          Chain
	BlockTime      time.Time
	BlockHeight    string
	VotingPower    int64
	VotingPercent  float64
	Ranking        int
	NumValidators  string
	NumDelegators  string
	Unbondings     int64
	Commission     float64
}

type ValidatorList added in v0.1.10

type ValidatorList struct {
	Entries []*Validator
}

type ValidatorSet added in v0.1.10

type ValidatorSet struct {
	BlockHeight string `json:"block_height"`
	Validators  []struct {
		Address string `json:"address"`
		PubKey  struct {
			Type string `json:"@type"`
			Key  string `json:"key"`
		} `json:"pub_key"`
		VotingPower      string `json:"voting_power"`
		ProposerPriority string `json:"proposer_priority"`
	} `json:"validators"`
	Pagination struct {
		NextKey interface{} `json:"next_key"`
		Total   string      `json:"total"`
	} `json:"pagination"`
}

type Validators added in v0.1.2

type Validators struct {
	BlockHeight        string `json:"block_height,omitempty"`
	ValidatorsResponse []struct {
		OperatorAddress string `json:"operator_address"`
		ConsensusPubkey struct {
			Type string `json:"@type"`
			Key  string `json:"key"`
		} `json:"consensus_pubkey"`
		Jailed          bool   `json:"jailed"`
		Status          string `json:"status"`
		Tokens          string `json:"tokens"`
		DelegatorShares string `json:"delegator_shares"`
		Description     struct {
			Moniker         string `json:"moniker"`
			Identity        string `json:"identity"`
			Website         string `json:"website"`
			SecurityContact string `json:"security_contact"`
			Details         string `json:"details"`
		} `json:"description"`
		UnbondingHeight string    `json:"unbonding_height"`
		UnbondingTime   time.Time `json:"unbonding_time"`
		Commission      struct {
			CommissionRates struct {
				Rate          string `json:"rate"`
				MaxRate       string `json:"max_rate"`
				MaxChangeRate string `json:"max_change_rate"`
			} `json:"commission_rates"`
			UpdateTime time.Time `json:"update_time"`
		} `json:"commission"`
		MinSelfDelegation string `json:"min_self_delegation"`
	} `json:"validators"`
	Pagination struct {
		NextKey interface{} `json:"next_key"`
		Total   string      `json:"total"`
	} `json:"pagination"`
}

type ZabbixConfig added in v0.1.2

type ZabbixConfig struct {
	Server string
	Port   int
	Host   string
}

Jump to

Keyboard shortcuts

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