Skip to content

Commit

Permalink
Fix broken build
Browse files Browse the repository at this point in the history
  • Loading branch information
thebrianchen committed Nov 16, 2022
1 parent 8b42122 commit 4a1842b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
8 changes: 2 additions & 6 deletions src/internal/nft-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
Expand Down
2 changes: 1 addition & 1 deletion src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
27 changes: 13 additions & 14 deletions test/integration/nft.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 4a1842b

Please sign in to comment.