Skip to content



Detecting the Provider

MathWallet will inject an object called ton on the window object of any web application the user visits.

To detect if a browser extension using this API is installed, you can check for the existence of the ton object.

To make it easy to detect MathWallet specifically, the extension adds an additional isMathWallet flag.

const isMathWalletInstalled = window.ton && window.ton.isMathWallet


const isMathWalletInstalled = window.openmask.provider && window.openmask.provider.isMathWallet

If MathWallet is not installed, we recommend you redirect your users to our website. Altogether, this may look like the following.


  1. App checks existing of the window.openmask.tonconnect
  2. App calls window.openmask.tonconnect.connect() and waits for a response
  3. Wallet sends account information to the app;

Dapp Developer Guide

More Resources