​Pull up wallet with DeepLink

Introduction

This document describes use deeplink to pull up the TokenPocket app for authorization, transfer, signature, signing to send transaction, string signature, opening DApp and other operations.

This method is suitable for html5 applications running on the mobile browser.

Html5 applications cannot receive callbacks like native app. so if you want to get the operation result,, you need to provide the callback url, and then the wallet sends the result to the URL. The operation flow chart is as follows:

Note: This method is limited to pulling up the wallet in the mobile phone system browser. If your application runs in the wallet's Dapp browser, please refer to the document JS-SDK

The following operations support EVM related network, Tron network, EOS network and IOST network. Here we only take ETH as an example to introduce.The parameters of each network are different, and the detailed document of the fields can be found at: https://github.com/TP-Lab/tp-wallet-sdk

Instructions

Pull up the wallet to authorize login

<a href='tpoutside://pull.activity?param={}'>Open TokenPocket to authorize</a><br/>

param example content is as follows

param should be encode with encodeURIComponent

{
	"callbackUrl": "http://115.205.0.178:9011/taaBizApi/taaInitData",
	"memo": "demo",
	"action": "login",
	"actionId": "1647604216423",
	"blockchains": [{
		"chainId": "1",
		"network": "ethereum"
	}],
	"dappIcon": "https://eosknights.io/img/icon.png",
	"dappName": "zs",
	"expired": 1602,
	"protocol": "TokenPocket",
	"version": "v1.0"
}

Pull up the wallet to transfer

<a href='tpoutside://pull.activity?param={}'>Open TokenPocket to transfer</a><br/>

param example content is as follows

{
	"amount": 0.1,
	"contract": "0x4d224452801ACEd8B2F0aebE155379bb5D594381",
	"decimal": 18,
	"desc": "",
	"from": "0x5FDcc57FBeeb69f60dD7eC8d9c21B52F566e016E",
	"memo": "0xe595a6",
	"precision": 0,
	"symbol": "AAA",
	"to": "0x5FDcc57FBeeb69f60dD7eC8d9c21B52F566e016E",
	"action": "transfer",
	"actionId": "web-db4c5466-1a03-438c-90c9-2172e8becea5",
	"blockchains": [{
		"chainId": "1",
		"network": "ethereum"
	}],
	"dappIcon": "https://eosknights.io/img/icon.png",
	"dappName": "Test demo",
	"expired": 0,
	"protocol": "TokenPocket",
	"version": "1.0"
}

Pull up the wallet to sign

<a href='tpoutside://pull.activity?param={}'>Open TokenPocket to pushTransaction</a><br/>

param example content is as follows

{
	"txData": "{\"from\":\"0x22F4900A1fB41f751b8F616832643224606B75B4\",\"gasPrice\":\"0x6c088e200\",\"gas\":\"0xea60\",\"chainId\":\"1\",\"to\":\"0x7d1e7fb353be75669c53c18ded2abcb8c4793d80\",\"data\":\"0xa9059cbb000000000000000000000000171a0b081493722a5fb8ebe6f0c4adf5fde49bd8000000000000000000000000000000000000000000000000000000000012c4b0\"}",
	"action": "pushTransaction",
	"actionId": "web-db4c5466-1a03-438c-90c9-2172e8becea5",
	"blockchains": [{
		"chainId": "1",
		"network": "ethereum"
	}],
	"dappIcon": "https://eosknights.io/img/icon.png",
	"dappName": "Test demo",
	"expired": 0,
	"protocol": "TokenPocket",
	"version": "1.1.8"
}

About "txData": DEMO

Pull up the wallet to sign string

<a href='tpoutside://pull.activity?param={}'>Open TokenPocket to sign message</a><br/>

param example content is as follows

{
	"hash": false,
	"memo": "demo",
	"message": "Ssd",
	"signType": "ethSign",
	"action": "sign",
	"actionId": "web-db4c5466-1a03-438c-90c9-2172e8becea5",
	"blockchains": [{
		"chainId": "1",
		"network": "ethereum"
	}],
	"dappIcon": "https://eosknights.io/img/icon.png",
	"dappName": "Test demo",
	"expired": 0,
	"protocol": "TokenPocket",
	"version": "1.1.8"
}

How to return to H5 from TP wallet

Using callbackSchema. After completing the operation, TP wallet will launch the H5 application through callbackSchema and return the results.

 "callbackSchema": "mySchema://myHost"

Pull up the wallet and open the link with the Dapp browser

<a href='tpdapp://open?params={}'>Open TokenPocket to open url</a><br/>

param example is as follows

{
	"url": "https://dapp.mytokenpocket.vip/referendum/index.html#/",
	"chain": "EOS"
	"source": "xxx"
}

Note that the param parameter needs to be encoded: URLEncoder.encode(param, "utf-8")

Last updated