Module: Solana::Ruby::Kit::Rpc::Api::GetEpochSchedule

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

Overview

Returns the epoch schedule from the cluster’s genesis config. Mirrors TypeScript’s GetEpochScheduleApi.getEpochSchedule.

Instance Method Summary collapse

Instance Method Details

#get_epoch_scheduleObject



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/solana/ruby/kit/rpc/api/get_epoch_schedule.rb', line 26

def get_epoch_schedule
  raw = transport.request('getEpochSchedule', [])

  EpochSchedule.new(
    first_normal_epoch:           Kernel.Integer(raw['firstNormalEpoch']),
    first_normal_slot:            Kernel.Integer(raw['firstNormalSlot']),
    leader_schedule_slot_offset:  Kernel.Integer(raw['leaderScheduleSlotOffset']),
    slots_per_epoch:              Kernel.Integer(raw['slotsPerEpoch']),
    warmup:                       raw['warmup'] == true
  )
end