intrinio-realtime 5.1.0 → 5.2.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/lib/intrinio-realtime.rb +35 -12
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc3ca7bfcaefea9195e278ebfeb51b51d9dc2b28f6912bc2135cb35f721853a0
|
4
|
+
data.tar.gz: a3e611f37751686dbc269e8df2b94fa08cc612bf03c0c059c2c517c7b276829b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a89f564cf81d506753fcef44ee796d80d8917e993bdc49fe65a0a9d0ecabfe7feda9b299ea8c9f61a43917e4883a1cfd40317c8ff1a884e570e2bc943d34cd57
|
7
|
+
data.tar.gz: a6a41610d3b7bf78c25ff062269b75fad5c91a4ce7c517d8f8fc3d36689b63c07f10a61adf5a24f9b483c06be814fb58d448730a4d57b89daa571a9edb02aeb8
|
data/lib/intrinio-realtime.rb
CHANGED
@@ -18,12 +18,13 @@ module Intrinio
|
|
18
18
|
UTP = "UTP".freeze
|
19
19
|
OTC = "OTC".freeze
|
20
20
|
IEX = "IEX".freeze
|
21
|
-
|
22
|
-
|
21
|
+
CBOE_ONE = "CBOE_ONE".freeze
|
22
|
+
PROVIDERS = [REALTIME, MANUAL, DELAYED_SIP, NASDAQ_BASIC, IEX, CBOE_ONE].freeze
|
23
|
+
SUBPROVIDERS = [NO_SUBPROVIDER, CTA_A, CTA_B, UTP, OTC, NASDAQ_BASIC, IEX, CBOE_ONE].freeze
|
23
24
|
ASK = "Ask".freeze
|
24
25
|
BID = "Bid".freeze
|
25
26
|
CLIENT_INFO_HEADER_KEY = "Client-Information".freeze
|
26
|
-
CLIENT_INFO_HEADER_VALUE = "IntrinioRealtimeRubySDKv5.
|
27
|
+
CLIENT_INFO_HEADER_VALUE = "IntrinioRealtimeRubySDKv5.2".freeze
|
27
28
|
MESSAGE_VERSION_HEADER_KEY = "UseNewEquitiesFormat".freeze
|
28
29
|
MESSAGE_VERSION_HEADER_VALUE = "v2".freeze
|
29
30
|
|
@@ -79,7 +80,14 @@ module Intrinio
|
|
79
80
|
end
|
80
81
|
|
81
82
|
def is_darkpool
|
82
|
-
|
83
|
+
case @subprovider
|
84
|
+
when CTA_A, CTA_B, UTP, OTC
|
85
|
+
@market_center == nil || @market_center == 'D' || @market_center == 'E' || @market_center == "\0" || @market_center.empty?
|
86
|
+
when NASDAQ_BASIC
|
87
|
+
@market_center == nil || @market_center == 'L' || @market_center == '2' || @market_center == "\0" || @market_center.empty?
|
88
|
+
else
|
89
|
+
false
|
90
|
+
end
|
83
91
|
end
|
84
92
|
|
85
93
|
def to_s
|
@@ -159,7 +167,7 @@ module Intrinio
|
|
159
167
|
unless @provider
|
160
168
|
@provider = REALTIME
|
161
169
|
end
|
162
|
-
raise "Provider must be 'REALTIME', 'DELAYED_SIP', 'NASDAQ_BASIC', or 'MANUAL'" unless PROVIDERS.include?(@provider)
|
170
|
+
raise "Provider must be 'IEX', 'REALTIME', 'DELAYED_SIP', 'NASDAQ_BASIC', 'CBOE_ONE', or 'MANUAL'" unless PROVIDERS.include?(@provider)
|
163
171
|
|
164
172
|
@ip_address = options[:ip_address]
|
165
173
|
raise "Missing option ip_address while in MANUAL mode." if @provider == MANUAL and (@ip_address.nil? || @ip_address.empty?)
|
@@ -169,6 +177,11 @@ module Intrinio
|
|
169
177
|
@trades_only = false
|
170
178
|
end
|
171
179
|
|
180
|
+
@delayed = options[:delayed]
|
181
|
+
if @delayed.nil?
|
182
|
+
@delayed = false
|
183
|
+
end
|
184
|
+
|
172
185
|
@thread_quantity = options[:threads]
|
173
186
|
unless @thread_quantity
|
174
187
|
@thread_quantity = 4
|
@@ -315,6 +328,8 @@ module Intrinio
|
|
315
328
|
NASDAQ_BASIC
|
316
329
|
when 6
|
317
330
|
IEX
|
331
|
+
when 7
|
332
|
+
CBOE_ONE
|
318
333
|
else
|
319
334
|
IEX
|
320
335
|
end
|
@@ -375,7 +390,9 @@ module Intrinio
|
|
375
390
|
pop = nil
|
376
391
|
data = nil
|
377
392
|
pop = @messages.deq
|
378
|
-
|
393
|
+
if pop.nil? || pop.empty?
|
394
|
+
sleep(0.1)
|
395
|
+
else
|
379
396
|
begin
|
380
397
|
data = pop.unpack('C*')
|
381
398
|
rescue StandardError => ex
|
@@ -390,7 +407,6 @@ module Intrinio
|
|
390
407
|
# From there, check the type and symbol length at index 0 of each chunk to know how many bytes each message has.
|
391
408
|
count.times {start_index = handle_message(data, start_index)}
|
392
409
|
end
|
393
|
-
if pop.nil? then sleep(0.1) end
|
394
410
|
rescue StandardError => e
|
395
411
|
me.send :error, "Error handling message from queue: #{e} #{pop} : #{data} ; count: #{count} ; start index: #{start_index}"
|
396
412
|
rescue Exception => e
|
@@ -427,8 +443,10 @@ module Intrinio
|
|
427
443
|
|
428
444
|
case @provider
|
429
445
|
when REALTIME then url = "https://realtime-mx.intrinio.com/auth"
|
446
|
+
when IEX then url = "https://realtime-mx.intrinio.com/auth"
|
430
447
|
when DELAYED_SIP then url = "https://realtime-delayed-sip.intrinio.com/auth"
|
431
448
|
when NASDAQ_BASIC then url = "https://realtime-nasdaq-basic.intrinio.com/auth"
|
449
|
+
when CBOE_ONE then url = "https://cboe-one.intrinio.com/auth"
|
432
450
|
when MANUAL then url = "http://" + @ip_address + "/auth"
|
433
451
|
end
|
434
452
|
|
@@ -447,12 +465,17 @@ module Intrinio
|
|
447
465
|
"#{url}api_key=#{@api_key}"
|
448
466
|
end
|
449
467
|
|
450
|
-
def socket_url
|
468
|
+
def socket_url
|
469
|
+
delayed_part = @delayed ? "&delayed=true" : ""
|
470
|
+
|
451
471
|
case @provider
|
452
|
-
when REALTIME then "wss://realtime-mx.intrinio.com/socket/websocket?vsn=1.0.0&token=#{@token}&#{CLIENT_INFO_HEADER_KEY}=#{CLIENT_INFO_HEADER_VALUE}&#{MESSAGE_VERSION_HEADER_KEY}=#{MESSAGE_VERSION_HEADER_VALUE}"
|
453
|
-
when
|
454
|
-
when
|
455
|
-
when
|
472
|
+
when REALTIME then "wss://realtime-mx.intrinio.com/socket/websocket?vsn=1.0.0&token=#{@token}&#{CLIENT_INFO_HEADER_KEY}=#{CLIENT_INFO_HEADER_VALUE}&#{MESSAGE_VERSION_HEADER_KEY}=#{MESSAGE_VERSION_HEADER_VALUE}#{delayed_part}"
|
473
|
+
when IEX then "wss://realtime-mx.intrinio.com/socket/websocket?vsn=1.0.0&token=#{@token}&#{CLIENT_INFO_HEADER_KEY}=#{CLIENT_INFO_HEADER_VALUE}&#{MESSAGE_VERSION_HEADER_KEY}=#{MESSAGE_VERSION_HEADER_VALUE}#{delayed_part}"
|
474
|
+
when DELAYED_SIP then "wss://realtime-delayed-sip.intrinio.com/socket/websocket?vsn=1.0.0&token=#{@token}&#{CLIENT_INFO_HEADER_KEY}=#{CLIENT_INFO_HEADER_VALUE}&#{MESSAGE_VERSION_HEADER_KEY}=#{MESSAGE_VERSION_HEADER_VALUE}#{delayed_part}"
|
475
|
+
when NASDAQ_BASIC then "wss://realtime-nasdaq-basic.intrinio.com/socket/websocket?vsn=1.0.0&token=#{@token}&#{CLIENT_INFO_HEADER_KEY}=#{CLIENT_INFO_HEADER_VALUE}&#{MESSAGE_VERSION_HEADER_KEY}=#{MESSAGE_VERSION_HEADER_VALUE}#{delayed_part}"
|
476
|
+
when CBOE_ONE then "wss://cboe-one.intrinio.com/socket/websocket?vsn=1.0.0&token=#{@token}&#{CLIENT_INFO_HEADER_KEY}=#{CLIENT_INFO_HEADER_VALUE}&#{MESSAGE_VERSION_HEADER_KEY}=#{MESSAGE_VERSION_HEADER_VALUE}#{delayed_part}"
|
477
|
+
when MANUAL then "ws://" + @ip_address + "/socket/websocket?vsn=1.0.0&token=#{@token}&#{CLIENT_INFO_HEADER_KEY}=#{CLIENT_INFO_HEADER_VALUE}&#{MESSAGE_VERSION_HEADER_KEY}=#{MESSAGE_VERSION_HEADER_VALUE}#{delayed_part}"
|
478
|
+
else raise "Unknown provider"
|
456
479
|
end
|
457
480
|
end
|
458
481
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intrinio-realtime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Intrinio
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|
@@ -78,7 +78,7 @@ homepage: https://github.com/intrinio/intrinio-realtime-ruby-sdk
|
|
78
78
|
licenses:
|
79
79
|
- GPL-3.0
|
80
80
|
metadata: {}
|
81
|
-
post_install_message:
|
81
|
+
post_install_message:
|
82
82
|
rdoc_options: []
|
83
83
|
require_paths:
|
84
84
|
- lib
|
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
94
|
version: '0'
|
95
95
|
requirements: []
|
96
96
|
rubygems_version: 3.1.6
|
97
|
-
signing_key:
|
97
|
+
signing_key:
|
98
98
|
specification_version: 4
|
99
99
|
summary: Intrinio provides real-time stock prices from its Multi-Exchange feed, via
|
100
100
|
a two-way WebSocket connection.
|