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 Quote
endpointReceive 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 Tx
endpoint with your transaction hash to speed up processing
Monitor progress - (optional)
You can query the process at any time with the
Get Execution Status
endpoint
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.
API Specification (v0)
Auto-generate clients using our OpenAPI spec.
SDKs
Pre-built SDKs for popular languages:
API Endpoints
Base URL: https://1click.chaindefuser.com/
/v0/deposit/submit
Optional route to speed up process with early deposit notification to 1Click
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.
Flag indicating whether this is a dry run request.
If true
, the response will NOT contain the following fields:
depositAddress
timeWhenInactive
deadline
true
Whether to use the amount as the output or the input for the basis of the swap:
EXACT_INPUT
- request output amount for exact input.EXACT_OUTPUT
- request output amount for exact output. TherefundTo
address will always receive excess tokens back even after the swap is complete.
Slippage tolerance for the swap. This value is in basis points (1/100th of a percent), e.g. 100 for 1% slippage.
100
ID of the origin asset.
nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near
Type of the deposit address:
ORIGIN_CHAIN
- deposit address on the origin chainINTENTS
- account ID inside near intents to which you should transfer assets inside intents.
ID of the destination asset.
nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near
Amount to swap as the base amount (can be switched to exact input/output using the dedicated flag), denoted in the smallest unit of the specified currency (e.g., wei for ETH).
1000
Address for user refund.
0x2527D02599Ba641c19FEa793cD0F167589a0f10D
Type of refund address:
ORIGIN_CHAIN
- assets will be refunded torefundTo
address on the origin chainINTENTS
- assets will be refunded torefundTo
intents account
Recipient address. The format should match recipientType
.
13QkxhNMrTPxoCkRdYdJ65tFuwXPhL5gLS2Z5Nr6gjRK
Type of recipient address:
DESTINATION_CHAIN
- assets will be transferred to chain ofdestinationAsset
INTENTS
- assets will be transferred to account inside intents
Timestamp in ISO format, that identifies when user refund will begin if the swap isn't completed by then. It needs to exceed the time required for the deposit tx to be minted, e.g. for Bitcoin it might require ~1h depending on the gas fees paid.
2019-08-24T14:15:22Z
Referral identifier(lower case only). It will be reflected in the on-chain data and displayed on public analytics platforms.
referral
Time in milliseconds user is willing to wait for quote from relay.
3000
Example: 3000
POST /v0/quote HTTP/1.1
Host: 1click.chaindefuser.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 583
{
"dry": true,
"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",
"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,
"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",
"recipientType": "DESTINATION_CHAIN",
"deadline": "2019-08-24T14:15:22Z",
"referral": "referral",
"quoteWaitingTimeMs": 3000,
"appFees": [
{
"recipient": "recipient.near",
"fee": 100
}
]
},
"quote": {
"depositAddress": "0x76b4c56085ED136a8744D52bE956396624a730E8",
"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
}
}
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.
Transaction hash of your deposit
0x123abc456def789
Deposit address for the quote
0x2527D02599Ba641c19FEa793cD0F167589a0f10D
POST /v0/deposit/submit HTTP/1.1
Host: 1click.chaindefuser.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 92
{
"txHash": "0x123abc456def789",
"depositAddress": "0x2527D02599Ba641c19FEa793cD0F167589a0f10D"
}
{
"quoteResponse": {
"timestamp": "2019-08-24T14:15:22Z",
"signature": "text",
"quoteRequest": {
"dry": true,
"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",
"recipientType": "DESTINATION_CHAIN",
"deadline": "2019-08-24T14:15:22Z",
"referral": "referral",
"quoteWaitingTimeMs": 3000,
"appFees": [
{
"recipient": "recipient.near",
"fee": 100
}
]
},
"quote": {
"depositAddress": "0x76b4c56085ED136a8744D52bE956396624a730E8",
"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
}
},
"status": "KNOWN_DEPOSIT_TX",
"updatedAt": "2025-06-25T04:33:16.791Z",
"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"
}
}
Retrieves the current status of a swap using the unique deposit address from the quote.
The response includes the state of the swap (e.g., pending, processing, success, refunded) and any associated swap and transaction details.
GET /v0/status HTTP/1.1
Host: 1click.chaindefuser.com
Authorization: Bearer JWT
Accept: */*
{
"quoteResponse": {
"timestamp": "2019-08-24T14:15:22Z",
"signature": "text",
"quoteRequest": {
"dry": true,
"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",
"recipientType": "DESTINATION_CHAIN",
"deadline": "2019-08-24T14:15:22Z",
"referral": "referral",
"quoteWaitingTimeMs": 3000,
"appFees": [
{
"recipient": "recipient.near",
"fee": 100
}
]
},
"quote": {
"depositAddress": "0x76b4c56085ED136a8744D52bE956396624a730E8",
"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
}
},
"status": "KNOWN_DEPOSIT_TX",
"updatedAt": "2025-06-25T04:33:16.791Z",
"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"
}
}
Last updated