Skip to main content
POST
https://api.hotstuff.trade
/
exchange
curl --request POST \
  --url https://api.hotstuff.trade/exchange \
  --header 'Content-Type: application/json' \
  --data '{
    "action": {
      "data": {
        "agentName": "TradingBot_v1",
        "agent": "0x436e1aDF2A0fAe363aCc76dEce9b3b8CD5214D07",
        "forAccount": "0xEc6d21B8c1FF6dF523F22c4cf54F077e5F7cAfBf",
        "signature": "0xedb65714077203f313b5a78e8c94d24f4f43a04efbe64eb00a847272fb8ecaf3...",
        "validUntil": 1772282419,
        "nonce": 1769690419606
      },
      "type": "1201"
    },
    "signature": "0xf68aca4d7c6e590e2cec78465029d23bcc122b95bb6cd11cf28a04a2e5f857fa...",
    "nonce": 1769690419606
  }'
{
  "tx_hash": "0x329d27195afd5fd8285c9ae5b3a2d6798674d1949ff09eb8aad55e64d2a1206c",
  "tx_type": 1201,
  "success": true,
  "data": {},
  "address": "0x6d13237c49345cD13f4F7a51CaeA4c5Ba53510a4"
}
Use the ExchangeClient addAgent method to register an API agent wallet that can act on behalf of your account or a sub-account. Method: POST https://api.hotstuff.trade/exchange
curl --request POST \
  --url https://api.hotstuff.trade/exchange \
  --header 'Content-Type: application/json' \
  --data '{
    "action": {
      "data": {
        "agentName": "TradingBot_v1",
        "agent": "0x436e1aDF2A0fAe363aCc76dEce9b3b8CD5214D07",
        "forAccount": "0xEc6d21B8c1FF6dF523F22c4cf54F077e5F7cAfBf",
        "signature": "0xedb65714077203f313b5a78e8c94d24f4f43a04efbe64eb00a847272fb8ecaf3...",
        "validUntil": 1772282419,
        "nonce": 1769690419606
      },
      "type": "1201"
    },
    "signature": "0xf68aca4d7c6e590e2cec78465029d23bcc122b95bb6cd11cf28a04a2e5f857fa...",
    "nonce": 1769690419606
  }'
{
  "tx_hash": "0x329d27195afd5fd8285c9ae5b3a2d6798674d1949ff09eb8aad55e64d2a1206c",
  "tx_type": 1201,
  "success": true,
  "data": {},
  "address": "0x6d13237c49345cD13f4F7a51CaeA4c5Ba53510a4"
}

Request Body

action
object
required
{
  "data": {
    "agentName": String,
    "agent": String,
    "forAccount": String,
    "signature": String,
    "validUntil": Number,
    "nonce": Number
  },
  "type": String
}
signature
string
required
Signed payload in hexadecimal format
nonce
number
required
Current timestamp in milliseconds

Response

FieldTypeDescription
tx_hashStringTransaction hash in hexadecimal format
tx_typeNumberTransaction type identifier
successBooleanWhether the operation was successful
dataObjectResponse data object
addressStringUser wallet address in hexadecimal format