Skip to content
CCPEDIAby Unity Nodes
Documentation/Canton Network Docs/Ledger APIOpenAPIView on Canton Network Docs

POST /v2/interactive-submission/prepare

POST
/
v2
/
interactive-submission
/
prepare
Try it
cURL
Python
JavaScript
PHP
Go
Java
Ruby
curl --request POST \
  --url 'http://localhost:7575/v2/interactive-submission/prepare' \
  --header 'Authorization: Bearer $TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "userId": "<string>",
  "commandId": "<string>",
  "commands": [
    {
      "CreateAndExerciseCommand": {
        "templateId": "<string>",
        "createArguments": "<string>",
        "choice": "<string>",
        "choiceArgument": "<string>"
      }
    }
  ],
  "minLedgerTime": {
    "time": {
      "Empty": {}
    }
  },
  "actAs": [
    "<string>"
  ],
  "readAs": [
    "<string>"
  ],
  "disclosedContracts": [
    {
      "templateId": "<string>",
      "contractId": "<string>",
      "createdEventBlob": "<string>",
      "synchronizerId": "<string>"
    }
  ],
  "synchronizerId": "<string>",
  "packageIdSelectionPreference": [
    "<string>"
  ],
  "verboseHashing": false,
  "prefetchContractKeys": [
    {
      "templateId": "<string>",
      "contractKey": "<string>",
      "limit": 123
    }
  ],
  "maxRecordTime": "<string>",
  "estimateTrafficCost": {
    "disabled": false,
    "expectedSignatures": [
      "SIGNING_ALGORITHM_SPEC_UNSPECIFIED"
    ]
  },
  "tapsMaxPasses": 123,
  "hashingSchemeVersion": "HASHING_SCHEME_VERSION_UNSPECIFIED"
}'
import json
import requests

url = "http://localhost:7575/v2/interactive-submission/prepare"
headers = {'Authorization': 'Bearer <token>', 'Content-Type': 'application/json'}
payload = json.loads(r'''{
  "userId": "<string>",
  "commandId": "<string>",
  "commands": [
    {
      "CreateAndExerciseCommand": {
        "templateId": "<string>",
        "createArguments": "<string>",
        "choice": "<string>",
        "choiceArgument": "<string>"
      }
    }
  ],
  "minLedgerTime": {
    "time": {
      "Empty": {}
    }
  },
  "actAs": [
    "<string>"
  ],
  "readAs": [
    "<string>"
  ],
  "disclosedContracts": [
    {
      "templateId": "<string>",
      "contractId": "<string>",
      "createdEventBlob": "<string>",
      "synchronizerId": "<string>"
    }
  ],
  "synchronizerId": "<string>",
  "packageIdSelectionPreference": [
    "<string>"
  ],
  "verboseHashing": false,
  "prefetchContractKeys": [
    {
      "templateId": "<string>",
      "contractKey": "<string>",
      "limit": 123
    }
  ],
  "maxRecordTime": "<string>",
  "estimateTrafficCost": {
    "disabled": false,
    "expectedSignatures": [
      "SIGNING_ALGORITHM_SPEC_UNSPECIFIED"
    ]
  },
  "tapsMaxPasses": 123,
  "hashingSchemeVersion": "HASHING_SCHEME_VERSION_UNSPECIFIED"
}''')
response = requests.request(
    "POST", url, headers=headers, json=payload
)

print(response.text)
const response = await fetch('http://localhost:7575/v2/interactive-submission/prepare', {
  method: 'POST',
  headers: {
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
},
  body: JSON.stringify({
  "userId": "<string>",
  "commandId": "<string>",
  "commands": [
    {
      "CreateAndExerciseCommand": {
        "templateId": "<string>",
        "createArguments": "<string>",
        "choice": "<string>",
        "choiceArgument": "<string>"
      }
    }
  ],
  "minLedgerTime": {
    "time": {
      "Empty": {}
    }
  },
  "actAs": [
    "<string>"
  ],
  "readAs": [
    "<string>"
  ],
  "disclosedContracts": [
    {
      "templateId": "<string>",
      "contractId": "<string>",
      "createdEventBlob": "<string>",
      "synchronizerId": "<string>"
    }
  ],
  "synchronizerId": "<string>",
  "packageIdSelectionPreference": [
    "<string>"
  ],
  "verboseHashing": false,
  "prefetchContractKeys": [
    {
      "templateId": "<string>",
      "contractKey": "<string>",
      "limit": 123
    }
  ],
  "maxRecordTime": "<string>",
  "estimateTrafficCost": {
    "disabled": false,
    "expectedSignatures": [
      "SIGNING_ALGORITHM_SPEC_UNSPECIFIED"
    ]
  },
  "tapsMaxPasses": 123,
  "hashingSchemeVersion": "HASHING_SCHEME_VERSION_UNSPECIFIED"
}),
});

console.log(await response.text());
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => 'http://localhost:7575/v2/interactive-submission/prepare',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => <<<'JSON'
{
  "userId": "<string>",
  "commandId": "<string>",
  "commands": [
    {
      "CreateAndExerciseCommand": {
        "templateId": "<string>",
        "createArguments": "<string>",
        "choice": "<string>",
        "choiceArgument": "<string>"
      }
    }
  ],
  "minLedgerTime": {
    "time": {
      "Empty": {}
    }
  },
  "actAs": [
    "<string>"
  ],
  "readAs": [
    "<string>"
  ],
  "disclosedContracts": [
    {
      "templateId": "<string>",
      "contractId": "<string>",
      "createdEventBlob": "<string>",
      "synchronizerId": "<string>"
    }
  ],
  "synchronizerId": "<string>",
  "packageIdSelectionPreference": [
    "<string>"
  ],
  "verboseHashing": false,
  "prefetchContractKeys": [
    {
      "templateId": "<string>",
      "contractKey": "<string>",
      "limit": 123
    }
  ],
  "maxRecordTime": "<string>",
  "estimateTrafficCost": {
    "disabled": false,
    "expectedSignatures": [
      "SIGNING_ALGORITHM_SPEC_UNSPECIFIED"
    ]
  },
  "tapsMaxPasses": 123,
  "hashingSchemeVersion": "HASHING_SCHEME_VERSION_UNSPECIFIED"
}
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/interactive-submission/prepare", bytes.NewBufferString(`{
  "userId": "<string>",
  "commandId": "<string>",
  "commands": [
    {
      "CreateAndExerciseCommand": {
        "templateId": "<string>",
        "createArguments": "<string>",
        "choice": "<string>",
        "choiceArgument": "<string>"
      }
    }
  ],
  "minLedgerTime": {
    "time": {
      "Empty": {}
    }
  },
  "actAs": [
    "<string>"
  ],
  "readAs": [
    "<string>"
  ],
  "disclosedContracts": [
    {
      "templateId": "<string>",
      "contractId": "<string>",
      "createdEventBlob": "<string>",
      "synchronizerId": "<string>"
    }
  ],
  "synchronizerId": "<string>",
  "packageIdSelectionPreference": [
    "<string>"
  ],
  "verboseHashing": false,
  "prefetchContractKeys": [
    {
      "templateId": "<string>",
      "contractKey": "<string>",
      "limit": 123
    }
  ],
  "maxRecordTime": "<string>",
  "estimateTrafficCost": {
    "disabled": false,
    "expectedSignatures": [
      "SIGNING_ALGORITHM_SPEC_UNSPECIFIED"
    ]
  },
  "tapsMaxPasses": 123,
  "hashingSchemeVersion": "HASHING_SCHEME_VERSION_UNSPECIFIED"
}`))
  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/interactive-submission/prepare"))
    .header("Authorization", "Bearer <token>")
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("""
{
  "userId": "<string>",
  "commandId": "<string>",
  "commands": [
    {
      "CreateAndExerciseCommand": {
        "templateId": "<string>",
        "createArguments": "<string>",
        "choice": "<string>",
        "choiceArgument": "<string>"
      }
    }
  ],
  "minLedgerTime": {
    "time": {
      "Empty": {}
    }
  },
  "actAs": [
    "<string>"
  ],
  "readAs": [
    "<string>"
  ],
  "disclosedContracts": [
    {
      "templateId": "<string>",
      "contractId": "<string>",
      "createdEventBlob": "<string>",
      "synchronizerId": "<string>"
    }
  ],
  "synchronizerId": "<string>",
  "packageIdSelectionPreference": [
    "<string>"
  ],
  "verboseHashing": false,
  "prefetchContractKeys": [
    {
      "templateId": "<string>",
      "contractKey": "<string>",
      "limit": 123
    }
  ],
  "maxRecordTime": "<string>",
  "estimateTrafficCost": {
    "disabled": false,
    "expectedSignatures": [
      "SIGNING_ALGORITHM_SPEC_UNSPECIFIED"
    ]
  },
  "tapsMaxPasses": 123,
  "hashingSchemeVersion": "HASHING_SCHEME_VERSION_UNSPECIFIED"
}
"""))
    .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/interactive-submission/prepare')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
  "userId": "<string>",
  "commandId": "<string>",
  "commands": [
    {
      "CreateAndExerciseCommand": {
        "templateId": "<string>",
        "createArguments": "<string>",
        "choice": "<string>",
        "choiceArgument": "<string>"
      }
    }
  ],
  "minLedgerTime": {
    "time": {
      "Empty": {}
    }
  },
  "actAs": [
    "<string>"
  ],
  "readAs": [
    "<string>"
  ],
  "disclosedContracts": [
    {
      "templateId": "<string>",
      "contractId": "<string>",
      "createdEventBlob": "<string>",
      "synchronizerId": "<string>"
    }
  ],
  "synchronizerId": "<string>",
  "packageIdSelectionPreference": [
    "<string>"
  ],
  "verboseHashing": false,
  "prefetchContractKeys": [
    {
      "templateId": "<string>",
      "contractKey": "<string>",
      "limit": 123
    }
  ],
  "maxRecordTime": "<string>",
  "estimateTrafficCost": {
    "disabled": false,
    "expectedSignatures": [
      "SIGNING_ALGORITHM_SPEC_UNSPECIFIED"
    ]
  },
  "tapsMaxPasses": 123,
  "hashingSchemeVersion": "HASHING_SCHEME_VERSION_UNSPECIFIED"
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
  http.request(request)
end
puts response.body
200
400
default
{
  "preparedTransaction": "<string>",
  "preparedTransactionHash": "<string>",
  "hashingSchemeVersion": "HASHING_SCHEME_VERSION_UNSPECIFIED",
  "hashingDetails": "<string>",
  "costEstimation": {
    "estimationTimestamp": "<string>",
    "confirmationRequestTrafficCostEstimation": 123,
    "confirmationResponseTrafficCostEstimation": 123,
    "totalTrafficCostEstimation": 123
  }
}
<string>
{
  "code": "<string>",
  "cause": "<string>",
  "correlationId": "<string>",
  "traceId": "<string>",
  "context": {},
  "resources": [
    [
      "<string>"
    ]
  ],
  "errorCategory": 123,
  "grpcCodeValue": 123,
  "retryInfo": "<string>",
  "definiteAnswer": false
}

Requires readAs scope for the submitting party when LAPI User authorization is enabled

cURL
Python
JavaScript
PHP
Go
Java
Ruby
curl --request POST \
  --url 'http://localhost:7575/v2/interactive-submission/prepare' \
  --header 'Authorization: Bearer $TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "userId": "<string>",
  "commandId": "<string>",
  "commands": [
    {
      "CreateAndExerciseCommand": {
        "templateId": "<string>",
        "createArguments": "<string>",
        "choice": "<string>",
        "choiceArgument": "<string>"
      }
    }
  ],
  "minLedgerTime": {
    "time": {
      "Empty": {}
    }
  },
  "actAs": [
    "<string>"
  ],
  "readAs": [
    "<string>"
  ],
  "disclosedContracts": [
    {
      "templateId": "<string>",
      "contractId": "<string>",
      "createdEventBlob": "<string>",
      "synchronizerId": "<string>"
    }
  ],
  "synchronizerId": "<string>",
  "packageIdSelectionPreference": [
    "<string>"
  ],
  "verboseHashing": false,
  "prefetchContractKeys": [
    {
      "templateId": "<string>",
      "contractKey": "<string>",
      "limit": 123
    }
  ],
  "maxRecordTime": "<string>",
  "estimateTrafficCost": {
    "disabled": false,
    "expectedSignatures": [
      "SIGNING_ALGORITHM_SPEC_UNSPECIFIED"
    ]
  },
  "tapsMaxPasses": 123,
  "hashingSchemeVersion": "HASHING_SCHEME_VERSION_UNSPECIFIED"
}'
import json
import requests

url = "http://localhost:7575/v2/interactive-submission/prepare"
headers = {'Authorization': 'Bearer <token>', 'Content-Type': 'application/json'}
payload = json.loads(r'''{
  "userId": "<string>",
  "commandId": "<string>",
  "commands": [
    {
      "CreateAndExerciseCommand": {
        "templateId": "<string>",
        "createArguments": "<string>",
        "choice": "<string>",
        "choiceArgument": "<string>"
      }
    }
  ],
  "minLedgerTime": {
    "time": {
      "Empty": {}
    }
  },
  "actAs": [
    "<string>"
  ],
  "readAs": [
    "<string>"
  ],
  "disclosedContracts": [
    {
      "templateId": "<string>",
      "contractId": "<string>",
      "createdEventBlob": "<string>",
      "synchronizerId": "<string>"
    }
  ],
  "synchronizerId": "<string>",
  "packageIdSelectionPreference": [
    "<string>"
  ],
  "verboseHashing": false,
  "prefetchContractKeys": [
    {
      "templateId": "<string>",
      "contractKey": "<string>",
      "limit": 123
    }
  ],
  "maxRecordTime": "<string>",
  "estimateTrafficCost": {
    "disabled": false,
    "expectedSignatures": [
      "SIGNING_ALGORITHM_SPEC_UNSPECIFIED"
    ]
  },
  "tapsMaxPasses": 123,
  "hashingSchemeVersion": "HASHING_SCHEME_VERSION_UNSPECIFIED"
}''')
response = requests.request(
    "POST", url, headers=headers, json=payload
)

print(response.text)
const response = await fetch('http://localhost:7575/v2/interactive-submission/prepare', {
  method: 'POST',
  headers: {
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
},
  body: JSON.stringify({
  "userId": "<string>",
  "commandId": "<string>",
  "commands": [
    {
      "CreateAndExerciseCommand": {
        "templateId": "<string>",
        "createArguments": "<string>",
        "choice": "<string>",
        "choiceArgument": "<string>"
      }
    }
  ],
  "minLedgerTime": {
    "time": {
      "Empty": {}
    }
  },
  "actAs": [
    "<string>"
  ],
  "readAs": [
    "<string>"
  ],
  "disclosedContracts": [
    {
      "templateId": "<string>",
      "contractId": "<string>",
      "createdEventBlob": "<string>",
      "synchronizerId": "<string>"
    }
  ],
  "synchronizerId": "<string>",
  "packageIdSelectionPreference": [
    "<string>"
  ],
  "verboseHashing": false,
  "prefetchContractKeys": [
    {
      "templateId": "<string>",
      "contractKey": "<string>",
      "limit": 123
    }
  ],
  "maxRecordTime": "<string>",
  "estimateTrafficCost": {
    "disabled": false,
    "expectedSignatures": [
      "SIGNING_ALGORITHM_SPEC_UNSPECIFIED"
    ]
  },
  "tapsMaxPasses": 123,
  "hashingSchemeVersion": "HASHING_SCHEME_VERSION_UNSPECIFIED"
}),
});

console.log(await response.text());
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => 'http://localhost:7575/v2/interactive-submission/prepare',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => <<<'JSON'
{
  "userId": "<string>",
  "commandId": "<string>",
  "commands": [
    {
      "CreateAndExerciseCommand": {
        "templateId": "<string>",
        "createArguments": "<string>",
        "choice": "<string>",
        "choiceArgument": "<string>"
      }
    }
  ],
  "minLedgerTime": {
    "time": {
      "Empty": {}
    }
  },
  "actAs": [
    "<string>"
  ],
  "readAs": [
    "<string>"
  ],
  "disclosedContracts": [
    {
      "templateId": "<string>",
      "contractId": "<string>",
      "createdEventBlob": "<string>",
      "synchronizerId": "<string>"
    }
  ],
  "synchronizerId": "<string>",
  "packageIdSelectionPreference": [
    "<string>"
  ],
  "verboseHashing": false,
  "prefetchContractKeys": [
    {
      "templateId": "<string>",
      "contractKey": "<string>",
      "limit": 123
    }
  ],
  "maxRecordTime": "<string>",
  "estimateTrafficCost": {
    "disabled": false,
    "expectedSignatures": [
      "SIGNING_ALGORITHM_SPEC_UNSPECIFIED"
    ]
  },
  "tapsMaxPasses": 123,
  "hashingSchemeVersion": "HASHING_SCHEME_VERSION_UNSPECIFIED"
}
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/interactive-submission/prepare", bytes.NewBufferString(`{
  "userId": "<string>",
  "commandId": "<string>",
  "commands": [
    {
      "CreateAndExerciseCommand": {
        "templateId": "<string>",
        "createArguments": "<string>",
        "choice": "<string>",
        "choiceArgument": "<string>"
      }
    }
  ],
  "minLedgerTime": {
    "time": {
      "Empty": {}
    }
  },
  "actAs": [
    "<string>"
  ],
  "readAs": [
    "<string>"
  ],
  "disclosedContracts": [
    {
      "templateId": "<string>",
      "contractId": "<string>",
      "createdEventBlob": "<string>",
      "synchronizerId": "<string>"
    }
  ],
  "synchronizerId": "<string>",
  "packageIdSelectionPreference": [
    "<string>"
  ],
  "verboseHashing": false,
  "prefetchContractKeys": [
    {
      "templateId": "<string>",
      "contractKey": "<string>",
      "limit": 123
    }
  ],
  "maxRecordTime": "<string>",
  "estimateTrafficCost": {
    "disabled": false,
    "expectedSignatures": [
      "SIGNING_ALGORITHM_SPEC_UNSPECIFIED"
    ]
  },
  "tapsMaxPasses": 123,
  "hashingSchemeVersion": "HASHING_SCHEME_VERSION_UNSPECIFIED"
}`))
  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/interactive-submission/prepare"))
    .header("Authorization", "Bearer <token>")
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("""
{
  "userId": "<string>",
  "commandId": "<string>",
  "commands": [
    {
      "CreateAndExerciseCommand": {
        "templateId": "<string>",
        "createArguments": "<string>",
        "choice": "<string>",
        "choiceArgument": "<string>"
      }
    }
  ],
  "minLedgerTime": {
    "time": {
      "Empty": {}
    }
  },
  "actAs": [
    "<string>"
  ],
  "readAs": [
    "<string>"
  ],
  "disclosedContracts": [
    {
      "templateId": "<string>",
      "contractId": "<string>",
      "createdEventBlob": "<string>",
      "synchronizerId": "<string>"
    }
  ],
  "synchronizerId": "<string>",
  "packageIdSelectionPreference": [
    "<string>"
  ],
  "verboseHashing": false,
  "prefetchContractKeys": [
    {
      "templateId": "<string>",
      "contractKey": "<string>",
      "limit": 123
    }
  ],
  "maxRecordTime": "<string>",
  "estimateTrafficCost": {
    "disabled": false,
    "expectedSignatures": [
      "SIGNING_ALGORITHM_SPEC_UNSPECIFIED"
    ]
  },
  "tapsMaxPasses": 123,
  "hashingSchemeVersion": "HASHING_SCHEME_VERSION_UNSPECIFIED"
}
"""))
    .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/interactive-submission/prepare')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
  "userId": "<string>",
  "commandId": "<string>",
  "commands": [
    {
      "CreateAndExerciseCommand": {
        "templateId": "<string>",
        "createArguments": "<string>",
        "choice": "<string>",
        "choiceArgument": "<string>"
      }
    }
  ],
  "minLedgerTime": {
    "time": {
      "Empty": {}
    }
  },
  "actAs": [
    "<string>"
  ],
  "readAs": [
    "<string>"
  ],
  "disclosedContracts": [
    {
      "templateId": "<string>",
      "contractId": "<string>",
      "createdEventBlob": "<string>",
      "synchronizerId": "<string>"
    }
  ],
  "synchronizerId": "<string>",
  "packageIdSelectionPreference": [
    "<string>"
  ],
  "verboseHashing": false,
  "prefetchContractKeys": [
    {
      "templateId": "<string>",
      "contractKey": "<string>",
      "limit": 123
    }
  ],
  "maxRecordTime": "<string>",
  "estimateTrafficCost": {
    "disabled": false,
    "expectedSignatures": [
      "SIGNING_ALGORITHM_SPEC_UNSPECIFIED"
    ]
  },
  "tapsMaxPasses": 123,
  "hashingSchemeVersion": "HASHING_SCHEME_VERSION_UNSPECIFIED"
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
  http.request(request)
end
puts response.body
200
400
default
{
  "preparedTransaction": "<string>",
  "preparedTransactionHash": "<string>",
  "hashingSchemeVersion": "HASHING_SCHEME_VERSION_UNSPECIFIED",
  "hashingDetails": "<string>",
  "costEstimation": {
    "estimationTimestamp": "<string>",
    "confirmationRequestTrafficCostEstimation": 123,
    "confirmationResponseTrafficCostEstimation": 123,
    "totalTrafficCostEstimation": 123
  }
}
<string>
{
  "code": "<string>",
  "cause": "<string>",
  "correlationId": "<string>",
  "traceId": "<string>",
  "context": {},
  "resources": [
    [
      "<string>"
    ]
  ],
  "errorCategory": 123,
  "grpcCodeValue": 123,
  "retryInfo": "<string>",
  "definiteAnswer": false
}

Authorizations

httpAuth

Authorization
string
required
HTTP bearer authentication. Send the token as Authorization: Bearer &lt;token&gt;. Ledger API standard JWT token

apiKeyAuth

Sec-WebSocket-Protocol
string
required
API key authentication in the header. Ledger API standard JWT token (websocket)

Body

application/json
userId
string
Uniquely identifies the participant user that prepares the transaction. Must be a valid UserIdString (as described in value.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. Optional
commandId
string
required
Uniquely identifies the command. The triple (user_id, act_as, command_id) constitutes the change ID for the intended ledger change, where act_as is interpreted as a set of party names. The change ID can be used for matching the intended ledger changes with all their completions. Must be a valid LedgerString (as described in value.proto). Required
commands
object[]
required
OpenAPI type: Command[].Individual elements of this atomic command. Must be non-empty. Limitation: Only single command transaction are currently supported by the API. The field is marked as repeated in preparation for future support of multiple commands. Required: must be non-empty

Show child attributes

Variant 1
object

Show child attributes

CreateAndExerciseCommand
object
required
OpenAPI type: CreateAndExerciseCommand.Create a contract and exercise a choice on it in the same transaction.

Show child attributes

templateId
string
required
The template of the contract the client wants to create. Both package-name and package-id reference identifier formats for the template-id are supported. Note: The package-id reference identifier format is deprecated. We plan to end support for this format in version 3.4. Required
createArguments
object
required
The arguments required for creating a contract from this template. Required
choice
string
required
The name of the choice the client wants to exercise. Must be a valid NameString (as described in value.proto). Required
choiceArgument
object
required
The argument for this choice. Required
Variant 2
object

Show child attributes

CreateCommand
object
required
OpenAPI type: CreateCommand.Create a new contract instance based on a template.

Show child attributes

templateId
string
required
The template of contract the client wants to create. Both package-name and package-id reference identifier formats for the template-id are supported. Note: The package-id reference identifier format is deprecated. We plan to end support for this format in version 3.4. Required
createArguments
object
required
The arguments required for creating a contract from this template. Required
Variant 3
object

Show child attributes

ExerciseByKeyCommand
object
required
OpenAPI type: ExerciseByKeyCommand.Exercise a choice on an existing contract specified by its key.

Show child attributes

templateId
string
required
The template of contract the client wants to exercise. Both package-name and package-id reference identifier formats for the template-id are supported. Note: The package-id reference identifier format is deprecated. We plan to end support for this format in version 3.4. Required
contractKey
object
required
The key of the contract the client wants to exercise upon. Required
choice
string
required
The name of the choice the client wants to exercise. Must be a valid NameString (as described in value.proto) Required
choiceArgument
object
required
The argument for this choice. Required
Variant 4
object

Show child attributes

ExerciseCommand
object
required
OpenAPI type: ExerciseCommand.Exercise a choice on an existing contract.

Show child attributes

templateId
string
required
The template or interface of the contract the client wants to exercise. Both package-name and package-id reference identifier formats for the template-id are supported. Note: The package-id reference identifier format is deprecated. We plan to end support for this format in version 3.4. To exercise a choice on an interface, specify the interface identifier in the template_id field. Required
contractId
string
required
The ID of the contract the client wants to exercise upon. Must be a valid LedgerString (as described in value.proto). Required
choice
string
required
The name of the choice the client wants to exercise. Must be a valid NameString (as described in value.proto) Required
choiceArgument
object
required
The argument for this choice. Required
minLedgerTime
object
OpenAPI type: MinLedgerTime.Optional

Show child attributes

time
object
OpenAPI type: Time.Required

Show child attributes

Variant 1
object

Show child attributes

Empty
object
required
OpenAPI type: Empty9.
Variant 2
object

Show child attributes

MinLedgerTimeAbs
object
required
OpenAPI type: MinLedgerTimeAbs.

Show child attributes

value
string
required
Variant 3
object

Show child attributes

MinLedgerTimeRel
object
required
OpenAPI type: MinLedgerTimeRel.

Show child attributes

value
object
required
OpenAPI type: Duration.

Show child attributes

seconds
number
required
OpenAPI type: integer (int64).
nanos
number
required
OpenAPI type: integer (int32).
unknownFields
object
OpenAPI type: UnknownFieldSet.This field is automatically added as part of protobuf to json mapping

Show child attributes

fields
object
required
OpenAPI type: Map_Int_Field.
actAs
string[]
required
Set of parties on whose behalf the command should be executed, if submitted. If ledger API authorization is enabled, then the authorization metadata must authorize the sender of the request to read (not act) on behalf of each of the given parties. This is because this RPC merely prepares a transaction and does not execute it. Therefore read authorization is sufficient even for actAs parties. Note: This may change, and more specific authorization scope may be introduced in the future. Each element must be a valid PartyIdString (as described in value.proto). Required: must be non-empty
readAs
string[]
Set of parties on whose behalf (in addition to all parties listed in act_as) contracts can be retrieved. This affects Daml operations such as fetch, fetchByKey, lookupByKey, exercise, and exerciseByKey. Note: 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 empty
disclosedContracts
object[]
OpenAPI type: DisclosedContract[].Additional contracts used to resolve contract & contract key lookups. Optional: can be empty

Show child attributes

templateId
string
The template id of the contract. The identifier uses the package-id reference format. If provided, used to validate the template id of the contract serialized in the created_event_blob. Optional
contractId
string
The contract id If provided, used to validate the contract id of the contract serialized in the created_event_blob. Optional
createdEventBlob
string
required
Opaque byte string containing the complete payload required by the Daml engine to reconstruct a contract not known to the receiving participant. Required: must be non-empty
synchronizerId
string
The ID of the synchronizer where the contract is currently assigned Optional
synchronizerId
string
Must be a valid synchronizer id If not set, a suitable synchronizer that this node is connected to will be chosen Optional
packageIdSelectionPreference
string[]
The package-id selection preference of the client for resolving package names and interface instances in command submission and interpretation Optional: can be empty
verboseHashing
boolean
When true, the response will contain additional details on how the transaction was encoded and hashed This can be useful for troubleshooting of hash mismatches. Should only be used for debugging. Defaults to false Optional
prefetchContractKeys
object[]
OpenAPI type: PrefetchContractKey[].Fetches the contract keys into the caches to speed up the command processing. Should only contain contract keys that are expected to be resolved during interpretation of the commands. Keys of disclosed contracts do not need prefetching. Optional: can be empty

Show child attributes

templateId
string
required
The template of contract the client wants to prefetch. Both package-name and package-id reference identifier formats for the template-id are supported. Note: The package-id reference identifier format is deprecated. We plan to end support for this format in version 3.4. Required
contractKey
object
required
The key of the contract the client wants to prefetch. Required
limit
number
OpenAPI type: 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. Optional
maxRecordTime
string
Maximum timestamp at which the transaction can be recorded onto the ledger via the synchronizer specified in the PrepareSubmissionResponse. If submitted after it will be rejected even if otherwise valid, in which case it needs to be prepared and signed again with a new valid max_record_time. Use this to limit the time-to-life of a prepared transaction, which is useful to know when it can definitely not be accepted anymore and resorting to preparing another transaction for the same intent is safe again. Optional
estimateTrafficCost
object
OpenAPI type: CostEstimationHints.Hints to improve cost estimation precision of a prepared transaction

Show child attributes

disabled
boolean
Disable cost estimation Default (not set) is false Optional
expectedSignatures
string[]
Details on the keys that will be used to sign the transaction (how many and of which type). Signature size impacts the cost of the transaction. If empty, the signature sizes will be approximated with threshold-many signatures (where threshold is defined in the PartyToParticipant of the external party), using keys in the order they are registered. Empty list is equivalent to not providing this field Optional: can be empty
tapsMaxPasses
number
OpenAPI type: integer (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. Optional
hashingSchemeVersion
string
The hashing scheme version to be used when building the hash. Defaults to HASHING_SCHEME_VERSION_V2. OptionalAllowed values: HASHING_SCHEME_VERSION_UNSPECIFIED, HASHING_SCHEME_VERSION_V2, HASHING_SCHEME_VERSION_V3.

Responses

200

application/json
preparedTransaction
string
required
The interpreted transaction, it represents the ledger changes necessary to execute the commands specified in the request. Clients MUST display the content of the transaction to the user for them to validate before signing the hash if the preparing participant is not trusted. Required
preparedTransactionHash
string
required
Hash of the transaction, this is what needs to be signed by the party to authorize the transaction. Only provided for convenience, clients MUST recompute the hash from the raw transaction if the preparing participant is not trusted. May be removed in future versions Required: must be non-empty
hashingSchemeVersion
string
required
The hashing scheme version used when building the hash RequiredAllowed values: HASHING_SCHEME_VERSION_UNSPECIFIED, HASHING_SCHEME_VERSION_V2, HASHING_SCHEME_VERSION_V3.
hashingDetails
string
Optional additional details on how the transaction was encoded and hashed. Only set if verbose_hashing = true in the request Note that there are no guarantees on the stability of the format or content of this field. Its content should NOT be parsed and should only be used for troubleshooting purposes. Optional
costEstimation
CostEstimation
Estimation of the cost of submitting the prepared transaction The estimation is done against the synchronizer chosen during preparation of the transaction (or the one explicitly requested). The cost of re-assigning contracts to another synchronizer when necessary is not included in the estimation.

Show child attributes

estimationTimestamp
string
required
Timestamp at which the estimation was made Required
confirmationRequestTrafficCostEstimation
integer (int64)
required
Estimated traffic cost of the confirmation request associated with the transaction Required
confirmationResponseTrafficCostEstimation
integer (int64)
required
Estimated traffic cost of the confirmation response associated with the transaction This field can also be used as an indication of the cost that other potential confirming nodes of the party will incur to approve or reject the transaction Required
totalTrafficCostEstimation
integer (int64)
required
Sum of the fields above Required

400

Invalid value, Invalid value for: body
text/plain
value
string
required

default

application/json
code
string
required
cause
string
required
correlationId
string
traceId
string
context
Map_String
required
resources
Tuple2_String_String[]
errorCategory
integer (int32)
required
grpcCodeValue
integer (int32)
retryInfo
string
definiteAnswer
boolean

History

Updated3.5

The POST /v2/interactive-submission/prepare operation changed in this snapshot.