TokenFlight
Open app

Overview

What the widget is and how it works.

TokenFlight lets a user convert a token on one chain into a token on another, paying from their own wallet.@tokenflight/widget puts that on your site: you give it a place on the page and your site's wallet, and it does the rest.

That is the whole setup

import { TokenFlightWidget } from "@tokenflight/widget";

new TokenFlightWidget({
  pageUrl: "https://fly.tokenflight.ai", // the page address you use
  walletAdapter, // your site's wallet
  container: "#convert",
}).initialize();

What happens

  • The widget shows the form, the quote, a review step and the order's progress, inside a frame.
  • When a wallet action is needed (switch network, send the deposit) it uses the wallet you passed in.
  • You can listen for events (an order was created, it completed), and change the look to match your site. Both are optional.

Good to know

  • It never sees a private key or a signature, and your site never handles a service key.
  • It has no dependencies and can sit on the same page as @tokenflight/swap.
  • The page header, links and background are hidden when it is framed, so it blends into yours.

Next: Quick start.