Releases: 0xsequence/marketplace-sdk
2.0.1
Fix multi-chain collection lookup: Collections deployed on multiple chains could resolve to the wrong configuration (currencies, fees, filters, orderbook). Lookups now match on both address and chain ID. Fix OpenSea minimum offer price validation: The useConvertPriceToUSD hook was always disabled, so the $0.01 USD minimum for OpenSea offers was never enforced. Validation now runs correctly in the MakeOfferModal. Improve buy modal reliability: The generateBuyTransaction call now polls until data is available, preventing the modal from hanging on slow responses. Added a progressive loading indicator.
2.0.0
2.0.0
Major Release
This release introduces first-class support for Trails, complete headless mode for all modals, and a modernized type system with BigInt and viem compatibility.
Trails Integration - 1-Click Checkout
Trails is now the default checkout mode, enabling seamless 1-click purchases across any chain, with any token, from any wallet.
<MarketplaceProvider config={{
projectAccessKey: 'your-key',
projectId: 'your-project-id',
// checkoutMode: 'trails' is the default
}}>| Checkout Mode | Description |
|---|---|
'trails' |
Default - 1-click checkout with cross-chain support |
'crypto' |
Direct on-chain payment in the listing currency |
{ mode: 'sequence-checkout', options } |
Sequence Checkout with custom options |
Complete Headless Mode
All modal components now export their internal context hooks and types for fully custom UI implementations. See the headless playground for a complete example.
import {
// Context hooks (NEW)
useBuyModalContext,
useCreateListingModalContext,
useMakeOfferModalContext,
useSellModalContext,
useTransferModalContext,
// Context types (NEW)
type BuyModalContext,
type CreateListingModalContext,
type MakeOfferModalContext,
type SellModalContext,
type TransferModalContext,
} from '@0xsequence/marketplace-sdk/react';Modern Type System - BigInt & Viem Compatible
All SDK types now use bigint primitives and are fully compatible with viem types:
| Property | Before (v1.x) | After (v2.0) |
|---|---|---|
tokenId |
string |
bigint |
amount / priceAmount |
string |
bigint |
quantity |
string | number |
bigint |
Address |
string |
viem Address |
Hex |
string |
viem Hex |
Breaking Changes
Type Changes (Migration Required)
tokenId,amount,quantitynow usebigintinstead ofstring- Address types now use viem's
Addresstype
Removed APIs
| Removed | Notes |
|---|---|
useListCollectionActivities |
Activities API removed |
useListCollectibleActivities |
Activities API removed |
onSuccess / onError callbacks |
Use React query for network errors |
Hook Changes
| Hook | Change |
|---|---|
| Count hooks | Return number directly instead of { count: number } |
New Features
New Hooks
useERC721Owner- Read ERC721 token owner address
New Utilities
processProperties/processAttributes- Normalize NFT metadata into standardized format
Enhanced Error Handling
Modal error handling has been significantly improved with better user feedback and recovery options:
- Modals - Added extensive error handling with retry options
- Headless mode - Added error boundaries and accessible error recovery patterns
const ctx = useBuyModalContext();
// New error handling properties
if (ctx.error) {
return <ErrorDisplay error={ctx.error} onRetry={ctx.refetchAll} />;
}Callback Removal (Breaking Change)
All modal hooks no longer accept onSuccess / onError callback parameters. Modals now handle errors internally with improved user feedback and recovery options.
If you need to surface network errors to your application, use React Query's global error handling via QueryCache callbacks. See the TanStack Query documentation for details.
The new context hooks (see Complete Headless Mode) provide full access to modal state for custom UI implementations.
Affected modals:
| Removed Callbacks From | New Context Hook (v2.0) |
|---|---|
useBuyModal |
useBuyModalContext() |
useCreateListingModal |
useCreateListingModalContext() |
useMakeOfferModal |
useMakeOfferModalContext() |
useSellModal |
useSellModalContext() |
useTransferModal |
useTransferModalContext() |
Before (v1.x):
const { openBuyModal } = useBuyModal({
onSuccess: (txHash) => console.log('Purchased!', txHash),
onError: (err) => console.error(err),
});After (v2.0):
const { openBuyModal } = useBuyModal();
const ctx = useBuyModalContext(); // NEW - provides full modal state access
// Handle states in your UI
if (ctx.isLoading) {
// Show loading state
}
if (ctx.error) {
// Show error state with ctx.refetchAll for retry
}Internal Improvements
- Upgraded dependencies: wagmi, @tanstack/react-query, nuqs
- Updated Trails SDK to v0.9.5
- Added comprehensive test coverage for transaction hooks
- Improved TypeScript type inference
1.1.1
✨ Improvements
- Query System Enhancements: Reorganized queries into domain-specific directories and added getQueryKey functions for improved cache management
- New Hooks and Queries: Added useListItemsOrdersForCollection for fetching all orders for a given collection, useCountItemsOrdersForCollection for counting collection orders, and useListItemsOrdersForCollectionPaginated for paginated collection orders
- UI/UX Enhancements: Enhanced TransactionDetails with better formatting, improved error display with ErrorLogBox component, enhanced CalendarDropdown with TimeSelector, and added loading modal to ERC1155BuyModal
- OpenSea Integration: Limited currency support to currencies supported by OpenSea v2
- Analytics & Tracking: Improved analytics provider with better wallet tracking
🐛 Bug Fixes
- Fixed date selection issues where past times could be selected
- Fixed retry behavior in payment modal to prevent excessive requests
- Fixed PriceInput component conditional rendering
- Fixed initialPageParam logic in paginated collection orders
🔧 Internal Improvements
- Switched from waitForTransactionReceipt to fetchTransactionReceipt for more reliable transaction handling
- Updated marketplace API client with new endpoints for collection order operations
- Enhanced test coverage
- Better error handling and logging throughout the codebase
0.8.6
0.3.1
Various bug fixes
0.3.0
- New collectable card component
- Changed hooks
UseListListingsForCollectibleandUseListOffersForCollectiblefrom infinite to paginated queries - Redesigned
react-viteplayground showcasing the most commonly used components/hooks - New
useCurrencyhook - New
useListCollectionshook - New
useGenerateCancelTransactionhook - Misc type and interface improvements
0.2.0
- Added error and success callbacks
useCheckoutOptionshook- Playground for demo and local dev
- Fixed access key for nodes
- Fixed missing export of sell hook
0.0.1
Initial alpha release with core Marketplace integration hooks and modals.
Hooks
- useMarketplaceConfig
- useSdkConfig
- useListCollections
- useCurrencies
Collectibles
- useListCollectables
- useBalanceOfCollectable
- useListOffersForCollectables
- useFileters
- useCollectable
- useHighestOffer
- useLowestListing
- useListCollectables
- useCollectionCounts
- useRoyalty
Transactions
- useGenerateSellTransaction
- useGenerateOfferTransaction
- useGenerateListingTransaction
Modals
- ListModal
- OfferModal
- TransactionSuccessModal