# mint

## Description

The `estimateFee` function is an asynchronous function used to estimate the gas fee required for the `mint` operation of an ERC20 token on a specific blockchain and environment.&#x20;

## Parameters

| Parameter           | Data Type | Description                                                                      |
| ------------------- | --------- | -------------------------------------------------------------------------------- |
| `blockchain`        | string    | The blockchain on which the ERC20 token exists.                                  |
| `contract`          | string    | The contract type, in this case, 'erc20'.                                        |
| `functionType`      | string    | The type of function for which to estimate the fee, in this case, 'mint'.        |
| `env`               | string    | The environment or network of the blockchain.                                    |
| `amount (optional)` | number    | The amount of ERC20 tokens to be minted. (Only required for 'mint' functionType) |

## Response

| Field          | Data Type | Description                                                           |
| -------------- | --------- | --------------------------------------------------------------------- |
| `code`         | number    | The response code indicating the success or failure of the operation. |
| `result`       | number    | The estimated gas fee in the blockchain's native currency.            |
| `VLRYEstimate` | number    | The estimated gas fee in VLRY (a virtual currency).                   |
| `USDEstimate`  | number    | The estimated gas fee in USD.                                         |

## Example Request and Response

### Prerequisites

Before making requests with NO.AI SDK, you must have it installed.

You can install NO.AI SDK using either **`npm`** or **`yarn`**. Use the following commands to install NO.AI SDK:

<br>

```sh
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `mint` request using the NO.AI SDK:

```javascript
const { Nft } = require('@nest25/evm-chains-lib');

const nft = new Nft('testnet');

async function main() {
    const result = await nft.estimateFee('eth', 'erc20', 'mint', 1);
    console.log("result", result);
}

main();
```

### Response

```sh
 result {
        code: 1,
        result: 0.009567552928786952,
        VLRYEstimate: 120.52259181961612,
        USDEstimate: 18.078388772942418
      }
```

### Use Cases

* **Estimate ERC20 Mint Gas Fee:** By invoking this function with the appropriate blockchain, contract, functionType ('mint'), and environment, you can estimate the gas fee required for the `mint` operation of an ERC20 token.
* **Supporting Multiple Blockchains:** The function allows estimating gas fees for ERC20 mint operations on different blockchains by specifying the blockchain parameter (e.g., 'Ethereum', 'Binance Smart Chain', etc.).
* **Providing Results in Different Currencies:** The function returns the estimated gas fee in the native currency of the specified blockchain, as well as its equivalent in VLRY and USD, providing flexibility for users who prefer different currencies.
