@account-kit/infra 4.21.0 → 4.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/alchemyTrackerHeaders.d.ts +24 -0
- package/dist/esm/alchemyTrackerHeaders.js +60 -0
- package/dist/esm/alchemyTrackerHeaders.js.map +1 -0
- package/dist/esm/alchemyTransport.d.ts +2 -0
- package/dist/esm/alchemyTransport.js +4 -1
- package/dist/esm/alchemyTransport.js.map +1 -1
- package/dist/esm/chains.d.ts +2 -0
- package/dist/esm/chains.js +13 -1
- package/dist/esm/chains.js.map +1 -1
- package/dist/esm/client/decorators/smartAccount.d.ts +1 -1
- package/dist/esm/client/decorators/smartAccount.js +11 -5
- package/dist/esm/client/decorators/smartAccount.js.map +1 -1
- package/dist/esm/client/smartAccountClient.d.ts +1 -1
- package/dist/esm/client/smartAccountClient.js +43 -23
- package/dist/esm/client/smartAccountClient.js.map +1 -1
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/middleware/feeEstimator.js +3 -2
- package/dist/esm/middleware/feeEstimator.js.map +1 -1
- package/dist/esm/middleware/gasManager.js +3 -2
- package/dist/esm/middleware/gasManager.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/alchemyTrackerHeaders.d.ts +25 -0
- package/dist/types/alchemyTrackerHeaders.d.ts.map +1 -0
- package/dist/types/alchemyTransport.d.ts +2 -0
- package/dist/types/alchemyTransport.d.ts.map +1 -1
- package/dist/types/chains.d.ts +2 -0
- package/dist/types/chains.d.ts.map +1 -1
- package/dist/types/client/decorators/smartAccount.d.ts +1 -1
- package/dist/types/client/decorators/smartAccount.d.ts.map +1 -1
- package/dist/types/client/smartAccountClient.d.ts +1 -1
- package/dist/types/client/smartAccountClient.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/middleware/feeEstimator.d.ts.map +1 -1
- package/dist/types/middleware/gasManager.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +4 -4
- package/src/alchemyTrackerHeaders.ts +61 -0
- package/src/alchemyTransport.ts +5 -1
- package/src/chains.ts +16 -0
- package/src/client/decorators/smartAccount.ts +11 -5
- package/src/client/smartAccountClient.ts +53 -34
- package/src/index.ts +3 -0
- package/src/middleware/feeEstimator.ts +7 -2
- package/src/middleware/gasManager.ts +3 -1
- package/src/version.ts +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove the tracking headers. This is used in our split transport to ensure that we remove the headers that
|
|
3
|
+
* are not used by the other systems.
|
|
4
|
+
*
|
|
5
|
+
* @param {unknown} x The headers to remove the tracking headers from
|
|
6
|
+
*/
|
|
7
|
+
export declare function mutateRemoveTrackingHeaders(x?: unknown): void;
|
|
8
|
+
/**
|
|
9
|
+
* Update the headers with the trace header and breadcrumb.
|
|
10
|
+
*
|
|
11
|
+
* These trace headers are used in the imply ingestion pipeline to trace the request.
|
|
12
|
+
* And the breadcrumb is used to get finer grain details in the trace.
|
|
13
|
+
*
|
|
14
|
+
* Then there are the trace headers that are part of the W3C trace context standard.
|
|
15
|
+
*
|
|
16
|
+
* @param {string} crumb The crumb to add to the breadcrumb
|
|
17
|
+
* @returns {Function} A function that updates the headers
|
|
18
|
+
*/
|
|
19
|
+
export declare function headersUpdate(crumb: string): (x: Record<string, string>) => {
|
|
20
|
+
traceheader: `00-${string}-${string}-${string}`;
|
|
21
|
+
tracestate: string;
|
|
22
|
+
"X-Alchemy-Trace-Breadcrumb": string;
|
|
23
|
+
"X-Alchemy-Trace-Id": string;
|
|
24
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { TraceHeader } from "@aa-sdk/core";
|
|
2
|
+
/**
|
|
3
|
+
* The header that is used to track the trace id.
|
|
4
|
+
*
|
|
5
|
+
* @see headersUpdate
|
|
6
|
+
*/
|
|
7
|
+
const TRACKER_HEADER = "X-Alchemy-Trace-Id";
|
|
8
|
+
/**
|
|
9
|
+
* The header that is used to track the breadcrumb.
|
|
10
|
+
*
|
|
11
|
+
* @see headersUpdate
|
|
12
|
+
*/
|
|
13
|
+
const TRACKER_BREADCRUMB = "X-Alchemy-Trace-Breadcrumb";
|
|
14
|
+
/**
|
|
15
|
+
* Remove the tracking headers. This is used in our split transport to ensure that we remove the headers that
|
|
16
|
+
* are not used by the other systems.
|
|
17
|
+
*
|
|
18
|
+
* @param {unknown} x The headers to remove the tracking headers from
|
|
19
|
+
*/
|
|
20
|
+
export function mutateRemoveTrackingHeaders(x) {
|
|
21
|
+
if (!x)
|
|
22
|
+
return;
|
|
23
|
+
if (Array.isArray(x))
|
|
24
|
+
return;
|
|
25
|
+
if (typeof x !== "object")
|
|
26
|
+
return;
|
|
27
|
+
TRACKER_HEADER in x && delete x[TRACKER_HEADER];
|
|
28
|
+
TRACKER_BREADCRUMB in x && delete x[TRACKER_BREADCRUMB];
|
|
29
|
+
"traceheader" in x && delete x["traceheader"];
|
|
30
|
+
"tracestate" in x && delete x["tracestate"];
|
|
31
|
+
}
|
|
32
|
+
function addCrumb(previous, crumb) {
|
|
33
|
+
if (!previous)
|
|
34
|
+
return crumb;
|
|
35
|
+
return `${previous} > ${crumb}`;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Update the headers with the trace header and breadcrumb.
|
|
39
|
+
*
|
|
40
|
+
* These trace headers are used in the imply ingestion pipeline to trace the request.
|
|
41
|
+
* And the breadcrumb is used to get finer grain details in the trace.
|
|
42
|
+
*
|
|
43
|
+
* Then there are the trace headers that are part of the W3C trace context standard.
|
|
44
|
+
*
|
|
45
|
+
* @param {string} crumb The crumb to add to the breadcrumb
|
|
46
|
+
* @returns {Function} A function that updates the headers
|
|
47
|
+
*/
|
|
48
|
+
export function headersUpdate(crumb) {
|
|
49
|
+
const headerUpdate_ = (x) => {
|
|
50
|
+
const traceHeader = (TraceHeader.fromTraceHeader(x) || TraceHeader.default()).withEvent(crumb);
|
|
51
|
+
return {
|
|
52
|
+
[TRACKER_HEADER]: traceHeader.parentId,
|
|
53
|
+
...x,
|
|
54
|
+
[TRACKER_BREADCRUMB]: addCrumb(x[TRACKER_BREADCRUMB], crumb),
|
|
55
|
+
...traceHeader.toTraceHeader(),
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
return headerUpdate_;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=alchemyTrackerHeaders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alchemyTrackerHeaders.js","sourceRoot":"","sources":["../../src/alchemyTrackerHeaders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;;;GAIG;AACH,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAE5C;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,4BAA4B,CAAC;AAExD;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CAAC,CAAW;IACrD,IAAI,CAAC,CAAC;QAAE,OAAO;IACf,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,OAAO;IAC7B,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO;IAClC,cAAc,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,cAAc,CAAC,CAAC;IAChD,kBAAkB,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,kBAAkB,CAAC,CAAC;IACxD,aAAa,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC;IAC9C,YAAY,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,QAAQ,CAAC,QAA4B,EAAE,KAAa;IAC3D,IAAI,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5B,OAAO,GAAG,QAAQ,MAAM,KAAK,EAAE,CAAC;AAClC,CAAC;AACD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,MAAM,aAAa,GAAG,CAAC,CAAyB,EAAE,EAAE;QAClD,MAAM,WAAW,GAAG,CAClB,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,CACxD,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACnB,OAAO;YACL,CAAC,cAAc,CAAC,EAAE,WAAW,CAAC,QAAQ;YACtC,GAAG,CAAC;YACJ,CAAC,kBAAkB,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,EAAE,KAAK,CAAC;YAC5D,GAAG,WAAW,CAAC,aAAa,EAAE;SAC/B,CAAC;IACJ,CAAC,CAAC;IACF,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["import { TraceHeader } from \"@aa-sdk/core\";\n\n/**\n * The header that is used to track the trace id.\n *\n * @see headersUpdate\n */\nconst TRACKER_HEADER = \"X-Alchemy-Trace-Id\";\n\n/**\n * The header that is used to track the breadcrumb.\n *\n * @see headersUpdate\n */\nconst TRACKER_BREADCRUMB = \"X-Alchemy-Trace-Breadcrumb\";\n\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?: unknown) {\n if (!x) return;\n if (Array.isArray(x)) return;\n if (typeof x !== \"object\") return;\n TRACKER_HEADER in x && delete x[TRACKER_HEADER];\n TRACKER_BREADCRUMB in x && delete x[TRACKER_BREADCRUMB];\n \"traceheader\" in x && delete x[\"traceheader\"];\n \"tracestate\" in x && delete x[\"tracestate\"];\n}\n\nfunction addCrumb(previous: string | undefined, crumb: string): string {\n if (!previous) 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: string) {\n const headerUpdate_ = (x: Record<string, string>) => {\n const traceHeader = (\n TraceHeader.fromTraceHeader(x) || TraceHeader.default()\n ).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"]}
|
|
@@ -22,6 +22,7 @@ type AlchemyTransportBase = Transport<"alchemy", {
|
|
|
22
22
|
export type AlchemyTransport = AlchemyTransportBase & {
|
|
23
23
|
updateHeaders(newHeaders: HeadersInit): void;
|
|
24
24
|
config: AlchemyTransportConfig;
|
|
25
|
+
dynamicFetchOptions: AlchemyTransportConfig["fetchOptions"];
|
|
25
26
|
};
|
|
26
27
|
/**
|
|
27
28
|
* A type guard for the transport to determine if it is an Alchemy transport.
|
|
@@ -76,4 +77,5 @@ export declare function isAlchemyTransport(transport: Transport, chain: Chain):
|
|
|
76
77
|
* @returns {AlchemyTransport} The configured Alchemy transport object.
|
|
77
78
|
*/
|
|
78
79
|
export declare function alchemy(config: AlchemyTransportConfig): AlchemyTransport;
|
|
80
|
+
export declare const convertHeadersToObject: (headers?: HeadersInit) => Record<string, string>;
|
|
79
81
|
export {};
|
|
@@ -2,6 +2,7 @@ import { ChainNotFoundError, ConnectionConfigSchema, split, } from "@aa-sdk/core
|
|
|
2
2
|
import { createTransport, http, } from "viem";
|
|
3
3
|
import { AlchemyChainSchema } from "./schema.js";
|
|
4
4
|
import { VERSION } from "./version.js";
|
|
5
|
+
import { mutateRemoveTrackingHeaders } from "./alchemyTrackerHeaders.js";
|
|
5
6
|
const alchemyMethods = [
|
|
6
7
|
"eth_sendUserOperation",
|
|
7
8
|
"eth_estimateUserOperationGas",
|
|
@@ -95,6 +96,7 @@ export function alchemy(config) {
|
|
|
95
96
|
? `${chain.rpcUrls.alchemy.http[0]}/${connectionConfig.apiKey ?? ""}`
|
|
96
97
|
: connectionConfig.rpcUrl;
|
|
97
98
|
const innerTransport = (() => {
|
|
99
|
+
mutateRemoveTrackingHeaders(config?.fetchOptions?.headers);
|
|
98
100
|
if (config.alchemyConnection && config.nodeRpcUrl) {
|
|
99
101
|
return split({
|
|
100
102
|
overrides: [
|
|
@@ -120,6 +122,7 @@ export function alchemy(config) {
|
|
|
120
122
|
}, { alchemyRpcUrl: rpcUrl, fetchOptions });
|
|
121
123
|
};
|
|
122
124
|
return Object.assign(transport, {
|
|
125
|
+
dynamicFetchOptions: fetchOptions,
|
|
123
126
|
updateHeaders(newHeaders_) {
|
|
124
127
|
const newHeaders = convertHeadersToObject(newHeaders_);
|
|
125
128
|
fetchOptions.headers = {
|
|
@@ -130,7 +133,7 @@ export function alchemy(config) {
|
|
|
130
133
|
config,
|
|
131
134
|
});
|
|
132
135
|
}
|
|
133
|
-
const convertHeadersToObject = (headers) => {
|
|
136
|
+
export const convertHeadersToObject = (headers) => {
|
|
134
137
|
if (!headers) {
|
|
135
138
|
return {};
|
|
136
139
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alchemyTransport.js","sourceRoot":"","sources":["../../src/alchemyTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,KAAK,GAGN,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,eAAe,EACf,IAAI,GAOL,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAavC,MAAM,cAAc,GAAG;IACrB,uBAAuB;IACvB,8BAA8B;IAC9B,6BAA6B;IAC7B,4BAA4B;IAC5B,0B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AU;aACd,CAAC;QACJ,CAAC;QACD,MAAM;KACP,CAAC,CAAC;AACL,CAAC;AAED,MAAM,sBAAsB,GAAG,CAC7B,OAAqB,EACG,EAAE;IAC1B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,OAAO,YAAY,OAAO,EAAE,CAAC;QAC/B,MAAM,aAAa,GAAG,EAA4B,CAAC;QACnD,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAC7B,aAAa,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC7B,CAAC,CAAC,CAAC;QACH,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;YACpC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YAC3B,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAA4B,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import {\n ChainNotFoundError,\n ConnectionConfigSchema,\n split,\n type ConnectionConfig,\n type NoUndefined,\n} from \"@aa-sdk/core\";\nimport {\n createTransport,\n http,\n type Chain,\n type EIP1193RequestFn,\n type HttpTransportConfig,\n type PublicRpcSchema,\n type Transport,\n type TransportConfig,\n} from \"viem\";\nimport type { AlchemyRpcSchema } from \"./client/types.js\";\nimport { AlchemyChainSchema } from \"./schema.js\";\nimport { VERSION } from \"./version.js\";\n\ntype Never<T> = T extends object\n ? {\n [K in keyof T]?: never;\n }\n : never;\n\ntype SplitTransportConfig = {\n alchemyConnection: ConnectionConfig;\n nodeRpcUrl: string;\n};\n\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];\n\nexport type AlchemyTransportConfig = (\n | (ConnectionConfig & Never<SplitTransportConfig>)\n | (SplitTransportConfig & Never<ConnectionConfig>)\n) & {\n /** The max number of times to retry. */\n retryCount?: TransportConfig[\"retryCount\"] | undefined;\n /** The base delay (in ms) between retries. */\n retryDelay?: TransportConfig[\"retryDelay\"] | undefined;\n fetchOptions?: NoUndefined<HttpTransportConfig[\"fetchOptions\"]>;\n};\n\ntype AlchemyTransportBase = Transport<\n \"alchemy\",\n {\n alchemyRpcUrl: string;\n fetchOptions?: AlchemyTransportConfig[\"fetchOptions\"];\n },\n EIP1193RequestFn<[...PublicRpcSchema, ...AlchemyRpcSchema]>\n>;\n\nexport type AlchemyTransport = AlchemyTransportBase & {\n updateHeaders(newHeaders: HeadersInit): void;\n config: AlchemyTransportConfig;\n};\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 a 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(\n transport: Transport,\n chain: Chain\n): transport is AlchemyTransport {\n return transport({ chain }).config.type === \"alchemy\";\n}\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: AlchemyTransportConfig): AlchemyTransport {\n const { retryDelay, retryCount } = 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\n const connectionConfig = ConnectionConfigSchema.parse(\n config.alchemyConnection ?? config\n );\n\n const headersAsObject = convertHeadersToObject(fetchOptions.headers);\n\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\n if (connectionConfig.jwt != null) {\n fetchOptions.headers = {\n ...fetchOptions.headers,\n Authorization: `Bearer ${connectionConfig.jwt}`,\n };\n }\n\n const transport: AlchemyTransportBase = (opts) => {\n const { chain: chain_ } = opts;\n if (!chain_) {\n throw new ChainNotFoundError();\n }\n const chain = AlchemyChainSchema.parse(chain_);\n\n const rpcUrl =\n connectionConfig.rpcUrl == null\n ? `${chain.rpcUrls.alchemy.http[0]}/${connectionConfig.apiKey ?? \"\"}`\n : connectionConfig.rpcUrl;\n\n const innerTransport = (() => {\n if (config.alchemyConnection && config.nodeRpcUrl) {\n return split({\n overrides: [\n {\n methods: alchemyMethods,\n transport: http(rpcUrl, { fetchOptions }),\n },\n ],\n fallback: http(config.nodeRpcUrl, {\n fetchOptions: config.fetchOptions,\n }),\n });\n }\n\n return http(rpcUrl, { fetchOptions });\n })();\n\n return createTransport(\n {\n key: \"alchemy\",\n name: \"Alchemy Transport\",\n request: innerTransport(opts).request,\n retryCount: retryCount ?? opts?.retryCount,\n retryDelay,\n type: \"alchemy\",\n },\n { alchemyRpcUrl: rpcUrl, fetchOptions }\n );\n };\n\n return Object.assign(transport, {\n updateHeaders(newHeaders_: HeadersInit) {\n const newHeaders = convertHeadersToObject(newHeaders_);\n\n fetchOptions.headers = {\n ...fetchOptions.headers,\n ...newHeaders,\n };\n },\n config,\n });\n}\n\nconst convertHeadersToObject = (\n headers?: HeadersInit\n): Record<string, string> => {\n if (!headers) {\n return {};\n }\n\n if (headers instanceof Headers) {\n const headersObject = {} as Record<string, string>;\n headers.forEach((value, key) => {\n headersObject[key] = value;\n });\n return headersObject;\n }\n\n if (Array.isArray(headers)) {\n return headers.reduce((acc, header) => {\n acc[header[0]] = header[1];\n return acc;\n }, {} as Record<string, string>);\n }\n\n return headers;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"alchemyTransport.js","sourceRoot":"","sources":["../../src/alchemyTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,KAAK,GAGN,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,eAAe,EACf,IAAI,GAOL,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,kBAAkB,EAAE,MA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AAa,EAAE,MAAM,EAAE,YAAY,EAAE,CACxC,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE;QAC9B,mBAAmB,EAAE,YAAY;QACjC,aAAa,CAAC,WAAwB;YACpC,MAAM,UAAU,GAAG,sBAAsB,CAAC,WAAW,CAAC,CAAC;YAEvD,YAAY,CAAC,OAAO,GAAG;gBACrB,GAAG,YAAY,CAAC,OAAO;gBACvB,GAAG,UAAU;aACd,CAAC;QACJ,CAAC;QACD,MAAM;KACP,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,OAAqB,EACG,EAAE;IAC1B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,OAAO,YAAY,OAAO,EAAE,CAAC;QAC/B,MAAM,aAAa,GAAG,EAA4B,CAAC;QACnD,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAC7B,aAAa,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC7B,CAAC,CAAC,CAAC;QACH,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;YACpC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YAC3B,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAA4B,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import {\n ChainNotFoundError,\n ConnectionConfigSchema,\n split,\n type ConnectionConfig,\n type NoUndefined,\n} from \"@aa-sdk/core\";\nimport {\n createTransport,\n http,\n type Chain,\n type EIP1193RequestFn,\n type HttpTransportConfig,\n type PublicRpcSchema,\n type Transport,\n type TransportConfig,\n} from \"viem\";\nimport type { AlchemyRpcSchema } from \"./client/types.js\";\nimport { AlchemyChainSchema } from \"./schema.js\";\nimport { VERSION } from \"./version.js\";\nimport { mutateRemoveTrackingHeaders } from \"./alchemyTrackerHeaders.js\";\n\ntype Never<T> = T extends object\n ? {\n [K in keyof T]?: never;\n }\n : never;\n\ntype SplitTransportConfig = {\n alchemyConnection: ConnectionConfig;\n nodeRpcUrl: string;\n};\n\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];\n\nexport type AlchemyTransportConfig = (\n | (ConnectionConfig & Never<SplitTransportConfig>)\n | (SplitTransportConfig & Never<ConnectionConfig>)\n) & {\n /** The max number of times to retry. */\n retryCount?: TransportConfig[\"retryCount\"] | undefined;\n /** The base delay (in ms) between retries. */\n retryDelay?: TransportConfig[\"retryDelay\"] | undefined;\n fetchOptions?: NoUndefined<HttpTransportConfig[\"fetchOptions\"]>;\n};\n\ntype AlchemyTransportBase = Transport<\n \"alchemy\",\n {\n alchemyRpcUrl: string;\n fetchOptions?: AlchemyTransportConfig[\"fetchOptions\"];\n },\n EIP1193RequestFn<[...PublicRpcSchema, ...AlchemyRpcSchema]>\n>;\n\nexport type AlchemyTransport = AlchemyTransportBase & {\n updateHeaders(newHeaders: HeadersInit): void;\n config: AlchemyTransportConfig;\n dynamicFetchOptions: AlchemyTransportConfig[\"fetchOptions\"];\n};\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 a 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(\n transport: Transport,\n chain: Chain\n): transport is AlchemyTransport {\n return transport({ chain }).config.type === \"alchemy\";\n}\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: AlchemyTransportConfig): AlchemyTransport {\n const { retryDelay, retryCount } = 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\n const connectionConfig = ConnectionConfigSchema.parse(\n config.alchemyConnection ?? config\n );\n\n const headersAsObject = convertHeadersToObject(fetchOptions.headers);\n\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\n if (connectionConfig.jwt != null) {\n fetchOptions.headers = {\n ...fetchOptions.headers,\n Authorization: `Bearer ${connectionConfig.jwt}`,\n };\n }\n\n const transport: AlchemyTransportBase = (opts) => {\n const { chain: chain_ } = opts;\n if (!chain_) {\n throw new ChainNotFoundError();\n }\n const chain = AlchemyChainSchema.parse(chain_);\n\n const rpcUrl =\n connectionConfig.rpcUrl == null\n ? `${chain.rpcUrls.alchemy.http[0]}/${connectionConfig.apiKey ?? \"\"}`\n : connectionConfig.rpcUrl;\n\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 }),\n },\n ],\n fallback: http(config.nodeRpcUrl, {\n fetchOptions: config.fetchOptions,\n }),\n });\n }\n\n return http(rpcUrl, { fetchOptions });\n })();\n\n return createTransport(\n {\n key: \"alchemy\",\n name: \"Alchemy Transport\",\n request: innerTransport(opts).request,\n retryCount: retryCount ?? opts?.retryCount,\n retryDelay,\n type: \"alchemy\",\n },\n { alchemyRpcUrl: rpcUrl, fetchOptions }\n );\n };\n\n return Object.assign(transport, {\n dynamicFetchOptions: fetchOptions,\n updateHeaders(newHeaders_: HeadersInit) {\n const newHeaders = convertHeadersToObject(newHeaders_);\n\n fetchOptions.headers = {\n ...fetchOptions.headers,\n ...newHeaders,\n };\n },\n config,\n });\n}\n\nexport const convertHeadersToObject = (\n headers?: HeadersInit\n): Record<string, string> => {\n if (!headers) {\n return {};\n }\n\n if (headers instanceof Headers) {\n const headersObject = {} as Record<string, string>;\n headers.forEach((value, key) => {\n headersObject[key] = value;\n });\n return headersObject;\n }\n\n if (Array.isArray(headers)) {\n return headers.reduce((acc, header) => {\n acc[header[0]] = header[1];\n return acc;\n }, {} as Record<string, string>);\n }\n\n return headers;\n};\n"]}
|
package/dist/esm/chains.d.ts
CHANGED
|
@@ -45,6 +45,8 @@ export declare const fraxtal: Chain;
|
|
|
45
45
|
export declare const fraxtalSepolia: Chain;
|
|
46
46
|
export declare const zora: Chain;
|
|
47
47
|
export declare const zoraSepolia: Chain;
|
|
48
|
+
export declare const sonic: Chain;
|
|
49
|
+
export declare const sonicTestnet: Chain;
|
|
48
50
|
export declare const worldChainSepolia: Chain;
|
|
49
51
|
export declare const worldChain: Chain;
|
|
50
52
|
export declare const shapeSepolia: Chain;
|
package/dist/esm/chains.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineChain } from "viem";
|
|
2
|
-
import { arbitrum as vab, arbitrumGoerli as vabg, arbitrumSepolia as vabs, base as vbase, baseGoerli as vbaseg, baseSepolia as vbases, fraxtal as vfrax, goerli as vgo, mainnet as vmain, optimism as vop, optimismGoerli as vopg, optimismSepolia as vops, polygon as vpg, polygonAmoy as vpga, polygonMumbai as vpgm, sepolia as vsep, arbitrumNova as vabn, zora as vzora, zoraSepolia as vzoras, } from "viem/chains";
|
|
2
|
+
import { arbitrum as vab, arbitrumGoerli as vabg, arbitrumSepolia as vabs, base as vbase, baseGoerli as vbaseg, baseSepolia as vbases, fraxtal as vfrax, goerli as vgo, mainnet as vmain, optimism as vop, optimismGoerli as vopg, optimismSepolia as vops, polygon as vpg, polygonAmoy as vpga, polygonMumbai as vpgm, sepolia as vsep, arbitrumNova as vabn, zora as vzora, zoraSepolia as vzoras, sonic as vsonic, sonicTestnet as vsonict, } from "viem/chains";
|
|
3
3
|
/**
|
|
4
4
|
* Defines an Alchemy chain configuration by adding an Alchemy-specific RPC base URL to the chain's RPC URLs.
|
|
5
5
|
*
|
|
@@ -193,6 +193,18 @@ export const zoraSepolia = {
|
|
|
193
193
|
...vzoras.rpcUrls,
|
|
194
194
|
},
|
|
195
195
|
};
|
|
196
|
+
export const sonic = {
|
|
197
|
+
...vsonic,
|
|
198
|
+
rpcUrls: {
|
|
199
|
+
...vsonic.rpcUrls,
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
export const sonicTestnet = {
|
|
203
|
+
...vsonict,
|
|
204
|
+
rpcUrls: {
|
|
205
|
+
...vsonict.rpcUrls,
|
|
206
|
+
},
|
|
207
|
+
};
|
|
196
208
|
export const worldChainSepolia = defineChain({
|
|
197
209
|
id: 4801,
|
|
198
210
|
name: "World Chain Sepolia",
|
package/dist/esm/chains.js.map
CHANGED
|
@@ -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,IAAI,EACtB,eAAe,IAAI,IAAI,EACvB,OAAO,IAAI,GAAG,EACd,WAAW,IAAI,IAAI,EACnB,aAAa,IAAI,IAAI,EACrB,OAAO,IAAI,IAAI,EACf,YAAY,IAAI,IAAI,EACpB,IAAI,IAAI,KAAK,EACb,WAAW,IAAI,MAAM,GACtB,MAAM,aAAa,CAAC;AAOrB;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EACjC,KAAK,EACL,UAAU,GAIX,EAAS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IAAI,EAAE,CAAC,yCAAyC,CAAC;SAClD;KACF;IACD,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,gBAAgB;YACtB,GAAG,EAAE,6CAA6C;SACnD;KACF;IACD,OAAO,EAAE,IAAI;CACd,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAU,WAAW,CAAC;IAC5C,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,cAAc;IACpB,cAAc,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC5D,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,uCAAuC,CAAC;SAChD;QACD,MAAM,EAAE;YACN,IAAI,EAAE,CAAC,uCAAuC,CAAC;SAChD;QACD,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,uCAAuC,CAAC;SAChD;KACF;IACD,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,gBAAgB;YACtB,GAAG,EAAE,uCAAuC;SAC7C;KACF;IACD,OAAO,EAAE,IAAI;CACd,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 arbitrumNova as vabn,\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\nexport const shapeSepolia: Chain = defineChain({\n id: 11011,\n name: \"Shape Sepolia\",\n network: \"Shape Sepolia\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://shape-sepolia.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://shape-sepolia.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://shape-sepolia.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const shape: Chain = defineChain({\n id: 360,\n name: \"Shape\",\n network: \"Shape\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://shape-mainnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://shape-mainnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://shape-mainnet.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const unichainMainnet: Chain = defineChain({\n id: 130,\n name: \"Unichain Mainnet\",\n network: \"Unichain Mainnet\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://unichain-mainnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://unichain-mainnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://unichain-mainnet.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const unichainSepolia: Chain = defineChain({\n id: 1301,\n name: \"Unichain Sepolia\",\n network: \"Unichain Sepolia\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://unichain-sepolia.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://unichain-sepolia.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://unichain-sepolia.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const soneiumMinato: Chain = defineChain({\n id: 1946,\n name: \"Soneium Minato\",\n network: \"Soneium Minato\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://soneium-minato.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://soneium-minato.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://soneium-minato.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const soneiumMainnet: Chain = defineChain({\n id: 1868,\n name: \"Soneium Mainnet\",\n network: \"Soneium Mainnet\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://soneium-mainnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://soneium-mainnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://soneium-mainnet.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const opbnbTestnet: Chain = defineChain({\n id: 5611,\n name: \"OPBNB Testnet\",\n network: \"OPBNB Testnet\",\n nativeCurrency: { name: \"BNB\", symbol: \"BNB\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://opbnb-testnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://opbnb-testnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://opbnb-testnet.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const opbnbMainnet: Chain = defineChain({\n id: 204,\n name: \"OPBNB Mainnet\",\n network: \"OPBNB Mainnet\",\n nativeCurrency: { name: \"BNB\", symbol: \"BNB\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://opbnb-mainnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://opbnb-mainnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://opbnb-mainnet.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const beraChainBartio: Chain = defineChain({\n id: 80084,\n name: \"BeraChain Bartio\",\n network: \"BeraChain Bartio\",\n nativeCurrency: { name: \"Bera\", symbol: \"BERA\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://berachain-bartio.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://berachain-bartio.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://berachain-bartio.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const inkMainnet: Chain = defineChain({\n id: 57073,\n name: \"Ink Mainnet\",\n network: \"Ink Mainnet\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://ink-mainnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://ink-mainnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://ink-mainnet.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const inkSepolia: Chain = defineChain({\n id: 763373,\n name: \"Ink Sepolia\",\n network: \"Ink Sepolia\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://ink-sepolia.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://ink-sepolia.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://ink-sepolia.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const arbitrumNova: Chain = {\n ...vabn,\n rpcUrls: {\n ...vabn.rpcUrls,\n },\n};\n\nexport const monadTestnet: Chain = defineChain({\n id: 10143,\n name: \"Monad Testnet\",\n nativeCurrency: { name: \"Monad\", symbol: \"MON\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://monad-testnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://monad-testnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://monad-testnet.g.alchemy.com/v2\"],\n },\n },\n testnet: true,\n});\n\nexport const mekong: Chain = defineChain({\n id: 7078815900,\n name: \"Mekong Pectra Devnet\",\n nativeCurrency: { name: \"eth\", symbol: \"eth\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.mekong.ethpandaops.io\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Block Explorer\",\n url: \"https://explorer.mekong.ethpandaops.io\",\n },\n },\n testnet: true,\n});\n\nexport const openlootSepolia: Chain = defineChain({\n id: 905905,\n name: \"Openloot Sepolia\",\n nativeCurrency: { name: \"Openloot\", symbol: \"OL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://openloot-sepolia.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://openloot-sepolia.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://openloot-sepolia.g.alchemy.com/v2\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Block Explorer\",\n url: \"https://openloot-sepolia.explorer.alchemy.com\",\n },\n },\n testnet: true,\n});\n\nexport const gensynTestnet: Chain = defineChain({\n id: 685685,\n name: \"Gensyn Testnet\",\n nativeCurrency: { name: \"eth\", symbol: \"eth\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://gensyn-testnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://gensyn-testnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://gensyn-testnet.g.alchemy.com/v2\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Block Explorer\",\n url: \"https://gensyn-testnet.explorer.alchemy.com\",\n },\n },\n testnet: true,\n});\n\nexport const riseTestnet: Chain = defineChain({\n id: 11155931,\n name: \"Rise Testnet\",\n nativeCurrency: { name: \"eth\", symbol: \"eth\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rise-testnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://rise-testnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://rise-testnet.g.alchemy.com/v2\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Block Explorer\",\n url: \"https://testnet-explorer.riselabs.xyz\",\n },\n },\n testnet: true,\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,YAAY,IAAI,IAAI,EACpB,IAAI,IAAI,KAAK,EACb,WAAW,IAAI,MAAM,EACrB,KAAK,IAAI,MAAM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D,OAAO,EAAE,IAAI;CACd,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAU,WAAW,CAAC;IAC9C,EAAE,EAAE,MAAM;IACV,IAAI,EAAE,gBAAgB;IACtB,cAAc,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC5D,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,yCAAyC,CAAC;SAClD;QACD,MAAM,EAAE;YACN,IAAI,EAAE,CAAC,yCAAyC,CAAC;SAClD;QACD,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,yCAAyC,CAAC;SAClD;KACF;IACD,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,gBAAgB;YACtB,GAAG,EAAE,6CAA6C;SACnD;KACF;IACD,OAAO,EAAE,IAAI;CACd,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAU,WAAW,CAAC;IAC5C,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,cAAc;IACpB,cAAc,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC5D,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,uCAAuC,CAAC;SAChD;QACD,MAAM,EAAE;YACN,IAAI,EAAE,CAAC,uCAAuC,CAAC;SAChD;QACD,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,uCAAuC,CAAC;SAChD;KACF;IACD,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,gBAAgB;YACtB,GAAG,EAAE,uCAAuC;SAC7C;KACF;IACD,OAAO,EAAE,IAAI;CACd,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 arbitrumNova as vabn,\n zora as vzora,\n zoraSepolia as vzoras,\n sonic as vsonic,\n sonicTestnet as vsonict,\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 sonic: Chain = {\n ...vsonic,\n rpcUrls: {\n ...vsonic.rpcUrls,\n },\n};\n\nexport const sonicTestnet: Chain = {\n ...vsonict,\n rpcUrls: {\n ...vsonict.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\nexport const shapeSepolia: Chain = defineChain({\n id: 11011,\n name: \"Shape Sepolia\",\n network: \"Shape Sepolia\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://shape-sepolia.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://shape-sepolia.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://shape-sepolia.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const shape: Chain = defineChain({\n id: 360,\n name: \"Shape\",\n network: \"Shape\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://shape-mainnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://shape-mainnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://shape-mainnet.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const unichainMainnet: Chain = defineChain({\n id: 130,\n name: \"Unichain Mainnet\",\n network: \"Unichain Mainnet\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://unichain-mainnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://unichain-mainnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://unichain-mainnet.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const unichainSepolia: Chain = defineChain({\n id: 1301,\n name: \"Unichain Sepolia\",\n network: \"Unichain Sepolia\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://unichain-sepolia.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://unichain-sepolia.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://unichain-sepolia.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const soneiumMinato: Chain = defineChain({\n id: 1946,\n name: \"Soneium Minato\",\n network: \"Soneium Minato\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://soneium-minato.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://soneium-minato.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://soneium-minato.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const soneiumMainnet: Chain = defineChain({\n id: 1868,\n name: \"Soneium Mainnet\",\n network: \"Soneium Mainnet\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://soneium-mainnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://soneium-mainnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://soneium-mainnet.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const opbnbTestnet: Chain = defineChain({\n id: 5611,\n name: \"OPBNB Testnet\",\n network: \"OPBNB Testnet\",\n nativeCurrency: { name: \"BNB\", symbol: \"BNB\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://opbnb-testnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://opbnb-testnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://opbnb-testnet.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const opbnbMainnet: Chain = defineChain({\n id: 204,\n name: \"OPBNB Mainnet\",\n network: \"OPBNB Mainnet\",\n nativeCurrency: { name: \"BNB\", symbol: \"BNB\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://opbnb-mainnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://opbnb-mainnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://opbnb-mainnet.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const beraChainBartio: Chain = defineChain({\n id: 80084,\n name: \"BeraChain Bartio\",\n network: \"BeraChain Bartio\",\n nativeCurrency: { name: \"Bera\", symbol: \"BERA\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://berachain-bartio.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://berachain-bartio.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://berachain-bartio.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const inkMainnet: Chain = defineChain({\n id: 57073,\n name: \"Ink Mainnet\",\n network: \"Ink Mainnet\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://ink-mainnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://ink-mainnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://ink-mainnet.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const inkSepolia: Chain = defineChain({\n id: 763373,\n name: \"Ink Sepolia\",\n network: \"Ink Sepolia\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://ink-sepolia.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://ink-sepolia.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://ink-sepolia.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const arbitrumNova: Chain = {\n ...vabn,\n rpcUrls: {\n ...vabn.rpcUrls,\n },\n};\n\nexport const monadTestnet: Chain = defineChain({\n id: 10143,\n name: \"Monad Testnet\",\n nativeCurrency: { name: \"Monad\", symbol: \"MON\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://monad-testnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://monad-testnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://monad-testnet.g.alchemy.com/v2\"],\n },\n },\n testnet: true,\n});\n\nexport const mekong: Chain = defineChain({\n id: 7078815900,\n name: \"Mekong Pectra Devnet\",\n nativeCurrency: { name: \"eth\", symbol: \"eth\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.mekong.ethpandaops.io\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Block Explorer\",\n url: \"https://explorer.mekong.ethpandaops.io\",\n },\n },\n testnet: true,\n});\n\nexport const openlootSepolia: Chain = defineChain({\n id: 905905,\n name: \"Openloot Sepolia\",\n nativeCurrency: { name: \"Openloot\", symbol: \"OL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://openloot-sepolia.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://openloot-sepolia.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://openloot-sepolia.g.alchemy.com/v2\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Block Explorer\",\n url: \"https://openloot-sepolia.explorer.alchemy.com\",\n },\n },\n testnet: true,\n});\n\nexport const gensynTestnet: Chain = defineChain({\n id: 685685,\n name: \"Gensyn Testnet\",\n nativeCurrency: { name: \"eth\", symbol: \"eth\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://gensyn-testnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://gensyn-testnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://gensyn-testnet.g.alchemy.com/v2\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Block Explorer\",\n url: \"https://gensyn-testnet.explorer.alchemy.com\",\n },\n },\n testnet: true,\n});\n\nexport const riseTestnet: Chain = defineChain({\n id: 11155931,\n name: \"Rise Testnet\",\n nativeCurrency: { name: \"eth\", symbol: \"eth\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rise-testnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://rise-testnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://rise-testnet.g.alchemy.com/v2\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Block Explorer\",\n url: \"https://testnet-explorer.riselabs.xyz\",\n },\n },\n testnet: true,\n});\n"]}
|
|
@@ -19,7 +19,7 @@ export type AlchemySmartAccountClientActions<TAccount extends SmartContractAccou
|
|
|
19
19
|
* const clientWithAlchemyActions = client.extend(alchemyActions);
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
22
|
-
* @param {Client<TTransport, TChain, TAccount>}
|
|
22
|
+
* @param {Client<TTransport, TChain, TAccount>} client_ The client instance used to perform actions
|
|
23
23
|
* @returns {AlchemySmartAccountClientActions<TAccount, TContext>} An object containing Alchemy Smart Account client actions
|
|
24
24
|
*/
|
|
25
25
|
export declare const alchemyActions: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined>(client: Client<TTransport, TChain, TAccount>) => AlchemySmartAccountClientActions<TAccount, TContext, TChain>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isSmartAccountWithSigner, sendTransaction, sendTransactions, sendUserOperation, } from "@aa-sdk/core";
|
|
1
|
+
import { isSmartAccountWithSigner, sendTransaction, sendTransactions, sendUserOperation, clientHeaderTrack, } from "@aa-sdk/core";
|
|
2
2
|
import { simulateUserOperationChanges } from "../../actions/simulateUserOperationChanges.js";
|
|
3
3
|
import { InfraLogger } from "../../metrics.js";
|
|
4
4
|
/**
|
|
@@ -13,24 +13,30 @@ import { InfraLogger } from "../../metrics.js";
|
|
|
13
13
|
* const clientWithAlchemyActions = client.extend(alchemyActions);
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
16
|
-
* @param {Client<TTransport, TChain, TAccount>}
|
|
16
|
+
* @param {Client<TTransport, TChain, TAccount>} client_ The client instance used to perform actions
|
|
17
17
|
* @returns {AlchemySmartAccountClientActions<TAccount, TContext>} An object containing Alchemy Smart Account client actions
|
|
18
18
|
*/
|
|
19
|
-
export const alchemyActions = (
|
|
20
|
-
simulateUserOperation: async (args) =>
|
|
21
|
-
|
|
19
|
+
export const alchemyActions = (client_) => ({
|
|
20
|
+
simulateUserOperation: async (args) => {
|
|
21
|
+
const client = clientHeaderTrack(client_, "simulateUserOperation");
|
|
22
|
+
return simulateUserOperationChanges(client, args);
|
|
23
|
+
},
|
|
24
|
+
async sendUserOperation(args) {
|
|
25
|
+
const client = clientHeaderTrack(client_, "infraSendUserOperation");
|
|
22
26
|
const { account = client.account } = args;
|
|
23
27
|
const result = sendUserOperation(client, args);
|
|
24
28
|
logSendUoEvent(client.chain.id, account);
|
|
25
29
|
return result;
|
|
26
30
|
},
|
|
27
31
|
sendTransaction: async (args, overrides, context) => {
|
|
32
|
+
const client = clientHeaderTrack(client_, "sendTransaction");
|
|
28
33
|
const { account = client.account } = args;
|
|
29
34
|
const result = await sendTransaction(client, args, overrides, context);
|
|
30
35
|
logSendUoEvent(client.chain.id, account);
|
|
31
36
|
return result;
|
|
32
37
|
},
|
|
33
38
|
async sendTransactions(args) {
|
|
39
|
+
const client = clientHeaderTrack(client_, "sendTransactions");
|
|
34
40
|
const { account = client.account } = args;
|
|
35
41
|
const result = sendTransactions(client, args);
|
|
36
42
|
logSendUoEvent(client.chain.id, account);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smartAccount.js","sourceRoot":"","sources":["../../../../src/client/decorators/smartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"smartAccount.js","sourceRoot":"","sources":["../../../../src/client/decorators/smartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EAQjB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAQtB,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAE7F,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAgC/C;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,cAAc,GAWyC,CAClE,OAAO,EACP,EAAE,CAAC,CAAC;IACJ,q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,CAAC,MAAM,CAAC,KAAM,CAAC,EAAE,EAAE,OAAQ,CAAC,CAAC;QAC3C,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC;AAEH,SAAS,cAAc,CAAC,OAAe,EAAE,OAA6B;IACpE,MAAM,UAAU,GAAG,wBAAwB,CAAC,OAAO,CAAC;QAClD,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,UAAU;QAChC,CAAC,CAAC,SAAS,CAAC;IAEd,WAAW,CAAC,UAAU,CAAC;QACrB,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE;YACJ,OAAO;YACP,UAAU,EAAE,UAAU;YACtB,UAAU,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC,OAAO;SAC5C;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {\n isSmartAccountWithSigner,\n sendTransaction,\n sendTransactions,\n sendUserOperation,\n type GetEntryPointFromAccount,\n type SendTransactionsParameters,\n type SendUserOperationParameters,\n type SendUserOperationResult,\n type SmartContractAccount,\n type UserOperationContext,\n type UserOperationOverrides,\n clientHeaderTrack,\n} from \"@aa-sdk/core\";\nimport type {\n Chain,\n Client,\n Hex,\n SendTransactionParameters,\n Transport,\n} from \"viem\";\nimport { simulateUserOperationChanges } from \"../../actions/simulateUserOperationChanges.js\";\nimport type { SimulateUserOperationAssetChangesResponse } from \"../../actions/types.js\";\nimport { InfraLogger } from \"../../metrics.js\";\n\nexport type AlchemySmartAccountClientActions<\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined,\n TChain extends Chain | undefined = Chain | undefined,\n TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>\n> = {\n simulateUserOperation: (\n args: SendUserOperationParameters<TAccount, TContext>\n ) => Promise<SimulateUserOperationAssetChangesResponse>;\n sendUserOperation: (\n args: SendUserOperationParameters<\n TAccount,\n TContext,\n GetEntryPointFromAccount<TAccount>\n >\n ) => Promise<SendUserOperationResult<TEntryPointVersion>>;\n sendTransaction: <TChainOverride extends Chain | undefined = undefined>(\n args: SendTransactionParameters<TChain, TAccount, TChainOverride>,\n overrides?: UserOperationOverrides<TEntryPointVersion>,\n context?: TContext\n ) => Promise<Hex>;\n sendTransactions: (\n args: SendTransactionsParameters<TAccount, TContext>\n ) => Promise<Hex>;\n};\n\n/**\n * Provides a set of actions for interacting with the Alchemy Smart Account client, including the ability to simulate user operations.\n *\n * @example\n * ```ts\n * import { alchemyActions } from \"@account-kit/infra\";\n * import { createPublicClient } from \"viem\";\n *\n * const client = createPublicClient(...);\n * const clientWithAlchemyActions = client.extend(alchemyActions);\n * ```\n *\n * @param {Client<TTransport, TChain, TAccount>} client_ The client instance used to perform actions\n * @returns {AlchemySmartAccountClientActions<TAccount, TContext>} An object containing Alchemy Smart Account client actions\n */\nexport const alchemyActions: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends UserOperationContext | undefined =\n | UserOperationContext\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n) => AlchemySmartAccountClientActions<TAccount, TContext, TChain> = (\n client_\n) => ({\n simulateUserOperation: async (args) => {\n const client = clientHeaderTrack(client_, \"simulateUserOperation\");\n return simulateUserOperationChanges(client, args);\n },\n async sendUserOperation(args) {\n const client = clientHeaderTrack(client_, \"infraSendUserOperation\");\n const { account = client.account } = args;\n\n const result = sendUserOperation(client, args);\n logSendUoEvent(client.chain!.id, account!);\n return result;\n },\n sendTransaction: async (args, overrides, context) => {\n const client = clientHeaderTrack(client_, \"sendTransaction\");\n const { account = client.account } = args;\n\n const result = await sendTransaction(client, args, overrides, context);\n logSendUoEvent(client.chain!.id, account as SmartContractAccount);\n return result;\n },\n async sendTransactions(args) {\n const client = clientHeaderTrack(client_, \"sendTransactions\");\n const { account = client.account } = args;\n\n const result = sendTransactions(client, args);\n logSendUoEvent(client.chain!.id, account!);\n return result;\n },\n});\n\nfunction logSendUoEvent(chainId: number, account: SmartContractAccount) {\n const signerType = isSmartAccountWithSigner(account)\n ? account.getSigner().signerType\n : \"unknown\";\n\n InfraLogger.trackEvent({\n name: \"client_send_uo\",\n data: {\n chainId,\n signerType: signerType,\n entryPoint: account.getEntryPoint().address,\n },\n });\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Prettify, type SmartAccountClient, type SmartAccountClientActions, type SmartAccountClientConfig, type SmartAccountClientRpcSchema, type SmartContractAccount, type SmartContractAccountWithSigner, type UserOperationContext } from "@aa-sdk/core";
|
|
2
2
|
import { type Chain } from "viem";
|
|
3
|
-
import type
|
|
3
|
+
import { type AlchemyTransport } from "../alchemyTransport.js";
|
|
4
4
|
import { type AlchemySmartAccountClientActions } from "./decorators/smartAccount.js";
|
|
5
5
|
import type { AlchemyRpcSchema } from "./types.js";
|
|
6
6
|
export declare function getSignerTypeHeader<TAccount extends SmartContractAccountWithSigner>(account: TAccount): {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { ChainNotFoundError, createSmartAccountClient, isSmartAccountWithSigner, } from "@aa-sdk/core";
|
|
1
|
+
import { ChainNotFoundError, clientHeaderTrack, createSmartAccountClient, isSmartAccountWithSigner, } from "@aa-sdk/core";
|
|
2
2
|
import {} from "viem";
|
|
3
|
+
import { alchemy, convertHeadersToObject, } from "../alchemyTransport.js";
|
|
3
4
|
import { getDefaultUserOperationFeeOptions } from "../defaults.js";
|
|
4
5
|
import { alchemyFeeEstimator } from "../middleware/feeEstimator.js";
|
|
5
6
|
import { alchemyGasAndPaymasterAndDataMiddleware } from "../middleware/gasManager.js";
|
|
6
7
|
import { alchemyUserOperationSimulator } from "../middleware/userOperationSimulator.js";
|
|
7
8
|
import { alchemyActions, } from "./decorators/smartAccount.js";
|
|
9
|
+
import { headersUpdate } from "../alchemyTrackerHeaders.js";
|
|
8
10
|
export function getSignerTypeHeader(account) {
|
|
9
11
|
return { "Alchemy-Aa-Sdk-Signer": account.getSigner().signerType };
|
|
10
12
|
}
|
|
@@ -25,43 +27,61 @@ export function getSignerTypeHeader(account) {
|
|
|
25
27
|
* @param {AlchemySmartAccountClientConfig} config The configuration for creating the Alchemy smart account client
|
|
26
28
|
* @returns {AlchemySmartAccountClient} An instance of `AlchemySmartAccountClient` configured based on the provided options
|
|
27
29
|
*/
|
|
28
|
-
export function createAlchemySmartAccountClient(
|
|
29
|
-
if (!chain) {
|
|
30
|
+
export function createAlchemySmartAccountClient(config) {
|
|
31
|
+
if (!config.chain) {
|
|
30
32
|
throw new ChainNotFoundError();
|
|
31
33
|
}
|
|
32
|
-
const feeOptions = opts?.feeOptions ?? getDefaultUserOperationFeeOptions(chain);
|
|
34
|
+
const feeOptions = config.opts?.feeOptions ?? getDefaultUserOperationFeeOptions(config.chain);
|
|
33
35
|
const scaClient = createSmartAccountClient({
|
|
34
|
-
account,
|
|
35
|
-
transport,
|
|
36
|
-
chain,
|
|
36
|
+
account: config.account,
|
|
37
|
+
transport: config.transport,
|
|
38
|
+
chain: config.chain,
|
|
37
39
|
type: "AlchemySmartAccountClient",
|
|
38
40
|
opts: {
|
|
39
|
-
...opts,
|
|
41
|
+
...config.opts,
|
|
40
42
|
feeOptions,
|
|
41
43
|
},
|
|
42
|
-
feeEstimator: feeEstimator ?? alchemyFeeEstimator(transport),
|
|
43
|
-
gasEstimator,
|
|
44
|
+
feeEstimator: config.feeEstimator ?? alchemyFeeEstimator(config.transport),
|
|
45
|
+
gasEstimator: config.gasEstimator,
|
|
44
46
|
customMiddleware: async (struct, args) => {
|
|
45
47
|
if (isSmartAccountWithSigner(args.account)) {
|
|
46
|
-
transport.updateHeaders(getSignerTypeHeader(args.account));
|
|
48
|
+
config.transport.updateHeaders(getSignerTypeHeader(args.account));
|
|
47
49
|
}
|
|
48
|
-
return customMiddleware
|
|
50
|
+
return config.customMiddleware
|
|
51
|
+
? config.customMiddleware(struct, args)
|
|
52
|
+
: struct;
|
|
49
53
|
},
|
|
50
|
-
...(policyId
|
|
54
|
+
...(config.policyId
|
|
51
55
|
? alchemyGasAndPaymasterAndDataMiddleware({
|
|
52
|
-
policyId,
|
|
53
|
-
transport,
|
|
54
|
-
gasEstimatorOverride: gasEstimator,
|
|
55
|
-
feeEstimatorOverride: feeEstimator,
|
|
56
|
+
policyId: config.policyId,
|
|
57
|
+
transport: config.transport,
|
|
58
|
+
gasEstimatorOverride: config.gasEstimator,
|
|
59
|
+
feeEstimatorOverride: config.feeEstimator,
|
|
56
60
|
})
|
|
57
61
|
: {}),
|
|
58
|
-
userOperationSimulator: useSimulation
|
|
59
|
-
? alchemyUserOperationSimulator(transport)
|
|
62
|
+
userOperationSimulator: config.useSimulation
|
|
63
|
+
? alchemyUserOperationSimulator(config.transport)
|
|
60
64
|
: undefined,
|
|
61
|
-
signUserOperation,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
signUserOperation: config.signUserOperation,
|
|
66
|
+
addBreadCrumb(breadcrumb) {
|
|
67
|
+
const oldConfig = config.transport.config;
|
|
68
|
+
const dynamicFetchOptions = config.transport.dynamicFetchOptions;
|
|
69
|
+
const newTransport = alchemy({ ...oldConfig });
|
|
70
|
+
newTransport.updateHeaders(headersUpdate(breadcrumb)(convertHeadersToObject(dynamicFetchOptions?.headers)));
|
|
71
|
+
return createAlchemySmartAccountClient({
|
|
72
|
+
...config,
|
|
73
|
+
transport: newTransport,
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
})
|
|
77
|
+
.extend(alchemyActions)
|
|
78
|
+
.extend((client_) => ({
|
|
79
|
+
addBreadcrumb(breadcrumb) {
|
|
80
|
+
return clientHeaderTrack(client_, breadcrumb);
|
|
81
|
+
},
|
|
82
|
+
}));
|
|
83
|
+
if (config.account && isSmartAccountWithSigner(config.account)) {
|
|
84
|
+
config.transport.updateHeaders(getSignerTypeHeader(config.account));
|
|
65
85
|
}
|
|
66
86
|
return scaClient;
|
|
67
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smartAccountClient.js","sourceRoot":"","sources":["../../../src/client/smartAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,GASzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAc,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"smartAccountClient.js","sourceRoot":"","sources":["../../../src/client/smartAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,wBAAwB,GASzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAc,MAAM,MAAM,CAAC;AAClC,OAAO,EACL,OAAO,EACP,sBAAsB,GAEvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iCAAiC,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,uCAAuC,EAAE,MAAM,6BAA6B,CAAC;AACtF,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EACL,cAAc,GAEf,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,MAAM,UAAU,mBAAmB,CAEjC,OAAiB;IACjB,OAAO,EAAE,uBAAuB,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,CAAC;AACrE,CAAC;AAiFD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,+BAA+B,CAC7C,MAAuC;IAEvC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,IAAI,kBAAkB,EAAE,CAAC;IACjC,CAAC;IAED,MAAM,UAAU,GACd,MAAM,CAAC,IAAI,EAAE,UAAU,IAAI,iCAAiC,CAAC,MAAM,CAAC,KAAK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CAAC,SAAS,CAAC,MAAM,CAAC;YAC1C,MAAM,mBAAmB,GAAG,MAAM,CAAC,SAAS,CAAC,mBAAmB,CAAC;YACjE,MAAM,YAAY,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;YAC/C,YAAY,CAAC,aAAa,CACxB,aAAa,CAAC,UAAU,CAAC,CACvB,sBAAsB,CAAC,mBAAmB,EAAE,OAAO,CAAC,CACrD,CACF,CAAC;YACF,OAAO,+BAA+B,CAAC;gBACrC,GAAG,MAAM;gBACT,SAAS,EAAE,YAAY;aACxB,CAAQ,CAAC;QACZ,CAAC;KACF,CAAC;SACC,MAAM,CAAC,cAAc,CAAC;SACtB,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QACpB,aAAa,CAAC,UAAkB;YAC9B,OAAO,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAChD,CAAC;KACF,CAAC,CAAC,CAAC;IAEN,IAAI,MAAM,CAAC,OAAO,IAAI,wBAAwB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/D,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,mBAAmB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import {\n ChainNotFoundError,\n clientHeaderTrack,\n createSmartAccountClient,\n isSmartAccountWithSigner,\n type Prettify,\n type SmartAccountClient,\n type SmartAccountClientActions,\n type SmartAccountClientConfig,\n type SmartAccountClientRpcSchema,\n type SmartContractAccount,\n type SmartContractAccountWithSigner,\n type UserOperationContext,\n} from \"@aa-sdk/core\";\nimport { type Chain } from \"viem\";\nimport {\n alchemy,\n convertHeadersToObject,\n type AlchemyTransport,\n} from \"../alchemyTransport.js\";\nimport { getDefaultUserOperationFeeOptions } from \"../defaults.js\";\nimport { alchemyFeeEstimator } from \"../middleware/feeEstimator.js\";\nimport { alchemyGasAndPaymasterAndDataMiddleware } from \"../middleware/gasManager.js\";\nimport { alchemyUserOperationSimulator } from \"../middleware/userOperationSimulator.js\";\nimport {\n alchemyActions,\n type AlchemySmartAccountClientActions,\n} from \"./decorators/smartAccount.js\";\nimport type { AlchemyRpcSchema } from \"./types.js\";\nimport { headersUpdate } from \"../alchemyTrackerHeaders.js\";\n\nexport function getSignerTypeHeader<\n TAccount extends SmartContractAccountWithSigner\n>(account: TAccount) {\n return { \"Alchemy-Aa-Sdk-Signer\": account.getSigner().signerType };\n}\n\n// #region AlchemySmartAccountClientConfig\nexport type AlchemySmartAccountClientConfig<\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 | string[];\n} & Pick<\n SmartAccountClientConfig<AlchemyTransport, chain, account, context>,\n | \"customMiddleware\"\n | \"feeEstimator\"\n | \"gasEstimator\"\n | \"signUserOperation\"\n | \"transport\"\n | \"chain\"\n | \"opts\"\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 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 AlchemyTransport,\n chain,\n account,\n actions & BaseAlchemyActions<chain, account, context>,\n [...SmartAccountClientRpcSchema, ...AlchemyRpcSchema],\n context\n >\n>;\n\nexport type AlchemySmartAccountClient<\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<AlchemySmartAccountClient_Base<chain, account, actions, context>>;\n\nexport function createAlchemySmartAccountClient<\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 params: AlchemySmartAccountClientConfig<TChain, TAccount, TContext>\n): AlchemySmartAccountClient<TChain, TAccount, Record<string, never>, TContext>;\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, alchemy } from \"@account-kit/infra\";\n * import { sepolia } from \"@account-kit/infra/chain\";\n *\n * const client = createAlchemySmartAccountClient({\n * chain: sepolia,\n * transport: alchemy({ 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 config: AlchemySmartAccountClientConfig\n): AlchemySmartAccountClient {\n if (!config.chain) {\n throw new ChainNotFoundError();\n }\n\n const feeOptions =\n config.opts?.feeOptions ?? getDefaultUserOperationFeeOptions(config.chain);\n\n const scaClient = createSmartAccountClient({\n account: config.account,\n transport: config.transport,\n chain: config.chain,\n type: \"AlchemySmartAccountClient\",\n opts: {\n ...config.opts,\n feeOptions,\n },\n feeEstimator: config.feeEstimator ?? alchemyFeeEstimator(config.transport),\n gasEstimator: config.gasEstimator,\n customMiddleware: async (struct, args) => {\n if (isSmartAccountWithSigner(args.account)) {\n config.transport.updateHeaders(getSignerTypeHeader(args.account));\n }\n return config.customMiddleware\n ? config.customMiddleware(struct, args)\n : struct;\n },\n ...(config.policyId\n ? alchemyGasAndPaymasterAndDataMiddleware({\n policyId: config.policyId,\n transport: config.transport,\n gasEstimatorOverride: config.gasEstimator,\n feeEstimatorOverride: config.feeEstimator,\n })\n : {}),\n userOperationSimulator: config.useSimulation\n ? alchemyUserOperationSimulator(config.transport)\n : undefined,\n signUserOperation: config.signUserOperation,\n addBreadCrumb(breadcrumb: string) {\n const oldConfig = config.transport.config;\n const dynamicFetchOptions = config.transport.dynamicFetchOptions;\n const newTransport = alchemy({ ...oldConfig });\n newTransport.updateHeaders(\n headersUpdate(breadcrumb)(\n convertHeadersToObject(dynamicFetchOptions?.headers)\n )\n );\n return createAlchemySmartAccountClient({\n ...config,\n transport: newTransport,\n }) as any;\n },\n })\n .extend(alchemyActions)\n .extend((client_) => ({\n addBreadcrumb(breadcrumb: string) {\n return clientHeaderTrack(client_, breadcrumb);\n },\n }));\n\n if (config.account && isSmartAccountWithSigner(config.account)) {\n config.transport.updateHeaders(getSignerTypeHeader(config.account));\n }\n\n return scaClient;\n}\n"]}
|