Module: SolanaRuby::WebSocketMethods::SignatureMethods

Included in:
SolanaRuby::WebSocketClient
Defined in:
lib/solana_ruby/web_socket_methods/signature_methods.rb

Overview

Signature Related Web Socket Methods

Constant Summary collapse

FINALIZED_OPTIONS =
{ commitment: "finalized" }.freeze
BASE_64_ENCODING_OPTIONS =
{ encoding: "base64" }.freeze

Instance Method Summary collapse

Instance Method Details

#on_signature(signature, options = FINALIZED_OPTIONS, &block) ⇒ Object



10
11
12
13
# File 'lib/solana_ruby/web_socket_methods/signature_methods.rb', line 10

def on_signature(signature, options = FINALIZED_OPTIONS, &block)
  params = [signature, options]
  subscribe("signatureSubscribe", params, &block)
end

#on_signature_with_options(signature, options = BASE_64_ENCODING_OPTIONS.merge(FINALIZED_OPTIONS), &block) ⇒ Object



15
16
17
# File 'lib/solana_ruby/web_socket_methods/signature_methods.rb', line 15

def on_signature_with_options(signature, options = BASE_64_ENCODING_OPTIONS.merge(FINALIZED_OPTIONS), &block)
  on_signature(signature, options, &block)
end

#remove_signature_listener(subscription_id) ⇒ Object

Unsubscribe from signature updates



20
21
22
# File 'lib/solana_ruby/web_socket_methods/signature_methods.rb', line 20

def remove_signature_listener(subscription_id)
  unsubscribe("signatureUnsubscribe", subscription_id)
end