import { AdapterState, WalletReadyState, type Network, AddonAdapter } from '@tronweb3/tronwallet-abstract-adapter'; import type { Transaction, SignedTransaction, AdapterName, BaseAdapterConfig } from '@tronweb3/tronwallet-abstract-adapter'; import { type WalletConnectAdapterConfig } from '@tronweb3/tronwallet-adapter-walletconnect'; declare global { interface Window { isBinance: boolean; binancew3w?: { tron?: any; }; } } export interface BinanceWalletAdapterConfig extends BaseAdapterConfig { /** * Timeout in millisecond for checking if Binance Wallet exists. * Default is 2 * 1000ms */ checkTimeout?: number; /** * Whether to open Binance Wallet download page when wallet is not found. * Default is true */ openUrlWhenWalletNotFound?: boolean; /** * Use WalletConnect as fallback when Binance Wallet is not found. * Default is false */ useWalletConnectWhenWalletNotFound?: boolean; /** * Whether to open the Binance app via deeplink on a mobile browser when the * Binance Wallet provider is not injected. * Default is true */ openAppWithDeeplink?: boolean; walletConnectConfig?: WalletConnectAdapterConfig; /** * Callback to receive the WalletConnect URI for custom QR code rendering. * When provided, the AppKit modal will be skipped. * Only used when falling back to WalletConnect. */ onWalletConnectUri?: (uri: string) => void; } export declare const BinanceWalletAdapterName: AdapterName<"Binance Wallet">; export declare class BinanceWalletAdapter extends AddonAdapter { name: AdapterName<"Binance Wallet">; url: string; icon: string; config: Required> & { walletConnectConfig?: WalletConnectAdapterConfig; onWalletConnectUri?: (uri: string) => void; }; private _readyState; private _state; private _connecting; private _provider; private _address; private _walletConnectAdapter; private _wcDisconnectHandler; constructor(config?: BinanceWalletAdapterConfig); get address(): string | null; get state(): AdapterState; get readyState(): WalletReadyState; get connecting(): boolean; /** * Set the onWalletConnectUri callback for custom QR code rendering. * This allows dynamic configuration of the URI handler after adapter initialization. * * Note: If called while connecting, the change will not affect the current connection * but will take effect on the next connection attempt. * * @param callback - Callback to receive the WalletConnect URI */ setOnWalletConnectUri(callback: ((uri: string) => void) | undefined): void; /** * Get network information used by Binance Wallet. * @returns {Network} Current network information. */ network(): Promise; protected _connect(): Promise; disconnect(): Promise; signMessage(message: string): Promise; signTransaction(transaction: Transaction): Promise; /** * Sign transaction and broadcast the signed transaction with Binance wallet selected network. * @param transaction * @returns */ signAndSendTransaction(transaction: Transaction): Promise<{ signature: string; txHash: string; transaction: SignedTransaction; wcResult?: { result: boolean; txid: string; }; }>; /** * Keep address and state in step. * * `connected` is derived from `state === AdapterState.Connected`, so updating only * `_address` lets the two drift apart permanently: after the wallet reports an * empty account list the adapter would hold no address while still claiming to be * connected. An empty list also has to normalize to `null` rather than the * `undefined` that `address[0]` yields. */ private _onAccountsChanged; private _listenEvent; private _stopListenEvent; private _checkPromise; /** * Detection polls for the full `checkTimeout` only once. Later attempts re-check a * single time, so retrying is free when the wallet is genuinely absent. */ private _hasRunInitialDetection; protected _checkWallet(): Promise; private _updateProvider; private setAddress; private setState; /** * Open the Binance app via deeplink when running in a mobile browser and the * Binance Wallet provider is not injected. Returns `true` when the deeplink * was triggered, `false` otherwise (so the caller can fall back to opening * the download page). */ protected _openAppByDeepLinkIfNeed(): boolean; } //# sourceMappingURL=adapter.d.ts.map