x402 icon indicating copy to clipboard operation
x402 copied to clipboard

feat: shared middleware function to build payment requirements

Open 0xf333 opened this issue 5 months ago • 5 comments

Description

let’s have a single builder to construct PaymentRequirements, as mentioned in commit 26f132bf. besides, this will simplify maintenance and prevent implementation drifts

Tests

cd typescript && \
pnpm build && \
pnpm lint:check && \
pnpm --filter x402 exec vitest run src/shared/middleware.test.ts --reporter=verbose

Checklist

  • [x] formatted and linted code
  • [x] all new and existing tests pass
  • [x] signed commits

0xf333 avatar Nov 04 '25 12:11 0xf333

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

cb-heimdall avatar Nov 04 '25 12:11 cb-heimdall

@0xf333 is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Nov 04 '25 12:11 vercel[bot]