Trader.xyz hosts a free, real-time NFT orderbook that hosts buy and sell NFT orders.
Overview
Trader.xyz hosts the official orderbook for 0x v4 NFT orders.
Trader.xyz orderbook is an open orderbook that keeps track of off-NFT chain orders and order statuses in real-time. Anyone can add orders to the orderbook as long as they are valid 0x v4 orders.
Having an open orderbook for NFT orders makes it much easier for integrators to build NFT marketplaces and swapping apps -- bring your own frontend and leverage the trader infrastructure. No lock-in and the open orderbook is completely free to use!
Routes:
Get Orders
GEThttps://api.trader.xyz/orderbook/orders
Fetch NFT buy and sell orders that can be filled via 0x v4
Upon finding an order you like. use the order field as the order object to fill on 0x v4.
constnftOrders=awaitfetch(`https://api.trader.xyz/orderbook/orders?chainId=1&nftToken=0x5Af0D9827E0c53E4799BB226655A1de152A425a5&status=open`).then(res =>res.json())// Find the first orderconstnftOrder= nftOrders[0]// Get the actual 0x v4 order that can be filled via the ExchangeProxyconstfillableZeroExOrder=nftOrder.order// Fill order with a) Swap SDK, or b) ethers/exchange proxy directly:// a) Fill via Swap SdKconstswapSdk=newSwapSdkV4(provider, signer);consttx=awaitswapSdk.fillSignedOrder(fillableZeroExOrder);// b) Fill via ExchangeProxy (you will need to set up the ExchangeProxy ABI via ethers)// The function signature looks like this:consttx=awaitexchangeProxy.buyERC721( fillableZeroExOrder,fillableZeroExOrder.signature,'0x',);
Posting orders
POSThttps://api.trader.xyz/orderbook/order
Add a signed 0x V4 NFT order to the open orderbook