mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2025-12-22 08:44:26 +01:00
real address for tap-the-faucet
This commit is contained in:
12
.env
12
.env
@@ -1,3 +1,11 @@
|
|||||||
VITE_NETWORK="signet"
|
# LOCALHOST REGTEST
|
||||||
|
|
||||||
|
VITE_NETWORK="regtest"
|
||||||
VITE_PROXY="wss://p.mutinywallet.com"
|
VITE_PROXY="wss://p.mutinywallet.com"
|
||||||
VITE_ESPLORA="https://mutinynet.com/api"
|
VITE_ESPLORA="http://localhost:3003"
|
||||||
|
|
||||||
|
#SIGNET
|
||||||
|
|
||||||
|
# VITE_NETWORK="signet"
|
||||||
|
# VITE_PROXY="wss://p.mutinywallet.com"
|
||||||
|
# VITE_ESPLORA="https://mutinynet.com/api"
|
||||||
@@ -2,12 +2,10 @@ import logo from '~/assets/icons/mutiny-logo.svg';
|
|||||||
import BalanceBox from "~/components/BalanceBox";
|
import BalanceBox from "~/components/BalanceBox";
|
||||||
import SafeArea from "~/components/SafeArea";
|
import SafeArea from "~/components/SafeArea";
|
||||||
import NavBar from "~/components/NavBar";
|
import NavBar from "~/components/NavBar";
|
||||||
import Card from "~/components/Card";
|
|
||||||
import { ButtonLink } from "~/components/Button";
|
|
||||||
import PeerConnectModal from "~/components/PeerConnectModal";
|
|
||||||
|
|
||||||
// TODO: use this reload prompt for real
|
// TODO: use this reload prompt for real
|
||||||
import ReloadPrompt from "~/components/Reload";
|
import ReloadPrompt from "~/components/Reload";
|
||||||
|
import KitchenSink from './KitchenSink';
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
return (
|
return (
|
||||||
@@ -18,10 +16,7 @@ export default function App() {
|
|||||||
</header>
|
</header>
|
||||||
<BalanceBox />
|
<BalanceBox />
|
||||||
<ReloadPrompt />
|
<ReloadPrompt />
|
||||||
<Card title="Kitchen Sink">
|
<KitchenSink />
|
||||||
<PeerConnectModal />
|
|
||||||
<ButtonLink target="_blank" rel="noopener noreferrer" href="https://faucet.mutinynet.com/?address=abc123">Tap the Faucet</ButtonLink>
|
|
||||||
</Card>
|
|
||||||
{/* safety div */}
|
{/* safety div */}
|
||||||
<div class="h-32" />
|
<div class="h-32" />
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
29
src/components/KitchenSink.tsx
Normal file
29
src/components/KitchenSink.tsx
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import { useMegaStore } from "~/state/megaStore";
|
||||||
|
import { ButtonLink } from "./Button";
|
||||||
|
import Card from "./Card";
|
||||||
|
import PeerConnectModal from "./PeerConnectModal";
|
||||||
|
import { createResource } from "solid-js";
|
||||||
|
|
||||||
|
export default function KitchenSink() {
|
||||||
|
const [state, _] = useMegaStore()
|
||||||
|
|
||||||
|
// TODO: would be nice if this was just newest unused address
|
||||||
|
const getNewAddress = async () => {
|
||||||
|
if (state.node_manager) {
|
||||||
|
console.log("Getting new address");
|
||||||
|
const address = await state.node_manager?.get_new_address();
|
||||||
|
return address
|
||||||
|
} else {
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const [address] = createResource(getNewAddress);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card title="Kitchen Sink">
|
||||||
|
<PeerConnectModal />
|
||||||
|
<ButtonLink target="_blank" rel="noopener noreferrer" href={`https://faucet.mutinynet.com/?address=${address()}`}>Tap the Faucet</ButtonLink>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user