Marketplace
Cometh ConnectCometh MarketplaceCometh checkout
  • Demo
  • API reference doc
  • SDK reference doc
  • 🚀Quickstart
    • Getting started
    • Core concepts
    • API cheatsheet
    • Third party helpers
  • 🛠️Core features
    • Get collection data
    • Assets search engine
    • Creating an order
    • Searching orders
    • Filling an order
    • Cancelling an order
  • ⚗️Advanced features
    • Tracking indexing
    • Get asset transfers
    • Admin routes
    • Refreshing metadata
    • Webhooks
  • 📖Resources
    • Why Cometh Marketplace
    • Order flow
    • Preparing for transactions
    • Sponsoring transactions
Powered by GitBook
On this page
  • Intallation
  • Creating a project
  • Get your API Keys
  • Initializing the SDK
  • Getting a user's assets
  • Next steps
  1. Quickstart

Getting started

Last updated 8 months ago

Our tutorials show how to build with the marketplace-api using the Typescript SDK. However, all the routes can be accessed directly as described in the . You can experience the provided experience on .

Both ERC721 and ERC1155 NFT collections can be quickly registered and a ready-to-use marketplace can be bootstrapped in minutes.

The easiest way to set up your marketplace is to use . It can be easily configured for your collection once you have registered it on your new project.

Intallation

To add the to your project, you can use npm or yarn:

npm install @cometh/marketplace-sdk
yarn add @cometh/marketplace-sdk

The SDK works both in the browser and in Node. The available functions are described in detail in the . In any case, we advise using the SDK documentation to explore route typings as it is more explicit.

Creating a project

To use Cometh Connect, the first step is to get your api keys at . If this is your first time using Cometh Connect, please so we can set you up with a Connect account and apiKey.

When creating a new project, choose the NFT marketplace feature.

You can also add an NFT marketplace scope to an existing project by switching product scope in your existing project.

Get your API Keys

On your dashboard, you can click the apiKey button to access all your project's credentials.

You now have your project API key, congrats ! It will be used in your front-end to authenticate public API calls

Initializing the SDK

When initializing your SDK, you need to pass the API url as well as the key for your project. The url corresponding to your project's network can be found on the API cheatsheet.

const networkApiUrl = 'https://api.marketplace.prod.core.cometh.tech/v1/doc'

const marketplaceSdk = new MarketplaceSdk({
  BASE: networkApiUrl,
  HEADERS: {
    apikey: 'YOUR_API_KEY'
  }
})

Getting a user's assets

Once our system has finished indexing your registered collection, we can easily search assets based on various criteria. For example, you can search all the assets owned by your logged in user.

const assetsSearch = await marketplaceSdk.asset.searchAssets({
  owner: userAddress,
  contractAddress: MY_COLLECTION_ADDRESS
})

const nbAssets = assetsSearch.total
const userAssets = assetsSearch.assets

Next steps

Building a marketplace will require to implement the different order operations supported by the API, mainly creating and filling orders.

If you want to expand your core knowledge of our marketplace system, we advise having a look at Core concepts.

To continue building, you will need to look at:

  • Get collection data

  • Creating an order

  • Filling an order

When setuping the project you will need to choose a network. If you don't see your network in the list, don't hesitate to so we can add it.

🚀
contact us
API reference documentation
our demo
our boilerplate
marketplace SDK
SDK reference documentation
https://app.cometh.io
reach out