Sha256: a3ae7984318c980951d6f56df5aeee32504efdbf95c756a76bdf79d3cda52cd4

Contents?: true

Size: 688 Bytes

Versions: 12

Compression:

Stored size: 688 Bytes

Contents

# frozen_string_literal: true

module SolanaRuby
  module WebSocketMethods
    # Log Related Web Socket Methods
    module LogMethods
      def on_logs(params = ["all"], &block)
        subscribe("logsSubscribe", params, &block)
      end

      def on_logs_for_account(public_key, &block)
        params = [{ mentions: [public_key] }]
        on_logs(params, &block)
      end

      def on_logs_for_program(program_id, &block)
        params = [{ mentions: [program_id] }]
        on_logs(params, &block)
      end

      # Unsubscribe from logs updates
      def remove_logs_listener(subscription_id)
        unsubscribe("logsUnsubscribe", 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/log_methods.rb
solana-ruby-web3js-2.0.1 lib/solana_ruby/web_socket_methods/log_methods.rb
solana-ruby-web3js-2.0.0beta2 lib/solana_ruby/web_socket_methods/log_methods.rb
solana-ruby-web3js-2.0.0beta1 lib/solana_ruby/web_socket_methods/log_methods.rb
solana-ruby-web3js-2.0.0 lib/solana_ruby/web_socket_methods/log_methods.rb
solana-ruby-web3js-1.0.1.beta4 lib/solana_ruby/web_socket_methods/log_methods.rb
solana-ruby-web3js-1.0.1.beta3 lib/solana_ruby/web_socket_methods/log_methods.rb
solana-ruby-web3js-1.0.1.beta2 lib/solana_ruby/web_socket_methods/log_methods.rb
solana-ruby-web3js-1.0.1.beta1 lib/solana_ruby/web_socket_methods/log_methods.rb
solana-ruby-web3js-1.0.0.beta lib/solana_ruby/web_socket_methods/log_methods.rb
solana-ruby-web3js-1.0.1 lib/solana_ruby/web_socket_methods/log_methods.rb
solana-ruby-web3js-1.0.0 lib/solana_ruby/web_socket_methods/log_methods.rb