# transferERC1155

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

## Usage

The following example is an advance handler that transfers 1 \* 10^18 units of token 1 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 { createApp } from "@deroll/app";
import { createWallet } from "@deroll/wallet";
import { parseUnits } from "viem";

// create app
const app = createApp();

// create wallet
const wallet = createWallet();

app.addAdvanceHandler(wallet.handler);

const token = "0x04d724738873CB6a86328D2EbAEb2079D715e61e"; // ERC-1155 address
app.addAdvanceHandler(async ({ metadata, payload }) => {
    const address = payload.toString();
    const value = parseUnits("1", 18);
    wallet.transferERC1155(token, metadata.msgSender, address, 1n, value); // [!code focus]
    return "accept";
});
```

## Returns

Type: `void`

## Parameters

Type: `Address`

Token address.

Type: `string`

From address.

Type: `string`

Recipiend address.

Type: `bigint`

Token id.

Type: `bigint`

Amount to transfer.
