utils
Index
Functions
abiSchemaToJsonSchema
Parameters
abis: ShortValidationSchema | FullValidationSchema
level: string = '/0'
Returns Schema
codePointToInt
Parameters
codePoint: number
Returns number
ensureIfUint8Array
Type parameters
- T = any
Parameters
data: T
Returns Uint8Array | T
ethAbiToJsonSchema
Parameters
abis: ValidationSchemaInput
Returns Schema
fetchArrayElement
Parameters
data: unknown[]
level: number
Returns unknown
hexToNumber
Converts value to it's number representation
Parameters
value: string
Returns number | bigint
hexToUint8Array
Parameters
hex: string
Returns Uint8Array
numberToHex
Converts value to it's hex representation
Parameters
value: ValidInputTypes
Returns string
padLeft
Adds a padding on the left of a string, if value is a integer or bigInt will be converted to a hex string.
Parameters
value: ValidInputTypes
characterAmount: number
sign: string = '0'
Returns string
parseBaseType
Type parameters
- T = string
Parameters
type: string
Returns { arraySizes: number[]; baseType?: T; baseTypeSize: undefined | number; isArray: boolean }
arraySizes: number[]
optionalbaseType?: T
baseTypeSize: undefined | number
isArray: boolean
transformJsonDataToAbiFormat
Parameters
abis: FullValidationSchema
data: Record<string, unknown> | readonly unknown[]
optionaltransformedData: unknown[]
Returns unknown[]
uint8ArrayToHexString
Parameters
uint8Array: Uint8Array
Returns string
Code points to int