import { Account, type Call, type PaymasterTimeBounds, RpcProvider, type Signature, type TypedData } from "starknet"; import { Tx } from "../tx/index.js"; import { AccountProvider } from "../wallet/accounts/provider.js"; import type { SignerInterface } from "../signer/index.js"; import type { AccountClassConfig, Address, ChainId, DeployOptions, EnsureReadyOptions, ExecuteOptions, FeeMode, PreflightOptions, PreflightResult, ProviderOptions, SDKConfig } from "../types/index.js"; import type { WalletInterface } from "../wallet/interface.js"; import { BaseWallet } from "../wallet/base.js"; export { type WalletInterface } from "../wallet/interface.js"; export { BaseWallet } from "../wallet/base.js"; export { AccountProvider } from "../wallet/accounts/provider.js"; /** * Options for creating a Wallet. */ export interface WalletOptions extends ProviderOptions { /** Account: either AccountProvider or { signer, accountClass? } */ account: AccountProvider | { signer: SignerInterface; accountClass?: AccountClassConfig; }; /** RPC provider */ provider: RpcProvider; /** SDK configuration */ config: SDKConfig; /** Known address (skips address computation if provided) */ accountAddress?: Address; /** Default fee mode (default: "user_pays") */ feeMode?: FeeMode; /** Default time bounds for paymaster transactions */ timeBounds?: PaymasterTimeBounds; } /** * Register swap and DCA providers on a wallet from shared options. */ export declare function applyProviders(wallet: WalletInterface, options: ProviderOptions): void; /** * Wallet implementation using a custom signer and account preset. * * This is the default wallet implementation that uses: * - A `SignerInterface` for signing (e.g., `StarkSigner` with a private key) * - An `AccountClassConfig` preset (e.g., `OpenZeppelinPreset`, `ArgentPreset`) * * For Cartridge Controller integration, use `CartridgeWallet` instead. * * @example * ```ts * const wallet = await Wallet.create({ * signer: new StarkSigner(privateKey), * accountClass: ArgentPreset, * provider, * config, * }); * ``` */ export declare class Wallet extends BaseWallet { private readonly provider; private readonly account; private readonly accountProvider; private readonly chainId; private readonly explorerConfig; private readonly defaultFeeMode; private readonly defaultTimeBounds; private deployedCache; private deployedCacheExpiresAt; private sponsoredDeployLock; private constructor(); /** * Create a new Wallet instance. * * @example * ```ts * // With signer (address computed from public key) * const wallet = await Wallet.create({ * account: { signer: new StarkSigner(privateKey), accountClass: ArgentPreset }, * provider, * config, * }); * * // With known address (skips address computation) * const wallet = await Wallet.create({ * account: { signer: new StarkSigner(privateKey) }, * address: "0x123...", * provider, * config, * }); * ``` */ static create(options: WalletOptions): Promise; isDeployed(): Promise; private clearDeploymentCache; private withSponsoredDeployLock; ensureReady(options?: EnsureReadyOptions): Promise; deploy(options?: DeployOptions): Promise; private deployPaymasterWith; /** * Deploy a Braavos account via the Braavos factory. * * This works by: * 1. Deploying a temporary OZ account (same public key) via paymaster * 2. Using that OZ account to call the Braavos factory * 3. The factory deploys the Braavos account */ private deployBraavosViaFactory; execute(calls: Call[], options?: ExecuteOptions): Promise; private executeUserPays; private executePaymaster; private executeSponsored; signMessage(typedData: TypedData): Promise; preflight(options: PreflightOptions): Promise; getAccount(): Account; getProvider(): RpcProvider; /** * Get the chain ID this wallet is connected to. */ getChainId(): ChainId; /** * Get the default fee mode for this wallet. */ getFeeMode(): FeeMode; /** * Get the account class hash. */ getClassHash(): string; /** * Estimate the fee for executing calls. * * @example * ```ts * const fee = await wallet.estimateFee([ * { contractAddress: "0x...", entrypoint: "transfer", calldata: [...] } * ]); * console.log(`Estimated fee: ${fee.overall_fee}`); * ``` */ estimateFee(calls: Call[]): Promise; disconnect(): Promise; } //# sourceMappingURL=index.d.ts.map