Skip to main content
getMappedTrackerValue(config, rulesEngineComponentContract, policyId, index, trackerKey, blockParams?): Promise<number[]>
Defined in: src/modules/trackers.ts:560 Retrieves the values of a mapped tracker.

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 containing the address and ABI for interaction.
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.
indexnumberThe index of the tracker for which the values should be retrieved.
trackerKey?stringThe key for the value to be retrieved.
blockParams?ContractBlockParameters-

Returns

Promise<number[]> A promise that resolves to an array of rule IDs if successful, or an empty array if an error occurs.

Throws

Will log an error to the console if the contract interaction fails.