Connect with UniSat Mobile Wallet

If you want to authorize login through our wallet application, you need to use deeplink for interaction. Here are the description of the deeplink’s format and parameters respectively:

Request Methods

Connect wallet:

App developers can use the following URL format to request connection authorization from the wallet:

unisat://request?method=connect&from=yourAppName&nonce=xxxxx

In this case, yourAppScheme needs to be replaced with your deeplink scheme, yourAppName replaced with your application name, and xxxxx replaced with your nonce.

Switch Network:

App developers can use the following URL format to request a network switch from the wallet:

unisat://request?method=switchNetwork&data=xxxxx&from=yourAppName&nonce=xxxxx

Here, xxxxx is a base64 encoded JSON array which contains the name of the network you want to switch to (such as: “livenet”, “testnet”, etc.)

If network switch is invoked on webpage, the data parameter in the App would be base64 encoding of array like ["livenet"], for example WyJsaXZlbmV0Il0=.

Signing Message:

When requesting the wallet to sign a message, use the following URL format:

unisat://request?method=signMessage&data=xxxxx&from=yourAppName&nonce=xxxxx

Signing PSBT:

To request the wallet to sign a PSBT, use the following URL format:

unisat://request?method=signPsbt&data=xxxxx&from=yourAppName&nonce=xxxxx

Return datas

After interacting in the wallet application, if the user confirms the relevant operations, a deeplink will be returned in the following format:

unisat://response?data=xxxxx&nonce=xxxxx

Here, xxxxx is the base64 encoded data.

If the user declines the related operations, a deeplink is returned in the following format:

unisat://response?error=xxxxx&nonce=xxxxx

Here, xxxxx is the base64 encoded error information.

Note: the nonce parameter is provided by the application side, facilitating the application in matching each request with its corresponding response result. nonce will be returned in result responses.

Last updated