Skip to content

Commit 1f06132

Browse files
Merge remote-tracking branch 'origin/main' into 10-11-feat_support_for_enclave_migration_in_react_native
2 parents 27bdf0a + 44b2634 commit 1f06132

File tree

93 files changed

+7348
-4699
lines changed

Some content is hidden

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

93 files changed

+7348
-4699
lines changed

.changeset/metal-pets-play.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@thirdweb-dev/service-utils": patch
3+
"thirdweb": patch
4+
---
5+
6+
update dependencies

.changeset/sweet-pears-change.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 upload logic for delayed reveal batch

apps/dashboard/package.json

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -30,45 +30,45 @@
3030
"@emotion/styled": "11.13.0",
3131
"@hookform/resolvers": "^3.9.0",
3232
"@n8tb1t/use-scroll-position": "^2.0.3",
33-
"@radix-ui/react-alert-dialog": "^1.1.1",
34-
"@radix-ui/react-avatar": "^1.1.0",
35-
"@radix-ui/react-checkbox": "^1.1.1",
36-
"@radix-ui/react-dialog": "1.1.1",
37-
"@radix-ui/react-dropdown-menu": "^2.1.1",
38-
"@radix-ui/react-hover-card": "^1.1.1",
33+
"@radix-ui/react-alert-dialog": "^1.1.2",
34+
"@radix-ui/react-avatar": "^1.1.1",
35+
"@radix-ui/react-checkbox": "^1.1.2",
36+
"@radix-ui/react-dialog": "1.1.2",
37+
"@radix-ui/react-dropdown-menu": "^2.1.2",
38+
"@radix-ui/react-hover-card": "^1.1.2",
3939
"@radix-ui/react-label": "^2.1.0",
40-
"@radix-ui/react-popover": "^1.1.1",
40+
"@radix-ui/react-popover": "^1.1.2",
4141
"@radix-ui/react-progress": "^1.1.0",
42-
"@radix-ui/react-radio-group": "^1.2.0",
43-
"@radix-ui/react-select": "^2.1.1",
42+
"@radix-ui/react-radio-group": "^1.2.1",
43+
"@radix-ui/react-select": "^2.1.2",
4444
"@radix-ui/react-separator": "^1.1.0",
4545
"@radix-ui/react-slot": "^1.1.0",
46-
"@radix-ui/react-switch": "^1.1.0",
47-
"@radix-ui/react-tooltip": "1.1.2",
48-
"@sentry/nextjs": "8.32.0",
49-
"@shazow/whatsabi": "^0.15.2",
50-
"@stripe/react-stripe-js": "^2.7.3",
46+
"@radix-ui/react-switch": "^1.1.1",
47+
"@radix-ui/react-tooltip": "1.1.3",
48+
"@sentry/nextjs": "8.34.0",
49+
"@shazow/whatsabi": "^0.15.3",
50+
"@stripe/react-stripe-js": "^2.8.1",
5151
"@stripe/stripe-js": "^3.5.0",
52-
"@tanstack/react-query": "5.56.2",
52+
"@tanstack/react-query": "5.59.13",
5353
"@tanstack/react-table": "^8.17.3",
5454
"@thirdweb-dev/service-utils": "workspace:*",
5555
"@vercel/og": "^0.6.2",
56-
"abitype": "1.0.5",
56+
"abitype": "1.0.6",
5757
"chakra-react-select": "^4.7.6",
5858
"class-variance-authority": "^0.7.0",
5959
"clsx": "^2.1.1",
6060
"color": "^4.2.3",
6161
"compare-versions": "^6.1.0",
62-
"date-fns": "^3.6.0",
62+
"date-fns": "4.1.0",
6363
"flat": "^6.0.1",
64-
"framer-motion": "11.9.0",
64+
"framer-motion": "11.11.8",
6565
"fuse.js": "7.0.0",
6666
"input-otp": "^1.2.4",
6767
"ioredis": "^5.4.1",
6868
"ipaddr.js": "^2.2.0",
6969
"lottie-react": "^2.4.0",
70-
"lucide-react": "0.441.0",
71-
"next": "14.2.13",
70+
"lucide-react": "0.452.0",
71+
"next": "14.2.15",
7272
"next-plausible": "^3.12.0",
7373
"next-seo": "^6.5.0",
7474
"next-themes": "^0.3.0",
@@ -83,48 +83,48 @@
8383
"react-children-utilities": "^2.10.0",
8484
"react-day-picker": "^8.10.1",
8585
"react-dom": "18.3.1",
86-
"react-dropzone": "^14.2.3",
86+
"react-dropzone": "^14.2.9",
8787
"react-hook-form": "7.52.0",
8888
"react-icons": "^5.2.1",
8989
"react-intersection-observer": "^9.10.3",
9090
"react-markdown": "^9.0.1",
9191
"react-responsive-carousel": "^3.2.23",
9292
"react-table": "^7.8.0",
93-
"recharts": "^2.12.7",
93+
"recharts": "^2.13.0",
9494
"remark-gfm": "^4.0.0",
9595
"server-only": "^0.0.1",
9696
"sonner": "^1.5.0",
9797
"spdx-correct": "^3.2.0",
9898
"swagger-ui-react": "^5.17.14",
99-
"tailwind-merge": "^2.5.2",
99+
"tailwind-merge": "^2.5.4",
100100
"tailwindcss-animate": "^1.0.7",
101101
"thirdweb": "workspace:*",
102102
"tiny-invariant": "^1.3.3",
103-
"use-debounce": "^10.0.1",
103+
"use-debounce": "^10.0.4",
104104
"zod": "3.23.8"
105105
},
106106
"devDependencies": {
107107
"@chakra-ui/cli": "^2.4.1",
108108
"@chromatic-com/storybook": "2.0.2",
109-
"@next/bundle-analyzer": "14.2.13",
110-
"@next/eslint-plugin-next": "14.2.13",
109+
"@next/bundle-analyzer": "14.2.15",
110+
"@next/eslint-plugin-next": "14.2.15",
111111
"@playwright/test": "1.47.2",
112-
"@storybook/addon-essentials": "8.3.4",
112+
"@storybook/addon-essentials": "8.3.5",
113113
"@storybook/addon-interactions": "8.3.5",
114-
"@storybook/addon-links": "8.3.4",
115-
"@storybook/addon-onboarding": "8.3.4",
116-
"@storybook/addon-viewport": "8.3.4",
117-
"@storybook/blocks": "8.3.4",
118-
"@storybook/nextjs": "8.3.4",
119-
"@storybook/react": "8.3.4",
114+
"@storybook/addon-links": "8.3.5",
115+
"@storybook/addon-onboarding": "8.3.5",
116+
"@storybook/addon-viewport": "8.3.5",
117+
"@storybook/blocks": "8.3.5",
118+
"@storybook/nextjs": "8.3.5",
119+
"@storybook/react": "8.3.5",
120120
"@storybook/test": "8.3.5",
121121
"@types/color": "^3.0.6",
122122
"@types/node": "20.14.9",
123123
"@types/papaparse": "^5.3.14",
124124
"@types/pluralize": "^0.0.33",
125125
"@types/qrcode": "^1.5.5",
126-
"@types/react": "^18.3.10",
127-
"@types/react-dom": "^18",
126+
"@types/react": "^18.3.11",
127+
"@types/react-dom": "^18.3.1",
128128
"@types/react-table": "^7.7.20",
129129
"@types/spdx-correct": "^3.1.3",
130130
"@types/swagger-ui-react": "^4.18.3",
@@ -133,14 +133,14 @@
133133
"autoprefixer": "^10.4.19",
134134
"checkly": "^4.8.1",
135135
"eslint": "8.57.0",
136-
"eslint-config-biome": "1.8.4",
137-
"eslint-plugin-react-compiler": "0.0.0-experimental-ca16900-20240916",
136+
"eslint-config-biome": "1.9.3",
137+
"eslint-plugin-react-compiler": "0.0.0-experimental-fa06e2c-20241014",
138138
"eslint-plugin-storybook": "^0.9.0",
139-
"knip": "^5.30.6",
139+
"knip": "^5.33.3",
140140
"next-sitemap": "^4.2.3",
141141
"postcss": "8.4.47",
142-
"storybook": "8.3.4",
142+
"storybook": "8.3.5",
143143
"tailwindcss": "3.4.13",
144-
"typescript": "5.6.2"
144+
"typescript": "5.6.3"
145145
}
146146
}

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

Lines changed: 58 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
44
import type { ResultItem } from "components/engine/system-metrics/components/StatusCodes";
55
import { THIRDWEB_API_HOST } from "constants/urls";
6+
import type { EngineBackendWalletType } from "lib/engine";
67
import { useState } from "react";
78
import { useActiveAccount, useActiveWalletChain } from "thirdweb/react";
89
import invariant from "tiny-invariant";
@@ -111,10 +112,16 @@ export function useEngineBackendWallets(instance: string) {
111112
});
112113
}
113114

115+
type EngineFeature =
116+
| "KEYPAIR_AUTH"
117+
| "CONTRACT_SUBSCRIPTIONS"
118+
| "IP_ALLOWLIST"
119+
| "HETEROGENEOUS_WALLET_TYPES";
120+
114121
interface EngineSystemHealth {
115122
status: string;
116123
engineVersion?: string;
117-
features?: string[];
124+
features?: EngineFeature[];
118125
}
119126

120127
export function useEngineSystemHealth(
@@ -138,6 +145,18 @@ export function useEngineSystemHealth(
138145
});
139146
}
140147

148+
// Helper function to check if a feature is supported.
149+
export function useHasEngineFeature(
150+
instanceUrl: string,
151+
feature: EngineFeature,
152+
) {
153+
const query = useEngineSystemHealth(instanceUrl);
154+
return {
155+
query,
156+
isSupported: !!query.data?.features?.includes(feature),
157+
};
158+
}
159+
141160
interface EngineSystemQueueMetrics {
142161
result: {
143162
queued: number;
@@ -188,17 +207,15 @@ export function useEngineLatestVersion() {
188207
}
189208

190209
interface UpdateVersionInput {
191-
engineId: string;
210+
deploymentId: string;
192211
serverVersion: string;
193212
}
194213

195214
export function useEngineUpdateServerVersion() {
196215
return useMutation({
197216
mutationFn: async (input: UpdateVersionInput) => {
198-
invariant(input.engineId, "engineId is required");
199-
200217
const res = await fetch(
201-
`${THIRDWEB_API_HOST}/v2/engine/${input.engineId}/infrastructure`,
218+
`${THIRDWEB_API_HOST}/v2/engine/deployments/${input.deploymentId}/infrastructure`,
202219
{
203220
method: "PUT",
204221
headers: {
@@ -401,29 +418,22 @@ export function useEngineTransactions(instance: string, autoUpdate: boolean) {
401418
});
402419
}
403420

404-
type WalletConfig =
405-
| {
406-
type: "local";
407-
}
408-
| {
409-
type: "aws-kms";
410-
awsAccessKeyId: string;
411-
awsSecretAccessKey: string;
412-
awsRegion: string;
413-
}
414-
| {
415-
type: "gcp-kms";
416-
gcpApplicationProjectId: string;
417-
gcpKmsLocationId: string;
418-
gcpKmsKeyRingId: string;
419-
gcpApplicationCredentialEmail: string;
420-
gcpApplicationCredentialPrivateKey: string;
421-
};
421+
export interface WalletConfigResponse {
422+
type: EngineBackendWalletType;
423+
424+
awsAccessKeyId?: string | null;
425+
awsRegion?: string | null;
426+
427+
gcpApplicationProjectId?: string | null;
428+
gcpKmsLocationId?: string | null;
429+
gcpKmsKeyRingId?: string | null;
430+
gcpApplicationCredentialEmail?: string | null;
431+
}
422432

423433
export function useEngineWalletConfig(instance: string) {
424434
const token = useLoggedInUser().user?.jwt ?? null;
425435

426-
return useQuery({
436+
return useQuery<WalletConfigResponse>({
427437
queryKey: engineKeys.walletConfig(instance),
428438
queryFn: async () => {
429439
const res = await fetch(`${instance}configuration/wallets`, {
@@ -432,8 +442,7 @@ export function useEngineWalletConfig(instance: string) {
432442
});
433443

434444
const json = await res.json();
435-
436-
return (json.result as WalletConfig) || {};
445+
return json.result;
437446
},
438447
enabled: !!instance && !!token,
439448
});
@@ -799,9 +808,6 @@ export function useEngineWebhooks(instance: string) {
799808

800809
// POST REQUESTS
801810
export type SetWalletConfigInput =
802-
| {
803-
type: "local";
804-
}
805811
| {
806812
type: "aws-kms";
807813
awsAccessKeyId: string;
@@ -821,8 +827,8 @@ export function useEngineSetWalletConfig(instance: string) {
821827
const token = useLoggedInUser().user?.jwt ?? null;
822828
const queryClient = useQueryClient();
823829

824-
return useMutation({
825-
mutationFn: async (input: SetWalletConfigInput) => {
830+
return useMutation<WalletConfigResponse, void, SetWalletConfigInput>({
831+
mutationFn: async (input) => {
826832
invariant(instance, "instance is required");
827833

828834
const res = await fetch(`${instance}configuration/wallets`, {
@@ -847,6 +853,7 @@ export function useEngineSetWalletConfig(instance: string) {
847853
}
848854

849855
export type CreateBackendWalletInput = {
856+
type: EngineBackendWalletType;
850857
label?: string;
851858
};
852859

@@ -913,25 +920,20 @@ export function useEngineUpdateBackendWallet(instance: string) {
913920
});
914921
}
915922

916-
export type ImportBackendWalletInput =
917-
| {
918-
awsKmsKeyId: string;
919-
awsKmsArn: string;
920-
}
921-
| {
922-
gcpKmsKeyId: string;
923-
gcpKmsKeyVersionId: string;
924-
}
925-
| {
926-
privateKey?: string;
927-
}
928-
| {
929-
mnemonic?: string;
930-
}
931-
| {
932-
encryptedJson?: string;
933-
password?: string;
934-
};
923+
// The backend determines the wallet imported based on the provided fields.
924+
export type ImportBackendWalletInput = {
925+
label?: string;
926+
927+
awsKmsArn?: string;
928+
929+
gcpKmsKeyId?: string;
930+
gcpKmsKeyVersionId?: string;
931+
932+
privateKey?: string;
933+
mnemonic?: string;
934+
encryptedJson?: string;
935+
password?: string;
936+
};
935937

936938
export function useEngineImportBackendWallet(instance: string) {
937939
const token = useLoggedInUser().user?.jwt ?? null;
@@ -1639,6 +1641,9 @@ export function useEngineCreateNotificationChannel(engineId: string) {
16391641
`${THIRDWEB_API_HOST}/v1/engine/${engineId}/notification-channels`,
16401642
{
16411643
method: "POST",
1644+
headers: {
1645+
"Content-Type": "application/json",
1646+
},
16421647
body: JSON.stringify(input),
16431648
},
16441649
);
@@ -1667,7 +1672,9 @@ export function useEngineDeleteNotificationChannel(engineId: string) {
16671672

16681673
const res = await fetch(
16691674
`${THIRDWEB_API_HOST}/v1/engine/${engineId}/notification-channels/${notificationChannelId}`,
1670-
{ method: "DELETE" },
1675+
{
1676+
method: "DELETE",
1677+
},
16711678
);
16721679
if (!res.ok) {
16731680
throw new Error(`Unexpected status ${res.status}: ${await res.text()}`);
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { redirect } from "next/navigation";
2+
import { getAuthTokenWalletAddress } from "../../../../api/lib/getAuthToken";
3+
import { DeployedContractsPage } from "../../../../team/[team_slug]/[project_slug]/contracts/_components/DeployedContractsPage";
4+
5+
export default function Page() {
6+
const accountAddress = getAuthTokenWalletAddress();
7+
if (!accountAddress) {
8+
return redirect(
9+
`/login?next=${encodeURIComponent("/dashboard/contracts/deploy")}`,
10+
);
11+
}
12+
13+
return (
14+
<DeployedContractsPage
15+
address={accountAddress}
16+
className="flex grow flex-col"
17+
/>
18+
);
19+
}

0 commit comments

Comments
 (0)