Skip to main content
1Click API enables you to specify a cross-chain swap intent (what you want to swap), and handles the execution for you.
There is no testnet version of NEAR Intents - use small amounts for test swaps.

Getting Started

1

Prerequisites

2

Query supported tokens

Fetch available tokens to find the assetId values you will need.
The response includes tokens with their assetId in this format:
  • NEAR tokens: nep141:wrap.near
  • Bridged tokens: nep141:eth-0xdac17f958d2ee523a2206206994597c13d831ec7.omft.near
3

Request a quote

Request a quote with your swap parameters. Include your JWT token to avoid the 0.2% fee.
ParameterDescription
drytrue to validate parameters and get a quote without executing the swap
swapTypeEXACT_INPUT (specify input amount) or EXACT_OUTPUT (specify output amount)
slippageToleranceMaximum acceptable slippage in basis points (100 = 1%)
originAssetSource token assetId from the tokens endpoint
depositTypeORIGIN_CHAIN for origin-chain deposits, INTENTS for public Intents balances, or CONFIDENTIAL_INTENTS
destinationAssetTarget token assetId from the tokens endpoint
amountAmount in smallest unit (wei, yoctoNEAR, etc.)
recipientAddress to receive swapped tokens
recipientTypeDESTINATION_CHAIN, INTENTS, or CONFIDENTIAL_INTENTS
refundToAddress for refunds if swap fails
refundTypeORIGIN_CHAIN, INTENTS, or CONFIDENTIAL_INTENTS
confidentialitypublic (default), basic, or advanced. Enables a confidential swap on an otherwise normal quote
deadlineQuote expiration timestamp in ISO format

Confidential swaps

Confidential Intents has two integration paths. Most partners only need the first.

Foreign-to-foreign (most partners)

Run a normal ORIGIN_CHAINDESTINATION_CHAIN swap and set the confidentiality parameter to basic or advanced. You do not need the CONFIDENTIAL_INTENTS type fields or signed-intent execution — the user deposits and receives on external chains exactly as a standard swap.

Embedded account / wallet

When the funds already live inside a user’s Confidential Intents balance, set depositType, recipientType, and/or refundType to CONFIDENTIAL_INTENTS and authorize the swap with Signed Intent Execution. This is the advanced, wallet-style use case.
To request a foreign-to-foreign confidential quote, add confidentiality to a standard quote request:
Confidential Intents is invite-only. Both confidentiality (foreign-to-foreign) and the CONFIDENTIAL_INTENTS type fields (embedded account) require your integration to be enabled. If set before rollout is enabled for you, the API may return an invite-only message. Contact the team via the Partner Portal to request access.
This guide uses EXACT_INPUT, but 1Click also supports EXACT_OUTPUT, FLEX_INPUT, and ANY_INPUT. Check out Swap Types to see what each one does and when to use it.
4

Send tokens

For ORIGIN_CHAIN quotes, transfer tokens to the depositAddress from the quote response. The swap begins automatically upon receipt.Save the deposit address and your transaction hash for tracking.If your quote uses depositType: INTENTS or depositType: CONFIDENTIAL_INTENTS, skip the on-chain transfer and use Signed Intent Execution instead.
5

Submit transaction hash (optional)

Speed up processing by notifying 1Click of your deposit.
6

Monitor status

Check swap progress using the deposit address.
StatusDescription
PENDING_DEPOSITAwaiting your token deposit
KNOWN_DEPOSIT_TXDeposit transaction detected
PROCESSINGSwap being executed
SUCCESSTokens delivered to destination address
INCOMPLETE_DEPOSITDeposit below required amount
REFUNDEDSwap failed, funds returned to refund address
FAILEDSwap encountered an error
View detailed transaction info on the NEAR Intents Explorer by searching for your deposit address.
7

Celebrate! 🎉

You just completed your first intent-based cross-chain swap!

Signed Intent Execution

Use signed intent execution when a quote uses depositType: INTENTS or depositType: CONFIDENTIAL_INTENTS. In both cases, the funds are already inside NEAR Intents, so the user authorizes the swap by signing an intent message off-chain instead of sending an on-chain deposit.
Foreign-to-foreign confidential swaps (using the confidentiality parameter with ORIGIN_CHAIN deposits) do not use signed intent execution — they follow the standard on-chain deposit flow above.
Deposit channeldepositTypeHow the deposit is made
Origin chain transferORIGIN_CHAINSend tokens to depositAddress, optionally notify via POST /v0/deposit/submit
Signed intentINTENTSGenerate intent, user signs, POST /v0/submit-intent
Signed intent (confidential)CONFIDENTIAL_INTENTSGenerate intent, user signs, POST /v0/submit-intent
For public Intents balances, this can speed execution because there is no on-chain deposit to wait for. For Confidential Intents balances, this is the required path because there is no RPC path for confidential intents.
Confidential Intents is invite-only for now. Confirm your integration is enabled before requesting quotes with CONFIDENTIAL_INTENTS.
POST /v0/generate-intent and POST /v0/submit-intent use partner authentication (X-API-Key recommended, JWT-auth legacy). They do not use the end-user User-Session token; the user’s authorization is the wallet signature submitted as signedData.
1

Quote

Request a quote with POST /v0/quote using depositType INTENTS or CONFIDENTIAL_INTENTS. Save the returned depositAddress; it links the signed intent back to the quote.
2

Generate

Call POST /v0/generate-intent with the depositAddress, the user’s signerId, and their wallet’s signing standard (nep413, erc191, raw_ed25519, webauthn, ton_connect, sep53, or tip191). It returns the unsigned intent payload.For the exact request fields and response shape, see Generate an intent for signing.
3

Sign

The user signs the returned intent payload with their wallet off-chain. Do not modify the payload between generation and signing; the signature must cover the exact payload returned by the API.
4

Submit

Call POST /v0/submit-intent with the signed payload (type: swap_transfer, signedData: the signed MultiPayload). It returns the intentHash.For the exact signedData schema and response shape, see Submit a signed intent.
5

Track

Poll GET /v0/status with the depositAddress, as with any swap. Include depositMemo if the quote response included one.

Next Steps

Clone the Example Repo

Clone and run a working TypeScript implementation to get started quickly.

Watch NEAR Intents 102

Follow along with this guided workshop explaining all the steps in detail.

Use the SDK

Integrate with our official SDK libraries for TypeScript, Go, or Rust.

NEAR Intents Explorer

Track transactions and view swap history

Troubleshooting

  • Check the blockchain explorer for your deposit transaction
  • Verify the deposit address matches the quote response
  • Allow up to 15 minutes for cross-chain processing
  • Use the status endpoint to check current state
  • Verify you sent the exact amount specified in the quote
  • Check your refund address for returned funds
  • Ensure your destination address format is correct for the target chain
  • Request a new quote and try again
Join our Telegram community for support.