max_exchange_api 1.3.0 → 1.4.0
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/.github/workflows/ruby.yml +43 -46
- data/.gitignore +62 -62
- data/.rubocop.yml +1227 -1227
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +49 -49
- data/LICENSE +21 -21
- data/README.md +70 -54
- data/Rakefile +10 -10
- data/bin/console +14 -14
- data/bin/setup +0 -0
- data/gemfiles/2.2.gemfile +11 -0
- data/gemfiles/Gemfile +10 -10
- data/lib/max_exchange_api/base_api.rb +52 -52
- data/lib/max_exchange_api/config.rb +26 -26
- data/lib/max_exchange_api/helper.rb +2 -0
- data/lib/max_exchange_api/private_api.rb +2 -218
- data/lib/max_exchange_api/private_v2_api.rb +224 -0
- data/lib/max_exchange_api/private_v3_api.rb +9 -0
- data/lib/max_exchange_api/public_api.rb +0 -58
- data/lib/max_exchange_api/public_v2_api.rb +66 -0
- data/lib/max_exchange_api/public_v3_api.rb +13 -0
- data/lib/max_exchange_api/version.rb +3 -3
- data/lib/max_exchange_api.rb +4 -2
- data/max_exchange_api.gemspec +42 -43
- metadata +9 -21
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
## Change Log
|
2
2
|
|
3
|
+
### [v1.3.0](https://github.com/khiav223577/max_exchange_api/compare/v1.2.0...v1.3.0) 2021/11/29
|
4
|
+
- [#12](https://github.com/khiav223577/max_exchange_api/pull/12) Support Ruby 3.0 (@khiav223577)
|
5
|
+
- [#11](https://github.com/khiav223577/max_exchange_api/pull/11) Add user agent to headers (@khiav223577)
|
6
|
+
- [#10](https://github.com/khiav223577/max_exchange_api/pull/10) Enhance: use query_string only if the action is GET (@khiav223577)
|
7
|
+
|
3
8
|
### [v1.2.0](https://github.com/khiav223577/max_exchange_api/compare/v1.1.1...v1.2.0) 2021/08/01
|
4
9
|
- [#9](https://github.com/khiav223577/max_exchange_api/pull/9) add yields api (@khiav223577)
|
5
10
|
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,49 +1,49 @@
|
|
1
|
-
# Contributor Code of Conduct
|
2
|
-
|
3
|
-
As contributors and maintainers of this project, and in the interest of
|
4
|
-
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
-
contribute through reporting issues, posting feature requests, updating
|
6
|
-
documentation, submitting pull requests or patches, and other activities.
|
7
|
-
|
8
|
-
We are committed to making participation in this project a harassment-free
|
9
|
-
experience for everyone, regardless of level of experience, gender, gender
|
10
|
-
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
-
body size, race, ethnicity, age, religion, or nationality.
|
12
|
-
|
13
|
-
Examples of unacceptable behavior by participants include:
|
14
|
-
|
15
|
-
* The use of sexualized language or imagery
|
16
|
-
* Personal attacks
|
17
|
-
* Trolling or insulting/derogatory comments
|
18
|
-
* Public or private harassment
|
19
|
-
* Publishing other's private information, such as physical or electronic
|
20
|
-
addresses, without explicit permission
|
21
|
-
* Other unethical or unprofessional conduct
|
22
|
-
|
23
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
-
threatening, offensive, or harmful.
|
28
|
-
|
29
|
-
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
-
fairly and consistently applying these principles to every aspect of managing
|
31
|
-
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
-
Conduct may be permanently removed from the project team.
|
33
|
-
|
34
|
-
This code of conduct applies both within project spaces and in public spaces
|
35
|
-
when an individual is representing the project or its community.
|
36
|
-
|
37
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
-
reported by contacting a project maintainer at
|
39
|
-
complaints will be reviewed and investigated and will result in a response that
|
40
|
-
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
-
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
-
incident.
|
43
|
-
|
44
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
-
version 1.3.0, available at
|
46
|
-
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
-
|
48
|
-
[homepage]: http://contributor-covenant.org
|
49
|
-
[version]: http://contributor-covenant.org/version/1/3/0/
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at khiav223577@gmail.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/LICENSE
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2020 Rumble Huang
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2020 Rumble Huang
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# MAX Exchange API Ruby SDK
|
2
2
|
|
3
3
|
[](http://rubygems.org/gems/max_exchange_api)
|
4
4
|
[](https://github.com/khiav223577/max_exchange_api/actions)
|
@@ -19,7 +19,7 @@ A ruby implementation of MAX exchange API
|
|
19
19
|
|
20
20
|
|
21
21
|
## Supports
|
22
|
-
- Ruby 2.2 ~ 2.7, 3.0
|
22
|
+
- Ruby 2.2 ~ 2.7, 3.0 ~ 3.3
|
23
23
|
|
24
24
|
## Installation
|
25
25
|
|
@@ -69,7 +69,8 @@ api = MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: L
|
|
69
69
|
### Public Api Examples
|
70
70
|
|
71
71
|
```rb
|
72
|
-
@
|
72
|
+
@api_v2 = MaxExchangeApi::PublicV2Api.new
|
73
|
+
@api_v3 = MaxExchangeApi::PublicV3Api.new
|
73
74
|
```
|
74
75
|
|
75
76
|
#### [GET /api/v2/vip_levels](https://max.maicoin.com/documents/api_list#!/public/getApiV2VipLevels)
|
@@ -80,7 +81,7 @@ api = MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: L
|
|
80
81
|
<summary>Show code</summary>
|
81
82
|
|
82
83
|
```rb
|
83
|
-
@
|
84
|
+
@api_v2vip_levels
|
84
85
|
```
|
85
86
|
</details>
|
86
87
|
|
@@ -92,7 +93,7 @@ api = MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: L
|
|
92
93
|
<summary>Show code</summary>
|
93
94
|
|
94
95
|
```rb
|
95
|
-
@
|
96
|
+
@api_v2vip_levels(2)
|
96
97
|
```
|
97
98
|
</details>
|
98
99
|
|
@@ -104,7 +105,7 @@ api = MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: L
|
|
104
105
|
<summary>Show code</summary>
|
105
106
|
|
106
107
|
```rb
|
107
|
-
@
|
108
|
+
@api_v2currencies
|
108
109
|
```
|
109
110
|
</details>
|
110
111
|
|
@@ -117,10 +118,10 @@ api = MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: L
|
|
117
118
|
|
118
119
|
```rb
|
119
120
|
# use default parameters
|
120
|
-
@
|
121
|
+
@api_v2k('btctwd')
|
121
122
|
|
122
123
|
# provide all possible parameters
|
123
|
-
@
|
124
|
+
@api_v2k('btctwd', limit: 30, period: 1, timestamp: 1624705402)
|
124
125
|
```
|
125
126
|
</details>
|
126
127
|
|
@@ -133,10 +134,10 @@ api = MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: L
|
|
133
134
|
|
134
135
|
```rb
|
135
136
|
# use default parameters
|
136
|
-
@
|
137
|
+
@api_v2depth('maxtwd')
|
137
138
|
|
138
139
|
# provide all possible parameters
|
139
|
-
@
|
140
|
+
@api_v2depth('maxtwd', limit: 10, sort_by_price: true)
|
140
141
|
```
|
141
142
|
</details>
|
142
143
|
|
@@ -149,10 +150,10 @@ api = MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: L
|
|
149
150
|
|
150
151
|
```rb
|
151
152
|
# use default parameters
|
152
|
-
@
|
153
|
+
@api_v2trades('btctwd')
|
153
154
|
|
154
155
|
# provide all possible parameters
|
155
|
-
@
|
156
|
+
@api_v2trades(
|
156
157
|
'maxtwd',
|
157
158
|
timestamp: 1624705402,
|
158
159
|
from: 68444,
|
@@ -174,7 +175,7 @@ api = MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: L
|
|
174
175
|
<summary>Show code</summary>
|
175
176
|
|
176
177
|
```rb
|
177
|
-
@
|
178
|
+
@api_v2markets
|
178
179
|
```
|
179
180
|
</details>
|
180
181
|
|
@@ -186,7 +187,7 @@ api = MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: L
|
|
186
187
|
<summary>Show code</summary>
|
187
188
|
|
188
189
|
```rb
|
189
|
-
@
|
190
|
+
@api_v2summary
|
190
191
|
```
|
191
192
|
</details>
|
192
193
|
|
@@ -198,7 +199,7 @@ api = MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: L
|
|
198
199
|
<summary>Show code</summary>
|
199
200
|
|
200
201
|
```rb
|
201
|
-
@
|
202
|
+
@api_v2tickers('btctwd')
|
202
203
|
```
|
203
204
|
</details>
|
204
205
|
|
@@ -210,7 +211,7 @@ api = MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: L
|
|
210
211
|
<summary>Show code</summary>
|
211
212
|
|
212
213
|
```rb
|
213
|
-
@
|
214
|
+
@api_v2tickers
|
214
215
|
```
|
215
216
|
</details>
|
216
217
|
|
@@ -222,17 +223,32 @@ api = MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: L
|
|
222
223
|
<summary>Show code</summary>
|
223
224
|
|
224
225
|
```rb
|
225
|
-
@
|
226
|
+
@api_v2timestamp
|
226
227
|
```
|
227
228
|
</details>
|
228
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
|
+
|
229
244
|
### Private Api Examples
|
230
245
|
|
231
246
|
```rb
|
232
247
|
access_key = 'YOUR_ACCESS_KEY'
|
233
248
|
secret_key = 'YOUR_SECRET_KEY'
|
234
249
|
|
235
|
-
@
|
250
|
+
@api_v2 = MaxExchangeApi::PrivateV2Api.new(access_key, secret_key)
|
251
|
+
@api_v3 = MaxExchangeApi::PrivateV3Api.new(access_key, secret_key)
|
236
252
|
```
|
237
253
|
|
238
254
|
### Trade
|
@@ -245,10 +261,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
245
261
|
|
246
262
|
```rb
|
247
263
|
# use max unique order id
|
248
|
-
@
|
264
|
+
@api_v2my_trades_of_order(123456)
|
249
265
|
|
250
266
|
# use user specified order id
|
251
|
-
@
|
267
|
+
@api_v2my_trades_of_order('MY_ORDER_123456', use_client_id: true)
|
252
268
|
```
|
253
269
|
</details>
|
254
270
|
|
@@ -261,10 +277,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
261
277
|
|
262
278
|
```rb
|
263
279
|
# use default parameters
|
264
|
-
@
|
280
|
+
@api_v2my_trades('btctwd')
|
265
281
|
|
266
282
|
# provide all possible parameters
|
267
|
-
@
|
283
|
+
@api_v2my_trades(
|
268
284
|
'maxtwd',
|
269
285
|
timestamp: 1624705402,
|
270
286
|
from: 68444,
|
@@ -288,10 +304,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
288
304
|
|
289
305
|
```rb
|
290
306
|
# use default parameters
|
291
|
-
@
|
307
|
+
@api_v2withdrawals('max')
|
292
308
|
|
293
309
|
# provide all possible parameters
|
294
|
-
@
|
310
|
+
@api_v2withdrawals(
|
295
311
|
'max',
|
296
312
|
'confirmed',
|
297
313
|
from: 68444,
|
@@ -313,7 +329,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
313
329
|
<summary>Show code</summary>
|
314
330
|
|
315
331
|
```rb
|
316
|
-
@
|
332
|
+
@api_v2withdrawal('withdraw_id')
|
317
333
|
```
|
318
334
|
</details>
|
319
335
|
|
@@ -325,7 +341,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
325
341
|
<summary>Show code</summary>
|
326
342
|
|
327
343
|
```rb
|
328
|
-
@
|
344
|
+
@api_v2create_withdrawal!('twd', 'withdraw_address_id', 100000)
|
329
345
|
```
|
330
346
|
</details>
|
331
347
|
|
@@ -338,7 +354,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
338
354
|
<summary>Show code</summary>
|
339
355
|
|
340
356
|
```rb
|
341
|
-
@
|
357
|
+
@api_v2member_profile
|
342
358
|
```
|
343
359
|
</details>
|
344
360
|
|
@@ -350,7 +366,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
350
366
|
<summary>Show code</summary>
|
351
367
|
|
352
368
|
```rb
|
353
|
-
@
|
369
|
+
@api_v2me
|
354
370
|
```
|
355
371
|
</details>
|
356
372
|
|
@@ -362,7 +378,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
362
378
|
<summary>Show code</summary>
|
363
379
|
|
364
380
|
```rb
|
365
|
-
@
|
381
|
+
@api_v2vip_level
|
366
382
|
```
|
367
383
|
</details>
|
368
384
|
|
@@ -375,7 +391,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
375
391
|
<summary>Show code</summary>
|
376
392
|
|
377
393
|
```rb
|
378
|
-
@
|
394
|
+
@api_v2accounts
|
379
395
|
```
|
380
396
|
</details>
|
381
397
|
|
@@ -387,7 +403,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
387
403
|
<summary>Show code</summary>
|
388
404
|
|
389
405
|
```rb
|
390
|
-
@
|
406
|
+
@api_v2account(currnecy)
|
391
407
|
```
|
392
408
|
</details>
|
393
409
|
|
@@ -401,10 +417,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
401
417
|
|
402
418
|
```rb
|
403
419
|
# use default parameters
|
404
|
-
@
|
420
|
+
@api_v2deposits('max')
|
405
421
|
|
406
422
|
# provide all possible parameters
|
407
|
-
@
|
423
|
+
@api_v2deposits(
|
408
424
|
'max',
|
409
425
|
'confirmed',
|
410
426
|
from: 68444,
|
@@ -426,7 +442,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
426
442
|
<summary>Show code</summary>
|
427
443
|
|
428
444
|
```rb
|
429
|
-
@
|
445
|
+
@api_v2deposit('transaction_id')
|
430
446
|
```
|
431
447
|
</details>
|
432
448
|
|
@@ -440,10 +456,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
440
456
|
|
441
457
|
```rb
|
442
458
|
# use default parameters
|
443
|
-
@
|
459
|
+
@api_v2deposit_addresses
|
444
460
|
|
445
461
|
# provide all possible parameters
|
446
|
-
@
|
462
|
+
@api_v2deposit_addresses(currency: 'twd', pagination: true, page: 3, limit: 15, offset: 5)
|
447
463
|
```
|
448
464
|
</details>
|
449
465
|
|
@@ -455,7 +471,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
455
471
|
<summary>Show code</summary>
|
456
472
|
|
457
473
|
```rb
|
458
|
-
@
|
474
|
+
@api_v2create_deposit_addresses!('twd')
|
459
475
|
```
|
460
476
|
</details>
|
461
477
|
|
@@ -468,10 +484,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
468
484
|
|
469
485
|
```rb
|
470
486
|
# use default parameters
|
471
|
-
@
|
487
|
+
@api_v2withdraw_addresses('twd')
|
472
488
|
|
473
489
|
# provide all possible parameters
|
474
|
-
@
|
490
|
+
@api_v2withdraw_addresses('usdt', pagination: true, page: 3, limit: 15, offset: 5)
|
475
491
|
```
|
476
492
|
</details>
|
477
493
|
|
@@ -485,10 +501,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
485
501
|
|
486
502
|
```rb
|
487
503
|
# use default parameters
|
488
|
-
@
|
504
|
+
@api_v2internal_transfers
|
489
505
|
|
490
506
|
# provide all possible parameters
|
491
|
-
@
|
507
|
+
@api_v2internal_transfers(
|
492
508
|
currency: 'btc',
|
493
509
|
side: 'in',
|
494
510
|
from: 68444,
|
@@ -509,7 +525,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
509
525
|
<summary>Show code</summary>
|
510
526
|
|
511
527
|
```rb
|
512
|
-
@
|
528
|
+
@api_v2internal_transfer('internal_transfer_id')
|
513
529
|
```
|
514
530
|
</details>
|
515
531
|
|
@@ -523,10 +539,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
523
539
|
|
524
540
|
```rb
|
525
541
|
# use default parameters
|
526
|
-
@
|
542
|
+
@api_v2rewards
|
527
543
|
|
528
544
|
# provide all possible parameters
|
529
|
-
@
|
545
|
+
@api_v2rewards(
|
530
546
|
currency: 'btc',
|
531
547
|
from: 68444,
|
532
548
|
to: 69444,
|
@@ -547,10 +563,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
547
563
|
|
548
564
|
```rb
|
549
565
|
# use default parameters
|
550
|
-
@
|
566
|
+
@api_v2rewards(reward_type: 'airdrop_rewards')
|
551
567
|
|
552
568
|
# provide all possible parameters
|
553
|
-
@
|
569
|
+
@api_v2rewards(
|
554
570
|
reward_type: 'airdrop_rewards',
|
555
571
|
currency: 'btc',
|
556
572
|
from: 68444,
|
@@ -571,7 +587,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
571
587
|
<summary>Show code</summary>
|
572
588
|
|
573
589
|
```rb
|
574
|
-
@
|
590
|
+
@api_v2max_rewards_yesterday
|
575
591
|
```
|
576
592
|
</details>
|
577
593
|
|
@@ -584,10 +600,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
584
600
|
|
585
601
|
```rb
|
586
602
|
# use default parameters
|
587
|
-
@
|
603
|
+
@api_v2yields
|
588
604
|
|
589
605
|
# provide all possible parameters
|
590
|
-
@
|
606
|
+
@api_v2yields(
|
591
607
|
currency: 'usdt',
|
592
608
|
from: 68444,
|
593
609
|
to: 69444,
|
@@ -609,7 +625,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
609
625
|
|
610
626
|
```rb
|
611
627
|
# use default parameters
|
612
|
-
@
|
628
|
+
@api_v2orders('maxtwd')
|
613
629
|
|
614
630
|
# provide all possible parameters
|
615
631
|
@api.orders(
|
@@ -708,14 +724,14 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
708
724
|
```rb
|
709
725
|
# use default parameters
|
710
726
|
@api.create_orders!('maxtwd', [
|
711
|
-
{ side: 'buy', volume: '1000', price: 7.5 },
|
712
|
-
{ side: 'buy', volume: '1500', price: 7.2 },
|
727
|
+
{ side: 'buy', volume: '1000', price: '7.5' },
|
728
|
+
{ side: 'buy', volume: '1500', price: '7.2' },
|
713
729
|
])
|
714
730
|
|
715
731
|
# provide all possible parameters
|
716
732
|
@api.create_orders!('maxtwd', [
|
717
|
-
{ side: 'buy', volume: '1000', price: 7.5, client_oid: 'MY_ORDER_ID_12345', stop_price: 8, ord_type: 'limit' },
|
718
|
-
{ side: 'buy', volume: '1500', price: 7.2, client_oid: 'MY_ORDER_ID_12346', stop_price: 8, ord_type: 'limit' },
|
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' },
|
719
735
|
], group_id: 12345)
|
720
736
|
```
|
721
737
|
</details>
|
data/Rakefile
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
require 'bundler/gem_tasks'
|
2
|
-
require 'rake/testtask'
|
3
|
-
|
4
|
-
Rake::TestTask.new(:test) do |t|
|
5
|
-
t.libs << 'test'
|
6
|
-
t.libs << 'lib'
|
7
|
-
t.test_files = FileList['test/**/*_test.rb']
|
8
|
-
end
|
9
|
-
|
10
|
-
task default: :test
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rake/testtask'
|
3
|
+
|
4
|
+
Rake::TestTask.new(:test) do |t|
|
5
|
+
t.libs << 'test'
|
6
|
+
t.libs << 'lib'
|
7
|
+
t.test_files = FileList['test/**/*_test.rb']
|
8
|
+
end
|
9
|
+
|
10
|
+
task default: :test
|
data/bin/console
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'bundler/setup'
|
4
|
-
require 'max_exchange_api'
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require 'irb'
|
14
|
-
IRB.start
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'max_exchange_api'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require 'irb'
|
14
|
+
IRB.start
|
data/bin/setup
CHANGED
File without changes
|
data/gemfiles/Gemfile
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
# Specify your gem's dependencies in rails_or.gemspec
|
4
|
-
|
5
|
-
group :test do
|
6
|
-
gem 'simplecov', '< 0.18'
|
7
|
-
gem 'httparty', '< 0.19'
|
8
|
-
end
|
9
|
-
|
10
|
-
gemspec path: '../'
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in rails_or.gemspec
|
4
|
+
|
5
|
+
group :test do
|
6
|
+
gem 'simplecov', '< 0.18'
|
7
|
+
gem 'httparty', '< 0.19'
|
8
|
+
end
|
9
|
+
|
10
|
+
gemspec path: '../'
|