Albatross Policy

Constants and utility functions for blockchain configuration, supply, and block calculations.

Usage

Basic usage

typescript
import { batchIndexAt, epochIndexAt, SLOTS_PER_EPOCH } from '@nimiq/utils/albatross-policy'

const currentEpoch = epochIndexAt(blockNumber)
const batch = batchIndexAt(blockNumber)
console.log(`Block ${blockNumber} is in epoch ${currentEpoch}, batch ${batch}`)

API

MethodDescription
epochIndexAt(blockNumber)Returns epoch index for given block number
batchIndexAt(blockNumber)Returns batch index for given block number
SLOTS_PER_EPOCHNumber of slots in each epoch
BATCHES_PER_EPOCHNumber of batches in each epoch
BLOCKS_PER_BATCHNumber of blocks in each batch
TOTAL_SUPPLYTotal supply in smallest units
Built with the Nimiq Vitepress Theme
Copy page
Create issue