kucoin_ruby 0.1.12 → 0.1.13

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
  SHA1:
3
- metadata.gz: 41ceaa91694c68a5c0631273c6de9e21f14cee14
4
- data.tar.gz: 853cda8f6091da05562e3ef1cf7eda1d238033b9
3
+ metadata.gz: 15ecfe53a79f626b26262f5c7a11863011b1f5c0
4
+ data.tar.gz: 4593ef6b260eb18de1143c6f3c8183082c4ca8f9
5
5
  SHA512:
6
- metadata.gz: f60026de687d4211e70561ed0aae025bbb8e2df3f3651367f421515ea22c5eb826b9f0a8917787785ad67893ae40e80f36eabd427632513f60558d116186dbaf
7
- data.tar.gz: bbf43e93f62736cfc3df4d6da68afd668d4a22b3952c236f0d5701245b828aedbd69a77b923282a55df0e824626a92cf374aae3ea9a32bcd673bccf16096edd6
6
+ metadata.gz: 77759703b70c47e8ddb9c0db98629cbc1b0f4a3790b6135412ab002c2cd2a97e35b0a93b749a9f689e747a21200b8e33475949fed4164ec2ce98f824e0f2b119
7
+ data.tar.gz: bbb2979a32b832ab925f4068c59f0142315b76888083f77af4f3e87a2f17acbc28263970e263f20b376dfc47490dbf9701792a94e14a9a0eb2ebcb5e39ed2816
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 0.1.13
2
+
3
+ ### Changed
4
+
5
+ - Fix Active_orders endpoint
6
+ - Fix Recent_deal_orders
7
+ - Refactor get_signed clean payload
8
+ - Fix Create_order endpoint
9
+ - Add Order_detail method on Trading class
10
+
1
11
  ## 0.1.11
2
12
 
3
13
  ### Changed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kucoin_ruby (0.1.12)
4
+ kucoin_ruby (0.1.13)
5
5
  addressable
6
6
  httparty
7
7
 
@@ -21,7 +21,7 @@ module KucoinRuby
21
21
  end
22
22
 
23
23
  def self.recent_deal_orders(symbol, limit, since)
24
- endpoint = "/v1/open/deal-orders?symbol=#{symbol}&synce=#{synce}&limit=#{limit}"
24
+ endpoint = "/v1/open/deal-orders?symbol=#{symbol}&synce=#{since}&limit=#{limit}"
25
25
  KucoinRuby::Net.get(endpoint)
26
26
  end
27
27
 
@@ -28,6 +28,7 @@ module KucoinRuby
28
28
  end
29
29
 
30
30
  def self.signed_get(endpoint, query_string = nil)
31
+ query_string = query_string&.keep_if{|_,y| y}
31
32
  nonce, signature = KucoinRuby::Util.sign_message(endpoint, query_string)
32
33
  query_string = URI.encode_www_form(query_string) if query_string.is_a? Hash
33
34
  uri = "#{API_HOST}#{endpoint}?#{query_string}"
@@ -39,8 +40,9 @@ module KucoinRuby
39
40
  end
40
41
 
41
42
  def self.signed_post(endpoint, payload = nil)
42
- nonce, signature = KucoinRuby::Util.sign_message(endpoint)
43
- uri = "#{API_HOST}#{endpoint}"
43
+ nonce, signature = KucoinRuby::Util.sign_message(endpoint, payload)
44
+ query_string = URI.encode_www_form(payload) if payload.is_a? Hash
45
+ uri = "#{API_HOST}#{endpoint}?#{query_string}"
44
46
  response = HTTParty.post(
45
47
  uri,
46
48
  headers: headers(nonce, signature),
@@ -1,20 +1,20 @@
1
1
  module KucoinRuby
2
2
  module Trading
3
3
  def self.create_order(symbol, type, price, amount)
4
- endpoint = '/v1/order'
5
- payload = {symbol: symbol, type: type, price: price, amount: amount}
4
+ endpoint = "/v1/#{symbol}/order"
5
+ payload = { amount: amount, price: price, type: type }
6
6
  KucoinRuby::Net.signed_post(endpoint, payload)
7
7
  end
8
8
 
9
- def self.active_orders(symbol = nil)
9
+ def self.active_orders(symbol, type = nil)
10
10
  endpoint = '/v1/order/active'
11
- query_string = {symbol: symbol}
11
+ query_string = {symbol: symbol, type: type}
12
12
  KucoinRuby::Net.signed_get(endpoint, query_string)
13
13
  end
14
14
 
15
15
  def self.cancel_order(symbol, order_id, type)
16
- endpoint = '/v1/cancel-order'
17
- payload = {symbol: symbol, type: type, orderOid: order_id}
16
+ endpoint = "/v1/#{symbol}/cancel-order"
17
+ payload = {orderOid: order_id, type: type}
18
18
  KucoinRuby::Net.signed_post(endpoint, payload)
19
19
  end
20
20
 
@@ -27,13 +27,19 @@ module KucoinRuby
27
27
  since: since,
28
28
  symbol: symbol,
29
29
  type: type
30
- }.keep_if{|_,y| y}
30
+ }
31
31
  KucoinRuby::Net.signed_get(endpoint, query_string)
32
32
  end
33
33
 
34
34
  def self.symbol_dealt_order(symbol, type=nil, limit=nil, page=nil )
35
35
  endpoint = '/v1/deal-orders'
36
- query_string = {limit: limit, page: page, symbol: symbol, type: type}.keep_if{|_,y| y}
36
+ query_string = {limit: limit, page: page, symbol: symbol, type: type}
37
+ KucoinRuby::Net.signed_get(endpoint, query_string)
38
+ end
39
+
40
+ def self.order_detail(symbol, type, order_id, limit=nil, page=nil )
41
+ endpoint = '/v1/order/detail'
42
+ query_string = {limit: limit, orderOid: order_id, page: page, symbol: symbol, type: type}
37
43
  KucoinRuby::Net.signed_get(endpoint, query_string)
38
44
  end
39
45
  end
@@ -1,3 +1,3 @@
1
1
  module KucoinRuby
2
- VERSION = "0.1.12"
2
+ VERSION = "0.1.13"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kucoin_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - lalo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-22 00:00:00.000000000 Z
11
+ date: 2018-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler