> For the complete documentation index, see [llms.txt](https://yuga.gitbook.io/zkyuga-whitepaper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yuga.gitbook.io/zkyuga-whitepaper/developer-guide/erc1155/mintbatch.md).

# mintBatch

The `mintBatch` method for the ERC-1155 token standard allows for the creation of specified quantities of multiple tokens with respective IDs for a certain Ethereum address. This method is essential for scenarios that require the simultaneous minting of various token types, enhancing efficiency by consolidating multiple minting operations into a single transaction. The method is housed within the `ERC1155Instance` object, accessible via the designated method of the `ZkyugaClient` or a similar library.

## Method Signature

```javascript
async mintBatch(
    userAddress: string,
    ids: string[],
    amounts: string[],
    data: string = "0x",
    signer: WalletSigner
): Promise<TransactionResponse>
```

### Parameters

| Parameter   | Type         | Description                                                                                     |
| ----------- | ------------ | ----------------------------------------------------------------------------------------------- |
| userAddress | string       | The Ethereum address designated to receive the minted tokens.                                   |
| ids         | string\[]    | An array of specific IDs of the ERC-1155 tokens to be minted.                                   |
| amounts     | string\[]    | An array indicating the quantity of each token to be minted, corresponding to the provided IDs. |
| data        | string       | Optional additional data or bytes to accompany the minting function; defaults to "0x".          |
| signer      | WalletSigner | The wallet signer instance tasked with signing the transaction.                                 |

### Returns

* A `Promise` resolving to a `TransactionResponse`, which offers details about the batch minting transaction.

## Usage Example

First, instantiate the desired ERC-1155 token contract:

```javascript
const erc1155 = zkyugaClient.getERC1155Instance("your ERC-1155 contract address here");
```

Subsequently, invoke the `mintBatch` method with the requisite parameters:

```javascript
const recipientAddress = "0xBbF289D846208c16EDc8474705C748aff07732dB";
const tokenIds = ["token-id-1", "token-id-2", "token-id-3"];
const mintAmounts = ["100", "200", "150"];
const dataBytes = "0x";  // Optional data bytes
const signer = zkyugaClient.createWalletSigner("your private key");

const batchMintTransaction = await erc1155.mintBatch(recipientAddress, tokenIds, mintAmounts, dataBytes, signer);
console.log(`Batch Mint Transaction Hash: ${batchMintTransaction.hash}`);
```

## Notes

* The `mintBatch` method simplifies the process of minting multiple ERC-1155 tokens simultaneously. It's crucial to ensure appropriate permissions and checks when using this method, as unrestricted batch minting can introduce potential vulnerabilities.
* Before invoking the `mintBatch` method, always confirm the correctness of the Ethereum address, token IDs, and other parameters to avoid inadvertent mistakes.

***
