Skip to main content
Version: Next

Namespace: num

Type Aliases

BigNumberish

Ƭ BigNumberish: string | number | bigint

Defined in

src/utils/num.ts:6

Functions

isHex

isHex(hex): boolean

Parameters

NameType
hexstring

Returns

boolean

Defined in

src/utils/num.ts:8


toBigInt

toBigInt(value): bigint

Parameters

NameType
valueBigNumberish

Returns

bigint

Defined in

src/utils/num.ts:12


isBigInt

isBigInt(value): value is bigint

Parameters

NameType
valueany

Returns

value is bigint

Defined in

src/utils/num.ts:16


toHex

toHex(number): string

Parameters

NameType
numberBigNumberish

Returns

string

Defined in

src/utils/num.ts:20


hexToDecimalString

hexToDecimalString(hex): string

Parameters

NameType
hexstring

Returns

string

Defined in

src/utils/num.ts:24


assertInRange

assertInRange(input, lowerBound, upperBound, inputName?): void

Parameters

NameTypeDefault value
inputBigNumberishundefined
lowerBoundBigNumberishundefined
upperBoundBigNumberishundefined
inputNamestring''

Returns

void

Defined in

src/utils/num.ts:40


bigNumberishArrayToDecimalStringArray

bigNumberishArrayToDecimalStringArray(rawCalldata): string[]

Parameters

NameType
rawCalldataBigNumberish[]

Returns

string[]

Defined in

src/utils/num.ts:57


bigNumberishArrayToHexadecimalStringArray

bigNumberishArrayToHexadecimalStringArray(rawCalldata): string[]

Parameters

NameType
rawCalldataBigNumberish[]

Returns

string[]

Defined in

src/utils/num.ts:61


getDecimalString

getDecimalString(value): string

Parameters

NameType
valuestring

Returns

string

Defined in

src/utils/num.ts:68


getHexString

getHexString(value): string

Parameters

NameType
valuestring

Returns

string

Defined in

src/utils/num.ts:78


getHexStringArray

getHexStringArray(value): string[]

Parameters

NameType
valuestring[]

Returns

string[]

Defined in

src/utils/num.ts:88


hexToBytes

hexToBytes(value): Uint8Array

Convert a hex string to an array of Bytes (Uint8Array)

Parameters

NameTypeDescription
valuestringhex string

Returns

Uint8Array

an array of Bytes

Defined in

src/utils/num.ts:99


cleanHex

cleanHex(hex): string

Remove hex string leading zero and lower case '0x01A'.. -> '0x1a..'

Parameters

NameTypeDescription
hexstringstring

Returns

string

Defined in

src/utils/num.ts:32


isStringWholeNumber

isStringWholeNumber(value): boolean

Parameters

NameType
valuestring

Returns

boolean

Defined in

src/utils/num.ts:65


toHexString

toHexString(value): string

Parameters

NameType
valuestring

Returns

string

Defined in

src/utils/num.ts:66


toCairoBool

toCairoBool(value): string

Parameters

NameType
valueboolean

Returns

string

Defined in

src/utils/num.ts:92