Skip to content

Type Alias: FieldRule ​

ts
type FieldRule = 
  | {
  compare: "equal";
  reason: string;
}
  | {
  compare: "atLeast";
  invalidReason: string;
  reason: string;
}
  | {
  compare: "nested";
  rules: RuleTable;
}
  | {
  compare: "skip";
  why: string;
};

Defined in: packages/x402-express/src/policy.ts:19

How one field of an echoed requirement is held against the merchant's.

Union Members ​

Type Literal ​

ts
{
  compare: "equal";
  reason: string;
}

Must be exactly what the merchant quoted.


Type Literal ​

ts
{
  compare: "atLeast";
  invalidReason: string;
  reason: string;
}

An integer-string amount that must be at least the merchant's.


Type Literal ​

ts
{
  compare: "nested";
  rules: RuleTable;
}

Walk a nested table.


Type Literal ​

ts
{
  compare: "skip";
  why: string;
}

Not compared, with the reason recorded here rather than left to inference.