dcts / opensea-scraper

Scrapes nft floor prices and additional information from opensea. Used for https://nftfloorprice.info
MIT License
184 stars 73 forks source link

fix definitions for rankings function #54

Closed jiricekcz closed 2 years ago

jiricekcz commented 2 years ago

Parameters of ranking functions were swapped in the declaration when compared to the implementation. This causes invalid data when using with typescript, because the chain is passed in as options and no warnings are raised.

dcts commented 2 years ago

Good catch, thank you!

But I would suggest to change the implementation according to the index.d.ts file, to follow the convention to have the options parameter always as last argument. If you want please change the following and I'll happily merge your PR:

  1. revert your changes in index.d.ts
  2. change the implementation in rankings.js such that the optionsGiven parameter is the last: https://github.com/dcts/opensea-scraper/blob/6fe68bc3276d935dc5e6f9ecad53d537f4b3c1e8/src/functions/rankings.js#L20
  3. adapt the usage example of the OpenseaScraper.rankings() function in README.md (https://github.com/dcts/opensea-scraper/blob/main/README.md#usage)
dcts commented 2 years ago

closed by PR #56