deleteRule(config, rulesEngineComponentContract, policyId, ruleId): Promise<number>

Deletes a rule from the rules engine component contract.

Parameters

ParameterTypeDescription
configConfig-
rulesEngineComponentContractobjectThe contract instance containing the rules engine component.
rulesEngineComponentContract.abi(object | object | object)[]-
rulesEngineComponentContract.address`0x${string}`-
policyIdnumberThe ID of the policy to which the rule belongs.
ruleIdnumberThe ID of the rule to be deleted.

Returns

Promise<number>

A promise that resolves to a number:

  • 0 if the rule was successfully deleted.
  • -1 if an error occurred during the deletion process.

Throws

This function does not throw errors directly but returns -1 in case of an exception.

Defined in

src/modules/rules.ts:156