Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/web3/packages/web3-utils/types/index.d.ts>Utils

Deno / TypeScript to Ethereum Connector
Latest
interface Utils
import { type Utils } from "https://deno.land/x/web3@v0.11.1/packages/web3-utils/types/index.d.ts";

Methods

isBN(value: string | number): boolean
isBigNumber(value: BN): boolean
toBN(value: number | string): BN
toTwosComplement(value: number | string | BN): string
isAddress(address: string, chainId?: number): boolean
isHex(hex: Hex): boolean
isHexStrict(hex: Hex): boolean
asciiToHex(string: string, length?: number): string
hexToAscii(string: string): string
toAscii(string: string): string
bytesToHex(bytes: number[]): string
numberToHex(value: number | string | BN): string
checkAddressChecksum(address: string, chainId?: number): boolean
fromAscii(string: string): string
fromDecimal(value: string | number): string
fromUtf8(string: string): string
fromWei(value: string | BN, unit?: Unit): string
hexToBytes(hex: Hex): number[]
hexToNumber(hex: Hex): number
hexToNumberString(hex: Hex): string
hexToString(hex: Hex): string
hexToUtf8(string: string): string
keccak256(value: string | BN): string
padLeft(
value: string | number,
characterAmount: number,
sign?: string,
): string
leftPad(
string: string | number,
characterAmount: number,
sign?: string,
): string
rightPad(
string: string | number,
characterAmount: number,
sign?: string,
): string
padRight(
string: string | number,
characterAmount: number,
sign?: string,
): string
sha3(value: string | BN): string | null
randomHex(bytesSize: number): string
utf8ToHex(string: string): string
stringToHex(string: string): string
toChecksumAddress(address: string, chainId?: number): string
toDecimal(hex: Hex): number
toHex(value: number | string | BN): string
toUtf8(string: string): string
toWei(val: BN, unit?: Unit): BN
toWei(val: string, unit?: Unit): string
isBloom(bloom: string): boolean
isInBloom(bloom: string, value: string | Uint8Array): boolean
isUserEthereumAddressInBloom(bloom: string, ethereumAddress: string): boolean
isContractAddressInBloom(bloom: string, contractAddress: string): boolean
isTopicInBloom(bloom: string, topic: string): boolean
isTopic(topic: string): boolean
jsonInterfaceMethodToString(abiItem: AbiItem): string
soliditySha3(...val: Mixed[]): string | null
soliditySha3Raw(...val: Mixed[]): string
encodePacked(...val: Mixed[]): string | null
getUnitValue(unit: Unit): string
unitMap(): Units
testAddress(bloom: string, address: string): boolean
testTopic(bloom: string, topic: string): boolean
getSignatureParameters(signature: string): { r: string; s: string; v: number; }
stripHexPrefix(str: string): string
toNumber(value: number | string | BN): number