toBlocks
toBlocks(
seconds):bigint
Defined in: src/entity/expiry.ts:149
A duration in seconds as a whole number of blocks.
Arkiv counts lifetimes in blocks, so a duration that is not a whole number of them does not
describe anything the chain can store. Rather than silently round a caller’s 3 up to two blocks
— four seconds, not what they asked for — this rejects it: a duration must be a positive multiple
of BLOCK_TIME (2 seconds). The ExpirationTime helpers all produce such multiples.
Parameters
Section titled “Parameters”seconds
Section titled “seconds”number
Returns
Section titled “Returns”bigint
Throws
Section titled “Throws”If the duration is not a positive whole number of blocks’ seconds.