forked from aboutcircles/circles-envio-indexer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
159 lines (149 loc) · 3.26 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
type GlobalStats {
id: ID!
signups: BigInt!
transfers: BigInt!
trusts: BigInt!
}
# new schema
enum TransferType {
Erc20WrapperTransfer
TransferSingle
TransferBatch
Demurrage
PersonalMint
StreamCompleted
HubTransfer
Transfer
GroupMintSingle
GroupMintBatch
GroupRedeem
GroupRedeemCollateralReturn
GroupRedeemCollateralBurn
}
type Transfer {
# id is: transactionHash-logIndex
id: ID!
safeTxHash: String
blockNumber: Int!
timestamp: Int!
transactionIndex: Int!
transactionHash: String! @index
logIndex: Int!
# batchIndex: Int!
# v1 or v2
version: Int!
# only for v2
operator: String
from: String!
to: String!
value: BigInt!
# transaction type; either: Erc20WrapperTransfer | TransferSingle | TransferBatch | StreamCompleted | HubTransfer | Transfer
transferType: TransferType!
# is either the v2 token-id or the v1 token address; both in address format
token: String!
isPartOfStreamOrHub: Boolean!
# demurrage can be applied both to sender and receiver
demurrageFrom: Transfer
demurrageTo: Transfer
}
type TrustRelation {
# is is truster-trustee-version
id: ID!
blockNumber: Int!
timestamp: Int!
transactionIndex: Int!
logIndex: Int!
version: Int!
trustee: Avatar!
truster: Avatar!
# v2 only or always UInt256.MAX in case of v1
expiryTime: BigInt!
# v1 only or always '100' in case of v2
limit: BigInt!
isMutual: Boolean!
isMigrated: Boolean!
}
enum AvatarType {
Signup
OrganizationSignup
RegisterHuman
Invite
RegisterGroup
RegisterOrganization
Unknown
Migrating
}
type AvatarBalance {
# id is avatar-token
id: ID!
# token address in v1 and token id in v2
token: Token!
avatar: Avatar!
balance: BigInt!
# this will be the opposite as the token type. Inflationary if demurrage, deflationary if static
computedValue: BigInt!
lastCalculated: Int
}
type Avatar {
# the avatar address
id: ID!
blockNumber: Int!
timestamp: Int!
transactionIndex: Int!
logIndex: Int!
transactionHash: String!
version: Int!
avatarType: AvatarType!
invitedBy: String
# v1 token address or equal to avatar address if v2
tokenId: String
# v2 wrapped token id
wrappedTokenId: String
# IPFS CID of the avatar's profile
cidV0: String
# balances of all tokens
balances: [AvatarBalance!]! @derivedFrom(field: "avatar")
# balance of all tokens aggregated
balance: BigInt!
# array of trusts given
trustsGiven: [TrustRelation!]! @derivedFrom(field: "truster")
# array of trusts received
trustsReceived: [TrustRelation!]! @derivedFrom(field: "trustee")
# count of trusts given
trustsGivenCount: Int!
# count of trusts received
trustsReceivedCount: Int!
lastMint: Int
# deprecated! use `trustsReceivedCount` instead
trustedByN: Int!
isVerified: Boolean!
profile: Profile
}
type Profile {
id: ID!
name: String
description: String
# groups only
symbol: String
previewImageUrl: String
imageUrl: String
}
enum TokenType {
RegisterGroup
RegisterHuman
Signup
WrappedDemurrageToken
WrappedStaticToken
}
type Token {
# token address in v1 and token id in v2
id: ID!
blockNumber: Int!
timestamp: Int!
transactionIndex: Int!
logIndex: Int!
transactionHash: String!
version: Int!
tokenType: TokenType!
tokenOwner: Avatar!
}