Skip to main content
POST
/
v0
/
quote
Request a swap quote
curl --request POST \
  --url https://1click.chaindefuser.com/v0/quote \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "dry": true,
  "slippageTolerance": 100,
  "originAsset": "nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near",
  "destinationAsset": "nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near",
  "amount": "1000",
  "refundTo": "0x2527D02599Ba641c19FEa793cD0F167589a0f10D",
  "recipient": "13QkxhNMrTPxoCkRdYdJ65tFuwXPhL5gLS2Z5Nr6gjRK",
  "deadline": "2019-08-24T14:15:22Z",
  "depositMode": "SIMPLE",
  "connectedWallets": [
    "0x123...",
    "0x456..."
  ],
  "sessionId": "session_abc123",
  "virtualChainRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
  "virtualChainRefundRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
  "customRecipientMsg": "smart-contract-recipient.near",
  "confidentiality": "basic",
  "referral": "ledger",
  "rebates": [
    {
      "recipient": "rebate-recipient.near",
      "share": 20
    },
    {
      "recipient": "partner-2.near",
      "share": 80
    }
  ],
  "quoteWaitingTimeMs": 3000,
  "appFees": [
    {
      "recipient": "recipient.near",
      "fee": 100
    }
  ]
}
'
{
  "correlationId": "550e8400-e29b-41d4-a716-446655440000",
  "timestamp": "2019-08-24T14:15:22Z",
  "signature": "<string>",
  "quoteRequest": {
    "dry": true,
    "slippageTolerance": 100,
    "originAsset": "nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near",
    "destinationAsset": "nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near",
    "amount": "1000",
    "refundTo": "0x2527D02599Ba641c19FEa793cD0F167589a0f10D",
    "recipient": "13QkxhNMrTPxoCkRdYdJ65tFuwXPhL5gLS2Z5Nr6gjRK",
    "deadline": "2019-08-24T14:15:22Z",
    "depositMode": "SIMPLE",
    "connectedWallets": [
      "0x123...",
      "0x456..."
    ],
    "sessionId": "session_abc123",
    "virtualChainRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
    "virtualChainRefundRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
    "customRecipientMsg": "smart-contract-recipient.near",
    "confidentiality": "basic",
    "referral": "ledger",
    "rebates": [
      {
        "recipient": "rebate-recipient.near",
        "share": 20
      },
      {
        "recipient": "partner-2.near",
        "share": 80
      }
    ],
    "quoteWaitingTimeMs": 3000,
    "appFees": [
      {
        "recipient": "recipient.near",
        "fee": 100
      }
    ]
  },
  "quote": {
    "amountIn": "1000000",
    "amountInFormatted": "1",
    "amountInUsd": "1",
    "minAmountIn": "995000",
    "amountOut": "9950000",
    "amountOutFormatted": "9.95",
    "amountOutUsd": "9.95",
    "minAmountOut": "9900000",
    "timeEstimate": 120,
    "depositAddress": "0x76b4c56085ED136a8744D52bE956396624a730E8",
    "depositMemo": "1111111",
    "deadline": "2025-03-04T15:00:00Z",
    "timeWhenInactive": "2025-03-04T15:00:00Z",
    "virtualChainRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
    "virtualChainRefundRecipient": "0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C",
    "customRecipientMsg": "smart-contract-recipient.near",
    "refundFee": "10000"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.near-intents.org/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-API-Key
string
header
required

API key for partner authentication (recommended)

Body

application/json
dry
boolean
required

Flag indicating whether this is a dry run request. If true, the response will NOT contain the following fields:

  • depositAddress
  • timeWhenInactive
  • deadline
Example:

true

swapType
enum<string>
required

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 to refundTo address after swap is complete.
  • EXACT_OUTPUT — requests the input amount for an exact output.

    • The output amount (amountOut) is fixed; slippage is applied to the input side.
    • The quote response includes amountIn (the proposed input with slippage tolerance baked in) and minAmountIn (the minimum input required).
    • Important: amountIn will appear higher than minAmountIn by approximately your slippageTolerance. This is not price degradation—it is a buffer to ensure successful execution. Any input amount above what is actually needed for the swap is refunded to your refundTo address after the swap completes.
    • If the deposit is above amountIn, the swap is processed and the excess is refunded to refundTo address after swap is complete.
    • If the deposit is less than minAmountIn, the deposit is refunded by deadline.
  • FLEX_INPUT — a flexible input amount that allows for partial deposits and variable amounts.

    • slippage applies both to amountOut and amountIn and defines an acceptable range (minAmountIn and minAmountOut).
    • Any amount higher than minAmountIn is accepted and converted to the output asset as long as minAmountOut is met.
    • The deposit must be at least minAmountIn, after applying the slippage constraint to the quoted amount. Deposits below minAmountIn are refunded if the total received by the deadline is below this amount.
    • If deposits exceed the upper bound, the swap is still processed
Available options:
EXACT_INPUT,
EXACT_OUTPUT,
FLEX_INPUT,
ANY_INPUT
slippageTolerance
number
required

Slippage tolerance for the swap. This value is in basis points (1/100th of a percent), e.g. 100 for 1% slippage.

Example:

100

originAsset
string
required

ID of the origin asset.

Example:

"nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near"

depositType
enum<string>
required

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.
Available options:
ORIGIN_CHAIN,
INTENTS,
CONFIDENTIAL_INTENTS
destinationAsset
string
required

ID of the destination asset.

Example:

"nep141:sol-5ce3bf3a31af18be40ba30f721101b4341690186.omft.near"

amount
string
required

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). Must be an integer string; decimal values like "0.01" are invalid—use base units (e.g. "10000000000000000" for 0.01 with 18 decimals).

Example:

"1000"

refundTo
string
required

Address used for refunds.

Example:

"0x2527D02599Ba641c19FEa793cD0F167589a0f10D"

refundType
enum<string>
required

Type of refund address:

  • ORIGIN_CHAIN - assets are refunded to the refundTo address on the origin chain.
  • INTENTS - assets are refunded to the refundTo Intents account.
Available options:
ORIGIN_CHAIN,
INTENTS,
CONFIDENTIAL_INTENTS
recipient
string
required

Recipient address. The format must match recipientType. Destination routing metadata, when required, must be encoded according to the destination chain address format.

Example:

"13QkxhNMrTPxoCkRdYdJ65tFuwXPhL5gLS2Z5Nr6gjRK"

recipientType
enum<string>
required

Type of recipient address:

  • DESTINATION_CHAIN - assets are transferred to the chain of destinationAsset.
  • INTENTS - assets are transferred to an account inside Intents
Available options:
DESTINATION_CHAIN,
INTENTS,
CONFIDENTIAL_INTENTS
deadline
string<date-time>
required

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.

Example:

"2019-08-24T14:15:22Z"

depositMode
enum<string>
default:SIMPLE

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 the memo together with depositAddress for swap to work.

depositMode applies only to deposit transaction metadata.

Available options:
SIMPLE,
MEMO
Example:

"SIMPLE"

connectedWallets
string[]

Addresses of connected wallets.

Example:
["0x123...", "0x456..."]
sessionId
string

Unique client session identifier for 1Click.

Example:

"session_abc123"

virtualChainRecipient
string

EVM address of a transfer recipient in a virtual chain

Example:

"0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C"

virtualChainRefundRecipient
string

EVM address of a refund recipient in a virtual chain

Example:

"0xb4c2fbec9d610F9A3a9b843c47b1A8095ceC887C"

customRecipientMsg
string

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.

Example:

"smart-contract-recipient.near"

confidentiality
enum<string>
default:public

Confidentiality mode for this quote. Invite-only for now: if set, API may return an invite-only message until rollout is enabled for your integration.

Available options:
public,
basic,
advanced
Example:

"basic"

referral
string

Distribution channel / venue identifier (for example: ledger, trustwallet). Keep lowercase for consistency.

Example:

"ledger"

rebates
object[]

Rebate distribution for this quote. Provide up to 3 confidential Intents recipients (for example, rebate-recipient.near on confidential Intents); each item defines a recipient and its percent share, and all shares must add up to 100.

Example:
[
{
"recipient": "rebate-recipient.near",
"share": 20
},
{
"recipient": "partner-2.near",
"share": 80
}
]
quoteWaitingTimeMs
number
default:0

Time in milliseconds the user is willing to wait for a quote from the relay. **Defaults to 0ms delay if not specified, if you want to receive the fastest quote.

Example:

3000

appFees
object[]

List of recipients and their fees

Response

correlationId
string
required

Unique identifier for request tracing and debugging

Example:

"550e8400-e29b-41d4-a716-446655440000"

timestamp
string<date-time>
required

Timestamp in ISO format that was used to derive the deposit address

Example:

"2019-08-24T14:15:22Z"

signature
string
required

Signature of the 1Click service confirming the quote for the specific deposit address. Must be saved on the client side (along with the whole quote) in order to resolve any disputes or mistakes.

quoteRequest
object
required

User request

quote
object
required

Response containing the deposit address for sending the amount of originAsset and the expected output amount.