max_exchange_api 1.2.0 → 1.3.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 +1 -0
- data/CHANGELOG.md +3 -0
- data/README.md +14 -12
- data/bin/setup +8 -8
- data/gemfiles/Gemfile +2 -1
- data/lib/max_exchange_api/base_api.rb +7 -2
- data/lib/max_exchange_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3f55473cff3a0a3a235b9e164ddc0e35ada7de436ac2fea87d9e17c179ed7135
|
|
4
|
+
data.tar.gz: 8de22008ea06fe624634099ad7cd1133876ed2182fd515b024c311ac49a4407e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 444b86438ad9c6055914ce5413225256cb986b7519dd94c255c6bd88837cf3c549db2193cd950c20fce073431e834163b68c7763f72abca45c586b10a4276708
|
|
7
|
+
data.tar.gz: 4abfa0033b87e4dab40a5b590c878ec4600e3d56dd94ee9b8db6db9d612b916a84e6e49e009f1d4e489be443e487029ec399d7017f9c6b75f8a54524f2627e05
|
data/.github/workflows/ruby.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
## Change Log
|
|
2
2
|
|
|
3
|
+
### [v1.2.0](https://github.com/khiav223577/max_exchange_api/compare/v1.1.1...v1.2.0) 2021/08/01
|
|
4
|
+
- [#9](https://github.com/khiav223577/max_exchange_api/pull/9) add yields api (@khiav223577)
|
|
5
|
+
|
|
3
6
|
### [v1.1.1](https://github.com/khiav223577/max_exchange_api/compare/v1.1.0...v1.1.1) 2021/08/01
|
|
4
7
|
- [#7](https://github.com/khiav223577/max_exchange_api/pull/7) Fix wrong path in rewards API (@khiav223577)
|
|
5
8
|
- [#8](https://github.com/khiav223577/max_exchange_api/pull/8) Adjust: maker fee and min base amount test cases (@khiav223577)
|
data/README.md
CHANGED
|
@@ -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
|
|
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
|
|
@@ -70,7 +72,7 @@ MaxExchangeApi::PrivateApi.new(access_key, secret_key, config: { logger: Logger.
|
|
|
70
72
|
@api = MaxExchangeApi::PublicApi.new
|
|
71
73
|
```
|
|
72
74
|
|
|
73
|
-
#### [GET
|
|
75
|
+
#### [GET /api/v2/vip_levels](https://max.maicoin.com/documents/api_list#!/public/getApiV2VipLevels)
|
|
74
76
|
|
|
75
77
|
> Get all VIP level fees.
|
|
76
78
|
|
|
@@ -573,7 +575,7 @@ secret_key = 'YOUR_SECRET_KEY'
|
|
|
573
575
|
```
|
|
574
576
|
</details>
|
|
575
577
|
|
|
576
|
-
#### GET /api/v2/yields
|
|
578
|
+
#### [GET /api/v2/yields](https://max.maicoin.com/documents/api_list#!/private/getApiV2Yields)
|
|
577
579
|
|
|
578
580
|
> get yields history
|
|
579
581
|
|
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
|
data/gemfiles/Gemfile
CHANGED
|
@@ -20,13 +20,18 @@ module MaxExchangeApi
|
|
|
20
20
|
uuid = SecureRandom.uuid
|
|
21
21
|
print_log(:info, "[API] #{uuid} #{method.upcase} '#{path}' query = #{query}")
|
|
22
22
|
|
|
23
|
+
body_or_query = method == :get ? :query : :body
|
|
24
|
+
|
|
23
25
|
begin
|
|
24
26
|
response = self.class.send(
|
|
25
27
|
method,
|
|
26
28
|
path,
|
|
27
|
-
headers: headers
|
|
28
|
-
|
|
29
|
+
headers: headers.merge(
|
|
30
|
+
'Accept' => 'application/json',
|
|
31
|
+
'User-Agent' => "max_exchange_api (#{MaxExchangeApi::VERSION})",
|
|
32
|
+
),
|
|
29
33
|
timeout: @config.timeout,
|
|
34
|
+
body_or_query => query,
|
|
30
35
|
).parsed_response
|
|
31
36
|
|
|
32
37
|
print_log(:info, "[API] #{uuid} response #{response}")
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: max_exchange_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- khiav reoy
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-11-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|