@account-kit/infra 4.0.0-alpha.9 → 4.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/actions/simulateUserOperationChanges.d.ts +17 -0
- package/dist/esm/actions/simulateUserOperationChanges.js +17 -0
- package/dist/esm/actions/simulateUserOperationChanges.js.map +1 -1
- package/dist/esm/actions/types.d.ts +4 -0
- package/dist/esm/actions/types.js +4 -0
- package/dist/esm/actions/types.js.map +1 -1
- package/dist/esm/chains.d.ts +22 -0
- package/dist/esm/chains.js +60 -1
- package/dist/esm/chains.js.map +1 -1
- package/dist/esm/client/decorators/alchemyEnhancedApis.d.ts +18 -5393
- package/dist/esm/client/decorators/alchemyEnhancedApis.js +37 -18
- package/dist/esm/client/decorators/alchemyEnhancedApis.js.map +1 -1
- package/dist/esm/client/decorators/smartAccount.d.ts +15 -0
- package/dist/esm/client/decorators/smartAccount.js +15 -0
- package/dist/esm/client/decorators/smartAccount.js.map +1 -1
- package/dist/esm/client/internal/smartAccountClientFromRpc.d.ts +7 -0
- package/dist/esm/client/internal/smartAccountClientFromRpc.js +17 -0
- package/dist/esm/client/internal/smartAccountClientFromRpc.js.map +1 -1
- package/dist/esm/client/isAlchemySmartAccountClient.d.ts +17 -5393
- package/dist/esm/client/isAlchemySmartAccountClient.js +21 -2
- package/dist/esm/client/isAlchemySmartAccountClient.js.map +1 -1
- package/dist/esm/client/rpcClient.d.ts +22 -0
- package/dist/esm/client/rpcClient.js +22 -0
- package/dist/esm/client/rpcClient.js.map +1 -1
- package/dist/esm/client/smartAccountClient.js +17 -0
- package/dist/esm/client/smartAccountClient.js.map +1 -1
- package/dist/esm/defaults.d.ts +14 -0
- package/dist/esm/defaults.js +14 -0
- package/dist/esm/defaults.js.map +1 -1
- package/dist/esm/errors/base.js +1 -0
- package/dist/esm/errors/base.js.map +1 -1
- package/dist/esm/gas-manager.d.ts +13 -0
- package/dist/esm/gas-manager.js +13 -0
- package/dist/esm/gas-manager.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/middleware/feeEstimator.d.ts +19 -0
- package/dist/esm/middleware/feeEstimator.js +20 -0
- package/dist/esm/middleware/feeEstimator.js.map +1 -1
- package/dist/esm/middleware/gasManager.d.ts +19 -0
- package/dist/esm/middleware/gasManager.js +19 -0
- package/dist/esm/middleware/gasManager.js.map +1 -1
- package/dist/esm/middleware/userOperationSimulator.d.ts +19 -0
- package/dist/esm/middleware/userOperationSimulator.js +19 -0
- package/dist/esm/middleware/userOperationSimulator.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +3 -1
- package/dist/esm/version.js.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/alchemyEnhancedApis.d.ts +1 -5393
- package/dist/types/client/decorators/alchemyEnhancedApis.d.ts.map +1 -1
- package/dist/types/client/isAlchemySmartAccountClient.d.ts +2 -5393
- package/dist/types/client/isAlchemySmartAccountClient.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/dist/types/version.d.ts.map +1 -1
- package/package.json +12 -13
- package/src/chains.ts +44 -0
- package/src/client/decorators/alchemyEnhancedApis.ts +13 -11
- package/src/client/isAlchemySmartAccountClient.ts +3 -3
- package/src/index.ts +3 -0
- package/src/version.ts +1 -1
- package/dist/cjs/actions/simulateUserOperationChanges.d.ts +0 -5
- package/dist/cjs/actions/simulateUserOperationChanges.js +0 -24
- package/dist/cjs/actions/simulateUserOperationChanges.js.map +0 -1
- package/dist/cjs/actions/types.d.ts +0 -39
- package/dist/cjs/actions/types.js +0 -17
- package/dist/cjs/actions/types.js.map +0 -1
- package/dist/cjs/chains.d.ts +0 -30
- package/dist/cjs/chains.js +0 -215
- package/dist/cjs/chains.js.map +0 -1
- package/dist/cjs/client/decorators/alchemyEnhancedApis.d.ts +0 -5406
- package/dist/cjs/client/decorators/alchemyEnhancedApis.js +0 -26
- package/dist/cjs/client/decorators/alchemyEnhancedApis.js.map +0 -1
- package/dist/cjs/client/decorators/smartAccount.d.ts +0 -7
- package/dist/cjs/client/decorators/smartAccount.js +0 -9
- package/dist/cjs/client/decorators/smartAccount.js.map +0 -1
- package/dist/cjs/client/internal/smartAccountClientFromRpc.d.ts +0 -11
- package/dist/cjs/client/internal/smartAccountClientFromRpc.js +0 -44
- package/dist/cjs/client/internal/smartAccountClientFromRpc.js.map +0 -1
- package/dist/cjs/client/isAlchemySmartAccountClient.d.ts +0 -5395
- package/dist/cjs/client/isAlchemySmartAccountClient.js +0 -9
- package/dist/cjs/client/isAlchemySmartAccountClient.js.map +0 -1
- package/dist/cjs/client/rpcClient.d.ts +0 -8
- package/dist/cjs/client/rpcClient.js +0 -36
- package/dist/cjs/client/rpcClient.js.map +0 -1
- package/dist/cjs/client/smartAccountClient.d.ts +0 -17
- package/dist/cjs/client/smartAccountClient.js +0 -32
- package/dist/cjs/client/smartAccountClient.js.map +0 -1
- package/dist/cjs/client/types.d.ts +0 -29
- package/dist/cjs/client/types.js +0 -3
- package/dist/cjs/client/types.js.map +0 -1
- package/dist/cjs/defaults.d.ts +0 -3
- package/dist/cjs/defaults.js +0 -23
- package/dist/cjs/defaults.js.map +0 -1
- package/dist/cjs/errors/base.d.ts +0 -4
- package/dist/cjs/errors/base.js +0 -18
- package/dist/cjs/errors/base.js.map +0 -1
- package/dist/cjs/errors/rpcUrl.d.ts +0 -10
- package/dist/cjs/errors/rpcUrl.js +0 -26
- package/dist/cjs/errors/rpcUrl.js.map +0 -1
- package/dist/cjs/gas-manager.d.ts +0 -6
- package/dist/cjs/gas-manager.js +0 -35
- package/dist/cjs/gas-manager.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -25
- package/dist/cjs/index.js +0 -53
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/middleware/feeEstimator.d.ts +0 -3
- package/dist/cjs/middleware/feeEstimator.js +0 -26
- package/dist/cjs/middleware/feeEstimator.js.map +0 -1
- package/dist/cjs/middleware/gasManager.d.ts +0 -2
- package/dist/cjs/middleware/gasManager.js +0 -11
- package/dist/cjs/middleware/gasManager.js.map +0 -1
- package/dist/cjs/middleware/userOperationSimulator.d.ts +0 -3
- package/dist/cjs/middleware/userOperationSimulator.js +0 -21
- package/dist/cjs/middleware/userOperationSimulator.js.map +0 -1
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/schema.d.ts +0 -396
- package/dist/cjs/schema.js +0 -19
- package/dist/cjs/schema.js.map +0 -1
- package/dist/cjs/type.d.ts +0 -3
- package/dist/cjs/type.js +0 -3
- package/dist/cjs/type.js.map +0 -1
- package/dist/cjs/version.d.ts +0 -1
- package/dist/cjs/version.js +0 -5
- package/dist/cjs/version.js.map +0 -1
- package/dist/esm/package.json +0 -1
|
@@ -2,4 +2,21 @@ import { type SendUserOperationParameters, type SmartContractAccount } from "@aa
|
|
|
2
2
|
import type { Chain, Client, Transport } from "viem";
|
|
3
3
|
import type { AlchemyRpcSchema } from "../client/types.js";
|
|
4
4
|
import type { SimulateUserOperationAssetChangesResponse } from "./types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Simulates user operation changes including asset changes for a specified user operation and returns the resulting state changes.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { simulateUserOperationChanges, createAlchemyPublicRpcClient } from "@account-kit/infra";
|
|
11
|
+
*
|
|
12
|
+
* const client = createAlchemyPublicRpcClient(...);
|
|
13
|
+
* const response = await simulateUserOperationChanges(client, {
|
|
14
|
+
* uo: ...
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @param {Client<Transport, TChain, TAccount, AlchemyRpcSchema>} client The client instance used to send the simulation request
|
|
19
|
+
* @param {SendUserOperationParameters<TAccount>} args The parameters of the user operation including the account and other overrides
|
|
20
|
+
* @returns {Promise<SimulateUserOperationAssetChangesResponse>} A promise that resolves to the response of the simulation showing the asset changes
|
|
21
|
+
*/
|
|
5
22
|
export declare const simulateUserOperationChanges: <TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined>(client: Client<Transport, TChain, TAccount, AlchemyRpcSchema>, args: SendUserOperationParameters<TAccount>) => Promise<SimulateUserOperationAssetChangesResponse>;
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { AccountNotFoundError, IncompatibleClientError, deepHexlify, } from "@aa-sdk/core";
|
|
2
2
|
import { isAlchemySmartAccountClient } from "../client/isAlchemySmartAccountClient.js";
|
|
3
|
+
/**
|
|
4
|
+
* Simulates user operation changes including asset changes for a specified user operation and returns the resulting state changes.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { simulateUserOperationChanges, createAlchemyPublicRpcClient } from "@account-kit/infra";
|
|
9
|
+
*
|
|
10
|
+
* const client = createAlchemyPublicRpcClient(...);
|
|
11
|
+
* const response = await simulateUserOperationChanges(client, {
|
|
12
|
+
* uo: ...
|
|
13
|
+
* });
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param {Client<Transport, TChain, TAccount, AlchemyRpcSchema>} client The client instance used to send the simulation request
|
|
17
|
+
* @param {SendUserOperationParameters<TAccount>} args The parameters of the user operation including the account and other overrides
|
|
18
|
+
* @returns {Promise<SimulateUserOperationAssetChangesResponse>} A promise that resolves to the response of the simulation showing the asset changes
|
|
19
|
+
*/
|
|
3
20
|
export const simulateUserOperationChanges = async (client, { account = client.account, overrides, ...params }) => {
|
|
4
21
|
if (!account) {
|
|
5
22
|
throw new AccountNotFoundError();
|
|
@@ -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;
|
|
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"]}
|
|
@@ -5,6 +5,10 @@ export declare enum SimulateAssetType {
|
|
|
5
5
|
ERC20 = "ERC20",
|
|
6
6
|
ERC721 = "ERC721",
|
|
7
7
|
ERC1155 = "ERC1155",
|
|
8
|
+
/**
|
|
9
|
+
* Special contracts that don't follow ERC 721/1155. Currently limited to
|
|
10
|
+
* CryptoKitties and CryptoPunks.
|
|
11
|
+
*/
|
|
8
12
|
SPECIAL_NFT = "SPECIAL_NFT"
|
|
9
13
|
}
|
|
10
14
|
export declare enum SimulateChangeType {
|
|
@@ -4,6 +4,10 @@ export var SimulateAssetType;
|
|
|
4
4
|
SimulateAssetType["ERC20"] = "ERC20";
|
|
5
5
|
SimulateAssetType["ERC721"] = "ERC721";
|
|
6
6
|
SimulateAssetType["ERC1155"] = "ERC1155";
|
|
7
|
+
/**
|
|
8
|
+
* Special contracts that don't follow ERC 721/1155. Currently limited to
|
|
9
|
+
* CryptoKitties and CryptoPunks.
|
|
10
|
+
*/
|
|
7
11
|
SimulateAssetType["SPECIAL_NFT"] = "SPECIAL_NFT";
|
|
8
12
|
})(SimulateAssetType || (SimulateAssetType = {}));
|
|
9
13
|
export var SimulateChangeType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/actions/types.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,iBAUX;AAVD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,oCAAe,CAAA;IACf,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/actions/types.ts"],"names":[],"mappings":"AAGA,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 { UserOperationStruct } from \"@aa-sdk/core\";\nimport type { Address, Hash } 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"]}
|
package/dist/esm/chains.d.ts
CHANGED
|
@@ -3,6 +3,25 @@ export type AlchemyChainConfig = {
|
|
|
3
3
|
chain: Chain;
|
|
4
4
|
rpcBaseUrl: string;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Defines an Alchemy chain configuration by adding an Alchemy-specific RPC base URL to the chain's RPC URLs.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { defineAlchemyChain } from "@account-kit/infra";
|
|
12
|
+
* import { sepolia } from "viem/chains";
|
|
13
|
+
*
|
|
14
|
+
* const chain = defineAlchemyChain({
|
|
15
|
+
* chain: sepolia,
|
|
16
|
+
* rpcBaseUrl: "https://eth-sepolia.g.alchemy.com/v2"
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @param {AlchemyChainConfig} params The parameters for defining the Alchemy chain
|
|
21
|
+
* @param {Chain} params.chain The original chain configuration
|
|
22
|
+
* @param {string} params.rpcBaseUrl The Alchemy-specific RPC base URL
|
|
23
|
+
* @returns {Chain} The updated chain configuration with the Alchemy RPC URL added
|
|
24
|
+
*/
|
|
6
25
|
export declare const defineAlchemyChain: ({ chain, rpcBaseUrl, }: {
|
|
7
26
|
chain: Chain;
|
|
8
27
|
rpcBaseUrl: string;
|
|
@@ -28,3 +47,6 @@ export declare const zora: Chain;
|
|
|
28
47
|
export declare const zoraSepolia: Chain;
|
|
29
48
|
export declare const worldChainSepolia: Chain;
|
|
30
49
|
export declare const worldChain: Chain;
|
|
50
|
+
export declare const shapeSepolia: Chain;
|
|
51
|
+
export declare const shape: Chain;
|
|
52
|
+
export declare const arbitrumNova: Chain;
|
package/dist/esm/chains.js
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import { defineChain } from "viem";
|
|
2
|
-
import { arbitrum as vab, arbitrumGoerli as vabg, arbitrumSepolia as vabs, base as vbase, baseGoerli as vbaseg, baseSepolia as vbases, fraxtal as vfrax, goerli as vgo, mainnet as vmain, optimism as vop, optimismGoerli as vopg, optimismSepolia as vops, polygon as vpg, polygonAmoy as vpga, polygonMumbai as vpgm, sepolia as vsep, zora as vzora, zoraSepolia as vzoras, } from "viem/chains";
|
|
2
|
+
import { arbitrum as vab, arbitrumGoerli as vabg, arbitrumSepolia as vabs, base as vbase, baseGoerli as vbaseg, baseSepolia as vbases, fraxtal as vfrax, goerli as vgo, mainnet as vmain, optimism as vop, optimismGoerli as vopg, optimismSepolia as vops, polygon as vpg, polygonAmoy as vpga, polygonMumbai as vpgm, sepolia as vsep, arbitrumNova as vabn, zora as vzora, zoraSepolia as vzoras, } from "viem/chains";
|
|
3
|
+
/**
|
|
4
|
+
* Defines an Alchemy chain configuration by adding an Alchemy-specific RPC base URL to the chain's RPC URLs.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { defineAlchemyChain } from "@account-kit/infra";
|
|
9
|
+
* import { sepolia } from "viem/chains";
|
|
10
|
+
*
|
|
11
|
+
* const chain = defineAlchemyChain({
|
|
12
|
+
* chain: sepolia,
|
|
13
|
+
* rpcBaseUrl: "https://eth-sepolia.g.alchemy.com/v2"
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param {AlchemyChainConfig} params The parameters for defining the Alchemy chain
|
|
18
|
+
* @param {Chain} params.chain The original chain configuration
|
|
19
|
+
* @param {string} params.rpcBaseUrl The Alchemy-specific RPC base URL
|
|
20
|
+
* @returns {Chain} The updated chain configuration with the Alchemy RPC URL added
|
|
21
|
+
*/
|
|
3
22
|
export const defineAlchemyChain = ({ chain, rpcBaseUrl, }) => {
|
|
4
23
|
return {
|
|
5
24
|
...chain,
|
|
@@ -208,4 +227,44 @@ export const worldChain = defineChain({
|
|
|
208
227
|
},
|
|
209
228
|
},
|
|
210
229
|
});
|
|
230
|
+
export const shapeSepolia = defineChain({
|
|
231
|
+
id: 11011,
|
|
232
|
+
name: "Shape Sepolia",
|
|
233
|
+
network: "Shape Sepolia",
|
|
234
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
235
|
+
rpcUrls: {
|
|
236
|
+
default: {
|
|
237
|
+
http: ["https://shape-sepolia.g.alchemy.com/v2"],
|
|
238
|
+
},
|
|
239
|
+
public: {
|
|
240
|
+
http: ["https://shape-sepolia.g.alchemy.com/v2"],
|
|
241
|
+
},
|
|
242
|
+
alchemy: {
|
|
243
|
+
http: ["https://shape-sepolia.g.alchemy.com/v2"],
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
});
|
|
247
|
+
export const shape = defineChain({
|
|
248
|
+
id: 360,
|
|
249
|
+
name: "Shape",
|
|
250
|
+
network: "Shape",
|
|
251
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
252
|
+
rpcUrls: {
|
|
253
|
+
default: {
|
|
254
|
+
http: ["https://shape-mainnet.g.alchemy.com/v2"],
|
|
255
|
+
},
|
|
256
|
+
public: {
|
|
257
|
+
http: ["https://shape-mainnet.g.alchemy.com/v2"],
|
|
258
|
+
},
|
|
259
|
+
alchemy: {
|
|
260
|
+
http: ["https://shape-mainnet.g.alchemy.com/v2"],
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
export const arbitrumNova = {
|
|
265
|
+
...vabn,
|
|
266
|
+
rpcUrls: {
|
|
267
|
+
...vabn.rpcUrls,
|
|
268
|
+
},
|
|
269
|
+
};
|
|
211
270
|
//# 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,IAAI,IAAI,KAAK,EACb,WAAW,IAAI,MAAM,GACtB,MAAM,aAAa,CAAC;AA0BrB,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;AA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E,CAAC,6CAA6C,CAAC;SACtD;KACF;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAU,WAAW,CAAC;IAC3C,EAAE,EAAE,GAAG;IACP,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,aAAa;IACtB,cAAc,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9D,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,6CAA6C,CAAC;SACtD;QACD,MAAM,EAAE;YACN,IAAI,EAAE,CAAC,6CAA6C,CAAC;SACtD;QACD,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,6CAA6C,CAAC;SACtD;KACF;CACF,CAAC,CAAC","sourcesContent":["import type { Chain } from \"viem\";\n\nimport { defineChain } from \"viem\";\nimport {\n arbitrum as vab,\n arbitrumGoerli as vabg,\n arbitrumSepolia as vabs,\n base as vbase,\n baseGoerli as vbaseg,\n baseSepolia as vbases,\n fraxtal as vfrax,\n goerli as vgo,\n mainnet as vmain,\n optimism as vop,\n optimismGoerli as vopg,\n optimismSepolia as vops,\n polygon as vpg,\n polygonAmoy as vpga,\n polygonMumbai as vpgm,\n sepolia as vsep,\n zora as vzora,\n zoraSepolia as vzoras,\n} from \"viem/chains\";\n\nexport type AlchemyChainConfig = {\n chain: Chain;\n rpcBaseUrl: string;\n};\n\n/**\n * Defines an Alchemy chain configuration by adding an Alchemy-specific RPC base URL to the chain's RPC URLs.\n *\n * @example\n * ```ts\n * import { defineAlchemyChain } from \"@account-kit/infra\";\n * import { sepolia } from \"viem/chains\";\n *\n * const chain = defineAlchemyChain({\n * chain: sepolia,\n * rpcBaseUrl: \"https://eth-sepolia.g.alchemy.com/v2\"\n * });\n * ```\n *\n * @param {AlchemyChainConfig} params The parameters for defining the Alchemy chain\n * @param {Chain} params.chain The original chain configuration\n * @param {string} params.rpcBaseUrl The Alchemy-specific RPC base URL\n * @returns {Chain} The updated chain configuration with the Alchemy RPC URL added\n */\nexport const defineAlchemyChain = ({\n chain,\n rpcBaseUrl,\n}: {\n chain: Chain;\n rpcBaseUrl: string;\n}): Chain => {\n return {\n ...chain,\n rpcUrls: {\n ...chain.rpcUrls,\n alchemy: {\n http: [rpcBaseUrl],\n },\n },\n };\n};\n\nexport const arbitrum: Chain = {\n ...vab,\n rpcUrls: {\n ...vab.rpcUrls,\n alchemy: {\n http: [\"https://arb-mainnet.g.alchemy.com/v2\"],\n },\n },\n};\n\nexport const arbitrumGoerli: Chain = {\n ...vabg,\n rpcUrls: {\n ...vabg.rpcUrls,\n alchemy: {\n http: [\"https://arb-goerli.g.alchemy.com/v2\"],\n },\n },\n};\n\nexport const arbitrumSepolia: Chain = {\n ...vabs,\n rpcUrls: {\n ...vabs.rpcUrls,\n alchemy: {\n http: [\"https://arb-sepolia.g.alchemy.com/v2\"],\n },\n },\n};\nexport const goerli: Chain = {\n ...vgo,\n rpcUrls: {\n ...vgo.rpcUrls,\n alchemy: {\n http: [\"https://eth-goerli.g.alchemy.com/v2\"],\n },\n },\n};\nexport const mainnet: Chain = {\n ...vmain,\n rpcUrls: {\n ...vmain.rpcUrls,\n alchemy: {\n http: [\"https://eth-mainnet.g.alchemy.com/v2\"],\n },\n },\n};\nexport const optimism: Chain = {\n ...vop,\n rpcUrls: {\n ...vop.rpcUrls,\n alchemy: {\n http: [\"https://opt-mainnet.g.alchemy.com/v2\"],\n },\n },\n};\nexport const optimismGoerli: Chain = {\n ...vopg,\n rpcUrls: {\n ...vopg.rpcUrls,\n alchemy: {\n http: [\"https://opt-goerli.g.alchemy.com/v2\"],\n },\n },\n};\nexport const optimismSepolia: Chain = {\n ...vops,\n rpcUrls: {\n ...vops.rpcUrls,\n alchemy: {\n http: [\"https://opt-sepolia.g.alchemy.com/v2\"],\n },\n },\n};\nexport const sepolia: Chain = {\n ...vsep,\n rpcUrls: {\n ...vsep.rpcUrls,\n alchemy: {\n http: [\"https://eth-sepolia.g.alchemy.com/v2\"],\n },\n },\n};\nexport const base: Chain = {\n ...vbase,\n rpcUrls: {\n ...vbase.rpcUrls,\n alchemy: {\n http: [\"https://base-mainnet.g.alchemy.com/v2\"],\n },\n },\n};\nexport const baseGoerli: Chain = {\n ...vbaseg,\n rpcUrls: {\n ...vbaseg.rpcUrls,\n alchemy: {\n http: [\"https://base-goerli.g.alchemy.com/v2\"],\n },\n },\n};\nexport const baseSepolia: Chain = {\n ...vbases,\n rpcUrls: {\n ...vbases.rpcUrls,\n alchemy: {\n http: [\"https://base-sepolia.g.alchemy.com/v2\"],\n },\n },\n};\n\nexport const polygonMumbai: Chain = {\n ...vpgm,\n rpcUrls: {\n ...vpgm.rpcUrls,\n alchemy: {\n http: [\"https://polygon-mumbai.g.alchemy.com/v2\"],\n },\n },\n};\n\nexport const polygonAmoy: Chain = {\n ...vpga,\n rpcUrls: {\n ...vpga.rpcUrls,\n alchemy: {\n http: [\"https://polygon-amoy.g.alchemy.com/v2\"],\n },\n },\n};\n\nexport const polygon: Chain = {\n ...vpg,\n rpcUrls: {\n ...vpg.rpcUrls,\n alchemy: {\n http: [\"https://polygon-mainnet.g.alchemy.com/v2\"],\n },\n },\n};\n\nexport const fraxtal: Chain = {\n ...vfrax,\n rpcUrls: {\n ...vfrax.rpcUrls,\n },\n};\n\nexport const fraxtalSepolia: Chain = defineChain({\n id: 2523,\n name: \"Fraxtal Sepolia\",\n nativeCurrency: { name: \"Frax Ether\", symbol: \"frxETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.testnet-sepolia.frax.com\"],\n },\n },\n});\n\nexport const zora: Chain = {\n ...vzora,\n rpcUrls: {\n ...vzora.rpcUrls,\n },\n};\n\nexport const zoraSepolia: Chain = {\n ...vzoras,\n rpcUrls: {\n ...vzoras.rpcUrls,\n },\n};\n\nexport const worldChainSepolia: Chain = defineChain({\n id: 4801,\n name: \"World Chain Sepolia\",\n network: \"World Chain Sepolia\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://worldchain-sepolia.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://worldchain-sepolia.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://worldchain-sepolia.g.alchemy.com/v2\"],\n },\n },\n});\n\nexport const worldChain: Chain = defineChain({\n id: 480,\n name: \"World Chain\",\n network: \"World Chain\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://worldchain-mainnet.g.alchemy.com/v2\"],\n },\n public: {\n http: [\"https://worldchain-mainnet.g.alchemy.com/v2\"],\n },\n alchemy: {\n http: [\"https://worldchain-mainnet.g.alchemy.com/v2\"],\n },\n },\n});\n"]}
|
|
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,KA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O,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9D,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,wCAAwC,CAAC;SACjD;QACD,MAAM,EAAE;YACN,IAAI,EAAE,CAAC,wCAAwC,CAAC;SACjD;QACD,OAAO,EAAE;YACP,IAAI,EAAE,CAAC,wCAAwC,CAAC;SACjD;KACF;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,GAAG,IAAI;IACP,OAAO,EAAE;QACP,GAAG,IAAI,CAAC,OAAO;KAChB;CACF,CAAC","sourcesContent":["import type { Chain } from \"viem\";\n\nimport { defineChain } from \"viem\";\nimport {\n arbitrum as vab,\n arbitrumGoerli as vabg,\n arbitrumSepolia as vabs,\n base as vbase,\n baseGoerli as vbaseg,\n baseSepolia as vbases,\n fraxtal as vfrax,\n goerli as vgo,\n mainnet as vmain,\n optimism as vop,\n optimismGoerli as vopg,\n optimismSepolia as vops,\n polygon as vpg,\n polygonAmoy as vpga,\n polygonMumbai as vpgm,\n sepolia as vsep,\n 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 arbitrumNova: Chain = {\n ...vabn,\n rpcUrls: {\n ...vabn.rpcUrls,\n },\n};\n"]}
|