polygonio-ruby 0.2.8 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0025e44c36af5a1d8091cca11ac55ebf929a3dae3ecde2f047bf6d4effb46d52
4
- data.tar.gz: 0306c02483d4f80046c64adb45b3062b49c4bb5c979708d1c096c95b397e1087
3
+ metadata.gz: da2cad3a46c2398a6870001bd5cfe968cc9a3e7cd352d56b5e7912b2bc97e28a
4
+ data.tar.gz: f2d619957c5549e493aef4a712769a891a4cccd4f663c20ff70e8d40c75b1018
5
5
  SHA512:
6
- metadata.gz: e4026dea18165f8554ac3f66c28460a85f15a8caba691eaf3c9dfde7f91d9a2f10ac419f87ece14eed5af0548bb3b29d54ab8a537a8c92720f5f51fa63f6026d
7
- data.tar.gz: '01865cb6d541ed0e6d49c9c0897528bb98c9f89581d906f023a4578e9b9689c5f920834c80a3f23e3b35458086f831f7261a4ed6d1c39af3d85908d4e3f51dd1'
6
+ metadata.gz: ddda76d07347f4b7ba49c711f0ff7b97de0d6d2b29170c351a56d6a05d7c52fb750f53d0758ef12776fea29ef73a2fdb1b0ac6eae7ea895944f32661d3bb553d
7
+ data.tar.gz: f5ee7cd088e3896a32e0f14e9472b8328d5e16c3c546795b0d954953e569aee91f66597624cec7d4d74cff83a7bcb8cc72e0b5c3e60c02434b3ce42e1ca3fd9b
data/README.md CHANGED
@@ -48,3 +48,13 @@ Polygonio::Websocket::Client.new("crypto", api_key).subscribe("XQ.BTC-USD") do |
48
48
  pp event
49
49
  end
50
50
  ```
51
+
52
+ Using delayed websockets. If your account only supports delayed feeds you will need to use the delayed websocket endpoint
53
+
54
+ ```ruby
55
+ Polygonio::Websocket::Client.new("stocks", api_key, delayed: true).subscribe("AM.*,A.*,T.*") do |event|
56
+ pp "Incoming message"
57
+ pp event
58
+ end
59
+ ```
60
+
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polygonio
4
- VERSION = "0.2.8"
4
+ VERSION = "0.3.0"
5
5
  end
@@ -134,8 +134,10 @@ module Polygonio
134
134
 
135
135
  @api_key = api_key
136
136
  @ws = nil
137
+ opts[:comm_inactivity_timeout] = 0
137
138
  @opts = opts
138
- if opts.fetch(:delayed) == true
139
+ delayed = opts.fetch(:delayed) { false }
140
+ if delayed
139
141
  @url = "#{BASE_URL_DELAYED}#{path}"
140
142
  else
141
143
  @url = "#{BASE_URL}#{path}"
@@ -41,8 +41,8 @@ module Polygonio
41
41
  attribute? :h, Types::JSON::Decimal # High Price
42
42
  attribute? :l, Types::JSON::Decimal # Low Price
43
43
  attribute? :c, Types::JSON::Decimal # Close Price
44
- attribute? :a, Types::Integer # Today's Volume weighted average price
45
- attribute? :z, Types::Integer # Average trade size
44
+ attribute? :a, Types::JSON::Decimal # Today's Volume weighted average price
45
+ attribute? :z, Types::JSON::Decimal # Average trade size
46
46
  attribute? :s, Types::Integer # Starting tick timestamp
47
47
  attribute? :e, Types::Integer # Ending tick timestamp
48
48
  attribute? :otc, Types::Bool # Whether or not this aggregate is for an OTC ticker.
@@ -60,8 +60,8 @@ module Polygonio
60
60
  attribute? :h, Types::JSON::Decimal # High Price
61
61
  attribute? :l, Types::JSON::Decimal # Low Price
62
62
  attribute? :c, Types::JSON::Decimal # Close Price
63
- attribute? :a, Types::Integer # Today's Volume weighted average price
64
- attribute? :z, Types::Integer # Average trade size
63
+ attribute? :a, Types::JSON::Decimal # Today's Volume weighted average price
64
+ attribute? :z, Types::JSON::Decimal # Average trade size
65
65
  attribute? :s, Types::Integer # Starting tick timestamp
66
66
  attribute? :e, Types::Integer # Ending tick timestamp
67
67
  attribute? :otc, Types::Bool # Whether or not this aggregate is for an OTC ticker.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polygonio-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Eufemio
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-07 00:00:00.000000000 Z
11
+ date: 2023-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport