import { type Account, type Address, type Chain, type ClientConfig, type Hex, type LocalAccount, type OneOf, type Prettify, type PublicClient, type RpcSchema, type SignAuthorizationReturnType, type Transport, type WalletClient } from "viem"; import { type SmartAccount, type SmartAccountImplementation, type UserOperation } from "viem/account-abstraction"; import { EntrypointAbi } from "../constants/abi"; import type { Module } from "../modules/utils/Types"; import type { Validator } from "../modules/validators/toValidator"; import type { Call } from "./utils/Types"; import { type EthersWallet } from "./utils/Utils"; import { type EthereumProvider, type Signer } from "./utils/toSigner"; /** * Base module configuration type */ export type MinimalModuleConfig = { module: Address; data: Hex; }; /** * Generic module configuration type that can be extended with additional properties */ export type GenericModuleConfig = T; export type PrevalidationHookModuleConfig = GenericModuleConfig & { hookType: bigint; }; /** * Parameters for creating a Startale Smart Account */ export type ToStartaleSmartAccountParameters = { /** The blockchain network */ chain: Chain; /** The transport configuration */ transport: ClientConfig["transport"]; /** The signer account or address */ signer: OneOf | LocalAccount | EthersWallet>; /** Optional index for the account */ index?: bigint | undefined; /** Optional account address override */ accountAddress?: Address; /** Optional validator modules configuration */ validators?: Array; /** Optional executor modules configuration */ executors?: Array; /** Optional prevalidation hook modules configuration */ prevalidationHooks?: Array; /** Optional hook module configuration */ hook?: GenericModuleConfig; /** Optional fallback modules configuration */ fallbacks?: Array; /** Optional registry address */ registryAddress?: Address; /** Optional factory address */ factoryAddress?: Address; /** Optional bootstrap address */ bootStrapAddress?: Address; /** Optional account implementation address */ accountImplementationAddress?: Address; /** Optional EIP-7702 Authorization */ eip7702Auth?: SignAuthorizationReturnType | undefined; /** Optional EIP-7702 Account */ eip7702Account?: Signer; } & Prettify, "account" | "cacheTime" | "chain" | "key" | "name" | "pollingInterval" | "rpcSchema">>; /** * Startale Smart Account type */ export type StartaleSmartAccount = Prettify>; /** * Startale Smart Account Implementation */ export type StartaleSmartAccountImplementation = SmartAccountImplementation Promise
; /** Gets the init code for the account */ getInitCode: () => Hex; /** Encodes a single call for execution */ encodeExecute: (call: Call) => Promise; /** Encodes a batch of calls for execution */ encodeExecuteBatch: (calls: readonly Call[]) => Promise; /** Calculates the hash of a user operation */ getUserOpHash: (userOp: UserOperation) => Hex; /** Factory data used for account creation */ factoryData: Hex; /** Factory address used for account creation */ factoryAddress: Address; /** The signer instance */ signer: Signer; /** The public client instance */ publicClient: PublicClient; /** The wallet client instance */ walletClient: WalletClient; /** The blockchain network */ chain: Chain; accountImplementationAddress: Address; /** Get the active module */ getModule: () => Validator; /** Set the active module */ setModule: (validationModule: Module) => void; /** EIP-7702 Authorization */ eip7702Authorization?: (() => Promise) | undefined; /** Execute the transaction to unauthorize the account */ unDelegate: () => Promise; /** Check if the account is delegated to the implementation address */ isDelegated: () => Promise; }>; /** * @description Create a Startale Smart Account. * * @param parameters - {@link ToStartaleSmartAccountParameters} * @returns Startale Smart Account. {@link StartaleSmartAccount} * * @example * import { toStartaleAccount } from '@startale-scs/aa-sdk' * import { createWalletClient, http } from 'viem' * import { mainnet } from 'viem/chains' * * const account = await toStartaleAccount({ * chain: mainnet, * transport: http(), * signer: '0x...', * }) */ export declare const toStartaleSmartAccount: (parameters: ToStartaleSmartAccountParameters) => Promise; //# sourceMappingURL=toStartaleSmartAccount.d.ts.map