Sha256: 18f30d7d287632c3b846c765daa2cfacdcafdb28a3ea8e643e81e97488776495

Contents?: true

Size: 634 Bytes

Versions: 1

Compression:

Stored size: 634 Bytes

Contents

# frozen_string_literal: true

require 'ftx_exchange_api/base_api'

module FtxExchangeApi
  class PublicApi < BaseApi
    base_uri 'https://ftx.com/api'

    def markets(market_name = nil)
      if market_name
        send_request(:get, "/markets/#{market_name}", {})
      else
        send_request(:get, '/markets', {})
      end
    end

    def orderbook(market_name, depth: nil)
      send_request(:get, "/markets/#{market_name}/orderbook", depth: depth)
    end

    protected

    def send_request(method, path, query)
      super(method, path, {}, query.reject{|_k, v| v == nil })
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ftx_exchange_api-0.0.2 lib/ftx_exchange_api/public_api.rb