convertRuleStructToString(functionString, encodedValues, ruleS, plhArray, foreignCalls, trackers, mappings): ruleJSON

Converts a RuleStruct object into a JSON-like string representation.

Parameters

ParameterTypeDescription
functionStringstringThe calling function signature as a string.
encodedValuesstringA string containing encoded values for the rule.
ruleSRuleStructThe RuleStruct object containing rule details such as placeholders, positive effects, and negative effects.
plhArraystring[]An array to store the names of placeholders extracted from the rule.
foreignCallsForeignCallOnChain[]-
trackersTrackerOnChain[]-
mappingshexToFunctionString[]-

Returns

ruleJSON

An object of type ruleJSON containing the condition, positive effects, negative effects, calling function, and encoded values.

The function processes the RuleStruct object to:

  • Extract placeholder names and append them to plhArray.
  • Parse and format positive and negative effects into strings.
  • Reverse parse the rule’s instruction set to generate a condition string.
  • Populate the ruleJSON object with the processed data.

Defined in

src/parsing/reverse-parsing-logic.ts:345