-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.graphql
160 lines (149 loc) · 3.77 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
type Domain @entity {
id: ID!
owner: Account
domainRegistrationOrders: [DomainRegistrationOrder!]
@derivedFrom(field: "domain")
createdAt: DateTime
createdAtBlock: Int
}
type Account @entity {
id: ID!
domains: [Domain!] @derivedFrom(field: "owner")
domainRegistrationOrders: [DomainRegistrationOrder!]
@derivedFrom(field: "target")
energyBoxes: [EnergyBox!] @derivedFrom(field: "owner")
}
type DomainRegistrationOrder @entity {
"Attempt ID from remark and it's the same value for all purchase, confirmation and refund(if it's existing) remarks"
id: ID!
createdAtBlock: Int!
createdAtTime: DateTime!
updatedAtBlock: Int
updatedAtTime: DateTime
blockHashSellerChain: String
blockHashUnameHostChain: String
confirmedBlockHashSellerChain: String
confirmedRemarkCallId: String
refundBlockHashSellerChain: String
refundRemarkCallId: String
target: Account!
domain: Domain!
price: BigInt
"TODO should be reviewed"
token: String!
purchaseTx: Transfer
refundTx: Transfer
status: OrderRequestStatus
refundStatus: OrderRefundStatus
purchaseRmrk: DmnRegRemark
confirmationRmrk: DmnRegRemark
refundRmrk: DmnRegRemark
errorRegistration: OrderError
errorRefund: OrderError
}
type EnergyBox @entity {
"Attempt ID from remark and it's the same value for all generation, confirmation and refund(if it's existing) remarks"
id: ID!
blockHashSellerChain: String
blockHashEnergyHostChain: String
energyAmount: BigInt!
boxPrice: BigInt!
"TODO should be reviewed"
token: String!
owner: Account
purchaseTx: Transfer
refundTx: Transfer
status: OrderRequestStatus
refundStatus: OrderRefundStatus
generationRmrk: NrgRemark
confirmationRmrk: NrgRemark
refundRmrk: NrgRemark
errorGeneration: OrderError
errorRefund: OrderError
}
type Transfer @entity {
id: ID!
blockHash: String!
extrinsicHash: String!
eventIndex: Int!
amount: BigInt!
token: String
from: Account!
to: Account!
addressChainPrefix: String
}
type DmnRegRemark {
protName: String!
version: String!
destination: String!
action: String!
content: DmnRegRemarkContent!
}
type DmnRegRemarkContent {
opId: String!
target: String!
domainName: String!
token: String!
}
type NrgRemark {
protName: String!
version: String!
destination: String!
action: String!
content: NrgRemarkContent!
}
type NrgRemarkContent {
opId: String!
target: String!
energyAmount: String!
token: String!
}
enum OrderRequestStatus {
"""
Processing of the Registration request has been stated and validations are passed or validation process is ongoing.
Orders with such status are subject to refund if indexer is already in chain head but order status is not changed
during long time (more than 20 blocks).
"""
Processing
"""
Registration request has been validated and domain is registered in blockchain but registration confirmation has not
been found yet. Refund for orders with such status is not needed as domain is registered so service is completed.
"""
InBlock
"""
Registration request has been validated, domain is registered in blockchain and proof remark (DMN_REG_OK) has been
found. Order is fulfilled and closed.
"""
Successful
"""
Registration request has been failed by vary of reasons. Refund is required.
"""
Failed
}
enum OrderRefundStatus {
"""
Order is processing or already fulfilled successfully without errors.
"""
None
"""
Order waits for refund because registration process has failed and order has `status: Failed`.
"""
Waiting
"""
Refund is successfully fulfilled.
"""
Fulfilled
"""
Refund is failed with error.
"""
Failed
}
type OrderError {
module: String
status: String
reason: String
}
type ProcessingState @entity {
id: ID!
domainRegRefundFullProcessingAtBlock: Int!
}