Skip to content

Commit

Permalink
new endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
borispoehland committed Sep 24, 2024
1 parent 0ee4efc commit 9b24ca9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/collection/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,16 @@ export class CollectionModule {
public getCollectionFloorPrice = async (
collection: string,
token = 'EGLD'
): Promise<number> => {
): 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'],
Expand All @@ -124,7 +128,7 @@ export class CollectionModule {
token,
},
})
return response?.price ? response.price : 0
return response
}

/**
Expand Down

0 comments on commit 9b24ca9

Please sign in to comment.