Skip to main content
BETA
HomeIntegration BuilderAPI ReferenceGuides
View Mirror World on Github
Join the Discord server

Performing Marketplace Transactions with the Mirror World Smart SDK

By David C. Nwadiogbu

The Mirror World Smart SDK not only helps you create dedicated Marketplaces for your NFTs and NFT collections, but it also equips you with different ways to perform transactions in the marketplace.

In this guide, we’ll look at the different marketplace transactions that you can make using the Mirror World Smart SDK.

Mirror World Smart SDK Marketplace Transactions

1. Marketplace Methods

You can create, update, and query marketplaces using the Mirror World Smart SDK. The SDK provides methods that make setting up your very own marketplace seamless. Go through this comprehensive guide on how to create NFT Marketplaces using the SDK to learn more.

2. NFT Transaction Methods

The Mirror World Smart SDK has a number of methods that allow you to manage your NFTs.

Let’s look at some of these methods and what they do:

  • list NFT: This is used to list an NFT on the marketplace.

_6
// how to list an NFT on a marketplace using the Mirror World JS SDK
_6
_6
const listing = await mirrorworld.listNFT({
_6
mintAddress: `Hc2My3GQCQTXTjV34Pi1pQGYUeckT1mEcMRiZZaH7Ydr`,
_6
price: 2, // Amount in SOL
_6
})

  • update NFT listing: You may update NFT listing details on the marketplace. e.g the price of the NFT.

_6
// how to update an NFT listing on a marketplace using the Mirror World JS SDK
_6
_6
const listing = await mirrorworld.updateNFTListing({
_6
mintAddress: `Hc2My3GQCQTXTjV34Pi1pQGYUeckT1mEcMRiZZaH7Ydr`,
_6
price: 2, // Amount in SOL
_6
})

  • cancel NFT listing: You may also cancel an NFT listing.

_6
// how to cancel an NFT listing on a marketplace using the Mirror World JS SDK
_6
_6
const listing = await mirrorworld.cancelNFTListing({
_6
mintAddress: `Hc2My3GQCQTXTjV34Pi1pQGYUeckT1mEcMRiZZaH7Ydr`,
_6
price: 2, // Amount in SOL
_6
})

  • buy NFT: This can be used to purchase an NFT on the Mirror World marketplace.

_6
// how to list buy an NFT on a marketplace using the Mirror World JS SDK
_6
_6
const listing = await mirrorworld.buyNFT({
_6
mintAddress: `Hc2My3GQCQTXTjV34Pi1pQGYUeckT1mEcMRiZZaH7Ydr`,
_6
price: 2, // Amount in SOL
_6
})

  • transfer NFT: If you would like to transfer an NFT from a holder's wallet to another address.

_6
// how to transfer an NFT on a marketplace using the Mirror World JS SDK
_6
_6
const listing = await mirrorworld.transferNFT({
_6
mintAddress: `Hc2My3GQCQTXTjV34Pi1pQGYUeckT1mEcMRiZZaH7Ydr`,
_6
recipientAddress: `C64RkD2jnvrFF8mi9FUBwfhNHuuiPuRMzCLRSWcyJKUG`,
_6
})

3. Fetch NFTs

There could be a number of reasons why you may want to fetch an NFT or a list of NFTs. It could be to display them in a dApp or list them on a marketplace. Whatever the reason, the Mirror World Smart SDK provides a variety of ways in which you can successfully fetch these NFTs and work with them.

Here are the different ways you may fetch an NFT:

  • by Mint Address: by providing a mint address or list of mint addresses, you can retrieve all the NFTs associated with the provided mint address(es)

_7
//how to fetch NFTs by mint address using the Mirror World JS SDK
_7
_7
const nftsQueryResult = await mirrorworld.fetchNFTsByMintAddresses({
_7
mintAddresses: [`Hc2My3GQCQTXTjV34Pi1pQGYUeckT1mEcMRiZZaH7Ydr`], // can take one mint address or a list of mint addresses
_7
limit: 20, // page size
_7
offset: 0, // page number
_7
})

  • by Creator Address or Owner: similarly, you can fetch a list of NFTs using the creator address(es)

_7
//how to fetch NFTs by creator address using the Mirror World JS SDK
_7
_7
const nftsQueryResult = await mirrorworld.fetchNFTsByCreatorAddresses({
_7
creatorAddresses: [`Hc2My3GQCQTXTjV34Pi1pQGYUeckT1mEcMRiZZaH7Ydr`], // can take one creator address or a list of creator addresses
_7
limit: 20, // page size
_7
offset: 0, // page number
_7
})

  • by Update Authorities: update authorities are what identify the owner of an NFT and allow them to be able to perform certain upgrades and mutate the state of the NFT. You may fetch NFTs using the update authority of that NFT.

_6
//how to fetch NFTs by update authorities using the Mirror World JS SDK
_6
_6
const nftsQueryResult = await mirrorworld.fetchNFTsByUpdateAuthorities({
_6
updateAuthorities: [`Hc2My3GQCQTXTjV34Pi1pQGYUeckT1mEcMRiZZaH7Ydr`], // can take one update authority or a list of update authorities
_6
offset: 0, // page number
_6
})

What’s Next

It’s quite effortless and straightforward to start performing marketplace transactions with the Mirror World Smart SDK. From creating a marketplace to listing an NFT on that marketplace, there are a lot of options available to you as a developer to start building your next killer dApp. Check out the documentation along with the API reference for the framework of your choice to learn more and fully utilize the SDK.

Edit this page on GitHub

Copyright © Mirror World, Inc. 2023
On this page

Home

Tutorials

Guides

API Reference