I’ve encountered an issue with a specific block, number 80543, within the ckBTC canister (nbsys-saaaa-aaaar-qaaga-cai). This block does not seem to align with the current IDL definition of icrc1. I’ve attached a screenshot from the DFINITY dashboard displaying the error message:
Canister nbsys-saaaa-aaaar-qaaga-cai trapped explicitly: failed to decode block 161086: failed to decode a block: Semantic(None, "invalid type: integer `1696594164110199924`, expected struct TimeStamp")
this issue is unique to block 80543; other blocks from ckBTC can be fetched without any problems.
Also, this issue is occurring when using the DFINITY agent library in JavaScript.
I’m looking for insights on the root cause of this error and suggestions on how to resolve it. Has anyone encountered a similar problem or can provide guidance on addressing this issue?
Hi, regarding the start of your message, I think one of my colleague will be more useful than me but, I’m curious about the JS part. Can you tell me which library exactly and version?
We had to change the IDL definition of Approve blocks because it wasn’t matching the incoming ICRC-3 spec. The expires_at field written by the ckBTC Ledger was a struct instead of what it should be, that is a number. We still need to upgrade the libraries to follow the new schema.
Ahhhhh thanks for the answer. Any particular reason why you do not use @dfinity/ledger-icrc?
It contains an up-to-date did files regarding that matters.
Great. In the same repo there is also in a @dfinity/ckbtc library. All these libs are used notably in NNS dapp. We keep those up-to-date. Let me know if you have any questions.
Hello @peterparker ,
I’m experiencing difficulties in retrieving blocks using the “@dfinity/ledger-icrc” library. Here’s the code I’m attempting to run:
TypeError: Cannot destructure property 'owner' of 'undefined' as it is undefined.
I’ve also explored the “@dfinity/ckbtc” library, but I wasn’t able to find any solutions that would allow me to retrieve a specific block from Ckbtc. Can you provide any guidance or assistance on this matter? Thank you.
Are you sude your id is a Principal and not a string or something else?
You are looking to query the transactions. Those transactions are attached to an account. An account can be a user, a canister, or else. Anything or anyone that hold transactions through an account.
Hello @peterparker ,
I’m continuing my efforts to find a solution for this issue, but I’m still unable to resolve it. I’ve also double-checked on the DFINITY dashboard, and the error there remains the same.
Could you please provide an update on the current status of this issue? Additionally, it would be greatly appreciated if you could direct me to the most recent version of the IDL for the ledger canister, which I can use to access transaction 80543 of the ckbtc token.
Which issue, the expires_at field? Don’t know much about this, @mariop knows best.
Or are you speaking about another issue?
I updated @dfinity/ledger-icrc last week. You can find the related did files in the repo or use the next version of the library (npm i @dfinity/ledger-icrc@next). Is this what you are looking for?
My goal is to obtain transaction details using the ‘@dfinity/agent’ library. I’m avoiding the use of the ‘@dfinity/icrc-ledger’ library because it requires supplying an account owner, which doesn’t align with my current requirements. I attempted to utilize the ledger canister IDL from the ‘ledger-icrc’ repository, but I’m still encountering the same error when dealing with this specific transaction.
I’ve given it a shot, but I’m still encountering same error. I’m finding it a bit challenging to grasp why this particular block is proving difficult to decode. If there have been any changes to the block or transaction definitions, I’m curious why this information (IDL or the part which got change for that specific transaction) hasn’t been made public yet. Additionally, it seems that the dashboard hasn’t been updated with the latest IDL, if there’s been any update at all.
Please keep me posted in this thread if you come across any updates or solutions.
Thanks for the trying and for the feedback! I’m also a consumer of the ledger rather than an actor so, I forwarded your question to the team. They’ll comeback with updates.