Giter VIP home page Giter VIP logo

marketplace-v3's Introduction

Important

This repository is outdated and no longer maintained. But we have something better for you!

Head over to this new repository: marketplace-template

The new marketplace template now comes with support for multiple chains and collections

NFT Marketplace V3

Create an NFT marketplace on top of your NFT collection on any EVM-compatible blockchain.

Features

  • List multiple collections into an aggregated marketplace
  • Customize branding and theme to your application

Installation

Install via thirdweb create

npx thirdweb create --template marketplace-v3

Environment Variables

To run this project, you will need to add environment variables. Check the .env.example file for all the environment variables required and add it to .env.local file or set them up on your hosting provider.

Run Locally

Install dependencies

  # npm
  npm install

  # yarn
  yarn install

Start the server

  # npm
  npm run dev

  # yarn
  yarn dev

Additional Resources

Contributing

Contributions and feedback are always welcome! Please check our open source page for more information.

Need help?

For help, please visit our support site.

marketplace-v3's People

Contributors

atharvadeosthale avatar avneesh0612 avatar ciaranightingale avatar gregfromstl avatar jakeloo avatar jarrodwatts avatar jnsdls avatar kien-ngo avatar manantank avatar mykcryptodev avatar saminacodes avatar warengonzaga avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

marketplace-v3's Issues

Build code failed

localhost colake-marketplace % yarn deploy
yarn run v1.22.19
$ next build && next export && npx thirdweb@latest upload out
Linting and checking validity of types ..Failed to compile.

./node_modules/abitype/dist/types/human-readable/formatAbi.d.ts:18:35
Type error: Type parameter declaration expected.

16 | * @returns Human-readable ABI
17 | */

18 | export declare function formatAbi<const TAbi extends Abi | readonly unknown[]>(abi: TAbi): FormatAbi;
| ^
19 | //# sourceMappingURL=formatAbi.d.ts.map
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

localhost colake-marketplace % node -v
v18.18.2

Issue when using with Bitindi Chain

import { CHAIN_ID_TO_NAME, NFT, ThirdwebSDK } from "@thirdweb-dev/sdk"; ('"@thirdweb-dev/sdk"' has no exported member named 'CHAIN_ID_TO_NAME'. Did you mean 'ChainIdOrName'?)

"isApprovedForAll",
nft.owner, (Argument of type 'string' is not assignable to parameter of type 'any[]'.ts(2345))
MARKETPLACE_ADDRESS
);

// If it is, provide approval
if (!hasApproval) {
  const txResult = await nftCollection?.call(
    "setApprovalForAll",
    MARKETPLACE_ADDRESS,  **Argument of type 'string' is not assignable to parameter of type 'any[]'.ts(2345)**
    true
  );

Fetch offers and set nextBid in the input field

Hello,

Thanks for writing this example. Its really useful. I am trying to get the offers received and place them in the placeholder of the Input component but I don't get it working.

I've tried the many approaches and it's driving me nuts. Here is my last one:

useEffect(() => {
    setLoadingMinimumNextBid(true);
    const fetchMinimumNextBid = async () => {
      if (auctionListing && auctionListing[0]) {
        const nextBid = await calcNextBid(marketplace, auctionListing[0]);
        setMinimumNextBid(nextBid);
      }
      setLoadingMinimumNextBid(false);
    };
    fetchMinimumNextBid();
  }, [auctionListing]);

  async function calcNextBid(
    marketplace: MarketplaceV3 | undefined,
    auctionListing: EnglishAuction | undefined,
  ): Promise<string | undefined> {
    if (!marketplace || !auctionListing) {
      console.debug("Either marketplace or auctionListing is undefined");
      return undefined;
    }
    const offers = await marketplace.offers.getAllValid({
      tokenContract: collectionAddress,
      tokenId: String(nft.id),
    });
    console.debug("Offers fetched: ${offers.length}");
    const bidBufferBps = auctionListing.bidBufferBps;
    const minimumBidCurrencyValue = auctionListing.minimumBidCurrencyValue.decimals;
    let highestBid = 0;
    if (offers.length > 0) {
      highestBid = offers.reduce((max, offer) => Math.max(Number(offer.totalPrice), max), 0);
      console.debug(`Highest bid from offers: ${highestBid}`);
    }
    const nextBid = highestBid > 0 
      ? ((highestBid * (1 + (bidBufferBps / 10000))).toString()) 
      : minimumBidCurrencyValue.toString();
    console.debug("Calculated next bid: ${nextBid}");
    return nextBid;
  }

No matter the approach I try, I get:
image

What I'm doing wrong?

Finish building this functionality and the timer for the end of the auctions would help devs so much.

Thanks!

BSC Not Support

Hello i now today using this thirdweb. since it's good using. and i build contract here too.. but the problem after add NFT i need using bnb network and this one sepolia. the bug happened after changes the code to BSC

From

import { sepolia } from "thirdweb/chains";
export const NETWORK = sepolia;

To

import { bsc } from "thirdweb/chains";
export const NETWORK = bsc;

Got error id thing. did anything i need fixed?

Error after attempting to load assets from the "Buy" page of imported contract. Error serializing '.contractMetadata.description'

After following your details instruction, which includes deploying my marketplacev3 contract and importing my ERC-721A collection on the Thirdweb dashboard, I continue to get an error on the "buy" component of the dapp. The NFTs from my collection do load successfully on the grid, but when I attempt to load anyone NFT to see further details this error shows up:
Server Error Error: Error serializing .contractMetadata.descriptionreturned fromgetStaticPropsin "/token/[contractAddress]/[tokenId]". Reason:undefinedcannot be serialized as JSON. Please usenull or omit this value.

I've also submitted a similar issue when attempting to load the marketplace contract and imported collection contract on the help section of the official discord which could be found here:

image

Traits not displaying in tokenid.tsx

The token detail page, tokenid.tsx is not displaying the trait name or value properly on my deployment. It only displays the key value and renders a blank object for each trait value. If I try to switch out the code to {value.value} and {value.trait_type} it works locally but fails to build for deployment.

<div className={styles.traitsContainer}> {Object.entries(nft?.metadata?.attributes || {}).map( ([key, value]) => ( <div className={styles.traitContainer} key={key}> <p className={styles.traitName}>{key}</p> <p className={styles.traitValue}> {value?.toString() || ""} </p> </div> ) )} </div>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.