Sha256: 4797028e7b080cbe9424419eec414189680f940731e43cbd957405a9c4b15a64

Contents?: true

Size: 911 Bytes

Versions: 6

Compression:

Stored size: 911 Bytes

Contents

# 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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
SimBot-0.1.20 lib/ApiController/peatio.rb
SimBot-0.1.19 lib/ApiController/peatio.rb
SimBot-0.1.18 lib/ApiController/peatio.rb
SimBot-0.1.17 lib/ApiController/peatio.rb
SimBot-0.1.16 lib/ApiController/peatio.rb
SimBot-0.1.15 lib/ApiController/peatio.rb