@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
43 lines • 1.88 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SimpleSmartAccountParamsSchema = exports.createBaseSmartAccountParamsSchema = void 0;
const zod_1 = require("abitype/zod");
const viem_1 = require("viem");
const zod_2 = __importDefault(require("zod"));
const schema_js_1 = require("../client/schema.js");
const index_js_1 = require("../entrypoint/index.js");
const schema_js_2 = require("../signer/schema.js");
const index_js_2 = require("../utils/index.js");
const createBaseSmartAccountParamsSchema = () => zod_2.default.object({
rpcClient: zod_2.default.union([
zod_2.default.string(),
(0, schema_js_1.createPublicErc4337ClientSchema)(),
]),
factoryAddress: zod_1.Address,
signer: zod_2.default.custom(schema_js_2.isSigner),
entryPointAddress: zod_1.Address.optional(),
chain: index_js_2.ChainSchema,
accountAddress: zod_1.Address.optional().describe("Optional override for the account address."),
initCode: zod_2.default
.string()
.refine((x) => (0, viem_1.isHex)(x, { strict: true }), "initCode must be a valid hex.")
.optional()
.describe("Optional override for the account init code."),
entryPointVersion: zod_2.default
.custom(index_js_1.isEntryPointVersion)
.optional(),
});
exports.createBaseSmartAccountParamsSchema = createBaseSmartAccountParamsSchema;
const SimpleSmartAccountParamsSchema = () => (0, exports.createBaseSmartAccountParamsSchema)()
.omit({
rpcClient: true,
})
.extend({
transport: zod_2.default.custom(),
salt: zod_2.default.bigint().optional(),
});
exports.SimpleSmartAccountParamsSchema = SimpleSmartAccountParamsSchema;
//# sourceMappingURL=schema.js.map