# Utilities

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

## UserOperation utils[​](#useroperation-utils "Direct link to UserOperation utils")

### createUserOperationHash[​](#createuseroperationhash "Direct link to createUserOperationHash")

#### Source code[​](#source-code "Direct link to Source code")

[createUserOperationHash](https://github.com/candidelabs/abstractionkit/blob/98853f30861382a534abf667ced83d47b6c9da0b/src/utils.ts#L28C17-L28C40)

### createPackedUserOperationV6[​](#createpackeduseroperationv6 "Direct link to createPackedUserOperationV6")

#### Source code[​](#source-code-1 "Direct link to Source code")

[createPackedUserOperationV6](https://github.com/candidelabs/abstractionkit/blob/98853f30861382a534abf667ced83d47b6c9da0b/src/utils.ts#L60C17-L60C44)

### createPackedUserOperationV7[​](#createpackeduseroperationv7 "Direct link to createPackedUserOperationV7")

#### Source code[​](#source-code-2 "Direct link to Source code")

[createPackedUserOperationV7](https://github.com/candidelabs/abstractionkit/blob/98853f30861382a534abf667ced83d47b6c9da0b/src/utils.ts#L100C17-L100C44)

### fetchAccountNonce[​](#fetchaccountnonce "Direct link to fetchAccountNonce")

#### Source code[​](#source-code-3 "Direct link to Source code")

[fetchAccountNonce](https://github.com/candidelabs/abstractionkit/blob/98853f30861382a534abf667ced83d47b6c9da0b/src/utils.ts#L273)

### calculateUserOperationMaxGasCost[​](#calculateuseroperationmaxgascost "Direct link to calculateUserOperationMaxGasCost")

#### Source code[​](#source-code-4 "Direct link to Source code")

[calculateUserOperationMaxGasCost](https://github.com/candidelabs/abstractionkit/blob/98853f30861382a534abf667ced83d47b6c9da0b/src/utils.ts#L349C17-L349C49)

### getBalance[​](#getbalance "Direct link to getBalance")

Returns the balance of an account in the EntryPoint contract.

#### Source code[​](#source-code-5 "Direct link to Source code")

[getBalance](https://github.com/candidelabs/abstractionkit/blob/b1826217624c1f7105fef58f56c3ffab93a57a4b/src/utils.ts#L457)

### simulateUserOperationWithTenderlyAndCreateShareLink[​](#simulateuseroperationwithtenderlyandcreatesharelink "Direct link to simulateUserOperationWithTenderlyAndCreateShareLink")

Simulates a UserOperation with Tenderly and returns a shareable link.

### getDepositInfo[​](#getdepositinfo "Direct link to getDepositInfo")

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

#### Source code[​](#source-code-6 "Direct link to Source code")

[getDepositInfo](https://github.com/candidelabs/abstractionkit/blob/b1826217624c1f7105fef58f56c3ffab93a57a4b/src/utils.ts#L468)

## Multicall utils[​](#multicall-utils "Direct link to Multicall utils")

### encodeMultiSendCallData[​](#encodemultisendcalldata "Direct link to encodeMultiSendCallData")

#### Source code[​](#source-code-7 "Direct link to Source code")

[encodeMultiSendCallData](https://github.com/candidelabs/abstractionkit/blob/98853f30861382a534abf667ced83d47b6c9da0b/src/account/Safe/multisend.ts#L25)

### decodeMultiSendCallData[​](#decodemultisendcalldata "Direct link to decodeMultiSendCallData")

#### Source code[​](#source-code-8 "Direct link to Source code")

[decodeMultiSendCallData](https://github.com/candidelabs/abstractionkit/blob/98853f30861382a534abf667ced83d47b6c9da0b/src/account/Safe/multisend.ts#L33C17-L33C40)

## Generic Ethereum utils[​](#generic-ethereum-utils "Direct link to Generic Ethereum utils")

### fetchGasPrice[​](#fetchgasprice "Direct link to fetchGasPrice")

#### Source code[​](#source-code-9 "Direct link to Source code")

[fetchGasPrice](https://github.com/candidelabs/abstractionkit/blob/98853f30861382a534abf667ced83d47b6c9da0b/src/utils.ts#L333)

### createCallData[​](#createcalldata "Direct link to createCallData")

#### Source code[​](#source-code-10 "Direct link to Source code")

[createCallData](https://github.com/candidelabs/abstractionkit/blob/98853f30861382a534abf667ced83d47b6c9da0b/src/utils.ts#L179)

### getFunctionSelector[​](#getfunctionselector "Direct link to getFunctionSelector")

#### Source code[​](#source-code-11 "Direct link to Source code")

[getFunctionSelector](https://github.com/candidelabs/abstractionkit/blob/98853f30861382a534abf667ced83d47b6c9da0b/src/utils.ts#L261)

### sendJsonRpcRequest[​](#sendjsonrpcrequest "Direct link to sendJsonRpcRequest")

#### Source code[​](#source-code-12 "Direct link to Source code")

[sendJsonRpcRequest](https://github.com/candidelabs/abstractionkit/blob/98853f30861382a534abf667ced83d47b6c9da0b/src/utils.ts#L194C23-L194C41)

### sendEthCallRequest[​](#sendethcallrequest "Direct link to sendEthCallRequest")

#### Source code[​](#source-code-13 "Direct link to Source code")

[sendEthCallRequest](https://github.com/candidelabs/abstractionkit/blob/98853f30861382a534abf667ced83d47b6c9da0b/src/utils.ts#L383)

### sendEthGetCodeRequest[​](#sendethgetcoderequest "Direct link to sendEthGetCodeRequest")

#### Source code[​](#source-code-14 "Direct link to Source code")

[sendEthGetCodeRequest](https://github.com/candidelabs/abstractionkit/blob/98853f30861382a534abf667ced83d47b6c9da0b/src/utils.ts#L424)
