zaif_wrapper 0.1.2 → 1.0.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 +4 -4
- data/README.md +40 -21
- data/lib/zaif_wrapper/client.rb +1 -1
- data/lib/zaif_wrapper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 899ad442302474aadf58b6ea93dfbb6a52db27a8cab327ce1511b0bb4682a144
|
4
|
+
data.tar.gz: edad02e0e2f78256ec45f05d4c62329ab0bc6e7296e80b8badc531ca0e176572
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26d2411465a72482e16fbb80abfc2e8c126c3dc5ad2c1ef1b49a39f8a864b06e1191ae3ded0b51f00d9d2f457269aef284ed8b070f4493994be3a5d2078102dc
|
7
|
+
data.tar.gz: efbd39d03a388d9bfd728bec0a92c5fff5ce838be51ba0b40ecf2132b322c87ef4679b19179d78f0d6a2c4827aec996679c1f95faef5e0a7448400e30e5cd812
|
data/README.md
CHANGED
@@ -26,10 +26,10 @@ Require zaif_wrapper:
|
|
26
26
|
require 'zaif_wrapper'
|
27
27
|
```
|
28
28
|
|
29
|
-
#### Public Client
|
29
|
+
#### [Public Client](http://techbureau-api-document.readthedocs.io/ja/latest/public/index.html)
|
30
30
|
```ruby
|
31
31
|
# If you only plan on touching public API endpoints.
|
32
|
-
client =
|
32
|
+
client = ZaifWrapper::Client::ZaifPublicApi.new
|
33
33
|
```
|
34
34
|
|
35
35
|
Create various requests:
|
@@ -38,50 +38,68 @@ Create various requests:
|
|
38
38
|
client.currencies('btc') # => [{ "name": "btc", "is_token": false }]
|
39
39
|
client.currency_pairs('btc_jpy')
|
40
40
|
client.last_price('btc_jpy')
|
41
|
+
client.ticker('btc_jpy')
|
42
|
+
client.trades('btc_jpy')
|
41
43
|
client.depth('btc_jpy')
|
42
44
|
```
|
43
45
|
|
44
|
-
#### Private Client
|
46
|
+
#### [Private Client](http://techbureau-api-document.readthedocs.io/ja/latest/trade/index.html)
|
45
47
|
```ruby
|
46
48
|
# If you only plan on touching Future API endpoints.
|
47
|
-
client =
|
49
|
+
client = ZaifWrapper::Client::ZaifPrivateApi.new(api_key, api_secret)
|
48
50
|
```
|
49
51
|
|
50
52
|
```ruby
|
51
|
-
client.
|
52
|
-
client.
|
53
|
-
client.
|
54
|
-
client.
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
53
|
+
client.get_info
|
54
|
+
client.get_info2
|
55
|
+
client.get_personal_info
|
56
|
+
client.get_id_info
|
57
|
+
client.trade_history
|
58
|
+
client.active_orders
|
59
|
+
client.trade({
|
60
|
+
currency_pair: 'btc_jpy',
|
61
|
+
action: 'bid',
|
62
|
+
price: 1000000,
|
63
|
+
amount: 0.0001
|
64
|
+
})
|
65
|
+
client.cancel_order({
|
66
|
+
order_id: 1
|
67
|
+
})
|
68
|
+
client.withdraw({
|
69
|
+
currency: 'btc',
|
70
|
+
address: 'abcabcabcabc',
|
71
|
+
amount: 0.3
|
72
|
+
})
|
73
|
+
client.deposit_history({
|
74
|
+
currency: 'jpy'
|
75
|
+
})
|
76
|
+
client.withdraw_history({
|
77
|
+
currency: 'jpy'
|
78
|
+
})
|
61
79
|
```
|
62
80
|
|
63
|
-
#### Future Client(
|
81
|
+
#### [Future Client](http://techbureau-api-document.readthedocs.io/ja/latest/public_futures/index.html)
|
64
82
|
```ruby
|
65
83
|
# If you only plan on touching Future API endpoints.
|
66
|
-
client =
|
84
|
+
client = ZaifWrapper::Client::ZaifFutureApi.new
|
67
85
|
```
|
68
86
|
|
69
|
-
#### Leverage Client(
|
87
|
+
#### [Leverage Client](http://techbureau-api-document.readthedocs.io/ja/latest/trade_leverage/index.html)
|
70
88
|
```ruby
|
71
89
|
# If you only plan on touching Leverage API endpoints.
|
72
|
-
client =
|
90
|
+
client = ZaifWrapper::Client::ZaifLeverageApi.new
|
73
91
|
```
|
74
92
|
|
75
|
-
#### WebSocket Client(
|
93
|
+
#### [WebSocket Client](http://techbureau-api-document.readthedocs.io/ja/latest/public/3_streaming.html)
|
76
94
|
```ruby
|
77
95
|
# If you only plan on connecting WebSocket API endpoints.
|
78
|
-
client =
|
96
|
+
client = ZaifWrapper::Client::ZaifStreamApi.new
|
79
97
|
client.stream('btc_jpy')
|
80
98
|
```
|
81
99
|
|
82
100
|
## Contributing
|
83
101
|
|
84
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/cobafan/
|
102
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/cobafan/zaifWrapper.
|
85
103
|
## License
|
86
104
|
|
87
105
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
@@ -90,3 +108,4 @@ The gem is available as open source under the terms of the [MIT License](http://
|
|
90
108
|
|
91
109
|
If This library is useful to you feel free to donate zaif with twitter chip.
|
92
110
|
* screen_name: cobafan
|
111
|
+
* donate_me: https://zaif.jp/social/tw/sendtip
|
data/lib/zaif_wrapper/client.rb
CHANGED
@@ -11,7 +11,6 @@ module ZaifWrapper
|
|
11
11
|
PRIVATE_REQUEST_URL_BASE = 'https://api.zaif.jp/tapi'.freeze
|
12
12
|
FUTURE_REQUEST_URL_BASE = 'https://api.zaif.jp/fapi/1/'.freeze
|
13
13
|
LEVERAGE_REQUEST_URL_BASE = 'https://api.zaif.jp/tlapi'.freeze
|
14
|
-
LEVERAGE_METHODS = ['get_positions', 'position_history', 'active_positions', 'create_position', 'change_position', 'cancel_position'].freeze
|
15
14
|
PUBLIC_METHODS = {
|
16
15
|
:currencies => 'currency_code',
|
17
16
|
:currency_pairs => 'currency_pair',
|
@@ -22,6 +21,7 @@ module ZaifWrapper
|
|
22
21
|
}.freeze
|
23
22
|
PRIVATE_METHODS = ['get_info', 'get_info2', 'get_personal_info', 'get_id_info', 'trade_history', 'active_orders', 'trade', 'cancel_order', 'withdraw', 'deposit_history', 'withdraw_history'].freeze
|
24
23
|
FUTURE_METHODS = ['groups', 'last_price', 'ticker', 'trades', 'depth'].freeze
|
24
|
+
LEVERAGE_METHODS = ['get_positions', 'position_history', 'active_positions', 'create_position', 'change_position', 'cancel_position'].freeze
|
25
25
|
|
26
26
|
def get_request(host, path)
|
27
27
|
response = RestClient.get "#{host}#{path}"
|
data/lib/zaif_wrapper/version.rb
CHANGED