Module: Solana::Ruby::Kit::Rpc::Api::GetBlockTime

Extended by:
T::Sig
Included in:
Client
Defined in:
lib/solana/ruby/kit/rpc/api/get_block_time.rb

Overview

Returns the estimated production time of a block. Mirrors TypeScript’s GetBlockTimeApi.getBlockTime.

Instance Method Summary collapse

Instance Method Details

#get_block_time(slot) ⇒ Object



13
14
15
16
# File 'lib/solana/ruby/kit/rpc/api/get_block_time.rb', line 13

def get_block_time(slot)
  raw = transport.request('getBlockTime', [slot])
  raw.nil? ? nil : Kernel.Integer(raw)
end