curl --request POST \
--url 'http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree' \
--header 'Authorization: Bearer $TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}'
import json
import requests
url = "http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree"
headers = {'Authorization': 'Bearer <token>', 'Content-Type': 'application/json'}
payload = json.loads(r'''{
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}''')
response = requests.request(
"POST", url, headers=headers, json=payload
)
print(response.text)
const response = await fetch('http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree', {
method: 'POST',
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}),
});
console.log(await response.text());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => <<<'JSON'
{
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}
JSON,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
echo $response;
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree", bytes.NewBufferString(`{
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}`))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
response, _ := http.DefaultClient.Do(req)
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
var request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}
"""))
.build();
var response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require 'net/http'
require 'uri'
uri = URI('http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(request)
end
puts response.body
{
"transactionTree": {
"updateId": "<string>",
"commandId": "<string>",
"workflowId": "<string>",
"effectiveAt": "<string>",
"offset": 123,
"eventsById": {},
"synchronizerId": "<string>",
"traceContext": {
"traceparent": "<string>",
"tracestate": "<string>"
},
"recordTime": "<string>"
}
}
<string>
{
"code": "<string>",
"cause": "<string>",
"correlationId": "<string>",
"traceId": "<string>",
"context": {},
"resources": [
[
"<string>"
]
],
"errorCategory": 123,
"grpcCodeValue": 123,
"retryInfo": "<string>",
"definiteAnswer": false
}
POST /v2/commands/submit-and-wait-for-transaction-tree
Submit a batch of commands and wait for the transaction trees response. Provided for backwards compatibility, it will be removed in the Canton version 3.5.0, use submit-and-wait-for-transaction instead.
curl --request POST \
--url 'http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree' \
--header 'Authorization: Bearer $TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}'
import json
import requests
url = "http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree"
headers = {'Authorization': 'Bearer <token>', 'Content-Type': 'application/json'}
payload = json.loads(r'''{
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}''')
response = requests.request(
"POST", url, headers=headers, json=payload
)
print(response.text)
const response = await fetch('http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree', {
method: 'POST',
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}),
});
console.log(await response.text());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => <<<'JSON'
{
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}
JSON,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
echo $response;
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree", bytes.NewBufferString(`{
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}`))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
response, _ := http.DefaultClient.Do(req)
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
var request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}
"""))
.build();
var response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require 'net/http'
require 'uri'
uri = URI('http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(request)
end
puts response.body
{
"transactionTree": {
"updateId": "<string>",
"commandId": "<string>",
"workflowId": "<string>",
"effectiveAt": "<string>",
"offset": 123,
"eventsById": {},
"synchronizerId": "<string>",
"traceContext": {
"traceparent": "<string>",
"tracestate": "<string>"
},
"recordTime": "<string>"
}
}
<string>
{
"code": "<string>",
"cause": "<string>",
"correlationId": "<string>",
"traceId": "<string>",
"context": {},
"resources": [
[
"<string>"
]
],
"errorCategory": 123,
"grpcCodeValue": 123,
"retryInfo": "<string>",
"definiteAnswer": false
}
Submit a batch of commands and wait for the transaction trees response. Provided for backwards compatibility, it will be removed in the Canton version 3.5.0, use submit-and-wait-for-transaction instead.
curl --request POST \
--url 'http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree' \
--header 'Authorization: Bearer $TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}'
import json
import requests
url = "http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree"
headers = {'Authorization': 'Bearer <token>', 'Content-Type': 'application/json'}
payload = json.loads(r'''{
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}''')
response = requests.request(
"POST", url, headers=headers, json=payload
)
print(response.text)
const response = await fetch('http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree', {
method: 'POST',
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}),
});
console.log(await response.text());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => <<<'JSON'
{
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}
JSON,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
echo $response;
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree", bytes.NewBufferString(`{
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}`))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
response, _ := http.DefaultClient.Do(req)
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
var request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}
"""))
.build();
var response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require 'net/http'
require 'uri'
uri = URI('http://localhost:7575/v2/commands/submit-and-wait-for-transaction-tree')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<string>",
"choice": "<string>",
"choiceArgument": "<string>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": "<object>"
}
}
}
},
"minLedgerTimeAbs": "<string>",
"minLedgerTimeRel": {
"seconds": 123,
"nanos": 123,
"unknownFields": {
"fields": {}
}
},
"submissionId": "<string>",
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<string>",
"limit": 123
}
],
"tapsMaxPasses": 123
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(request)
end
puts response.body
{
"transactionTree": {
"updateId": "<string>",
"commandId": "<string>",
"workflowId": "<string>",
"effectiveAt": "<string>",
"offset": 123,
"eventsById": {},
"synchronizerId": "<string>",
"traceContext": {
"traceparent": "<string>",
"tracestate": "<string>"
},
"recordTime": "<string>"
}
}
<string>
{
"code": "<string>",
"cause": "<string>",
"correlationId": "<string>",
"traceId": "<string>",
"context": {},
"resources": [
[
"<string>"
]
],
"errorCategory": 123,
"grpcCodeValue": 123,
"retryInfo": "<string>",
"definiteAnswer": false
}
Authorizations
httpAuth
Authorization: Bearer <token>. Ledger API standard JWT tokenapiKeyAuth
Body
Command[].Individual elements of this atomic command. Must be non-empty. Required: must be non-emptyShow child attributes
Show child attributes
Show child attributes
Show child attributes
CreateAndExerciseCommand.Create a contract and exercise a choice on it in the same transaction.Show child attributes
Show child attributes
value.proto). RequiredShow child attributes
Show child attributes
CreateCommand.Create a new contract instance based on a template.Show child attributes
Show child attributes
Show child attributes
Show child attributes
ExerciseByKeyCommand.Exercise a choice on an existing contract specified by its key.Show child attributes
Show child attributes
value.proto) RequiredShow child attributes
Show child attributes
ExerciseCommand.Exercise a choice on an existing contract.Show child attributes
Show child attributes
value.proto). Requiredvalue.proto) Requiredvalue.proto). Requiredvalue.proto). Required: must be non-emptyvalue.proto). Required unless authentication is used with a user token. In that case, the token’s user-id will be used for the request’s user_id. Optionalact_as) contracts can be retrieved. This affects Daml operations such as fetch, fetchByKey, lookupByKey, exercise, and exerciseByKey. Note: A participant node of a Daml network can host multiple parties. Each contract present on the participant node is only visible to a subset of these parties. A command can only use contracts that are visible to at least one of the parties in act_as or read_as. This visibility check is independent from the Daml authorization rules for fetch operations. If ledger API authorization is enabled, then the authorization metadata must authorize the sender of the request to read contract data on behalf of each of the given parties. Optional: can be emptyvalue.proto). OptionalDeduplicationPeriod.Specifies the deduplication period for the change ID. If omitted, the participant will assume the configured maximum deduplication time. OptionalShow child attributes
Show child attributes
Show child attributes
Show child attributes
DeduplicationDuration.Show child attributes
Show child attributes
Duration.Duration.Same as min_ledger_time_abs, but specified as a duration, starting from the time the command is received by the server. Must not be set at the same time as min_ledger_time_abs. Optionalvalue.proto). If omitted, the participant or the committer may set a value of their choice. OptionalDisclosedContract[].Additional contracts used to resolve contract & contract key lookups. Optional: can be emptyShow child attributes
Show child attributes
PrefetchContractKey[].Fetches the contract keys into the caches to speed up the command processing. Each entry specifies a key and a limit on how many contracts to prefetch for that key. The limit does not count disclosed contracts, and should reflect the number of additional contracts expected to be resolved during interpretation of the commands. If a key appears multiple times, the last entry’s limit wins. Optional: can be emptyShow child attributes
Show child attributes
integer (int32).The number of contracts to prefetch for this key, if available. This is in addition to disclosed contracts. - for backward compatibility reason, absence is interpreted as 1 - 0 is forbidden - capped at 2^31 - 1. The system may impose further limits. Optionalinteger (int32).The maximum number of passes for the Topology-Aware Package Selection (TAPS). Higher values can increase the chance of successful package selection for routing of interpreted transactions. If unset, this defaults to the value defined in the participant configuration. The provided value must not exceed the limit specified in the participant configuration. OptionalResponses
200
Show child attributes
Show child attributes
value.proto). Requiredvalue.proto). Optionalworkflow_id for the command was set. Must be a valid LedgerString (as described in value.proto). Optionalcommunity/ledger-api/README.md. Required, it is a valid absolute offset (positive integer).Show child attributes
Show child attributes
400
Invalid value, Invalid value for: bodydefault
History
3.5.03.5The POST /v2/commands/submit-and-wait-for-transaction-tree operation was updated in this snapshot.
3.43.4