Sha256: cbd32df1fe9dc0389f96605bd0a9b8e72534952f43080253e1c741f29528162b

Contents?: true

Size: 925 Bytes

Versions: 12

Compression:

Stored size: 925 Bytes

Contents

# frozen_string_literal: true

module SolanaRuby
  module HttpMethods
    # Blockhash Related HTTP Methods
    module BlockhashMethods
      def get_latest_blockhash
        recent_blockhash_info = get_latest_blockhash_and_context
        recent_blockhash_info["value"]
      end

      def get_latest_blockhash_and_context
        recent_blockhash_info = request("getLatestBlockhash")
        recent_blockhash_info["result"]
      end

      def get_fee_for_message(blockhash, options = { commitment: "processed" })
        params = [blockhash, options]
        fee_for_blockhash_info = request("getFeeForMessage", params)
        fee_for_blockhash_info["result"]
      end

      def is_blockhash_valid?(blockhash, options = { commitment: "processed" })
        params = [blockhash, options]
        blockhash_info = request("isBlockhashValid", params)
        blockhash_info["result"]["value"]
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
solana-ruby-web3js-2.0.2 lib/solana_ruby/http_methods/blockhash_methods.rb
solana-ruby-web3js-2.0.1 lib/solana_ruby/http_methods/blockhash_methods.rb
solana-ruby-web3js-2.0.0beta2 lib/solana_ruby/http_methods/blockhash_methods.rb
solana-ruby-web3js-2.0.0beta1 lib/solana_ruby/http_methods/blockhash_methods.rb
solana-ruby-web3js-2.0.0 lib/solana_ruby/http_methods/blockhash_methods.rb
solana-ruby-web3js-1.0.1.beta4 lib/solana_ruby/http_methods/blockhash_methods.rb
solana-ruby-web3js-1.0.1.beta3 lib/solana_ruby/http_methods/blockhash_methods.rb
solana-ruby-web3js-1.0.1.beta2 lib/solana_ruby/http_methods/blockhash_methods.rb
solana-ruby-web3js-1.0.1.beta1 lib/solana_ruby/http_methods/blockhash_methods.rb
solana-ruby-web3js-1.0.0.beta lib/solana_ruby/http_methods/blockhash_methods.rb
solana-ruby-web3js-1.0.1 lib/solana_ruby/http_methods/blockhash_methods.rb
solana-ruby-web3js-1.0.0 lib/solana_ruby/http_methods/blockhash_methods.rb