├── .env.sample ├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── specs.yml ├── .gitignore ├── .rspec ├── .rubocop.yml ├── .ruby-gemset ├── .ruby-version ├── .yardoc ├── checksums ├── complete ├── object_types ├── objects │ └── root.dat └── proxy_types ├── CHANGELOG.md ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── Rakefile ├── demo.rb ├── demo_ws_account.rb ├── demo_ws_program.rb ├── demo_ws_root.rb ├── demo_ws_slot.rb ├── doc ├── SolanaRpcRuby.html ├── SolanaRpcRuby │ ├── ApiClient.html │ ├── ApiError.html │ ├── Generators.html │ ├── Generators │ │ └── InstallGenerator.html │ ├── HelperMethods.html │ ├── MethodsWrapper.html │ ├── RequestBody.html │ ├── Response.html │ ├── WebsocketClient.html │ └── WebsocketsMethodsWrapper.html ├── _index.html ├── class_list.html ├── css │ ├── common.css │ ├── full_list.css │ └── style.css ├── file.README.html ├── file_list.html ├── frames.html ├── index.html ├── js │ ├── app.js │ ├── full_list.js │ └── jquery.js ├── method_list.html └── top-level-namespace.html ├── lib ├── generators │ ├── solana_rpc_ruby │ │ └── install_generator.rb │ └── templates │ │ └── solana_rpc_ruby_config.rb ├── solana_rpc_ruby.rb └── solana_rpc_ruby │ ├── api_client.rb │ ├── api_error.rb │ ├── helper_methods.rb │ ├── methods_wrapper.rb │ ├── request_body.rb │ ├── response.rb │ ├── version.rb │ ├── websocket_client.rb │ └── websocket_methods_wrapper.rb ├── solana_rpc_ruby.gemspec └── spec ├── dummy ├── .ruby-version ├── README.md ├── Rakefile ├── app │ ├── assets │ │ ├── config │ │ │ └── manifest.js │ │ ├── images │ │ │ └── .keep │ │ └── stylesheets │ │ │ └── application.css │ ├── controllers │ │ ├── application_controller.rb │ │ └── concerns │ │ │ └── .keep │ ├── helpers │ │ └── application_helper.rb │ ├── models │ │ └── concerns │ │ │ └── .keep │ └── views │ │ └── layouts │ │ └── application.html.erb ├── bin │ ├── bundle │ ├── rails │ ├── rake │ └── setup ├── config.ru ├── config │ ├── application.rb │ ├── boot.rb │ ├── credentials.yml.enc │ ├── environment.rb │ ├── environments │ │ ├── development.rb │ │ ├── production.rb │ │ └── test.rb │ ├── initializers │ │ ├── application_controller_renderer.rb │ │ ├── assets.rb │ │ ├── backtrace_silencers.rb │ │ ├── content_security_policy.rb │ │ ├── cookies_serializer.rb │ │ ├── filter_parameter_logging.rb │ │ ├── inflections.rb │ │ ├── mime_types.rb │ │ ├── permissions_policy.rb │ │ └── wrap_parameters.rb │ ├── locales │ │ └── en.yml │ ├── master.key │ ├── puma.rb │ └── routes.rb ├── lib │ ├── assets │ │ └── .keep │ └── tasks │ │ └── .keep ├── log │ └── .keep ├── public │ ├── 404.html │ ├── 422.html │ ├── 500.html │ ├── apple-touch-icon-precomposed.png │ ├── apple-touch-icon.png │ ├── favicon.ico │ └── robots.txt └── vendor │ └── .keep ├── fixtures └── vcr_cassettes │ ├── expected_responses │ └── methods_wrapper_spec_responses.json │ ├── get_account_info.yml │ ├── get_account_info_with_id_passed_to_initializer.yml │ ├── get_account_info_with_json_encoding.yml │ ├── get_account_info_with_params.yml │ ├── get_balance.yml │ ├── get_block.yml │ ├── get_block_commitment_with_required_params.yml │ ├── get_block_height.yml │ ├── get_block_height_with_optional_params.yml │ ├── get_block_production.yml │ ├── get_block_production_with_optional_params.yml │ ├── get_block_time_with_required_params.yml │ ├── get_block_with_optional_params.yml │ ├── get_blocks.yml │ ├── get_blocks_with_limit_with_required_params.yml │ ├── get_cluster_nodes.yml │ ├── get_confirmed_blocks.yml │ ├── get_epoch_info.yml │ ├── get_epoch_info_with_commitment.yml │ ├── get_epoch_schedule.yml │ ├── get_epoch_schedule_with_required_params.yml │ ├── get_fee_calculator_for_blockhash.yml │ ├── get_fee_for_message.yml │ ├── get_fee_rate_governor.yml │ ├── get_fees.yml │ ├── get_first_available_block.yml │ ├── get_genesis_hash.yml │ ├── get_health.yml │ ├── get_highest_snapshot_slot.yml │ ├── get_identity.yml │ ├── get_inflation_governor.yml │ ├── get_inflation_rate.yml │ ├── get_inflation_reward.yml │ ├── get_inflation_reward_with_optional_params.yml │ ├── get_largest_accounts.yml │ ├── get_largest_accounts_with_optional_params.yml │ ├── get_latest_blockhash.yml │ ├── get_leader_schedule.yml │ ├── get_leader_schedule_with_optional_params.yml │ ├── get_max_retransmit_slot.yml │ ├── get_max_shred_insert_slot.yml │ ├── get_minimum_balance_for_rent_exemption.yml │ ├── get_multiple_accounts.yml │ ├── get_multiple_accounts_with_optional_params.yml │ ├── get_program_accounts.yml │ ├── get_program_accounts_config_program.yml │ ├── get_program_accounts_vote_program.yml │ ├── get_program_accounts_with_optional_params.yml │ ├── get_recent_blockhash.yml │ ├── get_recent_performance_samples.yml │ ├── get_recent_performance_samples_with_optional_params.yml │ ├── get_signature_statuses.yml │ ├── get_signature_statuses_with_optional_params.yml │ ├── get_signatures_for_address.yml │ ├── get_signatures_for_address_with_optional_params.yml │ ├── get_slot.yml │ ├── get_slot_leader.yml │ ├── get_slot_leaders.yml │ ├── get_snapshot_slot.yml │ ├── get_stake_activation.yml │ ├── get_supply.yml │ ├── get_token_account_balance.yml │ ├── get_token_accounts_by_delegate.yml │ ├── get_token_accounts_by_delegate_with_optional_params.yml │ ├── get_token_accounts_by_owner.yml │ ├── get_token_accounts_by_owner_with_optional_params.yml │ ├── get_token_largest_accounts.yml │ ├── get_token_supply.yml │ ├── get_transaction.yml │ ├── get_transaction_count.yml │ ├── get_transaction_with_optional_params.yml │ ├── get_version.yml │ ├── get_vote_accounts.yml │ ├── get_vote_accounts_with_votePubkey_param.yml │ ├── is_blockhash_valid.yml │ ├── minimum_ledger_slot.yml │ ├── request_airdrop.yml │ ├── send_transaction.yml │ └── simulate_transaction.yml ├── lib ├── generators │ └── solana_rpc_ruby │ │ └── install_generator_spec.rb ├── solana_rpc_ruby │ ├── api_client_spec.rb │ ├── api_error_spec.rb │ ├── helper_methods_spec.rb │ ├── methods_wrapper_spec.rb │ ├── request_body_spec.rb │ ├── websocket_client_spec.rb │ └── websocket_methods_wrapper_spec.rb └── solana_rpc_ruby_spec.rb ├── spec_helper.rb └── support ├── file_manager.rb └── vcr.rb /.env.sample: -------------------------------------------------------------------------------- 1 | JSON_RPC_VERSION='2.0' 2 | 3 | MAINNET_URL='https://api.mainnet-beta.solana.com' 4 | TESTNET_URL='https://api.testnet.solana.com' 5 | DEVNET_URL='https://api.devnet.solana.com' 6 | -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributor Covenant Code of Conduct 3 | 4 | ## Our Pledge 5 | 6 | In the interest of fostering an open and welcoming environment, we as 7 | contributors and maintainers pledge to make participation in our project and 8 | our community a harassment-free experience for everyone, regardless of age, body 9 | size, disability, ethnicity, sex characteristics, gender identity and expression, 10 | level of experience, education, socio-economic status, nationality, personal 11 | appearance, race, religion, or sexual identity and orientation. 12 | 13 | ## Our Standards 14 | 15 | Examples of behavior that contributes to creating a positive environment 16 | include: 17 | 18 | * Using welcoming and inclusive language 19 | * Being respectful of differing viewpoints and experiences 20 | * Gracefully accepting constructive criticism 21 | * Focusing on what is best for the community 22 | * Showing empathy towards other community members 23 | 24 | Examples of unacceptable behavior by participants include: 25 | 26 | * The use of sexualized language or imagery and unwelcome sexual attention or 27 | advances 28 | * Trolling, insulting/derogatory comments, and personal or political attacks 29 | * Public or private harassment 30 | * Publishing others' private information, such as a physical or electronic 31 | address, without explicit permission 32 | * Other conduct which could reasonably be considered inappropriate in a 33 | professional setting 34 | 35 | ## Our Responsibilities 36 | 37 | Project maintainers are responsible for clarifying the standards of acceptable 38 | behavior and are expected to take appropriate and fair corrective action in 39 | response to any instances of unacceptable behavior. 40 | 41 | Project maintainers have the right and responsibility to remove, edit, or 42 | reject comments, commits, code, wiki edits, issues, and other contributions 43 | that are not aligned to this Code of Conduct, or to ban temporarily or 44 | permanently any contributor for other behaviors that they deem inappropriate, 45 | threatening, offensive, or harmful. 46 | 47 | ## Scope 48 | 49 | This Code of Conduct applies within all project spaces, and it also applies when 50 | an individual is representing the project or its community in public spaces. 51 | Examples of representing a project or community include using an official 52 | project e-mail address, posting via an official social media account, or acting 53 | as an appointed representative at an online or offline event. Representation of 54 | a project may be further defined and clarified by project maintainers. 55 | 56 | ## Enforcement 57 | 58 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 59 | reported by contacting the project team at [INSERT EMAIL ADDRESS]. All 60 | complaints will be reviewed and investigated and will result in a response that 61 | is deemed necessary and appropriate to the circumstances. The project team is 62 | obligated to maintain confidentiality with regard to the reporter of an incident. 63 | Further details of specific enforcement policies may be posted separately. 64 | 65 | Project maintainers who do not follow or enforce the Code of Conduct in good 66 | faith may face temporary or permanent repercussions as determined by other 67 | members of the project's leadership. 68 | 69 | ## Attribution 70 | 71 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 72 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 73 | 74 | [homepage]: https://www.contributor-covenant.org 75 | 76 | For answers to common questions about this code of conduct, see 77 | https://www.contributor-covenant.org/faq 78 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | 1. [Fork the repository.][fork] 4 | 2. [Create a topic branch.][branch] 5 | 3. Implement your feature or bug fix. 6 | 4. Don't forget to add specs and make sure they pass by running `rspec .`. 7 | 5. Make sure your code complies with the style guide by running `rubocop`. `rubocop -a` can automatically fix most issues for you. 8 | 6. If necessary, add documentation for your feature or bug fix. 9 | 7. Commit and push your changes. 10 | 8. [Submit a pull request.][pr] 11 | 12 | [fork]: http://help.github.com/fork-a-repo/ 13 | [branch]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-branches 14 | [pr]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior. 15 | 16 | **Expected behavior** 17 | A clear and concise description of what you expected to happen. 18 | 19 | **Your environment:** 20 | - OS 21 | - Ruby version 22 | 23 | **Additional context** 24 | Add any other context about the problem here. -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: 7 | 8 | --- 9 | 10 | **The feature I'd like is...** 11 | 12 | **Additional context** 13 | Add any other context or screenshots about the feature request here. -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Summary 2 | 3 | Provide a general description of the code changes in your pull 4 | request. Were there any bugs you had fixed? If so, mention them. If 5 | these bugs have open GitHub issues, be sure to tag them here as well, 6 | to keep the conversation linked together. 7 | 8 | ### Other Information 9 | 10 | If there's anything else that's important and relevant to your pull 11 | request, mention that information here. -------------------------------------------------------------------------------- /.github/workflows/specs.yml: -------------------------------------------------------------------------------- 1 | name: Ruby CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | test: 7 | 8 | runs-on: ubuntu-20.04 9 | 10 | strategy: 11 | matrix: 12 | ruby-version: ['3.0', '2.7'] 13 | 14 | steps: 15 | - uses: actions/checkout@v4 16 | - name: Set up Ruby ${{ matrix.ruby-version }} 17 | uses: ruby/setup-ruby@v1 18 | with: 19 | ruby-version: ${{ matrix.ruby-version }} 20 | bundler-cache: true 21 | - name: Install dependencies 22 | run: bundle install 23 | - name: Run tests 24 | run: bundle exec rspec 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | coverage/* 3 | *~ 4 | .bundle 5 | .rvmrc 6 | .byebug_history 7 | log/* 8 | measurement/* 9 | pkg/* 10 | .DS_Store 11 | .env 12 | spec/dummy/tmp/* 13 | spec/dummy/log/*.log 14 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --require spec_helper 3 | --order rand 4 | --format doc 5 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | require: 2 | - rubocop-performance 3 | - rubocop-rspec 4 | AllCops: 5 | TargetRubyVersion: 2.7 6 | NewCops: enable 7 | -------------------------------------------------------------------------------- /.ruby-gemset: -------------------------------------------------------------------------------- 1 | solana-rpc-ruby 2 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 2.7.5 2 | -------------------------------------------------------------------------------- /.yardoc/checksums: -------------------------------------------------------------------------------- 1 | lib/solana_rpc_ruby.rb 66c68256a6f5d5af498845a7a332a1ba9a7e8a15 2 | lib/solana_rpc_ruby/version.rb 3c52ea753d0503dd7d0e09754eb4a1fb6c1008eb 3 | lib/solana_rpc_ruby/response.rb 1b96e3ac9c672907920e72b22ec817fde6e31feb 4 | lib/solana_rpc_ruby/api_error.rb 7ef5dccd1b997cb03dc29e90791ecaf23161563e 5 | lib/solana_rpc_ruby/api_client.rb 8a5da83a4fa99887e3c130c05b990d633a92f0dd 6 | lib/solana_rpc_ruby/request_body.rb e77127adb2eb1a8e063d8b3b63dfd57e9be4d9f8 7 | lib/solana_rpc_ruby/helper_methods.rb b7cc271c0e7bf646c204cc659c7cb1fa1695f93d 8 | lib/solana_rpc_ruby/methods_wrapper.rb 90580dccd7637802dc84c37f1357b331b9ca4683 9 | lib/solana_rpc_ruby/websocket_client.rb f29146a845db1797d8c4bb0e4d065dbd84190f9d 10 | lib/solana_rpc_ruby/websocket_methods_wrapper.rb 4d073503a5451c38b7d47fcc74f96048777cbf93 11 | lib/generators/templates/solana_rpc_ruby_config.rb 614dfbb52b39499ebb8becce868dfe932ee37f6c 12 | lib/generators/solana_rpc_ruby/install_generator.rb be08023f5bd5713af079d750318c01949285edc1 13 | -------------------------------------------------------------------------------- /.yardoc/complete: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Block-Logic/solana-rpc-ruby/c498ba26783ed917190280693a6bea56c87fc0f9/.yardoc/complete -------------------------------------------------------------------------------- /.yardoc/objects/root.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Block-Logic/solana-rpc-ruby/c498ba26783ed917190280693a6bea56c87fc0f9/.yardoc/objects/root.dat -------------------------------------------------------------------------------- /.yardoc/proxy_types: -------------------------------------------------------------------------------- 1 | { -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | ## 1.0.0 3 | * Initial release 4 | 5 | ## 1.0.1 6 | * Add optional id argument that can be passed to MethodsWrapper class. 7 | 8 | ## 1.1.0 9 | * Add websockets connection to gem. 10 | 11 | ## 1.1.1 12 | * Fix SolanaRpcRuby::ApiError occurring when websocket program runs for too long 13 | (# e 38 | puts e.inspect 39 | end # begin 40 | 41 | # Example of block that can be passed to the method to manipualte the data. 42 | # block = Proc.new do |message| 43 | # json = JSON.parse(message) 44 | # puts json['params'] 45 | # end 46 | 47 | # Methods docs: https://docs.solana.com/developing/clients/jsonrpc-api#subscription-websocket 48 | # Uncomment one of the methods below to see the output. 49 | # Without the block the websocket message will be printed to the console. 50 | # 51 | # ws_method_wrapper.account_subscribe(account_id) 52 | # ws_method_wrapper.account_subscribe(account_id, &block) 53 | # ws_method_wrapper.logs_subscribe('all') 54 | # ws_method_wrapper.logs_subscribe('all', &block) 55 | # ws_method_wrapper.program_subscribe(program_id) 56 | # ws_method_wrapper.program_subscribe(program_id, &block) 57 | # ws_method_wrapper.root_subscribe 58 | # ws_method_wrapper.root_subscribe(&block) 59 | # ws_method_wrapper.signature_subscribe('provide_signature') 60 | # ws_method_wrapper.slot_subscribe(&block) 61 | # ws_method_wrapper.slots_updates_subscribe 62 | # ws_method_wrapper.slots_updates_subscribe(&block) 63 | # ws_method_wrapper.vote_subscribe(&block) # unstable, disabled by default, check the solana docs 64 | -------------------------------------------------------------------------------- /demo_ws_program.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby -wKU 2 | 3 | # ruby demo_ws_program.rb 4 | 5 | require_relative 'lib/solana_rpc_ruby' 6 | require 'pry' 7 | 8 | # ws_testnet_cluster = 'ws://api.testnet.solana.com' 9 | ws_mainnet_cluster = 'ws://api.mainnet-beta.solana.com' 10 | 11 | cluster = ARGV[0] || ws_mainnet_cluster 12 | raise "Please provide a cluster endpoint in this format: ws://api.mainnet-beta.solana.com" if cluster.nil? 13 | 14 | SolanaRpcRuby.config do |c| 15 | c.json_rpc_version = '2.0' 16 | c.ws_cluster = cluster 17 | # c.ws_cluster = ws_mainnet_cluster 18 | end 19 | 20 | puts SolanaRpcRuby.json_rpc_version 21 | puts SolanaRpcRuby.ws_cluster 22 | 23 | ws_method_wrapper = SolanaRpcRuby::WebsocketsMethodsWrapper.new(cluster: SolanaRpcRuby.cluster) 24 | 25 | # SOL 26 | # program_id = '11111111111111111111111111111111' 27 | 28 | # Serum Program V3 29 | program_id = '9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin' 30 | 31 | interrupted = false 32 | trap('INT') { interrupted = true } 33 | 34 | script_start = Time.now 35 | puts "SCRIPT START: #{script_start}" 36 | begin 37 | time_last = Time.now 38 | ws_method_wrapper.program_subscribe(program_id, commitment: 'confirmed', encoding: 'base64', filters: [{dataSize: 65548}]) do |message| 39 | json = JSON.parse(message) 40 | # puts json['params'] 41 | time_elapsed = Time.now - time_last 42 | if json['params'] 43 | slot = json['params']['result']['context']['slot'] 44 | pubkey = json['params']['result']['value']['pubkey'] 45 | owner = json['params']['result']['value']['account']['owner'] 46 | lamports = json['params']['result']['value']['account']['lamports'] 47 | 48 | # puts "#{time_elapsed.round(4)} seconds. #{json['params']}" 49 | puts "#{time_elapsed.round(4)} seconds. #{slot} #{pubkey} #{owner} #{lamports}" 50 | 51 | end 52 | time_last = Time.now 53 | break if interrupted 54 | end 55 | rescue SolanaRpcRuby::ApiError => e 56 | puts e.inspect 57 | end # begin 58 | script_end = Time.now 59 | puts "SCRIPT END: #{script_end}" 60 | puts "SCRIPT RUN TIME: #{script_end - script_start}" 61 | # Example of block that can be passed to the method to manipualte the data. 62 | # block = Proc.new do |message| 63 | # json = JSON.parse(message) 64 | # puts json['params'] 65 | # end 66 | 67 | # Methods docs: https://docs.solana.com/developing/clients/jsonrpc-api#subscription-websocket 68 | # Uncomment one of the methods below to see the output. 69 | # Without the block the websocket message will be printed to the console. 70 | # 71 | # ws_method_wrapper.account_subscribe(account_id) 72 | # ws_method_wrapper.account_subscribe(account_id, &block) 73 | # ws_method_wrapper.logs_subscribe('all') 74 | # ws_method_wrapper.logs_subscribe('all', &block) 75 | # ws_method_wrapper.program_subscribe(program_id) 76 | # ws_method_wrapper.program_subscribe(program_id, &block) 77 | # ws_method_wrapper.root_subscribe 78 | # ws_method_wrapper.root_subscribe(&block) 79 | # ws_method_wrapper.signature_subscribe('provide_signature') 80 | # ws_method_wrapper.slot_subscribe(&block) 81 | # ws_method_wrapper.slots_updates_subscribe 82 | # ws_method_wrapper.slots_updates_subscribe(&block) 83 | # ws_method_wrapper.vote_subscribe(&block) # unstable, disabled by default, check the solana docs 84 | -------------------------------------------------------------------------------- /demo_ws_root.rb: -------------------------------------------------------------------------------- 1 | require_relative 'lib/solana_rpc_ruby' 2 | require 'pry' 3 | 4 | ws_testnet_cluster = 'ws://api.testnet.solana.com' 5 | ws_mainnet_cluster = 'ws://api.mainnet-beta.solana.com' 6 | 7 | cluster = ARGV[0] || ws_mainnet_cluster 8 | raise "Please provide a cluster endpoint in this format: ws://api.mainnet-beta.solana.com" if cluster.nil? 9 | 10 | SolanaRpcRuby.config do |c| 11 | c.json_rpc_version = '2.0' 12 | c.ws_cluster = cluster 13 | end 14 | 15 | puts SolanaRpcRuby.json_rpc_version 16 | puts SolanaRpcRuby.ws_cluster 17 | 18 | ws_method_wrapper = SolanaRpcRuby::WebsocketsMethodsWrapper.new(cluster: SolanaRpcRuby.cluster) 19 | 20 | interrupted = false 21 | trap('INT') { interrupted = true } 22 | 23 | begin 24 | time_last = Time.now 25 | ws_method_wrapper.root_subscribe do |message| 26 | json = JSON.parse(message) 27 | # puts json['params'] 28 | time_elapsed = Time.now - time_last 29 | puts "#{time_elapsed.round(4)} seconds. #{json['params']}" 30 | time_last = Time.now 31 | break if interrupted 32 | end 33 | rescue SolanaRpcRuby::ApiError => e 34 | puts e.inspect 35 | end # begin 36 | 37 | # Example of block that can be passed to the method to manipualte the data. 38 | # block = Proc.new do |message| 39 | # json = JSON.parse(message) 40 | # puts json['params'] 41 | # end 42 | 43 | # Methods docs: https://docs.solana.com/developing/clients/jsonrpc-api#subscription-websocket 44 | # Uncomment one of the methods below to see the output. 45 | # Without the block the websocket message will be printed to the console. 46 | # 47 | # ws_method_wrapper.account_subscribe(account_id) 48 | # ws_method_wrapper.account_subscribe(account_id, &block) 49 | # ws_method_wrapper.logs_subscribe('all') 50 | # ws_method_wrapper.logs_subscribe('all', &block) 51 | # ws_method_wrapper.program_subscribe(program_id) 52 | # ws_method_wrapper.program_subscribe(program_id, &block) 53 | # ws_method_wrapper.root_subscribe 54 | # ws_method_wrapper.root_subscribe(&block) 55 | # ws_method_wrapper.signature_subscribe('provide_signature') 56 | # ws_method_wrapper.slot_subscribe(&block) 57 | # ws_method_wrapper.slots_updates_subscribe 58 | # ws_method_wrapper.slots_updates_subscribe(&block) 59 | # ws_method_wrapper.vote_subscribe(&block) # unstable, disabled by default, check the solana docs 60 | -------------------------------------------------------------------------------- /demo_ws_slot.rb: -------------------------------------------------------------------------------- 1 | require_relative 'lib/solana_rpc_ruby' 2 | require 'pry' 3 | 4 | ws_testnet_cluster = 'ws://api.testnet.solana.com' 5 | ws_mainnet_cluster = 'ws://api.mainnet-beta.solana.com' 6 | 7 | cluster = ARGV[0] || ws_mainnet_cluster 8 | raise 'Please provide a cluster endpoint in this format: ws://api.mainnet-beta.solana.com' if cluster.nil? 9 | 10 | SolanaRpcRuby.config do |c| 11 | c.json_rpc_version = '2.0' 12 | c.ws_cluster = cluster 13 | # c.ws_cluster = ws_mainnet_cluster 14 | end 15 | 16 | puts SolanaRpcRuby.json_rpc_version 17 | puts SolanaRpcRuby.ws_cluster 18 | 19 | ws_method_wrapper = SolanaRpcRuby::WebsocketsMethodsWrapper.new(cluster: SolanaRpcRuby.cluster) 20 | 21 | interrupted = false 22 | trap('INT') { interrupted = true } 23 | 24 | begin 25 | time_last = Time.now 26 | ws_method_wrapper.slot_subscribe do |message| 27 | json = JSON.parse(message) 28 | next if json['params'].nil? 29 | # puts json['params'] 30 | time_elapsed = Time.now - time_last 31 | puts "#{time_elapsed.round(3)} sec. #{json['params']['result']}" 32 | time_last = Time.now 33 | break if interrupted 34 | end 35 | rescue SolanaRpcRuby::ApiError => e 36 | puts e.inspect 37 | end 38 | 39 | # Example of block that can be passed to the method to manipualte the data. 40 | # block = Proc.new do |message| 41 | # json = JSON.parse(message) 42 | # puts json['params'] 43 | # end 44 | 45 | # Methods docs: https://docs.solana.com/developing/clients/jsonrpc-api#subscription-websocket 46 | # Uncomment one of the methods below to see the output. 47 | # Without the block the websocket message will be printed to the console. 48 | # 49 | # ws_method_wrapper.account_subscribe(account_id) 50 | # ws_method_wrapper.account_subscribe(account_id, &block) 51 | # ws_method_wrapper.logs_subscribe('all') 52 | # ws_method_wrapper.logs_subscribe('all', &block) 53 | # ws_method_wrapper.program_subscribe(program_id) 54 | # ws_method_wrapper.program_subscribe(program_id, &block) 55 | # ws_method_wrapper.root_subscribe 56 | # ws_method_wrapper.root_subscribe(&block) 57 | # ws_method_wrapper.signature_subscribe('provide_signature') 58 | # ws_method_wrapper.slot_subscribe(&block) 59 | # ws_method_wrapper.slots_updates_subscribe 60 | # ws_method_wrapper.slots_updates_subscribe(&block) 61 | # ws_method_wrapper.vote_subscribe(&block) # unstable, disabled by default, check the solana docs 62 | -------------------------------------------------------------------------------- /doc/SolanaRpcRuby/Generators.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Module: SolanaRpcRuby::Generators 8 | 9 | — Documentation by YARD 0.9.28 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 |
36 | 61 | 62 |

Module: SolanaRpcRuby::Generators 63 | 64 | 65 | 66 |

67 |
68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 |
80 |
Defined in:
81 |
lib/generators/solana_rpc_ruby/install_generator.rb
82 |
83 | 84 |
85 | 86 |

Defined Under Namespace

87 |

88 | 89 | 90 | 91 | 92 | Classes: InstallGenerator 93 | 94 | 95 |

96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 |
106 | 107 | 112 | 113 |
114 | 115 | -------------------------------------------------------------------------------- /doc/SolanaRpcRuby/Generators/InstallGenerator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Class: SolanaRpcRuby::Generators::InstallGenerator 8 | 9 | — Documentation by YARD 0.9.28 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 |
36 | 61 | 62 |

Class: SolanaRpcRuby::Generators::InstallGenerator 63 | 64 | 65 | 66 |

67 |
68 | 69 |
70 |
Inherits:
71 |
72 | Rails::Generators::Base 73 | 74 |
    75 |
  • Object
  • 76 | 77 | 78 | 79 | 80 | 81 |
82 | show all 83 | 84 |
85 |
86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 |
98 |
Defined in:
99 |
lib/generators/solana_rpc_ruby/install_generator.rb
100 |
101 | 102 |
103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 |

113 | Instance Method Summary 114 | collapse 115 |

116 | 117 |
    118 | 119 |
  • 120 | 121 | 122 | #copy_config ⇒ Object 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 |
    137 | 138 |
  • 139 | 140 | 141 |
142 | 143 | 144 | 145 | 146 | 147 |
148 |

Instance Method Details

149 | 150 | 151 |
152 |

153 | 154 | #copy_configObject 155 | 156 | 157 | 158 | 159 | 160 |

161 | 162 | 170 | 177 | 178 |
163 |
164 | 
165 | 
166 | 8
167 | 9
168 | 10
169 |
171 |
# File 'lib/generators/solana_rpc_ruby/install_generator.rb', line 8
172 | 
173 | def copy_config
174 |   template 'solana_rpc_ruby_config.rb', "#{Rails.root}/config/initializers/solana_rpc_ruby.rb"
175 | end
176 |
179 |
180 | 181 |
182 | 183 |
184 | 185 | 190 | 191 |
192 | 193 | -------------------------------------------------------------------------------- /doc/class_list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Class List 19 | 20 | 21 | 22 |
23 |
24 |

Class List

25 |
26 | 27 | 28 | Classes 29 | 30 | 31 | 32 | Methods 33 | 34 | 35 | 36 | Files 37 | 38 | 39 |
40 | 41 | 42 |
43 | 44 | 49 |
50 | 51 | 52 | -------------------------------------------------------------------------------- /doc/css/common.css: -------------------------------------------------------------------------------- 1 | /* Override this file with custom rules */ -------------------------------------------------------------------------------- /doc/css/full_list.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; 4 | font-size: 13px; 5 | height: 101%; 6 | overflow-x: hidden; 7 | background: #fafafa; 8 | } 9 | 10 | h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; } 11 | .clear { clear: both; } 12 | .fixed_header { position: fixed; background: #fff; width: 100%; padding-bottom: 10px; margin-top: 0; top: 0; z-index: 9999; height: 70px; } 13 | #search { position: absolute; right: 5px; top: 9px; padding-left: 24px; } 14 | #content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVAoKCggICLCwsOTk5ExMTPb29ra2tmZmZmhoaNzc3KCgoBISEiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCAAAACwAAAAAEAAQAAAHaIAAgoMgIiYlg4kACxIaACEJCSiKggYMCRselwkpghGJBJEcFgsjJyoAGBmfggcNEx0flBiKDhQFlIoCCA+5lAORFb4AJIihCRbDxQAFChAXw9HSqb60iREZ1omqrIPdJCTe0SWI09GBACH5BAkIAAAALAAAAAAQABAAAAdrgACCgwc0NTeDiYozCQkvOTo9GTmDKy8aFy+NOBA7CTswgywJDTIuEjYFIY0JNYMtKTEFiRU8Pjwygy4ws4owPyCKwsMAJSTEgiQlgsbIAMrO0dKDGMTViREZ14kYGRGK38nHguHEJcvTyIEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDAggPg4iJAAMJCRUAJRIqiRGCBI0WQEEJJkWDERkYAAUKEBc4Po1GiKKJHkJDNEeKig4URLS0ICImJZAkuQAhjSi/wQyNKcGDCyMnk8u5rYrTgqDVghgZlYjcACTA1sslvtHRgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCQARAtOUoQRGRiFD0kJUYWZhUhKT1OLhR8wBaaFBzQ1NwAlkIszCQkvsbOHL7Y4q4IuEjaqq0ZQD5+GEEsJTDCMmIUhtgk1lo6QFUwJVDKLiYJNUd6/hoEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4uen4ICCA+IkIsDCQkVACWmhwSpFqAABQoQF6ALTkWFnYMrVlhWvIKTlSAiJiVVPqlGhJkhqShHV1lCW4cMqSkAR1ofiwsjJyqGgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCSMhREZGIYYGY2ElYebi56fhyWQniSKAKKfpaCLFlAPhl0gXYNGEwkhGYREUywag1wJwSkHNDU3D0kJYIMZQwk8MjPBLx9eXwuETVEyAC/BOKsuEjYFhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; } 15 | #full_list { padding: 0; list-style: none; margin-left: 0; margin-top: 80px; font-size: 1.1em; } 16 | #full_list ul { padding: 0; } 17 | #full_list li { padding: 0; margin: 0; list-style: none; } 18 | #full_list li .item { padding: 5px 5px 5px 12px; } 19 | #noresults { padding: 7px 12px; background: #fff; } 20 | #content.insearch #noresults { margin-left: 7px; } 21 | li.collapsed ul { display: none; } 22 | li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; } 23 | li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; } 24 | li { color: #888; cursor: pointer; } 25 | li.deprecated { text-decoration: line-through; font-style: italic; } 26 | li.odd { background: #f0f0f0; } 27 | li.even { background: #fafafa; } 28 | .item:hover { background: #ddd; } 29 | li small:before { content: "("; } 30 | li small:after { content: ")"; } 31 | li small.search_info { display: none; } 32 | a, a:visited { text-decoration: none; color: #05a; } 33 | li.clicked > .item { background: #05a; color: #ccc; } 34 | li.clicked > .item a, li.clicked > .item a:visited { color: #eee; } 35 | li.clicked > .item a.toggle { opacity: 0.5; background-position: bottom right; } 36 | li.collapsed.clicked a.toggle { background-position: top right; } 37 | #search input { border: 1px solid #bbb; border-radius: 3px; } 38 | #full_list_nav { margin-left: 10px; font-size: 0.9em; display: block; color: #aaa; } 39 | #full_list_nav a, #nav a:visited { color: #358; } 40 | #full_list_nav a:hover { background: transparent; color: #5af; } 41 | #full_list_nav span:after { content: ' | '; } 42 | #full_list_nav span:last-child:after { content: ''; } 43 | 44 | #content h1 { margin-top: 0; } 45 | li { white-space: nowrap; cursor: normal; } 46 | li small { display: block; font-size: 0.8em; } 47 | li small:before { content: ""; } 48 | li small:after { content: ""; } 49 | li small.search_info { display: none; } 50 | #search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; } 51 | #content.insearch #search { background-position: center right; } 52 | #search input { width: 110px; } 53 | 54 | #full_list.insearch ul { display: block; } 55 | #full_list.insearch .item { display: none; } 56 | #full_list.insearch .found { display: block; padding-left: 11px !important; } 57 | #full_list.insearch li a.toggle { display: none; } 58 | #full_list.insearch li small.search_info { display: block; } 59 | -------------------------------------------------------------------------------- /doc/file_list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | File List 19 | 20 | 21 | 22 |
23 |
24 |

File List

25 |
26 | 27 | 28 | Classes 29 | 30 | 31 | 32 | Methods 33 | 34 | 35 | 36 | Files 37 | 38 | 39 |
40 | 41 | 42 |
43 | 44 | 54 |
55 | 56 | 57 | -------------------------------------------------------------------------------- /doc/frames.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Documentation by YARD 0.9.28 6 | 7 | 13 | 17 | 18 | -------------------------------------------------------------------------------- /doc/top-level-namespace.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Top Level Namespace 8 | 9 | — Documentation by YARD 0.9.28 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 |
36 | 61 | 62 |

Top Level Namespace 63 | 64 | 65 | 66 |

67 |
68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 |
80 | 81 |

Defined Under Namespace

82 |

83 | 84 | 85 | Modules: SolanaRpcRuby 86 | 87 | 88 | 89 | 90 |

91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 |
101 | 102 | 107 | 108 |
109 | 110 | -------------------------------------------------------------------------------- /lib/generators/solana_rpc_ruby/install_generator.rb: -------------------------------------------------------------------------------- 1 | require 'rails/generators' 2 | module SolanaRpcRuby 3 | module Generators 4 | class InstallGenerator < Rails::Generators::Base 5 | source_root File.expand_path('../templates', __dir__) 6 | 7 | desc 'Creates a SolanaRpcRuby config file.' 8 | def copy_config 9 | template 'solana_rpc_ruby_config.rb', "#{Rails.root}/config/initializers/solana_rpc_ruby.rb" 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/generators/templates/solana_rpc_ruby_config.rb: -------------------------------------------------------------------------------- 1 | require_relative 'solana_rpc_ruby' 2 | 3 | SolanaRpcRuby.config do |c| 4 | # These are options that you can set before using gem: 5 | # 6 | # You can use this setting or pass cluster directly, check the docs. 7 | # c.cluster = 'https://api.testnet.solana.com' 8 | # c.ws_cluster = 'ws://api.testnet.solana.com' 9 | 10 | 11 | # This one is mandatory. 12 | c.json_rpc_version = '2.0' 13 | end 14 | -------------------------------------------------------------------------------- /lib/solana_rpc_ruby.rb: -------------------------------------------------------------------------------- 1 | require_relative 'solana_rpc_ruby/api_client' 2 | require_relative 'solana_rpc_ruby/api_error' 3 | require_relative 'solana_rpc_ruby/methods_wrapper' 4 | require_relative 'solana_rpc_ruby/response' 5 | require_relative 'solana_rpc_ruby/websocket_client' 6 | require_relative 'solana_rpc_ruby/websocket_methods_wrapper' 7 | 8 | # Namespace for classes and modules that handle connection with solana JSON RPC API. 9 | module SolanaRpcRuby 10 | class << self 11 | # Default cluster address that will be used if not passed. 12 | # @return [String] cluster address. 13 | attr_accessor :cluster 14 | 15 | # Default websocket cluster address that will be used if not passed. 16 | # @return [String] websocket cluster address. 17 | attr_accessor :ws_cluster 18 | 19 | # Default json rpc version that will be used. 20 | # @return [String] json rpc version. 21 | attr_accessor :json_rpc_version 22 | 23 | # Config set from initializer. 24 | # @return [String] encoding. 25 | def config 26 | yield self 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/solana_rpc_ruby/api_client.rb: -------------------------------------------------------------------------------- 1 | require 'net/http' 2 | module SolanaRpcRuby 3 | ## 4 | # ApiClient class serves as a client for solana JSON RPC API. 5 | # @see https://docs.solana.com/developing/clients/jsonrpc-api 6 | class ApiClient 7 | OPEN_TIMEOUT = 120 8 | READ_TIMEOUT = 120 9 | 10 | # Determines which cluster will be used to send requests. 11 | # @return [String] 12 | attr_accessor :cluster 13 | 14 | # Default headers. 15 | # @return [Hash] 16 | attr_accessor :default_headers 17 | 18 | # Initialize object with cluster address where requests will be sent. 19 | # 20 | # @param cluster [String] 21 | def initialize(cluster = nil) 22 | @cluster = cluster || SolanaRpcRuby.cluster 23 | 24 | message = 'Cluster is missing. Please provide default cluster in config or pass it to the client directly.' 25 | raise ArgumentError, message unless @cluster 26 | end 27 | 28 | # Sends request to the api. 29 | # 30 | # @param body [Hash] 31 | # @param http_method [Symbol] 32 | # @param params [Hash] 33 | # 34 | # @return [Object] Net::HTTPOK 35 | def call_api(body:, http_method:, params: {}) 36 | uri = URI.parse(@cluster) 37 | 38 | request = Net::HTTP::Post.new(uri, default_headers) 39 | request.body = body 40 | 41 | Net::HTTP.start( 42 | uri.host, 43 | uri.port, 44 | use_ssl: true, 45 | open_timeout: OPEN_TIMEOUT, 46 | read_timeout: READ_TIMEOUT 47 | ) do |http| 48 | http.request(request) 49 | end 50 | 51 | rescue Timeout::Error, 52 | Net::HTTPError, 53 | Net::HTTPNotFound, 54 | Net::HTTPClientException, 55 | Net::HTTPFatalError, 56 | Net::ReadTimeout, 57 | Errno::ECONNREFUSED, 58 | SocketError => e 59 | 60 | fail ApiError.new(error_class: e.class, message: e.message) 61 | rescue StandardError => e 62 | message = "#{e.class} #{e.message}\n Backtrace: \n #{e.backtrace}" 63 | fail ApiError.new(error_class: e.class, message: e.message) 64 | end 65 | 66 | private 67 | 68 | def default_headers 69 | { "Content-Type" => "application/json" } 70 | end 71 | end 72 | end 73 | -------------------------------------------------------------------------------- /lib/solana_rpc_ruby/api_error.rb: -------------------------------------------------------------------------------- 1 | module SolanaRpcRuby 2 | ## 3 | # ApiError is a wrapper class for errors 4 | # 5 | class ApiError < StandardError 6 | # Error code. 7 | # @return [Integer] 8 | attr_reader :code 9 | 10 | # Error message. 11 | # @return [String] 12 | attr_reader :message 13 | 14 | # Initialize object with json response from the API with error. 15 | # 16 | # @param code [Integer] 17 | # @param message [String] 18 | # 19 | # @return [SolanaRpcRuby::ApiError] 20 | def initialize(message:, error_class: nil, code: nil) 21 | @code = code 22 | @message = message.to_s 23 | @error_class = error_class 24 | 25 | additional_info 26 | 27 | super @message 28 | end 29 | 30 | private 31 | def additional_info 32 | wrong_url_errors = [Errno::ECONNREFUSED, SocketError] 33 | if wrong_url_errors.include?(@error_class) 34 | @message += '. Check if the RPC url you provided is correct.' 35 | end 36 | end 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /lib/solana_rpc_ruby/helper_methods.rb: -------------------------------------------------------------------------------- 1 | module SolanaRpcRuby 2 | # Namespace for helper methods. 3 | module HelperMethods 4 | # Checks if the object is nil or empty. 5 | # 6 | # @param object [String, Array, Hash, Integer, NilClass] 7 | # 8 | # @return [Boolean] 9 | def blank?(object) 10 | unless [String, Array, Hash, Integer, NilClass].include? object.class 11 | raise ArgumentError, 'Object must be a String, Array or Hash or Integer or nil class.' 12 | end 13 | 14 | object.nil? || object.try(:empty?) 15 | end 16 | 17 | # Creates method name to match names required by Solana RPC JSON. 18 | # 19 | # @param method [String] 20 | # 21 | # @return [String] 22 | def create_method_name(method) 23 | return '' unless method && (method.is_a?(String) || method.is_a?(Symbol)) 24 | 25 | method.to_s.split('_').map.with_index do |string, i| 26 | i == 0 ? string : string.capitalize 27 | end.join 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/solana_rpc_ruby/request_body.rb: -------------------------------------------------------------------------------- 1 | module SolanaRpcRuby 2 | module RequestBody 3 | # Creates body sent to the solana JSON RPC API 4 | # 5 | # From solana docs: 6 | # To make a JSON-RPC request, send an HTTP POST request with a Content-Type: application/json header. 7 | # The JSON request data should contain 4 fields: 8 | # jsonrpc: , set to "2.0" 9 | # id: , a unique client-generated identifying integer 10 | # method: , a string containing the method to be invoked 11 | # params: , a JSON array of ordered parameter values 12 | # 13 | # @param method [string] method name. 14 | # @param method_params [Array] ordered array with required and/or optional params. 15 | # @param id [Integer] Unique client-generated identifying integer. 16 | # 17 | # @return [Json] JSON string with body. 18 | # 19 | def create_json_body(method, method_params: [], id: @id) 20 | body = base_body(id: id) 21 | body[:method] = method 22 | body[:params] = method_params if method_params.any? 23 | body.to_json 24 | end 25 | 26 | # Hash with default body params. 27 | # @param id [Integer] Unique client-generated identifying integer. 28 | # 29 | # @return [Hash] hash with base params for every request. 30 | def base_body(id: 1) 31 | raise ArgumentError, 'id must be an integer' unless id.is_a?(Integer) 32 | 33 | { 34 | "jsonrpc": SolanaRpcRuby.json_rpc_version, 35 | "id": id 36 | } 37 | end 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /lib/solana_rpc_ruby/response.rb: -------------------------------------------------------------------------------- 1 | module SolanaRpcRuby 2 | ## 3 | # Response class parses response from the API to the more convenient format. 4 | # 5 | class Response 6 | # Initialize object with response body in json format. 7 | # 8 | # @param response [Hash] hash with response from the API. 9 | def initialize(response) 10 | @response = response 11 | end 12 | 13 | # @return [Hash] result in the hash. 14 | def result 15 | @result ||= parsed_response['result'] 16 | end 17 | 18 | # @return [String] matching the request specification. 19 | def json_rpc 20 | @json_rpc ||= parsed_response['jsonrpc'] 21 | end 22 | 23 | # @return [Integer] matching the request identifier. 24 | def id 25 | @id ||= parsed_response['id'] 26 | end 27 | 28 | # @return [Hash] parsed response body. 29 | def parsed_response 30 | @parsed_response ||= JSON.parse(@response.body) 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /lib/solana_rpc_ruby/version.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module SolanaRpcRuby 4 | VERSION = '1.3.1' 5 | end 6 | -------------------------------------------------------------------------------- /lib/solana_rpc_ruby/websocket_client.rb: -------------------------------------------------------------------------------- 1 | require 'net/http' 2 | require 'faye/websocket' 3 | module SolanaRpcRuby 4 | ## 5 | # WebsocketClient class serves as a websocket client for solana JSON RPC API. 6 | # @see https://docs.solana.com/developing/clients/jsonrpc-api 7 | class WebsocketClient 8 | include RequestBody 9 | 10 | KEEPALIVE_TIME = 60 11 | SLEEP_TIME = 10 12 | RETRIES_LIMIT = 3 13 | 14 | # Determines which cluster will be used to send requests. 15 | # @return [String] 16 | attr_accessor :cluster 17 | 18 | # Api client used to connect with API. 19 | # @return [Object] 20 | attr_accessor :client 21 | 22 | # Initialize object with cluster address where requests will be sent. 23 | # 24 | # @param websocket_client [Object] 25 | # @param cluster [String] 26 | def initialize(websocket_client: Faye::WebSocket, cluster: nil) 27 | @client = websocket_client 28 | @cluster = cluster || SolanaRpcRuby.ws_cluster 29 | @retries = 0 30 | 31 | message = 'Websocket cluster is missing. Please provide default cluster in config or pass it to the client directly.' 32 | raise ArgumentError, message unless @cluster 33 | end 34 | 35 | # Connects with cluster's websocket. 36 | # 37 | # @param body [String] 38 | # @param &block [Proc] 39 | # 40 | # @return [String] # messages from websocket 41 | def connect(body, &block) 42 | EM.run { 43 | # ping option sends some data to the server periodically, 44 | # which prevents the connection to go idle. 45 | ws ||= Faye::WebSocket::Client.new(@cluster, nil) 46 | EM::PeriodicTimer.new(KEEPALIVE_TIME) do 47 | while !ws.ping 48 | @retries += 1 49 | 50 | unless @retries <= 3 51 | puts '3 ping retries failed, close connection.' 52 | ws.close 53 | break 54 | end 55 | 56 | puts 'Ping failed, sleep for 10 seconds...' 57 | sleep SLEEP_TIME 58 | end 59 | end 60 | 61 | ws.on :open do |event| 62 | p [:open] 63 | p "Status: #{ws.status}" 64 | ws.send(body) 65 | end 66 | 67 | ws.on :message do |event| 68 | # To run websocket_methods_wrapper_spec.rb, uncomment code below 69 | # to return info about connection estabilished. 70 | # Also, read the comment from the top of the mentioned file. 71 | # 72 | # if ENV['test'] == 'true' 73 | # result = block_given? ? block.call(event.data) : event.data 74 | # return result 75 | # end 76 | 77 | if block_given? 78 | block.call(event.data) 79 | else 80 | puts event.data 81 | end 82 | end 83 | 84 | ws.on :close do |event| 85 | p [:close, event.code, event.reason] 86 | 87 | @retries += 1 88 | if @retries <= RETRIES_LIMIT 89 | puts 'Retry...' 90 | # It restarts the websocket connection. 91 | connect(body, &block) 92 | else 93 | ws = nil 94 | puts 'Retries limit reached, closing. Wrong cluster address or unhealthy node might be a reason, please check.' 95 | EM.stop 96 | end 97 | end 98 | } 99 | rescue Timeout::Error, 100 | Net::HTTPError, 101 | Net::HTTPNotFound, 102 | Net::HTTPClientException, 103 | Net::HTTPFatalError, 104 | Net::ReadTimeout => e 105 | fail ApiError.new(message: e.message) 106 | rescue StandardError => e 107 | message = "#{e.class} #{e.message}\n Backtrace: \n #{e.backtrace}" 108 | fail ApiError.new(message: message) 109 | end 110 | end 111 | end 112 | -------------------------------------------------------------------------------- /solana_rpc_ruby.gemspec: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require_relative 'lib/solana_rpc_ruby/version' 4 | 5 | Gem::Specification.new do |spec| 6 | spec.name = 'solana_rpc_ruby' 7 | spec.version = SolanaRpcRuby::VERSION 8 | spec.authors = ['Block Logic Team'] 9 | spec.email = ['email@example.com'] 10 | spec.summary = 'Ruby wrapper for solana JSON RPC API.' 11 | spec.description = 'This gem allows to use JSON RPC API from solana.' 12 | spec.homepage = 'https://github.com/Block-Logic/solana-rpc-ruby' 13 | spec.license = 'MIT' 14 | spec.platform = Gem::Platform::RUBY 15 | spec.required_ruby_version = '>= 2.7.5' 16 | spec.files = Dir[ 17 | 'README.md', 'LICENSE', 'CHANGELOG.md', 18 | 'lib/**/*.rb', 19 | 'lib/**/*.rake', 20 | 'solana_rpc_ruby.gemspec', 21 | '.github/*.md', 22 | 'Gemfile', 23 | 'Rakefile' 24 | ] 25 | spec.extra_rdoc_files = ['README.md'] 26 | spec.metadata= { 27 | 'documentation_uri' => 'https://www.rubydoc.info/github/Block-Logic/solana-rpc-ruby', 28 | 'source_code_uri' => 'https://github.com/Block-Logic/solana-rpc-ruby' 29 | } 30 | 31 | spec.add_dependency 'faye-websocket', '~> 0.11' 32 | 33 | spec.add_development_dependency 'rubocop', '~> 1.15' 34 | spec.add_development_dependency 'rubocop-performance', '~> 1.11' 35 | spec.add_development_dependency 'rubocop-rspec', '~> 2.3' 36 | spec.add_development_dependency 'pry', '~> 0.14' 37 | 38 | spec.add_development_dependency 'codecov', '~> 0.4' 39 | spec.add_development_dependency 'dotenv', '~> 2.7' 40 | spec.add_development_dependency 'rails', '~> 6.1' 41 | spec.add_development_dependency 'rake', '~> 13.0' 42 | spec.add_development_dependency 'rspec', '~> 3.10' 43 | spec.add_development_dependency 'rspec-rails', '~> 4.0' 44 | spec.add_development_dependency 'simplecov', '~> 0.21' 45 | spec.add_development_dependency 'vcr', '~> 6.0' 46 | spec.add_development_dependency 'webmock', '~> 3.13' 47 | end 48 | -------------------------------------------------------------------------------- /spec/dummy/.ruby-version: -------------------------------------------------------------------------------- 1 | ruby-2.6.5 2 | -------------------------------------------------------------------------------- /spec/dummy/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | -------------------------------------------------------------------------------- /spec/dummy/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative "config/application" 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /spec/dummy/app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../stylesheets .css 3 | -------------------------------------------------------------------------------- /spec/dummy/app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Block-Logic/solana-rpc-ruby/c498ba26783ed917190280693a6bea56c87fc0f9/spec/dummy/app/assets/images/.keep -------------------------------------------------------------------------------- /spec/dummy/app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's 6 | * vendor/assets/stylesheets directory can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS 10 | * files in this directory. Styles in this file should be added after the last require_* statement. 11 | * It is generally better to create a new file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | -------------------------------------------------------------------------------- /spec/dummy/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | end 3 | -------------------------------------------------------------------------------- /spec/dummy/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Block-Logic/solana-rpc-ruby/c498ba26783ed917190280693a6bea56c87fc0f9/spec/dummy/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /spec/dummy/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /spec/dummy/app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Block-Logic/solana-rpc-ruby/c498ba26783ed917190280693a6bea56c87fc0f9/spec/dummy/app/models/concerns/.keep -------------------------------------------------------------------------------- /spec/dummy/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dummy 5 | 6 | <%= csrf_meta_tags %> 7 | <%= csp_meta_tag %> 8 | 9 | <%= stylesheet_link_tag 'application', media: 'all' %> 10 | 11 | 12 | 13 | <%= yield %> 14 | 15 | 16 | -------------------------------------------------------------------------------- /spec/dummy/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | # 5 | # This file was generated by Bundler. 6 | # 7 | # The application 'bundle' is installed as part of a gem, and 8 | # this file is here to facilitate running it. 9 | # 10 | 11 | require "rubygems" 12 | 13 | m = Module.new do 14 | module_function 15 | 16 | def invoked_as_script? 17 | File.expand_path($0) == File.expand_path(__FILE__) 18 | end 19 | 20 | def env_var_version 21 | ENV["BUNDLER_VERSION"] 22 | end 23 | 24 | def cli_arg_version 25 | return unless invoked_as_script? # don't want to hijack other binstubs 26 | return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` 27 | bundler_version = nil 28 | update_index = nil 29 | ARGV.each_with_index do |a, i| 30 | if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN 31 | bundler_version = a 32 | end 33 | next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ 34 | bundler_version = $1 35 | update_index = i 36 | end 37 | bundler_version 38 | end 39 | 40 | def gemfile 41 | gemfile = ENV["BUNDLE_GEMFILE"] 42 | return gemfile if gemfile && !gemfile.empty? 43 | 44 | File.expand_path("../../Gemfile", __FILE__) 45 | end 46 | 47 | def lockfile 48 | lockfile = 49 | case File.basename(gemfile) 50 | when "gems.rb" then gemfile.sub(/\.rb$/, gemfile) 51 | else "#{gemfile}.lock" 52 | end 53 | File.expand_path(lockfile) 54 | end 55 | 56 | def lockfile_version 57 | return unless File.file?(lockfile) 58 | lockfile_contents = File.read(lockfile) 59 | return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ 60 | Regexp.last_match(1) 61 | end 62 | 63 | def bundler_version 64 | @bundler_version ||= 65 | env_var_version || cli_arg_version || 66 | lockfile_version 67 | end 68 | 69 | def bundler_requirement 70 | return "#{Gem::Requirement.default}.a" unless bundler_version 71 | 72 | bundler_gem_version = Gem::Version.new(bundler_version) 73 | 74 | requirement = bundler_gem_version.approximate_recommendation 75 | 76 | return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0") 77 | 78 | requirement += ".a" if bundler_gem_version.prerelease? 79 | 80 | requirement 81 | end 82 | 83 | def load_bundler! 84 | ENV["BUNDLE_GEMFILE"] ||= gemfile 85 | 86 | activate_bundler 87 | end 88 | 89 | def activate_bundler 90 | gem_error = activation_error_handling do 91 | gem "bundler", bundler_requirement 92 | end 93 | return if gem_error.nil? 94 | require_error = activation_error_handling do 95 | require "bundler/version" 96 | end 97 | return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION)) 98 | warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`" 99 | exit 42 100 | end 101 | 102 | def activation_error_handling 103 | yield 104 | nil 105 | rescue StandardError, LoadError => e 106 | e 107 | end 108 | end 109 | 110 | m.load_bundler! 111 | 112 | if m.invoked_as_script? 113 | load Gem.bin_path("bundler", "bundle") 114 | end 115 | -------------------------------------------------------------------------------- /spec/dummy/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../config/application', __dir__) 3 | require_relative "../config/boot" 4 | require "rails/commands" 5 | -------------------------------------------------------------------------------- /spec/dummy/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative "../config/boot" 3 | require "rake" 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /spec/dummy/bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "fileutils" 3 | 4 | # path to your application root. 5 | APP_ROOT = File.expand_path('..', __dir__) 6 | 7 | def system!(*args) 8 | system(*args) || abort("\n== Command #{args} failed ==") 9 | end 10 | 11 | FileUtils.chdir APP_ROOT do 12 | # This script is a way to set up or update your development environment automatically. 13 | # This script is idempotent, so that you can run it at any time and get an expectable outcome. 14 | # Add necessary setup steps to this file. 15 | 16 | puts '== Installing dependencies ==' 17 | system! 'gem install bundler --conservative' 18 | system('bundle check') || system!('bundle install') 19 | 20 | puts "\n== Removing old logs and tempfiles ==" 21 | system! 'bin/rails log:clear tmp:clear' 22 | 23 | puts "\n== Restarting application server ==" 24 | system! 'bin/rails restart' 25 | end 26 | -------------------------------------------------------------------------------- /spec/dummy/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative "config/environment" 4 | 5 | run Rails.application 6 | Rails.application.load_server 7 | -------------------------------------------------------------------------------- /spec/dummy/config/application.rb: -------------------------------------------------------------------------------- 1 | require_relative "boot" 2 | 3 | require "rails" 4 | # Pick the frameworks you want: 5 | require "active_model/railtie" 6 | # require "active_job/railtie" 7 | # require "active_record/railtie" 8 | # require "active_storage/engine" 9 | require "action_controller/railtie" 10 | # require "action_mailer/railtie" 11 | # require "action_mailbox/engine" 12 | # require "action_text/engine" 13 | require "action_view/railtie" 14 | # require "action_cable/engine" 15 | require "sprockets/railtie" 16 | # require "rails/test_unit/railtie" 17 | 18 | # Require the gems listed in Gemfile, including any gems 19 | # you've limited to :test, :development, or :production. 20 | Bundler.require(*Rails.groups) 21 | 22 | module Dummy 23 | class Application < Rails::Application 24 | # Initialize configuration defaults for originally generated Rails version. 25 | 26 | # Configuration for the application, engines, and railties goes here. 27 | # 28 | # These settings can be overridden in specific environments using the files 29 | # in config/environments, which are processed later. 30 | # 31 | # config.time_zone = "Central Time (US & Canada)" 32 | # config.eager_load_paths << Rails.root.join("extras") 33 | 34 | # Don't generate system test files. 35 | config.generators.system_tests = nil 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /spec/dummy/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__) 2 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) 3 | $LOAD_PATH.unshift File.expand_path('../../../lib', __dir__) -------------------------------------------------------------------------------- /spec/dummy/config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | hGDYGSwPKPIzhL3mXtqBUkVNVxVHNhUMdnHWp+ZiXdQa6v7n+brNqXokygmGHKI1NUhJXQl3/GjBPP6Uog/lMPbU6VmOXC0/+5mIL1eeHDqVhZEgscQxfUHroxC3ngcXltSx7CqXrYe3oxtDHS8Z2vhq1ZtTlVJ3P3P8NYWk7sp/tnWvua+d6ThT9zKgquOL6s4FstJVCKft4zGlqgVADUZpToCZqn5QbgVuvVFjvdbUao7KrXhxGeLcIeiUy0vlm7pby9B3/b3go3+vXk+uRHu56tT8H+cTTrFoD3ICyiCUen+zYYEiace7uF/zVQybU0KCsXOeaL98DdhaBEUvUIV2ZbacD03pUOWWkA1qP3Tf2Z0wBkHKPZoIoUvxDxXjBrPQXwO6Wxq1W5G8cLm2nCXDnoD6vjQ3Ioi0--wnRBcgRjPOk+J8SW--D7/RS2VXoA/3nwqtClMRJA== -------------------------------------------------------------------------------- /spec/dummy/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /spec/dummy/config/environments/development.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | Rails.application.configure do 4 | # Settings specified here will take precedence over those in config/application.rb. 5 | 6 | # In the development environment your application's code is reloaded any time 7 | # it changes. This slows down response time but is perfect for development 8 | # since you don't have to restart the web server when you make code changes. 9 | config.cache_classes = false 10 | 11 | # Do not eager load code on boot. 12 | config.eager_load = false 13 | 14 | # Show full error reports. 15 | config.consider_all_requests_local = true 16 | 17 | # Enable/disable caching. By default caching is disabled. 18 | # Run rails dev:cache to toggle caching. 19 | if Rails.root.join('tmp', 'caching-dev.txt').exist? 20 | config.action_controller.perform_caching = true 21 | config.action_controller.enable_fragment_cache_logging = true 22 | 23 | config.cache_store = :memory_store 24 | config.public_file_server.headers = { 25 | 'Cache-Control' => "public, max-age=#{2.days.to_i}" 26 | } 27 | else 28 | config.action_controller.perform_caching = false 29 | 30 | config.cache_store = :null_store 31 | end 32 | 33 | # Print deprecation notices to the Rails logger. 34 | config.active_support.deprecation = :log 35 | 36 | # Raise exceptions for disallowed deprecations. 37 | config.active_support.disallowed_deprecation = :raise 38 | 39 | # Tell Active Support which deprecation messages to disallow. 40 | config.active_support.disallowed_deprecation_warnings = [] 41 | 42 | # Debug mode disables concatenation and preprocessing of assets. 43 | # This option may cause significant delays in view rendering with a large 44 | # number of complex assets. 45 | config.assets.debug = true 46 | 47 | # Suppress logger output for asset requests. 48 | config.assets.quiet = true 49 | 50 | # Raises error for missing translations. 51 | # config.i18n.raise_on_missing_translations = true 52 | 53 | # Annotate rendered view with file names. 54 | # config.action_view.annotate_rendered_view_with_filenames = true 55 | 56 | # Use an evented file watcher to asynchronously detect changes in source code, 57 | # routes, locales, etc. This feature depends on the listen gem. 58 | # config.file_watcher = ActiveSupport::EventedFileUpdateChecker 59 | 60 | # Uncomment if you wish to allow Action Cable access from any origin. 61 | # config.action_cable.disable_request_forgery_protection = true 62 | end 63 | -------------------------------------------------------------------------------- /spec/dummy/config/environments/production.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | Rails.application.configure do 4 | # Settings specified here will take precedence over those in config/application.rb. 5 | 6 | # Code is not reloaded between requests. 7 | config.cache_classes = true 8 | 9 | # Eager load code on boot. This eager loads most of Rails and 10 | # your application in memory, allowing both threaded web servers 11 | # and those relying on copy on write to perform better. 12 | # Rake tasks automatically ignore this option for performance. 13 | config.eager_load = true 14 | 15 | # Full error reports are disabled and caching is turned on. 16 | config.consider_all_requests_local = false 17 | config.action_controller.perform_caching = true 18 | 19 | # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] 20 | # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). 21 | # config.require_master_key = true 22 | 23 | # Disable serving static files from the `/public` folder by default since 24 | # Apache or NGINX already handles this. 25 | config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? 26 | 27 | # Compress CSS using a preprocessor. 28 | # config.assets.css_compressor = :sass 29 | 30 | # Do not fallback to assets pipeline if a precompiled asset is missed. 31 | config.assets.compile = false 32 | 33 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 34 | # config.asset_host = 'http://assets.example.com' 35 | 36 | # Specifies the header that your server uses for sending files. 37 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache 38 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX 39 | 40 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 41 | # config.force_ssl = true 42 | 43 | # Include generic and useful information about system operation, but avoid logging too much 44 | # information to avoid inadvertent exposure of personally identifiable information (PII). 45 | config.log_level = :info 46 | 47 | # Prepend all log lines with the following tags. 48 | config.log_tags = [ :request_id ] 49 | 50 | # Use a different cache store in production. 51 | # config.cache_store = :mem_cache_store 52 | 53 | 54 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 55 | # the I18n.default_locale when a translation cannot be found). 56 | config.i18n.fallbacks = true 57 | 58 | # Send deprecation notices to registered listeners. 59 | config.active_support.deprecation = :notify 60 | 61 | # Log disallowed deprecations. 62 | config.active_support.disallowed_deprecation = :log 63 | 64 | # Tell Active Support which deprecation messages to disallow. 65 | config.active_support.disallowed_deprecation_warnings = [] 66 | 67 | # Use default logging formatter so that PID and timestamp are not suppressed. 68 | config.log_formatter = ::Logger::Formatter.new 69 | 70 | # Use a different logger for distributed setups. 71 | # require "syslog/logger" 72 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') 73 | 74 | if ENV["RAILS_LOG_TO_STDOUT"].present? 75 | logger = ActiveSupport::Logger.new(STDOUT) 76 | logger.formatter = config.log_formatter 77 | config.logger = ActiveSupport::TaggedLogging.new(logger) 78 | end 79 | 80 | # Inserts middleware to perform automatic connection switching. 81 | # The `database_selector` hash is used to pass options to the DatabaseSelector 82 | # middleware. The `delay` is used to determine how long to wait after a write 83 | # to send a subsequent read to the primary. 84 | # 85 | # The `database_resolver` class is used by the middleware to determine which 86 | # database is appropriate to use based on the time delay. 87 | # 88 | # The `database_resolver_context` class is used by the middleware to set 89 | # timestamps for the last write to the primary. The resolver uses the context 90 | # class timestamps to determine how long to wait before reading from the 91 | # replica. 92 | # 93 | # By default Rails will store a last write timestamp in the session. The 94 | # DatabaseSelector middleware is designed as such you can define your own 95 | # strategy for connection switching and pass that into the middleware through 96 | # these configuration options. 97 | # config.active_record.database_selector = { delay: 2.seconds } 98 | # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver 99 | # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session 100 | end 101 | -------------------------------------------------------------------------------- /spec/dummy/config/environments/test.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | # The test environment is used exclusively to run your application's 4 | # test suite. You never need to work with it otherwise. Remember that 5 | # your test database is "scratch space" for the test suite and is wiped 6 | # and recreated between test runs. Don't rely on the data there! 7 | 8 | Rails.application.configure do 9 | # Settings specified here will take precedence over those in config/application.rb. 10 | 11 | config.cache_classes = true 12 | 13 | # Do not eager load code on boot. This avoids loading your whole application 14 | # just for the purpose of running a single test. If you are using a tool that 15 | # preloads Rails for running tests, you may have to set it to true. 16 | config.eager_load = false 17 | 18 | # Configure public file server for tests with Cache-Control for performance. 19 | config.public_file_server.enabled = true 20 | config.public_file_server.headers = { 21 | 'Cache-Control' => "public, max-age=#{1.hour.to_i}" 22 | } 23 | 24 | # Show full error reports and disable caching. 25 | config.consider_all_requests_local = true 26 | config.action_controller.perform_caching = false 27 | config.cache_store = :null_store 28 | 29 | # Raise exceptions instead of rendering exception templates. 30 | config.action_dispatch.show_exceptions = false 31 | 32 | # Disable request forgery protection in test environment. 33 | config.action_controller.allow_forgery_protection = false 34 | 35 | # Print deprecation notices to the stderr. 36 | config.active_support.deprecation = :stderr 37 | 38 | # Raise exceptions for disallowed deprecations. 39 | config.active_support.disallowed_deprecation = :raise 40 | 41 | # Tell Active Support which deprecation messages to disallow. 42 | config.active_support.disallowed_deprecation_warnings = [] 43 | 44 | # Raises error for missing translations. 45 | # config.i18n.raise_on_missing_translations = true 46 | 47 | # Annotate rendered view with file names. 48 | # config.action_view.annotate_rendered_view_with_filenames = true 49 | end 50 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ActiveSupport::Reloader.to_prepare do 4 | # ApplicationController.renderer.defaults.merge!( 5 | # http_host: 'example.org', 6 | # https: false 7 | # ) 8 | # end 9 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path. 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | 9 | # Precompile additional assets. 10 | # application.js, application.css, and all non-JS/CSS in the app/assets 11 | # folder are already added. 12 | # Rails.application.config.assets.precompile += %w( admin.js admin.css ) 13 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code 7 | # by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'". 8 | Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"] 9 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/content_security_policy.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Define an application-wide content security policy 4 | # For further information see the following documentation 5 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy 6 | 7 | # Rails.application.config.content_security_policy do |policy| 8 | # policy.default_src :self, :https 9 | # policy.font_src :self, :https, :data 10 | # policy.img_src :self, :https, :data 11 | # policy.object_src :none 12 | # policy.script_src :self, :https 13 | # policy.style_src :self, :https 14 | 15 | # # Specify URI for violation reports 16 | # # policy.report_uri "/csp-violation-report-endpoint" 17 | # end 18 | 19 | # If you are using UJS then enable automatic nonce generation 20 | # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } 21 | 22 | # Set the nonce only to specific directives 23 | # Rails.application.config.content_security_policy_nonce_directives = %w(script-src) 24 | 25 | # Report CSP violations to a specified URI 26 | # For further information see the following documentation: 27 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only 28 | # Rails.application.config.content_security_policy_report_only = true 29 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [ 5 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn 6 | ] 7 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/permissions_policy.rb: -------------------------------------------------------------------------------- 1 | # Define an application-wide HTTP permissions policy. For further 2 | # information see https://developers.google.com/web/updates/2018/06/feature-policy 3 | # 4 | # Rails.application.config.permissions_policy do |f| 5 | # f.camera :none 6 | # f.gyroscope :none 7 | # f.microphone :none 8 | # f.usb :none 9 | # f.fullscreen :self 10 | # f.payment :self, "https://secure.example.com" 11 | # end 12 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | -------------------------------------------------------------------------------- /spec/dummy/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # The following keys must be escaped otherwise they will not be retrieved by 20 | # the default I18n backend: 21 | # 22 | # true, false, on, off, yes, no 23 | # 24 | # Instead, surround them with single quotes. 25 | # 26 | # en: 27 | # 'true': 'foo' 28 | # 29 | # To learn more, please read the Rails Internationalization guide 30 | # available at https://guides.rubyonrails.org/i18n.html. 31 | 32 | en: 33 | hello: "Hello world" 34 | -------------------------------------------------------------------------------- /spec/dummy/config/master.key: -------------------------------------------------------------------------------- 1 | f956ac8326ac126552be7f07b6280ed0 -------------------------------------------------------------------------------- /spec/dummy/config/puma.rb: -------------------------------------------------------------------------------- 1 | # Puma can serve each request in a thread from an internal thread pool. 2 | # The `threads` method setting takes two numbers: a minimum and maximum. 3 | # Any libraries that use thread pools should be configured to match 4 | # the maximum value specified for Puma. Default is set to 5 threads for minimum 5 | # and maximum; this matches the default thread size of Active Record. 6 | # 7 | max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } 8 | min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } 9 | threads min_threads_count, max_threads_count 10 | 11 | # Specifies the `worker_timeout` threshold that Puma will use to wait before 12 | # terminating a worker in development environments. 13 | # 14 | worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" 15 | 16 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000. 17 | # 18 | port ENV.fetch("PORT") { 3000 } 19 | 20 | # Specifies the `environment` that Puma will run in. 21 | # 22 | environment ENV.fetch("RAILS_ENV") { "development" } 23 | 24 | # Specifies the `pidfile` that Puma will use. 25 | pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } 26 | 27 | # Specifies the number of `workers` to boot in clustered mode. 28 | # Workers are forked web server processes. If using threads and workers together 29 | # the concurrency of the application would be max `threads` * `workers`. 30 | # Workers do not work on JRuby or Windows (both of which do not support 31 | # processes). 32 | # 33 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 } 34 | 35 | # Use the `preload_app!` method when specifying a `workers` number. 36 | # This directive tells Puma to first boot the application and load code 37 | # before forking the application. This takes advantage of Copy On Write 38 | # process behavior so workers use less memory. 39 | # 40 | # preload_app! 41 | 42 | # Allow puma to be restarted by `rails restart` command. 43 | plugin :tmp_restart 44 | -------------------------------------------------------------------------------- /spec/dummy/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html 3 | end 4 | -------------------------------------------------------------------------------- /spec/dummy/lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Block-Logic/solana-rpc-ruby/c498ba26783ed917190280693a6bea56c87fc0f9/spec/dummy/lib/assets/.keep -------------------------------------------------------------------------------- /spec/dummy/lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Block-Logic/solana-rpc-ruby/c498ba26783ed917190280693a6bea56c87fc0f9/spec/dummy/lib/tasks/.keep -------------------------------------------------------------------------------- /spec/dummy/log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Block-Logic/solana-rpc-ruby/c498ba26783ed917190280693a6bea56c87fc0f9/spec/dummy/log/.keep -------------------------------------------------------------------------------- /spec/dummy/public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The page you were looking for doesn't exist.

62 |

You may have mistyped the address or the page may have moved.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /spec/dummy/public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The change you wanted was rejected.

62 |

Maybe you tried to change something you didn't have access to.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /spec/dummy/public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

We're sorry, but something went wrong.

62 |
63 |

If you are the application owner check the logs for more information.

64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /spec/dummy/public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Block-Logic/solana-rpc-ruby/c498ba26783ed917190280693a6bea56c87fc0f9/spec/dummy/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /spec/dummy/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Block-Logic/solana-rpc-ruby/c498ba26783ed917190280693a6bea56c87fc0f9/spec/dummy/public/apple-touch-icon.png -------------------------------------------------------------------------------- /spec/dummy/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Block-Logic/solana-rpc-ruby/c498ba26783ed917190280693a6bea56c87fc0f9/spec/dummy/public/favicon.ico -------------------------------------------------------------------------------- /spec/dummy/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /spec/dummy/vendor/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Block-Logic/solana-rpc-ruby/c498ba26783ed917190280693a6bea56c87fc0f9/spec/dummy/vendor/.keep -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_account_info.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getAccountInfo","params":["71bhKKL89U3dNHzuZVZ7KarqV6XtHEgjXjvJTsguD11B",{"encoding":"base58"}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 17 Jun 2021 12:10:21 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":81319292},"value":{"data":["","base58"],"executable":false,"lamports":21949231980027307,"owner":"11111111111111111111111111111111","rentEpoch":200}},"id":1} 36 | 37 | ' 38 | recorded_at: Thu, 17 Jun 2021 12:10:22 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_account_info_with_id_passed_to_initializer.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":99,"method":"getAccountInfo","params":["71bhKKL89U3dNHzuZVZ7KarqV6XtHEgjXjvJTsguD11B"]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 04 Aug 2021 11:21:16 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":87944040},"value":{"data":"","executable":false,"lamports":20949230980049262,"owner":"11111111111111111111111111111111","rentEpoch":216}},"id":99} 36 | 37 | ' 38 | recorded_at: Wed, 04 Aug 2021 11:21:16 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_account_info_with_json_encoding.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getAccountInfo","params":["71bhKKL89U3dNHzuZVZ7KarqV6XtHEgjXjvJTsguD11B",{"encoding":"jsonParsed"}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 15 Jul 2021 13:06:30 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":85054989},"value":{"data":["","base64"],"executable":false,"lamports":20949230980019350,"owner":"11111111111111111111111111111111","rentEpoch":209}},"id":1} 36 | 37 | ' 38 | recorded_at: Thu, 15 Jul 2021 15:06:31 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_account_info_with_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getAccountInfo","params":["71bhKKL89U3dNHzuZVZ7KarqV6XtHEgjXjvJTsguD11B",{"encoding":"base64","dataSlice":{"offset":2,"length":2}}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Mon, 21 Jun 2021 15:44:59 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":81860918},"value":{"data":["","base64"],"executable":false,"lamports":21949231980027627,"owner":"11111111111111111111111111111111","rentEpoch":201}},"id":1} 36 | 37 | ' 38 | recorded_at: Mon, 21 Jun 2021 15:45:00 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_balance.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getBalance","params":["BossttsdneANBePn2mJhooAewt3fo4aLg7enmpgMvdoH"]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 23 Jun 2021 12:50:16 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":82106586},"value":3999645000},"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 23 Jun 2021 12:50:16 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_block_commitment_with_required_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getBlockCommitment","params":[50000000]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Fri, 25 Jun 2021 14:00:01 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"commitment":null,"totalStake":79414359613836555},"id":1} 36 | 37 | ' 38 | recorded_at: Fri, 25 Jun 2021 14:00:01 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_block_height.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getBlockHeight","params":[]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Fri, 25 Jun 2021 13:46:26 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":68104338,"id":1} 36 | 37 | ' 38 | recorded_at: Fri, 25 Jun 2021 13:46:26 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_block_height_with_optional_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getBlockHeight","params":[{"commitment":"finalized"}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Fri, 25 Jun 2021 13:47:25 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":68104355,"id":1} 36 | 37 | ' 38 | recorded_at: Fri, 25 Jun 2021 13:47:26 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_block_production_with_optional_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getBlockProduction","params":[{"identity":"123vij84ecQEKUvQ7gYMKxKwKF6PbYSzCzzURYA4xULY","range":{"firstSlot":82300907,"lastSlot":82360969}}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Fri, 25 Jun 2021 12:31:17 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":82366849},"value":{"byIdentity":{"123vij84ecQEKUvQ7gYMKxKwKF6PbYSzCzzURYA4xULY":[28,18]},"range":{"firstSlot":82300907,"lastSlot":82360969}}},"id":1} 36 | 37 | ' 38 | recorded_at: Fri, 25 Jun 2021 12:31:18 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_block_time_with_required_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getBlockTime","params":[50000000]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Fri, 25 Jun 2021 15:01:37 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":1606682139,"id":1} 36 | 37 | ' 38 | recorded_at: Fri, 25 Jun 2021 15:01:38 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_block_with_optional_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getBlock","params":[50000000,{"encoding":"json","transactionDetails":"none","rewards":false}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 24 Jun 2021 13:02:15 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"blockHeight":null,"blockTime":1606682139,"blockhash":"AwJaDBHMjwPzNwqYWuVfmVj57i8Us6qHcoM7nR64GFbX","parentSlot":49999999,"previousBlockhash":"AMcQfqHFW9FFAVfYEgUJFouGDX2p1v8tyTyMMK2rtd9E"},"id":1} 36 | 37 | ' 38 | recorded_at: Thu, 24 Jun 2021 13:02:16 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_blocks.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getBlocks","params":[5,100]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Tue, 22 Jun 2021 13:39:46 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":[],"id":1} 36 | 37 | ' 38 | recorded_at: Tue, 22 Jun 2021 13:39:47 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_blocks_with_limit_with_required_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getBlocksWithLimit","params":[5,100]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Fri, 25 Jun 2021 14:55:01 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":[39368303,39368304,39368305,39368306,39368307,39368308,39368316,39368317,39368318,39368319,39368320,39368321,39368322,39368323,39368324,39368325,39368326,39368327,39368328,39368329,39368330,39368331,39368332,39368333,39368334,39368335,39368336,39368337,39368338,39368339,39368340,39368341,39368342,39368343,39368344,39368345,39368346,39368347,39368348,39368349,39368350,39368351,39368356,39368357,39368358,39368359,39368360,39368361,39368362,39368363,39368364,39368365,39368366,39368367,39368368,39368369,39368370,39368371,39368376,39368377,39368378,39368379,39368380,39368381,39368382,39368383,39368384,39368385,39368386,39368387,39368388,39368389,39368390,39368391,39368392,39368393,39368394,39368395,39368396,39368401,39368402,39368403,39368404,39368405,39368406,39368407,39368408,39368409,39368410,39368411,39368412,39368413,39368414,39368415,39368416,39368417,39368418,39368419,39368420,39368425],"id":1} 36 | 37 | ' 38 | recorded_at: Fri, 25 Jun 2021 14:55:02 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_confirmed_blocks.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getConfirmedBlocks","params":[5,100]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Mon, 21 Jun 2021 14:41:38 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":[],"id":1} 36 | 37 | ' 38 | recorded_at: Mon, 21 Jun 2021 14:41:38 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_epoch_info.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getEpochInfo","params":[]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Mon, 21 Jun 2021 15:20:20 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"absoluteSlot":81858689,"blockHeight":67735186,"epoch":202,"slotIndex":118433,"slotsInEpoch":432000,"transactionCount":25649833512},"id":1} 36 | 37 | ' 38 | recorded_at: Mon, 21 Jun 2021 15:20:21 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_epoch_info_with_commitment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getEpochInfo","params":[{"commitment":"confirmed"}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Tue, 22 Jun 2021 13:47:32 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"absoluteSlot":81981060,"blockHeight":67823574,"epoch":202,"slotIndex":240804,"slotsInEpoch":432000,"transactionCount":25746869785},"id":1} 36 | 37 | ' 38 | recorded_at: Tue, 22 Jun 2021 13:47:33 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_epoch_schedule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getEpochSchedule"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Fri, 25 Jun 2021 15:19:48 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"firstNormalEpoch":14,"firstNormalSlot":524256,"leaderScheduleSlotOffset":432000,"slotsPerEpoch":432000,"warmup":true},"id":1} 36 | 37 | ' 38 | recorded_at: Fri, 25 Jun 2021 15:19:49 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_epoch_schedule_with_required_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getEpochSchedule"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Fri, 25 Jun 2021 15:17:42 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"firstNormalEpoch":14,"firstNormalSlot":524256,"leaderScheduleSlotOffset":432000,"slotsPerEpoch":432000,"warmup":true},"id":1} 36 | 37 | ' 38 | recorded_at: Fri, 25 Jun 2021 15:17:43 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_fee_calculator_for_blockhash.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getFeeCalculatorForBlockhash","params":["5ENJWYp5X6zrAnhBZmZhLKaoWyr2cHXAB24UMVYemBnb"]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Fri, 25 Jun 2021 15:32:33 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":82383838},"value":{"feeCalculator":{"lamportsPerSignature":5000}}},"id":1} 36 | 37 | ' 38 | recorded_at: Fri, 25 Jun 2021 15:32:33 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_fee_for_message.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":95893,"method":"getFeeForMessage","params":["AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQAA"]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 12 Jan 2022 15:43:40 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":112593693},"value":null},"id":95893} 36 | 37 | ' 38 | recorded_at: Wed, 12 Jan 2022 16:43:41 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_fee_rate_governor.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getFeeRateGovernor"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Fri, 25 Jun 2021 15:48:06 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":82385240},"value":{"feeRateGovernor":{"burnPercent":50,"maxLamportsPerSignature":100000,"minLamportsPerSignature":5000,"targetLamportsPerSignature":10000,"targetSignaturesPerSlot":20000}}},"id":1} 36 | 37 | ' 38 | recorded_at: Fri, 25 Jun 2021 15:48:07 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_fees.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getFees"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Fri, 25 Jun 2021 15:32:07 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":82383778},"value":{"blockhash":"5ENJWYp5X6zrAnhBZmZhLKaoWyr2cHXAB24UMVYemBnb","feeCalculator":{"lamportsPerSignature":5000},"lastValidBlockHeight":68111306,"lastValidSlot":82384078}},"id":1} 36 | 37 | ' 38 | recorded_at: Fri, 25 Jun 2021 15:32:07 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_first_available_block.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getFirstAvailableBlock"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 08:15:39 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":39368303,"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 08:15:45 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_genesis_hash.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getGenesisHash"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 08:25:29 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":"4uhcVJyU9pJkvQyS88uRDiswHXSCkY3zQawwpjk2NsNY","id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 08:25:29 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_health.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getHealth"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 08:47:30 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":"ok","id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 08:47:30 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_highest_snapshot_slot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":29760,"method":"getHighestSnapshotSlot"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 12 Jan 2022 10:11:39 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"full":112553558,"incremental":null},"id":29760} 36 | 37 | ' 38 | recorded_at: Wed, 12 Jan 2022 11:11:40 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_identity.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getIdentity"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 08:50:31 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"identity":"8SQEcP4FaYQySktNQeyxF3w8pvArx3oMEh7fPrzkN9pu"},"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 08:50:31 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_inflation_governor.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getInflationGovernor"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 08:58:47 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"foundation":0.0,"foundationTerm":0.0,"initial":0.15,"taper":0.15,"terminal":0.015},"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 08:58:47 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_inflation_rate.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getInflationRate"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 09:04:14 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"epoch":204,"foundation":0.0,"total":0.1406902625026958,"validator":0.1406902625026958},"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 09:04:15 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_inflation_reward.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getInflationReward","params":[["CX1QZWh9rJnJ6H6XNxyjBqEPDxhA7gENWVcToHvgLqb4","79psA5PwDrjeHgZgiBBAqwuG5NsNWsHQapigxFPpsgEZ"]]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 09:34:16 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":[{"amount":58625515732,"effectiveSlot":82604257,"epoch":203,"postBalance":3521208340839},null],"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 09:34:17 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_inflation_reward_with_optional_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getInflationReward","params":[["CX1QZWh9rJnJ6H6XNxyjBqEPDxhA7gENWVcToHvgLqb4","79psA5PwDrjeHgZgiBBAqwuG5NsNWsHQapigxFPpsgEZ"],{"epoch":203}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 09:49:20 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":[{"amount":58625515732,"effectiveSlot":82604257,"epoch":203,"postBalance":3521208340839},null],"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 09:49:21 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_largest_accounts.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getLargestAccounts"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 10:14:04 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":83025916},"value":[{"address":"4Rf9mGD7FeYknun5JczX5nGLTfQuS1GRjNVfkEMKE92b","lamports":398178060209179312},{"address":"KchK7WTjPzq9QL5aCwnV1dLsT8rFjruS1Zfzamxus9G","lamports":215100475608555000},{"address":"8oRw7qpj6XgLGXYCDuNoTMCqoJnDd6A8LTpNyqApSfkA","lamports":99999675536411347},{"address":"9oKrJ9iiEnCC7bewcRFbcdo4LKL2PhUEqcu8gH2eDbVM","lamports":97721651026116775},{"address":"3ANJb42D3pkVtntgT6VtW2cD3icGVyoHi2NGwtXYHQAs","lamports":91160816739578142},{"address":"K7DbiDcRngs4KY3KxSUcMFNEzXW7iQgi3zFzerXYYDZ","lamports":80000000000000000},{"address":"mvines9iiHiQTysrwkJjGf2gb9Ex9jXJX8ns3qwf2kN","lamports":53925298123552905},{"address":"71bhKKL89U3dNHzuZVZ7KarqV6XtHEgjXjvJTsguD11B","lamports":21949231980028221},{"address":"57DPUrAncC4BUY7KBqRMCQUt4eQeMaJWpmLQwsL35ojZ","lamports":18210922251240877},{"address":"hQBS6cu8RHkXcCzE6N8mQxhgrtbNy4kivoRjTMzF2cA","lamports":18191952934303019},{"address":"5vxoRv2P12q4K4cWPCJkvPjg6jYnuCYxzF3juJZJiwba","lamports":14225826282894687},{"address":"2tZoLFgcbeW8Howq8QMRnExvuwHFUeEnx9ZhHq2qX77E","lamports":10099332705143424},{"address":"5NH47Zk9NAzfbtqNpUtn8CQgNZeZE88aa2NRpfe7DyTD","lamports":10000061532305268},{"address":"4xxV5Svt3LPsDv81seuqKB4QXxwhdQiFXzbj9GNYXkEr","lamports":10000000000000000},{"address":"GoCxdowvFindZVAXP3QsKRP3rR2LZBNXWwp3FB1yZznF","lamports":9796480999955000},{"address":"7arfejY2YxX9QrmzHrhu3rG3HofjMqKtfBzQLf8s3Wop","lamports":5465067221872345},{"address":"5TkrtJfHoX85sti8xSVvfggVV9SDvhjYjiXe9PqMJVN9","lamports":5384145919053672},{"address":"123vij84ecQEKUvQ7gYMKxKwKF6PbYSzCzzURYA4xULY","lamports":4350561885825884},{"address":"7vYe2KRUL2sbqSqbCn4UCvn2taaTJWvo3HBsPjZcEogG","lamports":3983999997415000},{"address":"7aeNmoVKnbxUSZGukYz2Gyr3UazXpaxATNszKu8XMW1k","lamports":3324774979081580}]},"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 10:14:05 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_largest_accounts_with_optional_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getLargestAccounts","params":[{"filter":"circulating"}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 10:09:30 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":83025918},"value":[{"address":"4Rf9mGD7FeYknun5JczX5nGLTfQuS1GRjNVfkEMKE92b","lamports":398178060209179312},{"address":"KchK7WTjPzq9QL5aCwnV1dLsT8rFjruS1Zfzamxus9G","lamports":215100475608555000},{"address":"8oRw7qpj6XgLGXYCDuNoTMCqoJnDd6A8LTpNyqApSfkA","lamports":99999675536401349},{"address":"9oKrJ9iiEnCC7bewcRFbcdo4LKL2PhUEqcu8gH2eDbVM","lamports":97721651026111777},{"address":"3ANJb42D3pkVtntgT6VtW2cD3icGVyoHi2NGwtXYHQAs","lamports":91160816739573142},{"address":"K7DbiDcRngs4KY3KxSUcMFNEzXW7iQgi3zFzerXYYDZ","lamports":80000000000000000},{"address":"mvines9iiHiQTysrwkJjGf2gb9Ex9jXJX8ns3qwf2kN","lamports":53925298123552905},{"address":"71bhKKL89U3dNHzuZVZ7KarqV6XtHEgjXjvJTsguD11B","lamports":21949231980028221},{"address":"57DPUrAncC4BUY7KBqRMCQUt4eQeMaJWpmLQwsL35ojZ","lamports":18210922251235879},{"address":"hQBS6cu8RHkXcCzE6N8mQxhgrtbNy4kivoRjTMzF2cA","lamports":18191952934293021},{"address":"5vxoRv2P12q4K4cWPCJkvPjg6jYnuCYxzF3juJZJiwba","lamports":14225826282894687},{"address":"2tZoLFgcbeW8Howq8QMRnExvuwHFUeEnx9ZhHq2qX77E","lamports":10099332705143426},{"address":"5NH47Zk9NAzfbtqNpUtn8CQgNZeZE88aa2NRpfe7DyTD","lamports":10000061532295270},{"address":"4xxV5Svt3LPsDv81seuqKB4QXxwhdQiFXzbj9GNYXkEr","lamports":10000000000000000},{"address":"GoCxdowvFindZVAXP3QsKRP3rR2LZBNXWwp3FB1yZznF","lamports":9796480999955000},{"address":"7arfejY2YxX9QrmzHrhu3rG3HofjMqKtfBzQLf8s3Wop","lamports":5465067221872347},{"address":"5TkrtJfHoX85sti8xSVvfggVV9SDvhjYjiXe9PqMJVN9","lamports":5384145919048672},{"address":"123vij84ecQEKUvQ7gYMKxKwKF6PbYSzCzzURYA4xULY","lamports":4350561885820886},{"address":"7vYe2KRUL2sbqSqbCn4UCvn2taaTJWvo3HBsPjZcEogG","lamports":3983999997415000},{"address":"7aeNmoVKnbxUSZGukYz2Gyr3UazXpaxATNszKu8XMW1k","lamports":3324774979081580}]},"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 10:09:31 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_latest_blockhash.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":8364,"method":"getLatestBlockhash"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 12 Jan 2022 10:28:21 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":112555704},"value":{"blockhash":"ERoYQz1Wo9XoUyENaNAb1s21AJoCGMjwvwDZuuJ1LCiw","lastValidBlockHeight":91969814}},"id":8364} 36 | 37 | ' 38 | recorded_at: Wed, 12 Jan 2022 11:28:22 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_leader_schedule_with_optional_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getLeaderSchedule","params":[{"epoch":203,"identity":"123vij84ecQEKUvQ7gYMKxKwKF6PbYSzCzzURYA4xULY"}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 10:28:41 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"123vij84ecQEKUvQ7gYMKxKwKF6PbYSzCzzURYA4xULY":[580,581,582,583,724,725,726,727,4208,4209,4210,4211,16596,16597,16598,16599,22604,22605,22606,22607,31512,31513,31514,31515,35532,35533,35534,35535,41568,41569,41570,41571,46584,46585,46586,46587,57036,57037,57038,57039,59484,59485,59486,59487,66420,66421,66422,66423,75944,75945,75946,75947,84928,84929,84930,84931,90900,90901,90902,90903,92260,92261,92262,92263,98716,98717,98718,98719,119216,119217,119218,119219,121272,121273,121274,121275,140584,140585,140586,140587,146020,146021,146022,146023,165396,165397,165398,165399,167224,167225,167226,167227,167748,167749,167750,167751,168892,168893,168894,168895,172044,172045,172046,172047,189348,189349,189350,189351,190532,190533,190534,190535,192564,192565,192566,192567,203036,203037,203038,203039,206564,206565,206566,206567,217980,217981,217982,217983,219876,219877,219878,219879,220340,220341,220342,220343,223416,223417,223418,223419,233524,233525,233526,233527,235220,235221,235222,235223,235956,235957,235958,235959,243884,243885,243886,243887,250448,250449,250450,250451,258356,258357,258358,258359,263076,263077,263078,263079,268736,268737,268738,268739,268988,268989,268990,268991,277412,277413,277414,277415,284560,284561,284562,284563,292480,292481,292482,292483,292632,292633,292634,292635,293852,293853,293854,293855,297404,297405,297406,297407,305252,305253,305254,305255,315048,315049,315050,315051,320476,320477,320478,320479,324260,324261,324262,324263,324504,324505,324506,324507,335580,335581,335582,335583,342600,342601,342602,342603,351696,351697,351698,351699,353368,353369,353370,353371,365108,365109,365110,365111,368140,368141,368142,368143,384244,384245,384246,384247,395088,395089,395090,395091,402084,402085,402086,402087,402948,402949,402950,402951,405052,405053,405054,405055,409056,409057,409058,409059,410784,410785,410786,410787,413936,413937,413938,413939,423588,423589,423590,423591,425736,425737,425738,425739,429460,429461,429462,429463]},"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 10:28:41 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_max_retransmit_slot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getMaxRetransmitSlot"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 10:36:08 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":83030418,"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 10:36:09 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_max_shred_insert_slot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getMaxShredInsertSlot"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 10:45:17 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":83031296,"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 10:45:17 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_minimum_balance_for_rent_exemption.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getMinimumBalanceForRentExemption","params":[50]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 11:09:56 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":1238880,"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 11:09:56 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_multiple_accounts_with_optional_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getMultipleAccounts","params":[["CX1QZWh9rJnJ6H6XNxyjBqEPDxhA7gENWVcToHvgLqb4","ConnvAV6R69HQpSPEi82XW9SJzRDrijg9VuJHCscrMKY"],{"encoding":"base64","dataSlice":{"offset":5,"length":1}}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 11:31:57 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":83035488},"value":[{"data":["Rg==","base64"],"executable":false,"lamports":3521208340839,"owner":"Vote111111111111111111111111111111111111111","rentEpoch":204},{"data":["AQ==","base64"],"executable":false,"lamports":108210555413508,"owner":"Vote111111111111111111111111111111111111111","rentEpoch":204}]},"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 11:31:57 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_program_accounts_with_optional_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getProgramAccounts","params":["Vote111111111111111111111111111111111111111",{"encoding":"base64","dataSlice":{"offset":1,"length":1},"filters":[{"dataSize":2},{"memcmp":{"offset":4,"bytes":"3Mc6vR"}}],"withContext":true}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 15 Jul 2021 13:32:11 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":85057364},"value":[]},"id":1} 36 | 37 | ' 38 | recorded_at: Thu, 15 Jul 2021 15:32:12 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_recent_blockhash.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getRecentBlockhash"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 15:00:54 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":83055428},"value":{"blockhash":"6M1AMekz95Y3c5UjHq9GkEs6YX1BEJrB4vxcoHjjMJuF","feeCalculator":{"lamportsPerSignature":5000}}},"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 15:00:55 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_recent_performance_samples_with_optional_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getRecentPerformanceSamples","params":[10]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 15:09:10 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":[{"numSlots":91,"numTransactions":67251,"samplePeriodSecs":60,"slot":83056219},{"numSlots":88,"numTransactions":78180,"samplePeriodSecs":60,"slot":83056128},{"numSlots":94,"numTransactions":76902,"samplePeriodSecs":60,"slot":83056040},{"numSlots":93,"numTransactions":73456,"samplePeriodSecs":60,"slot":83055946},{"numSlots":80,"numTransactions":88389,"samplePeriodSecs":60,"slot":83055853},{"numSlots":89,"numTransactions":82156,"samplePeriodSecs":60,"slot":83055773},{"numSlots":95,"numTransactions":70631,"samplePeriodSecs":60,"slot":83055684},{"numSlots":90,"numTransactions":85765,"samplePeriodSecs":60,"slot":83055589},{"numSlots":95,"numTransactions":75604,"samplePeriodSecs":60,"slot":83055499},{"numSlots":87,"numTransactions":79404,"samplePeriodSecs":60,"slot":83055404}],"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 15:09:11 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_signature_statuses.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getSignatureStatuses","params":[["36TLd62HWMovqgJSZzgq8XUBF2j7kS7nXpRqRpYS6EmN7rD5axGR4D5vnz21YE5Bk3ZACYVgZYRGxAafJo3VjcxM","3XLkMhuv6SszY4x5Bn91hgWHQdhNVDXAxG6pxqcCCtex6NfhGn9DB5ZxXyBVzVy2mBkh2d5c7NZZzQ9jdGhRrVrH"]]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 01 Jul 2021 09:33:48 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":83160615},"value":[null,null]},"id":1} 36 | 37 | ' 38 | recorded_at: Thu, 01 Jul 2021 09:33:48 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_signature_statuses_with_optional_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getSignatureStatuses","params":[["36TLd62HWMovqgJSZzgq8XUBF2j7kS7nXpRqRpYS6EmN7rD5axGR4D5vnz21YE5Bk3ZACYVgZYRGxAafJo3VjcxM","3XLkMhuv6SszY4x5Bn91hgWHQdhNVDXAxG6pxqcCCtex6NfhGn9DB5ZxXyBVzVy2mBkh2d5c7NZZzQ9jdGhRrVrH"],{"searchTransactionHistory":true}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 01 Jul 2021 09:33:48 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":83160615},"value":[{"confirmationStatus":"finalized","confirmations":null,"err":null,"slot":82507366,"status":{"Ok":null}},{"confirmationStatus":"finalized","confirmations":null,"err":null,"slot":82507367,"status":{"Ok":null}}]},"id":1} 36 | 37 | ' 38 | recorded_at: Thu, 01 Jul 2021 09:33:50 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_signatures_for_address.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getSignaturesForAddress","params":["8oz37poDhVBdUPcHDVFc7ChoS7yA1E1hMFp5tgaB1m7N"]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 15:21:13 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":[{"blockTime":1624651458,"confirmationStatus":"finalized","err":null,"memo":null,"signature":"aLoUEJQHE3JBocPVEdKZ1JUKW89FpRutf9qsTwAAkGPfuVkFL9HfSvhRuYD31Ui1U5C5vgqmuddn2pvByo5g8E8","slot":83027168},{"blockTime":1624651326,"confirmationStatus":"finalized","err":null,"memo":null,"signature":"5hxW7AwmeEW9iq1TGBDfB8CmRfTrzHoNd7TakWrDnZzUbKtdG3GXqvYpftvw4jGcH1vsUVe3b5kyjgmJHxhDAsTm","slot":83026947},{"blockTime":1624651290,"confirmationStatus":"finalized","err":null,"memo":null,"signature":"4QuudmcDagkDiufVDzXr1QBkUGF83vSsi68C2V3a3oP9oEa5TdUrxN6GwiVH5WX5e5sWE9BQMSJmxNiXTBzpdRcB","slot":83026888}],"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 15:21:22 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_signatures_for_address_with_optional_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getSignaturesForAddress","params":["8oz37poDhVBdUPcHDVFc7ChoS7yA1E1hMFp5tgaB1m7N",{"limit":1}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 15:23:16 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":[{"blockTime":1624651458,"confirmationStatus":"finalized","err":null,"memo":null,"signature":"aLoUEJQHE3JBocPVEdKZ1JUKW89FpRutf9qsTwAAkGPfuVkFL9HfSvhRuYD31Ui1U5C5vgqmuddn2pvByo5g8E8","slot":83027168}],"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 15:23:16 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_slot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getSlot"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 01 Jul 2021 10:14:30 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":83164411,"id":1} 36 | 37 | ' 38 | recorded_at: Thu, 01 Jul 2021 10:14:31 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_slot_leader.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getSlotLeader"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 01 Jul 2021 10:16:42 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":"4gMboaRFTTxQ6iPoH3NmxLw6Ux3SEAGkQjfrBT1suDZd","id":1} 36 | 37 | ' 38 | recorded_at: Thu, 01 Jul 2021 10:16:42 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_slot_leaders.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getSlotLeaders","params":[82507366,10]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 01 Jul 2021 10:27:43 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":["92h9nfYrehDW47mwHsjvGZQAsBikFrhhALp1XxzXo7rD","92h9nfYrehDW47mwHsjvGZQAsBikFrhhALp1XxzXo7rD","5saC4V5Kk7Xr5zUUbQZHfXCrzFWyW9Lvjq97N9ydX5nj","5saC4V5Kk7Xr5zUUbQZHfXCrzFWyW9Lvjq97N9ydX5nj","5saC4V5Kk7Xr5zUUbQZHfXCrzFWyW9Lvjq97N9ydX5nj","5saC4V5Kk7Xr5zUUbQZHfXCrzFWyW9Lvjq97N9ydX5nj","D8goKEZAXaWCfVSFbGKZQtFn3B5XFdLLmJgUSgMjEJf7","D8goKEZAXaWCfVSFbGKZQtFn3B5XFdLLmJgUSgMjEJf7","D8goKEZAXaWCfVSFbGKZQtFn3B5XFdLLmJgUSgMjEJf7","D8goKEZAXaWCfVSFbGKZQtFn3B5XFdLLmJgUSgMjEJf7"],"id":1} 36 | 37 | ' 38 | recorded_at: Thu, 01 Jul 2021 10:27:44 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_snapshot_slot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getSnapshotSlot"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 30 Jun 2021 15:12:21 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":83056403,"id":1} 36 | 37 | ' 38 | recorded_at: Wed, 30 Jun 2021 15:12:21 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_stake_activation.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getStakeActivation","params":["BbeCzMU39ceqSgQoNs9c1j2zes7kNcygew8MEjEBvzuY"]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 01 Jul 2021 10:55:00 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"active":79529161339,"inactive":0,"state":"active"},"id":1} 36 | 37 | ' 38 | recorded_at: Thu, 01 Jul 2021 10:55:00 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_token_account_balance.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.mainnet-beta.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getTokenAccountBalance","params":["7zio4a4zAQz5cBS2Ah4WsHVCexQ2bt76ByiEjL3h8m1p"]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.mainnet-beta.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 15 Jul 2021 09:14:32 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":87139018},"value":{"amount":"0","decimals":9,"uiAmount":0.0,"uiAmountString":"0"}},"id":1} 36 | 37 | ' 38 | recorded_at: Thu, 15 Jul 2021 11:14:34 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_token_accounts_by_delegate.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.mainnet-beta.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getTokenAccountsByDelegate","params":["7nJGERf1LZpjn4uTfcDZLJ6YRtvdSExAB9uK851zT6do",{"mint":"4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.mainnet-beta.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 15 Jul 2021 10:50:00 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":87148116},"value":[]},"id":1} 36 | 37 | ' 38 | recorded_at: Thu, 15 Jul 2021 12:50:03 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_token_accounts_by_delegate_with_optional_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.mainnet-beta.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getTokenAccountsByDelegate","params":["7zio4a4zAQz5cBS2Ah4WsHVCexQ2bt76ByiEjL3h8m1p",{"mint":"4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.mainnet-beta.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 15 Jul 2021 11:00:20 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":87149118},"value":[]},"id":1} 36 | 37 | ' 38 | recorded_at: Thu, 15 Jul 2021 13:00:22 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_token_accounts_by_owner.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.mainnet-beta.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getTokenAccountsByOwner","params":["122FAHxVFQDQjzgSBSNUmLJXJxG4ooUwLdYvgf3ASs2K",{"mint":"4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.mainnet-beta.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 15 Jul 2021 11:01:59 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":87149255},"value":[{"account":{"data":"qpJ4yNiR5j7UVVJG46YuizxkrL7UJpsJv5R9i45pg1gLm8C1Ymf9nuJtDVgkwcB6R4javmTdC73UJGdDsRKTwDv3FMB2KejVNH2d36FgbuXxugtxQstxs3K1tLye76oudJYETtZf6Eo7GUN5q9bUUnkBWZz5FykgdXdx2Wai6k7zEqS8zLnKpEGwbeKCtunazaAWFBo4FTCjDkCJ97adZS8MzupjrcEf9","executable":false,"lamports":2039280,"owner":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA","rentEpoch":200},"pubkey":"J3Rknuc3CjskKE4H1BUmRFtGffpsWFT1NSPevxWqLCx1"}]},"id":1} 36 | 37 | ' 38 | recorded_at: Thu, 15 Jul 2021 13:02:01 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_token_accounts_by_owner_with_optional_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.mainnet-beta.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getTokenAccountsByOwner","params":["122FAHxVFQDQjzgSBSNUmLJXJxG4ooUwLdYvgf3ASs2K",{"mint":"4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"},{"commitment":"finalized","encoding":"base58","dataSlice":{"offset":10,"length":3}}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.mainnet-beta.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 15 Jul 2021 11:09:25 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":87149968},"value":[{"account":{"data":["26Qf2","base58"],"executable":false,"lamports":2039280,"owner":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA","rentEpoch":200},"pubkey":"J3Rknuc3CjskKE4H1BUmRFtGffpsWFT1NSPevxWqLCx1"}]},"id":1} 36 | 37 | ' 38 | recorded_at: Thu, 15 Jul 2021 13:09:26 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_token_largest_accounts.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.mainnet-beta.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getTokenLargestAccounts","params":["4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.mainnet-beta.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 15 Jul 2021 11:14:03 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":87150405},"value":[{"address":"fArUAncZwVbMimiWv5cPUfFsapdLd8QMXZE4VXqFagR","amount":"176769990000046","decimals":6,"uiAmount":176769990.000046,"uiAmountString":"176769990.000046"},{"address":"DmKR61BQk5zJTNCK9rrt8fM8HrDH6DSdE3Rt7sXKoAKb","amount":"166500000000000","decimals":6,"uiAmount":166500000.0,"uiAmountString":"166500000"},{"address":"HoVhs7NAzcAaavr2tc2aaTynJ6kwhdfC2B2Z7EthKpeo","amount":"111000000000000","decimals":6,"uiAmount":111000000.0,"uiAmountString":"111000000"},{"address":"HuBBhoS81jyHTKMbhz8B3iYa8HSNShnRwXRzPzmFFuFr","amount":"26957142860000","decimals":6,"uiAmount":26957142.86,"uiAmountString":"26957142.86"},{"address":"8tnpAECxAT9nHBqR1Ba494Ar5dQMPGhL31MmPJz1zZvY","amount":"12185884767584","decimals":6,"uiAmount":12185884.767584,"uiAmountString":"12185884.767584"},{"address":"5unqG9sYX995czHCtHkkJvd2EaTE58jdvmjfz1nVvo5x","amount":"11100000000000","decimals":6,"uiAmount":11100000.0,"uiAmountString":"11100000"},{"address":"57UrreUU2rPKBa8dSgRUZo4Mnt4UJ13gU2mvzGmGkvsY","amount":"6342857140000","decimals":6,"uiAmount":6342857.14,"uiAmountString":"6342857.14"},{"address":"Faszfxg7k2HWUT4CSGUn9MAVGUsPijvDQ3i2h7fi46M6","amount":"5572391478200","decimals":6,"uiAmount":5572391.4782,"uiAmountString":"5572391.4782"},{"address":"Fy6SnHwAkxoGMhUH2cLu2biqAnHmaAwFDDww9k6gq5ws","amount":"5324567480103","decimals":6,"uiAmount":5324567.480103,"uiAmountString":"5324567.480103"},{"address":"DujWhSxnwqFd3TrLfScyUhJ3FdoaHrmoiVE6kU4ETQyL","amount":"5171818836423","decimals":6,"uiAmount":5171818.836423,"uiAmountString":"5171818.836423"},{"address":"3wqhzSB9avepM9xMteiZnbJw75zmTBDVmPFLTQAGcSMN","amount":"4933874705879","decimals":6,"uiAmount":4933874.705879,"uiAmountString":"4933874.705879"},{"address":"ENjXaFNDiLTh44Gs89ZtfUH2i5MGLLkfYbSY7TmP4Du3","amount":"4383589125299","decimals":6,"uiAmount":4383589.125299,"uiAmountString":"4383589.125299"},{"address":"Eg6sR9H28cFaek5DVdgxxDcRKKbS85XvCFEzzkdmYNhq","amount":"3786923892414","decimals":6,"uiAmount":3786923.892414,"uiAmountString":"3786923.892414"},{"address":"4RRQuphvxm8upeSWmf1FAhXD9MUDihEnUUNJvbpBvJf4","amount":"2269584607735","decimals":6,"uiAmount":2269584.607735,"uiAmountString":"2269584.607735"},{"address":"6U6U59zmFWrPSzm9sLX7kVkaK78Kz7XJYkrhP1DjF3uF","amount":"1888751900000","decimals":6,"uiAmount":1888751.9,"uiAmountString":"1888751.9"},{"address":"85WdjCsxksAoCo6NNZSU4rocjUHsJwXrzpHJScg8oVNZ","amount":"1669985000000","decimals":6,"uiAmount":1669985.0,"uiAmountString":"1669985"},{"address":"5QDTh4Bpz4wruWMfayMSjUxRgDvMzvS2ifkarhYtjS1B","amount":"1297129900000","decimals":6,"uiAmount":1297129.9,"uiAmountString":"1297129.9"},{"address":"EVVtYo4AeCbmn2dYS1UnhtfjpzCXCcN26G1HmuHwMo7w","amount":"1035146900000","decimals":6,"uiAmount":1035146.9,"uiAmountString":"1035146.9"},{"address":"FVz1J9FxbhaqMpm8hwGm6aFbvciNeo2xaikYs2Qs9xJ6","amount":"500591085774","decimals":6,"uiAmount":500591.085774,"uiAmountString":"500591.085774"},{"address":"8orrvb6rHB776KbQmszcxPH44cZHdCTYC1fr2a3oHufC","amount":"481344360333","decimals":6,"uiAmount":481344.360333,"uiAmountString":"481344.360333"}]},"id":1} 36 | 37 | ' 38 | recorded_at: Thu, 15 Jul 2021 13:14:07 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_token_supply.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.mainnet-beta.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":98438,"method":"getTokenSupply","params":["4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.mainnet-beta.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 12 Jan 2022 11:21:58 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":115908012},"value":{"amount":"555000000000000","decimals":6,"uiAmount":555000000.0,"uiAmountString":"555000000"}},"id":98438} 36 | 37 | ' 38 | recorded_at: Wed, 12 Jan 2022 12:21:59 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_transaction.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getTransaction","params":["36TLd62HWMovqgJSZzgq8XUBF2j7kS7nXpRqRpYS6EmN7rD5axGR4D5vnz21YE5Bk3ZACYVgZYRGxAafJo3VjcxM"]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 01 Jul 2021 12:11:09 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"blockTime":1624339578,"meta":{"err":null,"fee":5000,"innerInstructions":[],"logMessages":["Program 36 | Vote111111111111111111111111111111111111111 invoke [1]","Program Vote111111111111111111111111111111111111111 37 | success"],"postBalances":[486970147752,1600460010105,1,1,1],"postTokenBalances":[],"preBalances":[486970152752,1600460010105,1,1,1],"preTokenBalances":[],"rewards":[],"status":{"Ok":null}},"slot":82507366,"transaction":{"message":{"accountKeys":["FPncJ2ASP4cVPcmHxibgpqaxMuwjaw3qNQiZvVdoefDg","66T8QgJA6v4fhKqhAJeEMqBN3vu1EeNwER5ZbmvY19jK","SysvarS1otHashes111111111111111111111111111","SysvarC1ock11111111111111111111111111111111","Vote111111111111111111111111111111111111111"],"header":{"numReadonlySignedAccounts":0,"numReadonlyUnsignedAccounts":3,"numRequiredSignatures":1},"instructions":[{"accounts":[1,2,3,0],"data":"rTDbDtm67JPw9Wo4sw6Bfu9hJZX9eZRBqdy4DKhcZS9qnpsKckwikenCScNfis641PhU4QjquAHp74TpZc3a1G5HZ2PfEXiP47w8kMKu","programIdIndex":4}],"recentBlockhash":"9sULfGrgLMh4LL4xEk3DK5jqH4A9qq1iDRKU1LtHz9AN"},"signatures":["36TLd62HWMovqgJSZzgq8XUBF2j7kS7nXpRqRpYS6EmN7rD5axGR4D5vnz21YE5Bk3ZACYVgZYRGxAafJo3VjcxM"]}},"id":1} 38 | 39 | ' 40 | recorded_at: Thu, 01 Jul 2021 12:11:16 GMT 41 | recorded_with: VCR 6.0.0 42 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_transaction_count.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getTransactionCount"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 01 Jul 2021 13:07:21 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":26634129803,"id":1} 36 | 37 | ' 38 | recorded_at: Thu, 01 Jul 2021 13:07:21 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_transaction_with_optional_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getTransaction","params":["36TLd62HWMovqgJSZzgq8XUBF2j7kS7nXpRqRpYS6EmN7rD5axGR4D5vnz21YE5Bk3ZACYVgZYRGxAafJo3VjcxM",{"encoding":"base58"}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 01 Jul 2021 12:16:49 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"blockTime":1624339578,"meta":{"err":null,"fee":5000,"innerInstructions":[],"logMessages":["Program 36 | Vote111111111111111111111111111111111111111 invoke [1]","Program Vote111111111111111111111111111111111111111 37 | success"],"postBalances":[486970147752,1600460010105,1,1,1],"postTokenBalances":[],"preBalances":[486970152752,1600460010105,1,1,1],"preTokenBalances":[],"rewards":[],"status":{"Ok":null}},"slot":82507366,"transaction":["3cZS7wbtMVaSjCu5qXVdaZcHy6e43Fn2DKVbdor4kVadeCejvxAbAAuetsxBDz7f2KAsep2mCXv9kqnYYs3A1s2eydaaWXTwkokKA8Mun9xAmu7ri74whgM51BeT46D85LGVe5NmfNjybP4TTkGu1xyeDWbpiEBMdThhwiTLyg9WGS2FuSLBZHciP9KipPDtdixwRtBbrLfpCERVGb7yLubQn3tmU1SNdJH7j3AB3Tc7QLzf8P8aZkmEAcRhdK6oSfsvyhtveqzRjWjYAQvzVFmu5oXv4yXuMPVWZthrgtz8wQdkjcv3ZtHFqDSeQc3oCdZ2iBGdBkJr8SrZefzu8Yz2kZvSWZPTVn53RcbmAy5EpjjM1ANUX6GhJegtbBGYQsDRkeYewcGNXmcTHMLcty9zAUqy4VKMuMm4NSnLevhCXKnAbcKmhoomHmNGH2HPJo4cUMit2pGLm1BT2A7eZDa7","base58"]},"id":1} 38 | 39 | ' 40 | recorded_at: Thu, 01 Jul 2021 12:16:51 GMT 41 | recorded_with: VCR 6.0.0 42 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_version.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getVersion"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 01 Jul 2021 13:16:42 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"feature-set":743297851,"solana-core":"1.7.3"},"id":1} 36 | 37 | ' 38 | recorded_at: Thu, 01 Jul 2021 13:16:43 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/get_vote_accounts_with_votePubkey_param.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"getVoteAccounts","params":[{"votePubkey":"CZVUMA5W21V5VdtNV5R22FQr3MuCixcPr5j3pZYH8bdu"}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Tue, 22 Jun 2021 12:47:53 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"current":[{"activatedStake":45239332995339,"commission":100,"epochCredits":[[198,1069234,893438],[199,1243745,1069234],[200,1419552,1243745],[201,1589170,1419552],[202,1684310,1589170]],"epochVoteAccount":true,"lastVote":81975455,"nodePubkey":"FVD3oRjHRyDsGTwisgZrZPV6vbbRvkgx8hm6ctmBG1Ne","rootSlot":81975395,"votePubkey":"CZVUMA5W21V5VdtNV5R22FQr3MuCixcPr5j3pZYH8bdu"}],"delinquent":[]},"id":1} 36 | 37 | ' 38 | recorded_at: Tue, 22 Jun 2021 12:47:53 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/is_blockhash_valid.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":52057,"method":"isBlockhashValid","params":["ERoYQz1Wo9XoUyENaNAb1s21AJoCGMjwvwDZuuJ1LCiw"]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Wed, 12 Jan 2022 11:41:07 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":112564333},"value":false},"id":52057} 36 | 37 | ' 38 | recorded_at: Wed, 12 Jan 2022 12:41:08 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/minimum_ledger_slot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"minimumLedgerSlot"}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 01 Jul 2021 13:58:58 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":82859462,"id":1} 36 | 37 | ' 38 | recorded_at: Thu, 01 Jul 2021 13:58:58 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/request_airdrop.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"requestAirdrop","params":["BossttsdneANBePn2mJhooAewt3fo4aLg7enmpgMvdoH",10]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Thu, 01 Jul 2021 14:24:01 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":"5fNbYET4VJyEYzuD73AFXVpsxEugqdEVFLiQwEEfiq2Ew9yU44UyDkwYWcLHk4YWWTig4RymrTsKudeCmKq9QTpY","id":1} 36 | 37 | ' 38 | recorded_at: Thu, 01 Jul 2021 14:24:02 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/send_transaction.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"sendTransaction","params":["4hXTCkRzt9WyecNzV1XPgCDfGAZzQKNxLXgynz5QDuWWPSAZBZSHptvWRL3BjCvzUXRdKvHL2b7yGrRQcWyaqsaBCncVG7BFggS8w9snUts67BSh3EqKpXLUm5UMHfD7ZBe9GhARjbNQMLJ1QD3Spr6oMTBU6EhdB4RD8CP2xUxr2u3d6fos36PD98XS6oX8TQjLpsMwncs5DAMiD4nNnR8NBfyghGCWvCVifVwvA8B8TJxE1aiyiv2L429BCWfyzAme5sZW8rDb14NeCQHhZbtNqfXhcp2tAnaAT"]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Fri, 02 Jul 2021 09:35:40 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","error":{"code":-32002,"message":"Transaction simulation 36 | failed: Blockhash not found","data":{"accounts":null,"err":"BlockhashNotFound","logs":[]}},"id":1} 37 | 38 | ' 39 | recorded_at: Fri, 02 Jul 2021 09:35:41 GMT 40 | recorded_with: VCR 6.0.0 41 | -------------------------------------------------------------------------------- /spec/fixtures/vcr_cassettes/simulate_transaction.yml: -------------------------------------------------------------------------------- 1 | --- 2 | http_interactions: 3 | - request: 4 | method: post 5 | uri: https://api.testnet.solana.com/ 6 | body: 7 | encoding: UTF-8 8 | string: '{"jsonrpc":"2.0","id":1,"method":"simulateTransaction","params":["4hXTCkRzt9WyecNzV1XPgCDfGAZzQKNxLXgynz5QDuWWPSAZBZSHptvWRL3BjCvzUXRdKvHL2b7yGrRQcWyaqsaBCncVG7BFggS8w9snUts67BSh3EqKpXLUm5UMHfD7ZBe9GhARjbNQMLJ1QD3Spr6oMTBU6EhdB4RD8CP2xUxr2u3d6fos36PD98XS6oX8TQjLpsMwncs5DAMiD4nNnR8NBfyghGCWvCVifVwvA8B8TJxE1aiyiv2L429BCWfyzAme5sZW8rDb14NeCQHhZbtNqfXhcp2tAnaAT",{"accounts":{"addresses":[]}}]}' 9 | headers: 10 | Content-Type: 11 | - application/json 12 | Accept-Encoding: 13 | - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 14 | Accept: 15 | - "*/*" 16 | User-Agent: 17 | - Ruby 18 | Host: 19 | - api.testnet.solana.com 20 | response: 21 | status: 22 | code: 200 23 | message: OK 24 | headers: 25 | Content-Type: 26 | - application/json; charset=utf-8 27 | Date: 28 | - Fri, 02 Jul 2021 09:08:41 GMT 29 | Transfer-Encoding: 30 | - chunked 31 | Vary: 32 | - Accept-Encoding 33 | body: 34 | encoding: ASCII-8BIT 35 | string: '{"jsonrpc":"2.0","result":{"context":{"slot":83294564},"value":{"accounts":[],"err":"BlockhashNotFound","logs":[]}},"id":1} 36 | 37 | ' 38 | recorded_at: Fri, 02 Jul 2021 09:08:42 GMT 39 | recorded_with: VCR 6.0.0 40 | -------------------------------------------------------------------------------- /spec/lib/generators/solana_rpc_ruby/install_generator_spec.rb: -------------------------------------------------------------------------------- 1 | require 'generators/solana_rpc_ruby/install_generator' 2 | 3 | describe SolanaRpcRuby::Generators::InstallGenerator do 4 | before :all do 5 | remove_config 6 | end 7 | 8 | after :all do 9 | remove_config 10 | end 11 | 12 | it 'installs config file properly' do 13 | described_class.start 14 | expect(File.file?(config_file)).to be true 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /spec/lib/solana_rpc_ruby/api_client_spec.rb: -------------------------------------------------------------------------------- 1 | require 'vcr' 2 | 3 | describe SolanaRpcRuby::ApiClient do 4 | describe '#initialize' do 5 | let(:mainnet_cluster) { 'https://api.mainnet-beta.solana.com' } 6 | let(:testnet_cluster) { 'https://api.testnet.solana.com' } 7 | 8 | it 'uses cluster from config' do 9 | api_client = described_class.new 10 | 11 | expect(api_client.cluster).to eq(SolanaRpcRuby.cluster) 12 | expect(api_client.cluster).to eq(testnet_cluster) 13 | end 14 | 15 | it 'fails without cluster passed in or set in config' do 16 | SolanaRpcRuby.config do |c| 17 | c.cluster = nil 18 | end 19 | 20 | expect { described_class.new }.to raise_error(ArgumentError, /Cluster is missing/) 21 | 22 | SolanaRpcRuby.config do |c| 23 | c.cluster = testnet_cluster 24 | end 25 | end 26 | 27 | it 'allows to set different cluster than in config' do 28 | api_client = described_class.new(mainnet_cluster) 29 | 30 | expect(api_client.cluster).to_not eq(SolanaRpcRuby.cluster) 31 | expect(api_client.cluster).to eq('https://api.mainnet-beta.solana.com') 32 | end 33 | 34 | end 35 | 36 | describe '#call_api' do 37 | describe 'error handling' do 38 | let(:http) { double } 39 | before do 40 | allow(Net::HTTP).to receive(:start).and_yield http 41 | end 42 | 43 | describe 'Timeout::Error' do 44 | it 'raise error correctly' do 45 | allow(http).to \ 46 | receive(:request).with(an_instance_of(Net::HTTP::Post)) 47 | .and_raise(Timeout::Error, 'TimeoutError') 48 | 49 | expect do 50 | described_class.new.call_api(body: {}, http_method: :post) 51 | end.to raise_error(SolanaRpcRuby::ApiError, 'TimeoutError') 52 | end 53 | end 54 | 55 | describe 'Net::HTTPError' do 56 | it 'raise error correctly' do 57 | allow(http).to \ 58 | receive(:request).with(an_instance_of(Net::HTTP::Post)) 59 | .and_raise(Net::HTTPError.new('Net::HTTPError', 'Response')) 60 | 61 | expect do 62 | described_class.new.call_api(body: {}, http_method: :post) 63 | end.to raise_error(SolanaRpcRuby::ApiError, 'Net::HTTPError') 64 | end 65 | end 66 | 67 | describe 'Net::HTTPClientException' do 68 | it 'raise error correctly' do 69 | allow(http).to \ 70 | receive(:request).with(an_instance_of(Net::HTTP::Post)) 71 | .and_raise(Net::HTTPClientException.new('Net::HTTPClientException', 'Response')) 72 | 73 | expect do 74 | described_class.new.call_api(body: {}, http_method: :post) 75 | end.to raise_error(SolanaRpcRuby::ApiError, 'Net::HTTPClientException') 76 | end 77 | end 78 | 79 | describe 'Net::HTTPFatalError' do 80 | it 'raise error correctly' do 81 | allow(http).to \ 82 | receive(:request).with(an_instance_of(Net::HTTP::Post)) 83 | .and_raise(Net::HTTPFatalError.new('Net::HTTPFatalError', 'Response')) 84 | 85 | expect do 86 | described_class.new.call_api(body: {}, http_method: :post) 87 | end.to raise_error(SolanaRpcRuby::ApiError, 'Net::HTTPFatalError') 88 | end 89 | end 90 | 91 | describe 'Net::ReadTimeout' do 92 | it 'raise error correctly' do 93 | allow(http).to \ 94 | receive(:request).with(an_instance_of(Net::HTTP::Post)) 95 | .and_raise(Net::ReadTimeout) 96 | 97 | expect do 98 | described_class.new.call_api(body: {}, http_method: :post) 99 | end.to raise_error(SolanaRpcRuby::ApiError, 'Net::ReadTimeout') 100 | end 101 | end 102 | 103 | describe 'Errno::ECONNREFUSED' do 104 | it 'raise error correctly' do 105 | allow(http).to \ 106 | receive(:request).with(an_instance_of(Net::HTTP::Post)) 107 | .and_raise(Errno::ECONNREFUSED) 108 | 109 | expect do 110 | described_class.new.call_api(body: {}, http_method: :post) 111 | end.to raise_error( 112 | SolanaRpcRuby::ApiError, 113 | 'Connection refused. Check if the RPC url you provided is correct.' 114 | ) 115 | end 116 | end 117 | 118 | describe 'SocketError' do 119 | it 'raise error correctly' do 120 | allow(http).to \ 121 | receive(:request).with(an_instance_of(Net::HTTP::Post)) 122 | .and_raise(SocketError) 123 | 124 | expect do 125 | described_class.new.call_api(body: {}, http_method: :post) 126 | end.to raise_error( 127 | SolanaRpcRuby::ApiError, 128 | 'SocketError. Check if the RPC url you provided is correct.' 129 | ) 130 | end 131 | end 132 | 133 | describe 'StandardError' do 134 | it 'raise error correctly' do 135 | allow(http).to \ 136 | receive(:request).with(an_instance_of(Net::HTTP::Post)) 137 | .and_raise(StandardError.new('Some Standard Error')) 138 | 139 | expect do 140 | described_class.new.call_api(body: {}, http_method: :post) 141 | end.to raise_error(SolanaRpcRuby::ApiError, /Some Standard Error/) 142 | end 143 | end 144 | end 145 | end 146 | end 147 | -------------------------------------------------------------------------------- /spec/lib/solana_rpc_ruby/api_error_spec.rb: -------------------------------------------------------------------------------- 1 | describe SolanaRpcRuby::ApiError do 2 | let(:response) do 3 | { "error"=>{"code"=>-32602, "message"=>"Invalid params: invalid type: map, expected a string."} } 4 | end 5 | 6 | it 'returns correctly formatted error' do 7 | code = response['error']['code'] 8 | message = response['error']['message'] 9 | 10 | error = described_class.new( 11 | code: code, 12 | message: message 13 | ) 14 | 15 | expect(error.class).to eq(SolanaRpcRuby::ApiError) 16 | expect(error.message).to eq("Invalid params: invalid type: map, expected a string.") 17 | expect(error.code).to eq(-32602) 18 | end 19 | 20 | it 'Errno::ECONNREFUSED returns additional info' do 21 | message = 'Failed to open TCP connection to :80 (Connection refused - connect(2) for nil port 80)' 22 | error = described_class.new( 23 | error_class: Errno::ECONNREFUSED, 24 | message: message 25 | ) 26 | 27 | expect(error.class).to eq(SolanaRpcRuby::ApiError) 28 | expect(error.message).to eq(message + '. Check if the RPC url you provided is correct.') 29 | expect(error.code).to eq(nil) 30 | end 31 | 32 | it 'SocketError returns additional info' do 33 | message = 'Failed to open TCP connection to api.mainnet-beta.solanaa.com:443 (getaddrinfo: Name or service not known)' 34 | error = described_class.new( 35 | error_class: SocketError, 36 | message: message 37 | ) 38 | 39 | expect(error.class).to eq(SolanaRpcRuby::ApiError) 40 | expect(error.message).to eq(message + '. Check if the RPC url you provided is correct.') 41 | expect(error.code).to eq(nil) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /spec/lib/solana_rpc_ruby/helper_methods_spec.rb: -------------------------------------------------------------------------------- 1 | describe SolanaRpcRuby::RequestBody do 2 | include SolanaRpcRuby::HelperMethods 3 | 4 | describe '#blank?' do 5 | it 'returns correct boolean for argument' do 6 | # True 7 | expect(blank?({})).to be 8 | expect(blank?([])).to be 9 | expect(blank?('')).to be 10 | expect(blank?(nil)).to be 11 | 12 | # False 13 | expect(blank?({key: 'value'})).to be_falsey 14 | expect(blank?(['element'])).to be_falsey 15 | expect(blank?('string')).to be_falsey 16 | expect(blank?(' ')).to be_falsey 17 | end 18 | 19 | it 'raises an error when incorrect object passed in' do 20 | message = /Object must be a String, Array or Hash or Integer or nil class./ 21 | expect { blank?(true) } .to raise_error(ArgumentError, message) 22 | expect { blank?(false) } .to raise_error(ArgumentError, message) 23 | end 24 | end 25 | 26 | describe '#create_method_name' do 27 | it 'creates correct camel-cased method name' do 28 | expect(create_method_name('create_method_name')).to eq('createMethodName') 29 | end 30 | 31 | it 'returns an empty string when method argument is not provided or is different than String or Symbol' do 32 | expect(create_method_name('')).to eq('') 33 | expect(create_method_name(nil)).to eq('') 34 | expect(create_method_name(1)).to eq('') 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /spec/lib/solana_rpc_ruby/request_body_spec.rb: -------------------------------------------------------------------------------- 1 | describe SolanaRpcRuby::RequestBody do 2 | include SolanaRpcRuby::RequestBody 3 | 4 | it 'creates correct body from params' do 5 | method = 'getAccountInfo' 6 | params = [123, {'encoding': 'base58'}] 7 | id = 99 8 | 9 | json_body = create_json_body(method, method_params: params, id: id) 10 | 11 | expected_body = "{\"jsonrpc\":\"2.0\",\"id\":99,\"method\":\"getAccountInfo\",\"params\":[123,{\"encoding\":\"base58\"}]}" 12 | 13 | expect(json_body).to eq(expected_body) 14 | end 15 | 16 | it 'raises an error when id is not an integer' do 17 | id = '1' 18 | message = /id must be an integer/ 19 | expect { base_body(id: id) }.to raise_error(ArgumentError, message) 20 | end 21 | 22 | it 'returns correct base body' do 23 | id = 5 24 | 25 | expected_result = { 26 | "jsonrpc": SolanaRpcRuby.json_rpc_version, 27 | "id": id 28 | } 29 | 30 | expect(base_body(id: id)).to eq(expected_result) 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /spec/lib/solana_rpc_ruby/websocket_client_spec.rb: -------------------------------------------------------------------------------- 1 | require 'vcr' 2 | 3 | describe SolanaRpcRuby::WebsocketClient do 4 | describe '#initialize' do 5 | let(:ws_mainnet_cluster) { 'ws://api.mainnet-beta.solana.com' } 6 | let(:ws_testnet_cluster) { 'ws://api.testnet.solana.com' } 7 | 8 | it 'uses ws cluster from config' do 9 | api_client = described_class.new 10 | 11 | expect(api_client.cluster).to eq(SolanaRpcRuby.ws_cluster) 12 | end 13 | 14 | it 'fails without ws cluster passed in or set in config' do 15 | SolanaRpcRuby.config do |c| 16 | c.ws_cluster = nil 17 | end 18 | 19 | expect { described_class.new }.to raise_error(ArgumentError, /Websocket cluster is missing/) 20 | 21 | SolanaRpcRuby.config do |c| 22 | c.ws_cluster = ws_testnet_cluster 23 | end 24 | end 25 | 26 | it 'allows to set different ws cluster than in config' do 27 | api_client = described_class.new(cluster: ws_mainnet_cluster) 28 | 29 | expect(api_client.cluster).to_not eq(SolanaRpcRuby.cluster) 30 | expect(api_client.cluster).to eq(ws_mainnet_cluster) 31 | end 32 | 33 | it 'uses WebSocket::Client::Simple as a client' do 34 | api_client = described_class.new 35 | 36 | expect(api_client.client).to eq(Faye::WebSocket) 37 | end 38 | 39 | end 40 | 41 | describe '#connect' do 42 | describe 'error handling' do 43 | end 44 | end 45 | end 46 | -------------------------------------------------------------------------------- /spec/lib/solana_rpc_ruby_spec.rb: -------------------------------------------------------------------------------- 1 | describe SolanaRpcRuby do 2 | it 'is possible to provide config options' do 3 | described_class.config do |c| 4 | expect(c).to eq(described_class) 5 | end 6 | end 7 | 8 | describe 'parameters' do 9 | let(:test_cluster) { 'https://api.testnet.solana.com' } 10 | let(:test_ws_cluster) { 'ws://api.testnet.solana.com' } 11 | let(:fake_class) { class_double('SolanaRpcRuby') } 12 | 13 | it 'is possible to set cluster' do 14 | expect(fake_class).to receive(:cluster=).with(test_cluster) 15 | fake_class.cluster = test_cluster 16 | end 17 | 18 | it 'is possible to set ws_cluster' do 19 | expect(fake_class).to receive(:ws_cluster=).with(test_ws_cluster) 20 | fake_class.ws_cluster = test_ws_cluster 21 | end 22 | 23 | it 'is possible to set json_rpc_version' do 24 | expect(fake_class).to receive(:json_rpc_version=).with('2.0') 25 | fake_class.json_rpc_version = '2.0' 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'dotenv/load' 2 | require 'simplecov' 3 | require_relative '../spec/dummy/config/environment' 4 | require_relative '../lib/solana_rpc_ruby' 5 | 6 | Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each { |f| require f } 7 | 8 | ENV['RAILS_ENV'] = 'test' 9 | ENV['RAILS_ROOT'] ||= "#{File.dirname(__FILE__)}../../../spec/dummy" 10 | 11 | if ENV['CI'] == 'true' 12 | # require 'codecov' 13 | # SimpleCov.formatter = SimpleCov::Formatter::Codecov 14 | end 15 | 16 | SimpleCov.start 'rails' do 17 | add_filter 'spec/' 18 | add_filter '.github/' 19 | add_filter 'lib/generators/templates/' 20 | add_filter 'lib/solana_rpc_ruby/version' 21 | end 22 | 23 | RSpec.configure do |config| 24 | config.include FileManager 25 | end 26 | 27 | SolanaRpcRuby.config do |c| 28 | c.json_rpc_version = '2.0' 29 | c.cluster = 'https://api.testnet.solana.com' 30 | c.ws_cluster = 'ws://api.testnet.solana.com' 31 | end 32 | -------------------------------------------------------------------------------- /spec/support/file_manager.rb: -------------------------------------------------------------------------------- 1 | require 'fileutils' 2 | 3 | module FileManager 4 | def config_file 5 | "#{Rails.root}/config/initializers/solana_rpc_ruby.rb" 6 | end 7 | 8 | def add_config 9 | data = <<~DATA 10 | require 'solana_rpc_ruby' 11 | SolanaRpcRuby.config do |c| 12 | c.json_rpc_version = '2.0' 13 | c.cluster = 'https://api.testnet.solana.com' 14 | c.ws_cluster = 'ws://api.testnet.solana.com' 15 | end 16 | DATA 17 | File.open(config_file, 'w+:UTF-8') do |f| 18 | f.write data 19 | end 20 | end 21 | 22 | def remove_config 23 | FileUtils.remove_file config_file if File.file?(config_file) 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /spec/support/vcr.rb: -------------------------------------------------------------------------------- 1 | require 'vcr' 2 | VCR.configure do |c| 3 | c.cassette_library_dir = File.join(File.dirname(__FILE__), '..', 'fixtures', 'vcr_cassettes') 4 | c.hook_into :webmock 5 | # c.filter_sensitive_data('') { ENV.fetch('') } 6 | c.configure_rspec_metadata! 7 | end 8 | --------------------------------------------------------------------------------