module

Walk

Breadth-first walk of the fund graph, following OUT-transfers only: level 1 is every distinct address the root paid, level 2 everything those paid, and so on. Recipients are deduped against every address already visited, so a cycle (or a fan-out that merges back onto the root) terminates instead of looping.

The history fetch is injected so the walk works on every resolver: pass a closure over Transactions.list_explorer or Transactions.list.

Constants

ADDRESS_RE = /^[0-9a-fA-F]{40}$/
DefaultMaxAddresses = 500

Class methods

out_recipients(result : HistoryResult, address : String) : Array(Tuple(String, Transfer))

Distinct addresses that address sent funds to, paired with the first transfer that paid them. Skips self-transfers, reverted transactions, contract creation (to is not an address) and rows without a hash.

Source
run(root : String, max_depth : Int32, max_addresses : Int32 = DefaultMaxAddresses, progress : Proc(Int32, Int32, Nil) | Nil = nil, &fetch : String -> HistoryResult) : WalkResult

fetch is called once per address; progress (optional) is called after each fetch with the level and how many addresses that level has produced.

Source