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.
@@ -4,64 +4,6 @@ require 'max_exchange_api/base_api'
4
4
 
5
5
  module MaxExchangeApi
6
6
  class PublicApi < BaseApi
7
- base_uri 'https://max-api.maicoin.com/api/v2'
8
-
9
- def vip_levels(level = nil)
10
- if level
11
- send_request(:get, "/vip_levels/#{level}", {})
12
- else
13
- send_request(:get, '/vip_levels', {})
14
- end
15
- end
16
-
17
- def currencies
18
- send_request(:get, '/currencies', {})
19
- end
20
-
21
- def k(market, limit: 30, period: 1, timestamp: nil)
22
- send_request(:get, '/k', market: market, limit: limit, period: period, timestamp: timestamp)
23
- end
24
-
25
- def depth(market, limit: 10, sort_by_price: true)
26
- send_request(:get, '/depth', market: market, limit: limit, sort_by_price: sort_by_price)
27
- end
28
-
29
- def trades(market, timestamp: nil, from: nil, to: nil, order_by: 'desc', pagination: true, page: 1, limit: 50,
30
- offset: 0)
31
- send_request(
32
- :get,
33
- '/trades',
34
- market: market,
35
- timestamp: timestamp,
36
- from: from,
37
- to: to,
38
- order_by: order_by,
39
- pagination: pagination,
40
- page: page,
41
- limit: limit,
42
- offset: offset,
43
- )
44
- end
45
-
46
- def markets
47
- send_request(:get, '/markets', {})
48
- end
49
-
50
- def summary
51
- send_request(:get, '/summary', {})
52
- end
53
-
54
- def tickers(market = nil)
55
- if market
56
- send_request(:get, "/tickers/#{market}", {})
57
- else
58
- send_request(:get, '/tickers', {})
59
- end
60
- end
61
-
62
- def timestamp
63
- send_request(:get, '/timestamp', {})
64
- end
65
7
 
66
8
  protected
67
9
 
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'max_exchange_api/public_api'
4
+
5
+ module MaxExchangeApi
6
+ class PublicV2Api < PublicApi
7
+ base_uri 'https://max-api.maicoin.com/api/v2'
8
+
9
+ def vip_levels(level = nil)
10
+ if level
11
+ send_request(:get, "/vip_levels/#{level}", {})
12
+ else
13
+ send_request(:get, '/vip_levels', {})
14
+ end
15
+ end
16
+
17
+ def currencies
18
+ send_request(:get, '/currencies', {})
19
+ end
20
+
21
+ def k(market, limit: 30, period: 1, timestamp: nil)
22
+ send_request(:get, '/k', market: market, limit: limit, period: period, timestamp: timestamp)
23
+ end
24
+
25
+ def depth(market, limit: 10, sort_by_price: true)
26
+ send_request(:get, '/depth', market: market, limit: limit, sort_by_price: sort_by_price)
27
+ end
28
+
29
+ def trades(market, timestamp: nil, from: nil, to: nil, order_by: 'desc', pagination: true, page: 1, limit: 50,
30
+ offset: 0)
31
+ send_request(
32
+ :get,
33
+ '/trades',
34
+ market: market,
35
+ timestamp: timestamp,
36
+ from: from,
37
+ to: to,
38
+ order_by: order_by,
39
+ pagination: pagination,
40
+ page: page,
41
+ limit: limit,
42
+ offset: offset,
43
+ )
44
+ end
45
+
46
+ def markets
47
+ send_request(:get, '/markets', {})
48
+ end
49
+
50
+ def summary
51
+ send_request(:get, '/summary', {})
52
+ end
53
+
54
+ def tickers(market = nil)
55
+ if market
56
+ send_request(:get, "/tickers/#{market}", {})
57
+ else
58
+ send_request(:get, '/tickers', {})
59
+ end
60
+ end
61
+
62
+ def timestamp
63
+ send_request(:get, '/timestamp', {})
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'max_exchange_api/public_api'
4
+
5
+ module MaxExchangeApi
6
+ class PublicV3Api < PublicApi
7
+ base_uri 'https://max-api.maicoin.com/api/v3'
8
+
9
+ def available_loan_amount
10
+ send_request(:get, '/wallet/m/limits', {})
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
- module MaxExchangeApi
2
- VERSION = '1.2.0'
3
- end
1
+ module MaxExchangeApi
2
+ VERSION = '1.4.0'
3
+ end
@@ -1,4 +1,6 @@
1
1
  require 'max_exchange_api/version'
2
2
  require 'max_exchange_api/config'
3
- require 'max_exchange_api/public_api'
4
- require 'max_exchange_api/private_api'
3
+ require 'max_exchange_api/public_v2_api'
4
+ require 'max_exchange_api/public_v3_api'
5
+ require 'max_exchange_api/private_v2_api'
6
+ require 'max_exchange_api/private_v3_api'
@@ -1,43 +1,42 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'max_exchange_api/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = 'max_exchange_api'
8
- spec.version = MaxExchangeApi::VERSION
9
- spec.authors = ['khiav reoy']
10
- spec.email = ['mrtmrt15xn@yahoo.com.tw']
11
-
12
- spec.summary = 'MAX Exchange API Ruby SDK'
13
- spec.description = 'MAX Exchange API Ruby SDK'
14
- spec.homepage = 'https://github.com/khiav223577/max_exchange_api'
15
- spec.license = 'MIT'
16
-
17
- # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
- # delete this section to allow pushing this gem to any host.
19
- # if spec.respond_to?(:metadata)
20
- # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
21
- # else
22
- # raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
- # end
24
-
25
- spec.files = `git ls-files -z`.split("\x0").reject{|f| f.match(%r{^(test|spec|features)/}) }
26
- spec.bindir = 'exe'
27
- spec.executables = spec.files.grep(%r{^exe/}){|f| File.basename(f) }
28
- spec.require_paths = ['lib']
29
- spec.metadata = {
30
- 'homepage_uri' => 'https://github.com/khiav223577/max_exchange_api',
31
- 'changelog_uri' => 'https://github.com/khiav223577/max_exchange_api/blob/master/CHANGELOG.md',
32
- 'source_code_uri' => 'https://github.com/khiav223577/max_exchange_api',
33
- 'documentation_uri' => 'https://www.rubydoc.info/gems/max_exchange_api',
34
- 'bug_tracker_uri' => 'https://github.com/khiav223577/max_exchange_api/issues',
35
- }
36
-
37
- spec.add_development_dependency 'bundler', '>= 1.17', '< 3.x'
38
- spec.add_development_dependency 'rake', '~> 12.0'
39
- spec.add_development_dependency 'minitest', '~> 5.0'
40
- spec.add_development_dependency 'minitest-color', '~> 0.0.2'
41
-
42
- spec.add_dependency 'httparty', '>= 0.18.1'
43
- end
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'max_exchange_api/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'max_exchange_api'
8
+ spec.version = MaxExchangeApi::VERSION
9
+ spec.authors = ['khiav reoy']
10
+ spec.email = ['khiav223577@gmail.com']
11
+
12
+ spec.summary = 'MAX Exchange API Ruby SDK'
13
+ spec.description = 'MAX Exchange API Ruby SDK'
14
+ spec.homepage = 'https://github.com/khiav223577/max_exchange_api'
15
+ spec.license = 'MIT'
16
+
17
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
+ # delete this section to allow pushing this gem to any host.
19
+ # if spec.respond_to?(:metadata)
20
+ # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
21
+ # else
22
+ # raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
+ # end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject{|f| f.match(%r{^(test|spec|features)/}) }
26
+ spec.bindir = 'exe'
27
+ spec.executables = spec.files.grep(%r{^exe/}){|f| File.basename(f) }
28
+ spec.require_paths = ['lib']
29
+ spec.metadata = {
30
+ 'homepage_uri' => 'https://github.com/khiav223577/max_exchange_api',
31
+ 'changelog_uri' => 'https://github.com/khiav223577/max_exchange_api/blob/master/CHANGELOG.md',
32
+ 'source_code_uri' => 'https://github.com/khiav223577/max_exchange_api',
33
+ 'documentation_uri' => 'https://www.rubydoc.info/gems/max_exchange_api',
34
+ 'bug_tracker_uri' => 'https://github.com/khiav223577/max_exchange_api/issues',
35
+ }
36
+
37
+ spec.add_development_dependency 'bundler', '>= 1.17', '< 3.x'
38
+ spec.add_development_dependency 'rake', '~> 12.0'
39
+ spec.add_development_dependency 'minitest', '~> 5.0'
40
+
41
+ spec.add_dependency 'httparty', '>= 0.18.1'
42
+ end
metadata CHANGED
@@ -1,14 +1,13 @@
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.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - khiav reoy
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2021-08-01 00:00:00.000000000 Z
10
+ date: 2025-10-11 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bundler
@@ -58,20 +57,6 @@ dependencies:
58
57
  - - "~>"
59
58
  - !ruby/object:Gem::Version
60
59
  version: '5.0'
61
- - !ruby/object:Gem::Dependency
62
- name: minitest-color
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: 0.0.2
68
- type: :development
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: 0.0.2
75
60
  - !ruby/object:Gem::Dependency
76
61
  name: httparty
77
62
  requirement: !ruby/object:Gem::Requirement
@@ -88,7 +73,7 @@ dependencies:
88
73
  version: 0.18.1
89
74
  description: MAX Exchange API Ruby SDK
90
75
  email:
91
- - mrtmrt15xn@yahoo.com.tw
76
+ - khiav223577@gmail.com
92
77
  executables: []
93
78
  extensions: []
94
79
  extra_rdoc_files: []
@@ -103,13 +88,18 @@ files:
103
88
  - Rakefile
104
89
  - bin/console
105
90
  - bin/setup
91
+ - gemfiles/2.2.gemfile
106
92
  - gemfiles/Gemfile
107
93
  - lib/max_exchange_api.rb
108
94
  - lib/max_exchange_api/base_api.rb
109
95
  - lib/max_exchange_api/config.rb
110
96
  - lib/max_exchange_api/helper.rb
111
97
  - lib/max_exchange_api/private_api.rb
98
+ - lib/max_exchange_api/private_v2_api.rb
99
+ - lib/max_exchange_api/private_v3_api.rb
112
100
  - lib/max_exchange_api/public_api.rb
101
+ - lib/max_exchange_api/public_v2_api.rb
102
+ - lib/max_exchange_api/public_v3_api.rb
113
103
  - lib/max_exchange_api/version.rb
114
104
  - max_exchange_api.gemspec
115
105
  homepage: https://github.com/khiav223577/max_exchange_api
@@ -121,7 +111,6 @@ metadata:
121
111
  source_code_uri: https://github.com/khiav223577/max_exchange_api
122
112
  documentation_uri: https://www.rubydoc.info/gems/max_exchange_api
123
113
  bug_tracker_uri: https://github.com/khiav223577/max_exchange_api/issues
124
- post_install_message:
125
114
  rdoc_options: []
126
115
  require_paths:
127
116
  - lib
@@ -136,8 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
125
  - !ruby/object:Gem::Version
137
126
  version: '0'
138
127
  requirements: []
139
- rubygems_version: 3.2.14
140
- signing_key:
128
+ rubygems_version: 3.6.2
141
129
  specification_version: 4
142
130
  summary: MAX Exchange API Ruby SDK
143
131
  test_files: []