Skip to content

Commit 750e0b8

Browse files
Merge pull request #197 from Neko-Protocol/feat/mainnet-pools
feat: pools and mobile ready
2 parents 2f49e0b + dec84aa commit 750e0b8

37 files changed

Lines changed: 6975 additions & 2699 deletions

File tree

apps/web-app/.env.example

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Stellar Network Configuration
2-
NEXT_PUBLIC_STELLAR_NETWORK=TESTNET
3-
NEXT_PUBLIC_STELLAR_NETWORK_PASSPHRASE="Test SDF Network ; September 2015"
4-
NEXT_PUBLIC_STELLAR_RPC_URL=https://soroban-testnet.stellar.org
5-
NEXT_PUBLIC_STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org
1+
# Stellar Network Configuration (mainnet value must be PUBLIC, not MAINNET)
2+
NEXT_PUBLIC_STELLAR_NETWORK=PUBLIC
3+
NEXT_PUBLIC_STELLAR_NETWORK_PASSPHRASE="Public Global Stellar Network ; September 2015"
4+
NEXT_PUBLIC_STELLAR_RPC_URL=https://rpc.stellar.org
5+
NEXT_PUBLIC_STELLAR_HORIZON_URL=https://horizon.stellar.org
66

77
# SoroSwap ApiKey
88
NEXT_PUBLIC_SOROSWAP_API_KEY=
@@ -28,3 +28,5 @@ ALFREDPAY_API_KEY=
2828
ALFREDPAY_API_SECRET=
2929
ALFREDPAY_BASE_URL=https://api-service-co.alfredpay.app/api/v1/third-party-service/penny
3030
ALFREDPAY_WEBHOOK_SECRET=
31+
32+
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=

apps/web-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"dependencies": {
1212
"@blend-capital/blend-sdk": "^3.2.2",
13-
"@creit.tech/stellar-wallets-kit": "^1.0.0",
13+
"@creit.tech/stellar-wallets-kit": "^2.1.0",
1414
"@emotion/react": "^11.11.0",
1515
"@emotion/styled": "^11.11.0",
1616
"@hookform/resolvers": "^5.2.2",
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
import type { Metadata } from "next";
2-
import Borrow from "@/features/borrowing/components/pages/Borrow";
3-
4-
export const metadata: Metadata = {
5-
title: "Borrowing | Neko Protocol",
6-
description: "Borrow assets against your collateral in Neko Protocol.",
7-
};
1+
import { redirect } from "next/navigation";
82

93
export default function BorrowingPage() {
10-
return <Borrow />;
4+
redirect("/pools");
115
}

apps/web-app/src/app/(app)/layout.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
import { ReactNode } from "react";
22
import { Sidebar } from "@/components/navigation/Sidebar";
33
import { MobileHeader } from "@/components/navigation/MobileHeader";
4+
import { WalletAutoConnect } from "@/components/WalletAutoConnect";
45

56
export default function DashboardLayout({ children }: { children: ReactNode }) {
67
return (
78
<div className="flex min-h-screen">
9+
<WalletAutoConnect />
810
<Sidebar />
911
<MobileHeader />
1012

1113
{}
12-
<main className="pt-20 lg:pt-0 lg:ml-[270px] flex min-h-screen min-w-0 flex-1 flex-col items-center overflow-x-hidden text-white w-full">
14+
<main
15+
className="pt-16 lg:pt-0 lg:ml-[270px] flex min-h-screen min-w-0 flex-1 flex-col items-center overflow-x-hidden text-white w-full"
16+
style={{ paddingBottom: "max(1rem, env(safe-area-inset-bottom))" }}
17+
>
1318
{children}
1419
</main>
1520
</div>
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
import type { Metadata } from "next";
2-
import Lend from "@/features/lending/components/pages/Lend";
3-
4-
export const metadata: Metadata = {
5-
title: "Lending | Neko Protocol",
6-
description: "Supply assets to Neko lending pools and earn interest.",
7-
};
1+
import { redirect } from "next/navigation";
82

93
export default function LendingPage() {
10-
return <Lend />;
4+
redirect("/pools");
115
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { Metadata } from "next";
2+
import PoolDetail from "@/features/pools/components/pages/PoolDetail";
3+
4+
export const metadata: Metadata = {
5+
title: "Pool Details | Neko Protocol",
6+
description: "View pool details, deposit, withdraw, and manage positions.",
7+
};
8+
9+
export default function PoolDetailPage({
10+
params,
11+
}: {
12+
params: Promise<{ contractid: string }>;
13+
}) {
14+
return <PoolDetail params={params} />;
15+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import type { Metadata } from "next";
2+
import UnifiedPoolsPage from "@/features/pools/components/pages/UnifiedPoolsPage";
3+
4+
export const metadata: Metadata = {
5+
title: "Pools | Neko Protocol",
6+
description:
7+
"Supply liquidity, borrow assets, and manage your positions in Neko Protocol pools.",
8+
};
9+
10+
export default function PoolsPage() {
11+
return <UnifiedPoolsPage />;
12+
}

apps/web-app/src/app/layout.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ import { Providers } from "./providers";
55

66
export const metadata: Metadata = {
77
title: "Neko Protocol",
8-
description: "Real-World Asset DeFi Protocol",
8+
description: "All-in-one platform for RWAs on Stellar",
9+
viewport: {
10+
width: "device-width",
11+
initialScale: 1,
12+
viewportFit: "cover",
13+
},
914
};
1015

1116
export default function RootLayout({
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
"use client";
2+
3+
import { useEffect, useRef } from "react";
4+
import { ModuleType } from "@creit.tech/stellar-wallets-kit/types";
5+
import { getStellarWalletKit } from "@/lib/helpers/stellar/wallet";
6+
import { useStellarWalletStore } from "@/stores/stellarWalletStore";
7+
8+
/**
9+
* Silently auto-connects when the dApp is opened inside a wallet's in-app
10+
* browser (e.g. Lobstr, xBull mobile). The wallet module's `isPlatformWrapper`
11+
* flag tells the kit it is wrapping the page, so we can skip the modal.
12+
*
13+
* Bridge wallets (WalletConnect) are explicitly excluded: their `getAddress()`
14+
* triggers a QR-code / pairing flow when no session exists, which would pop up
15+
* uninvited. Only HOT_WALLET modules (Lobstr, xBull, Freighter in-app browsers)
16+
* can be safely auto-connected.
17+
*
18+
* Runs once on mount. No-ops if the user is already connected or no
19+
* platform-wrapper wallet is detected.
20+
*/
21+
export function WalletAutoConnect() {
22+
const { address, setWallet } = useStellarWalletStore();
23+
const attempted = useRef(false);
24+
25+
useEffect(() => {
26+
if (address || attempted.current) return;
27+
attempted.current = true;
28+
29+
void (async () => {
30+
try {
31+
const Kit = await getStellarWalletKit();
32+
const wallets = await Kit.refreshSupportedWallets();
33+
const platformWallet = wallets.find(
34+
(w) =>
35+
w.isPlatformWrapper &&
36+
w.isAvailable &&
37+
w.type !== ModuleType.BRIDGE_WALLET
38+
);
39+
if (!platformWallet) return;
40+
Kit.setWallet(platformWallet.id);
41+
const { address: walletAddress } = await Kit.fetchAddress();
42+
if (walletAddress) {
43+
setWallet({
44+
address: walletAddress,
45+
walletName: platformWallet.name,
46+
});
47+
}
48+
} catch {
49+
// Silently fail — user can always connect manually via the button.
50+
}
51+
})();
52+
}, [address, setWallet]);
53+
54+
return null;
55+
}

apps/web-app/src/components/navigation/sidebarConfig.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@ import {
22
LayoutDashboard,
33
ArrowLeftRight,
44
Landmark,
5-
TrendingUp,
65
BarChart2,
76
Settings,
87
Shield,
98
Banknote,
109
Vault,
10+
TrendingUp,
1111
} from "lucide-react";
1212

1313
export const NAV_ITEMS = [
1414
{ label: "Dashboard", href: "/dashboard", icon: LayoutDashboard },
1515
{ label: "Discover", href: "/discover", icon: BarChart2 },
16+
{ label: "Pools", href: "/pools", icon: Landmark },
1617
{ label: "Swap", href: "/swap", icon: ArrowLeftRight },
1718
{ label: "Borrow", href: "/borrowing", icon: Landmark },
1819
{ label: "Lend", href: "/lending", icon: TrendingUp },

0 commit comments

Comments
 (0)