Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
69a33a7
[TOOL-3337] Dashboard: Add Transactions pages in project layout
MananTank Apr 3, 2025
9861512
add vault-sdk package
d4mr Apr 8, 2025
9a8f2df
add server wallet table
joaquim-verges Apr 8, 2025
a98ef8d
update service utils types
joaquim-verges Apr 9, 2025
ad16030
Vault Service Account init + Create Vault EOA
d4mr Apr 9, 2025
1fbe3ca
UI polish
joaquim-verges Apr 9, 2025
8f56fbd
tooltips
joaquim-verges Apr 9, 2025
19a60db
rename
joaquim-verges Apr 9, 2025
801ef34
added access token flow
joaquim-verges Apr 9, 2025
80ad75e
add send transaction button
joaquim-verges Apr 9, 2025
9c8bc94
fix project update
joaquim-verges Apr 9, 2025
d5a55e6
tabIndex
joaquim-verges Apr 9, 2025
515234e
hide admin key section if no key present
joaquim-verges Apr 10, 2025
fedc697
transaction querying
d4mr Apr 10, 2025
9ec83a7
Merge branch 'tool-3337' of github.com:thirdweb-dev/js into tool-3337
d4mr Apr 10, 2025
c98aeae
uncomment conditional service account initialisation
d4mr Apr 10, 2025
2c1853f
transaction chart
joaquim-verges Apr 10, 2025
70ffb53
empty state
joaquim-verges Apr 10, 2025
fb8686b
handle uninitialised service account state for analytics
d4mr Apr 10, 2025
0191aa0
update API reference, and test-transaction
d4mr Apr 12, 2025
fce49a1
show smart account address
joaquim-verges Apr 14, 2025
412b4ba
add summary analytics
d4mr Apr 14, 2025
f94dba3
start renaming to vault
joaquim-verges Apr 18, 2025
f6eb80e
access token managment
joaquim-verges Apr 18, 2025
e4725bb
rotate admin button
joaquim-verges Apr 18, 2025
f866ad3
add scalar react component
joaquim-verges Apr 18, 2025
9ce9bc8
updated vault-sdk
d4mr Apr 21, 2025
8e08edf
default sign structured policy + list real access tokens
d4mr Apr 21, 2025
8d37481
fix export for new vault SDK methods
d4mr Apr 21, 2025
f6b05c2
fix import
joaquim-verges Apr 21, 2025
e84ccc4
fix typo
d4mr Apr 21, 2025
d94bac5
fix more typos
d4mr Apr 22, 2025
a397a03
add base server url
joaquim-verges Apr 22, 2025
ed4bc80
fix readme
joaquim-verges Apr 22, 2025
3969172
rename transactions tab to engine
joaquim-verges Apr 22, 2025
62a5b59
add test transaction component
joaquim-verges Apr 22, 2025
71a9431
lint
joaquim-verges Apr 22, 2025
2ad7e7c
fix build
joaquim-verges Apr 22, 2025
ad0bbd6
access token management
joaquim-verges Apr 22, 2025
9426108
handle access keys
joaquim-verges Apr 22, 2025
69247b0
fix z-index
joaquim-verges Apr 22, 2025
01c1008
refactor
joaquim-verges Apr 23, 2025
2da3008
invalidate query
joaquim-verges Apr 23, 2025
038884f
fix table icons
joaquim-verges Apr 23, 2025
5476c4a
refactor
joaquim-verges Apr 23, 2025
5c82927
more refactors
joaquim-verges Apr 23, 2025
4c5ac1f
basic tx detail view
joaquim-verges Apr 23, 2025
6d532ad
fix build
joaquim-verges Apr 23, 2025
8a2e605
update example and test transaction
d4mr Apr 23, 2025
56c6240
fix SSR
joaquim-verges Apr 23, 2025
6b65ea2
rebased
joaquim-verges Apr 23, 2025
e0a4dcd
build
joaquim-verges Apr 23, 2025
f69e692
lint
joaquim-verges Apr 23, 2025
192744e
beta tag
joaquim-verges Apr 24, 2025
b604820
add vault tab
joaquim-verges Apr 24, 2025
bdb4e53
lockfiles
joaquim-verges Apr 24, 2025
edbe4f6
update vault sdk for read access token policy
d4mr Apr 28, 2025
4f46cf1
update default management token policies
d4mr Apr 28, 2025
53b2d7f
masked access token
d4mr Apr 28, 2025
b6d5eb2
handle rotation codes internally
joaquim-verges Apr 28, 2025
3725074
list tokens UI
joaquim-verges Apr 29, 2025
6d481e7
dashboard auth for test
d4mr Apr 29, 2025
ba64760
add legacy badges and upsells
joaquim-verges Apr 29, 2025
76ce72c
label for server wallets
joaquim-verges Apr 29, 2025
cd568da
add diff lang examples
joaquim-verges Apr 29, 2025
6aaee1a
cleanup
joaquim-verges Apr 29, 2025
32f0dab
FTUX
joaquim-verges Apr 29, 2025
3f988f9
lint
joaquim-verges Apr 29, 2025
368c57d
misc
joaquim-verges Apr 29, 2025
19a0c14
show access token for FTUX flow
d4mr Apr 29, 2025
d9082d5
Merge remote-tracking branch 'origin/main' into tool-3337
joaquim-verges Apr 30, 2025
b20e941
banner update
joaquim-verges Apr 30, 2025
8ea8f66
addressed feedback
joaquim-verges Apr 30, 2025
00576f4
polish
joaquim-verges Apr 30, 2025
de2a454
polish
joaquim-verges Apr 30, 2025
0494a5c
render full chain in network selector
joaquim-verges Apr 30, 2025
7e00c49
lint
joaquim-verges Apr 30, 2025
462e44f
[Dashboard] Refactor team engines UI (#6892)
joaquim-verges Apr 30, 2025
bb08e7b
fix links
joaquim-verges May 1, 2025
9d6e1d9
basic tx detail UI
joaquim-verges May 1, 2025
248816e
lint
joaquim-verges May 1, 2025
537d3ab
add isRotated field to access token data
d4mr May 2, 2025
3c33120
fix type
d4mr May 2, 2025
e8a8c13
fix more types
d4mr May 2, 2025
7acf778
remove log
joaquim-verges May 2, 2025
44d7f6e
fix types
joaquim-verges May 2, 2025
634ab5d
cache SA, filter rotated access tokens
joaquim-verges May 2, 2025
824afaa
sdk support
joaquim-verges May 4, 2025
40670bb
add sdk example
joaquim-verges May 4, 2025
5846922
update routes
joaquim-verges May 4, 2025
d3c5ea4
new autogen api
joaquim-verges May 5, 2025
1c09239
add v1 prefix to all routes
joaquim-verges May 5, 2025
bd4f199
knip
joaquim-verges May 5, 2025
7254b05
sdk example
joaquim-verges May 5, 2025
1c2bc57
remove from server wallets page
joaquim-verges May 5, 2025
9e5d9c0
add tracking, fix cache 404
joaquim-verges May 5, 2025
7e59935
add vault portal links
joaquim-verges May 6, 2025
844c80c
fix details page
joaquim-verges May 6, 2025
f2d6360
add enqueue and status API
joaquim-verges May 6, 2025
49d315c
update code snippet
joaquim-verges May 6, 2025
1ffe89b
Merge remote-tracking branch 'origin/main' into tool-3337
joaquim-verges May 6, 2025
3ee95db
separate admin key / access token flow in FTUX
joaquim-verges May 6, 2025
398e3ae
fix build
joaquim-verges May 7, 2025
63e4f2f
Merge remote-tracking branch 'origin/main' into tool-3337
joaquim-verges May 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/big-cases-wish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@thirdweb-dev/vault-sdk": patch
---

Introducing vault sdk
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ packages/*/typedoc/*
storybook-static
.aider*

tsconfig.tsbuildinfo
tsconfig.tsbuildinfo
.cursor
6 changes: 5 additions & 1 deletion apps/dashboard/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,8 @@ ANALYTICS_SERVICE_URL=""
NEXT_PUBLIC_NEBULA_URL=""

# required for billing parts of the dashboard (team -> settings -> billing / invoices)
STRIPE_SECRET_KEY=""
STRIPE_SECRET_KEY=""

# required for server wallet management
NEXT_PUBLIC_THIRDWEB_VAULT_URL=""
NEXT_PUBLIC_ENGINE_CLOUD_URL=""
1 change: 1 addition & 0 deletions apps/dashboard/knip.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"ignoreDependencies": [
"@storybook/blocks",
"@thirdweb-dev/service-utils",
"@thirdweb-dev/vault-sdk",
"@types/color",
"fast-xml-parser"
]
Expand Down
2 changes: 2 additions & 0 deletions apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@
"@radix-ui/react-slot": "^1.2.0",
"@radix-ui/react-switch": "^1.2.2",
"@radix-ui/react-tooltip": "1.2.3",
"@scalar/api-reference-react": "^0.6.19",
"@sentry/nextjs": "9.13.0",
"@shazow/whatsabi": "0.21.0",
"@tanstack/react-query": "5.74.4",
"@tanstack/react-table": "^8.21.3",
"@thirdweb-dev/service-utils": "workspace:*",
"@thirdweb-dev/vault-sdk": "workspace:*",
"@vercel/functions": "2.0.0",
"@vercel/og": "^0.6.8",
"abitype": "1.0.8",
Expand Down
6 changes: 5 additions & 1 deletion apps/dashboard/src/@/actions/proxies.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use server";

import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
import { API_SERVER_URL } from "../constants/env";
import { API_SERVER_URL, THIRDWEB_ENGINE_CLOUD_URL } from "../constants/env";

type ProxyActionParams = {
pathname: string;
Expand Down Expand Up @@ -79,6 +79,10 @@ export async function apiServerProxy<T>(params: ProxyActionParams) {
return proxy<T>(API_SERVER_URL, params);
}

export async function engineCloudProxy<T>(params: ProxyActionParams) {
return proxy<T>(THIRDWEB_ENGINE_CLOUD_URL, params);
}

export async function payServerProxy<T>(params: ProxyActionParams) {
return proxy<T>(
process.env.NEXT_PUBLIC_PAY_URL
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/@/components/blocks/SidebarLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export function FullWidthSidebarLayout(props: {
links={[...contentSidebarLinks, ...(footerSidebarLinks || [])]}
/>

<main className="z-0 flex min-w-0 grow flex-col max-sm:w-full">
<main className="flex min-w-0 grow flex-col max-sm:w-full">
{children}
</main>
<AppFooter containerClassName="max-w-7xl" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ export const SelectWithSearch = React.forwardRef<
selectedOption && "text-foreground",
)}
>
{selectedOption?.label || placeholder}
{renderOption && selectedOption
? renderOption(selectedOption)
: selectedOption?.label || placeholder}
</span>
<ChevronDownIcon className="size-4 cursor-pointer text-muted-foreground" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/@/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const buttonVariants = cva(
link: "text-primary underline-offset-4 hover:underline text-semibold",
pink: "border border-nebula-pink-foreground !text-nebula-pink-foreground bg-[hsl(var(--nebula-pink-foreground)/5%)] hover:bg-nebula-pink-foreground/10 dark:!text-foreground dark:bg-nebula-pink-foreground/10 dark:hover:bg-nebula-pink-foreground/20",
upsell:
"bg-gradient-to-r from-purple-500 to-pink-500 text-white hover:from-purple-600 hover:to-pink-600 shadow-lg hover:shadow-xl transform hover:-translate-y-0.5 transition-all duration-200",
"bg-green-600 text-white hover:bg-green-700 shadow-lg hover:shadow-xl transform hover:-translate-y-0.5 transition-all duration-200",
},
size: {
default: "h-10 px-4 py-2",
Expand Down
6 changes: 3 additions & 3 deletions apps/dashboard/src/@/components/ui/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Button } from "./button";
import { ToolTipLabel } from "./tooltip";

export type TabLink = {
name: string;
name: React.ReactNode;
href: string;
isActive: boolean;
isDisabled?: boolean;
Expand Down Expand Up @@ -43,7 +43,7 @@ export function TabLinks(props: {
return (
<Button
asChild
key={tab.name}
key={tab.href}
disabled={tab.isDisabled}
variant="ghost"
>
Expand Down Expand Up @@ -206,7 +206,7 @@ function useUnderline<El extends HTMLElement>() {

export function TabPathLinks(props: {
links: {
name: string;
name: React.ReactNode;
path: string;
exactMatch?: boolean;
isDisabled?: boolean;
Expand Down
6 changes: 6 additions & 0 deletions apps/dashboard/src/@/constants/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ export const NEXT_PUBLIC_NEBULA_APP_CLIENT_ID =

export const NEBULA_APP_SECRET_KEY = process.env.NEBULA_APP_SECRET_KEY || "";

export const THIRDWEB_VAULT_URL =
process.env.NEXT_PUBLIC_THIRDWEB_VAULT_URL || "";

export const THIRDWEB_ENGINE_CLOUD_URL =
process.env.NEXT_PUBLIC_ENGINE_CLOUD_URL || "";

export const THIRDWEB_API_SECRET = process.env.API_SERVER_SECRET || "";

export const IPFS_GATEWAY_URL =
Expand Down
55 changes: 55 additions & 0 deletions apps/dashboard/src/@/lib/time.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { differenceInCalendarDays } from "date-fns";
import {
type DurationId,
type Range,
getLastNDaysRange,
} from "../../components/analytics/date-range-selector";

export function normalizeTime(date: Date) {
const newDate = new Date(date);
newDate.setHours(1, 0, 0, 0);
return newDate;
}

export function normalizeTimeISOString(date: Date) {
return normalizeTime(date).toISOString();
}

export function getFiltersFromSearchParams(params: {
from: string | undefined | string[];
to: string | undefined | string[];
interval: string | undefined | string[];
defaultRange: DurationId;
}) {
const fromStr = params.from;
const toStr = params.to;
const defaultRange = getLastNDaysRange(params.defaultRange);

const range: Range =
fromStr && toStr && typeof fromStr === "string" && typeof toStr === "string"
? {
from: normalizeTime(new Date(fromStr)),
to: normalizeTime(new Date(toStr)),
type: "custom",
}
: {
from: normalizeTime(defaultRange.from),
to: normalizeTime(defaultRange.to),
type: defaultRange.type,
};

const defaultInterval =
differenceInCalendarDays(range.to, range.from) > 30
? "week"
: ("day" as const);

return {
range,
interval:
params.interval === "day"
? ("day" as const)
: params.interval === "week"
? ("week" as const)
: defaultInterval,
};
}
12 changes: 8 additions & 4 deletions apps/dashboard/src/@3rdweb-sdk/react/hooks/useEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import {
useQuery,
useQueryClient,
} from "@tanstack/react-query";
import type { ResultItem } from "app/(app)/team/[team_slug]/(team)/~/engine/(instance)/[engineId]/metrics/components/StatusCodes";
import type { EngineBackendWalletType } from "lib/engine";
import { useState } from "react";
import { useActiveAccount } from "thirdweb/react";
import invariant from "tiny-invariant";
import type { EngineStatus } from "../../../app/(app)/team/[team_slug]/(team)/~/engine/(instance)/[engineId]/overview/components/transactions-table";
import type { ResultItem } from "../../../app/(app)/team/[team_slug]/[project_slug]/engine/dedicated/(instance)/[engineId]/metrics/components/StatusCodes";
import type { EngineStatus } from "../../../app/(app)/team/[team_slug]/[project_slug]/engine/dedicated/(instance)/[engineId]/overview/components/transactions-table";
import { engineKeys } from "../cache-keys";

// Engine instances
Expand Down Expand Up @@ -1641,15 +1641,19 @@ interface EngineResourceMetrics {
};
}

export function useEngineSystemMetrics(engineId: string, teamIdOrSlug: string) {
export function useEngineSystemMetrics(
engineId: string,
teamIdOrSlug: string,
projectSlug: string,
) {
const [enabled, setEnabled] = useState(true);

return useQuery({
queryKey: engineKeys.systemMetrics(engineId),
queryFn: async () => {
const res = await apiServerProxy({
method: "GET",
pathname: `/v1/teams/${teamIdOrSlug}/engine/${engineId}/metrics`,
pathname: `/v1/teams/${teamIdOrSlug}/${projectSlug}/engine/dedicated/${engineId}/metrics`,
});

if (!res.ok) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ export default async function TeamLayout(props: {
path: `/team/${params.team_slug}/~/analytics`,
name: "Analytics",
},
{
path: `/team/${params.team_slug}/~/engine`,
name: "Engines",
},
{
path: `/team/${params.team_slug}/~/ecosystem`,
name: "Ecosystems",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getTeamBySlug } from "@/api/team";
import { getTeamSubscriptions } from "@/api/team-subscription";
import { fetchRPCUsage } from "@/api/usage/rpc";
import { getThirdwebClient } from "@/constants/thirdweb.server";
import { normalizeTimeISOString } from "lib/time";
import { normalizeTimeISOString } from "@/lib/time";
import { redirect } from "next/navigation";
import { getValidAccount } from "../../../../../account/settings/getAccount";
import { getAuthToken } from "../../../../../api/lib/getAuthToken";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ function ProductsSection(props: {
title: "Engine",
description:
"Scale your application with a backend server to read, write, and deploy contracts at production-grade.",
href: `/team/${props.teamSlug}/~/engine`,
href: `/team/${props.teamSlug}/${props.projectSlug}/engine`,
icon: EngineIcon,
trackingLabel: "engine",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import {
WalletIcon,
} from "lucide-react";
import { ContractIcon } from "../../../../(dashboard)/(chain)/components/server/icons/ContractIcon";
import { EngineIcon } from "../../../../(dashboard)/(chain)/components/server/icons/EngineIcon";
import { InsightIcon } from "../../../../(dashboard)/(chain)/components/server/icons/InsightIcon";
import { PayIcon } from "../../../../(dashboard)/(chain)/components/server/icons/PayIcon";
import { SmartAccountIcon } from "../../../../(dashboard)/(chain)/components/server/icons/SmartAccountIcon";
import { Badge } from "../../../../../../@/components/ui/badge";
import { NebulaIcon } from "../../../../../nebula-app/(app)/icons/NebulaIcon";

export function ProjectSidebarLayout(props: {
Expand Down Expand Up @@ -60,17 +62,27 @@ export function ProjectSidebarLayout(props: {
tracking: tracking("contracts"),
},
{
href: `${layoutPath}/nebula`,
label: "Nebula",
icon: NebulaIcon,
tracking: tracking("nebula"),
href: `${layoutPath}/engine`,
label: (
<span className="flex items-center gap-2">
Engine <Badge>New</Badge>
</span>
),
icon: EngineIcon,
tracking: tracking("engine"),
},
{
href: `${layoutPath}/insight`,
label: "Insight",
icon: InsightIcon,
tracking: tracking("insight"),
},
{
href: `${layoutPath}/nebula`,
label: "Nebula",
icon: NebulaIcon,
tracking: tracking("nebula"),
},
]}
footerSidebarLinks={[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default async function Page(props: {
});

return (
<div>
<div className="flex grow flex-col">
<AccountAbstractionSummary
teamId={project.teamId}
projectId={project.id}
Expand Down
Loading
Loading