Skip to content

Conversation

0xsequence-bot
Copy link
Contributor

Comment on lines +1336 to +1374
// GetMarketplaceOrders queries marketplace orders with filtering and pagination.
//
// Retrieves buy orders (offers) and sell orders (listings) from a specific marketplace
// and collection with comprehensive filtering options.
//
// Parameters:
// marketplaceContractAddress: Target marketplace contract (required)
// collectionAddress: NFT collection contract (required)
// filter: MarketplaceOrderFilter with options:
// - isListing: true=listings, false=offers, omit=both
// - userAddresses: Include specific users
// - currencyAddresses: Filter by currencies (empty=all)
// - tokenIds: Filter by specific tokens (empty=all)
// - excludeUserAddresses: Exclude specific users
// - blockNumberGt: Orders greater than block number
// - createdAtAfter: Orders after timestamp
// - orderStatuses: Filter by status (OPEN, CLOSED, CANCELLED)
// - returnExpired: Include expired orders
// page: Pagination control (optional)
//
// Returns: Updated pagination info and array of matching orders
GetMarketplaceOrders(ctx context.Context, marketplaceContractAddress string, collectionAddress string, filter *MarketplaceOrderFilter, page *Page) (*Page, []*MarketplaceOrder, error)
// GetMarketplaceTopOrders finds the most competitive orders for specific tokens.
//
// Optimized for price discovery, returns the best available orders for each token.
// Useful for displaying current market prices and finding trading opportunities.
//
// Parameters:
// marketplaceContractAddress: Target marketplace contract (required)
// collectionAddress: NFT collection contract (required)
// filter: MarketplaceTopOrdersFilter with options:
// - currencyAddresses: Consider specific currencies (empty=all)
// - tokenIds: Target token IDs (required, non-empty)
// - isListing: true=listings/sell orders, false=offers/buy orders
// - priceSort: ASC=lowest first, DESC=highest first
// - excludeUser: Hide orders from specific user
//
// Returns: Array of top-priced active orders, sorted by priceSort preference
GetMarketplaceTopOrders(ctx context.Context, marketplaceContractAddress string, collectionAddress string, filter *MarketplaceTopOrdersFilter) ([]*MarketplaceOrder, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@david-littlefarmer here's the new Marketplace orderbook endpoints.

Related PR: https://github.com/0xsequence/indexer/pull/386 - indexer marketplace pipeline

Comment on lines -1528 to -1541
// These parameters are depracated, please don't use them:
// - filters
// - beforeExpiryTimestamp
// - blockNumberAfter
// - createdAtAfter
// and in OrderbookOrderFilter these fields are depracated:
// - userAddress
// - excludeUserAddress
//
// Use 'filter' and these fields instead
// - userAddresses
// - excludeUserAddress'
GetOrderbookOrders(ctx context.Context, page *Page, orderbookContractAddress string, collectionAddress string, currencyAddresses []string, filter *OrderbookOrderFilter, orderStatuses []OrderStatus, filters []*OrderbookOrderFilter, beforeExpiryTimestamp int64, blockNumberAfter int64, createdAtAfter int64) (*Page, []*OrderbookOrder, error)
GetTopOrders(ctx context.Context, orderbookContractAddress string, collectionAddress string, currencyAddresses []string, tokenIDs []string, isListing bool, priceSort SortOrder, excludeUser *string) ([]*OrderbookOrder, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deprecated endpoints. cc @david-littlefarmer

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.

4 participants