@account-kit/infra 4.0.0-alpha.5 → 4.0.0-alpha.7

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 (73) hide show
  1. package/dist/cjs/chains.d.ts +2 -0
  2. package/dist/cjs/chains.js +35 -1
  3. package/dist/cjs/chains.js.map +1 -1
  4. package/dist/cjs/client/decorators/alchemyEnhancedApis.d.ts +1132 -1276
  5. package/dist/cjs/client/internal/smartAccountClientFromRpc.js +2 -14
  6. package/dist/cjs/client/internal/smartAccountClientFromRpc.js.map +1 -1
  7. package/dist/cjs/client/isAlchemySmartAccountClient.d.ts +1132 -1276
  8. package/dist/cjs/client/smartAccountClient.d.ts +2 -3
  9. package/dist/cjs/client/smartAccountClient.js +2 -2
  10. package/dist/cjs/client/smartAccountClient.js.map +1 -1
  11. package/dist/cjs/client/types.d.ts +1 -48
  12. package/dist/cjs/client/types.js.map +1 -1
  13. package/dist/cjs/index.d.ts +1 -1
  14. package/dist/cjs/index.js +3 -1
  15. package/dist/cjs/index.js.map +1 -1
  16. package/dist/cjs/middleware/gasManager.d.ts +2 -29
  17. package/dist/cjs/middleware/gasManager.js +4 -141
  18. package/dist/cjs/middleware/gasManager.js.map +1 -1
  19. package/dist/cjs/middleware/userOperationSimulator.d.ts +2 -2
  20. package/dist/cjs/middleware/userOperationSimulator.js.map +1 -1
  21. package/dist/cjs/version.d.ts +1 -1
  22. package/dist/cjs/version.js +1 -1
  23. package/dist/cjs/version.js.map +1 -1
  24. package/dist/esm/chains.d.ts +2 -0
  25. package/dist/esm/chains.js +34 -0
  26. package/dist/esm/chains.js.map +1 -1
  27. package/dist/esm/client/decorators/alchemyEnhancedApis.d.ts +1132 -1276
  28. package/dist/esm/client/internal/smartAccountClientFromRpc.js +2 -14
  29. package/dist/esm/client/internal/smartAccountClientFromRpc.js.map +1 -1
  30. package/dist/esm/client/isAlchemySmartAccountClient.d.ts +1132 -1276
  31. package/dist/esm/client/smartAccountClient.d.ts +2 -3
  32. package/dist/esm/client/smartAccountClient.js +2 -3
  33. package/dist/esm/client/smartAccountClient.js.map +1 -1
  34. package/dist/esm/client/types.d.ts +1 -48
  35. package/dist/esm/client/types.js.map +1 -1
  36. package/dist/esm/index.d.ts +1 -1
  37. package/dist/esm/index.js +1 -1
  38. package/dist/esm/index.js.map +1 -1
  39. package/dist/esm/middleware/gasManager.d.ts +2 -29
  40. package/dist/esm/middleware/gasManager.js +5 -142
  41. package/dist/esm/middleware/gasManager.js.map +1 -1
  42. package/dist/esm/middleware/userOperationSimulator.d.ts +2 -2
  43. package/dist/esm/middleware/userOperationSimulator.js.map +1 -1
  44. package/dist/esm/version.d.ts +1 -1
  45. package/dist/esm/version.js +1 -1
  46. package/dist/esm/version.js.map +1 -1
  47. package/dist/types/chains.d.ts +2 -0
  48. package/dist/types/chains.d.ts.map +1 -1
  49. package/dist/types/client/decorators/alchemyEnhancedApis.d.ts +1132 -1276
  50. package/dist/types/client/decorators/alchemyEnhancedApis.d.ts.map +1 -1
  51. package/dist/types/client/internal/smartAccountClientFromRpc.d.ts +2 -2
  52. package/dist/types/client/isAlchemySmartAccountClient.d.ts +1132 -1276
  53. package/dist/types/client/isAlchemySmartAccountClient.d.ts.map +1 -1
  54. package/dist/types/client/smartAccountClient.d.ts +2 -3
  55. package/dist/types/client/smartAccountClient.d.ts.map +1 -1
  56. package/dist/types/client/types.d.ts +1 -48
  57. package/dist/types/client/types.d.ts.map +1 -1
  58. package/dist/types/index.d.ts +1 -1
  59. package/dist/types/index.d.ts.map +1 -1
  60. package/dist/types/middleware/gasManager.d.ts +15 -87
  61. package/dist/types/middleware/gasManager.d.ts.map +1 -1
  62. package/dist/types/middleware/userOperationSimulator.d.ts +2 -2
  63. package/dist/types/middleware/userOperationSimulator.d.ts.map +1 -1
  64. package/dist/types/version.d.ts +1 -1
  65. package/package.json +4 -3
  66. package/src/chains.ts +36 -0
  67. package/src/client/internal/smartAccountClientFromRpc.ts +4 -20
  68. package/src/client/smartAccountClient.ts +4 -5
  69. package/src/client/types.ts +1 -54
  70. package/src/index.ts +2 -0
  71. package/src/middleware/gasManager.ts +21 -424
  72. package/src/middleware/userOperationSimulator.ts +6 -2
  73. package/src/version.ts +1 -1
@@ -1,13 +1,12 @@
1
1
  import { type Prettify, type SmartAccountClient, type SmartAccountClientActions, type SmartAccountClientConfig, type SmartAccountClientRpcSchema, type SmartContractAccount, type UserOperationContext } from "@aa-sdk/core";
2
2
  import { type Chain, type Transport } from "viem";
3
- import { type AlchemyGasManagerConfig } from "../middleware/gasManager.js";
4
3
  import type { AlchemyProviderConfig } from "../type.js";
5
4
  import type { AlchemySmartAccountClientActions } from "./decorators/smartAccount.js";
6
5
  import type { AlchemyRpcSchema } from "./types.js";
7
6
  export type AlchemySmartAccountClientConfig<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartContractAccount | undefined = SmartContractAccount | undefined, context extends UserOperationContext | undefined = UserOperationContext | undefined> = {
8
7
  account?: account;
9
8
  useSimulation?: boolean;
10
- gasManagerConfig?: AlchemyGasManagerConfig;
9
+ policyId?: string;
11
10
  } & AlchemyProviderConfig & Pick<SmartAccountClientConfig<transport, chain, account, context>, "customMiddleware" | "feeEstimator" | "gasEstimator" | "signUserOperation">;
12
11
  export type BaseAlchemyActions<chain extends Chain | undefined = Chain | undefined, account extends SmartContractAccount | undefined = SmartContractAccount | undefined, context extends UserOperationContext | undefined = UserOperationContext | undefined> = SmartAccountClientActions<chain, account, context> & AlchemySmartAccountClientActions<account, context>;
13
12
  export type AlchemySmartAccountClient_Base<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartContractAccount | undefined = SmartContractAccount | undefined, actions extends Record<string, unknown> = Record<string, unknown>, context extends UserOperationContext | undefined = UserOperationContext | undefined> = Prettify<SmartAccountClient<transport, chain, account, actions & BaseAlchemyActions<chain, account, context>, [
@@ -15,4 +14,4 @@ export type AlchemySmartAccountClient_Base<transport extends Transport = Transpo
15
14
  ...AlchemyRpcSchema
16
15
  ], context>>;
17
16
  export type AlchemySmartAccountClient<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartContractAccount | undefined = SmartContractAccount | undefined, actions extends Record<string, unknown> = Record<string, unknown>, context extends UserOperationContext | undefined = UserOperationContext | undefined> = Prettify<AlchemySmartAccountClient_Base<transport, chain, account, actions, context>>;
18
- export declare function createAlchemySmartAccountClient<TTransport extends Transport = Transport, TChain extends Chain = Chain, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined>({ account, gasManagerConfig, useSimulation, feeEstimator, customMiddleware, gasEstimator, signUserOperation, ...config_ }: AlchemySmartAccountClientConfig<TTransport, TChain, TAccount, TContext>): AlchemySmartAccountClient<TTransport, TChain, TAccount, Record<string, never>, TContext>;
17
+ export declare function createAlchemySmartAccountClient<TTransport extends Transport = Transport, TChain extends Chain = Chain, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined>({ account, policyId, useSimulation, feeEstimator, customMiddleware, gasEstimator, signUserOperation, ...config_ }: AlchemySmartAccountClientConfig<TTransport, TChain, TAccount, TContext>): AlchemySmartAccountClient<TTransport, TChain, TAccount, Record<string, never>, TContext>;
@@ -5,7 +5,7 @@ const defaults_js_1 = require("../defaults.js");
5
5
  const schema_js_1 = require("../schema.js");
6
6
  const smartAccountClientFromRpc_js_1 = require("./internal/smartAccountClientFromRpc.js");
7
7
  const rpcClient_js_1 = require("./rpcClient.js");
8
- function createAlchemySmartAccountClient({ account, gasManagerConfig, useSimulation, feeEstimator, customMiddleware, gasEstimator, signUserOperation, ...config_ }) {
8
+ function createAlchemySmartAccountClient({ account, policyId, useSimulation, feeEstimator, customMiddleware, gasEstimator, signUserOperation, ...config_ }) {
9
9
  const config = schema_js_1.AlchemyProviderConfigSchema.parse(config_);
10
10
  const { chain, opts, ...connectionConfig } = config;
11
11
  const client = (0, rpcClient_js_1.createAlchemyPublicRpcClient)({
@@ -20,7 +20,7 @@ function createAlchemySmartAccountClient({ account, gasManagerConfig, useSimulat
20
20
  ...opts,
21
21
  feeOptions,
22
22
  },
23
- gasManagerConfig,
23
+ policyId,
24
24
  useSimulation,
25
25
  feeEstimator,
26
26
  customMiddleware,
@@ -1 +1 @@
1
- {"version":3,"file":"smartAccountClient.js","sourceRoot":"","sources":["../../../src/client/smartAccountClient.ts"],"names":[],"mappings":";;;AAUA,gDAAmE;AAEnE,4CAA2D;AAG3D,0FAAuG;AACvG,iDAA8D;AAsH9D,SAAgB,+BAA+B,CAAC,EAC9C,OAAO,EACP,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,GAAG,OAAO,EACsB;IAChC,MAAM,MAAM,GAAG,uCAA2B,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1D,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,gBAAgB,EAAE,GAAG,MAAM,CAAC;IAEpD,MAAM,MAAM,GAAG,IAAA,2CAA4B,EAAC;QAC1C,KAAK;QACL,gBAAgB;KACjB,CAAC,CAAC;IAEH,MAAM,UAAU,GACd,IAAI,EAAE,UAAU,IAAI,IAAA,+CAAiC,EAAC,KAAK,CAAC,CAAC;IAE/D,OAAO,IAAA,2EAA4C,EAAC;QAClD,MAAM;QACN,OAAO;QACP,IAAI,EAAE;YACJ,GAAG,IAAI;YACP,UAAU;SACX;QACD,gBAAgB;QAChB,aAAa;QACb,YAAY;QACZ,gBAAgB;QAChB,YAAY;QACZ,iBAAiB;KAClB,CAAC,CAAC;AACL,CAAC;AAnCD,0EAmCC","sourcesContent":["import {\n type Prettify,\n type SmartAccountClient,\n type SmartAccountClientActions,\n type SmartAccountClientConfig,\n type SmartAccountClientRpcSchema,\n type SmartContractAccount,\n type UserOperationContext,\n} from \"@aa-sdk/core\";\nimport { type Chain, type Transport } from \"viem\";\nimport { getDefaultUserOperationFeeOptions } from \"../defaults.js\";\nimport { type AlchemyGasManagerConfig } from \"../middleware/gasManager.js\";\nimport { AlchemyProviderConfigSchema } from \"../schema.js\";\nimport type { AlchemyProviderConfig } from \"../type.js\";\nimport type { AlchemySmartAccountClientActions } from \"./decorators/smartAccount.js\";\nimport { createAlchemySmartAccountClientFromRpcClient } from \"./internal/smartAccountClientFromRpc.js\";\nimport { createAlchemyPublicRpcClient } from \"./rpcClient.js\";\nimport type { AlchemyRpcSchema } from \"./types.js\";\n\n// #region AlchemySmartAccountClientConfig\nexport type AlchemySmartAccountClientConfig<\n transport extends Transport = Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n context extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n> = {\n account?: account;\n useSimulation?: boolean;\n gasManagerConfig?: AlchemyGasManagerConfig;\n} & AlchemyProviderConfig &\n Pick<\n SmartAccountClientConfig<transport, chain, account, context>,\n \"customMiddleware\" | \"feeEstimator\" | \"gasEstimator\" | \"signUserOperation\"\n >;\n// #endregion AlchemySmartAccountClientConfig\n\nexport type BaseAlchemyActions<\n chain extends Chain | undefined = Chain | undefined,\n account extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n context extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n> = SmartAccountClientActions<chain, account, context> &\n AlchemySmartAccountClientActions<account, context>;\n\nexport type AlchemySmartAccountClient_Base<\n transport extends Transport = Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n actions extends Record<string, unknown> = Record<string, unknown>,\n context extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n> = Prettify<\n SmartAccountClient<\n transport,\n chain,\n account,\n actions & BaseAlchemyActions<chain, account, context>,\n [...SmartAccountClientRpcSchema, ...AlchemyRpcSchema],\n context\n >\n>;\n\nexport type AlchemySmartAccountClient<\n transport extends Transport = Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n actions extends Record<string, unknown> = Record<string, unknown>,\n context extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n> = Prettify<\n AlchemySmartAccountClient_Base<transport, chain, account, actions, context>\n>;\n\nexport function createAlchemySmartAccountClient<\n TTransport extends Transport = Transport,\n TChain extends Chain = Chain,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n>({\n account,\n gasManagerConfig,\n useSimulation,\n feeEstimator,\n customMiddleware,\n gasEstimator,\n signUserOperation,\n ...config_\n}: AlchemySmartAccountClientConfig<\n TTransport,\n TChain,\n TAccount,\n TContext\n>): AlchemySmartAccountClient<\n TTransport,\n TChain,\n TAccount,\n Record<string, never>,\n TContext\n>;\n\n/**\n * Creates an Alchemy smart account client using the provided configuration options, including account details, gas manager configuration, and custom middleware.\n *\n * @example\n * ```ts\n * import { createAlchemySmartAccountClient } from \"@account-kit/infra\";\n * import { sepolia } from \"@account-kit/infra/chain\";\n *\n * const client = createAlchemySmartAccountClient({\n * chain: sepolia,\n * apiKey: \"your-api-key\",\n * });\n * ```\n *\n * @param {AlchemySmartAccountClientConfig} config The configuration for creating the Alchemy smart account client\n * @returns {AlchemySmartAccountClient} An instance of `AlchemySmartAccountClient` configured based on the provided options\n */\nexport function createAlchemySmartAccountClient({\n account,\n gasManagerConfig,\n useSimulation,\n feeEstimator,\n customMiddleware,\n gasEstimator,\n signUserOperation,\n ...config_\n}: AlchemySmartAccountClientConfig): AlchemySmartAccountClient {\n const config = AlchemyProviderConfigSchema.parse(config_);\n const { chain, opts, ...connectionConfig } = config;\n\n const client = createAlchemyPublicRpcClient({\n chain,\n connectionConfig,\n });\n\n const feeOptions =\n opts?.feeOptions ?? getDefaultUserOperationFeeOptions(chain);\n\n return createAlchemySmartAccountClientFromRpcClient({\n client,\n account,\n opts: {\n ...opts,\n feeOptions,\n },\n gasManagerConfig,\n useSimulation,\n feeEstimator,\n customMiddleware,\n gasEstimator,\n signUserOperation,\n });\n}\n"]}
1
+ {"version":3,"file":"smartAccountClient.js","sourceRoot":"","sources":["../../../src/client/smartAccountClient.ts"],"names":[],"mappings":";;;AAUA,gDAAmE;AACnE,4CAA2D;AAG3D,0FAAuG;AACvG,iDAA8D;AAsH9D,SAAgB,+BAA+B,CAAC,EAC9C,OAAO,EACP,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,GAAG,OAAO,EACsB;IAChC,MAAM,MAAM,GAAG,uCAA2B,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1D,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,gBAAgB,EAAE,GAAG,MAAM,CAAC;IAEpD,MAAM,MAAM,GAAG,IAAA,2CAA4B,EAAC;QAC1C,KAAK;QACL,gBAAgB;KACjB,CAAC,CAAC;IAEH,MAAM,UAAU,GACd,IAAI,EAAE,UAAU,IAAI,IAAA,+CAAiC,EAAC,KAAK,CAAC,CAAC;IAE/D,OAAO,IAAA,2EAA4C,EAAC;QAClD,MAAM;QACN,OAAO;QACP,IAAI,EAAE;YACJ,GAAG,IAAI;YACP,UAAU;SACX;QACD,QAAQ;QACR,aAAa;QACb,YAAY;QACZ,gBAAgB;QAChB,YAAY;QACZ,iBAAiB;KAClB,CAAC,CAAC;AACL,CAAC;AAnCD,0EAmCC","sourcesContent":["import {\n type Prettify,\n type SmartAccountClient,\n type SmartAccountClientActions,\n type SmartAccountClientConfig,\n type SmartAccountClientRpcSchema,\n type SmartContractAccount,\n type UserOperationContext,\n} from \"@aa-sdk/core\";\nimport { type Chain, type Transport } from \"viem\";\nimport { getDefaultUserOperationFeeOptions } from \"../defaults.js\";\nimport { AlchemyProviderConfigSchema } from \"../schema.js\";\nimport type { AlchemyProviderConfig } from \"../type.js\";\nimport type { AlchemySmartAccountClientActions } from \"./decorators/smartAccount.js\";\nimport { createAlchemySmartAccountClientFromRpcClient } from \"./internal/smartAccountClientFromRpc.js\";\nimport { createAlchemyPublicRpcClient } from \"./rpcClient.js\";\nimport type { AlchemyRpcSchema } from \"./types.js\";\n\n// #region AlchemySmartAccountClientConfig\nexport type AlchemySmartAccountClientConfig<\n transport extends Transport = Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n context extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n> = {\n account?: account;\n useSimulation?: boolean;\n policyId?: string;\n} & AlchemyProviderConfig &\n Pick<\n SmartAccountClientConfig<transport, chain, account, context>,\n \"customMiddleware\" | \"feeEstimator\" | \"gasEstimator\" | \"signUserOperation\"\n >;\n// #endregion AlchemySmartAccountClientConfig\n\nexport type BaseAlchemyActions<\n chain extends Chain | undefined = Chain | undefined,\n account extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n context extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n> = SmartAccountClientActions<chain, account, context> &\n AlchemySmartAccountClientActions<account, context>;\n\nexport type AlchemySmartAccountClient_Base<\n transport extends Transport = Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n actions extends Record<string, unknown> = Record<string, unknown>,\n context extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n> = Prettify<\n SmartAccountClient<\n transport,\n chain,\n account,\n actions & BaseAlchemyActions<chain, account, context>,\n [...SmartAccountClientRpcSchema, ...AlchemyRpcSchema],\n context\n >\n>;\n\nexport type AlchemySmartAccountClient<\n transport extends Transport = Transport,\n chain extends Chain | undefined = Chain | undefined,\n account extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n actions extends Record<string, unknown> = Record<string, unknown>,\n context extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n> = Prettify<\n AlchemySmartAccountClient_Base<transport, chain, account, actions, context>\n>;\n\nexport function createAlchemySmartAccountClient<\n TTransport extends Transport = Transport,\n TChain extends Chain = Chain,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n>({\n account,\n policyId,\n useSimulation,\n feeEstimator,\n customMiddleware,\n gasEstimator,\n signUserOperation,\n ...config_\n}: AlchemySmartAccountClientConfig<\n TTransport,\n TChain,\n TAccount,\n TContext\n>): AlchemySmartAccountClient<\n TTransport,\n TChain,\n TAccount,\n Record<string, never>,\n TContext\n>;\n\n/**\n * Creates an Alchemy smart account client using the provided configuration options, including account details, gas manager configuration, and custom middleware.\n *\n * @example\n * ```ts\n * import { createAlchemySmartAccountClient } from \"@account-kit/infra\";\n * import { sepolia } from \"@account-kit/infra/chain\";\n *\n * const client = createAlchemySmartAccountClient({\n * chain: sepolia,\n * apiKey: \"your-api-key\",\n * });\n * ```\n *\n * @param {AlchemySmartAccountClientConfig} config The configuration for creating the Alchemy smart account client\n * @returns {AlchemySmartAccountClient} An instance of `AlchemySmartAccountClient` configured based on the provided options\n */\nexport function createAlchemySmartAccountClient({\n account,\n policyId,\n useSimulation,\n feeEstimator,\n customMiddleware,\n gasEstimator,\n signUserOperation,\n ...config_\n}: AlchemySmartAccountClientConfig): AlchemySmartAccountClient {\n const config = AlchemyProviderConfigSchema.parse(config_);\n const { chain, opts, ...connectionConfig } = config;\n\n const client = createAlchemyPublicRpcClient({\n chain,\n connectionConfig,\n });\n\n const feeOptions =\n opts?.feeOptions ?? getDefaultUserOperationFeeOptions(chain);\n\n return createAlchemySmartAccountClientFromRpcClient({\n client,\n account,\n opts: {\n ...opts,\n feeOptions,\n },\n policyId,\n useSimulation,\n feeEstimator,\n customMiddleware,\n gasEstimator,\n signUserOperation,\n });\n}\n"]}
@@ -1,32 +1,7 @@
1
1
  import { type BundlerClient, type UserOperationRequest } from "@aa-sdk/core";
2
- import type { Address, Hex, HttpTransport } from "viem";
2
+ import type { HttpTransport } from "viem";
3
3
  import type { SimulateUserOperationAssetChangesRequest, SimulateUserOperationAssetChangesResponse } from "../actions/types";
4
- import type { RequestGasAndPaymasterAndDataOverrides, RequestGasAndPaymasterAndDataResponse, RequestPaymasterAndDataResponse } from "../middleware/gasManager";
5
4
  export type AlchemyRpcSchema = [
6
- {
7
- Method: "alchemy_requestPaymasterAndData";
8
- Parameters: [
9
- {
10
- policyId: string;
11
- entryPoint: Address;
12
- userOperation: UserOperationRequest;
13
- }
14
- ];
15
- ReturnType: RequestPaymasterAndDataResponse;
16
- },
17
- {
18
- Method: "alchemy_requestGasAndPaymasterAndData";
19
- Parameters: [
20
- {
21
- policyId: string;
22
- entryPoint: Address;
23
- userOperation: UserOperationRequest;
24
- dummySignature: Hex;
25
- overrides?: RequestGasAndPaymasterAndDataOverrides;
26
- }
27
- ];
28
- ReturnType: RequestGasAndPaymasterAndDataResponse;
29
- },
30
5
  {
31
6
  Method: "alchemy_simulateUserOperationAssetChanges";
32
7
  Parameters: SimulateUserOperationAssetChangesRequest;
@@ -40,28 +15,6 @@ export type AlchemyRpcSchema = [
40
15
  ];
41
16
  export type ClientWithAlchemyMethods = BundlerClient<HttpTransport> & {
42
17
  request: BundlerClient<HttpTransport>["request"] & {
43
- request(args: {
44
- method: "alchemy_requestPaymasterAndData";
45
- params: [
46
- {
47
- policyId: string;
48
- entryPoint: Address;
49
- userOperation: UserOperationRequest;
50
- }
51
- ];
52
- }): Promise<RequestPaymasterAndDataResponse>;
53
- request(args: {
54
- method: "alchemy_requestGasAndPaymasterAndData";
55
- params: [
56
- {
57
- policyId: string;
58
- entryPoint: Address;
59
- userOperation: UserOperationRequest;
60
- dummySignature: Hex;
61
- overrides?: RequestGasAndPaymasterAndDataOverrides;
62
- }
63
- ];
64
- }): Promise<RequestGasAndPaymasterAndDataResponse>;
65
18
  request(args: {
66
19
  method: "alchemy_simulateUserOperationAssetChanges";
67
20
  params: SimulateUserOperationAssetChangesRequest;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/client/types.ts"],"names":[],"mappings":"","sourcesContent":["import { type BundlerClient, type UserOperationRequest } from \"@aa-sdk/core\";\nimport type { Address, Hex, HttpTransport } from \"viem\";\nimport type {\n SimulateUserOperationAssetChangesRequest,\n SimulateUserOperationAssetChangesResponse,\n} from \"../actions/types\";\nimport type {\n RequestGasAndPaymasterAndDataOverrides,\n RequestGasAndPaymasterAndDataResponse,\n RequestPaymasterAndDataResponse,\n} from \"../middleware/gasManager\";\n\nexport type AlchemyRpcSchema = [\n {\n Method: \"alchemy_requestPaymasterAndData\";\n Parameters: [\n {\n policyId: string;\n entryPoint: Address;\n userOperation: UserOperationRequest;\n }\n ];\n ReturnType: RequestPaymasterAndDataResponse;\n },\n {\n Method: \"alchemy_requestGasAndPaymasterAndData\";\n Parameters: [\n {\n policyId: string;\n entryPoint: Address;\n userOperation: UserOperationRequest;\n dummySignature: Hex;\n overrides?: RequestGasAndPaymasterAndDataOverrides;\n }\n ];\n ReturnType: RequestGasAndPaymasterAndDataResponse;\n },\n {\n Method: \"alchemy_simulateUserOperationAssetChanges\";\n Parameters: SimulateUserOperationAssetChangesRequest;\n ReturnType: SimulateUserOperationAssetChangesResponse;\n },\n {\n Method: \"rundler_maxPriorityFeePerGas\";\n Parameters: [];\n ReturnType: UserOperationRequest[\"maxPriorityFeePerGas\"];\n }\n];\n\nexport type ClientWithAlchemyMethods = BundlerClient<HttpTransport> & {\n request: BundlerClient<HttpTransport>[\"request\"] &\n {\n request(args: {\n method: \"alchemy_requestPaymasterAndData\";\n params: [\n {\n policyId: string;\n entryPoint: Address;\n userOperation: UserOperationRequest;\n }\n ];\n }): Promise<RequestPaymasterAndDataResponse>;\n\n request(args: {\n method: \"alchemy_requestGasAndPaymasterAndData\";\n params: [\n {\n policyId: string;\n entryPoint: Address;\n userOperation: UserOperationRequest;\n dummySignature: Hex;\n overrides?: RequestGasAndPaymasterAndDataOverrides;\n }\n ];\n }): Promise<RequestGasAndPaymasterAndDataResponse>;\n\n request(args: {\n method: \"alchemy_simulateUserOperationAssetChanges\";\n params: SimulateUserOperationAssetChangesRequest;\n }): Promise<SimulateUserOperationAssetChangesResponse>;\n\n request(args: {\n method: \"rundler_maxPriorityFeePerGas\";\n params: [];\n }): Promise<UserOperationRequest[\"maxPriorityFeePerGas\"]>;\n }[\"request\"];\n} & {\n updateHeaders: (headers: HeadersInit) => void;\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/client/types.ts"],"names":[],"mappings":"","sourcesContent":["import { type BundlerClient, type UserOperationRequest } from \"@aa-sdk/core\";\nimport type { HttpTransport } from \"viem\";\nimport type {\n SimulateUserOperationAssetChangesRequest,\n SimulateUserOperationAssetChangesResponse,\n} from \"../actions/types\";\n\nexport type AlchemyRpcSchema = [\n {\n Method: \"alchemy_simulateUserOperationAssetChanges\";\n Parameters: SimulateUserOperationAssetChangesRequest;\n ReturnType: SimulateUserOperationAssetChangesResponse;\n },\n {\n Method: \"rundler_maxPriorityFeePerGas\";\n Parameters: [];\n ReturnType: UserOperationRequest[\"maxPriorityFeePerGas\"];\n }\n];\n\nexport type ClientWithAlchemyMethods = BundlerClient<HttpTransport> & {\n request: BundlerClient<HttpTransport>[\"request\"] &\n {\n request(args: {\n method: \"alchemy_simulateUserOperationAssetChanges\";\n params: SimulateUserOperationAssetChangesRequest;\n }): Promise<SimulateUserOperationAssetChangesResponse>;\n\n request(args: {\n method: \"rundler_maxPriorityFeePerGas\";\n params: [];\n }): Promise<UserOperationRequest[\"maxPriorityFeePerGas\"]>;\n }[\"request\"];\n} & {\n updateHeaders: (headers: HeadersInit) => void;\n};\n"]}
@@ -2,7 +2,7 @@ export type * from "./actions/simulateUserOperationChanges.js";
2
2
  export { simulateUserOperationChanges } from "./actions/simulateUserOperationChanges.js";
3
3
  export type * from "./actions/types.js";
4
4
  export type * from "./chains.js";
5
- export { arbitrum, arbitrumGoerli, arbitrumSepolia, base, baseGoerli, baseSepolia, defineAlchemyChain, fraxtal, fraxtalSepolia, goerli, mainnet, optimism, optimismGoerli, optimismSepolia, polygon, polygonAmoy, polygonMumbai, sepolia, zora, zoraSepolia, } from "./chains.js";
5
+ export { arbitrum, arbitrumGoerli, arbitrumSepolia, base, baseGoerli, baseSepolia, defineAlchemyChain, fraxtal, fraxtalSepolia, goerli, mainnet, optimism, optimismGoerli, optimismSepolia, polygon, polygonAmoy, polygonMumbai, sepolia, zora, zoraSepolia, worldChain, worldChainSepolia, } from "./chains.js";
6
6
  export type * from "./client/decorators/alchemyEnhancedApis.js";
7
7
  export { alchemyEnhancedApiActions } from "./client/decorators/alchemyEnhancedApis.js";
8
8
  export type * from "./client/decorators/smartAccount.js";
package/dist/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AlchemyProviderConfigSchema = exports.alchemyUserOperationSimulator = exports.alchemyGasManagerMiddleware = exports.alchemyFeeEstimator = exports.getAlchemyPaymasterAddress = exports.getDefaultUserOperationFeeOptions = exports.createAlchemySmartAccountClient = exports.createAlchemyPublicRpcClient = exports.isAlchemySmartAccountClient = exports.createAlchemySmartAccountClientFromExisting = exports.alchemyActions = exports.alchemyEnhancedApiActions = exports.zoraSepolia = exports.zora = exports.sepolia = exports.polygonMumbai = exports.polygonAmoy = exports.polygon = exports.optimismSepolia = exports.optimismGoerli = exports.optimism = exports.mainnet = exports.goerli = exports.fraxtalSepolia = exports.fraxtal = exports.defineAlchemyChain = exports.baseSepolia = exports.baseGoerli = exports.base = exports.arbitrumSepolia = exports.arbitrumGoerli = exports.arbitrum = exports.simulateUserOperationChanges = void 0;
3
+ exports.AlchemyProviderConfigSchema = exports.alchemyUserOperationSimulator = exports.alchemyGasManagerMiddleware = exports.alchemyFeeEstimator = exports.getAlchemyPaymasterAddress = exports.getDefaultUserOperationFeeOptions = exports.createAlchemySmartAccountClient = exports.createAlchemyPublicRpcClient = exports.isAlchemySmartAccountClient = exports.createAlchemySmartAccountClientFromExisting = exports.alchemyActions = exports.alchemyEnhancedApiActions = exports.worldChainSepolia = exports.worldChain = exports.zoraSepolia = exports.zora = exports.sepolia = exports.polygonMumbai = exports.polygonAmoy = exports.polygon = exports.optimismSepolia = exports.optimismGoerli = exports.optimism = exports.mainnet = exports.goerli = exports.fraxtalSepolia = exports.fraxtal = exports.defineAlchemyChain = exports.baseSepolia = exports.baseGoerli = exports.base = exports.arbitrumSepolia = exports.arbitrumGoerli = exports.arbitrum = exports.simulateUserOperationChanges = void 0;
4
4
  var simulateUserOperationChanges_js_1 = require("./actions/simulateUserOperationChanges.js");
5
5
  Object.defineProperty(exports, "simulateUserOperationChanges", { enumerable: true, get: function () { return simulateUserOperationChanges_js_1.simulateUserOperationChanges; } });
6
6
  var chains_js_1 = require("./chains.js");
@@ -24,6 +24,8 @@ Object.defineProperty(exports, "polygonMumbai", { enumerable: true, get: functio
24
24
  Object.defineProperty(exports, "sepolia", { enumerable: true, get: function () { return chains_js_1.sepolia; } });
25
25
  Object.defineProperty(exports, "zora", { enumerable: true, get: function () { return chains_js_1.zora; } });
26
26
  Object.defineProperty(exports, "zoraSepolia", { enumerable: true, get: function () { return chains_js_1.zoraSepolia; } });
27
+ Object.defineProperty(exports, "worldChain", { enumerable: true, get: function () { return chains_js_1.worldChain; } });
28
+ Object.defineProperty(exports, "worldChainSepolia", { enumerable: true, get: function () { return chains_js_1.worldChainSepolia; } });
27
29
  var alchemyEnhancedApis_js_1 = require("./client/decorators/alchemyEnhancedApis.js");
28
30
  Object.defineProperty(exports, "alchemyEnhancedApiActions", { enumerable: true, get: function () { return alchemyEnhancedApis_js_1.alchemyEnhancedApiActions; } });
29
31
  var smartAccount_js_1 = require("./client/decorators/smartAccount.js");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AACA,6FAAyF;AAAhF,+IAAA,4BAA4B,OAAA;AAGrC,yCAqBqB;AApBnB,qGAAA,QAAQ,OAAA;AACR,2GAAA,cAAc,OAAA;AACd,4GAAA,eAAe,OAAA;AACf,iGAAA,IAAI,OAAA;AACJ,uGAAA,UAAU,OAAA;AACV,wGAAA,WAAW,OAAA;AACX,+GAAA,kBAAkB,OAAA;AAClB,oGAAA,OAAO,OAAA;AACP,2GAAA,cAAc,OAAA;AACd,mGAAA,MAAM,OAAA;AACN,oGAAA,OAAO,OAAA;AACP,qGAAA,QAAQ,OAAA;AACR,2GAAA,cAAc,OAAA;AACd,4GAAA,eAAe,OAAA;AACf,oGAAA,OAAO,OAAA;AACP,wGAAA,WAAW,OAAA;AACX,0GAAA,aAAa,OAAA;AACb,oGAAA,OAAO,OAAA;AACP,iGAAA,IAAI,OAAA;AACJ,wGAAA,WAAW,OAAA;AAGb,qFAAuF;AAA9E,mIAAA,yBAAyB,OAAA;AAElC,uEAAqE;AAA5D,iHAAA,cAAc,OAAA;AACvB,+FAA6J;AAApJ,2JAAA,4CAA4C,OAA+C;AACpG,0FAAsF;AAA7E,6IAAA,2BAA2B,OAAA;AAEpC,sDAAqE;AAA5D,4HAAA,4BAA4B,OAAA;AAErC,wEAAiF;AAAxE,wIAAA,+BAA+B,OAAA;AAExC,6CAAkE;AAAzD,gIAAA,iCAAiC,OAAA;AAC1C,mDAA8D;AAArD,4HAAA,0BAA0B,OAAA;AACnC,gEAAmE;AAA1D,sHAAA,mBAAmB,OAAA;AAE5B,4DAAyE;AAAhE,4HAAA,2BAA2B,OAAA;AACpC,oFAAuF;AAA9E,0IAAA,6BAA6B,OAAA;AAEtC,yCAA0D;AAAjD,wHAAA,2BAA2B,OAAA","sourcesContent":["export type * from \"./actions/simulateUserOperationChanges.js\";\nexport { simulateUserOperationChanges } from \"./actions/simulateUserOperationChanges.js\";\nexport type * from \"./actions/types.js\";\nexport type * from \"./chains.js\";\nexport {\n arbitrum,\n arbitrumGoerli,\n arbitrumSepolia,\n base,\n baseGoerli,\n baseSepolia,\n defineAlchemyChain,\n fraxtal,\n fraxtalSepolia,\n goerli,\n mainnet,\n optimism,\n optimismGoerli,\n optimismSepolia,\n polygon,\n polygonAmoy,\n polygonMumbai,\n sepolia,\n zora,\n zoraSepolia,\n} from \"./chains.js\";\nexport type * from \"./client/decorators/alchemyEnhancedApis.js\";\nexport { alchemyEnhancedApiActions } from \"./client/decorators/alchemyEnhancedApis.js\";\nexport type * from \"./client/decorators/smartAccount.js\";\nexport { alchemyActions } from \"./client/decorators/smartAccount.js\";\nexport { createAlchemySmartAccountClientFromRpcClient as createAlchemySmartAccountClientFromExisting } from \"./client/internal/smartAccountClientFromRpc.js\";\nexport { isAlchemySmartAccountClient } from \"./client/isAlchemySmartAccountClient.js\";\nexport type * from \"./client/rpcClient.js\";\nexport { createAlchemyPublicRpcClient } from \"./client/rpcClient.js\";\nexport type * from \"./client/smartAccountClient.js\";\nexport { createAlchemySmartAccountClient } from \"./client/smartAccountClient.js\";\nexport type * from \"./client/types.js\";\nexport { getDefaultUserOperationFeeOptions } from \"./defaults.js\";\nexport { getAlchemyPaymasterAddress } from \"./gas-manager.js\";\nexport { alchemyFeeEstimator } from \"./middleware/feeEstimator.js\";\nexport type * from \"./middleware/gasManager.js\";\nexport { alchemyGasManagerMiddleware } from \"./middleware/gasManager.js\";\nexport { alchemyUserOperationSimulator } from \"./middleware/userOperationSimulator.js\";\nexport type * from \"./schema.js\";\nexport { AlchemyProviderConfigSchema } from \"./schema.js\";\nexport type { AlchemyProviderConfig } from \"./type.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AACA,6FAAyF;AAAhF,+IAAA,4BAA4B,OAAA;AAGrC,yCAuBqB;AAtBnB,qGAAA,QAAQ,OAAA;AACR,2GAAA,cAAc,OAAA;AACd,4GAAA,eAAe,OAAA;AACf,iGAAA,IAAI,OAAA;AACJ,uGAAA,UAAU,OAAA;AACV,wGAAA,WAAW,OAAA;AACX,+GAAA,kBAAkB,OAAA;AAClB,oGAAA,OAAO,OAAA;AACP,2GAAA,cAAc,OAAA;AACd,mGAAA,MAAM,OAAA;AACN,oGAAA,OAAO,OAAA;AACP,qGAAA,QAAQ,OAAA;AACR,2GAAA,cAAc,OAAA;AACd,4GAAA,eAAe,OAAA;AACf,oGAAA,OAAO,OAAA;AACP,wGAAA,WAAW,OAAA;AACX,0GAAA,aAAa,OAAA;AACb,oGAAA,OAAO,OAAA;AACP,iGAAA,IAAI,OAAA;AACJ,wGAAA,WAAW,OAAA;AACX,uGAAA,UAAU,OAAA;AACV,8GAAA,iBAAiB,OAAA;AAGnB,qFAAuF;AAA9E,mIAAA,yBAAyB,OAAA;AAElC,uEAAqE;AAA5D,iHAAA,cAAc,OAAA;AACvB,+FAA6J;AAApJ,2JAAA,4CAA4C,OAA+C;AACpG,0FAAsF;AAA7E,6IAAA,2BAA2B,OAAA;AAEpC,sDAAqE;AAA5D,4HAAA,4BAA4B,OAAA;AAErC,wEAAiF;AAAxE,wIAAA,+BAA+B,OAAA;AAExC,6CAAkE;AAAzD,gIAAA,iCAAiC,OAAA;AAC1C,mDAA8D;AAArD,4HAAA,0BAA0B,OAAA;AACnC,gEAAmE;AAA1D,sHAAA,mBAAmB,OAAA;AAE5B,4DAAyE;AAAhE,4HAAA,2BAA2B,OAAA;AACpC,oFAAuF;AAA9E,0IAAA,6BAA6B,OAAA;AAEtC,yCAA0D;AAAjD,wHAAA,2BAA2B,OAAA","sourcesContent":["export type * from \"./actions/simulateUserOperationChanges.js\";\nexport { simulateUserOperationChanges } from \"./actions/simulateUserOperationChanges.js\";\nexport type * from \"./actions/types.js\";\nexport type * from \"./chains.js\";\nexport {\n arbitrum,\n arbitrumGoerli,\n arbitrumSepolia,\n base,\n baseGoerli,\n baseSepolia,\n defineAlchemyChain,\n fraxtal,\n fraxtalSepolia,\n goerli,\n mainnet,\n optimism,\n optimismGoerli,\n optimismSepolia,\n polygon,\n polygonAmoy,\n polygonMumbai,\n sepolia,\n zora,\n zoraSepolia,\n worldChain,\n worldChainSepolia,\n} from \"./chains.js\";\nexport type * from \"./client/decorators/alchemyEnhancedApis.js\";\nexport { alchemyEnhancedApiActions } from \"./client/decorators/alchemyEnhancedApis.js\";\nexport type * from \"./client/decorators/smartAccount.js\";\nexport { alchemyActions } from \"./client/decorators/smartAccount.js\";\nexport { createAlchemySmartAccountClientFromRpcClient as createAlchemySmartAccountClientFromExisting } from \"./client/internal/smartAccountClientFromRpc.js\";\nexport { isAlchemySmartAccountClient } from \"./client/isAlchemySmartAccountClient.js\";\nexport type * from \"./client/rpcClient.js\";\nexport { createAlchemyPublicRpcClient } from \"./client/rpcClient.js\";\nexport type * from \"./client/smartAccountClient.js\";\nexport { createAlchemySmartAccountClient } from \"./client/smartAccountClient.js\";\nexport type * from \"./client/types.js\";\nexport { getDefaultUserOperationFeeOptions } from \"./defaults.js\";\nexport { getAlchemyPaymasterAddress } from \"./gas-manager.js\";\nexport { alchemyFeeEstimator } from \"./middleware/feeEstimator.js\";\nexport type * from \"./middleware/gasManager.js\";\nexport { alchemyGasManagerMiddleware } from \"./middleware/gasManager.js\";\nexport { alchemyUserOperationSimulator } from \"./middleware/userOperationSimulator.js\";\nexport type * from \"./schema.js\";\nexport { AlchemyProviderConfigSchema } from \"./schema.js\";\nexport type { AlchemyProviderConfig } from \"./type.js\";\n"]}
@@ -1,29 +1,2 @@
1
- import type { Address, ClientMiddlewareConfig, ClientMiddlewareFn, EntryPointVersion, Multiplier, UserOperationRequest } from "@aa-sdk/core";
2
- import { type Hex } from "viem";
3
- import type { ClientWithAlchemyMethods } from "../client/types";
4
- export type RequestGasAndPaymasterAndDataOverrides<TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = Partial<{
5
- maxFeePerGas: UserOperationRequest<TEntryPointVersion>["maxFeePerGas"] | Multiplier;
6
- maxPriorityFeePerGas: UserOperationRequest<TEntryPointVersion>["maxPriorityFeePerGas"] | Multiplier;
7
- callGasLimit: UserOperationRequest<TEntryPointVersion>["callGasLimit"] | Multiplier;
8
- verificationGasLimit: UserOperationRequest<TEntryPointVersion>["verificationGasLimit"] | Multiplier;
9
- preVerificationGas: UserOperationRequest<TEntryPointVersion>["preVerificationGas"] | Multiplier;
10
- } & TEntryPointVersion extends "0.7.0" ? {
11
- paymasterVerificationGasLimit: UserOperationRequest<"0.7.0">["paymasterVerificationGasLimit"] | Multiplier;
12
- paymasterPostOpGasLimit: UserOperationRequest<"0.7.0">["paymasterPostOpGasLimit"] | Multiplier;
13
- } : {}>;
14
- export type RequestPaymasterAndDataResponse<TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = TEntryPointVersion extends "0.6.0" ? {
15
- paymasterAndData: UserOperationRequest<"0.6.0">["paymasterAndData"];
16
- } : TEntryPointVersion extends "0.7.0" ? Pick<UserOperationRequest<"0.7.0">, "paymaster" | "paymasterData"> : {};
17
- export type RequestGasAndPaymasterAndDataResponse<TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = Pick<UserOperationRequest, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "maxFeePerGas" | "maxPriorityFeePerGas"> & RequestPaymasterAndDataResponse<TEntryPointVersion>;
18
- export interface AlchemyGasManagerConfig {
19
- policyId: string;
20
- gasEstimationOptions?: AlchemyGasEstimationOptions;
21
- paymasterAddress?: Address;
22
- dummyData?: Hex;
23
- }
24
- export interface AlchemyGasEstimationOptions {
25
- disableGasEstimation: boolean;
26
- fallbackGasEstimator?: ClientMiddlewareFn;
27
- fallbackFeeDataGetter?: ClientMiddlewareFn;
28
- }
29
- export declare function alchemyGasManagerMiddleware<C extends ClientWithAlchemyMethods>(client: C, config: AlchemyGasManagerConfig): Pick<ClientMiddlewareConfig, "paymasterAndData" | "feeEstimator" | "gasEstimator">;
1
+ import type { ClientMiddlewareConfig } from "@aa-sdk/core";
2
+ export declare function alchemyGasManagerMiddleware(policyId: string): Pick<ClientMiddlewareConfig, "dummyPaymasterAndData" | "paymasterAndData">;
@@ -2,147 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.alchemyGasManagerMiddleware = void 0;
4
4
  const core_1 = require("@aa-sdk/core");
5
- const viem_1 = require("viem");
6
- const gas_manager_js_1 = require("../gas-manager.js");
7
- const feeEstimator_js_1 = require("./feeEstimator.js");
8
- const dummyPaymasterAndData = (client, config) => () => {
9
- const paymaster = config.paymasterAddress ?? (0, gas_manager_js_1.getAlchemyPaymasterAddress)(client.chain);
10
- const paymasterData = config.dummyData ??
11
- "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c";
12
- return (0, viem_1.concat)([paymaster, paymasterData]);
13
- };
14
- function alchemyGasManagerMiddleware(client, config) {
15
- const gasEstimationOptions = config.gasEstimationOptions;
16
- const disableGasEstimation = gasEstimationOptions?.disableGasEstimation ?? false;
17
- const fallbackFeeDataGetter = gasEstimationOptions?.fallbackFeeDataGetter ?? (0, feeEstimator_js_1.alchemyFeeEstimator)(client);
18
- const fallbackGasEstimator = gasEstimationOptions?.fallbackGasEstimator ??
19
- (0, core_1.defaultGasEstimator)(client);
20
- return {
21
- gasEstimator: disableGasEstimation
22
- ? fallbackGasEstimator
23
- : async (struct, { overrides, account, feeOptions }) => {
24
- if ((0, core_1.bypassPaymasterAndDataEmptyHex)(overrides)) {
25
- return {
26
- ...struct,
27
- ...(await fallbackGasEstimator(struct, {
28
- overrides,
29
- account,
30
- feeOptions,
31
- client,
32
- })),
33
- };
34
- }
35
- return struct;
36
- },
37
- feeEstimator: disableGasEstimation
38
- ? fallbackFeeDataGetter
39
- : async (struct, { overrides, account, feeOptions }) => {
40
- let maxFeePerGas = await struct.maxFeePerGas;
41
- let maxPriorityFeePerGas = await struct.maxPriorityFeePerGas;
42
- if ((0, core_1.bypassPaymasterAndDataEmptyHex)(overrides)) {
43
- const result = await fallbackFeeDataGetter(struct, {
44
- overrides,
45
- feeOptions,
46
- account,
47
- client,
48
- });
49
- maxFeePerGas = (await result.maxFeePerGas) ?? maxFeePerGas;
50
- maxPriorityFeePerGas =
51
- (await result.maxPriorityFeePerGas) ?? maxPriorityFeePerGas;
52
- }
53
- return {
54
- ...struct,
55
- maxFeePerGas,
56
- maxPriorityFeePerGas,
57
- };
58
- },
59
- paymasterAndData: disableGasEstimation
60
- ? requestPaymasterAndData(client, config)
61
- : requestGasAndPaymasterData(client, config),
62
- };
5
+ function alchemyGasManagerMiddleware(policyId) {
6
+ return (0, core_1.erc7677Middleware)({
7
+ context: { policyId: policyId },
8
+ });
63
9
  }
64
10
  exports.alchemyGasManagerMiddleware = alchemyGasManagerMiddleware;
65
- const overrideField = (field, overrides, feeOptions, userOperation) => {
66
- let _field = field;
67
- if (overrides?.[_field] != null) {
68
- if ((0, core_1.isBigNumberish)(overrides[_field])) {
69
- return (0, core_1.deepHexlify)(overrides[_field]);
70
- }
71
- else {
72
- return {
73
- multiplier: Number(overrides[_field].multiplier),
74
- };
75
- }
76
- }
77
- if ((0, core_1.isMultiplier)(feeOptions?.[field])) {
78
- return {
79
- multiplier: Number(feeOptions[field].multiplier),
80
- };
81
- }
82
- const userOpField = userOperation[field];
83
- if ((0, viem_1.isHex)(userOpField) && (0, viem_1.fromHex)(userOpField, "bigint") > 0n) {
84
- return userOpField;
85
- }
86
- return undefined;
87
- };
88
- function requestGasAndPaymasterData(client, config) {
89
- return {
90
- dummyPaymasterAndData: dummyPaymasterAndData(client, config),
91
- paymasterAndData: async (struct, { overrides: overrides_, feeOptions, account }) => {
92
- const userOperation = (0, core_1.deepHexlify)(await (0, core_1.resolveProperties)(struct));
93
- const overrides = (0, core_1.filterUndefined)({
94
- maxFeePerGas: overrideField("maxFeePerGas", overrides_, feeOptions, userOperation),
95
- maxPriorityFeePerGas: overrideField("maxPriorityFeePerGas", overrides_, feeOptions, userOperation),
96
- callGasLimit: overrideField("callGasLimit", overrides_, feeOptions, userOperation),
97
- verificationGasLimit: overrideField("verificationGasLimit", overrides_, feeOptions, userOperation),
98
- preVerificationGas: overrideField("preVerificationGas", overrides_, feeOptions, userOperation),
99
- });
100
- if (account.getEntryPoint().version === "0.7.0") {
101
- const paymasterVerificationGasLimit = overrideField("paymasterVerificationGasLimit", overrides_, feeOptions, userOperation);
102
- if (paymasterVerificationGasLimit != null) {
103
- overrides.paymasterVerificationGasLimit = paymasterVerificationGasLimit;
104
- }
105
- const paymasterPostOpGasLimit = overrideField("paymasterPostOpGasLimit", overrides_, feeOptions, userOperation);
106
- if (paymasterPostOpGasLimit != null) {
107
- overrides.paymasterPostOpGasLimit = paymasterPostOpGasLimit;
108
- }
109
- }
110
- const result = await client.request({
111
- method: "alchemy_requestGasAndPaymasterAndData",
112
- params: [
113
- {
114
- policyId: config.policyId,
115
- entryPoint: account.getEntryPoint().address,
116
- userOperation,
117
- dummySignature: userOperation.signature,
118
- overrides,
119
- },
120
- ],
121
- });
122
- return {
123
- ...struct,
124
- ...result,
125
- };
126
- },
127
- };
128
- }
129
- const requestPaymasterAndData = (client, config) => ({
130
- dummyPaymasterAndData: dummyPaymasterAndData(client, config),
131
- paymasterAndData: async (struct, { account }) => {
132
- const result = await client.request({
133
- method: "alchemy_requestPaymasterAndData",
134
- params: [
135
- {
136
- policyId: config.policyId,
137
- entryPoint: account.getEntryPoint().address,
138
- userOperation: (0, core_1.deepHexlify)(await (0, core_1.resolveProperties)(struct)),
139
- },
140
- ],
141
- });
142
- return {
143
- ...struct,
144
- ...result,
145
- };
146
- },
147
- });
148
11
  //# sourceMappingURL=gasManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gasManager.js","sourceRoot":"","sources":["../../../src/middleware/gasManager.ts"],"names":[],"mappings":";;;AAUA,uCAQsB;AACtB,+BAAwD;AAExD,sDAA+D;AAC/D,uDAAwD;AAoIxD,MAAM,qBAAqB,GACzB,CACE,MAAS,EACT,MAA+B,EAC/B,EAAE,CACJ,GAAG,EAAE;IACH,MAAM,SAAS,GACb,MAAM,CAAC,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AAiB,EAAC,MAAM,CAAC,CAAC;iBAC5D;aACF;SACF,CAAC,CAAC;QAEH,OAAO;YACL,GAAG,MAAM;YACT,GAAG,MAAM;SACV,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import type {\n Address,\n ClientMiddlewareConfig,\n ClientMiddlewareFn,\n EntryPointVersion,\n Multiplier,\n UserOperationFeeOptions,\n UserOperationOverrides,\n UserOperationRequest,\n} from \"@aa-sdk/core\";\nimport {\n bypassPaymasterAndDataEmptyHex,\n deepHexlify,\n defaultGasEstimator,\n filterUndefined,\n isBigNumberish,\n isMultiplier,\n resolveProperties,\n} from \"@aa-sdk/core\";\nimport { concat, fromHex, isHex, type Hex } from \"viem\";\nimport type { ClientWithAlchemyMethods } from \"../client/types\";\nimport { getAlchemyPaymasterAddress } from \"../gas-manager.js\";\nimport { alchemyFeeEstimator } from \"./feeEstimator.js\";\n\n/**\n * overrides value for [`alchemy_requestGasAndPaymasterData`](https://docs.alchemy.com/reference/alchemy-requestgasandpaymasteranddata)\n *\n * @template {EntryPointVersion} TEntryPointVersion entry point version type\n */\nexport type RequestGasAndPaymasterAndDataOverrides<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = Partial<\n {\n maxFeePerGas:\n | UserOperationRequest<TEntryPointVersion>[\"maxFeePerGas\"]\n | Multiplier;\n maxPriorityFeePerGas:\n | UserOperationRequest<TEntryPointVersion>[\"maxPriorityFeePerGas\"]\n | Multiplier;\n callGasLimit:\n | UserOperationRequest<TEntryPointVersion>[\"callGasLimit\"]\n | Multiplier;\n verificationGasLimit:\n | UserOperationRequest<TEntryPointVersion>[\"verificationGasLimit\"]\n | Multiplier;\n preVerificationGas:\n | UserOperationRequest<TEntryPointVersion>[\"preVerificationGas\"]\n | Multiplier;\n } & TEntryPointVersion extends \"0.7.0\"\n ? {\n paymasterVerificationGasLimit:\n | UserOperationRequest<\"0.7.0\">[\"paymasterVerificationGasLimit\"]\n | Multiplier;\n paymasterPostOpGasLimit:\n | UserOperationRequest<\"0.7.0\">[\"paymasterPostOpGasLimit\"]\n | Multiplier;\n }\n : {}\n>;\n\n/**\n * [`alchemy-requestpaymasteranddata`](https://docs.alchemy.com/reference/alchemy-requestpaymasteranddata)\n * response type\n *\n * @template {EntryPointVersion} TEntryPointVersion entry point version type\n */\nexport type RequestPaymasterAndDataResponse<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = TEntryPointVersion extends \"0.6.0\"\n ? {\n paymasterAndData: UserOperationRequest<\"0.6.0\">[\"paymasterAndData\"];\n }\n : TEntryPointVersion extends \"0.7.0\"\n ? Pick<UserOperationRequest<\"0.7.0\">, \"paymaster\" | \"paymasterData\">\n : {};\n\n/**\n * [`alchemy_requestGasAndPaymasterData`](https://docs.alchemy.com/reference/alchemy-requestgasandpaymasteranddata)\n * response type\n *\n * @template {EntryPointVersion} TEntryPointVersion entry point version type\n */\nexport type RequestGasAndPaymasterAndDataResponse<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n> = Pick<\n UserOperationRequest,\n | \"callGasLimit\"\n | \"preVerificationGas\"\n | \"verificationGasLimit\"\n | \"maxFeePerGas\"\n | \"maxPriorityFeePerGas\"\n> &\n RequestPaymasterAndDataResponse<TEntryPointVersion>;\n\n/**\n * Alchemy gas manager configuration with gas policy id and optional gas estimation options\n *\n * To create a Gas Manager Policy, go to the [gas manager](https://dashboard.alchemy.com/gas-manager?a=embedded-accounts-get-started)\n * page of the Alchemy dashboard and click the “Create new policy” button.\n */\nexport interface AlchemyGasManagerConfig {\n /**\n * the policy id of the gas manager you want to use.\n *\n */\n policyId: string;\n /**\n * optional option configurable for the gas estimation portion of the Alchemy gas manager\n *\n */\n gasEstimationOptions?: AlchemyGasEstimationOptions;\n /**\n * paymaster address to use for the gas estimation.\n * If not provided, the default paymaster address for the chain will be used.\n *\n */\n paymasterAddress?: Address;\n /**\n * dummy paymaster data to use for the gas estimation.\n *\n */\n dummyData?: Hex;\n}\n\n/**\n * Alchemy gas manager configuration option configurable for the gas estimation portion of the Alchemy gas manager\n *\n */\nexport interface AlchemyGasEstimationOptions {\n /**\n * disable gas estimation and fallback to the default gas estimation.\n *\n */\n disableGasEstimation: boolean;\n /**\n * optional fallback gas estimator to use when gas estimation is disabled.\n *\n */\n fallbackGasEstimator?: ClientMiddlewareFn;\n /**\n * optional fallback fee estimator to use when gas estimation is disabled.\n *\n */\n fallbackFeeDataGetter?: ClientMiddlewareFn;\n}\n\n/**\n * Dummy paymaster and data middleware for the alchemy gas manager\n *\n * @template {ClientWithAlchemyMethods} C\n * @param client client with alchemy methods\n * @param config alchemy gas manager configuration\n * @returns the dummyPaymasterAndData middleware for Alchemy gas manager\n */\nconst dummyPaymasterAndData =\n <C extends ClientWithAlchemyMethods>(\n client: C,\n config: AlchemyGasManagerConfig\n ) =>\n () => {\n const paymaster =\n config.paymasterAddress ?? getAlchemyPaymasterAddress(client.chain);\n const paymasterData =\n config.dummyData ??\n \"0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c\";\n\n return concat([paymaster, paymasterData]); // or you can also return { paymaster, paymasterData }\n };\n\n/**\n * Alchemy gas manager middleware used as the paymaster middleware overrides param to the client middleware config\n *\n * @template {ClientWithAlchemyMethods} C\n * @param client client with alchemy methods\n * @param config alchemy gas manager configuration\n * @returns the gas estimator, fee estimator, and paymasterAndData middleware for Alchemy gas manager\n */\nexport function alchemyGasManagerMiddleware<C extends ClientWithAlchemyMethods>(\n client: C,\n config: AlchemyGasManagerConfig\n): Pick<\n ClientMiddlewareConfig,\n \"paymasterAndData\" | \"feeEstimator\" | \"gasEstimator\"\n> {\n const gasEstimationOptions = config.gasEstimationOptions;\n const disableGasEstimation =\n gasEstimationOptions?.disableGasEstimation ?? false;\n const fallbackFeeDataGetter =\n gasEstimationOptions?.fallbackFeeDataGetter ?? alchemyFeeEstimator(client);\n const fallbackGasEstimator =\n gasEstimationOptions?.fallbackGasEstimator ??\n defaultGasEstimator<C>(client);\n\n return {\n gasEstimator: disableGasEstimation\n ? fallbackGasEstimator\n : async (struct, { overrides, account, feeOptions }) => {\n // if user is bypassing paymaster to fallback to having the account to pay the gas (one-off override),\n // we cannot delegate gas estimation to the bundler because paymaster middleware will not be called\n if (bypassPaymasterAndDataEmptyHex(overrides)) {\n return {\n ...struct,\n ...(await fallbackGasEstimator(struct, {\n overrides,\n account,\n feeOptions,\n client,\n })),\n };\n }\n\n // essentially noop, because the gas estimation will happen in the backend\n return struct;\n },\n feeEstimator: disableGasEstimation\n ? fallbackFeeDataGetter\n : async (struct, { overrides, account, feeOptions }) => {\n let maxFeePerGas = await struct.maxFeePerGas;\n let maxPriorityFeePerGas = await struct.maxPriorityFeePerGas;\n\n // if user is bypassing paymaster to fallback to having the account to pay the gas (one-off override),\n // we cannot delegate gas estimation to the bundler because paymaster middleware will not be called\n if (bypassPaymasterAndDataEmptyHex(overrides)) {\n const result = await fallbackFeeDataGetter(struct, {\n overrides,\n feeOptions,\n account,\n client,\n });\n maxFeePerGas = (await result.maxFeePerGas) ?? maxFeePerGas;\n maxPriorityFeePerGas =\n (await result.maxPriorityFeePerGas) ?? maxPriorityFeePerGas;\n }\n\n return {\n ...struct,\n maxFeePerGas,\n maxPriorityFeePerGas,\n };\n },\n paymasterAndData: disableGasEstimation\n ? requestPaymasterAndData(client, config)\n : requestGasAndPaymasterData(client, config),\n };\n}\n\n/**\n * Utility function to override a field in the user operation request with the overrides or fee options\n *\n * @template {EntryPointVersion} TEntryPointVersion\n * @param field the field to override\n * @param overrides the overrides object\n * @param feeOptions the fee options object from the client\n * @param userOperation the user operation request\n * @returns the overridden field value\n */\nconst overrideField = <\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion\n>(\n field: keyof UserOperationFeeOptions<TEntryPointVersion>,\n overrides: UserOperationOverrides<TEntryPointVersion> | undefined,\n feeOptions: UserOperationFeeOptions<TEntryPointVersion> | undefined,\n userOperation: UserOperationRequest<TEntryPointVersion>\n): Hex | Multiplier | undefined => {\n let _field = field as keyof UserOperationOverrides<TEntryPointVersion>;\n\n if (overrides?.[_field] != null) {\n // one-off absolute override\n if (isBigNumberish(overrides[_field])) {\n return deepHexlify(overrides[_field]);\n }\n // one-off multiplier overrides\n else {\n return {\n multiplier: Number((overrides[_field] as Multiplier).multiplier),\n };\n }\n }\n\n // provider level fee options with multiplier\n if (isMultiplier(feeOptions?.[field])) {\n return {\n multiplier: Number((feeOptions![field] as Multiplier).multiplier),\n };\n }\n\n const userOpField =\n userOperation[field as keyof UserOperationRequest<TEntryPointVersion>];\n if (isHex(userOpField) && fromHex(userOpField as Hex, \"bigint\") > 0n) {\n return userOpField;\n }\n return undefined;\n};\n\n/**\n * Alchemy gas manager middleware function that returns the paymaster middleware for the client middleware config\n * that calls the [`alchemy_requestGasAndPaymasterAndData`](https://docs.alchemy.com/reference/alchemy-requestgasandpaymasteranddata)\n *\n * @template {ClientWithAlchemyMethods} C\n * @param client client with alchemy methods\n * @param config alchemy gas manager configuration\n * @returns the paymasterAndData middleware for Alchemy gas manager\n */\nfunction requestGasAndPaymasterData<C extends ClientWithAlchemyMethods>(\n client: C,\n config: AlchemyGasManagerConfig\n): ClientMiddlewareConfig[\"paymasterAndData\"] {\n return {\n dummyPaymasterAndData: dummyPaymasterAndData(client, config),\n\n paymasterAndData: async (\n struct,\n { overrides: overrides_, feeOptions, account }\n ) => {\n const userOperation: UserOperationRequest = deepHexlify(\n await resolveProperties(struct)\n );\n\n const overrides: RequestGasAndPaymasterAndDataOverrides = filterUndefined(\n {\n maxFeePerGas: overrideField(\n \"maxFeePerGas\",\n overrides_ as UserOperationOverrides,\n feeOptions,\n userOperation\n ),\n maxPriorityFeePerGas: overrideField(\n \"maxPriorityFeePerGas\",\n overrides_ as UserOperationOverrides,\n feeOptions,\n userOperation\n ),\n callGasLimit: overrideField(\n \"callGasLimit\",\n overrides_ as UserOperationOverrides,\n feeOptions,\n userOperation\n ),\n verificationGasLimit: overrideField(\n \"verificationGasLimit\",\n overrides_ as UserOperationOverrides,\n feeOptions,\n userOperation\n ),\n preVerificationGas: overrideField(\n \"preVerificationGas\",\n overrides_ as UserOperationOverrides,\n feeOptions,\n userOperation\n ),\n }\n );\n\n if (account.getEntryPoint().version === \"0.7.0\") {\n const paymasterVerificationGasLimit = overrideField<\"0.7.0\">(\n \"paymasterVerificationGasLimit\",\n overrides_ as UserOperationOverrides<\"0.7.0\">,\n feeOptions,\n userOperation\n );\n if (paymasterVerificationGasLimit != null) {\n (\n overrides as RequestGasAndPaymasterAndDataOverrides<\"0.7.0\">\n ).paymasterVerificationGasLimit = paymasterVerificationGasLimit;\n }\n\n const paymasterPostOpGasLimit = overrideField<\"0.7.0\">(\n \"paymasterPostOpGasLimit\",\n overrides_ as UserOperationOverrides<\"0.7.0\">,\n feeOptions,\n userOperation\n );\n if (paymasterPostOpGasLimit != null) {\n (\n overrides as RequestGasAndPaymasterAndDataOverrides<\"0.7.0\">\n ).paymasterPostOpGasLimit = paymasterPostOpGasLimit;\n }\n }\n\n const result = await client.request({\n method: \"alchemy_requestGasAndPaymasterAndData\",\n params: [\n {\n policyId: config.policyId,\n entryPoint: account.getEntryPoint().address,\n userOperation,\n dummySignature: userOperation.signature,\n overrides,\n },\n ],\n });\n\n return {\n ...struct,\n ...result,\n };\n },\n };\n}\n\n/**\n * Alchemy gas manager middleware function that returns the paymaster middleware for the client middleware config\n * that calls the [`alchemy_requestPaymasterAndData`](https://docs.alchemy.com/reference/alchemy-requestpaymasteranddata)\n * with gas estimation disabled.\n *\n * @param client client with alchemy methods\n * @param config alchemy gas manager configuration\n * @returns the paymasterAndData middleware for Alchemy gas manager with gas estimation disabled\n */\nconst requestPaymasterAndData: <C extends ClientWithAlchemyMethods>(\n client: C,\n config: AlchemyGasManagerConfig\n) => ClientMiddlewareConfig[\"paymasterAndData\"] = (client, config) => ({\n dummyPaymasterAndData: dummyPaymasterAndData(client, config),\n paymasterAndData: async (struct, { account }) => {\n const result = await client.request({\n method: \"alchemy_requestPaymasterAndData\",\n params: [\n {\n policyId: config.policyId,\n entryPoint: account.getEntryPoint().address,\n userOperation: deepHexlify(await resolveProperties(struct)),\n },\n ],\n });\n\n return {\n ...struct,\n ...result,\n };\n },\n});\n"]}
1
+ {"version":3,"file":"gasManager.js","sourceRoot":"","sources":["../../../src/middleware/gasManager.ts"],"names":[],"mappings":";;;AACA,uCAAiD;AAqBjD,SAAgB,2BAA2B,CACzC,QAAgB;IAEhB,OAAO,IAAA,wBAAiB,EAAuB;QAC7C,OAAO,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE;KAChC,CAAC,CAAC;AACL,CAAC;AAND,kEAMC","sourcesContent":["import type { ClientMiddlewareConfig } from \"@aa-sdk/core\";\nimport { erc7677Middleware } from \"@aa-sdk/core\";\n\n/**\n * Paymaster middleware factory that uses Alchemy's Gas Manager for sponsoring transactions.\n *\n * @example\n * ```ts\n *\n * import { sepolia } from \"@account-kit/infra\";\n * import { http } from \"viem\";\n *\n * const client = createSmartAccountClient({\n * http(\"rpc-url\"),\n * sepolia,\n * alchemyErc7677Middleware(\"policyId\")\n * );\n * ```\n *\n * @param {string} policyId the policyId for Alchemy's gas manager\n * @returns {Pick<ClientMiddlewareConfig, \"dummyPaymasterAndData\" | \"paymasterAndData\">} partial client middleware configuration containing `dummyPaymasterAndData` and `paymasterAndData`\n */\nexport function alchemyGasManagerMiddleware(\n policyId: string\n): Pick<ClientMiddlewareConfig, \"dummyPaymasterAndData\" | \"paymasterAndData\"> {\n return erc7677Middleware<{ policyId: string }>({\n context: { policyId: policyId },\n });\n}\n"]}
@@ -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;AAsBtB,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\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>(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"]}
@@ -1 +1 @@
1
- export declare const VERSION = "4.0.0-alpha.5";
1
+ export declare const VERSION = "4.0.0-alpha.7";
@@ -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.5";
4
+ exports.VERSION = "4.0.0-alpha.7";
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.5\";\n"]}
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.7\";\n"]}
@@ -26,3 +26,5 @@ export declare const fraxtal: Chain;
26
26
  export declare const fraxtalSepolia: Chain;
27
27
  export declare const zora: Chain;
28
28
  export declare const zoraSepolia: Chain;
29
+ export declare const worldChainSepolia: Chain;
30
+ export declare const worldChain: Chain;
@@ -174,4 +174,38 @@ export const zoraSepolia = {
174
174
  ...vzoras.rpcUrls,
175
175
  },
176
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
+ });
177
211
  //# sourceMappingURL=chains.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chains.js","sourceRoot":"","sources":["../../src/chains.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EACL,QAAQ,IAAI,GAAG,EACf,cAAc,IAAI,IAAI,EACtB,eAAe,IAAI,IAAI,EACvB,IAAI,IAAI,KAAK,EACb,UAAU,IAAI,MAAM,EACpB,WAAW,IAAI,MAAM,EACrB,OAAO,IAAI,KAAK,EAChB,MAAM,IAAI,GAAG,EACb,OAAO,IAAI,KAAK,EAChB,QAAQ,IAAI,GAAG,EACf,cAAc,IAAI,I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O,EAAE;QACP,GAAG,MAAM,CAAC,OAAO;KAClB;CACF,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"]}
1
+ {"version":3,"file":"chains.js","sourceRoot":"","sources":["../../src/chains.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EACL,QAAQ,IAAI,GAAG,EACf,cAAc,IAAI,IAAI,EACtB,eAAe,IAAI,IAAI,EACvB,IAAI,IAAI,KAAK,EACb,UAAU,IAAI,MAAM,EACpB,WAAW,IAAI,MAAM,EACrB,OAAO,IAAI,KAAK,EAChB,MAAM,IAAI,GAAG,EACb,OAAO,IAAI,KAAK,EAChB,QAAQ,IAAI,GAAG,EACf,cAAc,IAAI,IAAI,EACtB,eAAe,IAAI,IAAI,EACvB,OAAO,IAAI,GAAG,EACd,WAAW,IAAI,IAAI,EACnB,aAAa,IAAI,IAAI,EACrB,OAAO,IAAI,IAAI,EACf,IAAI,IAAI,KAAK,EACb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qB;IAC3B,OAAO,EAAE,qBAAqB;IAC9B,cAAc,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9D,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,6CAA6C,CAAC;SACtD;QACD,MAAM,EAAE;YACN,IAAI,EAAE,CAAC,6CAA6C,CAAC;SACtD;QACD,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,6CAA6C,CAAC;SACtD;KACF;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAU,WAAW,CAAC;IAC3C,EAAE,EAAE,GAAG;IACP,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,aAAa;IACtB,cAAc,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9D,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,6CAA6C,CAAC;SACtD;QACD,MAAM,EAAE;YACN,IAAI,EAAE,CAAC,6CAA6C,CAAC;SACtD;QACD,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,6CAA6C,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"]}