Skip to content

fix: verify ownership on stale marketplace listings#285

Merged
MartianGreed merged 3 commits intomainfrom
fix/stale-order-verification
Feb 19, 2026
Merged

fix: verify ownership on stale marketplace listings#285
MartianGreed merged 3 commits intomainfrom
fix/stale-order-verification

Conversation

@MartianGreed
Copy link
Collaborator

Problem

When an NFT owner creates a sell listing and then transfers the token to another wallet, the listing remains in Placed status on-chain but is unfillable. These stale listings were shown to users in several code paths.

What changed

SDK (getToken())

  • Added ownership verification: cross-checks fetchTokenBalances() to confirm the listing owner still holds the token
  • Added expiration filter (rejects expired orders)
  • New verifyOwnership option (defaults to true, set false to skip)

Client (token detail page)

  • New collectionOrdersVerifiedAtom — same shape as collectionOrdersAtom ({ [token]: OrderModel[] }) but filters through collectionOwnershipAtom to verify on-chain ownership
  • useTokenDetailViewModel now uses collectionOrdersVerifiedAtom instead of collectionOrdersAtom

Previously already verified ✅

  • listCollectionListings() — already had verifyOwnership (default on)
  • verifiedCollectionOrdersAtom — already used in collection items view

Now also verified ✅

  • getToken() — SDK level
  • Token detail page — client level via collectionOrdersVerifiedAtom

Still unverified (by design)

  • getCollectionOrders() — raw query, returns all orders regardless of status (API contract)
  • ordersAtom / listingsAtom — global atoms, used for aggregation

SDK (getToken):
- Add ownership verification to getToken() listings
- Cross-check on-chain token balances before returning listings
- Add expiration check (filter out expired orders)
- New verifyOwnership option (default: true)

Client (token detail page):
- Add collectionOrdersVerifiedAtom that cross-checks ownership
  via collectionOwnershipAtom (same pattern as verifiedCollectionOrdersAtom
  but returns OrderModel[] instead of ListingWithUsd[])
- Switch useTokenDetailViewModel to use collectionOrdersVerifiedAtom
  so token detail page no longer shows stale listings

Fixes: stale orders shown when NFT owner transfers token after listing
@vercel
Copy link

vercel bot commented Feb 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
arcade Ready Ready Preview Feb 19, 2026 2:36pm
arcade-storybook Ready Ready Preview Feb 19, 2026 2:36pm

Request Review

@MartianGreed MartianGreed merged commit 4a976fd into main Feb 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant