huobi_client 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/lib/huobi_client/client.rb +10 -10
- data/lib/huobi_client/request.rb +1 -0
- data/lib/huobi_client/response.rb +1 -0
- data/lib/huobi_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21fcbb5ba72a6a814ab0d1005350a1770acef76a
|
4
|
+
data.tar.gz: 634bdb2f30073ef7cf7fe55823fe0e05cc78c817
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f79dae9b68f11a79633e214ff096ac40e969251a7d5e17a0729d00e44cb3ff0cb9606ca62ccc2f733062f95650990e43ff4e6c1708f5479a5b6e2d67e557ed42
|
7
|
+
data.tar.gz: cd74093847d5f7d6d3b951bc33db433950178b3d5fb094f65b766c8c472b7700393740611fb4ec0bf40bd081ab4b742de7a185b4f2825e504cd7d6f49dacaaf4
|
data/.gitignore
CHANGED
data/lib/huobi_client/client.rb
CHANGED
@@ -75,7 +75,7 @@ module HuobiClient
|
|
75
75
|
end
|
76
76
|
|
77
77
|
# 交易API
|
78
|
-
def place(account_id
|
78
|
+
def place(account_id: @account_id, symbol:, type:, amount:, price: nil, source: 'api') # Pro站下单
|
79
79
|
# types
|
80
80
|
# buy-market:市价买,
|
81
81
|
# sell-market:市价卖,
|
@@ -86,7 +86,7 @@ module HuobiClient
|
|
86
86
|
post '/v1/order/orders/place', fun_params(__method__, binding).transform_keys {|key| key.to_s.sub('_', '-')}
|
87
87
|
end
|
88
88
|
|
89
|
-
def hadax_place(account_id
|
89
|
+
def hadax_place(account_id: @account_id, symbol:, type:, amount:, price: nil, source: 'api') # HADAX站下单
|
90
90
|
post '/v1/hadax/order/orders/place', fun_params(__method__, binding).transform_keys {|key| key.to_s.sub('_', '-')}
|
91
91
|
end
|
92
92
|
|
@@ -98,21 +98,21 @@ module HuobiClient
|
|
98
98
|
post '/v1/order/orders/batchcancel', fun_params(__method__, binding).transform_keys {|key| key.to_s.sub('_', '-')}
|
99
99
|
end
|
100
100
|
|
101
|
-
def order_detail # 查询某个订单详情
|
102
|
-
get "/v1/order/orders/#{
|
101
|
+
def order_detail(order_id:) # 查询某个订单详情
|
102
|
+
get "/v1/order/orders/#{order_id}"
|
103
103
|
end
|
104
104
|
|
105
|
-
def match_results # 查询某个订单的成交明细
|
106
|
-
get "/v1/order/orders/#{
|
105
|
+
def match_results(order_id:) # 查询某个订单的成交明细
|
106
|
+
get "/v1/order/orders/#{order_id}/matchresults"
|
107
107
|
end
|
108
108
|
|
109
|
-
def orders(symbol
|
109
|
+
def orders(symbol: nil, states:, types: nil, start_date: nil, end_date: nil, from: nil, direct: nil, size: nil) # 查询当前委托、历史委托
|
110
110
|
# direct false string 查询方向 prev 向前,next 向后
|
111
111
|
# states true string 查询的订单状态组合,使用','分割 pre-submitted 准备提交, submitted 已提交, partial-filled 部分成交, partial-canceled 部分成交撤销, filled 完全成交, canceled 已撤销
|
112
112
|
get '/v1/order/orders', fun_params(__method__, binding).transform_keys {|key| key.to_s.sub('_', '-')}
|
113
113
|
end
|
114
114
|
|
115
|
-
def all_match_results(symbol
|
115
|
+
def all_match_results(symbol: nil, states:, types: nil, start_date: nil, end_date: nil, from: nil, direct: nil, size: nil) # 查询当前成交、历史成交
|
116
116
|
get '/v1/order/matchresults', fun_params(__method__, binding).transform_keys {|key| key.to_s.sub('_', '-')}
|
117
117
|
end
|
118
118
|
|
@@ -130,8 +130,8 @@ module HuobiClient
|
|
130
130
|
post '/v1/margin/orders', fun_params(__method__, binding)
|
131
131
|
end
|
132
132
|
|
133
|
-
def margin_repay(amount:) # 归还借贷
|
134
|
-
post "/v1/margin/orders/#{
|
133
|
+
def margin_repay(amount:, order_id:) # 归还借贷
|
134
|
+
post "/v1/margin/orders/#{order_id}/repay", fun_params(__method__, binding)
|
135
135
|
end
|
136
136
|
|
137
137
|
def loan_orders(symbol:, states: nil, start_date: nil, end_date: nil, from: nil, direct: nil, size: nil) # 借贷订单
|
data/lib/huobi_client/request.rb
CHANGED
data/lib/huobi_client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: huobi_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vcinly
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|