@atxp/base 0.9.0 → 0.9.2

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 (52) hide show
  1. package/dist/basePaymentMaker.d.ts.map +1 -1
  2. package/dist/basePaymentMaker.js +33 -6
  3. package/dist/basePaymentMaker.js.map +1 -1
  4. package/dist/index.cjs +4833 -8
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.js +4836 -11
  7. package/dist/index.js.map +1 -1
  8. package/dist/node_modules/@aa-sdk/core/dist/esm/client/schema.js +69 -0
  9. package/dist/node_modules/@aa-sdk/core/dist/esm/client/schema.js.map +1 -0
  10. package/dist/node_modules/@aa-sdk/core/dist/esm/errors/base.js +43 -0
  11. package/dist/node_modules/@aa-sdk/core/dist/esm/errors/base.js.map +1 -0
  12. package/dist/node_modules/@aa-sdk/core/dist/esm/errors/client.js +22 -0
  13. package/dist/node_modules/@aa-sdk/core/dist/esm/errors/client.js.map +1 -0
  14. package/dist/node_modules/@aa-sdk/core/dist/esm/transport/split.js +57 -0
  15. package/dist/node_modules/@aa-sdk/core/dist/esm/transport/split.js.map +1 -0
  16. package/dist/node_modules/@aa-sdk/core/dist/esm/utils/schema.js +33 -0
  17. package/dist/node_modules/@aa-sdk/core/dist/esm/utils/schema.js.map +1 -0
  18. package/dist/node_modules/@aa-sdk/core/dist/esm/utils/traceHeader.js +22 -0
  19. package/dist/node_modules/@aa-sdk/core/dist/esm/utils/traceHeader.js.map +1 -0
  20. package/dist/node_modules/@aa-sdk/core/dist/esm/version.js +6 -0
  21. package/dist/node_modules/@aa-sdk/core/dist/esm/version.js.map +1 -0
  22. package/dist/node_modules/@account-kit/infra/dist/esm/alchemyTrackerHeaders.js +36 -0
  23. package/dist/node_modules/@account-kit/infra/dist/esm/alchemyTrackerHeaders.js.map +1 -0
  24. package/dist/node_modules/@account-kit/infra/dist/esm/alchemyTransport.js +190 -0
  25. package/dist/node_modules/@account-kit/infra/dist/esm/alchemyTransport.js.map +1 -0
  26. package/dist/node_modules/@account-kit/infra/dist/esm/schema.js +10 -0
  27. package/dist/node_modules/@account-kit/infra/dist/esm/schema.js.map +1 -0
  28. package/dist/node_modules/@account-kit/infra/dist/esm/version.js +6 -0
  29. package/dist/node_modules/@account-kit/infra/dist/esm/version.js.map +1 -0
  30. package/dist/node_modules/zod/index.js +6 -0
  31. package/dist/node_modules/zod/index.js.map +1 -0
  32. package/dist/node_modules/zod/v3/ZodError.js +137 -0
  33. package/dist/node_modules/zod/v3/ZodError.js.map +1 -0
  34. package/dist/node_modules/zod/v3/errors.js +12 -0
  35. package/dist/node_modules/zod/v3/errors.js.map +1 -0
  36. package/dist/node_modules/zod/v3/external.js +7 -0
  37. package/dist/node_modules/zod/v3/external.js.map +1 -0
  38. package/dist/node_modules/zod/v3/helpers/errorUtil.js +9 -0
  39. package/dist/node_modules/zod/v3/helpers/errorUtil.js.map +1 -0
  40. package/dist/node_modules/zod/v3/helpers/parseUtil.js +113 -0
  41. package/dist/node_modules/zod/v3/helpers/parseUtil.js.map +1 -0
  42. package/dist/node_modules/zod/v3/helpers/util.js +136 -0
  43. package/dist/node_modules/zod/v3/helpers/util.js.map +1 -0
  44. package/dist/node_modules/zod/v3/locales/en.js +112 -0
  45. package/dist/node_modules/zod/v3/locales/en.js.map +1 -0
  46. package/dist/node_modules/zod/v3/types.js +3690 -0
  47. package/dist/node_modules/zod/v3/types.js.map +1 -0
  48. package/dist/smartWalletHelpers.d.ts +5 -1
  49. package/dist/smartWalletHelpers.d.ts.map +1 -1
  50. package/dist/smartWalletHelpers.js +67 -3
  51. package/dist/smartWalletHelpers.js.map +1 -1
  52. package/package.json +5 -4
@@ -0,0 +1,69 @@
1
+ import { BigNumberishRangeSchema, MultiplierSchema } from '../utils/schema.js';
2
+ import { intersection as intersectionType, union as unionType, object as objectType, never as neverType, string as stringType, number as numberType } from '../../../../../zod/v3/types.js';
3
+
4
+ // [!region ConnectionConfigSchema]
5
+ // TODO: in v5 either remove this or simplify it (either way this should be moved out of aa-sdk/core)
6
+ const ConnectionConfigSchema = intersectionType(unionType([
7
+ objectType({
8
+ rpcUrl: neverType().optional(),
9
+ apiKey: stringType(),
10
+ jwt: neverType().optional(),
11
+ }),
12
+ objectType({
13
+ rpcUrl: neverType().optional(),
14
+ apiKey: neverType().optional(),
15
+ jwt: stringType(),
16
+ }),
17
+ objectType({
18
+ rpcUrl: stringType(),
19
+ apiKey: neverType().optional(),
20
+ jwt: neverType().optional(),
21
+ }),
22
+ objectType({
23
+ rpcUrl: stringType(),
24
+ apiKey: neverType().optional(),
25
+ jwt: stringType(),
26
+ }),
27
+ ]), objectType({
28
+ chainAgnosticUrl: stringType().optional(),
29
+ }));
30
+ // [!endregion ConnectionConfigSchema]
31
+ const UserOperationFeeOptionsFieldSchema = BigNumberishRangeSchema.merge(MultiplierSchema).partial();
32
+ const UserOperationFeeOptionsSchema_v6 = objectType({
33
+ maxFeePerGas: UserOperationFeeOptionsFieldSchema,
34
+ maxPriorityFeePerGas: UserOperationFeeOptionsFieldSchema,
35
+ callGasLimit: UserOperationFeeOptionsFieldSchema,
36
+ verificationGasLimit: UserOperationFeeOptionsFieldSchema,
37
+ preVerificationGas: UserOperationFeeOptionsFieldSchema,
38
+ })
39
+ .partial()
40
+ .strict();
41
+ const UserOperationFeeOptionsSchema_v7 = UserOperationFeeOptionsSchema_v6.extend({
42
+ paymasterVerificationGasLimit: UserOperationFeeOptionsFieldSchema,
43
+ paymasterPostOpGasLimit: UserOperationFeeOptionsFieldSchema,
44
+ })
45
+ .partial()
46
+ .strict();
47
+ const UserOperationFeeOptionsSchema = UserOperationFeeOptionsSchema_v7;
48
+ objectType({
49
+ /**
50
+ * The maximum number of times to try fetching a transaction receipt before giving up (default: 5)
51
+ */
52
+ txMaxRetries: numberType().min(0).optional().default(5),
53
+ /**
54
+ * The interval in milliseconds to wait between retries while waiting for tx receipts (default: 2_000)
55
+ */
56
+ txRetryIntervalMs: numberType().min(0).optional().default(2000),
57
+ /**
58
+ * The multiplier on interval length to wait between retries while waiting for tx receipts (default: 1.5)
59
+ */
60
+ txRetryMultiplier: numberType().min(0).optional().default(1.5),
61
+ /**
62
+ * Optional user operation fee options to be set globally at the provider level
63
+ */
64
+ feeOptions: UserOperationFeeOptionsSchema.optional(),
65
+ })
66
+ .strict();
67
+
68
+ export { ConnectionConfigSchema, UserOperationFeeOptionsFieldSchema, UserOperationFeeOptionsSchema, UserOperationFeeOptionsSchema_v6, UserOperationFeeOptionsSchema_v7 };
69
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sources":["../../../../../../../../../node_modules/@aa-sdk/core/dist/esm/client/schema.js"],"sourcesContent":["import { z } from \"zod\";\nimport { BigNumberishRangeSchema, MultiplierSchema } from \"../utils/index.js\";\nexport const createPublicErc4337ClientSchema = () => z.custom((provider) => {\n return (provider != null &&\n typeof provider === \"object\" &&\n \"request\" in provider &&\n \"type\" in provider &&\n \"key\" in provider &&\n \"name\" in provider);\n});\n// [!region ConnectionConfigSchema]\n// TODO: in v5 either remove this or simplify it (either way this should be moved out of aa-sdk/core)\nexport const ConnectionConfigSchema = z.intersection(z.union([\n z.object({\n rpcUrl: z.never().optional(),\n apiKey: z.string(),\n jwt: z.never().optional(),\n }),\n z.object({\n rpcUrl: z.never().optional(),\n apiKey: z.never().optional(),\n jwt: z.string(),\n }),\n z.object({\n rpcUrl: z.string(),\n apiKey: z.never().optional(),\n jwt: z.never().optional(),\n }),\n z.object({\n rpcUrl: z.string(),\n apiKey: z.never().optional(),\n jwt: z.string(),\n }),\n]), z.object({\n chainAgnosticUrl: z.string().optional(),\n}));\n// [!endregion ConnectionConfigSchema]\nexport const UserOperationFeeOptionsFieldSchema = BigNumberishRangeSchema.merge(MultiplierSchema).partial();\nexport const UserOperationFeeOptionsSchema_v6 = z\n .object({\n maxFeePerGas: UserOperationFeeOptionsFieldSchema,\n maxPriorityFeePerGas: UserOperationFeeOptionsFieldSchema,\n callGasLimit: UserOperationFeeOptionsFieldSchema,\n verificationGasLimit: UserOperationFeeOptionsFieldSchema,\n preVerificationGas: UserOperationFeeOptionsFieldSchema,\n})\n .partial()\n .strict();\nexport const UserOperationFeeOptionsSchema_v7 = UserOperationFeeOptionsSchema_v6.extend({\n paymasterVerificationGasLimit: UserOperationFeeOptionsFieldSchema,\n paymasterPostOpGasLimit: UserOperationFeeOptionsFieldSchema,\n})\n .partial()\n .strict();\nexport const UserOperationFeeOptionsSchema = UserOperationFeeOptionsSchema_v7;\nexport const SmartAccountClientOptsSchema = z\n .object({\n /**\n * The maximum number of times to try fetching a transaction receipt before giving up (default: 5)\n */\n txMaxRetries: z.number().min(0).optional().default(5),\n /**\n * The interval in milliseconds to wait between retries while waiting for tx receipts (default: 2_000)\n */\n txRetryIntervalMs: z.number().min(0).optional().default(2000),\n /**\n * The multiplier on interval length to wait between retries while waiting for tx receipts (default: 1.5)\n */\n txRetryMultiplier: z.number().min(0).optional().default(1.5),\n /**\n * Optional user operation fee options to be set globally at the provider level\n */\n feeOptions: UserOperationFeeOptionsSchema.optional(),\n})\n .strict();\n//# sourceMappingURL=schema.js.map"],"names":["z.intersection","z.union","z.object","z.never","z.string","z\n .object","z.number"],"mappings":";;;AAUA;AACA;AACY,MAAC,sBAAsB,GAAGA,gBAAc,CAACC,SAAO,CAAC;AAC7D,IAAIC,UAAQ,CAAC;AACb,QAAQ,MAAM,EAAEC,SAAO,EAAE,CAAC,QAAQ,EAAE;AACpC,QAAQ,MAAM,EAAEC,UAAQ,EAAE;AAC1B,QAAQ,GAAG,EAAED,SAAO,EAAE,CAAC,QAAQ,EAAE;AACjC,KAAK,CAAC;AACN,IAAID,UAAQ,CAAC;AACb,QAAQ,MAAM,EAAEC,SAAO,EAAE,CAAC,QAAQ,EAAE;AACpC,QAAQ,MAAM,EAAEA,SAAO,EAAE,CAAC,QAAQ,EAAE;AACpC,QAAQ,GAAG,EAAEC,UAAQ,EAAE;AACvB,KAAK,CAAC;AACN,IAAIF,UA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,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;AACjE;AACA;AACA;AACA,IAAI,iBAAiB,EAAEA,UAAQ,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC;AAChE;AACA;AACA;AACA,IAAI,UAAU,EAAE,6BAA6B,CAAC,QAAQ,EAAE;AACxD,CAAC;AACD,KAAK,MAAM;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,43 @@
1
+ import { BaseError as BaseError$1 } from 'viem';
2
+ import { VERSION } from '../version.js';
3
+
4
+ /**
5
+ * A custom error class that extends from `ViemBaseError`. This class allows for error messages to include links to relevant documentation based on provided `docsPath` and `docsSlug` parameters.
6
+ * This is based on on viem's BaseError type (obviously from the import and extend)
7
+ * we want the errors here to point to our docs if we supply a docsPath though
8
+ */
9
+ class BaseError extends BaseError$1 {
10
+ constructor(shortMessage, args = {}) {
11
+ super(shortMessage, args);
12
+ Object.defineProperty(this, "name", {
13
+ enumerable: true,
14
+ configurable: true,
15
+ writable: true,
16
+ value: "AASDKError"
17
+ });
18
+ Object.defineProperty(this, "version", {
19
+ enumerable: true,
20
+ configurable: true,
21
+ writable: true,
22
+ value: VERSION
23
+ });
24
+ const docsPath = args.cause instanceof BaseError
25
+ ? args.cause.docsPath || args.docsPath
26
+ : args.docsPath;
27
+ this.message = [
28
+ shortMessage || "An error occurred.",
29
+ "",
30
+ ...(args.metaMessages ? [...args.metaMessages, ""] : []),
31
+ ...(docsPath
32
+ ? [
33
+ `Docs: https://www.alchemy.com/docs/wallets${docsPath}${args.docsSlug ? `#${args.docsSlug}` : ""}`,
34
+ ]
35
+ : []),
36
+ ...(this.details ? [`Details: ${this.details}`] : []),
37
+ `Version: ${this.version}`,
38
+ ].join("\n");
39
+ }
40
+ }
41
+
42
+ export { BaseError };
43
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sources":["../../../../../../../../../node_modules/@aa-sdk/core/dist/esm/errors/base.js"],"sourcesContent":["import { BaseError as ViemBaseError } from \"viem\";\nimport { VERSION } from \"../version.js\";\n/**\n * A custom error class that extends from `ViemBaseError`. This class allows for error messages to include links to relevant documentation based on provided `docsPath` and `docsSlug` parameters.\n * This is based on on viem's BaseError type (obviously from the import and extend)\n * we want the errors here to point to our docs if we supply a docsPath though\n */\nexport class BaseError extends ViemBaseError {\n constructor(shortMessage, args = {}) {\n super(shortMessage, args);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"AASDKError\"\n });\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: VERSION\n });\n const docsPath = args.cause instanceof BaseError\n ? args.cause.docsPath || args.docsPath\n : args.docsPath;\n this.message = [\n shortMessage || \"An error occurred.\",\n \"\",\n ...(args.metaMessages ? [...args.metaMessages, \"\"] : []),\n ...(docsPath\n ? [\n `Docs: https://www.alchemy.com/docs/wallets${docsPath}${args.docsSlug ? `#${args.docsSlug}` : \"\"}`,\n ]\n : []),\n ...(this.details ? [`Details: ${this.details}`] : []),\n `Version: ${this.version}`,\n ].join(\"\\n\");\n }\n}\n//# sourceMappingURL=base.js.map"],"names":["ViemBaseError"],"mappings":";;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,SAAS,SAASA,WAAa,CAAC;AAC7C,IAAI,WAAW,CAAC,YAAY,EAAE,IAAI,GAAG,EAAE,EAAE;AACzC,QAAQ,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC;AACjC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE;AAC5C,YAAY,UAAU,EAAE,IAAI;AAC5B,YAAY,YAAY,EAAE,IAAI;AAC9B,YAAY,QAAQ,EAAE,IAAI;AAC1B,YAAY,KAAK,EAAE;AACnB,SAAS,CAAC;AACV,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE;AAC/C,YAAY,UAAU,EAAE,IAAI;AAC5B,YAAY,YAAY,EAAE,IAAI;AAC9B,YAAY,QAAQ,EAAE,IAAI;AAC1B,YAAY,KAAK,EAAE;AACnB,SAAS,CAAC;AACV,QAAQ,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,YAAY;AAC/C,cAAc,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC;AAC1C,cAAc,IAAI,CAAC,QAAQ;AAC3B,QAAQ,IAAI,CAAC,OAAO,GAAG;AACvB,YAAY,YAAY,IAAI,oBAAoB;AAChD,YAAY,EAAE;AACd,YAAY,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,GAAG,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC;AACpE,YAAY,IAAI;AAChB,kBAAkB;AAClB,oBAAoB,CAAC,0CAA0C,EAAE,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AACtH;AACA,kBAAkB,EAAE,CAAC;AACrB,YAAY,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;AACjE,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;AACtC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;AACpB,IAAI;AACJ;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,22 @@
1
+ import { BaseError } from './base.js';
2
+
3
+ /**
4
+ * Error class representing a "Chain Not Found" error, typically thrown when no chain is supplied to the client.
5
+ */
6
+ class ChainNotFoundError extends BaseError {
7
+ /**
8
+ * Initializes a new instance of the error message with a default message indicating that no chain was supplied to the client.
9
+ */
10
+ constructor() {
11
+ super("No chain supplied to the client");
12
+ Object.defineProperty(this, "name", {
13
+ enumerable: true,
14
+ configurable: true,
15
+ writable: true,
16
+ value: "ChainNotFoundError"
17
+ });
18
+ }
19
+ }
20
+
21
+ export { ChainNotFoundError };
22
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sources":["../../../../../../../../../node_modules/@aa-sdk/core/dist/esm/errors/client.js"],"sourcesContent":["import { BaseError } from \"./base.js\";\n/**\n * Represents an error thrown when a client is not compatible with the expected client type for a specific method. The error message provides guidance on how to create a compatible client.\n */\nexport class IncompatibleClientError extends BaseError {\n /**\n * Throws an error when the client type does not match the expected client type.\n *\n * @param {string} expectedClient The expected type of the client.\n * @param {string} method The method that was called.\n * @param {Client} client The client instance.\n */\n constructor(expectedClient, method, client) {\n super([\n `Client of type (${client.type}) is not a ${expectedClient}.`,\n `Create one with \\`createSmartAccountClient\\` first before using \\`${method}\\``,\n ].join(\"\\n\"));\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"IncompatibleClientError\"\n });\n }\n}\n/**\n * Represents an error that occurs when an invalid RPC URL is provided. This class extends the `BaseError` class and includes the invalid URL in the error message.\n */\nexport class InvalidRpcUrlError extends BaseError {\n /**\n * Creates an instance of an error with a message indicating an invalid RPC URL.\n *\n * @param {string} [rpcUrl] The invalid RPC URL that caused the error\n */\n constructor(rpcUrl) {\n super(`Invalid RPC URL ${rpcUrl}`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"InvalidRpcUrlError\"\n });\n }\n}\n/**\n * Error class representing a \"Chain Not Found\" error, typically thrown when no chain is supplied to the client.\n */\nexport class ChainNotFoundError extends BaseError {\n /**\n * Initializes a new instance of the error message with a default message indicating that no chain was supplied to the client.\n */\n constructor() {\n super(\"No chain supplied to the client\");\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"ChainNotFoundError\"\n });\n }\n}\n/**\n * Error class denoting that the provided entity id is invalid because it's too large.\n */\nexport class InvalidEntityIdError extends BaseError {\n /**\n * Initializes a new instance of the error message with a default message indicating that the entity id is invalid because it's too large.\n *\n * @param {number} entityId the invalid entityId used\n */\n constructor(entityId) {\n super(`Entity ID used is ${entityId}, but must be less than or equal to uint32.max`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"InvalidEntityIdError\"\n });\n }\n}\n/**\n * Error class denoting that the nonce key is invalid because its too large.\n */\nexport class InvalidNonceKeyError extends BaseError {\n /**\n * Initializes a new instance of the error message with a default message indicating that the nonce key is invalid.\n *\n * @param {bigint} nonceKey the invalid nonceKey used\n */\n constructor(nonceKey) {\n super(`Nonce key is ${nonceKey} but has to be less than or equal to 2**152`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"InvalidNonceKeyError\"\n });\n }\n}\n/**\n * Error class denoting that the provided entity id is invalid because it's overriding the native entity id.\n */\nexport class EntityIdOverrideError extends BaseError {\n /**\n * Initializes a new instance of the error message with a default message indicating that the nonce key is invalid.\n */\n constructor() {\n super(`EntityId of 0 is reserved for the owner and cannot be used`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"EntityIdOverrideError\"\n });\n }\n}\n/**\n * Error class denoting that the provided ma v2 account mode is invalid.\n */\nexport class InvalidModularAccountV2Mode extends BaseError {\n /**\n * Initializes a new instance of the error message with a default message indicating that the provided ma v2 account mode is invalid.\n */\n constructor() {\n super(`The provided account mode is invalid for ModularAccount V2`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"InvalidModularAccountV2Mode\"\n });\n }\n}\n/**\n * Error class denoting that the deferred action nonce used is invalid.\n */\nexport class InvalidDeferredActionNonce extends BaseError {\n /**\n * Initializes a new instance of the error message with a default message indicating that the provided deferred action nonce is invalid.\n */\n constructor() {\n super(`The provided deferred action nonce is invalid`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: \"InvalidDeferredActionNonce\"\n });\n }\n}\n//# sourceMappingURL=client.js.map"],"names":[],"mappings":";;AA4CA;AACA;AACA;AACO,MAAM,kBAAkB,SAAS,SAAS,CAAC;AAClD;AACA;AACA;AACA,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,iCAAiC,CAAC;AAChD,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE;AAC5C,YAAY,UAAU,EAAE,IAAI;AAC5B,YAAY,YAAY,EAAE,IAAI;AAC9B,YAAY,QAAQ,EAAE,IAAI;AAC1B,YAAY,KAAK,EAAE;AACnB,SAAS,CAAC;AACV,IAAI;AACJ;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,57 @@
1
+ import { custom } from 'viem';
2
+
3
+ /**
4
+ * The Split Transport allows you to split RPC traffic for specific methods across
5
+ * different RPC providers. This is done by specifying the methods you want handled
6
+ * specially as overrides and providing a fallback transport for all other methods.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * import { createPublicClient, http } from "viem";
11
+ * import { split } from "@aa-sdk/core";
12
+ *
13
+ * const bundlerMethods = [
14
+ * "eth_sendUserOperation",
15
+ * "eth_estimateUserOperationGas",
16
+ * "eth_getUserOperationReceipt",
17
+ * "eth_getUserOperationByHash",
18
+ * "eth_supportedEntryPoints"
19
+ * ];
20
+ *
21
+ * const clientWithSplit = createPublicClient({
22
+ * transport: split({
23
+ * overrides: [{
24
+ * methods: bundlerMethods,
25
+ * transport: http(BUNDLER_RPC_URL)
26
+ * }],
27
+ * fallback: http(OTHER_RPC_URL)
28
+ * }),
29
+ * });
30
+ * ```
31
+ *
32
+ * @param {SplitTransportParams} params split transport configuration containing the methods overrides and fallback transport
33
+ * @returns {CustomTransport} a viem Transport that splits traffic
34
+ */
35
+ const split = (params) => {
36
+ const overrideMap = params.overrides.reduce((accum, curr) => {
37
+ curr.methods.forEach((method) => {
38
+ if (accum.has(method) && accum.get(method) !== curr.transport) {
39
+ throw new Error("A method cannot be handled by more than one transport");
40
+ }
41
+ accum.set(method, curr.transport);
42
+ });
43
+ return accum;
44
+ }, new Map());
45
+ return (opts) => custom({
46
+ request: async (args) => {
47
+ const transportOverride = overrideMap.get(args.method);
48
+ if (transportOverride != null) {
49
+ return transportOverride(opts).request(args);
50
+ }
51
+ return params.fallback(opts).request(args);
52
+ },
53
+ })(opts);
54
+ };
55
+
56
+ export { split };
57
+ //# sourceMappingURL=split.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split.js","sources":["../../../../../../../../../node_modules/@aa-sdk/core/dist/esm/transport/split.js"],"sourcesContent":["import { custom } from \"viem\";\n/**\n * The Split Transport allows you to split RPC traffic for specific methods across\n * different RPC providers. This is done by specifying the methods you want handled\n * specially as overrides and providing a fallback transport for all other methods.\n *\n * @example\n * ```ts\n * import { createPublicClient, http } from \"viem\";\n * import { split } from \"@aa-sdk/core\";\n *\n * const bundlerMethods = [\n * \"eth_sendUserOperation\",\n * \"eth_estimateUserOperationGas\",\n * \"eth_getUserOperationReceipt\",\n * \"eth_getUserOperationByHash\",\n * \"eth_supportedEntryPoints\"\n * ];\n *\n * const clientWithSplit = createPublicClient({\n * transport: split({\n * overrides: [{\n * methods: bundlerMethods,\n * transport: http(BUNDLER_RPC_URL)\n * }],\n * fallback: http(OTHER_RPC_URL)\n * }),\n * });\n * ```\n *\n * @param {SplitTransportParams} params split transport configuration containing the methods overrides and fallback transport\n * @returns {CustomTransport} a viem Transport that splits traffic\n */\nexport const split = (params) => {\n const overrideMap = params.overrides.reduce((accum, curr) => {\n curr.methods.forEach((method) => {\n if (accum.has(method) && accum.get(method) !== curr.transport) {\n throw new Error(\"A method cannot be handled by more than one transport\");\n }\n accum.set(method, curr.transport);\n });\n return accum;\n }, new Map());\n return (opts) => custom({\n request: async (args) => {\n const transportOverride = overrideMap.get(args.method);\n if (transportOverride != null) {\n return transportOverride(opts).request(args);\n }\n return params.fallback(opts).request(args);\n },\n })(opts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oreList":[0]}
@@ -0,0 +1,33 @@
1
+ import { isHex } from 'viem';
2
+ import { custom, union as unionType, number as numberType, bigint as bigIntType, object as objectType } from '../../../../../zod/v3/types.js';
3
+
4
+ const ChainSchema = custom((chain) => chain != null &&
5
+ typeof chain === "object" &&
6
+ "id" in chain &&
7
+ typeof chain.id === "number");
8
+ const HexSchema = custom((val) => {
9
+ return isHex(val, { strict: true });
10
+ });
11
+ // [!region BigNumberish]
12
+ const BigNumberishSchema = unionType([HexSchema, numberType(), bigIntType()]);
13
+ // [!endregion BigNumberish]
14
+ // [!region BigNumberishRange]
15
+ const BigNumberishRangeSchema = objectType({
16
+ min: BigNumberishSchema.optional(),
17
+ max: BigNumberishSchema.optional(),
18
+ })
19
+ .strict();
20
+ // [!endregion BigNumberishRange]
21
+ // [!region Multiplier]
22
+ const MultiplierSchema = objectType({
23
+ /**
24
+ * Multiplier value with max precision of 4 decimal places
25
+ */
26
+ multiplier: numberType().refine((n) => {
27
+ return (n.toString().split(".")[1]?.length ?? 0) <= 4;
28
+ }, { message: "Max precision is 4 decimal places" }),
29
+ })
30
+ .strict();
31
+
32
+ export { BigNumberishRangeSchema, BigNumberishSchema, ChainSchema, HexSchema, MultiplierSchema };
33
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sources":["../../../../../../../../../node_modules/@aa-sdk/core/dist/esm/utils/schema.js"],"sourcesContent":["import { isHex } from \"viem\";\nimport { z } from \"zod\";\nexport const ChainSchema = z.custom((chain) => chain != null &&\n typeof chain === \"object\" &&\n \"id\" in chain &&\n typeof chain.id === \"number\");\nexport const HexSchema = z.custom((val) => {\n return isHex(val, { strict: true });\n});\n// [!region BigNumberish]\nexport const BigNumberishSchema = z.union([HexSchema, z.number(), z.bigint()]);\n// [!endregion BigNumberish]\n// [!region BigNumberishRange]\nexport const BigNumberishRangeSchema = z\n .object({\n min: BigNumberishSchema.optional(),\n max: BigNumberishSchema.optional(),\n})\n .strict();\n// [!endregion BigNumberishRange]\n// [!region Multiplier]\nexport const MultiplierSchema = z\n .object({\n /**\n * Multiplier value with max precision of 4 decimal places\n */\n multiplier: z.number().refine((n) => {\n return (n.toString().split(\".\")[1]?.length ?? 0) <= 4;\n }, { message: \"Max precision is 4 decimal places\" }),\n})\n .strict();\n// [!endregion Multiplier]\nexport function isBigNumberish(x) {\n return x != null && BigNumberishSchema.safeParse(x).success;\n}\nexport function isMultiplier(x) {\n return x != null && MultiplierSchema.safeParse(x).success;\n}\n//# sourceMappingURL=schema.js.map"],"names":["z.custom","z.union","z.number","z.bigint","z\n .object"],"mappings":";;;AAEY,MAAC,WAAW,GAAGA,MAAQ,CAAC,CAAC,KAAK,KAAK,KAAK,IAAI,IAAI;AAC5D,IAAI,OAAO,KAAK,KAAK,QAAQ;AAC7B,IAAI,IAAI,IAAI,KAAK;AACjB,IAAI,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ;AACpB,MAAC,SAAS,GAAGA,MAAQ,CAAC,CAAC,GAAG,KAAK;AAC3C,IAAI,OAAO,KAAK,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AACvC,CAAC;AACD;AACY,MAAC,kBAAkB,GAAGC,SAAO,CAAC,CAAC,SAAS,EAAEC,UAAQ,EAAE,EAAEC,UAAQ,EAAE,CAAC;AAC7E;AACA;AACY,MAAC,uBAAuB,GAAGC,UAC5B,CAAC;AACZ,IAAI,GAAG,EAAE,kBAAkB,CAAC,QAAQ,EAAE;AACtC,IAAI,GAAG,EAAE,kBAAkB,CAAC,QAAQ,EAAE;AACtC,CAAC;AACD,KAAK,MAAM;AACX;AACA;AACY,MAAC,gBAAgB,GAAGA,UACrB,CAAC;AACZ;AACA;AACA;AACA,IAAI,UAAU,EAAEF,UAAQ,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK;AACzC,QAAQ,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,KAAK,CAAC;AAC7D,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,mCAAmC,EAAE,CAAC;AACxD,CAAC;AACD,KAAK,MAAM;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,22 @@
1
+ function generateRandomHexString(numBytes) {
2
+ const hexPairs = new Array(numBytes).fill(0).map(() => Math.floor(Math.random() * 16)
3
+ .toString(16)
4
+ .padStart(2, "0"));
5
+ return hexPairs.join("");
6
+ }
7
+ /**
8
+ * These are the headers that are used in the trace headers, could be found in the spec
9
+ *
10
+ * @see https://www.w3.org/TR/trace-context/#design-overview
11
+ */
12
+ const TRACE_HEADER_NAME = "traceparent";
13
+ /**
14
+ * These are the headers that are used in the trace headers, could be found in the spec
15
+ *
16
+ * @see https://www.w3.org/TR/trace-context/#design-overview
17
+ */
18
+ const TRACE_HEADER_STATE = "tracestate";
19
+ generateRandomHexString(16);
20
+
21
+ export { TRACE_HEADER_NAME, TRACE_HEADER_STATE };
22
+ //# sourceMappingURL=traceHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traceHeader.js","sources":["../../../../../../../../../node_modules/@aa-sdk/core/dist/esm/utils/traceHeader.js"],"sourcesContent":["function generateRandomHexString(numBytes) {\n const hexPairs = new Array(numBytes).fill(0).map(() => Math.floor(Math.random() * 16)\n .toString(16)\n .padStart(2, \"0\"));\n return hexPairs.join(\"\");\n}\n/**\n * These are the headers that are used in the trace headers, could be found in the spec\n *\n * @see https://www.w3.org/TR/trace-context/#design-overview\n */\nexport const TRACE_HEADER_NAME = \"traceparent\";\n/**\n * These are the headers that are used in the trace headers, could be found in the spec\n *\n * @see https://www.w3.org/TR/trace-context/#design-overview\n */\nexport const TRACE_HEADER_STATE = \"tracestate\";\nconst clientTraceId = generateRandomHexString(16);\n/**\n * Some tools that are useful when dealing with the values\n * of the trace header. Follows the W3C trace context standard.\n *\n * @see https://www.w3.org/TR/trace-context/\n */\nexport class TraceHeader {\n /**\n * Initializes a new instance with the provided trace identifiers and state information.\n *\n * @param {string} traceId The unique identifier for the trace\n * @param {string} parentId The identifier of the parent trace\n * @param {string} traceFlags Flags containing trace-related options\n * @param {TraceHeader[\"traceState\"]} traceState The trace state information for additional trace context\n */\n constructor(traceId, parentId, traceFlags, traceState) {\n Object.defineProperty(this, \"traceId\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"parentId\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"traceFlags\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"traceState\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.traceId = traceId;\n this.parentId = parentId;\n this.traceFlags = traceFlags;\n this.traceState = traceState;\n }\n /**\n * Creating a default trace id that is a random setup for both trace id and parent id\n *\n * @example ```ts\n * const traceHeader = TraceHeader.fromTraceHeader(headers) || TraceHeader.default();\n * ```\n *\n * @returns {TraceHeader} A default trace header\n */\n static default() {\n return new TraceHeader(clientTraceId, generateRandomHexString(8), \"00\", //Means no flag have been set, and no sampled state https://www.w3.org/TR/trace-context/#trace-flags\n {});\n }\n /**\n * Should be able to consume a trace header from the headers of an http request\n *\n * @example ```ts\n * const traceHeader = TraceHeader.fromTraceHeader(headers);\n * ```\n *\n * @param {Record<string,string>} headers The headers from the http request\n * @returns {TraceHeader | undefined} The trace header object, or nothing if not found\n */\n static fromTraceHeader(headers) {\n if (!headers[TRACE_HEADER_NAME]) {\n return undefined;\n }\n const [version, traceId, parentId, traceFlags] = headers[TRACE_HEADER_NAME]?.split(\"-\");\n const traceState = headers[TRACE_HEADER_STATE]?.split(\",\").reduce((acc, curr) => {\n const [key, value] = curr.split(\"=\");\n acc[key] = value;\n return acc;\n }, {}) || {};\n if (version !== \"00\") {\n console.debug(new Error(`Invalid version for traceheader: ${headers[TRACE_HEADER_NAME]}`));\n return undefined;\n }\n return new TraceHeader(traceId, parentId, traceFlags, traceState);\n }\n /**\n * Should be able to convert the trace header to the format that is used in the headers of an http request\n *\n * @example ```ts\n * const traceHeader = TraceHeader.fromTraceHeader(headers) || TraceHeader.default();\n * const headers = traceHeader.toTraceHeader();\n * ```\n *\n * @returns {{traceparent: string, tracestate: string}} The trace header in the format of a record, used in our http client\n */\n toTraceHeader() {\n return {\n [TRACE_HEADER_NAME]: `00-${this.traceId}-${this.parentId}-${this.traceFlags}`,\n [TRACE_HEADER_STATE]: Object.entries(this.traceState)\n .map(([key, value]) => `${key}=${value}`)\n .join(\",\"),\n };\n }\n /**\n * Should be able to create a new trace header with a new event in the trace state,\n * as the key of the eventName as breadcrumbs appending onto previous breadcrumbs with the - infix if exists. And the\n * trace parent gets updated as according to the docs\n *\n * @example ```ts\n * const traceHeader = TraceHeader.fromTraceHeader(headers) || TraceHeader.default();\n * const newTraceHeader = traceHeader.withEvent(\"newEvent\");\n * ```\n *\n * @param {string} eventName The key of the new event\n * @returns {TraceHeader} The new trace header\n */\n withEvent(eventName) {\n const breadcrumbs = this.traceState.breadcrumbs\n ? `${this.traceState.breadcrumbs}-${eventName}`\n : eventName;\n return new TraceHeader(this.traceId, this.parentId, this.traceFlags, {\n ...this.traceState,\n breadcrumbs,\n });\n }\n}\n//# sourceMappingURL=traceHeader.js.map"],"names":[],"mappings":"AAAA,SAAS,uBAAuB,CAAC,QAAQ,EAAE;AAC3C,IAAI,MAAM,QAAQ,GAAG,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE;AACxF,SAAS,QAAQ,CAAC,EAAE;AACpB,SAAS,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC1B,IAAI,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;AAC5B;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,iBAAiB,GAAG;AACjC;AACA;AACA;AACA;AACA;AACY,MAAC,kBAAkB,GAAG;AACZ,uBAAuB,CAAC,EAAE;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,6 @@
1
+ // This file is autogenerated by inject-version.ts. Any changes will be
2
+ // overwritten on commit!
3
+ const VERSION = "4.81.3";
4
+
5
+ export { VERSION };
6
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sources":["../../../../../../../../node_modules/@aa-sdk/core/dist/esm/version.js"],"sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"4.81.3\";\n//# sourceMappingURL=version.js.map"],"names":[],"mappings":"AAAA;AACA;AACY,MAAC,OAAO,GAAG;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,36 @@
1
+ import { TRACE_HEADER_NAME, TRACE_HEADER_STATE } from '../../../../@aa-sdk/core/dist/esm/utils/traceHeader.js';
2
+
3
+ /**
4
+ * The header that is used to track the trace id.
5
+ * We use a client specific one to not mess with the span tracing of the servers.
6
+ *
7
+ * @see headersUpdate
8
+ */
9
+ const TRACKER_HEADER = "X-Alchemy-Client-Trace-Id";
10
+ /**
11
+ * The header that is used to track the breadcrumb.
12
+ *
13
+ * @see headersUpdate
14
+ */
15
+ const TRACKER_BREADCRUMB = "X-Alchemy-Client-Breadcrumb";
16
+ /**
17
+ * Remove the tracking headers. This is used in our split transport to ensure that we remove the headers that
18
+ * are not used by the other systems.
19
+ *
20
+ * @param {unknown} x The headers to remove the tracking headers from
21
+ */
22
+ function mutateRemoveTrackingHeaders(x) {
23
+ if (!x)
24
+ return;
25
+ if (Array.isArray(x))
26
+ return;
27
+ if (typeof x !== "object")
28
+ return;
29
+ TRACKER_HEADER in x && delete x[TRACKER_HEADER];
30
+ TRACKER_BREADCRUMB in x && delete x[TRACKER_BREADCRUMB];
31
+ TRACE_HEADER_NAME in x && delete x[TRACE_HEADER_NAME];
32
+ TRACE_HEADER_STATE in x && delete x[TRACE_HEADER_STATE];
33
+ }
34
+
35
+ export { mutateRemoveTrackingHeaders };
36
+ //# sourceMappingURL=alchemyTrackerHeaders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alchemyTrackerHeaders.js","sources":["../../../../../../../../node_modules/@account-kit/infra/dist/esm/alchemyTrackerHeaders.js"],"sourcesContent":["import { TRACE_HEADER_NAME } from \"@aa-sdk/core\";\nimport { TRACE_HEADER_STATE } from \"@aa-sdk/core\";\nimport { TraceHeader } from \"@aa-sdk/core\";\n/**\n * The header that is used to track the trace id.\n * We use a client specific one to not mess with the span tracing of the servers.\n *\n * @see headersUpdate\n */\nconst TRACKER_HEADER = \"X-Alchemy-Client-Trace-Id\";\n/**\n * The header that is used to track the breadcrumb.\n *\n * @see headersUpdate\n */\nconst TRACKER_BREADCRUMB = \"X-Alchemy-Client-Breadcrumb\";\n/**\n * Remove the tracking headers. This is used in our split transport to ensure that we remove the headers that\n * are not used by the other systems.\n *\n * @param {unknown} x The headers to remove the tracking headers from\n */\nexport function mutateRemoveTrackingHeaders(x) {\n if (!x)\n return;\n if (Array.isArray(x))\n return;\n if (typeof x !== \"object\")\n return;\n TRACKER_HEADER in x && delete x[TRACKER_HEADER];\n TRACKER_BREADCRUMB in x && delete x[TRACKER_BREADCRUMB];\n TRACE_HEADER_NAME in x && delete x[TRACE_HEADER_NAME];\n TRACE_HEADER_STATE in x && delete x[TRACE_HEADER_STATE];\n}\nfunction addCrumb(previous, crumb) {\n if (!previous)\n return crumb;\n return `${previous} > ${crumb}`;\n}\n/**\n * Update the headers with the trace header and breadcrumb.\n *\n * These trace headers are used in the imply ingestion pipeline to trace the request.\n * And the breadcrumb is used to get finer grain details in the trace.\n *\n * Then there are the trace headers that are part of the W3C trace context standard.\n *\n * @param {string} crumb The crumb to add to the breadcrumb\n * @returns {Function} A function that updates the headers\n */\nexport function headersUpdate(crumb) {\n const headerUpdate_ = (x) => {\n const traceHeader = (TraceHeader.fromTraceHeader(x) || TraceHeader.default()).withEvent(crumb);\n return {\n [TRACKER_HEADER]: traceHeader.parentId,\n ...x,\n [TRACKER_BREADCRUMB]: addCrumb(x[TRACKER_BREADCRUMB], crumb),\n ...traceHeader.toTraceHeader(),\n };\n };\n return headerUpdate_;\n}\n//# sourceMappingURL=alchemyTrackerHeaders.js.map"],"names":[],"mappings":";;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,cAAc,GAAG,2BAA2B;AAClD;AACA;AACA;AACA;AACA;AACA,MAAM,kBAAkB,GAAG,6BAA6B;AACxD;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,2BAA2B,CAAC,CAAC,EAAE;AAC/C,IAAI,IAAI,CAAC,CAAC;AACV,QAAQ;AACR,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACxB,QAAQ;AACR,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ;AAC7B,QAAQ;AACR,IAAI,cAAc,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,cAAc,CAAC;AACnD,IAAI,kBAAkB,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,kBAAkB,CAAC;AAC3D,IAAI,iBAAiB,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,iBAAiB,CAAC;AACzD,IAAI,kBAAkB,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,kBAAkB,CAAC;AAC3D;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,190 @@
1
+ import { http, createTransport } from 'viem';
2
+ import { mutateRemoveTrackingHeaders } from './alchemyTrackerHeaders.js';
3
+ import { AlchemyChainSchema } from './schema.js';
4
+ import { VERSION } from './version.js';
5
+ import { ConnectionConfigSchema } from '../../../../@aa-sdk/core/dist/esm/client/schema.js';
6
+ import { ChainNotFoundError } from '../../../../@aa-sdk/core/dist/esm/errors/client.js';
7
+ import { split } from '../../../../@aa-sdk/core/dist/esm/transport/split.js';
8
+
9
+ const alchemyMethods = [
10
+ "eth_sendUserOperation",
11
+ "eth_estimateUserOperationGas",
12
+ "eth_getUserOperationReceipt",
13
+ "eth_getUserOperationByHash",
14
+ "eth_supportedEntryPoints",
15
+ "rundler_maxPriorityFeePerGas",
16
+ "pm_getPaymasterData",
17
+ "pm_getPaymasterStubData",
18
+ "alchemy_requestGasAndPaymasterAndData",
19
+ ];
20
+ const chainAgnosticMethods = [
21
+ "wallet_prepareCalls",
22
+ "wallet_sendPreparedCalls",
23
+ "wallet_requestAccount",
24
+ "wallet_createAccount",
25
+ "wallet_listAccounts",
26
+ "wallet_createSession",
27
+ "wallet_getCallsStatus",
28
+ "wallet_requestQuote_v0",
29
+ ];
30
+ /**
31
+ * Creates an Alchemy transport with the specified configuration options.
32
+ * When sending all traffic to Alchemy, you must pass in one of rpcUrl, apiKey, or jwt.
33
+ * If you want to send Bundler and Paymaster traffic to Alchemy and Node traffic to a different RPC, you must pass in alchemyConnection and nodeRpcUrl.
34
+ *
35
+ * @example
36
+ * ### Basic Example
37
+ * If the chain you're using is supported for both Bundler and Node RPCs, then you can do the following:
38
+ * ```ts
39
+ * import { alchemy } from "@account-kit/infra";
40
+ *
41
+ * const transport = alchemy({
42
+ * // NOTE: you can also pass in an rpcUrl or jwt here or rpcUrl and jwt
43
+ * apiKey: "your-api-key",
44
+ * });
45
+ * ```
46
+ *
47
+ * ### AA Only Chains
48
+ * For AA-only chains, you need to specify the alchemyConnection and nodeRpcUrl since Alchemy only
49
+ * handles the Bundler and Paymaster RPCs for these chains.
50
+ * ```ts
51
+ * import { alchemy } from "@account-kit/infra";
52
+ *
53
+ * const transport = alchemy({
54
+ * alchemyConnection: {
55
+ * apiKey: "your-api-key",
56
+ * },
57
+ * nodeRpcUrl: "https://zora.rpc.url",
58
+ * });
59
+ * ```
60
+ *
61
+ * @param {AlchemyTransportConfig} config The configuration object for the Alchemy transport.
62
+ * @param {number} config.retryDelay Optional The delay between retries, in milliseconds.
63
+ * @param {number} config.retryCount Optional The number of retry attempts.
64
+ * @param {string} [config.alchemyConnection] Optional Alchemy connection configuration (if this is passed in, nodeRpcUrl is required).
65
+ * @param {string} [config.fetchOptions] Optional fetch options for HTTP requests.
66
+ * @param {string} [config.nodeRpcUrl] Optional RPC URL for node (if this is passed in, alchemyConnection is required).
67
+ * @param {string} [config.rpcUrl] Optional RPC URL.
68
+ * @param {string} [config.apiKey] Optional API key for Alchemy.
69
+ * @param {string} [config.jwt] Optional JSON Web Token for authorization.
70
+ * @returns {AlchemyTransport} The configured Alchemy transport object.
71
+ */
72
+ function alchemy(config) {
73
+ const { retryDelay, retryCount = 0 } = config;
74
+ // we create a copy here in case we create a split transport down below
75
+ // we don't want to add alchemy headers to 3rd party nodes
76
+ const fetchOptions = { ...config.fetchOptions };
77
+ const connectionConfig = ConnectionConfigSchema.parse(config.alchemyConnection ?? config);
78
+ const headersAsObject = convertHeadersToObject(fetchOptions.headers);
79
+ // TODO: we probably should just log these headers during telemetry logging instead of doing this mutable header stuff
80
+ fetchOptions.headers = {
81
+ ...headersAsObject,
82
+ "Alchemy-AA-Sdk-Version": VERSION,
83
+ };
84
+ if (connectionConfig.jwt != null || connectionConfig.apiKey != null) {
85
+ fetchOptions.headers = {
86
+ ...fetchOptions.headers,
87
+ Authorization: `Bearer ${connectionConfig.jwt ?? connectionConfig.apiKey}`,
88
+ };
89
+ }
90
+ const transport = (opts) => {
91
+ const { chain: chain_ } = opts;
92
+ if (!chain_) {
93
+ throw new ChainNotFoundError();
94
+ }
95
+ const chain = AlchemyChainSchema.parse(chain_);
96
+ const rpcUrl = connectionConfig.rpcUrl == null
97
+ ? chain.rpcUrls.alchemy.http[0]
98
+ : connectionConfig.rpcUrl;
99
+ const chainAgnosticRpcUrl = connectionConfig.rpcUrl == null
100
+ ? "https://api.g.alchemy.com/v2"
101
+ : (connectionConfig.chainAgnosticUrl ?? connectionConfig.rpcUrl);
102
+ const innerTransport = (() => {
103
+ mutateRemoveTrackingHeaders(config?.fetchOptions?.headers);
104
+ if (config.alchemyConnection && config.nodeRpcUrl) {
105
+ return split({
106
+ overrides: [
107
+ {
108
+ methods: alchemyMethods,
109
+ transport: http(rpcUrl, { fetchOptions, retryCount }),
110
+ },
111
+ {
112
+ methods: chainAgnosticMethods,
113
+ transport: http(chainAgnosticRpcUrl, {
114
+ fetchOptions,
115
+ retryCount,
116
+ retryDelay,
117
+ }),
118
+ },
119
+ ],
120
+ fallback: http(config.nodeRpcUrl, {
121
+ fetchOptions: config.fetchOptions,
122
+ retryCount,
123
+ retryDelay,
124
+ }),
125
+ });
126
+ }
127
+ return split({
128
+ overrides: [
129
+ {
130
+ methods: chainAgnosticMethods,
131
+ transport: http(chainAgnosticRpcUrl, {
132
+ fetchOptions,
133
+ retryCount,
134
+ retryDelay,
135
+ }),
136
+ },
137
+ ],
138
+ fallback: http(rpcUrl, { fetchOptions, retryCount, retryDelay }),
139
+ });
140
+ })();
141
+ return createTransport({
142
+ key: "alchemy",
143
+ name: "Alchemy Transport",
144
+ request: innerTransport({
145
+ ...opts,
146
+ // Retries are already handled above within the split transport,
147
+ // so `retryCount` must be 0 here for the expected behavior.
148
+ retryCount: 0,
149
+ }).request,
150
+ // Retries are already handled above within the split transport,
151
+ // so `retryCount` must be 0 here too for the expected behavior.
152
+ retryCount: 0,
153
+ retryDelay,
154
+ type: "alchemy",
155
+ }, { alchemyRpcUrl: rpcUrl, fetchOptions });
156
+ };
157
+ return Object.assign(transport, {
158
+ dynamicFetchOptions: fetchOptions,
159
+ updateHeaders(newHeaders_) {
160
+ const newHeaders = convertHeadersToObject(newHeaders_);
161
+ fetchOptions.headers = {
162
+ ...fetchOptions.headers,
163
+ ...newHeaders,
164
+ };
165
+ },
166
+ config,
167
+ });
168
+ }
169
+ const convertHeadersToObject = (headers) => {
170
+ if (!headers) {
171
+ return {};
172
+ }
173
+ if (headers instanceof Headers) {
174
+ const headersObject = {};
175
+ headers.forEach((value, key) => {
176
+ headersObject[key] = value;
177
+ });
178
+ return headersObject;
179
+ }
180
+ if (Array.isArray(headers)) {
181
+ return headers.reduce((acc, header) => {
182
+ acc[header[0]] = header[1];
183
+ return acc;
184
+ }, {});
185
+ }
186
+ return headers;
187
+ };
188
+
189
+ export { alchemy, convertHeadersToObject };
190
+ //# sourceMappingURL=alchemyTransport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alchemyTransport.js","sources":["../../../../../../../../node_modules/@account-kit/infra/dist/esm/alchemyTransport.js"],"sourcesContent":["import { ChainNotFoundError, ConnectionConfigSchema, split, } from \"@aa-sdk/core\";\nimport { createTransport, http, } from \"viem\";\nimport { mutateRemoveTrackingHeaders } from \"./alchemyTrackerHeaders.js\";\nimport { AlchemyChainSchema } from \"./schema.js\";\nimport { VERSION } from \"./version.js\";\nconst alchemyMethods = [\n \"eth_sendUserOperation\",\n \"eth_estimateUserOperationGas\",\n \"eth_getUserOperationReceipt\",\n \"eth_getUserOperationByHash\",\n \"eth_supportedEntryPoints\",\n \"rundler_maxPriorityFeePerGas\",\n \"pm_getPaymasterData\",\n \"pm_getPaymasterStubData\",\n \"alchemy_requestGasAndPaymasterAndData\",\n];\nconst chainAgnosticMethods = [\n \"wallet_prepareCalls\",\n \"wallet_sendPreparedCalls\",\n \"wallet_requestAccount\",\n \"wallet_createAccount\",\n \"wallet_listAccounts\",\n \"wallet_createSession\",\n \"wallet_getCallsStatus\",\n \"wallet_requestQuote_v0\",\n];\n/**\n * A type guard for the transport to determine if it is an Alchemy transport.\n * Used in cases where we would like to do switching depending on the transport, where there used\n * to be two clients for an alchemy and a non-alchemy, and with this switch we don't need the two seperate clients. *\n *\n * @param {Transport} transport The transport to check\n * @param {Chain} chain Chain for the transport to run its function to return the transport config\n * @returns {boolean} `true` if the transport is an Alchemy transport, otherwise `false`\n */\nexport function isAlchemyTransport(transport, chain) {\n return transport({ chain }).config.type === \"alchemy\";\n}\n/**\n * Creates an Alchemy transport with the specified configuration options.\n * When sending all traffic to Alchemy, you must pass in one of rpcUrl, apiKey, or jwt.\n * If you want to send Bundler and Paymaster traffic to Alchemy and Node traffic to a different RPC, you must pass in alchemyConnection and nodeRpcUrl.\n *\n * @example\n * ### Basic Example\n * If the chain you're using is supported for both Bundler and Node RPCs, then you can do the following:\n * ```ts\n * import { alchemy } from \"@account-kit/infra\";\n *\n * const transport = alchemy({\n * // NOTE: you can also pass in an rpcUrl or jwt here or rpcUrl and jwt\n * apiKey: \"your-api-key\",\n * });\n * ```\n *\n * ### AA Only Chains\n * For AA-only chains, you need to specify the alchemyConnection and nodeRpcUrl since Alchemy only\n * handles the Bundler and Paymaster RPCs for these chains.\n * ```ts\n * import { alchemy } from \"@account-kit/infra\";\n *\n * const transport = alchemy({\n * alchemyConnection: {\n * apiKey: \"your-api-key\",\n * },\n * nodeRpcUrl: \"https://zora.rpc.url\",\n * });\n * ```\n *\n * @param {AlchemyTransportConfig} config The configuration object for the Alchemy transport.\n * @param {number} config.retryDelay Optional The delay between retries, in milliseconds.\n * @param {number} config.retryCount Optional The number of retry attempts.\n * @param {string} [config.alchemyConnection] Optional Alchemy connection configuration (if this is passed in, nodeRpcUrl is required).\n * @param {string} [config.fetchOptions] Optional fetch options for HTTP requests.\n * @param {string} [config.nodeRpcUrl] Optional RPC URL for node (if this is passed in, alchemyConnection is required).\n * @param {string} [config.rpcUrl] Optional RPC URL.\n * @param {string} [config.apiKey] Optional API key for Alchemy.\n * @param {string} [config.jwt] Optional JSON Web Token for authorization.\n * @returns {AlchemyTransport} The configured Alchemy transport object.\n */\nexport function alchemy(config) {\n const { retryDelay, retryCount = 0 } = config;\n // we create a copy here in case we create a split transport down below\n // we don't want to add alchemy headers to 3rd party nodes\n const fetchOptions = { ...config.fetchOptions };\n const connectionConfig = ConnectionConfigSchema.parse(config.alchemyConnection ?? config);\n const headersAsObject = convertHeadersToObject(fetchOptions.headers);\n // TODO: we probably should just log these headers during telemetry logging instead of doing this mutable header stuff\n fetchOptions.headers = {\n ...headersAsObject,\n \"Alchemy-AA-Sdk-Version\": VERSION,\n };\n if (connectionConfig.jwt != null || connectionConfig.apiKey != null) {\n fetchOptions.headers = {\n ...fetchOptions.headers,\n Authorization: `Bearer ${connectionConfig.jwt ?? connectionConfig.apiKey}`,\n };\n }\n const transport = (opts) => {\n const { chain: chain_ } = opts;\n if (!chain_) {\n throw new ChainNotFoundError();\n }\n const chain = AlchemyChainSchema.parse(chain_);\n const rpcUrl = connectionConfig.rpcUrl == null\n ? chain.rpcUrls.alchemy.http[0]\n : connectionConfig.rpcUrl;\n const chainAgnosticRpcUrl = connectionConfig.rpcUrl == null\n ? \"https://api.g.alchemy.com/v2\"\n : (connectionConfig.chainAgnosticUrl ?? connectionConfig.rpcUrl);\n const innerTransport = (() => {\n mutateRemoveTrackingHeaders(config?.fetchOptions?.headers);\n if (config.alchemyConnection && config.nodeRpcUrl) {\n return split({\n overrides: [\n {\n methods: alchemyMethods,\n transport: http(rpcUrl, { fetchOptions, retryCount }),\n },\n {\n methods: chainAgnosticMethods,\n transport: http(chainAgnosticRpcUrl, {\n fetchOptions,\n retryCount,\n retryDelay,\n }),\n },\n ],\n fallback: http(config.nodeRpcUrl, {\n fetchOptions: config.fetchOptions,\n retryCount,\n retryDelay,\n }),\n });\n }\n return split({\n overrides: [\n {\n methods: chainAgnosticMethods,\n transport: http(chainAgnosticRpcUrl, {\n fetchOptions,\n retryCount,\n retryDelay,\n }),\n },\n ],\n fallback: http(rpcUrl, { fetchOptions, retryCount, retryDelay }),\n });\n })();\n return createTransport({\n key: \"alchemy\",\n name: \"Alchemy Transport\",\n request: innerTransport({\n ...opts,\n // Retries are already handled above within the split transport,\n // so `retryCount` must be 0 here for the expected behavior.\n retryCount: 0,\n }).request,\n // Retries are already handled above within the split transport,\n // so `retryCount` must be 0 here too for the expected behavior.\n retryCount: 0,\n retryDelay,\n type: \"alchemy\",\n }, { alchemyRpcUrl: rpcUrl, fetchOptions });\n };\n return Object.assign(transport, {\n dynamicFetchOptions: fetchOptions,\n updateHeaders(newHeaders_) {\n const newHeaders = convertHeadersToObject(newHeaders_);\n fetchOptions.headers = {\n ...fetchOptions.headers,\n ...newHeaders,\n };\n },\n config,\n });\n}\nexport const convertHeadersToObject = (headers) => {\n if (!headers) {\n return {};\n }\n if (headers instanceof Headers) {\n const headersObject = {};\n headers.forEach((value, key) => {\n headersObject[key] = value;\n });\n return headersObject;\n }\n if (Array.isArray(headers)) {\n return headers.reduce((acc, header) => {\n acc[header[0]] = header[1];\n return acc;\n }, {});\n }\n return headers;\n};\n//# sourceMappingURL=alchemyTransport.js.map"],"names":[],"mappings":";;;;;;;;AAKA,MAAM,cAAc,GAAG;AACvB,IAAI,uBAAuB;AAC3B,IAAI,8BAA8B;AAClC,IAAI,6BAA6B;AACjC,IAAI,4BAA4B;AAChC,IAAI,0BAA0B;AAC9B,IAAI,8BAA8B;AAClC,IAAI,qBAAqB;AACzB,IAAI,yBAAyB;AAC7B,IAAI,uCAAuC;AAC3C,CAAC;AACD,MAAM,oBAAoB,GAAG;AAC7B,IAAI,qBAAqB;AACzB,IAAI,0BAA0B;AAC9B,IAAI,uBAAuB;AAC3B,IAAI,sBAAsB;AAC1B,IAAI,qBAAqB;AACzB,IAAI,sBAAsB;AAC1B,IAAI,uBAAuB;AAC3B,IAAI,wBAAwB;AAC5B,CAAC;AAaD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,OAAO,CAAC,MAAM,EAAE;AAChC,IAAI,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,CAAC,EAAE,GAAG,MAAM;AACjD;AACA;AACA,IAAI,MAAM,YAAY,GAAG,EAAE,GAAG,MAAM,CAAC,YAAY,EAAE;AACnD,IAAI,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,KAAK,CAAC,MAAM,CAAC,iBAAiB,IAAI,MAAM,CAAC;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I,OAAO,OAAO;AAClB;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,10 @@
1
+ import * as external from '../../../../zod/v3/external.js';
2
+ import { ChainSchema } from '../../../../@aa-sdk/core/dist/esm/utils/schema.js';
3
+
4
+ const AlchemyChainSchema = external.custom((chain) => {
5
+ const chain_ = ChainSchema.parse(chain);
6
+ return chain_.rpcUrls.alchemy != null;
7
+ }, "chain must include an alchemy rpc url. See `defineAlchemyChain` or import a chain from `@account-kit/infra`.");
8
+
9
+ export { AlchemyChainSchema };
10
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sources":["../../../../../../../../node_modules/@account-kit/infra/dist/esm/schema.js"],"sourcesContent":["import { ChainSchema } from \"@aa-sdk/core\";\nimport z from \"zod\";\nexport const AlchemyChainSchema = z.custom((chain) => {\n const chain_ = ChainSchema.parse(chain);\n return chain_.rpcUrls.alchemy != null;\n}, \"chain must include an alchemy rpc url. See `defineAlchemyChain` or import a chain from `@account-kit/infra`.\");\n//# sourceMappingURL=schema.js.map"],"names":["z"],"mappings":";;;AAEY,MAAC,kBAAkB,GAAGA,QAAC,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK;AACtD,IAAI,MAAM,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC;AAC3C,IAAI,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI;AACzC,CAAC,EAAE,8GAA8G;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,6 @@
1
+ // This file is autogenerated by inject-version.ts. Any changes will be
2
+ // overwritten on commit!
3
+ const VERSION = "4.81.3";
4
+
5
+ export { VERSION };
6
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sources":["../../../../../../../../node_modules/@account-kit/infra/dist/esm/version.js"],"sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"4.81.3\";\n//# sourceMappingURL=version.js.map"],"names":[],"mappings":"AAAA;AACA;AACY,MAAC,OAAO,GAAG;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,6 @@
1
+ import * as external from './v3/external.js';
2
+
3
+
4
+
5
+ export { external as default, external as z };
6
+ //# sourceMappingURL=index.js.map