Class: SolanaRB::Client
- Inherits:
-
Object
- Object
- SolanaRB::Client
- Includes:
- HTTParty
- Defined in:
- lib/solana-ruby/client.rb
Instance Method Summary collapse
- #get_account_info(pubkey, options = {}) ⇒ Object
- #get_balance(pubkey, options = {}) ⇒ Object
- #get_block(slot_number, options = {}) ⇒ Object
- #get_block_commitment(slot_number, options = {}) ⇒ Object
- #get_block_height(options = {}) ⇒ Object
- #get_block_production(options = {}) ⇒ Object
- #get_block_time(slot_number, options = {}) ⇒ Object
- #get_blocks(start_slot, end_slot, options = {}) ⇒ Object
- #get_blocks_with_limit(start_slot, limit, options = {}) ⇒ Object
- #get_cluster_nodes(options = {}) ⇒ Object
- #get_epoch_info(options = {}) ⇒ Object
- #get_epoch_schedule(options = {}) ⇒ Object
- #get_fee_for_message(message, options = {}) ⇒ Object
- #get_first_available_block(options = {}) ⇒ Object
- #get_genesis_hash(options = {}) ⇒ Object
- #get_health(options = {}) ⇒ Object
- #get_highest_snapshot_slot(options = {}) ⇒ Object
- #get_identity(options = {}) ⇒ Object
- #get_inflation_governor(options = {}) ⇒ Object
- #get_inflation_rate(options = {}) ⇒ Object
- #get_inflation_reward(addresses, options = {}) ⇒ Object
- #get_largest_accounts(options = {}) ⇒ Object
- #get_latest_blockhash(options = {}) ⇒ Object
- #get_leader_schedule(options = {}) ⇒ Object
- #get_max_retransmit_slot(options = {}) ⇒ Object
- #get_max_shred_insert_slot(options = {}) ⇒ Object
- #get_minimum_balance_for_rent_exemption(data_length, options = {}) ⇒ Object
- #get_multiple_accounts(pubkeys, options = {}) ⇒ Object
- #get_program_accounts(pubkey, options = {}) ⇒ Object
- #get_recent_performance_samples(options = {}) ⇒ Object
- #get_recent_prioritization_fees(options = {}) ⇒ Object
- #get_signature_statuses(signatures, options = {}) ⇒ Object
- #get_signatures_for_address(address, options = {}) ⇒ Object
- #get_slot(options = {}) ⇒ Object
- #get_slot_leader(options = {}) ⇒ Object
- #get_slot_leaders(start_slot, limit, options = {}) ⇒ Object
- #get_stake_activation(pubkey, options = {}) ⇒ Object
- #get_stake_minimum_delegation(options = {}) ⇒ Object
- #get_supply(options = {}) ⇒ Object
- #get_token_account_balance(pubkey, options = {}) ⇒ Object
- #get_token_accounts_by_delegate(delegate, opts = {}, options = {}) ⇒ Object
- #get_token_accounts_by_owner(owner, opts = {}, options = {}) ⇒ Object
- #get_token_largest_accounts(pubkey, options = {}) ⇒ Object
- #get_token_supply(pubkey, options = {}) ⇒ Object
- #get_transaction(signature, options = {}) ⇒ Object
- #get_transaction_count(options = {}) ⇒ Object
- #get_version(options = {}) ⇒ Object
- #get_vote_accounts(options = {}) ⇒ Object
-
#initialize(api_key = nil) ⇒ Client
constructor
A new instance of Client.
- #is_blockhash_valid(blockhash, options = {}) ⇒ Object
- #minimum_ledger_slot(options = {}) ⇒ Object
- #request_airdrop(pubkey, lamports, options = {}) ⇒ Object
- #send_transaction(transaction, options = {}) ⇒ Object
- #simulate_transaction(transaction, options = {}) ⇒ Object
Constructor Details
#initialize(api_key = nil) ⇒ Client
Returns a new instance of Client.
9 10 11 |
# File 'lib/solana-ruby/client.rb', line 9 def initialize(api_key = nil) @api_key = api_key end |
Instance Method Details
#get_account_info(pubkey, options = {}) ⇒ Object
13 14 15 |
# File 'lib/solana-ruby/client.rb', line 13 def get_account_info(pubkey, = {}) request('getAccountInfo', [pubkey, ]) end |
#get_balance(pubkey, options = {}) ⇒ Object
17 18 19 |
# File 'lib/solana-ruby/client.rb', line 17 def get_balance(pubkey, = {}) request('getBalance', [pubkey, ]) end |
#get_block(slot_number, options = {}) ⇒ Object
21 22 23 |
# File 'lib/solana-ruby/client.rb', line 21 def get_block(slot_number, = {}) request('getBlock', [slot_number, ]) end |
#get_block_commitment(slot_number, options = {}) ⇒ Object
25 26 27 |
# File 'lib/solana-ruby/client.rb', line 25 def get_block_commitment(slot_number, = {}) request('getBlockCommitment', [slot_number, ]) end |
#get_block_height(options = {}) ⇒ Object
29 30 31 |
# File 'lib/solana-ruby/client.rb', line 29 def get_block_height( = {}) request('getBlockHeight', []) end |
#get_block_production(options = {}) ⇒ Object
33 34 35 |
# File 'lib/solana-ruby/client.rb', line 33 def get_block_production( = {}) request('getBlockProduction', []) end |
#get_block_time(slot_number, options = {}) ⇒ Object
37 38 39 |
# File 'lib/solana-ruby/client.rb', line 37 def get_block_time(slot_number, = {}) request('getBlockTime', [slot_number, ]) end |
#get_blocks(start_slot, end_slot, options = {}) ⇒ Object
41 42 43 |
# File 'lib/solana-ruby/client.rb', line 41 def get_blocks(start_slot, end_slot, = {}) request('getBlocks', [start_slot, end_slot, ]) end |
#get_blocks_with_limit(start_slot, limit, options = {}) ⇒ Object
45 46 47 |
# File 'lib/solana-ruby/client.rb', line 45 def get_blocks_with_limit(start_slot, limit, = {}) request('getBlocksWithLimit', [start_slot, limit, ]) end |
#get_cluster_nodes(options = {}) ⇒ Object
49 50 51 |
# File 'lib/solana-ruby/client.rb', line 49 def get_cluster_nodes( = {}) request('getClusterNodes', []) end |
#get_epoch_info(options = {}) ⇒ Object
53 54 55 |
# File 'lib/solana-ruby/client.rb', line 53 def get_epoch_info( = {}) request('getEpochInfo', []) end |
#get_epoch_schedule(options = {}) ⇒ Object
57 58 59 |
# File 'lib/solana-ruby/client.rb', line 57 def get_epoch_schedule( = {}) request('getEpochSchedule', []) end |
#get_fee_for_message(message, options = {}) ⇒ Object
61 62 63 |
# File 'lib/solana-ruby/client.rb', line 61 def (, = {}) request('getFeeForMessage', [, ]) end |
#get_first_available_block(options = {}) ⇒ Object
65 66 67 |
# File 'lib/solana-ruby/client.rb', line 65 def get_first_available_block( = {}) request('getFirstAvailableBlock', []) end |
#get_genesis_hash(options = {}) ⇒ Object
69 70 71 |
# File 'lib/solana-ruby/client.rb', line 69 def get_genesis_hash( = {}) request('getGenesisHash', []) end |
#get_health(options = {}) ⇒ Object
73 74 75 |
# File 'lib/solana-ruby/client.rb', line 73 def get_health( = {}) request('getHealth', []) end |
#get_highest_snapshot_slot(options = {}) ⇒ Object
77 78 79 |
# File 'lib/solana-ruby/client.rb', line 77 def get_highest_snapshot_slot( = {}) request('getHighestSnapshotSlot', []) end |
#get_identity(options = {}) ⇒ Object
81 82 83 |
# File 'lib/solana-ruby/client.rb', line 81 def get_identity( = {}) request('getIdentity', []) end |
#get_inflation_governor(options = {}) ⇒ Object
85 86 87 |
# File 'lib/solana-ruby/client.rb', line 85 def get_inflation_governor( = {}) request('getInflationGovernor', []) end |
#get_inflation_rate(options = {}) ⇒ Object
89 90 91 |
# File 'lib/solana-ruby/client.rb', line 89 def get_inflation_rate( = {}) request('getInflationRate', []) end |
#get_inflation_reward(addresses, options = {}) ⇒ Object
93 94 95 |
# File 'lib/solana-ruby/client.rb', line 93 def get_inflation_reward(addresses, = {}) request('getInflationReward', [addresses, ]) end |
#get_largest_accounts(options = {}) ⇒ Object
97 98 99 |
# File 'lib/solana-ruby/client.rb', line 97 def get_largest_accounts( = {}) request('getLargestAccounts', []) end |
#get_latest_blockhash(options = {}) ⇒ Object
101 102 103 |
# File 'lib/solana-ruby/client.rb', line 101 def get_latest_blockhash( = {}) request('getLatestBlockhash', []) end |
#get_leader_schedule(options = {}) ⇒ Object
105 106 107 |
# File 'lib/solana-ruby/client.rb', line 105 def get_leader_schedule( = {}) request('getLeaderSchedule', []) end |
#get_max_retransmit_slot(options = {}) ⇒ Object
109 110 111 |
# File 'lib/solana-ruby/client.rb', line 109 def get_max_retransmit_slot( = {}) request('getMaxRetransmitSlot', []) end |
#get_max_shred_insert_slot(options = {}) ⇒ Object
113 114 115 |
# File 'lib/solana-ruby/client.rb', line 113 def get_max_shred_insert_slot( = {}) request('getMaxShredInsertSlot', []) end |
#get_minimum_balance_for_rent_exemption(data_length, options = {}) ⇒ Object
117 118 119 |
# File 'lib/solana-ruby/client.rb', line 117 def get_minimum_balance_for_rent_exemption(data_length, = {}) request('getMinimumBalanceForRentExemption', [data_length, ]) end |
#get_multiple_accounts(pubkeys, options = {}) ⇒ Object
121 122 123 |
# File 'lib/solana-ruby/client.rb', line 121 def get_multiple_accounts(pubkeys, = {}) request('getMultipleAccounts', [pubkeys, ]) end |
#get_program_accounts(pubkey, options = {}) ⇒ Object
125 126 127 |
# File 'lib/solana-ruby/client.rb', line 125 def get_program_accounts(pubkey, = {}) request('getProgramAccounts', [pubkey, ]) end |
#get_recent_performance_samples(options = {}) ⇒ Object
129 130 131 |
# File 'lib/solana-ruby/client.rb', line 129 def get_recent_performance_samples( = {}) request('getRecentPerformanceSamples', []) end |
#get_recent_prioritization_fees(options = {}) ⇒ Object
133 134 135 |
# File 'lib/solana-ruby/client.rb', line 133 def get_recent_prioritization_fees( = {}) request('getRecentPrioritizationFees', []) end |
#get_signature_statuses(signatures, options = {}) ⇒ Object
137 138 139 |
# File 'lib/solana-ruby/client.rb', line 137 def get_signature_statuses(signatures, = {}) request('getSignatureStatuses', [signatures, ]) end |
#get_signatures_for_address(address, options = {}) ⇒ Object
141 142 143 |
# File 'lib/solana-ruby/client.rb', line 141 def get_signatures_for_address(address, = {}) request('getSignaturesForAddress', [address, ]) end |
#get_slot(options = {}) ⇒ Object
145 146 147 |
# File 'lib/solana-ruby/client.rb', line 145 def get_slot( = {}) request('getSlot', []) end |
#get_slot_leader(options = {}) ⇒ Object
149 150 151 |
# File 'lib/solana-ruby/client.rb', line 149 def get_slot_leader( = {}) request('getSlotLeader', []) end |
#get_slot_leaders(start_slot, limit, options = {}) ⇒ Object
153 154 155 |
# File 'lib/solana-ruby/client.rb', line 153 def get_slot_leaders(start_slot, limit, = {}) request('getSlotLeaders', [start_slot, limit, ]) end |
#get_stake_activation(pubkey, options = {}) ⇒ Object
157 158 159 |
# File 'lib/solana-ruby/client.rb', line 157 def get_stake_activation(pubkey, = {}) request('getStakeActivation', [pubkey, ]) end |
#get_stake_minimum_delegation(options = {}) ⇒ Object
161 162 163 |
# File 'lib/solana-ruby/client.rb', line 161 def get_stake_minimum_delegation( = {}) request('getStakeMinimumDelegation', []) end |
#get_supply(options = {}) ⇒ Object
165 166 167 |
# File 'lib/solana-ruby/client.rb', line 165 def get_supply( = {}) request('getSupply', []) end |
#get_token_account_balance(pubkey, options = {}) ⇒ Object
169 170 171 |
# File 'lib/solana-ruby/client.rb', line 169 def get_token_account_balance(pubkey, = {}) request('getTokenAccountBalance', [pubkey, ]) end |
#get_token_accounts_by_delegate(delegate, opts = {}, options = {}) ⇒ Object
173 174 175 |
# File 'lib/solana-ruby/client.rb', line 173 def get_token_accounts_by_delegate(delegate, opts = {}, = {}) request('getTokenAccountsByDelegate', [delegate, opts, ]) end |
#get_token_accounts_by_owner(owner, opts = {}, options = {}) ⇒ Object
177 178 179 |
# File 'lib/solana-ruby/client.rb', line 177 def get_token_accounts_by_owner(owner, opts = {}, = {}) request('getTokenAccountsByOwner', [owner, opts, ]) end |
#get_token_largest_accounts(pubkey, options = {}) ⇒ Object
181 182 183 |
# File 'lib/solana-ruby/client.rb', line 181 def get_token_largest_accounts(pubkey, = {}) request('getTokenLargestAccounts', [pubkey, ]) end |
#get_token_supply(pubkey, options = {}) ⇒ Object
185 186 187 |
# File 'lib/solana-ruby/client.rb', line 185 def get_token_supply(pubkey, = {}) request('getTokenSupply', [pubkey, ]) end |
#get_transaction(signature, options = {}) ⇒ Object
189 190 191 |
# File 'lib/solana-ruby/client.rb', line 189 def get_transaction(signature, = {}) request('getTransaction', [signature, ]) end |
#get_transaction_count(options = {}) ⇒ Object
193 194 195 |
# File 'lib/solana-ruby/client.rb', line 193 def get_transaction_count( = {}) request('getTransactionCount', []) end |
#get_version(options = {}) ⇒ Object
197 198 199 |
# File 'lib/solana-ruby/client.rb', line 197 def get_version( = {}) request('getVersion', []) end |
#get_vote_accounts(options = {}) ⇒ Object
201 202 203 |
# File 'lib/solana-ruby/client.rb', line 201 def get_vote_accounts( = {}) request('getVoteAccounts', []) end |
#is_blockhash_valid(blockhash, options = {}) ⇒ Object
205 206 207 |
# File 'lib/solana-ruby/client.rb', line 205 def is_blockhash_valid(blockhash, = {}) request('isBlockhashValid', [blockhash, ]) end |
#minimum_ledger_slot(options = {}) ⇒ Object
209 210 211 |
# File 'lib/solana-ruby/client.rb', line 209 def minimum_ledger_slot( = {}) request('minimumLedgerSlot', []) end |
#request_airdrop(pubkey, lamports, options = {}) ⇒ Object
213 214 215 |
# File 'lib/solana-ruby/client.rb', line 213 def request_airdrop(pubkey, lamports, = {}) request('requestAirdrop', [pubkey, lamports, ]) end |
#send_transaction(transaction, options = {}) ⇒ Object
217 218 219 |
# File 'lib/solana-ruby/client.rb', line 217 def send_transaction(transaction, = {}) request('sendTransaction', [transaction, ]) end |
#simulate_transaction(transaction, options = {}) ⇒ Object
221 222 223 |
# File 'lib/solana-ruby/client.rb', line 221 def simulate_transaction(transaction, = {}) request('simulateTransaction', [transaction, ]) end |