From 632d4c4442151c3bfb704719325414bb6889e402 Mon Sep 17 00:00:00 2001 From: markus <55011443+mdymalla@users.noreply.github.com> Date: Thu, 3 Oct 2024 09:41:30 +1000 Subject: [PATCH] [TD-1719] Collection bids list (#2268) --- packages/orderbook/src/orderbook.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/orderbook/src/orderbook.ts b/packages/orderbook/src/orderbook.ts index 39c0d237a4..db5b29ccdd 100644 --- a/packages/orderbook/src/orderbook.ts +++ b/packages/orderbook/src/orderbook.ts @@ -38,6 +38,8 @@ import { ListBidsParams, ListBidsResult, ListingResult, + ListCollectionBidsParams, + ListCollectionBidsResult, ListListingsParams, ListListingsResult, ListTradesParams, @@ -209,6 +211,22 @@ export class Orderbook { }; } + /** + * List collection bids. This method is used to get a list of collection bids filtered + * by conditions specified in the params object. + * @param {ListCollectionBidsParams} listOrderParams - Filtering, ordering and page parameters. + * @return {ListCollectionBidsResult} The paged collection bids. + */ + async listCollectionBids( + listOrderParams: ListCollectionBidsParams, + ): Promise { + const apiCollectionBids = await this.apiClient.listCollectionBids(listOrderParams); + return { + page: mapFromOpenApiPage(apiCollectionBids.page), + result: apiCollectionBids.result.map(mapCollectionBidFromOpenApiOrder), + }; + } + /** * List trades. This method is used to get a list of trades filtered by conditions specified * in the params object