Class: FTX::API::Convert

Inherits:
Private show all
Defined in:
lib/ftx/api/convert.rb

Instance Attribute Summary

Attributes inherited from Base

#config, #key, #secret

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from FTX::API::Base

Instance Method Details

#accept_quote(quote_id) ⇒ Object



19
20
21
# File 'lib/ftx/api/convert.rb', line 19

def accept_quote(quote_id)   
  send_request(:post, "/otc/quotes/#{quote_id}/accept", {})
end

#get_quote(quote_id) ⇒ Object



15
16
17
# File 'lib/ftx/api/convert.rb', line 15

def get_quote(quote_id)
  send_request(:get, "/otc/quotes/#{quote_id}", {})
end

#new_quote(query = {}) ⇒ Object

Raises:

  • (ArgumentError)


7
8
9
10
11
12
13
# File 'lib/ftx/api/convert.rb', line 7

def new_quote(query = {})
  raise ArgumentError.new(
    "Size, fromCoin, toCoin params required"
    ) unless [:fromCoin, :toCoin, :size].all? { |i| query.include? i }
  
  send_request(:post, "/otc/quotes", query)
end