@@ -8,7 +8,7 @@ import { css, Global } from "@emotion/react";
8
8
import { ThirdwebProvider , useContract , useNFT } from "@thirdweb-dev/react" ;
9
9
import { EditionDrop } from "@thirdweb-dev/sdk" ;
10
10
import { ThirdwebStorage } from "@thirdweb-dev/storage" ;
11
- import React , { useEffect , useMemo } from "react" ;
11
+ import React , { useEffect } from "react" ;
12
12
import { createRoot } from "react-dom/client" ;
13
13
import { ERC1155ClaimButton } from "src/shared/claim-button-erc1155" ;
14
14
import { TokenMetadataPage } from "../shared/token-metadata-page" ;
@@ -17,6 +17,7 @@ import { Header } from "../shared/header";
17
17
import chakraTheme from "../shared/theme" ;
18
18
import { fontsizeCss } from "../shared/theme/typography" ;
19
19
import { parseIpfsGateway } from "../utils/parseIpfsGateway" ;
20
+ import { useGasless } from "../shared/hooks/useGasless" ;
20
21
21
22
interface BodyProps {
22
23
children ?: React . ReactNode ;
@@ -90,23 +91,15 @@ const App: React.FC = () => {
90
91
const rpcUrl = urlParams . get ( "rpcUrl" ) || "" ;
91
92
const tokenId = urlParams . get ( "tokenId" ) || "0" ;
92
93
const relayerUrl = urlParams . get ( "relayUrl" ) || "" ;
94
+ const biconomyApiKey = urlParams . get ( "biconomyApiKey" ) || "" ;
95
+ const biconomyApiId = urlParams . get ( "biconomyApiId" ) || "" ;
93
96
94
97
const ipfsGateway = parseIpfsGateway ( urlParams . get ( "ipfsGateway" ) || "" ) ;
95
98
96
99
const colorScheme = urlParams . get ( "theme" ) === "dark" ? "dark" : "light" ;
97
100
const primaryColor = urlParams . get ( "primaryColor" ) || "purple" ;
98
101
99
- const sdkOptions = useMemo (
100
- ( ) =>
101
- relayerUrl
102
- ? {
103
- gasless : {
104
- openzeppelin : { relayerUrl } ,
105
- } ,
106
- }
107
- : undefined ,
108
- [ relayerUrl ] ,
109
- ) ;
102
+ const sdkOptions = useGasless ( relayerUrl , biconomyApiKey , biconomyApiId ) ;
110
103
111
104
return (
112
105
< >
0 commit comments