Skip to content
CCPEDIAby Unity Nodes
App Development

Filter by set of signatories using JSON API

5 posts275 viewsLast activity Jul 2022

  1. huwOP

    Hi there, I am using a template - AssetDeposit lib-finance/Asset.daml at 0b21a0723db01f63f7d6b16ed59ea8d37030219f · digital-asset/lib-finance · GitHub . I’d like to run a query, if possible, which finds all AssetDeposits that are signed by a specific set of parties. Is there any way to do this using the JSON API query syntax? I don’t think there is but wanted to double check.

  2. cocreature

    You can only filter by template fields not by signatories. However, the signatories can be derived from the template fields so in this case you could filter on account.id.signatories. Note that you cannot do subset queries though only exactly matches which may or may not be sufficient for your usecase.

  3. huw

    I’d love for that solution to work, but I don’t think it’s possible - at least from my reading of the documentation. It says genmaps (and therefore sets) are not supported for equality comparison.

  4. cocreature

    Good point, I had forgotten about that. Then you have to stick to filtering on the client isde.

  5. Stephen

    You cannot include this in a query. However, readers can be specified with each POST query (not supported for WS queries yet), and with both sync and WS, every created event has a signatories party-ID-list property, so you don’t have to track this down in the payload yourself.