> ## 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.

# Quickstart

> Execute your first intent-based swap using 1Click API

1Click API enables you to specify a cross-chain swap **intent** (**what** you want to swap), and handles the **execution** for you.

<Warning>
  There is no testnet version of NEAR Intents - use small amounts for test swaps.
</Warning>

***

## Getting Started

<Steps>
  <Step title="Prerequisites">
    * A small amount of tokens on ANY [supported chain](/resources/chain-support).
    * A [JWT token](/integration/distribution-channels/1click-api/authentication) to avoid the 0.2% fee.
  </Step>

  <Step title="Query supported tokens">
    Fetch available tokens to find the `assetId` values you will need.

    <CodeGroup>
      ```bash cURL theme={null}
      curl https://1click.chaindefuser.com/v0/tokens
      ```

      ```typescript TypeScript theme={null}
      const response = await fetch('https://1click.chaindefuser.com/v0/tokens');
      const tokens = await response.json();
      ```

      ```python Python theme={null}
      import requests
      response = requests.get('https://1click.chaindefuser.com/v0/tokens')
      tokens = response.json()
      ```
    </CodeGroup>

    The response includes tokens with their `assetId` in this format:

    * NEAR tokens: `nep141:wrap.near`
    * Bridged tokens: `nep141:eth-0xdac17f958d2ee523a2206206994597c13d831ec7.omft.near`

    <Accordion title="Example response">
      ```json theme={null}
      [
        {
          "assetId": "nep141:wrap.near",
          "decimals": 24,
          "blockchain": "near",
          "symbol": "wNEAR",
          "price": 1.1,
          "priceUpdatedAt": "2026-02-27T15:18:30.437Z",
          "contractAddress": "wrap.near"
        },
        {
          "assetId": "nep141:eth.omft.near",
          "decimals": 18,
          "blockchain": "eth",
          "symbol": "ETH",
          "price": 1947.28,
          "priceUpdatedAt": "2026-02-27T15:25:30.527Z",
          "contractAddress": null
        },
        {
          "assetId": "nep141:btc.omft.near",
          "decimals": 8,
          "blockchain": "btc",
          "symbol": "BTC",
          "price": 66093,
          "priceUpdatedAt": "2026-02-27T15:25:30.527Z",
          "contractAddress": null
        }
      ]
      ```
    </Accordion>
  </Step>

  <Step title="Request a quote">
    <span id="request-token" />

    Request a quote with your swap parameters. Include your [JWT token](/integration/distribution-channels/1click-api/authentication) to avoid the 0.2% fee.

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://1click.chaindefuser.com/v0/quote \
        -H "Content-Type: application/json" \
        -H "Authorization: Bearer YOUR_JWT_TOKEN" \
        -d '{
          "dry": false,
          "swapType": "EXACT_INPUT",
          "slippageTolerance": 100,
          "originAsset": "nep141:wrap.near",
          "depositType": "ORIGIN_CHAIN",
          "destinationAsset": "nep141:arb-0x912ce59144191c1204e64559fe8253a0e49e6548.omft.near",
          "amount": "100000000000000000000000",
          "recipient": "0xYourArbitrumAddress",
          "recipientType": "DESTINATION_CHAIN",
          "refundTo": "your-account.near",
          "refundType": "ORIGIN_CHAIN",
          "deadline": "2025-01-01T00:00:00.000Z"
        }'
      ```

      ```typescript TypeScript theme={null}
      const quote = await fetch('https://1click.chaindefuser.com/v0/quote', {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'Authorization': 'Bearer YOUR_JWT_TOKEN'
        },
        body: JSON.stringify({
          dry: false,
          swapType: 'EXACT_INPUT',
          slippageTolerance: 100,
          originAsset: 'nep141:wrap.near',
          depositType: 'ORIGIN_CHAIN',
          destinationAsset: 'nep141:arb-0x912ce59144191c1204e64559fe8253a0e49e6548.omft.near',
          amount: '100000000000000000000000',
          recipient: '0xYourArbitrumAddress',
          recipientType: 'DESTINATION_CHAIN',
          refundTo: 'your-account.near',
          refundType: 'ORIGIN_CHAIN',
          deadline: new Date(Date.now() + 3 * 60 * 1000).toISOString()
        })
      });
      const result = await quote.json();
      ```

      ```python Python theme={null}
      import requests
      from datetime import datetime, timedelta

      quote = requests.post(
        'https://1click.chaindefuser.com/v0/quote',
        headers={
          'Content-Type': 'application/json',
          'Authorization': 'Bearer YOUR_JWT_TOKEN'
        },
        json={
          'dry': False,
          'swapType': 'EXACT_INPUT',
          'slippageTolerance': 100,
          'originAsset': 'nep141:wrap.near',
          'depositType': 'ORIGIN_CHAIN',
          'destinationAsset': 'nep141:arb-0x912ce59144191c1204e64559fe8253a0e49e6548.omft.near',
          'amount': '100000000000000000000000',
          'recipient': '0xYourArbitrumAddress',
          'recipientType': 'DESTINATION_CHAIN',
          'refundTo': 'your-account.near',
          'refundType': 'ORIGIN_CHAIN',
          'deadline': (datetime.now() + timedelta(minutes=3)).isoformat() + 'Z'
        }
      )
      result = quote.json()
      ```
    </CodeGroup>

    <Accordion title="Key parameters">
      | Parameter           | Description                                                                                                |
      | ------------------- | ---------------------------------------------------------------------------------------------------------- |
      | `dry`               | `true` to validate parameters and **get a quote without executing the swap**                               |
      | `swapType`          | `EXACT_INPUT` (specify input amount) or `EXACT_OUTPUT` (specify output amount)                             |
      | `slippageTolerance` | Maximum acceptable slippage in basis points (100 = 1%)                                                     |
      | `originAsset`       | Source token `assetId` from the tokens endpoint                                                            |
      | `depositType`       | `ORIGIN_CHAIN` for origin-chain deposits, `INTENTS` for public Intents balances, or `CONFIDENTIAL_INTENTS` |
      | `destinationAsset`  | Target token `assetId` from the tokens endpoint                                                            |
      | `amount`            | Amount in smallest unit (wei, yoctoNEAR, etc.)                                                             |
      | `recipient`         | Address to receive swapped tokens                                                                          |
      | `recipientType`     | `DESTINATION_CHAIN`, `INTENTS`, or `CONFIDENTIAL_INTENTS`                                                  |
      | `refundTo`          | Address for refunds if swap fails                                                                          |
      | `refundType`        | `ORIGIN_CHAIN`, `INTENTS`, or `CONFIDENTIAL_INTENTS`                                                       |
      | `confidentiality`   | `public` (default), `basic`, or `advanced`. Enables a confidential swap on an otherwise normal quote       |
      | `deadline`          | Quote expiration timestamp in ISO format                                                                   |
    </Accordion>

    ## Confidential swaps

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

    <CardGroup cols={2}>
      <Card title="Foreign-to-foreign (most partners)" icon="globe">
        Run a normal `ORIGIN_CHAIN` → `DESTINATION_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.
      </Card>

      <Card title="Embedded account / wallet" icon="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](#signed-intent-execution). This is the advanced, wallet-style use case.
      </Card>
    </CardGroup>

    To request a foreign-to-foreign confidential quote, add `confidentiality` to a standard quote request:

    ```json theme={null}
    {
      "dry": false,
      "swapType": "EXACT_INPUT",
      "originAsset": "nep141:wrap.near",
      "depositType": "ORIGIN_CHAIN",
      "destinationAsset": "nep141:arb-0x912ce59144191c1204e64559fe8253a0e49e6548.omft.near",
      "amount": "100000000000000000000000",
      "recipient": "0xYourArbitrumAddress",
      "recipientType": "DESTINATION_CHAIN",
      "refundTo": "your-account.near",
      "refundType": "ORIGIN_CHAIN",
      "confidentiality": "basic",
      "deadline": "2025-01-01T00:00:00.000Z"
    }
    ```

    <Info>
      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](https://partners.near-intents.org) to request access.
    </Info>

    <Tip>
      This guide uses `EXACT_INPUT`, but 1Click also supports `EXACT_OUTPUT`, `FLEX_INPUT`, and `ANY_INPUT`. Check out [Swap Types](./swap-types) to see what each one does and when to use it.
    </Tip>
  </Step>

  <Step title="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](#signed-intent-execution) instead.
  </Step>

  <Step title="Submit transaction hash (optional)">
    Speed up processing by notifying 1Click of your deposit.

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://1click.chaindefuser.com/v0/deposit/submit \
        -H "Content-Type: application/json" \
        -d '{
          "depositAddress": "address-from-quote-response",
          "txHash": "0xYourTransactionHash"
        }'
      ```

      ```typescript TypeScript theme={null}
      await fetch('https://1click.chaindefuser.com/v0/deposit/submit', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({
          depositAddress: 'address-from-quote-response',
          txHash: '0xYourTransactionHash'
        })
      });
      ```

      ```python Python theme={null}
      requests.post(
        'https://1click.chaindefuser.com/v0/deposit/submit',
        json={
          'depositAddress': 'address-from-quote-response',
          'txHash': '0xYourTransactionHash'
        }
      )
      ```
    </CodeGroup>
  </Step>

  <Step title="Monitor status">
    Check swap progress using the deposit address.

    <CodeGroup>
      ```bash cURL theme={null}
      curl "https://1click.chaindefuser.com/v0/status?depositAddress=your-deposit-address"
      ```

      ```typescript TypeScript theme={null}
      const status = await fetch(
        'https://1click.chaindefuser.com/v0/status?depositAddress=your-deposit-address'
      );
      const result = await status.json();
      ```

      ```python Python theme={null}
      status = requests.get(
        'https://1click.chaindefuser.com/v0/status',
        params={'depositAddress': 'your-deposit-address'}
      )
      ```
    </CodeGroup>

    <Accordion title="Status response">
      | Status               | Description                                   |
      | -------------------- | --------------------------------------------- |
      | `PENDING_DEPOSIT`    | Awaiting your token deposit                   |
      | `KNOWN_DEPOSIT_TX`   | Deposit transaction detected                  |
      | `PROCESSING`         | Swap being executed                           |
      | `SUCCESS`            | Tokens delivered to destination address       |
      | `INCOMPLETE_DEPOSIT` | Deposit below required amount                 |
      | `REFUNDED`           | Swap failed, funds returned to refund address |
      | `FAILED`             | Swap encountered an error                     |
    </Accordion>

    <Callout color="#fb4d01">
      View detailed transaction info on the [NEAR Intents Explorer](https://explorer.near-intents.org) by searching for your deposit address.
    </Callout>
  </Step>

  <Step title="Celebrate! 🎉">
    You just completed your first intent-based cross-chain swap!
  </Step>
</Steps>

## 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.

<Tip>
  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.
</Tip>

| Deposit channel              | depositType            | How the deposit is made                                                          |
| ---------------------------- | ---------------------- | -------------------------------------------------------------------------------- |
| Origin chain transfer        | `ORIGIN_CHAIN`         | Send tokens to `depositAddress`, optionally notify via `POST /v0/deposit/submit` |
| Signed intent                | `INTENTS`              | Generate intent, user signs, `POST /v0/submit-intent`                            |
| Signed intent (confidential) | `CONFIDENTIAL_INTENTS` | Generate 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.

<Info>
  Confidential Intents is invite-only for now. Confirm your integration is enabled before requesting quotes with `CONFIDENTIAL_INTENTS`.
</Info>

<Info>
  `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`.
</Info>

<Steps>
  <Step title="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.
  </Step>

  <Step title="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](/api-reference/oneclick/generate-an-intent-for-signing).
  </Step>

  <Step title="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.
  </Step>

  <Step title="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](/api-reference/oneclick/submit-a-signed-intent).
  </Step>

  <Step title="Track">
    Poll `GET /v0/status` with the `depositAddress`, as with any swap. Include `depositMemo` if the quote response included one.
  </Step>
</Steps>

## Next Steps

<CardGroup cols={2}>
  <Card title="Clone the Example Repo" icon="github" href="https://github.com/near-examples/near-intents-examples">
    Clone and run a working TypeScript implementation to get started quickly.
  </Card>

  <Card title="Watch NEAR Intents 102" icon="youtube" href="https://www.youtube.com/watch?v=U8ngm2hR4a4">
    Follow along with this guided workshop explaining all the steps in detail.
  </Card>

  <Card title="Use the SDK" icon="window-restore" href="./sdk">
    Integrate with our official SDK libraries for TypeScript, Go, or Rust.
  </Card>

  <Card title="NEAR Intents Explorer" icon="magnifying-glass" href="https://explorer.near-intents.org">
    Track transactions and view swap history
  </Card>
</CardGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Swap taking a long time">
    * 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
  </Accordion>

  <Accordion title="Swap failed or was refunded">
    * 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
  </Accordion>

  <Accordion title="Need help?">
    Join our [Telegram community](https://t.me/near_intents) for support.
  </Accordion>
</AccordionGroup>
