updateRule(config, rulesEnginePolicyContract, rulesEngineRulesContract, rulesEngineComponentContract, rulesEngineForeignCallContract, policyId, ruleId, ruleS, foreignCallNameToID, trackerNameToID): Promise<number>
Updates an existing rule in the Rules Engine Policy Contract.

Parameters

ParameterTypeDescription
configConfig-
rulesEnginePolicyContractobject-
rulesEnginePolicyContract.abi(object | object)[]-
rulesEnginePolicyContract.address`0x${string}`-
rulesEngineRulesContractobjectThe contract instance for interacting with the Rules Engine Policy.
rulesEngineRulesContract.abi(object | object | object)[]-
rulesEngineRulesContract.address`0x${string}`-
rulesEngineComponentContractobject-
rulesEngineComponentContract.abi(object | object | object)[]-
rulesEngineComponentContract.address`0x${string}`-
rulesEngineForeignCallContractobject-
rulesEngineForeignCallContract.abi(object | object | object)[]-
rulesEngineForeignCallContract.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:289