Daml Set corresponding Javascript type?
- MaxOP
Hi Guys,
I have a daml template that takes in an argument of type Set, the template looks like below. It’s the last field, observerstemplate Asset with assetType : AssetType -- The asset owner owner : Party -- The amount of the asset amount : Decimal observers : Set PartyWhen using the Daml/ react library, What javascript datastructure do I pass in?
I’ve tried passing in an an array of partyId, eg[party], Not quite sure what I need to pass in.
also tried to use theDA.set, but I get the second image’s error, not sure what to pass in here.


- Leonid_Rozenberg
- huw
Hey guys. I’m struggling to create an instance of
Map<Party, {}>in sdk 1.17.1 using typescript. Not sure if the type has changed since when this question was posted. Hopefully I’m missing something simple:import { Map, Party } from "@daml/types"; const x: Map<Party, {}> = [['a', {}], ['b', {}]];Getting this error:
Type '(string | {})[][]' is missing the following properties from type 'Map<string, {}>': get, has, set, delete, entriesArray - cocreature
- huw
Sets andMaps in typescript have been bugging me for a while. Good to know this!