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

# relay

> Co-sign and broadcast a gasless transaction via the XOXNO Relayer WebSocket.

Enterprise feature. Submit a user-signed transaction that includes a shard-matched `relayer` address. The Relayer validates the shard assignment, co-signs with its Ed25519 key, and broadcasts via P2P gossipsub, covering the gas fee.

Gasless relaying is available to whitelisted enterprise applications. For standard transaction submission, use [broadcast](/api-reference/ws/broadcast) instead.

## Endpoint

`wss://relayer.xoxno.com/ws`

## Body

<ParamField body="action" type="string" required>
  Must be `"relay"`.
</ParamField>

<ParamField body="requestId" type="string">
  Echoed back in the response for client-side correlation.
</ParamField>

<ParamField body="tx" type="object" required>
  A user-signed transaction with the `relayer` field set.

  <Expandable title="properties" defaultOpen>
    <ParamField body="nonce" type="integer" required>
      Sender's current account nonce.
    </ParamField>

    <ParamField body="value" type="string" required>
      EGLD value in atomic units. Use `"0"` for ESDT transfers.
    </ParamField>

    <ParamField body="receiver" type="string" required>
      Receiver address in bech32 format.
    </ParamField>

    <ParamField body="sender" type="string" required>
      Sender address in bech32 format.
    </ParamField>

    <ParamField body="gasPrice" type="integer" required>
      Gas price in atomic units.
    </ParamField>

    <ParamField body="gasLimit" type="integer" required>
      Maximum gas units.
    </ParamField>

    <ParamField body="data" type="string">
      Base64-encoded transaction payload.
    </ParamField>

    <ParamField body="chainID" type="string" required>
      `"1"` for mainnet, `"D"` for devnet.
    </ParamField>

    <ParamField body="version" type="integer" required>
      Transaction version. Use `2`.
    </ParamField>

    <ParamField body="signature" type="string" required>
      User's hex-encoded Ed25519 signature. Compute this **after** setting the `relayer` field.
    </ParamField>

    <ParamField body="relayer" type="string" required>
      Shard-matched relayer address. Must match the sender's shard.

      | Shard | Address                                                          |
      | ----- | ---------------------------------------------------------------- |
      | 0     | `erd1l0x0n5yxsfcy93gm0vyvx9m9f7cte9h9vuq4am33ugpw3d5r3hvqx6f59h` |
      | 1     | `erd12yxd5phejzw83gn8qh6jfz6q9a0ekyyhkfd3c49r03mxw25l3a5swq3nf7` |
      | 2     | `erd13jxp0yjh7gjvzgrg5mj7e8rzhn5lzcye45l0p6e5996d543r7vrq9e50za` |
    </ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField name="action" type="string">
  `"relay"`
</ResponseField>

<ResponseField name="requestId" type="string">
  Echoed from the request.
</ResponseField>

<ResponseField name="status" type="string">
  `"completed"`, `"partial"`, or `"failed"`.
</ResponseField>

<ResponseField name="hashes" type="string[]">
  Transaction hashes for successfully relayed transactions.
</ResponseField>

<ResponseField name="failed" type="object[]">
  Failures, each with `index` and `reason`.

  <Expandable title="properties">
    <ResponseField name="index" type="integer">
      Zero-based index of the failed transaction.
    </ResponseField>

    <ResponseField name="reason" type="string">
      One of: `missing relayer`, `shard mismatch: sender_shard=X, relayer_shard=Y`, `unconfigured relayer`, `signing capacity exceeded, try again later`.
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```json Request theme={"system"}
  {
    "action": "relay",
    "requestId": "relay-001",
    "tx": {
      "nonce": 42,
      "value": "0",
      "receiver": "erd1qqqqqqqqqqqqqpgq...",
      "sender": "erd1spyavw0956vq68xj8y4tenjpq2wd5a9p2c6j8gsz7ztyrnpxrruqzu66jx",
      "gasPrice": 1000000000,
      "gasLimit": 50000000,
      "data": "c3dhcA==",
      "chainID": "1",
      "version": 2,
      "signature": "a1b2c3d4...",
      "relayer": "erd1l0x0n5yxsfcy93gm0vyvx9m9f7cte9h9vuq4am33ugpw3d5r3hvqx6f59h"
    }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={"system"}
  {
    "action": "relay",
    "requestId": "relay-001",
    "status": "completed",
    "hashes": [
      "d5e8c9a1b3f7..."
    ],
    "failed": []
  }
  ```

  ```json Shard mismatch theme={"system"}
  {
    "action": "relay",
    "requestId": "relay-001",
    "status": "failed",
    "hashes": [],
    "failed": [
      { "index": 0, "reason": "shard mismatch: sender_shard=1, relayer_shard=0" }
    ]
  }
  ```
</ResponseExample>
