updateRule
updateRule(
config
,rulesEnginePolicyContract
,policyId
,ruleId
,ruleS
,foreignCallNameToID
,trackerNameToID
):Promise
<number
>
Updates an existing rule in the Rules Engine Policy Contract.
Parameters
Parameter | Type | Description |
---|---|---|
config | Config | - |
rulesEnginePolicyContract | object | The contract instance for interacting with the Rules Engine Policy. |
rulesEnginePolicyContract.abi | (object | object | object )[] | - |
rulesEnginePolicyContract.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.
Throws
Will retry indefinitely if the contract simulation fails, with a 1-second delay between retries.