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",
        "amount": "100.0",
        "nonce": 1769691074949
      },
      "type": "1401"
    },
    "signature": "0x865876d8ea761547980c364c54e310f0cc6c2cc852fdcbff3c3534fc2d2b77d9...",
    "nonce": 1769691074949
  }'
{
  "tx_hash": "0x24666c7647f68ed388aa6f5aa2e08a7f36adc5f6339b5d12937e15e3b2cb928c",
  "tx_type": 1401,
  "error": "",
  "data": {
    "shares_minted": "100.0"
  },
  "address": "0xEc6d21B8c1FF6dF523F22c4cf54F077e5F7cAfBf"
}
Use the ExchangeClient depositToVault method to deposit collateral into a vault. 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",
        "amount": "100.0",
        "nonce": 1769691074949
      },
      "type": "1401"
    },
    "signature": "0x865876d8ea761547980c364c54e310f0cc6c2cc852fdcbff3c3534fc2d2b77d9...",
    "nonce": 1769691074949
  }'
{
  "tx_hash": "0x24666c7647f68ed388aa6f5aa2e08a7f36adc5f6339b5d12937e15e3b2cb928c",
  "tx_type": 1401,
  "error": "",
  "data": {
    "shares_minted": "100.0"
  },
  "address": "0xEc6d21B8c1FF6dF523F22c4cf54F077e5F7cAfBf"
}

Request Body

action
object
required
{
  "data": {
    "vaultAddress": String,
    "amount": 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.shares_mintedStringNumber of vault shares minted
addressStringUser wallet address in hexadecimal format