# Schedule ETH Transfer on Event Trigger

Initialise the Bundler Instance and Account API Instance.&#x20;

Make sure you have the ETH you want to schedule in your SC Wallet Address.

Transferring ETH if Proposal statusCode is equal to 2 in the example below.

```typescript
import { BigNumber } from "ethers";
import { encodeFunctionData, parseUnits } from "viem";

const unsignedUserOp = await walletAPI.createUnsignedUserOp({
  target: recipientAddressForETH,
  data: "0x",
  maxFeePerGas: BigNumber.from("90000000000"), // average value for the token transfer
  maxPriorityFeePerGas: BigNumber.from("1500000000"), // average value for the token transfer
  gasLimit: BigNumber.from("2000320"), // average value for the token transfer
  value: 1000000n, // Transfering ETH to recipient
});

const newUserOp: any = {
  sender: await unsignedUserOp.sender,
  nonce: await unsignedUserOp.nonce,
  initCode: await unsignedUserOp.initCode,
  callData: await unsignedUserOp.callData,
  callGasLimit: await unsignedUserOp.callGasLimit,
  verificationGasLimit: await unsignedUserOp.verificationGasLimit,
  preVerificationGas: await unsignedUserOp.preVerificationGas,
  maxFeePerGas: await unsignedUserOp.maxFeePerGas,
  maxPriorityFeePerGas: await unsignedUserOp.maxPriorityFeePerGas,
  paymasterAndData: await unsignedUserOp.paymasterAndData,
  signature: await unsignedUserOp.signature,
};

const key = await bundler.getValidNonceKey(newUserOp);
const nonce = await walletAPI.getNonce(key);
newUserOp.nonce = nonce;

const signedUserOp = await walletAPI.signUserOp(newUserOp);

const advancedOp = {
  ...signedUserOp,
  advancedUserOperation: {
    triggerEvent: {
      contractAddress: propsalContractAddress,
      eventSignature: "event ProposalResult(address indexed recipient, uint statusCode);",
      evaluationStatement: ":statusCode: == 2",
    },
  },
};

const userOpHash = await bundler.sendUserOpToBundler(advancedOp);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.epochprotocol.xyz/use-epoch-sdk/intent-automation-module/examples/schedule-eth-transfer-on-event-trigger.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
