Need guidence reagarding event decoding with @concordium/web-sdk version 3.5.0

I am following Concordium DApp examples repository (GitHub - Concordium/concordium-dapp-examples: Place to put small dApp examples). I need to decode the events received from the contract through an update method. I found an article on how to deserialize ContractEvent at Deserialize ContractEvent - #3 by nick, but it requires @concordium/web-sdk version >7. Currently, I’m using @concordium/web-sdk version 3.5.0, as mentioned in the GitHub example. When I tried switching to version >7, I encountered errors due to breaking changes in the newer versions. Could you please advise on how I can decode these events with my current setup?

When migrating to versions ^7
facing error like




Hi there.

First of all, I would advise you to use the latest version of @concordium/web-sdk, which is currently version 7.

Some of the examples in the dapp examples repository might not have been updated yet to use the latest SDK version. To update your applications code to be compatible with the latest SDK version, please check the documentation for upgrading to v7.

Hope this helps. If it doesn’t get you all the way to your goal, please don’t hesitate to provide more information on where you get stuck.

Could you give me some examples with version 7 . Also what if I want to stay in version 3 then how can I decode this event data

Have a look at the solution given here:

It gives an example of how to deserialize contract events for both versions >=7 and versions <7. As I wrote in that post, I would still advise you to use the latest version as the old one does not receive updates and has a range of improvements compared to older versions.