UNO is your simple, secure token wallet. View your token balances and check prices all in one place. Buy, Sell, Swap, or Send tokens in a fun and simple interface. Uno now supports a Quick Action to deeplink directly to the swap tab, with a specific swap ready to be executed.

Parameters

tab
string
required
Currently only supports “swap”; this allows deep linking to the swap tab.
fromToken
string
Token address for the from token.
amount
string
Base units amount of the from token.
toToken
string
Token address for the to token.
referrerAppId
string
World Miniapp App id of the referring World Miniapp. When provided, a “Go Back” deeplink button will appear in the top left of the header that takes the user back to the referring Miniapp.
Deeplink path for referring World Miniapp Quick Actions. When provided, this path will be added to the “Go Back” deeplink button so that the referring Miniapp can execute a Quick Action when the user taps “Go Back” in Uno.
Swap Screen

Helper function

const UNO_APP_ID = "app_a4f7f3e62c1de0b9490a5260cb390b56";

function getUnoDeeplinkUrl({
  fromToken,
  toToken,
  amount,
  referrerAppId,
  referrerDeeplinkPath,
}: {
  fromToken?: string;
  toToken?: string;
  amount?: string;
  referrerAppId?: string;
  referrerDeeplinkPath?: string;
}) {
  let path = `?tab=swap`;
  if (fromToken) {
    path += `&fromToken=${fromToken}`;
    if (amount) {
      path += `&amount=${amount}`;
    }
  }
  if (toToken) {
    path += `&toToken=${toToken}`;
  }
  if (referrerAppId) {
    path += `&referrerAppId=${referrerAppId}`;
  }
  if (referrerDeeplinkPath) {
    path += `&referrerDeeplinkPath=${encodeURIComponent(referrerDeeplinkPath)}`;
  }
  const encodedPath = encodeURIComponent(path);
  return `https://worldcoin.org/mini-app?app_id=${UNO_APP_ID}&path=${encodedPath}`;
}

// create a trade for 1.2345 USDC to WETH
console.log(
  getUnoDeeplinkUrl({
    fromToken: "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1",
    amount: "1234500",
    toToken: "0x4200000000000000000000000000000000000006",
  })
);
https://worldcoin.org/mini-app?app_id=app_a4f7f3e62c1de0b9490a5260cb390b56&path=%3Ftab%3Dswap%26fromToken%3D0x79A02482A880bCE3F13e09Da970dC34db4CD24d1%26amount%3D1234500%26toToken%3D0x4200000000000000000000000000000000000006

Appendix

Terminology
  • fromToken - token that is being swapped away for another token. Other names for this parameter are “sell token”, or “input token”.
  • toToken - token that is being swapped into for another token. Other names for this parameter are “buy token”, or “output token”.
  • referrer - In the cases that the UNO Quick Action link is used from a different Miniapp, the referrer is the Miniapp where that link was used. Specifying the referrerAppId allows UNO to provide a “Go back” to the Miniapp that provided the link to the UNO Quick Action.
Caveats/Warnings Swap will not work if not taken into consideration.
  • If the user does not have the fromToken (sell token).
  • Amount should be in the base units of the fromToken.