> For the complete documentation index, see [llms.txt](https://docs.intents.aurora.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.intents.aurora.dev/intents-swap/confidential-swaps.md).

# Confidential Swaps

Confidential Swaps route your swap through a private shard of NEAR. The origin wallet and the routing trail are hidden from the outside world. The destination transaction settles publicly as normal.

There is no separate API and no new integration. If you have already called the [Swap API Reference](/api-reference/swap-api-reference.md), you enable confidentiality by enabling confidentiality mode in the quote request.

{% hint style="info" %}
Confidentiality covers only the origin of the assets. See [Confidential Intents](/confidential-intents.md) for the full scope.
{% endhint %}

{% stepper %}
{% step %}

### **Get your API key**

Navigate to [Widget Studio](https://studio.aurora.dev/) and generate an API key. Confidential Swaps use the same key as your standard swaps.
{% endstep %}

{% step %}

### **Request a confidential quote**

Call the quote endpoint exactly as you do today, then add `confidentiality: "advanced"` to the request body. Everything else stays the same.

```bash
curl -X POST https://intents-api.aurora.dev/api/quote/${API_KEY} \
  -H "Content-Type: application/json" \
  -d '{
    "dry": false,
    "confidentiality": "advanced",
    "swapType": "EXACT_INPUT",
    "amount": "1000000",
    "originAsset": "<originAssetId>",
    "destinationAsset": "<destinationAssetId>",
    "depositType": "ORIGIN_CHAIN",
    "recipient": "<recipientAddress>",
    "recipientType": "DESTINATION_CHAIN",
    "refundTo": "<refundAddress>",
    "refundType": "ORIGIN_CHAIN",
    "slippageTolerance": 100,
    "deadline": "2026-07-06T12:00:00.000Z"
  }'
```

Or in JavaScript:

{% hint style="info" %}
Fetch `originAsset` and `destinationAsset` IDs from [Get supported tokens](/api-reference/swap-api-reference/get-supported-tokens.md). Never construct them manually.
{% endhint %}

```javascript
const res = await fetch(
  `https://intents-api.aurora.dev/api/quote/${API_KEY}`,
  {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      dry: false,
      confidentiality: "advanced",
      swapType: "EXACT_INPUT",
      amount: "1000000",
      originAsset: originAssetId,
      destinationAsset: destinationAssetId,
      depositType: "ORIGIN_CHAIN",
      recipient: recipientAddress,
      recipientType: "DESTINATION_CHAIN",
      refundTo: refundAddress,
      refundType: "ORIGIN_CHAIN",
      slippageTolerance: 100,
      deadline: new Date(Date.now() + 10 * 60_000).toISOString(),
    }),
  }
);

const { quote } = await res.json();
// quote.depositAddress is the confidential deposit address
```

{% endstep %}

{% step %}

### **Deposit and complete the swap**

The response returns a `depositAddress` as usual. Send the origin asset to that address, then poll for status with [Get swap status](/api-reference/swap-api-reference/get-swap-status.md). The flow is identical to a standard swap.

```javascript
// Notify the API after depositing to speed up processing
await fetch(`https://intents-api.aurora.dev/api/status/${API_KEY}?depositAddress=0x76b4c56085ED136a8744D52bE956396624a730E8`, {
  method: "POST",
});

// Poll until terminal: SUCCESS, FAILED, REFUNDED
```

**That is it**

The only difference from a standard swap is the `confidentiality` mode. Deposit addresses, status polling, refunds, and your configured fees all behave exactly as they do today.
{% endstep %}

{% step %}

### (Optional) Read Confidential Intents balance

Use [Authenticate user with signed data](/api-reference/confidential-swaps-api-reference/authenticate-user-with-signed-data.md) to authenticate your account and read your balance using [Get user token balances](/api-reference/confidential-swaps-api-reference/get-user-token-balances.md).

{% hint style="info" %}
This is related only to your Confidential Intents balances, a private layer of NEAR Intents.
{% endhint %}
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.intents.aurora.dev/intents-swap/confidential-swaps.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
