Session credential payload schema, discriminated on action.
Wire JSON uses camelCase action names ("open" / "topUp" / "voucher" /
"close"). Elixir atoms are snake_case (:open / :top_up / :voucher /
:close). Field names match the TIP-1034 precompile payloads in mppx
Protocol.ts and mpp-rs SessionCredentialPayload.
Summary
Functions
Parse a session credential payload map into a typed struct.
Serialize a session payload to the camelCase wire map.
Types
@type action() :: MPP.Session.Channel.action()
@type t() :: %MPP.Session.Payload{ action: action(), additional_deposit: non_neg_integer() | nil, authorized_signer: String.t() | nil, channel_id: String.t(), cumulative_amount: non_neg_integer() | nil, descriptor: descriptor() | nil, settlement_route: settlement_route() | nil, signature: String.t() | nil, transaction: String.t() | nil, type: String.t() | nil }
Functions
@spec parse(term()) :: {:ok, t()} | {:error, parse_error()}
Parse a session credential payload map into a typed struct.
Serialize a session payload to the camelCase wire map.