anchor icon indicating copy to clipboard operation
anchor copied to clipboard

ts: CPI events parsing

Open ochaloup opened this issue 10 months ago • 2 comments

Based on the discussion at https://github.com/coral-xyz/anchor/issues/2609 I understood there is no parsing utilities for CPI events for TS libraries.

I would like to kick-off the PR that would add this support under official Anchor TS library. I'm not sure what would be the best on creating such functionality neither what is the best place to put it. Maybe the approach is in a wrong direction so it's fine to just close the PR.

/cc @acheroncrypto

ochaloup avatar Apr 03 '24 09:04 ochaloup

@ochaloup is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Apr 03 '24 09:04 vercel[bot]

@acheroncrypto thanks for your comments. I'm moving from Draft to a Pull Request state. I did changes based on your comments with a bit of changing the logic to provide only one decode method for the coders. I believe it will be easier to grasp to just use decode that does what's needed. But I'm fine to change it back and split to two methods.

With adding the parseCpiEvents into interface I needed to change the default implemenation of the System(like) programs to get the build pass. I created an abstract class. It seemed to me cleaner but we can remove it back as it was.

ochaloup avatar Apr 12 '24 08:04 ochaloup