Hi All,
I have recently been exploring the Daml.Finance Library and familiarising myself with the Interface implementation.
I have created a contract with a reference to the Base Instrument.Key (like the holding does).
template Trade
with
instrument : Instrument.K
In one of my choices I would like to create another instrument using the instrument referenced in the contract.
I have tried the following
instrumentContract <- fetchInterfaceByKey @Instrument.R instrument
create instrumentContract with
depository = otherParty
But am getting the following error
No instance for (DA.Internal.Record.HasField “depository” Instrument.Instrument Party) arising from a use of ‘setField’. How should I approach this?
Is there a way to solve this? As the fetchInterfaceByKey only retrieves the Interface of a contract implementation, will I be able to recreate any instrument implementation this way ?