Hi, I wish to lock a Daml Finance holding from my UI. One way to do this would be to create a choice on a service contract and call into that, but I would like to be able to do it directly from the UI in TypeScript if possible.
However I am struggling to get the newLockers parameter correct. I want to do something like:
await ledger.exercise(Base.Acquire, borrowedCid as string as ContractId, {newLockers: ???, context:“Lock”, lockType: LockType.Semaphore});
But how do I create the newLockers value in Typescript? I can see it is type DA.Set.Types.Set and I have tried various approaches but not succeeded. I am probably missing something obvious so any pointers appreciated, TIA.
Assuming you’re doing this to convert from a template contract-ID to an interface contract-ID, I strongly recommend doing Tpl.toInterface(Base, borrowedCid) instead where Tpl is the template type of borrowedCid (defined here); this is statically type-checked like toInterfaceContractId in Daml, so will fail to compile if the template doesn’t actually implement the interface.