Skip to content

Commit ae7e82c

Browse files
authored
Merge branch 'main' into greg/tool-4834-fix-bigint-serialization-on-payment-widgets
2 parents 51d1bd9 + 55baa99 commit ae7e82c

File tree

220 files changed

+8348
-1351
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+8348
-1351
lines changed

.changeset/weak-papayas-occur.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Fix etherlink transfers when too little funds

apps/dashboard/.env.example

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ NEXT_PUBLIC_STRIPE_KEY=
4444

4545
NEXT_PUBLIC_STRIPE_PAYMENT_METHOD_CFG_ID=
4646

47-
# Needed for contract analytics / blockchain data information
48-
CHAINSAW_API_KEY=
49-
5047
#
5148
# Private (server)
5249
#
@@ -65,17 +62,11 @@ MORALIS_API_KEY=
6562
# - not required to build (unless testing wallet NFTs)>
6663
SSR_ALCHEMY_KEY=
6764

68-
# beehiiv.com API key (used for newsletter signups)
69-
# - not required to build (unless testing newsletter signups)>
70-
BEEHIIV_API_KEY=
7165

7266
# Hubspot Access Token (used for contact us form)
7367
# - not required to build (unless testing contact us form)>
7468
HUBSPOT_ACCESS_TOKEN=
7569

76-
# Github API Token (used for /open-source)
77-
GITHUB_API_TOKEN="ghp_..."
78-
7970
# Upload server url
8071
NEXT_PUBLIC_DASHBOARD_UPLOAD_SERVER="https://storage.thirdweb-preview.com"
8172

@@ -100,8 +91,6 @@ REDIS_URL=""
10091

10192
ANALYTICS_SERVICE_URL=""
10293

103-
# Required for Nebula Chat
104-
NEXT_PUBLIC_NEBULA_URL=""
10594

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

apps/dashboard/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
"compare-versions": "^6.1.0",
6363
"date-fns": "4.1.0",
6464
"fast-xml-parser": "^5.2.5",
65-
"fetch-event-stream": "0.1.5",
6665
"flat": "^6.0.1",
6766
"framer-motion": "12.17.0",
6867
"fuse.js": "7.1.0",

apps/dashboard/src/@/components/Responsive.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
2+
import { ClientOnly } from "@/components/blocks/client-only";
23
import { Suspense } from "react";
3-
import { ClientOnly } from "../../components/ClientOnly/ClientOnly";
44
import { useIsMobile } from "../hooks/use-mobile";
55

66
export function ResponsiveLayout(props: {
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
"use client";
2+
3+
import { cn } from "@/lib/utils";
4+
import { type ReactNode, useEffect, useState } from "react";
5+
6+
interface ClientOnlyProps {
7+
/**
8+
* Use this to server render a skeleton or loading state
9+
*/
10+
ssr: ReactNode;
11+
className?: string;
12+
children: ReactNode;
13+
}
14+
15+
export const ClientOnly: React.FC<ClientOnlyProps> = ({
16+
children,
17+
ssr,
18+
className,
19+
}) => {
20+
const hasMounted = useIsClientMounted();
21+
22+
if (!hasMounted) {
23+
return <> {ssr} </>;
24+
}
25+
26+
return (
27+
<div className={cn("fade-in-0 fill-mode-forwards ease-in", className)}>
28+
{children}
29+
</div>
30+
);
31+
};
32+
33+
function useIsClientMounted() {
34+
const [hasMounted, setHasMounted] = useState(false);
35+
36+
// eslint-disable-next-line no-restricted-syntax
37+
useEffect(() => {
38+
setHasMounted(true);
39+
}, []);
40+
41+
return hasMounted;
42+
}

apps/dashboard/src/@/components/color-mode-toggle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

3+
import { ClientOnly } from "@/components/blocks/client-only";
34
import { Button } from "@/components/ui/button";
4-
import { ClientOnly } from "components/ClientOnly/ClientOnly";
55
import { MoonIcon, SunIcon } from "lucide-react";
66
import { useTheme } from "next-themes";
77
import { Skeleton } from "./ui/skeleton";

apps/dashboard/src/@/components/ui/Spinner/Spinner.module.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
inset: 0px;
1313
border-radius: 50%;
1414
border: 4px solid #fff;
15-
animation: prixClipFix 2s linear infinite;
1615
stroke-linecap: round;
1716
animation: dash 1.5s ease-in-out infinite;
1817
}

apps/dashboard/src/@/components/ui/button.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@ const buttonVariants = cva(
99
{
1010
variants: {
1111
variant: {
12-
primary:
13-
"bg-primary hover:bg-primary/90 text-semibold text-primary-foreground ",
12+
primary: "bg-primary hover:bg-primary/90 text-primary-foreground ",
1413
default: "bg-foreground text-background hover:bg-foreground/90",
1514
destructive:
16-
"bg-destructive hover:bg-destructive/90 text-semibold text-destructive-foreground ",
15+
"bg-destructive hover:bg-destructive/90 text-destructive-foreground ",
1716
outline:
18-
"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground text-semibold",
17+
"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",
1918
secondary:
20-
"bg-secondary hover:bg-secondary/80 text-semibold text-secondary-foreground ",
21-
ghost: "hover:bg-accent text-semibold hover:text-accent-foreground",
22-
link: "text-primary underline-offset-4 hover:underline text-semibold",
19+
"bg-secondary hover:bg-secondary/80 text-secondary-foreground ",
20+
ghost: "hover:bg-accent hover:text-accent-foreground",
21+
link: "underline-offset-4 hover:underline",
2322
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",
2423
upsell:
2524
"bg-green-600 text-white hover:bg-green-700 shadow-lg hover:shadow-xl transform hover:-translate-y-0.5 transition-all duration-200",

apps/dashboard/src/@/components/ui/skeleton.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function SkeletonContainer<T>(props: {
1616
loadedData?: T;
1717
skeletonData: T;
1818
className?: string;
19-
render: (data: T, isSkeleton: boolean) => React.ReactNode;
19+
render: (data: T) => React.ReactNode;
2020
style?: React.CSSProperties;
2121
}) {
2222
const isLoading = props.loadedData === undefined;
@@ -40,7 +40,6 @@ function SkeletonContainer<T>(props: {
4040
props.loadedData === undefined
4141
? props.skeletonData
4242
: props.loadedData,
43-
!isLoading,
4443
)}
4544
</div>
4645
</div>

apps/dashboard/src/@/constants/public-envs.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
export const NEXT_PUBLIC_DASHBOARD_CLIENT_ID =
22
process.env.NEXT_PUBLIC_DASHBOARD_CLIENT_ID || "";
33

4-
export const NEXT_PUBLIC_NEBULA_APP_CLIENT_ID =
5-
process.env.NEXT_PUBLIC_NEBULA_APP_CLIENT_ID || "";
6-
74
export const NEXT_PUBLIC_THIRDWEB_VAULT_URL =
85
process.env.NEXT_PUBLIC_THIRDWEB_VAULT_URL || "";
96

@@ -30,7 +27,5 @@ export const NEXT_PUBLIC_TURNSTILE_SITE_KEY =
3027
export const NEXT_PUBLIC_THIRDWEB_ENGINE_FAUCET_WALLET =
3128
process.env.NEXT_PUBLIC_THIRDWEB_ENGINE_FAUCET_WALLET || "";
3229

33-
export const NEXT_PUBLIC_NEBULA_URL = process.env.NEXT_PUBLIC_NEBULA_URL || "";
34-
3530
export const NEXT_PUBLIC_DEMO_ENGINE_URL =
3631
process.env.NEXT_PUBLIC_DEMO_ENGINE_URL || "";

apps/dashboard/src/@/constants/server-envs.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@ experimental_taintUniqueValue(
1818
DASHBOARD_THIRDWEB_SECRET_KEY,
1919
);
2020

21-
export const NEBULA_APP_SECRET_KEY = process.env.NEBULA_APP_SECRET_KEY || "";
22-
23-
if (NEBULA_APP_SECRET_KEY) {
24-
experimental_taintUniqueValue(
25-
"Do not pass NEBULA_APP_SECRET_KEY to the client",
26-
process,
27-
NEBULA_APP_SECRET_KEY,
28-
);
29-
}
30-
3121
export const API_SERVER_SECRET = process.env.API_SERVER_SECRET || "";
3222

3323
if (API_SERVER_SECRET) {

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/layout.tsx

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,12 @@ import {
1414
DropdownMenuTrigger,
1515
} from "@/components/ui/dropdown-menu";
1616
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
17-
import {
18-
getAuthToken,
19-
getAuthTokenWalletAddress,
20-
} from "@app/api/lib/getAuthToken";
17+
import { getAuthToken } from "@app/api/lib/getAuthToken";
2118
import { ChevronDownIcon, TicketCheckIcon } from "lucide-react";
2219
import type { Metadata } from "next";
2320
import Link from "next/link";
2421
import { redirect } from "next/navigation";
2522
import { mapV4ChainToV5Chain } from "../../../../../../contexts/map-chains";
26-
import { NebulaChatButton } from "../../../../../nebula-app/(app)/components/FloatingChat/FloatingChat";
2723
import { TeamHeader } from "../../../../team/components/TeamHeader/team-header";
2824
import { StarButton } from "../../components/client/star-button";
2925
import { getChain, getChainMetadata } from "../../utils";
@@ -61,10 +57,9 @@ export default async function ChainPageLayout(props: {
6157
}) {
6258
const params = await props.params;
6359
const { children } = props;
64-
const [chain, authToken, accountAddress] = await Promise.all([
60+
const [chain, authToken] = await Promise.all([
6561
getChain(params.chain_id),
6662
getAuthToken(),
67-
getAuthTokenWalletAddress(),
6863
]);
6964

7065
if (params.chain_id !== chain.slug) {
@@ -74,49 +69,12 @@ export default async function ChainPageLayout(props: {
7469
const chainMetadata = await getChainMetadata(chain.chainId);
7570
const client = getClientThirdwebClient(undefined);
7671

77-
const chainPromptPrefix = `\
78-
You are assisting users exploring the chain ${chain.name} (Chain ID: ${chain.chainId}). Provide concise insights into the types of applications and activities prevalent on this chain, such as DeFi protocols, NFT marketplaces, or gaming platforms. Highlight notable projects or trends without delving into technical details like consensus mechanisms or gas fees.
79-
Users may seek comparisons between ${chain.name} and other chains. Provide objective, succinct comparisons focusing on performance, fees, and ecosystem support. Refrain from transaction-specific advice unless requested.
80-
Provide users with an understanding of the unique use cases and functionalities that ${chain.name} supports. Discuss how developers leverage this chain for specific applications, such as scalable dApps, low-cost transactions, or specialized token standards, focusing on practical implementations.
81-
Users may be interested in utilizing thirdweb tools on ${chain.name}. Offer clear guidance on how thirdweb's SDKs, smart contract templates, and deployment tools integrate with this chain. Emphasize the functionalities enabled by thirdweb without discussing transaction execution unless prompted.
82-
Avoid transaction-related actions to be executed by the user unless inquired about.
83-
84-
The following is the user's message:
85-
`;
86-
87-
const examplePrompts: string[] = [
88-
"What are users doing on this chain?",
89-
"What are the most active contracts?",
90-
"Why would I use this chain over others?",
91-
"Can I deploy thirdweb contracts to this chain?",
92-
];
93-
94-
if (chain.chainId !== 1) {
95-
examplePrompts.push("Can I bridge assets from Ethereum to this chain?");
96-
}
97-
9872
return (
9973
<div className="flex grow flex-col">
10074
<div className="border-border border-b bg-card">
10175
<TeamHeader />
10276
</div>
103-
<NebulaChatButton
104-
isLoggedIn={!!authToken}
105-
networks={chain.testnet ? "testnet" : "mainnet"}
106-
isFloating={true}
107-
pageType="chain"
108-
label="Ask AI about this chain"
109-
client={client}
110-
nebulaParams={{
111-
messagePrefix: chainPromptPrefix,
112-
chainIds: [chain.chainId],
113-
wallet: accountAddress ?? undefined,
114-
}}
115-
examplePrompts={examplePrompts.map((prompt) => ({
116-
title: prompt,
117-
message: prompt,
118-
}))}
119-
/>
77+
12078
<div className="flex h-14 border-border border-b pl-7">
12179
<Breadcrumb className="my-auto">
12280
<BreadcrumbList>

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/shared-layout.tsx

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ import { notFound } from "next/navigation";
88
import { getContractMetadata } from "thirdweb/extensions/common";
99
import { isAddress, isContractDeployed } from "thirdweb/utils";
1010
import { shortenIfAddress } from "utils/usedapp-external";
11-
import { NebulaChatButton } from "../../../../../nebula-app/(app)/components/FloatingChat/FloatingChat";
12-
import { examplePrompts } from "../../../../../nebula-app/(app)/data/examplePrompts";
13-
import { getAuthTokenWalletAddress } from "../../../../api/lib/getAuthToken";
1411
import type { ProjectMeta } from "../../../../team/[team_slug]/[project_slug]/contract/[chainIdOrSlug]/[contractAddress]/types";
1512
import { TeamHeader } from "../../../../team/components/TeamHeader/team-header";
1613
import { ConfigureCustomChain } from "./_layout/ConfigureCustomChain";
@@ -34,13 +31,12 @@ export async function SharedContractLayout(props: {
3431
return notFound();
3532
}
3633

37-
const [info, accountAddress, teamsAndProjects] = await Promise.all([
34+
const [info, teamsAndProjects] = await Promise.all([
3835
getContractPageParamsInfo({
3936
contractAddress: props.contractAddress,
4037
chainIdOrSlug: props.chainIdOrSlug,
4138
teamId: props.projectMeta?.teamId,
4239
}),
43-
getAuthTokenWalletAddress(),
4440
getTeamsAndProjectsIfLoggedIn(),
4541
]);
4642

@@ -109,17 +105,6 @@ export async function SharedContractLayout(props: {
109105
projectMeta: props.projectMeta,
110106
});
111107

112-
const contractAddress = serverContract.address;
113-
const chainName = chainMetadata.name;
114-
const chainId = chainMetadata.chainId;
115-
116-
const contractPromptPrefix = `A user is viewing the contract address ${contractAddress} on ${chainName} (Chain ID: ${chainId}). Provide a concise summary of this contract's functionalities, such as token minting, staking, or governance mechanisms. Focus on what the contract enables users to do, avoiding transaction execution details unless requested.
117-
Users may be interested in how to interact with the contract. Outline common interaction patterns, such as claiming rewards, participating in governance, or transferring assets. Emphasize the contract's capabilities without guiding through transaction processes unless asked.
118-
Provide insights into how the contract is being used. Share information on user engagement, transaction volumes, or integration with other dApps, focusing on the contract's role within the broader ecosystem.
119-
Users may be considering integrating the contract into their applications. Discuss how this contract's functionalities can be leveraged within different types of dApps, highlighting potential use cases and benefits.
120-
121-
The following is the user's message:`;
122-
123108
return (
124109
<ConditionalTeamHeaderLayout projectMeta={props.projectMeta}>
125110
<ContractPageLayout
@@ -131,20 +116,6 @@ The following is the user's message:`;
131116
teamsAndProjects={teamsAndProjects}
132117
projectMeta={props.projectMeta}
133118
>
134-
<NebulaChatButton
135-
isLoggedIn={!!accountAddress}
136-
networks={info.chainMetadata.testnet ? "testnet" : "mainnet"}
137-
isFloating={true}
138-
pageType="contract"
139-
label="Ask AI about this contract"
140-
client={clientContract.client}
141-
nebulaParams={{
142-
messagePrefix: contractPromptPrefix,
143-
chainIds: [chainId],
144-
wallet: accountAddress ?? undefined,
145-
}}
146-
examplePrompts={examplePrompts}
147-
/>
148119
{props.children}
149120
</ContractPageLayout>
150121
</ConditionalTeamHeaderLayout>

apps/dashboard/src/app/(app)/(dashboard)/(chain)/components/server/products.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { NebulaIcon } from "../../../../../nebula-app/(app)/icons/NebulaIcon";
21
import type { ChainSupportedService } from "../../types/chain";
32
import { ConnectSDKIcon } from "./icons/ConnectSDKIcon";
43
import { ContractIcon } from "./icons/ContractIcon";
54
import { EngineIcon } from "./icons/EngineIcon";
65
import { InsightIcon } from "./icons/InsightIcon";
6+
import { NebulaIcon } from "./icons/NebulaIcon";
77
import { PayIcon } from "./icons/PayIcon";
88
import { RPCIcon } from "./icons/RPCIcon";
99
import { SmartAccountIcon } from "./icons/SmartAccountIcon";

apps/dashboard/src/app/(app)/(dashboard)/support/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import { BookOpenIcon, ChevronRightIcon } from "lucide-react";
55
import { HomeIcon, WalletIcon } from "lucide-react";
66
import type { Metadata } from "next";
77
import Link from "next/link";
8+
import { NebulaIcon } from "../(chain)/components/server/icons/NebulaIcon";
89
import { EngineIcon } from "../../(dashboard)/(chain)/components/server/icons/EngineIcon";
910
import { InsightIcon } from "../../(dashboard)/(chain)/components/server/icons/InsightIcon";
1011
import { PayIcon } from "../../(dashboard)/(chain)/components/server/icons/PayIcon";
11-
import { CustomChatButton } from "../../../nebula-app/(app)/components/CustomChat/CustomChatButton";
12-
import { NebulaIcon } from "../../../nebula-app/(app)/icons/NebulaIcon";
12+
import { CustomChatButton } from "../../../../components/CustomChat/CustomChatButton";
1313
import {
1414
getAuthToken,
1515
getAuthTokenWalletAddress,

apps/dashboard/src/app/(app)/(dashboard)/tools/unixtime-converter/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ClientOnly } from "components/ClientOnly/ClientOnly";
1+
import { ClientOnly } from "@/components/blocks/client-only";
22
import type { Metadata } from "next";
33
import { UnixTimeConverter } from "./components/UnixTimeConverter";
44

apps/dashboard/src/app/(app)/account/contracts/_components/DeployedContractsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { ClientOnly } from "@/components/blocks/client-only";
12
import { Spinner } from "@/components/ui/Spinner/Spinner";
2-
import { ClientOnly } from "components/ClientOnly/ClientOnly";
33
import { ContractTable } from "components/contract-components/tables/contract-table";
44
import { Suspense } from "react";
55
import type { ThirdwebClient } from "thirdweb";

apps/dashboard/src/app/(app)/login/LoginPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
"use client";
22

33
import { getRawAccountAction } from "@/actions/getAccount";
4+
import { ClientOnly } from "@/components/blocks/client-only";
45
import { GenericLoadingPage } from "@/components/blocks/skeletons/GenericLoadingPage";
56
import { ToggleThemeButton } from "@/components/color-mode-toggle";
67
import { Spinner } from "@/components/ui/Spinner/Spinner";
78
import { NEXT_PUBLIC_TURNSTILE_SITE_KEY } from "@/constants/public-envs";
89
import { useDashboardRouter } from "@/lib/DashboardRouter";
910
import type { Account } from "@3rdweb-sdk/react/hooks/useApi";
1011
import { Turnstile } from "@marsidev/react-turnstile";
11-
import { ClientOnly } from "components/ClientOnly/ClientOnly";
1212
import { isVercel } from "lib/vercel-utils";
1313
import { useTheme } from "next-themes";
1414
import Link from "next/link";

0 commit comments

Comments
 (0)