Module: MaxExchangeApi::PrivateV3::ConvertApi

Included in:
MaxExchangeApi::PrivateV3Api
Defined in:
lib/max_exchange_api/private_v3/convert_api.rb

Instance Method Summary collapse

Instance Method Details

#convert_order(sn) ⇒ Object



10
11
12
# File 'lib/max_exchange_api/private_v3/convert_api.rb', line 10

def convert_order(sn)
  send_request(:get, '/convert', sn: sn)
end

#convert_orders(timestamp: nil, order_by: 'desc', limit: 50) ⇒ Object



6
7
8
# File 'lib/max_exchange_api/private_v3/convert_api.rb', line 6

def convert_orders(timestamp: nil, order_by: 'desc', limit: 50)
  send_request(:get, '/converts', timestamp: timestamp, order: order_by, limit: limit)
end

#create_convert_order(from: [], to: []) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/max_exchange_api/private_v3/convert_api.rb', line 14

def create_convert_order(from: [], to: [])
  from_amount, from_currency = from
  to_amount, to_currency = to

  send_request(
    :post,
    '/convert',
    from_amount: from_amount,
    from_currency: from_currency,
    to_amount: to_amount,
    to_currency: to_currency,
  )
end