To create and prepare an NFT listing, creators have to perform the following steps:
import { NftClient } from '../src';
import { LAUNCHPAD_ID, PACKAGE_OBJECT_ID, signer } from './common';
export const initLaunchpadSlot = async () => {
const pubKey = await signer.getAddress();
const transaction = NftClient.buildInitSlot({
packageObjectId: PACKAGE_OBJECT_ID,
slotAdmin: `0x${pubKey}`, // launchpad admin,
receiver: `0x${pubKey}`, // launchpad receiver
launchpad: LAUNCHPAD_ID,
});
const initLaunchpadSlotResult = await signer.executeMoveCall(transaction);
console.log('initLaunchpadSlotResult', JSON.stringify(initLaunchpadSlotResult));
};
initLaunchpadSlot();
import { NftClient } from '../src';
import { PACKAGE_OBJECT_ID, signer } from './common';
export const createInventory = async () => {
const transaction = NftClient.buildCreateInventoryTx({
packageObjectId: PACKAGE_OBJECT_ID,
isWhitelisted: false,
});
const createInventoryResult = await signer.executeMoveCall(transaction);
console.log('createInventoryResult', JSON.stringify(createInventoryResult));
};
createInventory();
import { NftClient } from '../src';
import {
INVENTORY_ID, LAUNCHPAD_SLOT_ID, PACKAGE_OBJECT_ID, signer
} from './common';
export const createMarket = async () => {
const transaction = NftClient.buildCreateFixedPriceMarketWithInventory({
packageObjectId: PACKAGE_OBJECT_ID,
slot: LAUNCHPAD_SLOT_ID,
inventoryId: INVENTORY_ID,
price: 100,
});
const createMarketResult = await signer.executeMoveCall(transaction);
console.log('createMarketResult', JSON.stringify(createMarketResult));
};
createMarket();