max_exchange_api 2.0.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.
data/README.md CHANGED
@@ -9,18 +9,9 @@
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
- ## Documentations
15
-
16
- * [REST API Introduction](https://max.maicoin.com/documents/api_v2)
17
- * [MAX V3 RESTful API List](https://max-api.maicoin.com/doc/v3.html)
18
- * [WebSocket API Documentation](https://maicoin.github.io/max-websocket-docs/)
19
-
20
-
21
- ## Supports
22
- - Ruby 2.2 ~ 2.7, 3.0 ~ 3.3
23
-
24
15
  ## Table of contents
25
16
 
26
17
  <!-- TOC -->
@@ -30,126 +21,14 @@ A ruby implementation of MAX exchange API
30
21
  * [Table of contents](#table-of-contents)
31
22
  * [Installation](#installation)
32
23
  * [Usage](#usage)
33
- * [Configuration](#configuration)
34
- * [Set timeout time](#set-timeout-time)
35
- * [Logging](#logging)
36
- * [Switch Sub-Account](#switch-sub-account)
37
- * [Public V3 Api Examples](#public-v3-api-examples)
38
- * [GET /api/v3/wallet/m/index_prices](#get-apiv3walletmindex_prices)
39
- * [GET /api/v3/wallet/m/historical_index_prices](#get-apiv3walletmhistorical_index_prices)
40
- * [GET /api/v3/wallet/m/limits](#get-apiv3walletmlimits)
41
- * [GET /api/v3/wallet/m/interest_rates](#get-apiv3walletminterest_rates)
42
- * [GET /api/v3/markets](#get-apiv3markets)
43
- * [GET /api/v3/currencies](#get-apiv3currencies)
44
- * [GET /api/v3/timestamp](#get-apiv3timestamp)
45
- * [GET /api/v3/k](#get-apiv3k)
46
- * [GET /api/v3/depth](#get-apiv3depth)
47
- * [GET /api/v3/trades](#get-apiv3trades)
48
- * [GET /api/v3/tickers](#get-apiv3tickers)
49
- * [GET /api/v3/ticker](#get-apiv3ticker)
50
- * [Private V3 Api Examples](#private-v3-api-examples)
51
- * [User](#user)
52
- * [GET /api/v3/info](#get-apiv3info)
53
- * [Account](#account)
54
- * [GET /api/v3/wallet/{wallet_type}/accounts](#get-apiv3walletwallet_typeaccounts)
55
- * [M-Wallet](#m-wallet)
56
- * [GET /api/v3/wallet/m/ad_ratio](#get-apiv3walletmad_ratio)
57
- * [POST /api/v3/wallet/m/loan](#post-apiv3walletmloan)
58
- * [POST /api/v3/wallet/m/repayment](#post-apiv3walletmrepayment)
59
- * [GET /api/v3/wallet/m/loans](#get-apiv3walletmloans)
60
- * [GET /api/v3/wallet/m/repayments](#get-apiv3walletmrepayments)
61
- * [GET /api/v3/wallet/m/liquidations](#get-apiv3walletmliquidations)
62
- * [GET /api/v3/wallet/m/liquidation](#get-apiv3walletmliquidation)
63
- * [GET /api/v3/wallet/m/interests](#get-apiv3walletminterests)
64
- * [Convert](#convert)
65
- * [GET /api/v3/converts](#get-apiv3converts)
66
- * [GET /api/v3/convert](#get-apiv3convert)
67
- * [POST /api/v3/convert](#post-apiv3convert)
68
- * [Order](#order)
69
- * [GET /api/v3/wallet/{wallet_type}/orders/open](#get-apiv3walletwallet_typeordersopen)
70
- * [GET /api/v3/wallet/{wallet_type}/orders/closed](#get-apiv3walletwallet_typeordersclosed)
71
- * [GET /api/v3/wallet/{wallet_type}/orders/history](#get-apiv3walletwallet_typeordershistory)
72
- * [POST /api/v3/wallet/{wallet_type}/order](#post-apiv3walletwallet_typeorder)
73
- * [GET /api/v3/order](#get-apiv3order)
74
- * [DELETE /api/v3/wallet/{wallet_type}/order](#delete-apiv3walletwallet_typeorder)
75
- * [DELETE /api/v3/order](#delete-apiv3order)
76
- * [Trade](#trade)
77
- * [GET /api/v3/order/trades](#get-apiv3ordertrades)
78
- * [GET /api/v3/wallet/{path_wallet_type}/trades](#get-apiv3walletpath_wallet_typetrades)
79
- * [Deposit](#deposit)
80
- * [GET /api/v3/deposit_address](#get-apiv3deposit_address)
81
- * [GET /api/v3/deposits](#get-apiv3deposits)
82
- * [GET /api/v3/deposit](#get-apiv3deposit)
83
- * [Withdraw](#withdraw)
84
- * [GET /api/v3/withdraw_addresses](#get-apiv3withdraw_addresses)
85
- * [GET /api/v3/withdrawals](#get-apiv3withdrawals)
86
- * [GET /api/v3/withdrawal](#get-apiv3withdrawal)
87
- * [POST /api/v3/withdrawal](#post-apiv3withdrawal)
88
- * [POST /api/v3/withdrawal/twd](#post-apiv3withdrawaltwd)
89
- * [Internal Transfer](#internal-transfer)
90
- * [GET /api/v3/internal_transfers](#get-apiv3internal_transfers)
91
- * [Reward](#reward)
92
- * [GET /api/v3/rewards](#get-apiv3rewards)
93
- * [SubAccount](#subaccount)
94
- * [GET /api/v3/sub_accounts](#get-apiv3sub_accounts)
95
- * [GET /api/v3/sub_account](#get-apiv3sub_account)
96
- * [POST /api/v3/sub_accounts](#post-apiv3sub_accounts)
97
- * [PUT /api/v3/sub_account](#put-apiv3sub_account)
98
- * [DELETE /api/v3/sub_account](#delete-apiv3sub_account)
99
- * [POST /api/v3/sub_account/transfer](#post-apiv3sub_accounttransfer)
100
- * [Public V2 Api Examples](#public-v2-api-examples)
101
- * [GET /api/v2/vip_levels](#get-apiv2vip_levels)
102
- * [GET /api/v2/vip_levels/{level}](#get-apiv2vip_levelslevel)
103
- * [GET /api/v2/currencies](#get-apiv2currencies)
104
- * [GET /api/v2/k](#get-apiv2k)
105
- * [GET /api/v2/depth](#get-apiv2depth)
106
- * [GET /api/v2/trades](#get-apiv2trades)
107
- * [GET /api/v2/markets](#get-apiv2markets)
108
- * [GET /api/v2/summary](#get-apiv2summary)
109
- * [GET /api/v2/tickers/{path_market}](#get-apiv2tickerspath_market)
110
- * [GET /api/v2/tickers](#get-apiv2tickers)
111
- * [GET /api/v2/timestamp](#get-apiv2timestamp)
112
- * [Private V2 Api Examples](#private-v2-api-examples)
113
- * [User](#user-1)
114
- * [GET /api/v2/members/profile](#get-apiv2membersprofile)
115
- * [GET /api/v2/members/me](#get-apiv2membersme)
116
- * [GET /api/v2/members/vip_level](#get-apiv2membersvip_level)
117
- * [Account](#account-1)
118
- * [GET /api/v2/members/accounts](#get-apiv2membersaccounts)
119
- * [GET /api/v2/members/accounts/{path_currency}](#get-apiv2membersaccountspath_currency)
120
- * [Order](#order-1)
121
- * [GET /api/v2/orders](#get-apiv2orders)
122
- * [GET /api/v2/order](#get-apiv2order)
123
- * [POST /api/v2/orders/clear](#post-apiv2ordersclear)
124
- * [POST /api/v2/order/delete](#post-apiv2orderdelete)
125
- * [POST /api/v2/orders](#post-apiv2orders)
126
- * [POST /api/v2/orders/multi/onebyone](#post-apiv2ordersmultionebyone)
127
- * [Trade](#trade-1)
128
- * [GET /api/v2/trades/my/of_order](#get-apiv2tradesmyof_order)
129
- * [GET /api/v2/trades/my](#get-apiv2tradesmy)
130
- * [Deposit](#deposit-1)
131
- * [GET /api/v2/deposits](#get-apiv2deposits)
132
- * [GET /api/v2/deposit](#get-apiv2deposit)
133
- * [GET /api/v2/deposit_addresses](#get-apiv2deposit_addresses)
134
- * [POST /api/v2/deposit_addresses](#post-apiv2deposit_addresses)
135
- * [Withdrawal](#withdrawal)
136
- * [GET /api/v2/withdrawals](#get-apiv2withdrawals)
137
- * [GET /api/v2/withdrawal](#get-apiv2withdrawal)
138
- * [POST /api/v2/withdrawal](#post-apiv2withdrawal)
139
- * [GET /api/v2/withdraw_addresses](#get-apiv2withdraw_addresses)
140
- * [Internal Transfer](#internal-transfer-1)
141
- * [GET /api/v2/internal_transfers](#get-apiv2internal_transfers)
142
- * [GET /api/v2/internal_transfer](#get-apiv2internal_transfer)
143
- * [Reward](#reward-1)
144
- * [GET /api/v2/rewards](#get-apiv2rewards)
145
- * [GET /api/v2/rewards/{path_reward_type}](#get-apiv2rewardspath_reward_type)
146
- * [GET /api/v2/max_rewards/yesterday](#get-apiv2max_rewardsyesterday)
147
- * [GET /api/v2/yields](#get-apiv2yields)
148
24
  * [Development](#development)
149
25
  * [Contributing](#contributing)
150
26
  * [License](#license)
151
27
  <!-- TOC -->
152
28
 
29
+ ## Supports
30
+ - Ruby 2.2 ~ 2.7, 3.0 ~ 3.3
31
+
153
32
  ## Installation
154
33
 
155
34
  ```ruby
@@ -166,1184 +45,8 @@ Or install it yourself as:
166
45
 
167
46
  ## Usage
168
47
 
169
- ```rb
170
- @public_v3_api = MaxExchangeApi::PublicV3Api.new
171
- @public_v3_api.depth('usdttwd')
172
-
173
- access_key, secret_key = File.read('secret').split(',')
174
- @private_v3_api = MaxExchangeApi::PrivateV3Api.new(access_key, secret_key)
175
- @private_v3_api.create_order!('usdttwd', 'sell', 1000, price: 31.35)
176
- @private_v3_api.create_order!('usdttwd', 'buy', 1000, price: 31.15)
177
- ```
178
-
179
- ## Configuration
180
-
181
- ### Set timeout time
182
-
183
- ```rb
184
- # Set default timeout time
185
- MaxExchangeApi.default_config.timeout = 3 # seconds
186
-
187
- # Create an api instance with custom timeout time
188
- api = MaxExchangeApi::PublicV3Api.new(config: { timeout: 12 })
189
- api = MaxExchangeApi::PrivateV3Api.new(access_key, secret_key, config: { timeout: 12 })
190
- ```
191
-
192
- ### Logging
193
-
194
- ```rb
195
- require 'logger'
196
-
197
- # Print log to standard output
198
- MaxExchangeApi.default_config.logger = Logger.new(STDOUT)
199
-
200
- # Print log to file
201
- MaxExchangeApi.default_config.logger = Logger.new('log/api.log')
202
-
203
- # Create an api instance with custom logger
204
- api = MaxExchangeApi::PublicV3Api.new(config: { logger: Logger.new(STDOUT) })
205
- api = MaxExchangeApi::PrivateV3Api.new(access_key, secret_key, config: { logger: Logger.new(STDOUT) })
206
- ```
207
-
208
- ### Switch Sub-Account
209
-
210
- ```rb
211
- @private_v3_api = MaxExchangeApi::PrivateV3Api.new(access_key, secret_key)
212
-
213
- # Switch to a specific sub-account (e.g., 's1-a7f20f')
214
- @private_v3_api.current_sub_account_sn = 's1-a7f20f'
215
-
216
- # Use the default sub-account (determined by the API token owner)
217
- @private_v3_api.current_sub_account_sn = nil
218
-
219
- # Switch to the main account
220
- @private_v3_api.current_sub_account_sn = 'main'
221
- ```
222
-
223
- ## Public V3 Api Examples
224
-
225
- ```rb
226
- @public_v3_api = MaxExchangeApi::PublicV3Api.new
227
- ```
228
-
229
- #### [GET /api/v3/wallet/m/index_prices](https://max-api.maicoin.com/doc/v3.html#tag/Public/operation/getApiV3WalletMIndexPrices)
230
-
231
- > Get latest index prices of m-wallet
232
-
233
- ```rb
234
- @public_v3_api.index_prices
235
- ```
236
-
237
- #### [GET /api/v3/wallet/m/historical_index_prices](https://max-api.maicoin.com/doc/v3.html#tag/Public/operation/getApiV3WalletMHistoricalIndexPrices)
238
-
239
- > Get latest historical index prices
240
-
241
- ```rb
242
- @public_v3_api.index_prices_histories
243
- ```
244
-
245
- #### [GET /api/v3/wallet/m/limits](https://max-api.maicoin.com/doc/v3.html#tag/Public/operation/getApiV3WalletMLimits)
246
-
247
- > Get total available loan amount
248
-
249
- ```rb
250
- @public_v3_api.available_loan_amount
251
- ```
252
-
253
- #### [GET /api/v3/wallet/m/interest_rates](https://max-api.maicoin.com/doc/v3.html#tag/Public/operation/getApiV3WalletMInterestRates)
254
-
255
- > Get latest interest rates of m-wallet
256
-
257
- ```rb
258
- @public_v3_api.loan_interest_rates
259
- ```
260
-
261
- #### [GET /api/v3/markets](https://max-api.maicoin.com/doc/v3.html#tag/Public/operation/getApiV3Markets)
262
-
263
- > Get all available markets.
264
-
265
- ```rb
266
- @public_v3_api.markets
267
- ```
268
-
269
- #### [GET /api/v3/currencies](https://max-api.maicoin.com/doc/v3.html#tag/Public/operation/getApiV3Currencies)
270
-
271
- > Get all available currencies
272
-
273
- ```rb
274
- @public_v3_api.currencies
275
- ```
276
-
277
- #### [GET /api/v3/timestamp](https://max-api.maicoin.com/doc/v3.html#tag/Public/operation/getApiV3Timestamp)
278
-
279
- > Get server current time, in seconds since Unix epoch
280
-
281
- ```rb
282
- @public_v3_api.timestamp
283
- ```
284
-
285
- #### [GET /api/v3/k](https://max-api.maicoin.com/doc/v3.html#tag/Public/operation/getApiV3K)
286
-
287
- > Get OHLC(k line) of a specific market.
288
-
289
- ```rb
290
- # use default parameters
291
- @private_v3_api.k('btctwd')
292
-
293
- # provide all possible parameters
294
- @private_v3_api.k('btctwd', limit: 30, period: 1, timestamp: 1624705402)
295
- ```
296
-
297
- #### [GET /api/v3/depth](https://max-api.maicoin.com/doc/v3.html#tag/Public/operation/getApiV3Depth)
298
-
299
- > Get depth of a specified market.
300
-
301
- ```rb
302
- # use default parameters
303
- @private_v3_api.depth('maxtwd')
304
-
305
- # provide all possible parameters
306
- @private_v3_api.depth('maxtwd', limit: 10, sort_by_price: true)
307
- ```
308
-
309
- #### [GET /api/v3/trades](https://max-api.maicoin.com/doc/v3.html#tag/Public/operation/getApiV3Trades)
310
-
311
- > Get recent trades on market, sorted in reverse creation order.
312
-
313
- ```rb
314
- # use default parameters
315
- @private_v3_api.trades('btctwd')
316
-
317
- # provide all possible parameters
318
- @private_v3_api.trades(
319
- 'maxtwd',
320
- timestamp: 1624705402,
321
- limit: 15,
322
- )
323
- ```
324
-
325
- #### [GET /api/v3/tickers](https://max-api.maicoin.com/doc/v3.html#tag/Public/operation/getApiV3Tickers)
326
-
327
- > Get ticker of all markets.
328
-
329
- ```rb
330
- @private_v3_api.tickers
331
- ```
332
-
333
- #### [GET /api/v3/ticker](https://max-api.maicoin.com/doc/v3.html#tag/Public/operation/getApiV3Ticker)
334
-
335
- > Get ticker of specific market.
336
-
337
- ```rb
338
- @private_v3_api.ticker('btctwd')
339
- ```
340
-
341
- ---
342
-
343
- ## Private V3 Api Examples
344
-
345
- ```rb
346
- access_key = 'YOUR_ACCESS_KEY'
347
- secret_key = 'YOUR_SECRET_KEY'
348
-
349
- @private_v3_api = MaxExchangeApi::PrivateV3Api.new(access_key, secret_key)
350
- ```
351
-
352
- ### User
353
- #### [GET /api/v3/info](https://max-api.maicoin.com/doc/v3.html#tag/User/operation/getApiV3Info)
354
-
355
- > Get user information
356
-
357
- ```rb
358
- @private_v3_api.member_info
359
- ```
360
-
361
- ### Account
362
- #### [GET /api/v3/wallet/{wallet_type}/accounts](https://max-api.maicoin.com/doc/v3.html#tag/Wallet/operation/getApiV3WalletPathWalletTypeAccounts)
363
-
364
- > Get your account balance with all supported currencies by different wallet type
365
-
366
- ```rb
367
- @private_v3_api.accounts
368
-
369
- # provide all possible parameters
370
- @private_v3_api.accounts(wallet_type: 'm', currency: 'usdt')
371
- ```
372
-
373
- ### M-Wallet
374
- #### [GET /api/v3/wallet/m/ad_ratio](https://max-api.maicoin.com/doc/v3.html#tag/Wallet/operation/getApiV3WalletMAdRatio)
375
-
376
- > Get the latest AD ratio of your m-wallet
377
-
378
- ```rb
379
- @private_v3_api.m_wallet_ad_ratio
380
- ```
381
-
382
- #### [POST /api/v3/wallet/m/loan](https://max-api.maicoin.com/doc/v3.html#tag/Wallet/operation/postApiV3WalletMLoan)
383
-
384
- > Create a loan request for your m-wallet
385
-
386
- ```rb
387
- @private_v3_api.m_wallet_loan!('30000', 'usdt')
388
- ```
389
-
390
- #### [POST /api/v3/wallet/m/repayment](https://max-api.maicoin.com/doc/v3.html#tag/Wallet/operation/postApiV3WalletMRepayment)
391
-
392
- > Make a repayment for your loan
393
-
394
- ```rb
395
- @private_v3_api.m_wallet_repay!('30000', 'usdt')
396
- ```
397
-
398
- #### [GET /api/v3/wallet/m/loans](https://max-api.maicoin.com/doc/v3.html#tag/Wallet/operation/getApiV3WalletMLoans)
399
-
400
- > Get loan history of your m-wallet
401
-
402
- ```rb
403
- @private_v3_api.m_wallet_loans('usdt')
404
-
405
- # provide all possible parameters
406
- @private_v3_api.m_wallet_loans(
407
- 'usdt',
408
- timestamp: 1624705402,
409
- order_by: 'asc',
410
- limit: 15,
411
- )
412
- ```
413
-
414
- #### [GET /api/v3/wallet/m/repayments](https://max-api.maicoin.com/doc/v3.html#tag/Wallet/operation/getApiV3WalletMRepayments)
415
-
416
- > Get repayment history of your m-wallet
417
-
418
- ```rb
419
- @private_v3_api.m_wallet_repayments('usdt')
420
-
421
- # provide all possible parameters
422
- @private_v3_api.m_wallet_repayments(
423
- 'usdt',
424
- timestamp: 1624705402,
425
- order_by: 'asc',
426
- limit: 15,
427
- )
428
- ```
429
-
430
- #### [GET /api/v3/wallet/m/liquidations](https://max-api.maicoin.com/doc/v3.html#tag/Wallet/operation/getApiV3WalletMLiquidations)
431
-
432
- > Get liquidation history of your m-wallet
433
-
434
- ```rb
435
- @private_v3_api.m_wallet_liquidations
436
-
437
- # provide all possible parameters
438
- @private_v3_api.m_wallet_liquidations(
439
- timestamp: 1624705402,
440
- order_by: 'asc',
441
- limit: 15,
442
- )
443
- ```
444
-
445
- #### [GET /api/v3/wallet/m/liquidation](https://max-api.maicoin.com/doc/v3.html#tag/Wallet/operation/getApiV3WalletMLiquidation)
446
-
447
- > Get detail of one specific liquidation history of your m-wallet
448
-
449
- ```rb
450
- @private_v3_api.m_wallet_liquidation('210407080800050666')
451
- ```
452
-
453
- #### [GET /api/v3/wallet/m/interests](https://max-api.maicoin.com/doc/v3.html#tag/Wallet/operation/getApiV3WalletMInterests)
454
-
455
- > Get interest history of your m-wallet
456
-
457
- ```rb
458
- @private_v3_api.m_wallet_interests('usdt')
459
-
460
- # provide all possible parameters
461
- @private_v3_api.m_wallet_interests(
462
- 'usdt',
463
- timestamp: 1624705402,
464
- order_by: 'asc',
465
- limit: 15,
466
- )
467
- ```
468
-
469
- ### Convert
470
- #### [GET /api/v3/converts](https://max-api.maicoin.com/doc/v3.html#tag/Convert/operation/getApiV3Converts)
471
-
472
- > Get convert orders history
473
-
474
- ```rb
475
- @private_v3_api.convert_orders
476
-
477
- # provide all possible parameters
478
- @private_v3_api.convert_orders(
479
- timestamp: 1624705402,
480
- order_by: 'asc',
481
- limit: 15,
482
- )
483
- ```
484
-
485
- #### [GET /api/v3/convert](https://max-api.maicoin.com/doc/v3.html#tag/Convert/operation/getApiV3Convert)
486
-
487
- > Get details of a specific convert order
488
-
489
- ```rb
490
- @private_v3_api.convert_order('6322d9bd-736b-4f19-b862-829e75cae1ce')
491
- ```
492
-
493
- #### [POST /api/v3/convert](https://max-api.maicoin.com/doc/v3.html#tag/Convert/operation/postApiV3Convert)
494
-
495
- > Execute a convert (flash exchange) between two currencies
496
-
497
- ```rb
498
- # Specify from amount
499
- @private_v3_api.create_convert_order(
500
- from: ['0.52', 'usdt'],
501
- to: [nil, 'twd'],
502
- )
503
-
504
- # Specify to amount
505
- @private_v3_api.create_convert_order(
506
- from: [nil, 'usdt'],
507
- to: ['16.58', 'twd'],
508
- )
509
- ```
510
-
511
- ### Order
512
- #### [GET /api/v3/wallet/{wallet_type}/orders/open](https://max-api.maicoin.com/doc/v3.html#tag/Order/operation/getApiV3WalletPathWalletTypeOrdersOpen)
513
-
514
- > Get open orders.
515
-
516
- ```rb
517
- # use default parameters
518
- @private_v3_api.open_orders('maxtwd')
519
-
520
- # provide all possible parameters
521
- @private_v3_api.open_orders(
522
- 'maxtwd',
523
- wallet_type: 'm', # 'spot' or 'm'
524
- timestamp: 1773734452000,
525
- order_by: 'desc',
526
- limit: 15,
527
- )
528
- ```
529
-
530
- #### [GET /api/v3/wallet/{wallet_type}/orders/closed](https://max-api.maicoin.com/doc/v3.html#tag/Order/operation/getApiV3WalletPathWalletTypeOrdersClosed)
531
-
532
- > Get closed orders.
533
-
534
- ```rb
535
- # use default parameters
536
- @private_v3_api.closed_orders('maxtwd')
537
-
538
- # provide all possible parameters
539
- @private_v3_api.closed_orders(
540
- 'maxtwd',
541
- wallet_type: 'm', # 'spot' or 'm'
542
- timestamp: 1773734452000,
543
- order_by: 'desc',
544
- limit: 15,
545
- )
546
- ```
547
-
548
- #### [GET /api/v3/wallet/{wallet_type}/orders/history](https://max-api.maicoin.com/doc/v3.html#tag/Order/operation/getApiV3WalletPathWalletTypeOrdersHistory)
549
-
550
- > Get order history in ascending order from a specific from_id.
551
-
552
- ```rb
553
- # use default parameters
554
- @private_v3_api.order_history('maxtwd')
555
-
556
- # provide all possible parameters
557
- @private_v3_api.orders_history(
558
- 'maxtwd',
559
- wallet_type: 'm', # 'spot' or 'm'
560
- from_id: 123456,
561
- limit: 15,
562
- )
563
- ```
564
-
565
- #### [POST /api/v3/wallet/{wallet_type}/order](https://max-api.maicoin.com/doc/v3.html#tag/Order/operation/postApiV3WalletPathWalletTypeOrder)
566
-
567
- > Create sell/buy order
568
-
569
- ```rb
570
- # use default parameters
571
- @private_v3_api.create_order!('maxtwd', 'buy', 1000, price: 7.5)
572
-
573
- # provide all possible parameters
574
- @private_v3_api.create_order!(
575
- 'maxtwd',
576
- 'buy',
577
- 1000,
578
- wallet_type: 'm', # 'spot' or 'm'
579
- price: 7.5,
580
- client_oid: 'MY_ORDER_ID_12345',
581
- stop_price: 8,
582
- ord_type: 'limit',
583
- group_id: 12345678,
584
- )
585
- ```
586
-
587
- #### [GET /api/v3/order](https://max-api.maicoin.com/doc/v3.html#tag/Order/operation/getApiV3Order)
588
-
589
- > Get order detail
590
-
591
- ```rb
592
- # use default parameters
593
- # use max unique order id
594
- @private_v3_api.order(123456)
595
-
596
- # use user specified order id
597
- @private_v3_api.order(client_oid: 'MY_ORDER_123456')
598
- ```
599
-
600
- #### [DELETE /api/v3/wallet/{wallet_type}/order](https://max-api.maicoin.com/doc/v3.html#tag/Order/operation/deleteApiV3WalletPathWalletTypeOrders)
601
-
602
- > Cancel all orders
603
-
604
- ```rb
605
- # use default parameters
606
- @private_v3_api.cancel_orders!
607
-
608
- # provide all possible parameters
609
- @private_v3_api.cancel_orders!(
610
- wallet_type: 'm', # 'spot' or 'm'
611
- market: 'maxtwd',
612
- side: 'sell',
613
- group_id: '123456',
614
- )
615
- ```
616
-
617
- #### [DELETE /api/v3/order](https://max-api.maicoin.com/doc/v3.html#tag/Order/operation/deleteApiV3Order)
618
-
619
- > Cancel an order
620
-
621
- ```rb
622
- # use max unique order id
623
- @private_v3_api.cancel_order!(123456)
624
-
625
- # use user specified order id
626
- @private_v3_api.cancel_order!(client_oid: 'MY_ORDER_123456')
627
- ```
628
-
629
- ### Trade
630
- #### [GET /api/v3/order/trades](https://max-api.maicoin.com/doc/v3.html#tag/Trade/operation/getApiV3OrderTrades)
631
-
632
- > Get trade detail by your order info
633
-
634
- ```rb
635
- # use max unique order id
636
- @private_v3_api.my_trades_of_order(123456)
637
-
638
- # use user specified order id
639
- @private_v3_api.my_trades_of_order(client_oid: 'MY_ORDER_123456')
640
- ```
641
-
642
- #### [GET /api/v3/wallet/{path_wallet_type}/trades](https://max-api.maicoin.com/doc/v3.html#tag/Trade/operation/getApiV3WalletPathWalletTypeTrades)
643
-
644
- > Get executed trades
645
-
646
- ```rb
647
- # use default parameters
648
- @private_v3_api.my_trades
649
-
650
- # provide all possible parameters
651
- @private_v3_api.my_trades(
652
- wallet_type: 'm', # 'spot' or 'm'
653
- market: 'maxtwd',
654
- timestamp: 1624705402,
655
- from_id: 68444,
656
- order_by: 'asc',
657
- limit: 15,
658
- )
659
- ```
660
-
661
- ### Deposit
662
- #### [GET /api/v3/deposit_address](https://max-api.maicoin.com/doc/v3.html#tag/Wallet/operation/getApiV3DepositAddress)
663
-
664
- > Get user deposit address by currency version
665
-
666
- ```rb
667
- @private_v3_api.deposit_address('bscusdt')
668
- ```
669
-
670
- #### [GET /api/v3/deposits](https://max-api.maicoin.com/doc/v3.html#tag/Transaction/operation/getApiV3Deposits)
671
-
672
- > get your deposits history
673
-
674
- ```rb
675
- # use default parameters
676
- @private_v3_api.deposits
677
-
678
- # provide all possible parameters
679
- @private_v3_api.deposits(
680
- currency: 'max',
681
- timestamp: 1624705402,
682
- order_by: 'asc',
683
- limit: 15,
684
- )
685
- ```
686
-
687
- #### [GET /api/v3/deposit](https://max-api.maicoin.com/doc/v3.html#tag/Transaction/operation/getApiV3Deposit)
688
-
689
- > Get details of a specific deposit
690
-
691
- ```rb
692
- # Query by uuid
693
- @private_v3_api.deposit(uuid: '18022603540001')
694
-
695
- # Query by txid
696
- @private_v3_api.deposit(txid: '0x8daa98e07886985bd6a142cd81b83582d6085f7eb931dc4984c18c84f2a845e0')
697
- ```
698
-
699
- ### Withdraw
700
- #### [GET /api/v3/withdraw_addresses](https://max-api.maicoin.com/doc/v3.html#tag/Wallet/operation/getApiV3WithdrawAddresses)
701
-
702
- > Get withdraw addresses of spot wallet
703
-
704
- ```rb
705
- @private_v3_api.withdraw_addresses('usdt')
706
-
707
- # provide all possible parameters
708
- @private_v3_api.withdraw_addresses('usdt', limit: 10, offset: 5)
709
- ```
710
-
711
- #### [GET /api/v3/withdrawals](https://max-api.maicoin.com/doc/v3.html#tag/Transaction/operation/getApiV3Withdrawals)
712
-
713
- > Get external withdrawals history
714
-
715
- ```rb
716
- # use default parameters
717
- @private_v3_api.withdraws
718
-
719
- # provide all possible parameters
720
- @private_v3_api.withdraws(
721
- currency: 'max',
722
- state: 'done',
723
- timestamp: 1624705402,
724
- order_by: 'asc',
725
- limit: 15,
726
- )
727
- ```
728
-
729
- #### [GET /api/v3/withdrawal](https://max-api.maicoin.com/doc/v3.html#tag/Transaction/operation/getApiV3Withdrawal)
730
-
731
- > Get details of a specific external withdraw
732
-
733
- ```rb
734
- # Query by uuid
735
- @private_v3_api.withdraw(uuid: '18022603540001')
736
- ```
737
-
738
- #### [POST /api/v3/withdrawal](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/postApiV2Withdrawal)
739
-
740
- > Submit a crypto withdrawal. IP whitelist for api token is required.
741
-
742
- ```rb
743
- @private_v3_api.create_withdraw!('withdraw_address_id', 100000)
744
- ```
745
-
746
- #### [POST /api/v3/withdrawal/twd](https://max-api.maicoin.com/doc/v3.html#tag/Transaction/operation/postApiV3WithdrawalTwd)
747
-
748
- > Submit twd withdrawal to verified bank account. IP whitelist for api token is required.
749
-
750
- ```rb
751
- @private_v3_api.create_twd_withdraw!(100000)
752
- ```
753
-
754
- ### Internal Transfer
755
- #### [GET /api/v3/internal_transfers](https://max-api.maicoin.com/doc/v3.html#tag/Transaction/operation/getApiV3InternalTransfers)
756
-
757
- > Get internal transfers history
758
-
759
- ```rb
760
- # use default parameters
761
- @private_v3_api.internal_transfers
762
-
763
- # provide all possible parameters
764
- @private_v2_api.internal_transfers(
765
- currency: 'btc',
766
- side: 'in',
767
- timestamp: 1624705402,
768
- order_by: 'asc',
769
- limit: 15,
770
- )
771
- ```
772
-
773
- ### Reward
774
- #### [GET /api/v3/rewards](https://max-api.maicoin.com/doc/v3.html#tag/Transaction/operation/getApiV3Rewards)
775
-
776
- > Get internal transfers history
777
-
778
- ```rb
779
- # use default parameters
780
- @private_v3_api.rewards
781
-
782
- # provide all possible parameters
783
- @private_v2_api.rewards(
784
- currency: 'btc',
785
- reward_type: 'yield',
786
- timestamp: 1624705402,
787
- order_by: 'asc',
788
- limit: 15,
789
- )
790
- ```
791
-
792
- ## SubAccount
793
- #### [GET /api/v3/sub_accounts](https://max-api.maicoin.com/doc/v3.html#tag/Transaction/operation/getApiV3SubAccounts)
794
-
795
- > Get sub_accounts
796
-
797
- ```rb
798
- @private_v3_api.sub_accounts
799
- ```
800
-
801
- #### [GET /api/v3/sub_account](https://max-api.maicoin.com/doc/v3.html#tag/Transaction/operation/getApiV3SubAccount)
802
-
803
- > Get sub_account
804
-
805
- ```rb
806
- @private_v3_api.sub_account('s1-a7f20f')
807
- ```
808
-
809
- #### [POST /api/v3/sub_accounts](https://max-api.maicoin.com/doc/v3.html#tag/Transaction/operation/postApiV3SubAccounts)
810
-
811
- > Create sub_account
812
-
813
- ```rb
814
- @private_v3_api.create_sub_account!(name: 'My Test SubAccount')
815
- ```
816
-
817
- #### [PUT /api/v3/sub_account](https://max-api.maicoin.com/doc/v3.html#tag/Transaction/operation/putApiV3SubAccount)
818
-
819
- > Update sub_account
820
-
821
- ```rb
822
- @private_v3_api.update_sub_account!('s1-a7f20f', name: 'My Test SubAccount')
823
- ```
824
-
825
- #### [DELETE /api/v3/sub_account](https://max-api.maicoin.com/doc/v3.html#tag/Transaction/operation/deleteApiV3SubAccount)
826
-
827
- > Delete sub_account
828
-
829
- ```rb
830
- @private_v3_api.delete_sub_account!('s1-a7f20f')
831
- ```
832
-
833
- #### [POST /api/v3/sub_account/transfer](https://max-api.maicoin.com/doc/v3.html#tag/Transaction/operation/postApiV3SubAccountTransfer)
834
-
835
- > Submit sub_account transfer
836
-
837
- ```rb
838
- # Transfer from main to s1 sub-account
839
- @private_v3_api.current_sub_account_sn = 'main'
840
- @private_v3_api.create_sub_account_transfer!('s1-a7f20f', 3, 'eth')
841
-
842
- # Transfer from s1 sub-account to s2 sub-account
843
- @private_v3_api.current_sub_account_sn = 's1-a7f20f'
844
- @private_v3_api.create_sub_account_transfer!('s2-jsjwsa', 3, 'eth')
845
- ```
846
-
847
- ## Public V2 Api Examples
848
-
849
- ```rb
850
- @public_v2_api = MaxExchangeApi::PublicV2Api.new
851
- ```
852
-
853
- #### [GET /api/v2/vip_levels](https://max-api.maicoin.com/doc/v2.html#tag/public/operation/getApiV2VipLevels)
854
-
855
- > Get all VIP level fees.
856
-
857
- ```rb
858
- @public_v2_api.vip_levels
859
- ```
860
-
861
- #### [GET /api/v2/vip_levels/{level}](https://max-api.maicoin.com/doc/v2.html#tag/public/operation/getApiV2VipLevelsLevel)
862
-
863
- > Get VIP level fee by level.
864
-
865
- ```rb
866
- @public_v2_api.vip_levels(2)
867
- ```
868
-
869
- #### [GET /api/v2/currencies](https://max-api.maicoin.com/doc/v2.html#tag/public/operation/getApiV2Currencies)
870
-
871
- > Get all available currencies.
872
-
873
- ```rb
874
- @public_v2_api.currencies
875
- ```
876
-
877
- #### [GET /api/v2/k](https://max-api.maicoin.com/doc/v2.html#tag/public/operation/getApiV2K)
878
-
879
- > Get OHLC(k line) of a specific market.
880
-
881
- ```rb
882
- # use default parameters
883
- @public_v2_api.k('btctwd')
884
-
885
- # provide all possible parameters
886
- @public_v2_api.k('btctwd', limit: 30, period: 1, timestamp: 1624705402)
887
- ```
888
-
889
- #### [GET /api/v2/depth](https://max-api.maicoin.com/doc/v2.html#tag/public/operation/getApiV2Depth)
890
-
891
- > Get depth of a specified market.
892
-
893
- ```rb
894
- # use default parameters
895
- @public_v2_api.depth('maxtwd')
896
-
897
- # provide all possible parameters
898
- @public_v2_api.depth('maxtwd', limit: 10, sort_by_price: true)
899
- ```
900
-
901
- #### [GET /api/v2/trades](https://max-api.maicoin.com/doc/v2.html#tag/public/operation/getApiV2Trades)
902
-
903
- > Get recent trades on market, sorted in reverse creation order.
904
-
905
- ```rb
906
- # use default parameters
907
- @public_v2_api.trades('btctwd')
908
-
909
- # provide all possible parameters
910
- @public_v2_api.trades(
911
- 'maxtwd',
912
- timestamp: 1624705402,
913
- from: 68444,
914
- to: 69444,
915
- order_by: 'asc',
916
- pagination: true,
917
- page: 3,
918
- limit: 15,
919
- offset: 5,
920
- )
921
- ```
922
-
923
- #### [GET /api/v2/markets](https://max-api.maicoin.com/doc/v2.html#tag/public/operation/getApiV2Markets)
924
-
925
- > Get all available markets.
926
-
927
- ```rb
928
- @public_v2_api.markets
929
- ```
930
-
931
- #### [GET /api/v2/summary](https://max-api.maicoin.com/doc/v2.html#tag/public/operation/getApiV2Summary)
932
-
933
- > Overview of market data for all tickers.
934
-
935
- ```rb
936
- @public_v2_api.summary
937
- ```
938
-
939
- #### [GET /api/v2/tickers/{path_market}](https://max-api.maicoin.com/doc/v2.html#tag/public/operation/getApiV2TickersPathMarket)
940
-
941
- > Get ticker of specific market.
942
-
943
- ```rb
944
- @public_v2_api.tickers('btctwd')
945
- ```
946
-
947
- #### [GET /api/v2/tickers](https://max-api.maicoin.com/doc/v2.html#tag/public/operation/getApiV2Tickers)
948
-
949
- > Get ticker of all markets.
950
-
951
- ```rb
952
- @public_v2_api.tickers
953
- ```
954
-
955
- #### [GET /api/v2/timestamp](https://max-api.maicoin.com/doc/v2.html#tag/public/operation/getApiV2Timestamp)
956
-
957
- > Get server current time, in seconds since Unix epoch.
958
-
959
- ```rb
960
- @public_v2_api.timestamp
961
- ```
962
-
963
- ## Private V2 Api Examples
964
-
965
- ```rb
966
- access_key = 'YOUR_ACCESS_KEY'
967
- secret_key = 'YOUR_SECRET_KEY'
968
-
969
- @private_v2_api = MaxExchangeApi::PrivateV2Api.new(access_key, secret_key)
970
- ```
971
-
972
- ### User
973
- #### [GET /api/v2/members/profile](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2MembersProfile)
974
-
975
- > get personal profile information
976
-
977
- ```rb
978
- @private_v2_api.member_profile
979
- ```
980
-
981
- #### [GET /api/v2/members/me](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2MembersMe)
982
-
983
- > get your profile and accounts information
984
-
985
- ```rb
986
- @private_v2_api.me
987
- ```
988
-
989
- #### [GET /api/v2/members/vip_level](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2MembersVipLevel)
990
-
991
- > get VIP level info
992
-
993
- ```rb
994
- @private_v2_api.vip_level
995
- ```
996
-
997
- ### Account
998
- #### [GET /api/v2/members/accounts](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2MembersAccounts)
999
-
1000
- > get personal accounts information
1001
-
1002
- ```rb
1003
- @private_v2_api.accounts
1004
- ```
1005
-
1006
- #### [GET /api/v2/members/accounts/{path_currency}](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2MembersAccountsPathCurrency)
1007
-
1008
- > get personal accounts information of a currency
1009
-
1010
- ```rb
1011
- @private_v2_api.account(currnecy)
1012
- ```
1013
-
1014
- ### Order
1015
- #### [GET /api/v2/orders](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2Orders)
1016
-
1017
- > get your orders, results is paginated.
1018
-
1019
- ```rb
1020
- # use default parameters
1021
- @private_v2_api.orders('maxtwd')
1022
-
1023
- # provide all possible parameters
1024
- @api.orders(
1025
- 'maxtwd',
1026
- state: 'done',
1027
- order_by: 'desc',
1028
- group_id: 12345,
1029
- pagination: true,
1030
- page: 3,
1031
- limit: 15,
1032
- offset: 5,
1033
- )
1034
- ```
1035
-
1036
- #### [GET /api/v2/order](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2Order)
1037
-
1038
- > get a specific order.
1039
-
1040
- ```rb
1041
- # use max unique order id
1042
- @api.order(123456)
1043
-
1044
- # use user specified order id
1045
- @api.order('MY_ORDER_123456', use_client_id: true)
1046
- ```
1047
-
1048
- #### [POST /api/v2/orders/clear](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/postApiV2OrdersClear)
1049
-
1050
- > cancel all your orders with given market and side
1051
-
1052
- ```rb
1053
- # use default parameters
1054
- @api.cancel_orders!
1055
-
1056
- # provide all possible parameters
1057
- @api.cancel_orders!(market: 'maxtwd', side: 'sell', group_id: '123456')
1058
- ```
1059
-
1060
- #### [POST /api/v2/order/delete](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/postApiV2OrderDelete)
1061
-
1062
- > cancel an order
1063
-
1064
- ```rb
1065
- # use max unique order id
1066
- @api.cancel_order!(123456)
1067
-
1068
- # use user specified order id
1069
- @api.cancel_order!('MY_ORDER_123456', use_client_id: true)
1070
- ```
1071
-
1072
- #### [POST /api/v2/orders](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/postApiV2Orders)
1073
-
1074
- > create a sell/buy order
1075
-
1076
- ```rb
1077
- # use default parameters
1078
- @api.create_order!('maxtwd', 'buy', 1000, price: 7.5)
1079
-
1080
- # provide all possible parameters
1081
- @api.create_order!(
1082
- 'maxtwd',
1083
- 'buy',
1084
- 1000,
1085
- price: 7.5,
1086
- client_oid: 'MY_ORDER_ID_12345',
1087
- stop_price: 8,
1088
- ord_type: 'limit',
1089
- group_id: 12345678,
1090
- )
1091
- ```
1092
-
1093
- #### [POST /api/v2/orders/multi/onebyone](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/postApiV2OrdersMultiOnebyone)
1094
-
1095
- > Create multiple sell/buy orders, orders may be partially accepted, please put your orders as an array in json body.
1096
-
1097
- ```rb
1098
- # use default parameters
1099
- @api.create_orders!('maxtwd', [
1100
- { side: 'buy', volume: '1000', price: '7.5' },
1101
- { side: 'buy', volume: '1500', price: '7.2' },
1102
- ])
1103
-
1104
- # provide all possible parameters
1105
- @api.create_orders!('maxtwd', [
1106
- { side: 'buy', volume: '1000', price: '7.5', client_oid: 'MY_ORDER_ID_12345', stop_price: '8', ord_type: 'limit' },
1107
- { side: 'buy', volume: '1500', price: '7.2', client_oid: 'MY_ORDER_ID_12346', stop_price: '8', ord_type: 'limit' },
1108
- ], group_id: 12345)
1109
- ```
1110
-
1111
- ### Trade
1112
- #### [GET /api/v2/trades/my/of_order](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2TradesMyOfOrder)
1113
-
1114
- > get your executed trades related to a order
1115
-
1116
- ```rb
1117
- # use max unique order id
1118
- @private_v2_api.my_trades_of_order(123456)
1119
-
1120
- # use user specified order id
1121
- @private_v2_api.my_trades_of_order('MY_ORDER_123456', use_client_id: true)
1122
- ```
1123
-
1124
- #### [GET /api/v2/trades/my](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2TradesMy)
1125
-
1126
- > get your executed trades, sorted in reverse creation order
1127
-
1128
- ```rb
1129
- # use default parameters
1130
- @private_v2_api.my_trades('btctwd')
1131
-
1132
- # provide all possible parameters
1133
- @private_v2_api.my_trades(
1134
- 'maxtwd',
1135
- timestamp: 1624705402,
1136
- from: 68444,
1137
- to: 69444,
1138
- order_by: 'asc',
1139
- pagination: true,
1140
- page: 3,
1141
- limit: 15,
1142
- offset: 5,
1143
- )
1144
- ```
1145
-
1146
- ### Deposit
1147
- #### [GET /api/v2/deposits](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2Deposits)
1148
-
1149
- > get your deposits history
1150
-
1151
- ```rb
1152
- # use default parameters
1153
- @private_v2_api.deposits('max')
1154
-
1155
- # provide all possible parameters
1156
- @private_v2_api.deposits(
1157
- 'max',
1158
- 'confirmed',
1159
- from: 68444,
1160
- to: 69444,
1161
- state: 'accepted',
1162
- pagination: true,
1163
- page: 3,
1164
- limit: 15,
1165
- offset: 5,
1166
- )
1167
- ```
1168
-
1169
- #### [GET /api/v2/deposit](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2Deposit)
1170
-
1171
- > get details of a specific deposit
1172
-
1173
- ```rb
1174
- @private_v2_api.deposit('transaction_id')
1175
- ```
1176
-
1177
- #### [GET /api/v2/deposit_addresses](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2DepositAddresses)
1178
-
1179
- > The addresses could be empty before generated, please call POST /deposit_addresses in that case
1180
-
1181
- ```rb
1182
- # use default parameters
1183
- @private_v2_api.deposit_addresses
1184
-
1185
- # provide all possible parameters
1186
- @private_v2_api.deposit_addresses(currency: 'twd', pagination: true, page: 3, limit: 15, offset: 5)
1187
- ```
1188
-
1189
- #### [POST /api/v2/deposit_addresses](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/postApiV2DepositAddresses)
1190
-
1191
- > Address creation is asynchronous, please call GET /deposit_addresses later to get generated addresses
1192
-
1193
- ```rb
1194
- @private_v2_api.create_deposit_addresses!('twd')
1195
- ```
1196
-
1197
- ### Withdrawal
1198
- #### [GET /api/v2/withdrawals](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2Withdrawals)
1199
-
1200
- > get your external withdrawals history
1201
-
1202
- ```rb
1203
- # use default parameters
1204
- @private_v2_api.withdrawals('max')
1205
-
1206
- # provide all possible parameters
1207
- @private_v2_api.withdrawals(
1208
- 'max',
1209
- 'confirmed',
1210
- from: 68444,
1211
- to: 69444,
1212
- state: 'confirmed',
1213
- pagination: true,
1214
- page: 3,
1215
- limit: 15,
1216
- offset: 5,
1217
- )
1218
- ```
1219
-
1220
- #### [GET /api/v2/withdrawal](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2Withdrawal)
1221
-
1222
- > get details of a specific external withdraw
1223
-
1224
- ```rb
1225
- @private_v2_api.withdrawal('withdraw_id')
1226
- ```
1227
-
1228
- #### [POST /api/v2/withdrawal](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/postApiV2Withdrawal)
1229
-
1230
- > submit a withdrawal. IP whitelist for api token is required.
1231
-
1232
- ```rb
1233
- @private_v2_api.create_withdrawal!('twd', 'withdraw_address_id', 100000)
1234
- ```
1235
-
1236
- #### [GET /api/v2/withdraw_addresses](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2WithdrawAddresses)
1237
-
1238
- > get withdraw addresses
1239
-
1240
- ```rb
1241
- # use default parameters
1242
- @private_v2_api.withdraw_addresses('twd')
1243
-
1244
- # provide all possible parameters
1245
- @private_v2_api.withdraw_addresses('usdt', pagination: true, page: 3, limit: 15, offset: 5)
1246
- ```
1247
-
1248
- ### Internal Transfer
1249
- #### [GET /api/v2/internal_transfers](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2InternalTransfers)
1250
-
1251
- > get internal transfers history
1252
-
1253
- ```rb
1254
- # use default parameters
1255
- @private_v2_api.internal_transfers
1256
-
1257
- # provide all possible parameters
1258
- @private_v2_api.internal_transfers(
1259
- currency: 'btc',
1260
- side: 'in',
1261
- from: 68444,
1262
- to: 69444,
1263
- pagination: true,
1264
- page: 3,
1265
- limit: 15,
1266
- offset: 5,
1267
- )
1268
- ```
1269
-
1270
- #### [GET /api/v2/internal_transfer](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2InternalTransfer)
1271
-
1272
- > get details of a specific internal transfer
1273
-
1274
- ```rb
1275
- @private_v2_api.internal_transfer('internal_transfer_id')
1276
- ```
1277
-
1278
- ### Reward
1279
- #### [GET /api/v2/rewards](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2Rewards)
1280
-
1281
- > get rewards history
1282
-
1283
- ```rb
1284
- # use default parameters
1285
- @private_v2_api.rewards
1286
-
1287
- # provide all possible parameters
1288
- @private_v2_api.rewards(
1289
- currency: 'btc',
1290
- from: 68444,
1291
- to: 69444,
1292
- pagination: true,
1293
- page: 3,
1294
- limit: 15,
1295
- offset: 5,
1296
- )
1297
- ```
1298
-
1299
- #### [GET /api/v2/rewards/{path_reward_type}](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2RewardsPathRewardType)
1300
-
1301
- > get specific rewards history
1302
-
1303
- ```rb
1304
- # use default parameters
1305
- @private_v2_api.rewards(reward_type: 'airdrop_rewards')
1306
-
1307
- # provide all possible parameters
1308
- @private_v2_api.rewards(
1309
- reward_type: 'airdrop_rewards',
1310
- currency: 'btc',
1311
- from: 68444,
1312
- to: 69444,
1313
- pagination: true,
1314
- page: 3,
1315
- limit: 15,
1316
- offset: 5,
1317
- )
1318
- ```
1319
-
1320
- #### [GET /api/v2/max_rewards/yesterday](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2MaxRewardsYesterday)
1321
-
1322
- > get max rewards yesterday
1323
-
1324
- ```rb
1325
- @private_v2_api.max_rewards_yesterday
1326
- ```
1327
-
1328
- #### [GET /api/v2/yields](https://max-api.maicoin.com/doc/v2.html#tag/private/operation/getApiV2Yields)
1329
-
1330
- > get yields history
1331
-
1332
- ```rb
1333
- # use default parameters
1334
- @private_v2_api.yields
1335
-
1336
- # provide all possible parameters
1337
- @private_v2_api.yields(
1338
- currency: 'usdt',
1339
- from: 68444,
1340
- to: 69444,
1341
- pagination: true,
1342
- page: 3,
1343
- limit: 15,
1344
- offset: 5,
1345
- )
1346
- ```
48
+ - [V2 API](docs/README.api_v2.md)
49
+ - [V3 API](docs/README.api_v3.md)
1347
50
 
1348
51
  ## Development
1349
52