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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: edbae1a964c5392adc89a6bd87851ef12ede61c116ff0e2739ceb7a281e5b680
4
- data.tar.gz: a643f7961288b860d35b28efdcf8f4ebcec28c1de9b44b5b19110d060400d3f1
3
+ metadata.gz: 3f55473cff3a0a3a235b9e164ddc0e35ada7de436ac2fea87d9e17c179ed7135
4
+ data.tar.gz: 8de22008ea06fe624634099ad7cd1133876ed2182fd515b024c311ac49a4407e
5
5
  SHA512:
6
- metadata.gz: fd7fef5a08064c12470a155cd451c95d0139c34e1f452d4df18ed4478aea52c72d298ca872a5afd9a1144be40c2013631fc635c9473565c5e38e642be94ffa86
7
- data.tar.gz: ab9eaa801cea900a431a201824e443ccd87b64476eed20ee0cac58684d4234b4b57ac658dd7b7458914c96a770a5cd67d5ab3745f2dfae8dd36c282204dabb79
6
+ metadata.gz: 444b86438ad9c6055914ce5413225256cb986b7519dd94c255c6bd88837cf3c549db2193cd950c20fce073431e834163b68c7763f72abca45c586b10a4276708
7
+ data.tar.gz: 4abfa0033b87e4dab40a5b590c878ec4600e3d56dd94ee9b8db6db9d612b916a84e6e49e009f1d4e489be443e487029ec399d7017f9c6b75f8a54524f2627e05
@@ -23,6 +23,7 @@ jobs:
23
23
  - 2.2
24
24
  - 2.6
25
25
  - 2.7
26
+ - 3.0
26
27
  gemfile:
27
28
  - Gemfile
28
29
  env:
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 config
43
+ # Set default timeout time
44
44
  MaxExchangeApi.default_config.timeout = 3 # seconds
45
45
 
46
- # custom config
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
- # default config
57
- MaxExchangeApi.default_config.logger = Logger.new(STDOUT) # print log to stdand output
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 config
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 GET /api/v2/vip_levels](https://max.maicoin.com/documents/api_list#!/public/getApiV2VipLevels)
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/4.2.gemfile
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
@@ -3,7 +3,8 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in rails_or.gemspec
4
4
 
5
5
  group :test do
6
- gem 'simplecov', '< 0.18'
6
+ gem 'simplecov', '< 0.18'
7
+ gem 'httparty', '< 0.19'
7
8
  end
8
9
 
9
10
  gemspec path: '../'
@@ -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
- query: query,
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}")
@@ -1,3 +1,3 @@
1
1
  module MaxExchangeApi
2
- VERSION = '1.2.0'
2
+ VERSION = '1.3.0'
3
3
  end
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.2.0
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-08-01 00:00:00.000000000 Z
11
+ date: 2021-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler