Reports (SRR API). Reports are generated synchronously on each call and returned as JSON; there is no separate generate-then-fetch step and no PDF. The report field is a Markdown narrative written per request (wording varies between calls, and the call takes a few seconds). The graph endpoint can also return a PNG image.

Reports describe an address's risk exposure and counterparties: store them with your case files, not in logs.

Functions

graph

fn (chain: Str, address: Str, options: Map): Any
fn (chain: Str, address: Str, options: Map, opts: Map): Any

The fund-flow graph for an address. With output_format: "png" returns {content-type: "image/png", bytes} (Bytes, ready for ::hot::file/write-file-bytes); otherwise the JSON body with the Mermaid (or HTML) graph.

Example

png ::cipherowl::reports/graph("evm", "0x93df2c9c8786242b8fdca3f96b3914b8b4a9f704", {output_format: "png"})

graph-params

fn (options: Map): Map

Query fields for the graph report: config, output_format (mermaid default, html, png), interactive (default true), style (detailed default, compact; compact needs mermaid). Unset options are dropped. Exposed for testing.

Example

::cipherowl::reports/graph-params({output_format: "png"}).output_format  // "png"

graph-result

fn (response: Any): Any

Shape a graph response: an image (content-type starting image/) becomes {content-type, bytes} with the raw body-bytes; anything else is the JSON body {graph, legend, summary, error, timestamp}. Exposed for testing.

Example

response {status: 200, headers: {"content-type": "application/json"}, body: {graph: "graph TD"}}
::cipherowl::reports/graph-result(response)  // {graph: "graph TD"}

report

fn (kind: Str, chain: Str, address: Str, params: Map, opts: Map): Map

GET one narrative report for chain (translated to its class), with the resolved config added.

Example

// The same call risk-assessment and sar-report make, for another narrative kind
out ::cipherowl::reports/report("risk-assessment", "evm", "0x93df2c9c8786242b8fdca3f96b3914b8b4a9f704", {config: "co-sandbox"}, {})
out.resolved-config

report-error

fn (body: Any): Str?

The generation failure CipherOwl reports in a report or graph body (error), or null. Reports fail in the body, not the HTTP status, so check this before using report or graph. Pure.

Example

::cipherowl::reports/report-error({error: "generation failed"})  // "generation failed"
::cipherowl::reports/report-error({report: "# Summary"})  // null

report-path

fn (kind: Str, chain: Str, address: Str, params: Map): Str

/api/report/v1/{kind}/chains/{chain}/addresses/{address} plus the query, with chain and address validated. Exposed for testing.

Example

::cipherowl::reports/report-path("sar", "evm", "0x0000000000000000000000000000000000000001", {config: "co-sandbox"})
// "/api/report/v1/sar/chains/evm/addresses/0x0000000000000000000000000000000000000001?config=co-sandbox"

risk-assessment

fn (chain: Str, address: Str): Map
fn (chain: Str, address: Str, options: Map): Map
fn (chain: Str, address: Str, options: Map, opts: Map): Map

A risk-assessment report: {risk_level, found_risk, report (Markdown), error, timestamp, resolved-config, requested-chain}. risk_level is deprecated; rely on found_risk. A generation failure comes back in error with HTTP 200: check report-error. chain may be a class (evm) or a specific chain (base), which is translated to its class with ::cipherowl::risk/chain-class.

Example

out ::cipherowl::reports/risk-assessment("evm", "0x93df2c9c8786242b8fdca3f96b3914b8b4a9f704", {config: "co-sandbox"})
out.report

sar-report

fn (chain: Str, address: Str, options: Map): Map
fn (chain: Str, address: Str, options: Map, opts: Map): Map

A DRAFT suspicious-activity report (SAR) narrative, same shape as risk-assessment. It is evidence for an officer to read and adapt; nothing is filed.

Example

out ::cipherowl::reports/sar-report("evm", "0x93df2c9c8786242b8fdca3f96b3914b8b4a9f704", {config: "co-sandbox"})
problem ::cipherowl::reports/report-error(out)
if(is-null(problem), out.report, problem)

with-resolved-config

fn (response: Any): Map

A report body plus resolved-config, the configuration CipherOwl applied (from the cipherowl-resolved-config response header). Exposed for testing.

Example

response {status: 200, headers: {"cipherowl-resolved-config": "co-vasp"}, body: {found_risk: false}}
::cipherowl::reports/with-resolved-config(response)  // {found_risk: false, resolved-config: "co-vasp"}