Module: SolanaRuby::HttpMethods::BlockhashMethods

Defined in:
lib/solana_ruby/http_methods/blockhash_methods.rb

Overview

Blockhash Related HTTP Methods

Instance Method Summary collapse

Instance Method Details

#get_fee_for_message(blockhash, options = { commitment: "processed" }) ⇒ Object



17
18
19
20
21
# File 'lib/solana_ruby/http_methods/blockhash_methods.rb', line 17

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

#get_latest_blockhashObject



7
8
9
10
# File 'lib/solana_ruby/http_methods/blockhash_methods.rb', line 7

def get_latest_blockhash
  recent_blockhash_info = get_latest_blockhash_and_context
  recent_blockhash_info["value"]
end

#get_latest_blockhash_and_contextObject



12
13
14
15
# File 'lib/solana_ruby/http_methods/blockhash_methods.rb', line 12

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

#is_blockhash_valid?(blockhash, options = { commitment: "processed" }) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
26
27
# File 'lib/solana_ruby/http_methods/blockhash_methods.rb', line 23

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