mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-01-03 14:24:27 +01:00
Fix for mutiny_wallet, handle new storage
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { MutinyManager } from "@mutinywallet/mutiny-wasm";
|
||||
import { MutinyWallet } from "@mutinywallet/mutiny-wasm";
|
||||
|
||||
export function satsToUsd(amount: number | undefined, price: number, formatted: boolean): string {
|
||||
if (typeof amount !== "number" || isNaN(amount)) {
|
||||
return ""
|
||||
}
|
||||
try {
|
||||
const btc = MutinyManager.convert_sats_to_btc(BigInt(Math.floor(amount)));
|
||||
const btc = MutinyWallet.convert_sats_to_btc(BigInt(Math.floor(amount)));
|
||||
const usd = btc * price;
|
||||
|
||||
if (formatted) {
|
||||
@@ -26,7 +26,7 @@ export function usdToSats(amount: number | undefined, price: number, formatted:
|
||||
}
|
||||
try {
|
||||
const btc = price / amount;
|
||||
const sats = MutinyManager.convert_btc_to_sats(btc);
|
||||
const sats = MutinyWallet.convert_btc_to_sats(btc);
|
||||
if (formatted) {
|
||||
return parseInt(sats.toString()).toLocaleString();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user