Close the modal. The optional reason is forwarded to subscribers via
WalletModalClosed.closeReason.
Subscribe to modal state changes. Returns an unsubscribe function.
Call to stop listening.
Open the modal.
Current modal state — snapshot, not reactive.
Imperative handle on the connect-wallet modal. Available as
tonConnectUI.modal. Prefer the convenience methods onTonConnectUI(openModal(),closeModal(),onModalStateChange()) — this interface is exposed for advanced cases that need direct access to the modal state.