utils
Index
References
Namespaces
Enumerations
Classes
Interfaces
Type Aliases
- AccessList
- AccessListBuffer
- AccessListBufferItem
- AccessListEIP2930ValuesArray
- AccessListItem
- AccountBodyBuffer
- AddressLike
- AsyncFunction
- BigIntLike
- BufferLike
- ByteTypes
- DataFormat
- EtherUnits
- FeeMarketEIP1559ValuesArray
- FormatType
- NestedBufferArray
- NestedUint8Array
- NumberTypes
- PrefixedHexString
- ReconnectOptions
- ToBufferInputTypes
- TxData
- TxValuesArray
- TypeOutputReturnType
- TypedTransaction
- WithdrawalBuffer
- WithdrawalData
Variables
- AccessTupleType
- AddressType
- BlobNetworkTransactionWrapper
- BlobTransactionType
- DEFAULT_RETURN_FORMAT
- ECDSASignatureType
- ETH_DATA_FORMAT
- GWEI_TO_WEI
- KECCAK256_NULL
- KECCAK256_NULL_S
- KECCAK256_RLP
- KECCAK256_RLP_ARRAY
- KECCAK256_RLP_ARRAY_S
- KECCAK256_RLP_S
- KZGCommitmentType
- KZGProofType
- MAX_INTEGER
- MAX_INTEGER_BIGINT
- MAX_UINT64
- MAX_WITHDRAWALS_PER_PAYLOAD
- RLP_EMPTY_STRING
- SECP256K1_ORDER
- SECP256K1_ORDER_DIV_2
- SignedBlobTransactionType
- TWO_POW256
- ethUnitMap
Functions
- accountBodyFromSlim
- accountBodyToRLP
- accountBodyToSlim
- addHexPrefix
- arrToBufArr
- arrayContainsArray
- asciiToHex
- baToJSON
- bigIntToBuffer
- bigIntToHex
- bigIntToUnpaddedBuffer
- bufArrToArr
- bufferToBigInt
- bufferToHex
- bufferToInt
- bytesToBuffer
- bytesToHex
- checkAddressCheckSum
- compareBlockNumbers
- convert
- convertScalarValue
- ecrecover
- ecsign
- encodePacked
- format
- fromAscii
- fromDecimal
- fromRpcSig
- fromSigned
- fromTwosComplement
- fromUtf8
- fromWei
- generateAddress
- generateAddress2
- getBinarySize
- getKeys
- getStorageSlotNumForLongString
- hashPersonalMessage
- hexToAscii
- hexToBytes
- hexToNumber
- hexToNumberString
- hexToString
- hexToUtf8
- importPublic
- intToBuffer
- intToHex
- intToUnpaddedBuffer
- isAccessList
- isAccessListBuffer
- isAddress
- isBatchRequest
- isBatchResponse
- isBloom
- isContractAddressInBloom
- isDataFormat
- isHex
- isHexPrefixed
- isHexStrict
- isHexString
- isInBloom
- isNullish
- isPromise
- isResponseRpcError
- isResponseWithError
- isResponseWithNotification
- isResponseWithResult
- isSubscriptionResult
- isTopic
- isTopicInBloom
- isUserEthereumAddressInBloom
- isValidAddress
- isValidChecksumAddress
- isValidPrivate
- isValidPublic
- isValidResponse
- isValidSignature
- isZeroAddress
- keccak256Wrapper
- leftPad
- mergeDeep
- numberToHex
- padLeft
- padRight
- padToEven
- pollTillDefined
- privateToAddress
- privateToPublic
- processSolidityEncodePackedArgs
- pubToAddress
- publicToAddress
- randomBytes
- randomHex
- rejectIfConditionAtInterval
- rejectIfTimeout
- rightPad
- setLengthLeft
- setLengthRight
- setRequestIdStart
- sha3
- sha3Raw
- short
- soliditySha3
- soliditySha3Raw
- stringToHex
- stripHexPrefix
- toAscii
- toBatchPayload
- toBigInt
- toBuffer
- toChecksumAddress
- toCompactSig
- toDecimal
- toHex
- toNumber
- toPayload
- toRpcSig
- toTwosComplement
- toType
- toUnsigned
- toUtf8
- toWei
- unpadArray
- unpadBuffer
- unpadHexString
- utf8ToHex
- uuidV4
- validateNoLeadingZeroes
- validateResponse
- waitWithTimeout
- zeroAddress
- zeros
References
keccak256
Renames and re-exports keccak256Wrapper
Namespaces
jsonRpc
isBatchRequest
Parameters
request: JsonRpcBatchRequest | JsonRpcOptionalRequest<unknown> | JsonRpcRequest<unknown>
Returns request is JsonRpcBatchRequest
isBatchResponse
Type parameters
- Result = unknown
- Error_1 = unknown
Parameters
response: JsonRpcResponse<Result, Error_1>
Returns response is JsonRpcBatchResponse<Result, Error_1>
isResponseRpcError
Parameters
rpcError: JsonRpcResponseWithError<JsonRpcResult>
Returns boolean
isResponseWithError
Type parameters
- Error_1 = unknown
- Result = unknown
Parameters
response: JsonRpcResponse<Result, Error_1>
Returns response is JsonRpcResponseWithError<Error_1>
isResponseWithNotification
Type parameters
- Result
Parameters
response: JsonRpcSubscriptionResult | JsonRpcNotification<Result>
Returns response is JsonRpcNotification<Result>
isResponseWithResult
Type parameters
- Result = unknown
- Error_1 = unknown
Parameters
response: JsonRpcResponse<Result, Error_1>
Returns response is JsonRpcResponseWithResult<Result>
isSubscriptionResult
Type parameters
- Result
Parameters
response: JsonRpcSubscriptionResult | JsonRpcNotification<Result>
Returns response is JsonRpcSubscriptionResult
isValidResponse
Type parameters
- Result = unknown
- Error_1 = unknown
Parameters
response: JsonRpcResponse<Result, Error_1>
Returns boolean
setRequestIdStart
Parameters
start: undefined | number
Returns void
toBatchPayload
Parameters
requests: JsonRpcOptionalRequest<unknown>[]
Returns JsonRpcBatchRequest
toPayload
Type parameters
- ParamType = unknown[]
Parameters
request: JsonRpcOptionalRequest<ParamType>
Returns JsonRpcPayload<ParamType>
validateResponse
Type parameters
- Result = unknown
- Error_1 = unknown
Parameters
response: JsonRpcResponse<Result, Error_1>
Returns boolean
ssz
constBytes20
constUintBigInt64
constUintNum64
constWithdrawal
constWithdrawals
Enumerations
Capability
EIP1559FeeMarket
EIP155ReplayProtection
EIP2718TypedTransaction
EIP2930AccessLists
FMT_BYTES
BUFFER
HEX
UINT8ARRAY
FMT_NUMBER
BIGINT
HEX
NUMBER
STR
TypeOutput
BigInt
Buffer
Number
PrefixedHexString
Classes
Account
constructor
Parameters
optionalnonce: bigint
optionalbalance: bigint
optionalstorageRoot: Buffer
optionalcodeHash: Buffer
Returns Account
balance
codeHash
nonce
storageRoot
isContract
Returns boolean
isEmpty
Returns boolean
raw
Returns Buffer[]
serialize
Returns Buffer
staticfromAccountData
Parameters
accountData: AccountData
Returns Account
staticfromRlpSerializedAccount
Parameters
serialized: Buffer
Returns Account
staticfromValuesArray
Parameters
values: Buffer[]
Returns Account
Address
constructor
Parameters
buf: Buffer
Returns Address
readonlybuf
equals
Parameters
address: Address
Returns boolean
isPrecompileOrSystemAddress
Returns boolean
isZero
Returns boolean
toBuffer
Returns Buffer
toString
Returns string
staticfromPrivateKey
Parameters
privateKey: Buffer
Returns Address
staticfromPublicKey
Parameters
pubKey: Buffer
Returns Address
staticfromString
Parameters
str: string
Returns Address
staticgenerate
staticgenerate2
staticzero
Returns Address
AsyncEventEmitter
Type parameters
- T: EventMap
constructor
Type parameters
- T: EventMap
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
Type parameters
- E: string | number | symbol
Parameters
event: E & string
rest...args: Parameters<T[E]>
Returns boolean
eventNames
Returns (keyof T & string)[]
first
Type parameters
- E: string | number | symbol
Parameters
event: E & string
listener: T[E]
Returns AsyncEventEmitter<T>
getMaxListeners
Returns number
listenerCount
Parameters
event: keyof T & string
Returns number
listeners
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
Type parameters
- TransactionObject
constructor
Type parameters
- TransactionObject
Parameters
txData: TxData | AccessListEIP2930TxData | FeeMarketEIP1559TxData
opts: TxOptions
Returns BaseTransaction<TransactionObject>
readonlycommon
readonlydata
readonlygasLimit
readonlynonce
optionalreadonlyr
optionalreadonlys
optionalreadonlyto
optionalreadonlyv
readonlyvalue
type
Returns number
abstracterrorStr
Returns string
getBaseFee
Returns bigint
getDataFee
Returns bigint
abstractgetMessageToSign
Parameters
hashMessage: false
Returns Buffer | Buffer[]
abstractgetMessageToVerifySignature
Returns Buffer
getSenderAddress
Returns Address
abstractgetSenderPublicKey
Returns Buffer
abstractgetUpfrontCost
Returns bigint
abstracthash
Returns Buffer
isSigned
Returns boolean
abstractraw
abstractserialize
Returns Buffer
sign
Parameters
privateKey: Buffer
Returns TransactionObject
supports
Parameters
capability: Capability
Returns boolean
toCreationAddress
Returns boolean
abstracttoJSON
Returns JsonTx
validate
Returns boolean
verifySignature
Returns boolean
ChunkResponseParser
constructor
Parameters
eventEmitter: EventEmitter
autoReconnect: boolean
Returns ChunkResponseParser
onError
Parameters
optionalclearQueues: () => void
Returns void
parseResponse
Parameters
data: string
Returns JsonRpcResponse<JsonRpcResult, JsonRpcResult>[]
Common
constructor
Parameters
opts: CommonOpts
Returns Common
readonlyDEFAULT_HARDFORK
_calcForkHash
Parameters
hardfork: string
genesisHash: Buffer
Returns string
_getHardfork
Parameters
hardfork: string
Returns null | HardforkConfig
activeOnBlock
Parameters
blockNumber: BigIntLike
Returns boolean
bootstrapNodes
Returns BootstrapNodeConfig[]
chainId
Returns bigint
chainName
Returns string
consensusAlgorithm
Returns string
consensusConfig
Returns {}
[key string]: CliqueConfig | EthashConfig | CasperConfig
consensusType
Returns string
copy
Returns Common
dnsNetworks
Returns string[]
eipBlock
Parameters
eip: number
Returns null | bigint
eips
Returns number[]
forkHash
Parameters
optional_hardfork: string
optionalgenesisHash: Buffer
Returns string
genesis
Returns GenesisBlockConfig
getHardforkByBlockNumber
Parameters
_blockNumber: BigIntLike
optional_td: BigIntLike
optional_timestamp: BigIntLike
Returns string
gteHardfork
Parameters
hardfork: string
Returns boolean
hardfork
Returns string
hardforkBlock
Parameters
optional_hardfork: string
Returns null | bigint
hardforkForForkHash
Parameters
forkHash: string
Returns null | HardforkConfig
hardforkGteHardfork
Parameters
_hardfork1: null | string
hardfork2: string
Returns boolean
hardforkIsActiveOnBlock
Parameters
_hardfork: null | string
_blockNumber: BigIntLike
Returns boolean
hardforkTTD
Parameters
optional_hardfork: string
Returns null | bigint
hardforkTimestamp
Parameters
optional_hardfork: string
Returns null | bigint
hardforks
Returns HardforkConfig[]
isActivatedEIP
Parameters
eip: number
Returns boolean
isHardforkBlock
Parameters
_blockNumber: BigIntLike
optional_hardfork: string
Returns boolean
isNextHardforkBlock
Parameters
_blockNumber: BigIntLike
optional_hardfork: string
Returns boolean
networkId
Returns bigint
nextHardforkBlock
Parameters
optional_hardfork: string
Returns null | bigint
nextHardforkBlockOrTimestamp
Parameters
optional_hardfork: string
Returns null | bigint
param
Parameters
topic: string
name: string
Returns bigint
paramByBlock
Parameters
topic: string
name: string
blockNumber: BigIntLike
optionaltd: BigIntLike
optionaltimestamp: BigIntLike
Returns bigint
paramByEIP
Parameters
topic: string
name: string
eip: number
Returns undefined | bigint
paramByHardfork
Parameters
topic: string
name: string
hardfork: string
Returns bigint
setChain
Parameters
chain: string | number | bigint | object
Returns ChainConfig
setEIPs
Parameters
optionaleips: number[]
Returns void
setForkHashes
Parameters
genesisHash: Buffer
Returns void
setHardfork
Parameters
hardfork: string
Returns void
setHardforkByBlockNumber
Parameters
blockNumber: BigIntLike
optionaltd: BigIntLike
optionaltimestamp: BigIntLike
Returns string
static_getInitializedChains
Parameters
optionalcustomChains: ChainConfig[]
Returns ChainsConfig
staticcustom
Parameters
chainParamsOrName: Partial<ChainConfig> | CustomChain
optionalopts: CustomCommonOpts
Returns Common
staticfromGethGenesis
Parameters
genesisJson: any
__namedParameters: GethConfigOpts
Returns Common
staticisSupportedChainId
Parameters
chainId: bigint
Returns boolean
abstractEip1193Provider
Type parameters
- API: Web3APISpec = EthExecutionAPI
constructor
Type parameters
- API: unknown = EthExecutionAPI
Returns Eip1193Provider<API>
[symbol]
Returns boolean
abstractconnect
Returns void
abstractdisconnect
Parameters
optionalcode: number
optionaldata: string
Returns void
abstractgetStatus
Returns Web3ProviderStatus
abstracton
Parameters
type: disconnect
callback: Web3ProviderEventCallback<ProviderRpcError>
Returns void
optionalabstractonce
Type parameters
- T = JsonRpcResult
Parameters
type: string
callback: Web3ProviderEventCallback<T>
Returns void
optionalabstractremoveAllListeners
Parameters
type: string
Returns void
abstractremoveListener
Parameters
type: string
callback: Web3ProviderEventCallback<JsonRpcResult>
Returns void
abstractrequest
Type parameters
- Method: string
- ResultType = unknown
Parameters
args: Web3APIPayload<API, Method>
Returns Promise<JsonRpcResponseWithResult<ResultType>>
abstractreset
Returns void
send
Type parameters
- ResultType = JsonRpcResult
- P = unknown
Parameters
payload: JsonRpcPayload<P>
callback: (err?: null | Error, response?: JsonRpcResponse<ResultType, JsonRpcResult>) => void
Returns void
sendAsync
Type parameters
- R = JsonRpcResult
- P = unknown
Parameters
payload: JsonRpcPayload<P>
Returns Promise<JsonRpcResponse<R, JsonRpcResult>>
abstractsupportsSubscriptions
Returns boolean
staticisWeb3Provider
Parameters
provider: unknown
Returns boolean
Lock
constructor
Returns Lock
acquire
Returns Promise<boolean>
release
Returns void
abstractSocketProvider
Type parameters
- MessageEvent
- CloseEvent
- ErrorEvent
- API: Web3APISpec = EthExecutionAPI
constructor
Type parameters
- MessageEvent
- CloseEvent
- ErrorEvent
- API: unknown = EthExecutionAPI
Parameters
socketPath: string
optionalsocketOptions: unknown
optionalreconnectOptions: Partial<ReconnectOptions>
Returns SocketProvider<MessageEvent, CloseEvent, ErrorEvent, API>
SocketConnection
Returns unknown
[symbol]
Returns boolean
connect
Returns void
disconnect
Parameters
optionalcode: number
optionaldata: string
Returns void
abstractgetStatus
Returns Web3ProviderStatus
on
Type parameters
- T = JsonRpcResult
Parameters
type: string
callback: Web3ProviderEventCallback<T>
Returns void
once
Type parameters
- T = JsonRpcResult
Parameters
type: string
callback: Web3ProviderEventCallback<T>
Returns void
removeAllListeners
Parameters
type: string
Returns void
removeListener
Parameters
type: string
callback: Web3ProviderEventCallback<JsonRpcResult>
Returns void
request
Type parameters
- Method: string
- ResultType = Web3APIReturnType<API, Method>
Parameters
request: Web3APIPayload<API, Method>
Returns Promise<JsonRpcResponseWithResult<ResultType>>
reset
Returns void
send
Type parameters
- ResultType = JsonRpcResult
- P = unknown
Parameters
payload: JsonRpcPayload<P>
callback: (err?: null | Error, response?: JsonRpcResponse<ResultType, JsonRpcResult>) => void
Returns void
sendAsync
Type parameters
- R = JsonRpcResult
- P = unknown
Parameters
payload: JsonRpcPayload<P>
Returns Promise<JsonRpcResponse<R, JsonRpcResult>>
supportsSubscriptions
Returns boolean
staticisWeb3Provider
Parameters
provider: unknown
Returns boolean
TransactionFactory
staticfromBlockBodyData
Parameters
data: Buffer | Buffer[]
optionaltxOptions: TxOptions
Returns TypedTransaction
staticfromEthersProvider
Parameters
provider: string | JsonRpcProvider
txHash: string
optionaltxOptions: TxOptions
Returns Promise<TypedTransaction>
staticfromSerializedData
Parameters
data: Buffer
optionaltxOptions: TxOptions
Returns TypedTransaction
staticfromTxData
Parameters
txData: TxData | AccessListEIP2930TxData | FeeMarketEIP1559TxData | BlobEIP4844TxData
optionaltxOptions: TxOptions
Returns TypedTransaction
Web3DeferredPromise
Type parameters
- T
constructor
Type parameters
- T
Parameters
optional__namedParameters: { eagerStart: boolean; timeout: number; timeoutMessage: string }
Returns Web3DeferredPromise<T>
[toStringTag]
state
Returns pending | fulfilled | rejected
catch
Type parameters
- TResult
Parameters
optionalonrejected: (reason: any) => TResult | PromiseLike<TResult>
Returns Promise<T | TResult>
finally
Parameters
optionalonfinally: () => void
Returns Promise<T>
reject
Parameters
optionalreason: unknown
Returns void
resolve
Parameters
value: T | PromiseLike<T>
Returns void
startTimer
Returns void
then
Type parameters
- TResult1
- TResult2
Parameters
optionalonfulfilled: (value: T) => TResult1 | PromiseLike<TResult1>
optionalonrejected: (reason: unknown) => TResult2 | PromiseLike<TResult2>
Returns Promise<TResult1 | TResult2>
Withdrawal
constructor
Parameters
index: bigint
validatorIndex: bigint
address: Address
amount: bigint
Returns Withdrawal
readonlyaddress
readonlyamount
readonlyindex
readonlyvalidatorIndex
raw
Returns WithdrawalBuffer
toJSON
Returns { address: string; amount: string; index: string; validatorIndex: string }
address: string
amount: string
index: string
validatorIndex: string
toValue
Returns { address: Buffer; amount: bigint; index: bigint; validatorIndex: bigint }
address: Buffer
amount: bigint
index: bigint
validatorIndex: bigint
staticfromValuesArray
Parameters
withdrawalArray: WithdrawalBuffer
Returns Withdrawal
staticfromWithdrawalData
Parameters
withdrawalData: WithdrawalData
Returns Withdrawal
statictoBufferArray
Parameters
withdrawal: WithdrawalData | Withdrawal
Returns WithdrawalBuffer
Interfaces
AccessListEIP2930TxData
optionalaccessList
optionalchainId
optionaldata
optionalgasLimit
optionalgasPrice
optionalnonce
optionalr
optionals
optionalto
optionaltype
optionalv
optionalvalue
AccountData
optionalbalance
optionalcodeHash
optionalnonce
optionalstorageRoot
BlobEIP4844TxData
optionalaccessList
optionalblobs
optionalchainId
optionaldata
optionalgasLimit
optionalgasPrice
optionalkzgCommitments
optionalkzgProof
optionalmaxFeePerDataGas
optionalmaxFeePerGas
optionalmaxPriorityFeePerGas
optionalnonce
optionalr
optionals
optionalto
optionaltype
optionalv
optionalvalue
optionalversionedHashes
ECDSASignature
r
s
v
EventMap
FeeMarketEIP1559TxData
optionalaccessList
optionalchainId
optionaldata
optionalgasLimit
optionalgasPrice
optionalmaxFeePerGas
optionalmaxPriorityFeePerGas
optionalnonce
optionalr
optionals
optionalto
optionaltype
optionalv
optionalvalue
JsonRpcTx
optionalaccessList
blockHash
blockNumber
optionalchainId
from
gas
gasPrice
hash
input
optionalmaxFeePerDataGas
optionalmaxFeePerGas
optionalmaxPriorityFeePerGas
nonce
r
s
to
transactionIndex
type
v
value
optionalversionedHashes
JsonRpcWithdrawal
address
amount
index
validatorIndex
JsonTx
optionalaccessList
optionalchainId
optionaldata
optionalgasLimit
optionalgasPrice
optionalmaxFeePerDataGas
optionalmaxFeePerGas
optionalmaxPriorityFeePerGas
optionalnonce
optionalr
optionals
optionalto
optionaltype
optionalv
optionalvalue
optionalversionedHashes
TransformableToArray
toArray
Returns Uint8Array
optionaltoBuffer
Returns Buffer
TransformableToBuffer
optionaltoArray
Returns Uint8Array
toBuffer
Returns Buffer
TxOptions
optionalcommon
optionalfreeze
Type Aliases
AccessList
AccessListBuffer
AccessListBufferItem
AccessListEIP2930ValuesArray
AccessListItem
Type declaration
address: PrefixedHexString
storageKeys: PrefixedHexString[]
AccountBodyBuffer
AddressLike
AsyncFunction
Type parameters
- T
- K = unknown
Type declaration
Parameters
rest...args: K[]
Returns Promise<T>
BigIntLike
BufferLike
ByteTypes
Type declaration
BYTES_BUFFER: Buffer
BYTES_HEX: HexString
BYTES_UINT8ARRAY: Uint8Array
DataFormat
Type declaration
readonlybytes: FMT_BYTES
readonlynumber: FMT_NUMBER
EtherUnits
FeeMarketEIP1559ValuesArray
FormatType
Type parameters
- T
- F: DataFormat
NestedBufferArray
NestedUint8Array
NumberTypes
Type declaration
NUMBER_BIGINT: bigint
NUMBER_HEX: HexString
NUMBER_NUMBER: number
NUMBER_STR: string
PrefixedHexString
ReconnectOptions
Type declaration
autoReconnect: boolean
delay: number
maxAttempts: number
ToBufferInputTypes
TxData
Type declaration
optionaldata?: BufferLike
optionalgasLimit?: BigIntLike
optionalgasPrice?: BigIntLike | null
optionalnonce?: BigIntLike
optionalr?: BigIntLike
optionals?: BigIntLike
optionalto?: AddressLike
optionaltype?: BigIntLike
optionalv?: BigIntLike
optionalvalue?: BigIntLike
TxValuesArray
TypeOutputReturnType
Type declaration
0: number
1: bigint
2: Buffer
3: PrefixedHexString
TypedTransaction
WithdrawalBuffer
WithdrawalData
Type declaration
address: AddressLike
amount: BigIntLike
index: BigIntLike
validatorIndex: BigIntLike
Variables
constAccessTupleType
constAddressType
constBlobNetworkTransactionWrapper
constBlobTransactionType
constDEFAULT_RETURN_FORMAT
Type declaration
readonlybytes: FMT_BYTES.HEX
readonlynumber: FMT_NUMBER.BIGINT
constECDSASignatureType
constETH_DATA_FORMAT
Type declaration
readonlybytes: FMT_BYTES.HEX
readonlynumber: FMT_NUMBER.HEX
constGWEI_TO_WEI
constKECCAK256_NULL
constKECCAK256_NULL_S
constKECCAK256_RLP
constKECCAK256_RLP_ARRAY
constKECCAK256_RLP_ARRAY_S
constKECCAK256_RLP_S
constKZGCommitmentType
constKZGProofType
constMAX_INTEGER
constMAX_INTEGER_BIGINT
constMAX_UINT64
constMAX_WITHDRAWALS_PER_PAYLOAD
constRLP_EMPTY_STRING
constSECP256K1_ORDER
constSECP256K1_ORDER_DIV_2
constSignedBlobTransactionType
constTWO_POW256
constethUnitMap
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
Parameters
body: AccountBodyBuffer
Returns (Uint8Array | Buffer)[]
accountBodyToRLP
Parameters
body: AccountBodyBuffer
optionalcouldBeSlim: boolean
Returns Buffer
accountBodyToSlim
Parameters
body: AccountBodyBuffer
Returns (Uint8Array | Buffer)[]
addHexPrefix
Parameters
str: string
Returns string
arrToBufArr
Parameters
arr: Uint8Array
Returns Buffer
arrayContainsArray
Parameters
superset: unknown[]
subset: unknown[]
optionalsome: boolean
Returns boolean
asciiToHex
Parameters
str: string
Returns string
baToJSON
Parameters
ba: any
Returns any
bigIntToBuffer
Parameters
num: bigint
Returns Buffer
bigIntToHex
Parameters
num: bigint
Returns string
bigIntToUnpaddedBuffer
Parameters
value: bigint
Returns Buffer
bufArrToArr
Parameters
arr: Buffer
Returns Uint8Array
bufferToBigInt
Parameters
buf: Buffer
Returns bigint
bufferToHex
Parameters
_buf: Buffer
Returns string
bufferToInt
Parameters
buf: Buffer
Returns number
bytesToBuffer
Parameters
data: Bytes
Returns Buffer
bytesToHex
Parameters
bytes: Bytes
Returns string
checkAddressCheckSum
Parameters
data: string
Returns boolean
compareBlockNumbers
Parameters
blockA: BlockNumberOrTag
blockB: BlockNumberOrTag
Returns 0 | 1 | -1
convert
Parameters
data: unknown
schema: JsonSchema
dataPath: string[]
format: DataFormat
optionaloneOfPath: [string, number][]
Returns unknown
convertScalarValue
Parameters
value: unknown
ethType: string
format: DataFormat
Returns unknown
ecrecover
Parameters
msgHash: Buffer
v: bigint
r: Buffer
s: Buffer
optionalchainId: bigint
Returns Buffer
ecsign
Parameters
msgHash: Buffer
privateKey: Buffer
optionalchainId: bigint
Returns ECDSASignature
encodePacked
Parameters
rest...values: Sha3Input[]
Returns string
format
Type parameters
- DataType: unknown
- ReturnType_1: DataFormat
Parameters
schema: ValidationSchemaInput | JsonSchema
data: DataType
returnFormat: ReturnType_1
Returns FormatType<DataType, ReturnType_1>
fromAscii
Parameters
str: string
Returns string
fromDecimal
Parameters
value: Numbers
Returns string
fromRpcSig
Parameters
sig: string
Returns ECDSASignature
fromSigned
Parameters
num: Buffer
Returns bigint
fromTwosComplement
Parameters
value: Numbers
optionalnibbleWidth: number
Returns number | bigint
fromUtf8
Parameters
str: string
Returns string
fromWei
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
Parameters
from: Buffer
nonce: Buffer
Returns Buffer
generateAddress2
Parameters
from: Buffer
salt: Buffer
initCode: Buffer
Returns Buffer
getBinarySize
Parameters
str: string
Returns number
getKeys
Parameters
params: Record<string, string>[]
key: string
optionalallowEmpty: boolean
Returns string[]
getStorageSlotNumForLongString
Parameters
mainSlotNumber: string | number
Returns undefined | string
hashPersonalMessage
Parameters
message: Buffer
Returns Buffer
hexToAscii
Parameters
str: string
Returns string
hexToBytes
Parameters
bytes: string
Returns Buffer
hexToNumber
Parameters
value: string
Returns number | bigint
hexToNumberString
Parameters
data: string
Returns string
hexToString
Parameters
str: string
Returns string
hexToUtf8
Parameters
str: string
Returns string
importPublic
Parameters
_publicKey: Buffer
Returns Buffer
intToBuffer
Parameters
i: number
Returns Buffer
intToHex
Parameters
i: number
Returns string
intToUnpaddedBuffer
Parameters
value: number
Returns Buffer
isAccessList
Parameters
input: AccessListBuffer | AccessList
Returns input is AccessList
isAccessListBuffer
Parameters
input: AccessListBuffer | AccessList
Returns input is AccessListBuffer
isAddress
Parameters
value: ValidInputTypes
optionalcheckChecksum: boolean
Returns boolean
isBatchRequest
Parameters
request: JsonRpcBatchRequest | JsonRpcOptionalRequest<unknown> | JsonRpcRequest<unknown>
Returns request is JsonRpcBatchRequest
isBatchResponse
Type parameters
- Result = unknown
- Error_1 = unknown
Parameters
response: JsonRpcResponse<Result, Error_1>
Returns response is JsonRpcBatchResponse<Result, Error_1>
isBloom
Parameters
bloom: ValidInputTypes
Returns boolean
isContractAddressInBloom
Parameters
bloom: string
contractAddress: string
Returns boolean
isDataFormat
Parameters
dataFormat: unknown
Returns dataFormat is DataFormat
isHex
Parameters
hex: ValidInputTypes
Returns boolean
isHexPrefixed
Parameters
str: string
Returns boolean
isHexStrict
Parameters
hex: ValidInputTypes
Returns boolean
isHexString
Parameters
value: string
optionallength: number
Returns boolean
isInBloom
Parameters
bloom: string
value: string | Uint8Array
Returns boolean
isNullish
Parameters
item: unknown
Returns item is undefined | null
isPromise
Parameters
object: unknown
Returns boolean
isResponseRpcError
Parameters
rpcError: JsonRpcResponseWithError<JsonRpcResult>
Returns boolean
isResponseWithError
Type parameters
- Error_1 = unknown
- Result = unknown
Parameters
response: JsonRpcResponse<Result, Error_1>
Returns response is JsonRpcResponseWithError<Error_1>
isResponseWithNotification
Type parameters
- Result
Parameters
response: JsonRpcSubscriptionResult | JsonRpcNotification<Result>
Returns response is JsonRpcNotification<Result>
isResponseWithResult
Type parameters
- Result = unknown
- Error_1 = unknown
Parameters
response: JsonRpcResponse<Result, Error_1>
Returns response is JsonRpcResponseWithResult<Result>
isSubscriptionResult
Type parameters
- Result
Parameters
response: JsonRpcSubscriptionResult | JsonRpcNotification<Result>
Returns response is JsonRpcSubscriptionResult
isTopic
Parameters
topic: string
Returns boolean
isTopicInBloom
Parameters
bloom: string
topic: string
Returns boolean
isUserEthereumAddressInBloom
Parameters
bloom: string
ethereumAddress: string
Returns boolean
isValidAddress
Parameters
hexAddress: string
Returns boolean
isValidChecksumAddress
Parameters
hexAddress: string
Returns boolean
isValidPrivate
Parameters
privateKey: Buffer
Returns boolean
isValidPublic
Parameters
publicKey: Buffer
optionalsanitize: boolean
Returns boolean
isValidResponse
Type parameters
- Result = unknown
- Error_1 = unknown
Parameters
response: JsonRpcResponse<Result, Error_1>
Returns boolean
isValidSignature
Parameters
v: bigint
r: Buffer
s: Buffer
optionalhomesteadOrLater: boolean
optionalchainId: bigint
Returns boolean
isZeroAddress
Parameters
hexAddress: string
Returns boolean
keccak256Wrapper
Parameters
data: string | number | bigint | Buffer | ArrayBuffer | Uint8Array | readonly number[]
Returns string
leftPad
Parameters
value: Numbers
characterAmount: number
optionalsign: string
Returns string
mergeDeep
Parameters
destination: Record<string, unknown>
rest...sources: Record<string, unknown>[]
Returns Record<string, unknown>
numberToHex
Parameters
value: Numbers
Returns string
padLeft
Parameters
value: Numbers
characterAmount: number
optionalsign: string
Returns string
padRight
Parameters
value: Numbers
characterAmount: number
optionalsign: string
Returns string
padToEven
Parameters
value: string
Returns string
pollTillDefined
Type parameters
- T
Parameters
func: AsyncFunction<T, unknown>
interval: number
Returns Promise<Exclude<T, undefined>>
privateToAddress
Parameters
privateKey: Buffer
Returns Buffer
privateToPublic
Parameters
privateKey: Buffer
Returns Buffer
processSolidityEncodePackedArgs
Parameters
arg: Sha3Input
Returns string
pubToAddress
Parameters
_pubKey: Buffer
optionalsanitize: boolean
Returns Buffer
publicToAddress
Parameters
_pubKey: Buffer
optionalsanitize: boolean
Returns Buffer
randomBytes
Parameters
byteSize: number
Returns Buffer
randomHex
Parameters
byteSize: number
Returns string
rejectIfConditionAtInterval
Type parameters
- T
Parameters
cond: AsyncFunction<undefined | T, unknown>
interval: number
Returns [NodeJS.Timer, Promise<never>]
rejectIfTimeout
Parameters
timeout: number
error: Error
Returns [NodeJS.Timer, Promise<never>]
rightPad
Parameters
value: Numbers
characterAmount: number
optionalsign: string
Returns string
setLengthLeft
Parameters
msg: Buffer
length: number
Returns Buffer
setLengthRight
Parameters
msg: Buffer
length: number
Returns Buffer
setRequestIdStart
Parameters
start: undefined | number
Returns void
sha3
Parameters
data: Bytes
Returns undefined | string
sha3Raw
Parameters
data: Bytes
Returns string
short
Parameters
buffer: string | Buffer
optionalmaxLength: number
Returns string
soliditySha3
Parameters
rest...values: Sha3Input[]
Returns undefined | string
soliditySha3Raw
Parameters
rest...values: TypedObject[] | TypedObjectAbbreviated[]
Returns string
stringToHex
Parameters
str: string
Returns string
stripHexPrefix
Parameters
str: string
Returns string
toAscii
Parameters
str: string
Returns string
toBatchPayload
Parameters
requests: JsonRpcOptionalRequest<unknown>[]
Returns JsonRpcBatchRequest
toBigInt
Parameters
value: unknown
Returns bigint
toBuffer
Parameters
Returns Buffer
toChecksumAddress
Parameters
address: string
Returns string
toCompactSig
Parameters
v: bigint
r: Buffer
s: Buffer
optionalchainId: bigint
Returns string
toDecimal
Parameters
value: string
Returns number | bigint
toHex
Parameters
value: string | number | bigint | boolean | object | Buffer | ArrayBuffer | Uint8Array
optionalreturnType: boolean
Returns string
toNumber
Parameters
value: Numbers
Returns number | bigint
toPayload
Type parameters
- ParamType = unknown[]
Parameters
request: JsonRpcOptionalRequest<ParamType>
Returns JsonRpcPayload<ParamType>
toRpcSig
Parameters
v: bigint
r: Buffer
s: Buffer
optionalchainId: bigint
Returns string
toTwosComplement
Parameters
value: Numbers
optionalnibbleWidth: number
Returns string
toType
Type parameters
- T: TypeOutput
Parameters
input: null
outputType: T
Returns null
toUnsigned
Parameters
num: bigint
Returns Buffer
toUtf8
Parameters
str: string
Returns string
toWei
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
Parameters
a: number[]
Returns number[]
unpadBuffer
Parameters
a: Buffer
Returns Buffer
unpadHexString
Parameters
_a: string
Returns string
utf8ToHex
Parameters
str: string
Returns string
uuidV4
Returns string
validateNoLeadingZeroes
Parameters
values: {}
Returns void
validateResponse
Type parameters
- Result = unknown
- Error_1 = unknown
Parameters
response: JsonRpcResponse<Result, Error_1>
Returns boolean
waitWithTimeout
Type parameters
- T
Parameters
awaitable: Promise<T> | AsyncFunction<T, unknown>
timeout: number
error: Error
Returns Promise<T>
zeroAddress
Returns string
zeros
Parameters
bytes: number
Returns Buffer