@account-kit/infra 4.0.0-alpha.0 → 4.0.0-alpha.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/cjs/actions/simulateUserOperationChanges.js.map +1 -1
- package/dist/cjs/chains.d.ts +4 -0
- package/dist/cjs/chains.js.map +1 -1
- package/dist/cjs/client/decorators/alchemyEnhancedApis.d.ts +5537 -1
- package/dist/cjs/client/decorators/alchemyEnhancedApis.js.map +1 -1
- package/dist/cjs/client/decorators/smartAccount.js.map +1 -1
- package/dist/cjs/client/internal/smartAccountClientFromRpc.d.ts +2 -2
- package/dist/cjs/client/internal/smartAccountClientFromRpc.js +2 -1
- package/dist/cjs/client/internal/smartAccountClientFromRpc.js.map +1 -1
- package/dist/cjs/client/isAlchemySmartAccountClient.js.map +1 -1
- package/dist/cjs/client/rpcClient.js.map +1 -1
- package/dist/cjs/client/smartAccountClient.js.map +1 -1
- package/dist/cjs/defaults.js.map +1 -1
- package/dist/cjs/gas-manager.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/middleware/feeEstimator.js.map +1 -1
- package/dist/cjs/middleware/gasManager.js.map +1 -1
- package/dist/cjs/middleware/userOperationSimulator.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/actions/simulateUserOperationChanges.js.map +1 -1
- package/dist/esm/chains.d.ts +4 -0
- package/dist/esm/chains.js.map +1 -1
- package/dist/esm/client/decorators/alchemyEnhancedApis.d.ts +5537 -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/internal/smartAccountClientFromRpc.d.ts +2 -2
- package/dist/esm/client/internal/smartAccountClientFromRpc.js +2 -1
- package/dist/esm/client/internal/smartAccountClientFromRpc.js.map +1 -1
- package/dist/esm/client/isAlchemySmartAccountClient.js.map +1 -1
- package/dist/esm/client/rpcClient.js.map +1 -1
- package/dist/esm/client/smartAccountClient.js.map +1 -1
- package/dist/esm/defaults.js.map +1 -1
- package/dist/esm/gas-manager.js +1 -1
- package/dist/esm/gas-manager.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.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/simulateUserOperationChanges.d.ts +17 -0
- package/dist/types/actions/simulateUserOperationChanges.d.ts.map +1 -1
- package/dist/types/chains.d.ts +23 -0
- package/dist/types/chains.d.ts.map +1 -1
- package/dist/types/client/decorators/alchemyEnhancedApis.d.ts +5554 -1
- package/dist/types/client/decorators/alchemyEnhancedApis.d.ts.map +1 -1
- package/dist/types/client/decorators/smartAccount.d.ts +15 -0
- package/dist/types/client/decorators/smartAccount.d.ts.map +1 -1
- package/dist/types/client/internal/smartAccountClientFromRpc.d.ts +2 -2
- package/dist/types/client/internal/smartAccountClientFromRpc.d.ts.map +1 -1
- package/dist/types/client/isAlchemySmartAccountClient.d.ts +15 -0
- package/dist/types/client/isAlchemySmartAccountClient.d.ts.map +1 -1
- package/dist/types/client/rpcClient.d.ts +22 -0
- package/dist/types/client/rpcClient.d.ts.map +1 -1
- package/dist/types/defaults.d.ts +14 -0
- package/dist/types/defaults.d.ts.map +1 -1
- package/dist/types/gas-manager.d.ts +13 -0
- package/dist/types/gas-manager.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/middleware/feeEstimator.d.ts +19 -0
- package/dist/types/middleware/feeEstimator.d.ts.map +1 -1
- package/dist/types/middleware/userOperationSimulator.d.ts +19 -0
- package/dist/types/middleware/userOperationSimulator.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +3 -3
- package/src/actions/simulateUserOperationChanges.ts +17 -0
- package/src/chains.ts +24 -0
- package/src/client/decorators/alchemyEnhancedApis.ts +50 -33
- package/src/client/decorators/smartAccount.ts +15 -0
- package/src/client/internal/smartAccountClientFromRpc.ts +33 -13
- package/src/client/isAlchemySmartAccountClient.ts +15 -0
- package/src/client/rpcClient.ts +22 -0
- package/src/client/smartAccountClient.ts +17 -0
- package/src/defaults.ts +14 -0
- package/src/gas-manager.ts +17 -4
- package/src/index.ts +1 -0
- package/src/middleware/feeEstimator.ts +19 -0
- package/src/middleware/gasManager.ts +1 -1
- package/src/middleware/userOperationSimulator.ts +19 -0
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alchemyEnhancedApis.d.ts","sourceRoot":"","sources":["../../../../src/client/decorators/alchemyEnhancedApis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAiB,SAAS,EAAE,MAAM,MAAM,CAAC;AAE5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAE1E,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAC9B,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACxB,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1B,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC3B,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iQASd,mBA2BF,CAAC"}
|
|
@@ -4,5 +4,20 @@ import type { SimulateUserOperationAssetChangesResponse } from "../../actions/ty
|
|
|
4
4
|
export type AlchemySmartAccountClientActions<TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined> = {
|
|
5
5
|
simulateUserOperation: (args: SendUserOperationParameters<TAccount, TContext>) => Promise<SimulateUserOperationAssetChangesResponse>;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* Provides a set of actions for interacting with the Alchemy Smart Account client, including the ability to simulate user operations.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { alchemyActions } from "@account-kit/infra";
|
|
13
|
+
* import { createPublicClient } from "viem";
|
|
14
|
+
*
|
|
15
|
+
* const client = createPublicClient(...);
|
|
16
|
+
* const clientWithAlchemyActions = client.extend(alchemyActions);
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @param {Client<TTransport, TChain, TAccount>} client The client instance used to perform actions
|
|
20
|
+
* @returns {AlchemySmartAccountClientActions<TAccount, TContext>} An object containing Alchemy Smart Account client actions
|
|
21
|
+
*/
|
|
7
22
|
export declare const alchemyActions: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined>(client: Client<TTransport, TChain, TAccount>) => AlchemySmartAccountClientActions<TAccount, TContext>;
|
|
8
23
|
//# sourceMappingURL=smartAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smartAccount.d.ts","sourceRoot":"","sources":["../../../../src/client/decorators/smartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2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,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,IACX;IACF,qBAAqB,EAAE,CACrB,IAAI,EAAE,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAClD,OAAO,CAAC,yCAAyC,CAAC,CAAC;CACzD,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,EAAE,CAC3B,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EAEb,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,KACzC,gCAAgC,CAAC,QAAQ,EAAE,QAAQ,CAGtD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { type SmartContractAccount, type SmartContractAccountWithSigner, type Us
|
|
|
2
2
|
import type { Chain, CustomTransport, Transport } from "viem";
|
|
3
3
|
import type { AlchemySmartAccountClient, AlchemySmartAccountClientConfig } from "../smartAccountClient.js";
|
|
4
4
|
import type { ClientWithAlchemyMethods } from "../types.js";
|
|
5
|
-
export type
|
|
5
|
+
export type CreateAlchemySmartAccountClientFromRpcClientParams<TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined> = Omit<AlchemySmartAccountClientConfig<Transport, Chain, TAccount, TContext>, "rpcUrl" | "chain" | "apiKey" | "jwt"> & {
|
|
6
6
|
client: ClientWithAlchemyMethods;
|
|
7
7
|
};
|
|
8
8
|
export declare function getSignerTypeHeader<TAccount extends SmartContractAccountWithSigner>(account: TAccount): {
|
|
@@ -15,5 +15,5 @@ export declare function getSignerTypeHeader<TAccount extends SmartContractAccoun
|
|
|
15
15
|
* @param args configuration for the client
|
|
16
16
|
* @returns a smart account client configured to use Alchemy's RPC
|
|
17
17
|
*/
|
|
18
|
-
export declare function createAlchemySmartAccountClientFromRpcClient<TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined>(args:
|
|
18
|
+
export declare function createAlchemySmartAccountClientFromRpcClient<TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined>(args: CreateAlchemySmartAccountClientFromRpcClientParams<TAccount, TContext>): AlchemySmartAccountClient<CustomTransport, TChain, TAccount, Record<string, never>, TContext>;
|
|
19
19
|
//# sourceMappingURL=smartAccountClientFromRpc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smartAccountClientFromRpc.d.ts","sourceRoot":"","sources":["../../../../src/client/internal/smartAccountClientFromRpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAK9D,OAAO,KAAK,EACV,yBAAyB,EACzB,+BAA+B,EAChC,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE5D,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"smartAccountClientFromRpc.d.ts","sourceRoot":"","sources":["../../../../src/client/internal/smartAccountClientFromRpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAK9D,OAAO,KAAK,EACV,yBAAyB,EACzB,+BAA+B,EAChC,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE5D,MAAM,MAAM,kDAAkD,CAC5D,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,IACX,IAAI,CACN,+BAA+B,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,EACrE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CACtC,GAAG;IAAE,MAAM,EAAE,wBAAwB,CAAA;CAAE,CAAC;AAEzC,wBAAgB,mBAAmB,CACjC,QAAQ,SAAS,8BAA8B,EAC/C,OAAO,EAAE,QAAQ;;EAElB;AAED;;;;;;GAMG;AACH,wBAAgB,4CAA4C,CAC1D,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EACb,QAAQ,SAAS,oBAAoB,GAAG,SAAS,GAC7C,oBAAoB,GACpB,SAAS,EAEb,IAAI,EAAE,kDAAkD,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAC3E,yBAAyB,CAC1B,eAAe,EACf,MAAM,EACN,QAAQ,EACR,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACrB,QAAQ,CACT,CAAC"}
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { type SmartContractAccount } from "@aa-sdk/core";
|
|
2
2
|
import type { Chain, Client, Transport } from "viem";
|
|
3
|
+
/**
|
|
4
|
+
* 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.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { isAlchemySmartAccountClient } from "@account-kit/infra";
|
|
9
|
+
*
|
|
10
|
+
* if (isAlchemySmartAccountClient(client)) {
|
|
11
|
+
* // do things with the client as an Alchemy Smart Account Client
|
|
12
|
+
* }
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @param {Client<TTransport, TChain, TAccount>} client The client instance to be checked
|
|
16
|
+
* @returns {boolean} `true` if the client is an Alchemy Smart Account Client, otherwise `false`
|
|
17
|
+
*/
|
|
3
18
|
export declare const isAlchemySmartAccountClient: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined>(client: Client<TTransport, TChain, TAccount>) => client is ((Client<TTransport, TChain, TAccount, [{
|
|
4
19
|
Method: "eth_sendUserOperation";
|
|
5
20
|
Parameters: [import("@aa-sdk/core").UserOperationRequest, `0x${string}`];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isAlchemySmartAccountClient.d.ts","sourceRoot":"","sources":["../../../src/client/isAlchemySmartAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAGrD,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6OAcvC,CAAC"}
|
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
import { type ConnectionConfig, type NoUndefined } from "@aa-sdk/core";
|
|
2
2
|
import { type Chain, type HttpTransportConfig } from "viem";
|
|
3
3
|
import type { ClientWithAlchemyMethods } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Creates an Alchemy public RPC client with the provided chain, connection configuration, and optional fetch options. The client has alchemy methods and can dynamically update HTTP headers.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { createAlchemyPublicRpcClient } from "@account-kit/infra";
|
|
10
|
+
* import { sepolia } from "@account-kit/infra/chains";
|
|
11
|
+
*
|
|
12
|
+
* const client = createAlchemyPublicRpcClient({
|
|
13
|
+
* chain: sepolia,
|
|
14
|
+
* connectionConfig: {
|
|
15
|
+
* apiKey: "your-api-key",
|
|
16
|
+
* }
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @param {{connectionConfig: ConnectionConfig,chain: Chain,fetchOptions?: NoUndefined<HttpTransportConfig["fetchOptions"]>}} params The parameters for creating the Alchemy public RPC client
|
|
21
|
+
* @param {ConnectionConfig} params.connectionConfig The connection configuration containing the RPC URL and API key
|
|
22
|
+
* @param {Chain} params.chain The blockchain chain configuration
|
|
23
|
+
* @param {NoUndefined<HttpTransportConfig["fetchOptions"]>} [params.fetchOptions] Optional fetch configuration for HTTP transport
|
|
24
|
+
* @returns {ClientWithAlchemyMethods} A client object tailored with Alchemy methods and capabilities to interact with the blockchain
|
|
25
|
+
*/
|
|
4
26
|
export declare const createAlchemyPublicRpcClient: ({ chain: chain_, connectionConfig, fetchOptions, }: {
|
|
5
27
|
connectionConfig: ConnectionConfig;
|
|
6
28
|
chain: Chain;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpcClient.d.ts","sourceRoot":"","sources":["../../../src/client/rpcClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAQ,KAAK,KAAK,EAAE,KAAK,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAGlE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE3D,eAAO,MAAM,4BAA4B;sBAKrB,gBAAgB;WAC3B,KAAK;;MAEV,wBA+BH,CAAC"}
|
|
1
|
+
{"version":3,"file":"rpcClient.d.ts","sourceRoot":"","sources":["../../../src/client/rpcClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAQ,KAAK,KAAK,EAAE,KAAK,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAGlE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,4BAA4B;sBAKrB,gBAAgB;WAC3B,KAAK;;MAEV,wBA+BH,CAAC"}
|
package/dist/types/defaults.d.ts
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import { type UserOperationFeeOptions } from "@aa-sdk/core";
|
|
2
2
|
import type { Chain } from "viem";
|
|
3
|
+
/**
|
|
4
|
+
* Retrieves the default user operation fee options for a given chain. Adjusts fees for specific chains like Arbitrum and Optimism.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { getDefaultUserOperationFeeOptions } from "@account-kit/infra";
|
|
9
|
+
* import { arbitrum } from "@account-kit/infra/chains";
|
|
10
|
+
*
|
|
11
|
+
* const feeOpts = getDefaultUserOperationFeeOptions(arbitrum);
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @param {Chain} chain The blockchain chain for which to get the fee options
|
|
15
|
+
* @returns {UserOperationFeeOptions} An object containing the default fee options for user operations on the specified chain
|
|
16
|
+
*/
|
|
3
17
|
export declare const getDefaultUserOperationFeeOptions: (chain: Chain) => UserOperationFeeOptions;
|
|
4
18
|
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,uBAAuB,EAC7B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAElC,eAAO,MAAM,iCAAiC,UACrC,KAAK,KACX,uBAoBF,CAAC"}
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,uBAAuB,EAC7B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAElC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iCAAiC,UACrC,KAAK,KACX,uBAoBF,CAAC"}
|
|
@@ -3,5 +3,18 @@ export declare const AlchemyPaymasterAddressV3 = "0x4f84a207A80c39E9e8BaE717c1F2
|
|
|
3
3
|
export declare const AlchemyPaymasterAddressV2 = "0x4Fd9098af9ddcB41DA48A1d78F91F1398965addc";
|
|
4
4
|
export declare const ArbSepoliaPaymasterAddress = "0x0804Afe6EEFb73ce7F93CD0d5e7079a5a8068592";
|
|
5
5
|
export declare const AlchemyPaymasterAddressV1 = "0xc03aac639bb21233e0139381970328db8bceeb67";
|
|
6
|
+
/**
|
|
7
|
+
* Retrieves the Alchemy paymaster address for the given chain. Returns different addresses based on the chain ID.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { sepolia, getAlchemyPaymasterAddress } from "@account-kit/infra/chains";
|
|
12
|
+
*
|
|
13
|
+
* const paymasterAddress = getAlchemyPaymasterAddress(sepolia);
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param {Chain} chain The chain for which the paymaster address is required
|
|
17
|
+
* @returns {Address} The Alchemy paymaster address corresponding to the specified chain
|
|
18
|
+
*/
|
|
6
19
|
export declare const getAlchemyPaymasterAddress: (chain: Chain) => Address;
|
|
7
20
|
//# sourceMappingURL=gas-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gas-manager.d.ts","sourceRoot":"","sources":["../../src/gas-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gas-manager.d.ts","sourceRoot":"","sources":["../../src/gas-manager.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAE3C,eAAO,MAAM,yBAAyB,+CACQ,CAAC;AAC/C,eAAO,MAAM,yBAAyB,+CACQ,CAAC;AAC/C,eAAO,MAAM,0BAA0B,+CACO,CAAC;AAC/C,eAAO,MAAM,yBAAyB,+CACQ,CAAC;AAE/C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,0BAA0B,UAAW,KAAK,KAAG,OAwBzD,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type * from "./actions/simulateUserOperationChanges.js";
|
|
2
2
|
export { simulateUserOperationChanges } from "./actions/simulateUserOperationChanges.js";
|
|
3
3
|
export type * from "./actions/types.js";
|
|
4
|
+
export type * from "./chains.js";
|
|
4
5
|
export { defineAlchemyChain } from "./chains.js";
|
|
5
6
|
export type * from "./client/decorators/alchemyEnhancedApis.js";
|
|
6
7
|
export { alchemyEnhancedApiActions } from "./client/decorators/alchemyEnhancedApis.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,2CAA2C,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AACzF,mBAAmB,oBAAoB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,mBAAmB,4CAA4C,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,mBAAmB,qCAAqC,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,q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AgD,CAAC;AAC7J,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,mBAAmB,uBAAuB,CAAC;AAC3C,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AACrE,mBAAmB,gCAAgC,CAAC;AACpD,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,mBAAmB,mBAAmB,CAAC;AACvC,OAAO,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,mBAAmB,4BAA4B,CAAC;AAChD,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,mBAAmB,aAAa,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC1D,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
import type { ClientMiddlewareFn } from "@aa-sdk/core";
|
|
2
2
|
import type { ClientWithAlchemyMethods } from "../client/types";
|
|
3
|
+
/**
|
|
4
|
+
* Function that estimates the transaction fees using Alchemy methods for a given client.
|
|
5
|
+
* It fetches the latest block and estimates the max priority fee per gas, applying any overrides or fee options provided.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { alchemyFeeEstimator, createAlchemyPublicRpcClient } from "@account-kit/infra";
|
|
10
|
+
* import { createSmartAccountClient } from "@aa-sdk/core";
|
|
11
|
+
*
|
|
12
|
+
* const bundlerClient = createAlchemyPublicRpcClient(...);
|
|
13
|
+
* const client = createSmartAccountClient({
|
|
14
|
+
* feeEstimator: alchemyFeeEstimator(bundlerClient),
|
|
15
|
+
* ...otherParams
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @param {ClientWithAlchemyMethods} client The client with Alchemy methods
|
|
20
|
+
* @returns {ClientMiddlewareFn} A middleware function that takes a transaction structure and fee options, and returns the augmented structure with estimated fees
|
|
21
|
+
*/
|
|
3
22
|
export declare const alchemyFeeEstimator: <C extends ClientWithAlchemyMethods>(client: C) => ClientMiddlewareFn;
|
|
4
23
|
//# sourceMappingURL=feeEstimator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feeEstimator.d.ts","sourceRoot":"","sources":["../../../src/middleware/feeEstimator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAEhE,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,SAAS,wBAAwB,EACnE,MAAM,EAAE,CAAC,KACN,kBAiCF,CAAC"}
|
|
1
|
+
{"version":3,"file":"feeEstimator.d.ts","sourceRoot":"","sources":["../../../src/middleware/feeEstimator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAEhE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,SAAS,wBAAwB,EACnE,MAAM,EAAE,CAAC,KACN,kBAiCF,CAAC"}
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
import { type ClientMiddlewareFn } from "@aa-sdk/core";
|
|
2
2
|
import type { ClientWithAlchemyMethods } from "../client/types";
|
|
3
|
+
/**
|
|
4
|
+
* A middleware function to be used during simulation of user operations which leverages Alchemy's RPC uo simulation method.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { alchemyUserOperationSimulator, createAlchemyPublicRpcClient } from "@account-kit/infra";
|
|
9
|
+
* import { createSmartAccountClient } from "@aa-sdk/core";
|
|
10
|
+
*
|
|
11
|
+
* const bundlerClient = createAlchemyPublicRpcClient(...);
|
|
12
|
+
* const client = createSmartAccountClient({
|
|
13
|
+
* userOperationSimulator: alchemyUserOperationSimulator(bundlerClient),
|
|
14
|
+
* ...otherParams
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @template C The client object with Alchemy methods
|
|
19
|
+
* @param {C} client The client object with Alchemy methods
|
|
20
|
+
* @returns {ClientMiddlewareFn} A middleware function to simulate and process user operations
|
|
21
|
+
*/
|
|
3
22
|
export declare function alchemyUserOperationSimulator<C extends ClientWithAlchemyMethods>(client: C): ClientMiddlewareFn;
|
|
4
23
|
//# sourceMappingURL=userOperationSimulator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userOperationSimulator.d.ts","sourceRoot":"","sources":["../../../src/middleware/userOperationSimulator.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAEhE,wBAAgB,6BAA6B,CAC3C,CAAC,SAAS,wBAAwB,EAClC,MAAM,EAAE,CAAC,GAAG,kBAAkB,CAgB/B"}
|
|
1
|
+
{"version":3,"file":"userOperationSimulator.d.ts","sourceRoot":"","sources":["../../../src/middleware/userOperationSimulator.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAEhE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,6BAA6B,CAC3C,CAAC,SAAS,wBAAwB,EAClC,MAAM,EAAE,CAAC,GAAG,kBAAkB,CAgB/B"}
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "4.0.0-alpha.
|
|
1
|
+
export declare const VERSION = "4.0.0-alpha.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@account-kit/infra",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.1",
|
|
4
4
|
"description": "adapters for @aa-sdk/core for interacting with alchemy services",
|
|
5
5
|
"author": "Alchemy",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"vitest": "^0.31.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@aa-sdk/core": "^4.0.0-alpha.
|
|
48
|
+
"@aa-sdk/core": "^4.0.0-alpha.1",
|
|
49
49
|
"eventemitter3": "^5.0.1",
|
|
50
50
|
"viem": "2.8.6",
|
|
51
51
|
"zod": "^3.22.4"
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"url": "https://github.com/alchemyplatform/aa-sdk/issues"
|
|
69
69
|
},
|
|
70
70
|
"homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "cb4bf5f8a9aa8fdff1610130821b69ff806e79e6",
|
|
72
72
|
"optionalDependencies": {
|
|
73
73
|
"alchemy-sdk": "^3.0.0"
|
|
74
74
|
}
|
|
@@ -10,6 +10,23 @@ import { isAlchemySmartAccountClient } from "../client/isAlchemySmartAccountClie
|
|
|
10
10
|
import type { AlchemyRpcSchema } from "../client/types.js";
|
|
11
11
|
import type { SimulateUserOperationAssetChangesResponse } from "./types.js";
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Simulates user operation changes including asset changes for a specified user operation and returns the resulting state changes.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { simulateUserOperationChanges, createAlchemyPublicRpcClient } from "@account-kit/infra";
|
|
19
|
+
*
|
|
20
|
+
* const client = createAlchemyPublicRpcClient(...);
|
|
21
|
+
* const response = await simulateUserOperationChanges(client, {
|
|
22
|
+
* uo: ...
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @param {Client<Transport, TChain, TAccount, AlchemyRpcSchema>} client The client instance used to send the simulation request
|
|
27
|
+
* @param {SendUserOperationParameters<TAccount>} args The parameters of the user operation including the account and other overrides
|
|
28
|
+
* @returns {Promise<SimulateUserOperationAssetChangesResponse>} A promise that resolves to the response of the simulation showing the asset changes
|
|
29
|
+
*/
|
|
13
30
|
export const simulateUserOperationChanges: <
|
|
14
31
|
TChain extends Chain | undefined = Chain | undefined,
|
|
15
32
|
TAccount extends SmartContractAccount | undefined =
|
package/src/chains.ts
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
import type { Chain } from "viem";
|
|
2
2
|
|
|
3
|
+
export type AlchemyChainConfig = {
|
|
4
|
+
chain: Chain;
|
|
5
|
+
rpcBaseUrl: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Defines an Alchemy chain configuration by adding an Alchemy-specific RPC base URL to the chain's RPC URLs.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { defineAlchemyChain } from "@account-kit/infra";
|
|
14
|
+
* import { sepolia } from "viem/chains";
|
|
15
|
+
*
|
|
16
|
+
* const chain = defineAlchemyChain({
|
|
17
|
+
* chain: sepolia,
|
|
18
|
+
* rpcBaseUrl: "https://eth-sepolia.g.alchemy.com/v2"
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @param {AlchemyChainConfig} params The parameters for defining the Alchemy chain
|
|
23
|
+
* @param {Chain} params.chain The original chain configuration
|
|
24
|
+
* @param {string} params.rpcBaseUrl The Alchemy-specific RPC base URL
|
|
25
|
+
* @returns {Chain} The updated chain configuration with the Alchemy RPC URL added
|
|
26
|
+
*/
|
|
3
27
|
export const defineAlchemyChain = ({
|
|
4
28
|
chain,
|
|
5
29
|
rpcBaseUrl,
|
|
@@ -14,41 +14,58 @@ export type AlchemyEnhancedApis = {
|
|
|
14
14
|
config: Alchemy["config"];
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Given an instance of the Alchemy SDK, returns a smart account client decorator which contains actions for interacting Alchemy's enhanced APIs.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { Alchemy } from "alchemy-sdk";
|
|
23
|
+
* import { alchemyEnhancedApiActions } from "@account-kit/infra";
|
|
24
|
+
* import { alchemySCAClient } from "./client";
|
|
25
|
+
*
|
|
26
|
+
* const alchemy = new Alchemy(...);
|
|
27
|
+
* const enhancedApiDecorator = alchemyEnhancedApiActions(alchemy);
|
|
28
|
+
* const withEnhancedApis = alchemySCAClient.extend(enhancedApiDecorator);
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @param {Alchemy} alchemy The Alchemy instance containing the SDK client
|
|
32
|
+
* @returns {(client: AlchemySmartAccountClient) => AlchemyEnhancedApis} A client decorator for Alchemy Smart Account clients that adds the enhanced API methods
|
|
33
|
+
*/
|
|
34
|
+
export const alchemyEnhancedApiActions =
|
|
35
|
+
(alchemy: Alchemy) =>
|
|
36
|
+
<
|
|
37
|
+
TTransport extends Transport = Transport,
|
|
38
|
+
TChain extends Chain | undefined = Chain | undefined,
|
|
39
|
+
TAccount extends SmartContractAccount | undefined =
|
|
40
|
+
| SmartContractAccount
|
|
41
|
+
| undefined
|
|
42
|
+
>(
|
|
43
|
+
client: AlchemySmartAccountClient<TTransport, TChain, TAccount>
|
|
44
|
+
): AlchemyEnhancedApis => {
|
|
45
|
+
const alchemySdk = AlchemySdkClientSchema.parse(alchemy);
|
|
29
46
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
47
|
+
if (client.transport.type === "http") {
|
|
48
|
+
const { url } = client.transport as ReturnType<HttpTransport>["config"] &
|
|
49
|
+
ReturnType<HttpTransport>["value"];
|
|
33
50
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
51
|
+
if (
|
|
52
|
+
client.transport.type === "http" &&
|
|
53
|
+
alchemy.config.url &&
|
|
54
|
+
alchemy.config.url !== url
|
|
55
|
+
) {
|
|
56
|
+
throw new Error(
|
|
57
|
+
"Alchemy SDK client JSON-RPC URL must match AlchemyProvider JSON-RPC URL"
|
|
58
|
+
);
|
|
59
|
+
}
|
|
42
60
|
}
|
|
43
|
-
}
|
|
44
61
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
62
|
+
return {
|
|
63
|
+
core: alchemySdk.core,
|
|
64
|
+
nft: alchemySdk.nft,
|
|
65
|
+
transact: alchemySdk.transact,
|
|
66
|
+
debug: alchemySdk.debug,
|
|
67
|
+
ws: alchemySdk.ws,
|
|
68
|
+
notify: alchemySdk.notify,
|
|
69
|
+
config: alchemySdk.config,
|
|
70
|
+
};
|
|
53
71
|
};
|
|
54
|
-
};
|
|
@@ -20,6 +20,21 @@ export type AlchemySmartAccountClientActions<
|
|
|
20
20
|
) => Promise<SimulateUserOperationAssetChangesResponse>;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Provides a set of actions for interacting with the Alchemy Smart Account client, including the ability to simulate user operations.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* import { alchemyActions } from "@account-kit/infra";
|
|
29
|
+
* import { createPublicClient } from "viem";
|
|
30
|
+
*
|
|
31
|
+
* const client = createPublicClient(...);
|
|
32
|
+
* const clientWithAlchemyActions = client.extend(alchemyActions);
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @param {Client<TTransport, TChain, TAccount>} client The client instance used to perform actions
|
|
36
|
+
* @returns {AlchemySmartAccountClientActions<TAccount, TContext>} An object containing Alchemy Smart Account client actions
|
|
37
|
+
*/
|
|
23
38
|
export const alchemyActions: <
|
|
24
39
|
TTransport extends Transport = Transport,
|
|
25
40
|
TChain extends Chain | undefined = Chain | undefined,
|
|
@@ -17,7 +17,7 @@ import type {
|
|
|
17
17
|
} from "../smartAccountClient.js";
|
|
18
18
|
import type { ClientWithAlchemyMethods } from "../types.js";
|
|
19
19
|
|
|
20
|
-
export type
|
|
20
|
+
export type CreateAlchemySmartAccountClientFromRpcClientParams<
|
|
21
21
|
TAccount extends SmartContractAccount | undefined =
|
|
22
22
|
| SmartContractAccount
|
|
23
23
|
| undefined,
|
|
@@ -51,7 +51,7 @@ export function createAlchemySmartAccountClientFromRpcClient<
|
|
|
51
51
|
| UserOperationContext
|
|
52
52
|
| undefined
|
|
53
53
|
>(
|
|
54
|
-
args:
|
|
54
|
+
args: CreateAlchemySmartAccountClientFromRpcClientParams<TAccount, TContext>
|
|
55
55
|
): AlchemySmartAccountClient<
|
|
56
56
|
CustomTransport,
|
|
57
57
|
TChain,
|
|
@@ -60,17 +60,37 @@ export function createAlchemySmartAccountClientFromRpcClient<
|
|
|
60
60
|
TContext
|
|
61
61
|
>;
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
client,
|
|
73
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Creates an AlchemySmartAccountClient using the provided RPC client configuration, including options, account, simulation settings, gas management, fee estimation, middleware and user operation signing.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* import { createAlchemySmartAccountClientFromRpcClient, createAlchemyPublicRpcClient } from "@account-kit/infra";
|
|
69
|
+
*
|
|
70
|
+
* const client = createAlchemyPublicRpcClient(...);
|
|
71
|
+
* const scaClient = createAlchemySmartAccountClientFromRpcClient({
|
|
72
|
+
* client,
|
|
73
|
+
* ...
|
|
74
|
+
* });
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @param {CreateAlchemySmartAccountClientFromRpcClientParams} args The configuration object containing all required parameters
|
|
78
|
+
* @returns {AlchemySmartAccountClient} An instance of AlchemySmartAccountClient
|
|
79
|
+
*/
|
|
80
|
+
export function createAlchemySmartAccountClientFromRpcClient(
|
|
81
|
+
args: CreateAlchemySmartAccountClientFromRpcClientParams
|
|
82
|
+
): AlchemySmartAccountClient {
|
|
83
|
+
const {
|
|
84
|
+
opts,
|
|
85
|
+
account,
|
|
86
|
+
useSimulation,
|
|
87
|
+
gasManagerConfig,
|
|
88
|
+
feeEstimator,
|
|
89
|
+
gasEstimator,
|
|
90
|
+
customMiddleware,
|
|
91
|
+
signUserOperation,
|
|
92
|
+
client,
|
|
93
|
+
} = args;
|
|
74
94
|
const feeOptions =
|
|
75
95
|
opts?.feeOptions ?? getDefaultUserOperationFeeOptions(client.chain);
|
|
76
96
|
|
|
@@ -2,6 +2,21 @@ import { isSmartAccountClient, type SmartContractAccount } from "@aa-sdk/core";
|
|
|
2
2
|
import type { Chain, Client, Transport } from "viem";
|
|
3
3
|
import type { AlchemySmartAccountClient } from "./smartAccountClient";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* 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.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { isAlchemySmartAccountClient } from "@account-kit/infra";
|
|
11
|
+
*
|
|
12
|
+
* if (isAlchemySmartAccountClient(client)) {
|
|
13
|
+
* // do things with the client as an Alchemy Smart Account Client
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param {Client<TTransport, TChain, TAccount>} client The client instance to be checked
|
|
18
|
+
* @returns {boolean} `true` if the client is an Alchemy Smart Account Client, otherwise `false`
|
|
19
|
+
*/
|
|
5
20
|
export const isAlchemySmartAccountClient = <
|
|
6
21
|
TTransport extends Transport = Transport,
|
|
7
22
|
TChain extends Chain | undefined = Chain | undefined,
|
package/src/client/rpcClient.ts
CHANGED
|
@@ -8,6 +8,28 @@ import { AlchemyChainSchema } from "../schema.js";
|
|
|
8
8
|
import { VERSION } from "../version.js";
|
|
9
9
|
import type { ClientWithAlchemyMethods } from "./types.js";
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Creates an Alchemy public RPC client with the provided chain, connection configuration, and optional fetch options. The client has alchemy methods and can dynamically update HTTP headers.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { createAlchemyPublicRpcClient } from "@account-kit/infra";
|
|
17
|
+
* import { sepolia } from "@account-kit/infra/chains";
|
|
18
|
+
*
|
|
19
|
+
* const client = createAlchemyPublicRpcClient({
|
|
20
|
+
* chain: sepolia,
|
|
21
|
+
* connectionConfig: {
|
|
22
|
+
* apiKey: "your-api-key",
|
|
23
|
+
* }
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @param {{connectionConfig: ConnectionConfig,chain: Chain,fetchOptions?: NoUndefined<HttpTransportConfig["fetchOptions"]>}} params The parameters for creating the Alchemy public RPC client
|
|
28
|
+
* @param {ConnectionConfig} params.connectionConfig The connection configuration containing the RPC URL and API key
|
|
29
|
+
* @param {Chain} params.chain The blockchain chain configuration
|
|
30
|
+
* @param {NoUndefined<HttpTransportConfig["fetchOptions"]>} [params.fetchOptions] Optional fetch configuration for HTTP transport
|
|
31
|
+
* @returns {ClientWithAlchemyMethods} A client object tailored with Alchemy methods and capabilities to interact with the blockchain
|
|
32
|
+
*/
|
|
11
33
|
export const createAlchemyPublicRpcClient = ({
|
|
12
34
|
chain: chain_,
|
|
13
35
|
connectionConfig,
|