Skip to main content

POST /v1/yield/setup-relay

Free — No payment required.
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, 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

setupTicket
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
  • initCalldataHashkeccak256 of the setup calldata
  • setupType"full" or "modules"
  • expiresAt — ISO 8601 expiry timestamp
signedRawTx
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
confirmations
number
Number of block confirmations to wait for (1-10, default: 2).

Example

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

{
  "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