Thrown by Demos.transfer (and friends) when a caller passes an OS amount with sub-DEM precision against a node that has not yet activated the osDenomination fork. The pre-fork wire shape is a JS number in DEM, which cannot represent sub-DEM precision; sending the transaction would silently truncate the user's funds. This guard fails fast at the public-API boundary before any signing happens.

try {
await demos.transfer(to, 1_234_567n) // sub-DEM precision
} catch (err) {
if (err instanceof SubDemPrecisionError) {
// tell the user to round, or to upgrade the node
}
}

Hierarchy

  • Error
    • SubDemPrecisionError

Constructors

Properties

Constructors

Properties

amountOs: bigint

Full OS amount the caller attempted to send.

subDemRemainderOs: bigint

Truncated remainder: amountOs % OS_PER_DEM.