intrinio-realtime 5.0.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 +38 -11
- 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
|
|
@@ -78,6 +79,17 @@ module Intrinio
|
|
78
79
|
@condition
|
79
80
|
end
|
80
81
|
|
82
|
+
def is_darkpool
|
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
|
91
|
+
end
|
92
|
+
|
81
93
|
def to_s
|
82
94
|
[@symbol, @price, @size, @timestamp, @total_volume, @subprovider, @market_center, @condition].join(",")
|
83
95
|
end
|
@@ -155,7 +167,7 @@ module Intrinio
|
|
155
167
|
unless @provider
|
156
168
|
@provider = REALTIME
|
157
169
|
end
|
158
|
-
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)
|
159
171
|
|
160
172
|
@ip_address = options[:ip_address]
|
161
173
|
raise "Missing option ip_address while in MANUAL mode." if @provider == MANUAL and (@ip_address.nil? || @ip_address.empty?)
|
@@ -165,6 +177,11 @@ module Intrinio
|
|
165
177
|
@trades_only = false
|
166
178
|
end
|
167
179
|
|
180
|
+
@delayed = options[:delayed]
|
181
|
+
if @delayed.nil?
|
182
|
+
@delayed = false
|
183
|
+
end
|
184
|
+
|
168
185
|
@thread_quantity = options[:threads]
|
169
186
|
unless @thread_quantity
|
170
187
|
@thread_quantity = 4
|
@@ -311,6 +328,8 @@ module Intrinio
|
|
311
328
|
NASDAQ_BASIC
|
312
329
|
when 6
|
313
330
|
IEX
|
331
|
+
when 7
|
332
|
+
CBOE_ONE
|
314
333
|
else
|
315
334
|
IEX
|
316
335
|
end
|
@@ -371,7 +390,9 @@ module Intrinio
|
|
371
390
|
pop = nil
|
372
391
|
data = nil
|
373
392
|
pop = @messages.deq
|
374
|
-
|
393
|
+
if pop.nil? || pop.empty?
|
394
|
+
sleep(0.1)
|
395
|
+
else
|
375
396
|
begin
|
376
397
|
data = pop.unpack('C*')
|
377
398
|
rescue StandardError => ex
|
@@ -386,7 +407,6 @@ module Intrinio
|
|
386
407
|
# From there, check the type and symbol length at index 0 of each chunk to know how many bytes each message has.
|
387
408
|
count.times {start_index = handle_message(data, start_index)}
|
388
409
|
end
|
389
|
-
if pop.nil? then sleep(0.1) end
|
390
410
|
rescue StandardError => e
|
391
411
|
me.send :error, "Error handling message from queue: #{e} #{pop} : #{data} ; count: #{count} ; start index: #{start_index}"
|
392
412
|
rescue Exception => e
|
@@ -423,8 +443,10 @@ module Intrinio
|
|
423
443
|
|
424
444
|
case @provider
|
425
445
|
when REALTIME then url = "https://realtime-mx.intrinio.com/auth"
|
446
|
+
when IEX then url = "https://realtime-mx.intrinio.com/auth"
|
426
447
|
when DELAYED_SIP then url = "https://realtime-delayed-sip.intrinio.com/auth"
|
427
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"
|
428
450
|
when MANUAL then url = "http://" + @ip_address + "/auth"
|
429
451
|
end
|
430
452
|
|
@@ -443,12 +465,17 @@ module Intrinio
|
|
443
465
|
"#{url}api_key=#{@api_key}"
|
444
466
|
end
|
445
467
|
|
446
|
-
def socket_url
|
468
|
+
def socket_url
|
469
|
+
delayed_part = @delayed ? "&delayed=true" : ""
|
470
|
+
|
447
471
|
case @provider
|
448
|
-
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}"
|
449
|
-
when
|
450
|
-
when
|
451
|
-
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"
|
452
479
|
end
|
453
480
|
end
|
454
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.
|