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": {
        "vaultAddress": "0x1234567890123456789012345678901234567890",
        "shares": "50.0",
        "nonce": 1769691075449
      },
      "type": "1402"
    },
    "signature": "0xc1aa6c72696fe7396404049143da22d26301a565d3b9cdcab36ac5872def6a89...",
    "nonce": 1769691075449
  }'
{
  "tx_hash": "0xa04e3a17347b9561983107ce39ae6671d6a20a787a20427d07094c6ab7b7543e",
  "tx_type": 1402,
  "error": "",
  "data": {
    "assets_redeemed": "50.0"
  },
  "address": "0xEc6d21B8c1FF6dF523F22c4cf54F077e5F7cAfBf"
}
Use the ExchangeClient redeemFromVault method to redeem shares from a vault and receive collateral. Method: POST https://api.hotstuff.trade/exchange
curl --request POST \
  --url https://api.hotstuff.trade/exchange \
  --header 'Content-Type: application/json' \
  --data '{
    "action": {
      "data": {
        "vaultAddress": "0x1234567890123456789012345678901234567890",
        "shares": "50.0",
        "nonce": 1769691075449
      },
      "type": "1402"
    },
    "signature": "0xc1aa6c72696fe7396404049143da22d26301a565d3b9cdcab36ac5872def6a89...",
    "nonce": 1769691075449
  }'
{
  "tx_hash": "0xa04e3a17347b9561983107ce39ae6671d6a20a787a20427d07094c6ab7b7543e",
  "tx_type": 1402,
  "error": "",
  "data": {
    "assets_redeemed": "50.0"
  },
  "address": "0xEc6d21B8c1FF6dF523F22c4cf54F077e5F7cAfBf"
}

Request Body

action
object
required
{
  "data": {
    "vaultAddress": String,
    "shares": String,
    "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
data.assets_redeemedStringAmount of assets redeemed
addressStringUser wallet address in hexadecimal format