Skip to content

0.6.0 — Latch is now Detent

Latest

Choose a tag to compare

@Hitek-cel Hitek-cel released this 16 Nov 05:45
npm install detent402

The first release as Detent (detent402). detent402@0.5.0 was published
earlier the same day by mistake, from this code under the old version number;
use 0.6.0.

  • Renamed from Latch (latch402) to Detent (detent402 on npm). Another
    x402 project, the @latch402 readiness scanner for OKX.AI, used the name
    first; npm refuses a bare detent as too close to dedent. Install
    detent402; import from "detent402", "detent402/x402" and
    "detent402/conformance". Renamed exports: latchX402 → detentX402,
    X402Latch → X402Detent, X402LatchOptions → X402DetentOptions,
    LatchError → DetentError, isLatchError → isDetentError. Error
    codes latch_unavailable and latch_unsupported_payment are now
    detent_unavailable and detent_unsupported_payment, and the token the 402
    carries is in a detent extension instead of latch. Database tables keep
    their latch_ names, so existing journals and receipts work unchanged. The
    demo folder is now .detent-demo/, and the demo moves an old
    .latch-demo/ across. The GitHub repository is now Hitek-cel/detent; old
    links redirect. Earlier entries keep the old name.
  • A stuck payment's retry is now answered 503 payment_unresolved, not
    409
    (with detent.http()). Recovery spec 0.9 splits the two "don't pay
    again yet" answers: 409 operation_in_flight with Retry-After while the
    payment can still resolve, and 503 with no Retry-After once it is stuck
    (control 11). The body is unchanged and names the reason, so a client can
    tell it apart from a server-health 503. Payments still in flight keep 409.
  • A payment recovered from the chain now keeps its settlement transaction.
    When the facilitator's reply was lost (a crash, a timeout), Detent learned
    from authorizationState that the payment landed but not which transaction
    did it, so the report showed "—" and the receipt had no settlementRef.
    eip3009Oracle now has findTransaction, which finds the
    AuthorizationUsed event within the payment's own time window, in chunks
    small enough for public RPCs (logRangeBlocks, default 200; maxLogCalls,
    default 30). A custom SettlementOracle may add its own findTransaction.
    Best effort: if it fails or finds nothing, the payment is delivered exactly as
    before, without the link. Payments recovered earlier are not rewritten.
  • The x402 demo takes --facilitator payai to run against PayAI's public
    facilitator instead of x402.org (only those two are allowed).