coinone 0.4.0 → 0.5.0

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: 0aefd02378e40eca9136bb2fb48c8fa626158810
4
- data.tar.gz: 382f3ea145b76062ff485ecfdab7506f1968dff5
3
+ metadata.gz: a3294629f31009d0067b41d9b57a5377dba3d923
4
+ data.tar.gz: dd8de5708feeefa4a7d20e0e586190d128464335
5
5
  SHA512:
6
- metadata.gz: fea50289bad08e6dd8238547350771d23dc926a9b9aa31d3549bdb5dcba1623883f8c104f23d51f104330bfdf453886469b1bbe0fd20de33b0bfa3a732fa513f
7
- data.tar.gz: 25317412c2f0f155366f99c63c32d2b7ae0250f10e773d98a7312a0127f8e89aef818082067e2cb84e10e536739305d7ed62d4d9bbb323a1e6a1ca671ed50204
6
+ metadata.gz: 7b8d5d164202d26a3aa9e8910ca069429866f9834c779109e9e13eed763d0bda5de8b4fcfe8166f0201e1be21eee5827b22bb3601d2802406d07e7d5a3b72b70
7
+ data.tar.gz: 7c61e7efb3d99baa7ab292cd9ae4d960b38ae778bf2fb094f4903229d77313c15f7a91ae1bf63e38f2daa3f00af4033b4a7278f7dfbe3afecabbd2c2118238c9
@@ -1,5 +1,16 @@
1
1
  ## Release History
2
2
 
3
+ * **v0.5.0** - 2017-03-15
4
+ - Porting `OrderV2 / Cancel All Order`
5
+ - Porting `OrderV2 / Cancel Order`
6
+ - Porting `OrderV2 / Limit Buy`
7
+ - Porting `OrderV2 / Limit Sell`
8
+ - Porting `OrderV2 / Market Buy`
9
+ - Porting `OrderV2 / Market Sell`
10
+ - Porting `OrderV2 / My Complete Orders`
11
+ - Porting `OrderV2 / My Limit Orders`
12
+
13
+
3
14
  * **v0.4.0** - 2017-03-15
4
15
  - Porting `AccountV2 / Daily Balance`
5
16
  - Porting `AccountV2 / Deposit Address`
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Coinone
2
2
  [![GemVersion](https://badge.fury.io/rb/coinone.svg)](https://badge.fury.io/rb/coinone) ![](http://ruby-gem-downloads-badge.herokuapp.com/coinone?type=total) [![Code Climate](https://lima.codeclimate.com/github/ggomagundan/coinone/badges/gpa.svg)](https://lima.codeclimate.com/github/ggomagundan/coinone)
3
- [![Build Status](https://travis-ci.org/ggomagundan/coinone.svg?branch=master)](https://travis-ci.org/ggomagundan/coinone) [![GitHub issues](https://img.shields.io/github/issues/ggomagundan/coinone.svg)](https://github.com/ggomagundan/coinone/issues) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/ggomagundan/coinone/master/LICENSE.txt)
3
+
4
+ [![Build Status](https://travis-ci.org/ggomagundan/coinone.svg?branch=master)](https://travis-ci.org/ggomagundan/coinone) [![GitHub issues](https://img.shields.io/github/issues/ggomagundan/coinone.svg)](https://github.com/ggomagundan/coinone/issues) [![Dependency Status](https://gemnasium.com/badges/github.com/ggomagundan/coinone.svg)](https://gemnasium.com/github.com/ggomagundan/coinone) [![Coverage Status](https://coveralls.io/repos/github/ggomagundan/coinone/badge.svg)](https://coveralls.io/github/ggomagundan/coinone)
5
+
6
+ [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/ggomagundan/coinone/master/LICENSE.txt)
4
7
 
5
8
  `Coinone` Gem is Ruby Language porting from Coinone API, and only support V2.
6
9
 
@@ -32,37 +35,37 @@ user = Coinone::Account.new(access_token: ENV['COINONE_ACCESS_TOKEN'], secret_k
32
35
  user_info = user.get_user_info
33
36
 
34
37
  ```
35
- AttributeName | Class | Description
36
- ----------- | ------------- | -------------
37
- result | String | Request's result
38
- security_level | Integer | User's security level. Summation of authentications.
39
- virtual_account_info ||Virtual account's information.
40
- - depositor|String|Virtual account's depositor.
41
- - account_number|String |Virtual account's number.
42
- - bank_name|String |Virtual account's bank name.
43
- mobile_info ||Mobile authentication's information.
44
- - user_name|String |Mobile phone's user name.
45
- - phone_number|String | Phone number.
46
- - phone_corp|String| Mobile phone's corporation code.
47
- - is_authenticated|Boolean | 'true' If a user is authenticated.
48
- bank_info||User's bank information.
49
- - depositor|String |Account's depositor.
50
- - bank_code |String |Account's bankCode. ([Link](https://en.wikipedia.org/wiki/List_of_banks_in_South_Korea))
51
- - account_number|String |Account's number.
52
- - is_authenticated|Boolean |'true' if a user is authenticated.
53
- email_info||User's email information.
54
- - is_authenticated |Boolean | 'true' if a user is authenticated.
55
- - email |String |User's email address.
56
- fee_rates ||User's fee.
57
- - btc | |User's fee.
58
- - - maker |Float |Percent of BTC maker fee.
59
- - - taker |Float |Percent of BTC taker fee.
60
- - eth | |User's fee.
61
- - - maker | Float |Percent of ETH maker fee.
62
- - - taker|Float |Percent of ETH taker fee.
63
- - etc | |User's fee.
64
- - - maker |Float |Percent of ETC maker fee.
65
- - - taker |Float |Percent of ETC taker fee.
38
+ |AttributeName | Class | Description|
39
+ |----------- | ------------- | -------------|
40
+ |result | String | Request's result|
41
+ |security_level | Integer | User's security level. Summation of authentications.|
42
+ |virtual_account_info ||Virtual account's information.|
43
+ |- depositor|String|Virtual account's depositor.|
44
+ |- account_number|String |Virtual account's number.|
45
+ |- bank_name|String |Virtual account's bank name.|
46
+ | mobile_info ||Mobile authentication's information.|
47
+ |- user_name|String |Mobile phone's user name.|
48
+ |- phone_number|String | Phone number.|
49
+ |- phone_corp|String| Mobile phone's corporation code.|
50
+ |- is_authenticated|Boolean | 'true' If a user is authenticated.|
51
+ |bank_info||User's bank information.|
52
+ |- depositor|String |Account's depositor.|
53
+ |- bank_code |String |Account's bankCode. ([Link](https://en.wikipedia.org/wiki/List_of_banks_in_South_Korea))|
54
+ |- account_number|String |Account's number.|
55
+ |- is_authenticated|Boolean |'true' if a user is authenticated.|
56
+ |email_info||User's email information.|
57
+ |- is_authenticated |Boolean | 'true' if a user is authenticated.|
58
+ |- email |String |User's email address.|
59
+ | fee_rates ||User's fee.|
60
+ |- btc | |User's fee.|
61
+ |- - maker |Float |Percent of BTC maker fee.|
62
+ |- - taker |Float |Percent of BTC taker fee.|
63
+ |- eth | |User's fee.|
64
+ |- - maker | Float |Percent of ETH maker fee.|
65
+ |- - taker|Float |Percent of ETH taker fee.|
66
+ |- etc | |User's fee.|
67
+ |- - maker |Float |Percent of ETC maker fee.|
68
+ |- - taker |Float |Percent of ETC taker fee.|
66
69
 
67
70
  - ACCOUNT V2 / Balance
68
71
  ```ruby
@@ -71,21 +74,21 @@ user = Coinone::Account.new(access_token: ENV['COINONE_ACCESS_TOKEN'], secret_k
71
74
  balance = user.get_balance
72
75
 
73
76
  ```
74
- AttributeName | Class | Description
75
- ----------- | ------------- | -------------
76
- result | String | Request's result
77
- btc||BTC information.
78
- - avail|BigDecimal|Available BTC.
79
- - balance|BigDecimal|Total BTC.
80
- eth||ETH information.
81
- - avail|BigDecimal|Available ETH.
82
- - balance|BigDecimal|Total ETH.
83
- etc||ETC information.
84
- - avail|BigDecimal|Available ETC.
85
- - balance|BigDecimal|Total ETC.
86
- normal_wallets|Array|BTC normal wallet information.
87
- - balance|BigDecimal|Total BTC.
88
- - label|String |Normal Wallet Label.
77
+ |AttributeName | Class | Description|
78
+ |----------- | ------------- | -------------|
79
+ |result | String | Request's result|
80
+ |btc||BTC information.|
81
+ |- avail|BigDecimal|Available BTC.|
82
+ |- balance|BigDecimal|Total BTC.|
83
+ |eth||ETH information.|
84
+ |- avail|BigDecimal|Available ETH.|
85
+ |- balance|BigDecimal|Total ETH.|
86
+ |etc||ETC information.|
87
+ |- avail|BigDecimal|Available ETC.|
88
+ |- balance|BigDecimal|Total ETC.|
89
+ |normal_wallets|Array|BTC normal wallet information.|
90
+ |- balance|BigDecimal|Total BTC.|
91
+ |- label|String |Normal Wallet Label.|
89
92
 
90
93
 
91
94
 
@@ -96,17 +99,18 @@ user = Coinone::Account.new(access_token: ENV['COINONE_ACCESS_TOKEN'], secret_k
96
99
  daily_balance = user.get_daily_balance
97
100
 
98
101
  ```
99
- AttributeName | Class | Description
100
- ----------- | ------------- | -------------
101
- result | String | Request's result
102
- daily_balances|Array|Daily balance's information.
103
- - timestamp|Integer|Timestamp
104
- - value|Integer|Overall balance's value in KRW.
105
- - btc|BigDecimal|BTC balance.
106
- - etc|BigDecimal|ETH balance.
107
- - etc|BigDecimal|ETC balance.
108
- - krw|BigDecimal|KRW balance.
109
- -
102
+ |AttributeName | Class | Description|
103
+ |----------- | ------------- | -------------|
104
+ |result | String | Request's result|
105
+ |daily_balances|Array|Daily balance's information.|
106
+ |- timestamp|Integer|Timestamp|
107
+ |- value|Integer|Overall balance's value in KRW.|
108
+ |- btc|BigDecimal|BTC balance.|
109
+ |- etc|BigDecimal|ETH balance.|
110
+ |- etc|BigDecimal|ETC balance.|
111
+ |- krw|BigDecimal|KRW balance.|
112
+
113
+
110
114
  - ACCOUNT V2 / Deposit Address
111
115
  ```ruby
112
116
  user = Coinone::Account.new(access_token: ENV['COINONE_ACCESS_TOKEN'], secret_key: ENV['COINONE_SECRET_KEY'])
@@ -115,18 +119,33 @@ deposit_address = user.get_deposit_address
115
119
 
116
120
  ```
117
121
 
118
- AttributeName | Class | Description
119
- ----------- | ------------- | -------------
120
- result | String | Request's result
121
- btc||BTC information.
122
- - address|String|BTC wallet address.
123
- eth||ETH information.
124
- - address|String|ETH wallet address.
125
- etc||ETC information.
126
- - address|String|ETC wallet address.
122
+ |AttributeName | Class | Description|
123
+ |----------- | ------------- | -------------|
124
+ |result | String | Request's result|
125
+ |btc||BTC information.|
126
+ |- address|String|BTC wallet address.|
127
+ |eth||ETH information.|
128
+ |- address|String|ETH wallet address.|
129
+ |etc||ETC information.|
130
+ |- address|String|ETC wallet address.|
127
131
 
128
132
  - ACCOUNT V2 / Virtual Account
129
133
 
134
+ ```ruby
135
+ user = Coinone::Account.new(access_token: ENV['COINONE_ACCESS_TOKEN'], secret_key: ENV['COINONE_SECRET_KEY'])
136
+
137
+ virtual_address = user.get_virtual_address
138
+
139
+ ```
140
+
141
+ |AttributeName | Class | Description|
142
+ |----------- | ------------- | -------------|
143
+ |result | String | Request's result|
144
+ |depositor|String|Virtual account's depositor.|
145
+ |account_number|String|Virtual account's number.|
146
+ |bank_name|String|Virtual account's bank name.|
147
+
148
+
130
149
  #### OAUTH
131
150
 
132
151
  - OAUTH / Delete Access Token
@@ -137,12 +156,128 @@ etc||ETC information.
137
156
  #### ORDER V2
138
157
 
139
158
  - ORDER V2 / Cancel All Order
159
+
160
+ ```ruby
161
+ order = Coinone::Order.new(access_token: ENV['COINONE_ACCESS_TOKEN'], secret_key: ENV['COINONE_SECRET_KEY'])
162
+
163
+ default_cancel_all = order.cancel_all_order() # Default currency "btc"
164
+ btc_cancel_all = order.cancel_all_order(currency: "btc")
165
+ eth_cancel_all = order.cancel_all_order(currency: "eth")
166
+ etc_cancel_all = order.cancel_all_order(currency: "etc")
167
+
168
+ ```
169
+ |AttributeName | Class | Description|
170
+ |----------- | ------------- | -------------|
171
+ |result | String | Request's result|
172
+ |success_canceled_orders|The number of canceled orders.|
173
+ |overall_orders|Integer|The number of overall orders before canceled.|
174
+
140
175
  - ORDER V2 / Cancel Order
176
+ ```ruby
177
+ order = Coinone::Order.new(access_token: ENV['COINONE_ACCESS_TOKEN'], secret_key: ENV['COINONE_SECRET_KEY'])
178
+
179
+ cancel_order = order.cancel_order(order_id: "COINONE_ORDER_ID", price: CANCEL_PRICE, qty: CANCEL_QTY, is_ask: 1(SET "1" IS SELL) , currency: "btc or eth or etc")
180
+ # cancel_order = order.cancel_order(order_id: "f9c53135-952d-44ef-bc77-b3ab4f1c445c", price: 1500000, qty: 0.3, is_ask: 1, currency: "eth")
181
+
182
+
183
+ ```
184
+ |AttributeName | Class | Description|
185
+ |----------- | ------------- | -------------|
186
+ |result | String | Request's result|
187
+
141
188
  - ORDER V2 / Limit Buy
189
+
190
+ ```ruby
191
+ order = Coinone::Order.new(access_token: ENV['COINONE_ACCESS_TOKEN'], secret_key: ENV['COINONE_SECRET_KEY'])
192
+
193
+ limit_buy = order.get_limit_buy(currency: "currency: "btc or eth or etc"", price: BUY_PRICE, qty: BUY_QTY)
194
+ # limit_buy = order.get_limit_buy(currency: "eth", price: 56000, qty: 1)
195
+
196
+ ```
197
+ |AttributeName | Class | Description|
198
+ |----------- | ------------- | -------------|
199
+ |result | String | Request's result|
200
+ |order_id | String | Order ID|
201
+
202
+
142
203
  - ORDER V2 / Limit Sell
204
+ ```ruby
205
+ order = Coinone::Order.new(access_token: ENV['COINONE_ACCESS_TOKEN'], secret_key: ENV['COINONE_SECRET_KEY'])
206
+
207
+ limit_buy = order.get_limit_sell(currency: "currency: "btc or eth or etc"", price: BUY_PRICE, qty: BUY_QTY)
208
+ # limit_buy = order.get_limit_sell(currency: "eth", price: 56000, qty: 1)
209
+
210
+ ```
211
+ |AttributeName | Class | Description|
212
+ |----------- | ------------- | -------------|
213
+ |result | String | Request's result|
214
+ |order_id | String | Order ID|
215
+
143
216
  - ORDER V2 / Market Buy
217
+ ```ruby
218
+ order = Coinone::Order.new(access_token: ENV['COINONE_ACCESS_TOKEN'], secret_key: ENV['COINONE_SECRET_KEY'])
219
+
220
+ limit_buy = order.get_market_buy(currency: "currency: "btc or eth or etc"", price: BUY_PRICE)
221
+ # limit_buy = order.get_market_buy(currency: "eth", price: 200000)
222
+
223
+ ```
224
+ |AttributeName | Class | Description|
225
+ |----------- | ------------- | -------------|
226
+ |result | String | Request's result|
227
+ |order_id | String | Order ID|
228
+
144
229
  - ORDER V2 / Market Sell
230
+ ```ruby
231
+ order = Coinone::Order.new(access_token: ENV['COINONE_ACCESS_TOKEN'], secret_key: ENV['COINONE_SECRET_KEY'])
232
+
233
+ limit_buy = order.get_market_sell(currency: "currency: "btc or eth or etc"", qty: SELL_QTY)
234
+ # limit_buy = order.get_market_sell(currency: "eth", qty: 10)
235
+
236
+ ```
237
+ |AttributeName | Class | Description|
238
+ |----------- | ------------- | -------------|
239
+ |result | String | Request's result|
240
+ |order_id | String | Order ID|
241
+
145
242
  - ORDER V2 / My Complete Orders
243
+ ```ruby
244
+ order = Coinone::Order.new(access_token: ENV['COINONE_ACCESS_TOKEN'], secret_key: ENV['COINONE_SECRET_KEY'])
245
+
246
+ complete_orders = order.get_complete_orders(currency: "eth")
247
+
248
+ ```
249
+ |AttributeName | Class | Description|
250
+ |----------- | ------------- | -------------|
251
+ |result | String | Request's result|
252
+ |complete_orders |Array|List of completed orders.|
253
+ |- timestamp|Integer|Timestamp.|
254
+ |- price|Integer|price of order.|
255
+ |- qty|Float|quantity of order.|
256
+ |- type|String|Order Type sell: 'ask', buy: 'bid'|
257
+ |- fee_rate|Float|Fee rate.|
258
+ |- fee|Float|Fee.|
259
+ |- order_id|String|Order ID.|
260
+
261
+
262
+ - ORDER V2 / My Limit Orders
263
+ ```ruby
264
+ order = Coinone::Order.new(access_token: ENV['COINONE_ACCESS_TOKEN'], secret_key: ENV['COINONE_SECRET_KEY'])
265
+
266
+ complete_orders = order.get_complete_orders(currency: "eth")
267
+
268
+ ```
269
+ |AttributeName | Class | Description|
270
+ |----------- | ------------- | -------------|
271
+ |result | String | Request's result|
272
+ |limit_orders |Array|List of limit orders.|
273
+ |- index|Integer|Index of order..|
274
+ |- timestamp|Integer|Timestamp.|
275
+ |- price|Integer|price of order.|
276
+ |- qty|Float|quantity of order.|
277
+ |- order_id|String|Order ID.|
278
+ |- type|String|Order Type sell: 'ask', buy: 'bid'|
279
+ |- fee_rate|Float|Fee rate.|
280
+
146
281
 
147
282
  #### PUBLIC
148
283
 
@@ -155,11 +290,11 @@ currency = Coinone::Public.get_currency
155
290
 
156
291
  ```
157
292
 
158
- AttributeName | Class | Description
159
- ----------- | ------------- | -------------
160
- result | String | Request's result
161
- currency|Float |Currency Rate.
162
- currency_type |String | Currency Type. Ex) USD, KRW..
293
+ |AttributeName | Class | Description|
294
+ |----------- | ------------- | -------------|
295
+ |result | String | Request's result|
296
+ |currency|Float |Currency Rate.|
297
+ |currency_type |String | Currency Type. Ex) USD, KRW..|
163
298
 
164
299
 
165
300
  - PUBLIC / Orderbook
@@ -173,17 +308,17 @@ eth_orderbook = Coinone::Public.get_orderbook(currency: "eth") # ETH Orderbook
173
308
  etc_orderbook = Coinone::Public.get_orderbook(currency: "etc") # ETC Orderbook
174
309
 
175
310
  ```
176
- AttributeName | Class | Description
177
- ----------- | ------------- | -------------
178
- result | String | Request's result
179
- ask |Array|Ask List.
180
- - price|Integer|Ask KRW price.
181
- - qty|Float|Ask BTC(or ETH, ETC) quantity.
182
- bid|Array|Bid List.
183
- - price |Integer|Bid KRW price.
184
- - qty|Float|Bid BTC(or ETH, ETC) quantity.
185
- timestamp|Integer|Timestamp.
186
- currency|String |Currency.
311
+ |AttributeName | Class | Description|
312
+ |----------- | ------------- | -------------|
313
+ |result | String | Request's result|
314
+ |ask |Array|Ask List.|
315
+ |- price|Integer|Ask KRW price.|
316
+ |- qty|Float|Ask BTC(or ETH, ETC) quantity.|
317
+ |bid|Array|Bid List.|
318
+ |- price |Integer|Bid KRW price.|
319
+ |- qty|Float|Bid BTC(or ETH, ETC) quantity.|
320
+ |timestamp|Integer|Timestamp.|
321
+ |currency|String |Currency.|
187
322
 
188
323
 
189
324
  - PUBLIC / Recent Complete Orders
@@ -203,15 +338,16 @@ etc_hour_complete_orders = Coinone::Public.get_complete_orders(currency: "etc",
203
338
  etc_day_complete_orders = Coinone::Public.get_complete_orders(currency: "etc", period: "day") # ETC and Hour Complete Orders
204
339
 
205
340
  ```
206
- AttributeName | Class | Description
207
- ----------- | ------------- | -------------
208
- result | String | Request's result
209
- orders |Array|Recent complete orders.
210
- - price|Integer|Ask KRW price.
211
- - qty|Float|BTC(or ETH, ETC) quantity.
212
- - timestamp|Integer|Timestamp.
213
- timestamp|Integer|Timestamp.
214
- currency|String |Currency.
341
+
342
+ |AttributeName | Class | Description|
343
+ |----------- | ------------- | -------------|
344
+ |result | String | Request's result|
345
+ |orders |Array|Recent complete orders.|
346
+ |- price|Integer|Ask KRW price.|
347
+ |- qty|Float|BTC(or ETH, ETC) quantity.|
348
+ |- timestamp|Integer|Timestamp.|
349
+ |timestamp|Integer|Timestamp.|
350
+ |currency|String |Currency.|
215
351
 
216
352
 
217
353
 
@@ -228,17 +364,18 @@ etc_ticker = Coinone::Public.get_ticker(currency: "etc") # ETC Ticker
228
364
  all_ticker = Coinone::Public.get_ticker(currency: "all") # ALL Ticker
229
365
 
230
366
  ```
231
- AttributeName | Class | Description
232
- ----------- | ------------- | -------------
233
- result | String | Request's result
234
- timestamp|Integer|Timestamp.
235
- tickers |Array|Tickers List
236
- - high|Integer|Highest price in 24 hours.
237
- - low|Integer|Lowest price in 24 hours.
238
- - last |Integer|Last completed price.
239
- - first |Integer|First price in 24 hours.
240
- - volume|Float|BTC volume of completed orders in 24 hours.
241
- - currency|String |Currency.
367
+
368
+ |AttributeName | Class | Description|
369
+ |----------- | ------------- | -------------|
370
+ |result | String | Request's result|
371
+ |timestamp|Integer|Timestamp.|
372
+ |tickers |Array|Tickers List|
373
+ |- high|Integer|Highest price in 24 hours.|
374
+ |- low|Integer|Lowest price in 24 hours.|
375
+ |- last |Integer|Last completed price.|
376
+ |- first |Integer|First price in 24 hours.|
377
+ |- volume|Float|BTC volume of completed orders in 24 hours.|
378
+ |- currency|String |Currency.|
242
379
 
243
380
 
244
381
 
@@ -255,21 +392,21 @@ tickers |Array|Tickers List
255
392
  - [x] ACCOUNT V2 / Balance
256
393
  - [x] ACCOUNT V2 / Daily Balance
257
394
  - [x] ACCOUNT V2 / Deposit Address
258
- - [ ] ACCOUNT V2 / Virtual Account
395
+ - [x] ACCOUNT V2 / Virtual Account
259
396
 
260
397
  - [ ] OAUTH / Delete Access Token
261
398
  - [ ] OAUTH / Get Access Token
262
399
  - [ ] OAUTH / Get Request Token
263
400
  - [ ] OAUTH / Refresh Access Token
264
401
 
265
- - [ ] ORDER V2 / Cancel All Order
266
- - [ ] ORDER V2 / Cancel Order
267
- - [ ] ORDER V2 / Limit Buy
268
- - [ ] ORDER V2 / Limit Sell
269
- - [ ] ORDER V2 / Market Buy
270
- - [ ] ORDER V2 / Market Sell
271
- - [ ] ORDER V2 / My Complete Orders
272
- - [ ] ORDER V2 / My Limit Orders
402
+ - [x] ORDER V2 / Cancel All Order
403
+ - [x] ORDER V2 / Cancel Order
404
+ - [x] ORDER V2 / Limit Buy
405
+ - [x] ORDER V2 / Limit Sell
406
+ - [x] ORDER V2 / Market Buy
407
+ - [x] ORDER V2 / Market Sell
408
+ - [x] ORDER V2 / My Complete Orders
409
+ - [x] ORDER V2 / My Limit Orders
273
410
 
274
411
  - [x] PUBLIC / Currency
275
412
  - [x] PUBLIC / OrderBook
@@ -287,7 +424,7 @@ The Documentation is at [Coinone Docs](http://doc.coinone.co.kr/)
287
424
 
288
425
  ## Change Log
289
426
 
290
- Current Version 0.4.0
427
+ Current Version 0.5.0
291
428
 
292
429
  This link listing [Change Log](https://github.com/ggomagundan/coinone/blob/master/CHANGE_LOG.md)
293
430
 
@@ -3,6 +3,7 @@ require "coinone/version"
3
3
  module Coinone
4
4
  require 'coinone/connection'
5
5
  require 'coinone/account'
6
+ require 'coinone/order'
6
7
  require 'coinone/public'
7
8
  require 'coinone/error'
8
9
  end
@@ -2,13 +2,14 @@ require "coinone/account/account_info"
2
2
  require "coinone/account/balance"
3
3
  require "coinone/account/daily_balance"
4
4
  require "coinone/account/deposit_address"
5
+ require "coinone/account/virtual_account"
5
6
 
6
7
  module Coinone
7
8
 
8
9
  class Account
9
10
 
10
11
  attr_reader :connection
11
- attr_reader :account_info, :balance, :daily_balance, :deposit_address
12
+ attr_reader :account_info, :balance, :daily_balance, :deposit_address, :virtual_account
12
13
 
13
14
  def initialize(options={}, connection=nil)
14
15
 
@@ -17,6 +18,7 @@ module Coinone
17
18
  @balance = Balance.new()
18
19
  @daily_balance = DailyBalance.new()
19
20
  @deposit_address = DepositAddress.new()
21
+ @virtual_account = VirtualAccount.new()
20
22
 
21
23
  end
22
24
 
@@ -38,9 +40,9 @@ module Coinone
38
40
 
39
41
  end
40
42
 
41
- def get_daily_balance(options={})
43
+ def get_daily_balance
42
44
 
43
- response = @connection.post("/v2/account/daily_balance/", options)
45
+ response = @connection.post("/v2/account/daily_balance/")
44
46
 
45
47
  @daily_balance.update_balance(response)
46
48
  @daily_balance
@@ -56,6 +58,16 @@ module Coinone
56
58
 
57
59
  end
58
60
 
61
+ def get_virtual_account
62
+
63
+ response = @connection.post("/v2/account/virtual_account/")
64
+
65
+ @virtual_account.update_virtual_account(response)
66
+ @virtual_account
67
+
68
+ end
69
+
70
+
59
71
 
60
72
 
61
73
  =begin
@@ -0,0 +1,84 @@
1
+ require "coinone/account/account_info"
2
+ require "coinone/account/balance"
3
+ require "coinone/account/daily_balance"
4
+ require "coinone/account/deposit_address"
5
+ require "coinone/account/virtual_account"
6
+
7
+ module Coinone
8
+
9
+ class Account
10
+
11
+ attr_reader :connection
12
+ attr_reader :account_info, :balance, :daily_balance, :deposit_address, :virtual_account
13
+
14
+ def initialize(options={}, connection=nil)
15
+
16
+ @connection = connection || Connection.factory(options)
17
+ @account_info = AccountInfo.new()
18
+ @balance = Balance.new()
19
+ @daily_balance = DailyBalance.new()
20
+ @deposit_address = DepositAddress.new()
21
+
22
+ end
23
+
24
+
25
+ def get_user_info
26
+ response = @connection.post( "/v2/account/user_info/")
27
+
28
+ @account_info.update_user_info(response)
29
+ @account_info
30
+
31
+ end
32
+
33
+ def get_balance
34
+
35
+ response = @connection.post("/v2/account/balance/")
36
+
37
+ @balance.update_balance(response)
38
+ @balance
39
+
40
+ end
41
+
42
+ def get_daily_balance
43
+
44
+ response = @connection.post("/v2/account/daily_balance/")
45
+
46
+ @daily_balance.update_balance(response)
47
+ @daily_balance
48
+
49
+ end
50
+
51
+ def get_deposit_address
52
+
53
+ response = @connection.post("/v2/account/deposit_address/")
54
+
55
+ @deposit_address.update_address(response)
56
+ @deposit_address
57
+
58
+ end
59
+
60
+ def get_virtual_account
61
+
62
+ response = @connection.post("/v2/account/virtual_account/")
63
+
64
+ @virtual_account.update_address(response)
65
+ @virtual_account
66
+
67
+ end
68
+
69
+
70
+
71
+
72
+ =begin
73
+ def security_level
74
+ return @security_level
75
+ end
76
+
77
+ def security_level=(new_security_level)
78
+ @security_level = new_security_level
79
+ end
80
+ =end
81
+
82
+
83
+ end
84
+ end
@@ -0,0 +1,34 @@
1
+ module Coinone
2
+
3
+ class Account
4
+
5
+ class VirtualAccount
6
+
7
+ attr_reader :result
8
+ attr_reader :depositor, :account_number, :bank_name
9
+
10
+ def initialize(options={})
11
+
12
+ @result = options[:result] || nil
13
+ @depositor = nil
14
+ @account_number = nil
15
+ @bank_name = nil
16
+
17
+ update_virtual_account(options)
18
+
19
+ end
20
+
21
+ def update_virtual_account(params={})
22
+
23
+ @result = params[:result] if params.has_key? :result
24
+ @depositor = params[:depositor] if params.has_key? :depositor
25
+ @account_number = params[:accountNumber] if params.has_key? :accountNumber
26
+ @bank_name = params[:bankName] if params.has_key? :bankName
27
+
28
+ end
29
+
30
+
31
+
32
+ end
33
+ end
34
+ end
@@ -46,7 +46,7 @@ module Coinone
46
46
 
47
47
  def post( connection_uri, params = {} )
48
48
  params[:access_token] = @access_token
49
- params[:nonce] = Time.now.to_i
49
+ params[:nonce] = Time.now.to_i
50
50
  payload = create_coinone_payload(params)
51
51
  signature = create_coinone_signature(payload)
52
52
  #puts "Send To : #{connection_uri}"
@@ -0,0 +1,106 @@
1
+ require 'coinone/order/cancel_all_order_response'
2
+ require 'coinone/order/cancel_order_response'
3
+ require 'coinone/order/trade_response'
4
+ require 'coinone/order/complete_orders'
5
+ require 'coinone/order/limit_orders'
6
+
7
+ module Coinone
8
+
9
+ class Order
10
+
11
+ attr_reader :connection
12
+ attr_reader :cancel_all_order_response, :cancel_order_response, :limit_sell, :limit_buy
13
+ attr_reader :market_buy, :market_sell, :complete_orders, :limit_orders
14
+
15
+
16
+ def initialize(options={}, connection=nil)
17
+
18
+ @connection = connection || Connection.factory(options)
19
+ @cancel_all_order_response = CancelAllOrderResponse.new()
20
+ @cancel_order_response = CancelOrderResponse.new()
21
+ @limit_sell = TradeResponse.new()
22
+ @limit_buy = TradeResponse.new()
23
+ @market_sell = TradeResponse.new()
24
+ @market_buy = TradeResponse.new()
25
+ @complete_orders = CompleteOrders.new()
26
+ @limit_orders = LimitOrders.new()
27
+
28
+ end
29
+
30
+
31
+ def cancel_all_order(options={})
32
+ options[:currency] = "btc" if options[:currency].blank?
33
+ response = @connection.post( "/v2/order/cancel_all/", options)
34
+
35
+ @cancel_all_order_response.update_response(response)
36
+ @cancel_all_order_response
37
+
38
+ end
39
+
40
+ def cancel_order(options={})
41
+ options[:currency] = "btc" if options[:currency].blank?
42
+ response = @connection.post( "/v2/order/cancel/", options)
43
+
44
+ @cancel_order_response.update_response(response)
45
+ @cancel_order_response
46
+
47
+ end
48
+
49
+ def get_limit_sell(options={})
50
+
51
+ options[:currency] = "btc" if options[:currency].blank?
52
+ response = @connection.post( "/v2/order/limit_sell/", options)
53
+
54
+ @limit_sell.update_response(response)
55
+ @limit_sell
56
+ end
57
+
58
+ def get_limit_buy(options = {})
59
+ options[:currency] = "btc" if options[:currency].blank?
60
+ response = @connection.post( "/v2/order/limit_buy/", options)
61
+
62
+ @limit_buy.update_response(response)
63
+ @limit_buy
64
+
65
+ end
66
+
67
+ def get_market_buy(options={})
68
+ options[:currency] = "btc" if options[:currency].blank?
69
+ response = @connection.post( "/v2/order/market_buy/", options)
70
+
71
+ @market_buy.update_response(response)
72
+ @market_buy
73
+
74
+ end
75
+
76
+ def get_market_sell(options={})
77
+ options[:currency] = "btc" if options[:currency].blank?
78
+ response = @connection.post( "/v2/order/market_sell/", options)
79
+
80
+ @market_sell.update_response(response)
81
+ @market_sell
82
+
83
+ end
84
+
85
+ def get_complete_orders(options={})
86
+ options[:currency] = "btc" if options[:currency].blank?
87
+ response = @connection.post( "/v2/order/complete_orders/", options)
88
+
89
+ @complete_orders.update_response(response)
90
+ @complete_orders
91
+
92
+
93
+ end
94
+
95
+
96
+ def get_limit_orders(options={})
97
+ options[:currency] = "btc" if options[:currency].blank?
98
+ response = @connection.post( "/v2/order/limit_orders/", options)
99
+
100
+ @limit_orders.update_response(response)
101
+ @limit_orders
102
+
103
+ end
104
+
105
+ end
106
+ end
@@ -0,0 +1,32 @@
1
+
2
+ module Coinone
3
+
4
+ class Order
5
+
6
+ class CancelAllOrderResponse
7
+
8
+ attr_reader :result
9
+ attr_reader :success_canceled_orders, :overall_orders
10
+
11
+ def initialize(options={})
12
+
13
+ @result = options[:result] || nil
14
+ @success_canceled_orders = nil
15
+ @overall_orders = nil
16
+
17
+ update_response(options)
18
+
19
+
20
+ end
21
+
22
+ def update_response(params={})
23
+
24
+ @result = params[:result] if params.has_key? :result
25
+ @success_canceled_orders = params[:successCanceledOrders].to_i if params.has_key? :successCanceledOrders
26
+ @overall_orders = params[:overallOrders].to_i if params.has_key? :overallOrders
27
+
28
+ end
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,27 @@
1
+
2
+ module Coinone
3
+
4
+ class Order
5
+
6
+ class CancelOrderResponse
7
+
8
+ attr_reader :result
9
+
10
+ def initialize(options={})
11
+
12
+ @result = options[:result] || nil
13
+
14
+ update_response(options)
15
+
16
+
17
+ end
18
+
19
+ def update_response(params={})
20
+
21
+ @result = params[:result] if params.has_key? :result
22
+
23
+ end
24
+
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,35 @@
1
+ require 'coinone/order/complete_orders/complete_order'
2
+ module Coinone
3
+
4
+ class Order
5
+
6
+ class CompleteOrders
7
+
8
+ attr_reader :result
9
+ attr_reader :complete_orders
10
+
11
+ def initialize(options={})
12
+
13
+ @result = options[:result] || nil
14
+ @complete_orders = []
15
+
16
+ update_response(options)
17
+
18
+
19
+ end
20
+
21
+ def update_response(params={})
22
+
23
+ @result = params[:result] if params.has_key? :result
24
+ if params[:completeOrders].present?
25
+ @complete_orders = []
26
+ params[:completeOrders].each do |complete_order|
27
+ @complete_orders.push(CompleteOrder.new(complete_order))
28
+ end
29
+ end
30
+
31
+ end
32
+
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,42 @@
1
+
2
+ module Coinone
3
+
4
+ class Order
5
+
6
+ class CompleteOrders
7
+ class CompleteOrder
8
+
9
+ attr_reader :timestamp, :price, :type, :qty, :fee_rate, :fee, :order_id
10
+
11
+ def initialize(options={})
12
+
13
+ @timestamp = nil
14
+ @price = nil
15
+ @type = nil
16
+ @qty = nil
17
+ @fee_rate = nil
18
+ @fee = nil
19
+ @order_id = nil
20
+
21
+
22
+ update_response(options)
23
+
24
+
25
+ end
26
+
27
+ def update_response(params={})
28
+
29
+ @timestamp = params[:timestamp].to_i if params.has_key? :timestamp
30
+ @price = params[:price].to_i if params.has_key? :price
31
+ @qty = params[:qty].to_f if params.has_key? :qty
32
+ @type = params[:type] if params.has_key? :type
33
+ @fee_rate = params[:feeRate].to_f if params.has_key? :feeRate
34
+ @fee = params[:fee].to_f if params.has_key? :fee
35
+ @order_id = params[:orderId] if params.has_key? :orderId
36
+
37
+ end
38
+
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,36 @@
1
+ require 'coinone/order/limit_orders/limit_order'
2
+
3
+ module Coinone
4
+
5
+ class Order
6
+
7
+ class LimitOrders
8
+
9
+ attr_reader :result
10
+ attr_reader :complete_orders
11
+
12
+ def initialize(options={})
13
+
14
+ @result = options[:result] || nil
15
+ @limit_orders = []
16
+
17
+ update_response(options)
18
+
19
+
20
+ end
21
+
22
+ def update_response(params={})
23
+
24
+ @result = params[:result] if params.has_key? :result
25
+ if params[:limitOrders].present?
26
+ @limit_orders = []
27
+ params[:limitOrders].each do |limit_order|
28
+ @limit_orders.push(LimitOrder.new(limit_order))
29
+ end
30
+ end
31
+
32
+ end
33
+
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,42 @@
1
+
2
+ module Coinone
3
+
4
+ class Order
5
+
6
+ class LimitOrders
7
+ class LimitOrder
8
+
9
+ attr_reader :index, :timestamp, :price, :type, :qty, :fee_rate, :order_id
10
+
11
+ def initialize(options={})
12
+
13
+ @index = nil
14
+ @timestamp = nil
15
+ @price = nil
16
+ @type = nil
17
+ @qty = nil
18
+ @fee_rate = nil
19
+ @order_id = nil
20
+
21
+ update_response(options)
22
+
23
+
24
+ end
25
+
26
+ def update_response(params={})
27
+
28
+
29
+ @index = params[:index].to_i if params.has_key? :index
30
+ @timestamp = params[:timestamp].to_i if params.has_key? :timestamp
31
+ @price = params[:price].to_i if params.has_key? :price
32
+ @qty = params[:qty].to_f if params.has_key? :qty
33
+ @order_id = params[:orderId] if params.has_key? :orderId
34
+ @type = params[:type] if params.has_key? :type
35
+ @fee_rate = params[:feeRate].to_f if params.has_key? :feeRate
36
+
37
+ end
38
+
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,32 @@
1
+
2
+ module Coinone
3
+
4
+ class Order
5
+
6
+ class CancelAllOrderResponse
7
+
8
+ attr_reader :result
9
+ attr_reader :success_canceled_orders, :overall_orders
10
+
11
+ def initialize(options={})
12
+
13
+ @result = options[:result] || nil
14
+ @success_canceled_orders = nil
15
+ @overall_orders = nil
16
+
17
+ update_response(options)
18
+
19
+
20
+ end
21
+
22
+ def update_response(params={})
23
+
24
+ @result = params[:result] if params.has_key? :result
25
+ @success_canceled_orders = params[:successCanceledOrders] if params.has_key? :successCanceledOrders
26
+ @overall_orders = params[:overallOrders] if params.has_key? :overallOrders
27
+
28
+ end
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,32 @@
1
+
2
+ module Coinone
3
+
4
+ class Order
5
+
6
+ class CancelAllOrderResponse
7
+
8
+ attr_reader :result
9
+ attr_reader :success_canceled_orders, :overall_orders
10
+
11
+ def initialize(options={})
12
+
13
+ @result = options[:result] || nil
14
+ @success_canceled_orders = nil
15
+ @overall_orders = nil
16
+
17
+ update_response(options)
18
+
19
+
20
+ end
21
+
22
+ def update_response(params={})
23
+
24
+ @result = params[:result] if params.has_key? :result
25
+ @success_canceled_orders = params[:successCanceledOrders] if params.has_key? :successCanceledOrders
26
+ @overall_orders = params[:overallOrders] if params.has_key? :overallOrders
27
+
28
+ end
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,30 @@
1
+
2
+ module Coinone
3
+
4
+ class Order
5
+
6
+ class TradeResponse
7
+
8
+ attr_reader :result
9
+ attr_reader :order_id
10
+
11
+ def initialize(options={})
12
+
13
+ @result = options[:result] || nil
14
+ @order_id= nil
15
+
16
+ update_response(options)
17
+
18
+
19
+ end
20
+
21
+ def update_response(params={})
22
+
23
+ @result = params[:result] if params.has_key? :result
24
+ @order_id = params[:orderId] if params.has_key? :orderId
25
+
26
+ end
27
+
28
+ end
29
+ end
30
+ end
@@ -1,3 +1,3 @@
1
1
  module Coinone
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coinone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kai Park
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-15 00:00:00.000000000 Z
11
+ date: 2017-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -127,6 +127,7 @@ files:
127
127
  - coinone.gemspec
128
128
  - lib/coinone.rb
129
129
  - lib/coinone/account.rb
130
+ - lib/coinone/account/;
130
131
  - lib/coinone/account/account_info.rb
131
132
  - lib/coinone/account/account_info/bank_info.rb
132
133
  - lib/coinone/account/account_info/email_info.rb
@@ -141,8 +142,19 @@ files:
141
142
  - lib/coinone/account/daily_balance/balance.rb
142
143
  - lib/coinone/account/deposit_address.rb
143
144
  - lib/coinone/account/deposit_address/wallet.rb
145
+ - lib/coinone/account/virtual_account.rb
144
146
  - lib/coinone/connection.rb
145
147
  - lib/coinone/error.rb
148
+ - lib/coinone/order.rb
149
+ - lib/coinone/order/cancel_all_order_response.rb
150
+ - lib/coinone/order/cancel_order_response.rb
151
+ - lib/coinone/order/complete_orders.rb
152
+ - lib/coinone/order/complete_orders/complete_order.rb
153
+ - lib/coinone/order/limit_orders.rb
154
+ - lib/coinone/order/limit_orders/limit_order.rb
155
+ - lib/coinone/order/market_buy.rb
156
+ - lib/coinone/order/market_sell.rb
157
+ - lib/coinone/order/trade_response.rb
146
158
  - lib/coinone/public.rb
147
159
  - lib/coinone/public/complete_orders.rb
148
160
  - lib/coinone/public/complete_orders/complete_order.rb