Skip to content

Fix PR #28: Rebase TypeScript receipt types and keep optional template-suite handling#29

Closed
GsCommand wants to merge 1 commit intomainfrom
codex/fix-and-rebase-pr-#28-on-latest-sdk
Closed

Fix PR #28: Rebase TypeScript receipt types and keep optional template-suite handling#29
GsCommand wants to merge 1 commit intomainfrom
codex/fix-and-rebase-pr-#28-on-latest-sdk

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • Restore and align TypeScript receipt surface to the latest SDK changes so verification and request-envelope types match the commons contract.
  • Preserve the template test-suite fix that made the SDK test suite optional when no tests exist, without reverting high-level API work.

Description

  • Added ReceiptProtocolMetadata and wired it into CommonsRequestEnvelope and CommercialRequestEnvelope so x402/receipt metadata is explicitly typed.
  • Converted CanonicalReceipt to CanonicalReceipt<TResult, TError> and propagated the generic result/error typing to CommandResponse and LegacyBlendedReceipt for consistent typings.
  • Fixed verification internals: compute hashMatches explicitly, compute receipt_id_present correctly, use signerId internally and map it to values.signer_id in the VerifyResult output.
  • Restored extractReceiptVerb to use shared getReceiptVerb logic and enhanced getReceiptVerb to fall back on common result-shape heuristics (e.g., summary/analysis).
  • Kept and improved typescript-sdk/scripts/template-tests.mjs to skip optional suites when no matching files exist while still running required suites.

Testing

  • Ran npm run typecheck in typescript-sdk and it completed successfully.
  • Ran npm run build in typescript-sdk and the build completed successfully.
  • Ran npm run test:unit in typescript-sdk and all unit and template tests passed (44 passed, 0 failed).

Codex Task

@GsCommand GsCommand closed this Apr 24, 2026
@GsCommand GsCommand deleted the codex/fix-and-rebase-pr-#28-on-latest-sdk branch April 24, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant