diff --git a/lib/models/funding_offer.rb b/lib/models/funding_offer.rb index 34800a6..ee8a41a 100644 --- a/lib/models/funding_offer.rb +++ b/lib/models/funding_offer.rb @@ -38,8 +38,8 @@ def to_new_order_packet data = { :type => @type, :symbol => @symbol, - :amount => BigDecimal.new(@amount, 8).to_s, - :rate => BigDecimal.new(@rate, 8).to_s, + :amount => BigDecimal(@amount, 8).to_s, + :rate => BigDecimal(@rate, 8).to_s, :period => 2 } if !@flags.nil? diff --git a/lib/models/order.rb b/lib/models/order.rb index aede9bf..6a854b8 100644 --- a/lib/models/order.rb +++ b/lib/models/order.rb @@ -173,7 +173,7 @@ def to_new_order_packet :cid => cid, :symbol => @symbol, :type => @type, - :amount => BigDecimal.new(@amount, 8).to_s, + :amount => BigDecimal(@amount, 8).to_s, :flags => @flags || 0, :meta => @meta } @@ -184,14 +184,14 @@ def to_new_order_packet data[:lev] = @lev end - data[:price] = BigDecimal.new(@price, 5).to_s if !@price.nil? - data[:price_trailing] = BigDecimal.new(@price_trailing, 5).to_s if !@price_trailing.nil? + data[:price] = BigDecimal(@price, 5).to_s if !@price.nil? + data[:price_trailing] = BigDecimal(@price_trailing, 5).to_s if !@price_trailing.nil? if !@price_aux_limit.nil? if is_oco - data[:price_oco_stop] = BigDecimal.new(@price_aux_limit, 5).to_s + data[:price_oco_stop] = BigDecimal(@price_aux_limit, 5).to_s else - data[:price_aux_limit] = BigDecimal.new(@price_aux_limit, 5).to_s + data[:price_aux_limit] = BigDecimal(@price_aux_limit, 5).to_s end end diff --git a/lib/rest/v2/funding.rb b/lib/rest/v2/funding.rb index 5edb8ac..69fa068 100644 --- a/lib/rest/v2/funding.rb +++ b/lib/rest/v2/funding.rb @@ -78,7 +78,7 @@ def close_funding(funding) # @return [Array] Raw notification ### def submit_funding_auto(currency, amount, period, rate='0', status=1) - dec_amount = BigDecimal.new(amount, 8).to_s + dec_amount = BigDecimal(amount, 8).to_s payload = { :status => status, :currency => currency, :amount => dec_amount, :period => period, :rate => rate } authenticated_post("auth/w/funding/auto", params: payload).body end