Module: SolanaRuby::HttpMethods::BasicMethods
- Defined in:
- lib/solana_ruby/http_methods/basic_methods.rb
Overview
Basic Methods
Constant Summary collapse
- FINALIZED_OPTIONS =
{ commitment: "finalized" }.freeze
Instance Method Summary collapse
- #get_balance(pubkey) ⇒ Object
- #get_balance_and_context(pubkey) ⇒ Object
- #get_epoch_info(options = FINALIZED_OPTIONS) ⇒ Object
- #get_epoch_schedule ⇒ Object
- #get_genesis_hash ⇒ Object
- #get_health ⇒ Object
- #get_identity ⇒ Object
- #get_inflation_governor ⇒ Object
- #get_inflation_rate ⇒ Object
- #get_inflation_reward(addresses, options = {}) ⇒ Object
- #get_leader_schedule(options = { epoch: nil }) ⇒ Object
- #get_minimum_balance_for_rent_exemption(account_data_size, options = FINALIZED_OPTIONS) ⇒ Object
- #get_recent_performance_samples(limit = 10) ⇒ Object
- #get_recent_prioritization_fees(addresses) ⇒ Object
- #get_stake_activation(account_pubkey, options = FINALIZED_OPTIONS.merge(epoch: nil)) ⇒ Object
- #get_stake_minimum_delegation(options = FINALIZED_OPTIONS) ⇒ Object
- #get_supply(options = FINALIZED_OPTIONS) ⇒ Object
- #get_total_supply(options = FINALIZED_OPTIONS) ⇒ Object
- #get_version ⇒ Object
Instance Method Details
#get_balance(pubkey) ⇒ Object
9 10 11 12 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 9 def get_balance(pubkey) balance_info = request("getBalance", [pubkey]) balance_info["result"]["value"] end |
#get_balance_and_context(pubkey) ⇒ Object
14 15 16 17 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 14 def get_balance_and_context(pubkey) balance_info = request("getBalance", [pubkey]) balance_info["result"] end |
#get_epoch_info(options = FINALIZED_OPTIONS) ⇒ Object
19 20 21 22 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 19 def get_epoch_info( = FINALIZED_OPTIONS) epoch_info = request("getEpochInfo", []) epoch_info["result"] end |
#get_epoch_schedule ⇒ Object
24 25 26 27 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 24 def get_epoch_schedule epoch_schedule = request("getEpochSchedule") epoch_schedule["result"] end |
#get_genesis_hash ⇒ Object
29 30 31 32 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 29 def get_genesis_hash genesis_hash = request("getGenesisHash") genesis_hash["result"] end |
#get_health ⇒ Object
86 87 88 89 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 86 def get_health health_info = request("getHealth") health_info["result"] end |
#get_identity ⇒ Object
91 92 93 94 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 91 def get_identity health_info = request("getIdentity") health_info["result"] end |
#get_inflation_governor ⇒ Object
34 35 36 37 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 34 def get_inflation_governor inflation_governor = request("getInflationGovernor") inflation_governor["result"] end |
#get_inflation_rate ⇒ Object
39 40 41 42 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 39 def get_inflation_rate inflation_rate = request("getInflationRate") inflation_rate["result"] end |
#get_inflation_reward(addresses, options = {}) ⇒ Object
44 45 46 47 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 44 def get_inflation_reward(addresses, = {}) params = [addresses, ] request("getInflationReward", params) end |
#get_leader_schedule(options = { epoch: nil }) ⇒ Object
49 50 51 52 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 49 def get_leader_schedule( = { epoch: nil }) leader_schedule = request("getLeaderSchedule", []) leader_schedule["result"] end |
#get_minimum_balance_for_rent_exemption(account_data_size, options = FINALIZED_OPTIONS) ⇒ Object
54 55 56 57 58 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 54 def get_minimum_balance_for_rent_exemption(account_data_size, = FINALIZED_OPTIONS) params = [account_data_size, ] minimum_balance_for_rent_exemption = request("getMinimumBalanceForRentExemption", params) minimum_balance_for_rent_exemption["result"] end |
#get_recent_performance_samples(limit = 10) ⇒ Object
96 97 98 99 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 96 def get_recent_performance_samples(limit = 10) performance_samples = request("getRecentPerformanceSamples", [limit]) performance_samples["result"] end |
#get_recent_prioritization_fees(addresses) ⇒ Object
101 102 103 104 105 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 101 def get_recent_prioritization_fees(addresses) params = [addresses] prioritization_fees = request("getRecentPrioritizationFees", params) prioritization_fees["result"] end |
#get_stake_activation(account_pubkey, options = FINALIZED_OPTIONS.merge(epoch: nil)) ⇒ Object
60 61 62 63 64 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 60 def get_stake_activation(account_pubkey, = FINALIZED_OPTIONS.merge(epoch: nil)) params = [account_pubkey, ] stake_activation = request("getStakeActivation", params) stake_activation["result"] end |
#get_stake_minimum_delegation(options = FINALIZED_OPTIONS) ⇒ Object
66 67 68 69 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 66 def get_stake_minimum_delegation( = FINALIZED_OPTIONS) stake_minimum_delagation = request("getStakeMinimumDelegation", [FINALIZED_OPTIONS]) stake_minimum_delagation["result"] end |
#get_supply(options = FINALIZED_OPTIONS) ⇒ Object
71 72 73 74 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 71 def get_supply( = FINALIZED_OPTIONS) supply_info = request("getSupply", []) supply_info["result"] end |
#get_total_supply(options = FINALIZED_OPTIONS) ⇒ Object
81 82 83 84 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 81 def get_total_supply( = FINALIZED_OPTIONS) supply_info = get_supply() supply_info["value"]["total"] end |
#get_version ⇒ Object
76 77 78 79 |
# File 'lib/solana_ruby/http_methods/basic_methods.rb', line 76 def get_version version_info = request("getVersion") version_info["result"] end |