Function: compareQuote()
ts
function compareQuote(
echoed,
policy,
rules,
depth?
):
| {
depth: number;
ok: true;
}
| {
depth: number;
ok: false;
reason: string;
};Defined in: packages/x402-express/src/policy.ts:53
Walk a rule table, comparing an echoed requirement against one quote.
depth counts the comparisons that passed before the one that failed. It is how the middleware decides which of several advertised quotes a payment was aimed at when it matches none of them: the quote it got furthest through is the one whose refusal is worth reporting.
Parameters
echoed
Record<string, unknown>
policy
Record<string, unknown>
rules
depth?
number = 0
Returns
| { depth: number; ok: true; } | { depth: number; ok: false; reason: string; }