Layr8.Delegated (layr8 v0.3.1)

Copy Markdown View Source

What a join reply says about the parent's wallet.

The node sends an object rather than a bare list precisely so that :unread has a value of its own. When it was a list, an unreadable wallet arrived as [] — the same value that means "read, and it grants nothing" — and that is the reassuring one of the two: a client acting on it sends its messages bare and gets back a denial naming a grant.

Summary

Functions

A join reply's delegated_credentials, or nil if it is not a reading.

Functions

parse(raw)

@spec parse(term()) :: Layr8.Delegated.Reading.t() | nil

A join reply's delegated_credentials, or nil if it is not a reading.

Anything that is not a well-formed reading — absent, a list (an older node, before status existed), a status this build does not know — is nil, which means "no reading". It is never coerced into %Reading{status: :complete, credentials: []}: that would state that a wallet was read and grants nothing, which is the one thing none of those inputs says.