Skip to main content
1Click Swap simplifies NEAR Intents by temporarily transferring assets to a trusted swapping agent that coordinates with Market Makers to execute your intent. This REST API abstracts the complexity of intent creation, solver coordination, and transaction execution.
By using the 1Click Swap API, you agree to the 1Click Terms of Service.

Key Benefits

Simple REST API

Just a few endpoints to create intents, submit deposits, and track status. No blockchain expertise required.

Competitive pricing

Automatic solver discovery ensures market makers compete for best execution on every swap.

Built-in transaction handling

Status tracking, automatic retries, and refund handling are all managed for you.

Earn fees on every swap

Configure fee collection with a single parameter and start earning from your integration immediately.

How It Works

1

Get an API key

Register on the Partner Dashboard to get your JWT token. Authenticated requests avoid the 0.2% platform fee.
2

Request a quote

Call the /v0/quote endpoint with the user’s swap details. You’ll receive pricing and a unique deposit address.
3

User deposits tokens

The user sends tokens to the deposit address. 1Click automatically begins the swap. Optionally use /v0/deposit/submit with your transaction hash to speed up processing.
4

Monitor status

Poll /v0/status to track progress and display updates to your user.
Result: The swap either succeeds with tokens delivered to your specified address, or fails with funds automatically refunded to your refund address.
Centralized exchanges (CEXes) often use intermediate or per-user deposit addresses that may not credit deposits sent via NEAR Intents until they are recognized or whitelisted. Send a small test amount before attempting full-scale transfers.

Swap Statuses

StatusDescription
PENDING_DEPOSITAwaiting deposit to the deposit address
KNOWN_DEPOSIT_TXDeposit transaction detected
PROCESSINGSwap being executed by Market Makers
SUCCESSFunds delivered to the destination address
INCOMPLETE_DEPOSITDeposit received but below required amount
REFUNDEDSwap not completed, funds returned to refund address
FAILEDSwap failed due to an error

API Specification

Base URL: https://1click.chaindefuser.com/ Auto-generate clients using the OpenAPI spec.
Use dry: true to preview quote pricing without generating a transaction. Set dry: false only at confirmation to reduce system load.

SDKs

Pre-built SDKs for popular languages:

Earning Fees

Distribution channels can earn fees on every swap. Configure fee collection when requesting quotes:
{
  "appFees": {
    "recipient": "your-wallet.near",
    "fee_bps": 50
  }
}
This charges a 0.5% fee (50 basis points) from the input token, sent to your wallet.

Fee Configuration Guide

Learn how to configure fees and set up fee aggregation for high-volume integrations

Example Integration

See a complete example in the near-intents-examples repository, which demonstrates:
  • Requesting quotes
  • Handling deposits
  • Monitoring swap status
  • Error handling and refunds

API Reference