Skip to main content

utils

Index

References

Namespaces

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

References

keccak256

Renames and re-exports keccak256Wrapper

Namespaces

jsonRpc

jsonRpc:

isBatchRequest

isBatchResponse

isResponseRpcError

isResponseWithError

isResponseWithNotification

isResponseWithResult

isSubscriptionResult

isValidResponse

  • isValidResponse<Result, Error_1>(response: JsonRpcResponse<Result, Error_1>): boolean
  • Type parameters

    • Result = unknown
    • Error_1 = unknown

    Parameters

    Returns boolean

setRequestIdStart

  • setRequestIdStart(start: undefined | number): void
  • Parameters

    • start: undefined | number

    Returns void

toBatchPayload

toPayload

validateResponse

  • validateResponse<Result, Error_1>(response: JsonRpcResponse<Result, Error_1>): boolean
  • Type parameters

    • Result = unknown
    • Error_1 = unknown

    Parameters

    Returns boolean

ssz

ssz:

constBytes20

Bytes20: ByteVectorType

constUintBigInt64

UintBigInt64: UintBigintType

constUintNum64

UintNum64: UintNumberType

constWithdrawal

Withdrawal: ContainerType<{ address: ByteVectorType; amount: UintBigintType; index: UintBigintType; validatorIndex: UintBigintType }>

constWithdrawals

Withdrawals: ListCompositeType<ContainerType<{ address: ByteVectorType; amount: UintBigintType; index: UintBigintType; validatorIndex: UintBigintType }>>

Enumerations

Capability

Capability:

EIP1559FeeMarket

EIP1559FeeMarket: 1559 = 1559

EIP155ReplayProtection

EIP155ReplayProtection: 155 = 155

EIP2718TypedTransaction

EIP2718TypedTransaction: 2718 = 2718

EIP2930AccessLists

EIP2930AccessLists: 2930 = 2930

FMT_BYTES

FMT_BYTES:

BUFFER

BUFFER: BYTES_BUFFER = "BYTES_BUFFER"

HEX

HEX: BYTES_HEX = "BYTES_HEX"

UINT8ARRAY

UINT8ARRAY: BYTES_UINT8ARRAY = "BYTES_UINT8ARRAY"

FMT_NUMBER

FMT_NUMBER:

BIGINT

BIGINT: NUMBER_BIGINT = "NUMBER_BIGINT"

HEX

HEX: NUMBER_HEX = "NUMBER_HEX"

NUMBER

NUMBER: NUMBER_NUMBER = "NUMBER_NUMBER"

STR

STR: NUMBER_STR = "NUMBER_STR"

TypeOutput

TypeOutput:

BigInt

BigInt: 1 = 1

Buffer

Buffer: 2 = 2

Number

Number: 0 = 0

PrefixedHexString

PrefixedHexString: 3 = 3

Classes

Account

Account:

constructor

  • new Account(nonce?: bigint, balance?: bigint, storageRoot?: Buffer, codeHash?: Buffer): Account
  • Parameters

    • optionalnonce: bigint
    • optionalbalance: bigint
    • optionalstorageRoot: Buffer
    • optionalcodeHash: Buffer

    Returns Account

balance

balance: bigint

codeHash

codeHash: Buffer

nonce

nonce: bigint

storageRoot

storageRoot: Buffer

isContract

  • isContract(): boolean
  • Returns boolean

isEmpty

  • isEmpty(): boolean
  • Returns boolean

raw

  • raw(): Buffer[]
  • Returns Buffer[]

serialize

  • serialize(): Buffer
  • Returns Buffer

staticfromAccountData

staticfromRlpSerializedAccount

  • fromRlpSerializedAccount(serialized: Buffer): Account
  • Parameters

    • serialized: Buffer

    Returns Account

staticfromValuesArray

  • fromValuesArray(values: Buffer[]): Account
  • Parameters

    • values: Buffer[]

    Returns Account

Address

Address:

constructor

  • Parameters

    • buf: Buffer

    Returns Address

readonlybuf

buf: Buffer

equals

  • Parameters

    Returns boolean

isPrecompileOrSystemAddress

  • isPrecompileOrSystemAddress(): boolean
  • Returns boolean

isZero

  • isZero(): boolean
  • Returns boolean

toBuffer

  • toBuffer(): Buffer
  • Returns Buffer

toString

  • toString(): string
  • Returns string

staticfromPrivateKey

  • fromPrivateKey(privateKey: Buffer): Address
  • Parameters

    • privateKey: Buffer

    Returns Address

staticfromPublicKey

  • fromPublicKey(pubKey: Buffer): Address
  • Parameters

    • pubKey: Buffer

    Returns Address

staticfromString

  • Parameters

    • str: string

    Returns Address

staticgenerate

staticgenerate2

staticzero

AsyncEventEmitter

AsyncEventEmitter<T>:

Type parameters

constructor

  • Type parameters

    Parameters

    • optionaloptions: EventEmitterOptions

    Returns AsyncEventEmitter<T>

addListener

  • Type parameters

    • E: string | number | symbol

    Parameters

    • event: E & string
    • listener: T[E]

    Returns AsyncEventEmitter<T>

after

  • Type parameters

    • E: string | number | symbol

    Parameters

    • event: E & string
    • target: T[E]
    • listener: T[E]

    Returns AsyncEventEmitter<T>

before

  • Type parameters

    • E: string | number | symbol

    Parameters

    • event: E & string
    • target: T[E]
    • listener: T[E]

    Returns AsyncEventEmitter<T>

emit

  • emit<E>(event: E & string, ...args: Parameters<T[E]>): boolean
  • Type parameters

    • E: string | number | symbol

    Parameters

    • event: E & string
    • rest...args: Parameters<T[E]>

    Returns boolean

eventNames

  • eventNames(): (keyof T & string)[]
  • Returns (keyof T & string)[]

first

  • Type parameters

    • E: string | number | symbol

    Parameters

    • event: E & string
    • listener: T[E]

    Returns AsyncEventEmitter<T>

getMaxListeners

  • getMaxListeners(): number
  • Returns number

listenerCount

  • listenerCount(event: keyof T & string): number
  • Parameters

    • event: keyof T & string

    Returns number

listeners

  • listeners<E>(event: E & string): T[E][]
  • Type parameters

    • E: string | number | symbol

    Parameters

    • event: E & string

    Returns T[E][]

on

  • Type parameters

    • E: string | number | symbol

    Parameters

    • event: E & string
    • listener: T[E]

    Returns AsyncEventEmitter<T>

once

  • Type parameters

    • E: string | number | symbol

    Parameters

    • event: E & string
    • listener: T[E]

    Returns AsyncEventEmitter<T>

prependListener

  • Type parameters

    • E: string | number | symbol

    Parameters

    • event: E & string
    • listener: T[E]

    Returns AsyncEventEmitter<T>

prependOnceListener

  • Type parameters

    • E: string | number | symbol

    Parameters

    • event: E & string
    • listener: T[E]

    Returns AsyncEventEmitter<T>

removeAllListeners

  • Parameters

    • optionalevent: keyof T & string

    Returns AsyncEventEmitter<T>

removeListener

  • Type parameters

    • E: string | number | symbol

    Parameters

    • event: E & string
    • listener: T[E]

    Returns AsyncEventEmitter<T>

setMaxListeners

  • Parameters

    • maxListeners: number

    Returns AsyncEventEmitter<T>

abstractBaseTransaction

BaseTransaction<TransactionObject>:

Type parameters

  • TransactionObject

constructor

readonlycommon

common: Common

readonlydata

data: Buffer

readonlygasLimit

gasLimit: bigint

readonlynonce

nonce: bigint

optionalreadonlyr

r?: bigint

optionalreadonlys

s?: bigint

optionalreadonlyto

to?: Address

optionalreadonlyv

v?: bigint

readonlyvalue

value: bigint

type

  • get type(): number
  • Returns number

abstracterrorStr

  • errorStr(): string
  • Returns string

getBaseFee

  • getBaseFee(): bigint
  • Returns bigint

getDataFee

  • getDataFee(): bigint
  • Returns bigint

abstractgetMessageToSign

  • getMessageToSign(hashMessage: false): Buffer | Buffer[]
  • getMessageToSign(hashMessage?: true): Buffer
  • Parameters

    • hashMessage: false

    Returns Buffer | Buffer[]

abstractgetMessageToVerifySignature

  • getMessageToVerifySignature(): Buffer
  • Returns Buffer

getSenderAddress

abstractgetSenderPublicKey

  • getSenderPublicKey(): Buffer
  • Returns Buffer

abstractgetUpfrontCost

  • getUpfrontCost(): bigint
  • Returns bigint

abstracthash

  • hash(): Buffer
  • Returns Buffer

isSigned

  • isSigned(): boolean
  • Returns boolean

abstractraw

abstractserialize

  • serialize(): Buffer
  • Returns Buffer

sign

  • sign(privateKey: Buffer): TransactionObject
  • Parameters

    • privateKey: Buffer

    Returns TransactionObject

supports

toCreationAddress

  • toCreationAddress(): boolean
  • Returns boolean

abstracttoJSON

validate

  • validate(): boolean
  • validate(stringError: false): boolean
  • validate(stringError: true): string[]
  • Returns boolean

verifySignature

  • verifySignature(): boolean
  • Returns boolean

ChunkResponseParser

ChunkResponseParser:

constructor

  • new ChunkResponseParser(eventEmitter: EventEmitter, autoReconnect: boolean): ChunkResponseParser

onError

  • onError(clearQueues?: () => void): void
  • Parameters

    • optionalclearQueues: () => void

    Returns void

parseResponse

Common

Common:

constructor

  • new Common(opts: CommonOpts): Common
  • Parameters

    • opts: CommonOpts

    Returns Common

readonlyDEFAULT_HARDFORK

DEFAULT_HARDFORK: string

_calcForkHash

  • _calcForkHash(hardfork: string, genesisHash: Buffer): string
  • Parameters

    • hardfork: string
    • genesisHash: Buffer

    Returns string

_getHardfork

  • _getHardfork(hardfork: string): null | HardforkConfig
  • Parameters

    • hardfork: string

    Returns null | HardforkConfig

activeOnBlock

bootstrapNodes

  • bootstrapNodes(): BootstrapNodeConfig[]
  • Returns BootstrapNodeConfig[]

chainId

  • chainId(): bigint
  • Returns bigint

chainName

  • chainName(): string
  • Returns string

consensusAlgorithm

  • consensusAlgorithm(): string
  • Returns string

consensusConfig

  • consensusConfig(): {}
  • Returns {}

    • [key string]: CliqueConfig | EthashConfig | CasperConfig

consensusType

  • consensusType(): string
  • Returns string

copy

dnsNetworks

  • dnsNetworks(): string[]
  • Returns string[]

eipBlock

  • eipBlock(eip: number): null | bigint
  • Parameters

    • eip: number

    Returns null | bigint

eips

  • eips(): number[]
  • Returns number[]

forkHash

  • forkHash(_hardfork?: string, genesisHash?: Buffer): string
  • Parameters

    • optional_hardfork: string
    • optionalgenesisHash: Buffer

    Returns string

genesis

  • genesis(): GenesisBlockConfig
  • Returns GenesisBlockConfig

getHardforkByBlockNumber

gteHardfork

  • gteHardfork(hardfork: string): boolean
  • Parameters

    • hardfork: string

    Returns boolean

hardfork

  • hardfork(): string
  • Returns string

hardforkBlock

  • hardforkBlock(_hardfork?: string): null | bigint
  • Parameters

    • optional_hardfork: string

    Returns null | bigint

hardforkForForkHash

  • hardforkForForkHash(forkHash: string): null | HardforkConfig
  • Parameters

    • forkHash: string

    Returns null | HardforkConfig

hardforkGteHardfork

  • hardforkGteHardfork(_hardfork1: null | string, hardfork2: string): boolean
  • Parameters

    • _hardfork1: null | string
    • hardfork2: string

    Returns boolean

hardforkIsActiveOnBlock

  • hardforkIsActiveOnBlock(_hardfork: null | string, _blockNumber: BigIntLike): boolean
  • Parameters

    Returns boolean

hardforkTTD

  • hardforkTTD(_hardfork?: string): null | bigint
  • Parameters

    • optional_hardfork: string

    Returns null | bigint

hardforkTimestamp

  • hardforkTimestamp(_hardfork?: string): null | bigint
  • Parameters

    • optional_hardfork: string

    Returns null | bigint

hardforks

  • hardforks(): HardforkConfig[]
  • Returns HardforkConfig[]

isActivatedEIP

  • isActivatedEIP(eip: number): boolean
  • Parameters

    • eip: number

    Returns boolean

isHardforkBlock

  • isHardforkBlock(_blockNumber: BigIntLike, _hardfork?: string): boolean
  • Parameters

    Returns boolean

isNextHardforkBlock

  • isNextHardforkBlock(_blockNumber: BigIntLike, _hardfork?: string): boolean
  • Parameters

    Returns boolean

networkId

  • networkId(): bigint
  • Returns bigint

nextHardforkBlock

  • nextHardforkBlock(_hardfork?: string): null | bigint
  • Parameters

    • optional_hardfork: string

    Returns null | bigint

nextHardforkBlockOrTimestamp

  • nextHardforkBlockOrTimestamp(_hardfork?: string): null | bigint
  • Parameters

    • optional_hardfork: string

    Returns null | bigint

param

  • param(topic: string, name: string): bigint
  • Parameters

    • topic: string
    • name: string

    Returns bigint

paramByBlock

paramByEIP

  • paramByEIP(topic: string, name: string, eip: number): undefined | bigint
  • Parameters

    • topic: string
    • name: string
    • eip: number

    Returns undefined | bigint

paramByHardfork

  • paramByHardfork(topic: string, name: string, hardfork: string): bigint
  • Parameters

    • topic: string
    • name: string
    • hardfork: string

    Returns bigint

setChain

  • setChain(chain: string | number | bigint | object): ChainConfig
  • Parameters

    • chain: string | number | bigint | object

    Returns ChainConfig

setEIPs

  • setEIPs(eips?: number[]): void
  • Parameters

    • optionaleips: number[]

    Returns void

setForkHashes

  • setForkHashes(genesisHash: Buffer): void
  • Parameters

    • genesisHash: Buffer

    Returns void

setHardfork

  • setHardfork(hardfork: string): void
  • Parameters

    • hardfork: string

    Returns void

setHardforkByBlockNumber

static_getInitializedChains

  • _getInitializedChains(customChains?: ChainConfig[]): ChainsConfig
  • Parameters

    • optionalcustomChains: ChainConfig[]

    Returns ChainsConfig

staticcustom

  • custom(chainParamsOrName: Partial<ChainConfig> | CustomChain, opts?: CustomCommonOpts): Common
  • Parameters

    • chainParamsOrName: Partial<ChainConfig> | CustomChain
    • optionalopts: CustomCommonOpts

    Returns Common

staticfromGethGenesis

  • fromGethGenesis(genesisJson: any, __namedParameters: GethConfigOpts): Common
  • Parameters

    • genesisJson: any
    • __namedParameters: GethConfigOpts

    Returns Common

staticisSupportedChainId

  • isSupportedChainId(chainId: bigint): boolean
  • Parameters

    • chainId: bigint

    Returns boolean

abstractEip1193Provider

Eip1193Provider<API>:

Type parameters

constructor

[symbol]

  • get [symbol](): boolean
  • Returns boolean

abstractconnect

  • connect(): void
  • Returns void

abstractdisconnect

  • disconnect(code?: number, data?: string): void
  • Parameters

    • optionalcode: number
    • optionaldata: string

    Returns void

abstractgetStatus

abstracton

optionalabstractonce

optionalabstractremoveAllListeners

  • removeAllListeners(type: string): void
  • Parameters

    • type: string

    Returns void

abstractremoveListener

abstractrequest

abstractreset

  • reset(): void
  • Returns void

send

sendAsync

abstractsupportsSubscriptions

  • supportsSubscriptions(): boolean
  • Returns boolean

staticisWeb3Provider

  • isWeb3Provider(provider: unknown): boolean
  • Parameters

    • provider: unknown

    Returns boolean

Lock

Lock:

constructor

acquire

  • acquire(): Promise<boolean>
  • Returns Promise<boolean>

release

  • release(): void
  • Returns void

abstractSocketProvider

SocketProvider<MessageEvent, CloseEvent, ErrorEvent, API>:

Type parameters

constructor

  • new SocketProvider<MessageEvent, CloseEvent, ErrorEvent, API>(socketPath: string, socketOptions?: unknown, reconnectOptions?: Partial<ReconnectOptions>): SocketProvider<MessageEvent, CloseEvent, ErrorEvent, API>
  • Type parameters

    Parameters

    • socketPath: string
    • optionalsocketOptions: unknown
    • optionalreconnectOptions: Partial<ReconnectOptions>

    Returns SocketProvider<MessageEvent, CloseEvent, ErrorEvent, API>

SocketConnection

  • get SocketConnection(): unknown
  • Returns unknown

[symbol]

  • get [symbol](): boolean
  • Returns boolean

connect

  • connect(): void
  • Returns void

disconnect

  • disconnect(code?: number, data?: string): void
  • Parameters

    • optionalcode: number
    • optionaldata: string

    Returns void

abstractgetStatus

on

once

removeAllListeners

  • removeAllListeners(type: string): void
  • Parameters

    • type: string

    Returns void

removeListener

request

reset

  • reset(): void
  • Returns void

send

sendAsync

supportsSubscriptions

  • supportsSubscriptions(): boolean
  • Returns boolean

staticisWeb3Provider

  • isWeb3Provider(provider: unknown): boolean
  • Parameters

    • provider: unknown

    Returns boolean

TransactionFactory

TransactionFactory:

staticfromBlockBodyData

staticfromEthersProvider

staticfromSerializedData

staticfromTxData

Web3DeferredPromise

Web3DeferredPromise<T>:

Type parameters

  • T

constructor

  • new Web3DeferredPromise<T>(__namedParameters?: { eagerStart: boolean; timeout: number; timeoutMessage: string }): Web3DeferredPromise<T>
  • Type parameters

    • T

    Parameters

    • optional__namedParameters: { eagerStart: boolean; timeout: number; timeoutMessage: string }

    Returns Web3DeferredPromise<T>

[toStringTag]

[toStringTag]: Promise

state

  • get state(): pending | fulfilled | rejected
  • Returns pending | fulfilled | rejected

catch

  • catch<TResult>(onrejected?: (reason: any) => TResult | PromiseLike<TResult>): Promise<T | TResult>
  • Type parameters

    • TResult

    Parameters

    • optionalonrejected: (reason: any) => TResult | PromiseLike<TResult>

    Returns Promise<T | TResult>

finally

  • finally(onfinally?: () => void): Promise<T>
  • Parameters

    • optionalonfinally: () => void

    Returns Promise<T>

reject

  • reject(reason?: unknown): void
  • Parameters

    • optionalreason: unknown

    Returns void

resolve

  • resolve(value: T | PromiseLike<T>): void
  • Parameters

    • value: T | PromiseLike<T>

    Returns void

startTimer

  • startTimer(): void
  • Returns void

then

  • then<TResult1, TResult2>(onfulfilled?: (value: T) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: unknown) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>
  • Type parameters

    • TResult1
    • TResult2

    Parameters

    • optionalonfulfilled: (value: T) => TResult1 | PromiseLike<TResult1>
    • optionalonrejected: (reason: unknown) => TResult2 | PromiseLike<TResult2>

    Returns Promise<TResult1 | TResult2>

Withdrawal

Withdrawal:

constructor

  • new Withdrawal(index: bigint, validatorIndex: bigint, address: Address, amount: bigint): Withdrawal
  • Parameters

    • index: bigint
    • validatorIndex: bigint
    • address: Address
    • amount: bigint

    Returns Withdrawal

readonlyaddress

address: Address

readonlyamount

amount: bigint

readonlyindex

index: bigint

readonlyvalidatorIndex

validatorIndex: bigint

raw

toJSON

  • toJSON(): { address: string; amount: string; index: string; validatorIndex: string }
  • Returns { address: string; amount: string; index: string; validatorIndex: string }

    • address: string
    • amount: string
    • index: string
    • validatorIndex: string

toValue

  • toValue(): { address: Buffer; amount: bigint; index: bigint; validatorIndex: bigint }
  • Returns { address: Buffer; amount: bigint; index: bigint; validatorIndex: bigint }

    • address: Buffer
    • amount: bigint
    • index: bigint
    • validatorIndex: bigint

staticfromValuesArray

staticfromWithdrawalData

statictoBufferArray

Interfaces

AccessListEIP2930TxData

AccessListEIP2930TxData:

optionalaccessList

accessList?: null | AccessListBuffer | AccessList

optionalchainId

chainId?: BigIntLike

optionaldata

data?: BufferLike

optionalgasLimit

gasLimit?: BigIntLike

optionalgasPrice

gasPrice?: null | BigIntLike

optionalnonce

nonce?: BigIntLike

optionalr

optionals

optionalto

optionaltype

type?: BigIntLike

optionalv

optionalvalue

value?: BigIntLike

AccountData

AccountData:

optionalbalance

balance?: BigIntLike

optionalcodeHash

codeHash?: BufferLike

optionalnonce

nonce?: BigIntLike

optionalstorageRoot

storageRoot?: BufferLike

BlobEIP4844TxData

BlobEIP4844TxData:

optionalaccessList

accessList?: null | AccessListBuffer | AccessList

optionalblobs

blobs?: BufferLike[]

optionalchainId

chainId?: BigIntLike

optionaldata

data?: BufferLike

optionalgasLimit

gasLimit?: BigIntLike

optionalgasPrice

gasPrice?: null

optionalkzgCommitments

kzgCommitments?: BufferLike[]

optionalkzgProof

kzgProof?: BufferLike

optionalmaxFeePerDataGas

maxFeePerDataGas?: BigIntLike

optionalmaxFeePerGas

maxFeePerGas?: BigIntLike

optionalmaxPriorityFeePerGas

maxPriorityFeePerGas?: BigIntLike

optionalnonce

nonce?: BigIntLike

optionalr

optionals

optionalto

optionaltype

type?: BigIntLike

optionalv

optionalvalue

value?: BigIntLike

optionalversionedHashes

versionedHashes?: BufferLike[]

ECDSASignature

ECDSASignature:

r

r: Buffer

s

s: Buffer

v

v: bigint

EventMap

EventMap:

FeeMarketEIP1559TxData

FeeMarketEIP1559TxData:

optionalaccessList

accessList?: null | AccessListBuffer | AccessList

optionalchainId

chainId?: BigIntLike

optionaldata

data?: BufferLike

optionalgasLimit

gasLimit?: BigIntLike

optionalgasPrice

gasPrice?: null

optionalmaxFeePerGas

maxFeePerGas?: BigIntLike

optionalmaxPriorityFeePerGas

maxPriorityFeePerGas?: BigIntLike

optionalnonce

nonce?: BigIntLike

optionalr

optionals

optionalto

optionaltype

type?: BigIntLike

optionalv

optionalvalue

value?: BigIntLike

JsonRpcTx

JsonRpcTx:

optionalaccessList

accessList?: JsonAccessListItem[]

blockHash

blockHash: null | string

blockNumber

blockNumber: null | string

optionalchainId

chainId?: string

from

from: string

gas

gas: string

gasPrice

gasPrice: string

hash

hash: string

input

input: string

optionalmaxFeePerDataGas

maxFeePerDataGas?: string

optionalmaxFeePerGas

maxFeePerGas?: string

optionalmaxPriorityFeePerGas

maxPriorityFeePerGas?: string

nonce

nonce: string

r

r: string

s

s: string

to

to: null | string

transactionIndex

transactionIndex: null | string

type

type: string

v

v: string

value

value: string

optionalversionedHashes

versionedHashes?: string[]

JsonRpcWithdrawal

JsonRpcWithdrawal:

address

address: string

amount

amount: string

index

index: string

validatorIndex

validatorIndex: string

JsonTx

JsonTx:

optionalaccessList

accessList?: JsonAccessListItem[]

optionalchainId

chainId?: string

optionaldata

data?: string

optionalgasLimit

gasLimit?: string

optionalgasPrice

gasPrice?: string

optionalmaxFeePerDataGas

maxFeePerDataGas?: string

optionalmaxFeePerGas

maxFeePerGas?: string

optionalmaxPriorityFeePerGas

maxPriorityFeePerGas?: string

optionalnonce

nonce?: string

optionalr

r?: string

optionals

s?: string

optionalto

to?: string

optionaltype

type?: string

optionalv

v?: string

optionalvalue

value?: string

optionalversionedHashes

versionedHashes?: string[]

TransformableToArray

TransformableToArray:

toArray

  • toArray(): Uint8Array
  • Returns Uint8Array

optionaltoBuffer

  • toBuffer(): Buffer
  • Returns Buffer

TransformableToBuffer

TransformableToBuffer:

optionaltoArray

  • toArray(): Uint8Array
  • Returns Uint8Array

toBuffer

  • toBuffer(): Buffer
  • Returns Buffer

TxOptions

TxOptions:

optionalcommon

common?: Common

optionalfreeze

freeze?: boolean

Type Aliases

AccessList

AccessList: AccessListItem[]

AccessListBuffer

AccessListBuffer: AccessListBufferItem[]

AccessListBufferItem

AccessListBufferItem: [Buffer, Buffer[]]

AccessListEIP2930ValuesArray

AccessListEIP2930ValuesArray: [Buffer, Buffer, Buffer, Buffer, Buffer, Buffer, Buffer, AccessListBuffer, Buffer?, Buffer?, Buffer?]

AccessListItem

AccessListItem: { address: PrefixedHexString; storageKeys: PrefixedHexString[] }

Type declaration

AccountBodyBuffer

AccountBodyBuffer: [Buffer, Buffer, Buffer | Uint8Array, Buffer | Uint8Array]

AddressLike

AddressLike: Address | Buffer | PrefixedHexString

AsyncFunction

AsyncFunction<T, K>: (...args: K[]) => Promise<T>

Type parameters

  • T
  • K = unknown

Type declaration

    • (...args: K[]): Promise<T>
    • Parameters

      • rest...args: K[]

      Returns Promise<T>

BigIntLike

BigIntLike: bigint | PrefixedHexString | number | Buffer

BufferLike

BufferLike: Buffer | Uint8Array | number[] | number | bigint | TransformableToBuffer | PrefixedHexString

ByteTypes

ByteTypes: { BYTES_BUFFER: Buffer; BYTES_HEX: HexString; BYTES_UINT8ARRAY: Uint8Array }

Type declaration

  • BYTES_BUFFER: Buffer
  • BYTES_HEX: HexString
  • BYTES_UINT8ARRAY: Uint8Array

DataFormat

DataFormat: { bytes: FMT_BYTES; number: FMT_NUMBER }

Type declaration

EtherUnits

EtherUnits: keyof typeof ethUnitMap

FeeMarketEIP1559ValuesArray

FeeMarketEIP1559ValuesArray: [Buffer, Buffer, Buffer, Buffer, Buffer, Buffer, Buffer, Buffer, AccessListBuffer, Buffer?, Buffer?, Buffer?]

FormatType

FormatType<T, F>: number extends Extract<T, Numbers> ? NumberTypes[F[number]] | Exclude<T, Numbers> : Buffer extends Extract<T, Bytes> ? ByteTypes[F[bytes]] | Exclude<T, Bytes> : T extends object | undefined ? { [ P in keyof T ]: FormatType<T[P], F> } : T

Type parameters

NestedBufferArray

NestedBufferArray: (Buffer | NestedBufferArray)[]

NestedUint8Array

NestedUint8Array: (Uint8Array | NestedUint8Array)[]

NumberTypes

NumberTypes: { NUMBER_BIGINT: bigint; NUMBER_HEX: HexString; NUMBER_NUMBER: number; NUMBER_STR: string }

Type declaration

  • NUMBER_BIGINT: bigint
  • NUMBER_HEX: HexString
  • NUMBER_NUMBER: number
  • NUMBER_STR: string

PrefixedHexString

PrefixedHexString: string

ReconnectOptions

ReconnectOptions: { autoReconnect: boolean; delay: number; maxAttempts: number }

Type declaration

  • autoReconnect: boolean
  • delay: number
  • maxAttempts: number

ToBufferInputTypes

ToBufferInputTypes: PrefixedHexString | number | bigint | Buffer | Uint8Array | number[] | TransformableToArray | TransformableToBuffer | null | undefined

TxData

TxData: { data?: BufferLike; gasLimit?: BigIntLike; gasPrice?: BigIntLike | null; nonce?: BigIntLike; r?: BigIntLike; s?: BigIntLike; to?: AddressLike; type?: BigIntLike; v?: BigIntLike; value?: BigIntLike }

Type declaration

TxValuesArray

TxValuesArray: Buffer[]

TypeOutputReturnType

TypeOutputReturnType: { 0: number; 1: bigint; 2: Buffer; 3: PrefixedHexString }

Type declaration

TypedTransaction

TypedTransaction: Transaction | AccessListEIP2930Transaction | FeeMarketEIP1559Transaction | BlobEIP4844Transaction

WithdrawalBuffer

WithdrawalBuffer: [Buffer, Buffer, Buffer, Buffer]

WithdrawalData

WithdrawalData: { address: AddressLike; amount: BigIntLike; index: BigIntLike; validatorIndex: BigIntLike }

Type declaration

Variables

constAccessTupleType

AccessTupleType: ContainerType<{ address: ByteVectorType; storageKeys: ListCompositeType<ByteVectorType> }>

constAddressType

AddressType: ByteVectorType

constBlobNetworkTransactionWrapper

BlobNetworkTransactionWrapper: ContainerType<{ blobKzgs: ListCompositeType<ByteVectorType>; blobs: ListCompositeType<ByteVectorType>; kzgAggregatedProof: ByteVectorType; tx: ContainerType<{ message: ContainerType<{ accessList: ListCompositeType<ContainerType<{ address: ByteVectorType; storageKeys: ListCompositeType<ByteVectorType> }>>; blobVersionedHashes: ListCompositeType<ByteVectorType>; chainId: UintBigintType; data: ByteListType; gas: UintBigintType; maxFeePerDataGas: UintBigintType; maxFeePerGas: UintBigintType; maxPriorityFeePerGas: UintBigintType; nonce: UintBigintType; to: UnionType<(ByteVectorType | NoneType)[]>; value: UintBigintType }>; signature: ContainerType<{ r: UintBigintType; s: UintBigintType; yParity: BooleanType }> }> }>

constBlobTransactionType

BlobTransactionType: ContainerType<{ accessList: ListCompositeType<ContainerType<{ address: ByteVectorType; storageKeys: ListCompositeType<ByteVectorType> }>>; blobVersionedHashes: ListCompositeType<ByteVectorType>; chainId: UintBigintType; data: ByteListType; gas: UintBigintType; maxFeePerDataGas: UintBigintType; maxFeePerGas: UintBigintType; maxPriorityFeePerGas: UintBigintType; nonce: UintBigintType; to: UnionType<(ByteVectorType | NoneType)[]>; value: UintBigintType }>

constDEFAULT_RETURN_FORMAT

DEFAULT_RETURN_FORMAT: { bytes: FMT_BYTES.HEX; number: FMT_NUMBER.BIGINT }

Type declaration

  • readonlybytes: FMT_BYTES.HEX
  • readonlynumber: FMT_NUMBER.BIGINT

constECDSASignatureType

ECDSASignatureType: ContainerType<{ r: UintBigintType; s: UintBigintType; yParity: BooleanType }>

constETH_DATA_FORMAT

ETH_DATA_FORMAT: { bytes: FMT_BYTES.HEX; number: FMT_NUMBER.HEX }

Type declaration

  • readonlybytes: FMT_BYTES.HEX
  • readonlynumber: FMT_NUMBER.HEX

constGWEI_TO_WEI

GWEI_TO_WEI: bigint

constKECCAK256_NULL

KECCAK256_NULL: Buffer

constKECCAK256_NULL_S

KECCAK256_NULL_S: c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 = "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"

constKECCAK256_RLP

KECCAK256_RLP: Buffer

constKECCAK256_RLP_ARRAY

KECCAK256_RLP_ARRAY: Buffer

constKECCAK256_RLP_ARRAY_S

KECCAK256_RLP_ARRAY_S: 1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347 = "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"

constKECCAK256_RLP_S

KECCAK256_RLP_S: 56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421 = "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"

constKZGCommitmentType

KZGCommitmentType: ByteVectorType

constKZGProofType

KZGProofType: ByteVectorType

constMAX_INTEGER

MAX_INTEGER: bigint

constMAX_INTEGER_BIGINT

MAX_INTEGER_BIGINT: bigint

constMAX_UINT64

MAX_UINT64: bigint

constMAX_WITHDRAWALS_PER_PAYLOAD

MAX_WITHDRAWALS_PER_PAYLOAD: 16 = 16

constRLP_EMPTY_STRING

RLP_EMPTY_STRING: Buffer

constSECP256K1_ORDER

SECP256K1_ORDER: bigint

constSECP256K1_ORDER_DIV_2

SECP256K1_ORDER_DIV_2: bigint

constSignedBlobTransactionType

SignedBlobTransactionType: ContainerType<{ message: ContainerType<{ accessList: ListCompositeType<ContainerType<{ address: ByteVectorType; storageKeys: ListCompositeType<ByteVectorType> }>>; blobVersionedHashes: ListCompositeType<ByteVectorType>; chainId: UintBigintType; data: ByteListType; gas: UintBigintType; maxFeePerDataGas: UintBigintType; maxFeePerGas: UintBigintType; maxPriorityFeePerGas: UintBigintType; nonce: UintBigintType; to: UnionType<(ByteVectorType | NoneType)[]>; value: UintBigintType }>; signature: ContainerType<{ r: UintBigintType; s: UintBigintType; yParity: BooleanType }> }>

constTWO_POW256

TWO_POW256: bigint

constethUnitMap

ethUnitMap: { Gwei: bigint; Kwei: bigint; Mwei: bigint; babbage: bigint; ether: bigint; femtoether: bigint; finney: bigint; gether: bigint; grand: bigint; gwei: bigint; kether: bigint; kwei: bigint; lovelace: bigint; mether: bigint; micro: bigint; microether: bigint; milli: bigint; milliether: bigint; mwei: bigint; nano: bigint; nanoether: bigint; noether: bigint; picoether: bigint; shannon: bigint; szabo: bigint; tether: bigint; wei: bigint }

Type declaration

  • Gwei: bigint
  • Kwei: bigint
  • Mwei: bigint
  • babbage: bigint
  • ether: bigint
  • femtoether: bigint
  • finney: bigint
  • gether: bigint
  • grand: bigint
  • gwei: bigint
  • kether: bigint
  • kwei: bigint
  • lovelace: bigint
  • mether: bigint
  • micro: bigint
  • microether: bigint
  • milli: bigint
  • milliether: bigint
  • mwei: bigint
  • nano: bigint
  • nanoether: bigint
  • noether: bigint
  • picoether: bigint
  • shannon: bigint
  • szabo: bigint
  • tether: bigint
  • wei: bigint

Functions

accountBodyFromSlim

accountBodyToRLP

accountBodyToSlim

addHexPrefix

  • addHexPrefix(str: string): string
  • Parameters

    • str: string

    Returns string

arrToBufArr

  • Parameters

    • arr: Uint8Array

    Returns Buffer

arrayContainsArray

  • arrayContainsArray(superset: unknown[], subset: unknown[], some?: boolean): boolean
  • Parameters

    • superset: unknown[]
    • subset: unknown[]
    • optionalsome: boolean

    Returns boolean

asciiToHex

  • asciiToHex(str: string): string
  • Parameters

    • str: string

    Returns string

baToJSON

  • baToJSON(ba: any): any
  • Parameters

    • ba: any

    Returns any

bigIntToBuffer

  • bigIntToBuffer(num: bigint): Buffer
  • Parameters

    • num: bigint

    Returns Buffer

bigIntToHex

  • bigIntToHex(num: bigint): string
  • Parameters

    • num: bigint

    Returns string

bigIntToUnpaddedBuffer

  • bigIntToUnpaddedBuffer(value: bigint): Buffer
  • Parameters

    • value: bigint

    Returns Buffer

bufArrToArr

  • Parameters

    • arr: Buffer

    Returns Uint8Array

bufferToBigInt

  • bufferToBigInt(buf: Buffer): bigint
  • Parameters

    • buf: Buffer

    Returns bigint

bufferToHex

  • bufferToHex(_buf: Buffer): string
  • Parameters

    • _buf: Buffer

    Returns string

bufferToInt

  • bufferToInt(buf: Buffer): number
  • Parameters

    • buf: Buffer

    Returns number

bytesToBuffer

  • bytesToBuffer(data: Bytes): Buffer
  • Parameters

    Returns Buffer

bytesToHex

  • bytesToHex(bytes: Bytes): string
  • Parameters

    Returns string

checkAddressCheckSum

  • checkAddressCheckSum(data: string): boolean
  • Parameters

    • data: string

    Returns boolean

compareBlockNumbers

convert

  • convert(data: unknown, schema: JsonSchema, dataPath: string[], format: DataFormat, oneOfPath?: [string, number][]): unknown
  • Parameters

    • data: unknown
    • schema: JsonSchema
    • dataPath: string[]
    • format: DataFormat
    • optionaloneOfPath: [string, number][]

    Returns unknown

convertScalarValue

  • convertScalarValue(value: unknown, ethType: string, format: DataFormat): unknown
  • Parameters

    Returns unknown

ecrecover

  • ecrecover(msgHash: Buffer, v: bigint, r: Buffer, s: Buffer, chainId?: bigint): Buffer
  • Parameters

    • msgHash: Buffer
    • v: bigint
    • r: Buffer
    • s: Buffer
    • optionalchainId: bigint

    Returns Buffer

ecsign

  • ecsign(msgHash: Buffer, privateKey: Buffer, chainId?: bigint): ECDSASignature
  • Parameters

    • msgHash: Buffer
    • privateKey: Buffer
    • optionalchainId: bigint

    Returns ECDSASignature

encodePacked

  • Parameters

    Returns string

format

fromAscii

  • fromAscii(str: string): string
  • Parameters

    • str: string

    Returns string

fromDecimal

  • fromDecimal(value: Numbers): string
  • Parameters

    Returns string

fromRpcSig

fromSigned

  • fromSigned(num: Buffer): bigint
  • Parameters

    • num: Buffer

    Returns bigint

fromTwosComplement

  • fromTwosComplement(value: Numbers, nibbleWidth?: number): number | bigint
  • Parameters

    • value: Numbers
    • optionalnibbleWidth: number

    Returns number | bigint

fromUtf8

  • fromUtf8(str: string): string
  • Parameters

    • str: string

    Returns string

fromWei

  • fromWei(number: Numbers, unit: noether | wei | kwei | Kwei | babbage | femtoether | mwei | Mwei | lovelace | picoether | gwei | Gwei | shannon | nanoether | nano | szabo | microether | micro | finney | milliether | milli | ether | kether | grand | mether | gether | tether): string
  • Parameters

    • number: Numbers
    • unit: noether | wei | kwei | Kwei | babbage | femtoether | mwei | Mwei | lovelace | picoether | gwei | Gwei | shannon | nanoether | nano | szabo | microether | micro | finney | milliether | milli | ether | kether | grand | mether | gether | tether

    Returns string

generateAddress

  • generateAddress(from: Buffer, nonce: Buffer): Buffer
  • Parameters

    • from: Buffer
    • nonce: Buffer

    Returns Buffer

generateAddress2

  • generateAddress2(from: Buffer, salt: Buffer, initCode: Buffer): Buffer
  • Parameters

    • from: Buffer
    • salt: Buffer
    • initCode: Buffer

    Returns Buffer

getBinarySize

  • getBinarySize(str: string): number
  • Parameters

    • str: string

    Returns number

getKeys

  • getKeys(params: Record<string, string>[], key: string, allowEmpty?: boolean): string[]
  • Parameters

    • params: Record<string, string>[]
    • key: string
    • optionalallowEmpty: boolean

    Returns string[]

getStorageSlotNumForLongString

  • getStorageSlotNumForLongString(mainSlotNumber: string | number): undefined | string
  • Parameters

    • mainSlotNumber: string | number

    Returns undefined | string

hashPersonalMessage

  • hashPersonalMessage(message: Buffer): Buffer
  • Parameters

    • message: Buffer

    Returns Buffer

hexToAscii

  • hexToAscii(str: string): string
  • Parameters

    • str: string

    Returns string

hexToBytes

  • hexToBytes(bytes: string): Buffer
  • Parameters

    • bytes: string

    Returns Buffer

hexToNumber

  • hexToNumber(value: string): number | bigint
  • Parameters

    • value: string

    Returns number | bigint

hexToNumberString

  • hexToNumberString(data: string): string
  • Parameters

    • data: string

    Returns string

hexToString

  • hexToString(str: string): string
  • Parameters

    • str: string

    Returns string

hexToUtf8

  • hexToUtf8(str: string): string
  • Parameters

    • str: string

    Returns string

importPublic

  • importPublic(_publicKey: Buffer): Buffer
  • Parameters

    • _publicKey: Buffer

    Returns Buffer

intToBuffer

  • intToBuffer(i: number): Buffer
  • Parameters

    • i: number

    Returns Buffer

intToHex

  • intToHex(i: number): string
  • Parameters

    • i: number

    Returns string

intToUnpaddedBuffer

  • intToUnpaddedBuffer(value: number): Buffer
  • Parameters

    • value: number

    Returns Buffer

isAccessList

isAccessListBuffer

isAddress

  • Parameters

    Returns boolean

isBatchRequest

isBatchResponse

isBloom

isContractAddressInBloom

  • isContractAddressInBloom(bloom: string, contractAddress: string): boolean
  • Parameters

    • bloom: string
    • contractAddress: string

    Returns boolean

isDataFormat

  • isDataFormat(dataFormat: unknown): dataFormat is DataFormat
  • Parameters

    • dataFormat: unknown

    Returns dataFormat is DataFormat

isHex

isHexPrefixed

  • isHexPrefixed(str: string): boolean
  • Parameters

    • str: string

    Returns boolean

isHexStrict

isHexString

  • isHexString(value: string, length?: number): boolean
  • Parameters

    • value: string
    • optionallength: number

    Returns boolean

isInBloom

  • isInBloom(bloom: string, value: string | Uint8Array): boolean
  • Parameters

    • bloom: string
    • value: string | Uint8Array

    Returns boolean

isNullish

  • isNullish(item: unknown): item is undefined | null
  • Parameters

    • item: unknown

    Returns item is undefined | null

isPromise

  • isPromise(object: unknown): boolean
  • Parameters

    • object: unknown

    Returns boolean

isResponseRpcError

isResponseWithError

isResponseWithNotification

isResponseWithResult

isSubscriptionResult

isTopic

  • isTopic(topic: string): boolean
  • Parameters

    • topic: string

    Returns boolean

isTopicInBloom

  • isTopicInBloom(bloom: string, topic: string): boolean
  • Parameters

    • bloom: string
    • topic: string

    Returns boolean

isUserEthereumAddressInBloom

  • isUserEthereumAddressInBloom(bloom: string, ethereumAddress: string): boolean
  • Parameters

    • bloom: string
    • ethereumAddress: string

    Returns boolean

isValidAddress

  • isValidAddress(hexAddress: string): boolean
  • Parameters

    • hexAddress: string

    Returns boolean

isValidChecksumAddress

  • isValidChecksumAddress(hexAddress: string): boolean
  • Parameters

    • hexAddress: string

    Returns boolean

isValidPrivate

  • isValidPrivate(privateKey: Buffer): boolean
  • Parameters

    • privateKey: Buffer

    Returns boolean

isValidPublic

  • isValidPublic(publicKey: Buffer, sanitize?: boolean): boolean
  • Parameters

    • publicKey: Buffer
    • optionalsanitize: boolean

    Returns boolean

isValidResponse

  • isValidResponse<Result, Error_1>(response: JsonRpcResponse<Result, Error_1>): boolean
  • Type parameters

    • Result = unknown
    • Error_1 = unknown

    Parameters

    Returns boolean

isValidSignature

  • isValidSignature(v: bigint, r: Buffer, s: Buffer, homesteadOrLater?: boolean, chainId?: bigint): boolean
  • Parameters

    • v: bigint
    • r: Buffer
    • s: Buffer
    • optionalhomesteadOrLater: boolean
    • optionalchainId: bigint

    Returns boolean

isZeroAddress

  • isZeroAddress(hexAddress: string): boolean
  • Parameters

    • hexAddress: string

    Returns boolean

keccak256Wrapper

  • keccak256Wrapper(data: string | number | bigint | Buffer | ArrayBuffer | Uint8Array | readonly number[]): string
  • Parameters

    • data: string | number | bigint | Buffer | ArrayBuffer | Uint8Array | readonly number[]

    Returns string

leftPad

  • leftPad(value: Numbers, characterAmount: number, sign?: string): string
  • Parameters

    • value: Numbers
    • characterAmount: number
    • optionalsign: string

    Returns string

mergeDeep

  • mergeDeep(destination: Record<string, unknown>, ...sources: Record<string, unknown>[]): Record<string, unknown>
  • Parameters

    • destination: Record<string, unknown>
    • rest...sources: Record<string, unknown>[]

    Returns Record<string, unknown>

numberToHex

  • numberToHex(value: Numbers): string
  • Parameters

    Returns string

padLeft

  • padLeft(value: Numbers, characterAmount: number, sign?: string): string
  • Parameters

    • value: Numbers
    • characterAmount: number
    • optionalsign: string

    Returns string

padRight

  • padRight(value: Numbers, characterAmount: number, sign?: string): string
  • Parameters

    • value: Numbers
    • characterAmount: number
    • optionalsign: string

    Returns string

padToEven

  • padToEven(value: string): string
  • Parameters

    • value: string

    Returns string

pollTillDefined

  • pollTillDefined<T>(func: AsyncFunction<T, unknown>, interval: number): Promise<Exclude<T, undefined>>
  • Type parameters

    • T

    Parameters

    Returns Promise<Exclude<T, undefined>>

privateToAddress

  • privateToAddress(privateKey: Buffer): Buffer
  • Parameters

    • privateKey: Buffer

    Returns Buffer

privateToPublic

  • privateToPublic(privateKey: Buffer): Buffer
  • Parameters

    • privateKey: Buffer

    Returns Buffer

processSolidityEncodePackedArgs

  • processSolidityEncodePackedArgs(arg: Sha3Input): string

pubToAddress

  • pubToAddress(_pubKey: Buffer, sanitize?: boolean): Buffer
  • Parameters

    • _pubKey: Buffer
    • optionalsanitize: boolean

    Returns Buffer

publicToAddress

  • publicToAddress(_pubKey: Buffer, sanitize?: boolean): Buffer
  • Parameters

    • _pubKey: Buffer
    • optionalsanitize: boolean

    Returns Buffer

randomBytes

  • randomBytes(byteSize: number): Buffer
  • Parameters

    • byteSize: number

    Returns Buffer

randomHex

  • randomHex(byteSize: number): string
  • Parameters

    • byteSize: number

    Returns string

rejectIfConditionAtInterval

  • rejectIfConditionAtInterval<T>(cond: AsyncFunction<undefined | T, unknown>, interval: number): [NodeJS.Timer, Promise<never>]
  • Type parameters

    • T

    Parameters

    Returns [NodeJS.Timer, Promise<never>]

rejectIfTimeout

  • rejectIfTimeout(timeout: number, error: Error): [NodeJS.Timer, Promise<never>]
  • Parameters

    • timeout: number
    • error: Error

    Returns [NodeJS.Timer, Promise<never>]

rightPad

  • rightPad(value: Numbers, characterAmount: number, sign?: string): string
  • Parameters

    • value: Numbers
    • characterAmount: number
    • optionalsign: string

    Returns string

setLengthLeft

  • setLengthLeft(msg: Buffer, length: number): Buffer
  • Parameters

    • msg: Buffer
    • length: number

    Returns Buffer

setLengthRight

  • setLengthRight(msg: Buffer, length: number): Buffer
  • Parameters

    • msg: Buffer
    • length: number

    Returns Buffer

setRequestIdStart

  • setRequestIdStart(start: undefined | number): void
  • Parameters

    • start: undefined | number

    Returns void

sha3

  • sha3(data: Bytes): undefined | string
  • Parameters

    Returns undefined | string

sha3Raw

  • sha3Raw(data: Bytes): string
  • Parameters

    Returns string

short

  • short(buffer: string | Buffer, maxLength?: number): string
  • Parameters

    • buffer: string | Buffer
    • optionalmaxLength: number

    Returns string

soliditySha3

  • soliditySha3(...values: Sha3Input[]): undefined | string
  • Parameters

    Returns undefined | string

soliditySha3Raw

stringToHex

  • stringToHex(str: string): string
  • Parameters

    • str: string

    Returns string

stripHexPrefix

  • stripHexPrefix(str: string): string
  • Parameters

    • str: string

    Returns string

toAscii

  • toAscii(str: string): string
  • Parameters

    • str: string

    Returns string

toBatchPayload

toBigInt

  • toBigInt(value: unknown): bigint
  • Parameters

    • value: unknown

    Returns bigint

toBuffer

toChecksumAddress

  • toChecksumAddress(address: string): string
  • Parameters

    • address: string

    Returns string

toCompactSig

  • toCompactSig(v: bigint, r: Buffer, s: Buffer, chainId?: bigint): string
  • Parameters

    • v: bigint
    • r: Buffer
    • s: Buffer
    • optionalchainId: bigint

    Returns string

toDecimal

  • toDecimal(value: string): number | bigint
  • Parameters

    • value: string

    Returns number | bigint

toHex

  • toHex(value: string | number | bigint | boolean | object | Buffer | ArrayBuffer | Uint8Array, returnType?: boolean): string
  • Parameters

    • value: string | number | bigint | boolean | object | Buffer | ArrayBuffer | Uint8Array
    • optionalreturnType: boolean

    Returns string

toNumber

  • toNumber(value: Numbers): number | bigint
  • Parameters

    Returns number | bigint

toPayload

toRpcSig

  • toRpcSig(v: bigint, r: Buffer, s: Buffer, chainId?: bigint): string
  • Parameters

    • v: bigint
    • r: Buffer
    • s: Buffer
    • optionalchainId: bigint

    Returns string

toTwosComplement

  • toTwosComplement(value: Numbers, nibbleWidth?: number): string
  • Parameters

    • value: Numbers
    • optionalnibbleWidth: number

    Returns string

toType

  • Type parameters

    Parameters

    • input: null
    • outputType: T

    Returns null

toUnsigned

  • toUnsigned(num: bigint): Buffer
  • Parameters

    • num: bigint

    Returns Buffer

toUtf8

  • toUtf8(str: string): string
  • Parameters

    • str: string

    Returns string

toWei

  • toWei(number: Numbers, unit: noether | wei | kwei | Kwei | babbage | femtoether | mwei | Mwei | lovelace | picoether | gwei | Gwei | shannon | nanoether | nano | szabo | microether | micro | finney | milliether | milli | ether | kether | grand | mether | gether | tether): string
  • Parameters

    • number: Numbers
    • unit: noether | wei | kwei | Kwei | babbage | femtoether | mwei | Mwei | lovelace | picoether | gwei | Gwei | shannon | nanoether | nano | szabo | microether | micro | finney | milliether | milli | ether | kether | grand | mether | gether | tether

    Returns string

unpadArray

  • unpadArray(a: number[]): number[]
  • Parameters

    • a: number[]

    Returns number[]

unpadBuffer

  • unpadBuffer(a: Buffer): Buffer
  • Parameters

    • a: Buffer

    Returns Buffer

unpadHexString

  • unpadHexString(_a: string): string
  • Parameters

    • _a: string

    Returns string

utf8ToHex

  • utf8ToHex(str: string): string
  • Parameters

    • str: string

    Returns string

uuidV4

  • uuidV4(): string
  • Returns string

validateNoLeadingZeroes

  • validateNoLeadingZeroes(values: {}): void
  • Parameters

    • values: {}

    Returns void

validateResponse

  • validateResponse<Result, Error_1>(response: JsonRpcResponse<Result, Error_1>): boolean
  • Type parameters

    • Result = unknown
    • Error_1 = unknown

    Parameters

    Returns boolean

waitWithTimeout

  • waitWithTimeout<T>(awaitable: Promise<T> | AsyncFunction<T, unknown>, timeout: number, error: Error): Promise<T>
  • waitWithTimeout<T>(awaitable: Promise<T> | AsyncFunction<T, unknown>, timeout: number): Promise<T | undefined>
  • Type parameters

    • T

    Parameters

    • awaitable: Promise<T> | AsyncFunction<T, unknown>
    • timeout: number
    • error: Error

    Returns Promise<T>

zeroAddress

  • zeroAddress(): string
  • Returns string

zeros

  • zeros(bytes: number): Buffer
  • Parameters

    • bytes: number

    Returns Buffer