Skip to content
CCPEDIAby Unity Nodes
App Development

How to convert `ContractId X` to `AnyContractId`?

2 posts432 views3 likesLast activity Apr 2020

  1. georgOP 1

    In 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?

  2. cocreature 2

    To 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.