createForeignCall(Creates a foreign call in the rules engine component contract.config
,rulesEngineForeignCallContract
,rulesEngineComponentContract
,rulesEnginePolicyContract
,policyId
,fcSyntax
):Promise
<number
>
Parameter | Type | Description |
---|---|---|
config | Config | The configuration object containing network and wallet information. |
rulesEngineForeignCallContract | object | The contract instance for interacting with the rules engine component. |
rulesEngineForeignCallContract.abi | (object | object | object )[] | - |
rulesEngineForeignCallContract.address | `0x${string}` | - |
rulesEngineComponentContract | object | - |
rulesEngineComponentContract.abi | (object | object | object )[] | - |
rulesEngineComponentContract.address | `0x${string}` | - |
rulesEnginePolicyContract | object | - |
rulesEnginePolicyContract.abi | (object | object )[] | - |
rulesEnginePolicyContract.address | `0x${string}` | - |
policyId | number | The ID of the policy to associate with the foreign call. |
fcSyntax | string | A JSON string representing the foreign call definition. |
Promise
<number
>
A promise that resolves to the foreign call index. Returns -1
if the operation fails.
simulateContract
function is used to simulate the contract interaction before writing to the blockchain.writeContract
function is used to execute the contract interaction on the blockchain.foreignCallIndex
for an updated foreign call or the result of the newly created foreign call.fcSyntax
fails.