Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Commit 2a3b462

Browse files
committed
update for web worker
1 parent fca7ed8 commit 2a3b462

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/routes/Redeem.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,7 @@ export function Redeem() {
170170
setError("");
171171
setLoading(true);
172172
if (!state.scan_result?.cashu_token) return;
173-
await state.mutiny_wallet?.melt_cashu_token(
174-
state.scan_result?.cashu_token
175-
);
173+
await sw.melt_cashu_token(state.scan_result?.cashu_token);
176174
setRedeemState("paid");
177175
await vibrateSuccess();
178176
} catch (e) {

src/workers/walletWorker.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,6 +1565,15 @@ export async function estimate_sweep_federation_fee(
15651565
return await wallet!.estimate_sweep_federation_fee(amount);
15661566
}
15671567

1568+
/**
1569+
* Calls upon a Cash mint and melts the token from it.
1570+
* @param {string} maybe_token
1571+
* @returns {Promise<any>}
1572+
*/
1573+
export async function melt_cashu_token(maybe_token: string): Promise<void> {
1574+
return await wallet!.melt_cashu_token(maybe_token);
1575+
}
1576+
15681577
export async function parse_params(params: string): Promise<PaymentParams> {
15691578
const paramsResult = await new PaymentParams(params);
15701579
// PAIN just another object rebuild

0 commit comments

Comments
 (0)