Skip to content

Commit becd948

Browse files
committed
Merge branch 'main' into greg/tool-4164-migrate-dashboard-analytics
2 parents 95f3fff + 3d7c2d4 commit becd948

File tree

116 files changed

+596
-1264
lines changed

Some content is hidden

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

116 files changed

+596
-1264
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
# Initializes the CodeQL tools for scanning.
4848
- name: Initialize CodeQL
49-
uses: github/codeql-action/init@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
49+
uses: github/codeql-action/init@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
5050
with:
5151
languages: ${{ matrix.language }}
5252
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -59,7 +59,7 @@ jobs:
5959
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
6060
# If this step fails, then you should remove it and run the build manually (see below)
6161
- name: Autobuild
62-
uses: github/codeql-action/autobuild@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
62+
uses: github/codeql-action/autobuild@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
6363

6464
# ℹ️ Command-line programs to run using the OS shell.
6565
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -72,4 +72,4 @@ jobs:
7272
# ./location_of_script_within_repo/buildscript.sh
7373

7474
- name: Perform CodeQL Analysis
75-
uses: github/codeql-action/analyze@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
75+
uses: github/codeql-action/analyze@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
- name: Create release Pull Request or publish to NPM
3838
id: changesets
39-
uses: changesets/action@06245a4e0a36c064a573d4150030f5ec548e4fcc #v1.4.0
39+
uses: changesets/action@746c25e23caa47dceb6a48ee85b4cbc5a9f5f293 #v1.4.0
4040
with:
4141
publish: pnpm release
4242
version: pnpm version-packages

apps/dashboard/package.json

Lines changed: 0 additions & 1 deletion
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-
"@date-fns/tz": "^1.2.0",
2928
"@emotion/react": "11.14.0",
3029
"@emotion/styled": "11.14.0",
3130
"@hookform/resolvers": "^3.9.1",

apps/dashboard/src/@/actions/getBalancesFromMoralis.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { defineDashboardChain } from "lib/defineDashboardChain";
33
import { ZERO_ADDRESS, isAddress, toTokens } from "thirdweb";
44
import { getWalletBalance } from "thirdweb/wallets";
5-
import { getUserThirdwebClient } from "../../app/(app)/api/lib/getAuthToken";
5+
import { serverThirdwebClient } from "../constants/thirdweb-client.server";
66

77
type BalanceQueryResponse = Array<{
88
balance: string;
@@ -23,7 +23,6 @@ export async function getTokenBalancesFromMoralis(params: {
2323
error: string;
2424
}
2525
> {
26-
const client = await getUserThirdwebClient();
2726
const { contractAddress, chainId } = params;
2827

2928
if (!isAddress(contractAddress)) {
@@ -39,7 +38,7 @@ export async function getTokenBalancesFromMoralis(params: {
3938
const balance = await getWalletBalance({
4039
address: contractAddress,
4140
chain,
42-
client,
41+
client: serverThirdwebClient,
4342
});
4443
return [
4544
{

apps/dashboard/src/@/actions/proxies.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,6 @@ export async function engineCloudProxy<T>(params: ProxyActionParams) {
8383
return proxy<T>(THIRDWEB_ENGINE_CLOUD_URL, params);
8484
}
8585

86-
export async function payServerProxy<T>(params: ProxyActionParams) {
87-
return proxy<T>(
88-
process.env.NEXT_PUBLIC_PAY_URL
89-
? `https://${process.env.NEXT_PUBLIC_PAY_URL}`
90-
: "https://pay.thirdweb-dev.com",
91-
params,
92-
);
93-
}
94-
9586
export async function analyticsServerProxy<T>(params: ProxyActionParams) {
9687
return proxy<T>(process.env.ANALYTICS_SERVICE_URL || "", params);
9788
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { getConfiguredThirdwebClient } from "./thirdweb.server";
2+
3+
export function getClientThirdwebClient(params?: {
4+
jwt: string | undefined | null;
5+
teamId: string | undefined | null;
6+
}) {
7+
return getConfiguredThirdwebClient({
8+
secretKey: params?.jwt ?? undefined,
9+
teamId: params?.teamId ?? undefined,
10+
});
11+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import "server-only";
2+
3+
import { DASHBOARD_THIRDWEB_SECRET_KEY } from "./env";
4+
import { getConfiguredThirdwebClient } from "./thirdweb.server";
5+
6+
export const serverThirdwebClient = getConfiguredThirdwebClient({
7+
teamId: undefined,
8+
secretKey: DASHBOARD_THIRDWEB_SECRET_KEY,
9+
});

apps/dashboard/src/@/constants/thirdweb.client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useActiveAccount } from "thirdweb/react";
44
import type { GetAuthTokenResponse } from "../../app/(app)/api/auth/get-auth-token/route";
55
import { LAST_USED_TEAM_ID } from "../../constants/cookies";
66
import { getCookie } from "../../lib/cookie";
7-
import { getThirdwebClient } from "./thirdweb.server";
7+
import { getClientThirdwebClient } from "./thirdweb-client.client";
88

99
// returns a thirdweb client with optional JWT passed i
1010

@@ -38,7 +38,7 @@ export function useThirdwebClient(jwt?: string) {
3838
return useMemo(
3939
// prefer jwt from props over the one from the token query if it exists
4040
() =>
41-
getThirdwebClient({
41+
getClientThirdwebClient({
4242
jwt: jwt || query.data,
4343
teamId: lastUsedTeamId,
4444
}),

apps/dashboard/src/@/constants/thirdweb.server.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
DASHBOARD_THIRDWEB_CLIENT_ID,
3-
DASHBOARD_THIRDWEB_SECRET_KEY,
43
IPFS_GATEWAY_URL,
54
} from "@/constants/env";
65
import {
@@ -12,7 +11,7 @@ import {
1211
THIRDWEB_SOCIAL_API_DOMAIN,
1312
THIRDWEB_STORAGE_DOMAIN,
1413
} from "constants/urls";
15-
import { createThirdwebClient } from "thirdweb";
14+
import { type ThirdwebClient, createThirdwebClient } from "thirdweb";
1615
import { populateEip712Transaction } from "thirdweb/transaction";
1716
import {
1817
getTransactionDecorator,
@@ -22,15 +21,10 @@ import {
2221
import { getZkPaymasterData } from "thirdweb/wallets/smart";
2322
import { getVercelEnv } from "../../lib/vercel-utils";
2423

25-
// returns a thirdweb client with optional JWT passed in
26-
export function getThirdwebClient(
27-
options:
28-
| {
29-
jwt: string | null | undefined;
30-
teamId: string | undefined;
31-
}
32-
| undefined,
33-
) {
24+
export function getConfiguredThirdwebClient(options: {
25+
secretKey: string | undefined;
26+
teamId: string | undefined;
27+
}): ThirdwebClient {
3428
if (getVercelEnv() !== "production") {
3529
// if not on production: run this when creating a client to set the domains
3630
setThirdwebDomains({
@@ -78,8 +72,8 @@ export function getThirdwebClient(
7872
}
7973

8074
return createThirdwebClient({
81-
teamId: options?.teamId,
82-
secretKey: options?.jwt ? options.jwt : DASHBOARD_THIRDWEB_SECRET_KEY,
75+
teamId: options.teamId,
76+
secretKey: options.secretKey,
8377
clientId: DASHBOARD_THIRDWEB_CLIENT_ID,
8478
config: {
8579
storage: {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { getThirdwebClient } from "@/constants/thirdweb.server";
21
import type { Metadata } from "next";
2+
import { getClientThirdwebClient } from "../../../../../@/constants/thirdweb-client.client";
33
import { UniversalBridgeEmbed } from "./components/client/UniversalBridgeEmbed";
44

55
const title = "Universal Bridge: Swap, Bridge, and On-Ramp";
@@ -19,7 +19,7 @@ export default async function RoutesPage({
1919
searchParams,
2020
}: { searchParams: Record<string, string | string[]> }) {
2121
const { chainId } = searchParams;
22-
const client = getThirdwebClient(undefined);
22+
const client = getClientThirdwebClient(undefined);
2323
return (
2424
<div className="relative mx-auto flex h-screen w-full flex-col items-center justify-center overflow-hidden border py-10">
2525
<main className="container z-10 flex justify-center">

0 commit comments

Comments
 (0)