Skip to main content

Try it Live

Run Uint examples in the interactive playground
New to unsigned integers? Start with Fundamentals for guided examples and concepts.

Type Definition

Branded bigint representing unsigned 256-bit integer (0 to 2^256-1). Supports tree-shakeable namespace methods and class instances with automatic wrapping on overflow.

Quick Reference

Effect Schema

API Methods

Constructors

Conversions

Arithmetic

Bitwise

Comparisons

Validation

Utilities

Types

Source: UintConstructor.ts:68-114

Constants

Uint module exports constants for validation and arithmetic:
Available constants:
  • Uint.MAX = 2^256 - 1 - Maximum Uint256 value (115792089237316195423570985008687907853269984665640564039457584007913129639935n)
  • Uint.MIN = 0 - Minimum Uint256 value
  • Uint.ZERO = 0 - Zero constant
  • Uint.ONE = 1 - One constant
  • Uint.SIZE = 32 - Size in bytes
Source: constants.ts

Wrapping Arithmetic

All arithmetic wraps on overflow (mod 2^256), matching EVM behavior:
See Fundamentals for overflow examples and Arithmetic for detailed operations.

Tree-Shaking

Import only what you need for optimal bundle size:

Specification