Documentation
¶
Index ¶
- Constants
- Variables
- func GetCachedData[T any](ctx context.Context, rdb *redis.Client, key string) (*T, bool)
- func ParsePaginationParams(c *gin.Context) map[string]string
- func SetCachedData[T any](ctx context.Context, rdb *redis.Client, key string, data T) bool
- type BlockchainConfig
- type CacheConfig
- type Config
- type DatabaseConfig
- type DelegationInfo
- type DelegationResponse
- type DelegationsResponse
- type DistributionParamsResponse
- type EstimatedAPRData
- type Interval
- type MintParamsResponse
- type NetworkStatus
- type NetworkStatusData
- type OperationsData
- type Pagination
- type PeriodDelegationInfo
- type PeriodDelegationResponse
- type PeriodDelegationsResponse
- type QueryResponse
- func GetDistributionParams(apiEndpoint string) (*QueryResponse[DistributionParamsResponse], error)
- func GetMintParams(apiEndpoint string) (*QueryResponse[MintParamsResponse], error)
- func GetStakingDelegation(apiEndpoint, validatorAddr, delegatorAddr string) (*QueryResponse[DelegationResponse], error)
- func GetStakingDelegatorDelegations(apiEndpoint, delegatorAddr string, params map[string]string) (*QueryResponse[DelegationsResponse], error)
- func GetStakingDelegatorUnbondingDelegations(apiEndpoint, delegatorAddr string, params map[string]string) (*QueryResponse[UnbondingDelegationsResponse], error)
- func GetStakingParams(apiEndpoint string) (*QueryResponse[StakingParamsResponse], error)
- func GetStakingPool(apiEndpoint string) (*QueryResponse[StakingPoolResponse], error)
- func GetStakingValidator(apiEndpoint, validatorAddr string) (*QueryResponse[ValidatorResponse], error)
- func GetStakingValidatorDelegations(apiEndpoint, validatorAddr string, params map[string]string) (*QueryResponse[DelegationsResponse], error)
- func GetStakingValidatorDelegatorPeriodDelegation(apiEndpoint, validatorAddr, delegatorAddr, delegationID string) (*QueryResponse[PeriodDelegationResponse], error)
- func GetStakingValidatorDelegatorPeriodDelegations(apiEndpoint, validatorAddr, delegatorAddr string, params map[string]string) (*QueryResponse[PeriodDelegationsResponse], error)
- func GetStakingValidators(apiEndpoint string, params map[string]string) (*QueryResponse[ValidatorsResponse], error)
- type Response
- type RewardsData
- type Server
- func (s *Server) EstimatedAPRHandler() gin.HandlerFunc
- func (s *Server) GetSystemAPRPercentage() (decimal.Decimal, error)
- func (s *Server) GracefulQuit() error
- func (s *Server) NetworkStatusHandler() gin.HandlerFunc
- func (s *Server) OperationsHandler() gin.HandlerFunc
- func (s *Server) RewardsHandler() gin.HandlerFunc
- func (s *Server) Run()
- func (s *Server) StakingDelegationHandler() gin.HandlerFunc
- func (s *Server) StakingDelegatorDelegationsHandler() gin.HandlerFunc
- func (s *Server) StakingDelegatorUnbondingDelegationsHandler() gin.HandlerFunc
- func (s *Server) StakingParamsHandler() gin.HandlerFunc
- func (s *Server) StakingPoolHandler() gin.HandlerFunc
- func (s *Server) StakingValidatorDelegationsHandler() gin.HandlerFunc
- func (s *Server) StakingValidatorDelegatorPeriodDelegationHandler() gin.HandlerFunc
- func (s *Server) StakingValidatorDelegatorPeriodDelegationsHandler() gin.HandlerFunc
- func (s *Server) StakingValidatorHandler() gin.HandlerFunc
- func (s *Server) StakingValidatorsHandler() gin.HandlerFunc
- func (s *Server) TotalStakeHandler() gin.HandlerFunc
- func (s *Server) TotalStakeHistoryHandler() gin.HandlerFunc
- type ServerConfig
- type StakeAmountData
- type StakingParamsResponse
- type StakingPoolResponse
- type StakingValidatorData
- type StakingValidatorsData
- type UnbondingDelegationsResponse
- type ValidatorInfo
- type ValidatorResponse
- type ValidatorsResponse
Constants ¶
View Source
const ( IndexModeReader = "reader" IndexModeWriter = "writer" )
View Source
const ( TokenTypeLocked = 0 TokenTypeUnlocked = 1 )
View Source
const (
CacheEngineRedis = "redis"
)
View Source
const (
DatabaseEnginePostgres = "postgres"
)
Variables ¶
Functions ¶
func GetCachedData ¶
Types ¶
type BlockchainConfig ¶
type CacheConfig ¶
type Config ¶
type Config struct { Blockchain BlockchainConfig `toml:"blockchain"` Server ServerConfig `toml:"server"` Database DatabaseConfig `toml:"database"` Cache CacheConfig `toml:"cache"` }
type DatabaseConfig ¶
type DelegationInfo ¶
type DelegationInfo struct { Delegation struct { DelegatorAddress string `json:"delegator_address"` ValidatorAddress string `json:"validator_address"` Shares string `json:"shares"` RewardsShares string `json:"rewards_shares"` } `json:"delegation"` Balance struct { Denom string `json:"denom"` Amount string `json:"amount"` } `json:"balance"` }
type DelegationResponse ¶
type DelegationResponse struct {
DelegationResponse DelegationInfo `json:"delegation_response"`
}
type DelegationsResponse ¶
type DelegationsResponse struct { DelegationResponses []DelegationInfo `json:"delegation_responses"` Pagination Pagination `json:"pagination"` }
type DistributionParamsResponse ¶
type DistributionParamsResponse struct { Params struct { Ubi string `json:"ubi"` } `json:"params"` }
type EstimatedAPRData ¶
type EstimatedAPRData struct {
APR string `json:"apr"`
}
type MintParamsResponse ¶
type NetworkStatus ¶
type NetworkStatus string
const ( StatusNormal NetworkStatus = "Normal" StatusDegraded NetworkStatus = "Degraded" StatusDown NetworkStatus = "Down" )
type NetworkStatusData ¶
type NetworkStatusData struct { Status NetworkStatus `json:"status"` CLBlockNumber int64 `json:"consensus_block_height"` ELBlockNumber int64 `json:"execution_block_height"` }
type OperationsData ¶
type Pagination ¶
type PeriodDelegationInfo ¶
type PeriodDelegationInfo struct { PeriodDelegation struct { DelegatorAddress string `json:"delegator_address"` ValidatorAddress string `json:"validator_address"` PeriodDelegationID string `json:"period_delegation_id"` PeriodType int `json:"period_type"` Shares string `json:"shares"` RewardsShares string `json:"rewards_shares"` EndTime string `json:"end_time"` } `json:"period_delegation"` Balance struct { Denom string `json:"denom"` Amount string `json:"amount"` } `json:"balance"` }
type PeriodDelegationResponse ¶
type PeriodDelegationResponse struct {
PeriodDelegationResponse PeriodDelegationInfo `json:"period_delegation_response"`
}
type PeriodDelegationsResponse ¶
type PeriodDelegationsResponse struct { PeriodDelegationResponses []PeriodDelegationInfo `json:"period_delegation_responses"` Pagination Pagination `json:"pagination"` }
type QueryResponse ¶
type QueryResponse[T any] struct { Code int `json:"code"` Msg T `json:"msg"` Error string `json:"error"` }
func GetDistributionParams ¶
func GetDistributionParams(apiEndpoint string) (*QueryResponse[DistributionParamsResponse], error)
func GetMintParams ¶
func GetMintParams(apiEndpoint string) (*QueryResponse[MintParamsResponse], error)
func GetStakingDelegation ¶
func GetStakingDelegation(apiEndpoint, validatorAddr, delegatorAddr string) (*QueryResponse[DelegationResponse], error)
func GetStakingDelegatorDelegations ¶
func GetStakingDelegatorDelegations(apiEndpoint, delegatorAddr string, params map[string]string) (*QueryResponse[DelegationsResponse], error)
func GetStakingDelegatorUnbondingDelegations ¶
func GetStakingDelegatorUnbondingDelegations(apiEndpoint, delegatorAddr string, params map[string]string) (*QueryResponse[UnbondingDelegationsResponse], error)
func GetStakingParams ¶
func GetStakingParams(apiEndpoint string) (*QueryResponse[StakingParamsResponse], error)
func GetStakingPool ¶
func GetStakingPool(apiEndpoint string) (*QueryResponse[StakingPoolResponse], error)
func GetStakingValidator ¶
func GetStakingValidator(apiEndpoint, validatorAddr string) (*QueryResponse[ValidatorResponse], error)
func GetStakingValidatorDelegations ¶
func GetStakingValidatorDelegations(apiEndpoint, validatorAddr string, params map[string]string) (*QueryResponse[DelegationsResponse], error)
func GetStakingValidatorDelegatorPeriodDelegation ¶
func GetStakingValidatorDelegatorPeriodDelegation(apiEndpoint, validatorAddr, delegatorAddr, delegationID string) (*QueryResponse[PeriodDelegationResponse], error)
func GetStakingValidatorDelegatorPeriodDelegations ¶
func GetStakingValidatorDelegatorPeriodDelegations(apiEndpoint, validatorAddr, delegatorAddr string, params map[string]string) (*QueryResponse[PeriodDelegationsResponse], error)
func GetStakingValidators ¶
func GetStakingValidators(apiEndpoint string, params map[string]string) (*QueryResponse[ValidatorsResponse], error)
type RewardsData ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) EstimatedAPRHandler ¶
func (s *Server) EstimatedAPRHandler() gin.HandlerFunc
func (*Server) GetSystemAPRPercentage ¶
func (*Server) GracefulQuit ¶
func (*Server) NetworkStatusHandler ¶
func (s *Server) NetworkStatusHandler() gin.HandlerFunc
func (*Server) OperationsHandler ¶
func (s *Server) OperationsHandler() gin.HandlerFunc
func (*Server) RewardsHandler ¶
func (s *Server) RewardsHandler() gin.HandlerFunc
func (*Server) StakingDelegationHandler ¶
func (s *Server) StakingDelegationHandler() gin.HandlerFunc
func (*Server) StakingDelegatorDelegationsHandler ¶
func (s *Server) StakingDelegatorDelegationsHandler() gin.HandlerFunc
func (*Server) StakingDelegatorUnbondingDelegationsHandler ¶
func (s *Server) StakingDelegatorUnbondingDelegationsHandler() gin.HandlerFunc
func (*Server) StakingParamsHandler ¶
func (s *Server) StakingParamsHandler() gin.HandlerFunc
func (*Server) StakingPoolHandler ¶
func (s *Server) StakingPoolHandler() gin.HandlerFunc
func (*Server) StakingValidatorDelegationsHandler ¶
func (s *Server) StakingValidatorDelegationsHandler() gin.HandlerFunc
func (*Server) StakingValidatorDelegatorPeriodDelegationHandler ¶
func (s *Server) StakingValidatorDelegatorPeriodDelegationHandler() gin.HandlerFunc
func (*Server) StakingValidatorDelegatorPeriodDelegationsHandler ¶
func (s *Server) StakingValidatorDelegatorPeriodDelegationsHandler() gin.HandlerFunc
func (*Server) StakingValidatorHandler ¶
func (s *Server) StakingValidatorHandler() gin.HandlerFunc
func (*Server) StakingValidatorsHandler ¶
func (s *Server) StakingValidatorsHandler() gin.HandlerFunc
func (*Server) TotalStakeHandler ¶
func (s *Server) TotalStakeHandler() gin.HandlerFunc
func (*Server) TotalStakeHistoryHandler ¶
func (s *Server) TotalStakeHistoryHandler() gin.HandlerFunc
type ServerConfig ¶
type StakeAmountData ¶
type StakingParamsResponse ¶
type StakingParamsResponse struct { Params 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"` MinDelegation string `json:"min_delegation"` Periods []struct { PeriodType int `json:"period_type"` Duration string `json:"duration"` RewardsMultiplier string `json:"rewards_multiplier"` } `json:"periods"` TokenTypes []struct { TokenType int `json:"token_type"` RewardsMultiplier string `json:"rewards_multiplier"` } `json:"token_types"` SingularityHeight string `json:"singularity_height"` } `json:"params"` }
type StakingPoolResponse ¶
type StakingValidatorData ¶
type StakingValidatorData struct { ValidatorInfo Uptime string `json:"uptime"` APR string `json:"apr"` }
type StakingValidatorsData ¶
type StakingValidatorsData struct { Validators []StakingValidatorData `json:"validators"` Pagination Pagination `json:"pagination"` }
type UnbondingDelegationsResponse ¶
type UnbondingDelegationsResponse struct { UnbondingResponses []struct { DelegatorAddress string `json:"delegator_address"` ValidatorAddress string `json:"validator_address"` Entries []struct { CreationHeight string `json:"creation_height"` CompletionTime string `json:"completion_time"` InitialBalance string `json:"initial_balance"` Balance string `json:"balance"` UnbondingID string `json:"unbonding_id"` } `json:"entries"` } `json:"unbonding_responses"` Pagination Pagination `json:"pagination"` }
type ValidatorInfo ¶
type ValidatorInfo struct { OperatorAddress string `json:"operator_address"` ConsensusPubKey struct { Type string `json:"type"` Value string `json:"value"` } `json:"consensus_pubkey"` Jailed bool `json:"jailed"` Status int `json:"status"` Tokens string `json:"tokens"` RewardsTokens string `json:"rewards_tokens"` Description struct { Moniker string `json:"moniker"` } `json:"description"` Commission struct { CommissionRates struct { Rate string `json:"rate"` MaxRate string `json:"max_rate"` MaxChangeRate string `json:"max_change_rate"` } `json:"commission_rates"` UpdateTime string `json:"update_time"` } `json:"commission"` SupportTokenType int `json:"support_token_type"` }
type ValidatorResponse ¶
type ValidatorResponse struct {
Validator ValidatorInfo `json:"validator"`
}
type ValidatorsResponse ¶
type ValidatorsResponse struct { Validators []ValidatorInfo `json:"validators"` Pagination Pagination `json:"pagination"` }
Click to show internal directories.
Click to hide internal directories.