Closed Cupnfish closed 1 year ago
Hey, you can just wrap decode method in try ... catch
and handle decoding errors as you want
🎉 Thank you so much for helping me resolve my issue! I really appreciate the time and effort you put into helping me out. As someone who is not very familiar with TypeScript, I was struggling to find a solution on my own, and your help was invaluable.
👍 Your expertise and willingness to assist me has been truly impressive, and I can't thank you enough for your support. I'm so grateful to be part of such a supportive and helpful community.
🙏 Once again, thank you for all your help. I couldn't have done it without you!
@belopash
Describe Hello,
I'm currently working on an event indexing project that uses a given ABI file to filter topics and decode results. However, since there is no fixed contract address, the input parameters may not always satisfy the decoding requirements, resulting in a panic during decoding.
I was wondering if there is a
try_decode
-like method available that could returnnull
or anerror
when there are issues with decoding, such asincorrect length
orfailure
to decode the event correctly. This would enable me to have more flexibility in handling these situations.Could the development team provide any suggestions or advice for addressing this issue?
Thank you!