CryptoStats Forum Archive

Pangolin Fees Adapter - CryptoStats (0.1.1)

Created Feb 4, 2022·767 views·1 reply·0 likes
ap0calyp
Feb 4, 2022, 10:08 PM
  • add check for any data from next date
  • I find in the UI when I select ‘2022-02-03’ as my date to test, the date coming through the routine ends up being ‘2022-02-04’. Unclear if this is timezone conversion in the test routine instead of local date.
David
Feb 7, 2022, 01:52 PM

Hey, I think the nextDate calculation may be getting messed up

The fixes would be one of these:

  • Change getDay to getUTCDate (nextDate.setUTCDate(nextDate.getUTCDay() + 1))
  • Use the SDK libraries (const nextDate = sdk.date.dateToTimestamp(sdk.date.getNextDay(date)))
ap0calyp
Feb 7, 2022, 06:28 PM

cool! I update to use this to make it more consistent:

The problem I was having in testing was more with the start date during testing;

I had assumed the start date in the input component shown above was a local date but it looks like it is being converted from my local date. The 2022-02-07 error is coming from the date not the nextDate

David
Feb 9, 2022, 11:10 PM

Cool, everything looks good, I’ve verified the adapter!

I think the date bug you’re running into might be a bug with the CryptoStats website, I’ll take a look into it.