mirror of
https://github.com/pezkuwichain/pezkuwi-subquery.git
synced 2026-04-22 01:57:58 +00:00
076b54bdc9
- Add StakingApy, ActiveStaker, Reward entities to schema.graphql - Add APY calculation engine in NewEra.ts (inflation curve + validator commission) - Add saveMultiStakingReward to Rewards.ts and PoolRewards.ts - Add handleAssetTransfer for assets.Transferred events - Add constants.ts with genesis hashes and inflation params - Add docker-compose.prod.yml for production deployment (relay + assethub nodes) - Add deploy-vps.yml GitHub Actions workflow for auto-deploy on push
153 lines
2.5 KiB
GraphQL
153 lines
2.5 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
|
|
}
|