Import
Signature
Select the first acceptable payment requirement matching the payer’s network. Searches the accepts array of a PaymentRequired challenge for an offer using the “exact” payment scheme matching the specified network (resolved via resolveNetwork).

Parameters

Pick<PaymentRequired, 'accepts'>
required
Parsed PaymentRequired object (anything with an accepts array).
string
required
Desired network name, alias, or CAIP-2 identifier.

Returns

PaymentRequirements
The matching PaymentRequirements entry.

Throws

  • NoSupportedRequirementError: If accepts is empty.
  • NetworkMismatchError: If no requirement matches the requested network.

Example

Source: src/index.ts