Sha256: 0407a3ba577684ec48ff24c19ba600d4223d03e09bd84dd85347484cdcbc2bba

Contents?: true

Size: 806 Bytes

Versions: 6

Compression:

Stored size: 806 Bytes

Contents

require_relative "base_client"

module PortalConnectors
  class ArbitrageClient < BaseClient
    def self.singleton
      @singleton ||= new
    end

    def submit_order(**attributes)
      params = attributes.merge(nonce: next_nonce)
      url = "#{host}/api/v1/orders"
      res = post_with_signature(url, params)
      [JSON.parse(res.body_str), res.response_code == 201]
    rescue => e
      return_error e
    end

    def sync_arbitrage_offer(remi_offer_id:, disabled:)
      params = {
        nonce: next_nonce,
        remi_offer_id: remi_offer_id,
        disabled: disabled,
      }
      url = "#{host}/api/v1/arbitrage_offers/sync"
      res = post_with_signature(url, params)
      [JSON.parse(res.body_str), res.response_code == 201]
    rescue => e
      return_error e
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
portal-connectors-0.58.39xc lib/portal-connectors/arbitrage_client.rb
portal-connectors-0.58.39xb lib/portal-connectors/arbitrage_client.rb
portal-connectors-0.58.39xa lib/portal-connectors/arbitrage_client.rb
portal-connectors-0.58.39fj lib/portal-connectors/arbitrage_client.rb
portal-connectors-0.58.39fg lib/portal-connectors/arbitrage_client.rb
portal-connectors-0.58.38xn lib/portal-connectors/arbitrage_client.rb