From 34de2a321c07bc71613ba1d22767f24339228fd4 Mon Sep 17 00:00:00 2001 From: Kien Ngo Date: Fri, 15 Nov 2024 02:24:31 +0700 Subject: [PATCH] update --- apps/dashboard/src/app/drops/[slug]/data.ts | 8 ++++++++ apps/dashboard/src/app/drops/[slug]/mint-ui.tsx | 7 +++++++ apps/dashboard/src/app/drops/[slug]/page.tsx | 1 + 3 files changed, 16 insertions(+) diff --git a/apps/dashboard/src/app/drops/[slug]/data.ts b/apps/dashboard/src/app/drops/[slug]/data.ts index 079ef6fcb9c..d8c347763e6 100644 --- a/apps/dashboard/src/app/drops/[slug]/data.ts +++ b/apps/dashboard/src/app/drops/[slug]/data.ts @@ -1,4 +1,5 @@ import type { Metadata } from "next"; +import type { GaslessOptions } from "thirdweb/transaction"; type DropPageData = { slug: string; @@ -9,6 +10,7 @@ type DropPageData = { // If not defined, we will use the image of the NFT or contract's image thumbnail?: string; metadata: Metadata; + gasless?: GaslessOptions; } & ({ type: "erc1155"; tokenId: bigint } | { type: "erc721" }); export const DROP_PAGES: DropPageData[] = [ @@ -45,6 +47,12 @@ export const DROP_PAGES: DropPageData[] = [ "This exclusive commemorative NFT marks the official launch of ZERĪ´'s mainnet and our exciting partnership with thirdweb. Own a piece of this milestone in blockchain history as we make onchain transactions free with zero.network", }, }, + gasless: { + provider: "engine", + relayerForwarderAddress: "", + relayerUrl: + "https://thirdweb.engine-usw2.thirdweb.com/relayer/790e2b34-a35d-4526-9396-f2163eb6e3a5", + }, }, // Add more chains here diff --git a/apps/dashboard/src/app/drops/[slug]/mint-ui.tsx b/apps/dashboard/src/app/drops/[slug]/mint-ui.tsx index 24093d6ba31..407da99293d 100644 --- a/apps/dashboard/src/app/drops/[slug]/mint-ui.tsx +++ b/apps/dashboard/src/app/drops/[slug]/mint-ui.tsx @@ -21,6 +21,7 @@ import { useActiveAccount, useReadContract, } from "thirdweb/react"; +import type { GaslessOptions } from "thirdweb/transaction"; type Props = { contract: ThirdwebContract; @@ -36,6 +37,7 @@ type Props = { currencySymbol: string | null; noActiveClaimCondition: false; quantityLimitPerWallet: bigint; + gasless?: GaslessOptions; } | { noActiveClaimCondition: true } ); @@ -181,6 +183,11 @@ export function NftMint(props: Props) { contractAddress={props.contract.address} chain={props.contract.chain} client={props.contract.client} + gasless={ + props.noActiveClaimCondition === false + ? props.gasless + : undefined + } claimParams={ props.type === "erc1155" ? { diff --git a/apps/dashboard/src/app/drops/[slug]/page.tsx b/apps/dashboard/src/app/drops/[slug]/page.tsx index 41d084d0cdd..5aa04f340b4 100644 --- a/apps/dashboard/src/app/drops/[slug]/page.tsx +++ b/apps/dashboard/src/app/drops/[slug]/page.tsx @@ -112,6 +112,7 @@ export default async function DropPage({ pricePerToken={pricePerToken} noActiveClaimCondition={false} quantityLimitPerWallet={claimCondition.quantityLimitPerWallet} + gasless={project.gasless} {...project} /> );