Skip to content

style(evm): tidy auth-capture imports - #34

Closed
PhilBot402 wants to merge 6 commits into
mainfrom
philbotts-sdk-cleanup-4793
Closed

PhilBot402 wants to merge 6 commits into
mainfrom
philbotts-sdk-cleanup-4793

Conversation

@PhilBot402

Copy link
Copy Markdown
Owner

Description

Cleanup-only pass on the TypeScript auth-capture code added in recent upstream merges. The escrow argument helpers in extra.ts used an inline import() type query for paymentInfoToContractTuple. That import is now a normal module import, and a local type alias names the tuple. Adjacent imports of the same module in the auth-capture facilitator and server are combined.

No runtime behavior changes. No changelog fragment: nothing user-facing changed.

Tests

From typescript/packages/mechanisms/evm:

  • prettier on the edited files
  • eslint . --ext .ts
  • tsup declaration build (package typecheck)
  • vitest run --coverage — 54 files, 1577 tests passed

Checklist

  • I have formatted and linted my code
  • All new and existing tests pass
  • My commits are signed (required for merge) -- you may need to rebase if you initially pushed unsigned commits
  • I added a changelog fragment for user-facing changes (docs-only changes can skip)

AI disclosure: automated by @phdargen. Use your own judgement

Open in Web Open in Cursor 

CarsonRoscoe and others added 6 commits October 5, 2026 17:45
…dation#3622)

* feat: add shared + facilitator auth-capture work in go

* feat: add server auth-capture work in go

* feat: remove code duplication in client

* feat: add auth-capture facilitator example

* feat: add auth-capture server example

* feat: add auth-capture client example

* feat: cleanup pass

* fix: auth-capture e2e tests

* fix: integration tests

* chore(e2e): restore unrelated uv.lock files

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(go): restore Permit2 allowance after auth-capture integration tests

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(go): make auth-capture refundDeadline relative to issue time

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: pr review feedback

* fix: pr feedback

* fix: pr review feedback

* feat: addressed PR feedback

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(evm): add auth-capture server and facilitator to TypeScript SDK

Completes the auth-capture EVM scheme in @x402/evm: the client scheme
landed in x402-foundation#2486, this adds the resource-server and facilitator halves
behind the ./auth-capture/server and ./auth-capture/facilitator entry
points.

The server scheme resolves merchant prices against the per-family
default-asset table, converts relative *DeadlineSeconds offsets into the
absolute captureDeadline / refundDeadline the wire format commits to, and
fails fast on merchant-set extra fields so misconfiguration surfaces in
the merchant's own logs rather than as a 402 to a payer. It declares the
authorization payment flow for both the eip3009 and permit2 collectors,
since each settles as a single escrow call after the resource runs.

The facilitator verifies envelope shape, deadline ordering, per-collector
fields, and the payer-agnostic PaymentInfo hash the signature is bound
to, then simulates authorize/charge so typed escrow reverts surface as
stable invalidReason strings. Signature checks route through
verifyTypedDataSignature so pre-verify matches on-chain SignatureChecker
semantics instead of viem's ECDSA fallback. Simulating an operator-gated
escrow call needs an explicit caller, so FacilitatorEvmSigner.readContract
gains an optional account.

Co-authored-by: phdargen <p.dargent@cern.ch>

* align sdk with v1.1 spec

* add examples

* add rpc retries

* outcome based sim for custom

* add builder code support

* decouple facilitator from scheme

* rebase

* test operator contracts

* custom hardening

* fix fmt

* pr comments 1-3

* pr comments 4-6

* every charge requires a receiverAuthorizer

* align with settlement pending + retry

* add go client + e2e tests

* support commerce v1.1

* review hardening

* improve test coverage

* fix fmt

* mark deadlines as dynamicExtraFields

* add delegated auth

* go:  add delegated auth

* align ts/go + expand e2e

* update custom operator contracts and fix integration tests

* fix go signer

* go: rotate operator

* ts: rotate operator

---------

Co-authored-by: A1igator <20358261+A1igator@users.noreply.github.com>
* Update docs/sdk-features.md

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/schemes/overview.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/schemes/overview.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/schemes/overview.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/schemes/overview.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
…402-foundation#3666)

* feat(builder-code): add facilitator-authored settlement metadata (m)

* pr feedback
…402-foundation#3711)

* Update docs/extensions/builder-code.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/extensions/builder-code.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/extensions/builder-code.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/extensions/builder-code.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/extensions/builder-code.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

* Update docs/extensions/builder-code.mdx

Generated-By: mintlify-agent

Mintlify-Source: dashboard-editor

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
Replace the inline type import in auth-capture extra and merge duplicate
module imports. No runtime behavior change.

Co-authored-by: phdargen <29732335+phdargen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants