Skip to content

Commit 7e319a7

Browse files
authored
Merge branch 'main' into yash/ocr-contracts-integration
2 parents 09ca5c6 + 61bfebf commit 7e319a7

File tree

65 files changed

+1815
-250
lines changed

Some content is hidden

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

65 files changed

+1815
-250
lines changed

.changeset/early-shoes-tap.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+
feat(chains): add Etherlink mainnet and testnet chains
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Add fallback mechanism to usePaymentMethods hook for getOwnedTokens failures
6+
7+
When getOwnedTokens batches fail in the usePaymentMethods hook, the system now falls back to getting native token balances for each chain using getWalletBalance. This ensures users can still access their native tokens as payment methods even when the insight API is experiencing issues, providing a more resilient user experience.
8+
9+
The fallback mechanism:
10+
- Catches getOwnedTokens failures and logs warnings
11+
- Falls back to native balance fetching using getWalletBalance for each chain
12+
- Transforms results to match the expected format
13+
- Continues normal processing flow seamlessly

.changeset/loud-clocks-begin.md

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

.changeset/ninety-heads-work.md

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

apps/dashboard/framer-rewrites.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,6 @@ module.exports = [
6262
// -- universal bridge landing pages --
6363
"/universal-bridge-regions/:region_slug",
6464
"/enterprise",
65+
"/token",
66+
"/vault",
6567
];

apps/dashboard/src/@/api/webhook-configs.ts

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,3 +310,53 @@ export async function deleteWebhookConfig(props: {
310310
status: "success",
311311
};
312312
}
313+
314+
type TestDestinationUrlResponse =
315+
| {
316+
result: {
317+
httpStatusCode: number;
318+
httpResponseBody: string;
319+
};
320+
status: "success";
321+
}
322+
| {
323+
body: string;
324+
reason: string;
325+
status: "error";
326+
};
327+
328+
export async function testDestinationUrl(props: {
329+
teamIdOrSlug: string;
330+
projectIdOrSlug: string;
331+
destinationUrl: string;
332+
}): Promise<TestDestinationUrlResponse> {
333+
const authToken = await getAuthToken();
334+
335+
if (!authToken) {
336+
return {
337+
body: "Authentication required",
338+
reason: "no_auth_token",
339+
status: "error",
340+
};
341+
}
342+
343+
const resp = await fetch(
344+
`${NEXT_PUBLIC_THIRDWEB_API_HOST}/v1/teams/${props.teamIdOrSlug}/projects/${props.projectIdOrSlug}/webhook-configs/test-destination-url`,
345+
{
346+
body: JSON.stringify({ destinationUrl: props.destinationUrl }),
347+
headers: {
348+
Authorization: `Bearer ${authToken}`,
349+
"Content-Type": "application/json",
350+
},
351+
method: "POST",
352+
},
353+
);
354+
if (!resp.ok) {
355+
return {
356+
body: await resp.text(),
357+
reason: "unknown",
358+
status: "error",
359+
};
360+
}
361+
return await resp.json();
362+
}

apps/dashboard/src/@/components/misc/AnnouncementBanner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function AnnouncementBanner() {
4747
return (
4848
<AnnouncementBannerUI
4949
href="https://blog.thirdweb.com/the-fastest-way-to-build-web3-applications/"
50-
label="We have re-branded our Engine, Universal Bridge, and Connect products. Please read the full blog post for details on changes"
50+
label="We have re-branded our Engine, Payments, and Connect products. Please read the full blog post for details on changes"
5151
trackingLabel="product-rebrand"
5252
/>
5353
);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
type SearchParams,
1111
} from "./components/server/routes-table";
1212

13-
const title = "Universal Bridge Routes: Swap, Bridge, and Onramp";
13+
const title = "Payments Routes: Swap, Bridge, and Onramp";
1414
const description =
1515
"A list of token routes for swapping, bridging, and on-ramping between EVM chains with thirdweb.";
1616

@@ -66,7 +66,7 @@ export default async function RoutesPage(props: {
6666
<div className="relative flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between">
6767
<div className="flex flex-col gap-1">
6868
<h3 className="font-medium text-lg">
69-
Get Started with Universal Bridge
69+
Get Started with thirdweb Payments
7070
</h3>
7171
<p className="text-muted-foreground text-sm">
7272
Simple, instant, and secure payments across any token and chain.

apps/dashboard/src/app/(app)/(dashboard)/(bridge)/utils.ts

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import "server-only";
22

3-
import type { Address } from "thirdweb";
43
import { NEXT_PUBLIC_THIRDWEB_BRIDGE_HOST } from "@/constants/public-envs";
54
import { DASHBOARD_THIRDWEB_SECRET_KEY } from "@/constants/server-envs";
65
import type { Route } from "./types/route";
@@ -10,21 +9,13 @@ export async function getRoutes({
109
offset,
1110
originQuery,
1211
destinationQuery,
13-
originChainId,
14-
destinationChainId,
15-
originTokenAddress,
16-
destinationTokenAddress,
1712
}: {
1813
limit?: number;
1914
offset?: number;
2015
originQuery?: string;
2116
destinationQuery?: string;
22-
originChainId?: number;
23-
destinationChainId?: number;
24-
originTokenAddress?: Address;
25-
destinationTokenAddress?: Address;
2617
} = {}) {
27-
const url = new URL(`${NEXT_PUBLIC_THIRDWEB_BRIDGE_HOST}/v1/routes`);
18+
const url = new URL(`${NEXT_PUBLIC_THIRDWEB_BRIDGE_HOST}/v1/routes/search`);
2819
if (limit) {
2920
url.searchParams.set("limit", limit.toString());
3021
}
@@ -37,20 +28,7 @@ export async function getRoutes({
3728
if (destinationQuery) {
3829
url.searchParams.set("destinationQuery", destinationQuery);
3930
}
40-
if (originChainId) {
41-
url.searchParams.set("originChainId", originChainId.toString());
42-
}
43-
if (destinationChainId) {
44-
url.searchParams.set("destinationChainId", destinationChainId.toString());
45-
}
46-
if (originTokenAddress) {
47-
url.searchParams.set("originTokenAddress", originTokenAddress);
48-
}
49-
if (destinationTokenAddress) {
50-
url.searchParams.set("destinationTokenAddress", destinationTokenAddress);
51-
}
5231
url.searchParams.set("sortBy", "popularity");
53-
// It's faster to filter client side, doesn't seem to be a big performance boost to paginate/filter server side
5432
const routesResponse = await fetch(url, {
5533
headers: {
5634
"x-secret-key": DASHBOARD_THIRDWEB_SECRET_KEY,

apps/dashboard/src/app/(app)/(dashboard)/contracts/publish/[publish_uri]/page.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { ChakraProviderSetup } from "chakra/ChakraProviderSetup";
22
import { revalidatePath } from "next/cache";
33
import { notFound, redirect } from "next/navigation";
44
import { fetchDeployMetadata } from "thirdweb/contract";
5+
import { getUserThirdwebClient } from "@/api/auth-token";
56
import { ContractPublishForm } from "@/components/contract-components/contract-publish-form";
67
import { getActiveAccountCookie, getJWTCookie } from "@/constants/cookie";
7-
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
88
import { serverThirdwebClient } from "@/constants/thirdweb-client.server";
99
import { getLatestPublishedContractsWithPublisherMapping } from "../../../published-contract/[publisher]/[contract_id]/utils/getPublishedContractsWithPublisherMapping";
1010

@@ -68,14 +68,15 @@ export default async function PublishContractPage(
6868
redirect(`/login?next=${encodeURIComponent(pathname)}`);
6969
}
7070

71+
const userThirdwebClient = await getUserThirdwebClient({
72+
teamId: undefined,
73+
});
74+
7175
return (
7276
<div className="container flex max-w-[1130px] flex-col gap-8 py-8">
7377
<ChakraProviderSetup>
7478
<ContractPublishForm
75-
client={getClientThirdwebClient({
76-
jwt: token,
77-
teamId: undefined,
78-
})}
79+
client={userThirdwebClient}
7980
isLoggedIn={!!token}
8081
onPublishSuccess={async () => {
8182
"use server";

0 commit comments

Comments
 (0)