max_exchange_api 1.4.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -2
- data/CHANGELOG.md +11 -0
- data/README.md +15 -703
- data/docs/README.api_v2.md +610 -0
- data/docs/README.api_v3.md +759 -0
- data/lib/max_exchange_api/helper.rb +7 -2
- data/lib/max_exchange_api/private_api.rb +3 -1
- data/lib/max_exchange_api/private_v2/account_api.rb +15 -0
- data/lib/max_exchange_api/private_v2/deposit_api.rb +75 -0
- data/lib/max_exchange_api/private_v2/internal_transfer_api.rb +26 -0
- data/lib/max_exchange_api/private_v2/order_api.rb +55 -0
- data/lib/max_exchange_api/private_v2/reward_api.rb +40 -0
- data/lib/max_exchange_api/private_v2/trade_api.rb +28 -0
- data/lib/max_exchange_api/private_v2/user_api.rb +19 -0
- data/lib/max_exchange_api/private_v2/withdraw_api.rb +42 -0
- data/lib/max_exchange_api/private_v2_api.rb +16 -214
- data/lib/max_exchange_api/private_v3/account_api.rb +15 -0
- data/lib/max_exchange_api/private_v3/convert_api.rb +29 -0
- data/lib/max_exchange_api/private_v3/deposit_api.rb +26 -0
- data/lib/max_exchange_api/private_v3/internal_transfer_api.rb +19 -0
- data/lib/max_exchange_api/private_v3/m_wallet_api.rb +76 -0
- data/lib/max_exchange_api/private_v3/order_api.rb +82 -0
- data/lib/max_exchange_api/private_v3/reward_api.rb +19 -0
- data/lib/max_exchange_api/private_v3/sub_account_api.rb +31 -0
- data/lib/max_exchange_api/private_v3/trade_api.rb +27 -0
- data/lib/max_exchange_api/private_v3/user_api.rb +11 -0
- data/lib/max_exchange_api/private_v3/withdraw_api.rb +35 -0
- data/lib/max_exchange_api/private_v3_api.rb +23 -0
- data/lib/max_exchange_api/public_api.rb +13 -14
- data/lib/max_exchange_api/public_v2_api.rb +65 -66
- data/lib/max_exchange_api/public_v3_api.rb +56 -0
- data/lib/max_exchange_api/version.rb +1 -1
- metadata +24 -3
data/README.md
CHANGED
|
@@ -9,14 +9,22 @@
|
|
|
9
9
|
A ruby implementation of MAX exchange API
|
|
10
10
|
|
|
11
11
|
* REST API V2
|
|
12
|
+
* REST API V3
|
|
12
13
|
* Websocket API
|
|
13
14
|
|
|
14
|
-
##
|
|
15
|
-
|
|
16
|
-
* [REST API Introduction](https://max.maicoin.com/documents/api_v2)
|
|
17
|
-
* [REST API End Points](https://max.maicoin.com/documents/api_list)
|
|
18
|
-
* [WebSocket API Documentation](https://maicoin.github.io/max-websocket-docs/)
|
|
15
|
+
## Table of contents
|
|
19
16
|
|
|
17
|
+
<!-- TOC -->
|
|
18
|
+
* [MAX Exchange API Ruby SDK](#max-exchange-api-ruby-sdk)
|
|
19
|
+
* [Documentations](#documentations)
|
|
20
|
+
* [Supports](#supports)
|
|
21
|
+
* [Table of contents](#table-of-contents)
|
|
22
|
+
* [Installation](#installation)
|
|
23
|
+
* [Usage](#usage)
|
|
24
|
+
* [Development](#development)
|
|
25
|
+
* [Contributing](#contributing)
|
|
26
|
+
* [License](#license)
|
|
27
|
+
<!-- TOC -->
|
|
20
28
|
|
|
21
29
|
## Supports
|
|
22
30
|
- Ruby 2.2 ~ 2.7, 3.0 ~ 3.3
|
|
@@ -35,706 +43,10 @@ Or install it yourself as:
|
|
|
35
43
|
|
|
36
44
|
$ gem install max_exchange_api
|
|
37
45
|
|
|
38
|
-
## Configuration
|
|
39
|
-
|
|
40
|
-
### Set timeout time
|
|
41
|
-
|
|
42
|
-
```rb
|
|
43
|
-
# Set default timeout time
|
|
44
|
-
MaxExchangeApi.default_config.timeout = 3 # seconds
|
|
45
|
-
|
|
46
|
-
# Create an api instance with custom timeout time
|
|
47
|
-
api = MaxExchangeApi::PublicApi.new(config: { timeout: 12 })
|
|
48
|
-
api = MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { timeout: 12 })
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Logging
|
|
52
|
-
|
|
53
|
-
```rb
|
|
54
|
-
require 'logger'
|
|
55
|
-
|
|
56
|
-
# Print log to standard output
|
|
57
|
-
MaxExchangeApi.default_config.logger = Logger.new(STDOUT)
|
|
58
|
-
|
|
59
|
-
# Print log to file
|
|
60
|
-
MaxExchangeApi.default_config.logger = Logger.new('log/api.log')
|
|
61
|
-
|
|
62
|
-
# Create an api instance with custom logger
|
|
63
|
-
api = MaxExchangeApi::PublicApi.new(config: { logger: Logger.new(STDOUT) })
|
|
64
|
-
api = MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: Logger.new(STDOUT) })
|
|
65
|
-
```
|
|
66
|
-
|
|
67
46
|
## Usage
|
|
68
47
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
```rb
|
|
72
|
-
@api_v2 = MaxExchangeApi::PublicV2Api.new
|
|
73
|
-
@api_v3 = MaxExchangeApi::PublicV3Api.new
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
#### [GET /api/v2/vip_levels](https://max.maicoin.com/documents/api_list#!/public/getApiV2VipLevels)
|
|
77
|
-
|
|
78
|
-
> Get all VIP level fees.
|
|
79
|
-
|
|
80
|
-
<details>
|
|
81
|
-
<summary>Show code</summary>
|
|
82
|
-
|
|
83
|
-
```rb
|
|
84
|
-
@api_v2vip_levels
|
|
85
|
-
```
|
|
86
|
-
</details>
|
|
87
|
-
|
|
88
|
-
#### [GET /api/v2/vip_levels/{level}](https://max.maicoin.com/documents/api_list#!/public/getApiV2VipLevelsLevel)
|
|
89
|
-
|
|
90
|
-
> Get VIP level fee by level.
|
|
91
|
-
|
|
92
|
-
<details>
|
|
93
|
-
<summary>Show code</summary>
|
|
94
|
-
|
|
95
|
-
```rb
|
|
96
|
-
@api_v2vip_levels(2)
|
|
97
|
-
```
|
|
98
|
-
</details>
|
|
99
|
-
|
|
100
|
-
#### [GET /api/v2/currencies](https://max.maicoin.com/documents/api_list#!/public/getApiV2Currencies)
|
|
101
|
-
|
|
102
|
-
> Get all available currencies.
|
|
103
|
-
|
|
104
|
-
<details>
|
|
105
|
-
<summary>Show code</summary>
|
|
106
|
-
|
|
107
|
-
```rb
|
|
108
|
-
@api_v2currencies
|
|
109
|
-
```
|
|
110
|
-
</details>
|
|
111
|
-
|
|
112
|
-
#### [GET /api/v2/k](https://max.maicoin.com/documents/api_list#!/public/getApiV2K)
|
|
113
|
-
|
|
114
|
-
> Get OHLC(k line) of a specific market.
|
|
115
|
-
|
|
116
|
-
<details>
|
|
117
|
-
<summary>Show code</summary>
|
|
118
|
-
|
|
119
|
-
```rb
|
|
120
|
-
# use default parameters
|
|
121
|
-
@api_v2k('btctwd')
|
|
122
|
-
|
|
123
|
-
# provide all possible parameters
|
|
124
|
-
@api_v2k('btctwd', limit: 30, period: 1, timestamp: 1624705402)
|
|
125
|
-
```
|
|
126
|
-
</details>
|
|
127
|
-
|
|
128
|
-
#### [GET /api/v2/depth](https://max.maicoin.com/documents/api_list#!/public/getApiV2Depth)
|
|
129
|
-
|
|
130
|
-
> Get depth of a specified market.
|
|
131
|
-
|
|
132
|
-
<details>
|
|
133
|
-
<summary>Show code</summary>
|
|
134
|
-
|
|
135
|
-
```rb
|
|
136
|
-
# use default parameters
|
|
137
|
-
@api_v2depth('maxtwd')
|
|
138
|
-
|
|
139
|
-
# provide all possible parameters
|
|
140
|
-
@api_v2depth('maxtwd', limit: 10, sort_by_price: true)
|
|
141
|
-
```
|
|
142
|
-
</details>
|
|
143
|
-
|
|
144
|
-
#### [GET /api/v2/trades](https://max.maicoin.com/documents/api_list#!/public/getApiV2Trades)
|
|
145
|
-
|
|
146
|
-
> Get recent trades on market, sorted in reverse creation order.
|
|
147
|
-
|
|
148
|
-
<details>
|
|
149
|
-
<summary>Show code</summary>
|
|
150
|
-
|
|
151
|
-
```rb
|
|
152
|
-
# use default parameters
|
|
153
|
-
@api_v2trades('btctwd')
|
|
154
|
-
|
|
155
|
-
# provide all possible parameters
|
|
156
|
-
@api_v2trades(
|
|
157
|
-
'maxtwd',
|
|
158
|
-
timestamp: 1624705402,
|
|
159
|
-
from: 68444,
|
|
160
|
-
to: 69444,
|
|
161
|
-
order_by: 'asc',
|
|
162
|
-
pagination: true,
|
|
163
|
-
page: 3,
|
|
164
|
-
limit: 15,
|
|
165
|
-
offset: 5,
|
|
166
|
-
)
|
|
167
|
-
```
|
|
168
|
-
</details>
|
|
169
|
-
|
|
170
|
-
#### [GET /api/v2/markets](https://max.maicoin.com/documents/api_list#!/public/getApiV2Markets)
|
|
171
|
-
|
|
172
|
-
> Get all available markets.
|
|
173
|
-
|
|
174
|
-
<details>
|
|
175
|
-
<summary>Show code</summary>
|
|
176
|
-
|
|
177
|
-
```rb
|
|
178
|
-
@api_v2markets
|
|
179
|
-
```
|
|
180
|
-
</details>
|
|
181
|
-
|
|
182
|
-
#### [GET /api/v2/summary](https://max.maicoin.com/documents/api_list#!/public/getApiV2Summary)
|
|
183
|
-
|
|
184
|
-
> Overview of market data for all tickers.
|
|
185
|
-
|
|
186
|
-
<details>
|
|
187
|
-
<summary>Show code</summary>
|
|
188
|
-
|
|
189
|
-
```rb
|
|
190
|
-
@api_v2summary
|
|
191
|
-
```
|
|
192
|
-
</details>
|
|
193
|
-
|
|
194
|
-
#### [GET /api/v2/tickers/{path_market}](https://max.maicoin.com/documents/api_list#!/public/getApiV2TickersPathMarket)
|
|
195
|
-
|
|
196
|
-
> Get ticker of specific market.
|
|
197
|
-
|
|
198
|
-
<details>
|
|
199
|
-
<summary>Show code</summary>
|
|
200
|
-
|
|
201
|
-
```rb
|
|
202
|
-
@api_v2tickers('btctwd')
|
|
203
|
-
```
|
|
204
|
-
</details>
|
|
205
|
-
|
|
206
|
-
#### [GET /api/v2/tickers](https://max.maicoin.com/documents/api_list#!/public/getApiV2Tickers)
|
|
207
|
-
|
|
208
|
-
> Get ticker of all markets.
|
|
209
|
-
|
|
210
|
-
<details>
|
|
211
|
-
<summary>Show code</summary>
|
|
212
|
-
|
|
213
|
-
```rb
|
|
214
|
-
@api_v2tickers
|
|
215
|
-
```
|
|
216
|
-
</details>
|
|
217
|
-
|
|
218
|
-
#### [GET /api/v2/timestamp](https://max.maicoin.com/documents/api_list#!/public/getApiV2Timestamp)
|
|
219
|
-
|
|
220
|
-
> Get server current time, in seconds since Unix epoch.
|
|
221
|
-
|
|
222
|
-
<details>
|
|
223
|
-
<summary>Show code</summary>
|
|
224
|
-
|
|
225
|
-
```rb
|
|
226
|
-
@api_v2timestamp
|
|
227
|
-
```
|
|
228
|
-
</details>
|
|
229
|
-
|
|
230
|
-
#### [GET /api/v3/wallet/m/limits](https://max.maicoin.com/documents/api_list/v3#tag/Public/operation/getApiV3WalletMLimits)
|
|
231
|
-
|
|
232
|
-
> Get total available loan amount
|
|
233
|
-
|
|
234
|
-
<details>
|
|
235
|
-
<summary>Show code</summary>
|
|
236
|
-
|
|
237
|
-
```rb
|
|
238
|
-
@api_v3.available_loan_amount
|
|
239
|
-
```
|
|
240
|
-
</details>
|
|
241
|
-
|
|
242
|
-
---
|
|
243
|
-
|
|
244
|
-
### Private Api Examples
|
|
245
|
-
|
|
246
|
-
```rb
|
|
247
|
-
access_key = 'YOUR_ACCESS_KEY'
|
|
248
|
-
secret_key = 'YOUR_SECRET_KEY'
|
|
249
|
-
|
|
250
|
-
@api_v2 = MaxExchangeApi::PrivateV2Api.new(access_key, secret_key)
|
|
251
|
-
@api_v3 = MaxExchangeApi::PrivateV3Api.new(access_key, secret_key)
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
### Trade
|
|
255
|
-
#### [GET /api/v2/trades/my/of_order](https://max.maicoin.com/documents/api_list#!/private/getApiV2TradesMyOfOrder)
|
|
256
|
-
|
|
257
|
-
> get your executed trades related to a order
|
|
258
|
-
|
|
259
|
-
<details>
|
|
260
|
-
<summary>Show code</summary>
|
|
261
|
-
|
|
262
|
-
```rb
|
|
263
|
-
# use max unique order id
|
|
264
|
-
@api_v2my_trades_of_order(123456)
|
|
265
|
-
|
|
266
|
-
# use user specified order id
|
|
267
|
-
@api_v2my_trades_of_order('MY_ORDER_123456', use_client_id: true)
|
|
268
|
-
```
|
|
269
|
-
</details>
|
|
270
|
-
|
|
271
|
-
#### [GET /api/v2/trades/my](https://max.maicoin.com/documents/api_list#!/private/getApiV2TradesMy)
|
|
272
|
-
|
|
273
|
-
> get your executed trades, sorted in reverse creation order
|
|
274
|
-
|
|
275
|
-
<details>
|
|
276
|
-
<summary>Show code</summary>
|
|
277
|
-
|
|
278
|
-
```rb
|
|
279
|
-
# use default parameters
|
|
280
|
-
@api_v2my_trades('btctwd')
|
|
281
|
-
|
|
282
|
-
# provide all possible parameters
|
|
283
|
-
@api_v2my_trades(
|
|
284
|
-
'maxtwd',
|
|
285
|
-
timestamp: 1624705402,
|
|
286
|
-
from: 68444,
|
|
287
|
-
to: 69444,
|
|
288
|
-
order_by: 'asc',
|
|
289
|
-
pagination: true,
|
|
290
|
-
page: 3,
|
|
291
|
-
limit: 15,
|
|
292
|
-
offset: 5,
|
|
293
|
-
)
|
|
294
|
-
```
|
|
295
|
-
</details>
|
|
296
|
-
|
|
297
|
-
### Withdrawal
|
|
298
|
-
#### [GET /api/v2/withdrawals](https://max.maicoin.com/documents/api_list#!/private/getApiV2Withdrawals)
|
|
299
|
-
|
|
300
|
-
> get your external withdrawals history
|
|
301
|
-
|
|
302
|
-
<details>
|
|
303
|
-
<summary>Show code</summary>
|
|
304
|
-
|
|
305
|
-
```rb
|
|
306
|
-
# use default parameters
|
|
307
|
-
@api_v2withdrawals('max')
|
|
308
|
-
|
|
309
|
-
# provide all possible parameters
|
|
310
|
-
@api_v2withdrawals(
|
|
311
|
-
'max',
|
|
312
|
-
'confirmed',
|
|
313
|
-
from: 68444,
|
|
314
|
-
to: 69444,
|
|
315
|
-
state: 'confirmed',
|
|
316
|
-
pagination: true,
|
|
317
|
-
page: 3,
|
|
318
|
-
limit: 15,
|
|
319
|
-
offset: 5,
|
|
320
|
-
)
|
|
321
|
-
```
|
|
322
|
-
</details>
|
|
323
|
-
|
|
324
|
-
#### [GET /api/v2/withdrawal](https://max.maicoin.com/documents/api_list#!/private/getApiV2Withdrawal)
|
|
325
|
-
|
|
326
|
-
> get details of a specific external withdraw
|
|
327
|
-
|
|
328
|
-
<details>
|
|
329
|
-
<summary>Show code</summary>
|
|
330
|
-
|
|
331
|
-
```rb
|
|
332
|
-
@api_v2withdrawal('withdraw_id')
|
|
333
|
-
```
|
|
334
|
-
</details>
|
|
335
|
-
|
|
336
|
-
#### [POST /api/v2/withdrawal](https://max.maicoin.com/documents/api_list#!/private/postApiV2Withdrawal)
|
|
337
|
-
|
|
338
|
-
> submit a withdrawal. IP whitelist for api token is required.
|
|
339
|
-
|
|
340
|
-
<details>
|
|
341
|
-
<summary>Show code</summary>
|
|
342
|
-
|
|
343
|
-
```rb
|
|
344
|
-
@api_v2create_withdrawal!('twd', 'withdraw_address_id', 100000)
|
|
345
|
-
```
|
|
346
|
-
</details>
|
|
347
|
-
|
|
348
|
-
### Profile
|
|
349
|
-
#### [GET /api/v2/members/profile](https://max.maicoin.com/documents/api_list#!/private/getApiV2MembersProfile)
|
|
350
|
-
|
|
351
|
-
> get personal profile information
|
|
352
|
-
|
|
353
|
-
<details>
|
|
354
|
-
<summary>Show code</summary>
|
|
355
|
-
|
|
356
|
-
```rb
|
|
357
|
-
@api_v2member_profile
|
|
358
|
-
```
|
|
359
|
-
</details>
|
|
360
|
-
|
|
361
|
-
#### [GET /api/v2/members/me](https://max.maicoin.com/documents/api_list#!/private/getApiV2MembersMe)
|
|
362
|
-
|
|
363
|
-
> get your profile and accounts information
|
|
364
|
-
|
|
365
|
-
<details>
|
|
366
|
-
<summary>Show code</summary>
|
|
367
|
-
|
|
368
|
-
```rb
|
|
369
|
-
@api_v2me
|
|
370
|
-
```
|
|
371
|
-
</details>
|
|
372
|
-
|
|
373
|
-
#### [GET /api/v2/members/vip_level](https://max.maicoin.com/documents/api_list#!/private/getApiV2MembersVipLevel)
|
|
374
|
-
|
|
375
|
-
> get VIP level info
|
|
376
|
-
|
|
377
|
-
<details>
|
|
378
|
-
<summary>Show code</summary>
|
|
379
|
-
|
|
380
|
-
```rb
|
|
381
|
-
@api_v2vip_level
|
|
382
|
-
```
|
|
383
|
-
</details>
|
|
384
|
-
|
|
385
|
-
### Account
|
|
386
|
-
#### [GET /api/v2/members/accounts](https://max.maicoin.com/documents/api_list#!/private/getApiV2MembersAccounts)
|
|
387
|
-
|
|
388
|
-
> get personal accounts information
|
|
389
|
-
|
|
390
|
-
<details>
|
|
391
|
-
<summary>Show code</summary>
|
|
392
|
-
|
|
393
|
-
```rb
|
|
394
|
-
@api_v2accounts
|
|
395
|
-
```
|
|
396
|
-
</details>
|
|
397
|
-
|
|
398
|
-
#### [GET /api/v2/members/accounts/{path_currency}](https://max.maicoin.com/documents/api_list#!/private/getApiV2MembersAccountsPathCurrency)
|
|
399
|
-
|
|
400
|
-
> get personal accounts information of a currency
|
|
401
|
-
|
|
402
|
-
<details>
|
|
403
|
-
<summary>Show code</summary>
|
|
404
|
-
|
|
405
|
-
```rb
|
|
406
|
-
@api_v2account(currnecy)
|
|
407
|
-
```
|
|
408
|
-
</details>
|
|
409
|
-
|
|
410
|
-
### Deposit
|
|
411
|
-
#### [GET /api/v2/deposits](https://max.maicoin.com/documents/api_list#!/private/getApiV2Deposits)
|
|
412
|
-
|
|
413
|
-
> get your deposits history
|
|
414
|
-
|
|
415
|
-
<details>
|
|
416
|
-
<summary>Show code</summary>
|
|
417
|
-
|
|
418
|
-
```rb
|
|
419
|
-
# use default parameters
|
|
420
|
-
@api_v2deposits('max')
|
|
421
|
-
|
|
422
|
-
# provide all possible parameters
|
|
423
|
-
@api_v2deposits(
|
|
424
|
-
'max',
|
|
425
|
-
'confirmed',
|
|
426
|
-
from: 68444,
|
|
427
|
-
to: 69444,
|
|
428
|
-
state: 'accepted',
|
|
429
|
-
pagination: true,
|
|
430
|
-
page: 3,
|
|
431
|
-
limit: 15,
|
|
432
|
-
offset: 5,
|
|
433
|
-
)
|
|
434
|
-
```
|
|
435
|
-
</details>
|
|
436
|
-
|
|
437
|
-
#### [GET /api/v2/deposit](https://max.maicoin.com/documents/api_list#!/private/getApiV2Deposit)
|
|
438
|
-
|
|
439
|
-
> get details of a specific deposit
|
|
440
|
-
|
|
441
|
-
<details>
|
|
442
|
-
<summary>Show code</summary>
|
|
443
|
-
|
|
444
|
-
```rb
|
|
445
|
-
@api_v2deposit('transaction_id')
|
|
446
|
-
```
|
|
447
|
-
</details>
|
|
448
|
-
|
|
449
|
-
### Address
|
|
450
|
-
#### [GET /api/v2/deposit_addresses](https://max.maicoin.com/documents/api_list#!/private/getApiV2DepositAddresses)
|
|
451
|
-
|
|
452
|
-
> The addresses could be empty before generated, please call POST /deposit_addresses in that case
|
|
453
|
-
|
|
454
|
-
<details>
|
|
455
|
-
<summary>Show code</summary>
|
|
456
|
-
|
|
457
|
-
```rb
|
|
458
|
-
# use default parameters
|
|
459
|
-
@api_v2deposit_addresses
|
|
460
|
-
|
|
461
|
-
# provide all possible parameters
|
|
462
|
-
@api_v2deposit_addresses(currency: 'twd', pagination: true, page: 3, limit: 15, offset: 5)
|
|
463
|
-
```
|
|
464
|
-
</details>
|
|
465
|
-
|
|
466
|
-
#### [POST /api/v2/deposit_addresses](https://max.maicoin.com/documents/api_list#!/private/postApiV2DepositAddresses)
|
|
467
|
-
|
|
468
|
-
> Address creation is asynchronous, please call GET /deposit_addresses later to get generated addresses
|
|
469
|
-
|
|
470
|
-
<details>
|
|
471
|
-
<summary>Show code</summary>
|
|
472
|
-
|
|
473
|
-
```rb
|
|
474
|
-
@api_v2create_deposit_addresses!('twd')
|
|
475
|
-
```
|
|
476
|
-
</details>
|
|
477
|
-
|
|
478
|
-
#### [GET /api/v2/withdraw_addresses](https://max.maicoin.com/documents/api_list#!/private/getApiV2WithdrawAddresses)
|
|
479
|
-
|
|
480
|
-
> get withdraw addresses
|
|
481
|
-
|
|
482
|
-
<details>
|
|
483
|
-
<summary>Show code</summary>
|
|
484
|
-
|
|
485
|
-
```rb
|
|
486
|
-
# use default parameters
|
|
487
|
-
@api_v2withdraw_addresses('twd')
|
|
488
|
-
|
|
489
|
-
# provide all possible parameters
|
|
490
|
-
@api_v2withdraw_addresses('usdt', pagination: true, page: 3, limit: 15, offset: 5)
|
|
491
|
-
```
|
|
492
|
-
</details>
|
|
493
|
-
|
|
494
|
-
### Internal Transfer
|
|
495
|
-
#### [GET /api/v2/internal_transfers](https://max.maicoin.com/documents/api_list#!/private/getApiV2InternalTransfers)
|
|
496
|
-
|
|
497
|
-
> get internal transfers history
|
|
498
|
-
|
|
499
|
-
<details>
|
|
500
|
-
<summary>Show code</summary>
|
|
501
|
-
|
|
502
|
-
```rb
|
|
503
|
-
# use default parameters
|
|
504
|
-
@api_v2internal_transfers
|
|
505
|
-
|
|
506
|
-
# provide all possible parameters
|
|
507
|
-
@api_v2internal_transfers(
|
|
508
|
-
currency: 'btc',
|
|
509
|
-
side: 'in',
|
|
510
|
-
from: 68444,
|
|
511
|
-
to: 69444,
|
|
512
|
-
pagination: true,
|
|
513
|
-
page: 3,
|
|
514
|
-
limit: 15,
|
|
515
|
-
offset: 5,
|
|
516
|
-
)
|
|
517
|
-
```
|
|
518
|
-
</details>
|
|
519
|
-
|
|
520
|
-
#### [GET /api/v2/internal_transfer](https://max.maicoin.com/documents/api_list#!/private/getApiV2InternalTransfer)
|
|
521
|
-
|
|
522
|
-
> get details of a specific internal transfer
|
|
523
|
-
|
|
524
|
-
<details>
|
|
525
|
-
<summary>Show code</summary>
|
|
526
|
-
|
|
527
|
-
```rb
|
|
528
|
-
@api_v2internal_transfer('internal_transfer_id')
|
|
529
|
-
```
|
|
530
|
-
</details>
|
|
531
|
-
|
|
532
|
-
### Reward
|
|
533
|
-
#### [GET /api/v2/rewards](https://max.maicoin.com/documents/api_list#!/private/getApiV2Rewards)
|
|
534
|
-
|
|
535
|
-
> get rewards history
|
|
536
|
-
|
|
537
|
-
<details>
|
|
538
|
-
<summary>Show code</summary>
|
|
539
|
-
|
|
540
|
-
```rb
|
|
541
|
-
# use default parameters
|
|
542
|
-
@api_v2rewards
|
|
543
|
-
|
|
544
|
-
# provide all possible parameters
|
|
545
|
-
@api_v2rewards(
|
|
546
|
-
currency: 'btc',
|
|
547
|
-
from: 68444,
|
|
548
|
-
to: 69444,
|
|
549
|
-
pagination: true,
|
|
550
|
-
page: 3,
|
|
551
|
-
limit: 15,
|
|
552
|
-
offset: 5,
|
|
553
|
-
)
|
|
554
|
-
```
|
|
555
|
-
</details>
|
|
556
|
-
|
|
557
|
-
#### [GET /api/v2/rewards/{path_reward_type}](https://max.maicoin.com/documents/api_list#!/private/getApiV2RewardsPathRewardType)
|
|
558
|
-
|
|
559
|
-
> get specific rewards history
|
|
560
|
-
|
|
561
|
-
<details>
|
|
562
|
-
<summary>Show code</summary>
|
|
563
|
-
|
|
564
|
-
```rb
|
|
565
|
-
# use default parameters
|
|
566
|
-
@api_v2rewards(reward_type: 'airdrop_rewards')
|
|
567
|
-
|
|
568
|
-
# provide all possible parameters
|
|
569
|
-
@api_v2rewards(
|
|
570
|
-
reward_type: 'airdrop_rewards',
|
|
571
|
-
currency: 'btc',
|
|
572
|
-
from: 68444,
|
|
573
|
-
to: 69444,
|
|
574
|
-
pagination: true,
|
|
575
|
-
page: 3,
|
|
576
|
-
limit: 15,
|
|
577
|
-
offset: 5,
|
|
578
|
-
)
|
|
579
|
-
```
|
|
580
|
-
</details>
|
|
581
|
-
|
|
582
|
-
#### [GET /api/v2/max_rewards/yesterday](https://max.maicoin.com/documents/api_list#!/private/getApiV2MaxRewardsYesterday)
|
|
583
|
-
|
|
584
|
-
> get max rewards yesterday
|
|
585
|
-
|
|
586
|
-
<details>
|
|
587
|
-
<summary>Show code</summary>
|
|
588
|
-
|
|
589
|
-
```rb
|
|
590
|
-
@api_v2max_rewards_yesterday
|
|
591
|
-
```
|
|
592
|
-
</details>
|
|
593
|
-
|
|
594
|
-
#### [GET /api/v2/yields](https://max.maicoin.com/documents/api_list#!/private/getApiV2Yields)
|
|
595
|
-
|
|
596
|
-
> get yields history
|
|
597
|
-
|
|
598
|
-
<details>
|
|
599
|
-
<summary>Show code</summary>
|
|
600
|
-
|
|
601
|
-
```rb
|
|
602
|
-
# use default parameters
|
|
603
|
-
@api_v2yields
|
|
604
|
-
|
|
605
|
-
# provide all possible parameters
|
|
606
|
-
@api_v2yields(
|
|
607
|
-
currency: 'usdt',
|
|
608
|
-
from: 68444,
|
|
609
|
-
to: 69444,
|
|
610
|
-
pagination: true,
|
|
611
|
-
page: 3,
|
|
612
|
-
limit: 15,
|
|
613
|
-
offset: 5,
|
|
614
|
-
)
|
|
615
|
-
```
|
|
616
|
-
</details>
|
|
617
|
-
|
|
618
|
-
### Order
|
|
619
|
-
#### [GET /api/v2/orders](https://max.maicoin.com/documents/api_list#!/private/getApiV2Orders)
|
|
620
|
-
|
|
621
|
-
> get your orders, results is paginated.
|
|
622
|
-
|
|
623
|
-
<details>
|
|
624
|
-
<summary>Show code</summary>
|
|
625
|
-
|
|
626
|
-
```rb
|
|
627
|
-
# use default parameters
|
|
628
|
-
@api_v2orders('maxtwd')
|
|
629
|
-
|
|
630
|
-
# provide all possible parameters
|
|
631
|
-
@api.orders(
|
|
632
|
-
'maxtwd',
|
|
633
|
-
state: 'done',
|
|
634
|
-
order_by: 'desc',
|
|
635
|
-
group_id: 12345,
|
|
636
|
-
pagination: true,
|
|
637
|
-
page: 3,
|
|
638
|
-
limit: 15,
|
|
639
|
-
offset: 5,
|
|
640
|
-
)
|
|
641
|
-
```
|
|
642
|
-
</details>
|
|
643
|
-
|
|
644
|
-
#### [GET /api/v2/order](https://max.maicoin.com/documents/api_list#!/private/getApiV2Order)
|
|
645
|
-
|
|
646
|
-
> get a specific order.
|
|
647
|
-
|
|
648
|
-
<details>
|
|
649
|
-
<summary>Show code</summary>
|
|
650
|
-
|
|
651
|
-
```rb
|
|
652
|
-
# use max unique order id
|
|
653
|
-
@api.order(123456)
|
|
654
|
-
|
|
655
|
-
# use user specified order id
|
|
656
|
-
@api.order('MY_ORDER_123456', use_client_id: true)
|
|
657
|
-
```
|
|
658
|
-
</details>
|
|
659
|
-
|
|
660
|
-
#### [POST /api/v2/orders/clear](https://max.maicoin.com/documents/api_list#!/private/postApiV2OrdersClear)
|
|
661
|
-
|
|
662
|
-
> cancel all your orders with given market and side
|
|
663
|
-
|
|
664
|
-
<details>
|
|
665
|
-
<summary>Show code</summary>
|
|
666
|
-
|
|
667
|
-
```rb
|
|
668
|
-
# use default parameters
|
|
669
|
-
@api.cancel_orders!
|
|
670
|
-
|
|
671
|
-
# provide all possible parameters
|
|
672
|
-
@api.cancel_orders!(market: 'maxtwd', side: 'sell', group_id: '123456')
|
|
673
|
-
```
|
|
674
|
-
</details>
|
|
675
|
-
|
|
676
|
-
#### [POST /api/v2/order/delete](https://max.maicoin.com/documents/api_list#!/private/postApiV2OrderDelete)
|
|
677
|
-
|
|
678
|
-
> cancel an order
|
|
679
|
-
|
|
680
|
-
<details>
|
|
681
|
-
<summary>Show code</summary>
|
|
682
|
-
|
|
683
|
-
```rb
|
|
684
|
-
# use max unique order id
|
|
685
|
-
@api.cancel_order!(123456)
|
|
686
|
-
|
|
687
|
-
# use user specified order id
|
|
688
|
-
@api.cancel_order!('MY_ORDER_123456', use_client_id: true)
|
|
689
|
-
```
|
|
690
|
-
</details>
|
|
691
|
-
|
|
692
|
-
#### [POST /api/v2/orders](https://max.maicoin.com/documents/api_list#!/private/postApiV2Orders)
|
|
693
|
-
|
|
694
|
-
> create a sell/buy order
|
|
695
|
-
|
|
696
|
-
<details>
|
|
697
|
-
<summary>Show code</summary>
|
|
698
|
-
|
|
699
|
-
```rb
|
|
700
|
-
# use default parameters
|
|
701
|
-
@api.create_order!('maxtwd', 'buy', 1000, price: 7.5)
|
|
702
|
-
|
|
703
|
-
# provide all possible parameters
|
|
704
|
-
@api.create_order!(
|
|
705
|
-
'maxtwd',
|
|
706
|
-
'buy',
|
|
707
|
-
1000,
|
|
708
|
-
price: 7.5,
|
|
709
|
-
client_oid: 'MY_ORDER_ID_12345',
|
|
710
|
-
stop_price: 8,
|
|
711
|
-
ord_type: 'limit',
|
|
712
|
-
group_id: 12345678,
|
|
713
|
-
)
|
|
714
|
-
```
|
|
715
|
-
</details>
|
|
716
|
-
|
|
717
|
-
#### [POST /api/v2/orders/multi/onebyone](https://max.maicoin.com/documents/api_list#!/private/postApiV2OrdersMultiOnebyone)
|
|
718
|
-
|
|
719
|
-
> Create multiple sell/buy orders, orders may be partially accepted, please put your orders as an array in json body.
|
|
720
|
-
|
|
721
|
-
<details>
|
|
722
|
-
<summary>Show code</summary>
|
|
723
|
-
|
|
724
|
-
```rb
|
|
725
|
-
# use default parameters
|
|
726
|
-
@api.create_orders!('maxtwd', [
|
|
727
|
-
{ side: 'buy', volume: '1000', price: '7.5' },
|
|
728
|
-
{ side: 'buy', volume: '1500', price: '7.2' },
|
|
729
|
-
])
|
|
730
|
-
|
|
731
|
-
# provide all possible parameters
|
|
732
|
-
@api.create_orders!('maxtwd', [
|
|
733
|
-
{ side: 'buy', volume: '1000', price: '7.5', client_oid: 'MY_ORDER_ID_12345', stop_price: '8', ord_type: 'limit' },
|
|
734
|
-
{ side: 'buy', volume: '1500', price: '7.2', client_oid: 'MY_ORDER_ID_12346', stop_price: '8', ord_type: 'limit' },
|
|
735
|
-
], group_id: 12345)
|
|
736
|
-
```
|
|
737
|
-
</details>
|
|
48
|
+
- [V2 API](docs/README.api_v2.md)
|
|
49
|
+
- [V3 API](docs/README.api_v3.md)
|
|
738
50
|
|
|
739
51
|
## Development
|
|
740
52
|
|