Cloning OpenSea NFT Boilerplate Questions

I did click “try it out” and after that entered the parameters and clicked execute. Is this only for paid tier because I am logged in and I see a locked svg next to the get /{address}/nft tab and I have a free tier

No it is not locked for free accounts. If you give me the contract address you’re using, I can show you an example.

contract address: 0x7EA60830390C80089508De230D303C0b44290773
polygon mainnet

So I clicked Try it out, put polygon as the chain, then your contract address and clicked Execute. Then I put the cursor from the first response into the cursor field and re-executed to get the next page. This is how you can use cursor.

1 Like

I was using /{address}/nft instead of /nft/{address} my bad. Thanks for the help

Does the 404 error happen on any page (except for / or home) when you reload it? If so it’s an issue of routing/redirects that you need to set up with your hosting provider.

Everything looks ok with your server, does it happen with any amount over 999? What is the error response you get in your browser when you try to sell?

Yes, it does it to me on every page…

It does not work unfortunatelyCapture d’écran 2022-06-11 051854

I installed it about 30 minutes ago… is it not updated…? or how to update it?

Sry the fix is here…Try changing this line of code in NFTBalance.jsx line 38 to the Moralis.Units.ETH() for calculating the const p.

    //const p = listPrice * ("1e" +18);
    const p = Moralis.Units.ETH(listPrice);
2 Likes

Thank you… actually… it works !!

By chance, a small idea for this problem??

when I reload the page I have this error ( when I backtrack too )

Error 404 - Not found

The required file was not found. It may be a technical error. Please retry later. If you cannot access the file after several attempts, it has been deleted.

This is happening in your localhost? or is it an error from any other function.

No, no problem locally… Only when I deploy it on the web

Ohk got it. Just read your last posts. Do you happen to know which function is causing the error.

No ser… Maybe I got the route wrong…?

import { useEffect, useState} from "react";

import { useMoralis } from "react-moralis";

import {

  BrowserRouter as Router,

  Switch,

  Route,

  NavLink,

  Redirect,

} from "react-router-dom";

import Account from "components/Account";

import Chains from "components/Chains";

import NFTBalance from "components/NFTBalance";

import NFTTokenIds from "components/NFTTokenIds";

import { Menu, Layout} from "antd";

import SearchCollections from "components/SearchCollections";

import "antd/dist/antd.css";

import NativeBalance from "components/NativeBalance";

import "./style.css";

import Text from "antd/lib/typography/Text";

import NFTMarketTransactions from "components/NFTMarketTransactions";

const { Header, Footer } = Layout;

const styles = {

  content: {

    display: "flex",

    justifyContent: "center",

    fontFamily: "Roboto, sans-serif",

    color: "#041836",

    marginTop: "130px",

    padding: "10px",

  },

  header: {

    position: "fixed",

    zIndex: 1,

    width: "100%",

    background: "#fff",

    display: "flex",

    justifyContent: "space-between",

    alignItems: "center",

    fontFamily: "Roboto, sans-serif",

    borderBottom: "2px solid rgba(0, 0, 0, 0.06)",

    padding: "0 10px",

    boxShadow: "0 1px 10px rgb(151 164 175 / 10%)",

  },

  headerRight: {

    display: "flex",

    gap: "20px",

    alignItems: "center",

    fontSize: "15px",

    fontWeight: "600",

  },

};

const App = ({ isServerInfo }) => {

  const { isWeb3Enabled, enableWeb3, isAuthenticated, isWeb3EnableLoading } =

    useMoralis();

  const [inputValue, setInputValue] = useState("explore");

  useEffect(() => {

    if (isAuthenticated && !isWeb3Enabled && !isWeb3EnableLoading) enableWeb3();

    // eslint-disable-next-line react-hooks/exhaustive-deps

  }, [isAuthenticated, isWeb3Enabled]);

  return (

    <Layout style={{ height: "100vh", overflow: "auto" }}>

      <Router>

        <Header style={styles.header}>

          <Logo />

          <SearchCollections style={{ borderRadius: "20px" }} setInputValue={setInputValue}/>

          <Menu

            theme="light"

            mode="horizontal"

            style={{

              display: "flex",

              fontSize: "17px",

              fontWeight: "500",

              marginLeft: "50px",

              width: "100%",

            }}

            defaultSelectedKeys={["nftMarket"]}

          >

            <Menu.Item key="nftMarket" onClick={() => setInputValue("explore")} >

              <NavLink to="/NFTMarketPlace">🎟️ Market</NavLink>

            </Menu.Item>

            <Menu.Item key="nft">

              <NavLink to="/nftBalance">🎫 Your Ticket(s)</NavLink>

            </Menu.Item>

            <Menu.Item key="buy now">

            <a

            href="https://www.cllottery-dapp.online/"

            target="_blank"

            rel="noopener noreferrer"

          >

           🏪 Buy Now

          </a>

            </Menu.Item>

            <Menu.Item key="transactions">

              <NavLink to="/Transactions">📑 Your Transactions</NavLink>

            </Menu.Item>

          </Menu>

          <div style={styles.headerRight}>

            <Chains />

            <NativeBalance />

            <Account />

          </div>

        </Header>

        <div style={styles.content}>

          <Switch>

            <Route path="/nftBalance">

              <NFTBalance />

            </Route>

            <Route path="/nftBalance">

              <NFTBalance />

            </Route>

            <Route path="/NFTMarketPlace">

              <NFTTokenIds inputValue={inputValue} setInputValue={setInputValue}/>

            </Route>

            <Route path="/Transactions">

              <NFTMarketTransactions />

            </Route>

          </Switch>

          <Redirect to="/NFTMarketPlace" />

        </div>

      </Router>

      <Footer style={{ margin: "auto", textAlign: "center", width: 240, borderRadius: "20px" }}>

        <Text style={{ display: "block" }}>

        Join our {""}

          <a

            target="_blank"

            rel="noopener noreferrer"

            href="https://t.me/CLLottery"

          >

            Telegram

          </a>

        </Text>

        <Text style={{ display: "block" }}>

        Follow us on{" "}

          <a

            target="_blank"

            rel="noopener noreferrer"

            href="https://twitter.com/Cro_LiveLottery"

          >

            Twitter

          </a>

        </Text>

      </Footer>

    </Layout>

  );

};

Humm strange it works locally but not on the net… for the price

This would be a react-router issue that happens when the project is deployed. You can contact your hosting provider for a fix. There are tutorials that show how to fix it for other platforms like Netlify; your provider may have documentation on it.

ok … it’s already 6am lol it will definitely open soon lol :sweat_smile: :joy:

Are you sure the updated code is loaded on the net

Yes I think so because I’m the one doing the transfers… usually it’s fast

can you add the console log of the calculated const p and test for prices greater than 999 on the net?
The result price number should not be in 1e format as this is the cause of the error.