From 4a1842bbda6f9ba85a605beb9756773fb6f639d5 Mon Sep 17 00:00:00 2001 From: Brian Chen Date: Wed, 16 Nov 2022 05:13:58 -0600 Subject: [PATCH] Fix broken build --- src/internal/nft-api.ts | 8 ++------ src/types/types.ts | 2 +- test/integration/nft.test.ts | 27 +++++++++++++-------------- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/internal/nft-api.ts b/src/internal/nft-api.ts index 5942827b3..2f5760652 100644 --- a/src/internal/nft-api.ts +++ b/src/internal/nft-api.ts @@ -410,18 +410,14 @@ export async function getNftSales( fromBlock: params?.fromBlock, toBlock: params?.toBlock, order: params?.order, - marketplace: - params?.marketplace != NftSaleMarketplace.UNKNOWN - ? params?.marketplace - : undefined, + marketplace: params?.marketplace, contractAddress: params?.contractAddress, tokenId: params?.tokenId ? BigNumber.from(params?.tokenId).toString() : undefined, sellerAddress: params?.sellerAddress, buyerAddress: params?.buyerAddress, - taker: - params?.taker != NftSaleTakerType.UNKNOWN ? params?.taker : undefined, + taker: params?.taker, limit: params?.limit, pageKey: params?.pageKey }); diff --git a/src/types/types.ts b/src/types/types.ts index 2a7cff21d..f6b3d237a 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -822,7 +822,7 @@ export interface GetNftSalesOptions { toBlock?: number | 'latest'; /** Whether to return the results in ascending or descending order by block number. */ - order?: AssetTransfersOrder; + order?: SortingOrder; /** The NFT marketplace to filter sales by. */ marketplace?: NftSaleMarketplace; diff --git a/test/integration/nft.test.ts b/test/integration/nft.test.ts index 95dcb9f52..26f663b7f 100644 --- a/test/integration/nft.test.ts +++ b/test/integration/nft.test.ts @@ -318,20 +318,19 @@ describe('E2E integration tests', () => { expect(response.nftSales[0].contractAddress).toEqual(contractAddress); }); - it.each( - Object.values(NftSaleMarketplace).filter( - marketplace => marketplace !== NftSaleMarketplace.UNKNOWN - ) - )(`getNftSales() with marketplace=%s`, async marketplace => { - const response = await alchemy.nft.getNftSales({ - marketplace, - limit: 10 - }); - - response.nftSales.forEach(nftSale => { - expect(nftSale.marketplace).toEqual(marketplace); - }); - }); + it.each(Object.values(NftSaleMarketplace))( + `getNftSales() with marketplace=%s`, + async marketplace => { + const response = await alchemy.nft.getNftSales({ + marketplace, + limit: 10 + }); + + response.nftSales.forEach(nftSale => { + expect(nftSale.marketplace).toEqual(marketplace); + }); + } + ); it('computeRarity()', async () => { const contractAddress = '0x0510745d2ca36729bed35c818527c4485912d99e';