Skip to content

Commit 3747e9c

Browse files
committed
Merge branch 'main' into feat/country-code
2 parents 05d72fb + 4b319c3 commit 3747e9c

File tree

166 files changed

+5135
-1924
lines changed

Some content is hidden

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

166 files changed

+5135
-1924
lines changed

.changeset/cuddly-results-play.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/eager-loops-fold.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/fuzzy-bars-wish.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

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/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/blocks/TokenSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
type ThirdwebClient,
66
} from "thirdweb";
77
import { shortenAddress } from "thirdweb/utils";
8-
import type { TokenMetadata } from "@/api/universal-bridge/tokens";
8+
import type { TokenMetadata } from "@/api/universal-bridge/types";
99
import { Img } from "@/components/blocks/Img";
1010
import { SelectWithSearch } from "@/components/blocks/select-with-search";
1111
import { Badge } from "@/components/ui/badge";

apps/dashboard/src/@/components/contracts/functions/interactive-abi-function.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
toSerializableTransaction,
2121
toWei,
2222
} from "thirdweb";
23-
import { useActiveAccount, useSendAndConfirmTransaction } from "thirdweb/react";
23+
import { useActiveAccount } from "thirdweb/react";
2424
import { parseAbiParams, stringify, toFunctionSelector } from "thirdweb/utils";
2525
import { FormFieldSetup } from "@/components/blocks/FormFieldSetup";
2626
import { SolidityInput } from "@/components/solidity-inputs";
@@ -34,6 +34,7 @@ import { Input } from "@/components/ui/input";
3434
import { Spinner } from "@/components/ui/Spinner";
3535
import { Skeleton } from "@/components/ui/skeleton";
3636
import { ToolTipLabel } from "@/components/ui/tooltip";
37+
import { useSendAndConfirmTx } from "@/hooks/useSendTx";
3738

3839
function formatResponseData(data: unknown): {
3940
type: "json" | "text";
@@ -264,7 +265,7 @@ export const InteractiveAbiFunction: React.FC<InteractiveAbiFunctionProps> = (
264265
data: mutationData,
265266
error: mutationError,
266267
isPending: mutationLoading,
267-
} = useSendAndConfirmTransaction();
268+
} = useSendAndConfirmTx();
268269

269270
const {
270271
mutate: readFn,

0 commit comments

Comments
 (0)