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.
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
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
What 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 thememo
together withdepositAddress
for swap to work.
SIMPLE
Example: SIMPLE
Possible values: How to interpret amount
when performing the swap:
EXACT_INPUT
- requests the output amount for an exact input.EXACT_OUTPUT
- requests the input amount for an exact output. TherefundTo
address always receives any excess tokens after the swap is complete.FLEX_INPUT
- a flexible input amount that allows for partial deposits and variable amounts.
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 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.near
Amount 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).
1000
Address used for refunds.
0x2527D02599Ba641c19FEa793cD0F167589a0f10D
Type of refund address:
ORIGIN_CHAIN
- assets are refunded to therefundTo
address on the origin chain.INTENTS
- assets are refunded to therefundTo
Intents account.
Recipient address. The format must match recipientType
.
13QkxhNMrTPxoCkRdYdJ65tFuwXPhL5gLS2Z5Nr6gjRK
EVM address of a transfer recipient in a virtual chain
0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C
EVM address of a refund recipient in a virtual chain
0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C
HIGHLY 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.near
Type 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:22Z
Referral identifier (lowercase only). It will be reflected in the on-chain data and displayed on public analytics platforms.
referral
Time in milliseconds the user is willing to wait for a quote from the relay.
3000
Example: 3000
Bad Request - Invalid input data
Unauthorized - JWT token is invalid
POST /v0/quote HTTP/1.1
Host: 1click.chaindefuser.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 803
{
"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",
"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",
"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.
Transaction hash of your deposit
0x123abc456def789
Deposit address for the quote
0x2527D02599Ba641c19FEa793cD0F167589a0f10D
Bad Request - Invalid input data
Unauthorized - JWT token is invalid
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,
"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",
"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-08-31T18:04:19.684Z",
"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, 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.
Unauthorized - JWT token is invalid
Deposit address not found
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,
"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",
"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-08-31T18:04:19.684Z",
"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