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": {
        "collateralId": 1,
        "amount": "5.0",
        "toDerivativesAccount": true,
        "nonce": 1769690769140
      },
      "type": "1053"
    },
    "signature": "0xfe11e1a13facd541cf8c7a03a61b32044acec9afb1f92cc9bb9beb254d0ddcf0...",
    "nonce": 1769690769140
  }'
{
  "tx_hash": "0x8ca2e333c5439263c7599e58599bd58d9392375bab7ced088eae9813664bbac3",
  "tx_type": 1053,
  "error": "",
  "data": {},
  "address": "0xEc6d21B8c1FF6dF523F22c4cf54F077e5F7cAfBf"
}
Use the ExchangeClient accountInternalBalanceTransferRequest method to transfer balance between spot and derivatives accounts. Method: POST https://api.hotstuff.trade/exchange
curl --request POST \
  --url https://api.hotstuff.trade/exchange \
  --header 'Content-Type: application/json' \
  --data '{
    "action": {
      "data": {
        "collateralId": 1,
        "amount": "5.0",
        "toDerivativesAccount": true,
        "nonce": 1769690769140
      },
      "type": "1053"
    },
    "signature": "0xfe11e1a13facd541cf8c7a03a61b32044acec9afb1f92cc9bb9beb254d0ddcf0...",
    "nonce": 1769690769140
  }'
{
  "tx_hash": "0x8ca2e333c5439263c7599e58599bd58d9392375bab7ced088eae9813664bbac3",
  "tx_type": 1053,
  "error": "",
  "data": {},
  "address": "0xEc6d21B8c1FF6dF523F22c4cf54F077e5F7cAfBf"
}

Request Body

action
object
required
{
  "data": {
    "collateralId": Number,
    "amount": String,
    "toDerivativesAccount": Boolean,
    "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
errorStringError message if request failed, empty string on success
dataObjectResponse data object
addressStringUser wallet address in hexadecimal format