Socket
Book a DemoInstallSign in
Socket

kabustation_client

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kabustation_client

1.2.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

kabustation_client

KabustationClient - the Ruby gem for the kabuステーションAPI

定義情報

REST APIのコード一覧、エンドポイントは下記リンク参照

  • REST APIコード一覧

This SDK is automatically generated by the OpenAPI Generator project:

Installation

Build a gem

To build the Ruby code into a gem:

gem build kabustation_client.gemspec

Then either install the gem locally:

gem install ./kabustation_client-1.1.0.gem

(for development, run gem install --dev ./kabustation_client-1.1.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'kabustation_client', '~> 1.1.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/kyohah/kabustation_client-ruby, then add the following in the Gemfile:

gem 'kabustation_client', :git => 'https://github.com/kyohah/kabustation_client-ruby.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

Windowsのnginxの設定

windows マシンで rubyを動かすなら不要

worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    map $http_upgrade $connection_upgrade { 
    default upgrade;
    ''      close;
    } 

    server {
        listen       80;
        server_name  localhost;

        proxy_http_version 1.1;
        proxy_set_header Host localhost;
        proxy_set_header Upgrade $http_upgrade; 
        proxy_set_header Connection $connection_upgrade;

        location /production/ { # 本番用
            proxy_pass   http://127.0.0.1:18080/kabusapi;
        }

        location /development/ { # 検証用
            proxy_pass   http://127.0.0.1:18081/kabusapi;
        }
    }
}
require 'kabustation_client'

KabustationClient.configure do |config|
  config.host = ENV.fetch('KABUSTATION_HOST', 'localhost')
  config.base_path = '/production'
end

api_instance = KabustationClient::AuthApi.new
request_token = KabustationClient::RequestToken.new({api_password: 'xxxxxx'}) # RequestToken | 

begin
  #トークン発行
  result = api_instance.token_post(request_token)
  p result
rescue KabustationClient::ApiError => e
  puts "Exception when calling AuthApi->token_post: #{e}"
end


KabustationClient.configure.api_key['ApiKeyAuth'] = result.token

register_instance = KabustationClient::RegisterApi.new
instance = KabustationClient::RequestRegister.new(symbols: [{symbol: '5401', exchange: 1}])
result = register_instance.register_put(instance)


client = KabustationClient::PushClient.new(
  open: -> { puts "WebSocket opened" },
  message: -> (board) { puts "Received message: #{board.symbol_name}" }, # KabustationClient::BoardSuccess
  error: -> (e) { puts "Error occurred: #{e}" },
  close: -> (e) { puts "Connection closed: #{e}" }
)
client.connect

Documentation for API Endpoints

All URIs are relative to http://localhost:18080/kabusapi

ClassMethodHTTP requestDescription
KabustationClient::AuthApitoken_postPOST /tokenトークン発行
KabustationClient::InfoApiapisoftlimit_getGET /apisoftlimitソフトリミット
KabustationClient::InfoApiboard_getGET /board/{symbol}時価情報・板情報
KabustationClient::InfoApiexchange_getGET /exchange/{symbol}為替情報
KabustationClient::InfoApimarginpremium_getGET /margin/marginpremium/{symbol}プレミアム料取得
KabustationClient::InfoApiorders_getGET /orders注文約定照会
KabustationClient::InfoApipositions_getGET /positions残高照会
KabustationClient::InfoApiprimary_exchange_getGET /primaryexchange/{symbol}優先市場
KabustationClient::InfoApiranking_getGET /ranking詳細ランキング
KabustationClient::InfoApiregulations_getGET /regulations/{symbol}規制情報
KabustationClient::InfoApisymbol_getGET /symbol/{symbol}銘柄情報
KabustationClient::InfoApisymbolname_future_getGET /symbolname/future先物銘柄コード取得
KabustationClient::InfoApisymbolname_option_getGET /symbolname/optionオプション銘柄コード取得
KabustationClient::InfoApisymbolname_option_mini_getGET /symbolname/minioptionweeklyミニオプション(限週)銘柄コード取得
KabustationClient::OrderApicancelorder_putPUT /cancelorder注文取消
KabustationClient::OrderApisendoder_future_postPOST /sendorder/future注文発注(先物)
KabustationClient::OrderApisendorder_option_postPOST /sendorder/option注文発注(オプション)
KabustationClient::OrderApisendorder_postPOST /sendorder注文発注(現物・信用)
KabustationClient::RegisterApiregister_putPUT /register銘柄登録
KabustationClient::RegisterApiunregister_all_putPUT /unregister/all銘柄登録全解除
KabustationClient::RegisterApiunregister_putPUT /unregister銘柄登録解除
KabustationClient::WalletApiwallet_cash_getGET /wallet/cash取引余力(現物)
KabustationClient::WalletApiwallet_cash_symbol_getGET /wallet/cash/{symbol}取引余力(現物)(銘柄指定)
KabustationClient::WalletApiwallet_future_getGET /wallet/future取引余力(先物)
KabustationClient::WalletApiwallet_future_symbol_getGET /wallet/future/{symbol}取引余力(先物)(銘柄指定)
KabustationClient::WalletApiwallet_margin_getGET /wallet/margin取引余力(信用)
KabustationClient::WalletApiwallet_margin_symbol_getGET /wallet/margin/{symbol}取引余力(信用)(銘柄指定)
KabustationClient::WalletApiwallet_option_getGET /wallet/option取引余力(オプション)
KabustationClient::WalletApiwallet_option_symbol_getGET /wallet/option/{symbol}取引余力(オプション)(銘柄指定)

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

ApiKeyAuth

  • Type: API key
  • API key parameter name: X-API-Key
  • Location: HTTP header

FAQs

Package last updated on 28 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.