solana_rpc_ruby 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38dad501bea927a8b385091626086b55a163627aa45dd53db41fbe406386c8f2
4
- data.tar.gz: 0db454403d0df36e44d9b684c146bcdaebb1a51cf2760b604834c2bc513608a4
3
+ metadata.gz: d65120f531245fa7c70085c81dd661d459d6f0cca9c6a0b481a1295a220d0817
4
+ data.tar.gz: ad979be697ce6fd0cb64bb595a7d27c924a2d9f99305076742bbd288f88ecc2a
5
5
  SHA512:
6
- metadata.gz: 5d29c3963c62382852f7ab2261f70184a7807f1e2fb2e0230f30564c0163d1fccd30f27469ee77edaf5cb1ea40e50d6c8e42f73dbcfcfac811d003b47a61fc6b
7
- data.tar.gz: 1067d94229ca472a4a17798efe82891633fecbf2f8368f8f9d753053f77a7560a02deca30ae3cd4f9c686c6131fcc643519b9783dc12a6a66bda683c56f36f44
6
+ metadata.gz: 409b498227399e3569ac41b674d1e845963e4c75fbbabe33bbfaf638b9debd5211c5c8d21c23824bd23c6a194c5851f4e91c0aa821670b9b9a412fa9312bab6d
7
+ data.tar.gz: 9759a799a2bdf643d35ae0c24bd911f531966417a3a52df5305b367dd8a763ac66acbcc900a844143ea588c2d87dee93c7bf3a853cc045090bceed23ddf0aef9
data/CHANGELOG.md CHANGED
@@ -44,4 +44,15 @@
44
44
  ## 2.0.0
45
45
  * Fix get_transaction when running without encoding parameter
46
46
  * Add support for maxSupportedTransactionVersion for get_transaction
47
- * Update ruby to 3.1.4 and bundler to 2.3.26
47
+ * Update ruby to 3.1.4 and bundler to 2.3.26
48
+
49
+ ## 2.1.0
50
+ * Add get_recent_prioritization_fees method
51
+ * Add get_stake_minimum_delegation method
52
+ * Fix get_leader_schedule to send epoch as positional parameter
53
+ * Fix get_supply to use excludeNonCirculatingAccountsList key
54
+ * Fix get_vote_accounts to use keepUnstakedDelinquents and delinquentSlotDistance keys
55
+ * Fix send_transaction to use maxRetries key
56
+ * Add request payload compatibility specs
57
+ * Update documentation with method inventories
58
+ * Maintain Ruby 3.1.4+ compatibility (CI tests both 3.1 and 3.2)
data/README.md CHANGED
@@ -5,13 +5,13 @@
5
5
  ![Stars](https://img.shields.io/github/stars/Block-Logic/solana-rpc-ruby.svg)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
  # solana_rpc_ruby
8
- A Solana RPC Client for Ruby. This gem provides a wrapper methods for Solana RPC JSON API https://docs.solana.com/developing/clients/jsonrpc-api.
8
+ A Solana RPC Client for Ruby. This gem provides a wrapper methods for Solana RPC JSON API https://solana.com/docs/rpc.
9
9
 
10
10
  ## Getting started
11
11
 
12
12
  ### Requirements
13
13
 
14
- This gem requires Ruby 2.7+ (as denoted in the `.ruby-version` file) and it has Rails 6.0+ on board. It MIGHT work with lower versions, but was not tested with them.
14
+ This gem requires Ruby 3.2+ (as denoted in the `.ruby-version` file) and it has Rails 6.0+ on board. It MIGHT work with lower versions, but was not tested with them.
15
15
 
16
16
  Add the following line to your Gemfile:
17
17
 
@@ -198,9 +198,36 @@ Gem is coming with demo scripts that you can run and test API and Websockets.
198
198
  3. Run `ruby demo.rb` or `ruby demo_ws_METHOD.rb` to see example output.
199
199
  4. Check the gem or Solana JSON RPC API docs to get more information about method usage and modify demo scripts loosely.
200
200
 
201
+ ### Method lists
202
+
203
+ #### HTTP methods (`SolanaRpcRuby::MethodsWrapper`)
204
+ Current methods:
205
+ `get_account_info`, `get_balance`, `get_block`, `get_block_height`, `get_block_production`, `get_block_commitment`,
206
+ `get_blocks`, `get_blocks_with_limit`, `get_block_time`, `get_cluster_nodes`, `get_epoch_info`, `get_epoch_schedule`,
207
+ `get_fee_for_message`, `get_first_available_block`, `get_genesis_hash`, `get_health`, `get_highest_snapshot_slot`,
208
+ `get_identity`, `get_inflation_governor`, `get_inflation_rate`, `get_inflation_reward`, `get_largest_accounts`,
209
+ `get_latest_blockhash`, `get_leader_schedule`, `get_max_retransmit_slot`, `get_max_shred_insert_slot`,
210
+ `get_minimum_balance_for_rent_exemption`, `get_multiple_accounts`, `get_program_accounts`,
211
+ `get_recent_performance_samples`, `get_recent_prioritization_fees`, `get_signatures_for_address`, `get_signature_statuses`, `get_slot`,
212
+ `get_slot_leader`, `get_slot_leaders`, `get_stake_activation`, `get_stake_minimum_delegation`, `get_supply`,
213
+ `get_token_account_balance`, `get_token_accounts_by_delegate`, `get_token_accounts_by_owner`,
214
+ `get_token_largest_accounts`, `get_token_supply`, `get_transaction`, `get_transaction_count`, `get_version`,
215
+ `get_vote_accounts`, `is_blockhash_valid`, `minimum_ledger_slot`, `request_airdrop`, `send_transaction`,
216
+ `simulate_transaction`.
217
+
218
+ Deprecated compatibility methods:
219
+ `get_confirmed_blocks`, `get_fee_calculator_for_blockhash`, `get_fee_rate_governor`, `get_fees`,
220
+ `get_recent_blockhash`, `get_snapshot_slot`.
221
+
222
+ #### Websocket methods (`SolanaRpcRuby::WebsocketsMethodsWrapper`)
223
+ `account_subscribe`, `account_unsubscribe`, `block_subscribe`, `block_unsubscribe`, `logs_subscribe`,
224
+ `logs_unsubscribe`, `program_subscribe`, `program_unsubscribe`, `signature_subscribe`, `signature_unsubscribe`,
225
+ `slot_subscribe`, `slot_unsubscribe`, `slots_updates_subscribe`, `slots_updates_unsubscribe`, `root_subscribe`,
226
+ `root_unsubscribe`, `vote_subscribe`, `vote_unsubscribe`.
227
+
201
228
  All info about methods you can find in the docs on: https://www.rubydoc.info/github/Block-Logic/solana-rpc-ruby/main/SolanaRpcRuby
202
229
 
203
- Also, as a reference you can use docs from solana: https://docs.solana.com/developing/clients/jsonrpc-api
230
+ Also, as a reference you can use docs from solana: https://solana.com/docs/rpc
204
231
  ## License
205
232
 
206
233
  Copyright (c) [Block Logic Team]. License type is [MIT](https://github.com/Block-Logic/solana-rpc-ruby/blob/main/LICENSE).
@@ -561,11 +561,14 @@ module SolanaRpcRuby
561
561
  params = []
562
562
  params_hash = {}
563
563
 
564
- params_hash['epoch'] = epoch unless epoch.nil?
565
564
  params_hash['identity'] = identity unless identity.empty?
566
565
  params_hash['commitment'] = commitment unless blank?(commitment)
567
566
 
568
- params << params_hash unless params_hash.empty?
567
+ params << epoch unless epoch.nil?
568
+ unless params_hash.empty?
569
+ params << nil if epoch.nil?
570
+ params << params_hash
571
+ end
569
572
 
570
573
  body = create_json_body(method, method_params: params)
571
574
 
@@ -910,7 +913,7 @@ module SolanaRpcRuby
910
913
  params_hash = {}
911
914
 
912
915
  params_hash['commitment'] = commitment unless blank?(commitment)
913
- params_hash['exclude_non_circulating_accounts_list'] = exclude_non_circulating_accounts_list \
916
+ params_hash['excludeNonCirculatingAccountsList'] = exclude_non_circulating_accounts_list \
914
917
  unless exclude_non_circulating_accounts_list.nil?
915
918
 
916
919
  params << params_hash unless params_hash.empty?
@@ -1193,8 +1196,8 @@ module SolanaRpcRuby
1193
1196
 
1194
1197
  params_hash['votePubkey'] = vote_pubkey unless blank?(vote_pubkey)
1195
1198
  params_hash['commitment'] = commitment unless blank?(commitment)
1196
- params_hash['keep_unstaked_delinquents'] = keep_unstaked_delinquents unless keep_unstaked_delinquents.nil?
1197
- params_hash['delinquent_slot_distance'] = delinquent_slot_distance unless blank?(delinquent_slot_distance)
1199
+ params_hash['keepUnstakedDelinquents'] = keep_unstaked_delinquents unless keep_unstaked_delinquents.nil?
1200
+ params_hash['delinquentSlotDistance'] = delinquent_slot_distance unless blank?(delinquent_slot_distance)
1198
1201
 
1199
1202
  params << params_hash unless params_hash.empty?
1200
1203
 
@@ -1297,7 +1300,7 @@ module SolanaRpcRuby
1297
1300
  params_hash['skipPreFlight'] = skip_pre_flight unless skip_pre_flight.nil?
1298
1301
  params_hash['preflightCommitment'] = pre_flight_commitment unless blank?(pre_flight_commitment)
1299
1302
  params_hash['encoding'] = encoding unless blank?(encoding)
1300
- params_hash['max_retries'] = max_retries unless blank?(max_retries)
1303
+ params_hash['maxRetries'] = max_retries unless blank?(max_retries)
1301
1304
 
1302
1305
  params << transaction_signature
1303
1306
  params << params_hash unless params_hash.empty?
@@ -1357,6 +1360,46 @@ module SolanaRpcRuby
1357
1360
  send_request(body, http_method)
1358
1361
  end
1359
1362
 
1363
+ # @see https://solana.com/docs/rpc/http/getrecentprioritizationfees
1364
+ #
1365
+ # Returns a list of prioritization fees from recent blocks.
1366
+ #
1367
+ # @param addresses [Array<String>] up to 128 account addresses
1368
+ #
1369
+ # @return [Response, ApiError] Response when success, ApiError on failure.
1370
+ def get_recent_prioritization_fees(addresses = [])
1371
+ http_method = :post
1372
+ method = create_method_name(__method__)
1373
+
1374
+ params = []
1375
+ params << addresses unless addresses.empty?
1376
+
1377
+ body = create_json_body(method, method_params: params)
1378
+
1379
+ send_request(body, http_method)
1380
+ end
1381
+
1382
+ # @see https://solana.com/docs/rpc/http/getstakeminimumdelegation
1383
+ #
1384
+ # Returns the stake minimum delegation, in lamports.
1385
+ #
1386
+ # @param commitment [String]
1387
+ #
1388
+ # @return [Response, ApiError] Response when success, ApiError on failure.
1389
+ def get_stake_minimum_delegation(commitment: nil)
1390
+ http_method = :post
1391
+ method = create_method_name(__method__)
1392
+
1393
+ params = []
1394
+ params_hash = {}
1395
+ params_hash['commitment'] = commitment unless blank?(commitment)
1396
+ params << params_hash unless params_hash.empty?
1397
+
1398
+ body = create_json_body(method, method_params: params)
1399
+
1400
+ send_request(body, http_method)
1401
+ end
1402
+
1360
1403
 
1361
1404
  ######## DEPRECATED METHODS #########
1362
1405
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolanaRpcRuby
4
- VERSION = '2.0.0'
4
+ VERSION = '2.1.0'
5
5
  end
@@ -76,7 +76,7 @@ module SolanaRpcRuby
76
76
  #
77
77
  # Subscribe to receive notification anytime a new block is Confirmed or Finalized.
78
78
  #
79
- # @param filter [String] # 'all' or public key as base-58 endcoded string
79
+ # @param filter [String] # 'all' or public key as base-58 encoded string
80
80
  # @param commitment [String]
81
81
  # @param encoding [String]
82
82
  # @param transaction_details [String]
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.homepage = 'https://github.com/Block-Logic/solana-rpc-ruby'
13
13
  spec.license = 'MIT'
14
14
  spec.platform = Gem::Platform::RUBY
15
- spec.required_ruby_version = '>= 2.7.5'
15
+ spec.required_ruby_version = '>= 3.1.4'
16
16
  spec.files = Dir[
17
17
  'README.md', 'LICENSE', 'CHANGELOG.md',
18
18
  'lib/**/*.rb',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solana_rpc_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Block Logic Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-09-18 00:00:00.000000000 Z
11
+ date: 2026-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faye-websocket
@@ -249,7 +249,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
249
249
  requirements:
250
250
  - - ">="
251
251
  - !ruby/object:Gem::Version
252
- version: 2.7.5
252
+ version: 3.1.4
253
253
  required_rubygems_version: !ruby/object:Gem::Requirement
254
254
  requirements:
255
255
  - - ">="