updateTracker(config, rulesEngineComponentContract, policyId, trackerId, trSyntax, confirmationCount): Promise<number>
Defined in: src/modules/trackers.ts:180 Asynchronously updates a tracker in the rules engine component contract.

Parameters

ParameterTypeDescription
configConfigThe configuration object containing network and wallet information.
rulesEngineComponentContract{ abi: ({ anonymous: undefined; inputs: ({ components: undefined; internalType: string; name: string; type: string; } | { components: object[]; 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 for interacting with the rules engine component.
rulesEngineComponentContract.abi({ anonymous: undefined; inputs: ({ components: undefined; internalType: string; name: string; type: string; } | { components: object[]; 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; })[]-
rulesEngineComponentContract.address`0x${string}`-
policyIdnumberThe ID of the policy associated with the tracker.
trackerIdnumberThe ID of the tracker to update.
trSyntaxstringA JSON string representing the tracker syntax.
confirmationCountnumber-

Returns

Promise<number> A promise that resolves to the existing tracker ID is returned. Returns -1 if the operation fails.

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.