Repository navigation
npm install detent402The 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 (detent402on npm). Another
x402 project, the @latch402 readiness scanner for OKX.AI, used the name
first; npm refuses a baredetentas too close todedent. Install
detent402; import from"detent402","detent402/x402"and
"detent402/conformance". Renamed exports:latchX402→detentX402,
X402Latch→X402Detent,X402LatchOptions→X402DetentOptions,
LatchError→DetentError,isLatchError→isDetentError. Error
codeslatch_unavailableandlatch_unsupported_paymentare now
detent_unavailableanddetent_unsupported_payment, and the token the 402
carries is in adetentextension instead oflatch. Database tables keep
theirlatch_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
stuckpayment's retry is now answered503 payment_unresolved, not
409 (withdetent.http()). Recovery spec 0.9 splits the two "don't pay
again yet" answers:409 operation_in_flightwithRetry-Afterwhile the
payment can still resolve, and503with noRetry-Afteronce 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
fromauthorizationStatethat the payment landed but not which transaction
did it, so the report showed "—" and the receipt had nosettlementRef.
eip3009Oraclenow hasfindTransaction, which finds the
AuthorizationUsedevent within the payment's own time window, in chunks
small enough for public RPCs (logRangeBlocks, default 200;maxLogCalls,
default 30). A customSettlementOraclemay add its ownfindTransaction.
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 payaito run against PayAI's public
facilitator instead of x402.org (only those two are allowed).