A new page has been added to the application that allows direct linking to offers using a transaction ID.
- Direct Linking: Access offers directly via URL with transaction ID parameter
- Comprehensive Offer Display: Shows all offer details including price, timestamps, and status
- Token Information: Displays associated NFT metadata and images
- Navigation: Easy navigation to related collection and token pages
- Responsive Design: Works on both desktop and mobile devices
- Dark/Light Theme Support: Respects the user's theme preference
/offer/:txid
Where :txid is either:
- The transaction ID of the offer
- The marketplace listing ID (mpListingId) as a fallback
/offer/ABCD1234EFGH5678... (transaction ID)
/offer/12345 (marketplace listing ID)
- Offer Status: Active/Expired status with color coding
- Price Information: Formatted price with currency (VOI/other)
- Participant Details: Offerer address (truncated for display)
- Token Information: Collection ID, Token ID
- Timestamps: Creation and expiration dates
- Token Metadata: NFT name, image, and description (if available)
- View Token: Navigate to the specific token page
- View Collection: Navigate to the collection page
- All Offers: Navigate to the general offers listing page
The page uses the following endpoints:
${ARC72_INDEXER_API}/nft-indexer/v1/mp/offers- For fetching offer data${NFT_NAVIGATOR_API}/nft-indexer/v1/tokens- For fetching token metadata
- First attempts to find offer by transaction ID
- Falls back to marketplace listing ID if transaction ID not found
- Displays appropriate error message if offer cannot be found
- Loading states with spinner
- Error messages for missing offers
- Graceful fallback for missing token metadata
- Image error handling for broken NFT images
Added to src/App.tsx:
<Route path="/offer/:txid" element={<OfferDetail />} />- Main component:
src/pages/OfferDetail/index.tsx - Exported from:
src/pages/index.tsx
- React Router for URL parameters
- Material-UI for UI components
- Styled Components for custom styling
- Axios for API calls
- Redux for theme state management
Potential improvements that could be added:
- Direct Transaction Lookup: Enhanced API support for direct transaction ID queries
- Offer Actions: Allow users to accept/cancel offers directly from the page
- Related Offers: Show other offers for the same token/collection
- Share Functionality: Easy sharing of offer links
- Price History: Historical price data for the token
- Offer Notifications: Alert system for offer status changes
To test the new page:
- Start the development server:
npm run dev - Navigate to
/offer/[some-offer-id]in your browser - Verify that offer details are displayed correctly
- Test with both valid and invalid offer IDs
- Test navigation to related pages
The page handles various edge cases including missing offers, invalid transaction IDs, and missing token metadata.