UNPKG

@account-kit/infra

Version:

adapters for @aa-sdk/core for interacting with alchemy services

23 lines (22 loc) 2.99 kB
import { type Prettify, type SmartAccountClient, type SmartAccountClientActions, type SmartAccountClientConfig, type SmartAccountClientRpcSchema, type SmartContractAccount, type SmartContractAccountWithSigner, type UserOperationContext } from "@aa-sdk/core"; import { type Chain } from "viem"; import { type AlchemyTransport } from "../alchemyTransport.js"; import { type AlchemySmartAccountClientActions } from "./decorators/smartAccount.js"; import type { AlchemyRpcSchema } from "./types.js"; import type { PolicyToken } from "../middleware/gasManager.js"; export declare function getSignerTypeHeader<TAccount extends SmartContractAccountWithSigner>(account: TAccount): { "Alchemy-Aa-Sdk-Signer": string; }; export type AlchemySmartAccountClientConfig<chain extends Chain | undefined = Chain | undefined, account extends SmartContractAccount | undefined = SmartContractAccount | undefined, context extends UserOperationContext | undefined = UserOperationContext | undefined> = { account?: account; useSimulation?: boolean; policyId?: string | string[]; policyToken?: PolicyToken; } & Pick<SmartAccountClientConfig<AlchemyTransport, chain, account, context>, "customMiddleware" | "feeEstimator" | "gasEstimator" | "signUserOperation" | "transport" | "chain" | "opts">; 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>; export type AlchemySmartAccountClient_Base<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<AlchemyTransport, chain, account, actions & BaseAlchemyActions<chain, account, context>, [ ...SmartAccountClientRpcSchema, ...AlchemyRpcSchema ], context>>; export type AlchemySmartAccountClient<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<chain, account, actions, context>>; export declare function createAlchemySmartAccountClient<TChain extends Chain = Chain, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = UserOperationContext | undefined>(params: AlchemySmartAccountClientConfig<TChain, TAccount, TContext>): AlchemySmartAccountClient<TChain, TAccount, Record<string, never>, TContext>;