Pantograph Extension is now available on Chrome, Firefox, Opera and Brave. To avoid collisions with any other extension wallets for users, Pantograph recommends Dapp developers to insert the following code into the code base.

Introduction

Pantograph is a blockchain platform that based on TomoChain. Pantograph extension enables users to interact with Dapps that built on TomoChain right on their favorite browser. The Pantograph team aims to bring the best experience for users when it comes to Tomo Dapps. We believe TomoChain is a great environment for users to experience Dapps. In this Tomo space, Token issuers can delegate Gas Fees in advance. It means users can try out most applications without a need to obtain Tomo within their wallet.

Custom Code

let tomoWeb3

    // The variable use to check whether already install Pantograph extension or not
    if (!window.tomochain) {
      window.alert('Please install Pantograph first.');
      return;
    }
    if (!tomoWeb3) {
      try {
        // Request account access if needed
        await window.tomochain.enable();

        // We don't know window.web3 version, so we use our own instance of Web3
        // with the injected provider given by Pantograph
        tomoWeb3 = new Web3(window.tomochain);
      } catch (error) {
        window.alert('You need to allow Pantograph.');
        return;
      }
    }

    const coinbase = await tomoWeb3.eth.getCoinbase();
     if (!coinbase) {
      window.alert('Please activate Pantograph first.');
      return;
    }

    // get account address
    const publicAddress = coinbase.toLowerCase()

    // sign Dapps to TomoChain
    tomoWeb3.eth.personal.sign('Sign Message', publicAddress, (err, signature) => {
          if (err) return resolve(err)
          return resolve({ address, signature })
    })

The provided lines of codes will improve the UX of your Dapps significantly. Once implemented, they can help users to use any wallet extension simultaneously without a need to uninstall any necessary extension. Obviously, it improves the comfortability in experience for users. On the other hand, we have designed Pantograph exclusively for Tomo Dapps with Tomo Testnet integrated. It would be quite convenient for developers to test their Dapps anytime within one click.