max_exchange_api 1.2.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 -45
- data/.gitignore +62 -62
- data/.rubocop.yml +1227 -1227
- data/CHANGELOG.md +8 -0
- data/CODE_OF_CONDUCT.md +49 -49
- data/LICENSE +21 -21
- data/README.md +83 -65
- data/Rakefile +10 -10
- data/bin/console +14 -14
- data/bin/setup +8 -8
- data/gemfiles/2.2.gemfile +11 -0
- data/gemfiles/Gemfile +9 -8
- data/lib/max_exchange_api/base_api.rb +52 -47
- 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,13 @@
|
|
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
|
+
|
8
|
+
### [v1.2.0](https://github.com/khiav223577/max_exchange_api/compare/v1.1.1...v1.2.0) 2021/08/01
|
9
|
+
- [#9](https://github.com/khiav223577/max_exchange_api/pull/9) add yields api (@khiav223577)
|
10
|
+
|
3
11
|
### [v1.1.1](https://github.com/khiav223577/max_exchange_api/compare/v1.1.0...v1.1.1) 2021/08/01
|
4
12
|
- [#7](https://github.com/khiav223577/max_exchange_api/pull/7) Fix wrong path in rewards API (@khiav223577)
|
5
13
|
- [#8](https://github.com/khiav223577/max_exchange_api/pull/8) Adjust: maker fee and min base amount test cases (@khiav223577)
|
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
|
22
|
+
- Ruby 2.2 ~ 2.7, 3.0 ~ 3.3
|
23
23
|
|
24
24
|
## Installation
|
25
25
|
|
@@ -40,12 +40,12 @@ Or install it yourself as:
|
|
40
40
|
### Set timeout time
|
41
41
|
|
42
42
|
```rb
|
43
|
-
# default
|
43
|
+
# Set default timeout time
|
44
44
|
MaxExchangeApi.default_config.timeout = 3 # seconds
|
45
45
|
|
46
|
-
# custom
|
47
|
-
MaxExchangeApi::PublicApi.new(config: { timeout: 12 })
|
48
|
-
MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { timeout: 12 })
|
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
49
|
```
|
50
50
|
|
51
51
|
### Logging
|
@@ -53,13 +53,15 @@ MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { timeout: 12 })
|
|
53
53
|
```rb
|
54
54
|
require 'logger'
|
55
55
|
|
56
|
-
#
|
57
|
-
MaxExchangeApi.default_config.logger = Logger.new(STDOUT)
|
56
|
+
# Print log to standard output
|
57
|
+
MaxExchangeApi.default_config.logger = Logger.new(STDOUT)
|
58
|
+
|
59
|
+
# Print log to file
|
58
60
|
MaxExchangeApi.default_config.logger = Logger.new('log/api.log')
|
59
61
|
|
60
|
-
# custom
|
61
|
-
MaxExchangeApi::PublicApi.new(config: { logger: Logger.new(STDOUT) })
|
62
|
-
MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: Logger.new(STDOUT) })
|
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) })
|
63
65
|
```
|
64
66
|
|
65
67
|
## Usage
|
@@ -67,10 +69,11 @@ MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: Logger.
|
|
67
69
|
### Public Api Examples
|
68
70
|
|
69
71
|
```rb
|
70
|
-
@
|
72
|
+
@api_v2 = MaxExchangeApi::PublicV2Api.new
|
73
|
+
@api_v3 = MaxExchangeApi::PublicV3Api.new
|
71
74
|
```
|
72
75
|
|
73
|
-
#### [GET
|
76
|
+
#### [GET /api/v2/vip_levels](https://max.maicoin.com/documents/api_list#!/public/getApiV2VipLevels)
|
74
77
|
|
75
78
|
> Get all VIP level fees.
|
76
79
|
|
@@ -78,7 +81,7 @@ MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: Logger.
|
|
78
81
|
<summary>Show code</summary>
|
79
82
|
|
80
83
|
```rb
|
81
|
-
@
|
84
|
+
@api_v2vip_levels
|
82
85
|
```
|
83
86
|
</details>
|
84
87
|
|
@@ -90,7 +93,7 @@ MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: Logger.
|
|
90
93
|
<summary>Show code</summary>
|
91
94
|
|
92
95
|
```rb
|
93
|
-
@
|
96
|
+
@api_v2vip_levels(2)
|
94
97
|
```
|
95
98
|
</details>
|
96
99
|
|
@@ -102,7 +105,7 @@ MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: Logger.
|
|
102
105
|
<summary>Show code</summary>
|
103
106
|
|
104
107
|
```rb
|
105
|
-
@
|
108
|
+
@api_v2currencies
|
106
109
|
```
|
107
110
|
</details>
|
108
111
|
|
@@ -115,10 +118,10 @@ MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: Logger.
|
|
115
118
|
|
116
119
|
```rb
|
117
120
|
# use default parameters
|
118
|
-
@
|
121
|
+
@api_v2k('btctwd')
|
119
122
|
|
120
123
|
# provide all possible parameters
|
121
|
-
@
|
124
|
+
@api_v2k('btctwd', limit: 30, period: 1, timestamp: 1624705402)
|
122
125
|
```
|
123
126
|
</details>
|
124
127
|
|
@@ -131,10 +134,10 @@ MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: Logger.
|
|
131
134
|
|
132
135
|
```rb
|
133
136
|
# use default parameters
|
134
|
-
@
|
137
|
+
@api_v2depth('maxtwd')
|
135
138
|
|
136
139
|
# provide all possible parameters
|
137
|
-
@
|
140
|
+
@api_v2depth('maxtwd', limit: 10, sort_by_price: true)
|
138
141
|
```
|
139
142
|
</details>
|
140
143
|
|
@@ -147,10 +150,10 @@ MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: Logger.
|
|
147
150
|
|
148
151
|
```rb
|
149
152
|
# use default parameters
|
150
|
-
@
|
153
|
+
@api_v2trades('btctwd')
|
151
154
|
|
152
155
|
# provide all possible parameters
|
153
|
-
@
|
156
|
+
@api_v2trades(
|
154
157
|
'maxtwd',
|
155
158
|
timestamp: 1624705402,
|
156
159
|
from: 68444,
|
@@ -172,7 +175,7 @@ MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: Logger.
|
|
172
175
|
<summary>Show code</summary>
|
173
176
|
|
174
177
|
```rb
|
175
|
-
@
|
178
|
+
@api_v2markets
|
176
179
|
```
|
177
180
|
</details>
|
178
181
|
|
@@ -184,7 +187,7 @@ MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: Logger.
|
|
184
187
|
<summary>Show code</summary>
|
185
188
|
|
186
189
|
```rb
|
187
|
-
@
|
190
|
+
@api_v2summary
|
188
191
|
```
|
189
192
|
</details>
|
190
193
|
|
@@ -196,7 +199,7 @@ MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: Logger.
|
|
196
199
|
<summary>Show code</summary>
|
197
200
|
|
198
201
|
```rb
|
199
|
-
@
|
202
|
+
@api_v2tickers('btctwd')
|
200
203
|
```
|
201
204
|
</details>
|
202
205
|
|
@@ -208,7 +211,7 @@ MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: Logger.
|
|
208
211
|
<summary>Show code</summary>
|
209
212
|
|
210
213
|
```rb
|
211
|
-
@
|
214
|
+
@api_v2tickers
|
212
215
|
```
|
213
216
|
</details>
|
214
217
|
|
@@ -220,17 +223,32 @@ MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: Logger.
|
|
220
223
|
<summary>Show code</summary>
|
221
224
|
|
222
225
|
```rb
|
223
|
-
@
|
226
|
+
@api_v2timestamp
|
224
227
|
```
|
225
228
|
</details>
|
226
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
|
+
|
227
244
|
### Private Api Examples
|
228
245
|
|
229
246
|
```rb
|
230
247
|
access_key = 'YOUR_ACCESS_KEY'
|
231
248
|
secret_key = 'YOUR_SECRET_KEY'
|
232
249
|
|
233
|
-
@
|
250
|
+
@api_v2 = MaxExchangeApi::PrivateV2Api.new(access_key, secret_key)
|
251
|
+
@api_v3 = MaxExchangeApi::PrivateV3Api.new(access_key, secret_key)
|
234
252
|
```
|
235
253
|
|
236
254
|
### Trade
|
@@ -243,10 +261,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
243
261
|
|
244
262
|
```rb
|
245
263
|
# use max unique order id
|
246
|
-
@
|
264
|
+
@api_v2my_trades_of_order(123456)
|
247
265
|
|
248
266
|
# use user specified order id
|
249
|
-
@
|
267
|
+
@api_v2my_trades_of_order('MY_ORDER_123456', use_client_id: true)
|
250
268
|
```
|
251
269
|
</details>
|
252
270
|
|
@@ -259,10 +277,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
259
277
|
|
260
278
|
```rb
|
261
279
|
# use default parameters
|
262
|
-
@
|
280
|
+
@api_v2my_trades('btctwd')
|
263
281
|
|
264
282
|
# provide all possible parameters
|
265
|
-
@
|
283
|
+
@api_v2my_trades(
|
266
284
|
'maxtwd',
|
267
285
|
timestamp: 1624705402,
|
268
286
|
from: 68444,
|
@@ -286,10 +304,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
286
304
|
|
287
305
|
```rb
|
288
306
|
# use default parameters
|
289
|
-
@
|
307
|
+
@api_v2withdrawals('max')
|
290
308
|
|
291
309
|
# provide all possible parameters
|
292
|
-
@
|
310
|
+
@api_v2withdrawals(
|
293
311
|
'max',
|
294
312
|
'confirmed',
|
295
313
|
from: 68444,
|
@@ -311,7 +329,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
311
329
|
<summary>Show code</summary>
|
312
330
|
|
313
331
|
```rb
|
314
|
-
@
|
332
|
+
@api_v2withdrawal('withdraw_id')
|
315
333
|
```
|
316
334
|
</details>
|
317
335
|
|
@@ -323,7 +341,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
323
341
|
<summary>Show code</summary>
|
324
342
|
|
325
343
|
```rb
|
326
|
-
@
|
344
|
+
@api_v2create_withdrawal!('twd', 'withdraw_address_id', 100000)
|
327
345
|
```
|
328
346
|
</details>
|
329
347
|
|
@@ -336,7 +354,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
336
354
|
<summary>Show code</summary>
|
337
355
|
|
338
356
|
```rb
|
339
|
-
@
|
357
|
+
@api_v2member_profile
|
340
358
|
```
|
341
359
|
</details>
|
342
360
|
|
@@ -348,7 +366,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
348
366
|
<summary>Show code</summary>
|
349
367
|
|
350
368
|
```rb
|
351
|
-
@
|
369
|
+
@api_v2me
|
352
370
|
```
|
353
371
|
</details>
|
354
372
|
|
@@ -360,7 +378,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
360
378
|
<summary>Show code</summary>
|
361
379
|
|
362
380
|
```rb
|
363
|
-
@
|
381
|
+
@api_v2vip_level
|
364
382
|
```
|
365
383
|
</details>
|
366
384
|
|
@@ -373,7 +391,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
373
391
|
<summary>Show code</summary>
|
374
392
|
|
375
393
|
```rb
|
376
|
-
@
|
394
|
+
@api_v2accounts
|
377
395
|
```
|
378
396
|
</details>
|
379
397
|
|
@@ -385,7 +403,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
385
403
|
<summary>Show code</summary>
|
386
404
|
|
387
405
|
```rb
|
388
|
-
@
|
406
|
+
@api_v2account(currnecy)
|
389
407
|
```
|
390
408
|
</details>
|
391
409
|
|
@@ -399,10 +417,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
399
417
|
|
400
418
|
```rb
|
401
419
|
# use default parameters
|
402
|
-
@
|
420
|
+
@api_v2deposits('max')
|
403
421
|
|
404
422
|
# provide all possible parameters
|
405
|
-
@
|
423
|
+
@api_v2deposits(
|
406
424
|
'max',
|
407
425
|
'confirmed',
|
408
426
|
from: 68444,
|
@@ -424,7 +442,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
424
442
|
<summary>Show code</summary>
|
425
443
|
|
426
444
|
```rb
|
427
|
-
@
|
445
|
+
@api_v2deposit('transaction_id')
|
428
446
|
```
|
429
447
|
</details>
|
430
448
|
|
@@ -438,10 +456,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
438
456
|
|
439
457
|
```rb
|
440
458
|
# use default parameters
|
441
|
-
@
|
459
|
+
@api_v2deposit_addresses
|
442
460
|
|
443
461
|
# provide all possible parameters
|
444
|
-
@
|
462
|
+
@api_v2deposit_addresses(currency: 'twd', pagination: true, page: 3, limit: 15, offset: 5)
|
445
463
|
```
|
446
464
|
</details>
|
447
465
|
|
@@ -453,7 +471,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
453
471
|
<summary>Show code</summary>
|
454
472
|
|
455
473
|
```rb
|
456
|
-
@
|
474
|
+
@api_v2create_deposit_addresses!('twd')
|
457
475
|
```
|
458
476
|
</details>
|
459
477
|
|
@@ -466,10 +484,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
466
484
|
|
467
485
|
```rb
|
468
486
|
# use default parameters
|
469
|
-
@
|
487
|
+
@api_v2withdraw_addresses('twd')
|
470
488
|
|
471
489
|
# provide all possible parameters
|
472
|
-
@
|
490
|
+
@api_v2withdraw_addresses('usdt', pagination: true, page: 3, limit: 15, offset: 5)
|
473
491
|
```
|
474
492
|
</details>
|
475
493
|
|
@@ -483,10 +501,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
483
501
|
|
484
502
|
```rb
|
485
503
|
# use default parameters
|
486
|
-
@
|
504
|
+
@api_v2internal_transfers
|
487
505
|
|
488
506
|
# provide all possible parameters
|
489
|
-
@
|
507
|
+
@api_v2internal_transfers(
|
490
508
|
currency: 'btc',
|
491
509
|
side: 'in',
|
492
510
|
from: 68444,
|
@@ -507,7 +525,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
507
525
|
<summary>Show code</summary>
|
508
526
|
|
509
527
|
```rb
|
510
|
-
@
|
528
|
+
@api_v2internal_transfer('internal_transfer_id')
|
511
529
|
```
|
512
530
|
</details>
|
513
531
|
|
@@ -521,10 +539,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
521
539
|
|
522
540
|
```rb
|
523
541
|
# use default parameters
|
524
|
-
@
|
542
|
+
@api_v2rewards
|
525
543
|
|
526
544
|
# provide all possible parameters
|
527
|
-
@
|
545
|
+
@api_v2rewards(
|
528
546
|
currency: 'btc',
|
529
547
|
from: 68444,
|
530
548
|
to: 69444,
|
@@ -545,10 +563,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
545
563
|
|
546
564
|
```rb
|
547
565
|
# use default parameters
|
548
|
-
@
|
566
|
+
@api_v2rewards(reward_type: 'airdrop_rewards')
|
549
567
|
|
550
568
|
# provide all possible parameters
|
551
|
-
@
|
569
|
+
@api_v2rewards(
|
552
570
|
reward_type: 'airdrop_rewards',
|
553
571
|
currency: 'btc',
|
554
572
|
from: 68444,
|
@@ -569,11 +587,11 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
569
587
|
<summary>Show code</summary>
|
570
588
|
|
571
589
|
```rb
|
572
|
-
@
|
590
|
+
@api_v2max_rewards_yesterday
|
573
591
|
```
|
574
592
|
</details>
|
575
593
|
|
576
|
-
#### GET /api/v2/yields
|
594
|
+
#### [GET /api/v2/yields](https://max.maicoin.com/documents/api_list#!/private/getApiV2Yields)
|
577
595
|
|
578
596
|
> get yields history
|
579
597
|
|
@@ -582,10 +600,10 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
582
600
|
|
583
601
|
```rb
|
584
602
|
# use default parameters
|
585
|
-
@
|
603
|
+
@api_v2yields
|
586
604
|
|
587
605
|
# provide all possible parameters
|
588
|
-
@
|
606
|
+
@api_v2yields(
|
589
607
|
currency: 'usdt',
|
590
608
|
from: 68444,
|
591
609
|
to: 69444,
|
@@ -607,7 +625,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
607
625
|
|
608
626
|
```rb
|
609
627
|
# use default parameters
|
610
|
-
@
|
628
|
+
@api_v2orders('maxtwd')
|
611
629
|
|
612
630
|
# provide all possible parameters
|
613
631
|
@api.orders(
|
@@ -706,14 +724,14 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
706
724
|
```rb
|
707
725
|
# use default parameters
|
708
726
|
@api.create_orders!('maxtwd', [
|
709
|
-
{ side: 'buy', volume: '1000', price: 7.5 },
|
710
|
-
{ side: 'buy', volume: '1500', price: 7.2 },
|
727
|
+
{ side: 'buy', volume: '1000', price: '7.5' },
|
728
|
+
{ side: 'buy', volume: '1500', price: '7.2' },
|
711
729
|
])
|
712
730
|
|
713
731
|
# provide all possible parameters
|
714
732
|
@api.create_orders!('maxtwd', [
|
715
|
-
{ side: 'buy', volume: '1000', price: 7.5, client_oid: 'MY_ORDER_ID_12345', stop_price: 8, ord_type: 'limit' },
|
716
|
-
{ 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' },
|
717
735
|
], group_id: 12345)
|
718
736
|
```
|
719
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
@@ -1,8 +1,8 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
set -euo pipefail
|
3
|
-
IFS=$'\n\t'
|
4
|
-
set -vx
|
5
|
-
|
6
|
-
bundle install --gemfile=gemfiles/
|
7
|
-
|
8
|
-
# Do any other automated setup that you need to do here
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
set -euo pipefail
|
3
|
+
IFS=$'\n\t'
|
4
|
+
set -vx
|
5
|
+
|
6
|
+
bundle install --gemfile=gemfiles/Gemfile
|
7
|
+
|
8
|
+
# Do any other automated setup that you need to do here
|