Class: Solana::Client
- Inherits:
-
Object
- Object
- Solana::Client
- Defined in:
- lib/solana-ruby/client.rb
Overview
Client class for interacting with the Solana JSON RPC API over HTTP and WS.
Instance Method Summary collapse
-
#account_subscribe(pubkey, options = {}) {|Object| ... } ⇒ Object
Subscribes to account changes.
-
#account_unsubscribe(subscription_id) {|Object| ... } ⇒ Object
Unsubscribes from account changes.
-
#block_subscribe(filter, options = {}) {|Object| ... } ⇒ Object
Subscribes to new blocks.
-
#block_unsubscribe(subscription_id) {|Object| ... } ⇒ Object
Unsubscribes from new blocks.
-
#get_account_info(pubkey, options = {}, &block) ⇒ Hash
Retrieves account information for a given public key.
-
#get_balance(pubkey, options = {}, &block) ⇒ Integer
Retrieves the balance for a given public key.
-
#get_block(slot_number, options = {}, &block) ⇒ Hash
Retrieves information about a specific block.
-
#get_block_commitment(slot_number, options = {}, &block) ⇒ Hash
Retrieves block commitment information for a specific block.
-
#get_block_height(options = {}, &block) ⇒ Integer
Retrieves the current block height.
-
#get_block_production(options = {}, &block) ⇒ Hash
Retrieves block production information.
-
#get_block_time(slot_number, &block) ⇒ Integer
Retrieves the estimated production time of a specific block.
-
#get_blocks(start_slot, options = {}, &block) ⇒ Array<Integer>
Retrieves a list of confirmed blocks between two slot numbers.
-
#get_blocks_with_limit(start_slot, limit, options = {}, &block) ⇒ Array<Integer>
Retrieves a list of confirmed blocks starting from a given slot number with a limit on the number of blocks.
-
#get_cluster_nodes(&block) ⇒ Array<Hash>
Retrieves the list of cluster nodes.
-
#get_epoch_info(options = {}, &block) ⇒ Hash
Retrieves epoch information.
-
#get_epoch_schedule(&block) ⇒ Hash
Retrieves the epoch schedule.
-
#get_fee_for_message(message, options = {}, &block) ⇒ Integer
Retrieves the fee for a given message.
-
#get_first_available_block(&block) ⇒ Integer
Retrieves the slot of the first available block.
-
#get_genesis_hash(&block) ⇒ String
Retrieves the genesis hash.
-
#get_health(&block) ⇒ String
Checks the health of the node.
-
#get_highest_snapshot_slot(&block) ⇒ Integer
Retrieves the highest snapshot slot.
-
#get_identity(&block) ⇒ Hash
Retrieves the identity of the node.
-
#get_inflation_governor(options = {}, &block) ⇒ Hash
Retrieves the current inflation governor settings.
-
#get_inflation_rate(&block) ⇒ Hash
Retrieves the current inflation rate.
-
#get_inflation_reward(addresses, options = {}, &block) ⇒ Array<Hash>
Retrieves the inflation reward for a given list of addresses.
-
#get_largest_accounts(options = {}, &block) ⇒ Array<Hash>
Retrieves the largest accounts.
-
#get_latest_blockhash(options = {}, &block) ⇒ Hash
Retrieves the latest blockhash.
-
#get_leader_schedule(slot_number = nil, options = {}, &block) ⇒ Hash
TODO.
-
#get_max_retransmit_slot(&block) ⇒ Integer
Retrieves the maximum retransmit slot.
-
#get_max_shred_insert_slot(&block) ⇒ Integer
Retrieves the maximum shred insert slot.
-
#get_minimum_balance_for_rent_exemption(data_length, options = {}, &block) ⇒ Integer
Retrieves the minimum balance required for rent exemption for a given data length.
-
#get_multiple_accounts(pubkeys, options = {}, &block) ⇒ Array<Hash>
Retrieves information for multiple accounts.
-
#get_program_accounts(pubkey, options = {}, &block) ⇒ Array<Hash>
Retrieves information for accounts owned by a specific program.
-
#get_recent_performance_samples(limit = 720, options = {}, &block) ⇒ Array<Hash>
Retrieves recent performance samples.
-
#get_recent_prioritization_fees(addresses = [], &block) ⇒ Hash
Retrieves recent prioritization fees.
-
#get_signature_statuses(signatures, options = {}, &block) ⇒ Array<Hash>
Retrieves the status of given transaction signatures.
-
#get_signatures_for_address(address, options = {}, &block) ⇒ Array<Hash>
Retrieves the signatures for a given address.
-
#get_slot(options = {}, &block) ⇒ Integer
Retrieves the current slot.
-
#get_slot_leader(options = {}, &block) ⇒ String
Retrieves the current slot leader.
-
#get_slot_leaders(start_slot, limit, options = {}, &block) ⇒ Array<String>
Retrieves the slot leaders starting from a given slot with a limit on the number of leaders.
-
#get_stake_activation(pubkey, options = {}, &block) ⇒ Hash
Retrieves the stake activation information for a given public key.
-
#get_stake_minimum_delegation(options = {}, &block) ⇒ Integer
Retrieves the minimum delegation for a stake account.
-
#get_supply(options = {}, &block) ⇒ Hash
Retrieves the supply information.
-
#get_token_account_balance(pubkey, options = {}, &block) ⇒ Hash
Retrieves the token balance for a given token account.
-
#get_token_accounts_by_delegate(delegate, opts = {}, options = {}, &block) ⇒ Array<Hash>
Retrieves token accounts by delegate.
-
#get_token_accounts_by_owner(owner, opts = {}, options = {}, &block) ⇒ Array<Hash>
Retrieves token accounts by owner.
-
#get_token_largest_accounts(pubkey, options = {}, &block) ⇒ Array<Hash>
Retrieves the largest accounts for a given token.
-
#get_token_supply(pubkey, options = {}, &block) ⇒ Hash
Retrieves the supply of a given token.
-
#get_transaction(signature, options = {}, &block) ⇒ Hash
Retrieves transaction details for a given signature.
-
#get_transaction_count(options = {}, &block) ⇒ Integer
Retrieves the total number of transactions processed by the network.
-
#get_version(&block) ⇒ Hash
Retrieves the current version of the Solana software.
-
#get_vote_accounts(options = {}, &block) ⇒ Hash
Retrieves the list of vote accounts.
-
#initialize(api_endpoint = Solana::Utils::MAINNET) ⇒ Client
constructor
Initializes a new Client.
-
#is_blockhash_valid(blockhash, options = {}, &block) ⇒ Boolean
Checks if a given blockhash is valid.
-
#logs_subscribe(filter, options = {}) {|Object| ... } ⇒ Object
Subscribes to log messages.
-
#logs_unsubscribe(subscription_id) {|Object| ... } ⇒ Object
Unsubscribes from log messages.
-
#minimum_ledger_slot(&block) ⇒ Integer
Retrieves the minimum ledger slot.
-
#program_subscribe(pubkey, options = {}) {|Object| ... } ⇒ Object
Subscribes to program changes.
-
#program_unsubscribe(subscription_id) {|Object| ... } ⇒ Object
Unsubscribes from program changes.
-
#request_airdrop(pubkey, lamports, options = {}, &block) ⇒ Hash
Requests an airdrop to a given public key.
-
#root_subscribe {|Object| ... } ⇒ Object
Subscribes to root changes.
-
#root_unsubscribe(subscription_id) {|Object| ... } ⇒ Object
Unsubscribes from root changes.
-
#send_transaction(transaction, options = {}, &block) ⇒ Hash
Sends a transaction.
-
#signature_subscribe(signature, options = {}) {|Object| ... } ⇒ Object
Subscribes to signature status changes.
-
#signature_unsubscribe(subscription_id) {|Object| ... } ⇒ Object
Unsubscribes from signature status changes.
-
#simulate_transaction(transaction, options = {}, &block) ⇒ Hash
Simulates a transaction.
-
#slot_subscribe {|Object| ... } ⇒ Object
Subscribes to slot changes.
-
#slot_unsubscribe(subscription_id) {|Object| ... } ⇒ Object
Unsubscribes from slot changes.
-
#slots_updates_subscribe {|Object| ... } ⇒ Object
Subscribes to slot updates.
-
#slots_updates_unsubscribe(subscription_id) {|Object| ... } ⇒ Object
Unsubscribes from slot updates.
-
#vote_subscribe {|Object| ... } ⇒ Object
Subscribes to vote updates.
-
#vote_unsubscribe(subscription_id) {|Object| ... } ⇒ Object
Unsubscribes from vote updates.
Constructor Details
Instance Method Details
#account_subscribe(pubkey, options = {}) {|Object| ... } ⇒ Object
Subscribes to account changes.
524 525 526 |
# File 'lib/solana-ruby/client.rb', line 524 def account_subscribe(pubkey, = {}, &block) request_ws('accountSubscribe', [pubkey, ], &block) end |
#account_unsubscribe(subscription_id) {|Object| ... } ⇒ Object
Unsubscribes from account changes.
533 534 535 |
# File 'lib/solana-ruby/client.rb', line 533 def account_unsubscribe(subscription_id, &block) request_ws('accountUnsubscribe', [subscription_id], &block) end |
#block_subscribe(filter, options = {}) {|Object| ... } ⇒ Object
Subscribes to new blocks.
542 543 544 |
# File 'lib/solana-ruby/client.rb', line 542 def block_subscribe(filter, = {}, &block) request_ws('blockSubscribe', [filter, ], &block) end |
#block_unsubscribe(subscription_id) {|Object| ... } ⇒ Object
Unsubscribes from new blocks.
551 552 553 |
# File 'lib/solana-ruby/client.rb', line 551 def block_unsubscribe(subscription_id, &block) request_ws('blockUnsubscribe', [subscription_id], &block) end |
#get_account_info(pubkey, options = {}, &block) ⇒ Hash
Retrieves account information for a given public key.
26 27 28 |
# File 'lib/solana-ruby/client.rb', line 26 def get_account_info(pubkey, = {}, &block) request_http('getAccountInfo', [pubkey, ], &block) end |
#get_balance(pubkey, options = {}, &block) ⇒ Integer
Retrieves the balance for a given public key.
36 37 38 |
# File 'lib/solana-ruby/client.rb', line 36 def get_balance(pubkey, = {}, &block) request_http('getBalance', [pubkey, ], &block) end |
#get_block(slot_number, options = {}, &block) ⇒ Hash
Retrieves information about a specific block.
46 47 48 |
# File 'lib/solana-ruby/client.rb', line 46 def get_block(slot_number, = {}, &block) request_http('getBlock', [slot_number, ], &block) end |
#get_block_commitment(slot_number, options = {}, &block) ⇒ Hash
Retrieves block commitment information for a specific block.
56 57 58 |
# File 'lib/solana-ruby/client.rb', line 56 def get_block_commitment(slot_number, = {}, &block) request_http('getBlockCommitment', [slot_number, ], &block) end |
#get_block_height(options = {}, &block) ⇒ Integer
Retrieves the current block height.
65 66 67 |
# File 'lib/solana-ruby/client.rb', line 65 def get_block_height( = {}, &block) request_http('getBlockHeight', [], &block) end |
#get_block_production(options = {}, &block) ⇒ Hash
Retrieves block production information.
74 75 76 |
# File 'lib/solana-ruby/client.rb', line 74 def get_block_production( = {}, &block) request_http('getBlockProduction', [], &block) end |
#get_block_time(slot_number, &block) ⇒ Integer
Retrieves the estimated production time of a specific block.
83 84 85 |
# File 'lib/solana-ruby/client.rb', line 83 def get_block_time(slot_number, &block) request_http('getBlockTime', [slot_number], &block) end |
#get_blocks(start_slot, options = {}, &block) ⇒ Array<Integer>
Retrieves a list of confirmed blocks between two slot numbers.
93 94 95 |
# File 'lib/solana-ruby/client.rb', line 93 def get_blocks(start_slot, = {}, &block) request_http('getBlocks', [start_slot, ], &block) end |
#get_blocks_with_limit(start_slot, limit, options = {}, &block) ⇒ Array<Integer>
Retrieves a list of confirmed blocks starting from a given slot number with a limit on the number of blocks.
104 105 106 |
# File 'lib/solana-ruby/client.rb', line 104 def get_blocks_with_limit(start_slot, limit, = {}, &block) request_http('getBlocksWithLimit', [start_slot, limit, ], &block) end |
#get_cluster_nodes(&block) ⇒ Array<Hash>
Retrieves the list of cluster nodes.
112 113 114 |
# File 'lib/solana-ruby/client.rb', line 112 def get_cluster_nodes(&block) request_http('getClusterNodes', &block) end |
#get_epoch_info(options = {}, &block) ⇒ Hash
Retrieves epoch information.
121 122 123 |
# File 'lib/solana-ruby/client.rb', line 121 def get_epoch_info( = {}, &block) request_http('getEpochInfo', [], &block) end |
#get_epoch_schedule(&block) ⇒ Hash
Retrieves the epoch schedule.
129 130 131 |
# File 'lib/solana-ruby/client.rb', line 129 def get_epoch_schedule(&block) request_http('getEpochSchedule', &block) end |
#get_fee_for_message(message, options = {}, &block) ⇒ Integer
Retrieves the fee for a given message.
139 140 141 |
# File 'lib/solana-ruby/client.rb', line 139 def (, = {}, &block) request_http('getFeeForMessage', [, ], &block) end |
#get_first_available_block(&block) ⇒ Integer
Retrieves the slot of the first available block.
147 148 149 |
# File 'lib/solana-ruby/client.rb', line 147 def get_first_available_block(&block) request_http('getFirstAvailableBlock', &block) end |
#get_genesis_hash(&block) ⇒ String
Retrieves the genesis hash.
155 156 157 |
# File 'lib/solana-ruby/client.rb', line 155 def get_genesis_hash(&block) request_http('getGenesisHash', &block) end |
#get_health(&block) ⇒ String
Checks the health of the node.
163 164 165 |
# File 'lib/solana-ruby/client.rb', line 163 def get_health(&block) request_http('getHealth', &block) end |
#get_highest_snapshot_slot(&block) ⇒ Integer
Retrieves the highest snapshot slot.
171 172 173 |
# File 'lib/solana-ruby/client.rb', line 171 def get_highest_snapshot_slot(&block) request_http('getHighestSnapshotSlot', &block) end |
#get_identity(&block) ⇒ Hash
Retrieves the identity of the node.
179 180 181 |
# File 'lib/solana-ruby/client.rb', line 179 def get_identity(&block) request_http('getIdentity', &block) end |
#get_inflation_governor(options = {}, &block) ⇒ Hash
Retrieves the current inflation governor settings.
188 189 190 |
# File 'lib/solana-ruby/client.rb', line 188 def get_inflation_governor( = {}, &block) request_http('getInflationGovernor', [], &block) end |
#get_inflation_rate(&block) ⇒ Hash
Retrieves the current inflation rate.
196 197 198 |
# File 'lib/solana-ruby/client.rb', line 196 def get_inflation_rate(&block) request_http('getInflationRate', &block) end |
#get_inflation_reward(addresses, options = {}, &block) ⇒ Array<Hash>
Retrieves the inflation reward for a given list of addresses.
206 207 208 |
# File 'lib/solana-ruby/client.rb', line 206 def get_inflation_reward(addresses, = {}, &block) request_http('getInflationReward', [addresses, ], &block) end |
#get_largest_accounts(options = {}, &block) ⇒ Array<Hash>
Retrieves the largest accounts.
215 216 217 |
# File 'lib/solana-ruby/client.rb', line 215 def get_largest_accounts( = {}, &block) request_http('getLargestAccounts', [], &block) end |
#get_latest_blockhash(options = {}, &block) ⇒ Hash
Retrieves the latest blockhash.
224 225 226 |
# File 'lib/solana-ruby/client.rb', line 224 def get_latest_blockhash( = {}, &block) request_http('getLatestBlockhash', [], &block) end |
#get_leader_schedule(slot_number = nil, options = {}, &block) ⇒ Hash
TODO
Retrieves the leader schedule.
234 235 236 |
# File 'lib/solana-ruby/client.rb', line 234 def get_leader_schedule(slot_number = nil, = {}, &block) request_http('getLeaderSchedule', [slot_number, ], &block) end |
#get_max_retransmit_slot(&block) ⇒ Integer
Retrieves the maximum retransmit slot.
242 243 244 |
# File 'lib/solana-ruby/client.rb', line 242 def get_max_retransmit_slot(&block) request_http('getMaxRetransmitSlot', &block) end |
#get_max_shred_insert_slot(&block) ⇒ Integer
Retrieves the maximum shred insert slot.
250 251 252 |
# File 'lib/solana-ruby/client.rb', line 250 def get_max_shred_insert_slot(&block) request_http('getMaxShredInsertSlot', &block) end |
#get_minimum_balance_for_rent_exemption(data_length, options = {}, &block) ⇒ Integer
Retrieves the minimum balance required for rent exemption for a given data length.
260 261 262 |
# File 'lib/solana-ruby/client.rb', line 260 def get_minimum_balance_for_rent_exemption(data_length, = {}, &block) request_http('getMinimumBalanceForRentExemption', [data_length, ], &block) end |
#get_multiple_accounts(pubkeys, options = {}, &block) ⇒ Array<Hash>
Retrieves information for multiple accounts.
270 271 272 |
# File 'lib/solana-ruby/client.rb', line 270 def get_multiple_accounts(pubkeys, = {}, &block) request_http('getMultipleAccounts', [pubkeys, ], &block) end |
#get_program_accounts(pubkey, options = {}, &block) ⇒ Array<Hash>
Retrieves information for accounts owned by a specific program.
280 281 282 |
# File 'lib/solana-ruby/client.rb', line 280 def get_program_accounts(pubkey, = {}, &block) request_http('getProgramAccounts', [pubkey, ], &block) end |
#get_recent_performance_samples(limit = 720, options = {}, &block) ⇒ Array<Hash>
Retrieves recent performance samples.
290 291 292 |
# File 'lib/solana-ruby/client.rb', line 290 def get_recent_performance_samples(limit = 720, = {}, &block) request_http('getRecentPerformanceSamples', [limit, ], &block) end |
#get_recent_prioritization_fees(addresses = [], &block) ⇒ Hash
Retrieves recent prioritization fees.
299 300 301 |
# File 'lib/solana-ruby/client.rb', line 299 def get_recent_prioritization_fees(addresses = [], &block) request_http('getRecentPrioritizationFees', [addresses], &block) end |
#get_signature_statuses(signatures, options = {}, &block) ⇒ Array<Hash>
Retrieves the status of given transaction signatures.
309 310 311 |
# File 'lib/solana-ruby/client.rb', line 309 def get_signature_statuses(signatures, = {}, &block) request_http('getSignatureStatuses', [signatures, ], &block) end |
#get_signatures_for_address(address, options = {}, &block) ⇒ Array<Hash>
Retrieves the signatures for a given address.
319 320 321 |
# File 'lib/solana-ruby/client.rb', line 319 def get_signatures_for_address(address, = {}, &block) request_http('getSignaturesForAddress', [address, ], &block) end |
#get_slot(options = {}, &block) ⇒ Integer
Retrieves the current slot.
328 329 330 |
# File 'lib/solana-ruby/client.rb', line 328 def get_slot( = {}, &block) request_http('getSlot', [], &block) end |
#get_slot_leader(options = {}, &block) ⇒ String
Retrieves the current slot leader.
337 338 339 |
# File 'lib/solana-ruby/client.rb', line 337 def get_slot_leader( = {}, &block) request_http('getSlotLeader', [], &block) end |
#get_slot_leaders(start_slot, limit, options = {}, &block) ⇒ Array<String>
Retrieves the slot leaders starting from a given slot with a limit on the number of leaders.
348 349 350 |
# File 'lib/solana-ruby/client.rb', line 348 def get_slot_leaders(start_slot, limit, = {}, &block) request_http('getSlotLeaders', [start_slot, limit, ], &block) end |
#get_stake_activation(pubkey, options = {}, &block) ⇒ Hash
Retrieves the stake activation information for a given public key.
358 359 360 |
# File 'lib/solana-ruby/client.rb', line 358 def get_stake_activation(pubkey, = {}, &block) request_http('getStakeActivation', [pubkey, ], &block) end |
#get_stake_minimum_delegation(options = {}, &block) ⇒ Integer
Retrieves the minimum delegation for a stake account.
367 368 369 |
# File 'lib/solana-ruby/client.rb', line 367 def get_stake_minimum_delegation( = {}, &block) request_http('getStakeMinimumDelegation', [], &block) end |
#get_supply(options = {}, &block) ⇒ Hash
Retrieves the supply information.
376 377 378 |
# File 'lib/solana-ruby/client.rb', line 376 def get_supply( = {}, &block) request_http('getSupply', [], &block) end |
#get_token_account_balance(pubkey, options = {}, &block) ⇒ Hash
Retrieves the token balance for a given token account.
386 387 388 |
# File 'lib/solana-ruby/client.rb', line 386 def get_token_account_balance(pubkey, = {}, &block) request_http('getTokenAccountBalance', [pubkey, ], &block) end |
#get_token_accounts_by_delegate(delegate, opts = {}, options = {}, &block) ⇒ Array<Hash>
Retrieves token accounts by delegate.
397 398 399 |
# File 'lib/solana-ruby/client.rb', line 397 def get_token_accounts_by_delegate(delegate, opts = {}, = {}, &block) request_http('getTokenAccountsByDelegate', [delegate, opts, ], &block) end |
#get_token_accounts_by_owner(owner, opts = {}, options = {}, &block) ⇒ Array<Hash>
Retrieves token accounts by owner.
408 409 410 |
# File 'lib/solana-ruby/client.rb', line 408 def get_token_accounts_by_owner(owner, opts = {}, = {}, &block) request_http('getTokenAccountsByOwner', [owner, opts, ], &block) end |
#get_token_largest_accounts(pubkey, options = {}, &block) ⇒ Array<Hash>
Retrieves the largest accounts for a given token.
418 419 420 |
# File 'lib/solana-ruby/client.rb', line 418 def get_token_largest_accounts(pubkey, = {}, &block) request_http('getTokenLargestAccounts', [pubkey, ], &block) end |
#get_token_supply(pubkey, options = {}, &block) ⇒ Hash
Retrieves the supply of a given token.
428 429 430 |
# File 'lib/solana-ruby/client.rb', line 428 def get_token_supply(pubkey, = {}, &block) request_http('getTokenSupply', [pubkey, ], &block) end |
#get_transaction(signature, options = {}, &block) ⇒ Hash
Retrieves transaction details for a given signature.
438 439 440 |
# File 'lib/solana-ruby/client.rb', line 438 def get_transaction(signature, = {}, &block) request_http('getTransaction', [signature, ], &block) end |
#get_transaction_count(options = {}, &block) ⇒ Integer
Retrieves the total number of transactions processed by the network.
447 448 449 |
# File 'lib/solana-ruby/client.rb', line 447 def get_transaction_count( = {}, &block) request_http('getTransactionCount', [], &block) end |
#get_version(&block) ⇒ Hash
Retrieves the current version of the Solana software.
455 456 457 |
# File 'lib/solana-ruby/client.rb', line 455 def get_version(&block) request_http('getVersion', &block) end |
#get_vote_accounts(options = {}, &block) ⇒ Hash
Retrieves the list of vote accounts.
464 465 466 |
# File 'lib/solana-ruby/client.rb', line 464 def get_vote_accounts( = {}, &block) request_http('getVoteAccounts', [], &block) end |
#is_blockhash_valid(blockhash, options = {}, &block) ⇒ Boolean
Checks if a given blockhash is valid.
474 475 476 |
# File 'lib/solana-ruby/client.rb', line 474 def is_blockhash_valid(blockhash, = {}, &block) request_http('isBlockhashValid', [blockhash, ], &block) end |
#logs_subscribe(filter, options = {}) {|Object| ... } ⇒ Object
Subscribes to log messages.
561 562 563 |
# File 'lib/solana-ruby/client.rb', line 561 def logs_subscribe(filter, = {}, &block) request_ws('logsSubscribe', [filter, ], &block) end |
#logs_unsubscribe(subscription_id) {|Object| ... } ⇒ Object
Unsubscribes from log messages.
570 571 572 |
# File 'lib/solana-ruby/client.rb', line 570 def logs_unsubscribe(subscription_id, &block) request_ws('logsUnsubscribe', [subscription_id], &block) end |
#minimum_ledger_slot(&block) ⇒ Integer
Retrieves the minimum ledger slot.
483 484 485 |
# File 'lib/solana-ruby/client.rb', line 483 def minimum_ledger_slot(&block) request_http('minimumLedgerSlot', &block) end |
#program_subscribe(pubkey, options = {}) {|Object| ... } ⇒ Object
Subscribes to program changes.
580 581 582 |
# File 'lib/solana-ruby/client.rb', line 580 def program_subscribe(pubkey, = {}, &block) request_ws('programSubscribe', [pubkey, ], &block) end |
#program_unsubscribe(subscription_id) {|Object| ... } ⇒ Object
Unsubscribes from program changes.
589 590 591 |
# File 'lib/solana-ruby/client.rb', line 589 def program_unsubscribe(subscription_id, &block) request_ws('programUnsubscribe', [subscription_id], &block) end |
#request_airdrop(pubkey, lamports, options = {}, &block) ⇒ Hash
Requests an airdrop to a given public key.
494 495 496 |
# File 'lib/solana-ruby/client.rb', line 494 def request_airdrop(pubkey, lamports, = {}, &block) request_http('requestAirdrop', [pubkey, lamports, ], &block) end |
#root_subscribe {|Object| ... } ⇒ Object
Subscribes to root changes.
597 598 599 |
# File 'lib/solana-ruby/client.rb', line 597 def root_subscribe(&block) request_ws('rootSubscribe', &block) end |
#root_unsubscribe(subscription_id) {|Object| ... } ⇒ Object
Unsubscribes from root changes.
606 607 608 |
# File 'lib/solana-ruby/client.rb', line 606 def root_unsubscribe(subscription_id, &block) request_ws('rootUnsubscribe', [subscription_id], &block) end |
#send_transaction(transaction, options = {}, &block) ⇒ Hash
Sends a transaction.
504 505 506 |
# File 'lib/solana-ruby/client.rb', line 504 def send_transaction(transaction, = {}, &block) request_http('sendTransaction', [transaction.to_json, ], &block) end |
#signature_subscribe(signature, options = {}) {|Object| ... } ⇒ Object
Subscribes to signature status changes.
616 617 618 |
# File 'lib/solana-ruby/client.rb', line 616 def signature_subscribe(signature, = {}, &block) request_ws('signatureSubscribe', [signature, ], &block) end |
#signature_unsubscribe(subscription_id) {|Object| ... } ⇒ Object
Unsubscribes from signature status changes.
625 626 627 |
# File 'lib/solana-ruby/client.rb', line 625 def signature_unsubscribe(subscription_id, &block) request_ws('signatureUnsubscribe', [subscription_id], &block) end |
#simulate_transaction(transaction, options = {}, &block) ⇒ Hash
Simulates a transaction.
514 515 516 |
# File 'lib/solana-ruby/client.rb', line 514 def simulate_transaction(transaction, = {}, &block) request_http('simulateTransaction', [transaction.to_json, ], &block) end |
#slot_subscribe {|Object| ... } ⇒ Object
Subscribes to slot changes.
633 634 635 |
# File 'lib/solana-ruby/client.rb', line 633 def slot_subscribe(&block) request_ws('slotSubscribe', &block) end |
#slot_unsubscribe(subscription_id) {|Object| ... } ⇒ Object
Unsubscribes from slot changes.
642 643 644 |
# File 'lib/solana-ruby/client.rb', line 642 def slot_unsubscribe(subscription_id, &block) request_ws('slotUnsubscribe', [subscription_id], &block) end |
#slots_updates_subscribe {|Object| ... } ⇒ Object
Subscribes to slot updates.
650 651 652 |
# File 'lib/solana-ruby/client.rb', line 650 def slots_updates_subscribe(&block) request_ws('slotsUpdatesSubscribe', &block) end |
#slots_updates_unsubscribe(subscription_id) {|Object| ... } ⇒ Object
Unsubscribes from slot updates.
659 660 661 |
# File 'lib/solana-ruby/client.rb', line 659 def slots_updates_unsubscribe(subscription_id, &block) request_ws('slotsUpdatesUnsubscribe', [subscription_id], &block) end |
#vote_subscribe {|Object| ... } ⇒ Object
Subscribes to vote updates.
667 668 669 |
# File 'lib/solana-ruby/client.rb', line 667 def vote_subscribe(&block) request_ws('voteSubscribe', &block) end |
#vote_unsubscribe(subscription_id) {|Object| ... } ⇒ Object
Unsubscribes from vote updates.
676 677 678 |
# File 'lib/solana-ruby/client.rb', line 676 def vote_unsubscribe(subscription_id, &block) request_ws('voteUnsubscribe', [subscription_id], &block) end |