From 9b24ca9c20ed73476d99e54624cb3bf46d06dd8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boris=20P=C3=B6hland?= Date: Tue, 24 Sep 2024 14:35:07 +0200 Subject: [PATCH] new endpoint --- src/collection/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/collection/index.ts b/src/collection/index.ts index 1fe630f..c6f7475 100644 --- a/src/collection/index.ts +++ b/src/collection/index.ts @@ -110,12 +110,16 @@ export class CollectionModule { public getCollectionFloorPrice = async ( collection: string, token = 'EGLD' - ): Promise => { + ): Promise<{ + price: number + usdPrice: number + }> => { if (!isValidCollectionTicker(collection)) { throw new Error('Invalid collection ticker: ' + collection) } const response = await this.api.fetchWithTimeout<{ price: number + usdPrice: number }>(`/collection/${collection}/floor-price`, { next: { tags: ['getCollectionFloorPrice'], @@ -124,7 +128,7 @@ export class CollectionModule { token, }, }) - return response?.price ? response.price : 0 + return response } /**