DEV Community

Jonathan Bakebwa
Jonathan Bakebwa

Posted on

Performing Marketplace Transactions with the Mirror World Smart SDK

An 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. Here's a quick guide showing a few methods of making transactions:

1. Marketplace Methods

You can create, update, and query marketplaces using the SDK, which 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

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

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

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

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

Cancel NFT Listing: You may also cancel an NFT listing.

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

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

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

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

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

3. Fetch NFTs

It could also be to display NFTs 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.

There could be a number of reasons why you may want to fetch an NFT or a list of NFTs. 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. Learn more about different methods that you can make using an SDK through this guide on performing marketplace transactions: [https://docs.mirrorworld.fun/guides/marketplace-transactions-with-mirrorworld-sdk].

Top comments (0)