API Conventions
Consistent API design across all modules.Naming Conventions
Constructors
| Pattern | Usage | Example |
|---|---|---|
Type(value) | Primary constructor | Address("0x...") |
Type.from(value) | Explicit variant | Address.from("0x...") |
Type.fromX(value) | From specific type | Address.fromHex("0x...") |
Converters
| Pattern | Usage | Example |
|---|---|---|
Type.toX(value) | Convert to X | Address.toHex(addr) |
Type.asX(value) | View as X (no copy) | Uint256.asBigInt(uint) |
Predicates
| Pattern | Usage | Returns |
|---|---|---|
Type.is(value) | Type guard | value is Type |
Type.isValid(value) | Validation | boolean |
Type.isX(value) | Specific check | boolean |
Comparisons
| Pattern | Usage |
|---|---|
Type.equals(a, b) | Equality check |
Type.compare(a, b) | Ordering (-1, 0, 1) |
Type.lt(a, b) | Less than |
Type.gt(a, b) | Greater than |

