diff --git a/package.json b/package.json index b44edca..b3dc7e4 100644 --- a/package.json +++ b/package.json @@ -49,9 +49,9 @@ "@chakra-ui/react": "^2.1.0", "@emotion/react": "^11", "@emotion/styled": "^11", - "@thirdweb-dev/react": "^3.8.0-dev-8d8b6a1", - "@thirdweb-dev/sdk": "^3.8.0-dev-8d8b6a1", - "@thirdweb-dev/storage": "^1.0.7-nightly-f295ec6", + "@thirdweb-dev/react": "^3.9.2", + "@thirdweb-dev/sdk": "^3.9.2", + "@thirdweb-dev/storage": "^1.0.10", "color": "^4.2.3", "ethers": "^5.7.0", "flat": "^5.0.2", diff --git a/src/embeds/erc1155.tsx b/src/embeds/erc1155.tsx index 6140d4d..de91031 100644 --- a/src/embeds/erc1155.tsx +++ b/src/embeds/erc1155.tsx @@ -74,19 +74,18 @@ const Erc1155Embed: React.FC = ({ const urlParams = new URL(window.location.toString()).searchParams; const App: React.FC = () => { - const chainId = Number(urlParams.get("chainId")); + const chain = JSON.parse(urlParams.get("chain") || ""); const contractAddress = urlParams.get("contract") || ""; - const rpcUrl = urlParams.get("rpcUrl") || ""; const tokenId = urlParams.get("tokenId") || "0"; const relayerUrl = urlParams.get("relayUrl") || ""; const biconomyApiKey = urlParams.get("biconomyApiKey") || ""; const biconomyApiId = urlParams.get("biconomyApiId") || ""; - const ipfsGateway = parseIpfsGateway(urlParams.get("ipfsGateway") || ""); - const colorScheme = urlParams.get("theme") === "dark" ? "dark" : "light"; const primaryColor = urlParams.get("primaryColor") || "purple"; + const ipfsGateway = parseIpfsGateway(urlParams.get("ipfsGateway") || ""); + const sdkOptions = useGasless(relayerUrl, biconomyApiKey, biconomyApiId); return ( @@ -101,7 +100,7 @@ const App: React.FC = () => { /> { }) : undefined } - chainRpc={rpcUrl ? { [chainId]: rpcUrl } : undefined} > = ({ const urlParams = new URL(window.location.toString()).searchParams; const App: React.FC = () => { - const chainId = Number(urlParams.get("chainId")); + const chain = JSON.parse(urlParams.get("chain") || ""); const contractAddress = urlParams.get("contract") || ""; - const rpcUrl = urlParams.get("rpcUrl") || ""; const relayerUrl = urlParams.get("relayUrl") || ""; const biconomyApiKey = urlParams.get("biconomyApiKey") || ""; const biconomyApiId = urlParams.get("biconomyApiId") || ""; - const ipfsGateway = parseIpfsGateway(urlParams.get("ipfsGateway") || ""); const colorScheme = urlParams.get("theme") === "dark" ? "dark" : "light"; const primaryColor = urlParams.get("primaryColor") || "purple"; + const ipfsGateway = parseIpfsGateway(urlParams.get("ipfsGateway") || ""); + const sdkOptions = useGasless(relayerUrl, biconomyApiKey, biconomyApiId); return ( @@ -94,7 +94,7 @@ const App: React.FC = () => { /> { }) : undefined } - chainRpc={rpcUrl ? { [chainId]: rpcUrl } : undefined} > = ({ const urlParams = new URL(window.location.toString()).searchParams; const App: React.FC = () => { - const chainId = Number(urlParams.get("chainId")); + const chain = JSON.parse(urlParams.get("chain") || ""); const contractAddress = urlParams.get("contract") || ""; - const rpcUrl = urlParams.get("rpcUrl") || ""; const relayerUrl = urlParams.get("relayUrl") || ""; const biconomyApiKey = urlParams.get("biconomyApiKey") || ""; const biconomyApiId = urlParams.get("biconomyApiId") || ""; @@ -96,7 +95,7 @@ const App: React.FC = () => { /> { }) : undefined } - chainRpc={rpcUrl ? { [chainId]: rpcUrl } : undefined} > = ({ const urlParams = new URL(window.location.toString()).searchParams; const App: React.FC = () => { - const chainId = Number(urlParams.get("chainId")); + const chain = JSON.parse(urlParams.get("chain") || ""); const contractAddress = urlParams.get("contract") || ""; - const rpcUrl = urlParams.get("rpcUrl") || ""; const directListingId = urlParams.get("directListingId") || ""; const englishAuctionId = urlParams.get("englishAuctionId") || ""; const relayerUrl = urlParams.get("relayUrl") || ""; @@ -703,7 +702,7 @@ const App: React.FC = () => { /> { }) : undefined } - chainRpc={rpcUrl ? { [chainId]: rpcUrl } : undefined} > = ({ const urlParams = new URL(window.location.toString()).searchParams; const App: React.FC = () => { - const chainId = Number(urlParams.get("chainId")); + const chain = JSON.parse(urlParams.get("chain") || ""); const contractAddress = urlParams.get("contract") || ""; - const rpcUrl = urlParams.get("rpcUrl") || ""; const listingId = urlParams.get("listingId") || ""; const relayerUrl = urlParams.get("relayUrl") || ""; const biconomyApiKey = urlParams.get("biconomyApiKey") || ""; @@ -675,7 +674,7 @@ const App: React.FC = () => { /> { }) : undefined } - chainRpc={rpcUrl ? { [chainId]: rpcUrl } : undefined} >