Skip to content

feat: implement getEpochInfo standard RPC method #28

Description

@gamandeepsingh

Noticed getEpochInfo isn't implemented yet; it's a pretty common method (wallets/explorers call it a lot to show epoch progress), so figured it's worth adding.

Good news is most of the data is already there. absoluteSlot, blockHeight and transactionCount are already handled by getSlot, getBlockHeight and getTransactionCount, and the rest (epoch, slotIndex, slotsInEpoch) is just simple math off DEFAULT_SLOTS_PER_EPOCH: which the codebase already uses in getInflationReward.

@notwedtm before I start a PR, is this something you'd want? And are you ok with me assuming the default epoch schedule (no warmup) like the existing code does?

Happy to send a PR if you're good with it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions