-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
129 lines (119 loc) · 2.67 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
type Auction @entity {
id: ID! #id is a required field
blockNum: Int!
status: String! @index
bids: [Bid]! @derivedFrom(field: "auction")
# winningBids: [WinningBid]! @derivedFrom(field: "auction")
leaseStart: Int
slotsStart: Int!
leaseEnd: Int
slotsEnd: Int!
closingStart: Int!
closingEnd: Int!
resultBlock: Int
ongoing: Boolean! @index
parachainLeases: [ParachainLeases] @derivedFrom(field: "auction")
}
# type Account @entity {
# id: ID!
# isFund: Boolean!
# }
type Parachain @entity {
id: ID!
paraId: Int!
createdAt: Date
creationBlock: Int
deregistered: Boolean!
deposit: BigInt!
manager: String!
leases: [ParachainLeases] @derivedFrom(field: "parachain")
bids: [Bid] @derivedFrom(field: "parachain")
funds: [Crowdloan] @derivedFrom(field: "parachain")
# activeFund: Crowdloan
# latestBid: Bid
chronicle: Chronicle
}
type Crowdloan @entity {
id: ID! # generated fund address
parachain: Parachain!
depositor: String!
verifier: String
cap: BigInt!
raised: BigInt! @index
lockExpiredBlock: Int!
blockNum: Int
firstSlot: Int!
lastSlot: Int!
status: String! @index
leaseExpiredBlock: Int
dissolvedBlock: Int
updatedAt: Date
createdAt: Date
isFinished: Boolean @index
wonAuctionId: String @index
contributions: [Contribution] @derivedFrom(field: "fund")
}
type AuctionParachain @entity {
id: ID!
auction: Auction!
parachain: Parachain!
blockNum: Int!
createdAt: Date!
firstSlot: Int!
lastSlot: Int!
}
type ParachainLeases @entity {
id: ID! # paraId-leaseRange-auction
paraId: Int!
parachain: Parachain! @index
leaseRange: String! @index #auctionId-start-end
firstLease: Int!
lastLease: Int!
latestBidAmount: BigInt!
auction: Auction @index
activeForAuction: String @index #auctionId or 'sudo'
winningAmount: BigInt
extraAmount: BigInt
wonBidFrom: String
numBlockWon: Int
winningResultBlock: Int
hasWon: Boolean! @index
}
type Bid @entity {
id: ID!
auction: Auction!
winningAuction: Int @index # auctionId
blockNum: Int! @index
parachain: Parachain!
isCrowdloan: Boolean!
amount: BigInt!
fund: Crowdloan
firstSlot: Int!
lastSlot: Int!
bidder: String
createdAt: Date!
}
type Contribution @entity {
id: ID!
account: String! @index
parachain: Parachain!
fund: Crowdloan!
amount: BigInt! @index
blockNum: Int! @index
createdAt: Date!
}
type Chronicle @entity {
id: ID! # Static 'ChronicleKey'
curAuction: Auction
curBlockNum: Int
curLease: Int
curLeaseStart: Int
curLeaseEnd: Int
parachains: [Parachain] @derivedFrom(field: "chronicle")
}
type CrowdloanSequence @entity {
id: ID!
curIndex: Int!
createdAt: Date!
blockNum: Int!
}