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

# convertForeignCallStructsToStrings

> v0.20.5

> **convertForeignCallStructsToStrings**(`foreignCallsOnChain`, `callingFunctionMappings`, `names`): [`ForeignCallJSON`](../../../modules/validation/interfaces/ForeignCallJSON)\[]

Defined in: [src/parsing/reverse-parsing-logic.ts:686](https://github.com/Forte-Service-Company-Ltd/forte-rules-engine-sdk/blob/40cc8388cecd8ee445b00b9df2b681cff8552ece/src/parsing/reverse-parsing-logic.ts#L686)

Convert on-chain foreign call entries into \{ data, json } pairs.

Resolves function signatures and return types using `callingFunctionMappings`
and `PT`, and maps each on-chain entry to the ForeignCallJSON shape along
with an id-bearing ForeignCallData.

The output string format is:
`Foreign Call <index> --> <foreignCallAddress> --> <functionSignature> --> <returnType> --> <parameterTypes>`

Example:

```
Foreign Call 1 --> 0x1234567890abcdef --> myFunction(uint256) --> uint256 --> uint256, string
```

## Parameters

| Parameter                 | Type                                                                                | Description                                                |
| ------------------------- | ----------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| `foreignCallsOnChain`     | [`ForeignCallOnChain`](../../../modules/types/type-aliases/ForeignCallOnChain)\[]   | On-chain foreign call entries.                             |
| `callingFunctionMappings` | [`hexToFunctionString`](../../../modules/types/type-aliases/hexToFunctionString)\[] | Hex-to-function mappings for signatures and arg encodings. |
| `names`                   | `string`\[]                                                                         | -                                                          |

## Returns

[`ForeignCallJSON`](../../../modules/validation/interfaces/ForeignCallJSON)\[]

Array of ForeignCallDataAndJSON.
