# frozen_string_literal: true module ApiController # General peatio api functionality class Peatio require 'json' require 'rest-client' def initialize(endpoint, token) @endpoint = endpoint @auth_token = token end def post_order(market, price, volume, type) response = RestClient.post("#{@endpoint}/orders", { 'market': market, 'side': type.to_s, 'volume': volume.to_s, 'price': price.to_s, 'ord_type': 'limit' }, {'Authorization': "Bearer #{@auth_token}", 'content_type': 'application/x-www-form-urlencoded'}) #puts response end end end