Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
ruby-version: ['3.1', '3.2']
ruby-version: ['3.2']

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.4
3.2.10
17 changes: 9 additions & 8 deletions .yardoc/checksums
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
README.md 0e2df2c668a20fd23ab54a352eb632bf274456c6
lib/generators/solana_rpc_ruby/install_generator.rb be08023f5bd5713af079d750318c01949285edc1
lib/generators/templates/solana_rpc_ruby_config.rb 614dfbb52b39499ebb8becce868dfe932ee37f6c
lib/solana_rpc_ruby.rb 66c68256a6f5d5af498845a7a332a1ba9a7e8a15
lib/solana_rpc_ruby/version.rb 3c52ea753d0503dd7d0e09754eb4a1fb6c1008eb
lib/solana_rpc_ruby/response.rb 1b96e3ac9c672907920e72b22ec817fde6e31feb
lib/solana_rpc_ruby/api_error.rb 7ef5dccd1b997cb03dc29e90791ecaf23161563e
lib/solana_rpc_ruby/api_client.rb 8a5da83a4fa99887e3c130c05b990d633a92f0dd
lib/solana_rpc_ruby/api_error.rb 7ef5dccd1b997cb03dc29e90791ecaf23161563e
lib/solana_rpc_ruby/helper_methods.rb 97fc86b808eb2c985171bce78aa21d3df5e8f715
lib/solana_rpc_ruby/methods_wrapper.rb d79a07678772e5dfb86982bf13bf324a1daa3d73
lib/solana_rpc_ruby/request_body.rb e77127adb2eb1a8e063d8b3b63dfd57e9be4d9f8
lib/solana_rpc_ruby/helper_methods.rb b7cc271c0e7bf646c204cc659c7cb1fa1695f93d
lib/solana_rpc_ruby/methods_wrapper.rb 90580dccd7637802dc84c37f1357b331b9ca4683
lib/solana_rpc_ruby/response.rb 1b96e3ac9c672907920e72b22ec817fde6e31feb
lib/solana_rpc_ruby/version.rb a0bfad180d7c0c689388b5b197b1cbfb38dfee85
lib/solana_rpc_ruby/websocket_client.rb f29146a845db1797d8c4bb0e4d065dbd84190f9d
lib/solana_rpc_ruby/websocket_methods_wrapper.rb 4d073503a5451c38b7d47fcc74f96048777cbf93
lib/generators/templates/solana_rpc_ruby_config.rb 614dfbb52b39499ebb8becce868dfe932ee37f6c
lib/generators/solana_rpc_ruby/install_generator.rb be08023f5bd5713af079d750318c01949285edc1
lib/solana_rpc_ruby/websocket_methods_wrapper.rb 19487674c8a23db31eb7a5ecfe3999a8886eb98b
Binary file modified .yardoc/object_types
Binary file not shown.
Binary file modified .yardoc/objects/root.dat
Binary file not shown.
103 changes: 58 additions & 45 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -66,51 +66,61 @@ GEM
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
addressable (2.8.9)
public_suffix (>= 2.0.2, < 8.0)
ast (2.4.3)
base64 (0.3.0)
bigdecimal (3.2.3)
bigdecimal (4.0.1)
builder (3.3.0)
codecov (0.6.0)
simplecov (>= 0.15, < 0.22)
coderay (1.1.3)
concurrent-ruby (1.3.5)
crack (1.0.0)
concurrent-ruby (1.3.6)
crack (1.0.1)
bigdecimal
rexml
crass (1.0.6)
date (3.4.1)
date (3.5.1)
diff-lcs (1.6.2)
docile (1.4.1)
dotenv (2.8.1)
drb (2.2.3)
erubi (1.13.1)
eventmachine (1.2.7)
faye-websocket (0.12.0)
eventmachine (>= 0.12.0)
websocket-driver (>= 0.8.0)
globalid (1.2.1)
globalid (1.3.0)
activesupport (>= 6.1)
hashdiff (1.2.1)
i18n (1.14.7)
i18n (1.14.8)
concurrent-ruby (~> 1.0)
json (2.13.2)
io-console (0.8.2)
json (2.19.1)
json-schema (6.2.0)
addressable (~> 2.8)
bigdecimal (>= 3.1, < 5)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
logger (1.7.0)
loofah (2.24.1)
loofah (2.25.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
mail (2.9.0)
logger
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
marcel (1.0.4)
marcel (1.1.0)
mcp (0.8.0)
json-schema (>= 4.1)
method_source (1.1.0)
mini_mime (1.1.5)
minitest (5.25.5)
net-imap (0.5.10)
minitest (6.0.2)
drb (~> 2.0)
prism (~> 1.5)
net-imap (0.6.3)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -119,22 +129,23 @@ GEM
timeout
net-smtp (0.5.1)
net-protocol
nio4r (2.7.4)
nokogiri (1.18.10-arm64-darwin)
nio4r (2.7.5)
nokogiri (1.19.1-arm64-darwin)
racc (~> 1.4)
nokogiri (1.18.10-x86_64-linux-gnu)
nokogiri (1.19.1-x86_64-linux-gnu)
racc (~> 1.4)
parallel (1.27.0)
parser (3.3.9.0)
parser (3.3.10.2)
ast (~> 2.4.1)
racc
prism (1.5.1)
pry (0.15.2)
prism (1.9.0)
pry (0.16.0)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (6.0.2)
reline (>= 0.6.0)
public_suffix (7.0.5)
racc (1.8.1)
rack (2.2.17)
rack (2.2.22)
rack-test (2.2.0)
rack (>= 1.3)
rails (6.1.7.10)
Expand All @@ -156,8 +167,8 @@ GEM
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
rails-html-sanitizer (1.7.0)
loofah (~> 2.25)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
railties (6.1.7.10)
actionpack (= 6.1.7.10)
Expand All @@ -166,19 +177,21 @@ GEM
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.1.1)
rake (13.3.0)
rake (13.3.1)
regexp_parser (2.11.3)
reline (0.6.3)
io-console (~> 0.5)
rexml (3.4.4)
rspec (3.13.1)
rspec (3.13.2)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.5)
rspec-core (3.13.6)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.5)
rspec-mocks (3.13.8)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-rails (4.1.2)
Expand All @@ -189,31 +202,32 @@ GEM
rspec-expectations (~> 3.10)
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.13.5)
rubocop (1.80.2)
rspec-support (3.13.7)
rubocop (1.85.1)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
mcp (~> 0.6)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.46.0, < 2.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.46.0)
rubocop-ast (1.49.0)
parser (>= 3.3.7.2)
prism (~> 1.4)
prism (~> 1.7)
rubocop-capybara (2.22.1)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-factory_bot (2.27.1)
rubocop-factory_bot (2.28.0)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-performance (1.26.0)
rubocop-performance (1.26.1)
lint_roller (~> 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.44.0, < 2.0)
rubocop-ast (>= 1.47.1, < 2.0)
rubocop-rspec (2.31.0)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
Expand All @@ -236,27 +250,26 @@ GEM
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
thor (1.4.0)
timeout (0.4.3)
thor (1.5.0)
timeout (0.6.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.1.0)
vcr (6.3.1)
base64
webmock (3.25.1)
unicode-emoji (4.2.0)
vcr (6.4.0)
webmock (3.26.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
websocket-driver (0.8.0)
base64
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.18)
zeitwerk (2.7.5)

PLATFORMS
arm64-darwin-24
arm64-darwin-25
x86_64-linux

DEPENDENCIES
Expand All @@ -277,4 +290,4 @@ DEPENDENCIES
webmock (~> 3.13)

BUNDLED WITH
2.3.26
2.4.19
33 changes: 30 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
![Stars](https://img.shields.io/github/stars/Block-Logic/solana-rpc-ruby.svg)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
# solana_rpc_ruby
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.
A Solana RPC Client for Ruby. This gem provides a wrapper methods for Solana RPC JSON API https://solana.com/docs/rpc.

## Getting started

### Requirements

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.
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.

Add the following line to your Gemfile:

Expand Down Expand Up @@ -198,9 +198,36 @@ Gem is coming with demo scripts that you can run and test API and Websockets.
3. Run `ruby demo.rb` or `ruby demo_ws_METHOD.rb` to see example output.
4. Check the gem or Solana JSON RPC API docs to get more information about method usage and modify demo scripts loosely.

### Method lists

#### HTTP methods (`SolanaRpcRuby::MethodsWrapper`)
Current methods:
`get_account_info`, `get_balance`, `get_block`, `get_block_height`, `get_block_production`, `get_block_commitment`,
`get_blocks`, `get_blocks_with_limit`, `get_block_time`, `get_cluster_nodes`, `get_epoch_info`, `get_epoch_schedule`,
`get_fee_for_message`, `get_first_available_block`, `get_genesis_hash`, `get_health`, `get_highest_snapshot_slot`,
`get_identity`, `get_inflation_governor`, `get_inflation_rate`, `get_inflation_reward`, `get_largest_accounts`,
`get_latest_blockhash`, `get_leader_schedule`, `get_max_retransmit_slot`, `get_max_shred_insert_slot`,
`get_minimum_balance_for_rent_exemption`, `get_multiple_accounts`, `get_program_accounts`,
`get_recent_performance_samples`, `get_recent_prioritization_fees`, `get_signatures_for_address`, `get_signature_statuses`, `get_slot`,
`get_slot_leader`, `get_slot_leaders`, `get_stake_activation`, `get_stake_minimum_delegation`, `get_supply`,
`get_token_account_balance`, `get_token_accounts_by_delegate`, `get_token_accounts_by_owner`,
`get_token_largest_accounts`, `get_token_supply`, `get_transaction`, `get_transaction_count`, `get_version`,
`get_vote_accounts`, `is_blockhash_valid`, `minimum_ledger_slot`, `request_airdrop`, `send_transaction`,
`simulate_transaction`.

Deprecated compatibility methods:
`get_confirmed_blocks`, `get_fee_calculator_for_blockhash`, `get_fee_rate_governor`, `get_fees`,
`get_recent_blockhash`, `get_snapshot_slot`.

#### Websocket methods (`SolanaRpcRuby::WebsocketsMethodsWrapper`)
`account_subscribe`, `account_unsubscribe`, `block_subscribe`, `block_unsubscribe`, `logs_subscribe`,
`logs_unsubscribe`, `program_subscribe`, `program_unsubscribe`, `signature_subscribe`, `signature_unsubscribe`,
`slot_subscribe`, `slot_unsubscribe`, `slots_updates_subscribe`, `slots_updates_unsubscribe`, `root_subscribe`,
`root_unsubscribe`, `vote_subscribe`, `vote_unsubscribe`.

All info about methods you can find in the docs on: https://www.rubydoc.info/github/Block-Logic/solana-rpc-ruby/main/SolanaRpcRuby

Also, as a reference you can use docs from solana: https://docs.solana.com/developing/clients/jsonrpc-api
Also, as a reference you can use docs from solana: https://solana.com/docs/rpc
## License

Copyright (c) [Block Logic Team]. License type is [MIT](https://github.com/Block-Logic/solana-rpc-ruby/blob/main/LICENSE).
10 changes: 5 additions & 5 deletions doc/SolanaRpcRuby.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>
Module: SolanaRpcRuby

&mdash; Documentation by YARD 0.9.28
&mdash; Documentation by YARD 0.9.37

</title>

Expand Down Expand Up @@ -79,7 +79,7 @@
<dl>
<dt>Defined in:</dt>
<dd>lib/solana_rpc_ruby.rb<span class="defines">,<br />
lib/solana_rpc_ruby/version.rb,<br /> lib/solana_rpc_ruby/response.rb,<br /> lib/solana_rpc_ruby/api_error.rb,<br /> lib/solana_rpc_ruby/api_client.rb,<br /> lib/solana_rpc_ruby/request_body.rb,<br /> lib/solana_rpc_ruby/helper_methods.rb,<br /> lib/solana_rpc_ruby/methods_wrapper.rb,<br /> lib/solana_rpc_ruby/websocket_client.rb,<br /> lib/solana_rpc_ruby/websocket_methods_wrapper.rb,<br /> lib/generators/solana_rpc_ruby/install_generator.rb</span>
lib/generators/solana_rpc_ruby/install_generator.rb,<br /> lib/solana_rpc_ruby/api_client.rb,<br /> lib/solana_rpc_ruby/api_error.rb,<br /> lib/solana_rpc_ruby/helper_methods.rb,<br /> lib/solana_rpc_ruby/methods_wrapper.rb,<br /> lib/solana_rpc_ruby/request_body.rb,<br /> lib/solana_rpc_ruby/response.rb,<br /> lib/solana_rpc_ruby/version.rb,<br /> lib/solana_rpc_ruby/websocket_client.rb,<br /> lib/solana_rpc_ruby/websocket_methods_wrapper.rb</span>
</dd>
</dl>

Expand Down Expand Up @@ -120,7 +120,7 @@ <h2>
<dt id="VERSION-constant" class="">VERSION =

</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>1.3.1</span><span class='tstring_end'>&#39;</span></span></pre></dd>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>2.0.0</span><span class='tstring_end'>&#39;</span></span></pre></dd>

</dl>

Expand Down Expand Up @@ -543,9 +543,9 @@ <h3 class="signature first" id="config-class_method">
</div>

<div id="footer">
Generated on Thu Mar 30 14:38:03 2023 by
Generated on Sun Mar 8 10:31:23 2026 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.28 (ruby-2.7.5).
0.9.37 (ruby-3.2.10).
</div>

</div>
Expand Down
6 changes: 3 additions & 3 deletions doc/SolanaRpcRuby/ApiClient.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>
Class: SolanaRpcRuby::ApiClient

&mdash; Documentation by YARD 0.9.28
&mdash; Documentation by YARD 0.9.37

</title>

Expand Down Expand Up @@ -628,9 +628,9 @@ <h3 class="signature first" id="call_api-instance_method">
</div>

<div id="footer">
Generated on Thu Mar 30 14:38:03 2023 by
Generated on Sun Mar 8 10:31:23 2026 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.28 (ruby-2.7.5).
0.9.37 (ruby-3.2.10).
</div>

</div>
Expand Down
6 changes: 3 additions & 3 deletions doc/SolanaRpcRuby/ApiError.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>
Exception: SolanaRpcRuby::ApiError

&mdash; Documentation by YARD 0.9.28
&mdash; Documentation by YARD 0.9.37

</title>

Expand Down Expand Up @@ -427,9 +427,9 @@ <h3 class="signature " id="message-instance_method">
</div>

<div id="footer">
Generated on Thu Mar 30 14:38:03 2023 by
Generated on Sun Mar 8 10:31:23 2026 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.28 (ruby-2.7.5).
0.9.37 (ruby-3.2.10).
</div>

</div>
Expand Down
Loading