Skip to content

Braga has been retired. The next public testnet is coming in September 2026. Read the announcement →

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.

number

bigint

If the duration is not a positive whole number of blocks’ seconds.