GetLeaderScheduleApi

type GetLeaderScheduleApi = object;

Methods

getLeaderSchedule()

Call Signature

getLeaderSchedule<TIdentity>(slot, config):
  | Readonly<{ [TAddress in Address]?: bigint[] }>
  | null;

Fetch the leader schedule of a particular validator.

Type Parameters
Type Parameter
TIdentity extends Address
Parameters
ParameterTypeDescription
slotbigintA slot that will be used to select the epoch for which to return the leader schedule.
configReadonly<{ commitment?: Commitment; keyByVoteAccount?: boolean; }> & Readonly<{ identity: Address; }>-
Returns

| Readonly<{ [TAddress in Address]?: bigint[] }> | null

A dictionary keyed by the specified validator identity, or its vote account address when keyByVoteAccount is true, with corresponding leader slot indices relative to the first slot in the requested epoch, or null if there is no epoch that corresponds to the given slot.

Throws

A SolanaError with code SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LEADER_SCHEDULE_IDENTITY_NOT_FOUND when the identity is not in the leader schedule, on servers running Agave v4.4.0 or later. Older servers respond with an empty object instead.

See

https://solana.com/docs/rpc/http/getleaderschedule

Call Signature

getLeaderSchedule(slot, config?): GetLeaderScheduleApiResponseWithAllIdentities | null;

Fetch the leader schedule for all validators.

Parameters
ParameterTypeDescription
slotbigintA slot that will be used to select the epoch for which to return the leader schedule.
config?Readonly<{ commitment?: Commitment; keyByVoteAccount?: boolean; }>-
Returns

GetLeaderScheduleApiResponseWithAllIdentities | null

A dictionary of validator identities, or vote account addresses when keyByVoteAccount is true, with corresponding leader slot indices relative to the first slot in the requested epoch, or null if there is no epoch that corresponds to the given slot.

See

https://solana.com/docs/rpc/http/getleaderschedule

Call Signature

getLeaderSchedule<TIdentity>(slot, config): GetLeaderScheduleApiResponseWithSingleIdentity<TIdentity>;

Fetch the leader schedule of a particular validator.

Type Parameters
Type Parameter
TIdentity extends Address
Parameters
ParameterTypeDescription
slotnullWhen null, orders the leader schedule for the current epoch.
configReadonly<{ commitment?: Commitment; keyByVoteAccount?: boolean; }> & Readonly<{ identity: Address; }>-
Returns

GetLeaderScheduleApiResponseWithSingleIdentity<TIdentity>

A dictionary keyed by the specified validator identity, or its vote account address when keyByVoteAccount is true, with corresponding leader slot indices relative to the first slot in the current epoch.

Throws

A SolanaError with code SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LEADER_SCHEDULE_IDENTITY_NOT_FOUND when the identity is not in the leader schedule, on servers running Agave v4.4.0 or later. Older servers respond with an empty object instead.

See

https://solana.com/docs/rpc/http/getleaderschedule

Call Signature

getLeaderSchedule(slot?, config?): GetLeaderScheduleApiResponseWithAllIdentities;

Fetch the leader schedule of all validators.

Parameters
ParameterTypeDescription
slot?nullWhen null, orders the leader schedule for the current epoch.
config?Readonly<{ commitment?: Commitment; keyByVoteAccount?: boolean; }>-
Returns

GetLeaderScheduleApiResponseWithAllIdentities

A dictionary of validator identities, or vote account addresses when keyByVoteAccount is true, with corresponding leader slot indices relative to the first slot in the current epoch.

See

https://solana.com/docs/rpc/http/getleaderschedule

On this page