Skip to main content

Documentation Index

Fetch the complete documentation index at: https://companyname-a7d5b98e-feature-fumodocs.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Plug in a swap or staking provider when the app needs DeFi flows. Each provider sits on the AppKit instance and supplies data: prices, quotes, and the transactions that the user will sign. The wallet still signs; the provider only prepares. A provider is not a wallet and not a connector. AppKit treats whatever it returns as external input — useful for showing prices, balances, and quotes, but never as proof of settlement.

Before you begin

You need AppKit packages installed and an AppKit instance created. See Prepare your project and Add wallet connectors.

Add a swap provider

Swap providers ship as separate entrypoints under @ton/appkit/swap/* so the bundler only includes the protocols you actually use. Construct an instance and pass it in the providers array on the AppKit constructor; AppKit registers it with the swap manager and the swap hooks (useSwapQuote, useBuildSwapTransaction) start returning quotes from that protocol.
// appkit.ts
import { AppKit } from '@ton/appkit';
import { DeDustSwapProvider } from '@ton/appkit/swap/dedust';

export const appKit = new AppKit({
  // networks, connectors...
  providers: [
    new DeDustSwapProvider(),
  ],
});
Omniston requires its own SDK package — install it before registering the provider:
npm i @ston-fi/omniston-sdk

Add a staking provider

Use createTonstakersProvider({}) from @ton/appkit/staking/tonstakers the same way:
import { AppKit } from '@ton/appkit';
import { createTonstakersProvider } from '@ton/appkit/staking/tonstakers';

export const appKit = new AppKit({
  // networks, connectors...
  providers: [
    createTonstakersProvider({}),
  ],
});
The staking hooks (useStakingQuote, useBuildStakeTransaction) start returning data from the registered provider.

Tips

Provider responses are external data. Validate critical outcomes server side before changing product state — wallet acceptance is not settlement, and a swap quote is not a price guarantee.

What to do next

  • Continue to Use UI widgets to render full swap and staking UIs with one component each.
  • For task-level walkthroughs, see Swaps and Staking.
  • See Providers for the full provider model — including the streaming and API client roles not covered here.