> ## 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.

# SubmitAndWaitForTransaction

Ledger API

›

[gRPC API](https://docs.canton.network/reference/grpc-ledger-api-reference/overview.md)

›

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

›

SubmitAndWaitForTransaction

com.daml.ledger.api.v2

# SubmitAndWaitForTransaction

gRPC

RPC

`/com.daml.ledger.api.v2.CommandService/SubmitAndWaitForTransaction`

## Protocol Details

Protocol
gRPC

Service
CommandService

RPC
SubmitAndWaitForTransaction

Client stream
No

Server stream
No

## Inputs

### SubmitAndWaitForTransactionRequest

Message
com.daml.ledger.api.v2.SubmitAndWaitForTransactionRequest

Client stream
No

`commands`
Commands

`transaction_format`
TransactionFormat

## Outputs

### SubmitAndWaitForTransactionResponse

Message
com.daml.ledger.api.v2.SubmitAndWaitForTransactionResponse

Server stream
No

`transaction`
Transaction

## Related Schemas

> [accordion] com.daml.ledger.api.v2.SubmitAndWaitForTransactionRequest
>
> `commands`
> Commands
>
> `transaction_format`
> TransactionFormat

> [accordion] com.daml.ledger.api.v2.Commands
>
> `workflow_id`
> string
>
> `user_id`
> string
>
> `command_id`
> string
>
> `commands`
> repeated Command
>
> `deduplication_duration`
> Duration
>
> `deduplication_offset`
> int64
>
> `min_ledger_time_abs`
> Timestamp
>
> `min_ledger_time_rel`
> Duration
>
> `act_as`
> repeated string
>
> `read_as`
> repeated string
>
> `submission_id`
> string
>
> `disclosed_contracts`
> repeated DisclosedContract
>
> `synchronizer_id`
> string
>
> `package_id_selection_preference`
> repeated string
>
> `prefetch_contract_keys`
> repeated PrefetchContractKey
>
> `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.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.TransactionFormat
>
> `event_format`
> EventFormat
>
> `transaction_shape`
> TransactionShape

> [accordion] com.daml.ledger.api.v2.EventFormat
>
> `filters_by_party`
> repeated map
>
> `filters_for_any_party`
> Filters
>
> `verbose`
> bool

> [accordion] com.daml.ledger.api.v2.Filters
>
> `cumulative`
> repeated CumulativeFilter

> [accordion] com.daml.ledger.api.v2.CumulativeFilter
>
> `wildcard_filter`
> WildcardFilter
>
> `interface_filter`
> InterfaceFilter
>
> `template_filter`
> TemplateFilter

> [accordion] com.daml.ledger.api.v2.WildcardFilter
>
> `include_created_event_blob`
> bool

> [accordion] com.daml.ledger.api.v2.InterfaceFilter
>
> `interface_id`
> Identifier
>
> `include_interface_view`
> bool
>
> `include_created_event_blob`
> bool

> [accordion] com.daml.ledger.api.v2.TemplateFilter
>
> `template_id`
> Identifier
>
> `include_created_event_blob`
> bool

> [accordion] com.daml.ledger.api.v2.TransactionShape
>
> <ul>
>   <li>`TRANSACTION_SHAPE_UNSPECIFIED`</li>
>
>   <li>`TRANSACTION_SHAPE_ACS_DELTA`</li>
>
>   <li>`TRANSACTION_SHAPE_LEDGER_EFFECTS`</li>
> </ul>

> [accordion] com.daml.ledger.api.v2.SubmitAndWaitForTransactionResponse
>
> `transaction`
> Transaction

> [accordion] com.daml.ledger.api.v2.Transaction
>
> `update_id`
> string
>
> `command_id`
> string
>
> `workflow_id`
> string
>
> `effective_at`
> Timestamp
>
> `events`
> repeated Event
>
> `offset`
> int64
>
> `synchronizer_id`
> string
>
> `trace_context`
> TraceContext
>
> `record_time`
> Timestamp
>
> `external_transaction_hash`
> bytes
>
> `paid_traffic_cost`
> int64
>
> `transaction_hash`
> bytes

> [accordion] com.daml.ledger.api.v2.Event
>
> `created`
> CreatedEvent
>
> `archived`
> ArchivedEvent
>
> `exercised`
> ExercisedEvent

> [accordion] com.daml.ledger.api.v2.CreatedEvent
>
> `offset`
> int64
>
> `node_id`
> int32
>
> `contract_id`
> string
>
> `template_id`
> Identifier
>
> `contract_key`
> Value
>
> `contract_key_hash`
> bytes
>
> `create_arguments`
> Record
>
> `created_event_blob`
> bytes
>
> `interface_views`
> repeated InterfaceView
>
> `witness_parties`
> repeated string
>
> `signatories`
> repeated string
>
> `observers`
> repeated string
>
> `created_at`
> Timestamp
>
> `package_name`
> string
>
> `acs_delta`
> bool
>
> `representative_package_id`
> string

> [accordion] com.daml.ledger.api.v2.InterfaceView
>
> `interface_id`
> Identifier
>
> `view_status`
> Status
>
> `view_value`
> Record
>
> `implementation_package_id`
> string

> [accordion] com.daml.ledger.api.v2.ArchivedEvent
>
> `offset`
> int64
>
> `node_id`
> int32
>
> `contract_id`
> string
>
> `template_id`
> Identifier
>
> `witness_parties`
> repeated string
>
> `package_name`
> string
>
> `implemented_interfaces`
> repeated Identifier

> [accordion] com.daml.ledger.api.v2.ExercisedEvent
>
> `offset`
> int64
>
> `node_id`
> int32
>
> `contract_id`
> string
>
> `template_id`
> Identifier
>
> `interface_id`
> Identifier
>
> `choice`
> string
>
> `choice_argument`
> Value
>
> `acting_parties`
> repeated string
>
> `consuming`
> bool
>
> `witness_parties`
> repeated string
>
> `last_descendant_node_id`
> int32
>
> `exercise_result`
> Value
>
> `package_name`
> string
>
> `implemented_interfaces`
> repeated Identifier
>
> `acs_delta`
> bool

> [accordion] com.daml.ledger.api.v2.TraceContext
>
> `traceparent`
> string
>
> `tracestate`
> string

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.CommandService/SubmitAndWaitForTransaction <<'EOF'
{
  "commands": {
    "workflowId": "string",
    "userId": "string",
    "commandId": "string",
    "commands": [
      {
        "create": {
          "templateId": {},
          "createArguments": {}
        }
      }
    ],
    "deduplicationDuration": "string",
    "minLedgerTimeAbs": "string",
    "minLedgerTimeRel": "string"
  },
  "transactionFormat": {
    "eventFormat": {
      "filtersByParty": [
        {
          "key": {
            "cumulative": [
              {}
            ]
          }
        }
      ],
      "filtersForAnyParty": {
        "cumulative": [
          {}
        ]
      },
      "verbose": true
    },
    "transactionShape": "TRANSACTION_SHAPE_UNSPECIFIED"
  }
}
EOF
```

OK

application/json

```json OK theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "transaction": {
    "updateId": "string",
    "commandId": "string",
    "workflowId": "string",
    "effectiveAt": "string",
    "events": [
      {
        "created": {
          "offset": "0",
          "nodeId": 0,
          "contractId": "string",
          "templateId": {},
          "contractKey": {},
          "contractKeyHash": "BASE64_ENCODED_BYTES",
          "createArguments": {},
          "createdEventBlob": "BASE64_ENCODED_BYTES"
        }
      }
    ],
    "offset": "0",
    "synchronizerId": "string",
    "traceContext": {
      "traceparent": "string",
      "tracestate": "string"
    }
  }
}
```
