Getting Started
Prerequisites
- A small amount of tokens on ANY supported chain.
- A JWT token to avoid the 0.2% fee.
Query supported tokens
Fetch available tokens to find the The response includes tokens with their
assetId values you will need.assetId in this format:- NEAR tokens:
nep141:wrap.near - Bridged tokens:
nep141:eth-0xdac17f958d2ee523a2206206994597c13d831ec7.omft.near
Example response
Example response
Request a quote
Request a quote with your swap parameters. Include your JWT token to avoid the 0.2% fee.
Key parameters
Key parameters
| Parameter | Description |
|---|---|
dry | true to validate parameters and get a quote without executing the swap |
swapType | EXACT_INPUT (specify input amount) or EXACT_OUTPUT (specify output amount) |
slippageTolerance | Maximum acceptable slippage in basis points (100 = 1%) |
originAsset | Source token assetId from the tokens endpoint |
depositType | ORIGIN_CHAIN for origin-chain deposits, INTENTS for public Intents balances, or CONFIDENTIAL_INTENTS |
destinationAsset | Target token assetId from the tokens endpoint |
amount | Amount in smallest unit (wei, yoctoNEAR, etc.) |
recipient | Address to receive swapped tokens |
recipientType | DESTINATION_CHAIN, INTENTS, or CONFIDENTIAL_INTENTS |
refundTo | Address for refunds if swap fails |
refundType | ORIGIN_CHAIN, INTENTS, or CONFIDENTIAL_INTENTS |
deadline | Quote expiration timestamp in ISO format |
CONFIDENTIAL_INTENTS is invite-only. Quotes using confidential deposit, recipient, or refund types require user authentication and only support EXACT_INPUT or EXACT_OUTPUT swap types. Contact the team via the Partner Portal to request access.Send tokens
For
ORIGIN_CHAIN quotes, transfer tokens to the depositAddress from the quote response. The swap begins automatically upon receipt.Save the deposit address and your transaction hash for tracking.If your quote uses depositType: INTENTS or depositType: CONFIDENTIAL_INTENTS, skip the on-chain transfer and use Signed Intent Execution instead.Monitor status
Check swap progress using the deposit address.
Status response
Status response
| Status | Description |
|---|---|
PENDING_DEPOSIT | Awaiting your token deposit |
KNOWN_DEPOSIT_TX | Deposit transaction detected |
PROCESSING | Swap being executed |
SUCCESS | Tokens delivered to destination address |
INCOMPLETE_DEPOSIT | Deposit below required amount |
REFUNDED | Swap failed, funds returned to refund address |
FAILED | Swap encountered an error |
View detailed transaction info on the NEAR Intents Explorer by searching for your deposit address.
Signed Intent Execution
Use signed intent execution when a quote usesdepositType: INTENTS or depositType: CONFIDENTIAL_INTENTS. In both cases, the funds are already inside NEAR Intents, so the user authorizes the swap by signing an intent message off-chain instead of sending an on-chain deposit.
| Deposit channel | depositType | How the deposit is made |
|---|---|---|
| Origin chain transfer | ORIGIN_CHAIN | Send tokens to depositAddress, optionally notify via POST /v0/deposit/submit |
| Signed intent | INTENTS | Generate intent, user signs, POST /v0/submit-intent |
| Signed intent (confidential) | CONFIDENTIAL_INTENTS | Generate intent, user signs, POST /v0/submit-intent |
Confidential Intents is invite-only for now. Confirm your integration is enabled before requesting quotes with
CONFIDENTIAL_INTENTS.POST /v0/generate-intent and POST /v0/submit-intent use partner authentication (X-API-Key recommended, JWT-auth legacy). They do not use the end-user User-Session token; the user’s authorization is the wallet signature submitted as signedData.Quote
Request a quote with
POST /v0/quote using depositType INTENTS or CONFIDENTIAL_INTENTS. Save the returned depositAddress; it links the signed intent back to the quote.Generate
Call
POST /v0/generate-intent with the depositAddress, the user’s signerId, and their wallet’s signing standard (nep413, erc191, raw_ed25519, webauthn, ton_connect, sep53, or tip191). It returns the unsigned intent payload.For the exact request fields and response shape, see Generate an intent for signing.Sign
The user signs the returned
intent payload with their wallet off-chain. Do not modify the payload between generation and signing; the signature must cover the exact payload returned by the API.Submit
Call
POST /v0/submit-intent with the signed payload (type: swap_transfer, signedData: the signed MultiPayload). It returns the intentHash.For the exact signedData schema and response shape, see Submit a signed intent.Next Steps
Clone the Example Repo
Clone and run a working TypeScript implementation to get started quickly.
Watch NEAR Intents 102
Follow along with this guided workshop explaining all the steps in detail.
Use the SDK
Integrate with our official SDK libraries for TypeScript, Go, or Rust.
NEAR Intents Explorer
Track transactions and view swap history
Troubleshooting
Swap taking a long time
Swap taking a long time
- Check the blockchain explorer for your deposit transaction
- Verify the deposit address matches the quote response
- Allow up to 15 minutes for cross-chain processing
- Use the status endpoint to check current state
Swap failed or was refunded
Swap failed or was refunded
- Verify you sent the exact amount specified in the quote
- Check your refund address for returned funds
- Ensure your destination address format is correct for the target chain
- Request a new quote and try again
Need help?
Need help?
Join our Telegram community for support.