Skip to main content

Module present

Module present 

Source
Expand description

A RuntimeValue as a host language shows it, decided once for every binding: each one (the console, Node, other languages) turns a Presented into its own values mechanically, so a value reads the same in all of them.

The shape follows the declared type, not the magnitude: a Uint whose bound fits a JS number is always a number, a wider one and a Counter always a big integer, so code reading a value sees one type for it whatever it holds. A circuit returning [] answers Presented::Undefined.

Structs§

ShapeError
A value that is not the shape its declared type says.

Enums§

Presented
A value as a host shows it.

Constants§

MAX_SAFE_INTEGER
The largest integer a JS number (an IEEE double) holds exactly.

Functions§

plain
value with no declared type: integers by magnitude.
stored
A ledger field’s value shaped by its declared storage: a Map an object keyed by each key’s string form, a Set or a List an array, a Merkle tree its root and height.
to_presented
value as a host shows it, for any result a binding hands out: fields in declaration order, an Option absent as null, bytes as bytes, an integer up to 64 bits by magnitude, and a 128-bit one (every amount) always a big integer.
typed
value shaped by the type it was declared with.