Skip to main content

Endpoint

POST /exchange

Request Body

ParameterTypeDescription
action*objectSee below
action.type*stringMust be "approveAgent"
action.hyperliquidChain*string"Mainnet" or "Testnet"
action.signatureChainId*stringEIP-712 chain ID in hex, for example "0xa4b1"
action.agentAddress*stringAgent wallet address, or the zero address to revoke
action.agentNamestringOptional label, max 50 chars
action.nonce*numberMust match outer nonce
nonce*numberReplay-protection nonce
signature*objectEIP-712 signature
signature.r*string32-byte hex string
signature.s*string32-byte hex string
signature.v*numberRecovery id

Response

{
  "success": true
}

Example Request

curl -X POST https://api.notional.xyz/exchange \
  -H "Content-Type: application/json" \
  -d '{
    "action": {
      "type": "approveAgent",
      "hyperliquidChain": "Mainnet",
      "signatureChainId": "0xa4b1",
      "agentAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
      "agentName": "Momentum Bot",
      "nonce": 1701234567890
    },
    "nonce": 1701234567890,
    "signature": {
      "r": "0x1234...",
      "s": "0x5678...",
      "v": 27
    }
  }'

Notes

  • Use 0x0000000000000000000000000000000000000000 to revoke an existing agent by name. - Renaming an existing approved agent is not supported in-place. Revoke it first, then approve again with the new name. - action.nonce must equal the outer nonce.