opensea-js icon indicating copy to clipboard operation
opensea-js copied to clipboard

List all "buy now" from a contract

Open Philigane opened this issue 4 years ago • 2 comments

Hello,

I am facing a problem. I am trying to list all "buy now" NFTs from a contract (or a collection) but i am not sure my approach is good.

I list all tokens id via Moralis API (to not overcharger Opensea API). Then i get orders from each token and i consider that if there is an order which can be paid in ETH it's the buy now. Then i complete the order.

This method works but occurs many many useless request and i am not even sure of it.

Is there any other solution ?

Philigane avatar Apr 11 '22 14:04 Philigane

i have refactored my code by doing this.

  • If collection has a high floor than my maxprice => return.
  • If not
    • i get all token_ids via Moralis.
    • From those token ids i get orders with the ETH payment token and with a price under my max price.
    • After that i have my orders and i can fulfil them

But damn it souldn't be like that ... In OS interface you can easily list all "buy now" now under a certain price. Here i have to do many useless request and taking the risk of getting the "request limit" exception.

I have a third option is to use a pupeeter for getting all assets that fill my needs and get their token id and their order ...

Philigane avatar Apr 13 '22 15:04 Philigane

We appreciate your feedback! We have a similar ticket open for this, check here: https://github.com/ProjectOpenSea/opensea-js/issues/475

Please follow that ticket for the latest updates. I will close this to avoid confusion.

esteban-OpenSea avatar Jun 10 '22 03:06 esteban-OpenSea