Skip to main content

Utilities

A set of utilities for ERC-4337 Account Abstraction to help you with your development.

UserOperation utils

createUserOperationHash

Source code

createUserOperationHash

createPackedUserOperationV6

Source code

createPackedUserOperationV6

createPackedUserOperationV7

Source code

createPackedUserOperationV7

fetchAccountNonce

Source code

fetchAccountNonce

calculateUserOperationMaxGasCost

Source code

calculateUserOperationMaxGasCost

getBalance

Returns the balance of an account in the EntryPoint contract.

Source code

getBalance

Simulates a UserOperation with Tenderly and returns a shareable link.

getDepositInfo

Returns the full deposit information of an account in the EntryPoint contract.

Source code

getDepositInfo

Multicall utils

encodeMultiSendCallData

Source code

encodeMultiSendCallData

decodeMultiSendCallData

Source code

decodeMultiSendCallData

Generic Ethereum utils

fetchGasPrice

Source code

fetchGasPrice

createCallData

Source code

createCallData

getFunctionSelector

Source code

getFunctionSelector

sendJsonRpcRequest

Source code

sendJsonRpcRequest

sendEthCallRequest

Source code

sendEthCallRequest

sendEthGetCodeRequest

Source code

sendEthGetCodeRequest