updateRule(Updates an existing rule in the Rules Engine Policy Contract.config,rulesEnginePolicyContract,rulesEngineRulesContract,rulesEngineComponentContract,rulesEngineForeignCallContract,policyId,ruleId,ruleS,foreignCallNameToID,trackerNameToID):Promise<number>
Parameters
| Parameter | Type | Description |
|---|---|---|
config | Config | - |
rulesEnginePolicyContract | object | - |
rulesEnginePolicyContract.abi | (object | object)[] | - |
rulesEnginePolicyContract.address | `0x${string}` | - |
rulesEngineRulesContract | object | The contract instance for interacting with the Rules Engine Policy. |
rulesEngineRulesContract.abi | (object | object | object)[] | - |
rulesEngineRulesContract.address | `0x${string}` | - |
rulesEngineComponentContract | object | - |
rulesEngineComponentContract.abi | (object | object | object)[] | - |
rulesEngineComponentContract.address | `0x${string}` | - |
rulesEngineForeignCallContract | object | - |
rulesEngineForeignCallContract.abi | (object | object | object)[] | - |
rulesEngineForeignCallContract.address | `0x${string}` | - |
policyId | number | The ID of the policy to which the rule belongs. |
ruleId | number | The ID of the rule to be updated. |
ruleS | string | A JSON string representing the rule’s structure and logic. |
foreignCallNameToID | FCNameToID[] | A mapping of foreign call names to their corresponding IDs. |
trackerNameToID | FCNameToID[] | A mapping of tracker names to their corresponding IDs. |
Returns
Promise<number>
A promise that resolves to the result of the rule update operation. Returns the result ID if successful, or -1 if the operation fails.