> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hotstuff.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# Deposit to Vault

> Send POST request to /exchange, or use the ExchangeClient SDKs.

Use the ExchangeClient `depositToVault` method to deposit collateral into a vault.

<RequestExample>
  ```bash cURL theme={null}
  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
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "tx_hash": "0x24666c7647f68ed388aa6f5aa2e08a7f36adc5f6339b5d12937e15e3b2cb928c",
    "tx_type": 1401,
    "error": "",
    "data": {
      "shares_minted": "100.0"
    },
    "address": "0xEc6d21B8c1FF6dF523F22c4cf54F077e5F7cAfBf"
  }
  ```
</ResponseExample>

### Request body

<ParamField body="action" type="object" required>
  ```
  {
    "data": {
      "vaultAddress": String,
      "amount": String,
      "nonce": Number
    },
    "type": String
  }
  ```
</ParamField>

<ParamField body="signature" type="string" required>
  Signed payload in hexadecimal format
</ParamField>

<ParamField body="nonce" type="number" required>
  Current timestamp in milliseconds
</ParamField>


## OpenAPI

````yaml openapi/exchange/vaults/deposit-to-vault.json POST /exchange
openapi: 3.0.3
info:
  title: Hotstuff Exchange API — Deposit to Vault
  version: 1.0.0
servers:
  - url: https://api.hotstuff.trade
security: []
paths:
  /exchange:
    post:
      summary: Deposit to Vault
      operationId: exchangeVaultsDepositToVault
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                action:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        vaultAddress:
                          type: string
                        amount:
                          type: string
                        nonce:
                          type: integer
                      required:
                        - vaultAddress
                        - amount
                        - nonce
                    type:
                      type: string
                  required:
                    - data
                    - type
                signature:
                  type: string
                nonce:
                  type: integer
              required:
                - action
                - signature
                - nonce
              example:
                action:
                  data:
                    vaultAddress: '0x1234567890123456789012345678901234567890'
                    amount: '100.0'
                    nonce: 1769691074949
                  type: '1401'
                signature: >-
                  0x865876d8ea761547980c364c54e310f0cc6c2cc852fdcbff3c3534fc2d2b77d9...
                nonce: 1769691074949
            examples:
              default:
                summary: Example request
                value:
                  action:
                    data:
                      vaultAddress: '0x1234567890123456789012345678901234567890'
                      amount: '100.0'
                      nonce: 1769691074949
                    type: '1401'
                  signature: >-
                    0x865876d8ea761547980c364c54e310f0cc6c2cc852fdcbff3c3534fc2d2b77d9...
                  nonce: 1769691074949
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  tx_hash:
                    type: string
                  tx_type:
                    type: integer
                  error:
                    type: string
                  data:
                    type: object
                    properties:
                      shares_minted:
                        type: string
                    required:
                      - shares_minted
                  address:
                    type: string
              example:
                tx_hash: >-
                  0x24666c7647f68ed388aa6f5aa2e08a7f36adc5f6339b5d12937e15e3b2cb928c
                tx_type: 1401
                error: ''
                data:
                  shares_minted: '100.0'
                address: '0xEc6d21B8c1FF6dF523F22c4cf54F077e5F7cAfBf'

````