# transferEther

Transfer L2 ETH (or base layer native token) from one user to another.

## Usage

The following example is an advance handler that transfers 1 ETH 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, which rejects the input and emits the error as a report.

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

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

// create wallet
const wallet = createWallet();

rollup.run({
    advance: chain(wallet.handler, ({ msgSender, payload }) => {
        const value = parseEther("1");
        const address = payload.toString();
        wallet.transferEther(msgSender, address, value); // [!code focus]
        return true;
    }),
});
```

## Returns

Type: `void`

## Parameters

Type: `string`

From address.

Type: `string`

Recipiend address.

Type: `bigint`

Amount to transfer.
