Limits under which a grant can authorize outgoing payments.
Supports no amount, a typed debit_amount, or a typed receive_amount.
Debit and receive amounts are mutually exclusive, matching Node's grant-request
validation in addition to the permissive schema branches. Optional receiver
follows the schema's URI format and HTTP(S) incoming-payment URL pattern.
Optional interval is a string: its ISO 8601 description supplies no pattern
or format validator, so this codec preserves it without parsing recurrence.
Omitted fields become nil; explicit JSON nulls are rejected. Empty limits are
allowed. Additional JSON fields are retained in extensions. URI/interval
spelling and amount strings are preserved. No network requests, budget tracking
or interval calculations occur. Inspection omits amounts and extension metadata.
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 limits with at most one amount, keeping permitted JSON extensions.
Converts to protocol fields, omitting nil values, without validating.
Validates a struct, treating nil fields as omitted.
Types
@type t() :: %OpenPayments.Types.OutgoingLimits{ debit_amount: OpenPayments.Types.Amount.t() | nil, extensions: %{optional(String.t()) => term()}, interval: String.t() | nil, receive_amount: OpenPayments.Types.Amount.t() | nil, receiver: String.t() | nil }
Functions
@spec from_map(map()) :: {:ok, t()} | {:error, OpenPayments.Error.t()}
Decodes limits with at most one amount, keeping permitted JSON extensions.
Converts to protocol fields, omitting nil values, without validating.
@spec validate(t()) :: :ok | {:error, OpenPayments.Error.t()}
Validates a struct, treating nil fields as omitted.