bitflyer 1.2.0 → 1.3.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
  SHA256:
3
- metadata.gz: 0afb7c55d8bf1c0c68fdb043881e446ad9481b932a328c25cc68dadabbd935c4
4
- data.tar.gz: 0d58c2aebb84b56f15bcc4bca7da2a2ace9f8c39ec6a6b87fa9460d03087d61f
3
+ metadata.gz: b190522b3b17c7f99dd4d91d7cba88b399cd1d313e5a4aeba6537ad802daa68b
4
+ data.tar.gz: c53b238a8c84a01ba4ba913a329e00724ef213d6acf6b7e0a216071038a37ff5
5
5
  SHA512:
6
- metadata.gz: af27099352002ac7983bb1655c6f7d04e606fa06494d76e37943c1c1343c4d6fdf987d235d36a863e63365e667ff7a61a7564fa81800f8ef6f9798b362c6df76
7
- data.tar.gz: 6e5f176afd23d3c438a1a5ec679a9e5dbd0b1a30784ce91968ce29f2914d7cd5dcd3eec1b5a96e260a203aef4375c4a90b31b2a77b2fb78c3e6fdfe28ec70a19
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.2.0)
5
- faraday (>= 0.14, < 1.4)
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.3.0)
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.0.0)
30
+ parser (3.0.1.1)
27
31
  ast (~> 2.4.1)
28
- pry (0.14.0)
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.4)
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.11.0)
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.2.0, < 2.0)
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.4.1)
58
- parser (>= 2.7.1.5)
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
- [![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
3
+ [![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
4
4
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
5
5
  [![Gem Version](https://badge.fury.io/rb/bitflyer.svg)](https://badge.fury.io/rb/bitflyer)
6
6
  [![Circle CI](https://circleci.com/gh/unhappychoice/bitflyer.svg?style=shield)](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.4'
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 FX_BTC_JPY ETH_BTC BCH_BTC BTCJPY_MAT3M BTCJPY_MAT1WK BTCJPY_MAT2WK].freeze
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).unpack('H*').first
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 == '[null]'
143
- debug_log 'Authenticated'
144
- subscribe_channels
145
- @ready&.call
146
- else
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bitflyer
4
- VERSION = '1.2.0'
4
+ VERSION = '1.3.0'
5
5
  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: 1.2.0
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-03-06 00:00:00.000000000 Z
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.4'
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.4'
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