Get data on a listing
Retrieve listing data from the orderbook SDK
📋Prerequisites
💡Listing vs Order
Immutable provides two distinct types of orders:
- Listings: These are orders initiated by an NFT owner who intends to sell their asset on a marketplace. Listings are considered sell orders.
- Bids: Representing a prospective buyer's intention to acquire an asset, bids allow users to express their interest in purchasing a specific asset. Users can place a bid on the order book, anticipating a match with a seller. Bids are considered buy orders.
Get a single listing
import { orderbook } from '@imtbl/sdk';
const getListing = async (client: orderbook.Orderbook, listingId: string) => {
const listing = await client.getListing(listingId);
};
Get listings from a particular NFT collection
This returns a list of listings. The following example filters by collection address and status.
import { orderbook } from '@imtbl/sdk';
const listListings = async (client: orderbook.Orderbook, contractAddress: string) => {
const listOfListings = await client.listListings({
sellItemContractAddress: contractAddress,
status: orderbook.OrderStatusName.ACTIVE,
pageSize: 50,
});
};