updateRule(config, rulesEnginePolicyContract, policyId, ruleId, ruleS, foreignCallNameToID, trackerNameToID): Promise<number>

Updates an existing rule in the Rules Engine Policy Contract.

Parameters

ParameterTypeDescription
configConfig-
rulesEnginePolicyContractobjectThe contract instance for interacting with the Rules Engine Policy.
rulesEnginePolicyContract.abi(object | object | object)[]-
rulesEnginePolicyContract.address`0x${string}`-
policyIdnumberThe ID of the policy to which the rule belongs.
ruleIdnumberThe ID of the rule to be updated.
ruleSstringA JSON string representing the rule’s structure and logic.
foreignCallNameToIDFCNameToID[]A mapping of foreign call names to their corresponding IDs.
trackerNameToIDFCNameToID[]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.

Defined in

src/modules/rules.ts:110