deleteRule(config, rulesEngineRulesContract, policyId, ruleId, confirmationCount): Promise<number>
Defined in: src/modules/rules.ts:395 Deletes a rule from the rules engine component contract.

Parameters

ParameterTypeDescription
configConfig-
rulesEngineRulesContract{ abi: ({ anonymous: undefined; inputs: ({ components: undefined; internalType: string; name: string; type: string; } | { components: ({ components: undefined; internalType: string; name: string; type: string; } | { components: …[]; internalType: string; name: string; type: string; })[]; internalType: string; name: string; type: string; })[]; name: string; outputs: object[]; stateMutability: string; type: string; } | { anonymous: undefined; inputs: object[]; name: string; outputs: object[]; stateMutability: string; type: string; } | { anonymous: boolean; inputs: object[]; name: string; outputs: undefined; stateMutability: undefined; type: string; })[]; address: `0x${string}`; }The contract instance containing the rules engine component.
rulesEngineRulesContract.abi({ anonymous: undefined; inputs: ({ components: undefined; internalType: string; name: string; type: string; } | { components: ({ components: undefined; internalType: string; name: string; type: string; } | { components: …[]; internalType: string; name: string; type: string; })[]; internalType: string; name: string; type: string; })[]; name: string; outputs: object[]; stateMutability: string; type: string; } | { anonymous: undefined; inputs: object[]; name: string; outputs: object[]; stateMutability: string; type: string; } | { anonymous: boolean; inputs: object[]; name: string; outputs: undefined; stateMutability: undefined; type: string; })[]-
rulesEngineRulesContract.address`0x${string}`-
policyIdnumberThe ID of the policy to which the rule belongs.
ruleIdnumberThe ID of the rule to be deleted.
confirmationCountnumber-

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.