@account-kit/infra 4.0.0-alpha.0 → 4.0.0-alpha.10

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 (123) hide show
  1. package/dist/cjs/actions/simulateUserOperationChanges.js.map +1 -1
  2. package/dist/cjs/chains.d.ts +25 -0
  3. package/dist/cjs/chains.js +200 -1
  4. package/dist/cjs/chains.js.map +1 -1
  5. package/dist/cjs/client/decorators/alchemyEnhancedApis.d.ts +5393 -1
  6. package/dist/cjs/client/decorators/alchemyEnhancedApis.js.map +1 -1
  7. package/dist/cjs/client/decorators/smartAccount.js.map +1 -1
  8. package/dist/cjs/client/internal/smartAccountClientFromRpc.d.ts +2 -2
  9. package/dist/cjs/client/internal/smartAccountClientFromRpc.js +3 -14
  10. package/dist/cjs/client/internal/smartAccountClientFromRpc.js.map +1 -1
  11. package/dist/cjs/client/isAlchemySmartAccountClient.d.ts +1173 -1317
  12. package/dist/cjs/client/isAlchemySmartAccountClient.js.map +1 -1
  13. package/dist/cjs/client/rpcClient.js.map +1 -1
  14. package/dist/cjs/client/smartAccountClient.d.ts +2 -3
  15. package/dist/cjs/client/smartAccountClient.js +2 -2
  16. package/dist/cjs/client/smartAccountClient.js.map +1 -1
  17. package/dist/cjs/client/types.d.ts +1 -48
  18. package/dist/cjs/client/types.js.map +1 -1
  19. package/dist/cjs/defaults.js +7 -7
  20. package/dist/cjs/defaults.js.map +1 -1
  21. package/dist/cjs/gas-manager.js +16 -16
  22. package/dist/cjs/gas-manager.js.map +1 -1
  23. package/dist/cjs/index.d.ts +2 -1
  24. package/dist/cjs/index.js +22 -1
  25. package/dist/cjs/index.js.map +1 -1
  26. package/dist/cjs/middleware/feeEstimator.js.map +1 -1
  27. package/dist/cjs/middleware/gasManager.d.ts +2 -29
  28. package/dist/cjs/middleware/gasManager.js +4 -141
  29. package/dist/cjs/middleware/gasManager.js.map +1 -1
  30. package/dist/cjs/middleware/userOperationSimulator.d.ts +2 -2
  31. package/dist/cjs/middleware/userOperationSimulator.js.map +1 -1
  32. package/dist/cjs/schema.js +3 -10
  33. package/dist/cjs/schema.js.map +1 -1
  34. package/dist/cjs/version.d.ts +1 -1
  35. package/dist/cjs/version.js +1 -1
  36. package/dist/cjs/version.js.map +1 -1
  37. package/dist/esm/actions/simulateUserOperationChanges.js.map +1 -1
  38. package/dist/esm/chains.d.ts +25 -0
  39. package/dist/esm/chains.js +199 -0
  40. package/dist/esm/chains.js.map +1 -1
  41. package/dist/esm/client/decorators/alchemyEnhancedApis.d.ts +5393 -1
  42. package/dist/esm/client/decorators/alchemyEnhancedApis.js.map +1 -1
  43. package/dist/esm/client/decorators/smartAccount.js.map +1 -1
  44. package/dist/esm/client/internal/smartAccountClientFromRpc.d.ts +2 -2
  45. package/dist/esm/client/internal/smartAccountClientFromRpc.js +3 -14
  46. package/dist/esm/client/internal/smartAccountClientFromRpc.js.map +1 -1
  47. package/dist/esm/client/isAlchemySmartAccountClient.d.ts +1173 -1317
  48. package/dist/esm/client/isAlchemySmartAccountClient.js.map +1 -1
  49. package/dist/esm/client/rpcClient.js.map +1 -1
  50. package/dist/esm/client/smartAccountClient.d.ts +2 -3
  51. package/dist/esm/client/smartAccountClient.js +2 -3
  52. package/dist/esm/client/smartAccountClient.js.map +1 -1
  53. package/dist/esm/client/types.d.ts +1 -48
  54. package/dist/esm/client/types.js.map +1 -1
  55. package/dist/esm/defaults.js +2 -1
  56. package/dist/esm/defaults.js.map +1 -1
  57. package/dist/esm/gas-manager.js +1 -1
  58. package/dist/esm/gas-manager.js.map +1 -1
  59. package/dist/esm/index.d.ts +2 -1
  60. package/dist/esm/index.js +1 -1
  61. package/dist/esm/index.js.map +1 -1
  62. package/dist/esm/middleware/feeEstimator.js.map +1 -1
  63. package/dist/esm/middleware/gasManager.d.ts +2 -29
  64. package/dist/esm/middleware/gasManager.js +5 -142
  65. package/dist/esm/middleware/gasManager.js.map +1 -1
  66. package/dist/esm/middleware/userOperationSimulator.d.ts +2 -2
  67. package/dist/esm/middleware/userOperationSimulator.js.map +1 -1
  68. package/dist/esm/schema.js +4 -11
  69. package/dist/esm/schema.js.map +1 -1
  70. package/dist/esm/version.d.ts +1 -1
  71. package/dist/esm/version.js +1 -1
  72. package/dist/esm/version.js.map +1 -1
  73. package/dist/types/actions/simulateUserOperationChanges.d.ts +17 -0
  74. package/dist/types/actions/simulateUserOperationChanges.d.ts.map +1 -1
  75. package/dist/types/chains.d.ts +44 -0
  76. package/dist/types/chains.d.ts.map +1 -1
  77. package/dist/types/client/decorators/alchemyEnhancedApis.d.ts +5410 -1
  78. package/dist/types/client/decorators/alchemyEnhancedApis.d.ts.map +1 -1
  79. package/dist/types/client/decorators/smartAccount.d.ts +15 -0
  80. package/dist/types/client/decorators/smartAccount.d.ts.map +1 -1
  81. package/dist/types/client/internal/smartAccountClientFromRpc.d.ts +4 -4
  82. package/dist/types/client/internal/smartAccountClientFromRpc.d.ts.map +1 -1
  83. package/dist/types/client/isAlchemySmartAccountClient.d.ts +1188 -1317
  84. package/dist/types/client/isAlchemySmartAccountClient.d.ts.map +1 -1
  85. package/dist/types/client/rpcClient.d.ts +22 -0
  86. package/dist/types/client/rpcClient.d.ts.map +1 -1
  87. package/dist/types/client/smartAccountClient.d.ts +2 -3
  88. package/dist/types/client/smartAccountClient.d.ts.map +1 -1
  89. package/dist/types/client/types.d.ts +1 -48
  90. package/dist/types/client/types.d.ts.map +1 -1
  91. package/dist/types/defaults.d.ts +14 -0
  92. package/dist/types/defaults.d.ts.map +1 -1
  93. package/dist/types/gas-manager.d.ts +13 -0
  94. package/dist/types/gas-manager.d.ts.map +1 -1
  95. package/dist/types/index.d.ts +2 -1
  96. package/dist/types/index.d.ts.map +1 -1
  97. package/dist/types/middleware/feeEstimator.d.ts +19 -0
  98. package/dist/types/middleware/feeEstimator.d.ts.map +1 -1
  99. package/dist/types/middleware/gasManager.d.ts +15 -87
  100. package/dist/types/middleware/gasManager.d.ts.map +1 -1
  101. package/dist/types/middleware/userOperationSimulator.d.ts +21 -2
  102. package/dist/types/middleware/userOperationSimulator.d.ts.map +1 -1
  103. package/dist/types/schema.d.ts.map +1 -1
  104. package/dist/types/version.d.ts +1 -1
  105. package/dist/types/version.d.ts.map +1 -1
  106. package/package.json +5 -4
  107. package/src/actions/simulateUserOperationChanges.ts +17 -0
  108. package/src/chains.ts +255 -0
  109. package/src/client/decorators/alchemyEnhancedApis.ts +50 -33
  110. package/src/client/decorators/smartAccount.ts +15 -0
  111. package/src/client/internal/smartAccountClientFromRpc.ts +36 -32
  112. package/src/client/isAlchemySmartAccountClient.ts +15 -0
  113. package/src/client/rpcClient.ts +22 -0
  114. package/src/client/smartAccountClient.ts +21 -5
  115. package/src/client/types.ts +1 -54
  116. package/src/defaults.ts +17 -3
  117. package/src/gas-manager.ts +17 -4
  118. package/src/index.ts +25 -1
  119. package/src/middleware/feeEstimator.ts +19 -0
  120. package/src/middleware/gasManager.ts +21 -424
  121. package/src/middleware/userOperationSimulator.ts +25 -2
  122. package/src/schema.ts +3 -11
  123. package/src/version.ts +1 -1
@@ -1,3 +1,3 @@
1
- import { type ClientMiddlewareFn } from "@aa-sdk/core";
1
+ import { type ClientMiddlewareFn, type UserOperationContext } from "@aa-sdk/core";
2
2
  import type { ClientWithAlchemyMethods } from "../client/types";
3
- export declare function alchemyUserOperationSimulator<C extends ClientWithAlchemyMethods>(client: C): ClientMiddlewareFn;
3
+ export declare function alchemyUserOperationSimulator<C extends ClientWithAlchemyMethods, TContext extends UserOperationContext | undefined = UserOperationContext | undefined>(client: C): ClientMiddlewareFn<TContext>;
@@ -1 +1 @@
1
- {"version":3,"file":"userOperationSimulator.js","sourceRoot":"","sources":["../../../src/middleware/userOperationSimulator.ts"],"names":[],"mappings":";;;AAAA,uCAIsB;AAGtB,SAAgB,6BAA6B,CAE3C,MAAS;IACT,OAAO,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACnC,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;YACvC,MAAM,EAAE,2CAA2C;YACnD,MAAM,EAAE;gBACN,IAAA,kBAAW,EAAC,MAAM,IAAA,wBAAiB,EAAC,MAAM,CAAC,CAAC;gBAC5C,OAAO,CAAC,aAAa,EAAE,CAAC,OAAO;aAChC;SACF,CAAC,CAAC;QAEH,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAlBD,sEAkBC","sourcesContent":["import {\n deepHexlify,\n resolveProperties,\n type ClientMiddlewareFn,\n} from \"@aa-sdk/core\";\nimport type { ClientWithAlchemyMethods } from \"../client/types\";\n\nexport function alchemyUserOperationSimulator<\n C extends ClientWithAlchemyMethods\n>(client: C): ClientMiddlewareFn {\n return async (struct, { account }) => {\n const uoSimResult = await client.request({\n method: \"alchemy_simulateUserOperationAssetChanges\",\n params: [\n deepHexlify(await resolveProperties(struct)),\n account.getEntryPoint().address,\n ],\n });\n\n if (uoSimResult.error) {\n throw new Error(uoSimResult.error.message);\n }\n\n return struct;\n };\n}\n"]}
1
+ {"version":3,"file":"userOperationSimulator.js","sourceRoot":"","sources":["../../../src/middleware/userOperationSimulator.ts"],"names":[],"mappings":";;;AAAA,uCAKsB;AAsBtB,SAAgB,6BAA6B,CAK3C,MAAS;IACT,OAAO,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACnC,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;YACvC,MAAM,EAAE,2CAA2C;YACnD,MAAM,EAAE;gBACN,IAAA,kBAAW,EAAC,MAAM,IAAA,wBAAiB,EAAC,MAAM,CAAC,CAAC;gBAC5C,OAAO,CAAC,aAAa,EAAE,CAAC,OAAO;aAChC;SACF,CAAC,CAAC;QAEH,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AArBD,sEAqBC","sourcesContent":["import {\n deepHexlify,\n resolveProperties,\n type ClientMiddlewareFn,\n type UserOperationContext,\n} from \"@aa-sdk/core\";\nimport type { ClientWithAlchemyMethods } from \"../client/types\";\n\n/**\n * A middleware function to be used during simulation of user operations which leverages Alchemy's RPC uo simulation method.\n *\n * @example\n * ```ts\n * import { alchemyUserOperationSimulator, createAlchemyPublicRpcClient } from \"@account-kit/infra\";\n * import { createSmartAccountClient } from \"@aa-sdk/core\";\n *\n * const bundlerClient = createAlchemyPublicRpcClient(...);\n * const client = createSmartAccountClient({\n * userOperationSimulator: alchemyUserOperationSimulator(bundlerClient),\n * ...otherParams\n * });\n * ```\n *\n * @template C The client object with Alchemy methods\n * @param {C} client The client object with Alchemy methods\n * @returns {ClientMiddlewareFn} A middleware function to simulate and process user operations\n */\nexport function alchemyUserOperationSimulator<\n C extends ClientWithAlchemyMethods,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n>(client: C): ClientMiddlewareFn<TContext> {\n return async (struct, { account }) => {\n const uoSimResult = await client.request({\n method: \"alchemy_simulateUserOperationAssetChanges\",\n params: [\n deepHexlify(await resolveProperties(struct)),\n account.getEntryPoint().address,\n ],\n });\n\n if (uoSimResult.error) {\n throw new Error(uoSimResult.error.message);\n }\n\n return struct;\n };\n}\n"]}
@@ -8,16 +8,9 @@ const core_1 = require("@aa-sdk/core");
8
8
  const alchemy_sdk_1 = require("alchemy-sdk");
9
9
  const zod_1 = __importDefault(require("zod"));
10
10
  exports.AlchemyChainSchema = zod_1.default.custom((chain) => {
11
- const _chain = core_1.ChainSchema.parse(chain);
12
- let chainObject;
13
- try {
14
- chainObject = (0, core_1.getChain)(_chain.id);
15
- }
16
- catch {
17
- return false;
18
- }
19
- return chainObject.rpcUrls.alchemy != null;
20
- }, "chain must include an alchemy rpc url. See `createAlchemyChain` or use the `AlchemyChainMap` exported from `@aa-sdk/core`");
11
+ const chain_ = core_1.ChainSchema.parse(chain);
12
+ return chain_.rpcUrls.alchemy != null;
13
+ }, "chain must include an alchemy rpc url. See `createAlchemyChain` or import a chain from `@account-kit/infra`.");
21
14
  exports.AlchemyProviderConfigSchema = core_1.ConnectionConfigSchema.and(zod_1.default.object({
22
15
  chain: exports.AlchemyChainSchema,
23
16
  opts: core_1.SmartAccountClientOptsSchema.optional().default(core_1.SmartAccountClientOptsSchema.parse({})),
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/schema.ts"],"names":[],"mappings":";;;;;;AAAA,uCAKsB;AACtB,6CAAsC;AAEtC,8CAAoB;AAEP,QAAA,kBAAkB,GAAG,aAAC,CAAC,MAAM,CAAQ,CAAC,KAAK,EAAE,EAAE;IAC1D,MAAM,MAAM,GAAG,kBAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAExC,IAAI,WAAW,CAAC;IAChB,IAAI,CAAC;QACH,WAAW,GAAG,IAAA,eAAQ,EAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,WAAW,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC;AAC7C,CAAC,EAAE,2HAA2H,CAAC,CAAC;AAEnH,QAAA,2BAA2B,GAAG,6BAAsB,CAAC,GAAG,CACnE,aAAC,CAAC,MAAM,CAAC;IACP,KAAK,EAAE,0BAAkB;IACzB,IAAI,EAAE,mCAA4B,CAAC,QAAQ,EAAE,CAAC,OAAO,CACnD,mCAA4B,CAAC,KAAK,CAAC,EAAE,CAAC,CACvC;CACF,CAAC,CACH,CAAC;AAEW,QAAA,sBAAsB,GAAG,aAAC,CAAC,UAAU,CAAC,qBAAO,CAAC,CAAC","sourcesContent":["import {\n ChainSchema,\n ConnectionConfigSchema,\n SmartAccountClientOptsSchema,\n getChain,\n} from \"@aa-sdk/core\";\nimport { Alchemy } from \"alchemy-sdk\";\nimport type { Chain } from \"viem\";\nimport z from \"zod\";\n\nexport const AlchemyChainSchema = z.custom<Chain>((chain) => {\n const _chain = ChainSchema.parse(chain);\n\n let chainObject;\n try {\n chainObject = getChain(_chain.id);\n } catch {\n return false;\n }\n\n return chainObject.rpcUrls.alchemy != null;\n}, \"chain must include an alchemy rpc url. See `createAlchemyChain` or use the `AlchemyChainMap` exported from `@aa-sdk/core`\");\n\nexport const AlchemyProviderConfigSchema = ConnectionConfigSchema.and(\n z.object({\n chain: AlchemyChainSchema,\n opts: SmartAccountClientOptsSchema.optional().default(\n SmartAccountClientOptsSchema.parse({})\n ),\n })\n);\n\nexport const AlchemySdkClientSchema = z.instanceof(Alchemy);\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/schema.ts"],"names":[],"mappings":";;;;;;AAAA,uCAIsB;AACtB,6CAAsC;AAEtC,8CAAoB;AAEP,QAAA,kBAAkB,GAAG,aAAC,CAAC,MAAM,CAAQ,CAAC,KAAK,EAAE,EAAE;IAC1D,MAAM,MAAM,GAAG,kBAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAExC,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC;AACxC,CAAC,EAAE,8GAA8G,CAAC,CAAC;AAEtG,QAAA,2BAA2B,GAAG,6BAAsB,CAAC,GAAG,CACnE,aAAC,CAAC,MAAM,CAAC;IACP,KAAK,EAAE,0BAAkB;IACzB,IAAI,EAAE,mCAA4B,CAAC,QAAQ,EAAE,CAAC,OAAO,CACnD,mCAA4B,CAAC,KAAK,CAAC,EAAE,CAAC,CACvC;CACF,CAAC,CACH,CAAC;AAEW,QAAA,sBAAsB,GAAG,aAAC,CAAC,UAAU,CAAC,qBAAO,CAAC,CAAC","sourcesContent":["import {\n ChainSchema,\n ConnectionConfigSchema,\n SmartAccountClientOptsSchema,\n} from \"@aa-sdk/core\";\nimport { Alchemy } from \"alchemy-sdk\";\nimport type { Chain } from \"viem\";\nimport z from \"zod\";\n\nexport const AlchemyChainSchema = z.custom<Chain>((chain) => {\n const chain_ = ChainSchema.parse(chain);\n\n return chain_.rpcUrls.alchemy != null;\n}, \"chain must include an alchemy rpc url. See `createAlchemyChain` or import a chain from `@account-kit/infra`.\");\n\nexport const AlchemyProviderConfigSchema = ConnectionConfigSchema.and(\n z.object({\n chain: AlchemyChainSchema,\n opts: SmartAccountClientOptsSchema.optional().default(\n SmartAccountClientOptsSchema.parse({})\n ),\n })\n);\n\nexport const AlchemySdkClientSchema = z.instanceof(Alchemy);\n"]}
@@ -1 +1 @@
1
- export declare const VERSION = "4.0.0-alpha.0";
1
+ export declare const VERSION = "4.0.0-alpha.10";
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = "4.0.0-alpha.0";
4
+ exports.VERSION = "4.0.0-alpha.10";
5
5
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAG,eAAe,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"4.0.0-alpha.0\";\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAG,gBAAgB,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"4.0.0-alpha.10\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"simulateUserOperationChanges.js","sourceRoot":"","sources":["../../../src/actions/simulateUserOperationChanges.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,WAAW,GAGZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAIvF,MAAM,CAAC,MAAM,4BAA4B,GAQiB,KAAK,EAC7D,MAAM,EACN,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,EAClD,EAAE;IACF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,2BAA2B,CAAC,MAAM,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,uBAAuB,CAC/B,2BAA2B,EAC3B,mCAAmC,EACnC,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,WAAW,CAC1B,MAAM,MAAM,CAAC,kBAAkB,CAAC;QAC9B,GAAG,MAAM;QACT,OAAO;QACP,SAAS;KACV,CAAC,CACH,CAAC;IAEF,OAAO,MAAM,CAAC,OAAO,CAAC;QACpB,MAAM,EAAE,2CAA2C;QACnD,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC;KACpD,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import {\n AccountNotFoundError,\n IncompatibleClientError,\n deepHexlify,\n type SendUserOperationParameters,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport type { Chain, Client, Transport } from \"viem\";\nimport { isAlchemySmartAccountClient } from \"../client/isAlchemySmartAccountClient.js\";\nimport type { AlchemyRpcSchema } from \"../client/types.js\";\nimport type { SimulateUserOperationAssetChangesResponse } from \"./types.js\";\n\nexport const simulateUserOperationChanges: <\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: Client<Transport, TChain, TAccount, AlchemyRpcSchema>,\n args: SendUserOperationParameters<TAccount>\n) => Promise<SimulateUserOperationAssetChangesResponse> = async (\n client,\n { account = client.account, overrides, ...params }\n) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isAlchemySmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"AlchemySmartAccountClient\",\n \"SimulateUserOperationAssetChanges\",\n client\n );\n }\n\n const uoStruct = deepHexlify(\n await client.buildUserOperation({\n ...params,\n account,\n overrides,\n })\n );\n\n return client.request({\n method: \"alchemy_simulateUserOperationAssetChanges\",\n params: [uoStruct, account.getEntryPoint().address],\n });\n};\n"]}
1
+ {"version":3,"file":"simulateUserOperationChanges.js","sourceRoot":"","sources":["../../../src/actions/simulateUserOperationChanges.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,WAAW,GAGZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAqBvF,MAAM,CAAC,MAAM,4BAA4B,GAQiB,KAAK,EAC7D,MAAM,EACN,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,EAClD,EAAE;IACF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,2BAA2B,CAAC,MAAM,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,uBAAuB,CAC/B,2BAA2B,EAC3B,mCAAmC,EACnC,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,WAAW,CAC1B,MAAM,MAAM,CAAC,kBAAkB,CAAC;QAC9B,GAAG,MAAM;QACT,OAAO;QACP,SAAS;KACV,CAAC,CACH,CAAC;IAEF,OAAO,MAAM,CAAC,OAAO,CAAC;QACpB,MAAM,EAAE,2CAA2C;QACnD,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC;KACpD,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import {\n AccountNotFoundError,\n IncompatibleClientError,\n deepHexlify,\n type SendUserOperationParameters,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport type { Chain, Client, Transport } from \"viem\";\nimport { isAlchemySmartAccountClient } from \"../client/isAlchemySmartAccountClient.js\";\nimport type { AlchemyRpcSchema } from \"../client/types.js\";\nimport type { SimulateUserOperationAssetChangesResponse } from \"./types.js\";\n\n/**\n * Simulates user operation changes including asset changes for a specified user operation and returns the resulting state changes.\n *\n * @example\n * ```ts\n * import { simulateUserOperationChanges, createAlchemyPublicRpcClient } from \"@account-kit/infra\";\n *\n * const client = createAlchemyPublicRpcClient(...);\n * const response = await simulateUserOperationChanges(client, {\n * uo: ...\n * });\n * ```\n *\n * @param {Client<Transport, TChain, TAccount, AlchemyRpcSchema>} client The client instance used to send the simulation request\n * @param {SendUserOperationParameters<TAccount>} args The parameters of the user operation including the account and other overrides\n * @returns {Promise<SimulateUserOperationAssetChangesResponse>} A promise that resolves to the response of the simulation showing the asset changes\n */\nexport const simulateUserOperationChanges: <\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: Client<Transport, TChain, TAccount, AlchemyRpcSchema>,\n args: SendUserOperationParameters<TAccount>\n) => Promise<SimulateUserOperationAssetChangesResponse> = async (\n client,\n { account = client.account, overrides, ...params }\n) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isAlchemySmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"AlchemySmartAccountClient\",\n \"SimulateUserOperationAssetChanges\",\n client\n );\n }\n\n const uoStruct = deepHexlify(\n await client.buildUserOperation({\n ...params,\n account,\n overrides,\n })\n );\n\n return client.request({\n method: \"alchemy_simulateUserOperationAssetChanges\",\n params: [uoStruct, account.getEntryPoint().address],\n });\n};\n"]}
@@ -1,5 +1,30 @@
1
1
  import type { Chain } from "viem";
2
+ export type AlchemyChainConfig = {
3
+ chain: Chain;
4
+ rpcBaseUrl: string;
5
+ };
2
6
  export declare const defineAlchemyChain: ({ chain, rpcBaseUrl, }: {
3
7
  chain: Chain;
4
8
  rpcBaseUrl: string;
5
9
  }) => Chain;
10
+ export declare const arbitrum: Chain;
11
+ export declare const arbitrumGoerli: Chain;
12
+ export declare const arbitrumSepolia: Chain;
13
+ export declare const goerli: Chain;
14
+ export declare const mainnet: Chain;
15
+ export declare const optimism: Chain;
16
+ export declare const optimismGoerli: Chain;
17
+ export declare const optimismSepolia: Chain;
18
+ export declare const sepolia: Chain;
19
+ export declare const base: Chain;
20
+ export declare const baseGoerli: Chain;
21
+ export declare const baseSepolia: Chain;
22
+ export declare const polygonMumbai: Chain;
23
+ export declare const polygonAmoy: Chain;
24
+ export declare const polygon: Chain;
25
+ export declare const fraxtal: Chain;
26
+ export declare const fraxtalSepolia: Chain;
27
+ export declare const zora: Chain;
28
+ export declare const zoraSepolia: Chain;
29
+ export declare const worldChainSepolia: Chain;
30
+ export declare const worldChain: Chain;
@@ -1,3 +1,5 @@
1
+ import { defineChain } from "viem";
2
+ import { arbitrum as vab, arbitrumGoerli as vabg, arbitrumSepolia as vabs, base as vbase, baseGoerli as vbaseg, baseSepolia as vbases, fraxtal as vfrax, goerli as vgo, mainnet as vmain, optimism as vop, optimismGoerli as vopg, optimismSepolia as vops, polygon as vpg, polygonAmoy as vpga, polygonMumbai as vpgm, sepolia as vsep, zora as vzora, zoraSepolia as vzoras, } from "viem/chains";
1
3
  export const defineAlchemyChain = ({ chain, rpcBaseUrl, }) => {
2
4
  return {
3
5
  ...chain,
@@ -9,4 +11,201 @@ export const defineAlchemyChain = ({ chain, rpcBaseUrl, }) => {
9
11
  },
10
12
  };
11
13
  };
14
+ export const arbitrum = {
15
+ ...vab,
16
+ rpcUrls: {
17
+ ...vab.rpcUrls,
18
+ alchemy: {
19
+ http: ["https://arb-mainnet.g.alchemy.com/v2"],
20
+ },
21
+ },
22
+ };
23
+ export const arbitrumGoerli = {
24
+ ...vabg,
25
+ rpcUrls: {
26
+ ...vabg.rpcUrls,
27
+ alchemy: {
28
+ http: ["https://arb-goerli.g.alchemy.com/v2"],
29
+ },
30
+ },
31
+ };
32
+ export const arbitrumSepolia = {
33
+ ...vabs,
34
+ rpcUrls: {
35
+ ...vabs.rpcUrls,
36
+ alchemy: {
37
+ http: ["https://arb-sepolia.g.alchemy.com/v2"],
38
+ },
39
+ },
40
+ };
41
+ export const goerli = {
42
+ ...vgo,
43
+ rpcUrls: {
44
+ ...vgo.rpcUrls,
45
+ alchemy: {
46
+ http: ["https://eth-goerli.g.alchemy.com/v2"],
47
+ },
48
+ },
49
+ };
50
+ export const mainnet = {
51
+ ...vmain,
52
+ rpcUrls: {
53
+ ...vmain.rpcUrls,
54
+ alchemy: {
55
+ http: ["https://eth-mainnet.g.alchemy.com/v2"],
56
+ },
57
+ },
58
+ };
59
+ export const optimism = {
60
+ ...vop,
61
+ rpcUrls: {
62
+ ...vop.rpcUrls,
63
+ alchemy: {
64
+ http: ["https://opt-mainnet.g.alchemy.com/v2"],
65
+ },
66
+ },
67
+ };
68
+ export const optimismGoerli = {
69
+ ...vopg,
70
+ rpcUrls: {
71
+ ...vopg.rpcUrls,
72
+ alchemy: {
73
+ http: ["https://opt-goerli.g.alchemy.com/v2"],
74
+ },
75
+ },
76
+ };
77
+ export const optimismSepolia = {
78
+ ...vops,
79
+ rpcUrls: {
80
+ ...vops.rpcUrls,
81
+ alchemy: {
82
+ http: ["https://opt-sepolia.g.alchemy.com/v2"],
83
+ },
84
+ },
85
+ };
86
+ export const sepolia = {
87
+ ...vsep,
88
+ rpcUrls: {
89
+ ...vsep.rpcUrls,
90
+ alchemy: {
91
+ http: ["https://eth-sepolia.g.alchemy.com/v2"],
92
+ },
93
+ },
94
+ };
95
+ export const base = {
96
+ ...vbase,
97
+ rpcUrls: {
98
+ ...vbase.rpcUrls,
99
+ alchemy: {
100
+ http: ["https://base-mainnet.g.alchemy.com/v2"],
101
+ },
102
+ },
103
+ };
104
+ export const baseGoerli = {
105
+ ...vbaseg,
106
+ rpcUrls: {
107
+ ...vbaseg.rpcUrls,
108
+ alchemy: {
109
+ http: ["https://base-goerli.g.alchemy.com/v2"],
110
+ },
111
+ },
112
+ };
113
+ export const baseSepolia = {
114
+ ...vbases,
115
+ rpcUrls: {
116
+ ...vbases.rpcUrls,
117
+ alchemy: {
118
+ http: ["https://base-sepolia.g.alchemy.com/v2"],
119
+ },
120
+ },
121
+ };
122
+ export const polygonMumbai = {
123
+ ...vpgm,
124
+ rpcUrls: {
125
+ ...vpgm.rpcUrls,
126
+ alchemy: {
127
+ http: ["https://polygon-mumbai.g.alchemy.com/v2"],
128
+ },
129
+ },
130
+ };
131
+ export const polygonAmoy = {
132
+ ...vpga,
133
+ rpcUrls: {
134
+ ...vpga.rpcUrls,
135
+ alchemy: {
136
+ http: ["https://polygon-amoy.g.alchemy.com/v2"],
137
+ },
138
+ },
139
+ };
140
+ export const polygon = {
141
+ ...vpg,
142
+ rpcUrls: {
143
+ ...vpg.rpcUrls,
144
+ alchemy: {
145
+ http: ["https://polygon-mainnet.g.alchemy.com/v2"],
146
+ },
147
+ },
148
+ };
149
+ export const fraxtal = {
150
+ ...vfrax,
151
+ rpcUrls: {
152
+ ...vfrax.rpcUrls,
153
+ },
154
+ };
155
+ export const fraxtalSepolia = defineChain({
156
+ id: 2523,
157
+ name: "Fraxtal Sepolia",
158
+ nativeCurrency: { name: "Frax Ether", symbol: "frxETH", decimals: 18 },
159
+ rpcUrls: {
160
+ default: {
161
+ http: ["https://rpc.testnet-sepolia.frax.com"],
162
+ },
163
+ },
164
+ });
165
+ export const zora = {
166
+ ...vzora,
167
+ rpcUrls: {
168
+ ...vzora.rpcUrls,
169
+ },
170
+ };
171
+ export const zoraSepolia = {
172
+ ...vzoras,
173
+ rpcUrls: {
174
+ ...vzoras.rpcUrls,
175
+ },
176
+ };
177
+ export const worldChainSepolia = defineChain({
178
+ id: 4801,
179
+ name: "World Chain Sepolia",
180
+ network: "World Chain Sepolia",
181
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
182
+ rpcUrls: {
183
+ default: {
184
+ http: ["https://worldchain-sepolia.g.alchemy.com/v2"],
185
+ },
186
+ public: {
187
+ http: ["https://worldchain-sepolia.g.alchemy.com/v2"],
188
+ },
189
+ alchemy: {
190
+ http: ["https://worldchain-sepolia.g.alchemy.com/v2"],
191
+ },
192
+ },
193
+ });
194
+ export const worldChain = defineChain({
195
+ id: 480,
196
+ name: "World Chain",
197
+ network: "World Chain",
198
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
199
+ rpcUrls: {
200
+ default: {
201
+ http: ["https://worldchain-mainnet.g.alchemy.com/v2"],
202
+ },
203
+ public: {
204
+ http: ["https://worldchain-mainnet.g.alchemy.com/v2"],
205
+ },
206
+ alchemy: {
207
+ http: ["https://worldchain-mainnet.g.alchemy.com/v2"],
208
+ },
209
+ },
210
+ });
12
211
  //# sourceMappingURL=chains.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chains.js","sourceRoot":"","sources":["../../src/chains.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EACjC,KAAK,EACL,UAAU,GAIX,EAAS,EAAE;IACV,OAAO;QACL,GAAG,KAAK;QACR,OAAO,EAAE;YACP,GAAG,KAAK,CAAC,OAAO;YAChB,OAAO,EAAE;gBACP,IAAI,EAAE,CAAC,UAAU,CAAC;aACnB;SACF;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { Chain } from \"viem\";\n\nexport const defineAlchemyChain = ({\n chain,\n rpcBaseUrl,\n}: {\n chain: Chain;\n rpcBaseUrl: string;\n}): Chain => {\n return {\n ...chain,\n rpcUrls: {\n ...chain.rpcUrls,\n alchemy: {\n http: [rpcBaseUrl],\n },\n },\n };\n};\n"]}
1
+ {"version":3,"file":"chains.js","sourceRoot":"","sources":["../../src/chains.ts"],"names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C,CAAC;SACtD;KACF;CACF,CAAC,CAAC","sourcesContent":["import type { Chain } from \"viem\";\n\nimport { defineChain } from \"viem\";\nimport {\n arbitrum as vab,\n arbitrumGoerli as vabg,\n arbitrumSepolia as vabs,\n base as vbase,\n baseGoerli as vbaseg,\n baseSepolia as vbases,\n fraxtal as vfrax,\n goerli as vgo,\n mainnet as vmain,\n optimism as vop,\n optimismGoerli as vopg,\n optimismSepolia as vops,\n polygon as vpg,\n polygonAmoy as vpga,\n polygonMumbai as vpgm,\n sepolia as vsep,\n zora as vzora,\n zoraSepolia as vzoras,\n} from \"viem/chains\";\n\nexport type AlchemyChainConfig = {\n chain: Chain;\n rpcBaseUrl: string;\n};\n\n/**\n * Defines an Alchemy chain configuration by adding an Alchemy-specific RPC base URL to the chain's RPC URLs.\n *\n * @example\n * ```ts\n * import { defineAlchemyChain } from \"@account-kit/infra\";\n * import { sepolia } from \"viem/chains\";\n *\n * const chain = defineAlchemyChain({\n * chain: sepolia,\n * rpcBaseUrl: \"https://eth-sepolia.g.alchemy.com/v2\"\n * });\n * ```\n *\n * @param {AlchemyChainConfig} params The parameters for defining the Alchemy chain\n * @param {Chain} params.chain The original chain configuration\n * @param {string} params.rpcBaseUrl The Alchemy-specific RPC base URL\n * @returns {Chain} The updated chain configuration with the Alchemy RPC URL added\n */\nexport const defineAlchemyChain = ({\n chain,\n rpcBaseUrl,\n}: {\n chain: Chain;\n rpcBaseUrl: string;\n}): Chain => {\n return {\n ...chain,\n rpcUrls: {\n ...chain.rpcUrls,\n alchemy: {\n http: [rpcBaseUrl],\n },\n },\n };\n};\n\nexport const arbitrum: Chain = {\n ...vab,\n rpcUrls: {\n ...vab.rpcUrls,\n alchemy: {\n http: [\"https://arb-mainnet.g.alchemy.com/v2\"],\n },\n },\n};\n\nexport const arbitrumGoerli: Chain = {\n ...vabg,\n rpcUrls: {\n ...vabg.rpcUrls,\n alchemy: {\n http: [\"https://arb-goerli.g.alchemy.com/v2\"],\n },\n },\n};\n\nexport const arbitrumSepolia: Chain = {\n ...vabs,\n rpcUrls: {\n ...vabs.rpcUrls,\n alchemy: {\n http: [\"https://arb-sepolia.g.alchemy.com/v2\"],\n },\n },\n};\nexport const goerli: Chain = {\n ...vgo,\n rpcUrls: {\n ...vgo.rpcUrls,\n alchemy: {\n http: [\"https://eth-goerli.g.alchemy.com/v2\"],\n },\n },\n};\nexport const mainnet: Chain = {\n ...vmain,\n rpcUrls: {\n ...vmain.rpcUrls,\n alchemy: {\n http: [\"https://eth-mainnet.g.alchemy.com/v2\"],\n },\n },\n};\nexport const optimism: Chain = {\n ...vop,\n rpcUrls: {\n ...vop.rpcUrls,\n alchemy: {\n http: [\"https://opt-mainnet.g.alchemy.com/v2\"],\n },\n },\n};\nexport const optimismGoerli: Chain = {\n ...vopg,\n rpcUrls: {\n ...vopg.rpcUrls,\n alchemy: {\n http: [\"https://opt-goerli.g.alchemy.com/v2\"],\n },\n },\n};\nexport const optimismSepolia: Chain = {\n ...vops,\n rpcUrls: {\n ...vops.rpcUrls,\n alchemy: {\n http: [\"https://opt-sepolia.g.alchemy.com/v2\"],\n },\n },\n};\nexport const sepolia: Chain = {\n ...vsep,\n rpcUrls: {\n ...vsep.rpcUrls,\n alchemy: {\n http: [\"https://eth-sepolia.g.alchemy.com/v2\"],\n },\n },\n};\nexport const base: Chain = {\n ...vbase,\n rpcUrls: {\n ...vbase.rpcUrls,\n alchemy: {\n http: [\"https://base-mainnet.g.alchemy.com/v2\"],\n },\n },\n};\nexport const baseGoerli: Chain = {\n ...vbaseg,\n rpcUrls: {\n ...vbaseg.rpcUrls,\n alchemy: {\n http: [\"https://base-goerli.g.alchemy.com/v2\"],\n },\n },\n};\nexport const baseSepolia: Chain = {\n ...vbases,\n rpcUrls: {\n ...vbases.rpcUrls,\n alchemy: {\n http: [\"https://base-sepolia.g.alchemy.com/v2\"],\n },\n },\n};\n\nexport const polygonMumbai: Chain = {\n ...vpgm,\n rpcUrls: {\n ...vpgm.rpcUrls,\n alchemy: {\n http: [\"https://polygon-mumbai.g.alchemy.com/v2\"],\n },\n },\n};\n\nexport const polygonAmoy: Chain = {\n ...vpga,\n rpcUrls: {\n ...vpga.rpcUrls,\n alchemy: {\n http: [\"https://polygon-amoy.g.alchemy.com/v2\"],\n },\n },\n};\n\nexport const polygon: Chain = {\n ...vpg,\n rpcUrls: {\n ...vpg.rpcUrls,\n alchemy: {\n http: [\"https://polygon-mainnet.g.alchemy.com/v2\"],\n },\n },\n};\n\nexport const fraxtal: Chain = {\n ...vfrax,\n rpcUrls: {\n ...vfrax.rpcUrls,\n },\n};\n\nexport const fraxtalSepolia: Chain = defineChain({\n id: 2523,\n name: \"Fraxtal Sepolia\",\n nativeCurrency: { name: \"Frax Ether\", symbol: \"frxETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.testnet-sepolia.frax.com\"],\n },\n },\n});\n\nexport const zora: Chain = {\n ...vzora,\n rpcUrls: {\n ...vzora.rpcUrls,\n },\n};\n\nexport const zoraSepolia: Chain = {\n ...vzoras,\n rpcUrls: {\n ...vzoras.rpcUrls,\n },\n};\n\nexport const worldChainSepolia: Chain = defineChain({\n id: 4801,\n name: \"World Chain Sepolia\",\n network: \"World Chain Sepolia\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://worldchain-sepolia.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://worldchain-sepolia.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://worldchain-sepolia.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const worldChain: Chain = defineChain({\n id: 480,\n name: \"World Chain\",\n network: \"World Chain\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://worldchain-mainnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://worldchain-mainnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://worldchain-mainnet.g.alchemy.com/v2\"],\n },\n },\n});\n"]}