I am facing an issue related to ICP index cannister getTransactions call. I have pushed a sample nodejs code to github repo here: GitHub - Zokshpay/icp_ledger_testing
I have followed the instructions provided in docs to have local ledger and index canister deployed with default values.
The problem I am facing is, getTransactions call always returns an empty transactions array in the response, but with the correct balance value.
But the same call done via the command line, returns the correct balance along with ‘transactions’ array with a list of transactions. Please see the attached screenshots for reference.
Any pointers on how to proceed would be great.
(min: I have tried the getTransactions call, by casting the maxResults/start args by casting in bigInt and without as well, and still get empty array.)
The query does not go up but down (if that analogy makes sense). If you want to query for the latest transactions, you can avoid specifying start or pass undefined.
Thank you so much, that solved the problem. i had been stuck on this for a while now. My understanding was, start at block 0 and give maximum of 100 results.
that is just wrong variable name, the value is for index canister id only. anyway, the issue is resolved, as suggested by @peterparker, it was pagination order issue.
I’m glad the issue is resolved.
The reason I thought it’s not just a variable name, is because qhbym-qaaaa-aaaaa-aaafq-cai is actually the default canister ID of the internet identity canister on a local replica.