ruby_bitbankcc 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/ruby_bitbankcc/bitbankcc.rb +45 -4
- data/lib/ruby_bitbankcc/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: fc8169297a30c9a81ede199ab65d2927b54fd688
|
4
|
+
data.tar.gz: cbd7fcecce1679707f127e50632d58a847733f3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e084f4acc42a51576f74add2599ac44808e77e4435a240e22e42c3024bad5114430302c0d796139a11d815444214e130c96c2b26dfb5dcac566e0b1afcd0da71
|
7
|
+
data.tar.gz: ac912545a363bcae99d59f0ad172a40c5f33a88d4f959047621b9a32ceab39243fd655e8e849cead41ffac92576d28b21f669e5eecf56bd011cb6e6b3ad504ac
|
data/README.md
CHANGED
@@ -32,5 +32,8 @@ bbcc.read_balance()
|
|
32
32
|
bbcc.read_active_orders('btc_jpy')
|
33
33
|
bbcc.create_order('btc_jpy', "0.001", 130000, 'buy', 'limit')
|
34
34
|
bbcc.cancel_order('btc_jpy', order_id)
|
35
|
+
bbcc.read_trade_history('btc_jpy')
|
36
|
+
bbcc.read_withdrawal_account('btc')
|
37
|
+
bbcc.request_withdrawal('btc', 'ACCOUNT UUID', '0.001', 'OTP TOKEN', 'SMS TOKEN')
|
35
38
|
JSON.parse(response.body)
|
36
39
|
```
|
@@ -12,7 +12,7 @@ class Bitbankcc
|
|
12
12
|
@@base_public_url = "https://public.bitbank.cc"
|
13
13
|
@@ssl = true
|
14
14
|
|
15
|
-
def initialize(key, secret, params = {})
|
15
|
+
def initialize(key = nil, secret = nil, params = {})
|
16
16
|
@key = key
|
17
17
|
@secret = secret
|
18
18
|
if !params[:base_url].nil?
|
@@ -29,7 +29,6 @@ class Bitbankcc
|
|
29
29
|
request_for_get(path, nonce)
|
30
30
|
end
|
31
31
|
|
32
|
-
|
33
32
|
def read_active_orders(pair, count = nil, from_id = nil, end_id = nil, since = nil, _end = nil)
|
34
33
|
path = "/v1/user/spot/active_orders"
|
35
34
|
nonce = Time.now.to_i.to_s
|
@@ -67,6 +66,44 @@ class Bitbankcc
|
|
67
66
|
request_for_post(path, nonce, body)
|
68
67
|
end
|
69
68
|
|
69
|
+
def read_trade_history(pair, count = nil, order_id = nil, since = nil, _end = nil, order = nil)
|
70
|
+
path = "/v1/user/spot/trade_history"
|
71
|
+
nonce = Time.now.to_i.to_s
|
72
|
+
params = {
|
73
|
+
pair: pair,
|
74
|
+
count: count,
|
75
|
+
order_id: order_id,
|
76
|
+
since: since,
|
77
|
+
end: _end,
|
78
|
+
order: order
|
79
|
+
}.compact
|
80
|
+
|
81
|
+
request_for_get(path, nonce, params)
|
82
|
+
end
|
83
|
+
|
84
|
+
def read_withdrawal_account(asset)
|
85
|
+
path = "/v1/user/withdrawal_account"
|
86
|
+
nonce = Time.now.to_i.to_s
|
87
|
+
params = {
|
88
|
+
asset: asset
|
89
|
+
}.compact
|
90
|
+
|
91
|
+
request_for_get(path, nonce, params)
|
92
|
+
end
|
93
|
+
|
94
|
+
def request_withdrawal(asset, uuid, amount, otp_token = nil, sms_token = nil)
|
95
|
+
path = "/v1/user/request_withdrawal"
|
96
|
+
nonce = Time.now.to_i.to_s
|
97
|
+
body = {
|
98
|
+
asset: asset,
|
99
|
+
uuid: uuid,
|
100
|
+
amount: amount,
|
101
|
+
otp_token: otp_token,
|
102
|
+
sms_token: sms_token
|
103
|
+
}.compact.to_json
|
104
|
+
request_for_post(path, nonce, body)
|
105
|
+
end
|
106
|
+
|
70
107
|
def read_ticker(pair)
|
71
108
|
RestClient.get @@base_public_url + "/#{pair}/ticker"
|
72
109
|
end
|
@@ -82,8 +119,12 @@ class Bitbankcc
|
|
82
119
|
private
|
83
120
|
def http_request(uri, request)
|
84
121
|
https = Net::HTTP.new(uri.host, uri.port)
|
85
|
-
|
86
|
-
|
122
|
+
|
123
|
+
if @@ssl
|
124
|
+
https.use_ssl = true
|
125
|
+
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
126
|
+
end
|
127
|
+
|
87
128
|
response = https.start do |h|
|
88
129
|
h.request(request)
|
89
130
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_bitbankcc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bitbankcc
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|