@dynamic-labs-sdk/zerodev 0.17.4 → 0.18.0

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.
Files changed (70) hide show
  1. package/dist/addZerodevExtension/addZerodevExtension.d.ts +1 -0
  2. package/dist/addZerodevExtension/addZerodevExtension.d.ts.map +1 -1
  3. package/dist/canSponsorUserOperation/canSponsorUserOperation.d.ts +1 -0
  4. package/dist/canSponsorUserOperation/canSponsorUserOperation.d.ts.map +1 -1
  5. package/dist/core.cjs.js +1 -1
  6. package/dist/core.esm.js +1 -1
  7. package/dist/createKernelClientForWalletAccount/createKernelClientForWalletAccount.d.ts +1 -0
  8. package/dist/createKernelClientForWalletAccount/createKernelClientForWalletAccount.d.ts.map +1 -1
  9. package/dist/estimateUserOperationGas/estimateUserOperationGas.d.ts +1 -0
  10. package/dist/estimateUserOperationGas/estimateUserOperationGas.d.ts.map +1 -1
  11. package/dist/getSignerForSmartWalletAccount/getSignerForSmartWalletAccount.d.ts +1 -0
  12. package/dist/getSignerForSmartWalletAccount/getSignerForSmartWalletAccount.d.ts.map +1 -1
  13. package/dist/{getZerodevRpc-DfIZRsGz.cjs.js → getZerodevRpc-7HsOpAJK.cjs.js} +12 -2
  14. package/dist/getZerodevRpc-7HsOpAJK.cjs.js.map +1 -0
  15. package/dist/{getZerodevRpc-BnYhE2ZX.esm.js → getZerodevRpc-BIo0SG4X.esm.js} +12 -2
  16. package/dist/getZerodevRpc-BIo0SG4X.esm.js.map +1 -0
  17. package/dist/index.cjs.js +19 -1
  18. package/dist/index.cjs.js.map +1 -1
  19. package/dist/index.esm.js +19 -1
  20. package/dist/index.esm.js.map +1 -1
  21. package/dist/isGasSponsorshipError/isGasSponsorshipError.d.ts +1 -0
  22. package/dist/isGasSponsorshipError/isGasSponsorshipError.d.ts.map +1 -1
  23. package/dist/isZerodevWalletAccount/isZerodevWalletAccount.d.ts +1 -0
  24. package/dist/isZerodevWalletAccount/isZerodevWalletAccount.d.ts.map +1 -1
  25. package/dist/sendUserOperation/sendUserOperation.d.ts +1 -0
  26. package/dist/sendUserOperation/sendUserOperation.d.ts.map +1 -1
  27. package/dist/signEip7702Authorization/signEip7702Authorization.d.ts +1 -0
  28. package/dist/signEip7702Authorization/signEip7702Authorization.d.ts.map +1 -1
  29. package/dist/simulateZerodevUserOperation/simulateZerodevUserOperation.d.ts +1 -0
  30. package/dist/simulateZerodevUserOperation/simulateZerodevUserOperation.d.ts.map +1 -1
  31. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  32. package/dist/utils/calculateFeeForUserOperation/calculateFeeForUserOperation.d.ts +1 -0
  33. package/dist/utils/calculateFeeForUserOperation/calculateFeeForUserOperation.d.ts.map +1 -1
  34. package/dist/utils/calculateGasForUserOperation/calculateGasForUserOperation.d.ts +1 -0
  35. package/dist/utils/calculateGasForUserOperation/calculateGasForUserOperation.d.ts.map +1 -1
  36. package/dist/utils/createKernelAccount/createKernelAccount.d.ts +1 -0
  37. package/dist/utils/createKernelAccount/createKernelAccount.d.ts.map +1 -1
  38. package/dist/utils/createZerodevWalletProvider/createZerodevWalletProvider.d.ts +1 -0
  39. package/dist/utils/createZerodevWalletProvider/createZerodevWalletProvider.d.ts.map +1 -1
  40. package/dist/utils/getAllUserZerodevAddresses/getAllUserZerodevAddresses.d.ts +1 -0
  41. package/dist/utils/getAllUserZerodevAddresses/getAllUserZerodevAddresses.d.ts.map +1 -1
  42. package/dist/utils/getEcdsaValidator/getEcdsaValidator.d.ts +1 -0
  43. package/dist/utils/getEcdsaValidator/getEcdsaValidator.d.ts.map +1 -1
  44. package/dist/utils/getEntryPoint/getEntryPoint.d.ts +1 -0
  45. package/dist/utils/getEntryPoint/getEntryPoint.d.ts.map +1 -1
  46. package/dist/utils/getKernelVersion/getKernelVersion.d.ts +1 -0
  47. package/dist/utils/getKernelVersion/getKernelVersion.d.ts.map +1 -1
  48. package/dist/utils/getPaymasterConfig/getPaymasterConfig.d.ts +1 -0
  49. package/dist/utils/getPaymasterConfig/getPaymasterConfig.d.ts.map +1 -1
  50. package/dist/utils/getZerodevChainProviderForNetworkId/getZerodevChainProviderForNetworkId.d.ts +1 -0
  51. package/dist/utils/getZerodevChainProviderForNetworkId/getZerodevChainProviderForNetworkId.d.ts.map +1 -1
  52. package/dist/utils/getZerodevProviderFromSettings/getZerodevProviderFromSettings.d.ts +1 -0
  53. package/dist/utils/getZerodevProviderFromSettings/getZerodevProviderFromSettings.d.ts.map +1 -1
  54. package/dist/utils/getZerodevRpc/getZerodevRpc.d.ts +1 -0
  55. package/dist/utils/getZerodevRpc/getZerodevRpc.d.ts.map +1 -1
  56. package/dist/utils/hasRequiredGasFields/hasRequiredGasFields.d.ts +1 -0
  57. package/dist/utils/hasRequiredGasFields/hasRequiredGasFields.d.ts.map +1 -1
  58. package/dist/utils/prepareUserOperationFromCalls/prepareUserOperationFromCalls.d.ts +1 -0
  59. package/dist/utils/prepareUserOperationFromCalls/prepareUserOperationFromCalls.d.ts.map +1 -1
  60. package/dist/utils/shouldSignWithEoa/shouldSignWithEoa.d.ts +1 -0
  61. package/dist/utils/shouldSignWithEoa/shouldSignWithEoa.d.ts.map +1 -1
  62. package/dist/utils/shouldUseEIP7702/shouldUseEIP7702.d.ts +1 -0
  63. package/dist/utils/shouldUseEIP7702/shouldUseEIP7702.d.ts.map +1 -1
  64. package/dist/utils/signMessage/signMessage.d.ts +1 -0
  65. package/dist/utils/signMessage/signMessage.d.ts.map +1 -1
  66. package/dist/utils/zerodevTransferAmount/zerodevTransferAmount.d.ts +1 -0
  67. package/dist/utils/zerodevTransferAmount/zerodevTransferAmount.d.ts.map +1 -1
  68. package/package.json +5 -5
  69. package/dist/getZerodevRpc-BnYhE2ZX.esm.js.map +0 -1
  70. package/dist/getZerodevRpc-DfIZRsGz.cjs.js.map +0 -1
@@ -5,6 +5,7 @@ export declare const ZERODEV_EXTENSION_KEY = "zerodev";
5
5
  * This extension enables Account Abstraction integration with ZeroDev
6
6
  *
7
7
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
8
+ * @not-instrumented
8
9
  */
9
10
  export declare const addZerodevExtension: (client?: import("@dynamic-labs-sdk/client").DynamicClient) => void;
10
11
  //# sourceMappingURL=addZerodevExtension.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"addZerodevExtension.d.ts","sourceRoot":"","sources":["../../src/addZerodevExtension/addZerodevExtension.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAE/C;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,qEAe/B,CAAC"}
1
+ {"version":3,"file":"addZerodevExtension.d.ts","sourceRoot":"","sources":["../../src/addZerodevExtension/addZerodevExtension.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAE/C;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,qEAe/B,CAAC"}
@@ -21,6 +21,7 @@ export type CanSponsorUserOperationParams = CanSponsorUserOperationWithWalletPar
21
21
  * @param params.kernelClient - Optional kernel client with sponsorship configured
22
22
  * @param params.walletAccount - The wallet account to use (required if kernelClient not provided)
23
23
  * @returns True if the user operation can be sponsored, false otherwise
24
+ * @not-instrumented
24
25
  */
25
26
  export declare const canSponsorUserOperation: ({ walletAccount, calls, kernelClient, }: CanSponsorUserOperationParams) => Promise<boolean>;
26
27
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"canSponsorUserOperation.d.ts","sourceRoot":"","sources":["../../src/canSponsorUserOperation/canSponsorUserOperation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG1D,KAAK,iCAAiC,GAAG;IACvC,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB,CAAC;AAEF,KAAK,uCAAuC,GAC1C,iCAAiC,GAAG;IAClC,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,aAAa,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEJ,KAAK,uCAAuC,GAC1C,iCAAiC,GAAG;IAClC,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB,CAAC;AAEJ,MAAM,MAAM,6BAA6B,GACrC,uCAAuC,GACvC,uCAAuC,CAAC;AAE5C;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,4CAIjC,6BAA6B,KAAG,OAAO,CAAC,OAAO,CA0BjD,CAAC"}
1
+ {"version":3,"file":"canSponsorUserOperation.d.ts","sourceRoot":"","sources":["../../src/canSponsorUserOperation/canSponsorUserOperation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG1D,KAAK,iCAAiC,GAAG;IACvC,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB,CAAC;AAEF,KAAK,uCAAuC,GAC1C,iCAAiC,GAAG;IAClC,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,aAAa,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEJ,KAAK,uCAAuC,GAC1C,iCAAiC,GAAG;IAClC,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB,CAAC;AAEJ,MAAM,MAAM,6BAA6B,GACrC,uCAAuC,GACvC,uCAAuC,CAAC;AAE5C;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,4CAIjC,6BAA6B,KAAG,OAAO,CAAC,OAAO,CA0BjD,CAAC"}
package/dist/core.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- const require_getZerodevRpc = require('./getZerodevRpc-DfIZRsGz.cjs.js');
1
+ const require_getZerodevRpc = require('./getZerodevRpc-7HsOpAJK.cjs.js');
2
2
  let _dynamic_labs_sdk_assert_package_version = require("@dynamic-labs-sdk/assert-package-version");
3
3
 
4
4
  //#region src/exports/core.ts
package/dist/core.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as getKernelVersion, i as shouldUseEIP7702, l as getZerodevChainProviderForNetworkId, m as version, n as getPaymasterConfig, o as getEntryPoint, p as name, r as createKernelAccount, s as getEcdsaValidator, t as getZerodevRpc, u as getZerodevProviderFromSettings } from "./getZerodevRpc-BnYhE2ZX.esm.js";
1
+ import { a as getKernelVersion, i as shouldUseEIP7702, l as getZerodevChainProviderForNetworkId, m as version, n as getPaymasterConfig, o as getEntryPoint, p as name, r as createKernelAccount, s as getEcdsaValidator, t as getZerodevRpc, u as getZerodevProviderFromSettings } from "./getZerodevRpc-BIo0SG4X.esm.js";
2
2
  import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
3
3
 
4
4
  //#region src/exports/core.ts
@@ -30,6 +30,7 @@ type CreateKernelClientForWalletAccountParams = {
30
30
  * to separate the authorization signing step from the transaction step.
31
31
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
32
32
  * @returns A promise that resolves to a KernelClient instance.
33
+ * @not-instrumented
33
34
  */
34
35
  export declare const createKernelClientForWalletAccount: ({ smartWalletAccount, withSponsorship, bundlerProvider, networkId, bundlerRpc: bundlerRpcOverride, paymasterRpc: paymasterRpcOverride, gasTokenAddress, eip7702Auth, }: CreateKernelClientForWalletAccountParams, client?: import("@dynamic-labs-sdk/client").DynamicClient) => Promise<KernelClient>;
35
36
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"createKernelClientForWalletAccount.d.ts","sourceRoot":"","sources":["../../src/createKernelClientForWalletAccount/createKernelClientForWalletAccount.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAKzE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAK1D,MAAM,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AAE/D,KAAK,wCAAwC,GAAG;IAC9C,eAAe,CAAC,EAAE,sBAAsB,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,2BAA2B,CAAC;IAC1C,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,gBAAgB,CAAC;IACrC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,kCAAkC,2KAU1C,wCAAwC,gEAE1C,OAAO,CAAC,YAAY,CAsFtB,CAAC"}
1
+ {"version":3,"file":"createKernelClientForWalletAccount.d.ts","sourceRoot":"","sources":["../../src/createKernelClientForWalletAccount/createKernelClientForWalletAccount.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAKzE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAK1D,MAAM,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AAE/D,KAAK,wCAAwC,GAAG;IAC9C,eAAe,CAAC,EAAE,sBAAsB,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,2BAA2B,CAAC;IAC1C,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,gBAAgB,CAAC;IACrC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,kCAAkC,2KAU1C,wCAAwC,gEAE1C,OAAO,CAAC,YAAY,CAsFtB,CAAC"}
@@ -11,6 +11,7 @@ export type EstimateUserOperationGasParams = {
11
11
  * @param params.calls - Array of calls (single call or multiple calls)
12
12
  * @param params.walletAccount - The wallet account that will execute the user operation
13
13
  * @returns The estimated gas cost in wei, or null if estimation fails
14
+ * @not-instrumented
14
15
  */
15
16
  export declare const estimateUserOperationGas: ({ walletAccount, calls, }: EstimateUserOperationGasParams) => Promise<bigint | null>;
16
17
  //# sourceMappingURL=estimateUserOperationGas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"estimateUserOperationGas.d.ts","sourceRoot":"","sources":["../../src/estimateUserOperationGas/estimateUserOperationGas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAKpD,MAAM,MAAM,8BAA8B,GAAG;IAC3C,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,aAAa,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,8BAGlC,8BAA8B,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAmBxD,CAAC"}
1
+ {"version":3,"file":"estimateUserOperationGas.d.ts","sourceRoot":"","sources":["../../src/estimateUserOperationGas/estimateUserOperationGas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAKpD,MAAM,MAAM,8BAA8B,GAAG;IAC3C,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,aAAa,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,8BAGlC,8BAA8B,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAmBxD,CAAC"}
@@ -11,6 +11,7 @@ type GetSignerForSmartWalletAccountParams = {
11
11
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
12
12
  * @returns A promise that resolves to an WalletClient instance.
13
13
  * @throws NoSmartWalletAccountSignerFoundError When the signer wallet account is not found for the given smart wallet account.
14
+ * @not-instrumented
14
15
  */
15
16
  export declare const getSignerForSmartWalletAccount: ({ smartWalletAccount }: GetSignerForSmartWalletAccountParams, client?: import("@dynamic-labs-sdk/client").DynamicClient) => Promise<WalletClient<Transport, Chain, Account>>;
16
17
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"getSignerForSmartWalletAccount.d.ts","sourceRoot":"","sources":["../../src/getSignerForSmartWalletAccount/getSignerForSmartWalletAccount.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEpE,KAAK,oCAAoC,GAAG;IAC1C,kBAAkB,EAAE,gBAAgB,CAAC;CACtC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,2BACjB,oCAAoC,gEAE3D,OAAO,CAAC,YAAY,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,CAgBjD,CAAC"}
1
+ {"version":3,"file":"getSignerForSmartWalletAccount.d.ts","sourceRoot":"","sources":["../../src/getSignerForSmartWalletAccount/getSignerForSmartWalletAccount.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEpE,KAAK,oCAAoC,GAAG;IAC1C,kBAAkB,EAAE,gBAAgB,CAAC;CACtC,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,8BAA8B,2BACjB,oCAAoC,gEAE3D,OAAO,CAAC,YAAY,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,CAgBjD,CAAC"}
@@ -10,7 +10,7 @@ let _zerodev_multi_chain_ecdsa_validator = require("@zerodev/multi-chain-ecdsa-v
10
10
 
11
11
  //#region package.json
12
12
  var name = "@dynamic-labs-sdk/zerodev";
13
- var version = "0.17.4";
13
+ var version = "0.18.0";
14
14
 
15
15
  //#endregion
16
16
  //#region src/constants.ts
@@ -51,6 +51,7 @@ const ERC20_TRANSFER_ABI = [{
51
51
 
52
52
  //#endregion
53
53
  //#region src/utils/getZerodevProviderFromSettings/getZerodevProviderFromSettings.ts
54
+ /** @not-instrumented */
54
55
  const getZerodevProviderFromSettings = (client) => {
55
56
  const projectSettings = client.projectSettings;
56
57
  (0, _dynamic_labs_sdk_client_core.assertDefined)(projectSettings, "Project settings are not available");
@@ -61,6 +62,7 @@ const getZerodevProviderFromSettings = (client) => {
61
62
 
62
63
  //#endregion
63
64
  //#region src/utils/getZerodevChainProviderForNetworkId/getZerodevChainProviderForNetworkId.ts
65
+ /** @not-instrumented */
64
66
  const getZerodevChainProviderForNetworkId = ({ networkId }, client) => {
65
67
  return getZerodevProviderFromSettings(client).multichainAccountAbstractionProviders?.find((provider) => provider.chain === networkId);
66
68
  };
@@ -75,6 +77,7 @@ const getZerodevChainProviderForNetworkId = ({ networkId }, client) => {
75
77
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
76
78
  * @returns A promise that resolves to an WalletClient instance.
77
79
  * @throws NoSmartWalletAccountSignerFoundError When the signer wallet account is not found for the given smart wallet account.
80
+ * @not-instrumented
78
81
  */
79
82
  const getSignerForSmartWalletAccount = ({ smartWalletAccount }, client = (0, _dynamic_labs_sdk_client_core.getDefaultClient)()) => {
80
83
  const signerWalletAccount = (0, _dynamic_labs_sdk_client.getOwnerWalletAccountForSmartWalletAccount)({ smartWalletAccount }, client);
@@ -84,6 +87,7 @@ const getSignerForSmartWalletAccount = ({ smartWalletAccount }, client = (0, _dy
84
87
 
85
88
  //#endregion
86
89
  //#region src/utils/getEcdsaValidator/getEcdsaValidator.ts
90
+ /** @not-instrumented */
87
91
  const getEcdsaValidator = ({ ecdsaProviderType, publicClient, signer, entryPoint, kernelVersion }) => {
88
92
  const params = {
89
93
  entryPoint,
@@ -96,6 +100,7 @@ const getEcdsaValidator = ({ ecdsaProviderType, publicClient, signer, entryPoint
96
100
 
97
101
  //#endregion
98
102
  //#region src/utils/getEntryPoint/getEntryPoint.ts
103
+ /** @not-instrumented */
99
104
  const getEntryPoint = (entryPoint) => {
100
105
  if (entryPoint === _dynamic_labs_sdk_api_core.ProviderEntryPointVersionEnum.V6) return _zerodev_sdk.constants.getEntryPoint("0.6");
101
106
  return _zerodev_sdk.constants.getEntryPoint("0.7");
@@ -103,6 +108,7 @@ const getEntryPoint = (entryPoint) => {
103
108
 
104
109
  //#endregion
105
110
  //#region src/utils/getKernelVersion/getKernelVersion.ts
111
+ /** @not-instrumented */
106
112
  const getKernelVersion = ({ kernelVersion, entryPoint }) => {
107
113
  if (kernelVersion && kernelVersion in KERNEL_VERSION_MAP) return KERNEL_VERSION_MAP[kernelVersion];
108
114
  const entryPointVersion = entryPoint.version;
@@ -112,6 +118,7 @@ const getKernelVersion = ({ kernelVersion, entryPoint }) => {
112
118
 
113
119
  //#endregion
114
120
  //#region src/utils/shouldUseEIP7702/shouldUseEIP7702.ts
121
+ /** @not-instrumented */
115
122
  const shouldUseEIP7702 = ({ smartWalletAccount }, client) => {
116
123
  const zerodevProvider = getZerodevProviderFromSettings(client);
117
124
  (0, _dynamic_labs_sdk_client_core.assertDefined)(zerodevProvider, "Zerodev provider is not enabled in project settings");
@@ -132,6 +139,7 @@ const shouldUseEIP7702 = ({ smartWalletAccount }, client) => {
132
139
  * @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.
133
140
  * @param client - The Dynamic client instance.
134
141
  * @returns A promise that resolves to a ZeroDev kernel account.
142
+ * @not-instrumented
135
143
  */
136
144
  const createKernelAccount = async ({ publicClient, smartWalletAccount, eip7702Auth }, client) => {
137
145
  const zerodevProvider = getZerodevProviderFromSettings(client);
@@ -175,6 +183,7 @@ const createKernelAccount = async ({ publicClient, smartWalletAccount, eip7702Au
175
183
 
176
184
  //#endregion
177
185
  //#region src/utils/getPaymasterConfig/getPaymasterConfig.ts
186
+ /** @not-instrumented */
178
187
  const getPaymasterConfig = ({ chain, gasTokenAddress, paymasterRpc }) => {
179
188
  const getPaymasterData = (params) => {
180
189
  return (0, _zerodev_sdk.createZeroDevPaymasterClient)({
@@ -190,6 +199,7 @@ const getPaymasterConfig = ({ chain, gasTokenAddress, paymasterRpc }) => {
190
199
 
191
200
  //#endregion
192
201
  //#region src/utils/getZerodevRpc/getZerodevRpc.ts
202
+ /** @not-instrumented */
193
203
  const getZerodevRpc = ({ networkId, bundlerProvider, rpcType }, client) => {
194
204
  const zerodevProvider = getZerodevProviderFromSettings(client);
195
205
  if (zerodevProvider?.zerodevPaymasterRpcUrl) return zerodevProvider.zerodevPaymasterRpcUrl;
@@ -285,4 +295,4 @@ Object.defineProperty(exports, 'version', {
285
295
  return version;
286
296
  }
287
297
  });
288
- //# sourceMappingURL=getZerodevRpc-DfIZRsGz.cjs.js.map
298
+ //# sourceMappingURL=getZerodevRpc-7HsOpAJK.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getZerodevRpc-7HsOpAJK.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\n/** @not-instrumented */\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\n/** @not-instrumented */\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 * @not-instrumented\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\n/** @not-instrumented */\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\n/** @not-instrumented */\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\n/** @not-instrumented */\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\n/** @not-instrumented */\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 * @not-instrumented\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\n/** @not-instrumented */\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\n/** @not-instrumented */\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,MAAaC,0BAGT;CACF,IAAKD,uBAAU;CACf,IAAKA,uBAAU;CACf,IAAKA,uBAAU;CAChB;AAED,MAAa,qBAAqB,CAChC;CACE,QAAQ,CACN;EAAE,MAAM;EAAM,MAAM;EAAW,EAC/B;EAAE,MAAM;EAAU,MAAM;EAAW,CACpC;CACD,MAAM;CACN,SAAS,CAAC;EAAE,MAAM;EAAI,MAAM;EAAQ,CAAC;CACrC,iBAAiB;CACjB,MAAM;CACP,CACF;;;;;ACrCD,MAAa,kCAAkC,WAA0B;CACvE,MAAM,kBAAkB,OAAO;AAE/B,kDAAc,iBAAiB,qCAAqC;CAEpE,MAAM,kBAAkB,gBAAgB,WAAW,MAChD,aAAa,SAAS,aAAaE,wCAAa,QAClD;AAED,kDACE,iBACA,gDACD;AAED,QAAO;;;;;;ACVT,MAAa,uCACX,EAAE,aACF,WACG;AAGH,QAFwB,+BAA+B,OAAO,CAEvC,uCAAuC,MAC3D,aAAa,SAAS,UAAU,UAClC;;;;;;;;;;;;;;;ACSH,MAAa,kCACX,EAAE,sBACF,8DAA2B,KAC0B;CACrD,MAAM,+FACJ,EAAE,oBAAoB,EACtB,OACD;AAED,KAAI,CAAC,uBAAuB,+CAAoB,oBAAoB,CAClE,OAAM,IAAIC,8DAAqC,mBAAmB,QAAQ;AAG5E,2EACE,EACE,eAAe,qBAChB,EACD,OACD;;;;;;ACzBH,MAAa,qBAAqB,EAChC,mBACA,cACA,QACA,YACA,oBAC6B;CAC7B,MAAM,SAAS;EACb;EACA;EACA;EACD;AAED,KAAI,sBAAsB,sBACxB,6EAAkC,cAAc,OAAO;AAGzD,6DAA8B,cAAc,OAAO;;;;;;AChCrD,MAAa,iBAAiB,eAAwB;AACpD,KAAI,eAAeC,yDAA8B,GAC/C,QAAOC,uBAAU,cAAc,MAAM;AAIvC,QAAOA,uBAAU,cAAc,MAAM;;;;;;ACGvC,MAAa,oBAAoB,EAC/B,eACA,iBAC4B;AAE5B,KAAI,iBAAiB,iBAAiB,mBACpC,QAAO,mBAAmB;CAI5B,MAAMC,oBACJ,WAAW;AACb,KAAI,qBAAqB,wBACvB,QAAO,wBAAwB;AAIjC,QAAOC,uBAAU;;;;;;AChBnB,MAAa,oBACX,EAAE,sBACF,WACG;CACH,MAAM,kBAAkB,+BAA+B,OAAO;AAE9D,kDACE,iBACA,sDACD;CAED,MAAM,4FACJ,EAAE,oBAAoB,EACtB,OACD;AAED,kDAAc,kBAAkB,kCAAkC;AAElE,QACE,gBAAgB,iBAEhB,mBAAmB,YAAY,iBAAiB;;;;;;;;;;;;;;;;;ACMpD,MAAa,sBAAsB,OACjC,EAAE,cAAc,oBAAoB,eACpC,WAC8D;CAC9D,MAAM,kBAAkB,+BAA+B,OAAO;AAE9D,kDACE,iBACA,sDACD;CAED,MAAM,SAAS,MAAM,+BACnB,EACE,oBACD,EACD,OACD;CAED,MAAM,4FACJ,EAAE,eAAe,oBAAoB,EACrC,OACD,EAAE;CAIH,MAAM,aAAa,cADjB,kBAAkB,qBAAqB,gBAAgB,kBACN;AAInD,KAFmB,iBAAiB,EAAE,oBAAoB,EAAE,OAAO,CAGjE,8CAAkC,cAAc;EAC9C,gBAAgB;EAChB;EACA;EACA,eAAeC,uBAAU;EAC1B,CAAC;CAMJ,MAAM,gBAAgB,iBAAiB;EACrC;EACA,eAJA,kBAAkB,iBAAiB,gBAAgB;EAKpD,CAAC;AAKF,KAFE,gBAAgB,2BAA2B,MAQ3C,wEAAyC,cAAc;EACrD;EACA,kBAAkB;GAChB,MAAM;GACN,IATqB,iBAAiB;IACxC;IACA,eAAe,gBAAgB;IAChC,CAAC;GAOC;EACD;EACD,CAAC;AAYJ,8CAAkC,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,wDALsD;GACpD;GACA,0BAAgB,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,kDACE,sBACA,4CAA4C,YAC7C;CAED,MAAM,oBACJ,mBACA,gBAAgB,0BAChBC,kDAAuB;CAEzB,MAAM,YACJ,YAAY,YAAY,oBAAoB;AAE9C,QAAO,GAAG,qBAAqB,GAAG,QAAQ,GAAG,qBAAqB,SAAS,GAAG,UAAU,GAAG"}
@@ -10,7 +10,7 @@ import { toMultiChainECDSAValidator } from "@zerodev/multi-chain-ecdsa-validator
10
10
 
11
11
  //#region package.json
12
12
  var name = "@dynamic-labs-sdk/zerodev";
13
- var version = "0.17.4";
13
+ var version = "0.18.0";
14
14
 
15
15
  //#endregion
16
16
  //#region src/constants.ts
@@ -51,6 +51,7 @@ const ERC20_TRANSFER_ABI = [{
51
51
 
52
52
  //#endregion
53
53
  //#region src/utils/getZerodevProviderFromSettings/getZerodevProviderFromSettings.ts
54
+ /** @not-instrumented */
54
55
  const getZerodevProviderFromSettings = (client) => {
55
56
  const projectSettings = client.projectSettings;
56
57
  assertDefined(projectSettings, "Project settings are not available");
@@ -61,6 +62,7 @@ const getZerodevProviderFromSettings = (client) => {
61
62
 
62
63
  //#endregion
63
64
  //#region src/utils/getZerodevChainProviderForNetworkId/getZerodevChainProviderForNetworkId.ts
65
+ /** @not-instrumented */
64
66
  const getZerodevChainProviderForNetworkId = ({ networkId }, client) => {
65
67
  return getZerodevProviderFromSettings(client).multichainAccountAbstractionProviders?.find((provider) => provider.chain === networkId);
66
68
  };
@@ -75,6 +77,7 @@ const getZerodevChainProviderForNetworkId = ({ networkId }, client) => {
75
77
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
76
78
  * @returns A promise that resolves to an WalletClient instance.
77
79
  * @throws NoSmartWalletAccountSignerFoundError When the signer wallet account is not found for the given smart wallet account.
80
+ * @not-instrumented
78
81
  */
79
82
  const getSignerForSmartWalletAccount = ({ smartWalletAccount }, client = getDefaultClient()) => {
80
83
  const signerWalletAccount = getOwnerWalletAccountForSmartWalletAccount({ smartWalletAccount }, client);
@@ -84,6 +87,7 @@ const getSignerForSmartWalletAccount = ({ smartWalletAccount }, client = getDefa
84
87
 
85
88
  //#endregion
86
89
  //#region src/utils/getEcdsaValidator/getEcdsaValidator.ts
90
+ /** @not-instrumented */
87
91
  const getEcdsaValidator = ({ ecdsaProviderType, publicClient, signer, entryPoint, kernelVersion }) => {
88
92
  const params = {
89
93
  entryPoint,
@@ -96,6 +100,7 @@ const getEcdsaValidator = ({ ecdsaProviderType, publicClient, signer, entryPoint
96
100
 
97
101
  //#endregion
98
102
  //#region src/utils/getEntryPoint/getEntryPoint.ts
103
+ /** @not-instrumented */
99
104
  const getEntryPoint = (entryPoint) => {
100
105
  if (entryPoint === ProviderEntryPointVersionEnum.V6) return constants.getEntryPoint("0.6");
101
106
  return constants.getEntryPoint("0.7");
@@ -103,6 +108,7 @@ const getEntryPoint = (entryPoint) => {
103
108
 
104
109
  //#endregion
105
110
  //#region src/utils/getKernelVersion/getKernelVersion.ts
111
+ /** @not-instrumented */
106
112
  const getKernelVersion = ({ kernelVersion, entryPoint }) => {
107
113
  if (kernelVersion && kernelVersion in KERNEL_VERSION_MAP) return KERNEL_VERSION_MAP[kernelVersion];
108
114
  const entryPointVersion = entryPoint.version;
@@ -112,6 +118,7 @@ const getKernelVersion = ({ kernelVersion, entryPoint }) => {
112
118
 
113
119
  //#endregion
114
120
  //#region src/utils/shouldUseEIP7702/shouldUseEIP7702.ts
121
+ /** @not-instrumented */
115
122
  const shouldUseEIP7702 = ({ smartWalletAccount }, client) => {
116
123
  const zerodevProvider = getZerodevProviderFromSettings(client);
117
124
  assertDefined(zerodevProvider, "Zerodev provider is not enabled in project settings");
@@ -132,6 +139,7 @@ const shouldUseEIP7702 = ({ smartWalletAccount }, client) => {
132
139
  * @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.
133
140
  * @param client - The Dynamic client instance.
134
141
  * @returns A promise that resolves to a ZeroDev kernel account.
142
+ * @not-instrumented
135
143
  */
136
144
  const createKernelAccount$1 = async ({ publicClient, smartWalletAccount, eip7702Auth }, client) => {
137
145
  const zerodevProvider = getZerodevProviderFromSettings(client);
@@ -175,6 +183,7 @@ const createKernelAccount$1 = async ({ publicClient, smartWalletAccount, eip7702
175
183
 
176
184
  //#endregion
177
185
  //#region src/utils/getPaymasterConfig/getPaymasterConfig.ts
186
+ /** @not-instrumented */
178
187
  const getPaymasterConfig = ({ chain, gasTokenAddress, paymasterRpc }) => {
179
188
  const getPaymasterData = (params) => {
180
189
  return createZeroDevPaymasterClient({
@@ -190,6 +199,7 @@ const getPaymasterConfig = ({ chain, gasTokenAddress, paymasterRpc }) => {
190
199
 
191
200
  //#endregion
192
201
  //#region src/utils/getZerodevRpc/getZerodevRpc.ts
202
+ /** @not-instrumented */
193
203
  const getZerodevRpc = ({ networkId, bundlerProvider, rpcType }, client) => {
194
204
  const zerodevProvider = getZerodevProviderFromSettings(client);
195
205
  if (zerodevProvider?.zerodevPaymasterRpcUrl) return zerodevProvider.zerodevPaymasterRpcUrl;
@@ -202,4 +212,4 @@ const getZerodevRpc = ({ networkId, bundlerProvider, rpcType }, client) => {
202
212
 
203
213
  //#endregion
204
214
  export { getKernelVersion as a, getSignerForSmartWalletAccount as c, ERC20_TRANSFER_ABI as d, ZERODEV_METADATA as f, shouldUseEIP7702 as i, getZerodevChainProviderForNetworkId as l, version as m, getPaymasterConfig as n, getEntryPoint as o, name as p, createKernelAccount$1 as r, getEcdsaValidator as s, getZerodevRpc as t, getZerodevProviderFromSettings as u };
205
- //# sourceMappingURL=getZerodevRpc-BnYhE2ZX.esm.js.map
215
+ //# sourceMappingURL=getZerodevRpc-BIo0SG4X.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getZerodevRpc-BIo0SG4X.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\n/** @not-instrumented */\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\n/** @not-instrumented */\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 * @not-instrumented\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\n/** @not-instrumented */\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\n/** @not-instrumented */\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\n/** @not-instrumented */\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\n/** @not-instrumented */\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 * @not-instrumented\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\n/** @not-instrumented */\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\n/** @not-instrumented */\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":"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"}
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- const require_getZerodevRpc = require('./getZerodevRpc-DfIZRsGz.cjs.js');
1
+ const require_getZerodevRpc = require('./getZerodevRpc-7HsOpAJK.cjs.js');
2
2
  let _dynamic_labs_sdk_assert_package_version = require("@dynamic-labs-sdk/assert-package-version");
3
3
  let _dynamic_labs_sdk_client_core = require("@dynamic-labs-sdk/client/core");
4
4
  let _dynamic_labs_sdk_client = require("@dynamic-labs-sdk/client");
@@ -10,6 +10,7 @@ let viem = require("viem");
10
10
  let viem_actions = require("viem/actions");
11
11
 
12
12
  //#region src/utils/getAllUserZerodevAddresses/getAllUserZerodevAddresses.ts
13
+ /** @not-instrumented */
13
14
  const getAllUserZerodevAddresses = (client) => {
14
15
  return (client.user?.verifiedCredentials.filter((credential) => credential.walletProvider === _dynamic_labs_sdk_api_core.WalletProviderEnum.SmartContractWallet && credential.walletName?.toLowerCase().startsWith(require_getZerodevRpc.ZERODEV_METADATA.normalizedWalletName) && credential.address && credential.chain && (0, _dynamic_labs_sdk_client_core.getChainFromVerifiedCredentialChain)(credential.chain) === "EVM") ?? []).map((credential) => credential.address);
15
16
  };
@@ -32,6 +33,7 @@ const getAllUserZerodevAddresses = (client) => {
32
33
  * to separate the authorization signing step from the transaction step.
33
34
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
34
35
  * @returns A promise that resolves to a KernelClient instance.
36
+ * @not-instrumented
35
37
  */
36
38
  const createKernelClientForWalletAccount = async ({ smartWalletAccount, withSponsorship = true, bundlerProvider, networkId, bundlerRpc: bundlerRpcOverride, paymasterRpc: paymasterRpcOverride, gasTokenAddress, eip7702Auth }, client = (0, _dynamic_labs_sdk_client_core.getDefaultClient)()) => {
37
39
  let networkData;
@@ -81,6 +83,7 @@ const createKernelClientForWalletAccount = async ({ smartWalletAccount, withSpon
81
83
 
82
84
  //#endregion
83
85
  //#region src/utils/shouldSignWithEoa/shouldSignWithEoa.ts
86
+ /** @not-instrumented */
84
87
  const shouldSignWithEoa = async ({ kernelClient, smartWalletAccount }, client) => {
85
88
  if (!require_getZerodevRpc.shouldUseEIP7702({ smartWalletAccount }, client)) return false;
86
89
  return !await kernelClient.account.isDeployed();
@@ -88,6 +91,7 @@ const shouldSignWithEoa = async ({ kernelClient, smartWalletAccount }, client) =
88
91
 
89
92
  //#endregion
90
93
  //#region src/utils/signMessage/signMessage.ts
94
+ /** @not-instrumented */
91
95
  const signMessage = async ({ walletAccount, message }, client) => {
92
96
  const kernelClient = await createKernelClientForWalletAccount({ smartWalletAccount: walletAccount }, client);
93
97
  if (await shouldSignWithEoa({
@@ -107,6 +111,7 @@ const signMessage = async ({ walletAccount, message }, client) => {
107
111
 
108
112
  //#endregion
109
113
  //#region src/isGasSponsorshipError/isGasSponsorshipError.ts
114
+ /** @not-instrumented */
110
115
  const isGasSponsorshipError = (err) => {
111
116
  return err?.message?.includes("userOp did not match any gas sponsoring policies") || false;
112
117
  };
@@ -119,6 +124,7 @@ const EVM_NATIVE_DECIMALS = 18;
119
124
  *
120
125
  * Attempts with gas sponsorship first, then falls back to unsponsored
121
126
  * if the paymaster rejects.
127
+ * @not-instrumented
122
128
  */
123
129
  const zerodevTransferAmount = async ({ amount, recipient, token, walletAccount }, client) => {
124
130
  if (!(0, _dynamic_labs_sdk_evm.isEvmWalletAccount)(walletAccount)) throw new _dynamic_labs_sdk_client.InvalidParamError("Wallet account is not an EVM wallet account");
@@ -160,6 +166,7 @@ const zerodevTransferAmount = async ({ amount, recipient, token, walletAccount }
160
166
 
161
167
  //#endregion
162
168
  //#region src/utils/createZerodevWalletProvider/createZerodevWalletProvider.ts
169
+ /** @not-instrumented */
163
170
  const createZerodevWalletProvider = (client) => {
164
171
  const chain = "EVM";
165
172
  const walletProviderType = _dynamic_labs_sdk_api_core.WalletProviderEnum.SmartContractWallet;
@@ -221,6 +228,7 @@ const ZERODEV_EXTENSION_KEY = "zerodev";
221
228
  * This extension enables Account Abstraction integration with ZeroDev
222
229
  *
223
230
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
231
+ * @not-instrumented
224
232
  */
225
233
  const addZerodevExtension = (client = (0, _dynamic_labs_sdk_client_core.getDefaultClient)()) => {
226
234
  if ((0, _dynamic_labs_sdk_client_core.hasExtension)({ extensionKey: ZERODEV_EXTENSION_KEY }, client)) return;
@@ -242,6 +250,7 @@ const addZerodevExtension = (client = (0, _dynamic_labs_sdk_client_core.getDefau
242
250
  * @param params.kernelClient - The kernel client to use for preparing the user operation
243
251
  * @param params.calls - Array of calls (can be single call or multiple calls)
244
252
  * @returns Promise resolving to the prepared user operation
253
+ * @not-instrumented
245
254
  */
246
255
  const prepareUserOperationFromCalls = async ({ kernelClient, calls }) => {
247
256
  const normalizedCalls = calls.map((call) => ({
@@ -263,6 +272,7 @@ const prepareUserOperationFromCalls = async ({ kernelClient, calls }) => {
263
272
  * @param params.kernelClient - Optional kernel client with sponsorship configured
264
273
  * @param params.walletAccount - The wallet account to use (required if kernelClient not provided)
265
274
  * @returns True if the user operation can be sponsored, false otherwise
275
+ * @not-instrumented
266
276
  */
267
277
  const canSponsorUserOperation = async ({ walletAccount, calls, kernelClient }) => {
268
278
  let kernelClientToUse = kernelClient;
@@ -282,6 +292,7 @@ const canSponsorUserOperation = async ({ walletAccount, calls, kernelClient }) =
282
292
 
283
293
  //#endregion
284
294
  //#region src/utils/calculateGasForUserOperation/calculateGasForUserOperation.ts
295
+ /** @not-instrumented */
285
296
  const calculateGasForUserOperation = ({ userOperationData }) => {
286
297
  return (userOperationData.callGasLimit + userOperationData.verificationGasLimit + userOperationData.preVerificationGas) * userOperationData.maxFeePerGas;
287
298
  };
@@ -295,6 +306,7 @@ const calculateGasForUserOperation = ({ userOperationData }) => {
295
306
  * @param params.calls - Array of calls (single call or multiple calls)
296
307
  * @param params.walletAccount - The wallet account that will execute the user operation
297
308
  * @returns The estimated gas cost in wei, or null if estimation fails
309
+ * @not-instrumented
298
310
  */
299
311
  const estimateUserOperationGas = async ({ walletAccount, calls }) => {
300
312
  try {
@@ -321,6 +333,7 @@ const estimateUserOperationGas = async ({ walletAccount, calls }) => {
321
333
  * @param params.walletAccount - The wallet account to use (required if kernelClient not provided)
322
334
  * @param params.withSponsorship - Whether to use sponsorship (default: true, only used with walletAccount)
323
335
  * @returns Promise resolving to the UserOperation receipt
336
+ * @not-instrumented
324
337
  */
325
338
  const sendUserOperation = async ({ walletAccount, calls, kernelClient, withSponsorship = true }) => {
326
339
  let kernelClientToUse = kernelClient;
@@ -353,6 +366,7 @@ const sendUserOperation = async ({ walletAccount, calls, kernelClient, withSpons
353
366
  * @param [params.networkId] - The network ID to use for signing. If not provided, uses the wallet's active network.
354
367
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
355
368
  * @returns A promise that resolves to the signed EIP-7702 authorization.
369
+ * @not-instrumented
356
370
  */
357
371
  const signEip7702Authorization = async ({ smartWalletAccount, networkId }, client = (0, _dynamic_labs_sdk_client_core.getDefaultClient)()) => {
358
372
  const walletClient = await require_getZerodevRpc.getSignerForSmartWalletAccount({ smartWalletAccount }, client);
@@ -380,6 +394,7 @@ const signEip7702Authorization = async ({ smartWalletAccount, networkId }, clien
380
394
  *
381
395
  * @param walletAccount - The wallet account to check.
382
396
  * @returns True if the wallet account is a Zerodev wallet account, false otherwise.
397
+ * @not-instrumented
383
398
  */
384
399
  const isZerodevWalletAccount = (walletAccount) => {
385
400
  return walletAccount.walletProviderKey.startsWith(require_getZerodevRpc.ZERODEV_METADATA.normalizedWalletName);
@@ -399,6 +414,7 @@ const isZerodevWalletAccount = (walletAccount) => {
399
414
  * @param params.nativeTokenPriceUsd - Optional USD price of the native token for fee conversion.
400
415
  * @returns Fee data including gas estimates and human-readable amounts.
401
416
  * @throws {FeeEstimationFailedError} If fee calculation fails.
417
+ * @not-instrumented
402
418
  */
403
419
  const calculateFeeForUserOperation = ({ userOperationData, networkData: _networkData, nativeTokenPriceUsd }) => {
404
420
  try {
@@ -445,6 +461,7 @@ const calculateFeeForUserOperation = ({ userOperationData, networkData: _network
445
461
  * });
446
462
  * }
447
463
  * ```
464
+ * @not-instrumented
448
465
  */
449
466
  const hasRequiredGasFields = (userOperation) => Boolean(userOperation.callGasLimit && userOperation.verificationGasLimit && userOperation.preVerificationGas && userOperation.maxFeePerGas);
450
467
 
@@ -472,6 +489,7 @@ const hasRequiredGasFields = (userOperation) => Boolean(userOperation.callGasLim
472
489
  * @throws {InvalidParamError} If wallet account is not an EVM ZeroDev account or network ID is not configured.
473
490
  * @throws {SimulationFailedError} If the simulation API call fails.
474
491
  * @throws {FeeEstimationFailedError} If includeFees is true and fee calculation fails.
492
+ * @not-instrumented
475
493
  */
476
494
  const simulateZerodevUserOperation = async ({ walletAccount, userOperation, networkId, entryPoint, includeFees = false }, client = (0, _dynamic_labs_sdk_client.getDefaultClient)()) => {
477
495
  if (!(0, _dynamic_labs_sdk_evm.isEvmWalletAccount)(walletAccount)) throw new _dynamic_labs_sdk_client.InvalidParamError("Wallet account must be an EVM wallet account");