> ## Documentation Index
> Fetch the complete documentation index at: https://docs.canton.network/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> If you are building a Canton Network application, start from https://docs.canton.network/appdev/quickstart.md. To run only a local network for your own Daml code, without building the QuickStart demo, see https://docs.canton.network/sdks-tools/development-tools/localnet.md.

# PrepareSubmission

Ledger API

›

[Protobuf](https://docs.canton.network/reference/protobuf/overview.md)

›

[com.daml.ledger.api.v2.interactive](https://docs.canton.network/reference/protobuf/packages/com-daml-ledger-api-v2-interactive.md)

›

PrepareSubmission

com.daml.ledger.api.v2.interactive

# PrepareSubmission

gRPC

RPC

`/com.daml.ledger.api.v2.interactive.InteractiveSubmissionService/PrepareSubmission`

## Protocol Details

Protocol
gRPC

Service
InteractiveSubmissionService

RPC
PrepareSubmission

Client stream
No

Server stream
No

## Inputs

### PrepareSubmissionRequest

Message
com.daml.ledger.api.v2.interactive.PrepareSubmissionRequest

Client stream
No

`user_id`
string

`command_id`
string

`commands`
repeated Command

`min_ledger_time`
MinLedgerTime

`max_record_time`
Timestamp

`act_as`
repeated string

`read_as`
repeated string

`disclosed_contracts`
repeated DisclosedContract

`synchronizer_id`
string

`package_id_selection_preference`
repeated string

`verbose_hashing`
bool

`prefetch_contract_keys`
repeated PrefetchContractKey

`estimate_traffic_cost`
CostEstimationHints

`hashing_scheme_version`
HashingSchemeVersion

`taps_max_passes`
uint32

## Outputs

### PrepareSubmissionResponse

Message
com.daml.ledger.api.v2.interactive.PrepareSubmissionResponse

Server stream
No

`prepared_transaction`
PreparedTransaction

`prepared_transaction_hash`
bytes

`hashing_scheme_version`
HashingSchemeVersion

`hashing_details`
string

`cost_estimation`
CostEstimation

## Related Schemas

> [accordion] com.daml.ledger.api.v2.interactive.PrepareSubmissionRequest
>
> `user_id`
> string
>
> `command_id`
> string
>
> `commands`
> repeated Command
>
> `min_ledger_time`
> MinLedgerTime
>
> `max_record_time`
> Timestamp
>
> `act_as`
> repeated string
>
> `read_as`
> repeated string
>
> `disclosed_contracts`
> repeated DisclosedContract
>
> `synchronizer_id`
> string
>
> `package_id_selection_preference`
> repeated string
>
> `verbose_hashing`
> bool
>
> `prefetch_contract_keys`
> repeated PrefetchContractKey
>
> `estimate_traffic_cost`
> CostEstimationHints
>
> `hashing_scheme_version`
> HashingSchemeVersion
>
> `taps_max_passes`
> uint32

> [accordion] com.daml.ledger.api.v2.Command
>
> `create`
> CreateCommand
>
> `exercise`
> ExerciseCommand
>
> `exercise_by_key`
> ExerciseByKeyCommand
>
> `create_and_exercise`
> CreateAndExerciseCommand

> [accordion] com.daml.ledger.api.v2.CreateCommand
>
> `template_id`
> Identifier
>
> `create_arguments`
> Record

> [accordion] com.daml.ledger.api.v2.Identifier
>
> `package_id`
> string
>
> `module_name`
> string
>
> `entity_name`
> string

> [accordion] com.daml.ledger.api.v2.Record
>
> `record_id`
> Identifier
>
> `fields`
> repeated RecordField

> [accordion] com.daml.ledger.api.v2.RecordField
>
> `label`
> string
>
> `value`
> Value

> [accordion] com.daml.ledger.api.v2.Value
>
> `unit`
> Empty
>
> `bool`
> bool
>
> `int64`
> sint64
>
> `date`
> int32
>
> `timestamp`
> sfixed64
>
> `numeric`
> string
>
> `party`
> string
>
> `text`
> string
>
> `contract_id`
> string
>
> `optional`
> Optional
>
> `list`
> List
>
> `text_map`
> TextMap
>
> `gen_map`
> GenMap
>
> `record`
> Record
>
> `variant`
> Variant
>
> `enum`
> Enum

> [accordion] com.daml.ledger.api.v2.Optional
>
> `value`
> Value

> [accordion] com.daml.ledger.api.v2.List
>
> `elements`
> repeated Value

> [accordion] com.daml.ledger.api.v2.TextMap
>
> `entries`
> repeated Entry

> [accordion] com.daml.ledger.api.v2.TextMap.Entry
>
> `key`
> string
>
> `value`
> Value

> [accordion] com.daml.ledger.api.v2.GenMap
>
> `entries`
> repeated Entry

> [accordion] com.daml.ledger.api.v2.GenMap.Entry
>
> `key`
> Value
>
> `value`
> Value

> [accordion] com.daml.ledger.api.v2.Variant
>
> `variant_id`
> Identifier
>
> `constructor`
> string
>
> `value`
> Value

> [accordion] com.daml.ledger.api.v2.Enum
>
> `enum_id`
> Identifier
>
> `constructor`
> string

> [accordion] com.daml.ledger.api.v2.ExerciseCommand
>
> `template_id`
> Identifier
>
> `contract_id`
> string
>
> `choice`
> string
>
> `choice_argument`
> Value

> [accordion] com.daml.ledger.api.v2.ExerciseByKeyCommand
>
> `template_id`
> Identifier
>
> `contract_key`
> Value
>
> `choice`
> string
>
> `choice_argument`
> Value

> [accordion] com.daml.ledger.api.v2.CreateAndExerciseCommand
>
> `template_id`
> Identifier
>
> `create_arguments`
> Record
>
> `choice`
> string
>
> `choice_argument`
> Value

> [accordion] com.daml.ledger.api.v2.interactive.MinLedgerTime
>
> `min_ledger_time_abs`
> Timestamp
>
> `min_ledger_time_rel`
> Duration

> [accordion] com.daml.ledger.api.v2.DisclosedContract
>
> `template_id`
> Identifier
>
> `contract_id`
> string
>
> `created_event_blob`
> bytes
>
> `synchronizer_id`
> string

> [accordion] com.daml.ledger.api.v2.PrefetchContractKey
>
> `template_id`
> Identifier
>
> `contract_key`
> Value
>
> `limit`
> uint32

> [accordion] com.daml.ledger.api.v2.interactive.CostEstimationHints
>
> `disabled`
> bool
>
> `expected_signatures`
> repeated SigningAlgorithmSpec

> [accordion] com.daml.ledger.api.v2.SigningAlgorithmSpec
>
> <ul>
>   <li>`SIGNING_ALGORITHM_SPEC_UNSPECIFIED`</li>
>
>   <li>`SIGNING_ALGORITHM_SPEC_ED25519`</li>
>
>   <li>`SIGNING_ALGORITHM_SPEC_EC_DSA_SHA_256`</li>
>
>   <li>`SIGNING_ALGORITHM_SPEC_EC_DSA_SHA_384`</li>
>
>   <li>`SIGNING_ALGORITHM_SPEC_ML_DSA_65`</li>
> </ul>

> [accordion] com.daml.ledger.api.v2.interactive.HashingSchemeVersion
>
> <ul>
>   <li>`HASHING_SCHEME_VERSION_UNSPECIFIED`</li>
>
>   <li>`HASHING_SCHEME_VERSION_V2`</li>
>
>   <li>`HASHING_SCHEME_VERSION_V3`</li>
>
>   <li>`HASHING_SCHEME_VERSION_V4`</li>
> </ul>

> [accordion] com.daml.ledger.api.v2.interactive.PrepareSubmissionResponse
>
> `prepared_transaction`
> PreparedTransaction
>
> `prepared_transaction_hash`
> bytes
>
> `hashing_scheme_version`
> HashingSchemeVersion
>
> `hashing_details`
> string
>
> `cost_estimation`
> CostEstimation

> [accordion] com.daml.ledger.api.v2.interactive.PreparedTransaction
>
> `transaction`
> DamlTransaction
>
> `metadata`
> Metadata

> [accordion] com.daml.ledger.api.v2.interactive.DamlTransaction
>
> `version`
> string
>
> `roots`
> repeated string
>
> `nodes`
> repeated Node
>
> `node_seeds`
> repeated NodeSeed

> [accordion] com.daml.ledger.api.v2.interactive.DamlTransaction.NodeSeed
>
> `node_id`
> int32
>
> `seed`
> bytes

> [accordion] com.daml.ledger.api.v2.interactive.DamlTransaction.Node
>
> `node_id`
> string
>
> `v1`
> Node

> [accordion] com.daml.ledger.api.v2.interactive.transaction.v1.Node
>
> `create`
> Create
>
> `fetch`
> Fetch
>
> `exercise`
> Exercise
>
> `rollback`
> Rollback
>
> `query_by_key`
> QueryByKey

> [accordion] com.daml.ledger.api.v2.interactive.transaction.v1.Create
>
> `lf_version`
> string
>
> `contract_id`
> string
>
> `package_name`
> string
>
> `template_id`
> Identifier
>
> `argument`
> Value
>
> `signatories`
> repeated string
>
> `stakeholders`
> repeated string
>
> `key`
> GlobalKeyWithMaintainers

> [accordion] com.daml.ledger.api.v2.interactive.GlobalKeyWithMaintainers
>
> `key`
> GlobalKey
>
> `maintainers`
> repeated string

> [accordion] com.daml.ledger.api.v2.interactive.GlobalKey
>
> `template_id`
> Identifier
>
> `package_name`
> string
>
> `key`
> Value
>
> `hash`
> bytes

> [accordion] com.daml.ledger.api.v2.interactive.transaction.v1.Fetch
>
> `lf_version`
> string
>
> `contract_id`
> string
>
> `package_name`
> string
>
> `template_id`
> Identifier
>
> `signatories`
> repeated string
>
> `stakeholders`
> repeated string
>
> `acting_parties`
> repeated string
>
> `interface_id`
> Identifier
>
> `key`
> GlobalKeyWithMaintainers
>
> `by_key`
> bool

> [accordion] com.daml.ledger.api.v2.interactive.transaction.v1.Exercise
>
> `lf_version`
> string
>
> `contract_id`
> string
>
> `package_name`
> string
>
> `template_id`
> Identifier
>
> `signatories`
> repeated string
>
> `stakeholders`
> repeated string
>
> `acting_parties`
> repeated string
>
> `interface_id`
> Identifier
>
> `choice_id`
> string
>
> `chosen_value`
> Value
>
> `consuming`
> bool
>
> `children`
> repeated string
>
> `exercise_result`
> Value
>
> `choice_observers`
> repeated string
>
> `key`
> GlobalKeyWithMaintainers
>
> `by_key`
> bool
>
> `external_call_results`
> repeated ExternalCallResult

> [accordion] com.daml.ledger.api.v2.interactive.transaction.v1.ExternalCallResult
>
> `extension_id`
> string
>
> `function_id`
> string
>
> `config`
> bytes
>
> `input`
> bytes
>
> `output`
> bytes

> [accordion] com.daml.ledger.api.v2.interactive.transaction.v1.Rollback
>
> `children`
> repeated string

> [accordion] com.daml.ledger.api.v2.interactive.transaction.v1.QueryByKey
>
> `lf_version`
> string
>
> `package_name`
> string
>
> `template_id`
> Identifier
>
> `exhaustive`
> bool
>
> `key`
> GlobalKeyWithMaintainers
>
> `result`
> repeated string

> [accordion] com.daml.ledger.api.v2.interactive.Metadata
>
> `submitter_info`
> SubmitterInfo
>
> `synchronizer_id`
> string
>
> `mediator_group`
> uint32
>
> `transaction_uuid`
> string
>
> `preparation_time`
> uint64
>
> `input_contracts`
> repeated InputContract
>
> `min_ledger_effective_time`
> uint64
>
> `max_ledger_effective_time`
> uint64
>
> `max_record_time`
> uint64
>
> `global_key_mapping`
> repeated GlobalKeyMappingEntry

> [accordion] com.daml.ledger.api.v2.interactive.Metadata.SubmitterInfo
>
> `act_as`
> repeated string
>
> `command_id`
> string

> [accordion] com.daml.ledger.api.v2.interactive.Metadata.GlobalKeyMappingEntry
>
> `key`
> GlobalKey
>
> `value`
> Value

> [accordion] com.daml.ledger.api.v2.interactive.Metadata.InputContract
>
> `v1`
> Create
>
> `created_at`
> uint64
>
> `event_blob`
> bytes

> [accordion] com.daml.ledger.api.v2.interactive.CostEstimation
>
> `estimation_timestamp`
> Timestamp
>
> `confirmation_request_traffic_cost_estimation`
> uint64
>
> `confirmation_response_traffic_cost_estimation`
> uint64
>
> `total_traffic_cost_estimation`
> uint64
>
> `reassignment_costs`
> repeated ReassignmentCost

> [accordion] com.daml.ledger.api.v2.interactive.ReassignmentCost
>
> `source_synchronizer_id`
> string
>
> `target_synchronizer_id`
> string
>
> `contract_ids`
> repeated string
>
> `unassignment_request_traffic_cost_estimation`
> uint64
>
> `unassignment_response_traffic_cost_estimation`
> uint64
>
> `assignment_request_traffic_cost_estimation`
> uint64
>
> `assignment_response_traffic_cost_estimation`
> uint64
>
> `total_reassignment_cost_estimation`
> uint64

grpcurl

```bash grpcurl theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Add -plaintext if the server is not using TLS.
grpcurl \
  -d @ \
  <HOST:PORT> \
  com.daml.ledger.api.v2.interactive.InteractiveSubmissionService/PrepareSubmission <<'EOF'
{
  "userId": "string",
  "commandId": "string",
  "commands": [
    {
      "create": {
        "templateId": {
          "packageId": "string",
          "moduleName": "string",
          "entityName": "string"
        },
        "createArguments": {
          "recordId": {},
          "fields": [
            {}
          ]
        }
      }
    }
  ],
  "minLedgerTime": {
    "minLedgerTimeAbs": "string"
  },
  "maxRecordTime": "string",
  "actAs": [
    "string"
  ],
  "readAs": [
    "string"
  ],
  "disclosedContracts": [
    {
      "templateId": {
        "packageId": "string",
        "moduleName": "string",
        "entityName": "string"
      },
      "contractId": "string",
      "createdEventBlob": "BASE64_ENCODED_BYTES",
      "synchronizerId": "string"
    }
  ]
}
EOF
```

OK

application/json

```json OK theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "preparedTransaction": {
    "transaction": {
      "version": "string",
      "roots": [
        "string"
      ],
      "nodes": [
        {
          "nodeId": "string",
          "v1": {}
        }
      ],
      "nodeSeeds": [
        {
          "nodeId": 0,
          "seed": "BASE64_ENCODED_BYTES"
        }
      ]
    },
    "metadata": {
      "submitterInfo": {
        "actAs": [
          "string"
        ],
        "commandId": "string"
      },
      "synchronizerId": "string",
      "mediatorGroup": 0,
      "transactionUuid": "string",
      "preparationTime": "0",
      "inputContracts": [
        {
          "v1": {},
          "createdAt": "0",
          "eventBlob": "BASE64_ENCODED_BYTES"
        }
      ],
      "minLedgerEffectiveTime": "0",
      "maxLedgerEffectiveTime": "0"
    }
  },
  "preparedTransactionHash": "BASE64_ENCODED_BYTES",
  "hashingSchemeVersion": "HASHING_SCHEME_VERSION_UNSPECIFIED",
  "hashingDetails": "string",
  "costEstimation": {
    "estimationTimestamp": "string",
    "confirmationRequestTrafficCostEstimation": "0",
    "confirmationResponseTrafficCostEstimation": "0",
    "totalTrafficCostEstimation": "0",
    "reassignmentCosts": [
      {
        "sourceSynchronizerId": "string",
        "targetSynchronizerId": "string",
        "contractIds": [
          "string"
        ],
        "unassignmentRequestTrafficCostEstimation": "0",
        "unassignmentResponseTrafficCostEstimation": "0",
        "assignmentRequestTrafficCostEstimation": "0",
        "assignmentResponseTrafficCostEstimation": "0",
        "totalReassignmentCostEstimation": "0"
      }
    ]
  }
}
```
