NFTfi-Genesis / nftfi.js

JavaScript SDK for interacting with the NFTfi Protocol
https://www.nftfi.com
14 stars 14 forks source link

Function get-offers-on-collection works strange #1

Closed DenisKochetov closed 1 year ago

DenisKochetov commented 1 year ago

I tried this example:

    filters: {
      nft: {
        address: process.env.NFTFI_SDK_EXAMPLE_NFT_ADDRESS,
        id: "2485"
      },
      pagination:{
      page: 3,
      limit: 20
    }
    }
  });

And got results as follows:

[INFO] offers for NFT collection 0xbce3781ae7ca1a5e050bd9c4c77369867ebc307e
[INFO] 0 tokenId: 2485 duration: 7 days; principal: 0.5; repayment: 0.505753; APR: 60.00%
[INFO] 1 tokenId: 0 duration: 14 days; principal: 620.0; repayment: 639.024658; APR: 80.00%
[INFO] 2 tokenId: 0 duration: 40 days; principal: 360.0; repayment: 396.29589; APR: 92.00%
[INFO] 3 tokenId: 0 duration: 30 days; principal: 465.0; repayment: 487.931507; APR: 60.00%
[INFO] 4 tokenId: 0 duration: 10 days; principal: 700.0; repayment: 714.383562; APR: 75.00%
[INFO] 5 tokenId: 2485 duration: 30 days; principal: 0.4; repayment: 0.416438; APR: 50.00%
[INFO] 6 tokenId: 2485 duration: 14 days; principal: 0.55; repayment: 0.567299; APR: 82.00%
[INFO] 7 tokenId: 2485 duration: 21 days; principal: 0.38; repayment: 0.396397; APR: 75.00%
[INFO] 8 tokenId: 0 duration: 10 days; principal: 0.621; repayment: 0.670489; APR: 290.88%
[INFO] 9 tokenId: 0 duration: 7 days; principal: 0.0621; repayment: 0.065564; APR: 290.86%
[INFO] 10 tokenId: 0 duration: 3 days; principal: 0.0621; repayment: 0.063585; APR: 290.94%
[INFO] 11 tokenId: 0 duration: 14 days; principal: 634.0; repayment: 655.886027; APR: 90.00%
[INFO] 12 tokenId: 0 duration: 7 days; principal: 0.57; repayment: 0.581478; APR: 105.00%
[INFO] 13 tokenId: 0 duration: 14 days; principal: 0.53; repayment: 0.554395; APR: 120.00%`
[INFO] 14 tokenId: 0 duration: 30 days; principal: 0.5; repayment: 0.553425; APR: 130.00%
[INFO] 15 tokenId: 0 duration: 14 days; principal: 475.0; repayment: 495.0; APR: 109.77%
[INFO] 16 tokenId: 0 duration: 30 days; principal: 465.0; repayment: 489.85; APR: 65.02%
[INFO] 17 tokenId: 0 duration: 14 days; principal: 0.582; repayment: 0.647604; APR: 293.88%
[INFO] 18 tokenId: 0 duration: 7 days; principal: 0.62; repayment: 0.654944; APR: 293.88%
[INFO] 19 tokenId: 0 duration: 3 days; principal: 0.62; repayment: 0.634976; APR: 293.88%

No matter which page number or limit I settled the result was the same.

I tried to settle id = 0, or removing this parameter at all, I still got 20 rows in the output.

Could you please tell me what am I doing wrong? I want to get all results from all available pages.

b4nd1do commented 1 year ago

Hi @DenisKochetov - Thanks for getting in touch. I'm assuming that you've managed to resolve your issue. If not, I can see that a potential problem might be the nesting of your pagination field. The pagination field needs to be on the root of the options object, not nested inside of the filters object.