-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
98 lines (86 loc) · 1.92 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
type Transfer @entity @index(fields: ["routeID", "depositNonce"], unique: true){
id: ID!
status: TransferStatus!
depositNonce: String!
deposit: Deposit @unique
execution: Execution @unique
feeID: String
fee: Fee @unique
routeID: String
route: Route!
amount: String
}
type Deposit @entity {
id: ID!
transfer: Transfer @derivedFrom(field: "deposit")
txHash: String!
blockNumber: String!
depositData: String!
timestamp: DateTime
handlerResponse: String!
destination: String
accountID: String
account: Account
}
type Execution @entity {
id: ID!
transfer: Transfer @derivedFrom(field: "execution")
txHash: String!
timestamp: DateTime
blockNumber: String!
message: String
}
enum TransferStatus {
pending
executed
failed
}
type Account @entity {
id: ID!
addressStatus: String
deposits: [Deposit!] @derivedFrom(field: "account")
}
type Resource @entity {
id: ID!
type: String!
tokens: [Token!] @derivedFrom(field: "resource")
}
type Token @entity @index(fields: ["tokenAddress", "domainID"], unique: true) {
id: ID!
decimals: Int!
tokenAddress: String!
tokenSymbol: String!
resource: Resource
resourceID: String
domain: Domain!
domainID: String
fee: [Fee!] @derivedFrom(field: "token")
}
type Domain @entity {
id: ID!
type: String!
name: String!
iconURL: String!
explorerURL: String!
routesFrom: [Route!] @derivedFrom(field: "fromDomain")
routesTo: [Route!] @derivedFrom(field: "toDomain")
token: [Token!] @derivedFrom(field: "domain")
}
type Fee @entity {
id: ID!
amount: String!
transferID: String
transfer: Transfer
token: Token
tokenID: String
}
type Route @entity @index(fields: ["fromDomainID", "toDomainID", "resourceID"], unique: true) {
id: ID!
fromDomainID: String
fromDomain: Domain
toDomainID: String
toDomain: Domain
resourceID: String
resource: Resource
transfers: [Transfer!] @derivedFrom(field: "route")
}