Sha256: c00c655eb77d6e3d51c87208f989ae8a7efdb6ff3d53f23551a91cd45082ae31

Contents?: true

Size: 608 Bytes

Versions: 12

Compression:

Stored size: 608 Bytes

Contents

# frozen_string_literal: true

module SolanaRuby
  module WebSocketMethods
    # Slot Related Web Socket Methods
    module SlotMethods
      # Subscribe to slot change notifications.
      # Options can include parameters such as commitment level, encoding, etc.
      def on_slot_change(&block)
        # Default to empty params if no options are provided.
        subscribe("slotSubscribe", [], &block)
      end

      # Unsubscribe from slot change notifications.
      def remove_slot_change_listener(subscription_id)
        unsubscribe("slotUnsubscribe", subscription_id)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
solana-ruby-web3js-2.0.2 lib/solana_ruby/web_socket_methods/slot_methods.rb
solana-ruby-web3js-2.0.1 lib/solana_ruby/web_socket_methods/slot_methods.rb
solana-ruby-web3js-2.0.0beta2 lib/solana_ruby/web_socket_methods/slot_methods.rb
solana-ruby-web3js-2.0.0beta1 lib/solana_ruby/web_socket_methods/slot_methods.rb
solana-ruby-web3js-2.0.0 lib/solana_ruby/web_socket_methods/slot_methods.rb
solana-ruby-web3js-1.0.1.beta4 lib/solana_ruby/web_socket_methods/slot_methods.rb
solana-ruby-web3js-1.0.1.beta3 lib/solana_ruby/web_socket_methods/slot_methods.rb
solana-ruby-web3js-1.0.1.beta2 lib/solana_ruby/web_socket_methods/slot_methods.rb
solana-ruby-web3js-1.0.1.beta1 lib/solana_ruby/web_socket_methods/slot_methods.rb
solana-ruby-web3js-1.0.0.beta lib/solana_ruby/web_socket_methods/slot_methods.rb
solana-ruby-web3js-1.0.1 lib/solana_ruby/web_socket_methods/slot_methods.rb
solana-ruby-web3js-1.0.0 lib/solana_ruby/web_socket_methods/slot_methods.rb