import { RpcProvider, type Call, type PaymasterTimeBounds } from "starknet"; import type { PAYMASTER_API } from "@starknet-io/starknet-types-010"; import { Tx } from "../tx/index.js"; import type { Address } from "../types/index.js"; import type { DeployOptions, EnsureReadyOptions, FeeMode, PreflightOptions, PreflightResult } from "../types/index.js"; /** Canonical (non-deprecated) fee mode variants. */ export type NormalizedFeeMode = "user_pays" | { type: "paymaster"; gasToken?: Address; }; /** * Normalize FeeMode by converting the deprecated `"sponsored"` alias * to its canonical `{ type: "paymaster" }` form. */ export declare function normalizeFeeMode(feeMode: FeeMode): NormalizedFeeMode; /** Type guard: does this fee mode use the paymaster path? */ export declare function isPaymasterMode(feeMode: FeeMode | undefined): feeMode is { type: "paymaster"; gasToken?: Address; } | "sponsored"; /** * Shared wallet utilities. * Used by wallet implementations to avoid code duplication. */ /** * Check if an account is deployed on-chain. */ export declare function checkDeployed(provider: RpcProvider, address: Address): Promise; /** * Ensure a wallet is ready for transactions. */ export declare function ensureWalletReady(wallet: { isDeployed: () => Promise; deploy: (options?: DeployOptions) => Promise; }, options?: EnsureReadyOptions): Promise; /** * Simulate a transaction to check if it would succeed. */ export declare function preflightTransaction(wallet: { isDeployed: () => Promise; }, account: { simulateTransaction: (invocations: Array<{ type: "INVOKE"; payload: Call[]; }>) => Promise; }, options: PreflightOptions): Promise; /** Build PaymasterDetails for sponsored or gasToken transactions. */ export declare function paymasterDetails(options: { feeMode: { type: "paymaster"; gasToken?: Address; }; timeBounds?: PaymasterTimeBounds | undefined; deploymentData?: PAYMASTER_API.ACCOUNT_DEPLOYMENT_DATA | undefined; }): { deploymentData?: PAYMASTER_API.ACCOUNT_DEPLOYMENT_DATA; timeBounds?: PaymasterTimeBounds; feeMode: { mode: "default"; gasToken: Address; } | { mode: "sponsored"; gasToken?: never; }; }; //# sourceMappingURL=utils.d.ts.map