ILP connection details returned in an incoming payment's methods array.
from_map/1 validates the pinned ilp-payment-method schema: type ilp, an
ILP address of at most 1023 characters, a nonempty unpadded base64url-alphabet
shared secret, and no additional fields. It does not decode the secret, impose
a secret byte length, or establish a STREAM connection.
Inspection omits shared_secret. Explicit to_map/1 and JSON encoding include
the secret because it is part of the protocol payload; treat those exports as
sensitive. Errors identify fields without retaining rejected values.
Struct literals can bypass validation. Call validate/1 after constructing or
modifying a struct; to_map/1 converts its shape without validating it.
Summary
Functions
Decodes and validates an ILP payment-method JSON object.
Converts to protocol fields, including the shared secret, without validating.
Validates a payment-method struct against the shared ILP schema.
Types
Functions
@spec from_map(map()) :: {:ok, t()} | {:error, OpenPayments.Error.t()}
Decodes and validates an ILP payment-method JSON object.
Converts to protocol fields, including the shared secret, without validating.
@spec validate(t()) :: :ok | {:error, OpenPayments.Error.t()}
Validates a payment-method struct against the shared ILP schema.