# Developers

If you're reading this section, you’re likely looking to automate the process of obtaining test MONAD tokens.

Please read this page carefully. If anything is unclear, feel free to join our [Discord](https://docs.mwdao.xyz/support) for further assistance.

### **Info Endpoint:**

`GET https://api.mwdao.xyz/bridge/api/v1/info`

This endpoint provides information about the bridge's current exchange rates, limits, and status.

#### **Response Format (JSON)**

```
{
  "exchangeRate": {
    "ETH": "0.000094",
    "USDC": "0.170000",
    "USDT": "0.170000"
  },
  "faucetReserve": "7.006998",
  "faucetWorking": true,
  "limitType": "per transaction",
  "walletLimit": "2.102099"
}

```

#### **Response Parameters**

#### **Exchange Rates**

The `exchangeRate` object defines the cost of **1 MONAD** in various currencies:

* `"ETH": "0.000094"` → 1 MONAD = 0.000094 ETH
* `"USDC": "0.170000"` → 1 MONAD = 0.17 USDC
* `"USDT": "0.170000"` → 1 MONAD = 0.17 USDT

#### **Faucet Reserve**

* `"faucetReserve": "7.006998"` → The total remaining MONAD tokens in the faucet.

#### **Faucet Status**

* `"faucetWorking": true` → Indicates whether the faucet is currently active.

#### **Transaction Limits**

* `"limitType": "per transaction"` → The limit is enforced on a per-transaction basis.
* `"walletLimit": "2.102099"` → The maximum amount of MONAD that a single wallet can receive in one transaction.

***

#### **Usage Recommendations**

1. **Before making a deposit**, check the `exchangeRate` values to calculate how much MONAD you will receive.
2. **Ensure the faucet is working** (`faucetWorking = true`) before initiating a transaction.
3. **Respect the limits** (`walletLimit`) to avoid reverts.
4. **Check minimum deposit limits** in depositor contract read functions.

### **Transaction Status Endpoint:**

`POST https://api.mwdao.xyz/bridge/api/v1/transaction/status`

This endpoint is used to check the status of a Monad bridge transaction by providing the **Arbitrum transaction hash**.

***

#### **Request Format**

#### **Method:**

`POST`

#### **Headers:**

```
{
  "Content-Type": "application/json"
}

```

#### **Body Parameters:**

```
{
  "source_tx": "<source transaction hash>"
}

```

`source_tx` (**string**) – The transaction hash from the source blockchain that initiated the bridge transfer. Format example: `0x6719c8b4e630adb0e3efe052d6f9d834ddffccd69f2c2c15198cb12a3ad21c6a`

#### **Response Format (JSON)**

```
{
  "status": "pending" | "processed" | "failed" | "not_found" | "refunded",
  "message": "<optional message>",
  "txs": {
    "source_tx": "<source transaction hash>",
    "destination_tx": "<destination transaction hash>"
  },
  "deposit_id": "<deposit ID>",
  "source_chain_id": <number>,
  "destination_chain_id": <number>,
  "error": "<error message>"
}
```

#### Response Parameters

* `status` (string) – Indicates the current status of the request. Possible values:
  * `pending`: The transaction is still being processed.
  * `processed`: The transaction has been successfully completed.
  * `failed`: The transaction encountered an error and could not be completed.
  * `not_found`: No transaction matching the provided hash was found.
  * `refunded`: The transaction has been refunded.
* `message` (string) – A descriptive message about the request outcome (e.g., "Transaction status retrieved successfully").
* txs (object) – Contains transaction hashes for both the source and destination:
  * `source_tx` (string): The original transaction hash provided in the request.
  * `destination_tx` (string) – The corresponding transaction hash on the destination blockchain after bridging.
* `deposit_id` (string) – A unique identifier for the deposit associated with this bridge transaction.
* source\_chain\_id (number): Numeric identifier for the source blockchain network.
* `destination_chain_id` (number): Numeric identifier for the destination blockchain network.
* `error` (string): Provides details about any error encountered during the request.

#### **Usage Recommendations**

1. **Poll the transaction status** every few seconds until a `"processed"` response is received.
2. **Set a maximum retry limit** (e.g., 3 minutes with 5-second intervals).
3. **Handle different statuses**:
   * `"processed"` → Show confirmation and provide the Monad transaction hash.
   * `"pending"` → Keep polling until the status changes.
   * `"failed"` → Notify the user and suggest troubleshooting steps.

### **Reading Limits from the Depositor Smart Contract**

The Depositor contract provides **view functions** to retrieve deposit limits and contract status.

#### **Available Functions:**

* `minEthDeposit() → uint256 (wei)` – Returns the **minimum deposit amount in ETH (in wei)**.
* `minUsdcDeposit() → uint256 (wei)` – Returns the **minimum deposit amount in USDC (in wei, with 6 decimals)**.
* `minUsdtDeposit() → uint256 (wei)` – Returns the **minimum deposit amount in USDT (in wei, with 6 decimals)**.
* `paused() → bool` – Returns `true` if the contract is **paused** (deposits are disabled), otherwise `false`.

Always **check `paused()`** before processing transactions.

### **Deposit Functions in the Smart Contract**

The Depositor contract allows users to deposit ETH, USDC, and USDT to receive test MONAD tokens based on the [current exchange rate](#info-endpoint). Each deposit function includes an metadata field for additional data, such as referral codes, which can be an empty string ("").

#### depositETH()

* Function Signature: `depositETH(string calldata metadata)`
* Description: Accepts ETH deposits (payable function).
* Parameters:
  * `metadata`: A string for additional data, such as a referral code. This field is optional and can be an empty string ("").
* Requirements:
  * The deposited ETH amount `msg.value` must meet or exceed the minimum deposit limit `minEthDeposit`.
  * The `metadata` string must not exceed 32 characters.

#### **depositUSDC()**

* Function Signature: `depositUSDC(uint256 amount, string calldata metadata)`
* Description: Accepts USDC deposits using `transferFrom()`.
* Parameters:
  * `amount`: The amount of USDC to deposit, specified in 6 decimals (e.g., 1 USDC = 1 \* 10^6 wei).
  * `metadata`: A string (up to 32 characters) for additional data, such as a referral code. This field is optional and can be an empty string ("").
* Requirements:
  * The sender must approve the contract to spend the specified amount of USDC beforehand.
  * The amount must meet or exceed the minimum deposit limit `minUsdcDeposit`.
  * The `metadata` string must not exceed 32 characters.

#### **depositUSDT()**

* Function Signature: `depositUSDT(uint256 amount, string calldata metadata)`
* Description: Accepts USDT deposits using `transferFrom()`.
* Parameters:
  * `amount`: The amount of USDT to deposit, specified in 6 decimals (e.g., 1 USDT = 1 \* 10^6 wei).
  * `metadata`: A string (up to 32 characters) for additional data, such as a referral code. This field is optional and can be an empty string ("").
* Requirements:
  * The sender must approve the contract to spend the specified amount of USDT beforehand.
  * The amount must meet or exceed the minimum deposit limit `minUsdtDeposit`.
  * The `metadata` string must not exceed 32 characters.

#### **Notes**

* Always check the **minimum deposit limits** before sending funds.
* For USDC/USDT deposits, **approval is required** before calling the deposit function.
* Transactions will **fail** if the deposit amount is below the minimum threshold.
