Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeDelegateName(name string) (string, error)
- func EncodeDelegateName(name string) (string, error)
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- type Account
- type Alias
- type Bookkeeping
- type BucketInfo
- type BucketInfoList
- type BucketInfoOutput
- type CandidateMeta
- type Chain
- type ComplexityRoot
- type Config
- type Delegate
- type DirectiveRoot
- type EpochRange
- type NumberOfActions
- type OperatorAddress
- type Pagination
- type Productivity
- type QueryResolver
- type Resolver
- type ResolverRoot
- type Reward
- type RewardDistribution
- type StakingInformation
- type StakingOutput
- type Voting
Constants ¶
View Source
const HexPrefix = "0x"
HexPrefix is the prefix of ERC20 address in hex string
Variables ¶
View Source
var ErrPaginationNotFound = errors.New("Pagination information is not found")
ErrPaginationNotFound is the error indicating that pagination is not specified
Functions ¶
func DecodeDelegateName ¶
DecodeDelegateName converts format to readable delegate name
func EncodeDelegateName ¶
EncodeDelegateName converts a delegate name input to an internal format
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
Types ¶
type Account ¶
type Account struct {
ActiveAccounts []string `json:"activeAccounts"`
Alias *Alias `json:"alias"`
OperatorAddress *OperatorAddress `json:"operatorAddress"`
}
type Bookkeeping ¶
type Bookkeeping struct {
Exist bool `json:"exist"`
RewardDistribution []*RewardDistribution `json:"rewardDistribution"`
Count int `json:"count"`
}
type BucketInfo ¶
type BucketInfoList ¶
type BucketInfoList struct {
EpochNumber int `json:"epochNumber"`
BucketInfo []*BucketInfo `json:"bucketInfo"`
Count int `json:"count"`
}
type BucketInfoOutput ¶
type BucketInfoOutput struct {
Exist bool `json:"exist"`
BucketInfoList []*BucketInfoList `json:"bucketInfoList"`
}
type CandidateMeta ¶
type Chain ¶
type Chain struct {
MostRecentEpoch int `json:"mostRecentEpoch"`
MostRecentBlockHeight int `json:"mostRecentBlockHeight"`
MostRecentTps int `json:"mostRecentTPS"`
NumberOfActions *NumberOfActions `json:"numberOfActions"`
}
type ComplexityRoot ¶
type ComplexityRoot struct {
Account struct {
ActiveAccounts func(childComplexity int, count int) int
Alias func(childComplexity int, operatorAddress string) int
OperatorAddress func(childComplexity int, aliasName string) int
}
Alias struct {
AliasName func(childComplexity int) int
Exist func(childComplexity int) int
}
Bookkeeping struct {
Count func(childComplexity int) int
Exist func(childComplexity int) int
RewardDistribution func(childComplexity int, pagination *Pagination) int
}
BucketInfo struct {
VoterEthAddress func(childComplexity int) int
WeightedVotes func(childComplexity int) int
}
BucketInfoList struct {
BucketInfo func(childComplexity int) int
Count func(childComplexity int) int
EpochNumber func(childComplexity int) int
}
BucketInfoOutput struct {
BucketInfoList func(childComplexity int) int
Exist func(childComplexity int) int
}
CandidateMeta struct {
ConsensusDelegates func(childComplexity int) int
EpochNumber func(childComplexity int) int
TotalCandidates func(childComplexity int) int
TotalWeightedVotes func(childComplexity int) int
VotedTokens func(childComplexity int) int
}
Chain struct {
MostRecentBlockHeight func(childComplexity int) int
MostRecentEpoch func(childComplexity int) int
MostRecentTps func(childComplexity int, blockWindow int) int
NumberOfActions func(childComplexity int, pagination *EpochRange) int
}
Delegate struct {
Bookkeeping func(childComplexity int, percentage int, includeFoundationBonus bool) int
BucketInfo func(childComplexity int) int
Productivity func(childComplexity int) int
Reward func(childComplexity int) int
Staking func(childComplexity int) int
}
NumberOfActions struct {
Count func(childComplexity int) int
Exist func(childComplexity int) int
}
OperatorAddress struct {
Exist func(childComplexity int) int
OperatorAddress func(childComplexity int) int
}
Productivity struct {
Exist func(childComplexity int) int
ExpectedProduction func(childComplexity int) int
Production func(childComplexity int) int
}
Query struct {
Account func(childComplexity int) int
Chain func(childComplexity int) int
Delegate func(childComplexity int, startEpoch int, epochCount int, delegateName string) int
Voting func(childComplexity int, startEpoch int, epochCount int) int
}
Reward struct {
BlockReward func(childComplexity int) int
EpochReward func(childComplexity int) int
Exist func(childComplexity int) int
FoundationBonus func(childComplexity int) int
}
RewardDistribution struct {
Amount func(childComplexity int) int
VoterEthAddress func(childComplexity int) int
VoterIotexAddress func(childComplexity int) int
}
StakingInformation struct {
EpochNumber func(childComplexity int) int
SelfStaking func(childComplexity int) int
TotalStaking func(childComplexity int) int
}
StakingOutput struct {
Exist func(childComplexity int) int
StakingInfo func(childComplexity int) int
}
Voting struct {
CandidateMeta func(childComplexity int) int
Exist func(childComplexity int) int
}
}
type Config ¶
type Config struct {
Resolvers ResolverRoot
Directives DirectiveRoot
Complexity ComplexityRoot
}
type Delegate ¶
type Delegate struct {
Reward *Reward `json:"reward"`
Productivity *Productivity `json:"productivity"`
Bookkeeping *Bookkeeping `json:"bookkeeping"`
BucketInfo *BucketInfoOutput `json:"bucketInfo"`
Staking *StakingOutput `json:"staking"`
}
type DirectiveRoot ¶
type DirectiveRoot struct {
}
type EpochRange ¶
type NumberOfActions ¶
type OperatorAddress ¶
type Pagination ¶
type Productivity ¶
type QueryResolver ¶
type QueryResolver interface {
Account(ctx context.Context) (*Account, error)
Chain(ctx context.Context) (*Chain, error)
Delegate(ctx context.Context, startEpoch int, epochCount int, delegateName string) (*Delegate, error)
Voting(ctx context.Context, startEpoch int, epochCount int) (*Voting, error)
}
type Resolver ¶
type Resolver struct {
PP *productivity.Protocol
RP *rewards.Protocol
AP *actions.Protocol
VP *votings.Protocol
CP *chainmeta.Protocol
}
Resolver is hte resolver that handles GraphQL request
type ResolverRoot ¶
type ResolverRoot interface {
Query() QueryResolver
}
type RewardDistribution ¶
type StakingInformation ¶
type StakingOutput ¶
type StakingOutput struct {
Exist bool `json:"exist"`
StakingInfo []*StakingInformation `json:"stakingInfo"`
}
type Voting ¶
type Voting struct {
Exist bool `json:"exist"`
CandidateMeta []*CandidateMeta `json:"candidateMeta"`
}
Click to show internal directories.
Click to hide internal directories.