-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.graphql
62 lines (55 loc) · 1.4 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# To improve query performance, we strongly suggest adding indexes to any field that you plan to filter or sort by
# Add the `@index` or `@index(unique: true)` annotation after any non-key field
# https://academy.subquery.network/build/graphql.html#indexing-by-non-primary-key-field
type CallByEra @entity {
id: ID! # era_contract
contractAddress: String! @index
era: BigInt! @index
numberOfCalls: BigInt!
activeUsers: [String]!
uniqueActiveUsers: BigInt!
timestamp: BigInt,
startBlock: Int
endBlock: Int
}
type StakingEvent @entity {
id: ID!
userAddress: String! @index
transaction: UserTransactionType!
contractAddress: String
amount: BigInt!
timestamp: BigInt! @index
blockNumber: BigInt!
}
enum UserTransactionType {
BondAndStake,
UnbondAndUnstake,
Withdraw,
WithdrawFromUnregistered,
NominationTransfer
}
type Era @entity {
id: ID! #Era number
block: BigInt!
timestamp: BigInt!
}
type Contract @entity {
id: ID! #Contrat address
registrationEra: BigInt!
registrationBlock: BigInt!
registrationTimestamp: BigInt!
unregistrationEra: BigInt
unregistrationTimestamp: BigInt
unregistrationBlock: BigInt
}
type UserTransaction @entity {
id: ID!
userAddress: String! @index
transaction: UserTransactionType!
transactionHash: String!
transactionSuccess: Boolean!
contractAddress: String
amount: BigInt
timestamp: BigInt! @index
blockNumber: BigInt!
}