UNPKG

@alchemy/aa-core

Version:

viem based SDK that enables interactions with ERC-4337 Smart Accounts. ABIs are based off the definitions generated in @account-abstraction/contracts

68 lines 3.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const viem_1 = require("viem"); const index_js_1 = require("../chains/index.js"); const EntryPointAbi_v6_js_1 = require("../abis/EntryPointAbi_v6.js"); const packUserOperation = (request) => { const hashedInitCode = (0, viem_1.keccak256)(request.initCode); const hashedCallData = (0, viem_1.keccak256)(request.callData); const hashedPaymasterAndData = (0, viem_1.keccak256)(request.paymasterAndData); return (0, viem_1.encodeAbiParameters)([ { type: "address" }, { type: "uint256" }, { type: "bytes32" }, { type: "bytes32" }, { type: "uint256" }, { type: "uint256" }, { type: "uint256" }, { type: "uint256" }, { type: "uint256" }, { type: "bytes32" }, ], [ request.sender, (0, viem_1.hexToBigInt)(request.nonce), hashedInitCode, hashedCallData, (0, viem_1.hexToBigInt)(request.callGasLimit), (0, viem_1.hexToBigInt)(request.verificationGasLimit), (0, viem_1.hexToBigInt)(request.preVerificationGas), (0, viem_1.hexToBigInt)(request.maxFeePerGas), (0, viem_1.hexToBigInt)(request.maxPriorityFeePerGas), hashedPaymasterAndData, ]); }; exports.default = { version: "0.6.0", address: { [index_js_1.mainnet.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", [index_js_1.sepolia.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", [index_js_1.goerli.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", [index_js_1.polygon.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", [index_js_1.polygonMumbai.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", [index_js_1.polygonAmoy.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", [index_js_1.optimism.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", [index_js_1.optimismGoerli.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", [index_js_1.optimismSepolia.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", [index_js_1.arbitrum.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", [index_js_1.arbitrumGoerli.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", [index_js_1.arbitrumSepolia.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", [index_js_1.base.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", [index_js_1.baseGoerli.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", [index_js_1.baseSepolia.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", [index_js_1.fraxtal.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", [index_js_1.fraxtalTestnet.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", [index_js_1.zora.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", [index_js_1.zoraSepolia.id]: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", }, abi: EntryPointAbi_v6_js_1.EntryPointAbi_v6, getUserOperationHash: (request, entryPointAddress, chainId) => { const encoded = (0, viem_1.encodeAbiParameters)([{ type: "bytes32" }, { type: "address" }, { type: "uint256" }], [ (0, viem_1.keccak256)(packUserOperation(request)), entryPointAddress, BigInt(chainId), ]); return (0, viem_1.keccak256)(encoded); }, packUserOperation, }; //# sourceMappingURL=0.6.js.map