nearfundocs
The NearFun handbook
SPECIFICATION · 14

Amount System

NearFun master specification

All raw financial quantities must use:

bigint

Never use JavaScript floating point for raw token values.

Centralize:

parseTokenAmount()
formatTokenAmount()
toRawAmount()
fromRawAmount()

Decimals must come from authoritative mint/protocol data.

Never spread:

  • 1e9

or:

/ 1e6

throughout the codebase.

NearFun documentation