solana_rpc_ruby 1.3.1 → 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 +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +30 -3
- data/lib/solana_rpc_ruby/helper_methods.rb +1 -1
- data/lib/solana_rpc_ruby/methods_wrapper.rb +51 -7
- data/lib/solana_rpc_ruby/version.rb +1 -1
- data/lib/solana_rpc_ruby/websocket_methods_wrapper.rb +1 -1
- data/solana_rpc_ruby.gemspec +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d65120f531245fa7c70085c81dd661d459d6f0cca9c6a0b481a1295a220d0817
|
|
4
|
+
data.tar.gz: ad979be697ce6fd0cb64bb595a7d27c924a2d9f99305076742bbd288f88ecc2a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 409b498227399e3569ac41b674d1e845963e4c75fbbabe33bbfaf638b9debd5211c5c8d21c23824bd23c6a194c5851f4e91c0aa821670b9b9a412fa9312bab6d
|
|
7
|
+
data.tar.gz: 9759a799a2bdf643d35ae0c24bd911f531966417a3a52df5305b367dd8a763ac66acbcc900a844143ea588c2d87dee93c7bf3a853cc045090bceed23ddf0aef9
|
data/CHANGELOG.md
CHANGED
|
@@ -40,3 +40,19 @@
|
|
|
40
40
|
|
|
41
41
|
## 1.3.1
|
|
42
42
|
* Adds supports of maxSupportedTransactionVersion for get_block method
|
|
43
|
+
|
|
44
|
+
## 2.0.0
|
|
45
|
+
* Fix get_transaction when running without encoding parameter
|
|
46
|
+
* Add support for maxSupportedTransactionVersion for get_transaction
|
|
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
|

|
|
6
6
|
[](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://
|
|
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
|
|
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://
|
|
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).
|
|
@@ -11,7 +11,7 @@ module SolanaRpcRuby
|
|
|
11
11
|
raise ArgumentError, 'Object must be a String, Array or Hash or Integer or nil class.'
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
object.nil? || object.
|
|
14
|
+
object.nil? || (object.respond_to?(:empty?) && object.empty?)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
# Creates method name to match names required by Solana RPC JSON.
|
|
@@ -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 <<
|
|
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['
|
|
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?
|
|
@@ -1113,7 +1116,7 @@ module SolanaRpcRuby
|
|
|
1113
1116
|
# @param commitment [String]
|
|
1114
1117
|
#
|
|
1115
1118
|
# @return [Response, ApiError] Response when success, ApiError on failure.
|
|
1116
|
-
def get_transaction(transaction_signature, encoding: '', commitment: nil)
|
|
1119
|
+
def get_transaction(transaction_signature, encoding: '', commitment: nil, max_supported_transaction_version: nil)
|
|
1117
1120
|
http_method = :post
|
|
1118
1121
|
method = create_method_name(__method__)
|
|
1119
1122
|
|
|
@@ -1122,6 +1125,7 @@ module SolanaRpcRuby
|
|
|
1122
1125
|
|
|
1123
1126
|
params_hash['commitment'] = commitment unless blank?(commitment)
|
|
1124
1127
|
params_hash['encoding'] = encoding unless blank?(encoding)
|
|
1128
|
+
params_hash['maxSupportedTransactionVersion'] = max_supported_transaction_version unless blank?(max_supported_transaction_version)
|
|
1125
1129
|
|
|
1126
1130
|
params << transaction_signature
|
|
1127
1131
|
params << params_hash unless params_hash.empty?
|
|
@@ -1192,8 +1196,8 @@ module SolanaRpcRuby
|
|
|
1192
1196
|
|
|
1193
1197
|
params_hash['votePubkey'] = vote_pubkey unless blank?(vote_pubkey)
|
|
1194
1198
|
params_hash['commitment'] = commitment unless blank?(commitment)
|
|
1195
|
-
params_hash['
|
|
1196
|
-
params_hash['
|
|
1199
|
+
params_hash['keepUnstakedDelinquents'] = keep_unstaked_delinquents unless keep_unstaked_delinquents.nil?
|
|
1200
|
+
params_hash['delinquentSlotDistance'] = delinquent_slot_distance unless blank?(delinquent_slot_distance)
|
|
1197
1201
|
|
|
1198
1202
|
params << params_hash unless params_hash.empty?
|
|
1199
1203
|
|
|
@@ -1296,7 +1300,7 @@ module SolanaRpcRuby
|
|
|
1296
1300
|
params_hash['skipPreFlight'] = skip_pre_flight unless skip_pre_flight.nil?
|
|
1297
1301
|
params_hash['preflightCommitment'] = pre_flight_commitment unless blank?(pre_flight_commitment)
|
|
1298
1302
|
params_hash['encoding'] = encoding unless blank?(encoding)
|
|
1299
|
-
params_hash['
|
|
1303
|
+
params_hash['maxRetries'] = max_retries unless blank?(max_retries)
|
|
1300
1304
|
|
|
1301
1305
|
params << transaction_signature
|
|
1302
1306
|
params << params_hash unless params_hash.empty?
|
|
@@ -1356,6 +1360,46 @@ module SolanaRpcRuby
|
|
|
1356
1360
|
send_request(body, http_method)
|
|
1357
1361
|
end
|
|
1358
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
|
+
|
|
1359
1403
|
|
|
1360
1404
|
######## DEPRECATED METHODS #########
|
|
1361
1405
|
|
|
@@ -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
|
|
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]
|
data/solana_rpc_ruby.gemspec
CHANGED
|
@@ -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 = '>=
|
|
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: 1.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Block Logic Team
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-05-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faye-websocket
|
|
@@ -241,7 +241,7 @@ licenses:
|
|
|
241
241
|
metadata:
|
|
242
242
|
documentation_uri: https://www.rubydoc.info/github/Block-Logic/solana-rpc-ruby
|
|
243
243
|
source_code_uri: https://github.com/Block-Logic/solana-rpc-ruby
|
|
244
|
-
post_install_message:
|
|
244
|
+
post_install_message:
|
|
245
245
|
rdoc_options: []
|
|
246
246
|
require_paths:
|
|
247
247
|
- lib
|
|
@@ -249,15 +249,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
249
249
|
requirements:
|
|
250
250
|
- - ">="
|
|
251
251
|
- !ruby/object:Gem::Version
|
|
252
|
-
version:
|
|
252
|
+
version: 3.1.4
|
|
253
253
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
254
254
|
requirements:
|
|
255
255
|
- - ">="
|
|
256
256
|
- !ruby/object:Gem::Version
|
|
257
257
|
version: '0'
|
|
258
258
|
requirements: []
|
|
259
|
-
rubygems_version: 3.
|
|
260
|
-
signing_key:
|
|
259
|
+
rubygems_version: 3.3.26
|
|
260
|
+
signing_key:
|
|
261
261
|
specification_version: 4
|
|
262
262
|
summary: Ruby wrapper for solana JSON RPC API.
|
|
263
263
|
test_files: []
|