How to convert `ContractId X` to `AnyContractId`?
App Development2 posts425 views3 likesLast activity Apr 2020
GE
georgOP
Apr 2020In a DAML Trigger the emitCommands function takes a list of AnyContractIds as second argument to mark them as pending. I have a list of ContractId X that I want to pass in, how can I convert between the two?
CO
cocreature
Apr 2020To convert to AnyContractId you can use toAnyContractId. For converting from AnyContractId use fromAnyContractId. The latter returns an Optional and will return None if the contract id is of a different template.