u256
u256(
value):U256Value
Defined in: src/attr/values.ts:126
A 256-bit unsigned integer, indexed for equality and range queries. The type for token amounts and anything else that can outgrow 2⁶⁴ — reach for u64 first for counters, timestamps and block heights.
Parameters
Section titled “Parameters”A non-negative integer, as a bigint, a safe number, or a decimal or 0x hex
string.
string | number | bigint
Returns
Section titled “Returns”Throws
Section titled “Throws”If the value is negative, non-integral, or wider than 256 bits.
Example
Section titled “Example”u256(1_000_000n)u256(Date.now()) // safe integers are acceptedu256("0xf4240") // hex, as it comes back over JSON-RPC