delist still shows active listing
elliotBraem opened this issue · 2 comments
I have an NFT that I listed then delisted via the SDK. You can see that token here
Below are code snippets for listing and delisting, although I do notice that compared to the documentation, { wallet } and args are switched in the execute call. I'll switch them but I don't think that should have mattered.
Code snippet for listing:
const handleListThing = async () => {
const wallet = await selector.wallet();
const args = {
nftContractId: thing.node.nft.nft_contract_id,
price: "100",
tokenId: thing.node.nft.token_id,
marketId: "market-v2-beta.mintspace2.testnet",
};
await execute(list(args), { wallet: wallet });
};
Code snippet for delisting:
const handleDelistThing = async () => {
const wallet = await selector.wallet();
const args = {
nftContractId: thing.node.nft.nft_contract_id,
tokenId: thing.node.nft.token_id,
marketId: "market-v2-beta.mintspace2.testnet",
};
await execute(delist(args), { wallet: wallet });
};
After the delist I am still seeing the token in mb_views_active_listings:
{
"data": {
"mb_views_active_listings": [
{
"approval_id": 4,
"base_uri": "https://arweave.net",
"content_flag": null,
"created_at": "2023-01-04T00:14:54.98842",
"currency": "near",
"description": null,
"extra": null,
"kind": "simple",
"listed_by": "everything.testnet",
"market_id": "market-v2-beta.mintspace2.testnet",
"media": null,
"metadata_id": "everything.mintspace2.testnet:bbc881f8c8dad31361911bdf9d80f1a3",
"minter": "everything.testnet",
"nft_contract_id": "everything.mintspace2.testnet",
"price": 100,
"receipt_id": "FrNoq4v56Wg3ZYJ8e2C6jiU5d9PtNE8NiocCLNkXEp6Z",
"reference": "3d9f895b-7703-4f67-9d96-568f0b453970",
"reference_blob": null,
"title": null,
"token_id": "6"
}
]
}
}
If I view more info via nft_listings query, I see that "unlisted_at" is null.
{
"data": {
"nft_listings": [
{
"accepted_at": null,
"accepted_offer_id": null,
"invalidated_at": null,
"metadata_id": "everything.mintspace2.testnet:bbc881f8c8dad31361911bdf9d80f1a3",
"price": 100,
"unlisted_at": null
}
]
}
}
On the UI however, it seems that the token has been recognized as unlisted since the button available is "List". What query does it use to determine this? I'm assuming something from mb_views_nft_tokens, but unlisted_at is still null here
^ this has been using a tarball generated from commit 7a1be99
Have just pulled in the latest release, will try again with token #7 on everything.mintspace2.testnet contract. These are the results:
List successful, I see it in mb_views_active_listings.
Had to change delist args to have an array of tokens (this should be updated on docs), but delist is successful. I see it removed from active listings. I see unlisted_at populated.
Perfect, thanks!
Thank you for reporting and including all the details. Good it's working now, we'll update the docs accordingly!