okex 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 463b9adff7eb98e1fa712f06153edbc29b80870aede2cd2913681da84f0e5b66
4
- data.tar.gz: 428d38ce826c5e3e01ddcd43c3a9e8e4e5b2de1d4f41139497ad5beee818b452
3
+ metadata.gz: c89695e5a69a030932da7523030a2653250666a64b5d6be96cc49302c44f42b6
4
+ data.tar.gz: a556bf958a0c14b9b94e6b2ac91c5320541fb4fb05307920d8b60f6b28faa170
5
5
  SHA512:
6
- metadata.gz: 615e679ffb2f370020af864cdc753bcf7cb836a83e73a127046f09712b1a81a4d20dcbe94643e19177f1c61578fb8e3bfd44f752673fed56ab4208d4eeda7ee0
7
- data.tar.gz: dc96eacc3985d1889eac587fee049b2c174eca9e245d03e66a4bfb3f1cb8c1871c99cb73ef70f5b418703883f4e6927888c7806492841fb76a71f9b4b43a332a
6
+ metadata.gz: a9bf7db9c81660b0295ac62a4fd217b79c888de5422b94fdcafb37cbb0b57db10c33c9d2d0ebe2522c2d98fa92acaf261784ef19b18b208585e55a80dae37c01
7
+ data.tar.gz: bf336b5e91e7d003afdcb262ada4f94a799d4704d4dff27b8c7e3f55f14cb750d6255da5c3e5d6e2d8c1daa5e2421757aa340032db0748ad7f92adacdda90e38
data/lib/okex/api_v5.rb CHANGED
@@ -112,6 +112,8 @@ class OKEX::ApiV5
112
112
  # @param inst_id [String] 合约名称
113
113
  def stop_loss_price(inst_id)
114
114
  result = client.get(host, "/api/v5/trade/orders-algo-pending?instId=#{inst_id}&instType=SWAP&ordType=conditional")
115
+
116
+ return -1 if result.empty?
115
117
  return result[0]["slTriggerPx"].to_i if result.size == 1
116
118
 
117
119
  raise "invalid result: #{result.inspect}"
data/lib/okex/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module OKEX
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: okex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Zhang