Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch/cross mint swap #105

Merged
merged 3 commits into from
Sep 16, 2024
Merged

Patch/cross mint swap #105

merged 3 commits into from
Sep 16, 2024

Conversation

gudnuf
Copy link
Contributor

@gudnuf gudnuf commented Sep 16, 2024

There were two issues here.

One is that if we want to claim locked ecash by melting to another mint, cashu-ts does not currently support unlocking in the melt operation so if the lightning payment fails, then we already had swapped to unlock and the original proofs are now spent.

  • Fixed by claiming the swapped proofs and prompting the user to add the source mint

The other issue was with a discrepancy in exchange rates between mints, and my getCrossMinttQuotes function was exceeding its max attempts to find valid mint/melt quotes to melt all the proofs.

  • Fixed by subtracting the difference in quotes rather than amountToMint = amountToMint - meltQuote.fee_reserve - 1;

Copy link

vercel bot commented Sep 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
boardwalk ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 16, 2024 6:41pm

@gudnuf gudnuf merged commit 4332e94 into main Sep 16, 2024
1 of 2 checks passed
@gudnuf gudnuf deleted the patch/cross-mint-swap branch September 16, 2024 18:41
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