Skip to content

introduce offer mints and accounts#959

Open
gudnuf wants to merge 1 commit intomasterfrom
add-offer-accounts
Open

introduce offer mints and accounts#959
gudnuf wants to merge 1 commit intomasterfrom
add-offer-accounts

Conversation

@gudnuf
Copy link
Copy Markdown
Contributor

@gudnuf gudnuf commented Mar 25, 2026

Replace closed_loop boolean with a purpose enum (transactional | gift-card | offer) in mint info extensions. Offer mints have NUT-04 minting disabled and keyset-based expiry.

I will open follow up PRs that add the account state (active, expired, deleted), and one for the offers UI

Replace closed_loop boolean with a purpose enum (transactional | gift-card | offer)
in mint info extensions. Offer mints have NUT-04 minting disabled and keyset-based
expiry for promotional ecash distribution.

- Add 'offer' to MintPurpose type and account_purpose DB enum
- Add expiresAt field to CashuAccount (derived from active keyset final_expiry)
- Allow NUT-04 disabled in mint validation for offer mints
- Adapt canSendToLightning/canReceiveFromLightning for 3-purpose model
- Update isTestMintQueryOptions to handle mints with minting disabled
@gudnuf gudnuf requested a review from jbojcic1 March 25, 2026 23:14
@gudnuf gudnuf self-assigned this Mar 25, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agicash Ready Ready Preview, Comment Mar 25, 2026 11:16pm

Request Review

@supabase
Copy link
Copy Markdown

supabase bot commented Mar 25, 2026

Updates to Preview Branch (add-offer-accounts) ↗︎

Deployments Status Updated
Database Wed, 25 Mar 2026 23:15:43 UTC
Services Wed, 25 Mar 2026 23:15:43 UTC
APIs Wed, 25 Mar 2026 23:15:43 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations ⚠️ Wed, 25 Mar 2026 23:19:05 UTC
Migrations Wed, 25 Mar 2026 23:19:09 UTC
Seeding Wed, 25 Mar 2026 23:19:09 UTC
Edge Functions Wed, 25 Mar 2026 23:19:09 UTC

⚠️ Warning — Service health check failed


View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

* Converted from the active keyset's `final_expiry` unix epoch (NUT-02).
* Null for non-offer accounts or when the keyset has no expiry.
*/
expires_at: z.string().nullable().optional(),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

looking at this plan for adding account state here I'm wondering if expires_at should be a new column, not in the cashu account jsonb.

@orveth orveth mentioned this pull request Mar 26, 2026
7 tasks
@orveth orveth requested review from ditto-agent and removed request for jbojcic1 March 28, 2026 09:20
@gudnuf gudnuf changed the title feat: add offer mint purpose to cashu protocol extensions introduce offer mints and accounts Mar 28, 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.

4 participants