Skip to Content

Data Plugin

Four nodes that cover the data-shaping work that would otherwise go into a Code node. No credentials or setup required — these are pure computation nodes.

Actions

ActionDescription
Encode / DecodeConvert text to padded hex (bytes8/16/32), raw hex or base64, and back
Extract FieldsPick named values out of upstream node output by dotted path
Flatten FindingsMerge several monitoring results into one labelled findings list
Static ConfigHold static JSON configuration on the canvas

Encode / Decode

Converts a string, or a JSON array of strings, between text and a hex or base64 representation. The common case is producing the bytes32 form of a short name for a contract call.

Inputs

InputRequiredDescription
operationYesencode (text to hex/base64) or decode (hex/base64 to text). Default encode
valueYesA single value, or a JSON array of values to convert in one step
formatYesbytes32, bytes16, bytes8, hex (no padding) or base64. Default bytes32
paddingNoright (Solidity string to bytesN, the default) or left (numeric, big-endian). Fixed-size formats only

Outputs

OutputDescription
resultThe converted value: a string for a single input, an array for an array input
mapObject keyed by each original value, holding its converted value
countNumber of values converted
operationencode or decode
formatThe format that was used
errorError message if the conversion failed

Notes

  • Encoding a value that does not fit the chosen size fails the step rather than truncating.
  • hex applies no padding, so SKY becomes 0x534b59.
  • Decoding strips the zero padding from the side named by padding, so a round trip through bytes32 returns the original string.

Example

-> Encode / Decode (Encode Networks): operation: encode value: ["SKY"] format: bytes32 -> Read Contract: args: {{@encode:Encode Networks.map.SKY}}

Extract Fields

Pulls named values out of an upstream node’s output by dotted path. A missing path returns null by default, so a partial fetch degrades instead of aborting the run.

Inputs

InputRequiredDescription
sourceYesA single upstream output, or a JSON object combining several
pathsYesOne path per line. name = path renames the output; a bare path keeps its last segment as the name
modeNoobject (single value, the default) or array (apply the paths to every item)
onMissingNonull (default), empty (empty string) or fail (fail the step)

Outputs

OutputDescription
fieldsObject of the extracted values, keyed by name (object mode)
itemsArray of extracted objects, one per source item (array mode)
missingNames whose path was not found
foundCountNumber of paths resolved
itemCountNumber of source items processed
errorError message if extraction failed

Notes

  • Numeric segments index into arrays, so rows.1.amount reads the second row.
  • To read from several upstream nodes at once, build a JSON object in source: {"chainlog": {{@a:Chainlog.data}}, "setup": {{@b:Setup.result}}}, then use paths like chainlog.vat.
  • Use this node rather than reaching into a nested path inside a template reference on an opaque node output, which cannot be validated before the run.

Example

-> HTTP Request (Chainlog) -> Extract Fields: source: {{@chainlog:Chainlog.data}} paths: vat = result.vat jug = result.jug spotter = result.spotter -> Read Contract: contractAddress: {{@fields:Extract Fields.fields.vat}}

Flatten Findings

Takes several monitoring results, flattens them into one findings list with per-source labels and severities, and reports whether anything was found.

Inputs

InputRequiredDescription
sourcesYesJSON array of sources. Each entry needs a label and a value; severity and itemsPath are optional per entry
defaultSeverityNoSeverity for sources without their own. Default warning
hashFieldNoDotted path inside each finding to read a transaction hash from. Default transactionHash
maxFindingsNoCap on the findings array. Default 100

A source value accepts:

Value shapeFindings produced
Object with events, transactions, logs, rows, items or resultsOne per element of the first array found
ArrayOne per element
trueOne finding, { triggered: true }
false, null, 0, empty stringNone
Any other objectOne finding holding the object

Set itemsPath on an entry to point at a nested array instead.

Outputs

OutputDescription
anyFoundTrue when at least one source produced a finding
countTotal number of findings, before any cap
findingsArray of { label, severity, hash, item }
labelsLabels of the sources that produced findings
firstHashThe first transaction hash found, or null
summaryHuman-readable per-label summary for an alert body
truncatedTrue when findings was capped by maxFindings
errorError message if the scan failed

Example

-> Query Events (File Changes) -> Query Events (Owner Calls) -> Flatten Findings: sources: [ {"label": "File changed", "value": {{@files:File Changes.result}}}, {"label": "Owner call", "value": {{@owner:Owner Calls.result}}, "severity": "critical"} ] -> Condition: {{@scan:Flatten Findings.anyFound}} == true -> Discord: "{{@scan:Flatten Findings.summary}}"

Static Config

Holds a static JSON value on the canvas — an address book, a constant set, a wallet registry — so it is visible and editable without a script wrapper.

Inputs

InputRequiredDescription
valueYesAny JSON value

Outputs

OutputDescription
resultThe configuration value
keysTop-level keys when the value is an object
countNumber of keys for an object, or entries for an array
valueTypeobject, array or primitive
errorError message if the JSON is invalid

Example

-> Static Config (Contracts): value: {"vat": "0x35D1...", "jug": "0x19c0..."} -> Read Contract: contractAddress: {{@contracts:Contracts.result.vat}}

Pair with a For Each node to iterate a registry:

-> Static Config (Wallets): value: [{"name": "Ops", "address": "0xA..."}, {"name": "Treasury", "address": "0xB..."}] -> For Each: arraySource: {{@wallets:Wallets.result}}