Compare commits

...

2 commits

Author SHA1 Message Date
1df32badfb
bug: allow redeeming cashui when cashu wallet is stuck
TODO: separate wallets from UI
2025-07-07 17:32:45 +02:00
1c2677b547
chore: add warnings in readme 2025-07-07 12:16:43 +02:00
2 changed files with 10 additions and 1 deletions

View file

@ -12,6 +12,12 @@ It's built for simplicity, speed, and interoperability, giving you the tools to
It's a Progressive Web App (PWA), which means you can "install" it on your phone or desktop for a native-like experience without going through an app store.
## ⚠️ Important Warnings
**This wallet is in BETA.** There may be bugs, including breaking bugs that could affect your funds or wallet functionality. Use with caution and only with amounts you can afford to lose.
**Web Wallet Security Notice:** PortalBTC is a web-based wallet running in your browser. While we implement security best practices, any browser extension or malicious website you visit could potentially access your private keys. For maximum security, periodically send large amounts to a hardware wallet or air-gapped device.
## What can it do?
- **Go Beyond the Main Chain**: Portal supports multiple Bitcoin layers in one interface.

View file

@ -1,6 +1,7 @@
import {
CashuMint,
CashuWallet,
getDecodedToken,
MintQuoteState,
type Proof,
} from "@cashu/cashu-ts";
@ -225,7 +226,9 @@ function updateBalance() {
export async function redeemToken(token: string): Promise<void> {
if (!token.trim()) throw new Error("Token is empty");
const wallet = await walletReady;
const parsedToken = getDecodedToken(token);
const mint = new CashuMint(parsedToken.mint);
const wallet = new CashuWallet(mint);
const received = await wallet.receive(token.trim());
proofs.push(...received);
const amountReceived = received.reduce((sum, p) => sum + p.amount, 0);