Hierarchy

  • TonConnectUI

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

  • Deprecated

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

    Returns

    Connected wallet.

    Throws

    TonConnectUIError if connection was aborted.

    Returns Promise<ConnectedWallet>

  • 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)
        • (state: SingleWalletModalState): void
        • Parameters

          • state: SingleWalletModalState

          Returns void

    Returns (() => void)

      • (): void
      • Experimental

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

        Returns void

  • Subscribe to connection status change.

    Returns

    function which has to be called to unsubscribe.

    Parameters

    • callback: ((wallet: null | ConnectedWallet) => void)
    • Optional errorsHandler: ((err: TonConnectError) => void)
        • (err: TonConnectError): void
        • Parameters

          • err: TonConnectError

          Returns void

    Returns (() => void)

      • (): void
      • Allows to subscribe to connection status changes and handle connection errors.

        Returns

        unsubscribe callback.

        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>

  • Opens the modal window and handles the transaction sending.

    Parameters

    • tx: SendTransactionRequest

      transaction to send.

    • Optional options: ActionConfiguration

      modal and notifications behaviour settings. Default is show only 'before' modal and all notifications.

    Returns Promise<SendTransactionResponse>

  • 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

    • connectRequestParameters: undefined | null | Loadable<ConnectAdditionalRequest>

    Returns void

Generated using TypeDoc