@dynamic-labs-sdk/zerodev 0.17.4 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addZerodevExtension/addZerodevExtension.d.ts +1 -0
- package/dist/addZerodevExtension/addZerodevExtension.d.ts.map +1 -1
- package/dist/canSponsorUserOperation/canSponsorUserOperation.d.ts +1 -0
- package/dist/canSponsorUserOperation/canSponsorUserOperation.d.ts.map +1 -1
- package/dist/core.cjs.js +1 -1
- package/dist/core.esm.js +1 -1
- package/dist/createKernelClientForWalletAccount/createKernelClientForWalletAccount.d.ts +1 -0
- package/dist/createKernelClientForWalletAccount/createKernelClientForWalletAccount.d.ts.map +1 -1
- package/dist/estimateUserOperationGas/estimateUserOperationGas.d.ts +1 -0
- package/dist/estimateUserOperationGas/estimateUserOperationGas.d.ts.map +1 -1
- package/dist/getSignerForSmartWalletAccount/getSignerForSmartWalletAccount.d.ts +1 -0
- package/dist/getSignerForSmartWalletAccount/getSignerForSmartWalletAccount.d.ts.map +1 -1
- package/dist/{getZerodevRpc-DfIZRsGz.cjs.js → getZerodevRpc-BhK1F7dl.cjs.js} +12 -2
- package/dist/getZerodevRpc-BhK1F7dl.cjs.js.map +1 -0
- package/dist/{getZerodevRpc-BnYhE2ZX.esm.js → getZerodevRpc-Dnyu81cp.esm.js} +12 -2
- package/dist/getZerodevRpc-Dnyu81cp.esm.js.map +1 -0
- package/dist/index.cjs.js +19 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +19 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/isGasSponsorshipError/isGasSponsorshipError.d.ts +1 -0
- package/dist/isGasSponsorshipError/isGasSponsorshipError.d.ts.map +1 -1
- package/dist/isZerodevWalletAccount/isZerodevWalletAccount.d.ts +1 -0
- package/dist/isZerodevWalletAccount/isZerodevWalletAccount.d.ts.map +1 -1
- package/dist/sendUserOperation/sendUserOperation.d.ts +1 -0
- package/dist/sendUserOperation/sendUserOperation.d.ts.map +1 -1
- package/dist/signEip7702Authorization/signEip7702Authorization.d.ts +1 -0
- package/dist/signEip7702Authorization/signEip7702Authorization.d.ts.map +1 -1
- package/dist/simulateZerodevUserOperation/simulateZerodevUserOperation.d.ts +1 -0
- package/dist/simulateZerodevUserOperation/simulateZerodevUserOperation.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/calculateFeeForUserOperation/calculateFeeForUserOperation.d.ts +1 -0
- package/dist/utils/calculateFeeForUserOperation/calculateFeeForUserOperation.d.ts.map +1 -1
- package/dist/utils/calculateGasForUserOperation/calculateGasForUserOperation.d.ts +1 -0
- package/dist/utils/calculateGasForUserOperation/calculateGasForUserOperation.d.ts.map +1 -1
- package/dist/utils/createKernelAccount/createKernelAccount.d.ts +1 -0
- package/dist/utils/createKernelAccount/createKernelAccount.d.ts.map +1 -1
- package/dist/utils/createZerodevWalletProvider/createZerodevWalletProvider.d.ts +1 -0
- package/dist/utils/createZerodevWalletProvider/createZerodevWalletProvider.d.ts.map +1 -1
- package/dist/utils/getAllUserZerodevAddresses/getAllUserZerodevAddresses.d.ts +1 -0
- package/dist/utils/getAllUserZerodevAddresses/getAllUserZerodevAddresses.d.ts.map +1 -1
- package/dist/utils/getEcdsaValidator/getEcdsaValidator.d.ts +1 -0
- package/dist/utils/getEcdsaValidator/getEcdsaValidator.d.ts.map +1 -1
- package/dist/utils/getEntryPoint/getEntryPoint.d.ts +1 -0
- package/dist/utils/getEntryPoint/getEntryPoint.d.ts.map +1 -1
- package/dist/utils/getKernelVersion/getKernelVersion.d.ts +1 -0
- package/dist/utils/getKernelVersion/getKernelVersion.d.ts.map +1 -1
- package/dist/utils/getPaymasterConfig/getPaymasterConfig.d.ts +1 -0
- package/dist/utils/getPaymasterConfig/getPaymasterConfig.d.ts.map +1 -1
- package/dist/utils/getZerodevChainProviderForNetworkId/getZerodevChainProviderForNetworkId.d.ts +1 -0
- package/dist/utils/getZerodevChainProviderForNetworkId/getZerodevChainProviderForNetworkId.d.ts.map +1 -1
- package/dist/utils/getZerodevProviderFromSettings/getZerodevProviderFromSettings.d.ts +1 -0
- package/dist/utils/getZerodevProviderFromSettings/getZerodevProviderFromSettings.d.ts.map +1 -1
- package/dist/utils/getZerodevRpc/getZerodevRpc.d.ts +1 -0
- package/dist/utils/getZerodevRpc/getZerodevRpc.d.ts.map +1 -1
- package/dist/utils/hasRequiredGasFields/hasRequiredGasFields.d.ts +1 -0
- package/dist/utils/hasRequiredGasFields/hasRequiredGasFields.d.ts.map +1 -1
- package/dist/utils/prepareUserOperationFromCalls/prepareUserOperationFromCalls.d.ts +1 -0
- package/dist/utils/prepareUserOperationFromCalls/prepareUserOperationFromCalls.d.ts.map +1 -1
- package/dist/utils/shouldSignWithEoa/shouldSignWithEoa.d.ts +1 -0
- package/dist/utils/shouldSignWithEoa/shouldSignWithEoa.d.ts.map +1 -1
- package/dist/utils/shouldUseEIP7702/shouldUseEIP7702.d.ts +1 -0
- package/dist/utils/shouldUseEIP7702/shouldUseEIP7702.d.ts.map +1 -1
- package/dist/utils/signMessage/signMessage.d.ts +1 -0
- package/dist/utils/signMessage/signMessage.d.ts.map +1 -1
- package/dist/utils/zerodevTransferAmount/zerodevTransferAmount.d.ts +1 -0
- package/dist/utils/zerodevTransferAmount/zerodevTransferAmount.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/getZerodevRpc-BnYhE2ZX.esm.js.map +0 -1
- package/dist/getZerodevRpc-DfIZRsGz.cjs.js.map +0 -1
|
@@ -18,6 +18,7 @@ type CalculateFeeForUserOperationParams = {
|
|
|
18
18
|
* @param params.nativeTokenPriceUsd - Optional USD price of the native token for fee conversion.
|
|
19
19
|
* @returns Fee data including gas estimates and human-readable amounts.
|
|
20
20
|
* @throws {FeeEstimationFailedError} If fee calculation fails.
|
|
21
|
+
* @not-instrumented
|
|
21
22
|
*/
|
|
22
23
|
export declare const calculateFeeForUserOperation: ({ userOperationData, networkData: _networkData, nativeTokenPriceUsd, }: CalculateFeeForUserOperationParams) => EvmTransactionFeeData;
|
|
23
24
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculateFeeForUserOperation.d.ts","sourceRoot":"","sources":["../../../src/utils/calculateFeeForUserOperation/calculateFeeForUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI9D,KAAK,kCAAkC,GAAG;IACxC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,WAAW,CAAC;IACzB,iBAAiB,EAAE,IAAI,CACrB,aAAa,EACX,cAAc,GACd,sBAAsB,GACtB,oBAAoB,GACpB,cAAc,CACjB,CAAC;CACH,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"calculateFeeForUserOperation.d.ts","sourceRoot":"","sources":["../../../src/utils/calculateFeeForUserOperation/calculateFeeForUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI9D,KAAK,kCAAkC,GAAG;IACxC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,WAAW,CAAC;IACzB,iBAAiB,EAAE,IAAI,CACrB,aAAa,EACX,cAAc,GACd,sBAAsB,GACtB,oBAAoB,GACpB,cAAc,CACjB,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,4BAA4B,2EAItC,kCAAkC,KAAG,qBAgCvC,CAAC"}
|
|
@@ -2,6 +2,7 @@ import type { UserOperation } from 'viem/account-abstraction';
|
|
|
2
2
|
type CalculateGasForUserOperationParams = {
|
|
3
3
|
userOperationData: Pick<UserOperation, 'callGasLimit' | 'verificationGasLimit' | 'preVerificationGas' | 'maxFeePerGas'>;
|
|
4
4
|
};
|
|
5
|
+
/** @not-instrumented */
|
|
5
6
|
export declare const calculateGasForUserOperation: ({ userOperationData, }: CalculateGasForUserOperationParams) => bigint;
|
|
6
7
|
export {};
|
|
7
8
|
//# sourceMappingURL=calculateGasForUserOperation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculateGasForUserOperation.d.ts","sourceRoot":"","sources":["../../../src/utils/calculateGasForUserOperation/calculateGasForUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,KAAK,kCAAkC,GAAG;IACxC,iBAAiB,EAAE,IAAI,CACrB,aAAa,EACX,cAAc,GACd,sBAAsB,GACtB,oBAAoB,GACpB,cAAc,CACjB,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,4BAA4B,2BAEtC,kCAAkC,KAAG,MAWvC,CAAC"}
|
|
1
|
+
{"version":3,"file":"calculateGasForUserOperation.d.ts","sourceRoot":"","sources":["../../../src/utils/calculateGasForUserOperation/calculateGasForUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,KAAK,kCAAkC,GAAG;IACxC,iBAAiB,EAAE,IAAI,CACrB,aAAa,EACX,cAAc,GACd,sBAAsB,GACtB,oBAAoB,GACpB,cAAc,CACjB,CAAC;CACH,CAAC;AAEF,wBAAwB;AACxB,eAAO,MAAM,4BAA4B,2BAEtC,kCAAkC,KAAG,MAWvC,CAAC"}
|
|
@@ -19,6 +19,7 @@ type CreateKernelAccountParams = {
|
|
|
19
19
|
* @param [params.eip7702Auth] - A pre-signed EIP-7702 authorization. When provided, this authorization is passed to the ZeroDev SDK instead of signing a new one internally. Useful for singleUse MFA flows.
|
|
20
20
|
* @param client - The Dynamic client instance.
|
|
21
21
|
* @returns A promise that resolves to a ZeroDev kernel account.
|
|
22
|
+
* @not-instrumented
|
|
22
23
|
*/
|
|
23
24
|
export declare const createKernelAccount: ({ publicClient, smartWalletAccount, eip7702Auth }: CreateKernelAccountParams, client: DynamicClient) => Promise<CreateKernelAccountReturnType<EntryPointVersion>>;
|
|
24
25
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createKernelAccount.d.ts","sourceRoot":"","sources":["../../../src/utils/createKernelAccount/createKernelAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAK9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EACL,KAAK,6BAA6B,EAGnC,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AASjE,KAAK,yBAAyB,GAAG;IAC/B,WAAW,CAAC,EAAE,2BAA2B,CAAC;IAC1C,YAAY,EAAE,YAAY,CAAC;IAC3B,kBAAkB,EAAE,gBAAgB,CAAC;CACtC,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"createKernelAccount.d.ts","sourceRoot":"","sources":["../../../src/utils/createKernelAccount/createKernelAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAK9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EACL,KAAK,6BAA6B,EAGnC,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AASjE,KAAK,yBAAyB,GAAG;IAC/B,WAAW,CAAC,EAAE,2BAA2B,CAAC;IAC1C,YAAY,EAAE,YAAY,CAAC;IAC3B,kBAAkB,EAAE,gBAAgB,CAAC;CACtC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,sDACqB,yBAAyB,UACpE,aAAa,KACpB,OAAO,CAAC,6BAA6B,CAAC,iBAAiB,CAAC,CA8E1D,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type DynamicClient } from '@dynamic-labs-sdk/client';
|
|
2
2
|
import { type EvmWalletProvider } from '@dynamic-labs-sdk/evm';
|
|
3
|
+
/** @not-instrumented */
|
|
3
4
|
export declare const createZerodevWalletProvider: (client: DynamicClient) => EvmWalletProvider;
|
|
4
5
|
//# sourceMappingURL=createZerodevWalletProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createZerodevWalletProvider.d.ts","sourceRoot":"","sources":["../../../src/utils/createZerodevWalletProvider/createZerodevWalletProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAInB,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,uBAAuB,CAAC;AAS/B,eAAO,MAAM,2BAA2B,WAC9B,aAAa,KACpB,iBA2EF,CAAC"}
|
|
1
|
+
{"version":3,"file":"createZerodevWalletProvider.d.ts","sourceRoot":"","sources":["../../../src/utils/createZerodevWalletProvider/createZerodevWalletProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAInB,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,uBAAuB,CAAC;AAS/B,wBAAwB;AACxB,eAAO,MAAM,2BAA2B,WAC9B,aAAa,KACpB,iBA2EF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAllUserZerodevAddresses.d.ts","sourceRoot":"","sources":["../../../src/utils/getAllUserZerodevAddresses/getAllUserZerodevAddresses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAM9D,eAAO,MAAM,0BAA0B,WAAY,aAAa,KAAG,MAAM,EAmBxE,CAAC"}
|
|
1
|
+
{"version":3,"file":"getAllUserZerodevAddresses.d.ts","sourceRoot":"","sources":["../../../src/utils/getAllUserZerodevAddresses/getAllUserZerodevAddresses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAM9D,wBAAwB;AACxB,eAAO,MAAM,0BAA0B,WAAY,aAAa,KAAG,MAAM,EAmBxE,CAAC"}
|
|
@@ -8,6 +8,7 @@ type GetEcdsaValidatorParams = {
|
|
|
8
8
|
publicClient: Client;
|
|
9
9
|
signer: Signer;
|
|
10
10
|
};
|
|
11
|
+
/** @not-instrumented */
|
|
11
12
|
export declare const getEcdsaValidator: ({ ecdsaProviderType, publicClient, signer, entryPoint, kernelVersion, }: GetEcdsaValidatorParams) => Promise<import("@zerodev/sdk").KernelValidator<"MultiChainECDSAValidator">> | Promise<import("@zerodev/sdk").KernelValidator<"ECDSAValidator">>;
|
|
12
13
|
export {};
|
|
13
14
|
//# sourceMappingURL=getEcdsaValidator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEcdsaValidator.d.ts","sourceRoot":"","sources":["../../../src/utils/getEcdsaValidator/getEcdsaValidator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,MAAM,EACP,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,KAAK,uBAAuB,GAAG;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAC;IAC9C,aAAa,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,iBAAiB,4EAM3B,uBAAuB,oJAYzB,CAAC"}
|
|
1
|
+
{"version":3,"file":"getEcdsaValidator.d.ts","sourceRoot":"","sources":["../../../src/utils/getEcdsaValidator/getEcdsaValidator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,MAAM,EACP,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,KAAK,uBAAuB,GAAG;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAC;IAC9C,aAAa,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAwB;AACxB,eAAO,MAAM,iBAAiB,4EAM3B,uBAAuB,oJAYzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEntryPoint.d.ts","sourceRoot":"","sources":["../../../src/utils/getEntryPoint/getEntryPoint.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,gBAAiB,MAAM,4GAOhD,CAAC"}
|
|
1
|
+
{"version":3,"file":"getEntryPoint.d.ts","sourceRoot":"","sources":["../../../src/utils/getEntryPoint/getEntryPoint.ts"],"names":[],"mappings":"AAGA,wBAAwB;AACxB,eAAO,MAAM,aAAa,gBAAiB,MAAM,4GAOhD,CAAC"}
|
|
@@ -5,6 +5,7 @@ type GetKernelVersionParams = {
|
|
|
5
5
|
entryPoint: EntryPointType<EntryPointVersion>;
|
|
6
6
|
kernelVersion: ProviderKernelVersionEnum | undefined;
|
|
7
7
|
};
|
|
8
|
+
/** @not-instrumented */
|
|
8
9
|
export declare const getKernelVersion: ({ kernelVersion, entryPoint, }: GetKernelVersionParams) => "0.3.0" | "0.3.1" | "0.3.2" | "0.3.3" | "0.0.2" | "0.2.2" | "0.2.3" | "0.2.4";
|
|
9
10
|
export {};
|
|
10
11
|
//# sourceMappingURL=getKernelVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getKernelVersion.d.ts","sourceRoot":"","sources":["../../../src/utils/getKernelVersion/getKernelVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAE5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAC;IAC9C,aAAa,EAAE,yBAAyB,GAAG,SAAS,CAAC;CACtD,CAAC;AAEF,eAAO,MAAM,gBAAgB,mCAG1B,sBAAsB,kFAexB,CAAC"}
|
|
1
|
+
{"version":3,"file":"getKernelVersion.d.ts","sourceRoot":"","sources":["../../../src/utils/getKernelVersion/getKernelVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAE5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,KAAK,sBAAsB,GAAG;IAC5B,UAAU,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAC;IAC9C,aAAa,EAAE,yBAAyB,GAAG,SAAS,CAAC;CACtD,CAAC;AAEF,wBAAwB;AACxB,eAAO,MAAM,gBAAgB,mCAG1B,sBAAsB,kFAexB,CAAC"}
|
|
@@ -9,6 +9,7 @@ type GetPaymasterConfigProps = {
|
|
|
9
9
|
gasTokenAddress?: Hex;
|
|
10
10
|
paymasterRpc: string;
|
|
11
11
|
};
|
|
12
|
+
/** @not-instrumented */
|
|
12
13
|
export declare const getPaymasterConfig: ({ chain, gasTokenAddress, paymasterRpc, }: GetPaymasterConfigProps) => {
|
|
13
14
|
paymaster: {
|
|
14
15
|
getPaymasterData: (params: GetPaymasterDataParameters) => Promise<import("@zerodev/sdk").SponsorUserOperationReturnType>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPaymasterConfig.d.ts","sourceRoot":"","sources":["../../../src/utils/getPaymasterConfig/getPaymasterConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAEpD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAE3E,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,kBAAkB,8CAI5B,uBAAuB;;mCACU,0BAA0B;;CAiB7D,CAAC"}
|
|
1
|
+
{"version":3,"file":"getPaymasterConfig.d.ts","sourceRoot":"","sources":["../../../src/utils/getPaymasterConfig/getPaymasterConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAEpD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAE3E,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAwB;AACxB,eAAO,MAAM,kBAAkB,8CAI5B,uBAAuB;;mCACU,0BAA0B;;CAiB7D,CAAC"}
|
package/dist/utils/getZerodevChainProviderForNetworkId/getZerodevChainProviderForNetworkId.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { DynamicClient } from '@dynamic-labs-sdk/client';
|
|
|
2
2
|
type GetZerodevChainProviderForNetworkIdProps = {
|
|
3
3
|
networkId: string;
|
|
4
4
|
};
|
|
5
|
+
/** @not-instrumented */
|
|
5
6
|
export declare const getZerodevChainProviderForNetworkId: ({ networkId }: GetZerodevChainProviderForNetworkIdProps, client: DynamicClient) => import("@dynamic-labs/sdk-api-core").ProviderMultichainAccountAbstractionProviders | undefined;
|
|
6
7
|
export {};
|
|
7
8
|
//# sourceMappingURL=getZerodevChainProviderForNetworkId.d.ts.map
|
package/dist/utils/getZerodevChainProviderForNetworkId/getZerodevChainProviderForNetworkId.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getZerodevChainProviderForNetworkId.d.ts","sourceRoot":"","sources":["../../../src/utils/getZerodevChainProviderForNetworkId/getZerodevChainProviderForNetworkId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI9D,KAAK,wCAAwC,GAAG;IAC9C,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,mCAAmC,kBAC/B,wCAAwC,UAC/C,aAAa,mGAOtB,CAAC"}
|
|
1
|
+
{"version":3,"file":"getZerodevChainProviderForNetworkId.d.ts","sourceRoot":"","sources":["../../../src/utils/getZerodevChainProviderForNetworkId/getZerodevChainProviderForNetworkId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI9D,KAAK,wCAAwC,GAAG;IAC9C,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAwB;AACxB,eAAO,MAAM,mCAAmC,kBAC/B,wCAAwC,UAC/C,aAAa,mGAOtB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { DynamicClient } from '@dynamic-labs-sdk/client';
|
|
2
|
+
/** @not-instrumented */
|
|
2
3
|
export declare const getZerodevProviderFromSettings: (client: DynamicClient) => import("@dynamic-labs/sdk-api-core").Provider;
|
|
3
4
|
//# sourceMappingURL=getZerodevProviderFromSettings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getZerodevProviderFromSettings.d.ts","sourceRoot":"","sources":["../../../src/utils/getZerodevProviderFromSettings/getZerodevProviderFromSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI9D,eAAO,MAAM,8BAA8B,WAAY,aAAa,kDAenE,CAAC"}
|
|
1
|
+
{"version":3,"file":"getZerodevProviderFromSettings.d.ts","sourceRoot":"","sources":["../../../src/utils/getZerodevProviderFromSettings/getZerodevProviderFromSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI9D,wBAAwB;AACxB,eAAO,MAAM,8BAA8B,WAAY,aAAa,kDAenE,CAAC"}
|
|
@@ -5,6 +5,7 @@ type GetZerodevRpcParams = {
|
|
|
5
5
|
networkId: string;
|
|
6
6
|
rpcType: 'paymaster' | 'bundler';
|
|
7
7
|
};
|
|
8
|
+
/** @not-instrumented */
|
|
8
9
|
export declare const getZerodevRpc: ({ networkId, bundlerProvider, rpcType }: GetZerodevRpcParams, client: DynamicClient) => string;
|
|
9
10
|
export {};
|
|
10
11
|
//# sourceMappingURL=getZerodevRpc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getZerodevRpc.d.ts","sourceRoot":"","sources":["../../../src/utils/getZerodevRpc/getZerodevRpc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAMpE,KAAK,mBAAmB,GAAG;IACzB,eAAe,CAAC,EAAE,sBAAsB,CAAC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,WAAW,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,aAAa,4CACiB,mBAAmB,UACpD,aAAa,WA2BtB,CAAC"}
|
|
1
|
+
{"version":3,"file":"getZerodevRpc.d.ts","sourceRoot":"","sources":["../../../src/utils/getZerodevRpc/getZerodevRpc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAMpE,KAAK,mBAAmB,GAAG;IACzB,eAAe,CAAC,EAAE,sBAAsB,CAAC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,WAAW,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,wBAAwB;AACxB,eAAO,MAAM,aAAa,4CACiB,mBAAmB,UACpD,aAAa,WA2BtB,CAAC"}
|
|
@@ -22,6 +22,7 @@ type UserOperationWithGasFields = Pick<UserOperation, 'callGasLimit' | 'verifica
|
|
|
22
22
|
* });
|
|
23
23
|
* }
|
|
24
24
|
* ```
|
|
25
|
+
* @not-instrumented
|
|
25
26
|
*/
|
|
26
27
|
export declare const hasRequiredGasFields: (userOperation: Partial<UserOperation>) => userOperation is Partial<UserOperation> & UserOperationWithGasFields;
|
|
27
28
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasRequiredGasFields.d.ts","sourceRoot":"","sources":["../../../src/utils/hasRequiredGasFields/hasRequiredGasFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,KAAK,0BAA0B,GAAG,IAAI,CACpC,aAAa,EACX,cAAc,GACd,sBAAsB,GACtB,oBAAoB,GACpB,cAAc,CACjB,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"hasRequiredGasFields.d.ts","sourceRoot":"","sources":["../../../src/utils/hasRequiredGasFields/hasRequiredGasFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,KAAK,0BAA0B,GAAG,IAAI,CACpC,aAAa,EACX,cAAc,GACd,sBAAsB,GACtB,oBAAoB,GACpB,cAAc,CACjB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,oBAAoB,kBAChB,OAAO,CAAC,aAAa,CAAC,KACpC,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC,GAAG,0BAM1C,CAAC"}
|
|
@@ -11,6 +11,7 @@ export type PrepareUserOperationFromCallsParams = {
|
|
|
11
11
|
* @param params.kernelClient - The kernel client to use for preparing the user operation
|
|
12
12
|
* @param params.calls - Array of calls (can be single call or multiple calls)
|
|
13
13
|
* @returns Promise resolving to the prepared user operation
|
|
14
|
+
* @not-instrumented
|
|
14
15
|
*/
|
|
15
16
|
export declare const prepareUserOperationFromCalls: ({ kernelClient, calls, }: PrepareUserOperationFromCallsParams) => Promise<{
|
|
16
17
|
callData: import("viem").Hex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareUserOperationFromCalls.d.ts","sourceRoot":"","sources":["../../../src/utils/prepareUserOperationFromCalls/prepareUserOperationFromCalls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,MAAM,mCAAmC,GAAG;IAChD,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"prepareUserOperationFromCalls.d.ts","sourceRoot":"","sources":["../../../src/utils/prepareUserOperationFromCalls/prepareUserOperationFromCalls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,MAAM,mCAAmC,GAAG;IAChD,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,6BAGvC,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAarC,CAAC"}
|
|
@@ -5,6 +5,7 @@ type ShouldSignWithEoaParams = {
|
|
|
5
5
|
kernelClient: KernelClient;
|
|
6
6
|
smartWalletAccount: EvmWalletAccount;
|
|
7
7
|
};
|
|
8
|
+
/** @not-instrumented */
|
|
8
9
|
export declare const shouldSignWithEoa: ({ kernelClient, smartWalletAccount }: ShouldSignWithEoaParams, client: DynamicClient) => Promise<boolean>;
|
|
9
10
|
export {};
|
|
10
11
|
//# sourceMappingURL=shouldSignWithEoa.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shouldSignWithEoa.d.ts","sourceRoot":"","sources":["../../../src/utils/shouldSignWithEoa/shouldSignWithEoa.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,KAAK,uBAAuB,GAAG;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,kBAAkB,EAAE,gBAAgB,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,iBAAiB,yCACU,uBAAuB,UACrD,aAAa,qBAWtB,CAAC"}
|
|
1
|
+
{"version":3,"file":"shouldSignWithEoa.d.ts","sourceRoot":"","sources":["../../../src/utils/shouldSignWithEoa/shouldSignWithEoa.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,KAAK,uBAAuB,GAAG;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,kBAAkB,EAAE,gBAAgB,CAAC;CACtC,CAAC;AAEF,wBAAwB;AACxB,eAAO,MAAM,iBAAiB,yCACU,uBAAuB,UACrD,aAAa,qBAWtB,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { type DynamicClient, type WalletAccount } from '@dynamic-labs-sdk/client
|
|
|
2
2
|
type ShouldUseEIP7702Params = {
|
|
3
3
|
smartWalletAccount: WalletAccount;
|
|
4
4
|
};
|
|
5
|
+
/** @not-instrumented */
|
|
5
6
|
export declare const shouldUseEIP7702: ({ smartWalletAccount }: ShouldUseEIP7702Params, client: DynamicClient) => boolean | undefined;
|
|
6
7
|
export {};
|
|
7
8
|
//# sourceMappingURL=shouldUseEIP7702.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shouldUseEIP7702.d.ts","sourceRoot":"","sources":["../../../src/utils/shouldUseEIP7702/shouldUseEIP7702.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAC;AAKlC,KAAK,sBAAsB,GAAG;IAC5B,kBAAkB,EAAE,aAAa,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,gBAAgB,2BACH,sBAAsB,UACtC,aAAa,wBAqBtB,CAAC"}
|
|
1
|
+
{"version":3,"file":"shouldUseEIP7702.d.ts","sourceRoot":"","sources":["../../../src/utils/shouldUseEIP7702/shouldUseEIP7702.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAC;AAKlC,KAAK,sBAAsB,GAAG;IAC5B,kBAAkB,EAAE,aAAa,CAAC;CACnC,CAAC;AAEF,wBAAwB;AACxB,eAAO,MAAM,gBAAgB,2BACH,sBAAsB,UACtC,aAAa,wBAqBtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signMessage.d.ts","sourceRoot":"","sources":["../../../src/utils/signMessage/signMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAK9D,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,WAAW,+BACM,iBAAiB,UACrC,aAAa,KACpB,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAgC/B,CAAC"}
|
|
1
|
+
{"version":3,"file":"signMessage.d.ts","sourceRoot":"","sources":["../../../src/utils/signMessage/signMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAK9D,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEF,wBAAwB;AACxB,eAAO,MAAM,WAAW,+BACM,iBAAiB,UACrC,aAAa,KACpB,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAgC/B,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { type TransferAmountParams } from '@dynamic-labs-sdk/client/core';
|
|
|
5
5
|
*
|
|
6
6
|
* Attempts with gas sponsorship first, then falls back to unsponsored
|
|
7
7
|
* if the paymaster rejects.
|
|
8
|
+
* @not-instrumented
|
|
8
9
|
*/
|
|
9
10
|
export declare const zerodevTransferAmount: ({ amount, recipient, token, walletAccount }: TransferAmountParams, client: DynamicClient) => Promise<{
|
|
10
11
|
transactionHash: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zerodevTransferAmount.d.ts","sourceRoot":"","sources":["../../../src/utils/zerodevTransferAmount/zerodevTransferAmount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,+BAA+B,CAAC;AAWvC
|
|
1
|
+
{"version":3,"file":"zerodevTransferAmount.d.ts","sourceRoot":"","sources":["../../../src/utils/zerodevTransferAmount/zerodevTransferAmount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,+BAA+B,CAAC;AAWvC;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,gDACa,oBAAoB,UACzD,aAAa,KACpB,OAAO,CAAC;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE,CAqDrC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-sdk/zerodev",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
25
|
+
"@dynamic-labs/sdk-api-core": "0.0.914",
|
|
26
26
|
"@zerodev/ecdsa-validator": "5.4.9",
|
|
27
27
|
"@zerodev/multi-chain-ecdsa-validator": "5.4.5",
|
|
28
28
|
"@zerodev/sdk": "5.4.37",
|
|
29
|
-
"@dynamic-labs-sdk/
|
|
30
|
-
"@dynamic-labs-sdk/
|
|
31
|
-
"@dynamic-labs-sdk/evm": "0.
|
|
29
|
+
"@dynamic-labs-sdk/client": "0.18.1",
|
|
30
|
+
"@dynamic-labs-sdk/assert-package-version": "0.18.1",
|
|
31
|
+
"@dynamic-labs-sdk/evm": "0.18.1"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"viem": "^2.28.4"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getZerodevRpc-BnYhE2ZX.esm.js","names":["ENTRY_POINT_VERSION_MAP: Record<\n EntryPointVersion,\n KERNEL_VERSION_TYPE\n>","entryPointVersion: keyof typeof ENTRY_POINT_VERSION_MAP","createKernelAccount","createZerodevKernelAccount"],"sources":["../package.json","../src/constants.ts","../src/utils/getZerodevProviderFromSettings/getZerodevProviderFromSettings.ts","../src/utils/getZerodevChainProviderForNetworkId/getZerodevChainProviderForNetworkId.ts","../src/getSignerForSmartWalletAccount/getSignerForSmartWalletAccount.ts","../src/utils/getEcdsaValidator/getEcdsaValidator.ts","../src/utils/getEntryPoint/getEntryPoint.ts","../src/utils/getKernelVersion/getKernelVersion.ts","../src/utils/shouldUseEIP7702/shouldUseEIP7702.ts","../src/utils/createKernelAccount/createKernelAccount.ts","../src/utils/getPaymasterConfig/getPaymasterConfig.ts","../src/utils/getZerodevRpc/getZerodevRpc.ts"],"sourcesContent":["","import { DYNAMIC_ICONIC_SPRITE_URL } from '@dynamic-labs-sdk/client/core';\nimport { ProviderKernelVersionEnum } from '@dynamic-labs/sdk-api-core';\nimport { constants } from '@zerodev/sdk';\nimport type { KERNEL_VERSION_TYPE } from '@zerodev/sdk/types';\nimport type { EntryPointVersion } from 'viem/account-abstraction';\n\nexport const ZERODEV_METADATA = {\n displayName: 'ZeroDev',\n icon: `${DYNAMIC_ICONIC_SPRITE_URL}#smartwallet`,\n normalizedWalletName: 'zerodev',\n};\n\nexport const ZERODEV_RPC_BASE_URL = 'https://rpc.zerodev.app/api/v2';\n\nexport const KERNEL_VERSION_MAP = {\n [ProviderKernelVersionEnum.V33]: constants.KERNEL_V3_3,\n [ProviderKernelVersionEnum.V32]: constants.KERNEL_V3_2,\n [ProviderKernelVersionEnum.V31]: constants.KERNEL_V3_1,\n [ProviderKernelVersionEnum.V30]: constants.KERNEL_V3_0,\n [ProviderKernelVersionEnum.V24]: constants.KERNEL_V2_4,\n} as const;\n\nexport const ENTRY_POINT_VERSION_MAP: Record<\n EntryPointVersion,\n KERNEL_VERSION_TYPE\n> = {\n 0.6: constants.KERNEL_V2_4,\n 0.7: constants.KERNEL_V3_1,\n 0.8: constants.KERNEL_V3_3,\n} as const;\n\nexport const ERC20_TRANSFER_ABI = [\n {\n inputs: [\n { name: 'to', type: 'address' },\n { name: 'amount', type: 'uint256' },\n ],\n name: 'transfer',\n outputs: [{ name: '', type: 'bool' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n] as const;\n","import type { DynamicClient } from '@dynamic-labs-sdk/client';\nimport { assertDefined } from '@dynamic-labs-sdk/client/core';\nimport { ProviderEnum } from '@dynamic-labs/sdk-api-core';\n\nexport const getZerodevProviderFromSettings = (client: DynamicClient) => {\n const projectSettings = client.projectSettings;\n\n assertDefined(projectSettings, 'Project settings are not available');\n\n const zerodevProvider = projectSettings.providers?.find(\n (provider) => provider.provider === ProviderEnum.Zerodev\n );\n\n assertDefined(\n zerodevProvider,\n 'Zerodev is not configured in project settings'\n );\n\n return zerodevProvider;\n};\n","import type { DynamicClient } from '@dynamic-labs-sdk/client';\n\nimport { getZerodevProviderFromSettings } from '../getZerodevProviderFromSettings';\n\ntype GetZerodevChainProviderForNetworkIdProps = {\n networkId: string;\n};\n\nexport const getZerodevChainProviderForNetworkId = (\n { networkId }: GetZerodevChainProviderForNetworkIdProps,\n client: DynamicClient\n) => {\n const zerodevProvider = getZerodevProviderFromSettings(client);\n\n return zerodevProvider.multichainAccountAbstractionProviders?.find(\n (provider) => provider.chain === networkId\n );\n};\n","import {\n NoSmartWalletAccountSignerFoundError,\n getOwnerWalletAccountForSmartWalletAccount,\n} from '@dynamic-labs-sdk/client';\nimport { getDefaultClient } from '@dynamic-labs-sdk/client/core';\nimport {\n type EvmWalletAccount,\n isEvmWalletAccount,\n} from '@dynamic-labs-sdk/evm';\nimport { createWalletClientForWalletAccount } from '@dynamic-labs-sdk/evm/viem';\nimport type { Account, Chain, Transport, WalletClient } from 'viem';\n\ntype GetSignerForSmartWalletAccountParams = {\n smartWalletAccount: EvmWalletAccount;\n};\n\n/**\n * Gets a WalletClient instance for the EOA of the smart wallet account.\n * You can use this signer to sign EVM transactions.\n *\n * @param params.smartWalletAccount - The EVM smart wallet account to get the signer for.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to an WalletClient instance.\n * @throws NoSmartWalletAccountSignerFoundError When the signer wallet account is not found for the given smart wallet account.\n */\nexport const getSignerForSmartWalletAccount = (\n { smartWalletAccount }: GetSignerForSmartWalletAccountParams,\n client = getDefaultClient()\n): Promise<WalletClient<Transport, Chain, Account>> => {\n const signerWalletAccount = getOwnerWalletAccountForSmartWalletAccount(\n { smartWalletAccount },\n client\n );\n\n if (!signerWalletAccount || !isEvmWalletAccount(signerWalletAccount)) {\n throw new NoSmartWalletAccountSignerFoundError(smartWalletAccount.address);\n }\n\n return createWalletClientForWalletAccount(\n {\n walletAccount: signerWalletAccount,\n },\n client\n );\n};\n","import { signerToEcdsaValidator } from '@zerodev/ecdsa-validator';\nimport { toMultiChainECDSAValidator } from '@zerodev/multi-chain-ecdsa-validator';\nimport type {\n EntryPointType,\n GetKernelVersion,\n Signer,\n} from '@zerodev/sdk/types';\nimport type { Client } from 'viem';\nimport type { EntryPointVersion } from 'viem/account-abstraction';\n\ntype GetEcdsaValidatorParams = {\n ecdsaProviderType?: string;\n entryPoint: EntryPointType<EntryPointVersion>;\n kernelVersion: GetKernelVersion<EntryPointVersion>;\n publicClient: Client;\n signer: Signer;\n};\n\nexport const getEcdsaValidator = ({\n ecdsaProviderType,\n publicClient,\n signer,\n entryPoint,\n kernelVersion,\n}: GetEcdsaValidatorParams) => {\n const params = {\n entryPoint,\n kernelVersion,\n signer,\n };\n\n if (ecdsaProviderType === 'zerodev_multi_chain') {\n return toMultiChainECDSAValidator(publicClient, params);\n }\n\n return signerToEcdsaValidator(publicClient, params);\n};\n","import { ProviderEntryPointVersionEnum } from '@dynamic-labs/sdk-api-core';\nimport { constants } from '@zerodev/sdk';\n\nexport const getEntryPoint = (entryPoint?: string) => {\n if (entryPoint === ProviderEntryPointVersionEnum.V6) {\n return constants.getEntryPoint('0.6');\n }\n\n // default to v7\n return constants.getEntryPoint('0.7');\n};\n","import type { ProviderKernelVersionEnum } from '@dynamic-labs/sdk-api-core';\nimport { constants } from '@zerodev/sdk';\nimport type { EntryPointType } from '@zerodev/sdk/types';\nimport type { EntryPointVersion } from 'viem/account-abstraction';\n\nimport { ENTRY_POINT_VERSION_MAP, KERNEL_VERSION_MAP } from '../../constants';\n\ntype GetKernelVersionParams = {\n entryPoint: EntryPointType<EntryPointVersion>;\n kernelVersion: ProviderKernelVersionEnum | undefined;\n};\n\nexport const getKernelVersion = ({\n kernelVersion,\n entryPoint,\n}: GetKernelVersionParams) => {\n // If kernel version is explicitly provided, use it\n if (kernelVersion && kernelVersion in KERNEL_VERSION_MAP) {\n return KERNEL_VERSION_MAP[kernelVersion];\n }\n\n // If no kernel version provided, determine based on entry point version\n const entryPointVersion: keyof typeof ENTRY_POINT_VERSION_MAP =\n entryPoint.version;\n if (entryPointVersion in ENTRY_POINT_VERSION_MAP) {\n return ENTRY_POINT_VERSION_MAP[entryPointVersion];\n }\n\n // Fallback to latest version\n return constants.KERNEL_V3_3;\n};\n","import {\n type DynamicClient,\n type WalletAccount,\n getOwnerWalletAccountForSmartWalletAccount,\n} from '@dynamic-labs-sdk/client';\nimport { assertDefined } from '@dynamic-labs-sdk/client/core';\n\nimport { getZerodevProviderFromSettings } from '../getZerodevProviderFromSettings';\n\ntype ShouldUseEIP7702Params = {\n smartWalletAccount: WalletAccount;\n};\n\nexport const shouldUseEIP7702 = (\n { smartWalletAccount }: ShouldUseEIP7702Params,\n client: DynamicClient\n) => {\n const zerodevProvider = getZerodevProviderFromSettings(client);\n\n assertDefined(\n zerodevProvider,\n 'Zerodev provider is not enabled in project settings'\n );\n\n const eoaWalletAccount = getOwnerWalletAccountForSmartWalletAccount(\n { smartWalletAccount },\n client\n );\n\n assertDefined(eoaWalletAccount, 'EOA wallet account is not found');\n\n return (\n zerodevProvider.enableEIP7702 &&\n // with EIP7702, the EOA wallet account address is the same as the smart wallet account address\n smartWalletAccount.address === eoaWalletAccount.address\n );\n};\n","import type { DynamicClient } from '@dynamic-labs-sdk/client';\nimport {\n assertDefined,\n getVerifiedCredentialForWalletAccount,\n} from '@dynamic-labs-sdk/client/core';\nimport type { EvmWalletAccount } from '@dynamic-labs-sdk/evm';\nimport { createEcdsaKernelMigrationAccount } from '@zerodev/ecdsa-validator';\nimport {\n type CreateKernelAccountReturnType,\n constants,\n createKernelAccount as createZerodevKernelAccount,\n} from '@zerodev/sdk';\nimport type { PublicClient } from 'viem';\nimport type { EntryPointVersion } from 'viem/account-abstraction';\nimport type { SignAuthorizationReturnType } from 'viem/accounts';\n\nimport { getSignerForSmartWalletAccount } from '../../getSignerForSmartWalletAccount';\nimport { getEcdsaValidator } from '../getEcdsaValidator';\nimport { getEntryPoint } from '../getEntryPoint';\nimport { getKernelVersion } from '../getKernelVersion';\nimport { getZerodevProviderFromSettings } from '../getZerodevProviderFromSettings';\nimport { shouldUseEIP7702 } from '../shouldUseEIP7702';\n\ntype CreateKernelAccountParams = {\n eip7702Auth?: SignAuthorizationReturnType;\n publicClient: PublicClient;\n smartWalletAccount: EvmWalletAccount;\n};\n\n/**\n * Creates a ZeroDev kernel account for a given smart wallet account.\n * This is a lower-level function used internally by createKernelClientForWalletAccount.\n *\n * @param params - The parameters for creating the kernel account.\n * @param params.publicClient - The viem public client to use for blockchain interactions.\n * @param params.smartWalletAccount - The EVM smart wallet account to create the kernel account for.\n * @param [params.eip7702Auth] - A pre-signed EIP-7702 authorization. When provided, this authorization is passed to the ZeroDev SDK instead of signing a new one internally. Useful for singleUse MFA flows.\n * @param client - The Dynamic client instance.\n * @returns A promise that resolves to a ZeroDev kernel account.\n */\nexport const createKernelAccount = async (\n { publicClient, smartWalletAccount, eip7702Auth }: CreateKernelAccountParams,\n client: DynamicClient\n): Promise<CreateKernelAccountReturnType<EntryPointVersion>> => {\n const zerodevProvider = getZerodevProviderFromSettings(client);\n\n assertDefined(\n zerodevProvider,\n 'Zerodev provider is not enabled in project settings'\n );\n\n const signer = await getSignerForSmartWalletAccount(\n {\n smartWalletAccount,\n },\n client\n );\n\n const walletProperties = getVerifiedCredentialForWalletAccount(\n { walletAccount: smartWalletAccount },\n client\n )?.walletProperties;\n\n const entryPointVersion =\n walletProperties?.entryPointVersion ?? zerodevProvider.entryPointVersion;\n const entryPoint = getEntryPoint(entryPointVersion);\n\n const useEIP7702 = shouldUseEIP7702({ smartWalletAccount }, client);\n\n if (useEIP7702) {\n return createZerodevKernelAccount(publicClient, {\n eip7702Account: signer,\n eip7702Auth,\n entryPoint,\n kernelVersion: constants.KERNEL_V3_3,\n });\n }\n\n const kernelVersionValue =\n walletProperties?.kernelVersion ?? zerodevProvider.kernelVersion;\n\n const kernelVersion = getKernelVersion({\n entryPoint,\n kernelVersion: kernelVersionValue,\n });\n\n const kernelV3MigrationEnabled =\n zerodevProvider.enableKernelV3Migration ?? false;\n\n if (kernelV3MigrationEnabled) {\n const apiKernelVersion = getKernelVersion({\n entryPoint,\n kernelVersion: zerodevProvider.kernelVersion,\n });\n\n return createEcdsaKernelMigrationAccount(publicClient, {\n entryPoint,\n migrationVersion: {\n from: kernelVersion,\n to: apiKernelVersion,\n },\n signer,\n });\n }\n\n const validator = await getEcdsaValidator({\n ecdsaProviderType:\n walletProperties?.ecdsaProviderType ?? zerodevProvider.ecdsaProviderType,\n entryPoint,\n kernelVersion,\n publicClient,\n signer,\n });\n\n return createZerodevKernelAccount(publicClient, {\n entryPoint,\n kernelVersion,\n plugins: {\n sudo: validator,\n },\n });\n};\n","import { createZeroDevPaymasterClient } from '@zerodev/sdk';\nimport type { Hex, Chain as ViemChain } from 'viem';\nimport { http } from 'viem';\nimport type { GetPaymasterDataParameters } from 'viem/account-abstraction';\n\ntype GetPaymasterConfigProps = {\n chain: ViemChain;\n /**\n * The address the ERC20 token to use for the paymaster.\n * If not provided, the paymaster will use the default gas token for the chain.\n */\n gasTokenAddress?: Hex;\n paymasterRpc: string;\n};\n\nexport const getPaymasterConfig = ({\n chain,\n gasTokenAddress,\n paymasterRpc,\n}: GetPaymasterConfigProps) => {\n const getPaymasterData = (params: GetPaymasterDataParameters) => {\n const zerodevPaymaster = createZeroDevPaymasterClient({\n chain,\n transport: http(paymasterRpc),\n });\n\n return zerodevPaymaster.sponsorUserOperation({\n gasToken: gasTokenAddress,\n userOperation: params,\n });\n };\n\n return {\n paymaster: {\n getPaymasterData,\n },\n };\n};\n","import type { DynamicClient } from '@dynamic-labs-sdk/client';\nimport { assertDefined } from '@dynamic-labs-sdk/client/core';\nimport { ZerodevBundlerProvider } from '@dynamic-labs/sdk-api-core';\n\nimport { ZERODEV_RPC_BASE_URL } from '../../constants';\nimport { getZerodevChainProviderForNetworkId } from '../getZerodevChainProviderForNetworkId';\nimport { getZerodevProviderFromSettings } from '../getZerodevProviderFromSettings';\n\ntype GetZerodevRpcParams = {\n bundlerProvider?: ZerodevBundlerProvider;\n networkId: string;\n rpcType: 'paymaster' | 'bundler';\n};\n\nexport const getZerodevRpc = (\n { networkId, bundlerProvider, rpcType }: GetZerodevRpcParams,\n client: DynamicClient\n) => {\n const zerodevProvider = getZerodevProviderFromSettings(client);\n\n if (zerodevProvider?.zerodevPaymasterRpcUrl) {\n return zerodevProvider.zerodevPaymasterRpcUrl;\n }\n\n const zerodevChainProvider = getZerodevChainProviderForNetworkId(\n { networkId },\n client\n );\n\n assertDefined(\n zerodevChainProvider,\n `No zerodev provider found for network id ${networkId}`\n );\n\n const paymasterProvider =\n bundlerProvider ??\n zerodevProvider.zerodevBundlerProvider ??\n ZerodevBundlerProvider.Pimlico;\n\n const paramName =\n rpcType === 'bundler' ? 'bundlerProvider' : 'paymasterProvider';\n\n return `${ZERODEV_RPC_BASE_URL}/${rpcType}/${zerodevChainProvider.clientId}?${paramName}=${paymasterProvider}`;\n};\n"],"mappings":";;;;;;;;;;;;;;;;ACMA,MAAa,mBAAmB;CAC9B,aAAa;CACb,MAAM,GAAG,0B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CAAC;GAOC;EACD;EACD,CAAC;AAYJ,QAAOA,oBAA2B,cAAc;EAC9C;EACA;EACA,SAAS,EACP,MAbc,MAAM,kBAAkB;GACxC,mBACE,kBAAkB,qBAAqB,gBAAgB;GACzD;GACA;GACA;GACA;GACD,CAAC,EAOC;EACF,CAAC;;;;;ACzGJ,MAAa,sBAAsB,EACjC,OACA,iBACA,mBAC6B;CAC7B,MAAM,oBAAoB,WAAuC;AAM/D,SALyB,6BAA6B;GACpD;GACA,WAAW,KAAK,aAAa;GAC9B,CAAC,CAEsB,qBAAqB;GAC3C,UAAU;GACV,eAAe;GAChB,CAAC;;AAGJ,QAAO,EACL,WAAW,EACT,kBACD,EACF;;;;;ACtBH,MAAa,iBACX,EAAE,WAAW,iBAAiB,WAC9B,WACG;CACH,MAAM,kBAAkB,+BAA+B,OAAO;AAE9D,KAAI,iBAAiB,uBACnB,QAAO,gBAAgB;CAGzB,MAAM,uBAAuB,oCAC3B,EAAE,WAAW,EACb,OACD;AAED,eACE,sBACA,4CAA4C,YAC7C;CAED,MAAM,oBACJ,mBACA,gBAAgB,0BAChB,uBAAuB;CAEzB,MAAM,YACJ,YAAY,YAAY,oBAAoB;AAE9C,QAAO,GAAG,qBAAqB,GAAG,QAAQ,GAAG,qBAAqB,SAAS,GAAG,UAAU,GAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getZerodevRpc-DfIZRsGz.cjs.js","names":["DYNAMIC_ICONIC_SPRITE_URL","ProviderKernelVersionEnum","constants","ENTRY_POINT_VERSION_MAP: Record<\n EntryPointVersion,\n KERNEL_VERSION_TYPE\n>","ProviderEnum","NoSmartWalletAccountSignerFoundError","ProviderEntryPointVersionEnum","constants","entryPointVersion: keyof typeof ENTRY_POINT_VERSION_MAP","constants","constants","ZerodevBundlerProvider"],"sources":["../package.json","../src/constants.ts","../src/utils/getZerodevProviderFromSettings/getZerodevProviderFromSettings.ts","../src/utils/getZerodevChainProviderForNetworkId/getZerodevChainProviderForNetworkId.ts","../src/getSignerForSmartWalletAccount/getSignerForSmartWalletAccount.ts","../src/utils/getEcdsaValidator/getEcdsaValidator.ts","../src/utils/getEntryPoint/getEntryPoint.ts","../src/utils/getKernelVersion/getKernelVersion.ts","../src/utils/shouldUseEIP7702/shouldUseEIP7702.ts","../src/utils/createKernelAccount/createKernelAccount.ts","../src/utils/getPaymasterConfig/getPaymasterConfig.ts","../src/utils/getZerodevRpc/getZerodevRpc.ts"],"sourcesContent":["","import { DYNAMIC_ICONIC_SPRITE_URL } from '@dynamic-labs-sdk/client/core';\nimport { ProviderKernelVersionEnum } from '@dynamic-labs/sdk-api-core';\nimport { constants } from '@zerodev/sdk';\nimport type { KERNEL_VERSION_TYPE } from '@zerodev/sdk/types';\nimport type { EntryPointVersion } from 'viem/account-abstraction';\n\nexport const ZERODEV_METADATA = {\n displayName: 'ZeroDev',\n icon: `${DYNAMIC_ICONIC_SPRITE_URL}#smartwallet`,\n normalizedWalletName: 'zerodev',\n};\n\nexport const ZERODEV_RPC_BASE_URL = 'https://rpc.zerodev.app/api/v2';\n\nexport const KERNEL_VERSION_MAP = {\n [ProviderKernelVersionEnum.V33]: constants.KERNEL_V3_3,\n [ProviderKernelVersionEnum.V32]: constants.KERNEL_V3_2,\n [ProviderKernelVersionEnum.V31]: constants.KERNEL_V3_1,\n [ProviderKernelVersionEnum.V30]: constants.KERNEL_V3_0,\n [ProviderKernelVersionEnum.V24]: constants.KERNEL_V2_4,\n} as const;\n\nexport const ENTRY_POINT_VERSION_MAP: Record<\n EntryPointVersion,\n KERNEL_VERSION_TYPE\n> = {\n 0.6: constants.KERNEL_V2_4,\n 0.7: constants.KERNEL_V3_1,\n 0.8: constants.KERNEL_V3_3,\n} as const;\n\nexport const ERC20_TRANSFER_ABI = [\n {\n inputs: [\n { name: 'to', type: 'address' },\n { name: 'amount', type: 'uint256' },\n ],\n name: 'transfer',\n outputs: [{ name: '', type: 'bool' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n] as const;\n","import type { DynamicClient } from '@dynamic-labs-sdk/client';\nimport { assertDefined } from '@dynamic-labs-sdk/client/core';\nimport { ProviderEnum } from '@dynamic-labs/sdk-api-core';\n\nexport const getZerodevProviderFromSettings = (client: DynamicClient) => {\n const projectSettings = client.projectSettings;\n\n assertDefined(projectSettings, 'Project settings are not available');\n\n const zerodevProvider = projectSettings.providers?.find(\n (provider) => provider.provider === ProviderEnum.Zerodev\n );\n\n assertDefined(\n zerodevProvider,\n 'Zerodev is not configured in project settings'\n );\n\n return zerodevProvider;\n};\n","import type { DynamicClient } from '@dynamic-labs-sdk/client';\n\nimport { getZerodevProviderFromSettings } from '../getZerodevProviderFromSettings';\n\ntype GetZerodevChainProviderForNetworkIdProps = {\n networkId: string;\n};\n\nexport const getZerodevChainProviderForNetworkId = (\n { networkId }: GetZerodevChainProviderForNetworkIdProps,\n client: DynamicClient\n) => {\n const zerodevProvider = getZerodevProviderFromSettings(client);\n\n return zerodevProvider.multichainAccountAbstractionProviders?.find(\n (provider) => provider.chain === networkId\n );\n};\n","import {\n NoSmartWalletAccountSignerFoundError,\n getOwnerWalletAccountForSmartWalletAccount,\n} from '@dynamic-labs-sdk/client';\nimport { getDefaultClient } from '@dynamic-labs-sdk/client/core';\nimport {\n type EvmWalletAccount,\n isEvmWalletAccount,\n} from '@dynamic-labs-sdk/evm';\nimport { createWalletClientForWalletAccount } from '@dynamic-labs-sdk/evm/viem';\nimport type { Account, Chain, Transport, WalletClient } from 'viem';\n\ntype GetSignerForSmartWalletAccountParams = {\n smartWalletAccount: EvmWalletAccount;\n};\n\n/**\n * Gets a WalletClient instance for the EOA of the smart wallet account.\n * You can use this signer to sign EVM transactions.\n *\n * @param params.smartWalletAccount - The EVM smart wallet account to get the signer for.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to an WalletClient instance.\n * @throws NoSmartWalletAccountSignerFoundError When the signer wallet account is not found for the given smart wallet account.\n */\nexport const getSignerForSmartWalletAccount = (\n { smartWalletAccount }: GetSignerForSmartWalletAccountParams,\n client = getDefaultClient()\n): Promise<WalletClient<Transport, Chain, Account>> => {\n const signerWalletAccount = getOwnerWalletAccountForSmartWalletAccount(\n { smartWalletAccount },\n client\n );\n\n if (!signerWalletAccount || !isEvmWalletAccount(signerWalletAccount)) {\n throw new NoSmartWalletAccountSignerFoundError(smartWalletAccount.address);\n }\n\n return createWalletClientForWalletAccount(\n {\n walletAccount: signerWalletAccount,\n },\n client\n );\n};\n","import { signerToEcdsaValidator } from '@zerodev/ecdsa-validator';\nimport { toMultiChainECDSAValidator } from '@zerodev/multi-chain-ecdsa-validator';\nimport type {\n EntryPointType,\n GetKernelVersion,\n Signer,\n} from '@zerodev/sdk/types';\nimport type { Client } from 'viem';\nimport type { EntryPointVersion } from 'viem/account-abstraction';\n\ntype GetEcdsaValidatorParams = {\n ecdsaProviderType?: string;\n entryPoint: EntryPointType<EntryPointVersion>;\n kernelVersion: GetKernelVersion<EntryPointVersion>;\n publicClient: Client;\n signer: Signer;\n};\n\nexport const getEcdsaValidator = ({\n ecdsaProviderType,\n publicClient,\n signer,\n entryPoint,\n kernelVersion,\n}: GetEcdsaValidatorParams) => {\n const params = {\n entryPoint,\n kernelVersion,\n signer,\n };\n\n if (ecdsaProviderType === 'zerodev_multi_chain') {\n return toMultiChainECDSAValidator(publicClient, params);\n }\n\n return signerToEcdsaValidator(publicClient, params);\n};\n","import { ProviderEntryPointVersionEnum } from '@dynamic-labs/sdk-api-core';\nimport { constants } from '@zerodev/sdk';\n\nexport const getEntryPoint = (entryPoint?: string) => {\n if (entryPoint === ProviderEntryPointVersionEnum.V6) {\n return constants.getEntryPoint('0.6');\n }\n\n // default to v7\n return constants.getEntryPoint('0.7');\n};\n","import type { ProviderKernelVersionEnum } from '@dynamic-labs/sdk-api-core';\nimport { constants } from '@zerodev/sdk';\nimport type { EntryPointType } from '@zerodev/sdk/types';\nimport type { EntryPointVersion } from 'viem/account-abstraction';\n\nimport { ENTRY_POINT_VERSION_MAP, KERNEL_VERSION_MAP } from '../../constants';\n\ntype GetKernelVersionParams = {\n entryPoint: EntryPointType<EntryPointVersion>;\n kernelVersion: ProviderKernelVersionEnum | undefined;\n};\n\nexport const getKernelVersion = ({\n kernelVersion,\n entryPoint,\n}: GetKernelVersionParams) => {\n // If kernel version is explicitly provided, use it\n if (kernelVersion && kernelVersion in KERNEL_VERSION_MAP) {\n return KERNEL_VERSION_MAP[kernelVersion];\n }\n\n // If no kernel version provided, determine based on entry point version\n const entryPointVersion: keyof typeof ENTRY_POINT_VERSION_MAP =\n entryPoint.version;\n if (entryPointVersion in ENTRY_POINT_VERSION_MAP) {\n return ENTRY_POINT_VERSION_MAP[entryPointVersion];\n }\n\n // Fallback to latest version\n return constants.KERNEL_V3_3;\n};\n","import {\n type DynamicClient,\n type WalletAccount,\n getOwnerWalletAccountForSmartWalletAccount,\n} from '@dynamic-labs-sdk/client';\nimport { assertDefined } from '@dynamic-labs-sdk/client/core';\n\nimport { getZerodevProviderFromSettings } from '../getZerodevProviderFromSettings';\n\ntype ShouldUseEIP7702Params = {\n smartWalletAccount: WalletAccount;\n};\n\nexport const shouldUseEIP7702 = (\n { smartWalletAccount }: ShouldUseEIP7702Params,\n client: DynamicClient\n) => {\n const zerodevProvider = getZerodevProviderFromSettings(client);\n\n assertDefined(\n zerodevProvider,\n 'Zerodev provider is not enabled in project settings'\n );\n\n const eoaWalletAccount = getOwnerWalletAccountForSmartWalletAccount(\n { smartWalletAccount },\n client\n );\n\n assertDefined(eoaWalletAccount, 'EOA wallet account is not found');\n\n return (\n zerodevProvider.enableEIP7702 &&\n // with EIP7702, the EOA wallet account address is the same as the smart wallet account address\n smartWalletAccount.address === eoaWalletAccount.address\n );\n};\n","import type { DynamicClient } from '@dynamic-labs-sdk/client';\nimport {\n assertDefined,\n getVerifiedCredentialForWalletAccount,\n} from '@dynamic-labs-sdk/client/core';\nimport type { EvmWalletAccount } from '@dynamic-labs-sdk/evm';\nimport { createEcdsaKernelMigrationAccount } from '@zerodev/ecdsa-validator';\nimport {\n type CreateKernelAccountReturnType,\n constants,\n createKernelAccount as createZerodevKernelAccount,\n} from '@zerodev/sdk';\nimport type { PublicClient } from 'viem';\nimport type { EntryPointVersion } from 'viem/account-abstraction';\nimport type { SignAuthorizationReturnType } from 'viem/accounts';\n\nimport { getSignerForSmartWalletAccount } from '../../getSignerForSmartWalletAccount';\nimport { getEcdsaValidator } from '../getEcdsaValidator';\nimport { getEntryPoint } from '../getEntryPoint';\nimport { getKernelVersion } from '../getKernelVersion';\nimport { getZerodevProviderFromSettings } from '../getZerodevProviderFromSettings';\nimport { shouldUseEIP7702 } from '../shouldUseEIP7702';\n\ntype CreateKernelAccountParams = {\n eip7702Auth?: SignAuthorizationReturnType;\n publicClient: PublicClient;\n smartWalletAccount: EvmWalletAccount;\n};\n\n/**\n * Creates a ZeroDev kernel account for a given smart wallet account.\n * This is a lower-level function used internally by createKernelClientForWalletAccount.\n *\n * @param params - The parameters for creating the kernel account.\n * @param params.publicClient - The viem public client to use for blockchain interactions.\n * @param params.smartWalletAccount - The EVM smart wallet account to create the kernel account for.\n * @param [params.eip7702Auth] - A pre-signed EIP-7702 authorization. When provided, this authorization is passed to the ZeroDev SDK instead of signing a new one internally. Useful for singleUse MFA flows.\n * @param client - The Dynamic client instance.\n * @returns A promise that resolves to a ZeroDev kernel account.\n */\nexport const createKernelAccount = async (\n { publicClient, smartWalletAccount, eip7702Auth }: CreateKernelAccountParams,\n client: DynamicClient\n): Promise<CreateKernelAccountReturnType<EntryPointVersion>> => {\n const zerodevProvider = getZerodevProviderFromSettings(client);\n\n assertDefined(\n zerodevProvider,\n 'Zerodev provider is not enabled in project settings'\n );\n\n const signer = await getSignerForSmartWalletAccount(\n {\n smartWalletAccount,\n },\n client\n );\n\n const walletProperties = getVerifiedCredentialForWalletAccount(\n { walletAccount: smartWalletAccount },\n client\n )?.walletProperties;\n\n const entryPointVersion =\n walletProperties?.entryPointVersion ?? zerodevProvider.entryPointVersion;\n const entryPoint = getEntryPoint(entryPointVersion);\n\n const useEIP7702 = shouldUseEIP7702({ smartWalletAccount }, client);\n\n if (useEIP7702) {\n return createZerodevKernelAccount(publicClient, {\n eip7702Account: signer,\n eip7702Auth,\n entryPoint,\n kernelVersion: constants.KERNEL_V3_3,\n });\n }\n\n const kernelVersionValue =\n walletProperties?.kernelVersion ?? zerodevProvider.kernelVersion;\n\n const kernelVersion = getKernelVersion({\n entryPoint,\n kernelVersion: kernelVersionValue,\n });\n\n const kernelV3MigrationEnabled =\n zerodevProvider.enableKernelV3Migration ?? false;\n\n if (kernelV3MigrationEnabled) {\n const apiKernelVersion = getKernelVersion({\n entryPoint,\n kernelVersion: zerodevProvider.kernelVersion,\n });\n\n return createEcdsaKernelMigrationAccount(publicClient, {\n entryPoint,\n migrationVersion: {\n from: kernelVersion,\n to: apiKernelVersion,\n },\n signer,\n });\n }\n\n const validator = await getEcdsaValidator({\n ecdsaProviderType:\n walletProperties?.ecdsaProviderType ?? zerodevProvider.ecdsaProviderType,\n entryPoint,\n kernelVersion,\n publicClient,\n signer,\n });\n\n return createZerodevKernelAccount(publicClient, {\n entryPoint,\n kernelVersion,\n plugins: {\n sudo: validator,\n },\n });\n};\n","import { createZeroDevPaymasterClient } from '@zerodev/sdk';\nimport type { Hex, Chain as ViemChain } from 'viem';\nimport { http } from 'viem';\nimport type { GetPaymasterDataParameters } from 'viem/account-abstraction';\n\ntype GetPaymasterConfigProps = {\n chain: ViemChain;\n /**\n * The address the ERC20 token to use for the paymaster.\n * If not provided, the paymaster will use the default gas token for the chain.\n */\n gasTokenAddress?: Hex;\n paymasterRpc: string;\n};\n\nexport const getPaymasterConfig = ({\n chain,\n gasTokenAddress,\n paymasterRpc,\n}: GetPaymasterConfigProps) => {\n const getPaymasterData = (params: GetPaymasterDataParameters) => {\n const zerodevPaymaster = createZeroDevPaymasterClient({\n chain,\n transport: http(paymasterRpc),\n });\n\n return zerodevPaymaster.sponsorUserOperation({\n gasToken: gasTokenAddress,\n userOperation: params,\n });\n };\n\n return {\n paymaster: {\n getPaymasterData,\n },\n };\n};\n","import type { DynamicClient } from '@dynamic-labs-sdk/client';\nimport { assertDefined } from '@dynamic-labs-sdk/client/core';\nimport { ZerodevBundlerProvider } from '@dynamic-labs/sdk-api-core';\n\nimport { ZERODEV_RPC_BASE_URL } from '../../constants';\nimport { getZerodevChainProviderForNetworkId } from '../getZerodevChainProviderForNetworkId';\nimport { getZerodevProviderFromSettings } from '../getZerodevProviderFromSettings';\n\ntype GetZerodevRpcParams = {\n bundlerProvider?: ZerodevBundlerProvider;\n networkId: string;\n rpcType: 'paymaster' | 'bundler';\n};\n\nexport const getZerodevRpc = (\n { networkId, bundlerProvider, rpcType }: GetZerodevRpcParams,\n client: DynamicClient\n) => {\n const zerodevProvider = getZerodevProviderFromSettings(client);\n\n if (zerodevProvider?.zerodevPaymasterRpcUrl) {\n return zerodevProvider.zerodevPaymasterRpcUrl;\n }\n\n const zerodevChainProvider = getZerodevChainProviderForNetworkId(\n { networkId },\n client\n );\n\n assertDefined(\n zerodevChainProvider,\n `No zerodev provider found for network id ${networkId}`\n );\n\n const paymasterProvider =\n bundlerProvider ??\n zerodevProvider.zerodevBundlerProvider ??\n ZerodevBundlerProvider.Pimlico;\n\n const paramName =\n rpcType === 'bundler' ? 'bundlerProvider' : 'paymasterProvider';\n\n return `${ZERODEV_RPC_BASE_URL}/${rpcType}/${zerodevChainProvider.clientId}?${paramName}=${paymasterProvider}`;\n};\n"],"mappings":";;;;;;;;;;;;;;;;ACMA,MAAa,mBAAmB;CAC9B,aAAa;CACb,MAAM,GAAGA,wDAA0B;CACnC,sBAAsB;CACvB;AAED,MAAa,uBAAuB;AAEpC,MAAa,qBAAqB;EAC/BC,qDAA0B,MAAMC,uBAAU;EAC1CD,qDAA0B,MAAMC,uBAAU;EAC1CD,qDAA0B,MAAMC,uBAAU;EAC1CD,qDAA0B,MAAMC,uBAAU;EAC1CD,qDAA0B,MAAMC,uBAAU;CAC5C;AAED,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