Skip to content

Conversation

@tenequm
Copy link
Contributor

@tenequm tenequm commented Dec 29, 2025

Description

Completes the @solana/kit v5 migration for @x402/svm, following the approach established in #663.

Background

PR #663 upgraded the legacy x402 package to @solana/kit v5. However, PR #705 (v2 architecture restructure) was developed in parallel and introduced the new @x402/svm package still pinned to kit v2. This creates a dependency conflict for projects using kit v5.

This PR brings @x402/svm to parity with the legacy package by upgrading to kit v5.1.0.

Dependency Changes

Package Before After
@solana/kit ^2.1.1 ^5.1.0
@solana-program/compute-budget ^0.8.0 ^0.11.0
@solana-program/token ^0.5.1 ^0.9.0
@solana-program/token-2022 ^0.4.2 ^0.6.1
@solana/transaction-confirmation ^2.1.1 Removed
zod ^3.24.2 Removed
@scure/base dependency devDependency

Why these changes

@solana/kit v5.1.0 includes an important bug fix in @solana/transaction-confirmation (PR #1003) where transaction errors during confirmation might not be thrown properly.

Removed dependencies:

  • @solana/transaction-confirmation - Not imported anywhere in the source; already re-exported from @solana/kit
  • zod - Not imported anywhere; comes as transitive dependency from @x402/core
  • @scure/base - Moved to devDependencies since it's only used in integration tests

Code changes:

  • Removed explicit as CompiledTransactionMessage type casts in utils.ts and facilitator schemes
  • In kit v5, getCompiledTransactionMessageDecoder().decode() returns the exact type expected by decompileTransactionMessage(), making the casts unnecessary

Files Modified

  • packages/mechanisms/svm/package.json - Dependency updates
  • packages/mechanisms/svm/src/utils.ts - Remove type cast
  • packages/mechanisms/svm/src/exact/facilitator/scheme.ts - Remove type cast
  • packages/mechanisms/svm/src/exact/v1/facilitator/scheme.ts - Remove type cast
  • pnpm-lock.yaml - Lockfile update

Tests

All 109 unit tests pass:

pnpm test

 ✓ test/unit/types.test.ts (5 tests)
 ✓ test/unit/signer.test.ts (9 tests)
 ✓ test/unit/client.test.ts (5 tests)
 ✓ test/unit/server.test.ts (14 tests)
 ✓ test/unit/v1/index.test.ts (4 tests)
 ✓ test/unit/index.test.ts (37 tests | 9 skipped)
 ✓ test/unit/v1/facilitator.test.ts (6 tests)
 ✓ test/unit/facilitator.test.ts (6 tests)
 ✓ test/unit/server.moneyParser.test.ts (28 tests)
 ✓ test/unit/v1/client.test.ts (4 tests)

 Test Files  10 passed (10)
      Tests  109 passed | 9 todo (118)

Build and type-check pass:

pnpm build  # Success
npx tsc --noEmit  # No errors

Checklist

  • I have formatted and linted my code
  • All new and existing tests pass
  • My commits are signed (required for merge)

- Upgrade @solana/kit from ^2.1.1 to ^5.1.0
- Upgrade @solana-program/compute-budget to ^0.11.0
- Upgrade @solana-program/token to ^0.9.0
- Upgrade @solana-program/token-2022 to ^0.6.1
- Remove @solana/transaction-confirmation (re-exported from @solana/kit)
- Remove zod (transitive via @x402/core)
- Move @scure/base to devDependencies (only used in tests)
- Remove unnecessary type casts for v5 compatibility
@cb-heimdall
Copy link

cb-heimdall commented Dec 29, 2025

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/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

@vercel
Copy link

vercel bot commented Dec 29, 2025

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

A member of the Team first needs to authorize it.

@phdargen phdargen self-assigned this Dec 30, 2025
Copy link
Contributor

@phdargen phdargen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch @tenequm and thanks for the update! Looks good and the e2e tests also ran without issue

@phdargen phdargen merged commit f6130a4 into coinbase:main Dec 30, 2025
12 of 13 checks passed
@tenequm tenequm deleted the chore/upgrade-x402-svm-to-solana-kit-v5 branch December 30, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants