Skip to content

feat: implement contract error parsing and UI display (#082)#179

Open
Anuoluwapo25 wants to merge 2 commits intoGildado:mainfrom
Anuoluwapo25:feat/contract-error-parsing-ui
Open

feat: implement contract error parsing and UI display (#082)#179
Anuoluwapo25 wants to merge 2 commits intoGildado:mainfrom
Anuoluwapo25:feat/contract-error-parsing-ui

Conversation

@Anuoluwapo25
Copy link

@Anuoluwapo25 Anuoluwapo25 commented Feb 26, 2026

##Description

  • Add parseContractError() utility that decodes Soroban invocation failures from XDR/error strings into structured ContractErrorResult with 20+ mapped codes, numeric ContractError(N) extraction, and heuristic token matching; unknown codes fall back to raw XDR display
  • Add CollapsibleContractErrorPanel component with error code badge, human-readable description, suggested action callout, and copy button for unknown XDR fallback
  • Add VestingEscrow page (/vesting) demonstrating contract error integration
  • Integrate ContractErrorPanel into PayrollScheduler and CrossAssetPayment, replacing generic toast-only errors with structured in-page diagnostics
  • Add 35 vitest integration tests covering all mapped codes, numeric codes, heuristic matching, unknown fallback, and resultXdr preservation

closes #155

Anuoluwapo25 and others added 2 commits February 26, 2026 10:23
- Add parseContractError() utility that decodes Soroban invocation
  failures from XDR/error strings into structured ContractErrorResult
  with 20+ mapped codes, numeric ContractError(N) extraction, and
  heuristic token matching; unknown codes fall back to raw XDR display
- Add CollapsibleContractErrorPanel component with error code badge,
  human-readable description, suggested action callout, and copy button
  for unknown XDR fallback
- Add VestingEscrow page (/vesting) demonstrating contract error integration
- Integrate ContractErrorPanel into PayrollScheduler and CrossAssetPayment,
  replacing generic toast-only errors with structured in-page diagnostics
- Add 35 vitest integration tests covering all mapped codes, numeric codes,
  heuristic matching, unknown fallback, and resultXdr preservation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Wilfred007
Copy link
Collaborator

@Anuoluwapo25 Hi kindly run build to clear this error

Run npm run lint

scaffold-stellar-frontend@0.0.1 lint
eslint .

/home/runner/work/PayD/PayD/frontend/src/pages/CrossAssetPayment.tsx
29:10 error 'contractErrorXdr' is assigned a value but never used @typescript-eslint/no-unused-vars

/home/runner/work/PayD/PayD/frontend/src/pages/RevenueSplitDashboard.tsx
239:49 warning Do not use item index in the array as its key react-x/no-array-index-key
269:44 warning Do not use item index in the array as its key react-x/no-array-index-key

/home/runner/work/PayD/PayD/frontend/src/pages/TransactionHistory.tsx
32:19 warning Do not use item index in the array as its key react-x/no-array-index-key

/home/runner/work/PayD/PayD/frontend/src/services/revenueSplit.ts
1:1 warning Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-unsafe-call')
1:1 warning Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-unsafe-member-access')
1:1 warning Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-unsafe-argument')

✖ 7 problems (1 error, 6 warnings)
0 errors and 3 warnings potentially fixable with the --fix option.

Error: Process completed with exit code 1.

@Anuoluwapo25
Copy link
Author

Anuoluwapo25 commented Feb 26, 2026 via email

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.

#082: Contract Error Parsing and UI Display

2 participants