Skip to main content

Module output

Module output 

Source
Expand description

Human and --json output.

In human mode, progress and results go to stdout and warnings and errors to stderr. With --json, stdout carries exactly one JSON document (the result, or { "ok": false, "error": … }), so scripts can parse it; warnings and logs still go to stderr.

Structs§

Output
Where output goes.

Functions§

event_line
One timeline line: [zcash ] zcash_locked Taker funded the Zcash HTLC <txid>.
print_document
Prints a JSON document on stdout as is (for results that are not ok).
print_record
One line of newline-delimited JSON on stdout (the maker’s --json records).
short
The first 10 characters of a swap id.
status_str
The wire name of a status (zcash_locked, …).
warn
Prints a warning to stderr (in both modes).

Type Aliases§

Progress
A callback that receives swaps as they progress.