Skip to content
Discussions/App Development/Explicit Disclosure Java BindingsForum ↗

Explicit Disclosure Java Bindings

App Development3 posts65 views4 likesLast activity Jan 2025
DA
David_MartinsOP
Jan 2025

Hello,

I’m working on a project that requires the use of explicit contract disclosure to allow some parties to execute some choices in ledger.
We were trying leverage the Java bindings to allow for this, but we noticed that there isn’t a public constructor for the ContractFilter class which we need to enable the inclusion of the created event blob (required as per the docs).
Can you help?

Best regards,
David Martins

TU
tudor_voicu
Jan 2025

Hi @David_Martins

I assumed you are interested in constructing a TransactionFilter (the return type of the ContractFilter.transactionFilter) that allows requesting the created event blob populated in the returned CreatedEvent payloads. Indeed the ContractFilter class doesn’t expose the high level functionality to allow this construction directly but we’ll add a method in the next release to support this

Until then, I suggest directly constructing the TransactionFilter to include the correct flag. As example for a Iou template:

    // Dummy requesting parties for the sake of the example
    Set<String> requestingParties = Set.of("Alice", "Bob");

    InclusiveFilter filter =
        new InclusiveFilter(
            Collections.emptyMap(),
            Collections.singletonMap(
                Iou.TEMPLATE_ID, Filter.Template.INCLUDE_CREATED_EVENT_BLOB));

    Map<String, Filter> partyToFilters =
        requestingParties.stream().collect(Collectors.toMap(Function.identity(), x -> filter));

    TransactionFilter transactionFilter = new FiltersByParty(partyToFilters);

Let us know if this solves your problem.

DA
David_Martins
Jan 2025

Hello

Thank you for the quick reply. This does indeed solve the issue as a workaround.

← Back to Discussions