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.

Getting started


This gem requires Ruby 2.6+ and h Rails 6.0+. It MIGHT work with lower versions, but was not tested againt them. Add the following line to your Gemfile:

gem 'solana_rpc_ruby'

Then run bundle install

Next, you need to run the generator:

rails g solana_rpc_ruby:install

The latter command will generate a new config file config/initializers/solana_rpc_ruby_config.rb looking like this:

require 'solana_rpc_ruby'

SolanaRpcRuby.config do |c|
  c.cluster = 'https://api.testnet.solana.com'
  c.json_rpc_version = '2.0'
  # ...other options

You can customize it to your needs.

Usage examples

# If you set default cluster you don't need to pass it every time.
method_wrapper = SolanaRpcRuby::MethodsWrapper.new(cluster: 'https://api.testnet.solana.com')
response = method_wrapper.()
puts response

All info about methods you can find in the docs on: FILL THE ADDRESS!!! Also, as a reference you can use docs from solana: https://docs.solana.com/developing/clients/jsonrpc-api


Copyright (c) [Block Logic Team]. License type is MIT.