Constructors

  • Parameters

    • Optional options: TonConnectUiCreateOptions

    Returns TonConnectUI

Properties

actionsConfiguration?: any
checkButtonRootExist: any
connectEmbeddedWallet: any

TODO: remove in the next major version. Initiates a connection with an embedded wallet, awaits its completion, and returns the connected wallet information.

Param: embeddedWallet

Information about the embedded wallet to connect to.

Throws

Error if the connection process fails.

connectExternalWallet: any

TODO: remove in the next major version. Initiates the connection process for an external wallet by opening the wallet modal and returns the connected wallet information upon successful connection.

Throws

Error if the user cancels the connection process or if the connection process fails.

connectRequestParametersCallback?: any
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.

getModalsAndNotificationsConfiguration: any
getSelectedWalletInfo: any
modal: WalletsModal

Manages the modal window state.

normalizeWidgetRoot: any
onTransactionModalStateChange: any

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

preferredWalletStorage: any
setPreferredWalletAppName: any
singleWalletModal: any

Manages the single wallet modal window state. TODO: make it public when interface will be ready for external usage.

subscribeToWalletChange: any
systemThemeChangeUnsubscribe: any
tracker: any

Emits user action event to the EventDispatcher. By default, it uses window.dispatchEvent for browser environment.

transactionModal: any

Manages the transaction modal window state. TODO: make it public when interface will be ready for external usage.

updateWalletInfo: any
waitForSendTransaction: any

Waits for a transaction to be sent based on provided options, returning the transaction response.

Param: options

Configuration for transaction statuses and errors handling. @options.transaction - Transaction to send. @options.ignoreErrors - If true, ignores errors during waiting, waiting continues until a valid transaction is sent. Default is false. @options.abortSignal - Optional AbortSignal for external cancellation. Throws TonConnectUIError if aborted.

Param: onRequestSent

(optional) will be called after the transaction is sent to the wallet.

Throws

TonConnectUIError if waiting is aborted or no valid transaction response is received and ignoreErrors is false.

waitForWalletConnection: any

TODO: remove in the next major version. Waits for a wallet connection based on provided options, returning connected wallet information.

Param: options

Configuration for connection statuses and errors handling. @options.ignoreErrors - If true, ignores errors during waiting, waiting continues until a valid wallet connects. Default is false. @options.abortSignal - Optional AbortSignal for external cancellation. Throws TonConnectUIError if aborted.

Throws

TonConnectUIError if waiting is aborted or no valid wallet connection is received and ignoreErrors is false.

walletInfo: any
walletInfoStorage: any
walletsList: any

Accessors

  • get account(): null | Account
  • Current connected account or null.

    Returns null | Account

  • get connected(): boolean
  • Current connection status.

    Returns boolean

  • get modalState(): WalletsModalState
  • Returns current modal window state.

    Returns WalletsModalState

  • get singleWalletModalState(): SingleWalletModalState
  • Experimental

    Returns current single wallet modal window state.

    Returns SingleWalletModalState

  • set uiOptions(options): void
  • Set and apply new UI options. Object with partial options should be passed. Passed options will be merged with current options.

    Parameters

    • options: TonConnectUiOptions

    Returns void

  • get wallet(): null | Wallet | (Wallet & WalletInfoWithOpenMethod)
  • Curren connected wallet app and its info or null.

    Returns null | Wallet | (Wallet & WalletInfoWithOpenMethod)

Methods

  • Closes the modal window.

    Parameters

    • Optional reason: WalletsModalCloseReason

    Returns void

  • Experimental

    Close the single wallet modal window.

    Parameters

    • Optional closeReason: WalletsModalCloseReason

    Returns void

  • Returns Promise<ConnectedWallet>

    Connected wallet.

    Deprecated

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

    Throws

    TonConnectUIError if connection was aborted.

  • Disconnect wallet and clean localstorage.

    Returns Promise<void>

  • Returns available wallets list.

    Returns Promise<WalletInfo[]>

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

    Parameters

    • onChange: ((state) => void)
        • (state): void
        • Parameters

          • state: WalletsModalState

          Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Experimental

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

    Parameters

    • onChange: ((state) => void)
        • (state): void
        • Parameters

          • state: SingleWalletModalState

          Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Subscribe to connection status change.

    Parameters

    • callback: ((wallet) => void)
        • (wallet): void
        • Parameters

          • wallet: null | ConnectedWallet

          Returns void

    • Optional errorsHandler: ((err) => void)
        • (err): void
        • Parameters

          • err: TonConnectError

          Returns void

    Returns (() => void)

    function which has to be called to unsubscribe.

      • (): 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>

  • 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

  • Returns Promise<WalletInfo[]>

Generated using TypeDoc