query

query.traceNeighbors

traceNeighbors(nodeId: string, depth?: number): string

Add a topology filter that retains only nodes whose out-degree is at least depth.

Currently implemented as a minimum out-degree filter: nodes with fewer than depth outgoing edges are hidden. Recorded in history as "AddFilter"; undoable.

nodeIdstringCurrently unused by the filter body; retained to preserve the signature that the planned neighbourhood-hop query will use.
depthnumberMinimum out-degree required for a node to remain visible; defaults to 2.

Returns: string

Example

const filterId = api.query.traceNeighbors("s1", 3); // keeps nodes with outDegree ≥ 3
api.filter.list().find(h => h.id === filterId)?.remove();