routes.tsx raw
1 import { Navigate, RouteObject } from "react-router";
2 import AppLayout from "src/components/layouts/AppLayout";
3 import SettingsLayout from "src/components/layouts/SettingsLayout";
4 import WalletLayout from "src/components/layouts/WalletLayout";
5 import TwoColumnFullScreenLayout from "src/components/layouts/TwoColumnFullScreenLayout";
6 import { DefaultRedirect } from "src/components/redirects/DefaultRedirect";
7 import { HomeRedirect } from "src/components/redirects/HomeRedirect";
8 import { SetupRedirect } from "src/components/redirects/SetupRedirect";
9 import { StartRedirect } from "src/components/redirects/StartRedirect";
10 import { ConnectAlbyAccount } from "src/screens/ConnectAlbyAccount";
11 import { CreateNodeMigrationFileSuccess } from "src/screens/CreateNodeMigrationFileSuccess";
12 import Home from "src/screens/Home";
13 import { Intro } from "src/screens/Intro";
14 import { MigrateNode } from "src/screens/MigrateNode";
15 import NotFound from "src/screens/NotFound";
16 import Start from "src/screens/Start";
17 import Unlock from "src/screens/Unlock";
18 import { Welcome } from "src/screens/Welcome";
19 import AlbyAuthRedirect from "src/screens/alby/AlbyAuthRedirect";
20 import { AI } from "src/screens/ai/AI";
21 import { Cards } from "src/screens/cards/Cards";
22 import { AlbyEarn } from "src/screens/alby/AlbyEarn";
23 import SupportAlby from "src/screens/alby/SupportAlby";
24 import AppDetails from "src/screens/apps/AppDetails";
25 import { AppsCleanup } from "src/screens/apps/AppsCleanup";
26 import { Connections } from "src/screens/apps/Connections";
27 import NewApp from "src/screens/apps/NewApp";
28 import { AppStoreDetail } from "src/screens/appstore/AppStoreDetail";
29 import Channels from "src/screens/channels/Channels";
30 import { CurrentChannelOrder } from "src/screens/channels/CurrentChannelOrder";
31 import IncreaseIncomingCapacity from "src/screens/channels/IncreaseIncomingCapacity";
32 import IncreaseOutgoingCapacity from "src/screens/channels/IncreaseOutgoingCapacity";
33 import { AutoChannel } from "src/screens/channels/auto/AutoChannel";
34 import { OpenedAutoChannel } from "src/screens/channels/auto/OpenedAutoChannel";
35 import { OpeningAutoChannel } from "src/screens/channels/auto/OpeningAutoChannel";
36 import { FirstChannel } from "src/screens/channels/first/FirstChannel";
37 import { OpenedFirstChannel } from "src/screens/channels/first/OpenedFirstChannel";
38 import { OpeningFirstChannel } from "src/screens/channels/first/OpeningFirstChannel";
39 import { AlbyCliSkill } from "src/screens/internal-apps/AlbyCliSkill";
40 import { BuzzPay } from "src/screens/internal-apps/BuzzPay";
41 import { LightningMessageboard } from "src/screens/internal-apps/LightningMessageboard";
42 import { SimpleBoost } from "src/screens/internal-apps/SimpleBoost";
43 import { Tictactoe } from "src/screens/internal-apps/Tictactoe";
44 import { ZapPlanner } from "src/screens/internal-apps/ZapPlanner";
45 import BuyBitcoin from "src/screens/onchain/BuyBitcoin";
46 import DepositBitcoin from "src/screens/onchain/DepositBitcoin";
47 import ConnectPeer from "src/screens/peers/ConnectPeer";
48 import Peers from "src/screens/peers/Peers";
49 import { About } from "src/screens/settings/About";
50 import { AlbyAccount } from "src/screens/settings/AlbyAccount";
51 import { AutoUnlock } from "src/screens/settings/AutoUnlock";
52 import { NodeSettings } from "src/screens/settings/NodeSettings";
53 import Backup from "src/screens/settings/Backup";
54 import { ChangeUnlockPassword } from "src/screens/settings/ChangeUnlockPassword";
55 import DebugTools from "src/screens/settings/DebugTools";
56 import DeveloperSettings from "src/screens/settings/DeveloperSettings";
57 import Settings from "src/screens/settings/Settings";
58
59 import { ImportMnemonic } from "src/screens/setup/ImportMnemonic";
60 import { RestoreNode } from "src/screens/setup/RestoreNode";
61 import { SetupAdvanced } from "src/screens/setup/SetupAdvanced";
62 import { SetupFinish } from "src/screens/setup/SetupFinish";
63 import { SetupNode } from "src/screens/setup/SetupNode";
64 import { SetupPassword } from "src/screens/setup/SetupPassword";
65 import { SetupSecurity } from "src/screens/setup/SetupSecurity";
66 import { BarkForm } from "src/screens/setup/node/BarkForm";
67 import { CLNForm } from "src/screens/setup/node/CLNForm";
68 import { CashuForm } from "src/screens/setup/node/CashuForm";
69 import { LDKForm } from "src/screens/setup/node/LDKForm";
70 import { LNDForm } from "src/screens/setup/node/LNDForm";
71 import { PhoenixdForm } from "src/screens/setup/node/PhoenixdForm";
72 import { PresetNodeForm } from "src/screens/setup/node/PresetNodeForm";
73 import { NewSubwallet } from "src/screens/subwallets/NewSubwallet";
74 import { SubwalletCreated } from "src/screens/subwallets/SubwalletCreated";
75 import { SubwalletList } from "src/screens/subwallets/SubwalletList";
76 import Lightning from "src/screens/wallet/Lightning";
77 import Onchain from "src/screens/wallet/Onchain";
78 import NodeAlias from "src/screens/wallet/NodeAlias";
79 import Receive from "src/screens/wallet/Receive";
80 import Send from "src/screens/wallet/Send";
81 import SignMessage from "src/screens/wallet/SignMessage";
82 import WithdrawOnchainFunds from "src/screens/wallet/WithdrawOnchainFunds";
83 import ReceiveInvoice from "src/screens/wallet/receive/ReceiveInvoice";
84 import ReceiveOffer from "src/screens/wallet/receive/ReceiveOffer";
85 import ReceiveOnchain from "src/screens/wallet/receive/ReceiveOnchain";
86 import ConfirmPayment from "src/screens/wallet/send/ConfirmPayment";
87 import LnurlPay from "src/screens/wallet/send/LnurlPay";
88 import OnchainSend from "src/screens/wallet/send/Onchain";
89 import OnchainSuccess from "src/screens/wallet/send/OnchainSuccess";
90 import PaymentSuccess from "src/screens/wallet/send/PaymentSuccess";
91 import ZeroAmount from "src/screens/wallet/send/ZeroAmount";
92 import Swap from "src/screens/wallet/swap";
93 import AutoSwap from "src/screens/wallet/swap/AutoSwap";
94 import SwapInStatus from "src/screens/wallet/swap/SwapInStatus";
95 import SwapOutStatus from "src/screens/wallet/swap/SwapOutStatus";
96
97 const routes: RouteObject[] = [
98 {
99 path: "/",
100 element: <AppLayout />,
101 handle: { crumb: () => "Home" },
102 children: [
103 {
104 index: true,
105 element: <HomeRedirect />,
106 },
107 {
108 path: "home",
109 element: <DefaultRedirect />,
110 handle: { crumb: () => "Dashboard" },
111 children: [
112 {
113 index: true,
114 element: <Home />,
115 },
116 ],
117 },
118 {
119 path: "wallet",
120 element: <DefaultRedirect />,
121 handle: { crumb: () => "Wallet" },
122 children: [
123 {
124 element: <WalletLayout />,
125 children: [
126 {
127 index: true,
128 element: <Lightning />,
129 },
130 {
131 path: "onchain",
132 element: <Onchain />,
133 },
134 ],
135 },
136 {
137 path: "swap",
138 handle: { crumb: () => "Swap" },
139 children: [
140 {
141 index: true,
142 element: <Swap />,
143 },
144 {
145 path: "out/status/:swapId",
146 element: <SwapOutStatus />,
147 },
148 {
149 path: "in/status/:swapId",
150 element: <SwapInStatus />,
151 },
152 {
153 path: "auto",
154 element: <AutoSwap />,
155 },
156 ],
157 },
158 {
159 path: "receive",
160 handle: { crumb: () => "Receive" },
161 children: [
162 {
163 index: true,
164 element: <Receive />,
165 },
166 {
167 handle: { crumb: () => "Receive On-chain" },
168 path: "onchain",
169 element: <ReceiveOnchain />,
170 },
171 {
172 handle: { crumb: () => "Invoice" },
173 path: "invoice",
174 element: <ReceiveInvoice />,
175 },
176 {
177 handle: { crumb: () => "BOLT-12 Offer" },
178 path: "offer",
179 element: <ReceiveOffer />,
180 },
181 ],
182 },
183 {
184 path: "send",
185 handle: { crumb: () => "Send" },
186 children: [
187 {
188 index: true,
189 element: <Send />,
190 },
191 {
192 path: "onchain",
193 element: <OnchainSend />,
194 },
195 {
196 path: "lnurl-pay",
197 element: <LnurlPay />,
198 },
199 {
200 path: "0-amount",
201 element: <ZeroAmount />,
202 },
203 {
204 path: "confirm-payment",
205 element: <ConfirmPayment />,
206 },
207 {
208 path: "onchain-success",
209 element: <OnchainSuccess />,
210 },
211 {
212 path: "success",
213 element: <PaymentSuccess />,
214 },
215 ],
216 },
217 {
218 path: "sign-message",
219 element: <SignMessage />,
220 handle: { crumb: () => "Sign Message" },
221 },
222 {
223 path: "node-alias",
224 element: <NodeAlias />,
225 handle: { crumb: () => "Node Alias" },
226 },
227 {
228 path: "withdraw",
229 element: <WithdrawOnchainFunds />,
230 handle: { crumb: () => "Withdraw On-Chain Balance" },
231 },
232 ],
233 },
234 {
235 path: "settings",
236 element: <DefaultRedirect />,
237 handle: { crumb: () => "Settings" },
238 children: [
239 {
240 path: "",
241 element: <SettingsLayout />,
242 children: [
243 {
244 index: true,
245 element: <Settings />,
246 },
247 {
248 path: "about",
249 element: <About />,
250 handle: { crumb: () => "About" },
251 },
252 {
253 path: "auto-unlock",
254 element: <AutoUnlock />,
255 handle: { crumb: () => "Auto Unlock" },
256 },
257 {
258 path: "node",
259 element: <NodeSettings />,
260 handle: { crumb: () => "Node" },
261 },
262 {
263 path: "change-unlock-password",
264 element: <ChangeUnlockPassword />,
265 handle: { crumb: () => "Unlock Password" },
266 },
267 {
268 path: "backup",
269 element: <Backup />,
270 handle: { crumb: () => "Backup" },
271 },
272 {
273 path: "node-migrate",
274 element: <MigrateNode />,
275 },
276 {
277 path: "alby-account",
278 element: <AlbyAccount />,
279 },
280 {
281 path: "developer",
282 element: <DeveloperSettings />,
283 },
284 {
285 path: "debug-tools",
286 element: <DebugTools />,
287 },
288 ],
289 },
290 ],
291 },
292 {
293 path: "apps",
294 element: <DefaultRedirect />,
295 handle: { crumb: () => "Connections" },
296 children: [
297 {
298 index: true,
299 element: <Connections />,
300 },
301 {
302 path: ":id",
303 element: <AppDetails />,
304 },
305 {
306 path: "new",
307 element: <NewApp />,
308 handle: { crumb: () => "New App" },
309 },
310 {
311 path: "cleanup",
312 element: <AppsCleanup />,
313 },
314 ],
315 },
316 {
317 path: "sub-wallets",
318 element: <DefaultRedirect />,
319 handle: { crumb: () => "Sub-wallets" },
320
321 children: [
322 {
323 index: true,
324 element: <SubwalletList />,
325 },
326 {
327 path: "new",
328 element: <NewSubwallet />,
329 },
330 {
331 path: "created",
332 element: <SubwalletCreated />,
333 },
334 ],
335 },
336 {
337 path: "internal-apps",
338 element: <DefaultRedirect />,
339 handle: { crumb: () => "Connections" },
340 children: [
341 {
342 path: "buzzpay",
343 element: <BuzzPay />,
344 },
345 {
346 path: "simpleboost",
347 element: <SimpleBoost />,
348 },
349 {
350 path: "lightning-messageboard",
351 element: <LightningMessageboard />,
352 },
353 {
354 path: "zapplanner",
355 element: <ZapPlanner />,
356 },
357 {
358 path: "alby-cli-skill",
359 element: <AlbyCliSkill />,
360 },
361 {
362 path: "tictactoe",
363 element: <Tictactoe />,
364 },
365 ],
366 },
367 {
368 path: "appstore",
369 element: <DefaultRedirect />,
370 handle: { crumb: () => "App Store" },
371 children: [
372 {
373 path: ":appStoreId",
374 element: <AppStoreDetail />,
375 },
376 ],
377 },
378 {
379 path: "channels",
380 element: <DefaultRedirect />,
381 handle: { crumb: () => "Node" },
382 children: [
383 {
384 index: true,
385 element: <Channels />,
386 },
387 {
388 path: "first",
389 handle: { crumb: () => "Your First Channel" },
390 children: [
391 {
392 index: true,
393 element: <FirstChannel />,
394 },
395 {
396 path: "opening",
397 element: <OpeningFirstChannel />,
398 },
399 {
400 path: "opened",
401 element: <OpenedFirstChannel />,
402 },
403 ],
404 },
405 {
406 path: "auto",
407 handle: { crumb: () => "New Channel" },
408 children: [
409 {
410 index: true,
411 element: <AutoChannel />,
412 },
413 {
414 path: "opening",
415 element: <OpeningAutoChannel />,
416 },
417 {
418 path: "opened",
419 element: <OpenedAutoChannel />,
420 },
421 ],
422 },
423 {
424 path: "outgoing",
425 element: <IncreaseOutgoingCapacity />,
426 handle: { crumb: () => "Open Channel with On-Chain" },
427 },
428 {
429 path: "incoming",
430 element: <IncreaseIncomingCapacity />,
431 handle: { crumb: () => "Open Channel with Lightning" },
432 },
433 {
434 path: "order",
435 element: <CurrentChannelOrder />,
436 handle: { crumb: () => "Current Order" },
437 },
438 {
439 path: "onchain/buy-bitcoin",
440 element: <BuyBitcoin />,
441 handle: { crumb: () => "Buy Bitcoin" },
442 },
443 {
444 path: "onchain/deposit-bitcoin",
445 element: <DepositBitcoin />,
446 handle: { crumb: () => "Deposit Bitcoin" },
447 },
448 ],
449 },
450 {
451 path: "peers",
452 element: <DefaultRedirect />,
453 handle: { crumb: () => "Peers" },
454 children: [
455 {
456 index: true,
457 element: <Peers />,
458 },
459 {
460 path: "new",
461 element: <ConnectPeer />,
462 handle: { crumb: () => "Connect Peer" },
463 },
464 ],
465 },
466 {
467 path: "support-alby",
468 element: <SupportAlby />,
469 },
470 {
471 path: "earn",
472 element: <AlbyEarn />,
473 handle: { crumb: () => "Earn" },
474 },
475 {
476 path: "ai",
477 element: <AI />,
478 handle: { crumb: () => "AI & Agents" },
479 },
480 {
481 path: "cards",
482 element: <DefaultRedirect />,
483 handle: { crumb: () => "Cards" },
484 children: [{ index: true, element: <Cards /> }],
485 },
486 ],
487 },
488 {
489 element: <TwoColumnFullScreenLayout />,
490 children: [
491 {
492 path: "start",
493 element: (
494 <StartRedirect>
495 <Start />
496 </StartRedirect>
497 ),
498 },
499 {
500 path: "alby/account",
501 element: <ConnectAlbyAccount />,
502 },
503 {
504 path: "alby/auth",
505 element: <AlbyAuthRedirect />,
506 },
507 {
508 path: "unlock",
509 element: <Unlock />,
510 },
511 {
512 path: "welcome",
513 element: <Welcome />,
514 },
515 {
516 path: "setup",
517 element: <SetupRedirect />,
518 children: [
519 {
520 element: <Navigate to="password" replace />,
521 },
522 {
523 path: "alby",
524 element: <ConnectAlbyAccount connectUrl="/setup/auth" />,
525 },
526 {
527 path: "auth",
528 element: <AlbyAuthRedirect />,
529 },
530 {
531 path: "password",
532 element: <SetupPassword />,
533 },
534 {
535 path: "security",
536 element: <SetupSecurity />,
537 },
538 {
539 path: "node",
540 children: [
541 {
542 index: true,
543 element: <SetupNode />,
544 },
545 {
546 path: "cashu",
547 element: <CashuForm />,
548 },
549 {
550 path: "phoenix",
551 element: <PhoenixdForm />,
552 },
553 {
554 path: "lnd",
555 element: <LNDForm />,
556 },
557 {
558 path: "ldk",
559 element: <LDKForm />,
560 },
561 {
562 path: "cln",
563 element: <CLNForm />,
564 },
565 {
566 path: "bark",
567 element: <BarkForm />,
568 },
569 {
570 path: "preset",
571 element: <PresetNodeForm />,
572 },
573 ],
574 },
575 {
576 path: "advanced",
577 element: <SetupAdvanced />,
578 },
579 {
580 path: "import-mnemonic",
581 element: <ImportMnemonic />,
582 },
583 {
584 path: "node-restore",
585 element: <RestoreNode />,
586 },
587 {
588 path: "finish",
589 element: <SetupFinish />,
590 },
591 ],
592 },
593 ],
594 },
595 {
596 path: "create-node-migration-file-success",
597 element: <CreateNodeMigrationFileSuccess />,
598 },
599 {
600 path: "intro",
601 element: <Intro />,
602 },
603 {
604 path: "/*",
605 element: <NotFound />,
606 },
607 ];
608
609 export default routes;
610