generated from subsquid-labs/squid-frontier-evm-template
-
Notifications
You must be signed in to change notification settings - Fork 5
/
schema.graphql
104 lines (95 loc) · 2.13 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
type Attribute {
# display_type field of metadata attributes
displayType: String
# trait_type field of metadata attributes
traitType: String!
value: String!
}
# these values come from the fetched metadata object from the token URI
type Metadata @entity {
id: ID!
name: String @index
description: String
image: String
# external_url field of metadata
externalUrl: String
attributes: [Attribute!]
type: String @index
composite: Boolean
layers: [String!]
artist: String @index
# artist_url field of metadata
artistUrl: String
}
type Token @entity {
id: ID!
numericId: BigInt! @index
owner: Owner
# tokenURI of contract
tokenUri: String
# compositeURI of contract
compositeTokenUri: String
# timestamp when the token URIs were updated last
updatedAt: BigInt! @index
createdAt: BigInt! @index
transfers: [Transfer!]! @derivedFrom(field: "token")
contract: Contract!
metadata: Metadata
}
type Owner @entity {
id: ID!
ownedTokens: [Token!]! @derivedFrom(field: "owner")
totalCollectionNfts: [TotalOwnedNft!]!
# amount of tokens
balance: BigInt! @index
transfers: [OwnerTransfer!] @derivedFrom(field: "owner")
}
type TotalOwnedNft {
conctractAddress: String!
amount: Int!
}
# Generic contract stats
type Contract @entity {
# 1
id: ID!
factoryId: BigInt! @index
name: String @index
symbol: String @index
#updated on each mint/burn
totalSupply: BigInt!
mintedTokens: [Token!]! @derivedFrom(field: "contract")
# contract URI updated once e.g. a day
contractURI: String
# timestamp when the contract URI was updated last
contractURIUpdated: BigInt @index
decimals: Int
startBlock: Int! @index
#metadata
metadataName: String @index
description: String
image: String
externalLink: String
artist: String @index
artistUrl: String
#counters
uniqueOwnersCount: Int! @index
}
type Transfer @entity {
id: ID!
token: Token!
from: Owner
to: Owner
timestamp: BigInt! @index
block: Int! @index
transactionHash: String! @index
}
enum Direction {
FROM
TO
}
type OwnerTransfer @entity {
id: ID!
owner: Owner
transfer: Transfer!
direction: Direction!
}