Skip to content

Commit 0ac9f93

Browse files
authored
Merge pull request #33 from magiclabs/rename-to-server-wallets
Rename to server wallets
2 parents 0f5f2b4 + 78c48a8 commit 0ac9f93

File tree

20 files changed

+152
-100
lines changed

20 files changed

+152
-100
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ Add the following environment variables to your `.env.local` file:
88
GOOGLE_CLIENT_ID=your-google-client-id
99
GOOGLE_CLIENT_SECRET=your-google-client-secret
1010
NEXT_PUBLIC_OIDC_PROVIDER_ID=your-magic-provider-id
11-
MAGIC_API_KEY=your-magic-secret-key
1211
NEXTAUTH_SECRET=your-next-auth-secret
12+
NEXT_PUBLIC_MAGIC_EMBEDDED_WALLET_KEY=your-embedded-wallet-publishable-api-key
13+
NEXT_PUBLIC_MAGIC_SERVER_WALLET_KEY=your-server-wallet-publishable-api-key
14+
SERVER_WALLET_SECRET_KEY=your-magic-server-wallet-secret-key
1315
```
1416

15-
Replace the values with your credentials from Google and GitHub developer consoles.
17+
Replace the values with your credentials from your Google and Magic developer dashboards.
1618

1719
## Getting Started
1820

Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import SessionProviderComponent from "../../../providers/SessionProvider";
4-
import { ApiWalletProvider } from "@/contexts/ApiWalletContext";
4+
import { ServerWalletProvider } from "@/contexts/ServerWalletContext";
55

66
export default function Layout({
77
children,
@@ -10,7 +10,7 @@ export default function Layout({
1010
}>) {
1111
return (
1212
<SessionProviderComponent>
13-
<ApiWalletProvider>{children}</ApiWalletProvider>
13+
<ServerWalletProvider>{children}</ServerWalletProvider>
1414
</SessionProviderComponent>
1515
);
1616
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { useEffect } from "react";
44
import { useRouter } from "next/navigation";
5-
import { useApiWallet } from "@/contexts/ApiWalletContext";
5+
import { useServerWallet } from "@/contexts/ServerWalletContext";
66
import { LoadingScreen } from "@/components/LoadingScreen";
77
import { Button } from "@/components/Button";
88
import { signIn } from "next-auth/react";
@@ -12,11 +12,11 @@ import { PageHeader } from "@/components/PageHeader";
1212

1313
export default function Home() {
1414
const router = useRouter();
15-
const { isAuthenticated, isLoading } = useApiWallet();
15+
const { isAuthenticated, isLoading } = useServerWallet();
1616

1717
useEffect(() => {
1818
if (isAuthenticated) {
19-
router.push("/api-wallet/wallet");
19+
router.push("/server-wallet/wallet");
2020
}
2121
}, [isAuthenticated, router]);
2222

@@ -33,9 +33,9 @@ export default function Home() {
3333
return (
3434
<div className="flex flex-col items-center gap-20 sm:pt-12">
3535
<PageHeader
36-
product="Express API Wallet"
36+
product="Server Wallet"
3737
title="Get Started"
38-
description="Connect your account to access your secure TEE wallet."
38+
description="Connect your account to access your secure TEE wallet via our Express API."
3939
/>
4040

4141
<Button onClick={() => signIn("google", { redirect: false })}>

src/app/(demo)/api-wallet/wallet/page.tsx renamed to src/app/(demo)/server-wallet/wallet/page.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
"use client";
22

3-
import { SolanaSignMethods } from "@/components/api-wallet/SolanaSignMethods";
4-
import { EVMSignMethods } from "@/components/api-wallet/EVMSignMethods";
5-
import { UserInfo } from "@/components/api-wallet/UserInfo";
6-
7-
import { useApiWallet } from "@/contexts/ApiWalletContext";
3+
import { SolanaSignMethods } from "@/components/server-wallet/SolanaSignMethods";
4+
import { EVMSignMethods } from "@/components/server-wallet/EVMSignMethods";
5+
import { UserInfo } from "@/components/server-wallet/UserInfo";
6+
import { useServerWallet } from "@/contexts/ServerWalletContext";
87
import { LoadingScreen } from "@/components/LoadingScreen";
98
import { PageHeader } from "@/components/PageHeader";
10-
import UserMethods from "@/components/api-wallet/UserMethods";
9+
import UserMethods from "@/components/server-wallet/UserMethods";
1110

12-
export default function ApiWalletPage() {
13-
const { selectedNetwork, isAuthenticated, isLoading } = useApiWallet();
11+
export default function ServerWalletPage() {
12+
const { selectedNetwork, isAuthenticated, isLoading } = useServerWallet();
1413

1514
if (isLoading) {
1615
return <LoadingScreen message="Checking authentication..." />;
@@ -24,7 +23,7 @@ export default function ApiWalletPage() {
2423
return (
2524
<div className="relative min-h-screen">
2625
<div className="relative z-10 flex flex-col items-center min-h-screen p-8 pt-0 sm:pt-12 pb-20 gap-2 sm:gap-16 sm:p-20">
27-
<PageHeader product="Express API Wallet" title="Connected" />
26+
<PageHeader product="Server Wallet" title="Connected" />
2827

2928
{/* Main Content */}
3029
<div className="flex flex-col lg:flex-row items-start gap-8 w-full max-w-7xl mt-16 sm:mt-8">

src/app/api/tee/wallet/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { getServerSession } from "next-auth";
22
import { TeeEndpoint } from "@/types/tee-types";
33
import { NextResponse } from "next/server";
44
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
5-
import { express } from "@/lib/api-wallet/express";
5+
import { express } from "@/lib/server-wallet/express";
66

77
export async function POST(req: Request) {
88
const session = await getServerSession(authOptions);

src/app/api/tee/wallet/sign/data/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { express } from "@/lib/api-wallet/express";
1+
import { express } from "@/lib/server-wallet/express";
22
import { TeeEndpoint } from "@/types/tee-types";
33
import { NextResponse } from "next/server";
44
import { getServerSession } from "next-auth";
@@ -20,7 +20,7 @@ export async function POST(req: Request) {
2020
method: "POST",
2121
body,
2222
});
23-
23+
2424
return NextResponse.json(res);
2525
} catch (error) {
2626
console.error("POST sign data error:", error);

src/app/api/tee/wallet/sign/message/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { express } from "@/lib/api-wallet/express";
1+
import { express } from "@/lib/server-wallet/express";
22
import { TeeEndpoint } from "@/types/tee-types";
33
import { NextResponse } from "next/server";
44
import { getServerSession } from "next-auth";

src/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function Home() {
1111
<p className="text-muted-foreground text-xl max-w-2xl text-center">
1212
Over 7 years of proven reliability and performance. Spin up wallets,
1313
trigger onchain actions, and stay compliant—all with one powerful,
14-
production-ready API or White-label Embedded Wallets.
14+
production-ready Server Wallet or Embedded Wallet.
1515
</p>
1616
</div>
1717

src/components/Header.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export const Header = () => {
2121

2222
const isEmbeddedWalletRoute =
2323
isHydrated && pathname?.startsWith("/embedded-wallet");
24-
const isApiWalletRoute = isHydrated && pathname?.startsWith("/api-wallet");
24+
const isServerWalletRoute =
25+
isHydrated && pathname?.startsWith("/server-wallet");
2526

2627
// Dynamic docs configuration based on pathname
2728
const getDocsConfig = () => {
@@ -31,10 +32,10 @@ export const Header = () => {
3132
url: "https://docs.magic.link/embedded-wallets/introduction",
3233
};
3334
}
34-
if (isApiWalletRoute) {
35+
if (isServerWalletRoute) {
3536
return {
36-
text: "View Express Docs",
37-
url: "https://docs.magic.link/api-wallets/express-api/overview",
37+
text: "View Server Wallet Docs",
38+
url: "https://docs.magic.link/server-wallets/express-api/overview",
3839
};
3940
}
4041
// Default Magic docs
@@ -66,7 +67,7 @@ export const Header = () => {
6667
</a>
6768

6869
<div className="flex flex-col md:flex-row items-center gap-4 z-10">
69-
{isApiWalletRoute && (
70+
{isServerWalletRoute && (
7071
<Link
7172
href="/embedded-wallet"
7273
className="flex-shrink-0 w-full md:w-auto"
@@ -85,16 +86,19 @@ export const Header = () => {
8586
</Link>
8687
)}
8788
{isEmbeddedWalletRoute && (
88-
<Link href="/api-wallet" className="flex-shrink-0 w-full md:w-auto">
89+
<Link
90+
href="/server-wallet"
91+
className="flex-shrink-0 w-full md:w-auto"
92+
>
8993
<Button variant="secondary" onClick={() => {}} fullWidth glow>
9094
<div className="flex items-center gap-2">
9195
<Image
9296
src={iconExpress}
93-
alt="Express API Wallet"
97+
alt="Server Wallet"
9498
width={24}
9599
height={24}
96100
/>
97-
Try API Wallet
101+
Try Server Wallet
98102
</div>
99103
</Button>
100104
</Link>

src/components/ProductButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const productMap = {
1818
highlightColor: "#7D51FF",
1919
},
2020
express: {
21-
href: "/api-wallet",
22-
label: "Express API Wallet",
21+
href: "/server-wallet",
22+
label: "Server Wallet",
2323
icon: iconExpress,
2424
highlightColor: "#90F0D3",
2525
},

0 commit comments

Comments
 (0)