@account-kit/infra 4.0.0-alpha.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/LICENSE +21 -0
- package/dist/cjs/actions/simulateUserOperationChanges.d.ts +5 -0
- package/dist/cjs/actions/simulateUserOperationChanges.js +24 -0
- package/dist/cjs/actions/simulateUserOperationChanges.js.map +1 -0
- package/dist/cjs/actions/types.d.ts +39 -0
- package/dist/cjs/actions/types.js +17 -0
- package/dist/cjs/actions/types.js.map +1 -0
- package/dist/cjs/chains.d.ts +5 -0
- package/dist/cjs/chains.js +16 -0
- package/dist/cjs/chains.js.map +1 -0
- package/dist/cjs/client/decorators/alchemyEnhancedApis.d.ts +14 -0
- package/dist/cjs/client/decorators/alchemyEnhancedApis.js +26 -0
- package/dist/cjs/client/decorators/alchemyEnhancedApis.js.map +1 -0
- package/dist/cjs/client/decorators/smartAccount.d.ts +7 -0
- package/dist/cjs/client/decorators/smartAccount.js +9 -0
- package/dist/cjs/client/decorators/smartAccount.js.map +1 -0
- package/dist/cjs/client/internal/smartAccountClientFromRpc.d.ts +11 -0
- package/dist/cjs/client/internal/smartAccountClientFromRpc.js +55 -0
- package/dist/cjs/client/internal/smartAccountClientFromRpc.js.map +1 -0
- package/dist/cjs/client/isAlchemySmartAccountClient.d.ts +5539 -0
- package/dist/cjs/client/isAlchemySmartAccountClient.js +9 -0
- package/dist/cjs/client/isAlchemySmartAccountClient.js.map +1 -0
- package/dist/cjs/client/rpcClient.d.ts +8 -0
- package/dist/cjs/client/rpcClient.js +36 -0
- package/dist/cjs/client/rpcClient.js.map +1 -0
- package/dist/cjs/client/smartAccountClient.d.ts +18 -0
- package/dist/cjs/client/smartAccountClient.js +32 -0
- package/dist/cjs/client/smartAccountClient.js.map +1 -0
- package/dist/cjs/client/types.d.ts +76 -0
- package/dist/cjs/client/types.js +3 -0
- package/dist/cjs/client/types.js.map +1 -0
- package/dist/cjs/defaults.d.ts +3 -0
- package/dist/cjs/defaults.js +23 -0
- package/dist/cjs/defaults.js.map +1 -0
- package/dist/cjs/errors/base.d.ts +4 -0
- package/dist/cjs/errors/base.js +18 -0
- package/dist/cjs/errors/base.js.map +1 -0
- package/dist/cjs/errors/rpcUrl.d.ts +10 -0
- package/dist/cjs/errors/rpcUrl.js +26 -0
- package/dist/cjs/errors/rpcUrl.js.map +1 -0
- package/dist/cjs/gas-manager.d.ts +6 -0
- package/dist/cjs/gas-manager.js +35 -0
- package/dist/cjs/gas-manager.js.map +1 -0
- package/dist/cjs/index.d.ts +24 -0
- package/dist/cjs/index.js +32 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/middleware/feeEstimator.d.ts +3 -0
- package/dist/cjs/middleware/feeEstimator.js +26 -0
- package/dist/cjs/middleware/feeEstimator.js.map +1 -0
- package/dist/cjs/middleware/gasManager.d.ts +29 -0
- package/dist/cjs/middleware/gasManager.js +148 -0
- package/dist/cjs/middleware/gasManager.js.map +1 -0
- package/dist/cjs/middleware/userOperationSimulator.d.ts +3 -0
- package/dist/cjs/middleware/userOperationSimulator.js +21 -0
- package/dist/cjs/middleware/userOperationSimulator.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/schema.d.ts +396 -0
- package/dist/cjs/schema.js +26 -0
- package/dist/cjs/schema.js.map +1 -0
- package/dist/cjs/type.d.ts +3 -0
- package/dist/cjs/type.js +3 -0
- package/dist/cjs/type.js.map +1 -0
- package/dist/cjs/version.d.ts +1 -0
- package/dist/cjs/version.js +5 -0
- package/dist/cjs/version.js.map +1 -0
- package/dist/esm/actions/simulateUserOperationChanges.d.ts +5 -0
- package/dist/esm/actions/simulateUserOperationChanges.js +20 -0
- package/dist/esm/actions/simulateUserOperationChanges.js.map +1 -0
- package/dist/esm/actions/types.d.ts +39 -0
- package/dist/esm/actions/types.js +14 -0
- package/dist/esm/actions/types.js.map +1 -0
- package/dist/esm/chains.d.ts +5 -0
- package/dist/esm/chains.js +12 -0
- package/dist/esm/chains.js.map +1 -0
- package/dist/esm/client/decorators/alchemyEnhancedApis.d.ts +14 -0
- package/dist/esm/client/decorators/alchemyEnhancedApis.js +22 -0
- package/dist/esm/client/decorators/alchemyEnhancedApis.js.map +1 -0
- package/dist/esm/client/decorators/smartAccount.d.ts +7 -0
- package/dist/esm/client/decorators/smartAccount.js +5 -0
- package/dist/esm/client/decorators/smartAccount.js.map +1 -0
- package/dist/esm/client/internal/smartAccountClientFromRpc.d.ts +11 -0
- package/dist/esm/client/internal/smartAccountClientFromRpc.js +50 -0
- package/dist/esm/client/internal/smartAccountClientFromRpc.js.map +1 -0
- package/dist/esm/client/isAlchemySmartAccountClient.d.ts +5539 -0
- package/dist/esm/client/isAlchemySmartAccountClient.js +5 -0
- package/dist/esm/client/isAlchemySmartAccountClient.js.map +1 -0
- package/dist/esm/client/rpcClient.d.ts +8 -0
- package/dist/esm/client/rpcClient.js +32 -0
- package/dist/esm/client/rpcClient.js.map +1 -0
- package/dist/esm/client/smartAccountClient.d.ts +18 -0
- package/dist/esm/client/smartAccountClient.js +31 -0
- package/dist/esm/client/smartAccountClient.js.map +1 -0
- package/dist/esm/client/types.d.ts +76 -0
- package/dist/esm/client/types.js +2 -0
- package/dist/esm/client/types.js.map +1 -0
- package/dist/esm/defaults.d.ts +3 -0
- package/dist/esm/defaults.js +19 -0
- package/dist/esm/defaults.js.map +1 -0
- package/dist/esm/errors/base.d.ts +4 -0
- package/dist/esm/errors/base.js +14 -0
- package/dist/esm/errors/base.js.map +1 -0
- package/dist/esm/errors/rpcUrl.d.ts +10 -0
- package/dist/esm/errors/rpcUrl.js +24 -0
- package/dist/esm/errors/rpcUrl.js.map +1 -0
- package/dist/esm/gas-manager.d.ts +6 -0
- package/dist/esm/gas-manager.js +31 -0
- package/dist/esm/gas-manager.js.map +1 -0
- package/dist/esm/index.d.ts +24 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/middleware/feeEstimator.d.ts +3 -0
- package/dist/esm/middleware/feeEstimator.js +22 -0
- package/dist/esm/middleware/feeEstimator.js.map +1 -0
- package/dist/esm/middleware/gasManager.d.ts +29 -0
- package/dist/esm/middleware/gasManager.js +144 -0
- package/dist/esm/middleware/gasManager.js.map +1 -0
- package/dist/esm/middleware/userOperationSimulator.d.ts +3 -0
- package/dist/esm/middleware/userOperationSimulator.js +17 -0
- package/dist/esm/middleware/userOperationSimulator.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/schema.d.ts +396 -0
- package/dist/esm/schema.js +20 -0
- package/dist/esm/schema.js.map +1 -0
- package/dist/esm/type.d.ts +3 -0
- package/dist/esm/type.js +2 -0
- package/dist/esm/type.js.map +1 -0
- package/dist/esm/version.d.ts +1 -0
- package/dist/esm/version.js +2 -0
- package/dist/esm/version.js.map +1 -0
- package/dist/types/actions/simulateUserOperationChanges.d.ts +6 -0
- package/dist/types/actions/simulateUserOperationChanges.d.ts.map +1 -0
- package/dist/types/actions/types.d.ts +44 -0
- package/dist/types/actions/types.d.ts.map +1 -0
- package/dist/types/chains.d.ts +6 -0
- package/dist/types/chains.d.ts.map +1 -0
- package/dist/types/client/decorators/alchemyEnhancedApis.d.ts +15 -0
- package/dist/types/client/decorators/alchemyEnhancedApis.d.ts.map +1 -0
- package/dist/types/client/decorators/smartAccount.d.ts +8 -0
- package/dist/types/client/decorators/smartAccount.d.ts.map +1 -0
- package/dist/types/client/internal/smartAccountClientFromRpc.d.ts +19 -0
- package/dist/types/client/internal/smartAccountClientFromRpc.d.ts.map +1 -0
- package/dist/types/client/isAlchemySmartAccountClient.d.ts +5540 -0
- package/dist/types/client/isAlchemySmartAccountClient.d.ts.map +1 -0
- package/dist/types/client/rpcClient.d.ts +9 -0
- package/dist/types/client/rpcClient.d.ts.map +1 -0
- package/dist/types/client/smartAccountClient.d.ts +19 -0
- package/dist/types/client/smartAccountClient.d.ts.map +1 -0
- package/dist/types/client/types.d.ts +77 -0
- package/dist/types/client/types.d.ts.map +1 -0
- package/dist/types/defaults.d.ts +4 -0
- package/dist/types/defaults.d.ts.map +1 -0
- package/dist/types/errors/base.d.ts +5 -0
- package/dist/types/errors/base.d.ts.map +1 -0
- package/dist/types/errors/rpcUrl.d.ts +11 -0
- package/dist/types/errors/rpcUrl.d.ts.map +1 -0
- package/dist/types/gas-manager.d.ts +7 -0
- package/dist/types/gas-manager.d.ts.map +1 -0
- package/dist/types/index.d.ts +25 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/middleware/feeEstimator.d.ts +4 -0
- package/dist/types/middleware/feeEstimator.d.ts.map +1 -0
- package/dist/types/middleware/gasManager.d.ts +94 -0
- package/dist/types/middleware/gasManager.d.ts.map +1 -0
- package/dist/types/middleware/userOperationSimulator.d.ts +4 -0
- package/dist/types/middleware/userOperationSimulator.d.ts.map +1 -0
- package/dist/types/schema.d.ts +397 -0
- package/dist/types/schema.d.ts.map +1 -0
- package/dist/types/type.d.ts +4 -0
- package/dist/types/type.d.ts.map +1 -0
- package/dist/types/version.d.ts +2 -0
- package/dist/types/version.d.ts.map +1 -0
- package/package.json +75 -0
- package/src/actions/simulateUserOperationChanges.ts +49 -0
- package/src/actions/types.ts +49 -0
- package/src/chains.ts +19 -0
- package/src/client/decorators/alchemyEnhancedApis.ts +54 -0
- package/src/client/decorators/smartAccount.ts +37 -0
- package/src/client/internal/smartAccountClientFromRpc.ts +121 -0
- package/src/client/isAlchemySmartAccountClient.ts +19 -0
- package/src/client/rpcClient.ts +50 -0
- package/src/client/smartAccountClient.ts +153 -0
- package/src/client/types.ts +89 -0
- package/src/defaults.ts +34 -0
- package/src/errors/base.ts +7 -0
- package/src/errors/rpcUrl.ts +20 -0
- package/src/gas-manager.ts +53 -0
- package/src/index.ts +24 -0
- package/src/middleware/feeEstimator.ts +40 -0
- package/src/middleware/gasManager.ts +432 -0
- package/src/middleware/userOperationSimulator.ts +26 -0
- package/src/schema.ts +33 -0
- package/src/type.ts +4 -0
- package/src/version.ts +3 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isAlchemySmartAccountClient.js","sourceRoot":"","sources":["../../../src/client/isAlchemySmartAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAA6B,MAAM,cAAc,CAAC;AAI/E,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAOzC,MAA4C,EACuB,EAAE;IAKrE,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC,CAAC","sourcesContent":["import { isSmartAccountClient, type SmartContractAccount } from \"@aa-sdk/core\";\nimport type { Chain, Client, Transport } from \"viem\";\nimport type { AlchemySmartAccountClient } from \"./smartAccountClient\";\n\nexport const isAlchemySmartAccountClient = <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n): client is AlchemySmartAccountClient<TTransport, TChain, TAccount> => {\n // TODO: the goal of this check is to make sure that the client supports certain RPC methods\n // we should probably do this by checking the client's transport and configured URL, since alchemy\n // clients have to be RPC clients. this is difficult to do though because the transport might\n // point to a proxy url :/\n return isSmartAccountClient(client);\n};\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ConnectionConfig, type NoUndefined } from "@aa-sdk/core";
|
|
2
|
+
import { type Chain, type HttpTransportConfig } from "viem";
|
|
3
|
+
import type { ClientWithAlchemyMethods } from "./types.js";
|
|
4
|
+
export declare const createAlchemyPublicRpcClient: ({ chain: chain_, connectionConfig, fetchOptions, }: {
|
|
5
|
+
connectionConfig: ConnectionConfig;
|
|
6
|
+
chain: Chain;
|
|
7
|
+
fetchOptions?: Omit<RequestInit, "body"> | undefined;
|
|
8
|
+
}) => ClientWithAlchemyMethods;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createBundlerClient, } from "@aa-sdk/core";
|
|
2
|
+
import { http } from "viem";
|
|
3
|
+
import { AlchemyChainSchema } from "../schema.js";
|
|
4
|
+
import { VERSION } from "../version.js";
|
|
5
|
+
export const createAlchemyPublicRpcClient = ({ chain: chain_, connectionConfig, fetchOptions = {}, }) => {
|
|
6
|
+
const chain = AlchemyChainSchema.parse(chain_);
|
|
7
|
+
const rpcUrl = connectionConfig.rpcUrl == null
|
|
8
|
+
? `${chain.rpcUrls.alchemy.http[0]}/${connectionConfig.apiKey ?? ""}`
|
|
9
|
+
: connectionConfig.rpcUrl;
|
|
10
|
+
fetchOptions.headers = {
|
|
11
|
+
...fetchOptions.headers,
|
|
12
|
+
"Alchemy-AA-Sdk-Version": VERSION,
|
|
13
|
+
};
|
|
14
|
+
if (connectionConfig.jwt != null) {
|
|
15
|
+
fetchOptions.headers = {
|
|
16
|
+
...fetchOptions.headers,
|
|
17
|
+
Authorization: `Bearer ${connectionConfig.jwt}`,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return createBundlerClient({
|
|
21
|
+
chain: chain,
|
|
22
|
+
transport: http(rpcUrl, { fetchOptions }),
|
|
23
|
+
}).extend(() => ({
|
|
24
|
+
updateHeaders(newHeaders) {
|
|
25
|
+
fetchOptions.headers = {
|
|
26
|
+
...fetchOptions.headers,
|
|
27
|
+
...newHeaders,
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=rpcClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpcClient.js","sourceRoot":"","sources":["../../../src/client/rpcClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAGpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,IAAI,EAAwC,MAAM,MAAM,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,EAC3C,KAAK,EAAE,MAAM,EACb,gBAAgB,EAChB,YAAY,GAAG,EAAE,GAKlB,EAA4B,EAAE;IAC7B,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE/C,MAAM,MAAM,GACV,gBAAgB,CAAC,MAAM,IAAI,IAAI;QAC7B,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,gBAAgB,CAAC,MAAM,IAAI,EAAE,EAAE;QACrE,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC;IAE9B,YAAY,CAAC,OAAO,GAAG;QACrB,GAAG,YAAY,CAAC,OAAO;QACvB,wBAAwB,EAAE,OAAO;KAClC,CAAC;IAEF,IAAI,gBAAgB,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;QACjC,YAAY,CAAC,OAAO,GAAG;YACrB,GAAG,YAAY,CAAC,OAAO;YACvB,aAAa,EAAE,UAAU,gBAAgB,CAAC,GAAG,EAAE;SAChD,CAAC;IACJ,CAAC;IAED,OAAO,mBAAmB,CAAC;QACzB,KAAK,EAAE,KAAK;QACZ,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,YAAY,EAAE,CAAC;KAC1C,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;QACf,aAAa,CAAC,UAAuB;YACnC,YAAY,CAAC,OAAO,GAAG;gBACrB,GAAG,YAAY,CAAC,OAAO;gBACvB,GAAG,UAAU;aACd,CAAC;QACJ,CAAC;KACF,CAAC,CAAC,CAAC;AACN,CAAC,CAAC","sourcesContent":["import {\n createBundlerClient,\n type ConnectionConfig,\n type NoUndefined,\n} from \"@aa-sdk/core\";\nimport { http, type Chain, type HttpTransportConfig } from \"viem\";\nimport { AlchemyChainSchema } from \"../schema.js\";\nimport { VERSION } from \"../version.js\";\nimport type { ClientWithAlchemyMethods } from \"./types.js\";\n\nexport const createAlchemyPublicRpcClient = ({\n chain: chain_,\n connectionConfig,\n fetchOptions = {},\n}: {\n connectionConfig: ConnectionConfig;\n chain: Chain;\n fetchOptions?: NoUndefined<HttpTransportConfig[\"fetchOptions\"]>;\n}): ClientWithAlchemyMethods => {\n const chain = AlchemyChainSchema.parse(chain_);\n\n const rpcUrl =\n connectionConfig.rpcUrl == null\n ? `${chain.rpcUrls.alchemy.http[0]}/${connectionConfig.apiKey ?? \"\"}`\n : connectionConfig.rpcUrl;\n\n fetchOptions.headers = {\n ...fetchOptions.headers,\n \"Alchemy-AA-Sdk-Version\": VERSION,\n };\n\n if (connectionConfig.jwt != null) {\n fetchOptions.headers = {\n ...fetchOptions.headers,\n Authorization: `Bearer ${connectionConfig.jwt}`,\n };\n }\n\n return createBundlerClient({\n chain: chain,\n transport: http(rpcUrl, { fetchOptions }),\n }).extend(() => ({\n updateHeaders(newHeaders: HeadersInit) {\n fetchOptions.headers = {\n ...fetchOptions.headers,\n ...newHeaders,\n };\n },\n }));\n};\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Prettify, type SmartAccountClient, type SmartAccountClientActions, type SmartAccountClientConfig, type SmartAccountClientRpcSchema, type SmartContractAccount, type UserOperationContext } from "@aa-sdk/core";
|
|
2
|
+
import { type Chain, type Transport } from "viem";
|
|
3
|
+
import { type AlchemyGasManagerConfig } from "../middleware/gasManager.js";
|
|
4
|
+
import type { AlchemyProviderConfig } from "../type.js";
|
|
5
|
+
import type { AlchemySmartAccountClientActions } from "./decorators/smartAccount.js";
|
|
6
|
+
import type { AlchemyRpcSchema } from "./types.js";
|
|
7
|
+
export type AlchemySmartAccountClientConfig<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartContractAccount | undefined = SmartContractAccount | undefined, context extends UserOperationContext | undefined = UserOperationContext | undefined> = {
|
|
8
|
+
account?: account;
|
|
9
|
+
useSimulation?: boolean;
|
|
10
|
+
gasManagerConfig?: AlchemyGasManagerConfig;
|
|
11
|
+
} & AlchemyProviderConfig & Pick<SmartAccountClientConfig<transport, chain, account, context>, "customMiddleware" | "feeEstimator" | "gasEstimator" | "signUserOperation">;
|
|
12
|
+
export type BaseAlchemyActions<chain extends Chain | undefined = Chain | undefined, account extends SmartContractAccount | undefined = SmartContractAccount | undefined, context extends UserOperationContext | undefined = UserOperationContext | undefined> = SmartAccountClientActions<chain, account, context> & AlchemySmartAccountClientActions<account, context>;
|
|
13
|
+
export type AlchemySmartAccountClient_Base<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartContractAccount | undefined = SmartContractAccount | undefined, actions extends Record<string, unknown> = Record<string, unknown>, context extends UserOperationContext | undefined = UserOperationContext | undefined> = Prettify<SmartAccountClient<transport, chain, account, actions & BaseAlchemyActions<chain, account, context>, [
|
|
14
|
+
...SmartAccountClientRpcSchema,
|
|
15
|
+
...AlchemyRpcSchema
|
|
16
|
+
], context>>;
|
|
17
|
+
export type AlchemySmartAccountClient<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartContractAccount | undefined = SmartContractAccount | undefined, actions extends Record<string, unknown> = Record<string, unknown>, context extends UserOperationContext | undefined = UserOperationContext | undefined> = Prettify<AlchemySmartAccountClient_Base<transport, chain, account, actions, context>>;
|
|
18
|
+
export declare function createAlchemySmartAccountClient<TTransport extends Transport = Transport, TChain extends Chain = Chain, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined>({ account, gasManagerConfig, useSimulation, feeEstimator, customMiddleware, gasEstimator, signUserOperation, ...config_ }: AlchemySmartAccountClientConfig<TTransport, TChain, TAccount, TContext>): AlchemySmartAccountClient<TTransport, TChain, TAccount, Record<string, never>, TContext>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {} from "@aa-sdk/core";
|
|
2
|
+
import {} from "viem";
|
|
3
|
+
import { getDefaultUserOperationFeeOptions } from "../defaults.js";
|
|
4
|
+
import {} from "../middleware/gasManager.js";
|
|
5
|
+
import { AlchemyProviderConfigSchema } from "../schema.js";
|
|
6
|
+
import { createAlchemySmartAccountClientFromRpcClient } from "./internal/smartAccountClientFromRpc.js";
|
|
7
|
+
import { createAlchemyPublicRpcClient } from "./rpcClient.js";
|
|
8
|
+
export function createAlchemySmartAccountClient({ account, gasManagerConfig, useSimulation, feeEstimator, customMiddleware, gasEstimator, signUserOperation, ...config_ }) {
|
|
9
|
+
const config = AlchemyProviderConfigSchema.parse(config_);
|
|
10
|
+
const { chain, opts, ...connectionConfig } = config;
|
|
11
|
+
const client = createAlchemyPublicRpcClient({
|
|
12
|
+
chain,
|
|
13
|
+
connectionConfig,
|
|
14
|
+
});
|
|
15
|
+
const feeOptions = opts?.feeOptions ?? getDefaultUserOperationFeeOptions(chain);
|
|
16
|
+
return createAlchemySmartAccountClientFromRpcClient({
|
|
17
|
+
client,
|
|
18
|
+
account,
|
|
19
|
+
opts: {
|
|
20
|
+
...opts,
|
|
21
|
+
feeOptions,
|
|
22
|
+
},
|
|
23
|
+
gasManagerConfig,
|
|
24
|
+
useSimulation,
|
|
25
|
+
feeEstimator,
|
|
26
|
+
customMiddleware,
|
|
27
|
+
gasEstimator,
|
|
28
|
+
signUserOperation,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=smartAccountClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smartAccountClient.js","sourceRoot":"","sources":["../../../src/client/smartAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAQN,MAAM,cAAc,CAAC;AACtB,OAAO,EAA8B,MAAM,MAAM,CAAC;AAClD,OAAO,EAAE,iCAAiC,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAgC,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAG3D,OAAO,EAAE,4CAA4C,EAAE,MAAM,yCAAyC,CAAC;AACvG,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAqG9D,MAAM,UAAU,+BAA+B,CAAC,EAC9C,OAAO,EACP,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,GAAG,OAAO,EACsB;IAChC,MAAM,MAAM,GAAG,2BAA2B,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1D,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,gBAAgB,EAAE,GAAG,MAAM,CAAC;IAEpD,MAAM,MAAM,GAAG,4BAA4B,CAAC;QAC1C,KAAK;QACL,gBAAgB;KACjB,CAAC,CAAC;IAEH,MAAM,UAAU,GACd,IAAI,EAAE,UAAU,IAAI,iCAAiC,CAAC,KAAK,CAAC,CAAC;IAE/D,OAAO,4CAA4C,CAAC;QAClD,MAAM;QACN,OAAO;QACP,IAAI,EAAE;YACJ,GAAG,IAAI;YACP,UAAU;SACX;QACD,gBAAgB;QAChB,aAAa;QACb,YAAY;QACZ,gBAAgB;QAChB,YAAY;QACZ,iBAAiB;KAClB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {\n type Prettify,\n type SmartAccountClient,\n type SmartAccountClientActions,\n type SmartAccountClientConfig,\n type SmartAccountClientRpcSchema,\n type SmartContractAccount,\n type UserOperationContext,\n} from \"@aa-sdk/core\";\nimport { type Chain, type Transport } from \"viem\";\nimport { getDefaultUserOperationFeeOptions } from \"../defaults.js\";\nimport { type AlchemyGasManagerConfig } from \"../middleware/gasManager.js\";\nimport { AlchemyProviderConfigSchema } from \"../schema.js\";\nimport type { AlchemyProviderConfig } from \"../type.js\";\nimport type { AlchemySmartAccountClientActions } from \"./decorators/smartAccount.js\";\nimport { createAlchemySmartAccountClientFromRpcClient } from \"./internal/smartAccountClientFromRpc.js\";\nimport { createAlchemyPublicRpcClient } from \"./rpcClient.js\";\nimport type { AlchemyRpcSchema } from \"./types.js\";\n\n// #region AlchemySmartAccountClientConfig\nexport type AlchemySmartAccountClientConfig<\n transport extends Transport = Transport,\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 gasManagerConfig?: AlchemyGasManagerConfig;\n} & AlchemyProviderConfig &\n Pick<\n SmartAccountClientConfig<transport, chain, account, context>,\n \"customMiddleware\" | \"feeEstimator\" | \"gasEstimator\" | \"signUserOperation\"\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 transport extends Transport = Transport,\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 transport,\n chain,\n account,\n actions & BaseAlchemyActions<chain, account, context>,\n [...SmartAccountClientRpcSchema, ...AlchemyRpcSchema],\n context\n >\n>;\n\nexport type AlchemySmartAccountClient<\n transport extends Transport = Transport,\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 AlchemySmartAccountClient_Base<transport, chain, account, actions, context>\n>;\n\nexport function createAlchemySmartAccountClient<\n TTransport extends Transport = Transport,\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 account,\n gasManagerConfig,\n useSimulation,\n feeEstimator,\n customMiddleware,\n gasEstimator,\n signUserOperation,\n ...config_\n}: AlchemySmartAccountClientConfig<\n TTransport,\n TChain,\n TAccount,\n TContext\n>): AlchemySmartAccountClient<\n TTransport,\n TChain,\n TAccount,\n Record<string, never>,\n TContext\n>;\n\nexport function createAlchemySmartAccountClient({\n account,\n gasManagerConfig,\n useSimulation,\n feeEstimator,\n customMiddleware,\n gasEstimator,\n signUserOperation,\n ...config_\n}: AlchemySmartAccountClientConfig): AlchemySmartAccountClient {\n const config = AlchemyProviderConfigSchema.parse(config_);\n const { chain, opts, ...connectionConfig } = config;\n\n const client = createAlchemyPublicRpcClient({\n chain,\n connectionConfig,\n });\n\n const feeOptions =\n opts?.feeOptions ?? getDefaultUserOperationFeeOptions(chain);\n\n return createAlchemySmartAccountClientFromRpcClient({\n client,\n account,\n opts: {\n ...opts,\n feeOptions,\n },\n gasManagerConfig,\n useSimulation,\n feeEstimator,\n customMiddleware,\n gasEstimator,\n signUserOperation,\n });\n}\n"]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type BundlerClient, type UserOperationRequest } from "@aa-sdk/core";
|
|
2
|
+
import type { Address, Hex, HttpTransport } from "viem";
|
|
3
|
+
import type { SimulateUserOperationAssetChangesRequest, SimulateUserOperationAssetChangesResponse } from "../actions/types";
|
|
4
|
+
import type { RequestGasAndPaymasterAndDataOverrides, RequestGasAndPaymasterAndDataResponse, RequestPaymasterAndDataResponse } from "../middleware/gasManager";
|
|
5
|
+
export type AlchemyRpcSchema = [
|
|
6
|
+
{
|
|
7
|
+
Method: "alchemy_requestPaymasterAndData";
|
|
8
|
+
Parameters: [
|
|
9
|
+
{
|
|
10
|
+
policyId: string;
|
|
11
|
+
entryPoint: Address;
|
|
12
|
+
userOperation: UserOperationRequest;
|
|
13
|
+
}
|
|
14
|
+
];
|
|
15
|
+
ReturnType: RequestPaymasterAndDataResponse;
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
Method: "alchemy_requestGasAndPaymasterAndData";
|
|
19
|
+
Parameters: [
|
|
20
|
+
{
|
|
21
|
+
policyId: string;
|
|
22
|
+
entryPoint: Address;
|
|
23
|
+
userOperation: UserOperationRequest;
|
|
24
|
+
dummySignature: Hex;
|
|
25
|
+
overrides?: RequestGasAndPaymasterAndDataOverrides;
|
|
26
|
+
}
|
|
27
|
+
];
|
|
28
|
+
ReturnType: RequestGasAndPaymasterAndDataResponse;
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
Method: "alchemy_simulateUserOperationAssetChanges";
|
|
32
|
+
Parameters: SimulateUserOperationAssetChangesRequest;
|
|
33
|
+
ReturnType: SimulateUserOperationAssetChangesResponse;
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
Method: "rundler_maxPriorityFeePerGas";
|
|
37
|
+
Parameters: [];
|
|
38
|
+
ReturnType: UserOperationRequest["maxPriorityFeePerGas"];
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
export type ClientWithAlchemyMethods = BundlerClient<HttpTransport> & {
|
|
42
|
+
request: BundlerClient<HttpTransport>["request"] & {
|
|
43
|
+
request(args: {
|
|
44
|
+
method: "alchemy_requestPaymasterAndData";
|
|
45
|
+
params: [
|
|
46
|
+
{
|
|
47
|
+
policyId: string;
|
|
48
|
+
entryPoint: Address;
|
|
49
|
+
userOperation: UserOperationRequest;
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
}): Promise<RequestPaymasterAndDataResponse>;
|
|
53
|
+
request(args: {
|
|
54
|
+
method: "alchemy_requestGasAndPaymasterAndData";
|
|
55
|
+
params: [
|
|
56
|
+
{
|
|
57
|
+
policyId: string;
|
|
58
|
+
entryPoint: Address;
|
|
59
|
+
userOperation: UserOperationRequest;
|
|
60
|
+
dummySignature: Hex;
|
|
61
|
+
overrides?: RequestGasAndPaymasterAndDataOverrides;
|
|
62
|
+
}
|
|
63
|
+
];
|
|
64
|
+
}): Promise<RequestGasAndPaymasterAndDataResponse>;
|
|
65
|
+
request(args: {
|
|
66
|
+
method: "alchemy_simulateUserOperationAssetChanges";
|
|
67
|
+
params: SimulateUserOperationAssetChangesRequest;
|
|
68
|
+
}): Promise<SimulateUserOperationAssetChangesResponse>;
|
|
69
|
+
request(args: {
|
|
70
|
+
method: "rundler_maxPriorityFeePerGas";
|
|
71
|
+
params: [];
|
|
72
|
+
}): Promise<UserOperationRequest["maxPriorityFeePerGas"]>;
|
|
73
|
+
}["request"];
|
|
74
|
+
} & {
|
|
75
|
+
updateHeaders: (headers: HeadersInit) => void;
|
|
76
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/client/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,MAAM,cAAc,CAAC","sourcesContent":["import { type BundlerClient, type UserOperationRequest } from \"@aa-sdk/core\";\nimport type { Address, Hex, HttpTransport } from \"viem\";\nimport type {\n SimulateUserOperationAssetChangesRequest,\n SimulateUserOperationAssetChangesResponse,\n} from \"../actions/types\";\nimport type {\n RequestGasAndPaymasterAndDataOverrides,\n RequestGasAndPaymasterAndDataResponse,\n RequestPaymasterAndDataResponse,\n} from \"../middleware/gasManager\";\n\nexport type AlchemyRpcSchema = [\n {\n Method: \"alchemy_requestPaymasterAndData\";\n Parameters: [\n {\n policyId: string;\n entryPoint: Address;\n userOperation: UserOperationRequest;\n }\n ];\n ReturnType: RequestPaymasterAndDataResponse;\n },\n {\n Method: \"alchemy_requestGasAndPaymasterAndData\";\n Parameters: [\n {\n policyId: string;\n entryPoint: Address;\n userOperation: UserOperationRequest;\n dummySignature: Hex;\n overrides?: RequestGasAndPaymasterAndDataOverrides;\n }\n ];\n ReturnType: RequestGasAndPaymasterAndDataResponse;\n },\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];\n\nexport type ClientWithAlchemyMethods = BundlerClient<HttpTransport> & {\n request: BundlerClient<HttpTransport>[\"request\"] &\n {\n request(args: {\n method: \"alchemy_requestPaymasterAndData\";\n params: [\n {\n policyId: string;\n entryPoint: Address;\n userOperation: UserOperationRequest;\n }\n ];\n }): Promise<RequestPaymasterAndDataResponse>;\n\n request(args: {\n method: \"alchemy_requestGasAndPaymasterAndData\";\n params: [\n {\n policyId: string;\n entryPoint: Address;\n userOperation: UserOperationRequest;\n dummySignature: Hex;\n overrides?: RequestGasAndPaymasterAndDataOverrides;\n }\n ];\n }): Promise<RequestGasAndPaymasterAndDataResponse>;\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 }[\"request\"];\n} & {\n updateHeaders: (headers: HeadersInit) => void;\n};\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { arbitrum, arbitrumGoerli, arbitrumSepolia, optimism, optimismGoerli, optimismSepolia, } from "@aa-sdk/core";
|
|
2
|
+
export const getDefaultUserOperationFeeOptions = (chain) => {
|
|
3
|
+
const feeOptions = {
|
|
4
|
+
maxFeePerGas: { multiplier: 1.5 },
|
|
5
|
+
maxPriorityFeePerGas: { multiplier: 1.05 },
|
|
6
|
+
};
|
|
7
|
+
if (new Set([
|
|
8
|
+
arbitrum.id,
|
|
9
|
+
arbitrumGoerli.id,
|
|
10
|
+
arbitrumSepolia.id,
|
|
11
|
+
optimism.id,
|
|
12
|
+
optimismGoerli.id,
|
|
13
|
+
optimismSepolia.id,
|
|
14
|
+
]).has(chain.id)) {
|
|
15
|
+
feeOptions.preVerificationGas = { multiplier: 1.05 };
|
|
16
|
+
}
|
|
17
|
+
return feeOptions;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,cAAc,EACd,eAAe,EACf,QAAQ,EACR,cAAc,EACd,eAAe,GAEhB,MAAM,cAAc,CAAC;AAGtB,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 {\n arbitrum,\n arbitrumGoerli,\n arbitrumSepolia,\n optimism,\n optimismGoerli,\n optimismSepolia,\n type UserOperationFeeOptions,\n} from \"@aa-sdk/core\";\nimport type { Chain } from \"viem\";\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"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseError as CoreBaseError } from "@aa-sdk/core";
|
|
2
|
+
import { VERSION } from "../version.js";
|
|
3
|
+
export class BaseError extends CoreBaseError {
|
|
4
|
+
constructor() {
|
|
5
|
+
super(...arguments);
|
|
6
|
+
Object.defineProperty(this, "version", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: true,
|
|
10
|
+
value: VERSION
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/errors/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,OAAgB,SAAU,SAAQ,aAAa;IAArD;;QAEW;;;;mBAAU,OAAO;WAAC;IAC7B,CAAC;CAAA","sourcesContent":["import { BaseError as CoreBaseError } from \"@aa-sdk/core\";\nimport { VERSION } from \"../version.js\";\n\nexport abstract class BaseError extends CoreBaseError {\n // This version could be different from the aa-core version so we overwrite this here.\n override version = VERSION;\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ConnectionConfig } from "@aa-sdk/core";
|
|
2
|
+
import { type Chain } from "viem";
|
|
3
|
+
import { BaseError } from "./base.js";
|
|
4
|
+
export declare class InvalidRpcUrlError extends BaseError {
|
|
5
|
+
name: string;
|
|
6
|
+
constructor(context: {
|
|
7
|
+
chain: Chain;
|
|
8
|
+
connectionConfig: ConnectionConfig;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {} from "@aa-sdk/core";
|
|
2
|
+
import {} from "viem";
|
|
3
|
+
import { BaseError } from "./base.js";
|
|
4
|
+
export class InvalidRpcUrlError extends BaseError {
|
|
5
|
+
constructor(context) {
|
|
6
|
+
super(["RPC Url not provided"].join("\n"), {
|
|
7
|
+
details: [
|
|
8
|
+
"If you are passing in a chain object and only an API key, make sure to use the chain object exported from @aa-sdk/core",
|
|
9
|
+
"Otherwise, pass in an RPC URL directly",
|
|
10
|
+
].join("\n"),
|
|
11
|
+
metaMessages: [
|
|
12
|
+
`Chain: ${JSON.stringify(context.chain, null, 2)}`,
|
|
13
|
+
`ConnectionConfig: ${JSON.stringify(context.connectionConfig)}`,
|
|
14
|
+
],
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(this, "name", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true,
|
|
20
|
+
value: "InvalidRpcUrlError"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=rpcUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpcUrl.js","sourceRoot":"","sources":["../../../src/errors/rpcUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,MAAM,cAAc,CAAC;AACrD,OAAO,EAAc,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAG/C,YAAY,OAA6D;QACvE,KAAK,CAAC,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACzC,OAAO,EAAE;gBACP,wHAAwH;gBACxH,wCAAwC;aACzC,CAAC,IAAI,CAAC,IAAI,CAAC;YACZ,YAAY,EAAE;gBACZ,UAAU,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE;gBAClD,qBAAqB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE;aAChE;SACF,CAAC,CAAC;QAZI;;;;mBAAO,oBAAoB;WAAC;IAarC,CAAC;CACF","sourcesContent":["import { type ConnectionConfig } from \"@aa-sdk/core\";\nimport { type Chain } from \"viem\";\nimport { BaseError } from \"./base.js\";\n\nexport class InvalidRpcUrlError extends BaseError {\n override name = \"InvalidRpcUrlError\";\n\n constructor(context: { chain: Chain; connectionConfig: ConnectionConfig }) {\n super([\"RPC Url not provided\"].join(\"\\n\"), {\n details: [\n \"If you are passing in a chain object and only an API key, make sure to use the chain object exported from @aa-sdk/core\",\n \"Otherwise, pass in an RPC URL directly\",\n ].join(\"\\n\"),\n metaMessages: [\n `Chain: ${JSON.stringify(context.chain, null, 2)}`,\n `ConnectionConfig: ${JSON.stringify(context.connectionConfig)}`,\n ],\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Address, Chain } from "viem";
|
|
2
|
+
export declare const AlchemyPaymasterAddressV3 = "0x4f84a207A80c39E9e8BaE717c1F25bA7AD1fB08F";
|
|
3
|
+
export declare const AlchemyPaymasterAddressV2 = "0x4Fd9098af9ddcB41DA48A1d78F91F1398965addc";
|
|
4
|
+
export declare const ArbSepoliaPaymasterAddress = "0x0804Afe6EEFb73ce7F93CD0d5e7079a5a8068592";
|
|
5
|
+
export declare const AlchemyPaymasterAddressV1 = "0xc03aac639bb21233e0139381970328db8bceeb67";
|
|
6
|
+
export declare const getAlchemyPaymasterAddress: (chain: Chain) => Address;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { arbitrum, arbitrumSepolia, base, baseSepolia, mainnet, sepolia, optimism, optimismSepolia, polygon, polygonAmoy, polygonMumbai, fraxtal, fraxtalSepolia, zora, zoraSepolia, } from "@aa-sdk/core";
|
|
2
|
+
export const AlchemyPaymasterAddressV3 = "0x4f84a207A80c39E9e8BaE717c1F25bA7AD1fB08F";
|
|
3
|
+
export const AlchemyPaymasterAddressV2 = "0x4Fd9098af9ddcB41DA48A1d78F91F1398965addc";
|
|
4
|
+
export const ArbSepoliaPaymasterAddress = "0x0804Afe6EEFb73ce7F93CD0d5e7079a5a8068592";
|
|
5
|
+
export const AlchemyPaymasterAddressV1 = "0xc03aac639bb21233e0139381970328db8bceeb67";
|
|
6
|
+
export const getAlchemyPaymasterAddress = (chain) => {
|
|
7
|
+
switch (chain.id) {
|
|
8
|
+
case polygonAmoy.id:
|
|
9
|
+
case optimismSepolia.id:
|
|
10
|
+
case baseSepolia.id:
|
|
11
|
+
case zora.id:
|
|
12
|
+
case zoraSepolia.id:
|
|
13
|
+
case fraxtal.id:
|
|
14
|
+
case fraxtalSepolia.id:
|
|
15
|
+
return AlchemyPaymasterAddressV3;
|
|
16
|
+
case mainnet.id:
|
|
17
|
+
case arbitrum.id:
|
|
18
|
+
case optimism.id:
|
|
19
|
+
case polygon.id:
|
|
20
|
+
case base.id:
|
|
21
|
+
return AlchemyPaymasterAddressV2;
|
|
22
|
+
case arbitrumSepolia.id:
|
|
23
|
+
return ArbSepoliaPaymasterAddress;
|
|
24
|
+
case sepolia.id:
|
|
25
|
+
case polygonMumbai.id:
|
|
26
|
+
return AlchemyPaymasterAddressV1;
|
|
27
|
+
default:
|
|
28
|
+
throw new Error(`Unsupported chain: ${chain}`);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=gas-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gas-manager.js","sourceRoot":"","sources":["../../src/gas-manager.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,IAAI,EACJ,WAAW,EACX,OAAO,EACP,OAAO,EACP,QAAQ,EACR,eAAe,EACf,OAAO,EACP,WAAW,EACX,aAAa,EACb,OAAO,EACP,cAAc,EACd,IAAI,EACJ,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,yBAAyB,GACpC,4CAA4C,CAAC;AAC/C,MAAM,CAAC,MAAM,yBAAyB,GACpC,4CAA4C,CAAC;AAC/C,MAAM,CAAC,MAAM,0BAA0B,GACrC,4CAA4C,CAAC;AAC/C,MAAM,CAAC,MAAM,yBAAyB,GACpC,4CAA4C,CAAC;AAE/C,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,KAAY,EAAW,EAAE;IAClE,QAAQ,KAAK,CAAC,EAAE,EAAE,CAAC;QACjB,KAAK,WAAW,CAAC,EAAE,CAAC;QACpB,KAAK,eAAe,CAAC,EAAE,CAAC;QACxB,KAAK,WAAW,CAAC,EAAE,CAAC;QACpB,KAAK,IAAI,CAAC,EAAE,CAAC;QACb,KAAK,WAAW,CAAC,EAAE,CAAC;QACpB,KAAK,OAAO,CAAC,EAAE,CAAC;QAChB,KAAK,cAAc,CAAC,EAAE;YACpB,OAAO,yBAAyB,CAAC;QACnC,KAAK,OAAO,CAAC,EAAE,CAAC;QAChB,KAAK,QAAQ,CAAC,EAAE,CAAC;QACjB,KAAK,QAAQ,CAAC,EAAE,CAAC;QACjB,KAAK,OAAO,CAAC,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,EAAE;YACV,OAAO,yBAAyB,CAAC;QACnC,KAAK,eAAe,CAAC,EAAE;YACrB,OAAO,0BAA0B,CAAC;QACpC,KAAK,OAAO,CAAC,EAAE,CAAC;QAChB,KAAK,aAAa,CAAC,EAAE;YACnB,OAAO,yBAAyB,CAAC;QACnC;YACE,MAAM,IAAI,KAAK,CAAC,sBAAsB,KAAK,EAAE,CAAC,CAAC;IACnD,CAAC;AACH,CAAC,CAAC","sourcesContent":["import type { Address, Chain } from \"viem\";\nimport {\n arbitrum,\n arbitrumSepolia,\n base,\n baseSepolia,\n mainnet,\n sepolia,\n optimism,\n optimismSepolia,\n polygon,\n polygonAmoy,\n polygonMumbai,\n fraxtal,\n fraxtalSepolia,\n zora,\n zoraSepolia,\n} from \"@aa-sdk/core\";\n\nexport const AlchemyPaymasterAddressV3 =\n \"0x4f84a207A80c39E9e8BaE717c1F25bA7AD1fB08F\";\nexport const AlchemyPaymasterAddressV2 =\n \"0x4Fd9098af9ddcB41DA48A1d78F91F1398965addc\";\nexport const ArbSepoliaPaymasterAddress =\n \"0x0804Afe6EEFb73ce7F93CD0d5e7079a5a8068592\";\nexport const AlchemyPaymasterAddressV1 =\n \"0xc03aac639bb21233e0139381970328db8bceeb67\";\n\nexport const getAlchemyPaymasterAddress = (chain: Chain): Address => {\n switch (chain.id) {\n case polygonAmoy.id:\n case optimismSepolia.id:\n case baseSepolia.id:\n case zora.id:\n case zoraSepolia.id:\n case fraxtal.id:\n case fraxtalSepolia.id:\n return AlchemyPaymasterAddressV3;\n case mainnet.id:\n case arbitrum.id:\n case optimism.id:\n case polygon.id:\n case base.id:\n return AlchemyPaymasterAddressV2;\n case arbitrumSepolia.id:\n return ArbSepoliaPaymasterAddress;\n case sepolia.id:\n case polygonMumbai.id:\n return AlchemyPaymasterAddressV1;\n default:\n throw new Error(`Unsupported chain: ${chain}`);\n }\n};\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type * from "./actions/simulateUserOperationChanges.js";
|
|
2
|
+
export { simulateUserOperationChanges } from "./actions/simulateUserOperationChanges.js";
|
|
3
|
+
export type * from "./actions/types.js";
|
|
4
|
+
export { defineAlchemyChain } from "./chains.js";
|
|
5
|
+
export type * from "./client/decorators/alchemyEnhancedApis.js";
|
|
6
|
+
export { alchemyEnhancedApiActions } from "./client/decorators/alchemyEnhancedApis.js";
|
|
7
|
+
export type * from "./client/decorators/smartAccount.js";
|
|
8
|
+
export { alchemyActions } from "./client/decorators/smartAccount.js";
|
|
9
|
+
export { createAlchemySmartAccountClientFromRpcClient as createAlchemySmartAccountClientFromExisting } from "./client/internal/smartAccountClientFromRpc.js";
|
|
10
|
+
export { isAlchemySmartAccountClient } from "./client/isAlchemySmartAccountClient.js";
|
|
11
|
+
export type * from "./client/rpcClient.js";
|
|
12
|
+
export { createAlchemyPublicRpcClient } from "./client/rpcClient.js";
|
|
13
|
+
export type * from "./client/smartAccountClient.js";
|
|
14
|
+
export { createAlchemySmartAccountClient } from "./client/smartAccountClient.js";
|
|
15
|
+
export type * from "./client/types.js";
|
|
16
|
+
export { getDefaultUserOperationFeeOptions } from "./defaults.js";
|
|
17
|
+
export { getAlchemyPaymasterAddress } from "./gas-manager.js";
|
|
18
|
+
export { alchemyFeeEstimator } from "./middleware/feeEstimator.js";
|
|
19
|
+
export type * from "./middleware/gasManager.js";
|
|
20
|
+
export { alchemyGasManagerMiddleware } from "./middleware/gasManager.js";
|
|
21
|
+
export { alchemyUserOperationSimulator } from "./middleware/userOperationSimulator.js";
|
|
22
|
+
export type * from "./schema.js";
|
|
23
|
+
export { AlchemyProviderConfigSchema } from "./schema.js";
|
|
24
|
+
export type { AlchemyProviderConfig } from "./type.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { simulateUserOperationChanges } from "./actions/simulateUserOperationChanges.js";
|
|
2
|
+
export { defineAlchemyChain } from "./chains.js";
|
|
3
|
+
export { alchemyEnhancedApiActions } from "./client/decorators/alchemyEnhancedApis.js";
|
|
4
|
+
export { alchemyActions } from "./client/decorators/smartAccount.js";
|
|
5
|
+
export { createAlchemySmartAccountClientFromRpcClient as createAlchemySmartAccountClientFromExisting } from "./client/internal/smartAccountClientFromRpc.js";
|
|
6
|
+
export { isAlchemySmartAccountClient } from "./client/isAlchemySmartAccountClient.js";
|
|
7
|
+
export { createAlchemyPublicRpcClient } from "./client/rpcClient.js";
|
|
8
|
+
export { createAlchemySmartAccountClient } from "./client/smartAccountClient.js";
|
|
9
|
+
export { getDefaultUserOperationFeeOptions } from "./defaults.js";
|
|
10
|
+
export { getAlchemyPaymasterAddress } from "./gas-manager.js";
|
|
11
|
+
export { alchemyFeeEstimator } from "./middleware/feeEstimator.js";
|
|
12
|
+
export { alchemyGasManagerMiddleware } from "./middleware/gasManager.js";
|
|
13
|
+
export { alchemyUserOperationSimulator } from "./middleware/userOperationSimulator.js";
|
|
14
|
+
export { AlchemyProviderConfigSchema } from "./schema.js";
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AAEzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAEvF,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,4CAA4C,IAAI,2CAA2C,EAAE,MAAM,gDAAgD,CAAC;AAC7J,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,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAEvF,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export type * from \"./actions/simulateUserOperationChanges.js\";\nexport { simulateUserOperationChanges } from \"./actions/simulateUserOperationChanges.js\";\nexport type * from \"./actions/types.js\";\nexport { defineAlchemyChain } 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 { createAlchemySmartAccountClientFromRpcClient as createAlchemySmartAccountClientFromExisting } from \"./client/internal/smartAccountClientFromRpc.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 { alchemyGasManagerMiddleware } from \"./middleware/gasManager.js\";\nexport { alchemyUserOperationSimulator } from \"./middleware/userOperationSimulator.js\";\nexport type * from \"./schema.js\";\nexport { AlchemyProviderConfigSchema } from \"./schema.js\";\nexport type { AlchemyProviderConfig } from \"./type.js\";\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { applyUserOpOverrideOrFeeOption } from "@aa-sdk/core";
|
|
2
|
+
export const alchemyFeeEstimator = (client) => async (struct, { overrides, feeOptions }) => {
|
|
3
|
+
let [block, maxPriorityFeePerGasEstimate] = await Promise.all([
|
|
4
|
+
client.getBlock({ blockTag: "latest" }),
|
|
5
|
+
client.request({
|
|
6
|
+
method: "rundler_maxPriorityFeePerGas",
|
|
7
|
+
params: [],
|
|
8
|
+
}),
|
|
9
|
+
]);
|
|
10
|
+
const baseFeePerGas = block.baseFeePerGas;
|
|
11
|
+
if (baseFeePerGas == null) {
|
|
12
|
+
throw new Error("baseFeePerGas is null");
|
|
13
|
+
}
|
|
14
|
+
const maxPriorityFeePerGas = applyUserOpOverrideOrFeeOption(maxPriorityFeePerGasEstimate, overrides?.maxPriorityFeePerGas, feeOptions?.maxPriorityFeePerGas);
|
|
15
|
+
const maxFeePerGas = applyUserOpOverrideOrFeeOption(baseFeePerGas + BigInt(maxPriorityFeePerGas), overrides?.maxFeePerGas, feeOptions?.maxFeePerGas);
|
|
16
|
+
return {
|
|
17
|
+
...struct,
|
|
18
|
+
maxPriorityFeePerGas,
|
|
19
|
+
maxFeePerGas,
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=feeEstimator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feeEstimator.js","sourceRoot":"","sources":["../../../src/middleware/feeEstimator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAG9D,MAAM,CAAC,MAAM,mBAAmB,GAG9B,CAAC,MAAM,EAAE,EAAE,CACX,KAAK,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE;IAC1C,IAAI,CAAC,KAAK,EAAE,4BAA4B,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC5D,MAAM,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;QAEvC,MAAM,CAAC,OAAO,CAAC;YACb,MAAM,EAAE,8BAA8B;YACtC,MAAM,EAAE,EAAE;SACX,CAAC;KACH,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;IAC1C,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,oBAAoB,GAAG,8BAA8B,CACzD,4BAA4B,EAC5B,SAAS,EAAE,oBAAoB,EAC/B,UAAU,EAAE,oBAAoB,CACjC,CAAC;IACF,MAAM,YAAY,GAAG,8BAA8B,CACjD,aAAa,GAAG,MAAM,CAAC,oBAAoB,CAAC,EAC5C,SAAS,EAAE,YAAY,EACvB,UAAU,EAAE,YAAY,CACzB,CAAC;IAEF,OAAO;QACL,GAAG,MAAM;QACT,oBAAoB;QACpB,YAAY;KACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { ClientMiddlewareFn } from \"@aa-sdk/core\";\nimport { applyUserOpOverrideOrFeeOption } from \"@aa-sdk/core\";\nimport type { ClientWithAlchemyMethods } from \"../client/types\";\n\nexport const alchemyFeeEstimator: <C extends ClientWithAlchemyMethods>(\n client: C\n) => ClientMiddlewareFn =\n (client) =>\n async (struct, { overrides, feeOptions }) => {\n let [block, maxPriorityFeePerGasEstimate] = await Promise.all([\n client.getBlock({ blockTag: \"latest\" }),\n // it is a fair assumption that if someone is using this Alchemy Middleware, then they are using Alchemy RPC\n client.request({\n method: \"rundler_maxPriorityFeePerGas\",\n params: [],\n }),\n ]);\n\n const baseFeePerGas = block.baseFeePerGas;\n if (baseFeePerGas == null) {\n throw new Error(\"baseFeePerGas is null\");\n }\n\n const maxPriorityFeePerGas = applyUserOpOverrideOrFeeOption(\n maxPriorityFeePerGasEstimate,\n overrides?.maxPriorityFeePerGas,\n feeOptions?.maxPriorityFeePerGas\n );\n const maxFeePerGas = applyUserOpOverrideOrFeeOption(\n baseFeePerGas + BigInt(maxPriorityFeePerGas),\n overrides?.maxFeePerGas,\n feeOptions?.maxFeePerGas\n );\n\n return {\n ...struct,\n maxPriorityFeePerGas,\n maxFeePerGas,\n };\n };\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Address, ClientMiddlewareConfig, ClientMiddlewareFn, EntryPointVersion, Multiplier, UserOperationRequest } from "@aa-sdk/core";
|
|
2
|
+
import { type Hex } from "viem";
|
|
3
|
+
import type { ClientWithAlchemyMethods } from "../client/types";
|
|
4
|
+
export type RequestGasAndPaymasterAndDataOverrides<TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = Partial<{
|
|
5
|
+
maxFeePerGas: UserOperationRequest<TEntryPointVersion>["maxFeePerGas"] | Multiplier;
|
|
6
|
+
maxPriorityFeePerGas: UserOperationRequest<TEntryPointVersion>["maxPriorityFeePerGas"] | Multiplier;
|
|
7
|
+
callGasLimit: UserOperationRequest<TEntryPointVersion>["callGasLimit"] | Multiplier;
|
|
8
|
+
verificationGasLimit: UserOperationRequest<TEntryPointVersion>["verificationGasLimit"] | Multiplier;
|
|
9
|
+
preVerificationGas: UserOperationRequest<TEntryPointVersion>["preVerificationGas"] | Multiplier;
|
|
10
|
+
} & TEntryPointVersion extends "0.7.0" ? {
|
|
11
|
+
paymasterVerificationGasLimit: UserOperationRequest<"0.7.0">["paymasterVerificationGasLimit"] | Multiplier;
|
|
12
|
+
paymasterPostOpGasLimit: UserOperationRequest<"0.7.0">["paymasterPostOpGasLimit"] | Multiplier;
|
|
13
|
+
} : {}>;
|
|
14
|
+
export type RequestPaymasterAndDataResponse<TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = TEntryPointVersion extends "0.6.0" ? {
|
|
15
|
+
paymasterAndData: UserOperationRequest<"0.6.0">["paymasterAndData"];
|
|
16
|
+
} : TEntryPointVersion extends "0.7.0" ? Pick<UserOperationRequest<"0.7.0">, "paymaster" | "paymasterData"> : {};
|
|
17
|
+
export type RequestGasAndPaymasterAndDataResponse<TEntryPointVersion extends EntryPointVersion = EntryPointVersion> = Pick<UserOperationRequest, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "maxFeePerGas" | "maxPriorityFeePerGas"> & RequestPaymasterAndDataResponse<TEntryPointVersion>;
|
|
18
|
+
export interface AlchemyGasManagerConfig {
|
|
19
|
+
policyId: string;
|
|
20
|
+
gasEstimationOptions?: AlchemyGasEstimationOptions;
|
|
21
|
+
paymasterAddress?: Address;
|
|
22
|
+
dummyData?: Hex;
|
|
23
|
+
}
|
|
24
|
+
export interface AlchemyGasEstimationOptions {
|
|
25
|
+
disableGasEstimation: boolean;
|
|
26
|
+
fallbackGasEstimator?: ClientMiddlewareFn;
|
|
27
|
+
fallbackFeeDataGetter?: ClientMiddlewareFn;
|
|
28
|
+
}
|
|
29
|
+
export declare function alchemyGasManagerMiddleware<C extends ClientWithAlchemyMethods>(client: C, config: AlchemyGasManagerConfig): Pick<ClientMiddlewareConfig, "paymasterAndData" | "feeEstimator" | "gasEstimator">;
|