wazirx 1.0.3 → 1.0.4
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/wazirx/client/websocket.rb +4 -6
- data/lib/wazirx/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 01c782f112885c2acdc69e8702285ddfba65affea3905b9d6db70418b69d6079
         | 
| 4 | 
            +
              data.tar.gz: f22e877e2871543b3d3ac8c6ed417b7582c302f4e014be06ba9f4ec04127a178
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: b8d23e24f0020484a5f253bcf8bafd32b6dccfca0a904e96ad6da60bf39044912e69a4af15e33118608d5600450667f63baae83e9ed78406ddf8a331789724a2
         | 
| 7 | 
            +
              data.tar.gz: d36ff416c540bc43bad33c3151459c792f49fab19fb7067ff7ec20efedac924efc59f8058a71703119bf27ba050d2df70fe733a212fe8b2454d637fea27c8435
         | 
| @@ -74,16 +74,15 @@ module Wazirx | |
| 74 74 | 
             
                    @ws.send(JSON.dump({'event': UNSUBSCRIBE, 'streams': streams.flatten, 'id': id}))
         | 
| 75 75 | 
             
                  end
         | 
| 76 76 |  | 
| 77 | 
            -
                  def create_stream(streams | 
| 78 | 
            -
                    @ws = Faye::WebSocket::Client.new(BASE_URL)
         | 
| 77 | 
            +
                  def create_stream(streams:, id:, action:, methods: {}, auth_key: '')
         | 
| 78 | 
            +
                    @ws = Faye::WebSocket::Client.new(BASE_URL, nil)
         | 
| 79 79 | 
             
                    @ws.on :open do |event|
         | 
| 80 80 | 
             
                      puts [:open]
         | 
| 81 81 | 
             
                      if action == SUBSCRIBE
         | 
| 82 82 | 
             
                        puts subscribeEvent(streams, id, auth_key)
         | 
| 83 | 
            -
                        methods[:message].call(event)
         | 
| 84 83 | 
             
                        EM.add_periodic_timer 300 do
         | 
| 85 | 
            -
                          @ws.send('ping' | 
| 86 | 
            -
                          puts [:message, ' | 
| 84 | 
            +
                          @ws.send('ping')
         | 
| 85 | 
            +
                          puts [:message, 'Pinging websocket every 5 minutes']
         | 
| 87 86 | 
             
                        end
         | 
| 88 87 | 
             
                      else
         | 
| 89 88 | 
             
                        puts unsubscribeEvent(streams, id, auth_key)
         | 
| @@ -97,7 +96,6 @@ module Wazirx | |
| 97 96 |  | 
| 98 97 | 
             
                    @ws.on :close do |event|
         | 
| 99 98 | 
             
                      puts [:close, event.code, event.reason]
         | 
| 100 | 
            -
                      methods[:message].call(event)
         | 
| 101 99 | 
             
                      @ws = nil
         | 
| 102 100 | 
             
                    end
         | 
| 103 101 | 
             
                  end
         | 
    
        data/lib/wazirx/version.rb
    CHANGED
    
    
    
        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. | 
| 4 | 
            +
              version: 1.0.4
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Dibyajit
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2022-05- | 
| 11 | 
            +
            date: 2022-05-17 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         |