Skip to content

Commit 6d09a4c

Browse files
authored
Merge branch 'main' into cursor/fetch-minimal-account-address-from-bundler-09f6
2 parents ebb96e9 + c331d18 commit 6d09a4c

File tree

400 files changed

+7009
-4438
lines changed

Some content is hidden

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

400 files changed

+7009
-4438
lines changed

.changeset/pretty-geese-win.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+
Add Pay Modal integration in `useSendAndConfirmTransaction` hook similar to `useSendTransaction` hook

apps/dashboard/.eslintrc.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,30 @@ module.exports = {
9595
'Import "posthog-js" directly only within the analytics helpers ("src/@/analytics/*"). Use the exported helpers from "@/analytics/track" elsewhere.',
9696
name: "posthog-js",
9797
},
98+
{
99+
importNames: ["useSendTransaction"],
100+
message:
101+
'Use `import { useSendAndConfirmTx } from "@/hooks/useSendTx";` instead',
102+
name: "thirdweb/react",
103+
},
104+
{
105+
importNames: ["useSendAndConfirmTransaction"],
106+
message:
107+
'Use `import { useSendAndConfirmTx } from "@/hooks/useSendTx";` instead',
108+
name: "thirdweb/react",
109+
},
110+
{
111+
importNames: ["sendTransaction"],
112+
message:
113+
'Use `import { useSendAndConfirmTx } from "@/hooks/useSendTx";` instead if used in react component',
114+
name: "thirdweb",
115+
},
116+
{
117+
importNames: ["sendAndConfirmTransaction"],
118+
message:
119+
'Use `import { useSendAndConfirmTx } from "@/hooks/useSendTx";` instead if used in react component',
120+
name: "thirdweb",
121+
},
98122
],
99123
patterns: [
100124
{

apps/dashboard/.storybook/preview.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import type { Preview } from "@storybook/nextjs";
2-
import "../src/global.css";
2+
import "@workspace/ui/global.css";
33
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
4+
import { Button } from "@workspace/ui/components/button";
45
import { MoonIcon, SunIcon } from "lucide-react";
5-
import { ThemeProvider, useTheme } from "next-themes";
66
import { Inter as interFont } from "next/font/google";
7-
// biome-ignore lint/style/useImportType: <explanation>
8-
import React from "react";
9-
import { useEffect } from "react";
7+
import { ThemeProvider, useTheme } from "next-themes";
8+
// biome-ignore lint/style/useImportType: ok
9+
import React, { useEffect } from "react";
1010
import { Toaster } from "sonner";
11-
import { Button } from "../src/@/components/ui/button";
1211

1312
const queryClient = new QueryClient();
1413

@@ -69,9 +68,7 @@ const preview: Preview = {
6968

7069
export default preview;
7170

72-
function StoryLayout(props: {
73-
children: React.ReactNode;
74-
}) {
71+
function StoryLayout(props: { children: React.ReactNode }) {
7572
const { setTheme, theme } = useTheme();
7673

7774
useEffect(() => {

apps/dashboard/knip.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414
"@types/color",
1515
"fast-xml-parser",
1616
"@workspace/ui",
17-
"tailwindcss-animate"
17+
"tailwindcss-animate",
18+
"@radix-ui/react-tooltip",
19+
"shiki",
20+
"react-children-utilities",
21+
"react-markdown",
22+
"remark-gfm"
1823
],
1924
"next": true,
2025
"project": ["src/**"]

apps/dashboard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"remark-gfm": "4.0.1",
6161
"responsive-rsc": "0.0.7",
6262
"server-only": "^0.0.1",
63-
"shiki": "1.27.0",
63+
"shiki": "3.12.0",
6464
"sonner": "2.0.6",
6565
"spdx-correct": "^3.2.0",
6666
"stripe": "17.7.0",
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { NEXT_PUBLIC_DASHBOARD_CLIENT_ID } from "@/constants/public-envs";
2+
import { UB_BASE_URL } from "./constants";
3+
import type { TokenMetadata } from "./types";
4+
5+
export async function getUniversalBridgeTokens(props: {
6+
chainId?: number;
7+
address?: string;
8+
}) {
9+
const url = new URL(`${UB_BASE_URL}/v1/tokens`);
10+
11+
if (props.chainId) {
12+
url.searchParams.append("chainId", String(props.chainId));
13+
}
14+
if (props.address) {
15+
url.searchParams.append("tokenAddress", props.address);
16+
}
17+
url.searchParams.append("limit", "1000");
18+
url.searchParams.append("includePrices", "false");
19+
20+
const res = await fetch(url.toString(), {
21+
headers: {
22+
"Content-Type": "application/json",
23+
"x-client-id": NEXT_PUBLIC_DASHBOARD_CLIENT_ID,
24+
} as Record<string, string>,
25+
method: "GET",
26+
});
27+
28+
if (!res.ok) {
29+
const text = await res.text();
30+
throw new Error(text);
31+
}
32+
33+
const json = await res.json();
34+
return json.data as Array<TokenMetadata>;
35+
}

apps/dashboard/src/@/api/universal-bridge/tokens.ts

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,8 @@
11
"use server";
22
import type { ProjectResponse } from "@thirdweb-dev/service-utils";
33
import { getAuthToken } from "@/api/auth-token";
4-
import { DASHBOARD_THIRDWEB_SECRET_KEY } from "@/constants/server-envs";
54
import { UB_BASE_URL } from "./constants";
6-
7-
export type TokenMetadata = {
8-
name: string;
9-
symbol: string;
10-
address: string;
11-
decimals: number;
12-
chainId: number;
13-
iconUri?: string;
14-
};
15-
16-
export async function getUniversalBridgeTokens(props: {
17-
chainId?: number;
18-
address?: string;
19-
}) {
20-
const url = new URL(`${UB_BASE_URL}/v1/tokens`);
21-
22-
if (props.chainId) {
23-
url.searchParams.append("chainId", String(props.chainId));
24-
}
25-
if (props.address) {
26-
url.searchParams.append("tokenAddress", props.address);
27-
}
28-
url.searchParams.append("limit", "1000");
29-
30-
const res = await fetch(url.toString(), {
31-
headers: {
32-
"Content-Type": "application/json",
33-
"x-secret-key": DASHBOARD_THIRDWEB_SECRET_KEY,
34-
} as Record<string, string>,
35-
method: "GET",
36-
});
37-
38-
if (!res.ok) {
39-
const text = await res.text();
40-
throw new Error(text);
41-
}
42-
43-
const json = await res.json();
44-
return json.data as Array<TokenMetadata>;
45-
}
5+
import type { TokenMetadata } from "./types";
466

477
export async function addUniversalBridgeTokenRoute(props: {
488
chainId: number;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export type TokenMetadata = {
2+
name: string;
3+
symbol: string;
4+
address: string;
5+
decimals: number;
6+
chainId: number;
7+
iconUri?: string;
8+
};

apps/dashboard/src/@/components/billing/renew-subscription-button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { toast } from "sonner";
77
import { reSubscribePlan } from "@/actions/billing";
88
import type { Team } from "@/api/team/get-team";
99
import { Button } from "@/components/ui/button";
10-
import { Spinner } from "@/components/ui/Spinner/Spinner";
10+
import { Spinner } from "@/components/ui/Spinner";
1111
import { useDashboardRouter } from "@/lib/DashboardRouter";
1212
import { pollWithTimeout } from "@/utils/pollWithTimeout";
1313
import { tryCatch } from "@/utils/try-catch";

apps/dashboard/src/@/components/blocks/DangerSettingCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
DialogTitle,
1111
DialogTrigger,
1212
} from "@/components/ui/dialog";
13-
import { Spinner } from "@/components/ui/Spinner/Spinner";
13+
import { Spinner } from "@/components/ui/Spinner";
1414
import { cn } from "../../lib/utils";
1515
import { DynamicHeight } from "../ui/DynamicHeight";
1616

0 commit comments

Comments
 (0)