-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
169 lines (152 loc) · 2.95 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
enum AirNetwork {
ARBITRUM_ONE
ARWEAVE_MAINNET
AURORA
AVALANCHE
BOBA
BSC # aka BNB Chain
CELO
COSMOS
CRONOS
MAINNET # Ethereum Mainnet
FANTOM
FUSE
HARMONY
JUNO
MOONBEAM
MOONRIVER
NEAR_MAINNET
OPTIMISM
OSMOSIS
MATIC # aka Polygon
XDAI # aka Gnosis Chain
}
enum AirProtocolType {
GENERIC
EXCHANGE
LENDING
YIELD
BRIDGE
DAO
NFT_MARKET_PLACE
STAKING
P2E #play to earn
LAUNCHPAD
}
enum AirTransactionType { # TODO: Think if this should be just Action Types.
SALE
MINT
GIFT
}
enum AirProtocolActionType {
ALL ##to track all action stats of a dapp
### NFT Marketplace/Tokens ###
BUY
SELL
MINT
BURN # TODO check this later
### NFT (ex: Poap) ###
ATTEND
### P2E (NFT + Utility) ###
EARN
### DEX ###
SWAP
ADD_LIQUIDITY
REMOVE_LIQUIDITY
ADD_TO_FARM
REMOVE_FROM_FARM
CLAIM_FARM_REWARD
### Lending ###
LEND
BORROW
FLASH_LOAN
### Staking / Delegating ###
STAKE
RESTAKE
UNSTAKE
DELEGATE
CLAIM_REWARDS
}
type AirBlock @entity {
id: ID! #chainID-number
hash: String!
number: BigInt!
timestamp: BigInt!
}
type AirMeta @entity {
id: ID! # air_meta
network: String!
schemaVersion: String!
slug: String! #Opensea_V1
name: String! # Opeasea V1
}
type AirEntityCounter @entity {
id: ID! #Air_DAILY_STATS_ACCOUNT
count: BigInt!
createdAt: AirBlock!
lastUpdatedAt: AirBlock!
}
type AirAccount @entity {
id: ID!
address: String!
createdAt: AirBlock!
}
type AirToken @entity {
id: ID! #chain-address
address: String!
transactions: [AirNftTransaction!] @derivedFrom(field: "transactionToken")
}
interface AirTransaction {
id: ID ! #chain-hash-logIndex-< add as per context > NFT marketplace will have tokenId
from: AirAccount!
to: AirAccount!
hash: String! #todo: Check if this should be bytes
block: AirBlock!
type: AirTransactionType!
index: BigInt!
protocolType: AirProtocolType!
protocolActionType: AirProtocolActionType!
}
type AirNftTransaction implements AirTransaction @entity {
id: ID!
from: AirAccount!
to: AirAccount!
hash: String! #todo: Check if this should be bytes
block: AirBlock!
type: AirTransactionType!
index: BigInt!
protocolType: AirProtocolType!
protocolActionType: AirProtocolActionType!
tokenId: BigInt! #nft
tokenAmount:BigInt! #nft
transactionToken: AirToken! #nft
paymentToken: AirToken #payment
paymentAmount: BigInt #payment
royalties: [AirNftSaleRoyalty!] @derivedFrom(field: "nftTransaction")
feeAmount: BigInt
feeBeneficiary: AirAccount
tokenMetadata: AirTokenMetadata
}
type AirNftSaleRoyalty @entity{
id: ID! #AirNftTransaction(ID) + royalty beneficiary
amount: BigInt!
beneficiary: String!
nftTransaction: AirNftTransaction!
}
type AirTokenMetadata @entity {
id: ID!
displayContentType: AirTokenDisplayType!
displayContent: String
}
enum AirTokenDisplayType {
IMAGE
VIDEO
AUDIO
TEXT_IMAGE
TEXT
}
type AirExtraData @entity {
id: ID!
name: String!
value: String!
}