Skip to content

fix: parse Solana payment errors from blockrun-sol (v0.12.27)#90

Merged
1bcMax merged 2 commits intomainfrom
fix/solana-payment-error-parsing
Mar 9, 2026
Merged

fix: parse Solana payment errors from blockrun-sol (v0.12.27)#90
1bcMax merged 2 commits intomainfrom
fix/solana-payment-error-parsing

Conversation

@1bcMax
Copy link
Member

@1bcMax 1bcMax commented Mar 9, 2026

Summary

  • transformPaymentError() now handles blockrun-sol's Solana error format (code=PAYMENT_INVALID + debug field) — previously fell through and showed raw server response
  • Maps insufficient, transaction_simulation_failed, invalid_signature, expired to user-friendly messages
  • Unknown Solana errors now logged to console with actual debug reason
  • Bump to v0.12.27

Test plan

  • Solana user with empty wallet sees "Insufficient Solana USDC balance" instead of raw JSON
  • Simulation failures show retry message
  • Base/EVM error path unchanged

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Updated package version to 0.12.27.
  • New Features

    • Added "skills" module to distribution package.
    • Enhanced Solana payment error handling with clearer, user-friendly error messages and wallet information display.

transformPaymentError() now handles blockrun-sol's error format
(code=PAYMENT_INVALID + debug field) in addition to the existing
Base/EVM format (details field). Solana users now see actionable
messages for insufficient_funds, simulation failures, and signature
errors instead of the raw server response.
@coderabbitai
Copy link

coderabbitai bot commented Mar 9, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a7fc1318-63f5-49d2-bc5b-2b199036b9cd

📥 Commits

Reviewing files that changed from the base of the PR and between a15f258 and 9301fa2.

⛔ Files ignored due to path filters (2)
  • dist-e2e/e2e.js.map is excluded by !**/*.map
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • dist-e2e/e2e.js
  • package.json
  • src/proxy.ts

📝 Walkthrough

Walkthrough

Updates package version to 0.12.27 and adds 'skills' directory to published files list. Enhances error handling in proxy.ts to support BlockRun Solana-specific payment verification errors, extracting wallet information and normalizing debug phrases into structured user-facing error messages.

Changes

Cohort / File(s) Summary
Package Configuration
package.json
Version bumped from 0.12.26 to 0.12.27 and 'skills' directory added to the files array for publication.
Error Handling
src/proxy.ts
Adds new Solana/BlockRun payment error format parsing in transformPaymentError. Extracts wallet information from payer, normalizes debug strings (insufficient balance, simulation failures, invalid signature, expired), and returns structured error payloads with specific error types and user guidance.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/solana-payment-error-parsing

Comment @coderabbitai help to get the list of available commands and usage tips.

@1bcMax 1bcMax merged commit 2c1d55e into main Mar 9, 2026
2 of 3 checks passed
@1bcMax 1bcMax deleted the fix/solana-payment-error-parsing branch March 9, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant