class Solana::Client

Client class for interacting with the Solana JSON RPC API over HTTP and WS.

Public Class Methods

new(api_endpoint = Solana::Utils::MAINNET, api_key = nil) click to toggle source

Initializes a new Client.

@param [String, nil] api_key Optional API key for authentication.

# File lib/solana-ruby/client.rb, line 16
def initialize(api_endpoint = Solana::Utils::MAINNET, api_key = nil)
  @api_key = api_key
  @api_endpoint = api_endpoint
end

Public Instance Methods

account_subscribe(pubkey, options = {}, &block) click to toggle source

Subscribes to account changes.

@param [String] pubkey The public key of the account. @param [Hash] options Optional parameters for the subscription. @yield [Object] The response from the subscription.

# File lib/solana-ruby/client.rb, line 534
def account_subscribe(pubkey, options = {}, &block)
  request_ws('accountSubscribe', [pubkey, options], &block)
end
account_unsubscribe(subscription_id, &block) click to toggle source

Unsubscribes from account changes.

@param [Integer] subscription_id The subscription ID. @yield [Object] The response from the unsubscription.

# File lib/solana-ruby/client.rb, line 543
def account_unsubscribe(subscription_id, &block)
  request_ws('accountUnsubscribe', [subscription_id], &block)
end
block_subscribe(options = {}, &block) click to toggle source

Subscribes to new blocks.

@param [Hash] options Optional parameters for the subscription. @yield [Object] The response from the subscription.

# File lib/solana-ruby/client.rb, line 552
def block_subscribe(options = {}, &block)
  request_ws('blockSubscribe', [options], &block)
end
block_unsubscribe(subscription_id, &block) click to toggle source

Unsubscribes from new blocks.

@param [Integer] subscription_id The subscription ID. @yield [Object] The response from the unsubscription.

# File lib/solana-ruby/client.rb, line 561
def block_unsubscribe(subscription_id, &block)
  request_ws('blockUnsubscribe', [subscription_id], &block)
end
get_account_info(pubkey, options = {}, &block) click to toggle source

Retrieves account information for a given public key.

@param [String] pubkey The public key of the account. @param [Hash] options Optional parameters for the request. @return [Hash] The account information.

# File lib/solana-ruby/client.rb, line 27
def get_account_info(pubkey, options = {}, &block)
  request_http('getAccountInfo', [pubkey, options], &block)
end
get_balance(pubkey, options = {}, &block) click to toggle source

Retrieves the balance for a given public key.

@param [String] pubkey The public key of the account. @param [Hash] options Optional parameters for the request. @return [Integer] The balance in lamports.

# File lib/solana-ruby/client.rb, line 37
def get_balance(pubkey, options = {}, &block)
  request_http('getBalance', [pubkey, options], &block)
end
get_block(slot_number, options = {}, &block) click to toggle source

Retrieves information about a specific block.

@param [Integer] slot_number The slot number of the block. @param [Hash] options Optional parameters for the request. @return [Hash] The block information.

# File lib/solana-ruby/client.rb, line 47
def get_block(slot_number, options = {}, &block)
  request_http('getBlock', [slot_number, options], &block)
end
get_block_commitment(slot_number, options = {}, &block) click to toggle source

Retrieves block commitment information for a specific block.

@param [Integer] slot_number The slot number of the block. @param [Hash] options Optional parameters for the request. @return [Hash] The block commitment information.

# File lib/solana-ruby/client.rb, line 57
def get_block_commitment(slot_number, options = {}, &block)
  request_http('getBlockCommitment', [slot_number, options], &block)
end
get_block_height(options = {}, &block) click to toggle source

Retrieves the current block height.

@param [Hash] options Optional parameters for the request. @return [Integer] The current block height.

# File lib/solana-ruby/client.rb, line 66
def get_block_height(options = {}, &block)
  request_http('getBlockHeight', [options], &block)
end
get_block_production(options = {}, &block) click to toggle source

Retrieves block production information.

@param [Hash] options Optional parameters for the request. @return [Hash] The block production information.

# File lib/solana-ruby/client.rb, line 75
def get_block_production(options = {}, &block)
  request_http('getBlockProduction', [options], &block)
end
get_block_time(slot_number, options = {}, &block) click to toggle source

Retrieves the estimated production time of a specific block.

@param [Integer] slot_number The slot number of the block. @param [Hash] options Optional parameters for the request. @return [Integer] The estimated production time in seconds.

# File lib/solana-ruby/client.rb, line 85
def get_block_time(slot_number, options = {}, &block)
  request_http('getBlockTime', [slot_number, options], &block)
end
get_blocks(start_slot, end_slot, options = {}, &block) click to toggle source

Retrieves a list of confirmed blocks between two slot numbers.

@param [Integer] start_slot The start slot number. @param [Integer] end_slot The end slot number. @param [Hash] options Optional parameters for the request. @return [Array<Integer>] The list of confirmed blocks.

# File lib/solana-ruby/client.rb, line 96
def get_blocks(start_slot, end_slot, options = {}, &block)
  request_http('getBlocks', [start_slot, end_slot, options], &block)
end
get_blocks_with_limit(start_slot, limit, options = {}, &block) click to toggle source

Retrieves a list of confirmed blocks starting from a given slot number with a limit on the number of blocks.

@param [Integer] start_slot The start slot number. @param [Integer] limit The maximum number of blocks to return. @param [Hash] options Optional parameters for the request. @return [Array<Integer>] The list of confirmed blocks.

# File lib/solana-ruby/client.rb, line 107
def get_blocks_with_limit(start_slot, limit, options = {}, &block)
  request_http('getBlocksWithLimit', [start_slot, limit, options], &block)
end
get_cluster_nodes(options = {}, &block) click to toggle source

Retrieves the list of cluster nodes.

@param [Hash] options Optional parameters for the request. @return [Array<Hash>] The list of cluster nodes.

# File lib/solana-ruby/client.rb, line 116
def get_cluster_nodes(options = {}, &block)
  request_http('getClusterNodes', [options], &block)
end
get_epoch_info(options = {}, &block) click to toggle source

Retrieves epoch information.

@param [Hash] options Optional parameters for the request. @return [Hash] The epoch information.

# File lib/solana-ruby/client.rb, line 125
def get_epoch_info(options = {}, &block)
  request_http('getEpochInfo', [options], &block)
end
get_epoch_schedule(options = {}, &block) click to toggle source

Retrieves the epoch schedule.

@param [Hash] options Optional parameters for the request. @return [Hash] The epoch schedule.

# File lib/solana-ruby/client.rb, line 134
def get_epoch_schedule(options = {}, &block)
  request_http('getEpochSchedule', [options], &block)
end
get_fee_for_message(message, options = {}, &block) click to toggle source

Retrieves the fee for a given message.

@param [String] message The message for which the fee is to be calculated. @param [Hash] options Optional parameters for the request. @return [Integer] The fee for the message.

# File lib/solana-ruby/client.rb, line 144
def get_fee_for_message(message, options = {}, &block)
  request_http('getFeeForMessage', [message, options], &block)
end
get_first_available_block(options = {}, &block) click to toggle source

Retrieves the slot of the first available block.

@param [Hash] options Optional parameters for the request. @return [Integer] The slot of the first available block.

# File lib/solana-ruby/client.rb, line 153
def get_first_available_block(options = {}, &block)
  request_http('getFirstAvailableBlock', [options], &block)
end
get_genesis_hash(options = {}, &block) click to toggle source

Retrieves the genesis hash.

@param [Hash] options Optional parameters for the request. @return [String] The genesis hash.

# File lib/solana-ruby/client.rb, line 162
def get_genesis_hash(options = {}, &block)
  request_http('getGenesisHash', [options], &block)
end
get_health(options = {}, &block) click to toggle source

Checks the health of the node.

@param [Hash] options Optional parameters for the request. @return [String] The health status of the node.

# File lib/solana-ruby/client.rb, line 171
def get_health(options = {}, &block)
  request_http('getHealth', [options], &block)
end
get_highest_snapshot_slot(options = {}, &block) click to toggle source

Retrieves the highest snapshot slot.

@param [Hash] options Optional parameters for the request. @return [Integer] The highest snapshot slot.

# File lib/solana-ruby/client.rb, line 180
def get_highest_snapshot_slot(options = {}, &block)
  request_http('getHighestSnapshotSlot', [options], &block)
end
get_identity(options = {}, &block) click to toggle source

Retrieves the identity of the node.

@param [Hash] options Optional parameters for the request. @return [Hash] The identity information of the node.

# File lib/solana-ruby/client.rb, line 189
def get_identity(options = {}, &block)
  request_http('getIdentity', [options], &block)
end
get_inflation_governor(options = {}, &block) click to toggle source

Retrieves the current inflation governor settings.

@param [Hash] options Optional parameters for the request. @return [Hash] The inflation governor settings.

# File lib/solana-ruby/client.rb, line 198
def get_inflation_governor(options = {}, &block)
  request_http('getInflationGovernor', [options], &block)
end
get_inflation_rate(options = {}, &block) click to toggle source

Retrieves the current inflation rate.

@param [Hash] options Optional parameters for the request. @return [Hash] The inflation rate.

# File lib/solana-ruby/client.rb, line 207
def get_inflation_rate(options = {}, &block)
  request_http('getInflationRate', [options], &block)
end
get_inflation_reward(addresses, options = {}, &block) click to toggle source

Retrieves the inflation reward for a given list of addresses.

@param [Array<String>] addresses The list of addresses. @param [Hash] options Optional parameters for the request. @return [Array<Hash>] The inflation rewards for the addresses.

# File lib/solana-ruby/client.rb, line 217
def get_inflation_reward(addresses, options = {}, &block)
  request_http('getInflationReward', [addresses, options], &block)
end
get_largest_accounts(options = {}, &block) click to toggle source

Retrieves the largest accounts.

@param [Hash] options Optional parameters for the request. @return [Array<Hash>] The largest accounts.

# File lib/solana-ruby/client.rb, line 226
def get_largest_accounts(options = {}, &block)
  request_http('getLargestAccounts', [options], &block)
end
get_latest_blockhash(options = {}, &block) click to toggle source

Retrieves the latest blockhash.

@param [Hash] options Optional parameters for the request. @return [Hash] The latest blockhash.

# File lib/solana-ruby/client.rb, line 235
def get_latest_blockhash(options = {}, &block)
  request_http('getLatestBlockhash', [options], &block)
end
get_leader_schedule(options = {}, &block) click to toggle source

Retrieves the leader schedule.

@param [Hash] options Optional parameters for the request. @return [Hash] The leader schedule.

# File lib/solana-ruby/client.rb, line 244
def get_leader_schedule(options = {}, &block)
  request_http('getLeaderSchedule', [options], &block)
end
get_max_retransmit_slot(options = {}, &block) click to toggle source

Retrieves the maximum retransmit slot.

@param [Hash] options Optional parameters for the request. @return [Integer] The maximum retransmit slot.

# File lib/solana-ruby/client.rb, line 253
def get_max_retransmit_slot(options = {}, &block)
  request_http('getMaxRetransmitSlot', [options], &block)
end
get_max_shred_insert_slot(options = {}, &block) click to toggle source

Retrieves the maximum shred insert slot.

@param [Hash] options Optional parameters for the request. @return [Integer] The maximum shred insert slot.

# File lib/solana-ruby/client.rb, line 262
def get_max_shred_insert_slot(options = {}, &block)
  request_http('getMaxShredInsertSlot', [options], &block)
end
get_minimum_balance_for_rent_exemption(data_length, options = {}, &block) click to toggle source

Retrieves the minimum balance required for rent exemption for a given data length.

@param [Integer] data_length The length of the data in bytes. @param [Hash] options Optional parameters for the request. @return [Integer] The minimum balance for rent exemption.

# File lib/solana-ruby/client.rb, line 272
def get_minimum_balance_for_rent_exemption(data_length, options = {}, &block)
  request_http('getMinimumBalanceForRentExemption', [data_length, options], &block)
end
get_multiple_accounts(pubkeys, options = {}, &block) click to toggle source

Retrieves information for multiple accounts.

@param [Array<String>] pubkeys The list of public keys. @param [Hash] options Optional parameters for the request. @return [Array<Hash>] The information for the accounts.

# File lib/solana-ruby/client.rb, line 282
def get_multiple_accounts(pubkeys, options = {}, &block)
  request_http('getMultipleAccounts', [pubkeys, options], &block)
end
get_program_accounts(pubkey, options = {}, &block) click to toggle source

Retrieves information for accounts owned by a specific program.

@param [String] pubkey The public key of the program. @param [Hash] options Optional parameters for the request. @return [Array<Hash>] The information for the program accounts.

# File lib/solana-ruby/client.rb, line 292
def get_program_accounts(pubkey, options = {}, &block)
  request_http('getProgramAccounts', [pubkey, options], &block)
end
get_recent_performance_samples(options = {}, &block) click to toggle source

Retrieves recent performance samples.

@param [Hash] options Optional parameters for the request. @return [Array<Hash>] The recent performance samples.

# File lib/solana-ruby/client.rb, line 301
def get_recent_performance_samples(options = {}, &block)
  request_http('getRecentPerformanceSamples', [options], &block)
end
get_recent_prioritization_fees(options = {}, &block) click to toggle source

Retrieves recent prioritization fees.

@param [Hash] options Optional parameters for the request. @return [Hash] The recent prioritization fees.

# File lib/solana-ruby/client.rb, line 310
def get_recent_prioritization_fees(options = {}, &block)
  request_http('getRecentPrioritizationFees', [options], &block)
end
get_signature_statuses(signatures, options = {}, &block) click to toggle source

Retrieves the status of given transaction signatures.

@param [Array<String>] signatures The list of transaction signatures. @param [Hash] options Optional parameters for the request. @return [Array<Hash>] The status of the transaction signatures.

# File lib/solana-ruby/client.rb, line 320
def get_signature_statuses(signatures, options = {}, &block)
  request_http('getSignatureStatuses', [signatures, options], &block)
end
get_signatures_for_address(address, options = {}, &block) click to toggle source

Retrieves the signatures for a given address.

@param [String] address The address for which to retrieve signatures. @param [Hash] options Optional parameters for the request. @return [Array<Hash>] The signatures for the address.

# File lib/solana-ruby/client.rb, line 330
def get_signatures_for_address(address, options = {}, &block)
  request_http('getSignaturesForAddress', [address, options], &block)
end
get_slot(options = {}, &block) click to toggle source

Retrieves the current slot.

@param [Hash] options Optional parameters for the request. @return [Integer] The current slot.

# File lib/solana-ruby/client.rb, line 339
def get_slot(options = {}, &block)
  request_http('getSlot', [options], &block)
end
get_slot_leader(options = {}, &block) click to toggle source

Retrieves the current slot leader.

@param [Hash] options Optional parameters for the request. @return [String] The current slot leader.

# File lib/solana-ruby/client.rb, line 348
def get_slot_leader(options = {}, &block)
  request_http('getSlotLeader', [options], &block)
end
get_slot_leaders(start_slot, limit, options = {}, &block) click to toggle source

Retrieves the slot leaders starting from a given slot with a limit on the number of leaders.

@param [Integer] start_slot The start slot number. @param [Integer] limit The maximum number of leaders to return. @param [Hash] options Optional parameters for the request. @return [Array<String>] The slot leaders.

# File lib/solana-ruby/client.rb, line 359
def get_slot_leaders(start_slot, limit, options = {}, &block)
  request_http('getSlotLeaders', [start_slot, limit, options], &block)
end
get_stake_activation(pubkey, options = {}, &block) click to toggle source

Retrieves the stake activation information for a given public key.

@param [String] pubkey The public key of the stake account. @param [Hash] options Optional parameters for the request. @return [Hash] The stake activation information.

# File lib/solana-ruby/client.rb, line 369
def get_stake_activation(pubkey, options = {}, &block)
  request_http('getStakeActivation', [pubkey, options], &block)
end
get_stake_minimum_delegation(options = {}, &block) click to toggle source

Retrieves the minimum delegation for a stake account.

@param [Hash] options Optional parameters for the request. @return [Integer] The minimum delegation.

# File lib/solana-ruby/client.rb, line 378
def get_stake_minimum_delegation(options = {}, &block)
  request_http('getStakeMinimumDelegation', [options], &block)
end
get_supply(options = {}, &block) click to toggle source

Retrieves the supply information.

@param [Hash] options Optional parameters for the request. @return [Hash] The supply information.

# File lib/solana-ruby/client.rb, line 387
def get_supply(options = {}, &block)
  request_http('getSupply', [options], &block)
end
get_token_account_balance(pubkey, options = {}, &block) click to toggle source

Retrieves the token balance for a given token account.

@param [String] pubkey The public key of the token account. @param [Hash] options Optional parameters for the request. @return [Hash] The token balance.

# File lib/solana-ruby/client.rb, line 397
def get_token_account_balance(pubkey, options = {}, &block)
  request_http('getTokenAccountBalance', [pubkey, options], &block)
end
get_token_accounts_by_delegate(delegate, opts = {}, options = {}, &block) click to toggle source

Retrieves token accounts by delegate.

@param [String] delegate The delegate address. @param [Hash] opts Additional options for the request. @param [Hash] options Optional parameters for the request. @return [Array<Hash>] The token accounts by delegate.

# File lib/solana-ruby/client.rb, line 408
def get_token_accounts_by_delegate(delegate, opts = {}, options = {}, &block)
  request_http('getTokenAccountsByDelegate', [delegate, opts, options], &block)
end
get_token_accounts_by_owner(owner, opts = {}, options = {}, &block) click to toggle source

Retrieves token accounts by owner.

@param [String] owner The owner address. @param [Hash] opts Additional options for the request. @param [Hash] options Optional parameters for the request. @return [Array<Hash>] The token accounts by owner.

# File lib/solana-ruby/client.rb, line 419
def get_token_accounts_by_owner(owner, opts = {}, options = {}, &block)
  request_http('getTokenAccountsByOwner', [owner, opts, options], &block)
end
get_token_largest_accounts(pubkey, options = {}, &block) click to toggle source

Retrieves the largest accounts for a given token.

@param [String] pubkey The public key of the token. @param [Hash] options Optional parameters for the request. @return [Array<Hash>] The largest accounts for the token.

# File lib/solana-ruby/client.rb, line 429
def get_token_largest_accounts(pubkey, options = {}, &block)
  request_http('getTokenLargestAccounts', [pubkey, options], &block)
end
get_token_supply(pubkey, options = {}, &block) click to toggle source

Retrieves the supply of a given token.

@param [String] pubkey The public key of the token. @param [Hash] options Optional parameters for the request. @return [Hash] The token supply.

# File lib/solana-ruby/client.rb, line 439
def get_token_supply(pubkey, options = {}, &block)
  request_http('getTokenSupply', [pubkey, options], &block)
end
get_transaction(signature, options = {}, &block) click to toggle source

Retrieves transaction details for a given signature.

@param [String] signature The transaction signature. @param [Hash] options Optional parameters for the request. @return [Hash] The transaction details.

# File lib/solana-ruby/client.rb, line 449
def get_transaction(signature, options = {}, &block)
  request_http('getTransaction', [signature, options], &block)
end
get_transaction_count(options = {}, &block) click to toggle source

Retrieves the total number of transactions processed by the network.

@param [Hash] options Optional parameters for the request. @return [Integer] The total number of transactions.

# File lib/solana-ruby/client.rb, line 458
def get_transaction_count(options = {}, &block)
  request_http('getTransactionCount', [options], &block)
end
get_version(&block) click to toggle source

Retrieves the current version of the Solana software.

@return [Hash] The current version information.

# File lib/solana-ruby/client.rb, line 466
def get_version(&block)
  request_http('getVersion', &block)
end
get_vote_accounts(options = {}, &block) click to toggle source

Retrieves the list of vote accounts.

@param [Hash] options Optional parameters for the request. @return [Hash] The list of vote accounts.

# File lib/solana-ruby/client.rb, line 475
def get_vote_accounts(options = {}, &block)
  request_http('getVoteAccounts', [options], &block)
end
is_blockhash_valid(blockhash, options = {}, &block) click to toggle source

Checks if a given blockhash is valid.

@param [String] blockhash The blockhash to check. @param [Hash] options Optional parameters for the request. @return [Boolean] Whether the blockhash is valid.

# File lib/solana-ruby/client.rb, line 485
def is_blockhash_valid(blockhash, options = {}, &block)
  request_http('isBlockhashValid', [blockhash, options], &block)
end
logs_subscribe(filter, options = {}, &block) click to toggle source

Subscribes to log messages.

@param [String, Hash] filter The filter for log messages (e.g., a public key or a set of options). @param [Hash] options Optional parameters for the subscription. @yield [Object] The response from the subscription.

# File lib/solana-ruby/client.rb, line 571
def logs_subscribe(filter, options = {}, &block)
  request_ws('logsSubscribe', [filter, options], &block)
end
logs_unsubscribe(subscription_id, &block) click to toggle source

Unsubscribes from log messages.

@param [Integer] subscription_id The subscription ID. @yield [Object] The response from the unsubscription.

# File lib/solana-ruby/client.rb, line 580
def logs_unsubscribe(subscription_id, &block)
  request_ws('logsUnsubscribe', [subscription_id], &block)
end
minimum_ledger_slot(options = {}, &block) click to toggle source

Retrieves the minimum ledger slot.

@param [Hash] options Optional parameters for the request. @return [Integer] The minimum ledger slot.

# File lib/solana-ruby/client.rb, line 494
def minimum_ledger_slot(options = {}, &block)
  request_http('minimumLedgerSlot', [options], &block)
end
program_subscribe(pubkey, options = {}, &block) click to toggle source

Subscribes to program changes.

@param [String] pubkey The public key of the program. @param [Hash] options Optional parameters for the subscription. @yield [Object] The response from the subscription.

# File lib/solana-ruby/client.rb, line 590
def program_subscribe(pubkey, options = {}, &block)
  request_ws('programSubscribe', [pubkey, options], &block)
end
program_unsubscribe(subscription_id, &block) click to toggle source

Unsubscribes from program changes.

@param [Integer] subscription_id The subscription ID. @yield [Object] The response from the unsubscription.

# File lib/solana-ruby/client.rb, line 599
def program_unsubscribe(subscription_id, &block)
  request_ws('programUnsubscribe', [subscription_id], &block)
end
request_airdrop(pubkey, lamports, options = {}, &block) click to toggle source

Requests an airdrop to a given public key.

@param [String] pubkey The public key to receive the airdrop. @param [Integer] lamports The amount of lamports to airdrop. @param [Hash] options Optional parameters for the request. @return [Hash] The airdrop request response.

# File lib/solana-ruby/client.rb, line 505
def request_airdrop(pubkey, lamports, options = {}, &block)
  request_http('requestAirdrop', [pubkey, lamports, options], &block)
end
root_subscribe(&block) click to toggle source

Subscribes to root changes.

@yield [Object] The response from the subscription.

# File lib/solana-ruby/client.rb, line 607
def root_subscribe(&block)
  request_ws('rootSubscribe', &block)
end
root_unsubscribe(subscription_id, &block) click to toggle source

Unsubscribes from root changes.

@param [Integer] subscription_id The subscription ID. @yield [Object] The response from the unsubscription.

# File lib/solana-ruby/client.rb, line 616
def root_unsubscribe(subscription_id, &block)
  request_ws('rootUnsubscribe', [subscription_id], &block)
end
send_transaction(transaction, &block) click to toggle source

Sends a transaction.

@param [Hash] transaction The transaction to send. @return [Hash] The response from the send transaction request.

# File lib/solana-ruby/client.rb, line 514
def send_transaction(transaction, &block)
  request_http('sendTransaction', [transaction.to_json], &block)
end
signature_subscribe(signature, options = {}, &block) click to toggle source

Subscribes to signature status changes.

@param [String] signature The signature to monitor. @param [Hash] options Optional parameters for the subscription. @yield [Object] The response from the subscription.

# File lib/solana-ruby/client.rb, line 626
def signature_subscribe(signature, options = {}, &block)
  request_ws('signatureSubscribe', [signature, options], &block)
end
signature_unsubscribe(subscription_id, &block) click to toggle source

Unsubscribes from signature status changes.

@param [Integer] subscription_id The subscription ID. @yield [Object] The response from the unsubscription.

# File lib/solana-ruby/client.rb, line 635
def signature_unsubscribe(subscription_id, &block)
  request_ws('signatureUnsubscribe', [subscription_id], &block)
end
simulate_transaction(transaction, options = {}, &block) click to toggle source

Simulates a transaction.

@param [Hash] transaction The transaction to simulate. @param [Hash] options Optional parameters for the request. @return [Hash] The simulation response.

# File lib/solana-ruby/client.rb, line 524
def simulate_transaction(transaction, options = {}, &block)
  request_http('simulateTransaction', [transaction.to_json, options], &block)
end
slot_subscribe(&block) click to toggle source

Subscribes to slot changes.

@yield [Object] The response from the subscription.

# File lib/solana-ruby/client.rb, line 643
def slot_subscribe(&block)
  request_ws('slotSubscribe', &block)
end
slot_unsubscribe(subscription_id, &block) click to toggle source

Unsubscribes from slot changes.

@param [Integer] subscription_id The subscription ID. @yield [Object] The response from the unsubscription.

# File lib/solana-ruby/client.rb, line 652
def slot_unsubscribe(subscription_id, &block)
  request_ws('slotUnsubscribe', [subscription_id], &block)
end
slots_updates_subscribe(&block) click to toggle source

Subscribes to slot updates.

@yield [Object] The response from the subscription.

# File lib/solana-ruby/client.rb, line 660
def slots_updates_subscribe(&block)
  request_ws('slotsUpdatesSubscribe', &block)
end
slots_updates_unsubscribe(subscription_id, &block) click to toggle source

Unsubscribes from slot updates.

@param [Integer] subscription_id The subscription ID. @yield [Object] The response from the unsubscription.

# File lib/solana-ruby/client.rb, line 669
def slots_updates_unsubscribe(subscription_id, &block)
  request_ws('slotsUpdatesUnsubscribe', [subscription_id], &block)
end
vote_subscribe(&block) click to toggle source

Subscribes to vote updates.

@yield [Object] The response from the subscription.

# File lib/solana-ruby/client.rb, line 677
def vote_subscribe(&block)
  request_ws('voteSubscribe', &block)
end
vote_unsubscribe(subscription_id, &block) click to toggle source

Unsubscribes from vote updates.

@param [Integer] subscription_id The subscription ID. @yield [Object] The response from the unsubscription.

# File lib/solana-ruby/client.rb, line 686
def vote_unsubscribe(subscription_id, &block)
  request_ws('voteUnsubscribe', [subscription_id], &block)
end