Skip to main content
Execute a cross-chain token swap using the 1Click Swap API. You’ll swap tokens from one blockchain to another without managing bridges or liquidity. NEAR Intents handles everything automatically.
Prerequisites:There is no testnet - use small amounts for test swaps.

Perform your first swap

1

Get supported tokens

Fetch available tokens to find the assetId values you’ll need.
curl https://1click.chaindefuser.com/v0/tokens
The response includes tokens with their assetId in this format:
  • NEAR tokens: nep141:wrap.near
  • Bridged tokens: nep141:eth-0xdac17f958d2ee523a2206206994597c13d831ec7.omft.near
2

Request a quote

Request a quote with your swap parameters. Include your JWT token to avoid the 0.2% fee.
curl -X POST https://1click.chaindefuser.com/v0/quote \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -d '{
    "dry": false,
    "swapType": "EXACT_INPUT",
    "slippageTolerance": 100,
    "originAsset": "nep141:wrap.near",
    "depositType": "ORIGIN_CHAIN",
    "destinationAsset": "nep141:arb-0x912ce59144191c1204e64559fe8253a0e49e6548.omft.near",
    "amount": "100000000000000000000000",
    "recipient": "0xYourArbitrumAddress",
    "recipientType": "DESTINATION_CHAIN",
    "refundTo": "your-account.near",
    "refundType": "ORIGIN_CHAIN",
    "deadline": "2025-01-01T00:00:00.000Z"
  }'
Set dry: true to preview pricing without generating a deposit address. Set dry: false when ready to execute.
Key parameters:
ParameterDescription
swapTypeEXACT_INPUT (specify input amount) or EXACT_OUTPUT (specify output amount)
slippageToleranceMaximum acceptable slippage in basis points (100 = 1%)
originAssetSource token assetId from the tokens endpoint
depositTypeORIGIN_CHAIN (deposit on source chain) or INTENTS (already in Verifier contract)
destinationAssetTarget token assetId from the tokens endpoint
amountAmount in smallest unit (wei, yoctoNEAR, etc.)
recipientAddress to receive swapped tokens
recipientTypeDESTINATION_CHAIN (native address) or INTENTS (NEAR Intents account)
refundToAddress for refunds if swap fails
refundTypeORIGIN_CHAIN or INTENTS
deadlineQuote expiration timestamp in ISO format
3

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.
4

Submit transaction hash (optional)

Speed up processing by notifying 1Click of your deposit.
curl -X POST https://1click.chaindefuser.com/v0/deposit/submit \
  -H "Content-Type: application/json" \
  -d '{
    "depositAddress": "address-from-quote-response",
    "txHash": "0xYourTransactionHash"
  }'
5

Monitor status

Check swap progress using the deposit address.
curl "https://1click.chaindefuser.com/v0/status?depositAddress=your-deposit-address"
Swap statuses:
StatusDescription
PENDING_DEPOSITAwaiting your token deposit
KNOWN_DEPOSIT_TXDeposit transaction detected
PROCESSINGSwap being executed
SUCCESSTokens delivered to destination address
INCOMPLETE_DEPOSITDeposit below required amount
REFUNDEDSwap failed, funds returned to refund address
FAILEDSwap encountered an error
View detailed transaction info on the NEAR Intents Explorer by searching for your deposit address.

Next Steps

Troubleshooting

  • 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
  • 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
Join our Telegram community for support.