1Click API
What is 1Click Swap API?
1Click 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 away the complexity of intent creation, solver coordination, and transaction execution, letting you focus on your user experience.
It features:
Simple REST endpoints for intent creation and management
Automatic solver discovery and competitive pricing
Built-in transaction handling and status tracking
Support for cross-chain intents
How 1Click API Works

Request a quote - Send the user's intent request to 1Click's
Request QuoteendpointReceive the best available quote with a unique deposit address
Transfer tokens - If provided quote is satisfactory, deposit tokens to the unique address provided
1Click automatically begins the swapping process upon receipt
Submit deposit transaction - (optional)
Use the
Submit Deposit Txendpoint with your transaction hash to speed up processing
Monitor progress - (optional)
You can query the process at any time with the
Get Execution Statusendpoint
Result: The swap either succeeds with tokens delivered to your specified address, or fails with funds automatically refunded to your refund address. Failed swaps can be retried by repeating this flow.
Quickstart 1Click Tutorial
To quickly get started with 1Click API, see this example breaking down each of the above steps:
This repo will show you how to quickly get started performing cross-chain swaps using 1Click's TypeScript SDK.
API Specification (v0)
Auto-generate clients using our OpenAPI spec.
SDKs
Pre-built SDKs for popular languages:
Swap Statuses
1Click Swap goes through these states in its lifecycle:
PENDING_DEPOSIT — Awaiting the deposit to the deposit address.
PROCESSING — Once the deposit on deposit address is detected, information is processed and executed by Market Makers.
SUCCESS — Funds are delivered to the specified destination chain/address.
INCOMPLETE_DEPOSIT — Deposit is received but below required bridge or quoted amount.
REFUNDED — If the swap is not completed, funds are automatically returned to the refund address.
FAILED - Swap failed due to the error.

API Endpoints
Base URL: https://1click.chaindefuser.com/
/v0/deposit/submit
Optional route to speed up process with early deposit notification to 1Click
The amountOutUsd field in quote responses should NOT be used in business logic or calculations. It is provided for display purposes only. Always use the actual token amounts for any programmatic operations.
Retrieves a list of tokens currently supported by the 1Click API for asset swaps.
Each token entry includes its blockchain, contract address (if available), price in USD, and other metadata such as symbol and decimals.
GET /v0/tokens HTTP/1.1
Host: 1click.chaindefuser.com
Accept: */*
[
{
"assetId": "nep141:wrap.near",
"decimals": 24,
"blockchain": "near",
"symbol": "wNEAR",
"price": "2.79",
"priceUpdatedAt": "2025-03-28T12:23:00.070Z",
"contractAddress": "wrap.near"
}
]Generates a swap quote based on input parameters such as the assets, amount, slippage tolerance, and recipient/refund information.
Returns pricing details, estimated time, and a unique deposit address to which tokens must be transferred to initiate the swap.
You can set the dry parameter to true to simulate the quote request without generating a deposit address or initiating the swap process. This is useful for previewing swap parameters or validating input data without committing to an actual swap.
This endpoint is the first required step in the swap process.
Enter JWT token (optional)
Flag indicating whether this is a dry run request.
If true, the response will NOT contain the following fields:
depositAddresstimeWhenInactivedeadline
trueWhat deposit address mode you will get in the response, most chain supports only SIMPLE and some(for example stellar) only MEMO:
SIMPLE- usual deposit with only deposit address.MEMO- some chains will REQUIRE thememotogether withdepositAddressfor swap to work.
SIMPLEExample: SIMPLEPossible values: How to interpret amount (and refunds) when performing the swap:
-
EXACT_INPUT— requests the output amount for an exact input.- If deposit is less than
amountIn, the deposit is refunded by deadline. - If deposit is above than
amountIn, the swap is processed and the excess is refunded torefundToaddress after swap is complete.
- If deposit is less than
-
EXACT_OUTPUT— requests the input amount for an exact output.- The quote response would have two fields
minAmountInandmaxAmountIn. - If the input is above than
maxAmountInthe swap is processed and the excess is refunded torefundToaddress after swap is complete. - If the input is less than
minAmountIn, the deposit is refunded by deadline.
- The quote response would have two fields
-
FLEX_INPUT— a flexible input amount that allows for partial deposits and variable amounts.slippageapplies both toamountOutandamountInand defines an acceptable range (minAmountInandminAmountOut).- Any amount higher than
minAmountInis accepted and converted to the output asset as long asminAmountOutis met. - The
amountIncan be less, as long as the 'slippage + 1%' constraint is met. If the total received by the deadline is below the lower bound, the deposit is refunded. - If deposits exceed the upper bound, the swap is still processed
Slippage tolerance for the swap. This value is in basis points (1/100th of a percent), e.g. 100 for 1% slippage.
100ID of the origin asset.
nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.nearType of deposit address:
ORIGIN_CHAIN- deposit address on the origin chain.INTENTS- the account ID within NEAR Intents to which you should transfer assets.
ID of the destination asset.
nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.nearAmount to swap as the base amount. It is interpreted as the input or output amount based on the swapType flag and is specified in the smallest unit of the currency (e.g., wei for ETH).
1000Address used for refunds.
0x2527D02599Ba641c19FEa793cD0F167589a0f10DType of refund address:
ORIGIN_CHAIN- assets are refunded to therefundToaddress on the origin chain.INTENTS- assets are refunded to therefundToIntents account.
Recipient address. The format must match recipientType.
13QkxhNMrTPxoCkRdYdJ65tFuwXPhL5gLS2Z5Nr6gjRKAddresses of connected wallets.
["0x123...","0x456..."]Unique client session identifier for 1Click.
session_abc123EVM address of a transfer recipient in a virtual chain
0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887CEVM address of a refund recipient in a virtual chain
0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887CHIGHLY EXPERIMENTAL Message to pass to ft_transfer_call when withdrawing assets to NEAR.
Otherwise, ft_transfer will be used.
WARNING: Funds will be lost if used with non NEP-141 tokens, in case of insufficient storage_deposit or if the recipient does not implement ft_on_transfer method.
smart-contract-recipient.nearType of recipient address:
DESTINATION_CHAIN- assets are transferred to the chain ofdestinationAsset.INTENTS- assets are transferred to an account inside Intents
Timestamp in ISO format that identifies when the user refund begins if the swap isn't completed by then. It must exceed the time required for the deposit transaction to be mined. For example, Bitcoin may require around one hour depending on the fees paid.
2019-08-24T14:15:22ZReferral identifier (lowercase only). It will be reflected in the on-chain data and displayed on public analytics platforms.
referralTime in milliseconds the user is willing to wait for a quote from the relay.
If you want to receive the fastest quote - use 0 as a value
3000Example: 3000Bad Request - Invalid input data
Unauthorized - JWT token is invalid
POST /v0/quote HTTP/1.1
Host: 1click.chaindefuser.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 875
{
"dry": true,
"depositMode": "SIMPLE",
"swapType": "EXACT_INPUT",
"slippageTolerance": 100,
"originAsset": "nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near",
"depositType": "ORIGIN_CHAIN",
"destinationAsset": "nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near",
"amount": "1000",
"refundTo": "0x2527D02599Ba641c19FEa793cD0F167589a0f10D",
"refundType": "ORIGIN_CHAIN",
"recipient": "13QkxhNMrTPxoCkRdYdJ65tFuwXPhL5gLS2Z5Nr6gjRK",
"connectedWallets": [
"0x123...",
"0x456..."
],
"sessionId": "session_abc123",
"virtualChainRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
"virtualChainRefundRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
"customRecipientMsg": "smart-contract-recipient.near",
"recipientType": "DESTINATION_CHAIN",
"deadline": "2019-08-24T14:15:22Z",
"referral": "referral",
"quoteWaitingTimeMs": 3000,
"appFees": [
{
"recipient": "recipient.near",
"fee": 100
}
]
}{
"timestamp": "2019-08-24T14:15:22Z",
"signature": "text",
"quoteRequest": {
"dry": true,
"depositMode": "SIMPLE",
"swapType": "EXACT_INPUT",
"slippageTolerance": 100,
"originAsset": "nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near",
"depositType": "ORIGIN_CHAIN",
"destinationAsset": "nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near",
"amount": "1000",
"refundTo": "0x2527D02599Ba641c19FEa793cD0F167589a0f10D",
"refundType": "ORIGIN_CHAIN",
"recipient": "13QkxhNMrTPxoCkRdYdJ65tFuwXPhL5gLS2Z5Nr6gjRK",
"connectedWallets": [
"0x123...",
"0x456..."
],
"sessionId": "session_abc123",
"virtualChainRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
"virtualChainRefundRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
"customRecipientMsg": "smart-contract-recipient.near",
"recipientType": "DESTINATION_CHAIN",
"deadline": "2019-08-24T14:15:22Z",
"referral": "referral",
"quoteWaitingTimeMs": 3000,
"appFees": [
{
"recipient": "recipient.near",
"fee": 100
}
]
},
"quote": {
"depositAddress": "0x76b4c56085ED136a8744D52bE956396624a730E8",
"depositMemo": "1111111",
"amountIn": "1000000",
"amountInFormatted": "1",
"amountInUsd": "1",
"minAmountIn": "995000",
"amountOut": "9950000",
"amountOutFormatted": "9.95",
"amountOutUsd": "9.95",
"minAmountOut": "9900000",
"deadline": "2025-03-04T15:00:00Z",
"timeWhenInactive": "2025-03-04T15:00:00Z",
"timeEstimate": 120,
"virtualChainRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
"virtualChainRefundRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
"customRecipientMsg": "smart-contract-recipient.near"
}
}Optionally notifies the 1Click service that a deposit has been sent to the specified address, using the blockchain transaction hash.
This step can speed up swap processing by allowing the system to preemptively verify the deposit.
Enter JWT token (optional)
Transaction hash of your deposit
0x123abc456def789Deposit address for the quote
0x2527D02599Ba641c19FEa793cD0F167589a0f10DSender account (used only for NEAR blockchain)
relay.tgMemo (use if deposit was submitted with one)
123456Bad Request - Invalid input data
Unauthorized - JWT token is invalid
POST /v0/deposit/submit HTTP/1.1
Host: 1click.chaindefuser.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 139
{
"txHash": "0x123abc456def789",
"depositAddress": "0x2527D02599Ba641c19FEa793cD0F167589a0f10D",
"nearSenderAccount": "relay.tg",
"memo": "123456"
}{
"quoteResponse": {
"timestamp": "2019-08-24T14:15:22Z",
"signature": "text",
"quoteRequest": {
"dry": true,
"depositMode": "SIMPLE",
"swapType": "EXACT_INPUT",
"slippageTolerance": 100,
"originAsset": "nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near",
"depositType": "ORIGIN_CHAIN",
"destinationAsset": "nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near",
"amount": "1000",
"refundTo": "0x2527D02599Ba641c19FEa793cD0F167589a0f10D",
"refundType": "ORIGIN_CHAIN",
"recipient": "13QkxhNMrTPxoCkRdYdJ65tFuwXPhL5gLS2Z5Nr6gjRK",
"connectedWallets": [
"0x123...",
"0x456..."
],
"sessionId": "session_abc123",
"virtualChainRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
"virtualChainRefundRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
"customRecipientMsg": "smart-contract-recipient.near",
"recipientType": "DESTINATION_CHAIN",
"deadline": "2019-08-24T14:15:22Z",
"referral": "referral",
"quoteWaitingTimeMs": 3000,
"appFees": [
{
"recipient": "recipient.near",
"fee": 100
}
]
},
"quote": {
"depositAddress": "0x76b4c56085ED136a8744D52bE956396624a730E8",
"depositMemo": "1111111",
"amountIn": "1000000",
"amountInFormatted": "1",
"amountInUsd": "1",
"minAmountIn": "995000",
"amountOut": "9950000",
"amountOutFormatted": "9.95",
"amountOutUsd": "9.95",
"minAmountOut": "9900000",
"deadline": "2025-03-04T15:00:00Z",
"timeWhenInactive": "2025-03-04T15:00:00Z",
"timeEstimate": 120,
"virtualChainRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
"virtualChainRefundRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
"customRecipientMsg": "smart-contract-recipient.near"
}
},
"status": "KNOWN_DEPOSIT_TX",
"updatedAt": "2025-12-02T00:42:17.821Z",
"swapDetails": {
"intentHashes": [
"text"
],
"nearTxHashes": [
"text"
],
"amountIn": "1000",
"amountInFormatted": "0.1",
"amountInUsd": "0.1",
"amountOut": "9950000",
"amountOutFormatted": "9.95",
"amountOutUsd": "9.95",
"slippage": 50,
"originChainTxHashes": [
{
"hash": "0x123abc456def789",
"explorerUrl": "text"
}
],
"destinationChainTxHashes": [
{
"hash": "0x123abc456def789",
"explorerUrl": "text"
}
],
"refundedAmount": "1000",
"refundedAmountFormatted": "0.1",
"refundedAmountUsd": "0.1",
"depositedAmount": "text",
"depositedAmountFormatted": "text",
"depositedAmountUsd": "text",
"referral": "referral"
}
}Retrieves the current status of a swap using the unique deposit address from the quote, if quote response included deposit memo, it is required as well.
The response includes the state of the swap (e.g., pending, processing, success, refunded) and any associated swap and transaction details.
Enter JWT token (optional)
Unauthorized - JWT token is invalid
Deposit address not found
GET /v0/status?depositAddress=text HTTP/1.1
Host: 1click.chaindefuser.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"quoteResponse": {
"timestamp": "2019-08-24T14:15:22Z",
"signature": "text",
"quoteRequest": {
"dry": true,
"depositMode": "SIMPLE",
"swapType": "EXACT_INPUT",
"slippageTolerance": 100,
"originAsset": "nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near",
"depositType": "ORIGIN_CHAIN",
"destinationAsset": "nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near",
"amount": "1000",
"refundTo": "0x2527D02599Ba641c19FEa793cD0F167589a0f10D",
"refundType": "ORIGIN_CHAIN",
"recipient": "13QkxhNMrTPxoCkRdYdJ65tFuwXPhL5gLS2Z5Nr6gjRK",
"connectedWallets": [
"0x123...",
"0x456..."
],
"sessionId": "session_abc123",
"virtualChainRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
"virtualChainRefundRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
"customRecipientMsg": "smart-contract-recipient.near",
"recipientType": "DESTINATION_CHAIN",
"deadline": "2019-08-24T14:15:22Z",
"referral": "referral",
"quoteWaitingTimeMs": 3000,
"appFees": [
{
"recipient": "recipient.near",
"fee": 100
}
]
},
"quote": {
"depositAddress": "0x76b4c56085ED136a8744D52bE956396624a730E8",
"depositMemo": "1111111",
"amountIn": "1000000",
"amountInFormatted": "1",
"amountInUsd": "1",
"minAmountIn": "995000",
"amountOut": "9950000",
"amountOutFormatted": "9.95",
"amountOutUsd": "9.95",
"minAmountOut": "9900000",
"deadline": "2025-03-04T15:00:00Z",
"timeWhenInactive": "2025-03-04T15:00:00Z",
"timeEstimate": 120,
"virtualChainRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
"virtualChainRefundRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
"customRecipientMsg": "smart-contract-recipient.near"
}
},
"status": "KNOWN_DEPOSIT_TX",
"updatedAt": "2025-12-02T00:42:17.821Z",
"swapDetails": {
"intentHashes": [
"text"
],
"nearTxHashes": [
"text"
],
"amountIn": "1000",
"amountInFormatted": "0.1",
"amountInUsd": "0.1",
"amountOut": "9950000",
"amountOutFormatted": "9.95",
"amountOutUsd": "9.95",
"slippage": 50,
"originChainTxHashes": [
{
"hash": "0x123abc456def789",
"explorerUrl": "text"
}
],
"destinationChainTxHashes": [
{
"hash": "0x123abc456def789",
"explorerUrl": "text"
}
],
"refundedAmount": "1000",
"refundedAmountFormatted": "0.1",
"refundedAmountUsd": "0.1",
"depositedAmount": "text",
"depositedAmountFormatted": "text",
"depositedAmountUsd": "text",
"referral": "referral"
}
}Retrieves all withdrawals by ANY_INPUT quote with filtering, pagination and sorting
Enter JWT token (optional)
Filter withdrawals from this timestamp (ISO string)
Page number for pagination (default: 1)
Number of withdrawals per page (max: 50, default: 50)
Sort order
Unauthorized - JWT token is invalid
Deposit address not found
GET /v0/any-input/withdrawals?depositAddress=text HTTP/1.1
Host: 1click.chaindefuser.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"asset": "nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near",
"recipient": "0x2527d02599ba641c19fea793cd0f167589a0f10d",
"affiliateRecipient": "0x2527d02599ba641c19fea793cd0f167589a0f10d",
"withdrawals": {
"status": "SUCCESS",
"amountOutFormatted": "9.95",
"amountOutUsd": "9.95",
"amountOut": "9950000",
"withdrawFeeFormatted": "0.01",
"withdrawFee": "10000",
"withdrawFeeUsd": "0.01",
"timestamp": "2019-08-24T14:15:22Z",
"hash": "0x123abc456def789"
}
}Last updated