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