Does that stats.js file exist in the NFTWhale-main folder? E.g. similar to the final repo.
I actually figured this out. thanks. I had to navigate to the /stats folder. I had an additional sub folder set up. Then I had to downgrade the moralis require to v1.
I keep getting this compilation error from Torus. Does anyone know how to fix it or disable Torus?
Not totally sure what it is, looks like a wallet or something. Is this necessary?
@toruslabs
is a dependency included with one of the packages for this project. What is the command you used here? This is from running the frontend (app folder)?
Iâm at 42:20 in the youtube tutorial.
cd app
yarn start
then error appears on compilation.
From forums it appears to be a babel issue. Not sure if thatâs true or not. Been workin on it for 5 hours trying to figure it out.
Any thoughts?
I can reproduce that error from the starter project, but not the final app (both installed with yarn, not npm).
If I clone the starter project again and use npm (npm install
and npm run start
) then I donât get that torus error.
Alternatively, if you want to use yarn, try cloning and installing with the final app and just edit the files with the code youâve done so far from following the tutorial.
Just opened my project
I did cd app
npm install
npm start
it worked. so in short, I should just avoid yarn moving forward for this project?
I think it is just an issue with this project - normally yarn works fine. If you look at the final repo, there is a yarn.lock in there as well as a package-lock.json that isnât in the starter (and usually you donât mix npm and yarn together).
would you suggest I uninstall yarn in my project?
if so, how would I go about that?
I wouldnât worry about it now that the project works. You are now using npm.
sounds good. thanks for your help!
Hey. Iâm trying to add additional features to this app and would like to make it so the app has the ability to sort if the transaction happened within the last day, week, month, year or over year. In some instances like if the transaction happened in the last 7 days, it may have also happened in the last day. So in theory day +1 and week +1.
How do I implement this in my loop? Can anyone spot the errors in my code? The results just keep getting posted to âoverYearTxâ instead of being split out into their appropriate categories.
Want it to be able to say like User X had 2 transactions total; 2 (both) this month, 1 was this week. Basically two transactions happened this month, one of which was this week. Hopefully thatâs clear.
Would love some help?
Github link: https://github.com/ericlam1114/DataMoralisPlatform/blob/main/stats.js
One issue is with your block numbers e.g. monthBlock
and yearBlock
seem to return the same values. You can test first with hardcoded block numbers for each period.
You can add some logging in your script. I would start simpler e.g. just work on counting transactions only within a month first, and with a smaller contract so tests are faster.
Awesome. I think I pinpointed the problem. It seems to have to do with how iâm calling the Moralis API.
For some reason the API keeps returning the same block for each unique timestamp.
On swagger iâm able to get the correct block utilizing the time/date but not in vscode.
Whatâs the issue in how iâm calling the API?
Youâre not passing in date
into the Moralis API from your options. E.g.
const blockoptionsThirty = {
chain: 'Eth',
dateThirty: dateThirty,
};
That should be:
const blockoptionsThirty = {
chain: 'Eth',
date: dateThirty,
};
That worked. thanks for the correction!
Hey, iâm having trouble getting the Moonbirds âLongest Avg Holdâ âLargest Bagâ and âHighest Avg Buy Inâ to display the correct numbers. Currently they are displaying âNaNâ. Iâm at 49:19 in the video.
I added some console.logs to hopefully help debug. would love some insight into where the error is.
async function getCol() {
const res = await axios.get("http://localhost:4000/", {
params: {slug: collection},
});
const data = res.data;
console.log("data",data);
console.log(âdataâ,data);
this prints: data Welcome to the server
const dataArray = Object.values(data);
console.log("dataArray",dataArray);
console.log(âdataArrayâ,dataArray);
this prints:
0: âWâ
1: âeâ
2: âlâ
3: âcâ
4: âoâ
5: âmâ
6: âeâ
etc. prints welcome to the server.
So I guess, it doesnât look like itâs retrieving the correct information from the correct page. I tried manually plugging in the slug etc. into the axios get request but the request gets caught in a promise. Been trying to figure this out for 3 days.
Anyone have insights into how to fix this?
So when I change it to include /collection I get
TypeError: Cannot read properties of undefined (reading âownersâ)
and
Uncaught (in promise)
AxiosError
code: âERR_BAD_RESPONSEâ
message: âRequest failed with status code 500â
In the headers object it says something like âcannot read properties of undefinedâ looks like it mentions âownersâ as well.
Iâm not seeing any use of owners
in Collection.js where the getCol
function is meant to be, can you post your current code.
If you are making your own changes, then more info is needed.