diff --git a/apps/dashboard/redirects.js b/apps/dashboard/redirects.js
index ac6848e9913..bf5fab03dba 100644
--- a/apps/dashboard/redirects.js
+++ b/apps/dashboard/redirects.js
@@ -115,6 +115,16 @@ const projectPageRedirects = [
permanent: false,
source: `${projectRoute}/connect/analytics`,
},
+ {
+ destination: `${projectRoute}/gateway/indexer/:path*`,
+ permanent: false,
+ source: `${projectRoute}/insight/:path*`,
+ },
+ {
+ destination: `${projectRoute}/gateway/rpc/:path*`,
+ permanent: false,
+ source: `${projectRoute}/rpc/:path*`,
+ },
];
const teamPageRedirects = [
diff --git a/apps/dashboard/src/app/(app)/(dashboard)/(chain)/components/server/products.ts b/apps/dashboard/src/app/(app)/(dashboard)/(chain)/components/server/products.ts
index b840871b1e6..b425f8219d1 100644
--- a/apps/dashboard/src/app/(app)/(dashboard)/(chain)/components/server/products.ts
+++ b/apps/dashboard/src/app/(app)/(dashboard)/(chain)/components/server/products.ts
@@ -1,7 +1,6 @@
import { ConnectSDKIcon } from "@/icons/ConnectSDKIcon";
import { ContractIcon } from "@/icons/ContractIcon";
import { EngineIcon } from "@/icons/EngineIcon";
-import { InsightIcon } from "@/icons/InsightIcon";
import { NebulaIcon } from "@/icons/NebulaIcon";
import { PayIcon } from "@/icons/PayIcon";
import { RPCIcon } from "@/icons/RPCIcon";
@@ -51,13 +50,6 @@ export const products = [
link: "https://portal.thirdweb.com/payments",
name: "Payments",
},
- {
- description: "Query and analyze blockchain data",
- icon: InsightIcon,
- id: "insight",
- link: "https://thirdweb.com/insight",
- name: "Insight",
- },
{
description: "The most powerful AI for interacting with the blockchain",
icon: NebulaIcon,
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
index f780934040f..b1f51f3857f 100644
--- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
+++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx
@@ -13,7 +13,6 @@ import { TypeScriptIcon } from "@/icons/brand-icons/TypeScriptIcon";
import { UnityIcon } from "@/icons/brand-icons/UnityIcon";
import { UnrealIcon } from "@/icons/brand-icons/UnrealIcon";
import { ContractIcon } from "@/icons/ContractIcon";
-import { InsightIcon } from "@/icons/InsightIcon";
import { PayIcon } from "@/icons/PayIcon";
import { ClientIDSection } from "./ClientIDSection";
import { SecretKeySection } from "./SecretKeySection";
@@ -111,13 +110,6 @@ function ProductsSection(props: { teamSlug: string; projectSlug: string }) {
icon: ContractIcon,
title: "Contracts",
},
- {
- description:
- "Add indexing capabilities to retrieve real-time onchain data",
- href: `/team/${props.teamSlug}/${props.projectSlug}/insight`,
- icon: InsightIcon,
- title: "Insight",
- },
{
description:
"Bridge, swap, and purchase cryptocurrencies with any fiat options or tokens via cross-chain routing",
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectSidebarLayout.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectSidebarLayout.tsx
index 8fdf7600334..f92b3b78fe7 100644
--- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectSidebarLayout.tsx
+++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectSidebarLayout.tsx
@@ -14,8 +14,6 @@ import {
type ShadcnSidebarLink,
} from "@/components/blocks/full-width-sidebar-layout";
import { BridgeIcon } from "@/icons/BridgeIcon";
-import { ContractIcon } from "@/icons/ContractIcon";
-import { InsightIcon } from "@/icons/InsightIcon";
import { NebulaIcon } from "@/icons/NebulaIcon";
import { PayIcon } from "@/icons/PayIcon";
import { TokenIcon } from "@/icons/TokenIcon";
@@ -24,6 +22,7 @@ import { WalletProductIcon } from "@/icons/WalletProductIcon";
export function ProjectSidebarLayout(props: {
layoutPath: string;
children: React.ReactNode;
+ hasEngines: boolean;
}) {
const contentSidebarLinks = [
{
@@ -36,91 +35,79 @@ export function ProjectSidebarLayout(props: {
separator: true,
},
{
- group: "Build",
+ subMenu: {
+ icon: WalletProductIcon,
+ label: "Wallets",
+ },
links: [
{
- subMenu: {
- icon: WalletProductIcon,
- label: "Wallets",
- },
- links: [
- {
- href: `${props.layoutPath}/wallets/user-wallets`,
- label: "User Wallets",
- },
- {
- href: `${props.layoutPath}/wallets/server-wallets`,
- label: "Server Wallets",
- },
- {
- href: `${props.layoutPath}/wallets/sponsored-gas`,
- label: "Gas Sponsorship",
- },
- ],
+ href: `${props.layoutPath}/wallets/user-wallets`,
+ label: "User Wallets",
},
{
- href: `${props.layoutPath}/contracts`,
- icon: ContractIcon,
- label: "Contracts",
+ href: `${props.layoutPath}/wallets/server-wallets`,
+ label: "Server Wallets",
},
{
- href: `${props.layoutPath}/ai`,
- icon: NebulaIcon,
- label: "AI",
+ href: `${props.layoutPath}/wallets/sponsored-gas`,
+ label: "Gas Sponsorship",
},
],
},
{
- separator: true,
+ href: `${props.layoutPath}/x402`,
+ icon: PayIcon,
+ label: (
+
+ x402 New
+
+ ),
},
{
- group: "Monetize",
- links: [
- {
- href: `${props.layoutPath}/x402`,
- icon: PayIcon,
- label: (
-
- x402 New
-
- ),
- },
- {
- href: `${props.layoutPath}/bridge`,
- icon: BridgeIcon,
- label: "Bridge",
- },
- {
- href: `${props.layoutPath}/tokens`,
- icon: TokenIcon,
- label: "Tokens",
- },
- ],
+ href: `${props.layoutPath}/bridge`,
+ icon: BridgeIcon,
+ label: "Bridge",
},
{
- separator: true,
+ href: `${props.layoutPath}/tokens`,
+ icon: TokenIcon,
+ label: "Tokens",
},
{
- group: "Scale",
+ href: `${props.layoutPath}/ai`,
+ icon: NebulaIcon,
+ label: "AI",
+ },
+ {
+ subMenu: {
+ icon: RssIcon,
+ label: "Gateway",
+ },
links: [
{
- href: `${props.layoutPath}/insight`,
- icon: InsightIcon,
- label: "Insight",
+ href: `${props.layoutPath}/gateway/rpc`,
+ label: "RPC",
},
{
- href: `${props.layoutPath}/rpc`,
- icon: RssIcon,
- label: "RPC",
+ href: `${props.layoutPath}/gateway/indexer`,
+ label: "Indexer",
},
- // linkely want to move this to `team` level eventually
{
- href: `${props.layoutPath}/engine`,
- icon: DatabaseIcon,
- label: "Engine",
+ href: `${props.layoutPath}/contracts`,
+ label: "Contracts",
},
],
},
+ // only show engine link if there the user already has an engine instance
+ ...(props.hasEngines
+ ? [
+ {
+ href: `${props.layoutPath}/engine`,
+ icon: DatabaseIcon,
+ label: "Engine",
+ },
+ ]
+ : []),
] satisfies ShadcnSidebarLink[];
const footerSidebarLinks = [
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(general)/overview/engine-instances-table.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(general)/overview/engine-instances-table.tsx
index a6d0f62a5dd..72fa51c3da0 100644
--- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(general)/overview/engine-instances-table.tsx
+++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(general)/overview/engine-instances-table.tsx
@@ -6,15 +6,10 @@ import {
ArrowRightIcon,
CheckIcon,
CircleAlertIcon,
- DatabaseIcon,
- InfinityIcon,
InfoIcon,
MoreHorizontalIcon,
PencilIcon,
- PlusIcon,
- ShieldCheckIcon,
Trash2Icon,
- WalletIcon,
} from "lucide-react";
import Link from "next/link";
import { useState } from "react";
@@ -22,7 +17,6 @@ import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import type { Team } from "@/api/team/get-team";
-import { CheckoutButton } from "@/components/billing/billing";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Badge, type BadgeProps } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
@@ -31,20 +25,10 @@ import {
Dialog,
DialogContent,
DialogDescription,
- DialogFooter,
DialogHeader,
DialogTitle,
- DialogTrigger,
} from "@/components/ui/dialog";
-import {
- Drawer,
- DrawerContent,
- DrawerDescription,
- DrawerFooter,
- DrawerHeader,
- DrawerTitle,
- DrawerTrigger,
-} from "@/components/ui/drawer";
+
import {
DropdownMenu,
DropdownMenuContent,
@@ -72,7 +56,6 @@ import {
TableRow,
} from "@/components/ui/table";
import { Textarea } from "@/components/ui/textarea";
-import { useIsMobile } from "@/hooks/use-mobile";
import {
type DeleteCloudHostedEngineParams,
deleteCloudHostedEngine,
@@ -84,7 +67,6 @@ import {
} from "@/hooks/useEngine";
import { EngineIcon } from "@/icons/EngineIcon";
import { useDashboardRouter } from "@/lib/DashboardRouter";
-import { cn } from "@/lib/utils";
type DeletedCloudHostedEngine = (
params: DeleteCloudHostedEngineParams,
@@ -126,96 +108,6 @@ export function EngineInstancesTable(props: {
);
}
-export function DedicatedEngineSubscriptionButton(props: { team: Team }) {
- const [open, setOpen] = useState(false);
- const isMobile = useIsMobile();
-
- const trigger = (
-
- );
-
- const title = (
-
-
-
-
-
Dedicated Engine
-
- );
-
- const content = (
-
-
- -
-
- Isolated environment
-
- -
-
- EOA or Smart Wallets
-
- -
-
- No transaction usage limits or charges
-
-
-
- );
-
- if (isMobile) {
- return (
-
- {trigger}
-
-
- {title}
-
- Instantly deploy a dedicated engine instance for your team.
-
-
- {content}
-
-
- Deploy Now · $299 / month
-
-
-
-
- );
- }
-
- return (
-
- );
-}
-
export function EngineInstancesTableUI(props: {
instances: EngineInstance[];
engineLinkPrefix: string;
@@ -896,10 +788,6 @@ function DeleteEngineSubscriptionModalContent(props: {
}
function EmptyEngineState(props: { team: Team; projectSlug: string }) {
- const [selectedTab, setSelectedTab] = useState<
- "self-hosted" | "cloud-hosted"
- >("cloud-hosted");
-
return (
@@ -908,75 +796,34 @@ function EmptyEngineState(props: { team: Team; projectSlug: string }) {
No Engine instances found
- Get started with one of the options below to add your first engine
- instance.
+ Import an Engine instance running on your own infrastructure.
-
-
-
+
+
+
Self-Hosted Engine
+
+ Add engine instance running on your own infrastructure.
+
+
+
-
-
-
- {selectedTab === "self-hosted" && (
-
-
- Self-Hosted Engine
-
-
- Add engine instance running on your own infrastructure.
-
-
-
-
-
-
- )}
-
- {selectedTab === "cloud-hosted" && (
-
-
Managed Engine
-
- Deploy a managed engine instance to your team.
We recommend
- using Engine Cloud in most cases.
-
-
-
-
-
-
- )}
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(general)/page.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(general)/page.tsx
index 32d15755850..a2cc5ad4105 100644
--- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(general)/page.tsx
+++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(general)/page.tsx
@@ -7,7 +7,6 @@ import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
import { loginRedirect } from "@/utils/redirects";
import { getEngineInstances } from "../_utils/getEngineInstances";
import { ImportEngineButton } from "./import/import-engine-dialog";
-import { DedicatedEngineSubscriptionButton } from "./overview/engine-instances-table";
import { EngineInstancesList } from "./overview/engine-list";
export default async function Page(props: {
@@ -61,9 +60,6 @@ export default async function Page(props: {
title: "Engine",
description: "Manage your deployed Engine instances.",
actions: {
- primary: {
- component:
,
- },
secondary: {
component: (
+
+
Indexer
+
+
+
+ Indexed data is automatically used when using the thirdweb SDKs and
+ API where appropriate.
+
+
+ Once you have integrated thirdweb into your application you will start
+ seeing usage patterns here.
+
+
+
+
+
+
+
+
+
+
+ Waiting for integration
+
+
+
+ );
+}
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/gateway/indexer/page.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/gateway/indexer/page.tsx
new file mode 100644
index 00000000000..bffd843eb03
--- /dev/null
+++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/gateway/indexer/page.tsx
@@ -0,0 +1,84 @@
+import { redirect } from "next/navigation";
+import { ResponsiveSearchParamsProvider } from "responsive-rsc";
+import { getAuthToken } from "@/api/auth-token";
+import { getProject } from "@/api/project/projects";
+import { ProjectPage } from "@/components/blocks/project-page/project-page";
+import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
+import { InsightIcon } from "@/icons/InsightIcon";
+import { getFiltersFromSearchParams } from "@/lib/time";
+import { loginRedirect } from "@/utils/redirects";
+import { InsightAnalytics } from "./components/InsightAnalytics";
+
+export default async function Page(props: {
+ params: Promise<{
+ team_slug: string;
+ project_slug: string;
+ }>;
+ searchParams: Promise<{
+ from?: string | undefined | string[];
+ to?: string | undefined | string[];
+ interval?: string | undefined | string[];
+ }>;
+}) {
+ const [params, authToken] = await Promise.all([props.params, getAuthToken()]);
+
+ const project = await getProject(params.team_slug, params.project_slug);
+
+ if (!authToken) {
+ loginRedirect(
+ `/team/${params.team_slug}/${params.project_slug}/gateway/indexer`,
+ );
+ }
+
+ if (!project) {
+ redirect(`/team/${params.team_slug}`);
+ }
+
+ const searchParams = await props.searchParams;
+ const { range, interval } = getFiltersFromSearchParams({
+ defaultRange: "last-30",
+ from: searchParams.from,
+ interval: searchParams.interval,
+ to: searchParams.to,
+ });
+
+ const client = getClientThirdwebClient({
+ jwt: authToken,
+ teamId: project.teamId,
+ });
+
+ return (
+
+
+
+
+
+ );
+}
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/rpc/components/MethodsTable.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/gateway/rpc/components/MethodsTable.tsx
similarity index 98%
rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/rpc/components/MethodsTable.tsx
rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/gateway/rpc/components/MethodsTable.tsx
index ce5700566c9..f366032eb1e 100644
--- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/rpc/components/MethodsTable.tsx
+++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/gateway/rpc/components/MethodsTable.tsx
@@ -15,7 +15,7 @@ import {
TableHeader,
TableRow,
} from "@/components/ui/table";
-import { CardHeading } from "../../payments/components/common";
+import { CardHeading } from "../../../payments/components/common";
export function TopRPCMethodsTable(props: {
data: RpcMethodStats[];
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/rpc/components/RequestsGraph.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/gateway/rpc/components/RequestsGraph.tsx
similarity index 100%
rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/rpc/components/RequestsGraph.tsx
rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/gateway/rpc/components/RequestsGraph.tsx
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/rpc/components/RpcAnalytics.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/gateway/rpc/components/RpcAnalytics.tsx
similarity index 100%
rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/rpc/components/RpcAnalytics.tsx
rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/gateway/rpc/components/RpcAnalytics.tsx
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/rpc/components/RpcAnalyticsFilter.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/gateway/rpc/components/RpcAnalyticsFilter.tsx
similarity index 100%
rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/rpc/components/RpcAnalyticsFilter.tsx
rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/gateway/rpc/components/RpcAnalyticsFilter.tsx
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/rpc/components/RpcFtux.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/gateway/rpc/components/RpcFtux.tsx
similarity index 92%
rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/rpc/components/RpcFtux.tsx
rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/gateway/rpc/components/RpcFtux.tsx
index 90d87f6bba7..71ccef30982 100644
--- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/rpc/components/RpcFtux.tsx
+++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/gateway/rpc/components/RpcFtux.tsx
@@ -1,7 +1,7 @@
import { CodeServer } from "@/components/ui/code/code.server";
import { isProd } from "@/constants/env-utils";
-import { ClientIDSection } from "../../components/ProjectFTUX/ClientIDSection";
-import { WaitingForIntegrationCard } from "../../components/WaitingForIntegrationCard/WaitingForIntegrationCard";
+import { ClientIDSection } from "../../../components/ProjectFTUX/ClientIDSection";
+import { WaitingForIntegrationCard } from "../../../components/WaitingForIntegrationCard/WaitingForIntegrationCard";
export function RpcFTUX(props: { clientId: string }) {
return (
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/rpc/page.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/gateway/rpc/page.tsx
similarity index 96%
rename from apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/rpc/page.tsx
rename to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/gateway/rpc/page.tsx
index cd5b226f1d0..fde7787fc1c 100644
--- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/rpc/page.tsx
+++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/gateway/rpc/page.tsx
@@ -25,7 +25,9 @@ export default async function Page(props: {
const project = await getProject(params.team_slug, params.project_slug);
if (!authToken) {
- loginRedirect(`/team/${params.team_slug}/${params.project_slug}/rpc`);
+ loginRedirect(
+ `/team/${params.team_slug}/${params.project_slug}/gateway/rpc`,
+ );
}
if (!project) {
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/insight/components/insight-ftux.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/insight/components/insight-ftux.tsx
deleted file mode 100644
index cc188f5d8a3..00000000000
--- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/insight/components/insight-ftux.tsx
+++ /dev/null
@@ -1,74 +0,0 @@
-import { CodeServer } from "@/components/ui/code/code.server";
-import { isProd } from "@/constants/env-utils";
-import { ClientIDSection } from "../../components/ProjectFTUX/ClientIDSection";
-import { WaitingForIntegrationCard } from "../../components/WaitingForIntegrationCard/WaitingForIntegrationCard";
-
-export function InsightFTUX(props: { clientId: string }) {
- return (
-
- ),
- label: "JavaScript",
- },
- {
- code: (
-
- ),
- label: "Python",
- },
- {
- code: (
-
- ),
- label: "Curl",
- },
- ]}
- ctas={[
- {
- href: "https://portal.thirdweb.com/insight",
- label: "View Docs",
- },
- ]}
- title="Integrate Insight"
- >
-
-
-
- );
-}
-
-const twDomain = isProd ? "thirdweb" : "thirdweb-dev";
-
-const jsCode = (clientId: string) => `\
-// Example: Get latest 10 transactions on Ethereum
-const res = await fetch("https://insight.${twDomain}.com/v1/transactions?chain=1&limit=10&clientId=${clientId}");
-const data = await res.json();
-`;
-
-const curlCode = (clientId: string) => `\
-# Example: Get latest 10 transactions on Ethereum
-curl -X GET "https://insight.${twDomain}.com/v1/transactions?chain=1&limit=10&clientId=${clientId}"
-`;
-
-const pythonCode = (clientId: string) => `\
-# Example: Get latest 10 transactions on Ethereum
-import requests
-
-response = requests.get("https://insight.${twDomain}.com/v1/transactions?chain=1&limit=10&clientId=${clientId}")
-data = response.json()
-`;
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/insight/page.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/insight/page.tsx
deleted file mode 100644
index fed3865eefe..00000000000
--- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/insight/page.tsx
+++ /dev/null
@@ -1,113 +0,0 @@
-import { ArrowUpRightIcon } from "lucide-react";
-import { redirect } from "next/navigation";
-import { ResponsiveSearchParamsProvider } from "responsive-rsc";
-import { getAuthToken } from "@/api/auth-token";
-import { getProject } from "@/api/project/projects";
-import { ProjectPage } from "@/components/blocks/project-page/project-page";
-import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
-import { InsightIcon } from "@/icons/InsightIcon";
-import { getFiltersFromSearchParams } from "@/lib/time";
-import { loginRedirect } from "@/utils/redirects";
-import { InsightAnalytics } from "./components/InsightAnalytics";
-
-export default async function Page(props: {
- params: Promise<{
- team_slug: string;
- project_slug: string;
- }>;
- searchParams: Promise<{
- from?: string | undefined | string[];
- to?: string | undefined | string[];
- interval?: string | undefined | string[];
- }>;
-}) {
- const [params, authToken] = await Promise.all([props.params, getAuthToken()]);
-
- const project = await getProject(params.team_slug, params.project_slug);
-
- if (!authToken) {
- loginRedirect(`/team/${params.team_slug}/${params.project_slug}/insight`);
- }
-
- if (!project) {
- redirect(`/team/${params.team_slug}`);
- }
-
- const searchParams = await props.searchParams;
- const { range, interval } = getFiltersFromSearchParams({
- defaultRange: "last-30",
- from: searchParams.from,
- interval: searchParams.interval,
- to: searchParams.to,
- });
-
- const client = getClientThirdwebClient({
- jwt: authToken,
- teamId: project.teamId,
- });
-
- return (
-
-
-
-
-
-
-
-
-
-
-
- Get Started with Insight
-
-
- A cross-chain API for historic blockchain data.
-
-
-
- Learn More
-
-
-
-
-
-
-
- );
-}
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/layout.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/layout.tsx
index 7f1fb8d3665..3ab4fc8cbc5 100644
--- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/layout.tsx
+++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/layout.tsx
@@ -12,6 +12,7 @@ import { TeamHeaderLoggedIn } from "../../../components/TeamHeader/team-header-l
import { StaffModeNotice } from "../../(team)/_components/StaffModeNotice";
import { ProjectSidebarLayout } from "./components/ProjectSidebarLayout";
import { SaveLastUsedProject } from "./components/SaveLastUsedProject";
+import { getEngineInstances } from "./engine/_utils/getEngineInstances";
export default async function ProjectLayout(props: {
children: React.ReactNode;
@@ -20,15 +21,34 @@ export default async function ProjectLayout(props: {
}) {
const params = await props.params;
- const [accountAddress, teams, account, authToken, team, project] =
- await Promise.all([
- getAuthTokenWalletAddress(),
- getTeams(),
- getValidAccount(`/team/${params.team_slug}/${params.project_slug}`),
- getAuthToken(),
- getTeamBySlug(params.team_slug),
- getProject(params.team_slug, params.project_slug),
- ]);
+ const [
+ accountAddress,
+ teams,
+ account,
+ authToken,
+ team,
+ project,
+ hasLegacyDedicatedEngines,
+ ] = await Promise.all([
+ getAuthTokenWalletAddress(),
+ getTeams(),
+ getValidAccount(`/team/${params.team_slug}/${params.project_slug}`),
+ getAuthToken(),
+ getTeamBySlug(params.team_slug),
+ getProject(params.team_slug, params.project_slug),
+ (async () => {
+ const authToken = await getAuthToken();
+ if (!authToken) {
+ return false;
+ }
+ const instances = await getEngineInstances({
+ authToken,
+ teamIdOrSlug: params.team_slug,
+ });
+ // if there are any engine instances, return true, otherwise false
+ return !!instances?.data?.length;
+ })(),
+ ]);
if (!teams || !accountAddress || !authToken) {
redirect("/login");
@@ -73,7 +93,10 @@ export default async function ProjectLayout(props: {
teamsAndProjects={teamsAndProjects}
/>
-
+
{props.children}