Skip to content

Commit 7f2530c

Browse files
committed
Merge remote-tracking branch 'origin' into ian/ftux
2 parents 7df1c68 + 3c77c6b commit 7f2530c

File tree

92 files changed

+2007
-712
lines changed

Some content is hidden

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

92 files changed

+2007
-712
lines changed

.changeset/bright-walls-applaud.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+
Optimize mintAdditionalSupplyToBatch extension

.changeset/late-bats-cry.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+
Auto resolve entrypoint address from factory when available

.changeset/lovely-items-live.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+
Fixes Brave Wallet Metadata

.changeset/tame-tips-type.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@thirdweb-dev/service-utils": patch
3+
---
4+
5+
Adds ecosystem headers to extractAuthorizationData result

apps/dashboard/src/@/components/blocks/app-footer.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,7 @@ export function AppFooter(props: AppFooterProps) {
119119
>
120120
Terms of Service
121121
</Link>
122-
<Link
123-
className="px-[10px] py-[6px] text-muted-foreground text-sm hover:underline"
124-
href="https://thirdweb.com/gas"
125-
target="_blank"
126-
>
127-
Gas Estimator
128-
</Link>
122+
129123
<Link
130124
className="px-[10px] py-[6px] text-muted-foreground text-sm hover:underline"
131125
href="https://thirdweb.com/chainlist"

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import { SidebarLayout } from "@/components/blocks/SidebarLayout";
33
import { ContractMetadata } from "components/custom-contract/contract-header/contract-metadata";
44
import { DeprecatedAlert } from "components/shared/DeprecatedAlert";
55
import type { Metadata } from "next";
6+
import { notFound } from "next/navigation";
67
import { getContractMetadata } from "thirdweb/extensions/common";
8+
import { isContractDeployed } from "thirdweb/utils";
79
import { resolveFunctionSelectors } from "../../../../../lib/selectors";
810
import { shortenIfAddress } from "../../../../../utils/usedapp-external";
911
import { ConfigureCustomChain } from "./ConfigureCustomChain";
@@ -26,6 +28,13 @@ export default async function Layout(props: {
2628
return <ConfigureCustomChain chainSlug={props.params.chain_id} />;
2729
}
2830

31+
// check if the contract exists
32+
const isValidContract = await isContractDeployed(info.contract);
33+
if (!isValidContract) {
34+
// TODO - replace 404 with a better page to upsale deploy or other thirdweb products
35+
notFound();
36+
}
37+
2938
const { contract, chainMetadata } = info;
3039
const contractPageMetadata = await getContractPageMetadata(contract);
3140
const sidebarLinks = getContractPageSidebarLinks({

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/overview/ContractOverviewPage.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { PublishedBy } from "components/contract-components/shared/published-by";
2+
import { ErrorBoundary } from "react-error-boundary";
23
import type { ThirdwebContract } from "thirdweb";
34
import { AnalyticsOverview } from "./components/Analytics";
45
import { BuildYourApp } from "./components/BuildYourApp";
@@ -99,7 +100,9 @@ export const ContractOverviewPage: React.FC<ContractOverviewPageProps> = ({
99100
/>
100101
</div>
101102
<div className="shrink-0 lg:w-[300px]">
102-
<PublishedBy contract={contract} />
103+
<ErrorBoundary fallback={null}>
104+
<PublishedBy contract={contract} />
105+
</ErrorBoundary>
103106
</div>
104107
</div>
105108
);

packages/service-utils/src/cf-worker/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ export async function extractAuthorizationData(
105105
bundleId = requestUrl.searchParams.get("bundleId");
106106
}
107107

108+
let ecosystemId = headers.get("x-ecosystem-id");
109+
if (!ecosystemId) {
110+
ecosystemId = requestUrl.searchParams.get("ecosystemId");
111+
}
112+
113+
let ecosystemPartnerId = headers.get("x-ecosystem-partner-id");
114+
if (!ecosystemPartnerId) {
115+
ecosystemPartnerId = requestUrl.searchParams.get("ecosystemPartnerId");
116+
}
117+
108118
let origin = headers.get("origin");
109119
// if origin header is not available we'll fall back to referrer;
110120
if (!origin) {
@@ -150,6 +160,8 @@ export async function extractAuthorizationData(
150160
hashedJWT: jwt ? await hashSecretKey(jwt) : null,
151161
secretKey,
152162
clientId,
163+
ecosystemId,
164+
ecosystemPartnerId,
153165
origin,
154166
bundleId,
155167
secretKeyHash,

packages/service-utils/src/core/authorize/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import type { AuthorizationResult } from "./types.js";
1212
export type AuthorizationInput = {
1313
secretKey: string | null;
1414
clientId: string | null;
15+
ecosystemId: string | null;
16+
ecosystemPartnerId: string | null;
1517
origin: string | null;
1618
bundleId: string | null;
1719
secretKeyHash: string | null;

packages/service-utils/src/node/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export function extractAuthorizationData(
107107
if (!clientId) {
108108
clientId = requestUrl.searchParams.get("clientId");
109109
}
110+
110111
// bundle id from header is first preference
111112
let bundleId = getHeader(headers, "x-bundle-id");
112113

@@ -115,6 +116,16 @@ export function extractAuthorizationData(
115116
bundleId = requestUrl.searchParams.get("bundleId");
116117
}
117118

119+
let ecosystemId = getHeader(headers, "x-ecosystem-id");
120+
if (!ecosystemId) {
121+
ecosystemId = requestUrl.searchParams.get("ecosystemId");
122+
}
123+
124+
let ecosystemPartnerId = getHeader(headers, "x-ecosystem-partner-id");
125+
if (!ecosystemPartnerId) {
126+
ecosystemPartnerId = requestUrl.searchParams.get("ecosystemPartnerId");
127+
}
128+
118129
let origin = getHeader(headers, "origin");
119130
// if origin header is not available we'll fall back to referrer;
120131
if (!origin) {
@@ -166,6 +177,8 @@ export function extractAuthorizationData(
166177
secretKeyHash,
167178
secretKey,
168179
clientId,
180+
ecosystemId,
181+
ecosystemPartnerId,
169182
origin,
170183
bundleId,
171184
targetAddress: authInput.targetAddress,

0 commit comments

Comments
 (0)