diff --git a/packages/components/built/Auth.js b/packages/components/built/Auth.js index 98c51dbb1..e46015b71 100644 --- a/packages/components/built/Auth.js +++ b/packages/components/built/Auth.js @@ -13,9 +13,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run import { useEffect, useRef, useState } from "react"; import { Computer } from "@bitcoin-computer/lib"; import { initFlowbite } from "flowbite"; +import { HiRefresh } from "react-icons/hi"; import { useUtilsComponents } from "./UtilsContext"; import { Modal } from "./Modal"; -import { HiRefresh } from "react-icons/hi"; function isLoggedIn() { return !!localStorage.getItem("BIP_39_KEY"); } @@ -48,17 +48,17 @@ function getBip44Path(_a) { } function loggedOutConfiguration() { return { - chain: process.env["REACT_APP_CHAIN"], - network: process.env["REACT_APP_NETWORK"], - url: process.env["REACT_APP_URL"] + chain: process.env.REACT_APP_CHAIN, + network: process.env.REACT_APP_NETWORK, + url: process.env.REACT_APP_URL }; } function loggedInConfiguration() { return { mnemonic: localStorage.getItem("BIP_39_KEY"), - chain: (localStorage.getItem("CHAIN") || process.env["REACT_APP_CHAIN"]), - network: (localStorage.getItem("NETWORK") || process.env["REACT_APP_NETWORK"]), - url: localStorage.getItem("URL") || process.env["REACT_APP_URL"] + chain: (localStorage.getItem("CHAIN") || process.env.REACT_APP_CHAIN), + network: (localStorage.getItem("NETWORK") || process.env.REACT_APP_NETWORK), + url: localStorage.getItem("URL") || process.env.REACT_APP_URL }; } function getComputer() { @@ -101,14 +101,14 @@ function LoginButton(_a) { } function LoginForm() { var _a = useState(new Computer().getMnemonic()), mnemonic = _a[0], setMnemonic = _a[1]; - var _b = useState(process.env["REACT_APP_CHAIN"]), chain = _b[0], setChain = _b[1]; - var _c = useState(process.env["REACT_APP_NETWORK"]), network = _c[0], setNetwork = _c[1]; - var _d = useState(process.env["REACT_APP_URL"]), url = _d[0], _ = _d[1]; + var _b = useState(process.env.REACT_APP_CHAIN), chain = _b[0], setChain = _b[1]; + var _c = useState(process.env.REACT_APP_NETWORK), network = _c[0], setNetwork = _c[1]; + var url = useState(process.env.REACT_APP_URL)[0]; var urlInputRef = useRef(null); useEffect(function () { initFlowbite(); }, []); - return (_jsxs(_Fragment, { children: [_jsx("div", __assign({ className: "max-w-sm mx-auto p-4 md:p-5 space-y-4" }, { children: _jsx("form", __assign({ className: "space-y-6" }, { children: _jsxs("div", { children: [_jsx(MnemonicInput, { mnemonic: mnemonic, setMnemonic: setMnemonic }), !process.env["REACT_APP_CHAIN"] && _jsx(ChainInput, { chain: chain, setChain: setChain }), !process.env["REACT_APP_NETWORK"] && (_jsx(NetworkInput, { network: network, setNetwork: setNetwork })), !process.env["REACT_APP_URL"] && _jsx(UrlInput, { urlInputRef: urlInputRef })] }) })) })), _jsx("div", __assign({ className: "max-w-sm mx-auto flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600" }, { children: _jsx(LoginButton, { mnemonic: mnemonic, chain: chain, network: network, url: url, urlInputRef: urlInputRef }) }))] })); + return (_jsxs(_Fragment, { children: [_jsx("div", __assign({ className: "max-w-sm mx-auto p-4 md:p-5 space-y-4" }, { children: _jsx("form", __assign({ className: "space-y-6" }, { children: _jsxs("div", { children: [_jsx(MnemonicInput, { mnemonic: mnemonic, setMnemonic: setMnemonic }), !process.env.REACT_APP_CHAIN && _jsx(ChainInput, { chain: chain, setChain: setChain }), !process.env.REACT_APP_NETWORK && (_jsx(NetworkInput, { network: network, setNetwork: setNetwork })), !process.env.REACT_APP_URL && _jsx(UrlInput, { urlInputRef: urlInputRef })] }) })) })), _jsx("div", __assign({ className: "max-w-sm mx-auto flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600" }, { children: _jsx(LoginButton, { mnemonic: mnemonic, chain: chain, network: network, url: url, urlInputRef: urlInputRef }) }))] })); } function LoginModal() { return _jsx(Modal.Component, { title: "Sign in", content: LoginForm, id: "sign-in-modal" }); diff --git a/packages/components/built/Error404.d.ts b/packages/components/built/Error404.d.ts index 58becf8b9..8966b2489 100644 --- a/packages/components/built/Error404.d.ts +++ b/packages/components/built/Error404.d.ts @@ -1,3 +1,3 @@ -export declare const Error404: ({ message }: { - message?: string | undefined; +export declare const Error404: ({ message: m }: { + message?: string; }) => import("react/jsx-runtime").JSX.Element; diff --git a/packages/components/built/Error404.js b/packages/components/built/Error404.js index 3d1bc4e3b..27f734006 100644 --- a/packages/components/built/Error404.js +++ b/packages/components/built/Error404.js @@ -11,11 +11,11 @@ var __assign = (this && this.__assign) || function () { }; import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; export var Error404 = function (_a) { - var message = _a.message; + var m = _a.message; var Missing = function () { return (_jsxs(_Fragment, { children: [_jsx("h1", __assign({ className: "mb-4 text-6xl tracking-tight font-extrabold text-blue-700 dark:text-blue-600" }, { children: "404" })), _jsx("p", __assign({ className: "mb-4 text-3xl tracking-tight font-bold text-gray-700 md:text-4xl dark:text-white" }, { children: "Something's missing." })), _jsxs("p", __assign({ className: "mb-4 text-lg font-light text-gray-500 dark:text-gray-400" }, { children: ["Sorry, we can't find that page. You'll find lots to explore on the home page.", " "] })), _jsx("a", __assign({ href: "/", className: "inline-flex text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:focus:ring-blue-900 my-4" }, { children: "Back to Homepage" }))] })); }; var Err = function (_a) { var message = _a.message; return (_jsxs(_Fragment, { children: [_jsx("h1", __assign({ className: "mb-4 text-6xl tracking-tight font-extrabold text-blue-700 dark:text-blue-600" }, { children: "400" })), _jsx("p", __assign({ className: "mb-4 text-3xl tracking-tight font-bold text-gray-700 md:text-4xl dark:text-white" }, { children: "Something went wrong." })), _jsx("p", __assign({ className: "mb-4 text-lg font-light text-gray-500 dark:text-gray-400" }, { children: message }))] })); }; - return (_jsx("section", __assign({ className: "w-full bg-white dark:bg-gray-900" }, { children: _jsx("div", __assign({ className: "py-8 px-4 mx-auto max-w-screen-xl lg:py-16 lg:px-6" }, { children: _jsx("div", __assign({ className: "mx-auto max-w-screen-sm text-center" }, { children: message ? _jsx(Err, { message: message }) : _jsx(Missing, {}) })) })) }))); + return (_jsx("section", __assign({ className: "w-full bg-white dark:bg-gray-900" }, { children: _jsx("div", __assign({ className: "py-8 px-4 mx-auto max-w-screen-xl lg:py-16 lg:px-6" }, { children: _jsx("div", __assign({ className: "mx-auto max-w-screen-sm text-center" }, { children: m ? _jsx(Err, { message: m }) : _jsx(Missing, {}) })) })) }))); }; diff --git a/packages/components/built/SmartObject.js b/packages/components/built/SmartObject.js index 351613bc0..3d0d792b4 100644 --- a/packages/components/built/SmartObject.js +++ b/packages/components/built/SmartObject.js @@ -79,7 +79,7 @@ var SmartObjectValues = function (_a) { }) .map(function (_a, i) { var key = _a[0], value = _a[1]; - return (_jsxs("div", { children: [_jsx("h3", __assign({ className: "mt-2 text-xl font-bold dark:text-white" }, { children: capitalizeFirstLetter(key) })), _jsx(ObjectValueCard, { content: toObject(value ? value : "") })] }, i)); + return (_jsxs("div", { children: [_jsx("h3", __assign({ className: "mt-2 text-xl font-bold dark:text-white" }, { children: capitalizeFirstLetter(key) })), _jsx(ObjectValueCard, { content: toObject(value || "") })] }, i)); }) })); }; // const revToId = (rev: string) => rev?.split(":")[0] diff --git a/packages/components/built/Transaction.js b/packages/components/built/Transaction.js index 7b360e392..3d7a4fdfe 100644 --- a/packages/components/built/Transaction.js +++ b/packages/components/built/Transaction.js @@ -111,6 +111,7 @@ function Component() { err_1 = _b.sent(); if (err_1 instanceof Error) { setTransition(""); + // eslint-disable-next-line no-console console.log("Error parsing transaction", err_1.message); } return [3 /*break*/, 3]; diff --git a/packages/components/built/Wallet.d.ts b/packages/components/built/Wallet.d.ts index 548b25a33..ac9eb825f 100644 --- a/packages/components/built/Wallet.d.ts +++ b/packages/components/built/Wallet.d.ts @@ -1,8 +1,4 @@ import { Computer } from "@bitcoin-computer/lib"; -declare function SendMoneyForm({ computer, paymentModSpec }: { - computer: any; - paymentModSpec: string | undefined; -}): import("react/jsx-runtime").JSX.Element; export declare function Wallet({ paymentModSpec }: { paymentModSpec?: string; }): import("react/jsx-runtime").JSX.Element; @@ -13,12 +9,9 @@ export declare const WalletComponents: { }) => import("react/jsx-runtime").JSX.Element; Address: ({ computer }: any) => import("react/jsx-runtime").JSX.Element; PublicKey: ({ computer }: any) => import("react/jsx-runtime").JSX.Element; - Path: ({ computer }: any) => import("react/jsx-runtime").JSX.Element; Mnemonic: ({ computer }: any) => import("react/jsx-runtime").JSX.Element; Chain: ({ computer }: any) => import("react/jsx-runtime").JSX.Element; Network: ({ computer }: any) => import("react/jsx-runtime").JSX.Element; Url: ({ computer }: any) => import("react/jsx-runtime").JSX.Element; - SendMoneyForm: typeof SendMoneyForm; LogOut: () => import("react/jsx-runtime").JSX.Element; }; -export {}; diff --git a/packages/components/built/Wallet.js b/packages/components/built/Wallet.js index 2a36bd4cb..1f30ba71b 100644 --- a/packages/components/built/Wallet.js +++ b/packages/components/built/Wallet.js @@ -46,31 +46,29 @@ var __generator = (this && this.__generator) || function (thisArg, body) { } }; import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; -import { initFlowbite } from "flowbite"; import { useCallback, useContext, useEffect, useState } from "react"; import { HiRefresh } from "react-icons/hi"; import { Auth } from "./Auth"; import { Drawer } from "./Drawer"; -import { useUtilsComponents, UtilsContext } from "./UtilsContext"; +import { UtilsContext } from "./UtilsContext"; import { ComputerContext } from "./ComputerContext"; var Balance = function (_a) { var computer = _a.computer, paymentModSpec = _a.paymentModSpec; var _b = useState(0), balance = _b[0], setBalance = _b[1]; - var _c = useState(localStorage.getItem("CHAIN") || "LTC"), chain = _c[0], setChain = _c[1]; + var _c = useState(localStorage.getItem("CHAIN") || "LTC"), setChain = _c[1]; var _d = UtilsContext.useUtilsComponents(), showSnackBar = _d.showSnackBar, showLoader = _d.showLoader; var refreshBalance = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () { - var paymentRevs, _a, payments, amountsInPaymentToken_1, availableWalletBalance, err_1; + var publicKey, mod, paymentRevs, _a, payments, amountsInPaymentToken, availableWalletBalance, err_1; return __generator(this, function (_b) { switch (_b.label) { case 0: _b.trys.push([0, 7, , 8]); showLoader(true); if (!computer) return [3 /*break*/, 6]; + publicKey = computer.getPublicKey(); + mod = paymentModSpec; if (!paymentModSpec) return [3 /*break*/, 2]; - return [4 /*yield*/, computer.query({ - publicKey: computer.getPublicKey(), - mod: paymentModSpec - })]; + return [4 /*yield*/, computer.query({ publicKey: publicKey, mod: mod })]; case 1: _a = _b.sent(); return [3 /*break*/, 3]; @@ -82,16 +80,13 @@ var Balance = function (_a) { return [4 /*yield*/, Promise.all(paymentRevs.map(function (rev) { return computer.sync(rev); }))]; case 4: payments = (_b.sent()); - amountsInPaymentToken_1 = 0; - if (payments && payments.length) { - payments.forEach(function (pay) { - amountsInPaymentToken_1 += pay._amount - computer.getMinimumFees(); - }); - } + amountsInPaymentToken = payments && payments.length + ? payments.reduce(function (total, pay) { return total + (pay._amount - computer.getMinimumFees()); }, 0) + : 0; return [4 /*yield*/, computer.getBalance()]; case 5: availableWalletBalance = _b.sent(); - setBalance(availableWalletBalance + amountsInPaymentToken_1); + setBalance(availableWalletBalance + amountsInPaymentToken); setChain(computer.getChain()); _b.label = 6; case 6: @@ -106,10 +101,25 @@ var Balance = function (_a) { } }); }); }, [computer]); + var fund = function () { return __awaiter(void 0, void 0, void 0, function () { + var _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: return [4 /*yield*/, computer.faucet(1e8)]; + case 1: + _b.sent(); + _a = setBalance; + return [4 /*yield*/, computer.getBalance()]; + case 2: + _a.apply(void 0, [_b.sent()]); + return [2 /*return*/]; + } + }); + }); }; useEffect(function () { refreshBalance(); }, []); - return (_jsxs("div", __assign({ className: "mb-4" }, { children: [_jsxs("h6", __assign({ className: "text-lg font-bold dark:text-white" }, { children: ["Balance", _jsx(HiRefresh, { onClick: refreshBalance, className: "w-4 h-4 ml-1 inline cursor-pointer text-gray-500 dark:text-gray-400 hover:text-slate-700 dark:hover:text-slate-100" })] })), _jsxs("p", __assign({ className: "mb-4 font-mono text-xs text-gray-500 dark:text-gray-400" }, { children: [balance / 1e8, " ", chain, " "] }))] }))); + return (_jsxs("div", __assign({ id: "dropdown-cta", className: "relative flex flex-col p-6 my-4 rounded-lg bg-blue-50 dark:bg-blue-900", role: "alert" }, { children: [_jsxs("div", __assign({ className: "text-center mb-1 text-2xl font-bold text-blue-800 dark:text-blue-400" }, { children: [balance / 1e8, " ", computer.getChain(), " ", _jsx(HiRefresh, { onClick: refreshBalance, className: "w-4 h-4 ml-1 mb-1 inline cursor-pointer hover:text-slate-700 dark:hover:text-slate-100" })] })), _jsx("div", __assign({ className: "text-center uppercase text-xs text-blue-800 dark:text-blue-400" }, { children: computer.getNetwork() })), computer.getNetwork() === 'regtest' && _jsx("button", __assign({ type: "button", onClick: fund, className: "absolute bottom-2 right-2 px-1 py-1 text-center text-xs font-medium text-center text-blue-700 hover:text-white border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg dark:border-blue-500 dark:text-blue-500 dark:hover:text-white dark:hover:bg-blue-500 dark:focus:ring-blue-800" }, { children: "Fund" }))] }))); }; var Address = function (_a) { var computer = _a.computer; @@ -117,19 +127,12 @@ var Address = function (_a) { }; var PublicKey = function (_a) { var computer = _a.computer; - return (_jsxs("div", __assign({ className: "mb-4" }, { children: [_jsx("h6", __assign({ className: "text-lg font-bold dark:text-white" }, { children: "Public Key" })), _jsx("p", __assign({ className: "mb-4 font-mono text-xs text-gray-500 dark:text-gray-400 break-words" }, { children: computer.getPublicKey() }))] }))); + return (_jsxs("div", __assign({ className: "mb-4" }, { children: [_jsx("h6", __assign({ className: "text-lg font-bold dark:text-white" }, { children: "Public Key" })), _jsx("p", __assign({ className: "mb-4 text-xs font-mono text-gray-500 dark:text-gray-400 break-words" }, { children: computer.getPublicKey() }))] }))); }; var Mnemonic = function (_a) { var computer = _a.computer; - var _b = useState(false), showMnemonic = _b[0], setShowMnemonic = _b[1]; - var Heading = function () { return _jsx("h6", __assign({ className: "text-lg font-bold dark:text-white" }, { children: "Mnemonic" })); }; - if (showMnemonic) - return (_jsxs("div", __assign({ className: "mb-4" }, { children: [_jsx(Heading, {}), _jsx("p", __assign({ className: "mb-1 font-mono text-xs text-gray-500 dark:text-gray-400 break-words" }, { children: computer.getMnemonic() })), _jsx("button", __assign({ onClick: function () { return setShowMnemonic(false); }, className: "text-sm text-gray-500 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-500 underline" }, { children: "Hide" }))] }))); - return (_jsxs("div", __assign({ className: "mb-4" }, { children: [_jsx(Heading, {}), _jsx("button", __assign({ onClick: function () { return setShowMnemonic(true); }, className: "text-sm text-gray-500 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-500 underline" }, { children: "Show" })), _jsx("br", {})] }))); -}; -var Path = function (_a) { - var computer = _a.computer; - return (_jsxs("div", __assign({ className: "mb-4" }, { children: [_jsx("h6", __assign({ className: "text-lg font-bold dark:text-white" }, { children: "Path" })), _jsx("p", __assign({ className: "mb-4 font-mono text-xs text-gray-500 dark:text-gray-400 break-words" }, { children: computer.getPath() }))] }))); + var _b = useState(false), mnemonicShown = _b[0], setMnemonicShown = _b[1]; + return _jsxs("div", __assign({ className: "mb-4" }, { children: [_jsxs("h6", __assign({ className: "text-lg font-bold dark:text-white" }, { children: ["Mnemonic\u00A0", _jsx("button", __assign({ onClick: function () { return setMnemonicShown(!mnemonicShown); }, className: "text-xs font-mono font-normal text-gray-500 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-500 underline" }, { children: mnemonicShown ? 'hide' : 'show' }))] })), _jsx("p", __assign({ className: "text-xs font-mono text-gray-500 dark:text-gray-400 break-words" }, { children: mnemonicShown ? computer.getMnemonic() : '' }))] })); }; var Url = function (_a) { var computer = _a.computer; @@ -144,187 +147,19 @@ var Network = function (_a) { return (_jsxs("div", __assign({ className: "mb-4" }, { children: [_jsx("h6", __assign({ className: "text-lg font-bold dark:text-white" }, { children: "Network" })), _jsx("p", __assign({ className: "mb-4 font-mono text-xs text-gray-500 dark:text-gray-400 break-words" }, { children: computer.getNetwork() }))] }))); }; var LogOut = function () { return (_jsxs(_Fragment, { children: [_jsxs("div", __assign({ className: "mb-6" }, { children: [_jsx("h6", __assign({ className: "text-lg font-bold dark:text-white" }, { children: "Log out" })), _jsx("p", __assign({ className: "mb-1 text-sm text-gray-500 dark:text-gray-400" }, { children: "Logging out will delete your mnemonic. Make sure to write it down." }))] })), _jsx("div", __assign({ className: "grid grid-cols-2 gap-4" }, { children: _jsx("button", __assign({ onClick: Auth.logout, className: "rounded-lg border border-gray-200 bg-white px-4 py-2 text-center text-sm font-medium text-gray-900 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700" }, { children: "Log out" })) }))] })); }; -function AmountInput(_a) { - var chain = _a.chain, amount = _a.amount, setAmount = _a.setAmount; - return (_jsxs(_Fragment, { children: [_jsx("div", __assign({ className: "mt-4 flex justify-between" }, { children: _jsxs("label", __assign({ className: "block mb-2 text-sm font-medium text-gray-900 dark:text-white" }, { children: ["Amount (", chain, ")"] })) })), _jsx("input", { value: amount, onChange: function (e) { return setAmount(e.target.value); }, placeholder: "1 ".concat(chain), className: "block w-full p-2 text-gray-900 border border-gray-300 rounded-lg bg-gray-50 text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" })] })); -} -function AddressInput(_a) { - var address = _a.address, setAddress = _a.setAddress; - return (_jsxs(_Fragment, { children: [_jsx("div", __assign({ className: "mt-4 flex justify-between" }, { children: _jsx("label", __assign({ className: "block mb-2 text-sm font-medium text-gray-900 dark:text-white" }, { children: "User Address" })) })), _jsx("input", { value: address, placeholder: "Address", onChange: function (e) { return setAddress(e.target.value); }, className: "block w-full p-2 text-gray-900 border border-gray-300 rounded-lg bg-gray-50 text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" })] })); -} -function SendMoneyButton(_a) { - var _this = this; - var computer = _a.computer, amount = _a.amount, address = _a.address, setAmount = _a.setAmount, setAddress = _a.setAddress, paymentModSpec = _a.paymentModSpec; - var _b = useUtilsComponents(), showSnackBar = _b.showSnackBar, showLoader = _b.showLoader; - var send = function (e) { return __awaiter(_this, void 0, void 0, function () { - var TRANSACTION_FEE, floatAmount, availableWalletBalance, requiredAmountToBeTransferred, paymentRevs, _a, payments, amountsInPaymentToken_2, sortedPayments, paymentsToBeWithdraw, newAvailableAmount, i, pay, error_1; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - e.preventDefault(); - TRANSACTION_FEE = computer.getMinimumFees(); - _b.label = 1; - case 1: - _b.trys.push([1, 12, , 13]); - if (!Auth.isLoggedIn()) - throw new Error("Please log in first."); - if (!address) { - showSnackBar("Please enter a valid address", false); - return [2 /*return*/]; - } - floatAmount = Math.round(Number(amount)); - if (!floatAmount) { - showSnackBar("Please enter a valid amount", false); - return [2 /*return*/]; - } - return [4 /*yield*/, computer.getBalance()]; - case 2: - availableWalletBalance = _b.sent(); - requiredAmountToBeTransferred = floatAmount * 1e8; - if (!(requiredAmountToBeTransferred + TRANSACTION_FEE < availableWalletBalance)) return [3 /*break*/, 4]; - return [4 /*yield*/, computer.send(requiredAmountToBeTransferred, address)]; - case 3: - _b.sent(); - return [3 /*break*/, 11]; - case 4: - if (!paymentModSpec) return [3 /*break*/, 6]; - return [4 /*yield*/, computer.query({ - publicKey: computer.getPublicKey(), - mod: paymentModSpec - })]; - case 5: - _a = _b.sent(); - return [3 /*break*/, 7]; - case 6: - _a = []; - _b.label = 7; - case 7: - paymentRevs = _a; - return [4 /*yield*/, Promise.all(paymentRevs.map(function (rev) { return computer.sync(rev); }))]; - case 8: - payments = (_b.sent()) // should import payment class - ; - amountsInPaymentToken_2 = 0; - if (payments && payments.length) { - payments.forEach(function (pay) { - amountsInPaymentToken_2 += pay._amount - TRANSACTION_FEE; - }); - } - if (requiredAmountToBeTransferred + TRANSACTION_FEE > - availableWalletBalance + amountsInPaymentToken_2) { - showSnackBar("Insufficient Balance.", false); - setAmount(""); - setAddress(""); - return [2 /*return*/]; - } - sortedPayments = payments.slice().sort(function (a, b) { return b._amount - a._amount; }); - paymentsToBeWithdraw = []; - newAvailableAmount = 0; - for (i = 0; i < sortedPayments.length; i++) { - pay = sortedPayments[i]; - newAvailableAmount += pay._amount - TRANSACTION_FEE; - paymentsToBeWithdraw.push(pay.setAmount(TRANSACTION_FEE)); - if (requiredAmountToBeTransferred + TRANSACTION_FEE < - availableWalletBalance + newAvailableAmount) { - break; - } - } - return [4 /*yield*/, Promise.all(paymentsToBeWithdraw)]; - case 9: - _b.sent(); - return [4 /*yield*/, computer.send(requiredAmountToBeTransferred, address)]; - case 10: - _b.sent(); - _b.label = 11; - case 11: - showSnackBar("".concat(amount, " ").concat(computer.getChain(), " trasferred successfully."), true); - setAmount(""); - setAddress(""); - return [3 /*break*/, 13]; - case 12: - error_1 = _b.sent(); - if (error_1 instanceof Error) { - showSnackBar(error_1.message, false); - } - return [2 /*return*/]; - case 13: return [2 /*return*/]; - } - }); - }); }; - return (_jsx(_Fragment, { children: _jsx("button", __assign({ onClick: function (e) { return __awaiter(_this, void 0, void 0, function () { - var error_2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - showLoader(true); - return [4 /*yield*/, send(e)]; - case 1: - _a.sent(); - showLoader(false); - return [3 /*break*/, 3]; - case 2: - error_2 = _a.sent(); - showLoader(false); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); - }); }, type: "submit", className: "px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800" }, { children: "Send (To Address)" })) })); -} -function SendMoneyForm(_a) { - var computer = _a.computer, paymentModSpec = _a.paymentModSpec; - var _b = useState(""), address = _b[0], setAddress = _b[1]; - var _c = useState(""), amount = _c[0], setAmount = _c[1]; - useEffect(function () { - initFlowbite(); - }, []); - return (_jsxs(_Fragment, { children: [_jsx("h6", __assign({ className: "text-lg font-bold dark:text-white" }, { children: "Transfer" })), _jsx("div", __assign({ className: "space-y-4" }, { children: _jsx("form", __assign({ className: "space-y-6" }, { children: _jsxs("div", { children: [_jsx(AddressInput, { address: address, setAddress: setAddress }), _jsx(AmountInput, { chain: computer.getChain(), amount: amount, setAmount: setAmount })] }) })) })), _jsx("div", __assign({ className: "flex items-center pt-4 rounded-b dark:border-gray-600" }, { children: _jsx(SendMoneyButton, { address: address, amount: amount, computer: computer, paymentModSpec: paymentModSpec, setAddress: setAddress, setAmount: setAmount }) }))] })); -} -function FaucetForm(_a) { - var _this = this; - var computer = _a.computer; - var _b = useState(""), amount = _b[0], setAmount = _b[1]; - useEffect(function () { - initFlowbite(); - }, []); - var showLoader = useUtilsComponents().showLoader; - return (_jsxs(_Fragment, { children: [_jsx("h6", __assign({ className: "text-lg font-bold dark:text-white" }, { children: "Fund Your Wallet" })), _jsx("p", __assign({ className: "text-sm text-gray-500 dark:text-gray-400" }, { children: "Click \"Fund\" to get 1 free regtest coin, then click on \"reload\" next to your balance." })), _jsx("div", __assign({ className: "flex items-center pt-4 rounded-b dark:border-gray-600" }, { children: _jsx("button", __assign({ onClick: function (e) { return __awaiter(_this, void 0, void 0, function () { - var error_3; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - showLoader(true); - return [4 /*yield*/, computer.faucet(1e8)]; - case 1: - _a.sent(); - showLoader(false); - return [3 /*break*/, 3]; - case 2: - error_3 = _a.sent(); - showLoader(false); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); - }); }, type: "submit", className: "px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800" }, { children: "Fund" })) }))] })); -} export function Wallet(_a) { var paymentModSpec = _a.paymentModSpec; var computer = useContext(ComputerContext); - var Content = function () { return (_jsxs(_Fragment, { children: [_jsx("h4", __assign({ className: "mb-8 text-2xl font-bold dark:text-white" }, { children: "Wallet" })), _jsx(Balance, { computer: computer, paymentModSpec: paymentModSpec }), _jsx(Address, { computer: computer }), _jsx(PublicKey, { computer: computer }), _jsx(Path, { computer: computer }), _jsx(Mnemonic, { computer: computer }), _jsx("hr", { className: "h-px my-6 bg-gray-200 border-0 dark:bg-gray-700" }), _jsx(Chain, { computer: computer }), _jsx(Network, { computer: computer }), _jsx(Url, { computer: computer }), computer.getNetwork() === "regtest" && (_jsxs(_Fragment, { children: [_jsx("hr", { className: "h-px my-6 bg-gray-200 border-0 dark:bg-gray-700" }), _jsx(FaucetForm, { computer: computer })] })), _jsx("hr", { className: "h-px my-6 bg-gray-200 border-0 dark:bg-gray-700" }), _jsx(SendMoneyForm, { computer: computer, paymentModSpec: paymentModSpec }), _jsx("hr", { className: "h-px my-6 bg-gray-200 border-0 dark:bg-gray-700" }), _jsx(LogOut, {})] })); }; + var Content = function () { return (_jsxs(_Fragment, { children: [_jsx("h4", __assign({ className: "text-2xl font-bold dark:text-white" }, { children: "Wallet" })), _jsx(Balance, { computer: computer, paymentModSpec: paymentModSpec }), _jsx(Address, { computer: computer }), _jsx(PublicKey, { computer: computer }), _jsx(Mnemonic, { computer: computer }), !process.env['REACT_APP_CHAIN'] && _jsx(Chain, { computer: computer }), !process.env['REACT_APP_NETWORK'] && _jsx(Network, { computer: computer }), !process.env['REACT_APP_URL'] && _jsx(Url, { computer: computer }), _jsx("hr", { className: "h-px my-6 bg-gray-200 border-0 dark:bg-gray-700" }), _jsx(LogOut, {})] })); }; return _jsx(Drawer.Component, { Content: Content, id: "wallet-drawer" }); } export var WalletComponents = { Balance: Balance, Address: Address, PublicKey: PublicKey, - Path: Path, Mnemonic: Mnemonic, Chain: Chain, Network: Network, Url: Url, - SendMoneyForm: SendMoneyForm, LogOut: LogOut }; diff --git a/packages/components/src/Auth.tsx b/packages/components/src/Auth.tsx index 20fafefbc..ee07502db 100644 --- a/packages/components/src/Auth.tsx +++ b/packages/components/src/Auth.tsx @@ -1,10 +1,10 @@ import { Dispatch, useEffect, useRef, useState } from "react" import { Computer } from "@bitcoin-computer/lib" import { initFlowbite } from "flowbite" +import { HiRefresh } from "react-icons/hi" import { useUtilsComponents } from "./UtilsContext" import { Modal } from "./Modal" import type { Chain, Network } from "./common/types" -import { HiRefresh } from "react-icons/hi" function isLoggedIn(): boolean { return !!localStorage.getItem("BIP_39_KEY") @@ -37,18 +37,18 @@ function getBip44Path({ purpose = 44, coinType = 2, account = 0 } = {}) { function loggedOutConfiguration() { return { - chain: process.env[`REACT_APP_CHAIN`] as Chain, - network: process.env[`REACT_APP_NETWORK`] as Network, - url: process.env[`REACT_APP_URL`] + chain: process.env.REACT_APP_CHAIN as Chain, + network: process.env.REACT_APP_NETWORK as Network, + url: process.env.REACT_APP_URL } } function loggedInConfiguration() { return { mnemonic: localStorage.getItem("BIP_39_KEY"), - chain: (localStorage.getItem("CHAIN") || process.env["REACT_APP_CHAIN"]) as Chain, - network: (localStorage.getItem("NETWORK") || process.env["REACT_APP_NETWORK"]) as Network, - url: localStorage.getItem("URL") || process.env["REACT_APP_URL"] + chain: (localStorage.getItem("CHAIN") || process.env.REACT_APP_CHAIN) as Chain, + network: (localStorage.getItem("NETWORK") || process.env.REACT_APP_NETWORK) as Network, + url: localStorage.getItem("URL") || process.env.REACT_APP_URL } } @@ -290,12 +290,12 @@ function LoginButton({ mnemonic, chain, network, path, url, urlInputRef }: any) function LoginForm() { const [mnemonic, setMnemonic] = useState(new Computer().getMnemonic()) const [chain, setChain] = useState( - process.env["REACT_APP_CHAIN"] as Chain | undefined + process.env.REACT_APP_CHAIN as Chain | undefined ) const [network, setNetwork] = useState( - process.env["REACT_APP_NETWORK"] as Network | undefined + process.env.REACT_APP_NETWORK as Network | undefined ) - const [url, _] = useState(process.env["REACT_APP_URL"]) + const [url] = useState(process.env.REACT_APP_URL) const urlInputRef = useRef(null) useEffect(() => { @@ -308,11 +308,11 @@ function LoginForm() {
- {!process.env["REACT_APP_CHAIN"] && } - {!process.env["REACT_APP_NETWORK"] && ( + {!process.env.REACT_APP_CHAIN && } + {!process.env.REACT_APP_NETWORK && ( )} - {!process.env["REACT_APP_URL"] && } + {!process.env.REACT_APP_URL && }
diff --git a/packages/components/src/Error404.tsx b/packages/components/src/Error404.tsx index cb7554af6..b3c063afa 100644 --- a/packages/components/src/Error404.tsx +++ b/packages/components/src/Error404.tsx @@ -1,5 +1,4 @@ -export const Error404 = ({ message }: { message?: string }) => { - +export const Error404 = ({ message: m }: { message?: string }) => { const Missing = () => (<>

404 @@ -18,7 +17,7 @@ export const Error404 = ({ message }: { message?: string }) => { ) - const Err = ({ message }: {message: string}) => (<> + const Err = ({ message }: { message: string }) => (<>

400

@@ -33,7 +32,7 @@ export const Error404 = ({ message }: { message?: string }) => { return (
- { message ? : } + { m ? : }
) diff --git a/packages/components/src/SmartObject.tsx b/packages/components/src/SmartObject.tsx index bf5846c3b..e2575490e 100644 --- a/packages/components/src/SmartObject.tsx +++ b/packages/components/src/SmartObject.tsx @@ -11,7 +11,7 @@ import { ComputerContext } from "./ComputerContext" const keywords = ["_id", "_rev", "_owners", "_root", "_amount"] const modalId = "smart-object-info-modal" -export const getFnParamNames = function (fn: string) { +export const getFnParamNames = (fn: string) => { const match = fn.toString().match(/\(.*?\)/) return match ? match[0].replace(/[()]/gi, "").replace(/\s/gi, "").split(",") : [] } @@ -41,7 +41,7 @@ const SmartObjectValues = ({ smartObject }: any) => { .map(([key, value], i) => (

{capitalizeFirstLetter(key)}

- +
))} diff --git a/packages/components/src/Transaction.tsx b/packages/components/src/Transaction.tsx index bf300da2b..ddf66ac61 100644 --- a/packages/components/src/Transaction.tsx +++ b/packages/components/src/Transaction.tsx @@ -54,6 +54,7 @@ function Component() { } catch (err) { if (err instanceof Error) { setTransition("") + // eslint-disable-next-line no-console console.log("Error parsing transaction", err.message) } } diff --git a/packages/components/src/Wallet.tsx b/packages/components/src/Wallet.tsx index 5777ad334..32f195075 100644 --- a/packages/components/src/Wallet.tsx +++ b/packages/components/src/Wallet.tsx @@ -1,11 +1,10 @@ -import { initFlowbite } from "flowbite" -import { Dispatch, useCallback, useContext, useEffect, useState } from "react" +import { useCallback, useContext, useEffect, useState } from "react" import { HiRefresh } from "react-icons/hi" +import { Computer } from "@bitcoin-computer/lib" import { Auth } from "./Auth" import { Drawer } from "./Drawer" -import { useUtilsComponents, UtilsContext } from "./UtilsContext" +import { UtilsContext } from "./UtilsContext" import { ComputerContext } from "./ComputerContext" -import { Computer } from "@bitcoin-computer/lib" const Balance = ({ computer, @@ -15,28 +14,22 @@ const Balance = ({ paymentModSpec: string | undefined }) => { const [balance, setBalance] = useState(0) - const [chain, setChain] = useState(localStorage.getItem("CHAIN") || "LTC") + const [, setChain] = useState(localStorage.getItem("CHAIN") || "LTC") const { showSnackBar, showLoader } = UtilsContext.useUtilsComponents() const refreshBalance = useCallback(async () => { try { showLoader(true) if (computer) { - const paymentRevs = paymentModSpec - ? await computer.query({ - publicKey: computer.getPublicKey(), - mod: paymentModSpec - }) - : [] - const payments = (await Promise.all(paymentRevs.map((rev) => computer.sync(rev)))) as any[] - let amountsInPaymentToken = 0 - - if (payments && payments.length) { - payments.forEach((pay) => { - amountsInPaymentToken += pay._amount - computer.getMinimumFees() - }) - } - let availableWalletBalance = await computer.getBalance() + const publicKey = computer.getPublicKey() + const mod = paymentModSpec + const paymentRevs = paymentModSpec ? await computer.query({ publicKey, mod }) : [] + const payments = (await Promise.all(paymentRevs.map((rev: string) => computer.sync(rev)))) as any[] + const amountsInPaymentToken = payments && payments.length + ? payments.reduce((total, pay) => total + (pay._amount - computer.getMinimumFees()), 0) + : 0 + + const availableWalletBalance = await computer.getBalance() setBalance(availableWalletBalance + amountsInPaymentToken) setChain(computer.getChain()) } @@ -47,23 +40,30 @@ const Balance = ({ } }, [computer]) + const fund = async () => { + await computer.faucet(1e8) + setBalance(await computer.getBalance()) + } + useEffect(() => { refreshBalance() }, []) return ( -
-
- Balance +
- -

- {balance / 1e8} {chain}{" "} -

+ className="w-4 h-4 ml-1 mb-1 inline cursor-pointer hover:text-slate-700 dark:hover:text-slate-100" + /> +
+
+ {computer.getNetwork()} +
+ {computer.getNetwork() === 'regtest' && } ) } @@ -80,56 +80,30 @@ const Address = ({ computer }: any) => ( const PublicKey = ({ computer }: any) => (
Public Key
-

+

{computer.getPublicKey()}

) const Mnemonic = ({ computer }: any) => { - const [showMnemonic, setShowMnemonic] = useState(false) - - const Heading = () =>
Mnemonic
- - if (showMnemonic) - return ( -
- -

- {computer.getMnemonic()} -

- + const [mnemonicShown, setMnemonicShown] = useState(false) + return
+
+ Mnemonic  -
- ) - return ( -
- - -
+ +

+ { mnemonicShown ? computer.getMnemonic() : '' } +

- ) } -const Path = ({ computer }: any) => ( -
-
Path
-

- {computer.getPath()} -

-
-) - const Url = ({ computer }: any) => (
Node Url
@@ -176,257 +150,19 @@ const LogOut = () => ( ) -function AmountInput({ - chain, - amount, - setAmount -}: { - chain: string - amount: string - setAmount: Dispatch -}) { - return ( - <> -
- -
- setAmount(e.target.value)} - placeholder={`1 ${chain}`} - className="block w-full p-2 text-gray-900 border border-gray-300 rounded-lg bg-gray-50 text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" - /> - - ) -} - -function AddressInput({ address, setAddress }: { address: string; setAddress: Dispatch }) { - return ( - <> -
- -
- setAddress(e.target.value)} - className="block w-full p-2 text-gray-900 border border-gray-300 rounded-lg bg-gray-50 text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" - /> - - ) -} - -function SendMoneyButton({ - computer, - amount, - address, - setAmount, - setAddress, - paymentModSpec -}: any) { - const { showSnackBar, showLoader } = useUtilsComponents() - - const send = async (e: React.MouseEvent) => { - e.preventDefault() - const TRANSACTION_FEE = computer.getMinimumFees() - try { - if (!Auth.isLoggedIn()) throw new Error("Please log in first.") - if (!address) { - showSnackBar("Please enter a valid address", false) - return - } - const floatAmount = Math.round(Number(amount)) - if (!floatAmount) { - showSnackBar("Please enter a valid amount", false) - return - } - - let availableWalletBalance = await computer.getBalance() - const requiredAmountToBeTransferred = floatAmount * 1e8 - if (requiredAmountToBeTransferred + TRANSACTION_FEE < availableWalletBalance) { - await computer.send(requiredAmountToBeTransferred, address) - } else { - const paymentRevs = paymentModSpec - ? await computer.query({ - publicKey: computer.getPublicKey(), - mod: paymentModSpec - }) - : [] - const payments = (await Promise.all( - paymentRevs.map((rev: string) => computer.sync(rev)) - )) as any[] // should import payment class - - let amountsInPaymentToken = 0 - - if (payments && payments.length) { - payments.forEach((pay) => { - amountsInPaymentToken += pay._amount - TRANSACTION_FEE - }) - } - - if ( - requiredAmountToBeTransferred + TRANSACTION_FEE > - availableWalletBalance + amountsInPaymentToken - ) { - showSnackBar(`Insufficient Balance.`, false) - setAmount("") - setAddress("") - return - } - - const sortedPayments = payments.slice().sort((a, b) => b._amount - a._amount) - const paymentsToBeWithdraw = [] - let newAvailableAmount = 0 - for (let i = 0; i < sortedPayments.length; i++) { - const pay = sortedPayments[i] - newAvailableAmount += pay._amount - TRANSACTION_FEE - paymentsToBeWithdraw.push(pay.setAmount(TRANSACTION_FEE)) - if ( - requiredAmountToBeTransferred + TRANSACTION_FEE < - availableWalletBalance + newAvailableAmount - ) { - break - } - } - - await Promise.all(paymentsToBeWithdraw) - await computer.send(requiredAmountToBeTransferred, address) - } - - showSnackBar(`${amount} ${computer.getChain()} trasferred successfully.`, true) - setAmount("") - setAddress("") - } catch (error) { - if (error instanceof Error) { - showSnackBar(error.message, false) - } - return - } - } - - return ( - <> - - - ) -} - -function SendMoneyForm({ - computer, - paymentModSpec -}: { - computer: any - paymentModSpec: string | undefined -}) { - const [address, setAddress] = useState("") - const [amount, setAmount] = useState("") - - useEffect(() => { - initFlowbite() - }, []) - - return ( - <> -
Transfer
-
-
-
- - -
-
-
-
- -
- - ) -} - -function FaucetForm({ computer }: { computer: Computer }) { - const [amount, setAmount] = useState("") - - useEffect(() => { - initFlowbite() - }, []) - - const { showLoader } = useUtilsComponents() - - return ( - <> -
Fund Your Wallet
-

- Click "Fund" to get 1 free regtest coin, then click on "reload" next to your balance. -

-
- -
- - ) -} - export function Wallet({ paymentModSpec }: { paymentModSpec?: string }) { const computer = useContext(ComputerContext) const Content = () => ( <> -

Wallet

+

Wallet

- -
- - - - {computer.getNetwork() === "regtest" && ( - <> -
- - - )} -
- + {!process.env['REACT_APP_CHAIN'] && } + {!process.env['REACT_APP_NETWORK'] && } + {!process.env['REACT_APP_URL'] && }
@@ -439,11 +175,9 @@ export const WalletComponents = { Balance, Address, PublicKey, - Path, Mnemonic, Chain, Network, Url, - SendMoneyForm, LogOut } diff --git a/packages/cra-template/public/index.html b/packages/cra-template/public/index.html index 01713aaec..c28291a93 100644 --- a/packages/cra-template/public/index.html +++ b/packages/cra-template/public/index.html @@ -26,7 +26,7 @@ --> React App - +
- TBC Explorer + Bitcoin Computer Explorer - +
diff --git a/packages/explorer/src/components/Navbar.tsx b/packages/explorer/src/components/Navbar.tsx index 762ac8cb8..3210b1074 100644 --- a/packages/explorer/src/components/Navbar.tsx +++ b/packages/explorer/src/components/Navbar.tsx @@ -56,7 +56,7 @@ export default function Navbar() { Bitcoin Computer Logo - TBC Explorer + Bitcoin Computer Explorer diff --git a/packages/explorer/src/components/playground/CreateNew.tsx b/packages/explorer/src/components/playground/CreateNew.tsx index bd77cc7b4..e78935174 100644 --- a/packages/explorer/src/components/playground/CreateNew.tsx +++ b/packages/explorer/src/components/playground/CreateNew.tsx @@ -148,11 +148,13 @@ const CreateNew = (props: { wrap="off" // Disable word wrapping > -
+
Arguments
+ +
{argumentsList.map( (argument: Argument, index) => !argument.hidden && ( -
+
+ + +
+ + +
+ diff --git a/packages/explorer/src/components/playground/DeployModule.tsx b/packages/explorer/src/components/playground/DeployModule.tsx index 3eb572ec3..9a1a14b28 100644 --- a/packages/explorer/src/components/playground/DeployModule.tsx +++ b/packages/explorer/src/components/playground/DeployModule.tsx @@ -53,10 +53,11 @@ const DeployModule = (props: { +
) } diff --git a/packages/explorer/src/components/playground/ExecuteExpression.tsx b/packages/explorer/src/components/playground/ExecuteExpression.tsx index 717040dfa..7a6fa9883 100644 --- a/packages/explorer/src/components/playground/ExecuteExpression.tsx +++ b/packages/explorer/src/components/playground/ExecuteExpression.tsx @@ -109,7 +109,10 @@ const ExecuteExpression = (props: { autoCorrect="off" // Disable auto correction wrap="off" // Disable word wrapping > -
+ +
Environment Variables
+ +
{expressionArgumentsList.map( (argument: ExpressionArgument, index) => !argument.hidden && ( @@ -140,18 +143,24 @@ const ExecuteExpression = (props: { ) )}
+ + +
+ +
+ diff --git a/packages/explorer/src/components/playground/Playground.tsx b/packages/explorer/src/components/playground/Playground.tsx index 22141b670..ed12f9cd1 100644 --- a/packages/explorer/src/components/playground/Playground.tsx +++ b/packages/explorer/src/components/playground/Playground.tsx @@ -27,9 +27,6 @@ const modalId = 'playground-info-modal' const Examples = ({ loadExamples, clearExamples }: { loadExamples: any; clearExamples: any }) => ( <> -
-

Load Examples

-
- - - ) -} - -export const Faucet = () => { - const [computer] = useState(Auth.getComputer()) - - return ( - <> - - - ) -} diff --git a/packages/wallet/src/components/Navbar.tsx b/packages/wallet/src/components/Navbar.tsx index 96e992681..ee2777c6a 100644 --- a/packages/wallet/src/components/Navbar.tsx +++ b/packages/wallet/src/components/Navbar.tsx @@ -43,7 +43,7 @@ export default function Navbar({ Bitcoin Computer - TBC Wallet + Bitcoin Computer Wallet }
) } @@ -138,32 +146,6 @@ export function SideBar() { Details - {computer.getNetwork() === "regtest" && ( -
  • - - - Faucet - -
  • - )} -