# transferBatchERC1155

Transfer multiple L2 ERC-1155 tokens from one user to another.

## Usage

The following example is an advance handler that transfers 1 \* 10^18 units of tokens 1 and 2 of the token `0x04d724738873CB6a86328D2EbAEb2079D715e61e` from the sender of the input to a recipient specified in the input payload.
If the sender does not have enough balance an exception is raised, and that handler is aborted.

```ts twoslash
import { Rollup, chain } from "@cartesi/rollup";
import { createWallet } from "@deroll/wallet";
import { parseUnits } from "viem";

// open the rollup device
const rollup = new Rollup();

// create wallet
const wallet = createWallet();

const token = "0x04d724738873CB6a86328D2EbAEb2079D715e61e"; // ERC-1155 address
rollup.run({
    advance: chain(wallet.handler, ({ msgSender, payload }) => {
        const value1 = parseUnits("1", 18);
        const value2 = parseUnits("1", 18);
        const address = payload.toString();
        wallet.transferBatchERC1155( // [!code focus]
            token, // [!code focus]
            msgSender, // [!code focus]
            address, // [!code focus]
            [1n, 2n], // [!code focus]
            [value1, value2], // [!code focus]
        ); // [!code focus]
        return true;
    }),
});
```

## Returns

Type: `void`

## Parameters

Type: `Address`

Token address.

Type: `string`

From address.

Type: `string`

Recipiend address.

Type: `bigint[]`

Token ids.

Type: `bigint[]`

Amounts to transfer.
