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

# POST /v1/yield/setup-relay

> Relay a signed EIP-7702 setup transaction for first-time wallet delegation.

# POST /v1/yield/setup-relay

<Note>**Free** — No payment required.</Note>

Relay a client-signed EIP-7702 setup transaction to enable smart wallet delegation for yield operations.

When `POST /v1/yield/prepare` returns `needsSetup: true`, the agent must sign a setup transaction and submit it through this endpoint. The server validates the setup ticket, broadcasts the signed transaction to a [test RPC](/concepts/test-rpc), waits for confirmation, and verifies that delegation and module initialization succeeded.

Two setup types are supported:

* **`full`** — First-time setup. Signs a Type-4 (EIP-7702) transaction with `authorization_list` to delegate the EOA to the Nexus smart account and initialize modules.
* **`modules`** — Re-initialization only. Signs a Type-2 (EIP-1559) self-call when delegation already exists but modules need setup.

## Parameters

<ParamField body="setupTicket" type="object" required>
  Setup ticket returned by `POST /v1/yield/prepare` when `needsSetup` is `true`. Contains:

  * `version` — Always `1`
  * `walletAddress` — Agent EOA address (`0x...`)
  * `chainId` — Target chain ID
  * `implementation` — Nexus smart account implementation address
  * `initCalldataHash` — `keccak256` of the setup calldata
  * `setupType` — `"full"` or `"modules"`
  * `expiresAt` — ISO 8601 expiry timestamp
</ParamField>

<ParamField body="signedRawTx" type="string" required>
  Signed raw transaction hex (`0x...`). Must be:

  * Type-4 with `authorization_list` for `setupType: "full"`
  * Type-2 or Type-4 for `setupType: "modules"`
  * A self-call (`to` == `walletAddress`)
  * Signed by the wallet specified in `setupTicket.walletAddress`
</ParamField>

<ParamField body="confirmations" type="number" optional>
  Number of block confirmations to wait for (1-10, default: 2).
</ParamField>

## Example

```bash theme={null}
curl -X POST https://api.staging.rhaios.com/v1/yield/setup-relay \
  -H "Content-Type: application/json" \
  -d '{
    "setupTicket": {
      "version": 1,
      "walletAddress": "0x...",
      "chainId": 8453,
      "implementation": "0x...",
      "initCalldataHash": "0x...",
      "setupType": "full",
      "expiresAt": "2025-03-01T00:00:00.000Z"
    },
    "signedRawTx": "0x...",
    "confirmations": 2
  }'
```

## Response

```json theme={null}
{
  "txHash": "0x9c3ec6d6de7b3b4f0f6f19d9d8a73f0f9f77a17f5d5f3ea0c9f234569c0b8e72",
  "receiptStatus": "success",
  "blockNumber": "28430172",
  "relayMode": "fork-only",
  "setupType": "full",
  "delegationVerified": true,
  "modulesVerified": true,
  "verifiedImplementation": "0x000000004F43C49e93C970E84001853a70923B03",
  "setupRequired": "none",
  "verificationChecks": [
    "ticket-not-expired",
    "chain-active",
    "implementation-match",
    "tx-type-valid",
    "chain-id-match",
    "self-call",
    "calldata-hash-match",
    "auth-list-valid",
    "signer-match",
    "tx-broadcast",
    "receipt-success",
    "delegation-verified"
  ]
}
```

After a successful relay, call `POST /v1/yield/prepare` again to get the deposit/redeem/rebalance payload — setup is now complete.

## Typical flow

1. Call `POST /v1/yield/prepare` — receives `needsSetup: true` with `setupTicket`
2. Sign the setup transaction locally (Type-4 for full, Type-2 for modules)
3. Call `POST /v1/yield/setup-relay` with the ticket and signed transaction
4. Call `POST /v1/yield/prepare` again — receives the execution payload with `needsSetup: false`
