Repository navigation
0.3.0 — works with the official x402 SDK
Latch now works with the official x402 SDK instead of beside it.
Added
latch402/x402— a bridge for the official SDK.latchX402(server, …)
registers lifecycle hooks on anx402ResourceServerand journals every
payment on theexactscheme's default flow. Route handlers do not change.- One atomic claim per payment, keyed by (payer, nonce) as the chain keys it.
Concurrent copies of a payment run the handler once. - The response is stored before the settle is requested, so a payment that
lands always has something to deliver. - A failed or timed-out settle is checked against an oracle before anything
is concluded. Money that moved is delivered; a payment that can still land
waits; one that cannot is voided. - A retry of a settled payment gets the stored response back, authorised by a
per-402 replay token carried in alatchextension. A new signature under
the samepayment-identifieris answered from the store and never settled. sweep()andrecover()finish or close payments whose process died.
Recovery never initiates a charge.
- One atomic claim per payment, keyed by (payer, nonce) as the chain keys it.
eip3009Oracle— asks the token contractauthorizationState(payer, nonce)over JSON-RPC. No key, no dependency.postgresAuthorizedPaymentStorage— the SDK'sauth-capture
AuthorizedPaymentStorageinterface on Postgres, so the record of escrow
holds survives a restart.- A JavaScript build with type declarations. The package now runs on Node 20+
without a TypeScript loader.
Changed
Latch.sweep()skips invoices opened by the x402 bridge, so the two can
share one journal.- The package exports compiled files from
dist/. Import paths are unchanged.
Notes
- The strict gate (
quote/redeem) is unchanged and still does not speak
the x402 wire format. Use the bridge for x402. - Nothing in this release has been run against a live facilitator. See
"Status" and "Limits" in the README.