Ledger API Reference¶
The specification for the services, methods, and messages for interacting with the gRPC-based Ledger API.
com/daml/ledger/api/v1/active_contracts_service.proto
ActiveContractsService, v1¶
Allows clients to initialize themselves according to a fairly recent state of the ledger without reading through all transactions that were committed since the ledger’s creation. In V2 Ledger API this service is not available anymore. Use v2.StateService instead.
GetActiveContracts method, v1¶
Returns a stream of the snapshot of the active contracts at a ledger offset. If there are no active contracts, the stream returns a single response message with the offset at which the snapshot has been taken. Clients SHOULD use the offset in the last GetActiveContractsResponse message to continue streaming transactions with the transaction service. Clients SHOULD NOT assume that the set of active contracts they receive reflects the state at the ledger end.
- Request: GetActiveContractsRequest
- Response: GetActiveContractsResponse
GetActiveContractsRequest message, v1¶
ledger_id
: string
Must correspond to the ledger ID reported by the Ledger Identification Service.
Must be a valid LedgerString (as described in value.proto
).
Optional
filter
: TransactionFilter
Templates to include in the served snapshot, per party. Required
verbose
: bool
If enabled, values served over the API will contain more information than strictly necessary to interpret the data. In particular, setting the verbose flag to true triggers the ledger to include labels for record fields. Optional
active_at_offset
: string
The offset at which the snapshot of the active contracts will be computed. Must be no greater than the current ledger end offset. Must be greater than or equal to the last pruning offset. If not set the current ledger end offset will be used. Optional
GetActiveContractsResponse message, v1¶
offset
: string
Included only in the last message.
The client should start consuming the transactions endpoint with this offset.
The format of this field is described in ledger_offset.proto
.
workflow_id
: string
The workflow that created the contracts.
Must be a valid LedgerString (as described in value.proto
).
active_contracts
: CreatedEvent (repeated)
The list of contracts that were introduced by the workflow with workflow_id
at the offset.
Must be a valid LedgerString (as described in value.proto
).
com/daml/ledger/api/v1/admin/command_inspection_service.proto
CommandInspectionService, v1/admin¶
Status: experimental interface, will change before it is deemed production ready
The inspection service provides methods for the ledger administrator to look under the hood of a running system. In V2 Ledger API this service is not available.
GetCommandStatus method, v1/admin¶
Inquire about the status of a command. This service is used for debugging only. The command status is only tracked in memory and is not persisted. The service can be used to understand the failure status and the structure of a command. Requires admin privileges The service is alpha without backward compatibility guarantees.
- Request: GetCommandStatusRequest
- Response: GetCommandStatusResponse
GetCommandStatusRequest message, v1/admin¶
command_id_prefix
: string
optional filter by command id
state
: CommandState
optional filter by state
limit
: uint32
optional limit of returned statuses, defaults to 100
GetCommandStatusResponse message, v1/admin¶
command_status
: GetCommandStatusResponse.CommandStatus (repeated)
GetCommandStatusResponse.CommandStatus message, v1/admin¶
started
: google.protobuf.Timestamp
completed
: google.protobuf.Timestamp
completion
: com.daml.ledger.api.v1.Completion
state
: CommandState
commands
: com.daml.ledger.api.v1.Command (repeated)
request_statistics
: GetCommandStatusResponse.CommandStatus.RequestStatistics
updates
: GetCommandStatusResponse.CommandStatus.CommandUpdates
GetCommandStatusResponse.CommandStatus.CommandUpdates message, v1/admin¶
created
: GetCommandStatusResponse.CommandStatus.CommandUpdates.Contract (repeated)
archived
: GetCommandStatusResponse.CommandStatus.CommandUpdates.Contract (repeated)
exercised
: uint32
fetched
: uint32
looked_up_by_key
: uint32
GetCommandStatusResponse.CommandStatus.CommandUpdates.Contract message, v1/admin¶
template_id
: com.daml.ledger.api.v1.Identifier
contract_id
: string
contract_key
: com.daml.ledger.api.v1.Value
GetCommandStatusResponse.CommandStatus.RequestStatistics message, v1/admin¶
envelopes
: uint32
request_size
: uint32
recipients
: uint32
CommandState enum, v1/admin¶
STATE_UNSPECIFIED |
0 | This value acts as wildcard in the queries |
STATE_PENDING |
1 | |
STATE_SUCCEEDED |
2 | |
STATE_FAILED |
3 |
com/daml/ledger/api/v1/admin/config_management_service.proto
ConfigManagementService, v1/admin¶
Status: experimental interface, will change before it is deemed production ready
The ledger configuration management service provides methods for the ledger administrator to change the current ledger configuration. The services provides methods to modify different aspects of the configuration. In V2 Ledger API this service is not available anymore.
GetTimeModel method, v1/admin¶
Return the currently active time model and the current configuration generation.
- Request: GetTimeModelRequest
- Response: GetTimeModelResponse
SetTimeModel method, v1/admin¶
Set the ledger time model.
- Request: SetTimeModelRequest
- Response: SetTimeModelResponse
GetTimeModelRequest message, v1/admin¶
Message has no fields.
GetTimeModelResponse message, v1/admin¶
configuration_generation
: int64
The current configuration generation. The generation is a monotonically increasing integer that is incremented on each change. Used when setting the time model.
time_model
: TimeModel
The current ledger time model.
SetTimeModelRequest message, v1/admin¶
submission_id
: string
Submission identifier used for tracking the request and to reject duplicate submissions. Required.
maximum_record_time
: google.protobuf.Timestamp
Deadline for the configuration change after which the change is rejected.
configuration_generation
: int64
The current configuration generation which we’re submitting the change against. This is used to perform a compare-and-swap of the configuration to safeguard against concurrent modifications. Required.
new_time_model
: TimeModel
The new time model that replaces the current one. Required.
SetTimeModelResponse message, v1/admin¶
configuration_generation
: int64
The configuration generation of the committed time model.
TimeModel message, v1/admin¶
avg_transaction_latency
: google.protobuf.Duration
The expected average latency of a transaction, i.e., the average time from submitting the transaction to a [[WriteService]] and the transaction being assigned a record time. Required.
min_skew
: google.protobuf.Duration
The minimimum skew between ledger time and record time: lt_TX >= rt_TX - minSkew Required.
max_skew
: google.protobuf.Duration
The maximum skew between ledger time and record time: lt_TX <= rt_TX + maxSkew Required.
com/daml/ledger/api/v1/admin/identity_provider_config_service.proto
IdentityProviderConfigService, v1/admin¶
Identity Provider Config Service makes it possible for participant node administrators to setup and manage additional identity providers at runtime.
This allows using access tokens from identity providers unknown at deployment time. When an identity provider is configured, independent IDP administrators can manage their own set of parties and users. Such parties and users have a matching identity_provider_id defined and are inaccessible to administrators from other identity providers. A user will only be authenticated if the corresponding JWT token is issued by the appropriate identity provider. Users and parties without identity_provider_id defined are assumed to be using the default identity provider, which is configured statically at the participant node’s deployment time.
The Ledger API uses the “iss” claim of a JWT token to match the token to a specific IDP. If there is no match, the default IDP is assumed.
The fields of request messages (and sub-messages) are marked either as Optional
or Required
:
Optional
denoting the client may leave the field unset when sending a request.Required
denoting the client must set the field to a non-default value when sending a request.
An identity provider config resource is described by the IdentityProviderConfig
message,
An identity provider config resource, once it has been created, can be modified.
In order to update the properties represented by the IdentityProviderConfig
message use the UpdateIdentityProviderConfig
RPC.
The only fields that can be modified are those marked as Modifiable
.
CreateIdentityProviderConfig method, v1/admin¶
Create a new identity provider configuration. The request will fail if the maximum allowed number of separate configurations is reached.
- Request: CreateIdentityProviderConfigRequest
- Response: CreateIdentityProviderConfigResponse
GetIdentityProviderConfig method, v1/admin¶
Get the identity provider configuration data by id.
- Request: GetIdentityProviderConfigRequest
- Response: GetIdentityProviderConfigResponse
UpdateIdentityProviderConfig method, v1/admin¶
Update selected modifiable attribute of an identity provider config resource described
by the IdentityProviderConfig
message.
- Request: UpdateIdentityProviderConfigRequest
- Response: UpdateIdentityProviderConfigResponse
ListIdentityProviderConfigs method, v1/admin¶
List all existing identity provider configurations.
- Request: ListIdentityProviderConfigsRequest
- Response: ListIdentityProviderConfigsResponse
DeleteIdentityProviderConfig method, v1/admin¶
Delete an existing identity provider configuration.
- Request: DeleteIdentityProviderConfigRequest
- Response: DeleteIdentityProviderConfigResponse
CreateIdentityProviderConfigRequest message, v1/admin¶
identity_provider_config
: IdentityProviderConfig
Required
CreateIdentityProviderConfigResponse message, v1/admin¶
identity_provider_config
: IdentityProviderConfig
DeleteIdentityProviderConfigRequest message, v1/admin¶
identity_provider_id
: string
The identity provider config to delete. Required
DeleteIdentityProviderConfigResponse message, v1/admin¶
Does not (yet) contain any data.
Message has no fields.
GetIdentityProviderConfigResponse message, v1/admin¶
identity_provider_config
: IdentityProviderConfig
IdentityProviderConfig message, v1/admin¶
identity_provider_id
: string
The identity provider identifier
Must be a valid LedgerString (as describe in value.proto
).
Required
is_deactivated
: bool
When set, the callers using JWT tokens issued by this identity provider are denied all access to the Ledger API. Optional, Modifiable
issuer
: string
Specifies the issuer of the JWT token. The issuer value is a case sensitive URL using the https scheme that contains scheme, host, and optionally, port number and path components and no query or fragment components. Required Modifiable
jwks_url
: string
The JWKS (JSON Web Key Set) URL. The Ledger API uses JWKs (JSON Web Keys) from the provided URL to verify that the JWT has been signed with the loaded JWK. Only RS256 (RSA Signature with SHA-256) signing algorithm is supported. Required Modifiable
audience
: string
Specifies the audience of the JWT token. When set, the callers using JWT tokens issued by this identity provider are allowed to get an access only if the “aud” claim includes the string specified here Optional, Modifiable
ListIdentityProviderConfigsRequest message, v1/admin¶
Pagination is not required as the resulting data set is small enough to be returned in a single call
Message has no fields.
ListIdentityProviderConfigsResponse message, v1/admin¶
identity_provider_configs
: IdentityProviderConfig (repeated)
UpdateIdentityProviderConfigRequest message, v1/admin¶
identity_provider_config
: IdentityProviderConfig
The identity provider config to update. Required, Modifiable
update_mask
: google.protobuf.FieldMask
An update mask specifies how and which properties of the IdentityProviderConfig
message are to be updated.
An update mask consists of a set of update paths.
A valid update path points to a field or a subfield relative to the IdentityProviderConfig
message.
A valid update mask must:
- contain at least one update path,
- contain only valid update paths.
Fields that can be updated are marked as Modifiable
.
For additional information see the documentation for standard protobuf3’s google.protobuf.FieldMask
.
Required
UpdateIdentityProviderConfigResponse message, v1/admin¶
identity_provider_config
: IdentityProviderConfig
Updated identity provider config
com/daml/ledger/api/v1/admin/metering_report_service.proto
MeteringReportService, v1/admin¶
Experimental API to retrieve metering reports.
Metering reports aim to provide the information necessary for billing participant and application operators.
GetMeteringReport method, v1/admin¶
Retrieve a metering report.
- Request: GetMeteringReportRequest
- Response: GetMeteringReportResponse
GetMeteringReportRequest message, v1/admin¶
Authorized if and only if the authenticated user is a participant admin.
from
: google.protobuf.Timestamp
The from timestamp (inclusive). Required.
to
: google.protobuf.Timestamp
The to timestamp (exclusive). If not provided, the server will default to its current time.
application_id
: string
If set to a non-empty value, then the report will only be generated for that application. Optional.
GetMeteringReportResponse message, v1/admin¶
request
: GetMeteringReportRequest
The actual request that was executed.
report_generation_time
: google.protobuf.Timestamp
The time at which the report was computed.
metering_report_json
: google.protobuf.Struct
The metering report json. For a JSON Schema definition of the JSon see: https://github.com/digital-asset/daml/blob/main/ledger-api/grpc-definitions/metering-report-schema.json
com/daml/ledger/api/v1/admin/object_meta.proto
ObjectMeta message, v1/admin¶
Represents metadata corresponding to a participant resource (e.g. a participant user or participant local information about a party).
Based on ObjectMeta
meta used in Kubernetes API.
See https://github.com/kubernetes/apimachinery/blob/master/pkg/apis/meta/v1/generated.proto#L640
resource_version
: string
An opaque, non-empty value, populated by a participant server which represents the internal version of the resource
this ObjectMeta
message is attached to. The participant server will change it to a unique value each time the corresponding resource is updated.
You must not rely on the format of resource version. The participant server might change it without notice.
You can obtain the newest resource version value by issuing a read request.
You may use it for concurrent change detection by passing it back unmodified in an update request.
The participant server will then compare the passed value with the value maintained by the system to determine
if any other updates took place since you had read the resource version.
Upon a successful update you are guaranteed that no other update took place during your read-modify-write sequence.
However, if another update took place during your read-modify-write sequence then your update will fail with an appropriate error.
Concurrent change control is optional. It will be applied only if you include a resource version in an update request.
When creating a new instance of a resource you must leave the resource version empty.
Its value will be populated by the participant server upon successful resource creation.
Optional
annotations
: ObjectMeta.AnnotationsEntry (repeated)
A set of modifiable key-value pairs that can be used to represent arbitrary, client-specific metadata. Constraints:
- The total size over all keys and values cannot exceed 256kb in UTF-8 encoding.
- Keys are composed of an optional prefix segment and a required name segment such that:
- key prefix, when present, must be a valid DNS subdomain with at most 253 characters, followed by a ‘/’ (forward slash) character,
- name segment must have at most 63 characters that are either alphanumeric ([a-z0-9A-Z]), or a ‘.’ (dot), ‘-’ (dash) or ‘_’ (underscore); and it must start and end with an alphanumeric character.
- Values can be any non-empty strings.
Keys with empty prefix are reserved for end-users. Properties set by external tools or internally by the participant server must use non-empty key prefixes. Duplicate keys are disallowed by the semantics of the protobuf3 maps. See: https://developers.google.com/protocol-buffers/docs/proto3#maps Annotations may be a part of a modifiable resource. Use the resource’s update RPC to update its annotations. In order to add a new annotation or update an existing one using an update RPC, provide the desired annotation in the update request. In order to remove an annotation using an update RPC, provide the target annotation’s key but set its value to the empty string in the update request. Optional Modifiable
PackageManagementService, v1/admin¶
Status: experimental interface, will change before it is deemed production ready
Query the Daml-LF packages supported by the ledger participant and upload DAR files. We use ‘backing participant’ to refer to this specific participant in the methods of this API.
ListKnownPackages method, v1/admin¶
Returns the details of all Daml-LF packages known to the backing participant.
- Request: ListKnownPackagesRequest
- Response: ListKnownPackagesResponse
UploadDarFile method, v1/admin¶
Upload a DAR file to the backing participant. Depending on the ledger implementation this might also make the package available on the whole ledger. This call might not be supported by some ledger implementations. Canton could be an example, where uploading a DAR is not sufficient to render it usable, it must be activated first. This call may:
- Succeed, if the package was successfully uploaded, or if the same package was already uploaded before.
- Respond with a gRPC error
- Request: UploadDarFileRequest
- Response: UploadDarFileResponse
ValidateDarFile method, v1/admin¶
Performs the same checks that UploadDarFile call performs, but doesn’t persist the DAR and does not make it available for command execution. This call: - Succeeds if the packages contained in the DAR are valid - Respond with a gRPC error if the provided packages are not valid
- Request: ValidateDarFileRequest
- Response: ValidateDarFileResponse
ListKnownPackagesRequest message, v1/admin¶
Message has no fields.
ListKnownPackagesResponse message, v1/admin¶
package_details
: PackageDetails (repeated)
The details of all Daml-LF packages known to backing participant. Required
PackageDetails message, v1/admin¶
package_id
: string
The identity of the Daml-LF package.
Must be a valid PackageIdString (as describe in value.proto
).
Required
package_size
: uint64
Size of the package in bytes.
The size of the package is given by the size of the daml_lf
ArchivePayload. See further details in daml_lf.proto
.
Required
known_since
: google.protobuf.Timestamp
Indicates since when the package is known to the backing participant. Required
source_description
: string
Description provided by the backing participant describing where it got the package from. Optional
UploadDarFileRequest message, v1/admin¶
dar_file
: bytes
Contains a Daml archive DAR file, which in turn is a jar like zipped
container for daml_lf
archives. See further details in
daml_lf.proto
.
Required
submission_id
: string
Unique submission identifier. Optional, defaults to a random identifier.
UploadDarFileResponse message, v1/admin¶
An empty message that is received when the upload operation succeeded.
Message has no fields.
ValidateDarFileRequest message, v1/admin¶
dar_file
: bytes
Contains a Daml archive DAR file, which in turn is a jar like zipped
container for daml_lf
archives. See further details in
daml_lf.proto
.
Required
submission_id
: string
Unique submission identifier. Optional, defaults to a random identifier.
ValidateDarFileResponse message, v1/admin¶
Message has no fields.
com/daml/ledger/api/v1/admin/participant_pruning_service.proto
ParticipantPruningService, v1/admin¶
Prunes/truncates the “oldest” transactions from the participant (the participant Ledger Api Server plus any other participant-local state) by removing a portion of the ledger in such a way that the set of future, allowed commands are not affected.
This enables:
- keeping the “inactive” portion of the ledger to a manageable size and
- removing inactive state to honor the right to be forgotten.
Prune method, v1/admin¶
Prune the ledger specifying the offset before and at which ledger transactions should be removed. Only returns when the potentially long-running prune request ends successfully or with an error.
- Request: PruneRequest
- Response: PruneResponse
PruneRequest message, v1/admin¶
prune_up_to
: string
Inclusive offset up to which the ledger is to be pruned. By default the following data is pruned:
- All normal and divulged contracts that have been archived before prune_up_to.
- All transaction events and completions before prune_up_to
submission_id
: string
Unique submission identifier. Optional, defaults to a random identifier, used for logging.
prune_all_divulged_contracts
: bool
Prune all immediately and retroactively divulged contracts created before prune_up_to independent of whether they were archived before prune_up_to. Useful to avoid leaking storage on participant nodes that can see a divulged contract but not its archival.
Application developers SHOULD write their Daml applications such that they do not rely on divulged contracts; i.e., no warnings from using divulged contracts as inputs to transactions are emitted.
Participant node operators SHOULD set the prune_all_divulged_contracts flag to avoid leaking storage due to accumulating unarchived divulged contracts PROVIDED that:
- no application using this participant node relies on divulgence OR
- divulged contracts on which applications rely have been re-divulged after the prune_up_to offset.
PruneResponse message, v1/admin¶
Empty for now, but may contain fields in the future
Message has no fields.
com/daml/ledger/api/v1/admin/party_management_service.proto
PartyManagementService, v1/admin¶
This service allows inspecting the party management state of the ledger known to the participant and managing the participant-local party metadata.
The authorization rules for its RPCs are specified on the <RpcName>Request
messages as boolean expressions over these facts:
HasRight(r)
denoting whether the authenticated user has rightr
andIsAuthenticatedIdentityProviderAdmin(idp)
denoting whetheridp
is equal to theidentity_provider_id
of the authenticated user and the user has an IdentityProviderAdmin right.
If identity_provider_id is set to an empty string, then it’s effectively set to the value of access token’s ‘iss’ field if that is provided. If identity_provider_id remains an empty string, the default identity provider will be assumed.
The fields of request messages (and sub-messages) are marked either as Optional
or Required
:
Optional
denoting the client may leave the field unset when sending a request.Required
denoting the client must set the field to a non-default value when sending a request.
A party details resource is described by the PartyDetails
message,
A party details resource, once it has been created, can be modified using the UpdatePartyDetails
RPC.
The only fields that can be modified are those marked as Modifiable
.
GetParticipantId method, v1/admin¶
Return the identifier of the participant. All horizontally scaled replicas should return the same id. daml-on-kv-ledger: returns an identifier supplied on command line at launch time canton: returns globally unique identifier of the participant
- Request: GetParticipantIdRequest
- Response: GetParticipantIdResponse
GetParties method, v1/admin¶
Get the party details of the given parties. Only known parties will be returned in the list.
- Request: GetPartiesRequest
- Response: GetPartiesResponse
ListKnownParties method, v1/admin¶
List the parties known by the participant. The list returned contains parties whose ledger access is facilitated by the participant and the ones maintained elsewhere.
- Request: ListKnownPartiesRequest
- Response: ListKnownPartiesResponse
AllocateParty method, v1/admin¶
Allocates a new party on a ledger and adds it to the set managed by the participant. Caller specifies a party identifier suggestion, the actual identifier allocated might be different and is implementation specific. Caller can specify party metadata that is stored locally on the participant. This call may:
- Succeed, in which case the actual allocated identifier is visible in the response.
- Respond with a gRPC error
daml-on-kv-ledger: suggestion’s uniqueness is checked by the validators in the consensus layer and call rejected if the identifier is already present. canton: completely different globally unique identifier is allocated. Behind the scenes calls to an internal protocol are made. As that protocol is richer than the surface protocol, the arguments take implicit values The party identifier suggestion must be a valid party name. Party names are required to be non-empty US-ASCII strings built from letters, digits, space, colon, minus and underscore limited to 255 chars
- Request: AllocatePartyRequest
- Response: AllocatePartyResponse
UpdatePartyDetails method, v1/admin¶
Update selected modifiable participant-local attributes of a party details resource. Can update the participant’s local information for local parties.
- Request: UpdatePartyDetailsRequest
- Response: UpdatePartyDetailsResponse
UpdatePartyIdentityProviderId method, v1/admin¶
Update the assignment of a party from one IDP to another.
- Request: UpdatePartyIdentityProviderRequest
- Response: UpdatePartyIdentityProviderResponse
AllocatePartyRequest message, v1/admin¶
Required authorization: HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(identity_provider_id)
party_id_hint
: string
A hint to the participant which party ID to allocate. It can be
ignored.
Must be a valid PartyIdString (as described in value.proto
).
Optional
display_name
: string
Human-readable name of the party to be added to the participant. It doesn’t
have to be unique.
Use of this field is discouraged. Use local_metadata
instead.
Optional
local_metadata
: ObjectMeta
Participant-local metadata to be stored in the PartyDetails
of this newly allocated party.
Optional
identity_provider_id
: string
The id of the Identity Provider
Optional, if not set, assume the party is managed by the default identity provider or party is not hosted by the participant.
AllocatePartyResponse message, v1/admin¶
party_details
: PartyDetails
GetParticipantIdRequest message, v1/admin¶
Required authorization: HasRight(ParticipantAdmin)
Message has no fields.
GetParticipantIdResponse message, v1/admin¶
participant_id
: string
Identifier of the participant, which SHOULD be globally unique.
Must be a valid LedgerString (as describe in value.proto
).
GetPartiesRequest message, v1/admin¶
Required authorization: HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(identity_provider_id)
parties
: string (repeated)
The stable, unique identifier of the Daml parties.
Must be valid PartyIdStrings (as described in value.proto
).
Required
identity_provider_id
: string
The id of the Identity Provider
whose parties should be retrieved.
Optional, if not set, assume the party is managed by the default identity provider or party is not hosted by the participant.
GetPartiesResponse message, v1/admin¶
party_details
: PartyDetails (repeated)
The details of the requested Daml parties by the participant, if known. The party details may not be in the same order as requested. Required
ListKnownPartiesRequest message, v1/admin¶
Required authorization: HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(identity_provider_id)
page_token
: string
Pagination token to determine the specific page to fetch. Using the token guarantees that parties on a subsequent page are all lexically greater than the last party on a previous page. Server does not store intermediate results between calls chained by a series of page tokens. As a consequence, if new parties are being added and a page is requested twice using the same token, more parties can be returned on the second call. Leave empty to fetch the first page. Optional
page_size
: int32
Maximum number of results to be returned by the server. The server will return no more than that many results, but it might return fewer. If the page_size is 0, the server will decide the number of results to be returned. If the page_size exceeds the maximum supported by the server, an error will be returned. To obtain the server’s maximum consult the PartyManagementFeature descriptor available in the VersionService. Optional
identity_provider_id
: string
The id of the Identity Provider
whose parties should be retrieved.
Optional, if not set, assume the party is managed by the default identity provider or party is not hosted by the participant.
ListKnownPartiesResponse message, v1/admin¶
party_details
: PartyDetails (repeated)
The details of all Daml parties known by the participant. Required
next_page_token
: string
Pagination token to retrieve the next page. Empty, if there are no further results.
PartyDetails message, v1/admin¶
party
: string
The stable unique identifier of a Daml party.
Must be a valid PartyIdString (as described in value.proto
).
Required
display_name
: string
Human readable name associated with the party at allocation time. Caution, it might not be unique. Use of this field is discouraged. Use the local_metadata field instead. Optional
is_local
: bool
true if party is hosted by the participant and the party shares the same identity provider as the user issuing the request. Optional
local_metadata
: ObjectMeta
Participant-local metadata of this party. Optional, Modifiable
identity_provider_id
: string
The id of the Identity Provider
Optional, if not set, there could be 3 options:
- the party is managed by the default identity provider.
- party is not hosted by the participant.
- party is hosted by the participant, but is outside of the user’s identity provider.
UpdatePartyDetailsRequest message, v1/admin¶
Required authorization: HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(party_details.identity_provider_id)
party_details
: PartyDetails
Party to be updated Required, Modifiable
update_mask
: google.protobuf.FieldMask
An update mask specifies how and which properties of the PartyDetails
message are to be updated.
An update mask consists of a set of update paths.
A valid update path points to a field or a subfield relative to the PartyDetails
message.
A valid update mask must:
- contain at least one update path,
- contain only valid update paths.
Fields that can be updated are marked as Modifiable
.
An update path can also point to non-Modifiable
fields such as ‘party’ and ‘local_metadata.resource_version’
because they are used:
- to identify the party details resource subject to the update,
- for concurrent change control.
An update path can also point to non-Modifiable
fields such as ‘is_local’ and ‘display_name’
as long as the values provided in the update request match the server values.
Examples of update paths: ‘local_metadata.annotations’, ‘local_metadata’.
For additional information see the documentation for standard protobuf3’s google.protobuf.FieldMask
.
For similar Ledger API see com.daml.ledger.api.v1.admin.UpdateUserRequest
.
Required
UpdatePartyIdentityProviderRequest message, v1/admin¶
Required authorization: HasRight(ParticipantAdmin)
party
: string
Party to update
source_identity_provider_id
: string
Current identity provider id of the party
target_identity_provider_id
: string
Target identity provider id of the party
UpdatePartyIdentityProviderResponse message, v1/admin¶
Message has no fields.
com/daml/ledger/api/v1/admin/user_management_service.proto
UserManagementService, v1/admin¶
Service to manage users and their rights for interacting with the Ledger API served by a participant node.
The authorization rules for its RPCs are specified on the <RpcName>Request
messages as boolean expressions over these facts:
HasRight(r)
denoting whether the authenticated user has rightr
andIsAuthenticatedUser(uid)
denoting whetheruid
is the empty string or equal to the id of the authenticated user.IsAuthenticatedIdentityProviderAdmin(idp)
denoting whetheridp
is equal to theidentity_provider_id
of the authenticated user and the user has an IdentityProviderAdmin right.
If user_id is set to the empty string (the default), then the data for the authenticated user will be retrieved. If identity_provider_id is set to an empty string, then it’s effectively set to the value of access token’s ‘iss’ field if that is provided. If identity_provider_id remains an empty string, the default identity provider will be assumed.
The fields of request messages (and sub-messages) are marked either as Optional
or Required
:
Optional
denoting the client may leave the field unset when sending a request.Required
denoting the client must set the field to a non-default value when sending a request.
A user resource consists of:
- a set of properties represented by the
User
message, - a set of user rights, where each right is represented by the
Right
message.
A user resource, once it has been created, can be modified.
In order to update the properties represented by the User
message use the UpdateUser
RPC. The only fields that can be modified are those marked as Modifiable
.
In order to grant or revoke user rights use GrantRights' and ``RevokeRights
RPCs.
CreateUser method, v1/admin¶
Create a new user.
- Request: CreateUserRequest
- Response: CreateUserResponse
GetUser method, v1/admin¶
Get the user data of a specific user or the authenticated user.
- Request: GetUserRequest
- Response: GetUserResponse
UpdateUser method, v1/admin¶
Update selected modifiable attribute of a user resource described by the User
message.
- Request: UpdateUserRequest
- Response: UpdateUserResponse
DeleteUser method, v1/admin¶
Delete an existing user and all its rights.
- Request: DeleteUserRequest
- Response: DeleteUserResponse
ListUsers method, v1/admin¶
List all existing users.
- Request: ListUsersRequest
- Response: ListUsersResponse
GrantUserRights method, v1/admin¶
Grant rights to a user. Granting rights does not affect the resource version of the corresponding user.
- Request: GrantUserRightsRequest
- Response: GrantUserRightsResponse
RevokeUserRights method, v1/admin¶
Revoke rights from a user. Revoking rights does not affect the resource version of the corresponding user.
- Request: RevokeUserRightsRequest
- Response: RevokeUserRightsResponse
ListUserRights method, v1/admin¶
List the set of all rights granted to a user.
- Request: ListUserRightsRequest
- Response: ListUserRightsResponse
UpdateUserIdentityProviderId method, v1/admin¶
Update the assignment of a user from one IDP to another.
- Request: UpdateUserIdentityProviderRequest
- Response: UpdateUserIdentityProviderResponse
CreateUserRequest message, v1/admin¶
Required authorization: HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(user.identity_provider_id)
user
: User
The user to create. Required
rights
: Right (repeated)
The rights to be assigned to the user upon creation,
which SHOULD include appropriate rights for the user.primary_party
.
Optional
DeleteUserRequest message, v1/admin¶
Required authorization: HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(identity_provider_id)
user_id
: string
The user to delete. Required
identity_provider_id
: string
The id of the Identity Provider
Optional, if not set, assume the user is managed by the default identity provider.
GetUserRequest message, v1/admin¶
Required authorization: HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(identity_provider_id) OR IsAuthenticatedUser(user_id)
user_id
: string
The user whose data to retrieve. If set to empty string (the default), then the data for the authenticated user will be retrieved. Optional
identity_provider_id
: string
The id of the Identity Provider
Optional, if not set, assume the user is managed by the default identity provider.
GrantUserRightsRequest message, v1/admin¶
Add the rights to the set of rights granted to the user.
Required authorization: HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(identity_provider_id)
user_id
: string
The user to whom to grant rights. Required
rights
: Right (repeated)
The rights to grant. Optional
identity_provider_id
: string
The id of the Identity Provider
Optional, if not set, assume the user is managed by the default identity provider.
GrantUserRightsResponse message, v1/admin¶
newly_granted_rights
: Right (repeated)
The rights that were newly granted by the request.
ListUserRightsRequest message, v1/admin¶
Required authorization: HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(identity_provider_id) OR IsAuthenticatedUser(user_id)
user_id
: string
The user for which to list the rights. If set to empty string (the default), then the rights for the authenticated user will be listed. Required
identity_provider_id
: string
The id of the Identity Provider
Optional, if not set, assume the user is managed by the default identity provider.
ListUsersRequest message, v1/admin¶
Required authorization: HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(identity_provider_id)
page_token
: string
Pagination token to determine the specific page to fetch. Leave empty to fetch the first page. Optional
page_size
: int32
Maximum number of results to be returned by the server. The server will return no more than that many results, but it might return fewer. If 0, the server will decide the number of results to be returned. Optional
identity_provider_id
: string
The id of the Identity Provider
Optional, if not set, assume the user is managed by the default identity provider.
ListUsersResponse message, v1/admin¶
users
: User (repeated)
A subset of users of the participant node that fit into this page.
next_page_token
: string
Pagination token to retrieve the next page. Empty, if there are no further results.
RevokeUserRightsRequest message, v1/admin¶
Remove the rights from the set of rights granted to the user.
Required authorization: HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(identity_provider_id)
user_id
: string
The user from whom to revoke rights. Required
rights
: Right (repeated)
The rights to revoke. Optional
identity_provider_id
: string
The id of the Identity Provider
Optional, if not set, assume the user is managed by the default identity provider.
RevokeUserRightsResponse message, v1/admin¶
newly_revoked_rights
: Right (repeated)
The rights that were actually revoked by the request.
Right message, v1/admin¶
A right granted to a user.
oneof kind.participant_admin
: Right.ParticipantAdmin
The user can administer the participant node.
oneof kind.can_act_as
: Right.CanActAs
The user can act as a specific party.
oneof kind.can_read_as
: Right.CanReadAs
The user can read ledger data visible to a specific party.
oneof kind.identity_provider_admin
: Right.IdentityProviderAdmin
The user can administer users and parties assigned to the same identity provider as the one of the user.
Right.CanReadAs message, v1/admin¶
party
: string
The right to read ledger data visible to this party.
Right.IdentityProviderAdmin message, v1/admin¶
The right to administer the identity provider that the user is assigned to. It means, being able to manage users and parties that are also assigned to the same identity provider.
Message has no fields.
Right.ParticipantAdmin message, v1/admin¶
The right to administer the participant node.
Message has no fields.
UpdateUserIdentityProviderRequest message, v1/admin¶
Required authorization: HasRight(ParticipantAdmin)
user_id
: string
User to update
source_identity_provider_id
: string
Current identity provider id of the user
target_identity_provider_id
: string
Target identity provider id of the user
UpdateUserIdentityProviderResponse message, v1/admin¶
Message has no fields.
UpdateUserRequest message, v1/admin¶
Required authorization: HasRight(ParticipantAdmin) OR IsAuthenticatedIdentityProviderAdmin(user.identity_provider_id)
user
: User
The user to update. Required, Modifiable
update_mask
: google.protobuf.FieldMask
An update mask specifies how and which properties of the User
message are to be updated.
An update mask consists of a set of update paths.
A valid update path points to a field or a subfield relative to the User
message.
A valid update mask must:
- contain at least one update path,
- contain only valid update paths.
Fields that can be updated are marked as Modifiable
.
An update path can also point to a non-Modifiable
fields such as ‘id’ and ‘metadata.resource_version’
because they are used:
- to identify the user resource subject to the update,
- for concurrent change control.
Examples of valid update paths: ‘primary_party’, ‘metadata’, ‘metadata.annotations’.
For additional information see the documentation for standard protobuf3’s google.protobuf.FieldMask
.
For similar Ledger API see com.daml.ledger.api.v1.admin.UpdatePartyDetailsRequest
.
Required
User message, v1/admin¶
Users are used to dynamically manage the rights given to Daml applications. They are stored and managed per participant node.
Read the Authorization documentation to learn more.
id
: string
The user identifier, which must be a non-empty string of at most 128 characters that are either alphanumeric ASCII characters or one of the symbols “@^$.!`-#+’~_|:”. Required
primary_party
: string
The primary party as which this user reads and acts by default on the ledger
provided it has the corresponding CanReadAs(primary_party)
or
CanActAs(primary_party)
rights.
Ledger API clients SHOULD set this field to a non-empty value for all users to
enable the users to act on the ledger using their own Daml party.
Users for participant administrators MAY have an associated primary party.
Optional,
Modifiable
is_deactivated
: bool
When set, then the user is denied all access to the Ledger API. Otherwise, the user has access to the Ledger API as per the user’s rights. Optional, Modifiable
metadata
: ObjectMeta
The metadata of this user.
Note that the metadata.resource_version
tracks changes to the properties described by the User
message and not the user’s rights.
Optional,
Modifiable
identity_provider_id
: string
The id of the identity provider configured by Identity Provider Config
Optional, if not set, assume the user is managed by the default identity provider.
com/daml/ledger/api/v1/command_completion_service.proto
CommandCompletionService, v1¶
Allows clients to observe the status of their submissions. Commands may be submitted via the Command Submission Service. The on-ledger effects of their submissions are disclosed by the Transaction Service.
Commands may fail in 2 distinct manners:
- Failure communicated synchronously in the gRPC error of the submission.
- Failure communicated asynchronously in a Completion, see
completion.proto
.
Note that not only successfully submitted commands MAY produce a completion event. For example, the participant MAY choose to produce a completion event for a rejection of a duplicate command.
Clients that do not receive a successful completion about their submission MUST NOT assume that it was successful. Clients SHOULD subscribe to the CompletionStream before starting to submit commands to prevent race conditions.
CompletionStream method, v1¶
Subscribe to command completion events.
- Request: CompletionStreamRequest
- Response: CompletionStreamResponse
CompletionEnd method, v1¶
Returns the offset after the latest completion.
- Request: CompletionEndRequest
- Response: CompletionEndResponse
Checkpoint message, v1¶
Checkpoints may be used to:
- detect time out of commands.
- provide an offset which can be used to restart consumption.
record_time
: google.protobuf.Timestamp
All commands with a maximum record time below this value MUST be considered lost if their completion has not arrived before this checkpoint. Required
offset
: LedgerOffset
May be used in a subsequent CompletionStreamRequest to resume the consumption of this stream at a later time. Required
CompletionEndRequest message, v1¶
ledger_id
: string
Must correspond to the ledger ID reported by the Ledger Identification Service.
Must be a valid LedgerString (as described in value.proto
).
Optional
CompletionEndResponse message, v1¶
offset
: LedgerOffset
This offset can be used in a CompletionStreamRequest message. Required
CompletionStreamRequest message, v1¶
ledger_id
: string
Must correspond to the ledger id reported by the Ledger Identification Service.
Must be a valid LedgerString (as described in value.proto
).
Optional
application_id
: string
Only completions of commands submitted with the same application_id will be visible in the stream.
Must be a valid ApplicationIdString (as described in value.proto
).
Required unless authentication is used with a user token or a custom token specifying an application-id.
In that case, the token’s user-id, respectively application-id, will be used for the request’s application_id.
parties
: string (repeated)
Non-empty list of parties whose data should be included.
Only completions of commands for which at least one of the act_as
parties is in the given set of parties
will be visible in the stream.
Must be a valid PartyIdString (as described in value.proto
).
Required
offset
: LedgerOffset
This field indicates the minimum offset for completions. This can be used to resume an earlier completion stream. This offset is exclusive: the response will only contain commands whose offset is strictly greater than this. Optional, if not set the ledger uses the current ledger end offset instead.
CompletionStreamResponse message, v1¶
checkpoint
: Checkpoint
This checkpoint may be used to restart consumption. The checkpoint is after any completions in this response. Optional
completions
: Completion (repeated)
If set, one or more completions.
com/daml/ledger/api/v1/command_service.proto
CommandService, v1¶
Command Service is able to correlate submitted commands with completion data, identify timeouts, and return contextual information with each tracking result. This supports the implementation of stateless clients.
Note that submitted commands generally produce completion events as well, even in case a command gets rejected. For example, the participant MAY choose to produce a completion event for a rejection of a duplicate command.
SubmitAndWait method, v1¶
Submits a single composite command and waits for its result. Propagates the gRPC error of failed submissions including Daml interpretation errors.
- Request: SubmitAndWaitRequest
- Response: .google.protobuf.Empty
SubmitAndWaitForTransactionId method, v1¶
Submits a single composite command, waits for its result, and returns the transaction id. Propagates the gRPC error of failed submissions including Daml interpretation errors.
- Request: SubmitAndWaitRequest
- Response: SubmitAndWaitForTransactionIdResponse
SubmitAndWaitForTransaction method, v1¶
Submits a single composite command, waits for its result, and returns the transaction. Propagates the gRPC error of failed submissions including Daml interpretation errors.
- Request: SubmitAndWaitRequest
- Response: SubmitAndWaitForTransactionResponse
SubmitAndWaitForTransactionTree method, v1¶
Submits a single composite command, waits for its result, and returns the transaction tree. Propagates the gRPC error of failed submissions including Daml interpretation errors.
- Request: SubmitAndWaitRequest
- Response: SubmitAndWaitForTransactionTreeResponse
SubmitAndWaitForTransactionIdResponse message, v1¶
transaction_id
: string
The id of the transaction that resulted from the submitted command.
Must be a valid LedgerString (as described in value.proto
).
Required
completion_offset
: string
The format of this field is described in ledger_offset.proto
.
Optional
SubmitAndWaitForTransactionResponse message, v1¶
transaction
: Transaction
The flat transaction that resulted from the submitted command. Required
completion_offset
: string
The format of this field is described in ledger_offset.proto
.
Optional
SubmitAndWaitForTransactionTreeResponse message, v1¶
transaction
: TransactionTree
The transaction tree that resulted from the submitted command. Required
completion_offset
: string
The format of this field is described in ledger_offset.proto
.
Optional
CommandSubmissionService, v1¶
Allows clients to attempt advancing the ledger’s state by submitting commands. The final states of their submissions are disclosed by the Command Completion Service. The on-ledger effects of their submissions are disclosed by the Transaction Service.
Commands may fail in 2 distinct manners:
- Failure communicated synchronously in the gRPC error of the submission.
- Failure communicated asynchronously in a Completion, see
completion.proto
.
Note that not only successfully submitted commands MAY produce a completion event. For example, the participant MAY choose to produce a completion event for a rejection of a duplicate command.
Clients that do not receive a successful completion about their submission MUST NOT assume that it was successful. Clients SHOULD subscribe to the CompletionStream before starting to submit commands to prevent race conditions.
Submit method, v1¶
Submit a single composite command.
- Request: SubmitRequest
- Response: .google.protobuf.Empty
SubmitRequest message, v1¶
The submitted commands will be processed atomically in a single transaction. Moreover, each Command
in commands
will be executed in the order specified by the request.
commands
: Commands
The commands to be submitted in a single transaction. Required
com/daml/ledger/api/v1/commands.proto
Command message, v1¶
A command can either create a new contract or exercise a choice on an existing contract.
oneof command.create
: CreateCommand
oneof command.exercise
: ExerciseCommand
oneof command.exerciseByKey
: ExerciseByKeyCommand
oneof command.createAndExercise
: CreateAndExerciseCommand
Commands message, v1¶
A composite command that groups multiple commands together.
ledger_id
: string
Must correspond to the ledger ID reported by the Ledger Identification Service.
Must be a valid LedgerString (as described in value.proto
).
Optional
workflow_id
: string
Identifier of the on-ledger workflow that this command is a part of.
Must be a valid LedgerString (as described in value.proto
).
Optional
application_id
: string
Uniquely identifies the application or participant user that issued the command.
Must be a valid ApplicationIdString (as described in value.proto
).
Required unless authentication is used with a user token or a custom token specifying an application-id.
In that case, the token’s user-id, respectively application-id, will be used for the request’s application_id.
command_id
: string
Uniquely identifies the command.
The triple (application_id, party + act_as, command_id) constitutes the change ID for the intended ledger change,
where party + 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
party
: string
Party on whose behalf the command should be executed.
If ledger API authorization is enabled, then the authorization metadata must authorize the sender of the request
to act on behalf of the given party.
Must be a valid PartyIdString (as described in value.proto
).
Deprecated in favor of the act_as
field. If both are set, then the effective list of parties on whose
behalf the command should be executed is the union of all parties listed in party
and act_as
.
Optional
commands
: Command (repeated)
Individual elements of this atomic command. Must be non-empty. Required
oneof deduplication_period.deduplication_time
: google.protobuf.Duration
Specifies the length of the deduplication period.
Same semantics apply as for deduplication_duration.
Must be non-negative. Must not exceed the maximum deduplication time (see
ledger_configuration_service.proto
).
oneof deduplication_period.deduplication_duration
: google.protobuf.Duration
Specifies the length of the deduplication period.
It is interpreted relative to the local clock at some point during the submission’s processing.
Must be non-negative. Must not exceed the maximum deduplication time (see
ledger_configuration_service.proto
).
oneof deduplication_period.deduplication_offset
: string
Specifies the start of the deduplication period by a completion stream offset (exclusive).
Must be a valid LedgerString (as described in ledger_offset.proto
).
min_ledger_time_abs
: google.protobuf.Timestamp
Lower bound for the ledger time assigned to the resulting transaction. Note: The ledger time of a transaction is assigned as part of command interpretation. Use this property if you expect that command interpretation will take a considerate amount of time, such that by the time the resulting transaction is sequenced, its assigned ledger time is not valid anymore. Must not be set at the same time as min_ledger_time_rel. Optional
min_ledger_time_rel
: google.protobuf.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. Optional
act_as
: string (repeated)
Set of parties on whose behalf the command should be executed.
If ledger API authorization is enabled, then the authorization metadata must authorize the sender of the request
to act on behalf of each of the given parties.
This field supersedes the party
field. The effective set of parties on whose behalf the command
should be executed is the union of all parties listed in party
and act_as
, which must be non-empty.
Each element must be a valid PartyIdString (as described in value.proto
).
Optional
read_as
: string (repeated)
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 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
submission_id
: string
A unique identifier to distinguish completions for different submissions with the same change ID.
Typically a random UUID. Applications are expected to use a different UUID for each retry of a submission
with the same change ID.
Must be a valid LedgerString (as described in value.proto
).
If omitted, the participant or the committer may set a value of their choice. Optional
disclosed_contracts
: DisclosedContract (repeated)
Additional contracts used to resolve contract & contract key lookups. Optional
package_id_selection_preference
: string (repeated)
The package-id selection preference of the client for resolving package names and interface instances in command submission and interpretation
CreateAndExerciseCommand message, v1¶
Create a contract and exercise a choice on it in the same transaction.
template_id
: Identifier
The template of the contract the client wants to create. Required
create_arguments
: Record
The arguments required for creating a contract from this template. Required
choice
: string
The name of the choice the client wants to exercise.
Must be a valid NameString (as described in value.proto
).
Required
choice_argument
: Value
The argument for this choice. Required
CreateCommand message, v1¶
Create a new contract instance based on a template.
template_id
: Identifier
The template of contract the client wants to create. Required
create_arguments
: Record
The arguments required for creating a contract from this template. Required
DisclosedContract message, v1¶
An additional contract that is used to resolve contract & contract key lookups.
template_id
: Identifier
The template id of the contract. Required
contract_id
: string
The contract id Required
created_event_blob
: bytes
Opaque byte string containing the complete payload required by the Daml engine to reconstruct a contract not known to the receiving participant. Required
ExerciseByKeyCommand message, v1¶
Exercise a choice on an existing contract specified by its key.
template_id
: Identifier
The template of contract the client wants to exercise. Required
contract_key
: Value
The key of the contract the client wants to exercise upon. Required
choice
: string
The name of the choice the client wants to exercise.
Must be a valid NameString (as described in value.proto
)
Required
choice_argument
: Value
The argument for this choice. Required
ExerciseCommand message, v1¶
Exercise a choice on an existing contract.
template_id
: Identifier
The template of contract the client wants to exercise. Required
contract_id
: string
The ID of the contract the client wants to exercise upon.
Must be a valid LedgerString (as described in value.proto
).
Required
choice
: string
The name of the choice the client wants to exercise.
Must be a valid NameString (as described in value.proto
)
Required
choice_argument
: Value
The argument for this choice. Required
com/daml/ledger/api/v1/completion.proto
Completion message, v1¶
A completion represents the status of a submitted command on the ledger: it can be successful or failed.
command_id
: string
The ID of the succeeded or failed command.
Must be a valid LedgerString (as described in value.proto
).
Required
status
: google.rpc.Status
Identifies the exact type of the error. It uses the same format of conveying error details as it is used for the RPC responses of the APIs. Optional
transaction_id
: string
The transaction_id of the transaction that resulted from the command with command_id.
Only set for successfully executed commands.
Must be a valid LedgerString (as described in value.proto
).
Optional
application_id
: string
The application-id or user-id that was used for the submission, as described in commands.proto
.
Must be a valid ApplicationIdString (as described in value.proto
).
Optional for historic completions where this data is not available.
act_as
: string (repeated)
The set of parties on whose behalf the commands were executed.
Contains the union of party
and act_as
from commands.proto
.
The order of the parties need not be the same as in the submission.
Each element must be a valid PartyIdString (as described in value.proto
).
Optional for historic completions where this data is not available.
submission_id
: string
The submission ID this completion refers to, as described in commands.proto
.
Must be a valid LedgerString (as described in value.proto
).
Optional
oneof deduplication_period.deduplication_offset
: string
Specifies the start of the deduplication period by a completion stream offset (exclusive).
Must be a valid LedgerString (as described in value.proto
).
oneof deduplication_period.deduplication_duration
: google.protobuf.Duration
Specifies the length of the deduplication period. It is measured in record time of completions.
Must be non-negative.
trace_context
: TraceContext
Optional; ledger api trace context
The trace context transported in this message corresponds to the trace context supplied by the client application in a HTTP2 header of the original command submission. We typically use a header to transfer this type of information. Here we use message body, because it is used in gRPC streams which do not support per message headers. This field will be populated with the trace context contained in the original submission. If that was not provided, a unique ledger-api-server generated trace context will be used instead.
com/daml/ledger/api/v1/contract_metadata.proto
ContractMetadata message, v1¶
Contract-related metadata used in DisclosedContract (that can be included in command submission) or forwarded as part of the CreatedEvent in Active Contract Set or Transaction streams.
created_at
: google.protobuf.Timestamp
Ledger effective time of the transaction that created the contract. Required
contract_key_hash
: bytes
Hash of the contract key if defined. Optional
driver_metadata
: bytes
Driver-specific metadata. This is opaque and cannot be decoded. Optional
com/daml/ledger/api/v1/event.proto
ArchivedEvent message, v1¶
Records that a contract has been archived, and choices may no longer be exercised on it.
event_id
: string
The ID of this particular event.
Must be a valid LedgerString (as described in value.proto
).
Required
contract_id
: string
The ID of the archived contract.
Must be a valid LedgerString (as described in value.proto
).
Required
template_id
: Identifier
The template of the archived contract. Required
witness_parties
: string (repeated)
The parties that are notified of this event. For an ArchivedEvent
,
these are the intersection of the stakeholders of the contract in
question and the parties specified in the TransactionFilter
. The
stakeholders are the union of the signatories and the observers of
the contract.
Each one of its elements must be a valid PartyIdString (as described
in value.proto
).
Required
CreatedEvent message, v1¶
Records that a contract has been created, and choices may now be exercised on it.
event_id
: string
The ID of this particular event.
Must be a valid LedgerString (as described in value.proto
).
Required
contract_id
: string
The ID of the created contract.
Must be a valid LedgerString (as described in value.proto
).
Required
template_id
: Identifier
The template of the created contract. Required
package_name
: google.protobuf.StringValue
The package name of the created contract. Optional
contract_key
: Value
The key of the created contract.
This will be set if and only if create_arguments
is set and template_id
defines a contract key.
Optional
create_arguments
: Record
The arguments that have been used to create the contract. Set either:
- if there was a party, which is in the
witness_parties
of this event, and for which anInclusiveFilters
exists with thetemplate_id
of this event among thetemplate_ids
,- or if there was a party, which is in the
witness_parties
of this event, and for which a wildcard filter exists (Filters
withoutInclusiveFilters
, or with anInclusiveFilters
with emptytemplate_ids
and emptyinterface_filters
).
Optional
created_event_blob
: bytes
Opaque representation of contract create event payload intended for forwarding to an API server as a contract disclosed as part of a command submission. Optional
interface_views
: InterfaceView (repeated)
Interface views specified in the transaction filter.
Includes an InterfaceView
for each interface for which there is a InterfaceFilter
with
- its party in the
witness_parties
of this event,- and which is implemented by the template of this event,
- and which has
include_interface_view
set.
Optional
witness_parties
: string (repeated)
The parties that are notified of this event. When a CreatedEvent
is returned as part of a transaction tree, this will include all
the parties specified in the TransactionFilter
that are informees
of the event. If served as part of a flat transaction those will
be limited to all parties specified in the TransactionFilter
that
are stakeholders of the contract (i.e. either signatories or observers).
In case of v2 API,
if the CreatedEvent
is returned as part of an AssignedEvent,
ActiveContract or IncompleteUnassigned (so the event is related to
an assignment or unassignment): this will include all parties of the
TransactionFilter
that are stakeholders of the contract.
Required
signatories
: string (repeated)
The signatories for this contract as specified by the template. Required
observers
: string (repeated)
The observers for this contract as specified explicitly by the template or implicitly as choice controllers. This field never contains parties that are signatories. Required
agreement_text
: google.protobuf.StringValue
The agreement text of the contract. We use StringValue to properly reflect optionality on the wire for backwards compatibility. This is necessary since the empty string is an acceptable (and in fact the default) agreement text, but also the default string in protobuf. This means a newer client works with an older sandbox seamlessly. Optional
created_at
: google.protobuf.Timestamp
Ledger effective time of the transaction that created the contract. Required
Event message, v1¶
An event in the flat transaction stream can either be the creation or the archiving of a contract.
In the transaction service the events are restricted to the events
visible for the parties specified in the transaction filter. Each
event message type below contains a witness_parties
field which
indicates the subset of the requested parties that can see the event
in question. In the flat transaction stream you’ll only receive events
that have witnesses.
oneof event.created
: CreatedEvent
oneof event.archived
: ArchivedEvent
ExercisedEvent message, v1¶
Records that a choice has been exercised on a target contract.
event_id
: string
The ID of this particular event.
Must be a valid LedgerString (as described in value.proto
).
Required
contract_id
: string
The ID of the target contract.
Must be a valid LedgerString (as described in value.proto
).
Required
template_id
: Identifier
The template of the target contract. Required
package_name
: google.protobuf.StringValue
The package name of the created contract. Optional
interface_id
: Identifier
The interface where the choice is defined, if inherited. Optional
choice
: string
The choice that was exercised on the target contract.
Must be a valid NameString (as described in value.proto
).
Required
choice_argument
: Value
The argument of the exercised choice. Required
acting_parties
: string (repeated)
The parties that exercised the choice.
Each element must be a valid PartyIdString (as described in value.proto
).
Required
consuming
: bool
If true, the target contract may no longer be exercised. Required
witness_parties
: string (repeated)
The parties that are notified of this event. The witnesses of an exercise
node will depend on whether the exercise was consuming or not.
If consuming, the witnesses are the union of the stakeholders and
the actors.
If not consuming, the witnesses are the union of the signatories and
the actors. Note that the actors might not necessarily be observers
and thus signatories. This is the case when the controllers of a
choice are specified using “flexible controllers”, using the
choice ... controller
syntax, and said controllers are not
explicitly marked as observers.
Each element must be a valid PartyIdString (as described in value.proto
).
Required
child_event_ids
: string (repeated)
References to further events in the same transaction that appeared as a result of this ExercisedEvent
.
It contains only the immediate children of this event, not all members of the subtree rooted at this node.
The order of the children is the same as the event order in the transaction.
Each element must be a valid LedgerString (as described in value.proto
).
Optional
exercise_result
: Value
The result of exercising the choice. Required
InterfaceView message, v1¶
View of a create event matched by an interface filter.
interface_id
: Identifier
The interface implemented by the matched event. Required
view_status
: google.rpc.Status
Whether the view was successfully computed, and if not, the reason for the error. The error is reported using the same rules for error codes and messages as the errors returned for API requests. Required
view_value
: Record
The value of the interface’s view method on this event.
Set if it was requested in the InterfaceFilter
and it could be
sucessfully computed.
Optional
com/daml/ledger/api/v1/event_query_service.proto
EventQueryService, v1¶
Query events by contract id or key.
GetEventsByContractId method, v1¶
Get the create and the consuming exercise event for the contract with the provided ID. No events will be returned for contracts that have been pruned because they have already been archived before the latest pruning offset.
- Request: GetEventsByContractIdRequest
- Response: GetEventsByContractIdResponse
GetEventsByContractKey method, v1¶
Get all create and consuming exercise events for the contracts with the provided contract key. Only events for unpruned contracts will be returned. Matching events are delivered in reverse chronological order, i.e., the most recent events are delivered first.
- Request: GetEventsByContractKeyRequest
- Response: GetEventsByContractKeyResponse
GetEventsByContractIdRequest message, v1¶
contract_id
: string
The contract id being queried. Required
requesting_parties
: string (repeated)
The parties whose events the client expects to see. The events associated with the contract id will only be returned if the requesting parties includes at least one party that is a stakeholder of the event. For a definition of stakeholders see https://docs.daml.com/concepts/ledger-model/ledger-privacy.html#contract-observers-and-stakeholders Required
GetEventsByContractIdResponse message, v1¶
create_event
: CreatedEvent
The create event for the contract with the contract_id
given in the request
provided it exists and has not yet been pruned.
Optional
archive_event
: ArchivedEvent
The archive event for the contract with the contract_id
given in the request
provided such an archive event exists and it has not yet been pruned.
Optional
GetEventsByContractKeyRequest message, v1¶
contract_key
: Value
The contract key to search for. Required
template_id
: Identifier
The template id associated with the contract key Required
requesting_parties
: string (repeated)
The parties whose events the client expects to see. The events associated with the contract key will only be returned if the requesting parties includes at least one party that is a stakeholder of the event. For a definition of stakeholders see https://docs.daml.com/concepts/ledger-model/ledger-privacy.html#contract-observers-and-stakeholders To gain visibility of all contract key bindings and to ensure consistent performance use a key maintainer as a requesting party. Required
continuation_token
: string
A continuation_token
associated with a previous response.
Optional
GetEventsByContractKeyResponse message, v1¶
create_event
: CreatedEvent
The most recent create event for a contract with the key given in the request, if
no continuation_token
is provided. If a continuation_token
is provided, then
this is the most recent create event preceding the create event whose
continuation_token
was provided.
Optional
archive_event
: ArchivedEvent
The archive event for the create event provided the created contract is archived. Optional
continuation_token
: string
If the continuation_token
is populated then there may be additional events available. To retrieve
these events use the continuation_token
in a subsequent request.
Optional
com/daml/ledger/api/v1/experimental_features.proto
AcsActiveAtOffsetFeature message, v1¶
Whether the Ledger API supports requesting ACS at an offset
supported
: bool
CommandDeduplicationFeatures message, v1¶
Feature descriptors for command deduplication intended to be used for adapting Ledger API tests.
deduplication_period_support
: CommandDeduplicationPeriodSupport
deduplication_type
: CommandDeduplicationType
max_deduplication_duration_enforced
: bool
The ledger will reject any requests which specify a deduplication period which exceeds the specified max deduplication duration. This is also enforced for ledgers that convert deduplication periods specified as offsets to durations.
CommandDeduplicationPeriodSupport message, v1¶
Feature descriptor specifying how deduplication periods can be specified and how they are handled by the participant node.
offset_support
: CommandDeduplicationPeriodSupport.OffsetSupport
duration_support
: CommandDeduplicationPeriodSupport.DurationSupport
ExperimentalCommandInspectionService message, v1¶
Whether the Ledger API supports command inspection service
supported
: bool
ExperimentalCommitterEventLog message, v1¶
How the committer stores events.
event_log_type
: ExperimentalCommitterEventLog.CommitterEventLogType
ExperimentalContractIds message, v1¶
See daml-lf/spec/contract-id.rst for more information on contract ID formats.
ExperimentalExplicitDisclosure message, v1¶
Enables the use of explicitly disclosed contracts for command submission
supported
: bool
ExperimentalFeatures message, v1¶
See the feature message definitions for descriptions.
self_service_error_codes
: ExperimentalSelfServiceErrorCodes
static_time
: ExperimentalStaticTime
command_deduplication
: CommandDeduplicationFeatures
optional_ledger_id
: ExperimentalOptionalLedgerId
contract_ids
: ExperimentalContractIds
committer_event_log
: ExperimentalCommitterEventLog
explicit_disclosure
: ExperimentalExplicitDisclosure
user_and_party_local_metadata_extensions
: ExperimentalUserAndPartyLocalMetadataExtensions
acs_active_at_offset
: AcsActiveAtOffsetFeature
template_filters
: TransactionsWithTemplateFilters
command_inspection_service
: ExperimentalCommandInspectionService
pruned_offsets
: StreamingPrunedOffsets
ExperimentalOptionalLedgerId message, v1¶
Ledger API does not require ledgerId to be set in the requests.
Message has no fields.
ExperimentalSelfServiceErrorCodes message, v1¶
GRPC self-service error codes are returned by the Ledger API.
Message has no fields.
ExperimentalStaticTime message, v1¶
Ledger is in the static time mode and exposes a time service.
supported
: bool
ExperimentalUserAndPartyLocalMetadataExtensions message, v1¶
Whether the Ledger API supports: - is_deactivated user property, - metadata with annotations and resource version for users and parties, - update calls for users and parties.
supported
: bool
StreamingPrunedOffsets message, v1¶
Whether the Ledger API supports streaming pruned offsets in the transaction streams
supported
: bool
TransactionsWithTemplateFilters message, v1¶
Whether the Ledger API supports querying for transaction streams using template filters
supported
: bool
CommandDeduplicationPeriodSupport.DurationSupport enum, v1¶
How the participant node supports deduplication periods specified as durations.
DURATION_NATIVE_SUPPORT |
0 | |
DURATION_CONVERT_TO_OFFSET |
1 |
CommandDeduplicationPeriodSupport.OffsetSupport enum, v1¶
How the participant node supports deduplication periods specified using offsets.
OFFSET_NOT_SUPPORTED |
0 | |
OFFSET_NATIVE_SUPPORT |
1 | |
OFFSET_CONVERT_TO_DURATION |
2 |
CommandDeduplicationType enum, v1¶
How the participant node reports duplicate command submissions.
ASYNC_ONLY |
0 | Duplicate commands are exclusively reported asynchronously via completions. |
ASYNC_AND_CONCURRENT_SYNC |
1 | Commands that are duplicates of concurrently submitted commands are reported synchronously via a gRPC error on the command submission, while all other duplicate commands are reported asynchronously via completions. |
ExperimentalCommitterEventLog.CommitterEventLogType enum, v1¶
CENTRALIZED |
0 | Default. There is a single log. |
DISTRIBUTED |
1 | There is more than one event log. Usually, when the committer itself is distributed. Or there are per-participant event logs. It may result in transaction IDs being different for the same transaction across participants, for example. |
ExperimentalContractIds.ContractIdV1Support enum, v1¶
SUFFIXED |
0 | Contract IDs must be suffixed. Distributed ledger implementations must reject non-suffixed contract IDs. |
NON_SUFFIXED |
1 | Contract IDs do not need to be suffixed. This can be useful for shorter contract IDs in centralized committer implementations. Suffixed contract IDs must also be supported. |
com/daml/ledger/api/v1/ledger_configuration_service.proto
LedgerConfigurationService, v1¶
LedgerConfigurationService allows clients to subscribe to changes of the ledger configuration. In V2 Ledger API this service is not available anymore.
GetLedgerConfiguration method, v1¶
Returns the latest configuration as the first response, and publishes configuration updates in the same stream.
- Request: GetLedgerConfigurationRequest
- Response: GetLedgerConfigurationResponse
GetLedgerConfigurationRequest message, v1¶
ledger_id
: string
Must correspond to the ledger ID reported by the Ledger Identification Service.
Must be a valid LedgerString (as described in value.proto
).
Optional
GetLedgerConfigurationResponse message, v1¶
ledger_configuration
: LedgerConfiguration
The latest ledger configuration.
LedgerConfiguration message, v1¶
LedgerConfiguration contains parameters of the ledger instance that may be useful to clients.
max_deduplication_duration
: google.protobuf.Duration
If a command submission specifies a deduplication period of length up to max_deduplication_duration
,
the submission SHOULD not be rejected with FAILED_PRECONDITION
because the deduplication period starts too early.
The deduplication period is measured on a local clock of the participant or Daml ledger,
and therefore subject to clock skews and clock drifts.
Command submissions with longer periods MAY get accepted though.
com/daml/ledger/api/v1/ledger_identity_service.proto
LedgerIdentityService, v1¶
DEPRECATED: This service is now deprecated and ledger identity string is optional for all Ledger API requests.
Allows clients to verify that the server they are communicating with exposes the ledger they wish to operate on. In V2 Ledger API this service is not available anymore.
GetLedgerIdentity method, v1¶
Clients may call this RPC to return the identifier of the ledger they are connected to.
- Request: GetLedgerIdentityRequest
- Response: GetLedgerIdentityResponse
GetLedgerIdentityRequest message, v1¶
Message has no fields.
GetLedgerIdentityResponse message, v1¶
ledger_id
: string
The ID of the ledger exposed by the server.
Must be a valid LedgerString (as described in value.proto
).
Optional
com/daml/ledger/api/v1/ledger_offset.proto
LedgerOffset message, v1¶
Describes a specific point on the ledger.
The Ledger API endpoints that take offsets allow to specify portions of the ledger that are relevant for the client to read.
Offsets returned by the Ledger API can be used as-is (e.g. to keep track of processed transactions and provide a restart point to use in case of need).
The format of absolute offsets is opaque to the client: no client-side transformation of an offset is guaranteed to return a meaningful offset.
The server implementation ensures internally that offsets are lexicographically comparable.
oneof value.absolute
: string
The format of this string is specific to the ledger and opaque to the client.
oneof value.boundary
: LedgerOffset.LedgerBoundary
LedgerOffset.LedgerBoundary enum, v1¶
LEDGER_BEGIN |
0 | Refers to the first transaction. |
LEDGER_END |
1 | Refers to the currently last transaction, which is a moving target. |
com/daml/ledger/api/v1/package_service.proto
PackageService, v1¶
Allows clients to query the Daml-LF packages that are supported by the server.
ListPackages method, v1¶
Returns the identifiers of all supported packages.
- Request: ListPackagesRequest
- Response: ListPackagesResponse
GetPackage method, v1¶
Returns the contents of a single package.
- Request: GetPackageRequest
- Response: GetPackageResponse
GetPackageStatus method, v1¶
Returns the status of a single package.
- Request: GetPackageStatusRequest
- Response: GetPackageStatusResponse
GetPackageRequest message, v1¶
ledger_id
: string
Must correspond to the ledger ID reported by the Ledger Identification Service.
Must be a valid LedgerString (as described in value.proto
).
Optional
package_id
: string
The ID of the requested package.
Must be a valid PackageIdString (as described in value.proto
).
Required
GetPackageResponse message, v1¶
hash_function
: HashFunction
The hash function we use to calculate the hash. Required
archive_payload
: bytes
Contains a daml_lf
ArchivePayload. See further details in daml_lf.proto
.
Required
hash
: string
The hash of the archive payload, can also used as a package_id
.
Must be a valid PackageIdString (as described in value.proto
).
Required
GetPackageStatusRequest message, v1¶
ledger_id
: string
Must correspond to the ledger ID reported by the Ledger Identification Service.
Must be a valid LedgerString (as described in value.proto
).
Optional
package_id
: string
The ID of the requested package.
Must be a valid PackageIdString (as described in value.proto
).
Required
ListPackagesRequest message, v1¶
ledger_id
: string
Must correspond to the ledger ID reported by the Ledger Identification Service.
Must be a valid LedgerString (as described in value.proto
).
Optional
ListPackagesResponse message, v1¶
package_ids
: string (repeated)
The IDs of all Daml-LF packages supported by the server.
Each element must be a valid PackageIdString (as described in value.proto
).
Required
HashFunction enum, v1¶
SHA256 |
0 |
PackageStatus enum, v1¶
UNKNOWN |
0 | The server is not aware of such a package. |
REGISTERED |
1 | The server is able to execute Daml commands operating on this package. |
com/daml/ledger/api/v1/testing/time_service.proto
TimeService, v1/testing¶
Optional service, exposed for testing static time scenarios.
GetTime method, v1/testing¶
Returns a stream of time updates. Always returns at least one response, where the first one is the current time. Subsequent responses are emitted whenever the ledger server’s time is updated.
- Request: GetTimeRequest
- Response: GetTimeResponse
SetTime method, v1/testing¶
Allows clients to change the ledger’s clock in an atomic get-and-set operation.
- Request: SetTimeRequest
- Response: .google.protobuf.Empty
GetTimeRequest message, v1/testing¶
ledger_id
: string
Must correspond to the ledger ID reported by the Ledger Identification Service.
Must be a valid LedgerString (as describe in value.proto
).
Optional
GetTimeResponse message, v1/testing¶
current_time
: google.protobuf.Timestamp
The current time according to the ledger server.
SetTimeRequest message, v1/testing¶
ledger_id
: string
Must correspond to the ledger ID reported by the Ledger Identification Service.
Must be a valid LedgerString (as describe in value.proto
).
Optional
current_time
: google.protobuf.Timestamp
MUST precisely match the current time as it’s known to the ledger server.
new_time
: google.protobuf.Timestamp
The time the client wants to set on the ledger.
MUST be a point int time after current_time
.
com/daml/ledger/api/v1/trace_context.proto
TraceContext message, v1¶
traceparent
: google.protobuf.StringValue
https://www.w3.org/TR/trace-context/
tracestate
: google.protobuf.StringValue
com/daml/ledger/api/v1/transaction.proto
Transaction message, v1¶
Filtered view of an on-ledger transaction’s create and archive events.
transaction_id
: string
Assigned by the server. Useful for correlating logs.
Must be a valid LedgerString (as described in value.proto
).
Required
command_id
: string
The ID of the command which resulted in this transaction. Missing for everyone except the submitting party.
Must be a valid LedgerString (as described in value.proto
).
Optional
workflow_id
: string
The workflow ID used in command submission.
Must be a valid LedgerString (as described in value.proto
).
Optional
effective_at
: google.protobuf.Timestamp
Ledger effective time.
Must be a valid LedgerString (as described in value.proto
).
Required
events
: Event (repeated)
The collection of events.
Only contains CreatedEvent
or ArchivedEvent
.
Required
offset
: string
The absolute offset. The format of this field is described in ledger_offset.proto
.
Required
trace_context
: TraceContext
Optional; ledger api trace context
The trace context transported in this message corresponds to the trace context supplied by the client application in a HTTP2 header of the original command submission. We typically use a header to transfer this type of information. Here we use message body, because it is used in gRPC streams which do not support per message headers. This field will be populated with the trace context contained in the original submission. If that was not provided, a unique ledger-api-server generated trace context will be used instead.
TransactionTree message, v1¶
Complete view of an on-ledger transaction.
transaction_id
: string
Assigned by the server. Useful for correlating logs.
Must be a valid LedgerString (as described in value.proto
).
Required
command_id
: string
The ID of the command which resulted in this transaction. Missing for everyone except the submitting party.
Must be a valid LedgerString (as described in value.proto
).
Optional
workflow_id
: string
The workflow ID used in command submission. Only set if the workflow_id
for the command was set.
Must be a valid LedgerString (as described in value.proto
).
Optional
effective_at
: google.protobuf.Timestamp
Ledger effective time. Required
offset
: string
The absolute offset. The format of this field is described in ledger_offset.proto
.
Required
events_by_id
: TransactionTree.EventsByIdEntry (repeated)
Changes to the ledger that were caused by this transaction. Nodes of the transaction tree.
Each key be a valid LedgerString (as describe in value.proto
).
Required
root_event_ids
: string (repeated)
Roots of the transaction tree.
Each element must be a valid LedgerString (as describe in value.proto
).
The elements are in the same order as the commands in the
corresponding Commands object that triggered this transaction.
Required
trace_context
: TraceContext
Optional; ledger api trace context
The trace context transported in this message corresponds to the trace context supplied by the client application in a HTTP2 header of the original command submission. We typically use a header to transfer this type of information. Here we use message body, because it is used in gRPC streams which do not support per message headers. This field will be populated with the trace context contained in the original submission. If that was not provided, a unique ledger-api-server generated trace context will be used instead.
TreeEvent message, v1¶
Each tree event message type below contains a witness_parties
field which
indicates the subset of the requested parties that can see the event
in question.
Note that transaction trees might contain events with _no_ witness parties, which were included simply because they were children of events which have witnesses.
oneof kind.created
: CreatedEvent
oneof kind.exercised
: ExercisedEvent
com/daml/ledger/api/v1/transaction_filter.proto
Filters message, v1¶
The union of a set of contract filters, or a wildcard.
inclusive
: InclusiveFilters
If set, then contracts matching any of the InclusiveFilters
match
this filter.
If not set, or if InclusiveFilters
has empty template_ids
and empty interface_filters
:
any contract matches this filter.
Optional
InclusiveFilters message, v1¶
A filter that matches all contracts that are either an instance of one of
the template_ids
or that match one of the interface_filters
.
template_ids
: Identifier (repeated)
A collection of templates for which the data will be included in the
create_arguments
of a matching CreatedEvent
.
SHOULD NOT contain duplicates.
All template_ids
need to be valid: corresponding templates should be defined in one of
the available packages at the time of the query.
Deprecated in favor of the template_filters
. If the template_filters
field is set,
the template_ids
field is ignored.
Optional
interface_filters
: InterfaceFilter (repeated)
Include an InterfaceView
for every InterfaceFilter
matching a contract.
The InterfaceFilter
instances MUST each use a unique interface_id
.
Optional
template_filters
: TemplateFilter (repeated)
A collection of templates for which the data will be included in the
create_arguments
of a matching CreatedEvent
.
SHOULD NOT contain duplicate templates.
In contrast to the template_ids
field, one can specify whether the create event payloads
should be provided alongside the create arguments.
If a contract is simultaneously selected by a template filter and one or more interface filters,
the corresponding include_created_event_blob
are consolidated using an OR operation.
Optional
InterfaceFilter message, v1¶
This filter matches contracts that implement a specific interface.
interface_id
: Identifier
The interface that a matching contract must implement.
The interface_id
needs to be valid: corresponding interface should be defined in
one of the available packages at the time of the query.
Required
include_interface_view
: bool
Whether to include the interface view on the contract in the returned CreatedEvent
.
Use this to access contract data in a uniform manner in your API client.
Optional
include_created_event_blob
: bool
Whether to include a created_event_blob
in the returned CreatedEvent
.
Use this to access the contract create event payload in your API client
for submitting it as a disclosed contract with future commands.
Optional
TemplateFilter message, v1¶
This filter matches contracts of a specific template.
template_id
: Identifier
A template for which the payload should be included in the response.
The template_id
needs to be valid: corresponding template should be defined in
one of the available packages at the time of the query.
Required
include_created_event_blob
: bool
Whether to include a created_event_blob
in the returned CreatedEvent
.
Use this to access the contract event payload in your API client
for submitting it as a disclosed contract with future commands.
Optional
TransactionFilter message, v1¶
A filter both for filtering create and archive events as well as for filtering transaction trees.
filters_by_party
: TransactionFilter.FiltersByPartyEntry (repeated)
Each key must be a valid PartyIdString (as described in value.proto
).
The interpretation of the filter depends on the stream being filtered:
- For transaction tree streams only party filters with wildcards are allowed, and all subtrees whose root has one of the listed parties as an informee are returned.
- For transaction and active-contract-set streams create and archive events are returned for all contracts whose stakeholders include at least one of the listed parties and match the per-party filter.
Required
TransactionService, v1¶
Allows clients to read transactions from the ledger. In V2 Ledger API this service is not available anymore. Use v2.UpdateService instead.
GetTransactions method, v1¶
Read the ledger’s filtered transaction stream for a set of parties. Lists only creates and archives, but not other events. Omits all events on transient contracts, i.e., contracts that were both created and archived in the same transaction.
- Request: GetTransactionsRequest
- Response: GetTransactionsResponse
GetTransactionTrees method, v1¶
Read the ledger’s complete transaction tree stream for a set of parties. The stream can be filtered only by parties, but not templates (template filter must be empty).
- Request: GetTransactionsRequest
- Response: GetTransactionTreesResponse
GetTransactionByEventId method, v1¶
Lookup a transaction tree by the ID of an event that appears within it. For looking up a transaction instead of a transaction tree, please see GetFlatTransactionByEventId
- Request: GetTransactionByEventIdRequest
- Response: GetTransactionResponse
GetTransactionById method, v1¶
Lookup a transaction tree by its ID. For looking up a transaction instead of a transaction tree, please see GetFlatTransactionById
- Request: GetTransactionByIdRequest
- Response: GetTransactionResponse
GetFlatTransactionByEventId method, v1¶
Lookup a transaction by the ID of an event that appears within it.
- Request: GetTransactionByEventIdRequest
- Response: GetFlatTransactionResponse
GetFlatTransactionById method, v1¶
Lookup a transaction by its ID.
- Request: GetTransactionByIdRequest
- Response: GetFlatTransactionResponse
GetLedgerEnd method, v1¶
Get the current ledger end. Subscriptions started with the returned offset will serve transactions created after this RPC was called.
- Request: GetLedgerEndRequest
- Response: GetLedgerEndResponse
GetLatestPrunedOffsets method, v1¶
Get the latest successfully pruned ledger offsets
- Request: GetLatestPrunedOffsetsRequest
- Response: GetLatestPrunedOffsetsResponse
GetFlatTransactionResponse message, v1¶
transaction
: Transaction
GetLatestPrunedOffsetsRequest message, v1¶
Empty for now, but may contain fields in the future.
Message has no fields.
GetLatestPrunedOffsetsResponse message, v1¶
participant_pruned_up_to_inclusive
: LedgerOffset
The offset up to which the ledger has been pruned, disregarding the state of all divulged contracts pruning.
all_divulged_contracts_pruned_up_to_inclusive
: LedgerOffset
The offset up to which all divulged events have been pruned on the ledger. It can be at or before the
participant_pruned_up_to_inclusive
offset.
For more details about all divulged events pruning,
see PruneRequest.prune_all_divulged_contracts
in participant_pruning_service.proto
.
GetLedgerEndRequest message, v1¶
ledger_id
: string
Must correspond to the ledger ID reported by the Ledger Identification Service.
Must be a valid LedgerString (as describe in value.proto
).
Optional
GetLedgerEndResponse message, v1¶
offset
: LedgerOffset
The absolute offset of the current ledger end.
GetTransactionByEventIdRequest message, v1¶
ledger_id
: string
Must correspond to the ledger ID reported by the Ledger Identification Service.
Must be a valid LedgerString (as described in value.proto
).
Optional
event_id
: string
The ID of a particular event.
Must be a valid LedgerString (as described in value.proto
).
Required
requesting_parties
: string (repeated)
The parties whose events the client expects to see.
Events that are not visible for the parties in this collection will not be present in the response.
Each element must be a valid PartyIdString (as described in value.proto
).
Required
GetTransactionByIdRequest message, v1¶
ledger_id
: string
Must correspond to the ledger ID reported by the Ledger Identification Service.
Must be a valid LedgerString (as describe in value.proto
).
Optional
transaction_id
: string
The ID of a particular transaction.
Must be a valid LedgerString (as describe in value.proto
).
Required
requesting_parties
: string (repeated)
The parties whose events the client expects to see.
Events that are not visible for the parties in this collection will not be present in the response.
Each element be a valid PartyIdString (as describe in value.proto
).
Required
GetTransactionResponse message, v1¶
transaction
: TransactionTree
GetTransactionTreesResponse message, v1¶
transactions
: TransactionTree (repeated)
The list of transaction trees that matches the filter in GetTransactionsRequest
for the GetTransactionTrees
method.
pruned_offset
: string
Current pruned offset. It is sent when following three conditions are met: - a pruning operation has completed - the transaction stream tails the LEDGER_END - the send_pruned_offsets field was set on the corresponding request. The conditions for including the pruned_offset in messages may change in the future implementations. When pruned_offset is set, the message does not contain any transactions in the transactions field.
GetTransactionsRequest message, v1¶
ledger_id
: string
Must correspond to the ledger ID reported by the Ledger Identification Service.
Must be a valid LedgerString (as described in value.proto
).
Optional
begin
: LedgerOffset
Beginning of the requested ledger section. This offset is exclusive: the response will only contain transactions whose offset is strictly greater than this. Required
end
: LedgerOffset
End of the requested ledger section. This offset is inclusive: the response will only contain transactions whose offset is less than or equal to this. Optional, if not set, the stream will not terminate.
filter
: TransactionFilter
Requesting parties with template filters. Template filters must be empty for GetTransactionTrees requests. Required
verbose
: bool
If enabled, values served over the API will contain more information than strictly necessary to interpret the data. In particular, setting the verbose flag to true triggers the ledger to include labels for record fields. Optional
send_pruned_offsets
: bool
If set to true, the server will send responses containing pruned offset upon pruning completion. Optional
GetTransactionsResponse message, v1¶
transactions
: Transaction (repeated)
The list of transactions that matches the filter in GetTransactionsRequest for the GetTransactions method.
pruned_offset
: string
Current pruned offset. It is sent when following three conditions are met: - a pruning operation has completed - the transaction stream tails the LEDGER_END - the send_pruned_offsets field was set on the corresponding request. The conditions for including the pruned_offset in messages may change in the future implementations. When pruned_offset is set, the message does not contain any transactions in the transactions field.
com/daml/ledger/api/v1/value.proto
Enum message, v1¶
A value with finite set of alternative representations.
enum_id
: Identifier
Omitted from the transaction stream when verbose streaming is not enabled. Optional when submitting commands.
constructor
: string
Determines which of the Variant’s alternatives is encoded in this message. Must be a valid NameString. Required
GenMap message, v1¶
entries
: GenMap.Entry (repeated)
Identifier message, v1¶
Unique identifier of an entity.
package_id
: string
The identifier of the Daml package that contains the entity. Must be a valid PackageIdString. Required
module_name
: string
The dot-separated module name of the identifier. Required
entity_name
: string
The dot-separated name of the entity (e.g. record, template, …) within the module. Required
List message, v1¶
A homogenous collection of values.
elements
: Value (repeated)
The elements must all be of the same concrete value type. Optional
Optional message, v1¶
Corresponds to Java’s Optional type, Scala’s Option, and Haskell’s Maybe.
The reason why we need to wrap this in an additional message
is that we
need to be able to encode the None
case in the Value
oneof.
value
: Value
optional
Record message, v1¶
Contains nested values.
record_id
: Identifier
Omitted from the transaction stream when verbose streaming is not enabled. Optional when submitting commands.
fields
: RecordField (repeated)
The nested values of the record. Required
RecordField message, v1¶
A named nested value within a record.
label
: string
When reading a transaction stream, it’s omitted if verbose streaming is not enabled. When submitting a commmand, it’s optional:
- if all keys within a single record are present, the order in which fields appear does not matter. however, each key must appear exactly once.
- if any of the keys within a single record are omitted, the order of fields MUST match the order of declaration in the Daml template.
Must be a valid NameString
value
: Value
A nested value of a record. Required
Value message, v1¶
Encodes values that the ledger accepts as command arguments and emits as contract arguments.
The values encoding use different classes of non-empty strings as identifiers. Those classes are
defined as follows:
- NameStrings are strings with length <= 1000 that match the regexp [A-Za-z\$_][A-Za-z0-9\$_]*
.
- PackageIdStrings are strings with length <= 64 that match the regexp [A-Za-z0-9\-_ ]+
.
- PartyIdStrings are strings with length <= 255 that match the regexp [A-Za-z0-9:\-_ ]+
.
- LedgerStrings are strings with length <= 255 that match the regexp [A-Za-z0-9#:\-_/ ]+
.
- ApplicationIdStrings are strings with length <= 255 that match the regexp [A-Za-z0-9#:\-_/ @\|]+
.
oneof Sum.record
: Record
oneof Sum.variant
: Variant
oneof Sum.contract_id
: string
Identifier of an on-ledger contract. Commands which reference an unknown or already archived contract ID will fail. Must be a valid LedgerString.
oneof Sum.list
: List
Represents a homogeneous list of values.
oneof Sum.int64
: sint64
oneof Sum.numeric
: string
A Numeric, that is a decimal value with precision 38 (at most 38 significant digits) and a scale between 0 and 37 (significant digits on the right of the decimal point). The field has to match the regex:
[+-]?\d{1,38}(.\d{0,37})?
and should be representable by a Numeric without loss of precision.
oneof Sum.text
: string
A string.
oneof Sum.timestamp
: sfixed64
Microseconds since the UNIX epoch. Can go backwards. Fixed since the vast majority of values will be greater than 2^28, since currently the number of microseconds since the epoch is greater than that. Range: 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999Z, so that we can convert to/from https://www.ietf.org/rfc/rfc3339.txt
oneof Sum.party
: string
An agent operating on the ledger. Must be a valid PartyIdString.
oneof Sum.bool
: bool
True or false.
oneof Sum.unit
: google.protobuf.Empty
This value is used for example for choices that don’t take any arguments.
oneof Sum.date
: int32
Days since the unix epoch. Can go backwards. Limited from 0001-01-01 to 9999-12-31, also to be compatible with https://www.ietf.org/rfc/rfc3339.txt
oneof Sum.optional
: Optional
The Optional type, None or Some
oneof Sum.map
: Map
The Map type
oneof Sum.enum
: Enum
The Enum type
oneof Sum.gen_map
: GenMap
The GenMap type
Variant message, v1¶
A value with alternative representations.
variant_id
: Identifier
Omitted from the transaction stream when verbose streaming is not enabled. Optional when submitting commands.
constructor
: string
Determines which of the Variant’s alternatives is encoded in this message. Must be a valid NameString. Required
value
: Value
The value encoded within the Variant. Required
com/daml/ledger/api/v1/version_service.proto
VersionService, v1¶
Allows clients to retrieve information about the ledger API version
GetLedgerApiVersion method, v1¶
Read the Ledger API version
- Request: GetLedgerApiVersionRequest
- Response: GetLedgerApiVersionResponse
FeaturesDescriptor message, v1¶
user_management
: UserManagementFeature
If set, then the Ledger API server supports user management. It is recommended that clients query this field to gracefully adjust their behavior for ledgers that do not support user management.
party_management
: PartyManagementFeature
If set, then the Ledger API server supports party management configurability. It is recommended that clients query this field to gracefully adjust their behavior to maximum party page size.
experimental
: ExperimentalFeatures
Features under development or features that are used for ledger implementation testing purposes only.
Daml applications SHOULD not depend on these in production.
GetLedgerApiVersionRequest message, v1¶
ledger_id
: string
Must correspond to the ledger ID reported by the Ledger Identification Service.
Must be a valid LedgerString (as described in value.proto
).
Optional
GetLedgerApiVersionResponse message, v1¶
version
: string
The version of the ledger API.
features
: FeaturesDescriptor
The features supported by this Ledger API endpoint.
Daml applications CAN use the feature descriptor on top of version constraints on the Ledger API version to determine whether a given Ledger API endpoint supports the features required to run the application.
See the feature descriptions themselves for the relation between Ledger API versions and feature presence.
PartyManagementFeature message, v1¶
max_parties_page_size
: int32
The maximum number of parties the server can return in a single response (page).
UserManagementFeature message, v1¶
supported
: bool
Whether the Ledger API server provides the user management service.
max_rights_per_user
: int32
The maximum number of rights that can be assigned to a single user. Servers MUST support at least 100 rights per user. A value of 0 means that the server enforces no rights per user limit.
max_users_page_size
: int32
The maximum number of users the server can return in a single response (page). Servers MUST support at least a 100 users per page. A value of 0 means that the server enforces no page size limit.
com/daml/ledger/api/v2/command_completion_service.proto
CommandCompletionService, v2¶
Allows clients to observe the status of their submissions. Commands may be submitted via the Command Submission Service. The on-ledger effects of their submissions are disclosed by the Update Service.
Commands may fail in 2 distinct manners:
- Failure communicated synchronously in the gRPC error of the submission.
- Failure communicated asynchronously in a Completion, see
completion.proto
.
Note that not only successfully submitted commands MAY produce a completion event. For example, the participant MAY choose to produce a completion event for a rejection of a duplicate command.
Clients that do not receive a successful completion about their submission MUST NOT assume that it was successful. Clients SHOULD subscribe to the CompletionStream before starting to submit commands to prevent race conditions.
CompletionStream method, v2¶
Subscribe to command completion events.
- Request: CompletionStreamRequest
- Response: CompletionStreamResponse
CompletionStreamRequest message, v2¶
application_id
: string
Only completions of commands submitted with the same application_id will be visible in the stream.
Must be a valid ApplicationIdString (as described in value.proto
).
Required unless authentication is used with a user token or a custom token specifying an application-id.
In that case, the token’s user-id, respectively application-id, will be used for the request’s application_id.
parties
: string (repeated)
Non-empty list of parties whose data should be included.
Only completions of commands for which at least one of the act_as
parties is in the given set of parties
will be visible in the stream.
Must be a valid PartyIdString (as described in value.proto
).
Required
begin_exclusive
: ParticipantOffset
This field indicates the minimum offset for completions. This can be used to resume an earlier completion stream. Optional, if not set the ledger uses the current ledger end offset instead.
CompletionStreamResponse message, v2¶
checkpoint
: com.daml.ledger.api.v1.Checkpoint
This checkpoint may be used to restart consumption. The checkpoint belongs to the completion in this response. Required
completion
: Completion
Required
domain_id
: string
The sequencing domain. In case
- successful/failed transactions: identifies the sequencing domain of the transaction
- for successful/failed unassign commands: identifies the source domain
- for successful/failed assign commands: identifies the target domain
Required
com/daml/ledger/api/v2/command_service.proto
CommandService, v2¶
Command Service is able to correlate submitted commands with completion data, identify timeouts, and return contextual information with each tracking result. This supports the implementation of stateless clients.
Note that submitted commands generally produce completion events as well, even in case a command gets rejected. For example, the participant SHOULD produce a completion event for a rejection of a duplicate command.
SubmitAndWait method, v2¶
Submits a single composite command and waits for its result. Propagates the gRPC error of failed submissions including Daml interpretation errors.
- Request: SubmitAndWaitRequest
- Response: .google.protobuf.Empty
SubmitAndWaitForUpdateId method, v2¶
Submits a single composite command, waits for its result, and returns the update id. Propagates the gRPC error of failed submissions including Daml interpretation errors.
- Request: SubmitAndWaitRequest
- Response: SubmitAndWaitForUpdateIdResponse
SubmitAndWaitForTransaction method, v2¶
Submits a single composite command, waits for its result, and returns the transaction. Propagates the gRPC error of failed submissions including Daml interpretation errors.
- Request: SubmitAndWaitRequest
- Response: SubmitAndWaitForTransactionResponse
SubmitAndWaitForTransactionTree method, v2¶
Submits a single composite command, waits for its result, and returns the transaction tree. Propagates the gRPC error of failed submissions including Daml interpretation errors.
- Request: SubmitAndWaitRequest
- Response: SubmitAndWaitForTransactionTreeResponse
SubmitAndWaitForTransactionResponse message, v2¶
transaction
: Transaction
The flat transaction that resulted from the submitted command. Required
completion_offset
: string
The format of this field is described in participant_offset.proto
.
Optional
SubmitAndWaitForTransactionTreeResponse message, v2¶
transaction
: TransactionTree
The transaction tree that resulted from the submitted command. Required
completion_offset
: string
The format of this field is described in participant_offset.proto
.
Optional
SubmitAndWaitForUpdateIdResponse message, v2¶
update_id
: string
The id of the transaction that resulted from the submitted command.
Must be a valid LedgerString (as described in value.proto
).
Required
completion_offset
: string
The format of this field is described in participant_offset.proto
.
Optional
CommandSubmissionService, v2¶
Allows clients to attempt advancing the ledger’s state by submitting commands. The final states of their submissions are disclosed by the Command Completion Service. The on-ledger effects of their submissions are disclosed by the Update Service.
Commands may fail in 2 distinct manners:
- Failure communicated synchronously in the gRPC error of the submission.
- Failure communicated asynchronously in a Completion, see
completion.proto
.
Note that not only successfully submitted commands MAY produce a completion event. For example, the participant MAY choose to produce a completion event for a rejection of a duplicate command.
Clients that do not receive a successful completion about their submission MUST NOT assume that it was successful. Clients SHOULD subscribe to the CompletionStream before starting to submit commands to prevent race conditions.
Submit method, v2¶
Submit a single composite command.
- Request: SubmitRequest
- Response: SubmitResponse
SubmitReassignment method, v2¶
Submit a single reassignment.
- Request: SubmitReassignmentRequest
- Response: SubmitReassignmentResponse
SubmitReassignmentRequest message, v2¶
reassignment_command
: ReassignmentCommand
The reassignment command to be submitted. Required
SubmitReassignmentResponse message, v2¶
Message has no fields.
SubmitRequest message, v2¶
The submitted commands will be processed atomically in a single transaction. Moreover, each Command
in commands
will be executed in the order specified by the request.
commands
: Commands
The commands to be submitted in a single transaction. Required
Commands message, v2¶
A composite command that groups multiple commands together.
workflow_id
: string
Identifier of the on-ledger workflow that this command is a part of.
Must be a valid LedgerString (as described in value.proto
).
Optional
application_id
: string
Uniquely identifies the application or participant user that issued the command.
Must be a valid ApplicationIdString (as described in value.proto
).
Required unless authentication is used with a user token or a custom token specifying an application-id.
In that case, the token’s user-id, respectively application-id, will be used for the request’s application_id.
command_id
: string
Uniquely identifies the command.
The triple (application_id, party + act_as, command_id) constitutes the change ID for the intended ledger change,
where party + 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
party
: string
Party on whose behalf the command should be executed.
If ledger API authorization is enabled, then the authorization metadata must authorize the sender of the request
to act on behalf of the given party.
Must be a valid PartyIdString (as described in value.proto
).
Deprecated in favor of the act_as
field. If both are set, then the effective list of parties on whose
behalf the command should be executed is the union of all parties listed in party
and act_as
.
Optional
commands
: com.daml.ledger.api.v1.Command (repeated)
Individual elements of this atomic command. Must be non-empty. Required
oneof deduplication_period.deduplication_duration
: google.protobuf.Duration
Specifies the length of the deduplication period.
It is interpreted relative to the local clock at some point during the submission’s processing.
Must be non-negative. Must not exceed the maximum deduplication time (see
ledger_configuration_service.proto
).
oneof deduplication_period.deduplication_offset
: string
Specifies the start of the deduplication period by a completion stream offset (exclusive).
Must be a valid LedgerString (as described in participant_offset.proto
).
min_ledger_time_abs
: google.protobuf.Timestamp
Lower bound for the ledger time assigned to the resulting transaction. Note: The ledger time of a transaction is assigned as part of command interpretation. Use this property if you expect that command interpretation will take a considerate amount of time, such that by the time the resulting transaction is sequenced, its assigned ledger time is not valid anymore. Must not be set at the same time as min_ledger_time_rel. Optional
min_ledger_time_rel
: google.protobuf.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. Optional
act_as
: string (repeated)
Set of parties on whose behalf the command should be executed.
If ledger API authorization is enabled, then the authorization metadata must authorize the sender of the request
to act on behalf of each of the given parties.
This field supersedes the party
field. The effective set of parties on whose behalf the command
should be executed is the union of all parties listed in party
and act_as
, which must be non-empty.
Each element must be a valid PartyIdString (as described in value.proto
).
Optional
read_as
: string (repeated)
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 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
submission_id
: string
A unique identifier to distinguish completions for different submissions with the same change ID.
Typically a random UUID. Applications are expected to use a different UUID for each retry of a submission
with the same change ID.
Must be a valid LedgerString (as described in value.proto
).
If omitted, the participant or the committer may set a value of their choice. Optional
disclosed_contracts
: com.daml.ledger.api.v1.DisclosedContract (repeated)
Additional contracts used to resolve contract & contract key lookups. Optional
domain_id
: string
Must be a valid domain ID Required
package_id_selection_preference
: string (repeated)
The package-id selection preference of the client for resolving package names and interface instances in command submission and interpretation
com/daml/ledger/api/v2/completion.proto
Completion message, v2¶
A completion represents the status of a submitted command on the ledger: it can be successful or failed.
command_id
: string
The ID of the succeeded or failed command.
Must be a valid LedgerString (as described in value.proto
).
Required
status
: google.rpc.Status
Identifies the exact type of the error. It uses the same format of conveying error details as it is used for the RPC responses of the APIs. Optional
update_id
: string
The update_id of the transaction or reassignment that resulted from the command with command_id.
Only set for successfully executed commands.
Must be a valid LedgerString (as described in value.proto
).
application_id
: string
The application-id or user-id that was used for the submission, as described in commands.proto
.
Must be a valid ApplicationIdString (as described in value.proto
).
Optional for historic completions where this data is not available.
act_as
: string (repeated)
The set of parties on whose behalf the commands were executed.
Contains the union of party
and act_as
from commands.proto
.
The order of the parties need not be the same as in the submission.
Each element must be a valid PartyIdString (as described in value.proto
).
Optional for historic completions where this data is not available.
submission_id
: string
The submission ID this completion refers to, as described in commands.proto
.
Must be a valid LedgerString (as described in value.proto
).
Optional
oneof deduplication_period.deduplication_offset
: string
Specifies the start of the deduplication period by a completion stream offset (exclusive).
Must be a valid LedgerString (as described in value.proto
).
oneof deduplication_period.deduplication_duration
: google.protobuf.Duration
Specifies the length of the deduplication period. It is measured in record time of completions.
Must be non-negative.
trace_context
: com.daml.ledger.api.v1.TraceContext
Optional; ledger api trace context
The trace context transported in this message corresponds to the trace context supplied by the client application in a HTTP2 header of the original command submission. We typically use a header to transfer this type of information. Here we use message body, because it is used in gRPC streams which do not support per message headers. This field will be populated with the trace context contained in the original submission. If that was not provided, a unique ledger-api-server generated trace context will be used instead.
com/daml/ledger/api/v2/event_query_service.proto
EventQueryService, v2¶
Query events by contract id.
Note that querying by contract key is not (yet) supported, as contract keys are not supported (yet) in multi-domain scenarios.
GetEventsByContractId method, v2¶
Get the create and the consuming exercise event for the contract with the provided ID. No events will be returned for contracts that have been pruned because they have already been archived before the latest pruning offset.
Archived message, v2¶
archived_event
: com.daml.ledger.api.v1.ArchivedEvent
Required
domain_id
: string
Required The domain which sequenced the archival of the contract
Created message, v2¶
created_event
: com.daml.ledger.api.v1.CreatedEvent
Required
domain_id
: string
The domain which sequenced the creation of the contract Required
GetEventsByContractIdResponse message, v2¶
created
: Created
The create event for the contract with the contract_id
given in the request
provided it exists and has not yet been pruned.
Optional
archived
: Archived
The archive event for the contract with the contract_id
given in the request
provided such an archive event exists and it has not yet been pruned.
Optional
com/daml/ledger/api/v2/package_service.proto
PackageService, v2¶
Allows clients to query the Daml-LF packages that are supported by the server.
ListPackages method, v2¶
Returns the identifiers of all supported packages.
- Request: ListPackagesRequest
- Response: .com.daml.ledger.api.v1.ListPackagesResponse
GetPackage method, v2¶
Returns the contents of a single package.
- Request: GetPackageRequest
- Response: .com.daml.ledger.api.v1.GetPackageResponse
GetPackageStatus method, v2¶
Returns the status of a single package.
- Request: GetPackageStatusRequest
- Response: .com.daml.ledger.api.v1.GetPackageStatusResponse
GetPackageRequest message, v2¶
package_id
: string
The ID of the requested package.
Must be a valid PackageIdString (as described in value.proto
).
Required
GetPackageStatusRequest message, v2¶
package_id
: string
The ID of the requested package.
Must be a valid PackageIdString (as described in value.proto
).
Required
ListPackagesRequest message, v2¶
Message has no fields.
com/daml/ledger/api/v2/participant_offset.proto
ParticipantOffset message, v2¶
Describes a specific point on the participant. This is a participant local value: a participant offset is meaningful only in the context of its participant. Different participants may associate different offsets to the same change synchronized over a domain, and conversely, the same literal participant offset may refer to different changes on different participants.
This is also a unique index of the changes which happened on the virtual shared ledger.
Participant offset define an order, which is the same in which order the updates are
visible as subscribing to the UpdateService
. This ordering is also a fully causal
ordering for one specific domain: for two updates synchronized by the same domain, the
one with a bigger participant offset happened after than the one with a smaller participant
offset. Please note this is not true for updates synchronized by a different domain.
Accordingly, the participant offset order may deviate from the order of the changes
on the virtual shared ledger.
The Ledger API endpoints that take offsets allow to specify portions of the participant that are relevant for the client to read.
Offsets returned by the Ledger API can be used as-is (e.g. to keep track of processed transactions and provide a restart point to use in case of need).
The format of absolute offsets is opaque to the client: no client-side transformation of an offset is guaranteed to return a meaningful offset.
The server implementation ensures internally that offsets are lexicographically comparable.
oneof value.absolute
: string
The format of this string is specific to the participant and opaque to the client.
oneof value.boundary
: ParticipantOffset.ParticipantBoundary
ParticipantOffset.ParticipantBoundary enum, v2¶
PARTICIPANT_BEGIN |
0 | Refers to the first transaction. |
PARTICIPANT_END |
1 | Refers to the currently last transaction, which is a moving target. |
com/daml/ledger/api/v2/reassignment.proto
AssignedEvent message, v2¶
Records that a contract has been assigned, and it can be used on the target domain.
source
: string
The ID of the source domain. Must be a valid domain ID. Required
target
: string
The ID of the target domain. Must be a valid domain ID. Required
unassign_id
: string
The ID from the unassigned event.
For correlation capabilities.
For one contract the (unassign_id, source domain) pair is unique.
Must be a valid LedgerString (as described in value.proto
).
Required
submitter
: string
Party on whose behalf the assign command was executed.
Empty if the assignment happened offline via the repair service.
Must be a valid PartyIdString (as described in value.proto
).
Optional
reassignment_counter
: uint64
Each corresponding assigned and unassigned event has the same reassignment_counter. This strictly increases with each unassign command for the same contract. Creation of the contract corresponds to reassignment_counter equals zero. Required
created_event
: com.daml.ledger.api.v1.CreatedEvent
Required
Reassignment message, v2¶
Complete view of an on-ledger reassignment.
update_id
: string
Assigned by the server. Useful for correlating logs.
Must be a valid LedgerString (as described in value.proto
).
Required
command_id
: string
The ID of the command which resulted in this reassignment. Missing for everyone except the submitting party on the submitting participant.
Must be a valid LedgerString (as described in value.proto
).
Optional
workflow_id
: string
The workflow ID used in reassignment command submission. Only set if the workflow_id
for the command was set.
Must be a valid LedgerString (as described in value.proto
).
Optional
offset
: string
The absolute offset. The format of this field is described in participant_offset.proto
.
Required
oneof event.unassigned_event
: UnassignedEvent
oneof event.assigned_event
: AssignedEvent
trace_context
: com.daml.ledger.api.v1.TraceContext
Optional; ledger api trace context
The trace context transported in this message corresponds to the trace context supplied by the client application in a HTTP2 header of the original command submission. We typically use a header to transfer this type of information. Here we use message body, because it is used in gRPC streams which do not support per message headers. This field will be populated with the trace context contained in the original submission. If that was not provided, a unique ledger-api-server generated trace context will be used instead.
UnassignedEvent message, v2¶
Records that a contract has been unassigned, and it becomes unusable on the source domain
unassign_id
: string
The ID of the unassignment. This needs to be used as an input for a assign ReassignmentCommand.
For one contract the (unassign_id, source domain) pair is unique.
Must be a valid LedgerString (as described in value.proto
).
Required
contract_id
: string
The ID of the reassigned contract.
Must be a valid LedgerString (as described in value.proto
).
Required
template_id
: com.daml.ledger.api.v1.Identifier
- The template of the reassigned contract.
- Required
source
: string
The ID of the source domain Must be a valid domain ID Required
target
: string
The ID of the target domain Must be a valid domain ID Required
submitter
: string
Party on whose behalf the unassign command was executed.
Empty if the unassignment happened offline via the repair service.
Must be a valid PartyIdString (as described in value.proto
).
Optional
reassignment_counter
: uint64
Each corresponding assigned and unassigned event has the same reassignment_counter. This strictly increases with each unassign command for the same contract. Creation of the contract corresponds to reassignment_counter equals zero. Required
assignment_exclusivity
: google.protobuf.Timestamp
Assignment exclusivity Before this time (measured on the target domain), only the submitter of the unassignment can initiate the assignment Defined for reassigning participants. Optional
witness_parties
: string (repeated)
The parties that are notified of this event. Required
com/daml/ledger/api/v2/reassignment_command.proto
AssignCommand message, v2¶
Assign a contract
unassign_id
: string
The ID from the unassigned event to be completed by this assignment.
Must be a valid LedgerString (as described in value.proto
).
Required
source
: string
The ID of the source domain Must be a valid domain ID Required
target
: string
The ID of the target domain Must be a valid domain ID Required
ReassignmentCommand message, v2¶
workflow_id
: string
Identifier of the on-ledger workflow that this command is a part of.
Must be a valid LedgerString (as described in value.proto
).
Optional
application_id
: string
Uniquely identifies the application or participant user that issued the command.
Must be a valid ApplicationIdString (as described in value.proto
).
Required unless authentication is used with a user token or a custom token specifying an application-id.
In that case, the token’s user-id, respectively application-id, will be used for the request’s application_id.
command_id
: string
Uniquely identifies the command.
The triple (application_id, submitter, command_id) constitutes the change ID for the intended ledger change.
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
submitter
: string
Party on whose behalf the command should be executed.
If ledger API authorization is enabled, then the authorization metadata must authorize the sender of the request
to act on behalf of the given party.
Must be a valid PartyIdString (as described in value.proto
).
Required
oneof command.unassign_command
: UnassignCommand
oneof command.assign_command
: AssignCommand
submission_id
: string
A unique identifier to distinguish completions for different submissions with the same change ID.
Typically a random UUID. Applications are expected to use a different UUID for each retry of a submission
with the same change ID.
Must be a valid LedgerString (as described in value.proto
).
If omitted, the participant or the committer may set a value of their choice. Optional
UnassignCommand message, v2¶
Unassign a contract
contract_id
: string
The ID of the contract the client wants to unassign.
Must be a valid LedgerString (as described in value.proto
).
Required
source
: string
The ID of the source domain Must be a valid domain ID Required
target
: string
The ID of the target domain Must be a valid domain ID Required
com/daml/ledger/api/v2/state_service.proto
StateService, v2¶
Allows clients to get state from the ledger.
GetActiveContracts method, v2¶
Returns a stream of the snapshot of the active contracts and incomplete reassignments at a ledger offset. If there are no active contracts, the stream returns a single response message with the offset at which the snapshot has been taken. Clients SHOULD use the offset in the last GetActiveContractsResponse message to continue streaming transactions with the update service. Clients SHOULD NOT assume that the set of active contracts they receive reflects the state at the ledger end.
- Request: GetActiveContractsRequest
- Response: GetActiveContractsResponse
GetConnectedDomains method, v2¶
Get the list of connected domains at the time of the query.
- Request: GetConnectedDomainsRequest
- Response: GetConnectedDomainsResponse
GetLedgerEnd method, v2¶
Get the current ledger end. Subscriptions started with the returned offset will serve events after this RPC was called.
- Request: GetLedgerEndRequest
- Response: GetLedgerEndResponse
GetLatestPrunedOffsets method, v2¶
Get the latest successfully pruned ledger offsets
- Request: GetLatestPrunedOffsetsRequest
- Response: GetLatestPrunedOffsetsResponse
ActiveContract message, v2¶
created_event
: com.daml.ledger.api.v1.CreatedEvent
Required
domain_id
: string
A valid domain ID Required
reassignment_counter
: uint64
Each corresponding assigned and unassigned event has the same reassignment_counter. This strictly increases with each unassign command for the same contract. Creation of the contract corresponds to reassignment_counter equals zero. This field will be the reassignment_counter of the latest observable activation event on this domain, which is before the active_at_offset. Required
GetActiveContractsRequest message, v2¶
filter
: TransactionFilter
Templates to include in the served snapshot, per party. Required
verbose
: bool
If enabled, values served over the API will contain more information than strictly necessary to interpret the data. In particular, setting the verbose flag to true triggers the ledger to include labels for record fields. Optional
active_at_offset
: string
The offset at which the snapshot of the active contracts will be computed. Must be no greater than the current ledger end offset. Must be greater than or equal to the last pruning offset. If not set the current ledger end offset will be used. Optional
GetActiveContractsResponse message, v2¶
offset
: string
Included only in the last message.
The client should start consuming the transactions endpoint with this offset.
The format of this field is described in participant_offset.proto
.
workflow_id
: string
The workflow ID used in command submission which corresponds to the contract_entry. Only set if
the workflow_id
for the command was set.
Must be a valid LedgerString (as described in value.proto
).
Optional
oneof contract_entry.active_contract
: ActiveContract
The contract is active on the given domain, meaning: there was an activation event on the given domain ( created, assigned), which is not followed by a deactivation event (archived, unassigned) on the same domain, until the active_at_offset. Since activeness is defined as a per domain concept, it is possible, that a contract is active on one domain, but already archived on another. There will be one such message for each domain the contract is active on.
oneof contract_entry.incomplete_unassigned
: IncompleteUnassigned
Included iff the unassigned event was before or at the active_at_offset, but there was no corresponding assigned event before or at the active_at_offset.
oneof contract_entry.incomplete_assigned
: IncompleteAssigned
Important: this message is not indicating that the contract is active on the target domain! Included iff the assigned event was before or at the active_at_offset, but there was no corresponding unassigned event before or at the active_at_offset.
GetConnectedDomainsRequest message, v2¶
party
: string
The party of interest
Must be a valid PartyIdString (as described in value.proto
).
Required
GetConnectedDomainsResponse message, v2¶
connected_domains
: GetConnectedDomainsResponse.ConnectedDomain (repeated)
GetConnectedDomainsResponse.ConnectedDomain message, v2¶
domain_alias
: string
The alias of the domain Required
domain_id
: string
The ID of the domain Required
permission
: ParticipantPermission
The permission on the domain Required
GetLatestPrunedOffsetsRequest message, v2¶
Empty for now, but may contain fields in the future.
Message has no fields.
GetLatestPrunedOffsetsResponse message, v2¶
participant_pruned_up_to_inclusive
: ParticipantOffset
The offset up to which the ledger has been pruned, disregarding the state of all divulged contracts pruning.
all_divulged_contracts_pruned_up_to_inclusive
: ParticipantOffset
The offset up to which all divulged events have been pruned on the ledger. It can be at or before the
participant_pruned_up_to_inclusive
offset.
For more details about all divulged events pruning,
see PruneRequest.prune_all_divulged_contracts
in participant_pruning_service.proto
.
GetLedgerEndRequest message, v2¶
Message has no fields.
GetLedgerEndResponse message, v2¶
offset
: ParticipantOffset
The absolute offset of the current ledger end.
IncompleteUnassigned message, v2¶
created_event
: com.daml.ledger.api.v1.CreatedEvent
Required
unassigned_event
: UnassignedEvent
Required
ParticipantPermission enum, v2¶
Enum indicating the permission level that the participant has for the party whose connected domains are being listed.
Submission |
0 | |
Confirmation |
1 | participant can only confirm transactions |
Observation |
2 | participant can only observe transactions |
com/daml/ledger/api/v2/testing/time_service.proto
TimeService, v2/testing¶
Optional service, exposed for testing static time scenarios.
GetTime method, v2/testing¶
Returns the current time according to the ledger server.
- Request: GetTimeRequest
- Response: GetTimeResponse
SetTime method, v2/testing¶
Allows clients to change the ledger’s clock in an atomic get-and-set operation.
- Request: SetTimeRequest
- Response: .google.protobuf.Empty
GetTimeRequest message, v2/testing¶
Message has no fields.
GetTimeResponse message, v2/testing¶
current_time
: google.protobuf.Timestamp
The current time according to the ledger server.
SetTimeRequest message, v2/testing¶
current_time
: google.protobuf.Timestamp
MUST precisely match the current time as it’s known to the ledger server.
new_time
: google.protobuf.Timestamp
The time the client wants to set on the ledger.
MUST be a point int time after current_time
.
com/daml/ledger/api/v2/transaction.proto
Transaction message, v2¶
Filtered view of an on-ledger transaction’s create and archive events.
update_id
: string
Assigned by the server. Useful for correlating logs.
Must be a valid LedgerString (as described in value.proto
).
Required
command_id
: string
The ID of the command which resulted in this transaction. Missing for everyone except the submitting party.
Must be a valid LedgerString (as described in value.proto
).
Optional
workflow_id
: string
The workflow ID used in command submission.
Must be a valid LedgerString (as described in value.proto
).
Optional
effective_at
: google.protobuf.Timestamp
Ledger effective time.
Must be a valid LedgerString (as described in value.proto
).
Required
events
: com.daml.ledger.api.v1.Event (repeated)
The collection of events.
Only contains CreatedEvent
or ArchivedEvent
.
Required
offset
: string
The absolute offset. The format of this field is described in participant_offset.proto
.
Required
domain_id
: string
A valid domain ID. Identifies the domain that synchronized the transaction. Required
trace_context
: com.daml.ledger.api.v1.TraceContext
Optional; ledger api trace context
The trace context transported in this message corresponds to the trace context supplied by the client application in a HTTP2 header of the original command submission. We typically use a header to transfer this type of information. Here we use message body, because it is used in gRPC streams which do not support per message headers. This field will be populated with the trace context contained in the original submission. If that was not provided, a unique ledger-api-server generated trace context will be used instead.
TransactionTree message, v2¶
Complete view of an on-ledger transaction.
update_id
: string
Assigned by the server. Useful for correlating logs.
Must be a valid LedgerString (as described in value.proto
).
Required
command_id
: string
The ID of the command which resulted in this transaction. Missing for everyone except the submitting party.
Must be a valid LedgerString (as described in value.proto
).
Optional
workflow_id
: string
The workflow ID used in command submission. Only set if the workflow_id
for the command was set.
Must be a valid LedgerString (as described in value.proto
).
Optional
effective_at
: google.protobuf.Timestamp
Ledger effective time. Required
offset
: string
The absolute offset. The format of this field is described in participant_offset.proto
.
Required
events_by_id
: TransactionTree.EventsByIdEntry (repeated)
Changes to the ledger that were caused by this transaction. Nodes of the transaction tree.
Each key be a valid LedgerString (as describe in value.proto
).
Required
root_event_ids
: string (repeated)
Roots of the transaction tree.
Each element must be a valid LedgerString (as describe in value.proto
).
The elements are in the same order as the commands in the
corresponding Commands object that triggered this transaction.
Required
domain_id
: string
A valid domain ID. Identifies the domain that synchronized the transaction. Required
trace_context
: com.daml.ledger.api.v1.TraceContext
Optional; ledger api trace context
The trace context transported in this message corresponds to the trace context supplied by the client application in a HTTP2 header of the original command submission. We typically use a header to transfer this type of information. Here we use message body, because it is used in gRPC streams which do not support per message headers. This field will be populated with the trace context contained in the original submission. If that was not provided, a unique ledger-api-server generated trace context will be used instead.
TransactionTree.EventsByIdEntry message, v2¶
key
: string
value
: com.daml.ledger.api.v1.TreeEvent
com/daml/ledger/api/v2/transaction_filter.proto
TransactionFilter message, v2¶
A filter both for filtering create and archive events as well as for filtering transaction trees.
filters_by_party
: TransactionFilter.FiltersByPartyEntry (repeated)
Each key must be a valid PartyIdString (as described in value.proto
).
The interpretation of the filter depends on the stream being filtered:
- For transaction tree streams all party keys used as wildcard filters, and all subtrees
whose root has one of the listed parties as an informee are returned.
If there are InclusiveFilters, those will control returned
CreatedEvent
fields were applicable, but not used for template/interface filtering. - For transaction and active-contract-set streams create and archive events are returned for all contracts whose stakeholders include at least one of the listed parties and match the per-party filter.
Required
TransactionFilter.FiltersByPartyEntry message, v2¶
key
: string
value
: com.daml.ledger.api.v1.Filters
com/daml/ledger/api/v2/update_service.proto
UpdateService, v2¶
Allows clients to read updates (transactions and reassignments) from the ledger.
GetUpdates
and GetUpdateTrees
provide a comprehensive stream of updates/changes
which happened on the virtual shared ledger. These streams are indexed with ledger
offsets, which are strictly increasing.
The virtual shared ledger consist of changes happening on multiple domains which are
connected to the serving participant. Each update belongs to one domain, this is
provided in the result (the domain_id
field in Transaction
and TransactionTree
for transactions, the source
field in UnassignedEvent
and the target
field in AssignedEvent
).
Consumers can rely on strong causal guarantees on the virtual shared ledger for a single
domain: updates which have greater offsets are happened after than updates with smaller
offsets for the same domain. Across different domains this is not guaranteed.
GetUpdates method, v2¶
Read the ledger’s filtered transaction stream and related reassignments for a set of parties. For transactions it lists only creates and archives, but no other events. Omits all events on transient contracts, i.e., contracts that were both created and archived in the same transaction.
- Request: GetUpdatesRequest
- Response: GetUpdatesResponse
GetUpdateTrees method, v2¶
Read the ledger’s complete transaction tree stream and related reassignments for a set of parties.
The stream will be filtered only by the parties as wildcard parties.
The template/interface filters describe the respective fields in the CreatedEvent
results.
- Request: GetUpdatesRequest
- Response: GetUpdateTreesResponse
GetTransactionTreeByEventId method, v2¶
Lookup a transaction tree by the ID of an event that appears within it. For looking up a transaction instead of a transaction tree, please see GetTransactionByEventId
- Request: GetTransactionByEventIdRequest
- Response: GetTransactionTreeResponse
GetTransactionTreeById method, v2¶
Lookup a transaction tree by its ID. For looking up a transaction instead of a transaction tree, please see GetTransactionById
- Request: GetTransactionByIdRequest
- Response: GetTransactionTreeResponse
GetTransactionByEventId method, v2¶
Lookup a transaction by the ID of an event that appears within it.
- Request: GetTransactionByEventIdRequest
- Response: GetTransactionResponse
GetTransactionById method, v2¶
Lookup a transaction by its ID.
- Request: GetTransactionByIdRequest
- Response: GetTransactionResponse
GetTransactionByEventIdRequest message, v2¶
event_id
: string
The ID of a particular event.
Must be a valid LedgerString (as described in value.proto
).
Required
requesting_parties
: string (repeated)
The parties whose events the client expects to see.
Events that are not visible for the parties in this collection will not be present in the response.
Each element must be a valid PartyIdString (as described in value.proto
).
Required
GetTransactionByIdRequest message, v2¶
update_id
: string
The ID of a particular transaction.
Must be a valid LedgerString (as describe in value.proto
).
Required
requesting_parties
: string (repeated)
The parties whose events the client expects to see.
Events that are not visible for the parties in this collection will not be present in the response.
Each element be a valid PartyIdString (as describe in value.proto
).
Required
GetUpdateTreesResponse message, v2¶
oneof update.transaction_tree
: TransactionTree
oneof update.reassignment
: Reassignment
pruned_offset
: string
Current pruned offset. It is sent when following three conditions are met: - a pruning operation has completed - the transaction stream tails the LEDGER_END - the send_pruned_offsets field was set on the corresponding request. The conditions for including the pruned_offset in messages may change in the future implementations. When pruned_offset is set, the message does not contain any transactions in the transactions field.
GetUpdatesRequest message, v2¶
begin_exclusive
: ParticipantOffset
Beginning of the requested ledger section. The response will only contain transactions whose offset is strictly greater than this. Required
end_inclusive
: ParticipantOffset
End of the requested ledger section. The response will only contain transactions whose offset is less than or equal to this. Optional, if not set, the stream will not terminate.
filter
: TransactionFilter
Requesting parties with template filters. Template filters must be empty for GetUpdateTrees requests. Required
verbose
: bool
If enabled, values served over the API will contain more information than strictly necessary to interpret the data. In particular, setting the verbose flag to true triggers the ledger to include labels, record and variant type ids for record fields. Optional
send_pruned_offsets
: bool
If set to true, the server will send responses containing pruned offset upon pruning completion. Optional
GetUpdatesResponse message, v2¶
oneof update.transaction
: Transaction
oneof update.reassignment
: Reassignment
pruned_offset
: string
Current pruned offset. It is sent when following three conditions are met: - a pruning operation has completed - the transaction stream tails the LEDGER_END - the send_pruned_offsets field was set on the corresponding request. The conditions for including the pruned_offset in messages may change in the future implementations. When pruned_offset is set, the message does not contain any transactions in the transactions field.
com/daml/ledger/api/v2/version_service.proto
VersionService, v2¶
Allows clients to retrieve information about the ledger API version
GetLedgerApiVersion method, v2¶
Read the Ledger API version
- Request: GetLedgerApiVersionRequest
- Response: .com.daml.ledger.api.v1.GetLedgerApiVersionResponse
Scalar Value Types¶
double
Java Python C++ C# double
float
double
double
float
Java Python C++ C# float
float
float
float
int32
Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.
Java Python C++ C# int
int
int32
int
int64
Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.
Java Python C++ C# long
int/long
int64
long
uint32
Uses variable-length encoding.
Java Python C++ C# int
int/long
uint32
uint
uint64
Uses variable-length encoding.
Java Python C++ C# long
int/long
uint64
ulong
sint32
Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.
Java Python C++ C# int
int
int32
int
sint64
Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.
Java Python C++ C# long
int/long
int64
long
fixed32
Always four bytes. More efficient than uint32 if values are often greater than 2^28.
Java Python C++ C# int
int
uint32
uint
fixed64
Always eight bytes. More efficient than uint64 if values are often greater than 2^56.
Java Python C++ C# long
int/long
uint64
ulong
sfixed32
Always four bytes.
Java Python C++ C# int
int
int32
int
sfixed64
Always eight bytes.
Java Python C++ C# long
int/long
int64
long
bool
Java Python C++ C# boolean
boolean
bool
bool
string
A string must always contain UTF-8 encoded or 7-bit ASCII text.
Java Python C++ C# String
str/unicode
string
string
bytes
May contain any arbitrary sequence of bytes.
Java Python C++ C# ByteString
str
string
ByteString