Skip to main content
@tevm/voltaire
@tevm/voltaire / primitives/Uint128

primitives/Uint128

Type Aliases

Uint128Type

Uint128Type = bigint & object
Defined in: src/primitives/Uint128/Uint128Type.ts:9 Uint128 type

Type Declaration

[brand]
readonly [brand]: "Uint128"

See

https://voltaire.tevm.sh/primitives/uint128 for Uint128 documentation

Since

0.0.0

Variables

bitLength()

const bitLength: (uint) => number = _bitLength
Defined in: src/primitives/Uint128/index.ts:120

Parameters

uint
Uint128Type

Returns

number

bitwiseAnd()

const bitwiseAnd: (uint, b) => Uint128Type = _bitwiseAnd
Defined in: src/primitives/Uint128/index.ts:88

Parameters

uint
Uint128Type
b
Uint128Type

Returns

Uint128Type

bitwiseNot()

const bitwiseNot: (uint) => Uint128Type = _bitwiseNot
Defined in: src/primitives/Uint128/index.ts:94

Parameters

uint
Uint128Type

Returns

Uint128Type

bitwiseOr()

const bitwiseOr: (uint, b) => Uint128Type = _bitwiseOr
Defined in: src/primitives/Uint128/index.ts:90

Parameters

uint
Uint128Type
b
Uint128Type

Returns

Uint128Type

bitwiseXor()

const bitwiseXor: (uint, b) => Uint128Type = _bitwiseXor
Defined in: src/primitives/Uint128/index.ts:92

Parameters

uint
Uint128Type
b
Uint128Type

Returns

Uint128Type

BrandedUint128

const BrandedUint128: object
Defined in: src/primitives/Uint128/index.ts:134

Type Declaration

bitLength()
bitLength: (uint) => number
Parameters
uint
Uint128Type
Returns
number
bitwiseAnd()
bitwiseAnd: (uint, b) => Uint128Type
Parameters
uint
Uint128Type
b
Uint128Type
Returns
Uint128Type
bitwiseNot()
bitwiseNot: (uint) => Uint128Type
Parameters
uint
Uint128Type
Returns
Uint128Type
bitwiseOr()
bitwiseOr: (uint, b) => Uint128Type
Parameters
uint
Uint128Type
b
Uint128Type
Returns
Uint128Type
bitwiseXor()
bitwiseXor: (uint, b) => Uint128Type
Parameters
uint
Uint128Type
b
Uint128Type
Returns
Uint128Type
clone()
clone: (uint) => Uint128Type
Parameters
uint
Uint128Type
Returns
Uint128Type
dividedBy()
dividedBy: (uint, b) => Uint128Type
Parameters
uint
Uint128Type
b
Uint128Type
Returns
Uint128Type
equals()
equals: (uint, b) => boolean
Parameters
uint
Uint128Type
b
Uint128Type
Returns
boolean
from()
from: (value) => Uint128Type
Parameters
value
string | number | bigint
Returns
Uint128Type
fromAbiEncoded()
fromAbiEncoded: (bytes) => Uint128Type
Parameters
bytes
Uint8Array
Returns
Uint128Type
fromBigInt()
fromBigInt: (value) => Uint128Type
Parameters
value
bigint
Returns
Uint128Type
fromBytes()
fromBytes: (bytes) => Uint128Type
Parameters
bytes
Uint8Array
Returns
Uint128Type
fromHex()
fromHex: (hex) => Uint128Type
Parameters
hex
string
Returns
Uint128Type
fromNumber()
fromNumber: (value) => Uint128Type
Parameters
value
number
Returns
Uint128Type
gcd()
gcd: (a, b) => Uint128Type
Parameters
a
Uint128Type
b
Uint128Type
Returns
Uint128Type
greaterThan()
greaterThan: (uint, b) => boolean
Parameters
uint
Uint128Type
b
Uint128Type
Returns
boolean
greaterThanOrEqual()
greaterThanOrEqual: (uint, b) => boolean
Parameters
uint
Uint128Type
b
Uint128Type
Returns
boolean
isPowerOf2()
isPowerOf2: (uint) => boolean
Parameters
uint
Uint128Type
Returns
boolean
isValid()
isValid: (value) => boolean
Parameters
value
string | number | bigint
Returns
boolean
isZero()
isZero: (uint) => boolean
Parameters
uint
Uint128Type
Returns
boolean
lcm()
lcm: (a, b) => Uint128Type
Parameters
a
Uint128Type
b
Uint128Type
Returns
Uint128Type
leadingZeros()
leadingZeros: (uint) => number
Parameters
uint
Uint128Type
Returns
number
lessThan()
lessThan: (uint, b) => boolean
Parameters
uint
Uint128Type
b
Uint128Type
Returns
boolean
lessThanOrEqual()
lessThanOrEqual: (uint, b) => boolean
Parameters
uint
Uint128Type
b
Uint128Type
Returns
boolean
max()
max: (values) => Uint128Type
Parameters
values
Uint128Type[]
Returns
Uint128Type
MAX
MAX: Uint128Type
Maximum Uint128 value: 2^128 - 1
See
https://voltaire.tevm.sh/primitives/uint128 for Uint128 documentation
Since
0.0.0
Example
import { MAX } from './primitives/Uint128/index.js';
console.log(MAX); // 340282366920938463463374607431768211455n
maximum()
maximum: (uint, b) => Uint128Type
Parameters
uint
Uint128Type
b
Uint128Type
Returns
Uint128Type
min()
min: (values) => Uint128Type
Parameters
values
Uint128Type[]
Returns
Uint128Type
MIN
MIN: Uint128Type
Minimum Uint128 value: 0
See
https://voltaire.tevm.sh/primitives/uint128 for Uint128 documentation
Since
0.0.0
Example
import { MIN } from './primitives/Uint128/index.js';
console.log(MIN); // 0n
minimum()
minimum: (uint, b) => Uint128Type
Parameters
uint
Uint128Type
b
Uint128Type
Returns
Uint128Type
minus()
minus: (uint, b) => Uint128Type
Parameters
uint
Uint128Type
b
Uint128Type
Returns
Uint128Type
modulo()
modulo: (uint, b) => Uint128Type
Parameters
uint
Uint128Type
b
Uint128Type
Returns
Uint128Type
notEquals()
notEquals: (uint, b) => boolean
Parameters
uint
Uint128Type
b
Uint128Type
Returns
boolean
ONE
ONE: Uint128Type
One value
See
https://voltaire.tevm.sh/primitives/uint128 for Uint128 documentation
Since
0.0.0
Example
import { ONE } from './primitives/Uint128/index.js';
console.log(ONE); // 1n
plus()
plus: (uint, b) => Uint128Type
Parameters
uint
Uint128Type
b
Uint128Type
Returns
Uint128Type
popCount()
popCount: (uint) => number
Parameters
uint
Uint128Type
Returns
number
product()
product: (values) => Uint128Type
Parameters
values
Uint128Type[]
Returns
Uint128Type
shiftLeft()
shiftLeft: (uint, bits) => Uint128Type
Parameters
uint
Uint128Type
bits
number
Returns
Uint128Type
shiftRight()
shiftRight: (uint, bits) => Uint128Type
Parameters
uint
Uint128Type
bits
number
Returns
Uint128Type
SIZE
SIZE: 16
Size in bytes (16 bytes for Uint128)
See
https://voltaire.tevm.sh/primitives/uint128 for Uint128 documentation
Since
0.0.0
Example
import { SIZE } from './primitives/Uint128/index.js';
console.log(SIZE); // 16
sum()
sum: (values) => Uint128Type
Parameters
values
Uint128Type[]
Returns
Uint128Type
times()
times: (uint, b) => Uint128Type
Parameters
uint
Uint128Type
b
Uint128Type
Returns
Uint128Type
toAbiEncoded()
toAbiEncoded: (uint) => Uint8Array
Parameters
uint
Uint128Type
Returns
Uint8Array
toBigInt()
toBigInt: (uint) => bigint
Parameters
uint
Uint128Type
Returns
bigint
toBytes()
toBytes: (uint) => Uint8Array
Parameters
uint
Uint128Type
Returns
Uint8Array
toHex()
toHex: (uint) => string
Parameters
uint
Uint128Type
Returns
string
toNumber()
toNumber: (uint) => number
Parameters
uint
Uint128Type
Returns
number
toPower()
toPower: (uint, exponent) => Uint128Type
Parameters
uint
Uint128Type
exponent
Uint128Type
Returns
Uint128Type
toString()
toString: (uint, radix?) => string
Parameters
uint
Uint128Type
radix?
number
Returns
string
tryFrom()
tryFrom: (value) => Uint128Type | null
Parameters
value
string | number | bigint
Returns
Uint128Type | null
ZERO
ZERO: Uint128Type
Zero value
See
https://voltaire.tevm.sh/primitives/uint128 for Uint128 documentation
Since
0.0.0
Example
import { ZERO } from './primitives/Uint128/index.js';
console.log(ZERO); // 0n

clone()

const clone: (uint) => Uint128Type = _clone
Defined in: src/primitives/Uint128/index.ts:74

Parameters

uint
Uint128Type

Returns

Uint128Type

dividedBy()

const dividedBy: (uint, b) => Uint128Type = _dividedBy
Defined in: src/primitives/Uint128/index.ts:79

Parameters

uint
Uint128Type
b
Uint128Type

Returns

Uint128Type

equals()

const equals: (uint, b) => boolean = _equals
Defined in: src/primitives/Uint128/index.ts:100

Parameters

uint
Uint128Type
b
Uint128Type

Returns

boolean

from()

const from: (value) => Uint128Type = _from
Defined in: src/primitives/Uint128/index.ts:54

Parameters

value
bigint | number | string

Returns

Uint128Type

fromAbiEncoded()

const fromAbiEncoded: (bytes) => Uint128Type = _fromAbiEncoded
Defined in: src/primitives/Uint128/index.ts:59

Parameters

bytes
Uint8Array

Returns

Uint128Type

fromBigInt()

const fromBigInt: (value) => Uint128Type = _fromBigInt
Defined in: src/primitives/Uint128/index.ts:56

Parameters

value
bigint

Returns

Uint128Type

fromBytes()

const fromBytes: (bytes) => Uint128Type = _fromBytes
Defined in: src/primitives/Uint128/index.ts:58

Parameters

bytes
Uint8Array

Returns

Uint128Type

fromHex()

const fromHex: (hex) => Uint128Type = _fromHex
Defined in: src/primitives/Uint128/index.ts:55

Parameters

hex
string

Returns

Uint128Type

fromNumber()

const fromNumber: (value) => Uint128Type = _fromNumber
Defined in: src/primitives/Uint128/index.ts:57

Parameters

value
number

Returns

Uint128Type

gcd()

const gcd: (a, b) => Uint128Type = _gcd
Defined in: src/primitives/Uint128/index.ts:129

Parameters

a
Uint128Type
b
Uint128Type

Returns

Uint128Type

greaterThan()

const greaterThan: (uint, b) => boolean = _greaterThan
Defined in: src/primitives/Uint128/index.ts:107

Parameters

uint
Uint128Type
b
Uint128Type

Returns

boolean

greaterThanOrEqual()

const greaterThanOrEqual: (uint, b) => boolean = _greaterThanOrEqual
Defined in: src/primitives/Uint128/index.ts:109

Parameters

uint
Uint128Type
b
Uint128Type

Returns

boolean

isPowerOf2()

const isPowerOf2: (uint) => boolean = _isPowerOf2
Defined in: src/primitives/Uint128/index.ts:131

Parameters

uint
Uint128Type

Returns

boolean

isValid()

const isValid: (value) => boolean = _isValid
Defined in: src/primitives/Uint128/index.ts:63

Parameters

value
bigint | number | string

Returns

boolean

isZero()

const isZero: (uint) => boolean = _isZero
Defined in: src/primitives/Uint128/index.ts:113

Parameters

uint
Uint128Type

Returns

boolean

lcm()

const lcm: (a, b) => Uint128Type = _lcm
Defined in: src/primitives/Uint128/index.ts:130

Parameters

a
Uint128Type
b
Uint128Type

Returns

Uint128Type

leadingZeros()

const leadingZeros: (uint) => number = _leadingZeros
Defined in: src/primitives/Uint128/index.ts:121

Parameters

uint
Uint128Type

Returns

number

lessThan()

const lessThan: (uint, b) => boolean = _lessThan
Defined in: src/primitives/Uint128/index.ts:103

Parameters

uint
Uint128Type
b
Uint128Type

Returns

boolean

lessThanOrEqual()

const lessThanOrEqual: (uint, b) => boolean = _lessThanOrEqual
Defined in: src/primitives/Uint128/index.ts:105

Parameters

uint
Uint128Type
b
Uint128Type

Returns

boolean

max()

const max: (values) => Uint128Type = _max
Defined in: src/primitives/Uint128/index.ts:127

Parameters

values
Uint128Type[]

Returns

Uint128Type

MAX

const MAX: Uint128Type
Defined in: src/primitives/Uint128/constants.js:34 Maximum Uint128 value: 2^128 - 1

See

https://voltaire.tevm.sh/primitives/uint128 for Uint128 documentation

Since

0.0.0

Example

import { MAX } from './primitives/Uint128/index.js';
console.log(MAX); // 340282366920938463463374607431768211455n

maximum()

const maximum: (uint, b) => Uint128Type = _maximum
Defined in: src/primitives/Uint128/index.ts:117

Parameters

uint
Uint128Type
b
Uint128Type

Returns

Uint128Type

min()

const min: (values) => Uint128Type = _min
Defined in: src/primitives/Uint128/index.ts:126

Parameters

values
Uint128Type[]

Returns

Uint128Type

MIN

const MIN: Uint128Type
Defined in: src/primitives/Uint128/constants.js:50 Minimum Uint128 value: 0

See

https://voltaire.tevm.sh/primitives/uint128 for Uint128 documentation

Since

0.0.0

Example

import { MIN } from './primitives/Uint128/index.js';
console.log(MIN); // 0n

minimum()

const minimum: (uint, b) => Uint128Type = _minimum
Defined in: src/primitives/Uint128/index.ts:115

Parameters

uint
Uint128Type
b
Uint128Type

Returns

Uint128Type

minus()

const minus: (uint, b) => Uint128Type = _minus
Defined in: src/primitives/Uint128/index.ts:77

Parameters

uint
Uint128Type
b
Uint128Type

Returns

Uint128Type

modulo()

const modulo: (uint, b) => Uint128Type = _modulo
Defined in: src/primitives/Uint128/index.ts:81

Parameters

uint
Uint128Type
b
Uint128Type

Returns

Uint128Type

notEquals()

const notEquals: (uint, b) => boolean = _notEquals
Defined in: src/primitives/Uint128/index.ts:101

Parameters

uint
Uint128Type
b
Uint128Type

Returns

boolean

ONE

const ONE: Uint128Type
Defined in: src/primitives/Uint128/constants.js:78 One value

See

https://voltaire.tevm.sh/primitives/uint128 for Uint128 documentation

Since

0.0.0

Example

import { ONE } from './primitives/Uint128/index.js';
console.log(ONE); // 1n

plus()

const plus: (uint, b) => Uint128Type = _plus
Defined in: src/primitives/Uint128/index.ts:76

Parameters

uint
Uint128Type
b
Uint128Type

Returns

Uint128Type

popCount()

const popCount: (uint) => number = _popCount
Defined in: src/primitives/Uint128/index.ts:122

Parameters

uint
Uint128Type

Returns

number

product()

const product: (values) => Uint128Type = _product
Defined in: src/primitives/Uint128/index.ts:125

Parameters

values
Uint128Type[]

Returns

Uint128Type

shiftLeft()

const shiftLeft: (uint, bits) => Uint128Type = _shiftLeft
Defined in: src/primitives/Uint128/index.ts:95

Parameters

uint
Uint128Type
bits
number

Returns

Uint128Type

shiftRight()

const shiftRight: (uint, bits) => Uint128Type = _shiftRight
Defined in: src/primitives/Uint128/index.ts:97

Parameters

uint
Uint128Type
bits
number

Returns

Uint128Type

SIZE

const SIZE: 16 = 16
Defined in: src/primitives/Uint128/constants.js:20 Size in bytes (16 bytes for Uint128)

See

https://voltaire.tevm.sh/primitives/uint128 for Uint128 documentation

Since

0.0.0

Example

import { SIZE } from './primitives/Uint128/index.js';
console.log(SIZE); // 16

sum()

const sum: (values) => Uint128Type = _sum
Defined in: src/primitives/Uint128/index.ts:124

Parameters

values
Uint128Type[]

Returns

Uint128Type

times()

const times: (uint, b) => Uint128Type = _times
Defined in: src/primitives/Uint128/index.ts:78

Parameters

uint
Uint128Type
b
Uint128Type

Returns

Uint128Type

toAbiEncoded()

const toAbiEncoded: (uint) => Uint8Array = _toAbiEncoded
Defined in: src/primitives/Uint128/index.ts:69

Parameters

uint
Uint128Type

Returns

Uint8Array

toBigInt()

const toBigInt: (uint) => bigint = _toBigInt
Defined in: src/primitives/Uint128/index.ts:66

Parameters

uint
Uint128Type

Returns

bigint

toBytes()

const toBytes: (uint) => Uint8Array = _toBytes
Defined in: src/primitives/Uint128/index.ts:68

Parameters

uint
Uint128Type

Returns

Uint8Array

toHex()

const toHex: (uint) => string = _toHex
Defined in: src/primitives/Uint128/index.ts:65

Parameters

uint
Uint128Type

Returns

string

toNumber()

const toNumber: (uint) => number = _toNumber
Defined in: src/primitives/Uint128/index.ts:67

Parameters

uint
Uint128Type

Returns

number

toPower()

const toPower: (uint, exponent) => Uint128Type = _toPower
Defined in: src/primitives/Uint128/index.ts:83

Parameters

uint
Uint128Type
exponent
Uint128Type

Returns

Uint128Type

toString()

const toString: (uint, radix?) => string = _toString
Defined in: src/primitives/Uint128/index.ts:71

Parameters

uint
Uint128Type
radix?
number

Returns

string

tryFrom()

const tryFrom: (value) => Uint128Type | null = _tryFrom
Defined in: src/primitives/Uint128/index.ts:61

Parameters

value
bigint | number | string

Returns

Uint128Type | null

ZERO

const ZERO: Uint128Type
Defined in: src/primitives/Uint128/constants.js:64 Zero value

See

https://voltaire.tevm.sh/primitives/uint128 for Uint128 documentation

Since

0.0.0

Example

import { ZERO } from './primitives/Uint128/index.js';
console.log(ZERO); // 0n