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

63 lines 2.74 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SmartAccountClientOptsSchema = exports.UserOperationFeeOptionsSchema = exports.UserOperationFeeOptionsSchema_v7 = exports.UserOperationFeeOptionsSchema_v6 = exports.UserOperationFeeOptionsFieldSchema = exports.ConnectionConfigSchema = exports.createPublicErc4337ClientSchema = void 0; const zod_1 = require("zod"); const index_js_1 = require("../utils/index.js"); const createPublicErc4337ClientSchema = () => zod_1.z.custom((provider) => { return (provider != null && typeof provider === "object" && "request" in provider && "type" in provider && "key" in provider && "name" in provider); }); exports.createPublicErc4337ClientSchema = createPublicErc4337ClientSchema; exports.ConnectionConfigSchema = zod_1.z.union([ zod_1.z.object({ rpcUrl: zod_1.z.never().optional(), apiKey: zod_1.z.string(), jwt: zod_1.z.never().optional(), }), zod_1.z.object({ rpcUrl: zod_1.z.never().optional(), apiKey: zod_1.z.never().optional(), jwt: zod_1.z.string(), }), zod_1.z.object({ rpcUrl: zod_1.z.string(), apiKey: zod_1.z.never().optional(), jwt: zod_1.z.never().optional(), }), zod_1.z.object({ rpcUrl: zod_1.z.string(), apiKey: zod_1.z.never().optional(), jwt: zod_1.z.string(), }), ]); exports.UserOperationFeeOptionsFieldSchema = index_js_1.BigNumberishRangeSchema.merge(index_js_1.MultiplierSchema).partial(); exports.UserOperationFeeOptionsSchema_v6 = zod_1.z .object({ maxFeePerGas: exports.UserOperationFeeOptionsFieldSchema, maxPriorityFeePerGas: exports.UserOperationFeeOptionsFieldSchema, callGasLimit: exports.UserOperationFeeOptionsFieldSchema, verificationGasLimit: exports.UserOperationFeeOptionsFieldSchema, preVerificationGas: exports.UserOperationFeeOptionsFieldSchema, }) .partial() .strict(); exports.UserOperationFeeOptionsSchema_v7 = exports.UserOperationFeeOptionsSchema_v6.extend({ paymasterVerificationGasLimit: exports.UserOperationFeeOptionsFieldSchema, paymasterPostOpGasLimit: exports.UserOperationFeeOptionsFieldSchema, }) .partial() .strict(); exports.UserOperationFeeOptionsSchema = exports.UserOperationFeeOptionsSchema_v7; exports.SmartAccountClientOptsSchema = zod_1.z .object({ txMaxRetries: zod_1.z.number().min(0).optional().default(5), txRetryIntervalMs: zod_1.z.number().min(0).optional().default(2000), txRetryMultiplier: zod_1.z.number().min(0).optional().default(1.5), feeOptions: exports.UserOperationFeeOptionsSchema.optional(), }) .strict(); //# sourceMappingURL=schema.js.map