bitflyer 1.2.0 → 1.3.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/.all-contributorsrc +9 -0
- data/.github/dependabot.yml +23 -0
- data/Gemfile.lock +15 -11
- data/README.md +3 -2
- data/bitflyer.gemspec +1 -1
- data/lib/bitflyer/realtime/client.rb +2 -1
- data/lib/bitflyer/realtime/websocket.rb +7 -9
- data/lib/bitflyer/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b190522b3b17c7f99dd4d91d7cba88b399cd1d313e5a4aeba6537ad802daa68b
|
|
4
|
+
data.tar.gz: c53b238a8c84a01ba4ba913a329e00724ef213d6acf6b7e0a216071038a37ff5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b41f5b83d91accdac278ed3b38bbff5dc12c2d95e16b2998413661eb817a447543d25afa7e246a22f99860740fcb83af10b31cf7e7a6069674f39b2bfd74517c
|
|
7
|
+
data.tar.gz: 344832975df6df64f311975197c2d5a1f5a8e00b14b9e9ec4f9e02f72937a447304ea3d2b0bed4a922de0d2d0525cd6e8c3b6e4fc4c688570a171f3a96500956
|
data/.all-contributorsrc
CHANGED
|
@@ -22,6 +22,15 @@
|
|
|
22
22
|
"contributions": [
|
|
23
23
|
"code"
|
|
24
24
|
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"login": "fkshom",
|
|
28
|
+
"name": "Shoma FUKUDA",
|
|
29
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/1889118?v=4",
|
|
30
|
+
"profile": "https://github.com/fkshom",
|
|
31
|
+
"contributions": [
|
|
32
|
+
"code"
|
|
33
|
+
]
|
|
25
34
|
}
|
|
26
35
|
],
|
|
27
36
|
"contributorsPerLine": 7,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: bundler
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: daily
|
|
7
|
+
time: "12:00"
|
|
8
|
+
timezone: Asia/Tokyo
|
|
9
|
+
open-pull-requests-limit: 20
|
|
10
|
+
reviewers:
|
|
11
|
+
- unhappychoice
|
|
12
|
+
allow:
|
|
13
|
+
- dependency-type: direct
|
|
14
|
+
- dependency-type: indirect
|
|
15
|
+
ignore:
|
|
16
|
+
- dependency-name: rubocop
|
|
17
|
+
versions:
|
|
18
|
+
- 1.12.0
|
|
19
|
+
- 1.12.1
|
|
20
|
+
- dependency-name: regexp_parser
|
|
21
|
+
versions:
|
|
22
|
+
- 2.1.0
|
|
23
|
+
- 2.1.1
|
data/Gemfile.lock
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
bitflyer (1.
|
|
5
|
-
faraday (>= 0.14, < 1.
|
|
4
|
+
bitflyer (1.3.0)
|
|
5
|
+
faraday (>= 0.14, < 1.5)
|
|
6
6
|
faraday_middleware (>= 0.12, < 1.1)
|
|
7
7
|
websocket-client-simple (~> 0.3.0)
|
|
8
8
|
|
|
@@ -13,25 +13,29 @@ GEM
|
|
|
13
13
|
coderay (1.1.3)
|
|
14
14
|
diff-lcs (1.4.4)
|
|
15
15
|
event_emitter (0.2.6)
|
|
16
|
-
faraday (1.
|
|
16
|
+
faraday (1.4.1)
|
|
17
|
+
faraday-excon (~> 1.1)
|
|
17
18
|
faraday-net_http (~> 1.0)
|
|
19
|
+
faraday-net_http_persistent (~> 1.1)
|
|
18
20
|
multipart-post (>= 1.2, < 3)
|
|
19
|
-
ruby2_keywords
|
|
21
|
+
ruby2_keywords (>= 0.0.4)
|
|
22
|
+
faraday-excon (1.1.0)
|
|
20
23
|
faraday-net_http (1.0.1)
|
|
24
|
+
faraday-net_http_persistent (1.1.0)
|
|
21
25
|
faraday_middleware (1.0.0)
|
|
22
26
|
faraday (~> 1.0)
|
|
23
27
|
method_source (1.0.0)
|
|
24
28
|
multipart-post (2.1.1)
|
|
25
29
|
parallel (1.20.1)
|
|
26
|
-
parser (3.0.
|
|
30
|
+
parser (3.0.1.1)
|
|
27
31
|
ast (~> 2.4.1)
|
|
28
|
-
pry (0.14.
|
|
32
|
+
pry (0.14.1)
|
|
29
33
|
coderay (~> 1.1)
|
|
30
34
|
method_source (~> 1.0)
|
|
31
35
|
rainbow (3.0.0)
|
|
32
36
|
rake (13.0.3)
|
|
33
37
|
regexp_parser (2.1.1)
|
|
34
|
-
rexml (3.2.
|
|
38
|
+
rexml (3.2.5)
|
|
35
39
|
rspec (3.10.0)
|
|
36
40
|
rspec-core (~> 3.10.0)
|
|
37
41
|
rspec-expectations (~> 3.10.0)
|
|
@@ -45,17 +49,17 @@ GEM
|
|
|
45
49
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
46
50
|
rspec-support (~> 3.10.0)
|
|
47
51
|
rspec-support (3.10.2)
|
|
48
|
-
rubocop (1.
|
|
52
|
+
rubocop (1.14.0)
|
|
49
53
|
parallel (~> 1.10)
|
|
50
54
|
parser (>= 3.0.0.0)
|
|
51
55
|
rainbow (>= 2.2.2, < 4.0)
|
|
52
56
|
regexp_parser (>= 1.8, < 3.0)
|
|
53
57
|
rexml
|
|
54
|
-
rubocop-ast (>= 1.
|
|
58
|
+
rubocop-ast (>= 1.5.0, < 2.0)
|
|
55
59
|
ruby-progressbar (~> 1.7)
|
|
56
60
|
unicode-display_width (>= 1.4.0, < 3.0)
|
|
57
|
-
rubocop-ast (1.
|
|
58
|
-
parser (>=
|
|
61
|
+
rubocop-ast (1.5.0)
|
|
62
|
+
parser (>= 3.0.1.1)
|
|
59
63
|
ruby-progressbar (1.11.0)
|
|
60
64
|
ruby2_keywords (0.0.4)
|
|
61
65
|
unicode-display_width (2.0.0)
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# bitflyer
|
|
2
2
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
3
|
-
[](#contributors-)
|
|
4
4
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
5
5
|
[](https://badge.fury.io/rb/bitflyer)
|
|
6
6
|
[](https://circleci.com/gh/unhappychoice/bitflyer)
|
|
@@ -102,8 +102,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
102
102
|
<!-- markdownlint-disable -->
|
|
103
103
|
<table>
|
|
104
104
|
<tr>
|
|
105
|
-
<td align="center"><a href="http://blog.unhappychoice.com"><img src="https://avatars.githubusercontent.com/u/5608948?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Yuji Ueki</b></sub></a><br /><a href="https://github.com/unhappychoice/bitflyer/commits?author=unhappychoice" title="Code">💻</a></td>
|
|
106
105
|
<td align="center"><a href="https://github.com/yemartin"><img src="https://avatars.githubusercontent.com/u/139002?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Yves-Eric Martin</b></sub></a><br /><a href="https://github.com/unhappychoice/bitflyer/commits?author=yemartin" title="Code">💻</a></td>
|
|
106
|
+
<td align="center"><a href="http://blog.unhappychoice.com"><img src="https://avatars.githubusercontent.com/u/5608948?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Yuji Ueki</b></sub></a><br /><a href="https://github.com/unhappychoice/bitflyer/commits?author=unhappychoice" title="Code">💻</a></td>
|
|
107
|
+
<td align="center"><a href="https://github.com/fkshom"><img src="https://avatars.githubusercontent.com/u/1889118?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Shoma FUKUDA</b></sub></a><br /><a href="https://github.com/unhappychoice/bitflyer/commits?author=fkshom" title="Code">💻</a></td>
|
|
107
108
|
</tr>
|
|
108
109
|
</table>
|
|
109
110
|
|
data/bitflyer.gemspec
CHANGED
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
18
18
|
spec.require_paths = ['lib']
|
|
19
19
|
|
|
20
|
-
spec.add_dependency 'faraday', '>= 0.14', '< 1.
|
|
20
|
+
spec.add_dependency 'faraday', '>= 0.14', '< 1.5'
|
|
21
21
|
spec.add_dependency 'faraday_middleware', '>= 0.12', '< 1.1'
|
|
22
22
|
spec.add_dependency 'websocket-client-simple', '~> 0.3.0'
|
|
23
23
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
|
@@ -5,7 +5,8 @@ require_relative './websocket'
|
|
|
5
5
|
module Bitflyer
|
|
6
6
|
module Realtime
|
|
7
7
|
PUBLIC_EVENT_NAMES = %w[lightning_board_snapshot lightning_board lightning_ticker lightning_executions].freeze
|
|
8
|
-
MARKETS = %w[BTC_JPY
|
|
8
|
+
MARKETS = %w[BTC_JPY XRP_JPY ETH_JPY XLM_JPY MONA_JPY ETH_BTC BCH_BTC FX_BTC_JPY BTCJPY_MAT1WK BTCJPY_MAT2WK
|
|
9
|
+
BTCJPY_MAT3M].freeze
|
|
9
10
|
PUBLIC_CHANNEL_NAMES = PUBLIC_EVENT_NAMES.product(MARKETS).map { |e, m| "#{e}_#{m}" }.freeze
|
|
10
11
|
PRIVATE_CHANNEL_NAMES = %w[child_order_events parent_order_events].freeze
|
|
11
12
|
CHANNEL_NAMES = (PUBLIC_CHANNEL_NAMES + PRIVATE_CHANNEL_NAMES).freeze
|
|
@@ -87,7 +87,7 @@ module Bitflyer
|
|
|
87
87
|
reconnect
|
|
88
88
|
end
|
|
89
89
|
|
|
90
|
-
def handle_message(payload:)
|
|
90
|
+
def handle_message(payload:) # rubocop:disable Metrics/CyclomaticComplexity
|
|
91
91
|
debug_log payload.data
|
|
92
92
|
return unless payload.data =~ /^\d+/
|
|
93
93
|
|
|
@@ -127,7 +127,7 @@ module Bitflyer
|
|
|
127
127
|
def authenticate
|
|
128
128
|
debug_log 'Authenticate'
|
|
129
129
|
timestamp = Time.now.to_i
|
|
130
|
-
nonce = Random.new.bytes(16).
|
|
130
|
+
nonce = Random.new.bytes(16).unpack1('H*')
|
|
131
131
|
signature = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), @secret, timestamp.to_s + nonce)
|
|
132
132
|
auth_params = {
|
|
133
133
|
api_key: @key,
|
|
@@ -139,13 +139,11 @@ module Bitflyer
|
|
|
139
139
|
end
|
|
140
140
|
|
|
141
141
|
def authenticated(json:)
|
|
142
|
-
if json
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
raise "Authentication failed: #{json}"
|
|
148
|
-
end
|
|
142
|
+
raise "Authentication failed: #{json}" if json != '[null]'
|
|
143
|
+
|
|
144
|
+
debug_log 'Authenticated'
|
|
145
|
+
subscribe_channels
|
|
146
|
+
@ready&.call
|
|
149
147
|
end
|
|
150
148
|
|
|
151
149
|
def subscribe_channels
|
data/lib/bitflyer/version.rb
CHANGED
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: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yuji Ueki
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-05-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -19,7 +19,7 @@ dependencies:
|
|
|
19
19
|
version: '0.14'
|
|
20
20
|
- - "<"
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: '1.
|
|
22
|
+
version: '1.5'
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -29,7 +29,7 @@ dependencies:
|
|
|
29
29
|
version: '0.14'
|
|
30
30
|
- - "<"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '1.
|
|
32
|
+
version: '1.5'
|
|
33
33
|
- !ruby/object:Gem::Dependency
|
|
34
34
|
name: faraday_middleware
|
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -143,6 +143,7 @@ extra_rdoc_files: []
|
|
|
143
143
|
files:
|
|
144
144
|
- ".all-contributorsrc"
|
|
145
145
|
- ".circleci/config.yml"
|
|
146
|
+
- ".github/dependabot.yml"
|
|
146
147
|
- ".rubocop.yml"
|
|
147
148
|
- ".rubocop_todo.yml"
|
|
148
149
|
- CODE_OF_CONDUCT.md
|