# Prepare a Supply

> Coming soon, upon request — this feature is turned on for your tenant by the Aurea team. [Contact us](https://www.aureahub.com/contact)

The unsigned transactions of a supply, for a wallet the user signs for — client-side or MPC.

## Overview

- `weiAmount`: digits only, in the smallest unit. The chain and the wallet are picked among all the user's EVM wallets ([Chain and Wallet](https://docs.aureahub.com/docs/guide-lending.md)).
- `steps`: the pool's approval when the allowance falls short, then the supply — each an unsigned EIP-1559 transaction (`to`, `data`, `value`, `chainId`, `nonce`, `gasLimit`, `maxFeePerGas`, `maxPriorityFeePerGas`) with the `txHashToSign`. `walletAddress`: the wallet that signs.
- Sign every `txHashToSign` and send `steps` and the signatures to [Send the Signatures](https://docs.aureahub.com/docs/lending-broadcast.md). Nothing is sent until then.
- For a tenant on the institutional security profile, a policy rule that asks for an approval answers `403` `POLICY_APPROVAL_REQUIRED` here.

## Endpoint

### `POST /v1/lending/prepare-supply`

Authentication: bearer token required.

Builds the unsigned supply transactions. Needs the user's access token and the tenant signature (or a server token).

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `weiAmount` | string | yes | The amount, digits only, in the smallest unit |
| `isTestnet` | boolean | yes | `true` testnet, `false` mainnet |

**Responses**

`200` OK

```json
{
  "steps": [
    {
      "stepIndex": 0,
      "txHashToSign": "0x4c0e…",
      "to": "0xcB44…C56E",
      "data": "0x095ea7b3…",
      "value": "0",
      "chainId": 100,
      "nonce": 7,
      "gasLimit": "60000",
      "maxFeePerGas": "3000000000",
      "maxPriorityFeePerGas": "1000000000"
    },
    {
      "stepIndex": 1,
      "txHashToSign": "0x9a2d…",
      "to": "0x… (the lending pool)",
      "data": "0x617ba037…",
      "value": "0",
      "chainId": 100,
      "nonce": 8,
      "gasLimit": "290000",
      "maxFeePerGas": "3000000000",
      "maxPriorityFeePerGas": "1000000000"
    }
  ],
  "walletAddress": "0x2f4b6c2e9a1d5f3b7c8e0a4d6b2c9e1f3a5d7b90"
}
```

**Example request**

```bash
curl -X POST https://api.aureahub.com/v1/lending/prepare-supply \
  -H "Authorization: Bearer USER_ACCESS_TOKEN" \
  -H "x-tenant-api-key: YOUR_API_KEY" \
  -H "x-timestamp: UNIX_SECONDS" \
  -H "x-signature: HMAC_SHA256_HEX" \
  -H "Content-Type: application/json" \
  -d '{"weiAmount": "50000000000000000000", "isTestnet": false}'
```

---

Web version: https://docs.aureahub.com/#lending-prepare-supply
