import { Address } from 'viem'; declare const POLYMARKET_POLYGON_CHAIN_ID = 137; /** * Headless Polymarket account lookup, exported via the * `@rhinestone/deposit-modal/polymarket` subpath so a consumer can render * the user's Polymarket address + balance in their own UI (no React, no * modal, no wallet-connect stack in the bundle). */ interface PolymarketTokenBalance { /** Base units (6 decimals). */ raw: bigint; /** `formatUnits(raw, 6)`. */ formatted: string; /** 1:1 for pUSD and USDC.e. */ usd: number; } interface PolymarketAccount { eoa: Address; /** Present even when balances are zero. */ proxyWallet: Address; chainId: typeof POLYMARKET_POLYGON_CHAIN_ID; pusd: PolymarketTokenBalance; usdce: PolymarketTokenBalance; totalUsd: number; } /** * Looks up the Polymarket proxy wallet for an EOA and reads its pUSD and * USDC.e balances on Polygon. * * - Resolves `null` ONLY when the EOA has no Polymarket proxy at all. * Found-but-empty resolves a full account with zeroed balances — the * address is the headline. * - A failed balance read (RPC outage) also resolves the account with * zeroed balances rather than rejecting. * - Transient Gamma failures (network, 5xx) and aborts reject, so a * caller never mistakes an outage for "no account". * * The balance reported here is "what exists" at the proxy. The modal's * own availability check additionally verifies the EOA can MOVE those * funds (Safe owner / deposit-wallet owner) — an account whose EOA owns * neither reports a balance here but routes to the modal's home screen * when opened via `initialDappImport`. * * `signal` cancels the Gamma profile fetch and short-circuits between * steps; an in-flight RPC balance read itself is not cancellable. */ declare function getPolymarketAccount(params: { eoa: Address | string; /** Overrides the default public Polygon RPC. */ rpcUrl?: string; signal?: AbortSignal; }): Promise; export { type PolymarketAccount, type PolymarketTokenBalance, getPolymarketAccount };