Files
pezkuwichain 71f0cce337 feat(governance): add OpenGov v2 indexer for referenda, votes, delegations
Index convictionVoting and referenda pallet data to support PezWallet
governance UI — referendum tracking, casting votes, delegation stats,
and delegator vote propagation.
2026-02-19 01:40:21 +03:00

222 lines
3.7 KiB
GraphQL

type Transfer @jsonField {
amount: String!
to: String!
from: String!
fee: String!
eventIdx: Int!
success: Boolean!
}
type AssetTransfer @jsonField {
assetId: String!
amount: String!
to: String!
from: String!
fee: String!
eventIdx: Int!
success: Boolean!
}
type RewardInfo @jsonField {
eventIdx: Int!
amount: String!
isReward: Boolean!
era: Int
stash: String
validator: String
}
type PoolReward @jsonField {
eventIdx: Int!
amount: String!
isReward: Boolean!
poolId: Int!
}
type Swap @jsonField {
assetIdIn: String!
amountIn: String!
assetIdOut: String!
amountOut: String!
sender: String!
receiver: String!
assetIdFee: String!
fee: String!
eventIdx: Int!
success: Boolean!
}
enum RewardType {
reward
slash
}
type AccountReward @entity {
id: ID!
address: String! @index
blockNumber: Int! @index
timestamp: BigInt!
amount: BigInt!
accumulatedAmount: BigInt!
type: RewardType!
}
type AccountPoolReward @entity {
id: ID!
address: String! @index
blockNumber: Int! @index
timestamp: BigInt!
amount: BigInt!
accumulatedAmount: BigInt!
type: RewardType!
poolId: Int!
}
type AccumulatedReward @entity {
id: ID! #address
amount: BigInt!
}
type AccumulatedPoolReward @entity {
id: ID! #address
amount: BigInt!
}
type Extrinsic @jsonField {
hash: String!
module: String!
call: String!
fee: String!
success: Boolean!
}
type HistoryElement @entity {
id: ID!
blockNumber: Int!
extrinsicIdx: Int
extrinsicHash: String
timestamp: BigInt! @index
address: String! @index
reward: RewardInfo
poolReward: PoolReward
extrinsic: Extrinsic
transfer: Transfer
assetTransfer: AssetTransfer
swap: Swap
}
type EraValidatorInfo @entity {
id: ID!
address: String! @index
era: Int! @index
total: BigInt!
own: BigInt!
others: [IndividualExposure]!
}
type IndividualExposure @jsonField {
who: String!
value: String!
}
type ErrorEvent @entity {
id: ID!
description: String!
}
# ===== Multi-staking API entities (used by PezWallet dashboard) =====
type StakingApy @entity {
id: ID!
networkId: String! @index
stakingType: String! @index
maxAPY: Float!
}
type ActiveStaker @entity {
id: ID!
networkId: String! @index
stakingType: String! @index
address: String! @index
}
type Reward @entity {
id: ID!
networkId: String! @index
stakingType: String! @index
address: String! @index
type: RewardType! @index
amount: BigInt!
timestamp: BigInt!
blockNumber: Int! @index
}
# ===== Governance — Dijital Kurdistan OpenGov v2 =====
type VoteBalance @jsonField {
amount: String!
conviction: String!
}
type StandardVote @jsonField {
aye: Boolean!
vote: VoteBalance!
}
type SplitVote @jsonField {
ayeAmount: String!
nayAmount: String!
}
type SplitAbstainVote @jsonField {
ayeAmount: String!
nayAmount: String!
abstainAmount: String!
}
type Referendum @entity {
id: ID! # referendumIndex as string
trackId: Int! @index
}
type CastingVoting @entity {
id: ID! # referendumId-voter
referendum: Referendum!
voter: String! @index
delegateId: String @index
standardVote: StandardVote
splitVote: SplitVote
splitAbstainVote: SplitAbstainVote
at: Int! @index
timestamp: BigInt
}
type DelegatorVoting @entity {
id: ID! # parentId-delegator
parent: CastingVoting!
delegator: String! @index
vote: VoteBalance
}
type Delegation @entity {
id: ID! # delegator-trackId
delegateId: String! @index
delegator: String! @index
trackId: Int! @index
delegation: VoteBalance
}
type Delegate @entity {
id: ID! # accountId hex
accountId: String! @index
delegators: Int!
delegatorVotes: BigInt!
}
type DelegateVote @entity {
id: ID! # delegateId-referendumId
delegate: Delegate!
at: Int! @index
timestamp: BigInt
}