This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathschema.graphql
188 lines (167 loc) · 5.55 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
type AccountMetadataByKey @entity {
id: ID! # accountId + "-" + key
accountId: String!
key: Bytes!
value: Bytes!
lastUpdatedBlockTimestamp: BigInt!
}
type AccountMetadataEvent @entity {
id: ID! # event.transaction.hash.toHex() + "-" + event.logIndex.toString()
accountId: String!
key: Bytes!
value: Bytes!
lastUpdatedBlockTimestamp: BigInt!
}
# TODO: rename to AddressAccount
type Account @entity {
id: ID! # the accountId
assetConfigs: [AccountAssetConfig!]! @derivedFrom(field: "account")
splitsEntryIds: [String!]!
splitsEntries: [SplitsEntry!]! @derivedFrom(field: "sender")
splitsReceiversHash: Bytes!
lastUpdatedBlockTimestamp: BigInt!
}
# TODO: rename to AddressAccountAssetConfig
type AccountAssetConfig @entity {
id: ID! # the accountId + "-" + assetId
account: Account!
assetId: BigInt!
streamsEntryIds: [String!]!
streamsEntries: [StreamsEntry!]! @derivedFrom(field: "senderAssetConfig")
balance: BigInt! # the account's balance for the asset at last top-up
assetConfigHash: Bytes!
amountSplittable: BigInt!
amountPostSplitCollectable: BigInt!
amountCollected: BigInt!
lastUpdatedBlockTimestamp: BigInt!
}
type StreamsSetEvent @entity {
id: ID! # event.transaction.hash.toHex() + "-" + event.logIndex.toString()
accountId: String! # the accountId of the sender
assetId: BigInt!
receiversHash: Bytes! # the hash of the receivers list
streamReceiverSeenEvents: [StreamReceiverSeenEvent!]! @derivedFrom(field: "streamsSetEvent")
streamsHistoryHash: Bytes! # the history hash of this streams-set for squeezing
balance: BigInt!
blockTimestamp: BigInt!
maxEnd: BigInt!
}
type LastSetStreamAccountMapping @entity {
id: ID! # receiversHash
streamsSetEventId: String! # the ID of the last StreamsSetEvent that was created with this receiversHash
accountId: String! # the last accountId that SetStreams was called for with this receiversHash
assetId: BigInt! # the last assetId that SetStreams was called for with this receiversHash
}
type StreamReceiverSeenEvent @entity {
id: ID! # event.transaction.hash.toHex() + "-" + event.logIndex.toString()
streamsSetEvent: StreamsSetEvent!
receiversHash: Bytes!
senderAccountId: String!
receiverAccountId: String! # the receiver's accountId
config: BigInt!
blockTimestamp: BigInt!
}
type StreamsEntry @entity {
id: ID! # sender's accountId + "-" + receiver's accountId + "-" + assetId
sender: Account!
senderAssetConfig: AccountAssetConfig!
accountId: String! # the receiver's accountId
config: BigInt!
}
type ReceivedStreamsEvent @entity {
id: ID! # event.transaction.hash.toHex() + "-" + event.logIndex.toString()
accountId: String! # the sender's accountId
assetId: BigInt!
amt: BigInt!
receivableCycles: BigInt!
blockTimestamp: BigInt!
}
type SqueezedStreamsEvent @entity {
id: ID! # event.transaction.hash.toHex() + "-" + event.logIndex.toString()
accountId: String! # the sender's accountId
assetId: BigInt!
senderId: String!
amt: BigInt!
blockTimestamp: BigInt!
streamsHistoryHashes: [Bytes!]!
}
type SplitsSetEvent @entity {
id: ID! # event.transaction.hash.toHex() + "-" + event.logIndex.toString()
accountId: String! # the accountId of the sender
receiversHash: Bytes! # the hash of the receivers list
splitsReceiverSeenEvents: [SplitsReceiverSeenEvent!]! @derivedFrom(field: "splitsSetEvent")
blockTimestamp: BigInt!
}
type LastSetSplitsAccountMapping @entity {
id: ID! # receiversHash
splitsSetEventId: String! # the ID of the last SplitsSetEvent that was created with this receiversHash
accountId: String! # the last accountId that SetSplits was called for with this receiversHash
}
type SplitsReceiverSeenEvent @entity {
id: ID! # event.transaction.hash.toHex() + "-" + event.logIndex.toString()
splitsSetEvent: SplitsSetEvent!
receiversHash: Bytes!
senderAccountId: String! # the sender's accountId
receiverAccountId: String! # the receiver's accountId
weight: BigInt!
blockTimestamp: BigInt!
}
type SplitsEntry @entity {
id: ID! # sender's accountId + "-" + receiver's accountId
sender: Account!
accountId: String! # the receiver's accountId
weight: BigInt!
}
type SplitEvent @entity {
id: ID! # event.transaction.hash.toHex() + "-" + event.logIndex.toString()
accountId: String! # the sender's accountId
receiverId: String! # the receiver's accountId
assetId: BigInt!
amt: BigInt!
blockTimestamp: BigInt!
}
type CollectableEvent @entity {
id: ID! # event.transaction.hash.toHex() + "-" + event.logIndex.toString()
account: Account!
assetId: BigInt!
amt: BigInt!
blockTimestamp: BigInt!
}
type CollectedEvent @entity {
id: ID! # event.transaction.hash.toHex() + "-" + event.logIndex.toString()
account: Account!
assetId: BigInt!
collected: BigInt!
blockTimestamp: BigInt!
}
type GivenEvent @entity {
id: ID! # event.transaction.hash.toHex() + "-" + event.logIndex.toString()
accountId: String!
receiverAccountId: String! # the receiver's accountId
assetId: BigInt!
amt: BigInt!
blockTimestamp: BigInt!
}
type App @entity {
id: ID! # the appId
appAddress: Bytes!
lastUpdatedBlockTimestamp: BigInt!
}
type NFTSubAccount @entity {
id: ID! # the NFT token ID
ownerAddress: Bytes!
originalOwnerAddress: Bytes
}
type ImmutableSplitsCreated @entity {
id: ID! # accountId + "-" + receiversHash
accountId: String!
receiversHash: Bytes!
}
type RepoAccount @entity {
id: ID! # the accountId
name: String! # The name of the repository.
forge: BigInt!
status: String # null, 'CLAIMED' or 'OWNER_UPDATE_REQUESTED'.
ownerAddress: String
lastUpdatedBlockTimestamp: BigInt!
}