-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopenapi.yaml
320 lines (309 loc) · 10.5 KB
/
openapi.yaml
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
openapi: 3.0.3
info:
title: MVC Bridge API Spec
description: API definition for Mvc Bridge provided apis
version: 1.0.12
license:
name: MIT License
url: https://opensource.org/licenses/MIT
contact:
email: [email protected]
name: MVC Bridge team
servers:
- url: 'https://testnet.mvcbridge.com'
- url: 'https://mainnet.mvcbridge.com'
tags:
- name: vault
description: Vault is the place you send your assets to or receive your assets from.
- name: order
description: bridge order related api
paths:
/vault/{chainName}/{tokenName}/info:
get:
tags:
- vault
summary: Get the vault info for the token.
parameters:
- name: chainName
in: path
description: The public chain of your source address(mvc eth tron bsc ...)
required: true
schema:
type: string
- name: tokenName
in: path
description: The token name you sent(usdt usdc ...)
required: true
schema:
type: string
responses:
'200':
description: Result of your vault info.
content:
application/json:
schema:
$ref: '#/components/schemas/VaultInfoResponse'
/order/{fromChain}/{fromTokenName}/{address}/pending:
get:
tags:
- order
summary: Get the deposits waiting for request or not processed yet.
parameters:
- name: fromChain
in: path
description: The public chain of your source address(mvc eth tron bsc ...)
required: true
schema:
type: string
- name: fromTokenName
in: path
description: The token name you sent(usdt usdc ...)
required: true
schema:
type: string
- name: address
in: path
description: The address from which you send your tx. Must be valid source in the transaction.
required: true
schema:
type: string
- name: targetChain
in: query
description: (optional) filter result by target chain.
required: false
schema:
type: string
- name: targetTokenName
in: query
description: (optional) filter result by target token name.
required: false
schema:
type: string
responses:
'200':
description: Result of your orders waiting for request.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/OrderPending'
/order/{fromChain}/{fromTokenName}/{address}/finalized:
get:
tags:
- order
summary: Get the deposits waiting for request.
parameters:
- name: fromChain
in: path
description: The public chain of your source address(mvc eth tron bsc ...)
required: true
schema:
type: string
- name: fromTokenName
in: path
description: The token name you sent(usdt usdc ...)
required: true
schema:
type: string
- name: address
in: path
description: The address from which you send your tx. Must be valid source in the transaction.
required: true
schema:
type: string
- name: targetChain
in: query
description: (optional) filter result by target chain.
required: false
schema:
type: string
- name: targetTokenName
in: query
description: (optional) filter result by target token name.
required: false
schema:
type: string
responses:
'200':
description: Result of your orders waiting for request.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/OrderFinalized'
/order/register:
post:
tags:
- order
summary: Register a new order to the bridge.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OrderRegisterRequest'
responses:
'200':
description: Result of your order registration.
content:
application/json:
schema:
$ref: '#/components/schemas/OrderRegisterResp'
components:
securitySchemes:
# arbitrary name for the security scheme
bearerAuth:
type: http
scheme: bearer
# optional, arbitrary value for documentation purposes
bearerFormat: JWT
schemas:
UnauthorizedError:
description: Access token is missing or invalid
VaultInfoResponse:
type: object
description: The vault info for the token.
properties:
address:
description: The deposit address for the vault.
type: string
chain:
description: The public chain of your source address(mvc eth tron bsc ...)
type: string
tokenName:
description: The token name you sent(usdt usdc ...)
type: string
decimal:
description: The decimal of the token.
type: integer
depositMinAmount:
description: The minimum amount of the token to deposit, if deposit amount is lower than this, it will not be processed.
type: integer
format: int64
depositConfirmation:
description: The confirmation needed for the deposit transaction.
type: integer
withdrawGasFee:
description: Gas fee to cover onchain transfer. AmountYouReceive = amountYouSent - withdrawGasFee - withdrawBridgeFeeRate * amountYouSend - withdrawBridgeFeeFixed
type: integer
format: int64
withdrawBridgeFeeRate:
description: The service fee rate of bridge. AmountYouReceive = amountYouSent - withdrawGasFee - withdrawBridgeFeeRate * amountYouSend - withdrawBridgeFeeFixed
type: string
withdrawBridgeFeeFixed:
description: The service fee fixed amount of bridge. AmountYouReceive = amountYouSent - withdrawGasFee - withdrawBridgeFeeRate * amountYouSend - withdrawBridgeFeeFixed
type: integer
format: int64
OrderRegisterRequest:
type: object
description: Register a bridging request.
properties:
fromChain:
description: The public chain of your source address(mvc eth tron bsc ...)
type: string
fromTokenName:
description: The token name you sent(usdt usdc ...)
type: string
txid:
description: The transaction of your sending request. Must be found on the blockchain to proceed.
type: string
amount:
description: Amount you send, use String for large values.
type: string
fromAddress:
description: The address from which you send your tx. Must be valid source in the transaction.
type: string
toChain:
description: The public chain you want to bridge your asset to (mvc eth tron bsc ...).
type: string
toTokenName:
description: The token name you want to receive(usdt usdc ...)
type: string
toAddress:
description: The address you want to bridge your asset to.
type: string
signature:
description: The signature indicating you are the owner of fromAddress.
type: string
OrderRegisterResp:
type: object
properties:
orderTxid:
type: string
description: The txid of your request.
success:
type: boolean
description: True if registered successful.
message:
type: string
description: The reason of your failed request.
OrderPending:
type: object
description: The deposits waiting for request to confirm target.
properties:
vaultId:
type: string
description: The vault id of your request.
txid:
type: string
description: The txid of your request.
fromAddress:
type: string
description: The address from which you send your tx. Must be valid source in the transaction.
fromAmount:
type: string
description: Amount you sent, use String for large values.
state:
type: string
description: State of your order(WAITING_REQUEST, CONFIRMING, PROCESSING).
targetVaultId:
type: string
description: The vault id of your target request.
toAddress:
type: string
description: The address you want to bridge your asset to.
targetAmount:
type: string
description: Amount you can receive after the fee, use String for large values.
confirmationRequired:
type: integer
description: The confirmation needed for the deposit transaction.
currentConfirmation:
type: integer
description: The current confirmation of the deposit transaction.
OrderFinalized:
type: object
description: The deposits waiting for request to confirm target.
properties:
vaultId:
type: string
description: The vault id of your request.
txid:
type: string
description: The txid of your request.
finalizedTimestamp:
type: integer
format: int64
description: The time when your request finalize.
fromAddress:
type: string
description: The address from which you send your tx. Must be valid source in the transaction.
fromAmount:
type: string
description: Amount you sent, use String for large values.
state:
type: string
description: State of your order(SUCCESS, DROPPED, MINIMUM_NOT_MET).
targetVaultId:
type: string
description: The vault id of your target request.
toAddress:
type: string
description: The address you want to bridge your asset to.
targetAmount:
type: string
description: Amount you can receive after the fee, use String for large values.
processTxid:
type: string
description: The txid of the transaction that processed your request.