Closed
Conversation
Two bugs with v2 keysets: getDecodedToken fails without keyset IDs for resolution, and re-encoded tokens have truncated IDs that can't be looked up. Fix uses dependency-injected keyset resolver with cache-first strategy, plus raw token string passthrough in paste/scan.
- extractCashuTokenString validates via getTokenMetadata (not just regex) - extractCashuToken uses try/catch like cashu.me for v2 detection - Preserves immediate validation UX in paste/scan handlers
4 tasks: token functions + tests, resolver factory, paste/scan handlers, route clientLoaders. Includes v2-specific tests with round-trip verification.
- Add extractCashuTokenString for paste/scan handlers (validates via getTokenMetadata without full decode, avoids lossy re-encode cycle) - Update extractCashuToken to async with keyset ID fetcher for v2 resolution (tries v1 decode first, falls back to mint keyset fetch) - Add extractCashuToken wrapper in shared/cashu that wires queryClient - Update route clientLoaders to use v2-aware decode - Fix getTokenHash to clone proofs before getEncodedToken (cashu-ts mutates proof.id, truncating v2 keyset IDs to short form) See: cashubtc/cashu-ts#535 - Add token extraction tests covering v1/v2 decode and round-trips
Replace AgicashMintExtension.closed_loop with purpose field matching CDK update. Add 'offer' to AccountPurpose for promotional ecash with expiry. Store expiresAt in JSONB details from keyset final_expiry. - Validator accepts mints with NUT-04 (minting) disabled - canReceiveFromLightning checks NUT-04 status generically - checkIsTestMint handles minting-disabled mints - Show non-expired offers in gift cards UI with expiry date - DB migration adds 'offer' to account_purpose enum
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Updates to Preview Branch (feat/offers-mvp) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
f1d8682 to
ecd243b
Compare
|
Closing — superseded by #959 (feat: add offer mint purpose to cashu protocol extensions), which takes a narrower, cleaner approach to offer account support. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AgicashMintExtension.closed_loopwithpurposefield ("transactional"|"gift-card"|"offer") matching CDK updateexpiresAtto cashu accounts (stored in JSONB details, read from keysetfinal_expiry)canReceiveFromLightningchecks NUT-04 status genericallycheckIsTestMinthandles minting-disabled mints gracefully'offer'toaccount_purposeenumNote
One known type error in
user-repository.ts— resolves after applying the migration and runningbun run db:generate-types.Test plan
expiresAtis persisted🤖 Generated with Claude Code