Searching orders

Orders can be searched using various criteria. This can be useful to display orders for a user or an asset with different filters. The results are paginated and the search always returns the total number of results.

const ordersSearch = await marketplaceSdk.order.searchOrders({
    maker: userAddress,
    tokenAddress: MY_COLLECTION_ADDRESS,
    statuses: [TradeStatus.OPEN, TradeStatus.FILLED],
    direction: TradeDirection.SELL,
    limit: 100,
    skip: 0,
    orderBy: SearchOrdersSortOption.SIGNED_AT,
    orderByDirection: FilterDirection.DESC
})

const userOrders = ordersSearch.orders

In this example, we display the sales orders of a user with the status "Open" or "Filled" sorted by decreasing signature date.

Order statuses are explained in more detail in Order flow.

All our API routes are also available without the SDK. Here, it's the search orders route.

Last updated