Class: MaxExchangeApi::PrivateV2Api
- Inherits:
-
PrivateApi
- Object
- BaseApi
- PrivateApi
- MaxExchangeApi::PrivateV2Api
- Defined in:
- lib/max_exchange_api/private_v2_api.rb
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
- #account(currency) ⇒ Object
- #accounts ⇒ Object
- #cancel_order!(order_id, use_client_id: false) ⇒ Object
- #cancel_orders!(market: nil, side: nil, group_id: nil) ⇒ Object
- #create_deposit_addresses!(currency) ⇒ Object
- #create_order!(market, side, volume, price: nil, client_oid: nil, stop_price: nil, ord_type: nil, group_id: nil) ⇒ Object
- #create_orders!(market, orders, group_id: nil) ⇒ Object
- #create_withdrawal!(currency, withdraw_address_id, amount) ⇒ Object
- #deposit(transaction_id) ⇒ Object
- #deposit_addresses(currency: nil, pagination: nil, page: 1, limit: 50, offset: 0) ⇒ Object
- #deposits(currency, from: nil, to: nil, state: nil, pagination: nil, page: 1, limit: 50, offset: 0) ⇒ Object
- #internal_transfer(internal_transfer_id) ⇒ Object
- #internal_transfers(currency: nil, side: 'in', from: nil, to: nil, pagination: nil, page: 1, limit: 50, offset: 0) ⇒ Object
- #max_rewards_yesterday ⇒ Object
- #me ⇒ Object
- #member_profile ⇒ Object
- #my_trades(market, timestamp: nil, from: nil, to: nil, order_by: 'desc', pagination: true, page: 1, limit: 50, offset: 0) ⇒ Object
- #my_trades_of_order(order_id, use_client_id: false) ⇒ Object
- #order(order_id, use_client_id: false) ⇒ Object
- #orders(market, state: nil, order_by: 'asc', group_id: nil, pagination: nil, page: 1, limit: 50, offset: 0) ⇒ Object
- #rewards(reward_type: nil, currency: nil, from: nil, to: nil, pagination: nil, page: 1, limit: 50, offset: 0) ⇒ Object
- #vip_level ⇒ Object
- #withdraw_addresses(currency, pagination: nil, page: 1, limit: 50, offset: 0) ⇒ Object
- #withdrawal(withdraw_id) ⇒ Object
- #withdrawals(currency, from: nil, to: nil, state: nil, pagination: nil, page: 1, limit: 50, offset: 0) ⇒ Object
- #yields(currency: nil, from: nil, to: nil, pagination: nil, page: 1, limit: 50, offset: 0) ⇒ Object
Methods inherited from PrivateApi
Methods inherited from BaseApi
Constructor Details
This class inherits a constructor from MaxExchangeApi::PrivateApi
Instance Method Details
#account(currency) ⇒ Object
47 48 49 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 47 def account(currency) send_request(:get, "/members/accounts/#{currency}", {}) end |
#accounts ⇒ Object
43 44 45 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 43 def accounts send_request(:get, '/members/accounts', {}) end |
#cancel_order!(order_id, use_client_id: false) ⇒ Object
200 201 202 203 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 200 def cancel_order!(order_id, use_client_id: false) id_params_key = use_client_id ? :client_oid : :id send_request(:post, '/order/delete', id_params_key => order_id) end |
#cancel_orders!(market: nil, side: nil, group_id: nil) ⇒ Object
196 197 198 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 196 def cancel_orders!(market: nil, side: nil, group_id: nil) send_request(:post, '/orders/clear', market: market, side: side, group_id: group_id) end |
#create_deposit_addresses!(currency) ⇒ Object
83 84 85 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 83 def create_deposit_addresses!(currency) send_request(:post, '/deposit_addresses', currency: currency) end |
#create_order!(market, side, volume, price: nil, client_oid: nil, stop_price: nil, ord_type: nil, group_id: nil) ⇒ Object
205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 205 def create_order!(market, side, volume, price: nil, client_oid: nil, stop_price: nil, ord_type: nil, group_id: nil) send_request( :post, '/orders', market: market, side: side, volume: volume, price: price, client_oid: client_oid, stop_price: stop_price, ord_type: ord_type, group_id: group_id, ) end |
#create_orders!(market, orders, group_id: nil) ⇒ Object
220 221 222 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 220 def create_orders!(market, orders, group_id: nil) send_request(:post, '/orders/multi/onebyone', market: market, orders: orders, group_id: group_id) end |
#create_withdrawal!(currency, withdraw_address_id, amount) ⇒ Object
119 120 121 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 119 def create_withdrawal!(currency, withdraw_address_id, amount) send_request(:post, '/withdrawal', currency: currency, withdraw_address_uuid: withdraw_address_id, amount: amount) end |
#deposit(transaction_id) ⇒ Object
67 68 69 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 67 def deposit(transaction_id) send_request(:get, '/deposit', txid: transaction_id) end |
#deposit_addresses(currency: nil, pagination: nil, page: 1, limit: 50, offset: 0) ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 71 def deposit_addresses(currency: nil, pagination: nil, page: 1, limit: 50, offset: 0) send_request( :get, '/deposit_addresses', currency: currency, pagination: pagination, page: page, limit: limit, offset: offset, ) end |
#deposits(currency, from: nil, to: nil, state: nil, pagination: nil, page: 1, limit: 50, offset: 0) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 51 def deposits(currency, from: nil, to: nil, state: nil, pagination: nil, page: 1, limit: 50, offset: 0) send_request( :get, '/deposits', currency: currency, from: from, to: to, state: state, pagination: pagination, page: page, limit: limit, offset: offset, ) end |
#internal_transfer(internal_transfer_id) ⇒ Object
139 140 141 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 139 def internal_transfer(internal_transfer_id) send_request(:get, '/internal_transfer', uuid: internal_transfer_id) end |
#internal_transfers(currency: nil, side: 'in', from: nil, to: nil, pagination: nil, page: 1, limit: 50, offset: 0) ⇒ Object
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 123 def internal_transfers(currency: nil, side: 'in', from: nil, to: nil, pagination: nil, page: 1, limit: 50, offset: 0) send_request( :get, '/internal_transfers', currency: currency, side: side, from: from, to: to, pagination: pagination, page: page, limit: limit, offset: offset, ) end |
#max_rewards_yesterday ⇒ Object
172 173 174 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 172 def max_rewards_yesterday send_request(:get, '/max_rewards/yesterday', {}) end |
#me ⇒ Object
35 36 37 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 35 def me send_request(:get, '/members/me', {}) end |
#member_profile ⇒ Object
31 32 33 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 31 def member_profile send_request(:get, '/members/profile', {}) end |
#my_trades(market, timestamp: nil, from: nil, to: nil, order_by: 'desc', pagination: true, page: 1, limit: 50, offset: 0) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 14 def my_trades(market, timestamp: nil, from: nil, to: nil, order_by: 'desc', pagination: true, page: 1, limit: 50, offset: 0) send_request( :get, '/trades/my', market: market, timestamp: , from: from, to: to, order_by: order_by, pagination: pagination, page: page, limit: limit, offset: offset, ) end |
#my_trades_of_order(order_id, use_client_id: false) ⇒ Object
9 10 11 12 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 9 def my_trades_of_order(order_id, use_client_id: false) id_params_key = use_client_id ? :client_oid : :id send_request(:get, '/trades/my/of_order', id_params_key => order_id) end |
#order(order_id, use_client_id: false) ⇒ Object
191 192 193 194 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 191 def order(order_id, use_client_id: false) id_params_key = use_client_id ? :client_oid : :id send_request(:get, '/order', id_params_key => order_id) end |
#orders(market, state: nil, order_by: 'asc', group_id: nil, pagination: nil, page: 1, limit: 50, offset: 0) ⇒ Object
176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 176 def orders(market, state: nil, order_by: 'asc', group_id: nil, pagination: nil, page: 1, limit: 50, offset: 0) send_request( :get, '/orders', market: market, state: state, order_by: order_by, group_id: group_id, pagination: pagination, page: page, limit: limit, offset: offset, ) end |
#rewards(reward_type: nil, currency: nil, from: nil, to: nil, pagination: nil, page: 1, limit: 50, offset: 0) ⇒ Object
143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 143 def rewards(reward_type: nil, currency: nil, from: nil, to: nil, pagination: nil, page: 1, limit: 50, offset: 0) path = reward_type ? "/rewards/#{reward_type}" : '/rewards' send_request( :get, path, currency: currency, from: from, to: to, pagination: pagination, page: page, limit: limit, offset: offset, ) end |
#vip_level ⇒ Object
39 40 41 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 39 def vip_level send_request(:get, '/members/vip_level', {}) end |
#withdraw_addresses(currency, pagination: nil, page: 1, limit: 50, offset: 0) ⇒ Object
87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 87 def withdraw_addresses(currency, pagination: nil, page: 1, limit: 50, offset: 0) send_request( :get, '/withdraw_addresses', currency: currency, pagination: pagination, page: page, limit: limit, offset: offset, ) end |
#withdrawal(withdraw_id) ⇒ Object
99 100 101 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 99 def withdrawal(withdraw_id) send_request(:get, '/withdrawal', uuid: withdraw_id) end |
#withdrawals(currency, from: nil, to: nil, state: nil, pagination: nil, page: 1, limit: 50, offset: 0) ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 103 def withdrawals(currency, from: nil, to: nil, state: nil, pagination: nil, page: 1, limit: 50, offset: 0) send_request( :get, '/withdrawals', currency: currency, from: from, to: to, state: state, pagination: pagination, page: page, limit: limit, offset: offset, ) end |
#yields(currency: nil, from: nil, to: nil, pagination: nil, page: 1, limit: 50, offset: 0) ⇒ Object
158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/max_exchange_api/private_v2_api.rb', line 158 def yields(currency: nil, from: nil, to: nil, pagination: nil, page: 1, limit: 50, offset: 0) send_request( :get, '/yields', currency: currency, from: from, to: to, pagination: pagination, page: page, limit: limit, offset: offset, ) end |