Documentation
    Preparing search index...

    Class TonConnectUI

    Index

    Constructors

    Properties

    connectionRestored: Promise<boolean> = ...

    Promise that resolves after end of th connection restoring process (promise will fire after onStatusChange, so you can get actual information about wallet and session after when promise resolved). Resolved value true/false indicates if the session was restored successfully.

    connector: ITonConnect

    TonConnect instance.

    Manages the modal window state.

    Accessors

    • get singleWalletModalState(): SingleWalletModalState
      Experimental

      Returns current single wallet modal window state.

      Returns SingleWalletModalState

    Methods

    • Returns Promise<ConnectedWallet>

      Connected wallet.

      Use tonConnectUI.openModal() instead. Will be removed in the next major version. Opens the modal window and handles a wallet connection.

      TonConnectUIError if connection was aborted.

    • Experimental

      Subscribe to the single wallet modal window state changes, returns a function which has to be called to unsubscribe.

      Parameters

      • onChange: (state: SingleWalletModalState) => void

      Returns () => void

    • Opens the modal window, returns a promise that resolves after the modal window is opened.

      Returns Promise<void>

    • Experimental

      Opens the single wallet modal window, returns a promise that resolves after the modal window is opened.

      Parameters

      • wallet: string

      Returns Promise<void>

    • Use it to customize ConnectRequest and add tonProof payload. You can call it multiply times to set updated tonProof payload if previous one is outdated. If connectRequestParameters.state === 'loading' loader will appear instead of the qr code in the wallets modal. If connectRequestParameters.state was changed to 'ready' or it's value has been changed, QR will be re-rendered.

      Parameters

      Returns void