kabustation_client 1.1.0 → 1.2.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: fb897ba18aad95da6bee12e58d1c5f8b9ab162595c0e789cb2b4b63c8aa236a4
4
- data.tar.gz: 2f39af3d8ff3b8fcc5b1cee4c77de5bcdb95b86b4e3482fed829c01d1ce834d9
3
+ metadata.gz: 35b056cd69b523eeb7805d822583d0b9ab7299e93fa4e60544f3dc2eb9238a97
4
+ data.tar.gz: 90bfc5292755371196b2e3cc7ebc638022a4c31fd6ec6c661be590ea87c2f23c
5
5
  SHA512:
6
- metadata.gz: b71b493a8dd811b2092cdda8d73fed6d982ffdf78881f24809a41bedffad71c08d1e0b8fa00bbe22193c82e926a298110484f8c00847f540bad21094cffdd2b0
7
- data.tar.gz: febc086f8065feaa31b11166b16c484378e92eca1535d5d8b3520c275a71fa567aa134100e8e0caceba05db8776dd873e637f2bc667c2268cd056482801dbcb8
6
+ metadata.gz: 5d03115c357982ee9c529fe729079d3ce02aec781b6237adf12fb6af02f539c46c89c14a56648581f619d7e632101fb7bc13e192873c0d3074b4b49ebc279d46
7
+ data.tar.gz: 66e52d768dc7e54b2551b4d2bd25e5c21c50d4fbbf6166c15448f55f3242210a045f97dadd9e8193bcc84fc1b782d57db52d7a1a8cd40a92e2e9b9b20068c5a3
@@ -0,0 +1,36 @@
1
+ name: Ruby Gem
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+ pull_request:
7
+ branches: [ "main" ]
8
+
9
+ jobs:
10
+ build:
11
+ name: Build + Publish
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: read
15
+ packages: write
16
+
17
+ steps:
18
+ - uses: actions/checkout@v3
19
+ - name: Set up Ruby 3.3
20
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
21
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
22
+ # uses: ruby/setup-ruby@v1
23
+ uses: ruby/setup-ruby@v1
24
+ with:
25
+ ruby-version: 3.3.0
26
+
27
+ - name: Publish to RubyGems
28
+ run: |
29
+ mkdir -p $HOME/.gem
30
+ touch $HOME/.gem/credentials
31
+ chmod 0600 $HOME/.gem/credentials
32
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
33
+ gem build *.gemspec
34
+ gem push *.gem
35
+ env:
36
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
@@ -0,0 +1,38 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ "main" ]
13
+ pull_request:
14
+ branches: [ "main" ]
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ jobs:
20
+ test:
21
+
22
+ runs-on: ubuntu-latest
23
+ strategy:
24
+ matrix:
25
+ ruby-version: ['2.7.8','3.2.2']
26
+
27
+ steps:
28
+ - uses: actions/checkout@v3
29
+ - name: Set up Ruby
30
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
31
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
32
+ # uses: ruby/setup-ruby@v1
33
+ uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
34
+ with:
35
+ ruby-version: ${{ matrix.ruby-version }}
36
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
37
+ - name: Run tests
38
+ run: bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,39 @@
1
+ # Generated by: https://openapi-generator.tech
2
+ #
3
+
4
+ *.gem
5
+ *.rbc
6
+ /.config
7
+ /coverage/
8
+ /InstalledFiles
9
+ /pkg/
10
+ /spec/reports/
11
+ /spec/examples.txt
12
+ /test/tmp/
13
+ /test/version_tmp/
14
+ /tmp/
15
+
16
+ ## Specific to RubyMotion:
17
+ .dat*
18
+ .repl_history
19
+ build/
20
+
21
+ ## Documentation cache and generated files:
22
+ /.yardoc/
23
+ /_yardoc/
24
+ /doc/
25
+ /rdoc/
26
+
27
+ ## Environment normalization:
28
+ /.bundle/
29
+ /vendor/bundle
30
+ /lib/bundler/man/
31
+
32
+ # for a library or gem, you might want to ignore these files since the code is
33
+ # intended to run in multiple environments; otherwise, check them in:
34
+ Gemfile.lock
35
+ .ruby-version
36
+ # .ruby-gemset
37
+
38
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
39
+ .rvmrc
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,26 @@
1
+ .ruby: &ruby
2
+ variables:
3
+ LANG: "C.UTF-8"
4
+ before_script:
5
+ - ruby -v
6
+ - bundle config set --local deployment true
7
+ - bundle install -j $(nproc)
8
+ parallel:
9
+ matrix:
10
+ - RUBY_VERSION: ['2.7', '3.0', '3.1']
11
+ image: "ruby:$RUBY_VERSION"
12
+ cache:
13
+ paths:
14
+ - vendor/ruby
15
+ key: 'ruby-$RUBY_VERSION'
16
+
17
+ gem:
18
+ extends: .ruby
19
+ script:
20
+ - bundle exec rspec
21
+ - bundle exec rake build
22
+ - bundle exec rake install
23
+ artifacts:
24
+ paths:
25
+ - pkg/*.gem
26
+
@@ -0,0 +1,162 @@
1
+ .gitignore
2
+ .gitlab-ci.yml
3
+ .rspec
4
+ .rubocop.yml
5
+ .travis.yml
6
+ Gemfile
7
+ README.md
8
+ Rakefile
9
+ docs/ApiSoftLimitResponse.md
10
+ docs/AuthApi.md
11
+ docs/BoardSuccess.md
12
+ docs/BoardSuccessBuy1.md
13
+ docs/BoardSuccessBuy10.md
14
+ docs/BoardSuccessBuy2.md
15
+ docs/BoardSuccessBuy3.md
16
+ docs/BoardSuccessBuy4.md
17
+ docs/BoardSuccessBuy5.md
18
+ docs/BoardSuccessBuy6.md
19
+ docs/BoardSuccessBuy7.md
20
+ docs/BoardSuccessBuy8.md
21
+ docs/BoardSuccessBuy9.md
22
+ docs/BoardSuccessSell1.md
23
+ docs/BoardSuccessSell10.md
24
+ docs/BoardSuccessSell2.md
25
+ docs/BoardSuccessSell3.md
26
+ docs/BoardSuccessSell4.md
27
+ docs/BoardSuccessSell5.md
28
+ docs/BoardSuccessSell6.md
29
+ docs/BoardSuccessSell7.md
30
+ docs/BoardSuccessSell8.md
31
+ docs/BoardSuccessSell9.md
32
+ docs/ErrorResponse.md
33
+ docs/ExchangeResponse.md
34
+ docs/InfoApi.md
35
+ docs/MarginPremiumResponse.md
36
+ docs/MarginPremiumResponseDayTrade.md
37
+ docs/MarginPremiumResponseGeneralMargin.md
38
+ docs/OrderApi.md
39
+ docs/OrderSuccess.md
40
+ docs/OrdersSuccess.md
41
+ docs/OrdersSuccessDetailsInner.md
42
+ docs/Positions.md
43
+ docs/PositionsDeriv.md
44
+ docs/PositionsSuccess.md
45
+ docs/PrimaryExchangeResponse.md
46
+ docs/RankingByCategoryResponse.md
47
+ docs/RankingByCategoryResponseRankingInner.md
48
+ docs/RankingByMarginResponse.md
49
+ docs/RankingByMarginResponseRankingInner.md
50
+ docs/RankingByTickCountResponse.md
51
+ docs/RankingByTickCountResponseRankingInner.md
52
+ docs/RankingByTradeValueResponse.md
53
+ docs/RankingByTradeValueResponseRankingInner.md
54
+ docs/RankingByTradeVolumeResponse.md
55
+ docs/RankingByTradeVolumeResponseRankingInner.md
56
+ docs/RankingDefaultResponse.md
57
+ docs/RankingDefaultResponseRankingInner.md
58
+ docs/RankingGet200Response.md
59
+ docs/RegistSuccess.md
60
+ docs/RegisterApi.md
61
+ docs/RegulationsResponse.md
62
+ docs/RegulationsResponseRegulationsInfoInner.md
63
+ docs/RequestCancelOrder.md
64
+ docs/RequestRegister.md
65
+ docs/RequestRegisterSymbolsInner.md
66
+ docs/RequestSendOrder.md
67
+ docs/RequestSendOrderDerivFuture.md
68
+ docs/RequestSendOrderDerivFutureReverseLimitOrder.md
69
+ docs/RequestSendOrderDerivOption.md
70
+ docs/RequestSendOrderReverseLimitOrder.md
71
+ docs/RequestToken.md
72
+ docs/RequestUnregister.md
73
+ docs/SymbolNameSuccess.md
74
+ docs/SymbolSuccess.md
75
+ docs/TokenSuccess.md
76
+ docs/UnregisterAllSuccess.md
77
+ docs/WalletApi.md
78
+ docs/WalletCashSuccess.md
79
+ docs/WalletFutureSuccess.md
80
+ docs/WalletMarginSuccess.md
81
+ docs/WalletOptionSuccess.md
82
+ git_push.sh
83
+ kabustation_client.gemspec
84
+ lib/kabustation_client.rb
85
+ lib/kabustation_client/api/auth_api.rb
86
+ lib/kabustation_client/api/info_api.rb
87
+ lib/kabustation_client/api/order_api.rb
88
+ lib/kabustation_client/api/register_api.rb
89
+ lib/kabustation_client/api/wallet_api.rb
90
+ lib/kabustation_client/api_client.rb
91
+ lib/kabustation_client/api_error.rb
92
+ lib/kabustation_client/configuration.rb
93
+ lib/kabustation_client/models/api_soft_limit_response.rb
94
+ lib/kabustation_client/models/board_success.rb
95
+ lib/kabustation_client/models/board_success_buy1.rb
96
+ lib/kabustation_client/models/board_success_buy10.rb
97
+ lib/kabustation_client/models/board_success_buy2.rb
98
+ lib/kabustation_client/models/board_success_buy3.rb
99
+ lib/kabustation_client/models/board_success_buy4.rb
100
+ lib/kabustation_client/models/board_success_buy5.rb
101
+ lib/kabustation_client/models/board_success_buy6.rb
102
+ lib/kabustation_client/models/board_success_buy7.rb
103
+ lib/kabustation_client/models/board_success_buy8.rb
104
+ lib/kabustation_client/models/board_success_buy9.rb
105
+ lib/kabustation_client/models/board_success_sell1.rb
106
+ lib/kabustation_client/models/board_success_sell10.rb
107
+ lib/kabustation_client/models/board_success_sell2.rb
108
+ lib/kabustation_client/models/board_success_sell3.rb
109
+ lib/kabustation_client/models/board_success_sell4.rb
110
+ lib/kabustation_client/models/board_success_sell5.rb
111
+ lib/kabustation_client/models/board_success_sell6.rb
112
+ lib/kabustation_client/models/board_success_sell7.rb
113
+ lib/kabustation_client/models/board_success_sell8.rb
114
+ lib/kabustation_client/models/board_success_sell9.rb
115
+ lib/kabustation_client/models/error_response.rb
116
+ lib/kabustation_client/models/exchange_response.rb
117
+ lib/kabustation_client/models/margin_premium_response.rb
118
+ lib/kabustation_client/models/margin_premium_response_day_trade.rb
119
+ lib/kabustation_client/models/margin_premium_response_general_margin.rb
120
+ lib/kabustation_client/models/order_success.rb
121
+ lib/kabustation_client/models/orders_success.rb
122
+ lib/kabustation_client/models/orders_success_details_inner.rb
123
+ lib/kabustation_client/models/positions.rb
124
+ lib/kabustation_client/models/positions_deriv.rb
125
+ lib/kabustation_client/models/positions_success.rb
126
+ lib/kabustation_client/models/primary_exchange_response.rb
127
+ lib/kabustation_client/models/ranking_by_category_response.rb
128
+ lib/kabustation_client/models/ranking_by_category_response_ranking_inner.rb
129
+ lib/kabustation_client/models/ranking_by_margin_response.rb
130
+ lib/kabustation_client/models/ranking_by_margin_response_ranking_inner.rb
131
+ lib/kabustation_client/models/ranking_by_tick_count_response.rb
132
+ lib/kabustation_client/models/ranking_by_tick_count_response_ranking_inner.rb
133
+ lib/kabustation_client/models/ranking_by_trade_value_response.rb
134
+ lib/kabustation_client/models/ranking_by_trade_value_response_ranking_inner.rb
135
+ lib/kabustation_client/models/ranking_by_trade_volume_response.rb
136
+ lib/kabustation_client/models/ranking_by_trade_volume_response_ranking_inner.rb
137
+ lib/kabustation_client/models/ranking_default_response.rb
138
+ lib/kabustation_client/models/ranking_default_response_ranking_inner.rb
139
+ lib/kabustation_client/models/ranking_get200_response.rb
140
+ lib/kabustation_client/models/regist_success.rb
141
+ lib/kabustation_client/models/regulations_response.rb
142
+ lib/kabustation_client/models/regulations_response_regulations_info_inner.rb
143
+ lib/kabustation_client/models/request_cancel_order.rb
144
+ lib/kabustation_client/models/request_register.rb
145
+ lib/kabustation_client/models/request_register_symbols_inner.rb
146
+ lib/kabustation_client/models/request_send_order.rb
147
+ lib/kabustation_client/models/request_send_order_deriv_future.rb
148
+ lib/kabustation_client/models/request_send_order_deriv_future_reverse_limit_order.rb
149
+ lib/kabustation_client/models/request_send_order_deriv_option.rb
150
+ lib/kabustation_client/models/request_send_order_reverse_limit_order.rb
151
+ lib/kabustation_client/models/request_token.rb
152
+ lib/kabustation_client/models/request_unregister.rb
153
+ lib/kabustation_client/models/symbol_name_success.rb
154
+ lib/kabustation_client/models/symbol_success.rb
155
+ lib/kabustation_client/models/token_success.rb
156
+ lib/kabustation_client/models/unregister_all_success.rb
157
+ lib/kabustation_client/models/wallet_cash_success.rb
158
+ lib/kabustation_client/models/wallet_future_success.rb
159
+ lib/kabustation_client/models/wallet_margin_success.rb
160
+ lib/kabustation_client/models/wallet_option_success.rb
161
+ lib/kabustation_client/version.rb
162
+ spec/spec_helper.rb
@@ -0,0 +1 @@
1
+ 7.6.0
@@ -0,0 +1,23 @@
1
+ # OpenAPI Generator Ignore
2
+ # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3
+
4
+ # Use this file to prevent files from being overwritten by the generator.
5
+ # The patterns follow closely to .gitignore or .dockerignore.
6
+
7
+ # As an example, the C# client generator defines ApiClient.cs.
8
+ # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9
+ #ApiClient.cs
10
+
11
+ # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12
+ #foo/*/qux
13
+ # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14
+
15
+ # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16
+ #foo/**/qux
17
+ # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18
+
19
+ # You can also negate patterns with an exclamation (!).
20
+ # For example, you can ignore all files in a docs folder with the file extension .md:
21
+ #docs/*.md
22
+ # Then explicitly reverse the ignore rule for a single file:
23
+ #!docs/README.md
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,148 @@
1
+ # This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license)
2
+ # Automatically generated by OpenAPI Generator (https://openapi-generator.tech)
3
+ AllCops:
4
+ TargetRubyVersion: 2.4
5
+ # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
6
+ # to ignore them, so only the ones explicitly set in this file are enabled.
7
+ DisabledByDefault: true
8
+ Exclude:
9
+ - '**/templates/**/*'
10
+ - '**/vendor/**/*'
11
+ - 'actionpack/lib/action_dispatch/journey/parser.rb'
12
+
13
+ # Prefer &&/|| over and/or.
14
+ Style/AndOr:
15
+ Enabled: true
16
+
17
+ # Align `when` with `case`.
18
+ Layout/CaseIndentation:
19
+ Enabled: true
20
+
21
+ # Align comments with method definitions.
22
+ Layout/CommentIndentation:
23
+ Enabled: true
24
+
25
+ Layout/ElseAlignment:
26
+ Enabled: true
27
+
28
+ Layout/EmptyLineAfterMagicComment:
29
+ Enabled: true
30
+
31
+ # In a regular class definition, no empty lines around the body.
32
+ Layout/EmptyLinesAroundClassBody:
33
+ Enabled: true
34
+
35
+ # In a regular method definition, no empty lines around the body.
36
+ Layout/EmptyLinesAroundMethodBody:
37
+ Enabled: true
38
+
39
+ # In a regular module definition, no empty lines around the body.
40
+ Layout/EmptyLinesAroundModuleBody:
41
+ Enabled: true
42
+
43
+ Layout/FirstArgumentIndentation:
44
+ Enabled: true
45
+
46
+ # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
47
+ Style/HashSyntax:
48
+ Enabled: false
49
+
50
+ # Method definitions after `private` or `protected` isolated calls need one
51
+ # extra level of indentation.
52
+ Layout/IndentationConsistency:
53
+ Enabled: true
54
+ EnforcedStyle: indented_internal_methods
55
+
56
+ # Two spaces, no tabs (for indentation).
57
+ Layout/IndentationWidth:
58
+ Enabled: true
59
+
60
+ Layout/LeadingCommentSpace:
61
+ Enabled: true
62
+
63
+ Layout/SpaceAfterColon:
64
+ Enabled: true
65
+
66
+ Layout/SpaceAfterComma:
67
+ Enabled: true
68
+
69
+ Layout/SpaceAroundEqualsInParameterDefault:
70
+ Enabled: true
71
+
72
+ Layout/SpaceAroundKeyword:
73
+ Enabled: true
74
+
75
+ Layout/SpaceAroundOperators:
76
+ Enabled: true
77
+
78
+ Layout/SpaceBeforeComma:
79
+ Enabled: true
80
+
81
+ Layout/SpaceBeforeFirstArg:
82
+ Enabled: true
83
+
84
+ Style/DefWithParentheses:
85
+ Enabled: true
86
+
87
+ # Defining a method with parameters needs parentheses.
88
+ Style/MethodDefParentheses:
89
+ Enabled: true
90
+
91
+ Style/FrozenStringLiteralComment:
92
+ Enabled: false
93
+ EnforcedStyle: always
94
+
95
+ # Use `foo {}` not `foo{}`.
96
+ Layout/SpaceBeforeBlockBraces:
97
+ Enabled: true
98
+
99
+ # Use `foo { bar }` not `foo {bar}`.
100
+ Layout/SpaceInsideBlockBraces:
101
+ Enabled: true
102
+
103
+ # Use `{ a: 1 }` not `{a:1}`.
104
+ Layout/SpaceInsideHashLiteralBraces:
105
+ Enabled: true
106
+
107
+ Layout/SpaceInsideParens:
108
+ Enabled: true
109
+
110
+ # Check quotes usage according to lint rule below.
111
+ #Style/StringLiterals:
112
+ # Enabled: true
113
+ # EnforcedStyle: single_quotes
114
+
115
+ # Detect hard tabs, no hard tabs.
116
+ Layout/IndentationStyle:
117
+ Enabled: true
118
+
119
+ # Blank lines should not have any spaces.
120
+ Layout/TrailingEmptyLines:
121
+ Enabled: true
122
+
123
+ # No trailing whitespace.
124
+ Layout/TrailingWhitespace:
125
+ Enabled: false
126
+
127
+ # Use quotes for string literals when they are enough.
128
+ Style/RedundantPercentQ:
129
+ Enabled: true
130
+
131
+ # Align `end` with the matching keyword or starting expression except for
132
+ # assignments, where it should be aligned with the LHS.
133
+ Layout/EndAlignment:
134
+ Enabled: true
135
+ EnforcedStyleAlignWith: variable
136
+ AutoCorrect: true
137
+
138
+ # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
139
+ Lint/RequireParentheses:
140
+ Enabled: true
141
+
142
+ Style/RedundantReturn:
143
+ Enabled: true
144
+ AllowMultipleReturnValues: true
145
+
146
+ Style/Semicolon:
147
+ Enabled: true
148
+ AllowAsExpressionSeparator: true
data/.travis.yml ADDED
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+ cache: bundler
3
+ rvm:
4
+ - 2.7
5
+ - 3.0
6
+ - 3.1
7
+ script:
8
+ - bundle install --path vendor/bundle
9
+ - bundle exec rspec
10
+ - gem build kabustation_client.gemspec
11
+ - gem install ./kabustation_client-1.2.0.gem
data/README.md CHANGED
@@ -9,8 +9,8 @@ KabustationClient - the Ruby gem for the kabuステーションAPI
9
9
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
10
10
 
11
11
  - API version: 1.5
12
- - Package version: 1.1.0
13
- - Generator version: 7.4.0
12
+ - Package version: 1.2.0
13
+ - Generator version: 7.6.0
14
14
  - Build package: org.openapitools.codegen.languages.RubyClientCodegen
15
15
  For more information, please visit [https://kabucom.github.io/kabusapi/ptal/index.html](https://kabucom.github.io/kabusapi/ptal/index.html)
16
16
 
@@ -99,7 +99,7 @@ require 'kabustation_client'
99
99
 
100
100
  KabustationClient.configure do |config|
101
101
  config.host = ENV.fetch('KABUSTATION_HOST', 'localhost')
102
- config.base_path = 'production'
102
+ config.base_path = '/production'
103
103
  end
104
104
 
105
105
  api_instance = KabustationClient::AuthApi.new
@@ -115,6 +115,20 @@ end
115
115
 
116
116
 
117
117
  KabustationClient.configure.api_key['ApiKeyAuth'] = result.token
118
+
119
+ register_instance = KabustationClient::RegisterApi.new
120
+ instance = KabustationClient::RequestRegister.new(symbols: [{symbol: '5401', exchange: 1}])
121
+ result = register_instance.register_put(instance)
122
+
123
+
124
+ client = KabustationClient::PushClient.new(
125
+ open: -> { puts "WebSocket opened" },
126
+ message: -> (board) { puts "Received message: #{board.symbol_name}" }, # KabustationClient::BoardSuccess
127
+ error: -> (e) { puts "Error occurred: #{e}" },
128
+ close: -> (e) { puts "Connection closed: #{e}" }
129
+ )
130
+ client.connect
131
+
118
132
  ```
119
133
 
120
134
  ## Documentation for API Endpoints
@@ -29,11 +29,15 @@ Gem::Specification.new do |s|
29
29
  s.metadata = {}
30
30
 
31
31
  s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
32
+ s.add_runtime_dependency 'websocket-client-simple'
32
33
 
33
34
  s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
34
35
 
35
- s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
36
+ s.files = Dir.chdir(File.expand_path(__dir__)) do
37
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
38
+ end
36
39
  s.test_files = `find spec/*`.split("\n")
37
- s.executables = []
40
+ s.bindir = "exe"
41
+ s.executables = s.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
38
42
  s.require_paths = ["lib"]
39
43
  end
@@ -0,0 +1,53 @@
1
+
2
+ require 'websocket-client-simple'
3
+ require 'json'
4
+
5
+ module KabustationClient
6
+ class PushClient
7
+ attr_reader :ws
8
+
9
+ def initialize(callbacks = {})
10
+ @callbacks = {
11
+ open: -> {},
12
+ message: -> (_board) {},
13
+ error: -> (_e) {},
14
+ close: -> (_e) {}
15
+ }.merge(callbacks)
16
+
17
+ config = Configuration.default
18
+
19
+ @uri = "ws://#{config.host}#{config.base_path}/websocket"
20
+ end
21
+
22
+ def connect
23
+ callbacks = @callbacks
24
+
25
+ @ws = WebSocket::Client::Simple.connect @uri do |ws|
26
+ ws.on :open do
27
+ callbacks[:open].call
28
+ end
29
+
30
+ ws.on :message do |msg|
31
+ data = msg.data.force_encoding("ASCII-8BIT").force_encoding('UTF-8')
32
+ json = JSON.parse(data)
33
+ board = KabustationClient::ApiClient.new.convert_to_type(json, 'BoardSuccess')
34
+
35
+ callbacks[:message].call(board)
36
+ end
37
+
38
+ ws.on :error do |e|
39
+ callbacks[:error].call(e)
40
+ end
41
+
42
+ ws.on :close do |e|
43
+ callbacks[:close].call(e)
44
+ end
45
+ end
46
+ end
47
+
48
+
49
+ def close
50
+ @ws.close
51
+ end
52
+ end
53
+ end
@@ -11,5 +11,5 @@ Generator version: 7.4.0
11
11
  =end
12
12
 
13
13
  module KabustationClient
14
- VERSION = '1.1.0'
14
+ VERSION = '1.2.0'
15
15
  end
@@ -93,6 +93,9 @@ require 'kabustation_client/api/order_api'
93
93
  require 'kabustation_client/api/register_api'
94
94
  require 'kabustation_client/api/wallet_api'
95
95
 
96
+ # WebSocket
97
+ require 'kabustation_client/push_client'
98
+
96
99
  module KabustationClient
97
100
  class << self
98
101
  # Customize default settings for the SDK using block.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kabustation_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kyohah
8
- autorequire:
9
- bindir: bin
8
+ autorequire:
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-17 00:00:00.000000000 Z
11
+ date: 2024-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -30,6 +30,20 @@ dependencies:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 1.0.1
33
+ - !ruby/object:Gem::Dependency
34
+ name: websocket-client-simple
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
33
47
  - !ruby/object:Gem::Dependency
34
48
  name: rspec
35
49
  requirement: !ruby/object:Gem::Requirement
@@ -57,8 +71,17 @@ executables: []
57
71
  extensions: []
58
72
  extra_rdoc_files: []
59
73
  files:
74
+ - ".github/workflows/gem-push.yml"
75
+ - ".github/workflows/ruby.yml"
76
+ - ".gitignore"
77
+ - ".gitlab-ci.yml"
78
+ - ".openapi-generator-ignore"
79
+ - ".openapi-generator/FILES"
80
+ - ".openapi-generator/VERSION"
81
+ - ".rspec"
82
+ - ".rubocop.yml"
83
+ - ".travis.yml"
60
84
  - Gemfile
61
- - Gemfile.lock
62
85
  - README.md
63
86
  - Rakefile
64
87
  - bin/console
@@ -216,6 +239,7 @@ files:
216
239
  - lib/kabustation_client/models/wallet_future_success.rb
217
240
  - lib/kabustation_client/models/wallet_margin_success.rb
218
241
  - lib/kabustation_client/models/wallet_option_success.rb
242
+ - lib/kabustation_client/push_client.rb
219
243
  - lib/kabustation_client/version.rb
220
244
  - spec/api/auth_api_spec.rb
221
245
  - spec/api/info_api_spec.rb
@@ -295,7 +319,7 @@ homepage: https://github.com/kyohah/kabustation_client-ruby
295
319
  licenses:
296
320
  - MIT
297
321
  metadata: {}
298
- post_install_message:
322
+ post_install_message:
299
323
  rdoc_options: []
300
324
  require_paths:
301
325
  - lib
@@ -311,81 +335,81 @@ required_rubygems_version: !ruby/object:Gem::Requirement
311
335
  version: '0'
312
336
  requirements: []
313
337
  rubygems_version: 3.5.3
314
- signing_key:
338
+ signing_key:
315
339
  specification_version: 4
316
340
  summary: kabuステーションAPI Ruby Gem
317
341
  test_files:
342
+ - spec/api/register_api_spec.rb
318
343
  - spec/api/wallet_api_spec.rb
319
344
  - spec/api/auth_api_spec.rb
320
345
  - spec/api/order_api_spec.rb
321
- - spec/api/register_api_spec.rb
322
346
  - spec/api/info_api_spec.rb
323
- - spec/models/ranking_get200_response_spec.rb
324
- - spec/models/order_success_spec.rb
325
- - spec/models/board_success_buy6_spec.rb
326
- - spec/models/board_success_buy10_spec.rb
327
- - spec/models/ranking_by_category_response_spec.rb
328
- - spec/models/token_success_spec.rb
329
- - spec/models/exchange_response_spec.rb
330
- - spec/models/primary_exchange_response_spec.rb
331
- - spec/models/wallet_cash_success_spec.rb
332
- - spec/models/board_success_sell6_spec.rb
333
- - spec/models/request_send_order_deriv_future_spec.rb
334
- - spec/models/error_response_spec.rb
335
- - spec/models/positions_success_spec.rb
336
- - spec/models/regist_success_spec.rb
337
- - spec/models/margin_premium_response_general_margin_spec.rb
338
- - spec/models/board_success_sell7_spec.rb
339
- - spec/models/request_register_spec.rb
340
- - spec/models/ranking_by_trade_volume_response_spec.rb
341
- - spec/models/symbol_success_spec.rb
342
- - spec/models/request_unregister_spec.rb
343
- - spec/models/board_success_buy7_spec.rb
344
- - spec/models/ranking_by_tick_count_response_ranking_inner_spec.rb
347
+ - spec/models/request_register_symbols_inner_spec.rb
348
+ - spec/models/unregister_all_success_spec.rb
345
349
  - spec/models/regulations_response_regulations_info_inner_spec.rb
346
- - spec/models/ranking_by_category_response_ranking_inner_spec.rb
347
- - spec/models/ranking_by_tick_count_response_spec.rb
348
- - spec/models/symbol_name_success_spec.rb
349
- - spec/models/board_success_sell5_spec.rb
350
- - spec/models/margin_premium_response_spec.rb
351
- - spec/models/wallet_option_success_spec.rb
352
- - spec/models/board_success_sell10_spec.rb
353
- - spec/models/board_success_buy5_spec.rb
354
350
  - spec/models/api_soft_limit_response_spec.rb
355
- - spec/models/ranking_by_trade_volume_response_ranking_inner_spec.rb
356
- - spec/models/board_success_buy4_spec.rb
357
- - spec/models/unregister_all_success_spec.rb
351
+ - spec/models/ranking_get200_response_spec.rb
352
+ - spec/models/positions_spec.rb
358
353
  - spec/models/ranking_by_margin_response_ranking_inner_spec.rb
354
+ - spec/models/board_success_buy7_spec.rb
355
+ - spec/models/ranking_by_trade_volume_response_ranking_inner_spec.rb
356
+ - spec/models/ranking_default_response_spec.rb
357
+ - spec/models/board_success_sell2_spec.rb
358
+ - spec/models/ranking_by_trade_volume_response_spec.rb
359
359
  - spec/models/board_success_sell4_spec.rb
360
- - spec/models/orders_success_spec.rb
361
- - spec/models/wallet_margin_success_spec.rb
362
- - spec/models/board_success_buy8_spec.rb
363
- - spec/models/board_success_sell1_spec.rb
364
- - spec/models/request_send_order_reverse_limit_order_spec.rb
360
+ - spec/models/ranking_by_category_response_ranking_inner_spec.rb
365
361
  - spec/models/board_success_spec.rb
362
+ - spec/models/margin_premium_response_general_margin_spec.rb
363
+ - spec/models/wallet_margin_success_spec.rb
364
+ - spec/models/request_cancel_order_spec.rb
365
+ - spec/models/board_success_buy5_spec.rb
366
+ - spec/models/board_success_buy10_spec.rb
367
+ - spec/models/board_success_sell3_spec.rb
368
+ - spec/models/positions_deriv_spec.rb
369
+ - spec/models/board_success_buy3_spec.rb
370
+ - spec/models/positions_success_spec.rb
366
371
  - spec/models/regulations_response_spec.rb
372
+ - spec/models/board_success_buy6_spec.rb
373
+ - spec/models/board_success_buy4_spec.rb
374
+ - spec/models/request_register_spec.rb
375
+ - spec/models/order_success_spec.rb
376
+ - spec/models/ranking_by_tick_count_response_spec.rb
367
377
  - spec/models/orders_success_details_inner_spec.rb
368
- - spec/models/ranking_by_trade_value_response_ranking_inner_spec.rb
369
378
  - spec/models/ranking_by_margin_response_spec.rb
370
- - spec/models/board_success_buy1_spec.rb
371
- - spec/models/board_success_sell8_spec.rb
372
- - spec/models/ranking_by_trade_value_response_spec.rb
373
- - spec/models/margin_premium_response_day_trade_spec.rb
374
- - spec/models/ranking_default_response_spec.rb
375
379
  - spec/models/board_success_sell9_spec.rb
376
- - spec/models/request_token_spec.rb
377
- - spec/models/board_success_buy9_spec.rb
378
- - spec/models/request_send_order_deriv_future_reverse_limit_order_spec.rb
379
- - spec/models/request_send_order_spec.rb
380
+ - spec/models/board_success_buy8_spec.rb
381
+ - spec/models/token_success_spec.rb
382
+ - spec/models/board_success_sell5_spec.rb
383
+ - spec/models/board_success_sell8_spec.rb
384
+ - spec/models/ranking_default_response_ranking_inner_spec.rb
385
+ - spec/models/regist_success_spec.rb
386
+ - spec/models/wallet_cash_success_spec.rb
387
+ - spec/models/board_success_buy1_spec.rb
388
+ - spec/models/board_success_sell7_spec.rb
389
+ - spec/models/ranking_by_tick_count_response_ranking_inner_spec.rb
380
390
  - spec/models/board_success_buy2_spec.rb
381
- - spec/models/board_success_sell2_spec.rb
391
+ - spec/models/board_success_sell1_spec.rb
392
+ - spec/models/board_success_sell10_spec.rb
382
393
  - spec/models/wallet_future_success_spec.rb
383
- - spec/models/positions_spec.rb
394
+ - spec/models/symbol_name_success_spec.rb
395
+ - spec/models/primary_exchange_response_spec.rb
396
+ - spec/models/board_success_buy9_spec.rb
397
+ - spec/models/request_send_order_reverse_limit_order_spec.rb
398
+ - spec/models/symbol_success_spec.rb
399
+ - spec/models/request_unregister_spec.rb
400
+ - spec/models/board_success_sell6_spec.rb
401
+ - spec/models/margin_premium_response_spec.rb
402
+ - spec/models/request_send_order_spec.rb
403
+ - spec/models/ranking_by_trade_value_response_spec.rb
404
+ - spec/models/ranking_by_trade_value_response_ranking_inner_spec.rb
405
+ - spec/models/request_send_order_deriv_future_spec.rb
406
+ - spec/models/error_response_spec.rb
407
+ - spec/models/request_send_order_deriv_future_reverse_limit_order_spec.rb
384
408
  - spec/models/request_send_order_deriv_option_spec.rb
385
- - spec/models/ranking_default_response_ranking_inner_spec.rb
386
- - spec/models/board_success_sell3_spec.rb
387
- - spec/models/request_register_symbols_inner_spec.rb
388
- - spec/models/board_success_buy3_spec.rb
389
- - spec/models/positions_deriv_spec.rb
390
- - spec/models/request_cancel_order_spec.rb
409
+ - spec/models/orders_success_spec.rb
410
+ - spec/models/wallet_option_success_spec.rb
411
+ - spec/models/request_token_spec.rb
412
+ - spec/models/ranking_by_category_response_spec.rb
413
+ - spec/models/exchange_response_spec.rb
414
+ - spec/models/margin_premium_response_day_trade_spec.rb
391
415
  - spec/spec_helper.rb
data/Gemfile.lock DELETED
@@ -1,73 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- kabustation_client (1.1.0)
5
- typhoeus (~> 1.0, >= 1.0.1)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- ast (2.4.2)
11
- byebug (11.1.3)
12
- coderay (1.1.3)
13
- diff-lcs (1.5.1)
14
- ethon (0.16.0)
15
- ffi (>= 1.15.0)
16
- ffi (1.16.3)
17
- jaro_winkler (1.5.6)
18
- method_source (1.1.0)
19
- parallel (1.24.0)
20
- parser (3.3.0.5)
21
- ast (~> 2.4.1)
22
- racc
23
- pry (0.14.2)
24
- coderay (~> 1.1)
25
- method_source (~> 1.0)
26
- pry-byebug (3.10.1)
27
- byebug (~> 11.0)
28
- pry (>= 0.13, < 0.15)
29
- psych (5.1.2)
30
- stringio
31
- racc (1.7.3)
32
- rainbow (3.1.1)
33
- rake (13.0.6)
34
- rspec (3.13.0)
35
- rspec-core (~> 3.13.0)
36
- rspec-expectations (~> 3.13.0)
37
- rspec-mocks (~> 3.13.0)
38
- rspec-core (3.13.0)
39
- rspec-support (~> 3.13.0)
40
- rspec-expectations (3.13.0)
41
- diff-lcs (>= 1.2.0, < 2.0)
42
- rspec-support (~> 3.13.0)
43
- rspec-mocks (3.13.0)
44
- diff-lcs (>= 1.2.0, < 2.0)
45
- rspec-support (~> 3.13.0)
46
- rspec-support (3.13.1)
47
- rubocop (0.66.0)
48
- jaro_winkler (~> 1.5.1)
49
- parallel (~> 1.10)
50
- parser (>= 2.5, != 2.5.1.1)
51
- psych (>= 3.1.0)
52
- rainbow (>= 2.2.2, < 4.0)
53
- ruby-progressbar (~> 1.7)
54
- unicode-display_width (>= 1.4.0, < 1.6)
55
- ruby-progressbar (1.13.0)
56
- stringio (3.1.0)
57
- typhoeus (1.4.1)
58
- ethon (>= 0.9.0)
59
- unicode-display_width (1.5.0)
60
-
61
- PLATFORMS
62
- arm64-darwin-23
63
- ruby
64
-
65
- DEPENDENCIES
66
- kabustation_client!
67
- pry-byebug
68
- rake (~> 13.0.1)
69
- rspec (~> 3.6, >= 3.6.0)
70
- rubocop (~> 0.66.0)
71
-
72
- BUNDLED WITH
73
- 2.5.3