<aside> 👉

These are experimental ideas for new frames features. We’re interested in feedback and Warpcast may prototype one or more of these, but they are not yet part of the frames spec.

</aside>

Motivation

Frame developers want users to be able to easily find and swap tokens in feed, but it’s too difficult to build custom swap and token data UIs. Several of the most popular frames use embedded swap widgets that do not natively connect to the user’s wallet.

Proposal

Frame Actions

Introduce a new frame button action type, “view token.” Instead of opening a frame, pressing this button navigates to a native view with information about a token.

image.png

View Token Action

type ViewTokenAction = {
 /** 
  * Action type. Must be 'view_token'
  */
  type: 'view_token';
  
 /** 
  * CAIP-19 asset ID (see "Appendix: CAIP-19 Extensions")
  * Example: 
  * eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
  */
  token?: string;
};

Opens a native modal view with information about a token. Falls back to opening the embed URL for unknown or unsupported asset types, or in clients without a native “token” view.

An example frame embed using the view_token action:

{
  version: "next",
  imageUrl: "<https://frame.example.com/image.png>",
  button: {
    title: "$EXAMPLE",
    action: {
      type: "view_token",
      token: "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
    };
  };
};

Frame SDK actions

View Token

> await sdk.actions.viewToken({ token });
type ViewTokenOptions = {
 /** 
  * CAIP-19 asset ID (see "Appendix: CAIP-19 Extensions")
  * Example: 
  * eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
  */
  token?: string;
};

Opens a native screen/modal view displaying information about a token. Clients should fall back to an external link for unknown or unsupported asset types.

Swap