-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
111 lines (102 loc) · 2.45 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
# To improve query performance, we strongly suggest adding indexes to any field that you plan to filter or sort by
# Add the `@index` or `@index(unique: true)` annotation after any non-key field
# https://academy.subquery.network/build/graphql.html#indexing-by-non-primary-key-field
enum Network {
ASTAR
MOONBEAM
MOONRIVER
SHIDEN
}
enum Marketplace {
TOFUNFT
MOONBEANS
}
type Attribute @jsonField {
trait_type: String
value: String
}
type Metadata @jsonField {
name: String
description: String
image: String
external_url: String
attributes: [Attribute]
}
type Account @entity {
"account address"
id: ID!
}
type Collection @entity {
"network + contractAddress"
id: ID!
"Deployed blockchain network"
network: Network!
"Contract address"
contractAddress: String!
"Collection name"
name: String
"Collection symbol"
symbol: String
"List of nfts"
nfts: [Nft!]! @derivedFrom(field: "collection")
"The lowest price for an item in this collection"
floorPrice: BigInt!
}
type Nft @entity {
"netowrk + collectionAddress + tokenId"
id: ID!
"Deployed blockchain network"
network: Network!
"Id of nft token"
tokenId: BigInt!
"Collection where this nft belongs to"
collection: Collection!
"The block height at which nft was minted or created"
block: BigInt!
"The unix timestamp of the block at which nft was minted or created"
timestamp: Int!
"The name of nft"
name: String
"Nft metadata URL"
uri: String
"Nft image URL"
image: String
"Nft description"
description: String
"Nft metadata"
metadata: Metadata
"The current owner of this token"
owner: Account!
"Nft transfer history"
transfers: [NftTransfers!]! @derivedFrom(field: "nft")
"Market price of listed nft"
price: Price
}
type Price @entity {
"network + collectionAddress + tokenId"
id: ID!
"Current item price"
amount: BigInt!
"Token address, null for items priced in native token"
currency: String
"The marketplace where nft is listed for sale"
marketplace: Marketplace!
}
type NftTransfers @entity {
"network-blocknumber-logIndex"
id: ID!
"Deployed blockchain network"
network: Network!
"Nft being transfered"
nft: Nft!
"The block height at which transaction occured"
block: BigInt!
"The unix timestamp of block that contains this transfer transaction"
timestamp: Int!
"The transaction id"
transactionId: String!
"Source nft account"
from: Account!
"Destination nft account"
to: Account!
}