> For the complete documentation index, see [llms.txt](https://docs.inverter.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.inverter.network/sdk/typescript-sdk/perform-a-multicall.md).

# Perform a Multicall

## **Setup Requirements**

* **Set up Inverter Network SDK**: Refer to the[ Quick Start](/sdk/typescript-sdk.md) guide for detailed instructions.
* **Retrieve workflow simulation (optional)**: If you are going to batch the workflow deployment itself you can retrieve the preliminary data from [here](/sdk/typescript-sdk/simulate-a-workflow.md).&#x20;

Inverter has a module multicall provider called `trustedForwarder` which enables developers to batch write calls for inverter managed contracts.

## Executing Module Multicall

In this section we will use a already deployed workflow to showcase the execution.

**Parameters**

* **`trustedForwarderAddress` | `orchestratorAddress` (required)**:\
  This parameter is used to locate the batcher.
* `calls` **(required)**:\
  These parameters are the metadata of the bathed write functions.

{% code overflow="wrap" %}

```typescript
import { sdk } from '<your_sdk_export>'
import type { MixedRequestedModules } from '@inverter-network/sdk'

const { getWorkflow, moduleMulticall } = sdk

const deployer = sdk.walletClient.account.address
const TOTAL_DEPOSIT_AMOUNT = '1000'

// Should either be `as const` or be passed dirrectly in the `requestedModules`
const requestedModules = {
    fundingManager: 'FM_DepositVault_v1',
    paymentProcessor: 'PP_Simple_v1',
    authorizer: 'AUT_Roles_v1'
} as const satisfies MixedRequestedModules

const workflow = await getWorkflow({
    orchestratorAddress: '0x8a1897E6Fa0236F68f86240C391D2a7bED3Cf85c',
    requestedModules,
    fundingTokenType: 'ERC20Issuance_v1'
})

// We will first mint the TOTAL_DEPOSIT_AMOUNT
await workflow.fundingToken.module.write.mint.run([deployer, TOTAL_DEPOSIT_AMOUNT])

// Now we will call deposit twice in one transaction
// NOTE: The bytecode run will handle the needed 2 approves, if you want to handle it yourself, pass in the skipApprove method option at the second index of the params `{skipApprove: true}`
const { returnDatas, statuses, transactionHash } =
        await sdk.moduleMulticall.write(
          {
            orchestratorAddress: workflow.orchestrator.address,
            calls: [
              {
                address: workflow.fundingManager.address,
                allowFailure: false,
                callData: await workflow.fundingManager.bytecode.deposit.run('500')
              },
              {
                address: workflow.fundingManager.address,
                allowFailure: false,
                callData: await workflow.fundingManager.bytecode.deposit.run('500')
              }
            ],
          }
        )
        
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.inverter.network/sdk/typescript-sdk/perform-a-multicall.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
