Skip to content

Commit

Permalink
update for web worker
Browse files Browse the repository at this point in the history
  • Loading branch information
futurepaul committed May 9, 2024
1 parent fca7ed8 commit 2a3b462
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/routes/Redeem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,7 @@ export function Redeem() {
setError("");
setLoading(true);
if (!state.scan_result?.cashu_token) return;
await state.mutiny_wallet?.melt_cashu_token(
state.scan_result?.cashu_token
);
await sw.melt_cashu_token(state.scan_result?.cashu_token);
setRedeemState("paid");
await vibrateSuccess();
} catch (e) {
Expand Down
9 changes: 9 additions & 0 deletions src/workers/walletWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1565,6 +1565,15 @@ export async function estimate_sweep_federation_fee(
return await wallet!.estimate_sweep_federation_fee(amount);
}

/**
* Calls upon a Cash mint and melts the token from it.
* @param {string} maybe_token
* @returns {Promise<any>}
*/
export async function melt_cashu_token(maybe_token: string): Promise<void> {
return await wallet!.melt_cashu_token(maybe_token);
}

export async function parse_params(params: string): Promise<PaymentParams> {
const paramsResult = await new PaymentParams(params);
// PAIN just another object rebuild
Expand Down

0 comments on commit 2a3b462

Please sign in to comment.