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

# Transfer

> Transfer ENSC between wallets

<span style={{ color: "#16a34a" }}>`POST`</span> `/transfer`

This endpoint generates an unsigned transaction for transferring tokens between wallets. It is designed specifically for transferring ENSC tokens only. The service validates both the sender and recipient addresses, confirms that the asset type is ENSC. It also checks that the sender has sufficient token [balance](/integrations/endpoints/token-balance) and [allowance](/integrations/endpoints/token-approval) (pass the sender parameter to approve the token allowance).

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <api_key>` |

**Body**

| Name        | Type   | Description                                          |
| ----------- | ------ | ---------------------------------------------------- |
| `from`      | string | The wallet address that holds the tokens (sender).   |
| `recipient` | string | The wallet address that will receive the tokens.     |
| `assetType` | string | The asset type for the transfer. **Must be** `ENSC`. |
| `amount`    | number | The number of tokens to transfer.                    |

**Example**

<Tabs>
  <Tab title="Transfer Request">
    ```json theme={null}
    {
      "from": "0xsenderaddress",
      "recipient": "0xrecipientaddress",
      "assetType": "ENSC",
      "amount": 5
    }
    ```
  </Tab>

  <Tab title="Response (200) Ok">
    ```json theme={null}
    {
      "status": 200,
      "message": "Transfer transaction generated successfully",
      "data": {
        "to": "0xTokenContractAddressXYZ",
        "nonce": "12",
        "gasLimit": "0x186a0",
        "gasPrice": "20000000000",
        "data": "0xEncodedTransferFunctionCall",
        "fromAddress": "0xsenderaddress",
        "toAddress": "0xrecipientaddress",
        "value": "5000000000000000000"  // Amount in Wei (for 5 tokens with 18 decimals)
      }
    }

    ```
  </Tab>
</Tabs>

**Common Error Responses**

<Tabs>
  <Tab title="Invalid Sender Address:">
    ```json theme={null}
    {
      "status": 400,
      "error": "Invalid Request",
      "message": "Invalid sender address",
      "details": { "receivedAddress": "0xInvalidSender" }
    }
    ```
  </Tab>

  <Tab title="Invalid Recipient Address:">
    ```json theme={null}
    {
      "status": 400,
      "error": "Invalid Request",
      "message": "Invalid recipient address",
      "details": { "receivedAddress": "0xInvalidRecipient" }
    }
    ```
  </Tab>

  <Tab title="Unsupported Asset Type:">
    ```json theme={null}
    {
      "status": 400,
      "error": "Invalid Asset",
      "message": "Only ENSC transfers are allowed",
      "details": { "supportedAssets": ["ENSC"] }
    }
    ```
  </Tab>

  <Tab title="Insufficient Balance:">
    ```json theme={null}
    // ENSC has 18 decimals, requiredBalance is 5 and currentBalance is 3
    {
      "status": 400,
      "error": "Insufficient Balance",
      "message": "Sender does not have enough ENSC balance",
      "details": {
        "requiredBalance": "5000000000000000000",
        "currentBalance": "3000000000000000000"
      }
    }
    ```
  </Tab>

  <Tab title="Insufficient Allowance:">
    ```json theme={null}
    {
      "status": 400,
      "error": "Insufficient Allowance",
      "message": "Sender has not approved enough tokens for transfer",
      "details": {
        "requiredAllowance": "5000000000000000000",
        "currentAllowance": "2000000000000000000"
      }
    }
    ```
  </Tab>
</Tabs>
