Create a Item
Initiates the creation of a new item based on provided data.
Lock Items
Locks items based on their IDs or a collection ID.
Mint Items
Requests the minting of one or more items.
Check mint request
Check the status of a mint request
Delete a single item
Delete items that are not minted or not being minted
async function createItem(data) {
const { collectionId, attributes, itemTypeId } = data;
try {
const headers = new Headers();
headers.append("Content-Type", "application/json");
headers.append("Phosphor-Api-Key", phosphorApiKey);
return fetch(`${phosphorApiUrl}/v1/items`, {
method: "POST",
headers,
body: JSON.stringify({
collection_id: collectionId,
attributes: {
title: attributes.title,
description: attributes.description,
image_url: attributes.image_url,
...attributes.otherAttributes,
},
item_type_id: itemTypeId,
}),
});
} catch (error) {
console.log(error);
}
}