Skip to content

Commit e3ec814

Browse files
authored
Merge branch 'main' into mintable-module
2 parents 1d8e153 + c8b5780 commit e3ec814

File tree

155 files changed

+2803
-4046
lines changed

Some content is hidden

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

155 files changed

+2803
-4046
lines changed

.changeset/fuzzy-olives-prove.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+
expose WalletUser type for in app / ecosystem wallets

.changeset/smart-chicken-beam.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+
Reduce async calls before requesting webauthn credentials for ios 15

.changeset/sweet-days-admire.md

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

apps/dashboard/.env.example

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,6 @@ GITHUB_API_TOKEN="ghp_..."
7575
# Upload server url
7676
NEXT_PUBLIC_DASHBOARD_UPLOAD_SERVER="https://storage.thirdweb-preview.com"
7777

78-
# Payments Admin Secret. For dev, get this value from paper-web-dev (on Zeet)'s "HASURA_ADMIN_SECRET_KEY" env var
79-
PAYMENTS_ADMIN_SECRET=""
80-
81-
# Disable telemetry
82-
NEXT_TELEMETRY_DISABLED=1
83-
84-
# Use trench for KYC
85-
NEXT_PUBLIC_TRENCH_2_API_ENDPOINT=""
86-
8778
# Unthread variables - only required for submitting the support form in /support
8879
UNTHREAD_API_KEY=""
8980
UNTHREAD_TRIAGE_CHANNEL_ID=""

apps/dashboard/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"@chakra-ui/react": "^2.8.2",
2626
"@chakra-ui/styled-system": "^2.9.2",
2727
"@chakra-ui/theme-tools": "^2.1.2",
28-
"@coinbase/onchainkit": "^0.14.2",
2928
"@emotion/react": "11.13.3",
3029
"@emotion/styled": "11.13.0",
3130
"@hookform/resolvers": "^3.9.0",
@@ -62,13 +61,13 @@
6261
"compare-versions": "^6.1.0",
6362
"date-fns": "4.1.0",
6463
"flat": "^6.0.1",
65-
"framer-motion": "11.11.9",
64+
"framer-motion": "11.11.10",
6665
"fuse.js": "7.0.0",
6766
"input-otp": "^1.2.4",
6867
"ioredis": "^5.4.1",
6968
"ipaddr.js": "^2.2.0",
7069
"lottie-react": "^2.4.0",
71-
"lucide-react": "0.453.0",
70+
"lucide-react": "0.454.0",
7271
"next": "14.2.15",
7372
"next-plausible": "^3.12.0",
7473
"next-seo": "^6.5.0",
@@ -108,7 +107,7 @@
108107
"@chromatic-com/storybook": "2.0.2",
109108
"@next/bundle-analyzer": "14.2.15",
110109
"@next/eslint-plugin-next": "14.2.15",
111-
"@playwright/test": "1.47.2",
110+
"@playwright/test": "1.48.2",
112111
"@storybook/addon-essentials": "8.3.6",
113112
"@storybook/addon-interactions": "8.3.6",
114113
"@storybook/addon-links": "8.3.6",
@@ -118,7 +117,7 @@
118117
"@storybook/nextjs": "8.3.6",
119118
"@storybook/react": "8.3.6",
120119
"@storybook/test": "8.3.6",
121-
"@types/color": "^3.0.6",
120+
"@types/color": "4.2.0",
122121
"@types/node": "20.14.9",
123122
"@types/papaparse": "^5.3.15",
124123
"@types/pluralize": "^0.0.33",
@@ -136,7 +135,7 @@
136135
"eslint-config-biome": "1.9.3",
137136
"eslint-plugin-react-compiler": "0.0.0-experimental-fa06e2c-20241014",
138137
"eslint-plugin-storybook": "^0.9.0",
139-
"knip": "^5.33.3",
138+
"knip": "5.34.2",
140139
"next-sitemap": "^4.2.3",
141140
"postcss": "8.4.47",
142141
"storybook": "8.3.6",

apps/dashboard/src/@3rdweb-sdk/react/cache-keys.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,11 @@ export const embeddedWalletsKeys = {
6363
all: ["embeddedWallets"] as const,
6464
wallet: (walletAddress: string) =>
6565
[...embeddedWalletsKeys.all, walletAddress] as const,
66-
embeddedWallets: (walletAddress: string, clientId: string | undefined) =>
67-
[...embeddedWalletsKeys.wallet(walletAddress), clientId] as const,
66+
embeddedWallets: (
67+
walletAddress: string,
68+
clientId: string | undefined,
69+
page: number,
70+
) => [...embeddedWalletsKeys.wallet(walletAddress), clientId, page] as const,
6871
};
6972

7073
export const engineKeys = {
Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,43 @@
1-
import { useQuery } from "@tanstack/react-query";
1+
import { keepPreviousData, useQuery } from "@tanstack/react-query";
22
import { THIRDWEB_EWS_API_HOST } from "constants/urls";
3+
import type { WalletUser } from "thirdweb/wallets";
34
import { embeddedWalletsKeys } from "../cache-keys";
45
import { useLoggedInUser } from "./useLoggedInUser";
56

6-
// FIXME: Make API to return camelCase or transform
7-
export type EmbeddedWalletUser = {
8-
id: string;
9-
client_id: string;
10-
created_at: string;
11-
last_accessed_at: string;
12-
embedded_wallet?: {
13-
id: string;
14-
address: string;
15-
chain: string;
16-
wallet_user_id: string;
17-
}[];
18-
ews_authed_user: {
19-
id: string;
20-
authed_user_id: string;
21-
email: string;
22-
}[];
23-
};
24-
25-
export function useEmbeddedWallets(clientId: string) {
7+
export function useEmbeddedWallets(clientId: string, page: number) {
268
const { user, isLoggedIn } = useLoggedInUser();
279

2810
return useQuery({
2911
queryKey: embeddedWalletsKeys.embeddedWallets(
3012
user?.address as string,
31-
clientId as string,
13+
clientId,
14+
page,
3215
),
3316
queryFn: async () => {
34-
const res = await fetch(
35-
`${THIRDWEB_EWS_API_HOST}/api/thirdweb/embedded-wallet?clientId=${clientId}&lastAccessedAt=0`,
36-
{
37-
method: "GET",
38-
headers: {
39-
"Content-Type": "application/json",
40-
Authorization: `Bearer ${user?.jwt}`,
41-
},
42-
},
17+
const url = new URL(
18+
`${THIRDWEB_EWS_API_HOST}/api/2024-05-05/account/list`,
4319
);
20+
url.searchParams.append("clientId", clientId);
21+
url.searchParams.append("page", page.toString());
4422

45-
const json = await res.json();
23+
const res = await fetch(url.href, {
24+
method: "GET",
25+
headers: {
26+
"Content-Type": "application/json",
27+
Authorization: `Bearer ${user?.jwt}`,
28+
},
29+
});
30+
if (!res.ok) {
31+
throw new Error(`Failed to fetch wallets: ${await res.text()}`);
32+
}
4633

47-
return json.walletUsers as EmbeddedWalletUser[];
34+
const json = await res.json();
35+
return json as {
36+
users: WalletUser[];
37+
totalPages: number;
38+
};
4839
},
40+
placeholderData: keepPreviousData,
4941
enabled: !!user?.address && isLoggedIn && !!clientId,
5042
});
5143
}

apps/dashboard/src/@3rdweb-sdk/react/hooks/useEngine.ts

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

33
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
4-
import type { ResultItem } from "components/engine/system-metrics/components/StatusCodes";
4+
import type { ResultItem } from "app/team/[team_slug]/[project_slug]/engine/(instance)/[engineId]/metrics/components/StatusCodes";
55
import { THIRDWEB_API_HOST } from "constants/urls";
66
import type { EngineBackendWalletType } from "lib/engine";
77
import { useState } from "react";

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/_utils/getContractFromParams.ts

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,25 @@ export async function getContractPageParamsInfo(params: {
2020
// move on
2121
}
2222

23-
if (!chainMetadata) {
24-
const cookieStore = cookies();
25-
const localChainStoreValue = cookieStore.get(TW_LOCAL_CHAIN_STORE)?.value;
23+
const cookieStore = cookies();
24+
const localChainStoreValue = cookieStore.get(TW_LOCAL_CHAIN_STORE)?.value;
2625

27-
if (localChainStoreValue) {
28-
try {
29-
const chains = JSON.parse(decodeURIComponent(localChainStoreValue));
30-
if (typeof chains === "object" && Array.isArray(chains)) {
31-
const chainOverrides = chains as ChainMetadata[];
32-
const chain = chainOverrides.find(
33-
(c) =>
34-
c.slug === chainSlugOrId ||
35-
c.chainId === Number.parseInt(chainSlugOrId),
36-
);
37-
if (chain) {
38-
chainMetadata = chain;
39-
}
26+
if (localChainStoreValue) {
27+
try {
28+
const chains = JSON.parse(decodeURIComponent(localChainStoreValue));
29+
if (typeof chains === "object" && Array.isArray(chains)) {
30+
const chainOverrides = chains as ChainMetadata[];
31+
const chain = chainOverrides.find(
32+
(c) =>
33+
c.slug === chainSlugOrId ||
34+
c.chainId === Number.parseInt(chainSlugOrId),
35+
);
36+
if (chain) {
37+
chainMetadata = chain;
4038
}
41-
} catch {
42-
// noop
4339
}
40+
} catch {
41+
// noop
4442
}
4543
}
4644

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/code/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default async function Page(props: {
2828
);
2929
}
3030

31-
const abi = await resolveContractAbi(contract).then(() => undefined);
31+
const abi = await resolveContractAbi(contract).catch(() => undefined);
3232

3333
return (
3434
<ContractCodePage

0 commit comments

Comments
 (0)