Prerequisites:
- A small amount of tokens on ANY supported chain.
- A JWT token to avoid the 0.2% fee.
Perform your first swap
Get supported tokens
Fetch available tokens to find the The response includes tokens with their
assetId values you’ll need.assetId in this format:- NEAR tokens:
nep141:wrap.near - Bridged tokens:
nep141:eth-0xdac17f958d2ee523a2206206994597c13d831ec7.omft.near
Request a quote
Request a quote with your swap parameters. Include your JWT token to avoid the 0.2% fee.Key parameters:
| Parameter | Description |
|---|---|
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 (deposit on source chain) or INTENTS (already in Verifier contract) |
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 (native address) or INTENTS (NEAR Intents account) |
refundTo | Address for refunds if swap fails |
refundType | ORIGIN_CHAIN or INTENTS |
deadline | Quote expiration timestamp in ISO format |
Send tokens
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.Monitor status
Check swap progress using the deposit address.Swap statuses:
| 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 |
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.
Create a Distribution Channel
The easiest way to build a distribution channel.
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.