createTracker(config, rulesEngineComponentContract, policyId, trSyntax): Promise<number>

Asynchronously creates a tracker in the rules engine component contract.

Parameters

ParameterTypeDescription
configConfig-
rulesEngineComponentContractobjectThe contract instance for interacting with the rules engine component.
rulesEngineComponentContract.abi(object | object | object)[]-
rulesEngineComponentContract.address`0x${string}`-
policyIdnumberThe ID of the policy associated with the tracker.
trSyntaxstringA JSON string representing the tracker syntax.

Returns

Promise<number>

A promise that resolves to the new tracker ID

Throws

Will retry indefinitely with a 1-second delay between attempts if an error occurs during the contract simulation. Ensure proper error handling or timeout mechanisms are implemented to avoid infinite loops.

Defined in

src/modules/trackers.ts:39