binance-ruby 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/binance/api/margin/order.rb +23 -0
- data/lib/binance/api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09f5f77206284ebedb2a0f1d95e8c82c332362ad5c447244081c52447754da65'
|
4
|
+
data.tar.gz: 17ade78a7eaff0f6d8d4538cebde68877c4e0b6e6838f844068fefb3d60c5957
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae97db01f0ca888aa4c0ff933455286934a0526cc19beeddd1ce23b992f884ae3ae6a4f3d2137f992b1dd4182ff2377bcec85bacdc02126926dea85d7546e259
|
7
|
+
data.tar.gz: 07d4309dc23201d4bb120353a14caece000904535297fdd15f07efcea2c854a9c0688ed9891cc420ee77b156780c91ac41862049596c682b6ea74389e81ede29
|
@@ -3,6 +3,19 @@ module Binance
|
|
3
3
|
module Margin
|
4
4
|
class Order
|
5
5
|
class << self
|
6
|
+
def cancel!(symbol: nil, isIsolated: false, orderId: nil, origClientOrderId: nil,
|
7
|
+
newClientOrderId: nil, recvWindow: nil)
|
8
|
+
timestamp = Configuration.timestamp
|
9
|
+
params = {
|
10
|
+
symbol: symbol, isIsolated: isIsolated, orderId: orderId, origClientOrderId: origClientOrderId,
|
11
|
+
newClientOrderId: newClientOrderId, recvWindow: recvWindow, timestamp: timestamp,
|
12
|
+
}.delete_if { |_, value| value.nil? }
|
13
|
+
ensure_required_cancel_keys!(params: params)
|
14
|
+
path = "/sapi/v1/margin/order"
|
15
|
+
Request.send!(api_key_type: :trading, method: :delete, path: path,
|
16
|
+
params: params, security_type: :margin, tld: Configuration.tld)
|
17
|
+
end
|
18
|
+
|
6
19
|
def create!(symbol: nil, isIsolated: false, side: nil, type: nil, quantity: nil,
|
7
20
|
quoteOrderQty: nil, price: nil, stopPrice: nil, newClientOrderId: nil,
|
8
21
|
icebergQty: nil, newOrderRespType: nil, sideEffectType: nil, timeInForce: nil,
|
@@ -47,6 +60,16 @@ module Binance
|
|
47
60
|
def required_create_keys
|
48
61
|
[:symbol, :side, :type, :timestamp].freeze
|
49
62
|
end
|
63
|
+
|
64
|
+
def ensure_required_cancel_keys!(params:)
|
65
|
+
keys = required_cancel_keys.dup
|
66
|
+
missing_keys = keys.select { |key| params[key].nil? }
|
67
|
+
raise Error.new(message: "required keys are missing: #{missing_keys.join(", ")}") unless missing_keys.empty?
|
68
|
+
end
|
69
|
+
|
70
|
+
def required_cancel_keys
|
71
|
+
[:symbol, :timestamp].freeze
|
72
|
+
end
|
50
73
|
end
|
51
74
|
end
|
52
75
|
end
|
data/lib/binance/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: binance-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jake Peterson
|
@@ -206,5 +206,5 @@ requirements: []
|
|
206
206
|
rubygems_version: 3.0.8
|
207
207
|
signing_key:
|
208
208
|
specification_version: 4
|
209
|
-
summary: binance-ruby-0.6.
|
209
|
+
summary: binance-ruby-0.6.3
|
210
210
|
test_files: []
|