-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMetaDexa-API.html
386 lines (305 loc) · 21.3 KB
/
MetaDexa-API.html
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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
<!doctype html>
<html>
<head>
<title>MetaDexa API</title>
<style type="text/css">
body {
font-family: Trebuchet MS, sans-serif;
font-size: 15px;
color: #444;
margin-right: 24px;
}
h1 {
font-size: 25px;
}
h2 {
font-size: 20px;
}
h3 {
font-size: 16px;
font-weight: bold;
}
hr {
height: 1px;
border: 0;
color: #ddd;
background-color: #ddd;
}
.app-desc {
clear: both;
margin-left: 20px;
}
.param-name {
width: 100%;
}
.license-info {
margin-left: 20px;
}
.license-url {
margin-left: 20px;
}
.model {
margin: 0 0 0px 20px;
}
.method {
margin-left: 20px;
}
.method-notes {
margin: 10px 0 20px 0;
font-size: 90%;
color: #555;
}
pre {
padding: 10px;
margin-bottom: 2px;
}
.http-method {
text-transform: uppercase;
}
pre.get {
background-color: #0f6ab4;
}
pre.post {
background-color: #10a54a;
}
pre.put {
background-color: #c5862b;
}
pre.delete {
background-color: #a41e22;
}
.huge {
color: #fff;
}
pre.example {
background-color: #f3f3f3;
padding: 10px;
border: 1px solid #ddd;
}
code {
white-space: pre;
}
.nickname {
font-weight: bold;
}
.method-path {
font-size: 1.5em;
background-color: #0f6ab4;
}
.up {
float:right;
}
.parameter {
width: 500px;
}
.param {
width: 500px;
padding: 10px 0 0 20px;
font-weight: bold;
}
.param-desc {
width: 700px;
padding: 0 0 0 20px;
color: #777;
}
.param-type {
font-style: italic;
}
.param-enum-header {
width: 700px;
padding: 0 0 0 60px;
color: #777;
font-weight: bold;
}
.param-enum {
width: 700px;
padding: 0 0 0 80px;
color: #777;
font-style: italic;
}
.field-label {
padding: 0;
margin: 0;
clear: both;
}
.field-items {
padding: 0 0 15px 0;
margin-bottom: 15px;
}
.return-type {
clear: both;
padding-bottom: 10px;
}
.param-header {
font-weight: bold;
}
.method-tags {
text-align: right;
}
.method-tag {
background: none repeat scroll 0% 0% #24A600;
border-radius: 3px;
padding: 2px 10px;
margin: 2px;
color: #FFF;
display: inline-block;
text-decoration: none;
}
</style>
</head>
<body>
<h1>MetaDexa API</h1>
<div class="app-desc">MetaDexa - Trading API</div>
<div class="app-desc">More information: <a href="https://github.com/MetaDexa/metadexa-api">https://github.com/MetaDexa/metadexa-api</a></div>
<div class="app-desc">Version: 1.0</div>
<div class="license-info">All rights reserved</div>
<div class="license-url"><a href="https://api.metadexa.io">https://api.metadexa.io</a></div>
<h2><a name="__Methods">Methods</a></h2>
<h3>Table of Contents </h3>
<div class="method-summary"></div>
<h4><a href="#GetQuote">GetQuote</a></h4>
<ul>
<li><a href="#v10ChainIdGetQuoteGet"><code><span class="http-method">get</span> /v1.0/{chainId}/getQuote</code></a></li>
</ul>
<h4><a href="#GetGaslessQuote">GetGaslessQuote</a></h4>
<ul>
<li><a href="#v10ChainIdGetGaslessQuoteGet"><code><span class="http-method">get</span> /v1.0/{chainId}/getGaslessQuote</code></a></li>
</ul>
<h1><a name="GetQuote">GetQuote</a></h1>
<div class="method"><a name="v10ChainIdGetQuoteGet"></a>
<div class="method-path">
<a class="up" href="#__Methods">Up</a>
<pre class="get"><code class="huge"><span class="http-method">get</span> /v1.0/{chainId}/getQuote</code></pre></div>
<div class="method-notes">Fetches the best aggregated quotes for given trading pair</div>
<h3 class="field-label">Path parameters</h3>
<div class="field-items">
<div class="param">chainId (required)</div>
<div class="param-desc"><span class="param-type">Path Parameter</span> — </div> </div> <!-- field-items -->
<h3 class="field-label">Query parameters</h3>
<div class="field-items">
<div class="param">buyTokenAddress (required)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — </div> <div class="param">skipValidation (required)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — </div> <div class="param">sellTokenAmount (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — Add one of (sellTokenAmount, buyTokenAmount) </div> <div class="param">buyTokenAmount (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — Add one of (sellTokenAmount, buyTokenAmount) </div> <div class="param">fromAddress (required)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — </div> <div class="param">sellTokenAddress (required)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — </div> <div class="param">slippage (required)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — Price slippage you are willing to accept, may be set with decimals. <br>(e.g. slippage=<strong>0.005</strong> means <strong>0.5%</strong> slippage is acceptable</strong>; slippage=<strong>0.01</strong> means <strong>1%</strong> slippage is acceptable, etc.) </div> <div class="param">recipient (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — ETH address </div> <div class="param">affiliate (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — The ETH address that should receive affiliate fees (if specified) </div> <div class="param">affiliateFee (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — This percentage of (sellTokenAddress(1inch) / buyTokenAddress (0x)) token amount will be sent to affiliate, the rest will be used as for the swap. (e.g. affiliateFee=<strong>0.5</strong> equals <strong>0.5%</strong>) </div> <div class="param">signaturePermitData (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — </div> </div> <!-- field-items -->
<h3 class="field-label">Return type</h3>
<div class="return-type">
Object
</div>
<!--Todo: process Response Object and its headers, schema, examples -->
<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: application/json</div>
<pre class="example"><code>{
"estimatedGas" : 531962,
"buyTokenAddress" : "0x14af1f2f02dccb1e43402339099a05a5e363b83c",
"buyAmount" : "153047124858823786407",
"sellTokenAddress" : "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"sellAmount" : "10000000",
"allowanceTarget" : "0x6afD834f6e3D5ad5A83E7838ca45F3DBDe3E323d",
}</code></pre>
<h3 class="field-label">Produces</h3>
This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="header">Content-Type</span> response header.
<ul>
<li><code>application/json; charset=utf-8</code></li>
</ul>
<h3 class="field-label">Responses</h3>
<h4 class="field-label">200</h4>
Returns the best aggregated quotes for given trading pair
<pre class="example"><code>{
"estimatedGas": "317950",
"buyTokenAddress": "0x14af1f2f02dccb1e43402339099a05a5e363b83c",
"buyAmount": "153526728217882460000",
"sellTokenAddress": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"sellAmount": "10000000",
"allowanceTarget": "0x6afD834f6e3D5ad5A83E7838ca45F3DBDe3E323d"
}</code></pre>
</div> <!-- method -->
<hr/>
<h1><a name="GetGaslessQuote">GetGaslessQuote</a></h1>
<div class="method"><a name="v10ChainIdGetGaslessQuoteGet"></a>
<div class="method-path">
<a class="up" href="#__Methods">Up</a>
<pre class="get"><code class="huge"><span class="http-method">get</span> /v1.0/{chainId}/getGaslessQuote</code></pre></div>
<div class="method-notes">Fetches the best Gasless aggregated quotes for given trading pair</div>
<h3 class="field-label">Path parameters</h3>
<div class="field-items">
<div class="param">chainId (required)</div>
<div class="param-desc"><span class="param-type">Path Parameter</span> — </div> </div> <!-- field-items -->
<h3 class="field-label">Query parameters</h3>
<div class="field-items">
<div class="param">buyTokenAddress (required)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — </div> <div class="param">skipValidation (required)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — </div> <div class="param">sellTokenAmount (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — Add one of (sellTokenAmount, buyTokenAmount) </div> <div class="param">buyTokenAmount (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — Add one of (sellTokenAmount, buyTokenAmount) </div> <div class="param">fromAddress (required)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — </div> <div class="param">sellTokenAddress (required)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — </div> <div class="param">slippage (required)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — Price slippage you are willing to accept, may be set with decimals. <br>(e.g. slippage=<strong>0.005</strong> means <strong>0.5%</strong> slippage is acceptable</strong>; slippage=<strong>0.01</strong> means <strong>1%</strong> slippage is acceptable, etc.) </div> <div class="param">recipient (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — ETH address </div> <div class="param">affiliate (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — The ETH address that should receive affiliate fees (if specified) </div> <div class="param">affiliateFee (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — This percentage of (sellTokenAddress(1inch) / buyTokenAddress (0x)) token amount will be sent to affiliate, the rest will be used as for the swap. (e.g. affiliateFee=<strong>0.5</strong> equals <strong>0.5%</strong>) </div> <div class="param">signaturePermitData (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> — </div> </div> <!-- field-items -->
<h3 class="field-label">Return type</h3>
<div class="return-type">
Object
</div>
<!--Todo: process Response Object and its headers, schema, examples -->
<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: application/json</div>
<pre class="example"><code>{
"estimatedGas": 240000,
"paymentTokenAddress": "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270",
"paymentFees": "0",
"buyTokenAddress": "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270",
"buyAmount": "63179691357410456145",
"sellTokenAddress": "0x14af1f2f02dccb1e43402339099a05a5e363b83c",
"sellAmount": "1000000000000000000000",
"allowanceTarget": "0x6afD834f6e3D5ad5A83E7838ca45F3DBDe3E323d",
"tx": {
"from": "0x252ca143428929B2A351888ab14634629a9CF216",
"to": "0x316766609569e00c3484fE9e558A35b975064a62",
"data": "0xf08a8de4000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000006a0000000000000000000000000252ca143428929b2a351888ab14634629a9cf2160000000000000000000000006afd834f6e3d5ad5a83e7838ca45f3dbde3e323d0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000186a60f963500000000000000000000000000000000000000000000000000000186a6066e750000000000000000000000000000000000000000000000000000000000000524e79f303b00000000000000000000000014af1f2f02dccb1e43402339099a05a5e363b83c00000000000000000000000000000000000000000000000000000000000007d00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000b4761736c657373537761700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000014af1f2f02dccb1e43402339099a05a5e363b83c000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000000000007d00000000000000000000000000000000000000000000000000000000000000054000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000252ca143428929b2a351888ab14634629a9cf2160000000000000000000000001111111254fb6c44bac0bed2854e76f90643097d000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002887c025200000000000000000000000000b97cd69145e5a9357b2acd6af6c5076380f17afb0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000018000000000000000000000000014af1f2f02dccb1e43402339099a05a5e363b83c000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000b97cd69145e5a9357b2acd6af6c5076380f17afb000000000000000000000000ddbe6efb0d5a2bf9aba843290d7a69f4db03bfdd00000000000000000000000000000000000000000000000000000000000007d0000000000000000000000000000000000000000000000000000000000000005300000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000df0000000000000000000000000000000000000000000000a100008b00004f02a00000000000000000000000000000000000000000000000000000000000000053ee63c1e500ba589ba3af52975a12acc6de69c9ab3ac1ae780414af1f2f02dccb1e43402339099a05a5e363b83c41010d500b1d8e8ef31e21c99d1db9a6444d3adf127000042e1a7d4d0000000000000000000000000000000000000000000000000000000000000000c0611111111254fb6c44bac0bed2854e76f90643097d00000000000000000000000000000000000000000000000000000000000007d000cfee7c08000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041e2c5ef7a9396280b1863a8174d24a36ad663e01b4300f41bf0abf06fb8adc3de2410991d920ab77ac62fe0516a3980ffef728911f818a867c65bc69862c941301c00000000000000000000000000000000000000000000000000000000000000",
"gas": 315000,
"value": "0",
"gasPrice": "124324285671"
}
}</code></pre>
<h3 class="field-label">Produces</h3>
This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="header">Content-Type</span> response header.
<ul>
<li><code>application/json; charset=utf-8</code></li>
</ul>
<h3 class="field-label">Responses</h3>
<h4 class="field-label">200</h4>
Returns the best Gasless aggregated quotes for given trading pair
<pre class="example"><code>{
"estimatedGas": 0,
"paymentTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"paymentFees": "0",
"buyTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"buyAmount": "84",
"sellTokenAddress": "0x14af1f2f02dccb1e43402339099a05a5e363b83c",
"sellAmount": "2000",
"allowanceTarget": "0x6afD834f6e3D5ad5A83E7838ca45F3DBDe3E323d",
"tx": {
"from": "0x252ca143428929B2A351888ab14634629a9CF216",
"to": "0x316766609569e00c3484fE9e558A35b975064a62",
"data": "0xf08a8de400000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000720000000000000000000000000252ca143428929b2a351888ab14634629a9cf2160000000000000000000000006afd834f6e3d5ad5a83e7838ca45f3dbde3e323d0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000186a631ad1100000000000000000000000000000000000000000000000000000186a628855100000000000000000000000000000000000000000000000000000000000005a4e79f303b00000000000000000000000014af1f2f02dccb1e43402339099a05a5e363b83c00000000000000000000000000000000000000000000000000000000000007d0000000000000000000000000be188d6641e8b680743a4815dfa0f6208038960f000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000b4761736c657373537761700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000000000000002000000000000000000000000014af1f2f02dccb1e43402339099a05a5e363b83c000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000000000007d00000000000000000000000000000000000000000000000000000000000000054000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000252ca143428929b2a351888ab14634629a9cf2160000000000000000000000001111111254fb6c44bac0bed2854e76f90643097d000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000003087c025200000000000000000000000000b97cd69145e5a9357b2acd6af6c5076380f17afb0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000018000000000000000000000000014af1f2f02dccb1e43402339099a05a5e363b83c000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000b97cd69145e5a9357b2acd6af6c5076380f17afb000000000000000000000000ddbe6efb0d5a2bf9aba843290d7a69f4db03bfdd00000000000000000000000000000000000000000000000000000000000007d0000000000000000000000000000000000000000000000000000000000000005300000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001470000000000000000000000000000000001090000f30000b700006800004e80206c4eca2714af1f2f02dccb1e43402339099a05a5e363b83cbe188d6641e8b680743a4815dfa0f6208038960f000000000000000000000000000000000000000000000000000000000000000a0020d6bdbf7814af1f2f02dccb1e43402339099a05a5e363b83c02a00000000000000000000000000000000000000000000000000000000000000053ee63c1e500ba589ba3af52975a12acc6de69c9ab3ac1ae780414af1f2f02dccb1e43402339099a05a5e363b83c41010d500b1d8e8ef31e21c99d1db9a6444d3adf127000042e1a7d4d0000000000000000000000000000000000000000000000000000000000000000c0611111111254fb6c44bac0bed2854e76f90643097d00000000000000000000000000000000000000000000000000000000000007d000000000000000000000000000000000000000000000000000cfee7c08000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041f160d71b5b9f5407afef1f2e164e2bbc8b34dc125184869e1acdb0c473cb560e6343df006eb396453e38a2647f2d2b23fd7b99267736d2fe75e4aff71108436d1b00000000000000000000000000000000000000000000000000000000000000",
"gas": 380767,
"value": "0",
"gasPrice": "124632630482"
}
}</code></pre>
</div> <!-- method -->
<hr/>
</body>
</html>