Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Integrate NEAR on an existing SwapKit integration

NEAR is a swap provider that routes cross-chain swaps through NEAR Intents. It follows the standard quote and swap flow, so an existing SwapKit integration picks up NEAR routes with no code changes — they simply start appearing in /v3/quote responses for supported pairs.

Two things are worth knowing before you ship: how to recognise a NEAR route, and what its transaction looks like.

Provider Identification

/v3/quote returns a routes array, and each route carries its own providers. A NEAR route shows "NEAR" there:

{
  "routes": [
    {
      "routeId": "85bb4fa2-3a65-4d22-b20b-e43d028d83e6",
      "providers": ["NEAR"]
    }
  ]
}

NEAR is considered whenever providers is omitted from the request, which is the default. If you already restrict that array, add "NEAR" to it.

Supported Chains

NEAR's coverage changes as chains are added, so read it from a live source rather than from this page: the NEAR entry on SwapKit's trade offerings is regenerated from the API, and GET /providers reports what is enabled right now.

Transaction shape

NEAR settles by deposit: the transaction /v3/swap returns funds a deposit address created for your swap, rather than calling a settlement contract the way an on-chain DEX route does.

What that transaction looks like depends on the asset being sold, and you don't have to guess — each route's txHint says which shape it will be:

  • simpleTransfer — a plain value transfer to the deposit address.

  • transferWithMemo — the same, but the memo is load-bearing and must survive.

  • contractCall — a token sell. An ERC-20 transfer on EVM, an ft_transfer_call on NEAR, so the transaction is addressed to the token's own contract rather than to the deposit address.

txHint comes back on the quote and is guaranteed to match what /v3/swap builds for the same routeId, so you can filter routes your wallet can't sign before you ever call /v3/swap.

The one thing to watch: don't gate signing on the transaction's target matching a deposit address, because on contractCall routes it legitimately won't.

Confirmations and timing

A deposit has to confirm on its own chain before the swap starts, so how long that takes depends on which chain you're selling from. The quote already accounts for it — read estimatedTime off the response rather than hard-coding a figure.

Example Integration

The standard two-step flow, with nothing NEAR-specific in it:

  1. Quote — unchanged from any other swap:

  1. Route selection — present the routes to the user and let them choose.

  2. Transaction building — post the chosen route's routeId to /v3/swap with the addresses. The routeId is cached for 5 minutes.

  1. Sign and broadcast the returned transaction with your existing wallet integration.

Last updated