> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nexroute.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Submit your first transaction to a Capture endpoint

This guide walks an onboarded partner through their first submission.

## Prerequisites

* A dedicated Capture endpoint URL (provided by nexroute during onboarding)
* Source IPs allowlisted on that endpoint (coordinated during onboarding; see [Authentication](/capture/rpc/authentication))

## Methods

The endpoint speaks JSON-RPC 2.0 over HTTPS and WebSocket. Two submission methods are exposed:

* **`eth_sendPrivateRawTransaction`** — submit a single user-signed transaction. Use this for the common case where the user signs one swap and you forward it as-is.
* **`eth_sendBundle`** — submit an ordered list of user-signed transactions as an atomic bundle. **Most useful when a swap needs its ERC-20 approval packed alongside it**: pass `[approval_tx, swap_tx]` and the approval, swap, and backrun all land atomically. Mirrors Flashbots' `eth_sendBundle` shape.

Any other method returns `-32601 method not found`.

## Submit a single transaction

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST <YOUR_CAPTURE_ENDPOINT> \
    -H "Content-Type: application/json" \
    -d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "eth_sendPrivateRawTransaction",
      "params": [{ "tx": "<RAW_SIGNED_TX>" }]
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('<YOUR_CAPTURE_ENDPOINT>', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      jsonrpc: '2.0',
      id: 1,
      method: 'eth_sendPrivateRawTransaction',
      params: [{ tx: '<RAW_SIGNED_TX>' }],
    }),
  });

  const data = await response.json();
  console.log(data.result); // 0x... tx hash
  ```
</CodeGroup>

Params is a single-element array containing an object with `tx`, the hex-encoded raw signed transaction (`0x`-prefixed). The object shape mirrors Flashbots' `eth_sendPrivateTransaction` and reserves room for optional fields (e.g. `maxBlockNumber`) without further wire breaks. The signature is the user's; nexroute does not modify the payload.

### Response

The endpoint returns a JSON-RPC envelope echoing the request `id`. The `result` field contains the transaction hash (0x-prefixed, 32 bytes).

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x6b6f1c8f5d2c4a9d3e1f8b7c6a5d4e3f2c1b0a9d8e7f6a5b4c3d2e1f0a9b8c7d"
}
```

A non-error response confirms acceptance; nexroute is committed to delivery from this point. Use the hash to track inclusion in any block explorer.

## Submit a bundle (approval + swap)

When the swap needs an ERC-20 approval the same user hasn't issued yet, submit both transactions together so they land atomically with the backrun. Order matters: the last transaction is the source nexroute backruns behind; earlier transactions are dependencies bundled in front.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST <YOUR_CAPTURE_ENDPOINT> \
    -H "Content-Type: application/json" \
    -d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "eth_sendBundle",
      "params": [
        {
          "txs": [
            "<RAW_SIGNED_APPROVAL_TX>",
            "<RAW_SIGNED_SWAP_TX>"
          ]
        }
      ]
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('<YOUR_CAPTURE_ENDPOINT>', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      jsonrpc: '2.0',
      id: 1,
      method: 'eth_sendBundle',
      params: [
        {
          txs: [
            '<RAW_SIGNED_APPROVAL_TX>',
            '<RAW_SIGNED_SWAP_TX>',
          ],
        },
      ],
    }),
  });

  const data = await response.json();
  console.log(data.result); // 0x... bundle hash
  ```
</CodeGroup>

The `result` field contains the bundle hash (keccak256 of the concatenated transaction hashes).

## Errors

Errors follow standard JSON-RPC conventions:

| Code     | Cause                                                                             |
| -------- | --------------------------------------------------------------------------------- |
| `-32601` | Method other than `eth_sendPrivateRawTransaction` or `eth_sendBundle`             |
| `-32000` | Malformed transaction (RLP decode failure, invalid signature) or empty bundle     |
| `-32603` | Internal error during forwarding (rare; nexroute always retries before surfacing) |

A non-error response means the submission has been accepted into the routing pipeline. Subsequent inclusion is monitored automatically.

## Next steps

* [Authentication](/capture/rpc/authentication): IP allowlist setup and operational notes
* [Security](/capture/rpc/security): what nexroute guarantees about your orderflow
* [eth\_sendPrivateRawTransaction](/capture/api-reference/eth_sendPrivateRawTransaction) and [eth\_sendBundle](/capture/api-reference/eth_sendBundle): full method specifications
