-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
91 lines (80 loc) · 2 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
enum ContractType {
ERC721,
ERC1155
}
enum StatusType {
PENDING,
PROCESSING,
COMPLETED,
FAILED,
UNKNOWN,
INVALID
}
type AnyJson @jsonField {
# Need a value for codegen but type is any
_: String
}
type Nft @entity {
id: ID! #CollectionID-TokenId
tokenId: String! @index
amount: BigInt! #1 for Erc721. 1155 semi-fungible has other values
collection: Collection!
minted_block: BigInt! @index# Should be bigInt
minted_timestamp: BigInt! # unix epoch timestamp
minter_address: String! @index # event transaction from
current_owner: String! @index # event args to
metadata: Metadata
}
type Collection @entity {
id: ID! # chainID-contract adddress
network: Network!
contract_address: String! @index # event address
created_block: BigInt! @index
created_timestamp: BigInt! @index# unix epoch timestamp
creator_address: String! # event transaction from
total_supply: BigInt!
name: String
symbol: String
contract_type: ContractType! # e.g. ERC721, RMRK Hardcode
# floor_price: Int # Later on
}
type Transfer @entity {
id: ID!
tokenId: String! @index
amount: BigInt! # Same as with NFT
network: Network!
block: BigInt! @index
timestamp: BigInt! @index
transaction_hash: String! @index# event transaction hash
nft: Nft
from: String! @index
to: String! @index
}
type Network @entity {
id: ID!
}
type Metadata @entity {
id: ID! # hashed metadata_uri
metadata_uri: String!
raw: AnyJson
metadata_status: StatusType!
name: String
symbol: String
token_uri: String
image_uri: String
description: String
}
type Address @entity {
id: ID! #network account address ?
network: Network!
account: Account #optinal for now
}
type Account @entity {
"""Id is a base58 encoded public key"""
id: ID! # base58 encoded public key (only substrate chains ?)
addresses: [Address] @derivedFrom(field: "account") # addresses
}
type BlockedAddresses @entity {
"""Addresses that does not implement desired interfaces"""
id: ID! # networkId-contractAddress
}