> ## Documentation Index
> Fetch the complete documentation index at: https://thrackle.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# getAllForeignCalls

> **getAllForeignCalls**(`config`, `rulesEngineForeignCallContract`, `policyId`): `Promise`\<[`ForeignCallOnChain`](../../types/type-aliases/ForeignCallOnChain)\[]>

Retrieves all foreign calls associated with a specific policy ID from the Rules Engine Component Contract.

## Parameters

| Parameter                                | Type                                  | Description                                                                                       |
| ---------------------------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `config`                                 | `Config`                              | The configuration object containing network and wallet information.                               |
| `rulesEngineForeignCallContract`         | `object`                              | An object representing the Rules Engine Component Contract,                                       |
| `rulesEngineForeignCallContract.abi`     | (`object` \| `object` \| `object`)\[] | -                                                                                                 |
| `rulesEngineForeignCallContract.address` | \`0x\$\{string}\`                     | -                                                                                                 |
| `policyId`                               | `number`                              | The ID of the policy for which foreign calls are to be retrieved. containing its address and ABI. |

## Returns

`Promise`\<[`ForeignCallOnChain`](../../types/type-aliases/ForeignCallOnChain)\[]>

A promise that resolves to an array of foreign calls if successful, or `null` if an error occurs.

## Throws

Will log an error to the console if the operation fails.

## Defined in

[src/modules/foreign-calls.ts:488](https://github.com/forte-service-company-ltd/forte-rules-engine-sdk/blob/5aad4d7c3c8cc91280e4449c17ac8ea31219fbed/src/modules/foreign-calls.ts#L488)
