A set of utilities for ERC-4337 Account Abstraction to help you with your development.
UserOperation utils
createUserOperationHash
Computes the hash of a UserOperation, which is used as the unique identifier for the operation on-chain.
- example.ts
- Param Types
- Return Type
example.ts
import { createUserOperationHash } from "abstractionkit";
const userOpHash = createUserOperationHash(
userOperation,
"0x0000000071727De22E5E9d8BAf0edAc6f37da032",
11155111n
);
| key | type | description |
|---|
useroperation | UserOperationV6 | UserOperationV7 | UserOperationV8 | UserOperationV9 | The UserOperation to hash |
entrypointAddress | string | The address of the EntryPoint contract |
chainId | bigint | The chain ID of the target network |
| key | type | description |
|---|
userOperationHash | string | The keccak256 hash of the packed UserOperation |
Source code
createUserOperationHash
createPackedUserOperationV6
Encodes a UserOperationV6 into its packed ABI representation, suitable for hashing or on-chain verification.
- example.ts
- Param Types
- Return Type
example.ts
import { createPackedUserOperationV6 } from "abstractionkit";
const packed = createPackedUserOperationV6(userOperationV6);
| key | type | description |
|---|
useroperation | UserOperationV6 | A UserOperation following the EntryPoint v0.6 format |
| key | type | description |
|---|
packedUserOperation | string | ABI-encoded packed representation of the UserOperation |
Source code
createPackedUserOperationV6
createPackedUserOperationV7
Encodes a UserOperationV7 into its packed ABI representation, suitable for hashing or on-chain verification.
- example.ts
- Param Types
- Return Type
example.ts
import { createPackedUserOperationV7 } from "abstractionkit";
const packed = createPackedUserOperationV7(userOperationV7);
| key | type | description |
|---|
useroperation | UserOperationV7 | A UserOperation following the EntryPoint v0.7 format |
| key | type | description |
|---|
packedUserOperation | string | ABI-encoded packed representation of the UserOperation |
Source code
createPackedUserOperationV7
fetchAccountNonce
Fetches the current nonce for a smart account from the EntryPoint. Accepts an optional key parameter (default 0) that enables parallel nonce channels, allowing multiple independent UserOperations to be submitted concurrently.
- example.ts
- Param Types
- Return Type
example.ts
import { fetchAccountNonce } from "abstractionkit";
const nonce = await fetchAccountNonce(
"https://ethereum-sepolia-rpc.publicnode.com",
"0x0000000071727De22E5E9d8BAf0edAc6f37da032",
"0xYourSmartAccountAddress"
);
| key | type | description |
|---|
rpcUrl | string | The JSON-RPC URL of an Ethereum node |
entryPoint | string | The address of the EntryPoint contract |
account | string | The smart account address to query the nonce for |
key | number | Nonce key for parallel nonce channels (default: 0). Using different keys allows multiple independent UserOperations to be submitted concurrently. |
| key | type | description |
|---|
nonce | Promise<bigint> | The current nonce of the account in the EntryPoint |
Source code
fetchAccountNonce
calculateUserOperationMaxGasCost
Calculates the maximum possible gas cost (in wei) for a UserOperation based on its gas limits and fee parameters.
- example.ts
- Param Types
- Return Type
example.ts
import { calculateUserOperationMaxGasCost } from "abstractionkit";
const maxCost = calculateUserOperationMaxGasCost(userOperation);
| key | type | description |
|---|
useroperation | UserOperationV6 | UserOperationV7 | The UserOperation to calculate the maximum gas cost for |
| key | type | description |
|---|
maxGasCost | bigint | The maximum gas cost in wei that the UserOperation could consume |
Source code
calculateUserOperationMaxGasCost
JsonRpcNode
JsonRpcNode wraps common Ethereum node calls behind the same Transport abstraction used by Bundler and Paymaster services. Use it for node reads instead of the removed top-level URL helpers fetchGasPrice, getBalanceOf, getDepositInfo, and getDelegatedAddress.
example.ts
import { GasOption, JsonRpcNode } from "abstractionkit";
const node = new JsonRpcNode("https://ethereum-sepolia-rpc.publicnode.com");
const [maxFeePerGas, maxPriorityFeePerGas] = await node.getFeeData(GasOption.Medium);
const deposit = await node.getEntryPointDeposit(
"0xYourAccountAddress",
"0x0000000071727De22E5E9d8BAf0edAc6f37da032",
);
const depositInfo = await node.getEntryPointDepositInfo(
"0xYourAccountAddress",
"0x0000000071727De22E5E9d8BAf0edAc6f37da032",
);
const delegatee = await node.getDelegatedAddress("0xYourEOAAddress");
transport.ts
import { JsonRpcNode, type Transport } from "abstractionkit";
const transport: Transport = {
request: async ({ method, params }, options) => {
return myRpcClient.request({ method, params }, { signal: options?.signal });
},
};
const node = new JsonRpcNode(transport);
const code = await node.getCode("0xYourAccountAddress");
Methods
chainId()
blockNumber()
getCode(address)
call(transaction)
getTransactionCount(address)
getFeeData(gasOption?)
getDelegatedAddress(eoaAddress)
getEntryPointNonce(entryPoint, account, key?)
getEntryPointDeposit(address, entryPoint)
getEntryPointDepositInfo(address, entryPoint)
request(args, options?)
Source code
JsonRpcNode
getBalanceOf
Deprecated in v0.3.8. Use JsonRpcNode#getEntryPointDeposit instead.
migration.ts
import { JsonRpcNode } from "abstractionkit";
const node = new JsonRpcNode("https://ethereum-sepolia-rpc.publicnode.com");
const balance = await node.getEntryPointDeposit(
"0xYourAccountAddress",
"0x0000000071727De22E5E9d8BAf0edAc6f37da032",
);
getDepositInfo
Deprecated in v0.3.8. Use JsonRpcNode#getEntryPointDepositInfo instead.
migration.ts
import { JsonRpcNode } from "abstractionkit";
const node = new JsonRpcNode("https://ethereum-sepolia-rpc.publicnode.com");
const info = await node.getEntryPointDepositInfo(
"0xYourAccountAddress",
"0x0000000071727De22E5E9d8BAf0edAc6f37da032",
);
getStorageAt
Reads the 32-byte storage word at a given slot via eth_getStorageAt.
- example.ts
- Param Types
- Return Types
example.ts
import { JsonRpcNode, SAFE_FALLBACK_HANDLER_STORAGE_SLOT } from "abstractionkit";
const node = new JsonRpcNode("https://ethereum-sepolia-rpc.publicnode.com");
const word = await node.getStorageAt(
"0xYourAccountAddress",
SAFE_FALLBACK_HANDLER_STORAGE_SLOT,
);
| key | type | description |
|---|
address | string | The contract address to read storage from. |
slot | string | The 32-byte storage slot, as a hex string. |
blockTag? | string | bigint | Block tag or number to read at. Defaults to "latest". |
| key | type | description |
|---|
word | Promise<string> | Resolves to the 32-byte storage word at the given slot, as a hex string. |
Source code
getStorageAt
Simulation utils
simulateUserOperationWithTenderlyAndCreateShareLink
Simulates a UserOperation via the EntryPoint's handleOps on Tenderly and returns a shareable dashboard link.
- example.ts
- Param Types
- Return Type
example.ts
import { simulateUserOperationWithTenderlyAndCreateShareLink } from "abstractionkit";
const { simulation, simulationShareLink } =
await simulateUserOperationWithTenderlyAndCreateShareLink(
"my-account",
"my-project",
"my-access-key",
11155111n,
"0x0000000071727De22E5E9d8BAf0edAc6f37da032",
userOperation
);
| key | type | description |
|---|
tenderlyAccountSlug | string | Your Tenderly account slug |
tenderlyProjectSlug | string | Your Tenderly project slug |
tenderlyAccessKey | string | Your Tenderly API access key |
chainId | bigint | The chain ID of the target network |
entrypointAddress | string | The address of the EntryPoint contract |
userOperation | UserOperationV6 | UserOperationV7 | UserOperationV8 | UserOperationV9 | The UserOperation to simulate |
blockNumber | number | null | Block number to simulate against (default: null for latest) |
stateOverrides? | OverrideType | null | Optional state overrides applied during simulation |
| key | type | description |
|---|
simulation | SingleTransactionTenderlySimulationResult | The simulation result from Tenderly |
simulationShareLink | string | A shareable Tenderly dashboard link for the simulation |
Source code
simulateUserOperationWithTenderlyAndCreateShareLink
simulateUserOperationCallDataWithTenderlyAndCreateShareLink
Simulates UserOperation callData with Tenderly and returns shareable links. Unlike simulateUserOperationWithTenderlyAndCreateShareLink, this simulates the inner call data rather than the full EntryPoint handleOps flow.
- example.ts
- Param Types
- Return Type
example.ts
import { simulateUserOperationCallDataWithTenderlyAndCreateShareLink } from "abstractionkit";
const { simulation, callDataSimulationShareLink } =
await simulateUserOperationCallDataWithTenderlyAndCreateShareLink(
"my-account",
"my-project",
"my-access-key",
11155111n,
"0x0000000071727De22E5E9d8BAf0edAc6f37da032",
userOperation
);
| key | type | description |
|---|
tenderlyAccountSlug | string | Your Tenderly account slug |
tenderlyProjectSlug | string | Your Tenderly project slug |
tenderlyAccessKey | string | Your Tenderly API access key |
chainId | bigint | The chain ID of the target network |
entrypointAddress | string | The address of the EntryPoint contract |
userOperation | UserOperationV6ToSimulate | UserOperationV7ToSimulate | UserOperationV8ToSimulate | UserOperationV9ToSimulate | A partial UserOperation with at least sender, nonce, and callData populated |
blockNumber | number | null | Block number to simulate against (default: null for latest) |
stateOverrides? | OverrideType | null | Optional state overrides applied during simulation |
| key | type | description |
|---|
simulation | TenderlySimulationResult | The simulation result from Tenderly |
callDataSimulationShareLink | string | A shareable Tenderly dashboard link for the callData simulation |
accountDeploymentSimulationShareLink? | string | A shareable link for the account deployment simulation, if a factory was provided |
Source code
simulateUserOperationCallDataWithTenderlyAndCreateShareLink
simulateSenderCallDataWithTenderlyAndCreateShareLink
Simulates sender callData directly with Tenderly and returns shareable links. Useful for simulating the execution of callData from a specific sender address without wrapping it in a full UserOperation.
- example.ts
- Param Types
- Return Type
example.ts
import { simulateSenderCallDataWithTenderlyAndCreateShareLink } from "abstractionkit";
const { simulation, callDataSimulationShareLink } =
await simulateSenderCallDataWithTenderlyAndCreateShareLink(
"my-account",
"my-project",
"my-access-key",
11155111n,
"0x0000000071727De22E5E9d8BAf0edAc6f37da032",
"0xSenderAddress",
"0xCallData"
);
| key | type | description |
|---|
tenderlyAccountSlug | string | Your Tenderly account slug |
tenderlyProjectSlug | string | Your Tenderly project slug |
tenderlyAccessKey | string | Your Tenderly API access key |
chainId | bigint | The chain ID of the target network |
entrypointAddress | string | The address of the EntryPoint contract |
sender | string | The sender address to simulate the call from |
callData | string | The call data to simulate |
factory | string | null | Factory address if the account needs deployment (default: null) |
factoryData | string | null | Factory init data for account deployment (default: null) |
blockNumber | number | null | Block number to simulate against (default: null for latest) |
stateOverrides? | OverrideType | null | Optional state overrides applied during simulation |
| key | type | description |
|---|
simulation | TenderlySimulationResult | The simulation result from Tenderly |
callDataSimulationShareLink | string | A shareable Tenderly dashboard link for the callData simulation |
accountDeploymentSimulationShareLink? | string | A shareable link for the account deployment simulation, if a factory was provided |
Source code
simulateSenderCallDataWithTenderlyAndCreateShareLink
Multicall utils
encodeMultiSendCallData
Encodes an array of MetaTransactions into a single callData payload for the MultiSend contract.
- example.ts
- Param Types
- Return Type
example.ts
import { encodeMultiSendCallData } from "abstractionkit";
const callData = encodeMultiSendCallData([
{
to: "0xTokenAddress",
value: 0n,
data: "0xTransferCallData",
operation: 0,
},
{
to: "0xAnotherContract",
value: 0n,
data: "0xAnotherCallData",
operation: 0,
},
]);
| key | type | description |
|---|
metaTransactions | MetaTransaction[] | Array of MetaTransactions to encode into a single MultiSend call |
MetaTransaction
| key | type | description |
|---|
to | string | Target contract address |
value | bigint | Value to send with the transaction (in wei) |
data | string | Call data for the transaction |
operation | Operation | Operation type: 0 for Call, 1 for DelegateCall |
| key | type | description |
|---|
callData | string | ABI-encoded callData for the MultiSend contract |
Source code
encodeMultiSendCallData
decodeMultiSendCallData
Decodes encoded MultiSend callData back into a readable representation.
- example.ts
- Param Types
- Return Type
example.ts
import { decodeMultiSendCallData } from "abstractionkit";
const decoded = decodeMultiSendCallData(encodedCallData);
| key | type | description |
|---|
callData | string | The encoded MultiSend callData to decode |
| key | type | description |
|---|
decoded | string | Decoded representation of the MultiSend transactions |
Source code
decodeMultiSendCallData
Generic Ethereum utils
fetchGasPrice
Deprecated in v0.3.8. Use JsonRpcNode#getFeeData instead.
migration.ts
import { GasOption, JsonRpcNode } from "abstractionkit";
const node = new JsonRpcNode("https://ethereum-sepolia-rpc.publicnode.com");
const [maxFeePerGas, maxPriorityFeePerGas] = await node.getFeeData(GasOption.Medium);
createCallData
Encodes a function call into ABI-encoded call data by combining a function selector with its encoded parameters.
- example.ts
- Param Types
- Return Type
example.ts
import { createCallData } from "abstractionkit";
const callData = createCallData(
"0xa9059cbb",
["address", "uint256"],
["0xRecipientAddress", 1000000n]
);
| key | type | description |
|---|
functionSelector | string | The 4-byte function selector (e.g. from getFunctionSelector) |
functionInputAbi | string[] | Array of ABI type strings for the function parameters (e.g. ["address", "uint256"]) |
functionInputParameters | AbiInputValue[] | Array of values matching the ABI types |
| key | type | description |
|---|
callData | string | The ABI-encoded call data combining the selector and encoded parameters |
Source code
createCallData
getFunctionSelector
Computes the 4-byte function selector from a Solidity function signature string.
- example.ts
- Param Types
- Return Type
example.ts
import { getFunctionSelector } from "abstractionkit";
const selector = getFunctionSelector("transfer(address,uint256)");
| key | type | description |
|---|
functionSignature | string | The function signature string (e.g. "transfer(address,uint256)") |
| key | type | description |
|---|
selector | string | The first 4 bytes (8 hex characters) of the keccak256 hash of the function signature |
Source code
getFunctionSelector
sendJsonRpcRequest
Sends a JSON-RPC request to the given URL. Accepts optional headers (defaults to {"Content-Type": "application/json"}) and an optional paramsKeyName for non-standard JSON-RPC endpoints.
- example.ts
- Param Types
- Return Type
example.ts
import { sendJsonRpcRequest } from "abstractionkit";
const result = await sendJsonRpcRequest(
"https://ethereum-sepolia-rpc.publicnode.com",
"eth_blockNumber",
[]
);
| key | type | description |
|---|
rpcUrl | string | The JSON-RPC endpoint URL |
method | string | The JSON-RPC method name |
params | JsonRpcParam | The parameters to pass to the JSON-RPC method |
headers | Record<string, string> | HTTP headers for the request (default: {"Content-Type": "application/json"}) |
paramsKeyName | string | Key name for the params field in the JSON-RPC body (default: "params"). Useful for non-standard JSON-RPC endpoints. |
| key | type | description |
|---|
result | Promise<JsonRpcResult> | The JSON-RPC result, or an error if the request failed |
Source code
sendJsonRpcRequest
sendEthCallRequest
Deprecated in v0.3.8. Use JsonRpcNode#call instead.
example.ts
import { JsonRpcNode } from "abstractionkit";
const node = new JsonRpcNode("https://ethereum-sepolia-rpc.publicnode.com");
const result = await node.call({
to: "0xContractAddress",
data: "0xCallData",
});
Source code
JsonRpcNode.call
sendEthGetCodeRequest
Deprecated in v0.3.8. Use JsonRpcNode#getCode instead.
example.ts
import { JsonRpcNode } from "abstractionkit";
const node = new JsonRpcNode("https://ethereum-sepolia-rpc.publicnode.com");
const code = await node.getCode("0xContractAddress");
Source code
JsonRpcNode.getCode
getDelegatedAddress
Deprecated in v0.3.8. Use JsonRpcNode#getDelegatedAddress instead.
migration.ts
import { JsonRpcNode } from "abstractionkit";
const node = new JsonRpcNode("https://ethereum-sepolia-rpc.publicnode.com");
const delegatee = await node.getDelegatedAddress("0xYourEOAAddress");
if (delegatee) {
console.log("Delegated to:", delegatee);
} else {
console.log("Not delegated");
}
Error and revert decoding
decodeUserOperationRevertReason
Reads the EntryPoint's UserOperationRevertReason log directly from a mined receipt and returns the decoded reason, with no extra RPC call. The result is matched to the receipt's userOpHash, so a multi-op bundle returns the right entry. The reason is an Error string, a Panic code, or empty when the inner call left no revert data (usually out-of-gas).
- example.ts
- Param Types
- Return Types
example.ts
import { decodeUserOperationRevertReason } from "abstractionkit";
const receipt = await response.included();
const revert = decodeUserOperationRevertReason(receipt);
if (revert.reverted) {
console.log(revert.errorMessage ?? revert.panicCode ?? "out of gas");
}
| key | type | description |
|---|
receipt | UserOperationReceiptResult | A mined UserOperation receipt. The function reads the EntryPoint's UserOperationRevertReason log from it directly, with no extra RPC call. |
| key | type | description |
|---|
UserOperationRevert | | key | type | description |
|---|
reverted | boolean | True when the receipt's success is false. | outOfGas | boolean | True when the inner call left no revert data. Usually out-of-gas, though a bare revert()/assert or a call to a non-contract also produce empty data. | errorMessage? | string | Decoded Error("...") string, when the call reverted with a reason. | panicCode? | number | Decoded Panic(uint256) code (0x11 overflow, 0x12 divide-by-zero, ...). | revertData | string | The raw revert data bytes, for custom errors or further decoding. |
| The decoded revert reason, matched to the receipt's userOpHash so multi-op bundles return the right entry. |
Source code
decodeUserOperationRevertReason
parseAaCode
Parses an EntryPoint AAxx revert code (e.g. AA21) out of an error message, so you can branch on a stable contract-defined code instead of matching message text. When a UserOperation fails, AbstractionKit also surfaces this code directly on AbstractionKitError.aaCode, so most callers can read error.aaCode without calling parseAaCode themselves.
- example.ts
- Param Types
- Return Types
example.ts
import { parseAaCode } from "abstractionkit";
try {
await smartAccount.sendUserOperation(userOperation, bundlerUrl);
} catch (error) {
if (error.aaCode === "AA21") {
}
const code = parseAaCode(error.message);
}
| key | type | description |
|---|
message | string | An error message string from a failed UserOperation. |
| key | type | description |
|---|
aaCode | string | undefined | The parsed EntryPoint AAxx revert code (e.g. "AA21"), or undefined when the message contains no AA code. |
Source code
parseAaCode
EIP-7702 Utilities
createAndSignEip7702DelegationAuthorization
Creates and signs an EIP-7702 delegation authorization, allowing an EOA to delegate its code to a specified contract address. Accepts either a hex-encoded private key string for synchronous signing, or an async signer callback (hash: string) => Promise<string> for use with viem, ethers Signers, hardware wallets, or MPC signers.
- example.ts
- Param Types
- Return Type
example.ts
import { createAndSignEip7702DelegationAuthorization } from "abstractionkit";
const authorization = createAndSignEip7702DelegationAuthorization(
11155111n,
"0xDelegateeContractAddress",
0n,
"0xYourPrivateKey"
);
const authorization = await createAndSignEip7702DelegationAuthorization(
11155111n,
"0xDelegateeContractAddress",
0n,
async (hash) => {
return await wallet.signMessage(hash);
}
);
| key | type | description |
|---|
chainId | bigint | The chain ID for the delegation authorization |
address | string | The contract address to delegate to |
nonce | bigint | The authorization nonce of the EOA |
signer | string | ((hash: string) => Promise<string>) | Either a hex-encoded private key for synchronous signing, or an async callback that receives the authorization hash and returns a signature. The callback form supports viem wallets, ethers Signers, hardware wallets, and MPC signers. |
| key | type | description |
|---|
authorization | Authorization7702Hex | The signed EIP-7702 delegation authorization |
Authorization7702Hex
| key | type | description |
|---|
chainId | string | Hex-encoded chain ID |
address | string | The delegatee contract address |
nonce | string | Hex-encoded authorization nonce |
yParity | string | Hex-encoded y-parity of the signature |
r | string | Hex-encoded r component of the signature |
s | string | Hex-encoded s component of the signature |
Source code
createAndSignEip7702DelegationAuthorization
createRevokeDelegationAuthorization
Creates a signed authorization that revokes an existing EIP-7702 delegation by setting the delegatee address to the zero address, restoring the EOA to a normal account.
- example.ts
- Param Types
- Return Type
example.ts
import { createRevokeDelegationAuthorization } from "abstractionkit";
const revokeAuth = createRevokeDelegationAuthorization(
11155111n,
0n,
"0xYourPrivateKey"
);
| key | type | description |
|---|
chainId | bigint | The chain ID for the revocation authorization |
nonce | bigint | The authorization nonce of the EOA |
eoaPrivateKey | string | The hex-encoded private key of the EOA |
| key | type | description |
|---|
authorization | Authorization7702Hex | A signed authorization that delegates to address(0), revoking the existing delegation |
Authorization7702Hex
| key | type | description |
|---|
chainId | string | Hex-encoded chain ID |
address | string | The delegatee contract address |
nonce | string | Hex-encoded authorization nonce |
yParity | string | Hex-encoded y-parity of the signature |
r | string | Hex-encoded r component of the signature |
s | string | Hex-encoded s component of the signature |
Source code
createRevokeDelegationAuthorization
createEip7702DelegationAuthorizationHash
Computes the keccak256 hash of an EIP-7702 delegation authorization using the MAGIC prefix (0x05) as defined in the EIP-7702 spec. Useful when signing the authorization externally.
- example.ts
- Param Types
- Return Type
example.ts
import { createEip7702DelegationAuthorizationHash } from "abstractionkit";
const hash = createEip7702DelegationAuthorizationHash(
11155111n,
"0xDelegateeContractAddress",
0n
);
| key | type | description |
|---|
chainId | bigint | The chain ID for the authorization |
address | string | The delegatee contract address |
nonce | bigint | The authorization nonce |
| key | type | description |
|---|
hash | string | The keccak256 hash of the RLP-encoded authorization with the MAGIC prefix (0x05), as specified by EIP-7702 |
Source code
createEip7702DelegationAuthorizationHash
createAndSignEip7702RawTransaction
Creates and signs a raw EIP-7702 (set-code, type 0x04) transaction with an authorization list. The transaction is RLP-encoded and includes the type prefix, ready for eth_sendRawTransaction.
- example.ts
- Param Types
- Return Type
example.ts
import { createAndSignEip7702RawTransaction } from "abstractionkit";
const rawTx = createAndSignEip7702RawTransaction(
11155111n,
0n,
2000000000n,
20000000000n,
21000n,
"0xDestination",
0n,
"0x",
[],
[authorization],
"0xYourPrivateKey"
);
| key | type | description |
|---|
chainId | bigint | The chain ID for the transaction |
nonce | bigint | The transaction nonce |
max_priority_fee_per_gas | bigint | Maximum priority fee per gas (EIP-1559) |
max_fee_per_gas | bigint | Maximum fee per gas (EIP-1559) |
gas_limit | bigint | Gas limit for the transaction |
destination | string | The target address for the transaction |
value | bigint | Value to send in wei |
data | string | The call data for the transaction |
access_list | [string, string[]][] | EIP-2930 access list: array of [address, storageKeys] tuples |
authorization_list | Authorization7702[] | Array of EIP-7702 authorizations to include in the transaction |
eoaPrivateKey | string | The hex-encoded private key to sign the transaction with |
| key | type | description |
|---|
rawTransaction | string | The signed, RLP-encoded EIP-7702 transaction with the 0x04 type prefix, ready for eth_sendRawTransaction |
Source code
createAndSignEip7702RawTransaction
createEip7702TransactionHash
Computes the keccak256 hash of an EIP-7702 transaction for signing purposes, using the type 0x04 prefix and RLP encoding.
- example.ts
- Param Types
- Return Type
example.ts
import { createEip7702TransactionHash } from "abstractionkit";
const txHash = createEip7702TransactionHash(
11155111n,
0n,
2000000000n,
20000000000n,
21000n,
"0xDestination",
0n,
"0x",
[],
[authorization]
);
| key | type | description |
|---|
chainId | bigint | The chain ID for the transaction |
nonce | bigint | The transaction nonce |
max_priority_fee_per_gas | bigint | Maximum priority fee per gas (EIP-1559) |
max_fee_per_gas | bigint | Maximum fee per gas (EIP-1559) |
gas_limit | bigint | Gas limit for the transaction |
destination | string | The target address for the transaction |
value | bigint | Value to send in wei |
data | string | The call data for the transaction |
access_list | [string, string[]][] | EIP-2930 access list: array of [address, storageKeys] tuples |
authorization_list | Authorization7702[] | Array of EIP-7702 authorizations to include in the transaction |
| key | type | description |
|---|
hash | string | The keccak256 hash of the RLP-encoded EIP-7702 transaction with the 0x04 type prefix, used for signing |
Source code
createEip7702TransactionHash