Skip to content

Pin @stacks/connect version and add wallet error handling#14

Open
warmidris wants to merge 2 commits intoobycode:mainfrom
warmidris:leather-wallet-compat
Open

Pin @stacks/connect version and add wallet error handling#14
warmidris wants to merge 2 commits intoobycode:mainfrom
warmidris:leather-wallet-compat

Conversation

@warmidris
Copy link
Copy Markdown
Contributor

@warmidris warmidris commented Mar 27, 2026

Summary

  • Pin @stacks/connect to v8.2.5 in both docs/app.js and server/ui/main.src.js — the ESM CDN import was unpinned, which could break on upstream releases
  • Wallet cancellation detectionisWalletCancellationError and normalizeWalletPromptError recognize user-cancelled prompts and surface a clean "Signature cancelled" message instead of cryptic errors

Applied to both docs/app.js (docs site UI) and server/ui/main.src.js (node console UI).

Test plan

  • Open docs site, connect wallet, sign a transfer message — works as before
  • Cancel a signing prompt — verify clean "Signature cancelled" error instead of raw wallet error
  • Open node console UI, repeat wallet connect + signing tests

Generated with Claude Code

warmidris and others added 2 commits March 27, 2026 01:25
- Pin @stacks/connect to v8.2.5 for reproducible builds
- Add VRS→RSV signature normalization (Leather returns VRS, Clarity expects RSV)
- Add 3-tier signing fallback: @stacks/connect → direct provider → wallet-JSON format
- Add cvToWalletJson() for older Leather versions that reject raw ClarityValue objects
- Add wallet cancellation detection to avoid retrying after user explicitly cancels
- Applied to both docs/app.js (docs UI) and server/ui/main.src.js (node console UI)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove over-engineered Leather compatibility layer (signature
normalization, ClarityValue-to-JSON conversion, 3-tier fallback
signing). Keep only the @stacks/connect@8.2.5 version pin and
wallet cancellation error handling around the original direct
request() calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@warmidris warmidris changed the title Add Leather wallet compatibility for SIP-018 signing Pin @stacks/connect version and add wallet error handling Mar 27, 2026
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