Fix for mutiny_wallet, handle new storage

This commit is contained in:
benthecarman
2023-05-06 14:15:01 -05:00
parent 1b3c73a40c
commit dfe87ce8a3
16 changed files with 105 additions and 106 deletions

View File

@@ -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 {