bitflyer 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d0a5803fb1c59025047dc57e2d68098aecbf86dc
4
- data.tar.gz: cab306e2ff3c80bc0ea50af1cc405c4a3e5adfeb
3
+ metadata.gz: 1fe1a563928289a8e8aaef7cbe25549dd18810ef
4
+ data.tar.gz: 249c561de32e3d2eff443dbe3454cbb36d5dc900
5
5
  SHA512:
6
- metadata.gz: ed458055798e5d28368fb2c21f9150c153f1d182dd148715c280cf546f4538cf05ce29f5285bf9d826a65d0f51e4414cc88a7ea89a65f97be89388c26dab43d6
7
- data.tar.gz: 1390d7daa1e4ce69d53a48dfc7c5c3b17ea9150c8c47f509e4438260c519029b7862a0bc36bda143bfe2172f88c92f13a84db3fb59f90249f02fca31b47210c7
6
+ metadata.gz: 7060497afcac7294de5a9c1f8639110eceb8f5ae4c183ca8f46eebb49a17987dd18a39025d944fb64fa2971c8aae8f5691b4392094abce2b664c69b0b07012b5
7
+ data.tar.gz: 2766ff1aa67e219dbf46ec8823feee55cd83a3dcaf7e84e251373e96265d12c2a36e2bb3a9e2083b0e724e370d3852dbdecac39647f6ef3ec99c4dc4caeb60d6
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bitflyer (0.0.4)
4
+ bitflyer (0.1.0)
5
5
  faraday (~> 0.12.2)
6
6
  faraday_middleware (~> 0.11.0.1)
7
7
  pubnub (~> 4.0.22)
@@ -38,16 +38,31 @@ module Bitflyer
38
38
  @connection.get('/v1/me/getdeposits').body
39
39
  end
40
40
 
41
- def withdraw
42
- # TBD
41
+ def withdraw(currency_code: 'JPY', bank_account_id: nil, amount: nil, code: nil)
42
+ body = {
43
+ currency_code: currency_code,
44
+ bank_account_id: bank_account_id,
45
+ amount: amount,
46
+ code: code
47
+ }.delete_if { |_, v| v.nil? }
48
+ @connection.post('/v1/me/withdraw', body).body
43
49
  end
44
50
 
45
51
  def withdrawals
46
52
  @connection.get('/v1/me/getwithdrawals').body
47
53
  end
48
54
 
49
- def send_child_order
50
- #TBD
55
+ def send_child_order(product_code: 'BTC_JPY', child_order_type: nil, side: nil, price: nil, size: nil, minute_to_expire: nil, time_in_force: 'GTC')
56
+ body = {
57
+ product_code: product_code,
58
+ child_order_type: child_order_type,
59
+ side: side,
60
+ price: price,
61
+ size: size,
62
+ minute_to_expire: minute_to_expire,
63
+ time_in_force: time_in_force
64
+ }.delete_if { |_, v| v.nil? }
65
+ @connection.post('/v1/me/sendchildorder', body).body
51
66
  end
52
67
 
53
68
  def cancel_child_order(product_code: 'BTC_JPY', child_order_id: nil, child_order_acceptance_id: nil)
@@ -56,11 +71,17 @@ module Bitflyer
56
71
  child_order_id: child_order_id,
57
72
  child_order_acceptance_id: child_order_acceptance_id
58
73
  }.delete_if { |_, v| v.nil? }
59
- @connection.post('/v1/me/cancelchildorder', body)
74
+ @connection.post('/v1/me/cancelchildorder', body).body
60
75
  end
61
76
 
62
- def send_parent_order
63
- #TBD
77
+ def send_parent_order(order_method: nil, minute_to_expire: nil, time_in_force: 'GTC', parameters: parameters)
78
+ body = {
79
+ order_method: order_method,
80
+ minute_to_expire: minute_to_expire,
81
+ time_in_force: time_in_force,
82
+ parameters: parameters
83
+ }.delete_if { |_, v| v.nil? }
84
+ @connection.post('/v1/me/sendparentorder', body).body
64
85
  end
65
86
 
66
87
  def cancel_parent_order(product_code: 'BTC_JPY', parent_order_id: nil, parent_order_acceptance_id: nil)
@@ -69,7 +90,7 @@ module Bitflyer
69
90
  parent_order_id: parent_order_id,
70
91
  parent_order_acceptance_id: parent_order_acceptance_id
71
92
  }.delete_if { |_, v| v.nil? }
72
- @connection.post('/v1/me/cancelparentorder', body)
93
+ @connection.post('/v1/me/cancelparentorder', body).body
73
94
  end
74
95
 
75
96
  def cancel_all_child_orders(product_code: 'BTC_JPY')
@@ -1,3 +1,3 @@
1
1
  module Bitflyer
2
- VERSION = '0.0.4'
2
+ VERSION = '0.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitflyer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Ueki