/** * Rebuild a bip122 account the parent flattened for the wire. * * `BridgeParent.toBip122WireAccount` sends `publicKey` as a number array, * because Comlink's structured clone drops the wallet's prototype-accessor * fields entirely. Reviving it to a `Uint8Array` here means the injected * adapter sees exactly the shape it sees in direct mode, so nothing downstream * needs to know whether it is running framed. */ export declare function reviveBip122Account(account: unknown): unknown; export declare class BridgeChild { private parentAPI?; private tronInjectedIds; private tonJsBridgeKeys; private eip6963Done; private solanaDone; private bitcoinDone; private tronDone; private tonDone; private bip122ParentIndex; private onError?; private reportedBridgeErrors; private static readonly MAX_REPORTED_BRIDGE_ERRORS; constructor(options?: { tronInjectedIds?: string[]; tonJsBridgeKeys?: string[]; onError?: (info: { namespace: string; message: string; }) => void; }); /** * Surface a bridge-discovery failure ONCE per (namespace, message). Benign * poll-misses (`BridgeReadTimeout` — the parent isn't live yet, retried next * tick) are NOT reported; only real failures (older/unsupported parent, * malformed marshaling) reach the observer. */ private reportBridgeError; private initializeConnection; /** * Install `window.__uwcRefreshBip122Accounts(walletId)`, which re-reads a * bip122 wallet's accounts from the parent into the copy marshaled here. * * `tryMarshalBitcoin` copies `accounts` once, at startup, and a grant usually * lands later: an EVM or Solana connect to MetaMask grants its Bitcoin * account too. The injected connector calls this before it reads `accounts`, * so a framed session gathers that account the way a direct one does. The * marshaled wallet is updated in place because the connector holds that same * object. * * Best-effort: an unknown wallet or a failed read leaves the copy as it was. * An older parent built its list once, so re-reading it changes nothing. */ private installBip122AccountsRefresh; /** * Install window globals the injected EVM/TRON connectors call directly to * subscribe to live provider events across the bridge (accountsChanged, * chainChanged, disconnect) — mirrors this file's existing convention of * exposing bridge capability via `window.*` rather than requiring callers * to hold a `BridgeChild` instance reference (see `window.eip6963Wallets` * etc. above). Only installed once `this.parentAPI` exists, i.e. only in * bridge mode. */ private installProviderEventSubscriptionGlobals; private anyWindowWalletsAlreadySet; private syncParentOrigin; private pollForWallets; private fillEmptyDefaults; /** * A readiness read that RESOLVES `undefined` means the parent is live but its * ParentAPI predates this namespace: real Comlink resolves a GET on a missing * property to `undefined` (it never rejects), while a not-yet-exposed parent * makes the read hang into a BridgeReadTimeout instead. Waiting cannot turn * that answer into `true`, so complete the namespace with [] now rather than * retrying to the MAX_POLL_MS backstop — on hosts embedding via an old SDK * (e.g. mesh-web-sdk 3.3.x shipping uwc-bridge-parent 0.0.2, which predates * tron/ton) that retry loop stalled consumer-side wallet detection ~5 s on * every load. Reported once per namespace so the "why didn't wallet X * appear?" class stays observable. */ private completeUnsupportedNamespace; private tryMarshalEip6963; private tryMarshalSolana; private tryMarshalBitcoin; private tryMarshalTron; private tryMarshalTon; } //# sourceMappingURL=BridgeChild.d.ts.map