@account-kit/infra 4.34.1 → 4.35.1
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/actions/simulateUserOperationChanges.js.map +1 -1
- package/dist/esm/actions/types.js.map +1 -1
- package/dist/esm/alchemyTransport.js +6 -16
- package/dist/esm/alchemyTransport.js.map +1 -1
- package/dist/esm/chains.d.ts +3 -0
- package/dist/esm/chains.js +69 -0
- package/dist/esm/chains.js.map +1 -1
- package/dist/esm/client/decorators/alchemyEnhancedApis.js.map +1 -1
- package/dist/esm/client/decorators/smartAccount.js.map +1 -1
- package/dist/esm/client/isAlchemySmartAccountClient.js.map +1 -1
- package/dist/esm/client/smartAccountClient.js.map +1 -1
- package/dist/esm/client/types.js.map +1 -1
- package/dist/esm/defaults.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/metrics.js.map +1 -1
- package/dist/esm/middleware/feeEstimator.js.map +1 -1
- package/dist/esm/middleware/gasManager.js.map +1 -1
- package/dist/esm/middleware/userOperationSimulator.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/actions/types.d.ts.map +1 -1
- package/dist/types/alchemyTrackerHeaders.d.ts.map +1 -1
- package/dist/types/alchemyTransport.d.ts.map +1 -1
- package/dist/types/chains.d.ts +3 -0
- package/dist/types/chains.d.ts.map +1 -1
- package/dist/types/client/decorators/smartAccount.d.ts.map +1 -1
- package/dist/types/client/rpcClient.d.ts.map +1 -1
- package/dist/types/defaults.d.ts.map +1 -1
- package/dist/types/gas-manager.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +5 -7
- package/src/actions/simulateUserOperationChanges.ts +5 -5
- package/src/actions/types.ts +11 -11
- package/src/alchemyTransport.ts +17 -24
- package/src/chains.ts +72 -0
- package/src/client/decorators/alchemyEnhancedApis.ts +4 -4
- package/src/client/decorators/smartAccount.ts +9 -8
- package/src/client/isAlchemySmartAccountClient.ts +2 -2
- package/src/client/smartAccountClient.ts +10 -10
- package/src/client/types.ts +1 -1
- package/src/defaults.ts +1 -1
- package/src/index.ts +3 -0
- package/src/metrics.ts +1 -1
- package/src/middleware/feeEstimator.ts +3 -3
- package/src/middleware/gasManager.ts +25 -25
- package/src/middleware/userOperationSimulator.ts +1 -1
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simulateUserOperationChanges.js","sourceRoot":"","sources":["../../../src/actions/simulateUserOperationChanges.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,WAAW,GAGZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAIvF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAQiB,KAAK,EAC7D,MAAM,EACN,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,EAClD,EAAE;IACF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,2BAA2B,CAAC,MAAM,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,uBAAuB,CAC/B,2BAA2B,EAC3B,mCAAmC,EACnC,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,WAAW,CAC1B,MAAM,MAAM,CAAC,kBAAkB,CAAC;QAC9B,GAAG,MAAM;QACT,OAAO;QACP,SAAS;KACV,CAAC,CACH,CAAC;IAEF,OAAO,MAAM,CAAC,OAAO,CAAC;QACpB,MAAM,EAAE,2CAA2C;QACnD,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC;KACpD,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import {\n AccountNotFoundError,\n IncompatibleClientError,\n deepHexlify,\n type SendUserOperationParameters,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport type { Chain, Client, Transport } from \"viem\";\nimport { isAlchemySmartAccountClient } from \"../client/isAlchemySmartAccountClient.js\";\nimport type { AlchemyRpcSchema } from \"../client/types.js\";\nimport type { SimulateUserOperationAssetChangesResponse } from \"./types.js\";\n\n/**\n * Simulates user operation changes including asset changes for a specified user operation and returns the resulting state changes.\n *\n * @example\n * ```ts\n * import { simulateUserOperationChanges, createAlchemyPublicRpcClient } from \"@account-kit/infra\";\n *\n * const client = createAlchemyPublicRpcClient(...);\n * const response = await simulateUserOperationChanges(client, {\n * uo: ...\n * });\n * ```\n *\n * @param {Client<Transport, TChain, TAccount, AlchemyRpcSchema>} client The client instance used to send the simulation request\n * @param {SendUserOperationParameters<TAccount>} args The parameters of the user operation including the account and other overrides\n * @returns {Promise<SimulateUserOperationAssetChangesResponse>} A promise that resolves to the response of the simulation showing the asset changes\n */\nexport const simulateUserOperationChanges: <\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined
|
|
1
|
+
{"version":3,"file":"simulateUserOperationChanges.js","sourceRoot":"","sources":["../../../src/actions/simulateUserOperationChanges.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,WAAW,GAGZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAIvF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAQiB,KAAK,EAC7D,MAAM,EACN,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,EAClD,EAAE;IACF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,2BAA2B,CAAC,MAAM,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,uBAAuB,CAC/B,2BAA2B,EAC3B,mCAAmC,EACnC,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,WAAW,CAC1B,MAAM,MAAM,CAAC,kBAAkB,CAAC;QAC9B,GAAG,MAAM;QACT,OAAO;QACP,SAAS;KACV,CAAC,CACH,CAAC;IAEF,OAAO,MAAM,CAAC,OAAO,CAAC;QACpB,MAAM,EAAE,2CAA2C;QACnD,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC;KACpD,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import {\n AccountNotFoundError,\n IncompatibleClientError,\n deepHexlify,\n type SendUserOperationParameters,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport type { Chain, Client, Transport } from \"viem\";\nimport { isAlchemySmartAccountClient } from \"../client/isAlchemySmartAccountClient.js\";\nimport type { AlchemyRpcSchema } from \"../client/types.js\";\nimport type { SimulateUserOperationAssetChangesResponse } from \"./types.js\";\n\n/**\n * Simulates user operation changes including asset changes for a specified user operation and returns the resulting state changes.\n *\n * @example\n * ```ts\n * import { simulateUserOperationChanges, createAlchemyPublicRpcClient } from \"@account-kit/infra\";\n *\n * const client = createAlchemyPublicRpcClient(...);\n * const response = await simulateUserOperationChanges(client, {\n * uo: ...\n * });\n * ```\n *\n * @param {Client<Transport, TChain, TAccount, AlchemyRpcSchema>} client The client instance used to send the simulation request\n * @param {SendUserOperationParameters<TAccount>} args The parameters of the user operation including the account and other overrides\n * @returns {Promise<SimulateUserOperationAssetChangesResponse>} A promise that resolves to the response of the simulation showing the asset changes\n */\nexport const simulateUserOperationChanges: <\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n>(\n client: Client<Transport, TChain, TAccount, AlchemyRpcSchema>,\n args: SendUserOperationParameters<TAccount>,\n) => Promise<SimulateUserOperationAssetChangesResponse> = async (\n client,\n { account = client.account, overrides, ...params },\n) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isAlchemySmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"AlchemySmartAccountClient\",\n \"SimulateUserOperationAssetChanges\",\n client,\n );\n }\n\n const uoStruct = deepHexlify(\n await client.buildUserOperation({\n ...params,\n account,\n overrides,\n }),\n );\n\n return client.request({\n method: \"alchemy_simulateUserOperationAssetChanges\",\n params: [uoStruct, account.getEntryPoint().address],\n });\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/actions/types.ts"],"names":[],"mappings":"AAQA,MAAM,CAAN,IAAY,iBAUX;AAVD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,oCAAe,CAAA;IACf,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB;;;OAGG;IACH,gDAA2B,CAAA;AAC7B,CAAC,EAVW,iBAAiB,KAAjB,iBAAiB,QAU5B;AAED,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,2CAAqB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B","sourcesContent":["import type {\n UserOperationStruct,\n UserOperationRequest,\n UserOperationOverrides,\n EntryPointVersion,\n} from \"@aa-sdk/core\";\nimport type { Address, Hash, Hex } from \"viem\";\n\nexport enum SimulateAssetType {\n NATIVE = \"NATIVE\",\n ERC20 = \"ERC20\",\n ERC721 = \"ERC721\",\n ERC1155 = \"ERC1155\",\n /**\n * Special contracts that don't follow ERC 721/1155. Currently limited to\n * CryptoKitties and CryptoPunks.\n */\n SPECIAL_NFT = \"SPECIAL_NFT\",\n}\n\nexport enum SimulateChangeType {\n APPROVE = \"APPROVE\",\n TRANSFER = \"TRANSFER\",\n}\n\nexport type SimulateUserOperationAssetChangesRequest = [\n UserOperationStruct,\n entryPoint: Address,\n blockNumber?: Hash
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/actions/types.ts"],"names":[],"mappings":"AAQA,MAAM,CAAN,IAAY,iBAUX;AAVD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,oCAAe,CAAA;IACf,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB;;;OAGG;IACH,gDAA2B,CAAA;AAC7B,CAAC,EAVW,iBAAiB,KAAjB,iBAAiB,QAU5B;AAED,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,2CAAqB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B","sourcesContent":["import type {\n UserOperationStruct,\n UserOperationRequest,\n UserOperationOverrides,\n EntryPointVersion,\n} from \"@aa-sdk/core\";\nimport type { Address, Hash, Hex } from \"viem\";\n\nexport enum SimulateAssetType {\n NATIVE = \"NATIVE\",\n ERC20 = \"ERC20\",\n ERC721 = \"ERC721\",\n ERC1155 = \"ERC1155\",\n /**\n * Special contracts that don't follow ERC 721/1155. Currently limited to\n * CryptoKitties and CryptoPunks.\n */\n SPECIAL_NFT = \"SPECIAL_NFT\",\n}\n\nexport enum SimulateChangeType {\n APPROVE = \"APPROVE\",\n TRANSFER = \"TRANSFER\",\n}\n\nexport type SimulateUserOperationAssetChangesRequest = [\n UserOperationStruct,\n entryPoint: Address,\n blockNumber?: Hash,\n];\n\nexport type SimulateUserOperationAssetChangesResponse = {\n changes: SimulateAssetChange[];\n error?: SimulateAssetChangesError;\n};\n\nexport interface SimulateAssetChangesError extends Record<string, any> {\n message: string;\n}\n\nexport interface SimulateAssetChange {\n assetType: SimulateAssetType;\n changeType: SimulateChangeType;\n from: Address;\n to: Address;\n rawAmount?: string;\n amount?: string;\n contactAddress: Address;\n tokenId?: string;\n decimals: number;\n symbol: string;\n name?: string;\n logo?: string;\n}\n\nexport type RequestGasAndPaymasterAndDataRequest = [\n {\n policyId: string | string[];\n entryPoint: Address;\n erc20Context?: {\n tokenAddress: Address;\n permit?: Hex;\n maxTokenAmount?: BigInt;\n };\n dummySignature: Hex;\n userOperation: UserOperationRequest;\n overrides?: UserOperationOverrides;\n },\n];\n\nexport type RequestGasAndPaymasterAndDataResponse<\n TEntryPointVersion extends EntryPointVersion = EntryPointVersion,\n> = Pick<\n UserOperationRequest,\n | \"callGasLimit\"\n | \"preVerificationGas\"\n | \"verificationGasLimit\"\n | \"maxFeePerGas\"\n | \"maxPriorityFeePerGas\"\n> &\n (TEntryPointVersion extends \"0.6.0\"\n ? {\n paymasterAndData: UserOperationRequest<\"0.6.0\">[\"paymasterAndData\"];\n }\n : TEntryPointVersion extends \"0.7.0\"\n ? Pick<\n UserOperationRequest<\"0.7.0\">,\n | \"paymaster\"\n | \"paymasterData\"\n | \"paymasterVerificationGasLimit\"\n | \"paymasterPostOpGasLimit\"\n >\n : never);\n"]}
|
|
@@ -78,7 +78,7 @@ export function isAlchemyTransport(transport, chain) {
|
|
|
78
78
|
* @returns {AlchemyTransport} The configured Alchemy transport object.
|
|
79
79
|
*/
|
|
80
80
|
export function alchemy(config) {
|
|
81
|
-
const { retryDelay, retryCount
|
|
81
|
+
const { retryDelay, retryCount } = config;
|
|
82
82
|
// we create a copy here in case we create a split transport down below
|
|
83
83
|
// we don't want to add alchemy headers to 3rd party nodes
|
|
84
84
|
const fetchOptions = { ...config.fetchOptions };
|
|
@@ -106,7 +106,7 @@ export function alchemy(config) {
|
|
|
106
106
|
: connectionConfig.rpcUrl;
|
|
107
107
|
const chainAgnosticRpcUrl = connectionConfig.rpcUrl == null
|
|
108
108
|
? "https://api.g.alchemy.com/v2/"
|
|
109
|
-
: connectionConfig.chainAgnosticUrl ?? connectionConfig.rpcUrl;
|
|
109
|
+
: (connectionConfig.chainAgnosticUrl ?? connectionConfig.rpcUrl);
|
|
110
110
|
const innerTransport = (() => {
|
|
111
111
|
mutateRemoveTrackingHeaders(config?.fetchOptions?.headers);
|
|
112
112
|
if (config.alchemyConnection && config.nodeRpcUrl) {
|
|
@@ -114,22 +114,15 @@ export function alchemy(config) {
|
|
|
114
114
|
overrides: [
|
|
115
115
|
{
|
|
116
116
|
methods: alchemyMethods,
|
|
117
|
-
transport: http(rpcUrl, {
|
|
118
|
-
fetchOptions,
|
|
119
|
-
retryCount: 0,
|
|
120
|
-
}),
|
|
117
|
+
transport: http(rpcUrl, { fetchOptions }),
|
|
121
118
|
},
|
|
122
119
|
{
|
|
123
120
|
methods: chainAgnosticMethods,
|
|
124
|
-
transport: http(chainAgnosticRpcUrl, {
|
|
125
|
-
fetchOptions,
|
|
126
|
-
retryCount: 0,
|
|
127
|
-
}),
|
|
121
|
+
transport: http(chainAgnosticRpcUrl, { fetchOptions }),
|
|
128
122
|
},
|
|
129
123
|
],
|
|
130
124
|
fallback: http(config.nodeRpcUrl, {
|
|
131
125
|
fetchOptions: config.fetchOptions,
|
|
132
|
-
retryCount: 0,
|
|
133
126
|
}),
|
|
134
127
|
});
|
|
135
128
|
}
|
|
@@ -137,13 +130,10 @@ export function alchemy(config) {
|
|
|
137
130
|
overrides: [
|
|
138
131
|
{
|
|
139
132
|
methods: chainAgnosticMethods,
|
|
140
|
-
transport: http(chainAgnosticRpcUrl, {
|
|
141
|
-
fetchOptions,
|
|
142
|
-
retryCount: 0,
|
|
143
|
-
}),
|
|
133
|
+
transport: http(chainAgnosticRpcUrl, { fetchOptions }),
|
|
144
134
|
},
|
|
145
135
|
],
|
|
146
|
-
fallback: http(rpcUrl, { fetchOptions
|
|
136
|
+
fallback: http(rpcUrl, { fetchOptions }),
|
|
147
137
|
});
|
|
148
138
|
})();
|
|
149
139
|
return createTransport({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alchem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ACrB,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 { mutateRemoveTrackingHeaders } from \"./alchemyTrackerHeaders.js\";\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 AlchemyConnectionConfig = ConnectionConfig;\n\ntype SplitTransportConfig = {\n alchemyConnection: AlchemyConnectionConfig;\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\nconst chainAgnosticMethods = [\n \"wallet_prepareCalls\",\n \"wallet_sendPreparedCalls\",\n \"wallet_requestAccount\",\n \"wallet_createAccount\",\n \"wallet_listAccounts\",\n \"wallet_createSession\",\n \"wallet_getCallsStatus\",\n];\n\nexport type AlchemyTransportConfig = (\n | (AlchemyConnectionConfig & Never<SplitTransportConfig>)\n | (SplitTransportConfig & Never<AlchemyConnectionConfig>)\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 = 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\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 || connectionConfig.apiKey != null) {\n fetchOptions.headers = {\n ...fetchOptions.headers,\n Authorization: `Bearer ${\n connectionConfig.jwt ?? connectionConfig.apiKey\n }`,\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]}/`\n : connectionConfig.rpcUrl;\n\n const chainAgnosticRpcUrl =\n connectionConfig.rpcUrl == null\n ? \"https://api.g.alchemy.com/v2/\"\n : connectionConfig.chainAgnosticUrl ?? 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, {\n fetchOptions,\n retryCount: 0,\n }),\n },\n {\n methods: chainAgnosticMethods,\n transport: http(chainAgnosticRpcUrl, {\n fetchOptions,\n retryCount: 0,\n }),\n },\n ],\n fallback: http(config.nodeRpcUrl, {\n fetchOptions: config.fetchOptions,\n retryCount: 0,\n }),\n });\n }\n\n return split({\n overrides: [\n {\n methods: chainAgnosticMethods,\n transport: http(chainAgnosticRpcUrl, {\n fetchOptions,\n retryCount: 0,\n }),\n },\n ],\n fallback: http(rpcUrl, { fetchOptions, retryCount: 0 }),\n });\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"]}
|
|
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;AACd,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAEzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAevC,MAAM,cAAc,GAAG;IACrB,uBAAuB;IACvB,8BAA8B;IAC9B,6BAA6B;IAC7B,4BAA4B;IAC5B,0BAA0B;IAC1B,8BAA8B;IAC9B,qBAAqB;IACrB,yBAAyB;IACzB,uCAAuC;CACxC,CAAC;AAEF,MAAM,oBAAoB,GAAG;IAC3B,qBAAqB;IACrB,0BAA0B;IAC1B,uBAAuB;IACvB,sBAAsB;IACtB,qBAAqB;IACrB,sBAAsB;IACtB,uBAAuB;CACxB,CAAC;AA4BF;;;;;;;;GAQ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AAO,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 { mutateRemoveTrackingHeaders } from \"./alchemyTrackerHeaders.js\";\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 AlchemyConnectionConfig = ConnectionConfig;\n\ntype SplitTransportConfig = {\n alchemyConnection: AlchemyConnectionConfig;\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\nconst chainAgnosticMethods = [\n \"wallet_prepareCalls\",\n \"wallet_sendPreparedCalls\",\n \"wallet_requestAccount\",\n \"wallet_createAccount\",\n \"wallet_listAccounts\",\n \"wallet_createSession\",\n \"wallet_getCallsStatus\",\n];\n\nexport type AlchemyTransportConfig = (\n | (AlchemyConnectionConfig & Never<SplitTransportConfig>)\n | (SplitTransportConfig & Never<AlchemyConnectionConfig>)\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 || connectionConfig.apiKey != null) {\n fetchOptions.headers = {\n ...fetchOptions.headers,\n Authorization: `Bearer ${\n connectionConfig.jwt ?? connectionConfig.apiKey\n }`,\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]}/`\n : connectionConfig.rpcUrl;\n\n const chainAgnosticRpcUrl =\n connectionConfig.rpcUrl == null\n ? \"https://api.g.alchemy.com/v2/\"\n : (connectionConfig.chainAgnosticUrl ?? 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 methods: chainAgnosticMethods,\n transport: http(chainAgnosticRpcUrl, { fetchOptions }),\n },\n ],\n fallback: http(config.nodeRpcUrl, {\n fetchOptions: config.fetchOptions,\n }),\n });\n }\n\n return split({\n overrides: [\n {\n methods: chainAgnosticMethods,\n transport: http(chainAgnosticRpcUrl, { fetchOptions }),\n },\n ],\n fallback: http(rpcUrl, { fetchOptions }),\n });\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(\n (acc, header) => {\n acc[header[0]] = header[1];\n return acc;\n },\n {} as Record<string, string>,\n );\n }\n\n return headers;\n};\n"]}
|
package/dist/esm/chains.d.ts
CHANGED
|
@@ -66,3 +66,6 @@ export declare const gensynTestnet: Chain;
|
|
|
66
66
|
export declare const riseTestnet: Chain;
|
|
67
67
|
export declare const storyMainnet: Chain;
|
|
68
68
|
export declare const storyAeneid: Chain;
|
|
69
|
+
export declare const celoAlfajores: Chain;
|
|
70
|
+
export declare const celoMainnet: Chain;
|
|
71
|
+
export declare const teaSepolia: Chain;
|
package/dist/esm/chains.js
CHANGED
|
@@ -575,4 +575,73 @@ export const storyAeneid = defineChain({
|
|
|
575
575
|
},
|
|
576
576
|
testnet: true,
|
|
577
577
|
});
|
|
578
|
+
export const celoAlfajores = defineChain({
|
|
579
|
+
id: 44787,
|
|
580
|
+
name: "Celo Alfajores",
|
|
581
|
+
nativeCurrency: { name: "Celo native asset", symbol: "CELO", decimals: 18 },
|
|
582
|
+
rpcUrls: {
|
|
583
|
+
default: {
|
|
584
|
+
http: ["https://celo-alfajores.g.alchemy.com/v2"],
|
|
585
|
+
},
|
|
586
|
+
public: {
|
|
587
|
+
http: ["https://celo-alfajores.g.alchemy.com/v2"],
|
|
588
|
+
},
|
|
589
|
+
alchemy: {
|
|
590
|
+
http: ["https://celo-alfajores.g.alchemy.com/v2"],
|
|
591
|
+
},
|
|
592
|
+
},
|
|
593
|
+
blockExplorers: {
|
|
594
|
+
default: {
|
|
595
|
+
name: "Block Explorer",
|
|
596
|
+
url: "https://celo-alfajores.blockscout.com/",
|
|
597
|
+
},
|
|
598
|
+
},
|
|
599
|
+
testnet: true,
|
|
600
|
+
});
|
|
601
|
+
export const celoMainnet = defineChain({
|
|
602
|
+
id: 42220,
|
|
603
|
+
name: "Celo Mainnet",
|
|
604
|
+
nativeCurrency: { name: "Celo native asset", symbol: "CELO", decimals: 18 },
|
|
605
|
+
rpcUrls: {
|
|
606
|
+
default: {
|
|
607
|
+
http: ["https://celo-mainnet.g.alchemy.com/v2"],
|
|
608
|
+
},
|
|
609
|
+
public: {
|
|
610
|
+
http: ["https://celo-mainnet.g.alchemy.com/v2"],
|
|
611
|
+
},
|
|
612
|
+
alchemy: {
|
|
613
|
+
http: ["https://celo-mainnet.g.alchemy.com/v2"],
|
|
614
|
+
},
|
|
615
|
+
},
|
|
616
|
+
blockExplorers: {
|
|
617
|
+
default: {
|
|
618
|
+
name: "Block Explorer",
|
|
619
|
+
url: "https://celo.blockscout.com/",
|
|
620
|
+
},
|
|
621
|
+
},
|
|
622
|
+
testnet: false,
|
|
623
|
+
});
|
|
624
|
+
export const teaSepolia = defineChain({
|
|
625
|
+
id: 10218,
|
|
626
|
+
name: "Tea Sepolia",
|
|
627
|
+
nativeCurrency: { name: "TEA", symbol: "TEA", decimals: 18 },
|
|
628
|
+
rpcUrls: {
|
|
629
|
+
default: {
|
|
630
|
+
http: ["https://tea-sepolia.g.alchemy.com/v2"],
|
|
631
|
+
},
|
|
632
|
+
public: {
|
|
633
|
+
http: ["https://tea-sepolia.g.alchemy.com/v2"],
|
|
634
|
+
},
|
|
635
|
+
alchemy: {
|
|
636
|
+
http: ["https://tea-sepolia.g.alchemy.com/v2"],
|
|
637
|
+
},
|
|
638
|
+
},
|
|
639
|
+
blockExplorers: {
|
|
640
|
+
default: {
|
|
641
|
+
name: "Block Explorer",
|
|
642
|
+
url: "https://sepolia.tea.xyz/",
|
|
643
|
+
},
|
|
644
|
+
},
|
|
645
|
+
testnet: true,
|
|
646
|
+
});
|
|
578
647
|
//# sourceMappingURL=chains.js.map
|
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;;;;;;;;;;;;;;;;;;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ACD,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,wCAAwC,CAAC;SACjD;KACF;IACD,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,gBAAgB;YACtB,GAAG,EAAE,0BAA0B;SAChC;KACF;IACD,OAAO,EAAE,KAAK;CACf,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAU,WAAW,CAAC;IAC5C,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,cAAc;IACpB,cAAc,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC1D,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,6BAA6B;SACnC;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 blockExplorers: {\n default: {\n name: \"Block Explorer\",\n url: \"https://testnet.monadexplorer.com\",\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://explorer.testnet.riselabs.xyz\",\n },\n },\n testnet: true,\n});\n\nexport const storyMainnet: Chain = defineChain({\n id: 1514,\n name: \"Story Mainnet\",\n nativeCurrency: { name: \"IP\", symbol: \"IP\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://story-mainnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://story-mainnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://story-mainnet.g.alchemy.com/v2\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Block Explorer\",\n url: \"https://www.storyscan.io\",\n },\n },\n testnet: false,\n});\n\nexport const storyAeneid: Chain = defineChain({\n id: 1315,\n name: \"Story Aeneid\",\n nativeCurrency: { name: \"IP\", symbol: \"IP\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://story-aeneid.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://story-aeneid.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://story-aeneid.g.alchemy.com/v2\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Block Explorer\",\n url: \"https://aeneid.storyscan.io\",\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,GACtB,MAAM,aAAa,CAAC;AAOrB;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EACjC,KAAK,EACL,UAAU,GAIX,EAAS,EAAE;IACV,OAAO;QACL,GAAG,KAAK;QACR,OAAO,EAAE;YACP,GAAG,KAAK,CAAC,OAAO;YAChB,OAAO,EAAE;gBACP,IAAI,EAAE,CAAC,UAAU,CAAC;aACnB;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,GAAG,GAAG;IACN,OAAO,EAAE;QACP,GAAG,GAAG,CAAC,OAAO;QACd,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,sCAAsC,CAAC;SAC/C;KACF;CACF,CAAC;AAEF,MAA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cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,gBAAgB;YACtB,GAAG,EAAE,8BAA8B;SACpC;KACF;IACD,OAAO,EAAE,KAAK;CACf,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAU,WAAW,CAAC;IAC3C,EAAE,EAAE,KAAK;IACT,IAAI,EAAE,aAAa;IACnB,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,sCAAsC,CAAC;SAC/C;QACD,MAAM,EAAE;YACN,IAAI,EAAE,CAAC,sCAAsC,CAAC;SAC/C;QACD,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,sCAAsC,CAAC;SAC/C;KACF;IACD,cAAc,EAAE;QACd,OAAO,EAAE;YACP,IAAI,EAAE,gBAAgB;YACtB,GAAG,EAAE,0BAA0B;SAChC;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 blockExplorers: {\n default: {\n name: \"Block Explorer\",\n url: \"https://testnet.monadexplorer.com\",\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://explorer.testnet.riselabs.xyz\",\n },\n },\n testnet: true,\n});\n\nexport const storyMainnet: Chain = defineChain({\n id: 1514,\n name: \"Story Mainnet\",\n nativeCurrency: { name: \"IP\", symbol: \"IP\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://story-mainnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://story-mainnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://story-mainnet.g.alchemy.com/v2\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Block Explorer\",\n url: \"https://www.storyscan.io\",\n },\n },\n testnet: false,\n});\n\nexport const storyAeneid: Chain = defineChain({\n id: 1315,\n name: \"Story Aeneid\",\n nativeCurrency: { name: \"IP\", symbol: \"IP\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://story-aeneid.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://story-aeneid.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://story-aeneid.g.alchemy.com/v2\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Block Explorer\",\n url: \"https://aeneid.storyscan.io\",\n },\n },\n testnet: true,\n});\n\nexport const celoAlfajores: Chain = defineChain({\n id: 44787,\n name: \"Celo Alfajores\",\n nativeCurrency: { name: \"Celo native asset\", symbol: \"CELO\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://celo-alfajores.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://celo-alfajores.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://celo-alfajores.g.alchemy.com/v2\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Block Explorer\",\n url: \"https://celo-alfajores.blockscout.com/\",\n },\n },\n testnet: true,\n});\n\nexport const celoMainnet: Chain = defineChain({\n id: 42220,\n name: \"Celo Mainnet\",\n nativeCurrency: { name: \"Celo native asset\", symbol: \"CELO\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://celo-mainnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://celo-mainnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://celo-mainnet.g.alchemy.com/v2\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Block Explorer\",\n url: \"https://celo.blockscout.com/\",\n },\n },\n testnet: false,\n});\n\nexport const teaSepolia: Chain = defineChain({\n id: 10218,\n name: \"Tea Sepolia\",\n nativeCurrency: { name: \"TEA\", symbol: \"TEA\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://tea-sepolia.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://tea-sepolia.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://tea-sepolia.g.alchemy.com/v2\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Block Explorer\",\n url: \"https://sepolia.tea.xyz/\",\n },\n },\n testnet: true,\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alchemyEnhancedApis.js","sourceRoot":"","sources":["../../../../src/client/decorators/alchemyEnhancedApis.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAazD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,yBAAyB,CACvC,OAAgB;IAShB,OAAO,CAAC,MAAM,EAAE,EAAE;QAChB,MAAM,UAAU,GAAG,sBAAsB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEzD,IACE,OAAO,CAAC,MAAM,CAAC,GAAG;YAClB,OAAO,CAAC,MAAM,CAAC,GAAG,KAAK,MAAM,CAAC,SAAS,CAAC,aAAa,EACrD,CAAC;YACD,MAAM,IAAI,KAAK,CACb,yEAAyE,CAC1E,CAAC;QACJ,CAAC;QAED,OAAO;YACL,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,GAAG,EAAE,UAAU,CAAC,GAAG;YACnB,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,KAAK,EAAE,UAAU,CAAC,KAAK;YACvB,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,MAAM,EAAE,UAAU,CAAC,MAAM;SAC1B,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { SmartContractAccount } from \"@aa-sdk/core\";\nimport type { Alchemy } from \"alchemy-sdk\";\nimport type { Chain } from \"viem\";\nimport { AlchemySdkClientSchema } from \"../../schema.js\";\nimport type { AlchemySmartAccountClient } from \"../smartAccountClient.js\";\n\nexport type AlchemyEnhancedApis = {\n core: Alchemy[\"core\"];\n nft: Alchemy[\"nft\"];\n transact: Alchemy[\"transact\"];\n debug: Alchemy[\"debug\"];\n ws: Alchemy[\"ws\"];\n notify: Alchemy[\"notify\"];\n config: Alchemy[\"config\"];\n};\n\n/**\n * Given an instance of the Alchemy SDK, returns a smart account client decorator which contains actions for interacting Alchemy's enhanced APIs.\n *\n * @example\n * ```ts\n * import { Alchemy } from \"alchemy-sdk\";\n * import { alchemyEnhancedApiActions } from \"@account-kit/infra\";\n * import { alchemySCAClient } from \"./client\";\n *\n * const alchemy = new Alchemy(...);\n * const enhancedApiDecorator = alchemyEnhancedApiActions(alchemy);\n * const withEnhancedApis = alchemySCAClient.extend(enhancedApiDecorator);\n * ```\n *\n * @param {Alchemy} alchemy The Alchemy instance containing the SDK client\n * @returns {(client: AlchemySmartAccountClient) => AlchemyEnhancedApis} A client decorator for Alchemy Smart Account clients that adds the enhanced API methods\n */\nexport function alchemyEnhancedApiActions(\n alchemy: Alchemy
|
|
1
|
+
{"version":3,"file":"alchemyEnhancedApis.js","sourceRoot":"","sources":["../../../../src/client/decorators/alchemyEnhancedApis.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAazD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,yBAAyB,CACvC,OAAgB;IAShB,OAAO,CAAC,MAAM,EAAE,EAAE;QAChB,MAAM,UAAU,GAAG,sBAAsB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEzD,IACE,OAAO,CAAC,MAAM,CAAC,GAAG;YAClB,OAAO,CAAC,MAAM,CAAC,GAAG,KAAK,MAAM,CAAC,SAAS,CAAC,aAAa,EACrD,CAAC;YACD,MAAM,IAAI,KAAK,CACb,yEAAyE,CAC1E,CAAC;QACJ,CAAC;QAED,OAAO;YACL,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,GAAG,EAAE,UAAU,CAAC,GAAG;YACnB,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,KAAK,EAAE,UAAU,CAAC,KAAK;YACvB,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,MAAM,EAAE,UAAU,CAAC,MAAM;SAC1B,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { SmartContractAccount } from \"@aa-sdk/core\";\nimport type { Alchemy } from \"alchemy-sdk\";\nimport type { Chain } from \"viem\";\nimport { AlchemySdkClientSchema } from \"../../schema.js\";\nimport type { AlchemySmartAccountClient } from \"../smartAccountClient.js\";\n\nexport type AlchemyEnhancedApis = {\n core: Alchemy[\"core\"];\n nft: Alchemy[\"nft\"];\n transact: Alchemy[\"transact\"];\n debug: Alchemy[\"debug\"];\n ws: Alchemy[\"ws\"];\n notify: Alchemy[\"notify\"];\n config: Alchemy[\"config\"];\n};\n\n/**\n * Given an instance of the Alchemy SDK, returns a smart account client decorator which contains actions for interacting Alchemy's enhanced APIs.\n *\n * @example\n * ```ts\n * import { Alchemy } from \"alchemy-sdk\";\n * import { alchemyEnhancedApiActions } from \"@account-kit/infra\";\n * import { alchemySCAClient } from \"./client\";\n *\n * const alchemy = new Alchemy(...);\n * const enhancedApiDecorator = alchemyEnhancedApiActions(alchemy);\n * const withEnhancedApis = alchemySCAClient.extend(enhancedApiDecorator);\n * ```\n *\n * @param {Alchemy} alchemy The Alchemy instance containing the SDK client\n * @returns {(client: AlchemySmartAccountClient) => AlchemyEnhancedApis} A client decorator for Alchemy Smart Account clients that adds the enhanced API methods\n */\nexport function alchemyEnhancedApiActions(\n alchemy: Alchemy,\n): <\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n>(\n client: AlchemySmartAccountClient<TChain, TAccount>,\n) => AlchemyEnhancedApis {\n return (client) => {\n const alchemySdk = AlchemySdkClientSchema.parse(alchemy);\n\n if (\n alchemy.config.url &&\n alchemy.config.url !== client.transport.alchemyRpcUrl\n ) {\n throw new Error(\n \"Alchemy SDK client JSON-RPC URL must match AlchemyProvider JSON-RPC URL\",\n );\n }\n\n return {\n core: alchemySdk.core,\n nft: alchemySdk.nft,\n transact: alchemySdk.transact,\n debug: alchemySdk.debug,\n ws: alchemySdk.ws,\n notify: alchemySdk.notify,\n config: alchemySdk.config,\n };\n };\n}\n"]}
|
|
@@ -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,EAQjB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAQtB,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAE7F,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
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;AAiC/C;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,cAAc,GAWyC,CAClE,OAAO,EACP,EAAE,CAAC,CAAC;IACJ,qBAAqB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACpC,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,EAAE,uBAAuB,CAAC,CAAC;QACnE,OAAO,4BAA4B,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;IACD,KAAK,CAAC,iBAAiB,CAAC,IAAI;QAC1B,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,CAAC,CAAC;QACpE,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;QAE1C,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC/C,cAAc,CAAC,MAAM,CAAC,KAAM,CAAC,EAAE,EAAE,OAAQ,CAAC,CAAC;QAC3C,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,eAAe,EA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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\n 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isAlchemySmartAccountClient.js","sourceRoot":"","sources":["../../../src/client/isAlchemySmartAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,MAAM,cAAc,CAAC;AAIzD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,2BAA2B,CAMzC,MAA2C;IAE3C,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC;AAC7C,CAAC","sourcesContent":["import { type SmartContractAccount } from \"@aa-sdk/core\";\nimport type { Chain, Client, Transport } from \"viem\";\nimport type { AlchemySmartAccountClient } from \"./smartAccountClient\";\n\n/**\n * Checks if a given client is an Alchemy Smart Account Client. The goal of this check is to ensure that the client supports certain RPC methods.\n *\n * @example\n * ```ts\n * import { isAlchemySmartAccountClient } from \"@account-kit/infra\";\n *\n * if (isAlchemySmartAccountClient(client)) {\n * // do things with the client as an Alchemy Smart Account Client\n * }\n * ```\n *\n * @param {Client<TTransport, TChain, TAccount>} client The client instance to be checked\n * @returns {boolean} `true` if the client is an Alchemy Smart Account Client, otherwise `false`\n */\nexport function isAlchemySmartAccountClient<\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined
|
|
1
|
+
{"version":3,"file":"isAlchemySmartAccountClient.js","sourceRoot":"","sources":["../../../src/client/isAlchemySmartAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,MAAM,cAAc,CAAC;AAIzD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,2BAA2B,CAMzC,MAA2C;IAE3C,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC;AAC7C,CAAC","sourcesContent":["import { type SmartContractAccount } from \"@aa-sdk/core\";\nimport type { Chain, Client, Transport } from \"viem\";\nimport type { AlchemySmartAccountClient } from \"./smartAccountClient\";\n\n/**\n * Checks if a given client is an Alchemy Smart Account Client. The goal of this check is to ensure that the client supports certain RPC methods.\n *\n * @example\n * ```ts\n * import { isAlchemySmartAccountClient } from \"@account-kit/infra\";\n *\n * if (isAlchemySmartAccountClient(client)) {\n * // do things with the client as an Alchemy Smart Account Client\n * }\n * ```\n *\n * @param {Client<TTransport, TChain, TAccount>} client The client instance to be checked\n * @returns {boolean} `true` if the client is an Alchemy Smart Account Client, otherwise `false`\n */\nexport function isAlchemySmartAccountClient<\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n>(\n client: Client<Transport, TChain, TAccount>,\n): client is AlchemySmartAccountClient<TChain, TAccount> {\n return client.transport.type === \"alchemy\";\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
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,EAA4B,MAAM,MAAM,CAAC;AAChD,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;AAwFD;;;;;;;;;;;;;;;;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,CAAC,CAAC;IAE7E,MAAM,SAAS,GAAG,wBAAwB,CAAC;QACzC,OAAO,EAAE,MAAM,CAAC,OAAO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B,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 Address, 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
|
|
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,EAA4B,MAAM,MAAM,CAAC;AAChD,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;AAwFD;;;;;;;;;;;;;;;;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,CAAC,CAAC;IAE7E,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SAAS,GAAG,MAAM,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 Address, 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 policyToken?: {\n address: Address;\n maxTokenAmount: bigint;\n approvalMode?: \"NONE\" | \"PERMIT\";\n erc20Name?: string;\n version?: string;\n };\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 policyToken: config.policyToken,\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/client/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,MAAM,cAAc,CAAC","sourcesContent":["import {\n type BundlerClient,\n type Erc7677RpcSchema,\n type UserOperationRequest,\n} from \"@aa-sdk/core\";\nimport type {\n SimulateUserOperationAssetChangesRequest,\n SimulateUserOperationAssetChangesResponse,\n RequestGasAndPaymasterAndDataRequest,\n RequestGasAndPaymasterAndDataResponse,\n} from \"../actions/types\";\nimport type { AlchemyTransport } from \"../alchemyTransport\";\n\nexport type AlchemyRpcSchema = [\n {\n Method: \"alchemy_simulateUserOperationAssetChanges\";\n Parameters: SimulateUserOperationAssetChangesRequest;\n ReturnType: SimulateUserOperationAssetChangesResponse;\n },\n {\n Method: \"rundler_maxPriorityFeePerGas\";\n Parameters: [];\n ReturnType: UserOperationRequest[\"maxPriorityFeePerGas\"];\n },\n ...Erc7677RpcSchema<{ policyId: string }>,\n {\n Method: \"alchemy_requestGasAndPaymasterAndData\";\n Parameters: RequestGasAndPaymasterAndDataRequest;\n ReturnType: RequestGasAndPaymasterAndDataResponse;\n }
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/client/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,MAAM,cAAc,CAAC","sourcesContent":["import {\n type BundlerClient,\n type Erc7677RpcSchema,\n type UserOperationRequest,\n} from \"@aa-sdk/core\";\nimport type {\n SimulateUserOperationAssetChangesRequest,\n SimulateUserOperationAssetChangesResponse,\n RequestGasAndPaymasterAndDataRequest,\n RequestGasAndPaymasterAndDataResponse,\n} from \"../actions/types\";\nimport type { AlchemyTransport } from \"../alchemyTransport\";\n\nexport type AlchemyRpcSchema = [\n {\n Method: \"alchemy_simulateUserOperationAssetChanges\";\n Parameters: SimulateUserOperationAssetChangesRequest;\n ReturnType: SimulateUserOperationAssetChangesResponse;\n },\n {\n Method: \"rundler_maxPriorityFeePerGas\";\n Parameters: [];\n ReturnType: UserOperationRequest[\"maxPriorityFeePerGas\"];\n },\n ...Erc7677RpcSchema<{ policyId: string }>,\n {\n Method: \"alchemy_requestGasAndPaymasterAndData\";\n Parameters: RequestGasAndPaymasterAndDataRequest;\n ReturnType: RequestGasAndPaymasterAndDataResponse;\n },\n];\n\nexport type ClientWithAlchemyMethods = BundlerClient<AlchemyTransport> & {\n request: BundlerClient<AlchemyTransport>[\"request\"] &\n {\n request(args: {\n method: \"alchemy_simulateUserOperationAssetChanges\";\n params: SimulateUserOperationAssetChangesRequest;\n }): Promise<SimulateUserOperationAssetChangesResponse>;\n\n request(args: {\n method: \"rundler_maxPriorityFeePerGas\";\n params: [];\n }): Promise<UserOperationRequest[\"maxPriorityFeePerGas\"]>;\n\n request(args: {\n method: \"alchemy_requestGasAndPaymasterAndData\";\n params: RequestGasAndPaymasterAndDataRequest;\n }): Promise<RequestGasAndPaymasterAndDataResponse>;\n }[\"request\"];\n};\n"]}
|
package/dist/esm/defaults.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,MAAM,cAAc,CAAC;AAE5D,OAAO,EACL,QAAQ,EACR,cAAc,EACd,eAAe,EACf,QAAQ,EACR,cAAc,EACd,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAC/C,KAAY,EACa,EAAE;IAC3B,MAAM,UAAU,GAA4B;QAC1C,YAAY,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE;QACjC,oBAAoB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;KAC3C,CAAC;IAEF,IACE,IAAI,GAAG,CAAS;QACd,QAAQ,CAAC,EAAE;QACX,cAAc,CAAC,EAAE;QACjB,eAAe,CAAC,EAAE;QAClB,QAAQ,CAAC,EAAE;QACX,cAAc,CAAC,EAAE;QACjB,eAAe,CAAC,EAAE;KACnB,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,EAChB,CAAC;QACD,UAAU,CAAC,kBAAkB,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IACvD,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC","sourcesContent":["import { type UserOperationFeeOptions } from \"@aa-sdk/core\";\nimport type { Chain } from \"viem\";\nimport {\n arbitrum,\n arbitrumGoerli,\n arbitrumSepolia,\n optimism,\n optimismGoerli,\n optimismSepolia,\n} from \"./chains.js\";\n\n/**\n * Retrieves the default user operation fee options for a given chain. Adjusts fees for specific chains like Arbitrum and Optimism.\n *\n * @example\n * ```ts\n * import { getDefaultUserOperationFeeOptions } from \"@account-kit/infra\";\n * import { arbitrum } from \"@account-kit/infra\";\n *\n * const feeOpts = getDefaultUserOperationFeeOptions(arbitrum);\n * ```\n *\n * @param {Chain} chain The blockchain chain for which to get the fee options\n * @returns {UserOperationFeeOptions} An object containing the default fee options for user operations on the specified chain\n */\nexport const getDefaultUserOperationFeeOptions = (\n chain: Chain
|
|
1
|
+
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,MAAM,cAAc,CAAC;AAE5D,OAAO,EACL,QAAQ,EACR,cAAc,EACd,eAAe,EACf,QAAQ,EACR,cAAc,EACd,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAC/C,KAAY,EACa,EAAE;IAC3B,MAAM,UAAU,GAA4B;QAC1C,YAAY,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE;QACjC,oBAAoB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;KAC3C,CAAC;IAEF,IACE,IAAI,GAAG,CAAS;QACd,QAAQ,CAAC,EAAE;QACX,cAAc,CAAC,EAAE;QACjB,eAAe,CAAC,EAAE;QAClB,QAAQ,CAAC,EAAE;QACX,cAAc,CAAC,EAAE;QACjB,eAAe,CAAC,EAAE;KACnB,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,EAChB,CAAC;QACD,UAAU,CAAC,kBAAkB,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IACvD,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC","sourcesContent":["import { type UserOperationFeeOptions } from \"@aa-sdk/core\";\nimport type { Chain } from \"viem\";\nimport {\n arbitrum,\n arbitrumGoerli,\n arbitrumSepolia,\n optimism,\n optimismGoerli,\n optimismSepolia,\n} from \"./chains.js\";\n\n/**\n * Retrieves the default user operation fee options for a given chain. Adjusts fees for specific chains like Arbitrum and Optimism.\n *\n * @example\n * ```ts\n * import { getDefaultUserOperationFeeOptions } from \"@account-kit/infra\";\n * import { arbitrum } from \"@account-kit/infra\";\n *\n * const feeOpts = getDefaultUserOperationFeeOptions(arbitrum);\n * ```\n *\n * @param {Chain} chain The blockchain chain for which to get the fee options\n * @returns {UserOperationFeeOptions} An object containing the default fee options for user operations on the specified chain\n */\nexport const getDefaultUserOperationFeeOptions = (\n chain: Chain,\n): UserOperationFeeOptions => {\n const feeOptions: UserOperationFeeOptions = {\n maxFeePerGas: { multiplier: 1.5 },\n maxPriorityFeePerGas: { multiplier: 1.05 },\n };\n\n if (\n new Set<number>([\n arbitrum.id,\n arbitrumGoerli.id,\n arbitrumSepolia.id,\n optimism.id,\n optimismGoerli.id,\n optimismSepolia.id,\n ]).has(chain.id)\n ) {\n feeOptions.preVerificationGas = { multiplier: 1.05 };\n }\n\n return feeOptions;\n};\n"]}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type * from "./actions/types.js";
|
|
|
4
4
|
export type * from "./alchemyTransport.js";
|
|
5
5
|
export { alchemy, isAlchemyTransport } from "./alchemyTransport.js";
|
|
6
6
|
export type * from "./chains.js";
|
|
7
|
-
export { arbitrum, arbitrumGoerli, arbitrumNova, arbitrumSepolia, base, baseGoerli, baseSepolia, defineAlchemyChain, fraxtal, fraxtalSepolia, goerli, mainnet, optimism, optimismGoerli, optimismSepolia, polygon, polygonAmoy, polygonMumbai, sepolia, shape, shapeSepolia, worldChain, worldChainSepolia, zora, zoraSepolia, beraChainBartio, opbnbMainnet, opbnbTestnet, soneiumMinato, soneiumMainnet, unichainMainnet, unichainSepolia, inkMainnet, inkSepolia, mekong, monadTestnet, openlootSepolia, gensynTestnet, riseTestnet, storyMainnet, storyAeneid, } from "./chains.js";
|
|
7
|
+
export { arbitrum, arbitrumGoerli, arbitrumNova, arbitrumSepolia, base, baseGoerli, baseSepolia, defineAlchemyChain, fraxtal, fraxtalSepolia, goerli, mainnet, optimism, optimismGoerli, optimismSepolia, polygon, polygonAmoy, polygonMumbai, sepolia, shape, shapeSepolia, worldChain, worldChainSepolia, zora, zoraSepolia, beraChainBartio, opbnbMainnet, opbnbTestnet, soneiumMinato, soneiumMainnet, unichainMainnet, unichainSepolia, inkMainnet, inkSepolia, mekong, monadTestnet, openlootSepolia, gensynTestnet, riseTestnet, storyMainnet, storyAeneid, celoAlfajores, celoMainnet, teaSepolia, } from "./chains.js";
|
|
8
8
|
export type * from "./client/decorators/alchemyEnhancedApis.js";
|
|
9
9
|
export { alchemyEnhancedApiActions } from "./client/decorators/alchemyEnhancedApis.js";
|
|
10
10
|
export type * from "./client/decorators/smartAccount.js";
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { simulateUserOperationChanges } from "./actions/simulateUserOperationChanges.js";
|
|
2
2
|
export { alchemy, isAlchemyTransport } from "./alchemyTransport.js";
|
|
3
|
-
export { arbitrum, arbitrumGoerli, arbitrumNova, arbitrumSepolia, base, baseGoerli, baseSepolia, defineAlchemyChain, fraxtal, fraxtalSepolia, goerli, mainnet, optimism, optimismGoerli, optimismSepolia, polygon, polygonAmoy, polygonMumbai, sepolia, shape, shapeSepolia, worldChain, worldChainSepolia, zora, zoraSepolia, beraChainBartio, opbnbMainnet, opbnbTestnet, soneiumMinato, soneiumMainnet, unichainMainnet, unichainSepolia, inkMainnet, inkSepolia, mekong, monadTestnet, openlootSepolia, gensynTestnet, riseTestnet, storyMainnet, storyAeneid, } from "./chains.js";
|
|
3
|
+
export { arbitrum, arbitrumGoerli, arbitrumNova, arbitrumSepolia, base, baseGoerli, baseSepolia, defineAlchemyChain, fraxtal, fraxtalSepolia, goerli, mainnet, optimism, optimismGoerli, optimismSepolia, polygon, polygonAmoy, polygonMumbai, sepolia, shape, shapeSepolia, worldChain, worldChainSepolia, zora, zoraSepolia, beraChainBartio, opbnbMainnet, opbnbTestnet, soneiumMinato, soneiumMainnet, unichainMainnet, unichainSepolia, inkMainnet, inkSepolia, mekong, monadTestnet, openlootSepolia, gensynTestnet, riseTestnet, storyMainnet, storyAeneid, celoAlfajores, celoMainnet, teaSepolia, } from "./chains.js";
|
|
4
4
|
export { alchemyEnhancedApiActions } from "./client/decorators/alchemyEnhancedApis.js";
|
|
5
5
|
export { alchemyActions } from "./client/decorators/smartAccount.js";
|
|
6
6
|
export { isAlchemySmartAccountClient } from "./client/isAlchemySmartAccountClient.js";
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AAGzF,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,EACL,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,eAAe,EACf,IAAI,EACJ,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,cAAc,EACd,MAAM,EACN,OAAO,EACP,QAAQ,EACR,cAAc,EACd,eAAe,EACf,OAAO,EACP,WAAW,EACX,aAAa,EACb,OAAO,EACP,KAAK,EACL,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,IAAI,EACJ,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,cAAc,EACd,eAAe,EACf,eAAe,EACf,UAAU,EACV,UAAU,EACV,MAAM,EACN,YAAY,EACZ,eAAe,EACf,aAAa,EACb,WAAW,EACX,YAAY,EACZ,WAAW,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AAGzF,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,EACL,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,eAAe,EACf,IAAI,EACJ,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,cAAc,EACd,MAAM,EACN,OAAO,EACP,QAAQ,EACR,cAAc,EACd,eAAe,EACf,OAAO,EACP,WAAW,EACX,aAAa,EACb,OAAO,EACP,KAAK,EACL,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,IAAI,EACJ,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,cAAc,EACd,eAAe,EACf,eAAe,EACf,UAAU,EACV,UAAU,EACV,MAAM,EACN,YAAY,EACZ,eAAe,EACf,aAAa,EACb,WAAW,EACX,YAAY,EACZ,WAAW,EACX,aAAa,EACb,WAAW,EACX,UAAU,GACX,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAEvF,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAEtF,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAEjF,OAAO,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EACL,2BAA2B,EAC3B,uCAAuC,GACxC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC","sourcesContent":["export type * from \"./actions/simulateUserOperationChanges.js\";\nexport { simulateUserOperationChanges } from \"./actions/simulateUserOperationChanges.js\";\nexport type * from \"./actions/types.js\";\nexport type * from \"./alchemyTransport.js\";\nexport { alchemy, isAlchemyTransport } from \"./alchemyTransport.js\";\nexport type * from \"./chains.js\";\nexport {\n arbitrum,\n arbitrumGoerli,\n arbitrumNova,\n arbitrumSepolia,\n base,\n baseGoerli,\n baseSepolia,\n defineAlchemyChain,\n fraxtal,\n fraxtalSepolia,\n goerli,\n mainnet,\n optimism,\n optimismGoerli,\n optimismSepolia,\n polygon,\n polygonAmoy,\n polygonMumbai,\n sepolia,\n shape,\n shapeSepolia,\n worldChain,\n worldChainSepolia,\n zora,\n zoraSepolia,\n beraChainBartio,\n opbnbMainnet,\n opbnbTestnet,\n soneiumMinato,\n soneiumMainnet,\n unichainMainnet,\n unichainSepolia,\n inkMainnet,\n inkSepolia,\n mekong,\n monadTestnet,\n openlootSepolia,\n gensynTestnet,\n riseTestnet,\n storyMainnet,\n storyAeneid,\n celoAlfajores,\n celoMainnet,\n teaSepolia,\n} from \"./chains.js\";\nexport type * from \"./client/decorators/alchemyEnhancedApis.js\";\nexport { alchemyEnhancedApiActions } from \"./client/decorators/alchemyEnhancedApis.js\";\nexport type * from \"./client/decorators/smartAccount.js\";\nexport { alchemyActions } from \"./client/decorators/smartAccount.js\";\nexport { isAlchemySmartAccountClient } from \"./client/isAlchemySmartAccountClient.js\";\nexport type * from \"./client/rpcClient.js\";\nexport { createAlchemyPublicRpcClient } from \"./client/rpcClient.js\";\nexport type * from \"./client/smartAccountClient.js\";\nexport { createAlchemySmartAccountClient } from \"./client/smartAccountClient.js\";\nexport type * from \"./client/types.js\";\nexport { getDefaultUserOperationFeeOptions } from \"./defaults.js\";\nexport { getAlchemyPaymasterAddress } from \"./gas-manager.js\";\nexport { alchemyFeeEstimator } from \"./middleware/feeEstimator.js\";\nexport type * from \"./middleware/gasManager.js\";\nexport * from \"./alchemyTrackerHeaders.js\";\nexport {\n alchemyGasManagerMiddleware,\n alchemyGasAndPaymasterAndDataMiddleware,\n} from \"./middleware/gasManager.js\";\nexport { alchemyUserOperationSimulator } from \"./middleware/userOperationSimulator.js\";\nexport type * from \"./schema.js\";\n"]}
|
package/dist/esm/metrics.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAavC,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAoB;IACzD,OAAO,EAAE,oBAAoB;IAC7B,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC","sourcesContent":["import { createLogger } from \"@account-kit/logging\";\nimport type { Address } from \"viem\";\nimport { VERSION } from \"./version.js\";\n\nexport type InfraEventsSchema = [\n {\n EventName: \"client_send_uo\";\n EventData: {\n signerType: string;\n chainId: number;\n entryPoint: Address;\n };\n }
|
|
1
|
+
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAavC,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAoB;IACzD,OAAO,EAAE,oBAAoB;IAC7B,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC","sourcesContent":["import { createLogger } from \"@account-kit/logging\";\nimport type { Address } from \"viem\";\nimport { VERSION } from \"./version.js\";\n\nexport type InfraEventsSchema = [\n {\n EventName: \"client_send_uo\";\n EventData: {\n signerType: string;\n chainId: number;\n entryPoint: Address;\n };\n },\n];\n\nexport const InfraLogger = createLogger<InfraEventsSchema>({\n package: \"@account-kit/infra\",\n version: VERSION,\n});\n"]}
|