web3-utils
Index
Classes
Enumerations
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
Interfaces
Namespaces
References
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
References
keccak256
Type Aliases
AccessList
AccessListBuffer
AccessListBufferItem
AccessListEIP2930ValuesArray
AccessListItem
Type declaration
address: PrefixedHexString
storageKeys: PrefixedHexString[]
AccountBodyBuffer
AddressLike
A type that represents an input that can be converted to an Address.
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
Buffer values array for a FeeMarketEIP1559Transaction
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
Legacy Transaction Data
Type declaration
optionaldata?: BufferLike
This will contain the data of the message or the init of a contract.
optionalgasLimit?: BigIntLike
The transaction’s gas limit.
optionalgasPrice?: BigIntLike | null
The transaction’s gas price.
optionalnonce?: BigIntLike
The transaction’s nonce.
optionalr?: BigIntLike
EC signature parameter.
optionals?: BigIntLike
EC signature parameter.
optionalto?: AddressLike
The transaction’s the address is sent to.
optionaltype?: BigIntLike
The transaction type
optionalv?: BigIntLike
EC recovery ID.
optionalvalue?: BigIntLike
The amount of Ether sent.
TxValuesArray
Buffer values array for a legacy Transaction
TypeOutputReturnType
Type declaration
0: number
1: bigint
2: Buffer
3: PrefixedHexString
TypedTransaction
Encompassing type for all transaction types.
Note that this also includes legacy txs which are referenced as Transaction for compatibility reasons.
WithdrawalBuffer
WithdrawalData
Flexible input data type for EIP-4895 withdrawal data with amount in Gwei to match CL representation and for eventual ssz withdrawalsRoot
Type declaration
address: AddressLike
amount: BigIntLike
index: BigIntLike
validatorIndex: BigIntLike
Variables
constAccessTupleType
constAddressType
EIP4844 types
constBlobNetworkTransactionWrapper
constBlobTransactionType
constDEFAULT_RETURN_FORMAT
Type declaration
bytes: HEX
number: BIGINT
constECDSASignatureType
constETH_DATA_FORMAT
Type declaration
bytes: HEX
number: HEX
constGWEI_TO_WEI
constKECCAK256_NULL
Keccak-256 hash of null
constKECCAK256_NULL_S
Keccak-256 hash of null
constKECCAK256_RLP
Keccak-256 hash of the RLP of null
constKECCAK256_RLP_ARRAY
Keccak-256 of an RLP of an empty array
constKECCAK256_RLP_ARRAY_S
Keccak-256 of an RLP of an empty array
constKECCAK256_RLP_S
Keccak-256 hash of the RLP of null
constKZGCommitmentType
constKZGProofType
constMAX_INTEGER
The max integer that the evm can handle (2^256-1)
constMAX_INTEGER_BIGINT
The max integer that the evm can handle (2^256-1) as a bigint 2^256-1 equals to 340282366920938463463374607431768211455 We use literal value instead of calculated value for compatibility issue.
constMAX_UINT64
2^64-1
constMAX_WITHDRAWALS_PER_PAYLOAD
constRLP_EMPTY_STRING
RLP encoded empty string
constSECP256K1_ORDER
constSECP256K1_ORDER_DIV_2
constSignedBlobTransactionType
constTWO_POW256
2^256
Buffer values array for an AccessListEIP2930Transaction