convertRuleStructToString(functionString, encodedValues, ruleS, ruleM, foreignCalls, trackers, mappings, ruleId?): RuleDataAndJSON
Defined in: src/parsing/reverse-parsing-logic.ts:511 Convert on-chain RuleStruct + metadata into a { data, json } pair. Builds a human-readable RuleJSON and a RuleData that includes the id, by reverse-parsing the condition and effects and resolving placeholders.

Parameters

ParameterTypeDescription
functionStringstringCalling function signature for the rule JSON.
encodedValuesstringEncoded calling-function args used to derive names.
ruleSRuleStructOn-chain RuleStruct (instructionSet, placeholders, effects).
ruleMRuleMetadataStructRule metadata (name, description).
foreignCallsForeignCallOnChain[]Foreign calls referenced by placeholders.
trackersTrackerOnChain[]Trackers referenced by placeholders.
mappingshexToFunctionString[]Hex-to-function mappings to resolve signatures.
ruleId?numberOptional id to include in the returned RuleData.

Returns

RuleDataAndJSON RuleDataAndJSON: { data: RuleData, json: RuleJSON }. 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.