JS-SDK

Extension Protocol Support

TokenPocket mobile app is already compatible with Metamask(ETH), Unisat(BTC), TronLink(TRON), Phantom(Solana), Scatter(EOS) and iWallet(IOST) protocols.

If your DApp already supports extension wallet protocols such as MetaMask, TronLink, Phantom, Scatter, and iWallet, you can run it directly in the DApp browser of TokenPocket without any modification.

For details please refer to: https://github.com/TP-Lab/tp-js-sdk

From Android 1.7.0 and iOS 2.0.7 ,TokenPocket mobile app is already compatible with NIP-07(Nostr),if your DApp already support Nostr you can run it directly in the DApp browser of TokenPocket without any modification.

How to use Nostr DAPP in TokenPocket, Please refer to:

In addition, we also provide tp-js-sdk. The SDK only takes effect in the TokenPocket mobile Dapp browser, and provides interfaces such as full-screen display, saving pictures, and rotating the screen.

To debug Dapp in the TP wallet, you can turn on the developer mode. How to open: Open Wallet -> My -> About Us -> Quickly tap the TP icon at the top for 8 times -> Click on the developer mode at the bottom -> Developer mode

For detailed document of tp-js-sdk, please refer to: https://github.com/TP-Lab/tp-js-sdk

Commonly used tp-js-sdk interface

Get app information

tp.getAppInfo()

Scan code

tp.invokeQRScanner().then(console.log)

"abcdefg"

Set DApp to full screen display

tp.fullScreen({
   fullScreen: 0
})

For more interfaces, please check the detailed document: https://github.com/TP-Lab/tp-js-sdk

Last updated