max_exchange_api 1.4.0 → 2.0.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/.rubocop.yml +2 -2
- data/README.md +981 -372
- data/lib/max_exchange_api/helper.rb +7 -2
- data/lib/max_exchange_api/private_api.rb +3 -1
- data/lib/max_exchange_api/private_v2/account_api.rb +15 -0
- data/lib/max_exchange_api/private_v2/deposit_api.rb +75 -0
- data/lib/max_exchange_api/private_v2/internal_transfer_api.rb +26 -0
- data/lib/max_exchange_api/private_v2/order_api.rb +55 -0
- data/lib/max_exchange_api/private_v2/reward_api.rb +40 -0
- data/lib/max_exchange_api/private_v2/trade_api.rb +28 -0
- data/lib/max_exchange_api/private_v2/user_api.rb +19 -0
- data/lib/max_exchange_api/private_v2/withdraw_api.rb +42 -0
- data/lib/max_exchange_api/private_v2_api.rb +16 -214
- data/lib/max_exchange_api/private_v3/account_api.rb +15 -0
- data/lib/max_exchange_api/private_v3/convert_api.rb +29 -0
- data/lib/max_exchange_api/private_v3/deposit_api.rb +26 -0
- data/lib/max_exchange_api/private_v3/internal_transfer_api.rb +19 -0
- data/lib/max_exchange_api/private_v3/m_wallet_api.rb +76 -0
- data/lib/max_exchange_api/private_v3/order_api.rb +82 -0
- data/lib/max_exchange_api/private_v3/reward_api.rb +19 -0
- data/lib/max_exchange_api/private_v3/sub_account_api.rb +31 -0
- data/lib/max_exchange_api/private_v3/trade_api.rb +27 -0
- data/lib/max_exchange_api/private_v3/user_api.rb +11 -0
- data/lib/max_exchange_api/private_v3/withdraw_api.rb +35 -0
- data/lib/max_exchange_api/private_v3_api.rb +23 -0
- data/lib/max_exchange_api/public_api.rb +13 -14
- data/lib/max_exchange_api/public_v2_api.rb +65 -66
- data/lib/max_exchange_api/public_v3_api.rb +56 -0
- data/lib/max_exchange_api/version.rb +1 -1
- metadata +22 -3
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module MaxExchangeApi
|
|
4
|
+
module PrivateV3
|
|
5
|
+
module MWalletApi
|
|
6
|
+
def m_wallet_ad_ratio
|
|
7
|
+
send_request(:get, '/wallet/m/ad_ratio', {})
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def m_wallet_loan!(amount, currency)
|
|
11
|
+
send_request(
|
|
12
|
+
:post,
|
|
13
|
+
'/wallet/m/loan',
|
|
14
|
+
currency: currency,
|
|
15
|
+
amount: amount,
|
|
16
|
+
)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def m_wallet_repay!(amount, currency)
|
|
20
|
+
send_request(
|
|
21
|
+
:post,
|
|
22
|
+
'/wallet/m/repayment',
|
|
23
|
+
currency: currency,
|
|
24
|
+
amount: amount,
|
|
25
|
+
)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def m_wallet_loans(currency, timestamp: nil, order_by: 'desc', limit: 50)
|
|
29
|
+
send_request(
|
|
30
|
+
:get,
|
|
31
|
+
'/wallet/m/loans',
|
|
32
|
+
currency: currency,
|
|
33
|
+
timestamp: timestamp,
|
|
34
|
+
order: order_by,
|
|
35
|
+
limit: limit,
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def m_wallet_repayments(currency, timestamp: nil, order_by: 'desc', limit: 50)
|
|
40
|
+
send_request(
|
|
41
|
+
:get,
|
|
42
|
+
'/wallet/m/repayments',
|
|
43
|
+
currency: currency,
|
|
44
|
+
timestamp: timestamp,
|
|
45
|
+
order: order_by,
|
|
46
|
+
limit: limit,
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def m_wallet_liquidations(timestamp: nil, order_by: 'desc', limit: 50)
|
|
51
|
+
send_request(
|
|
52
|
+
:get,
|
|
53
|
+
'/wallet/m/liquidations',
|
|
54
|
+
timestamp: timestamp,
|
|
55
|
+
order: order_by,
|
|
56
|
+
limit: limit,
|
|
57
|
+
)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def m_wallet_liquidation(sn)
|
|
61
|
+
send_request(:get, '/wallet/m/liquidation', sn: sn)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def m_wallet_interests(currency, timestamp: nil, order_by: 'desc', limit: 50)
|
|
65
|
+
send_request(
|
|
66
|
+
:get,
|
|
67
|
+
'/wallet/m/interests',
|
|
68
|
+
currency: currency,
|
|
69
|
+
timestamp: timestamp,
|
|
70
|
+
order: order_by,
|
|
71
|
+
limit: limit,
|
|
72
|
+
)
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module MaxExchangeApi
|
|
4
|
+
module PrivateV3
|
|
5
|
+
module OrderApi
|
|
6
|
+
def open_orders(market, timestamp: nil, order_by: 'desc', limit: 50, wallet_type: 'spot')
|
|
7
|
+
send_request(
|
|
8
|
+
:get,
|
|
9
|
+
"/wallet/#{wallet_type}/orders/open",
|
|
10
|
+
market: market,
|
|
11
|
+
state: state,
|
|
12
|
+
timestamp: timestamp,
|
|
13
|
+
order_by: order_by,
|
|
14
|
+
limit: limit,
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def closed_orders(market, timestamp: nil, order_by: 'desc', limit: 50, wallet_type: 'spot')
|
|
19
|
+
send_request(
|
|
20
|
+
:get,
|
|
21
|
+
"/wallet/#{wallet_type}/orders/closed",
|
|
22
|
+
market: market,
|
|
23
|
+
state: state,
|
|
24
|
+
timestamp: timestamp,
|
|
25
|
+
order_by: order_by,
|
|
26
|
+
limit: limit,
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def orders_history(market, from_id: 1, limit: 50, wallet_type: 'spot')
|
|
31
|
+
send_request(
|
|
32
|
+
:get,
|
|
33
|
+
"/wallet/#{wallet_type}/orders/history",
|
|
34
|
+
market,
|
|
35
|
+
from_id: from_id,
|
|
36
|
+
limit: limit,
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def create_order!(market, side, volume, price: nil, client_oid: nil, stop_price: nil, ord_type: nil, group_id: nil, wallet_type: 'spot')
|
|
41
|
+
send_request(
|
|
42
|
+
:post,
|
|
43
|
+
"/wallet/#{wallet_type}/order",
|
|
44
|
+
market: market,
|
|
45
|
+
side: side,
|
|
46
|
+
volume: volume,
|
|
47
|
+
price: price,
|
|
48
|
+
client_oid: client_oid,
|
|
49
|
+
stop_price: stop_price,
|
|
50
|
+
ord_type: ord_type,
|
|
51
|
+
group_id: group_id,
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def order(order_id = nil, client_oid: nil)
|
|
56
|
+
if order_id
|
|
57
|
+
send_request(:get, '/order', id: order_id)
|
|
58
|
+
else
|
|
59
|
+
send_request(:get, '/order', client_oid: client_oid)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def cancel_orders!(market: nil, side: nil, group_id: nil, wallet_type: 'spot')
|
|
64
|
+
send_request(
|
|
65
|
+
:delete,
|
|
66
|
+
"/wallet/#{wallet_type}/orders/clear",
|
|
67
|
+
market: market,
|
|
68
|
+
side: side,
|
|
69
|
+
group_id: group_id,
|
|
70
|
+
)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def cancel_order!(order_id = nil, client_oid: nil)
|
|
74
|
+
if order_id
|
|
75
|
+
send_request(:delete, '/order', id: order_id)
|
|
76
|
+
else
|
|
77
|
+
send_request(:delete, '/order', client_oid: client_oid)
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module MaxExchangeApi
|
|
4
|
+
module PrivateV3
|
|
5
|
+
module RewardApi
|
|
6
|
+
def rewards(currency: nil, reward_type: nil, timestamp: nil, order_by: 'desc', limit: 50)
|
|
7
|
+
send_request(
|
|
8
|
+
:get,
|
|
9
|
+
'/internal_transfers',
|
|
10
|
+
currency: currency,
|
|
11
|
+
reward_type: reward_type,
|
|
12
|
+
timestamp: timestamp,
|
|
13
|
+
order: order_by,
|
|
14
|
+
limit: limit,
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module MaxExchangeApi
|
|
4
|
+
module PrivateV3
|
|
5
|
+
module SubAccountApi
|
|
6
|
+
def sub_accounts
|
|
7
|
+
send_request(:get, '/sub_accounts')
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def sub_account(sn)
|
|
11
|
+
send_request(:get, '/sub_account', sn: sn)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def create_sub_account!(name:)
|
|
15
|
+
send_request(:post, '/sub_accounts', name: name)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def update_sub_account!(sn, name:)
|
|
19
|
+
send_request(:put, '/sub_account', sn: sn, name: name)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def delete_sub_account!(sn)
|
|
23
|
+
send_request(:delete, '/sub_account', sn: sn)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def create_sub_account_transfer!(to_sn, amount, currency)
|
|
27
|
+
send_request(:post, '/sub_account/transfer', to_sn: to_sn, currency: currency, amount: amount)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module MaxExchangeApi
|
|
4
|
+
module PrivateV3
|
|
5
|
+
module TradeApi
|
|
6
|
+
def my_trades_of_order(order_id = nil, client_oid: nil)
|
|
7
|
+
if order_id
|
|
8
|
+
send_request(:get, '/order/trades', order_id: order_id)
|
|
9
|
+
else
|
|
10
|
+
send_request(:get, '/order/trades', client_oid: client_oid)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def my_trades(wallet_type: 'spot', market: nil, timestamp: nil, from_id: nil, order_by: 'desc', limit: 50)
|
|
15
|
+
send_request(
|
|
16
|
+
:get,
|
|
17
|
+
"/wallet/#{wallet_type}/trades",
|
|
18
|
+
market: market,
|
|
19
|
+
timestamp: timestamp,
|
|
20
|
+
from_id: from_id,
|
|
21
|
+
order: order_by,
|
|
22
|
+
limit: limit,
|
|
23
|
+
)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module MaxExchangeApi
|
|
4
|
+
module PrivateV3
|
|
5
|
+
module WithdrawApi
|
|
6
|
+
def withdraw_addresses(currency, limit: 50, offset: 0)
|
|
7
|
+
send_request(:get, '/withdraw_addresses', currency: currency, limit: limit, offset: offset)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def withdraws(currency: nil, state: nil, timestamp: nil, order_by: 'desc', limit: 50)
|
|
11
|
+
send_request(
|
|
12
|
+
:get,
|
|
13
|
+
'/withdrawals',
|
|
14
|
+
currency: currency,
|
|
15
|
+
state: state,
|
|
16
|
+
timestamp: timestamp,
|
|
17
|
+
order: order_by,
|
|
18
|
+
limit: limit,
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def withdraw(uuid:)
|
|
23
|
+
send_request(:get, '/withdrawal', uuid: uuid)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def create_withdraw!(withdraw_address_uuid, amount)
|
|
27
|
+
send_request(:post, '/withdrawal', withdraw_address_uuid: withdraw_address_uuid, amount: amount)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def create_twd_withdraw!(amount)
|
|
31
|
+
send_request(:post, '/withdrawal/twd', amount: amount)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -1,9 +1,32 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'max_exchange_api/private_api'
|
|
4
|
+
require 'max_exchange_api/private_v3/user_api'
|
|
5
|
+
require 'max_exchange_api/private_v3/account_api'
|
|
6
|
+
require 'max_exchange_api/private_v3/m_wallet_api'
|
|
7
|
+
require 'max_exchange_api/private_v3/convert_api'
|
|
8
|
+
require 'max_exchange_api/private_v3/order_api'
|
|
9
|
+
require 'max_exchange_api/private_v3/trade_api'
|
|
10
|
+
require 'max_exchange_api/private_v3/deposit_api'
|
|
11
|
+
require 'max_exchange_api/private_v3/withdraw_api'
|
|
12
|
+
require 'max_exchange_api/private_v3/internal_transfer_api'
|
|
13
|
+
require 'max_exchange_api/private_v3/reward_api'
|
|
14
|
+
require 'max_exchange_api/private_v3/sub_account_api'
|
|
4
15
|
|
|
5
16
|
module MaxExchangeApi
|
|
6
17
|
class PrivateV3Api < PrivateApi
|
|
7
18
|
base_uri 'https://max-api.maicoin.com/api/v3'
|
|
19
|
+
|
|
20
|
+
include PrivateV3::UserApi
|
|
21
|
+
include PrivateV3::AccountApi
|
|
22
|
+
include PrivateV3::MWalletApi
|
|
23
|
+
include PrivateV3::ConvertApi
|
|
24
|
+
include PrivateV3::OrderApi
|
|
25
|
+
include PrivateV3::TradeApi
|
|
26
|
+
include PrivateV3::DepositApi
|
|
27
|
+
include PrivateV3::WithdrawApi
|
|
28
|
+
include PrivateV3::InternalTransferApi
|
|
29
|
+
include PrivateV3::RewardApi
|
|
30
|
+
include PrivateV3::SubAccountApi
|
|
8
31
|
end
|
|
9
32
|
end
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'max_exchange_api/base_api'
|
|
4
|
-
|
|
5
|
-
module MaxExchangeApi
|
|
6
|
-
class PublicApi < BaseApi
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'max_exchange_api/base_api'
|
|
4
|
+
|
|
5
|
+
module MaxExchangeApi
|
|
6
|
+
class PublicApi < BaseApi
|
|
7
|
+
protected
|
|
8
|
+
|
|
9
|
+
def send_request(method, path, query)
|
|
10
|
+
super(method, path, {}, query)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -1,66 +1,65 @@
|
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
end
|
|
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, offset: 0)
|
|
30
|
+
send_request(
|
|
31
|
+
:get,
|
|
32
|
+
'/trades',
|
|
33
|
+
market: market,
|
|
34
|
+
timestamp: timestamp,
|
|
35
|
+
from: from,
|
|
36
|
+
to: to,
|
|
37
|
+
order_by: order_by,
|
|
38
|
+
pagination: pagination,
|
|
39
|
+
page: page,
|
|
40
|
+
limit: limit,
|
|
41
|
+
offset: offset,
|
|
42
|
+
)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def markets
|
|
46
|
+
send_request(:get, '/markets', {})
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def summary
|
|
50
|
+
send_request(:get, '/summary', {})
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def tickers(market = nil)
|
|
54
|
+
if market
|
|
55
|
+
send_request(:get, "/tickers/#{market}", {})
|
|
56
|
+
else
|
|
57
|
+
send_request(:get, '/tickers', {})
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def timestamp
|
|
62
|
+
send_request(:get, '/timestamp', {})
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
@@ -6,8 +6,64 @@ module MaxExchangeApi
|
|
|
6
6
|
class PublicV3Api < PublicApi
|
|
7
7
|
base_uri 'https://max-api.maicoin.com/api/v3'
|
|
8
8
|
|
|
9
|
+
def index_prices
|
|
10
|
+
send_request(:get, '/wallet/m/index_prices', {})
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def index_prices_histories(market, start_time, end_time)
|
|
14
|
+
send_request(
|
|
15
|
+
:get,
|
|
16
|
+
'/wallet/m/historical_index_prices',
|
|
17
|
+
market: market,
|
|
18
|
+
start_time: start_time,
|
|
19
|
+
end_time: end_time,
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
|
|
9
23
|
def available_loan_amount
|
|
10
24
|
send_request(:get, '/wallet/m/limits', {})
|
|
11
25
|
end
|
|
26
|
+
|
|
27
|
+
def loan_interest_rates
|
|
28
|
+
send_request(:get, '/wallet/m/interest_rates', {})
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def markets
|
|
32
|
+
send_request(:get, '/markets', {})
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def currencies
|
|
36
|
+
send_request(:get, '/currencies', {})
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def timestamp
|
|
40
|
+
send_request(:get, '/timestamp', {})
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def k(market, limit: 30, period: 1, timestamp: nil)
|
|
44
|
+
send_request(:get, '/k', market: market, limit: limit, period: period, timestamp: timestamp)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def depth(market, limit: 10, sort_by_price: true)
|
|
48
|
+
send_request(:get, '/depth', market: market, limit: limit, sort_by_price: sort_by_price)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def trades(market, timestamp: nil, limit: 50)
|
|
52
|
+
send_request(
|
|
53
|
+
:get,
|
|
54
|
+
'/trades',
|
|
55
|
+
market: market,
|
|
56
|
+
timestamp: timestamp,
|
|
57
|
+
limit: limit,
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def tickers
|
|
62
|
+
send_request(:get, '/tickers', {})
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def ticker(market)
|
|
66
|
+
send_request(:get, '/ticker', market: market)
|
|
67
|
+
end
|
|
12
68
|
end
|
|
13
69
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: max_exchange_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- khiav reoy
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: bundler
|
|
@@ -95,7 +95,26 @@ files:
|
|
|
95
95
|
- lib/max_exchange_api/config.rb
|
|
96
96
|
- lib/max_exchange_api/helper.rb
|
|
97
97
|
- lib/max_exchange_api/private_api.rb
|
|
98
|
+
- lib/max_exchange_api/private_v2/account_api.rb
|
|
99
|
+
- lib/max_exchange_api/private_v2/deposit_api.rb
|
|
100
|
+
- lib/max_exchange_api/private_v2/internal_transfer_api.rb
|
|
101
|
+
- lib/max_exchange_api/private_v2/order_api.rb
|
|
102
|
+
- lib/max_exchange_api/private_v2/reward_api.rb
|
|
103
|
+
- lib/max_exchange_api/private_v2/trade_api.rb
|
|
104
|
+
- lib/max_exchange_api/private_v2/user_api.rb
|
|
105
|
+
- lib/max_exchange_api/private_v2/withdraw_api.rb
|
|
98
106
|
- lib/max_exchange_api/private_v2_api.rb
|
|
107
|
+
- lib/max_exchange_api/private_v3/account_api.rb
|
|
108
|
+
- lib/max_exchange_api/private_v3/convert_api.rb
|
|
109
|
+
- lib/max_exchange_api/private_v3/deposit_api.rb
|
|
110
|
+
- lib/max_exchange_api/private_v3/internal_transfer_api.rb
|
|
111
|
+
- lib/max_exchange_api/private_v3/m_wallet_api.rb
|
|
112
|
+
- lib/max_exchange_api/private_v3/order_api.rb
|
|
113
|
+
- lib/max_exchange_api/private_v3/reward_api.rb
|
|
114
|
+
- lib/max_exchange_api/private_v3/sub_account_api.rb
|
|
115
|
+
- lib/max_exchange_api/private_v3/trade_api.rb
|
|
116
|
+
- lib/max_exchange_api/private_v3/user_api.rb
|
|
117
|
+
- lib/max_exchange_api/private_v3/withdraw_api.rb
|
|
99
118
|
- lib/max_exchange_api/private_v3_api.rb
|
|
100
119
|
- lib/max_exchange_api/public_api.rb
|
|
101
120
|
- lib/max_exchange_api/public_v2_api.rb
|
|
@@ -125,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
125
144
|
- !ruby/object:Gem::Version
|
|
126
145
|
version: '0'
|
|
127
146
|
requirements: []
|
|
128
|
-
rubygems_version:
|
|
147
|
+
rubygems_version: 4.0.8
|
|
129
148
|
specification_version: 4
|
|
130
149
|
summary: MAX Exchange API Ruby SDK
|
|
131
150
|
test_files: []
|