Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions apps/playground-web/src/app/insight/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,22 @@ export async function fetchBlueprintSpec(params: {
}

export async function fetchAllBlueprints() {
// fetch list
const blueprintSpecs = await fetchBlueprintList();

// fetch all blueprints
const blueprints = await Promise.all(
blueprintSpecs.map((spec) =>
fetchBlueprintSpec({
blueprintId: spec.id,
}),
),
);

return blueprints;
try {
// fetch list
const blueprintSpecs = await fetchBlueprintList();

// fetch all blueprints
const blueprints = await Promise.all(
blueprintSpecs.map((spec) =>
fetchBlueprintSpec({
blueprintId: spec.id,
}),
),
);

return blueprints;
} catch (error) {
console.error(error);
return [];
}
}
9 changes: 4 additions & 5 deletions apps/playground-web/src/components/pay/direct-payment.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use client";

import { sepolia } from "thirdweb/chains";
import { base } from "thirdweb/chains";
import { PayEmbed, getDefaultToken } from "thirdweb/react";
import { THIRDWEB_CLIENT } from "../../lib/client";
import { StyledConnectButton } from "../styled-connect-button";
Expand All @@ -16,9 +15,9 @@ export function BuyMerchPreview() {
payOptions={{
mode: "direct_payment",
paymentInfo: {
amount: "0.1",
chain: sepolia,
token: getDefaultToken(sepolia, "USDC"),
amount: "2",
chain: base,
token: getDefaultToken(base, "USDC"),
sellerAddress: "0xEb0effdFB4dC5b3d5d3aC6ce29F3ED213E95d675",
},
metadata: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useTheme } from "next-themes";
import { getContract } from "thirdweb";
import { base, sepolia } from "thirdweb/chains";
import { base, polygon } from "thirdweb/chains";
import { transfer } from "thirdweb/extensions/erc20";
import { claimTo, getNFT } from "thirdweb/extensions/erc1155";
import {
Expand All @@ -21,12 +21,12 @@ const nftContract = getContract({
client: THIRDWEB_CLIENT,
});

const USDC = getDefaultToken(sepolia, "USDC");
const USDC = getDefaultToken(polygon, "USDC");

const usdcContract = getContract({
// biome-ignore lint/style/noNonNullAssertion: its there
address: USDC!.address,
chain: sepolia,
chain: polygon,
client: THIRDWEB_CLIENT,
});

Expand Down Expand Up @@ -55,6 +55,7 @@ export function PayTransactionPreview() {
to: account?.address || "",
}),
metadata: nft?.metadata,
buyWithFiat: false,
}}
/>
)}
Expand All @@ -69,6 +70,7 @@ export function PayTransactionButtonPreview() {
return (
<>
<StyledConnectButton />
<div className="h-10" />
{account && (
<div className="flex flex-col items-center justify-center gap-2">
<div className="flex items-center gap-2">
Expand Down
Loading
Loading