import { MAX_POLL_MS } from '@meshconnect/uwc-bridge-child' /** * Consumer-side budget for the bridge wallet poll * (pollForBridgeWallets in eip6963/wallet-standard/tron/ton-discovery.ts). * * Derived as the bridge child's own budget (MAX_POLL_MS) plus a grace margin, so * the invariant "consumer budget > child budget" is enforced by construction * rather than by a comment. Why it must hold: * - The child writes window.{tron,ton}Wallets — real wallets, or [] via its * fillEmptyDefaults backstop — up to its own MAX_POLL_MS deadline. * - Consumer-side wallet detection is ONE-SHOT: UniversalWalletConnector runs * it once at construction, and connectTron later reads the cached result. A * missed wallet there throws "tron provider was not detected" until reload. * - A wallet that becomes ready on the child's LAST tick is written a few ms * AFTER MAX_POLL_MS (the marshal is a Comlink round-trip). The grace covers * that tail, so an equal deadline can't let the consumer resolve [] on the * same tick and cache it. */ const GRACE_MS = 300 export const BRIDGE_WALLET_POLL_MS = MAX_POLL_MS + GRACE_MS