This is a daml finance related query. In the current implementation. ElectionEffect uses the interface Effect and Effect interface doesn’t have the field amount in its view, which is though present in the ElectionEffect.
Is this intentional design, if so what is the reason
For my purpose I need to access the amount in UI, is there a way to do it,
2.1 Do you have some function similar to fromInterface in daml, but for UI/React
2.2 I tried directly to streamquery ElectionEffect to the UI, but I am not able to import it, do i need to change anything manually on package-lock.json to fix this?
2.3 I thought of some temporary workaround like embed the amount information in description or create a separate template to capture this.
Regarding the point 3., I tried adding it as a dependency in package.json, but its still not being detected, when i try to import it in the UI Code. It will be helpful to understand how and where to update this dependency.
I have taken a different approach and added a service choice to split the holding and is able to pass the new split holding cid to the claim effect, but i observed that the claim effect is again fetching the instrument holdings and again splitting it to the required amount rather than using the holding cid, i provided. I am doing private equity usecase, and there is one instrument and a single holder has three position of the same instrument with three different custodian. So, even though am passing a holding cid corresponding to the right amount held at custodian3, when the holder does claim effect, its fetching a holding held at custodian1 and trying to apply the effect there. I am assuming this is happening because, the code is expecting a single custodian usecase and is fetching the holding based on the instrument id. Is there a way to override this behaviour?