watcher-ts/packages/eden-watcher/src/schema.gql
2022-11-16 20:01:18 +05:30

465 lines
9.5 KiB
GraphQL

enum CacheControlScope {
PUBLIC
PRIVATE
}
directive @cacheControl(
maxAge: Int
scope: CacheControlScope
inheritMaxAge: Boolean
) on FIELD_DEFINITION | OBJECT | INTERFACE | UNION
scalar BigInt
scalar Bytes
scalar BigDecimal
input Block_height {
hash: Bytes
number: Int
}
type Proof {
data: String!
}
type ResultBoolean {
value: Boolean!
proof: Proof
}
type ResultString {
value: String!
proof: Proof
}
type ResultInt {
value: Int!
proof: Proof
}
type ResultBigInt {
value: BigInt!
proof: Proof
}
type _Block_ {
cid: String!
hash: String!
number: Int!
timestamp: Int!
parentHash: String!
}
type _Transaction_ {
hash: String!
index: Int!
from: String!
to: String!
}
type ResultEvent {
block: _Block_!
tx: _Transaction_!
contract: String!
eventIndex: Int!
event: Event!
proof: Proof
}
union Event = TransferEvent | ApprovalEvent | AuthorizationUsedEvent | AdminUpdatedEvent | TaxRateUpdatedEvent | SlotClaimedEvent | SlotDelegateUpdatedEvent | StakeEvent | UnstakeEvent | WithdrawEvent | ApprovalForAllEvent | BlockProducerAddedEvent | BlockProducerRemovedEvent | BlockProducerRewardCollectorChangedEvent | ClaimedEvent | SlashedEvent | MerkleRootUpdatedEvent | AccountUpdatedEvent | PermanentURIEvent | GovernanceChangedEvent | UpdateThresholdChangedEvent | RoleAdminChangedEvent | RoleGrantedEvent | RoleRevokedEvent | RewardScheduleChangedEvent
type TransferEvent {
from: String!
to: String!
value: BigInt
tokenId: BigInt
}
type ApprovalEvent {
owner: String!
spender: String
value: BigInt
approved: String
tokenId: BigInt
}
type AuthorizationUsedEvent {
authorizer: String!
nonce: String!
}
type AdminUpdatedEvent {
newAdmin: String!
oldAdmin: String!
}
type TaxRateUpdatedEvent {
newNumerator: Int!
newDenominator: Int!
oldNumerator: Int!
oldDenominator: Int!
}
type SlotClaimedEvent {
slot: Int!
owner: String!
delegate: String!
newBidAmount: BigInt!
oldBidAmount: BigInt!
taxNumerator: Int!
taxDenominator: Int!
}
type SlotDelegateUpdatedEvent {
slot: Int!
owner: String!
newDelegate: String!
oldDelegate: String!
}
type StakeEvent {
staker: String!
stakeAmount: BigInt!
}
type UnstakeEvent {
staker: String!
unstakedAmount: BigInt!
}
type WithdrawEvent {
withdrawer: String!
withdrawalAmount: BigInt!
}
type ApprovalForAllEvent {
owner: String!
operator: String!
approved: Boolean!
}
type BlockProducerAddedEvent {
producer: String!
}
type BlockProducerRemovedEvent {
producer: String!
}
type BlockProducerRewardCollectorChangedEvent {
producer: String!
collector: String!
}
type RewardScheduleChangedEvent {
# Note: dummy property added as server throws an error for type without any fields.
dummy: String
}
type ClaimedEvent {
index: BigInt!
totalEarned: BigInt!
account: String!
claimed: BigInt!
}
type SlashedEvent {
account: String!
slashed: BigInt!
}
type MerkleRootUpdatedEvent {
merkleRoot: String!
distributionNumber: BigInt!
metadataURI: String!
}
type AccountUpdatedEvent {
account: String!
totalClaimed: BigInt!
totalSlashed: BigInt!
}
type PermanentURIEvent {
value: String!
id: BigInt!
}
type GovernanceChangedEvent {
from: String!
to: String!
}
type UpdateThresholdChangedEvent {
updateThreshold: BigInt!
}
type RoleAdminChangedEvent {
role: String!
previousAdminRole: String!
newAdminRole: String!
}
type RoleGrantedEvent {
role: String!
account: String!
sender: String!
}
type RoleRevokedEvent {
role: String!
account: String!
sender: String!
}
type ResultState {
block: _Block_!
contractAddress: String!
cid: String!
kind: String!
data: String!
}
type SyncStatus {
latestIndexedBlockHash: String!
latestIndexedBlockNumber: Int!
latestCanonicalBlockHash: String!
latestCanonicalBlockNumber: Int!
}
enum OrderDirection {
asc
desc
}
type Query {
events(blockHash: String!, contractAddress: String!, name: String): [ResultEvent!]
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!): [ResultEvent!]
producer(id: String!, block: Block_height): Producer!
producers(block: Block_height, first: Int = 100, skip: Int = 0): [Producer!]!
producerSet(id: String!, block: Block_height): ProducerSet!
producerSetChange(id: String!, block: Block_height): ProducerSetChange!
producerRewardCollectorChange(id: String!, block: Block_height): ProducerRewardCollectorChange!
rewardScheduleEntry(id: String!, block: Block_height): RewardScheduleEntry!
rewardSchedule(id: String!, block: Block_height): RewardSchedule!
producerEpoch(id: String!, block: Block_height): ProducerEpoch!
block(id: String!, block: Block_height): Block!
blocks(where: Block_filter, block: Block_height, orderBy: Block_orderBy, orderDirection: OrderDirection, first: Int = 100, skip: Int = 0): [Block!]!
epoch(id: String!, block: Block_height): Epoch!
epoches(where: Epoch_filter, block: Block_height, first: Int = 100, skip: Int = 0): [Epoch!]!
slotClaim(id: String!, block: Block_height): SlotClaim!
slot(id: String!, block: Block_height): Slot!
staker(id: String!, block: Block_height): Staker!
stakers(where: Staker_filter, block: Block_height, orderBy: Staker_orderBy, orderDirection: OrderDirection, first: Int = 100, skip: Int = 0): [Staker!]!
network(id: String!, block: Block_height): Network!
distributor(id: String!, block: Block_height): Distributor!
distribution(id: String!, block: Block_height): Distribution!
claim(id: String!, block: Block_height): Claim!
slash(id: String!, block: Block_height): Slash!
account(id: String!, block: Block_height): Account!
getStateByCID(cid: String!): ResultState
getState(blockHash: String!, contractAddress: String!, kind: String): ResultState
getSyncStatus: SyncStatus
}
type Producer {
id: ID!
active: Boolean!
rewardCollector: Bytes
rewards: BigInt!
confirmedBlocks: BigInt!
pendingEpochBlocks: BigInt!
}
type ProducerSet {
id: ID!
producers: [Producer!]! @cacheControl(inheritMaxAge: true)
}
type ProducerSetChange {
id: ID!
blockNumber: BigInt!
producer: Bytes!
changeType: ProducerSetChangeType! @cacheControl(inheritMaxAge: true)
}
enum ProducerSetChangeType {
Added
Removed
}
type ProducerRewardCollectorChange {
id: ID!
blockNumber: BigInt!
producer: Bytes!
rewardCollector: Bytes!
}
type RewardScheduleEntry {
id: ID!
startTime: BigInt!
epochDuration: BigInt!
rewardsPerEpoch: BigInt!
}
type RewardSchedule {
id: ID!
rewardScheduleEntries: [RewardScheduleEntry!]! @cacheControl(inheritMaxAge: true)
lastEpoch: Epoch @cacheControl(inheritMaxAge: true)
pendingEpoch: Epoch @cacheControl(inheritMaxAge: true)
activeRewardScheduleEntry: RewardScheduleEntry @cacheControl(inheritMaxAge: true)
}
type Block {
id: ID!
fromActiveProducer: Boolean!
hash: Bytes!
parentHash: Bytes!
unclesHash: Bytes!
author: Bytes!
stateRoot: Bytes!
transactionsRoot: Bytes!
receiptsRoot: Bytes!
number: BigInt!
gasUsed: BigInt!
gasLimit: BigInt!
timestamp: BigInt!
difficulty: BigInt!
totalDifficulty: BigInt!
size: BigInt
}
input Block_filter {
fromActiveProducer: Boolean
number_gte: BigInt
number_lte: BigInt
timestamp_lte: BigInt
}
enum Block_orderBy {
number
timestamp
}
type Epoch {
id: ID!
finalized: Boolean!
epochNumber: BigInt!
startBlock: Block @cacheControl(inheritMaxAge: true)
endBlock: Block @cacheControl(inheritMaxAge: true)
producerBlocks: BigInt!
allBlocks: BigInt!
producerBlocksRatio: BigDecimal!
producerRewards: [ProducerEpoch!]! @cacheControl(inheritMaxAge: true)
}
input Epoch_filter {
epochNumber_gte: BigInt
epochNumber_lte: BigInt
}
type ProducerEpoch {
id: ID!
address: Bytes!
epoch: Epoch! @cacheControl(inheritMaxAge: true)
totalRewards: BigInt!
blocksProduced: BigInt!
blocksProducedRatio: BigDecimal!
}
type SlotClaim {
id: ID!
slot: Slot! @cacheControl(inheritMaxAge: true)
owner: Bytes!
winningBid: BigInt!
oldBid: BigInt!
startTime: BigInt!
expirationTime: BigInt!
taxRatePerDay: BigDecimal!
}
type Slot {
id: ID!
owner: Bytes!
delegate: Bytes!
winningBid: BigInt!
oldBid: BigInt!
startTime: BigInt!
expirationTime: BigInt!
taxRatePerDay: BigDecimal!
claims: [SlotClaim!]! @cacheControl(inheritMaxAge: true)
}
type Staker {
id: ID!
staked: BigInt!
rank: BigInt
}
input Staker_filter {
rank_gte: BigInt
}
enum Staker_orderBy {
rank
}
type Network {
id: ID!
slot0: Slot @cacheControl(inheritMaxAge: true)
slot1: Slot @cacheControl(inheritMaxAge: true)
slot2: Slot @cacheControl(inheritMaxAge: true)
stakers: [Staker!]! @cacheControl(inheritMaxAge: true)
numStakers: BigInt
totalStaked: BigInt!
stakedPercentiles: [BigInt!]!
}
type Distributor {
id: ID!
currentDistribution: Distribution @cacheControl(inheritMaxAge: true)
}
type Distribution {
id: ID!
distributor: Distributor! @cacheControl(inheritMaxAge: true)
timestamp: BigInt!
distributionNumber: BigInt!
merkleRoot: Bytes!
metadataURI: String!
}
type Claim {
id: ID!
timestamp: BigInt!
index: BigInt!
account: Account! @cacheControl(inheritMaxAge: true)
totalEarned: BigInt!
claimed: BigInt!
}
type Account {
id: ID!
totalClaimed: BigInt!
totalSlashed: BigInt!
claims: [Claim!]! @cacheControl(inheritMaxAge: true)
slashes: [Slash!]! @cacheControl(inheritMaxAge: true)
}
type Slash {
id: ID!
timestamp: BigInt!
account: Account! @cacheControl(inheritMaxAge: true)
slashed: BigInt!
}
type Mutation {
watchContract(address: String!, kind: String!, checkpoint: Boolean!, startingBlock: Int): Boolean!
}
type Subscription {
onEvent: ResultEvent!
}