wazirx 1.0.1 → 1.0.2

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: 202c04f431dbe03f2f8246d77e71bc061e7f3436b2518f756569661c926c5d4c
4
- data.tar.gz: 45ab7233b6eef9ed845c11ef5db3a12eaa0face74108e5c79ec27f59d5d4e78d
3
+ metadata.gz: 8f3fe59a49d2c88b73a3a7141e5bd5c3c2ee989d1f0e9fc506c957c7186a4272
4
+ data.tar.gz: aa28a281b05f1323dae86fccec3b75522d569c6ae998b72116b047c00fe4ecb3
5
5
  SHA512:
6
- metadata.gz: 0959115fd4127b6baf7da074568c3acd767c8dd18d68c6a50996345a4503d174c55f40547e64671062b9188f1e9389325299fa27aca89b80b88514cc33029a64
7
- data.tar.gz: 59d761aad842d32d4262b4dc47b34662c0fbbf00ca6acb17e475207e19e7d25b2d376b434696064c06368a8fdea18564a033f7bc80d8a2e615032fe78c18272d
6
+ metadata.gz: 8b0783a976b70d1672d4c20a87b5e5fbee6bf7869e5cdd8e8682ddca597cf3568ca18dfec34fe07f9d417536afe349841f4c9809f9ae34d31c8c35e35f547a25
7
+ data.tar.gz: 5048809c05a59bbcc7b50e3375fae64f5e1ba490e87cc15bb5e6092ddac6cc9bf7e62969c516f3f6d7ed421415f68417378bf6c0f11241ca53b52878dc42878b
@@ -73,12 +73,16 @@ module Wazirx
73
73
  @ws.send(JSON.dump({'event':'unsubscribe', 'streams':streams.flatten,'id':id}))
74
74
  end
75
75
 
76
- def create_stream(streams: streams, id: id, action: action, auth_key:'')
76
+ def create_stream(streams: streams, id: id, action: action, methods: methods, auth_key:'')
77
77
  @ws = Faye::WebSocket::Client.new(BASE_URL)
78
78
  @ws.on :open do |event|
79
79
  puts [:open]
80
80
  if action == SUBSCRIBE
81
81
  puts subscribeEvent(streams, id, auth_key)
82
+ EM.add_periodic_timer 300 do
83
+ @ws.ping BASE_URL
84
+ puts [:message, 'pinged every 5 minutes']
85
+ end
82
86
  else
83
87
  puts unsubscribeEvent(streams, id, auth_key)
84
88
  end
@@ -86,6 +90,7 @@ module Wazirx
86
90
 
87
91
  @ws.on :message do |event|
88
92
  puts [:message, JSON.load(event.data)]
93
+ methods[:message].call(event)
89
94
  end
90
95
 
91
96
  @ws.on :close do |event|
@@ -1,3 +1,3 @@
1
1
  module Wazirx
2
- VERSION = '1.0.1'.freeze
2
+ VERSION = '1.0.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wazirx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dibyajit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-22 00:00:00.000000000 Z
11
+ date: 2022-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  - !ruby/object:Gem::Version
132
132
  version: '0'
133
133
  requirements: []
134
- rubygems_version: 3.0.9
134
+ rubygems_version: 3.0.3.1
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: API Wrapper for the Wazirx cryptocurrency exchange.