> For the complete documentation index, see [llms.txt](https://docs.anchored.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.anchored.finance/trading-api-docs-en/api-reference/one-click.md).

# One Click

> One Click allows delegated trading through an authorized proxy wallet. Before calling `/send` endpoints, complete the authorization flow.

## Query Authorization Status

```
GET /api/v1/1ct/status
```

Response `data`:

| Field       | Type   | Description                                               |
| ----------- | ------ | --------------------------------------------------------- |
| `status`    | string | Authorization status. `/send` endpoints require `enable`. |
| `delegatee` | string | Proxy wallet address.                                     |

***

## Generate EIP-712 Payload

```
POST /api/v1/1ct/prepare
```

### Request Body

| Field      | Type   | Required | Description                                                |
| ---------- | ------ | -------- | ---------------------------------------------------------- |
| `deadline` | number | Yes      | EIP-712 signature deadline (Unix seconds). ≤ `4294967295`. |

### Response `data`

| Field         | Type   | Description                    |
| ------------- | ------ | ------------------------------ |
| `delegatee`   | string | Proxy wallet address.          |
| `signPayload` | object | EIP-712 typed data.            |
| `nonce`       | number | Delegate nonce.                |
| `deadline`    | number | Deadline matching the request. |

### signPayload Structure

```json
{
  "domain": {
    "name": "OneClickRouter",
    "version": "1",
    "chainId": 10143,
    "verifyingContract": "0x..."
  },
  "types": {
    "EIP712Domain": [
      { "name": "name", "type": "string" },
      { "name": "version", "type": "string" },
      { "name": "chainId", "type": "uint256" },
      { "name": "verifyingContract", "type": "address" }
    ],
    "Delegate": [
      { "name": "user", "type": "address" },
      { "name": "delegatee", "type": "address" },
      { "name": "nonce", "type": "uint64" },
      { "name": "deadline", "type": "uint32" }
    ]
  },
  "primaryType": "Delegate",
  "message": {
    "user": "0x...",
    "delegatee": "0x...",
    "nonce": 0,
    "deadline": 1893456000
  }
}
```

***

## Enable One Click

```
POST /api/v1/1ct/enable
```

### Request Body

| Field       | Type   | Required | Description                                               |
| ----------- | ------ | -------- | --------------------------------------------------------- |
| `signature` | string | Yes      | User's EIP-712 signature on `signPayload` (65 bytes hex). |
| `deadline`  | number | Yes      | Deadline matching the signature payload.                  |

{% hint style="warning" %}
`signature` is a `0x`-prefixed 65 bytes hex. `deadline` **must** use the same value returned by `/prepare`.
{% endhint %}

### Node.js Signature Example (ethers v6)

```js
import { Wallet } from "ethers";

const { signPayload, deadline } = prepareResponse.data;
const wallet = new Wallet(process.env.USER_PRIVATE_KEY);

// Verify signer address matches
if (wallet.address.toLowerCase() !== signPayload.message.user.toLowerCase()) {
  throw new Error("signer address must match signPayload.message.user");
}

// ethers v6 signature
const signature = await wallet.signTypedData(
  { ...signPayload.domain, chainId: BigInt(signPayload.domain.chainId) },
  { Delegate: signPayload.types.Delegate },
  {
    ...signPayload.message,
    nonce: BigInt(signPayload.message.nonce),
    deadline: BigInt(signPayload.message.deadline),
  }
);

console.log({ signature, deadline });
```

***

## Disable One Click

```
POST /api/v1/1ct/disable
```

No request body. Use empty string for `RAW_BODY` in signing.

***

## Available Send Endpoints

After One Click is enabled, use these `/send` endpoints for delegated trading:

| Operation    | Endpoint                        | Method |
| ------------ | ------------------------------- | ------ |
| Place Order  | `/api/v1/orders/send`           | POST   |
| Cancel Order | `/api/v1/orders/{orderId}/send` | DELETE |
| Deposit      | `/api/v1/cash/deposits/send`    | POST   |
| Withdraw     | `/api/v1/cash/withdrawals/send` | POST   |

Internal flow: build calldata first → send transaction via One Click. Order, deposit, and withdrawal endpoints auto-record txHash on success.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.anchored.finance/trading-api-docs-en/api-reference/one-click.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
