Skip to content

epochsToDays

epochsToDays(epochs): bigint

Defined in: packages/synapse-core/src/utils/epoch.ts:106

Convert a number of epochs to whole days (floor division).

Each Filecoin epoch is 30 seconds, so 2880 epochs = 1 day.

Passes maxUint256 through unchanged so callers can use it as an “infinite” sentinel (e.g. resolveAccountState().runwayInEpochs when lockupRate is 0n).

ParameterTypeDescription
epochsbigintThe number of epochs to convert

bigint

The number of whole days

import { epochsToDays } from '@filoz/synapse-core/utils'
epochsToDays(2880n) // 1n
epochsToDays(8640n) // 3n