bitflyer 0.0.3 → 0.0.4

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: 3262fb553fca50cb3dc908ee75bc12f681c0b181
4
- data.tar.gz: 0de64d3294118b44d7172d3d8ab5f79c1dc6ee15
3
+ metadata.gz: d0a5803fb1c59025047dc57e2d68098aecbf86dc
4
+ data.tar.gz: cab306e2ff3c80bc0ea50af1cc405c4a3e5adfeb
5
5
  SHA512:
6
- metadata.gz: 95b41bdae76e09275fa237306047d28dee8d860e29af031571909c91983ac7646613c24e4080a8518bd6855d5c24b0e2c8b458df087f73a0debd20613226c28f
7
- data.tar.gz: 0eaca9e72e199ffdea0ed8374945266d61aeaccf4236c768ad1d7eac77ec6000f1d17e1afad1a1597988514ac8d5d2fa3626b82097616cd557f118849cff1ed0
6
+ metadata.gz: ed458055798e5d28368fb2c21f9150c153f1d182dd148715c280cf546f4538cf05ce29f5285bf9d826a65d0f51e4414cc88a7ea89a65f97be89388c26dab43d6
7
+ data.tar.gz: 1390d7daa1e4ce69d53a48dfc7c5c3b17ea9150c8c47f509e4438260c519029b7862a0bc36bda143bfe2172f88c92f13a84db3fb59f90249f02fca31b47210c7
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bitflyer (0.0.3)
4
+ bitflyer (0.0.4)
5
5
  faraday (~> 0.12.2)
6
6
  faraday_middleware (~> 0.11.0.1)
7
7
  pubnub (~> 4.0.22)
@@ -46,8 +46,85 @@ module Bitflyer
46
46
  @connection.get('/v1/me/getwithdrawals').body
47
47
  end
48
48
 
49
- def positions
50
- @connection.get('/v1/me/getpositions', { product_code: 'FX_BTC_JPY' }).body
49
+ def send_child_order
50
+ #TBD
51
+ end
52
+
53
+ def cancel_child_order(product_code: 'BTC_JPY', child_order_id: nil, child_order_acceptance_id: nil)
54
+ body = {
55
+ product_code: product_code,
56
+ child_order_id: child_order_id,
57
+ child_order_acceptance_id: child_order_acceptance_id
58
+ }.delete_if { |_, v| v.nil? }
59
+ @connection.post('/v1/me/cancelchildorder', body)
60
+ end
61
+
62
+ def send_parent_order
63
+ #TBD
64
+ end
65
+
66
+ def cancel_parent_order(product_code: 'BTC_JPY', parent_order_id: nil, parent_order_acceptance_id: nil)
67
+ body = {
68
+ product_code: product_code,
69
+ parent_order_id: parent_order_id,
70
+ parent_order_acceptance_id: parent_order_acceptance_id
71
+ }.delete_if { |_, v| v.nil? }
72
+ @connection.post('/v1/me/cancelparentorder', body)
73
+ end
74
+
75
+ def cancel_all_child_orders(product_code: 'BTC_JPY')
76
+ @connection.post('/v1/me/cancelallchildorders', { product_code: product_code }).body
77
+ end
78
+
79
+ def child_orders(product_code: 'BTC_JPY', count: nil, before: nil, after: nil, child_order_state: nil, parent_order_id: nil)
80
+ query = {
81
+ product_code: product_code,
82
+ count: count,
83
+ before: before,
84
+ after: after,
85
+ child_order_state: child_order_state,
86
+ parent_order_id: parent_order_id
87
+ }.delete_if { |_, v| v.nil? }
88
+ @connection.get('/v1/me/getchildorders', query).body
89
+ end
90
+
91
+ def parent_orders(product_code: 'BTC_JPY', count: nil, before: nil, after: nil, parent_order_state: nil)
92
+ query = {
93
+ product_code: product_code,
94
+ count: count,
95
+ before: before,
96
+ after: after,
97
+ parent_order_state: parent_order_state
98
+ }.delete_if { |_, v| v.nil? }
99
+ @connection.get('/v1/me/getparentorders', query).body
100
+ end
101
+
102
+ def parent_order(parent_order_id: nil, parent_order_acceptance_id: nil)
103
+ query = {
104
+ parent_order_id: parent_order_id,
105
+ parent_order_acceptance_id: parent_order_acceptance_id
106
+ }.delete_if { |_, v| v.nil? }
107
+ @connection.get('/v1/me/getparentorder', query).body
108
+ end
109
+
110
+ def executions(product_code: 'BTC_JPY', count: nil, before: nil, after: nil, child_order_id: nil, child_order_acceptance_id: nil)
111
+ query = {
112
+ product_code: product_code,
113
+ count: count,
114
+ before: before,
115
+ after: after,
116
+ child_order_id: child_order_id,
117
+ child_order_acceptance_id: child_order_acceptance_id,
118
+ }.delete_if { |_, v| v.nil? }
119
+ @connection.get('/v1/me/getexecutions', query).body
120
+ end
121
+
122
+ def positions(product_code: 'FX_BTC_JPY')
123
+ @connection.get('/v1/me/getpositions', { product_code: product_code }).body
124
+ end
125
+
126
+ def trading_commission(product_code: 'BTC_JPY')
127
+ @connection.get('v1/me/gettradingcommission', { product_code: product_code }).body
51
128
  end
52
129
  end
53
130
  end
@@ -1,3 +1,3 @@
1
1
  module Bitflyer
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitflyer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Ueki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-26 00:00:00.000000000 Z
11
+ date: 2017-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday