-
Notifications
You must be signed in to change notification settings - Fork 7
/
schema.graphql
99 lines (89 loc) · 2.28 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
type Chain @entity @cardinality(value: 10) {
id: ID! # network chain id e.g. 111555111
}
type ApplicationFactory @entity @cardinality(value: 5) {
id: ID! # chainId+address
applications: [Application!] @derivedFrom(field: "factory")
address: String!
chain: Chain! @index
}
type Application
@entity
@cardinality(value: 100)
@index(fields: ["address", "chain"]) {
id: ID! # chainId+address
address: String!
owner: String
timestamp: BigInt!
factory: ApplicationFactory
inputs: [Input!] @derivedFrom(field: "application")
chain: Chain! @index
}
type Token
@entity
@cardinality(value: 10)
@index(fields: ["address", "chain"]) {
id: ID! # chainId+address
address: String!
name: String!
symbol: String!
decimals: Int!
chain: Chain! @index
}
type NFT @entity @cardinality(value: 10) @index(fields: ["address", "chain"]) {
id: ID! # chainId+address
address: String!
name: String
symbol: String
chain: Chain! @index
}
# ERC-1155 contract representation
type MultiToken
@entity
@cardinality(value: 10)
@index(fields: ["address", "chain"]) {
id: ID! # chainId+address
address: String!
chain: Chain! @index
}
# scalar for erc-1155 tokens data to be used for single and batch deposits
type Erc1155Transfer {
tokenIndex: BigInt!
amount: BigInt!
}
type Erc1155Deposit @entity @cardinality(value: 100) {
id: ID! # chainId+address
from: String!
token: MultiToken!
transfers: [Erc1155Transfer!]
chain: Chain! @index
}
type Erc721Deposit @entity @cardinality(value: 100) {
id: ID! # chainId+address
from: String!
token: NFT!
tokenIndex: BigInt!
chain: Chain! @index
}
type Erc20Deposit @entity @cardinality(value: 100) {
id: ID! # chainId+address
token: Token!
from: String!
amount: BigInt!
chain: Chain! @index
}
type Input @entity @cardinality(value: 100) @index(fields: ["id", "chain"]) {
id: ID! # chainId+address+idx
application: Application!
index: Int!
msgSender: String!
payload: String!
timestamp: BigInt!
blockNumber: BigInt!
blockHash: String!
transactionHash: String!
erc20Deposit: Erc20Deposit
erc721Deposit: Erc721Deposit
erc1155Deposit: Erc1155Deposit
chain: Chain! @index
}