Marketplace
(In Beta)
Last updated
(In Beta)
Last updated
Creating an NFT marketplace with Candy Shop as easy as rendering a few React components that take some common parameters:
candyShop: Candy Shop instance, which can be instantiated after you create a shop on the . See for details.
wallet: Connected user wallet, which is an object that contains the wallet address (i.e. publicKey) and a web3Modal instance. Refer to the in the Github repo for a sample implementation.
walletConnectComponent: React component that functions as a button for user to connect and disconnect Metamask and other EVM wallets. Refer to EthConnectButton in the in the Github repo for sample implementation.
Show the NFTs that are for sale and allow users to connect their wallet and buy them.
Additional params:
filters: Array<{ name: string, identifier: number, attribute?: { key: value }}>
You can let users filter by NFT collection by specifying the filters parameter. Name is the label shown in the filter box. Identifier is the unique NFT collection identifier, which you can get by whitelisting an NFT collection in My Shop or by using the getIdentifier helper method in the Candy Shop library. You can also specify an optional attribute parameter to filter orders for NFTs with that attribute.
identifiers: Array<number>
By default, only show orders from certain NFT collections. Takes an array of identifiers.
url: string
When user clicks on an NFT order, direct user to a new route instead of opening a buy NFT modal. Route should be in form of /my-route/:tokenMint
where :tokenMint
will be replaced by the NFT token mint
Show sell interface that allows users to connect their wallet and list their NFTs for sale.
Enable Cache NFT
We also provide the optional prop for Sell component to enable cache NFT that will store connected wallet's NFT in IndexedDB. The CandyShop IDB will auto be deleted once remove the enableCacheNFT prop or set it as false
.
Show key stats about your collection
Show activity in your shop. By default, activity is sorted by descending transaction time. You can also sort activity by price or name by specifying the optional `orderBy` argument as shown below.
Show buy interface for a single NFT order. This component can be used by specifying the url
param to the Orders component. Token mint can be parsed from the URL and inserted into the OrderDetail component.
CandyShopDataValidator
is a React context provider that enables real-time updates to orders and transactions that take place in your shop. It does so by listening to the socket session of the Candy Shop backend at regular intervals and applying any updates to child Candy Shop UI components.
You can use it by wrapping Candy Shop UI components with CandyShopDataValidator
:
You can create a completely custom marketplace by working directly with @liqnft/candy-shop-sdk
. You can install Candy Shop SDK directly like so:
or
This will also install the up to date @liqnft/candy-shop-sdk
as dependencies. Then you can use the import statement below to use SDK.
Please refer to the components in /core/ui/src
to see how various methods are called. For more detailed usage guide, please reference the sdk
source code at