All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.digitalasset.ledger.api.refinements.CompositeCommandAdapter.scala Maven / Gradle / Ivy

There is a newer version: 3.0.0-snapshot.20240126.12648.0.va9dc2d63
Show newest version
// Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

package com.daml.ledger.api.refinements

import com.daml.ledger.api.refinements.ApiTypes.{ApplicationId, LedgerId}
import com.daml.ledger.api.v1.commands.Commands
import scalaz.syntax.tag._

class CompositeCommandAdapter(
    ledgerId: LedgerId,
    applicationId: ApplicationId,
) {
  def transform(c: CompositeCommand): Commands =
    Commands(
      ledgerId = ledgerId.unwrap,
      workflowId = c.workflowId.unwrap,
      applicationId = applicationId.unwrap,
      commandId = c.commandId.unwrap,
      party = c.party.unwrap,
      commands = c.commands,
    )
}

object CompositeCommandAdapter {
  def apply(
      ledgerId: LedgerId,
      applicationId: ApplicationId,
  ) = new CompositeCommandAdapter(ledgerId, applicationId)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy