@canton-network/core-ledger-client 0.21.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,994 @@
1
+ export interface JsCantonError {
2
+ code: string;
3
+ cause: string;
4
+ correlationId?: string;
5
+ traceId?: string;
6
+ context: Map_String;
7
+ resources?: Tuple2_String_String[];
8
+ errorCategory: number;
9
+ grpcCodeValue?: number;
10
+ retryInfo?: string;
11
+ definiteAnswer?: boolean;
12
+ }
13
+ export type Map_String = Record<string, string>;
14
+ export type Tuple2_String_String = any;
15
+ export interface CompletionStreamRequest {
16
+ /** Only completions of commands submitted with the same user_id will be visible in the stream.
17
+ Must be a valid UserIdString (as described in ``value.proto``).
18
+ Required unless authentication is used with a user token.
19
+ In that case, the token's user-id will be used for the request's user_id. **/
20
+ userId: string;
21
+ /** Non-empty list of parties whose data should be included.
22
+ The stream shows only completions of commands for which at least one of the ``act_as`` parties is in the given set of parties.
23
+ Must be a valid PartyIdString (as described in ``value.proto``).
24
+ Required **/
25
+ parties?: string[];
26
+ /** This optional field indicates the minimum offset for completions. This can be used to resume an earlier completion stream.
27
+ If not set the ledger uses the ledger begin offset instead.
28
+ If specified, it must be a valid absolute offset (positive integer) or zero (ledger begin offset).
29
+ If the ledger has been pruned, this parameter must be specified and greater than the pruning offset. **/
30
+ beginExclusive: number;
31
+ }
32
+ export type Either_JsCantonError_CompletionStreamResponse = CompletionStreamResponse | JsCantonError;
33
+ export type Map_K_V = Record<string, string>;
34
+ export interface CompletionStreamResponse {
35
+ completionResponse: CompletionResponse;
36
+ }
37
+ export type CompletionResponse = Completion | Empty1 | OffsetCheckpoint;
38
+ export interface Completion {
39
+ value: Completion1;
40
+ }
41
+ export interface Completion1 {
42
+ /** The ID of the succeeded or failed command.
43
+ Must be a valid LedgerString (as described in ``value.proto``).
44
+ Required **/
45
+ commandId: string;
46
+ /** Identifies the exact type of the error.
47
+ It uses the same format of conveying error details as it is used for the RPC responses of the APIs.
48
+ Optional **/
49
+ status?: JsStatus;
50
+ /** The update_id of the transaction or reassignment that resulted from the command with command_id.
51
+ Only set for successfully executed commands.
52
+ Must be a valid LedgerString (as described in ``value.proto``). **/
53
+ updateId: string;
54
+ /** The user-id that was used for the submission, as described in ``commands.proto``.
55
+ Must be a valid UserIdString (as described in ``value.proto``).
56
+ Optional for historic completions where this data is not available. **/
57
+ userId: string;
58
+ /** The set of parties on whose behalf the commands were executed.
59
+ Contains the ``act_as`` parties from ``commands.proto``
60
+ filtered to the requesting parties in CompletionStreamRequest.
61
+ The order of the parties need not be the same as in the submission.
62
+ Each element must be a valid PartyIdString (as described in ``value.proto``).
63
+ Optional for historic completions where this data is not available. **/
64
+ actAs?: string[];
65
+ /** The submission ID this completion refers to, as described in ``commands.proto``.
66
+ Must be a valid LedgerString (as described in ``value.proto``).
67
+ Optional **/
68
+ submissionId: string;
69
+ deduplicationPeriod: DeduplicationPeriod;
70
+ /** Optional; ledger API trace context
71
+
72
+ The trace context transported in this message corresponds to the trace context supplied
73
+ by the client application in a HTTP2 header of the original command submission.
74
+ We typically use a header to transfer this type of information. Here we use message
75
+ body, because it is used in gRPC streams which do not support per message headers.
76
+ This field will be populated with the trace context contained in the original submission.
77
+ If that was not provided, a unique ledger-api-server generated trace context will be used
78
+ instead. **/
79
+ traceContext?: TraceContext;
80
+ /** May be used in a subsequent CompletionStreamRequest to resume the consumption of this stream at a later time.
81
+ Required, must be a valid absolute offset (positive integer). **/
82
+ offset: number;
83
+ /** The synchronizer along with its record time.
84
+ The synchronizer id provided, in case of
85
+
86
+ - successful/failed transactions: identifies the synchronizer of the transaction
87
+ - for successful/failed unassign commands: identifies the source synchronizer
88
+ - for successful/failed assign commands: identifies the target synchronizer
89
+
90
+ Required **/
91
+ synchronizerTime?: SynchronizerTime;
92
+ }
93
+ export interface JsStatus {
94
+ code: number;
95
+ message: string;
96
+ details?: ProtoAny[];
97
+ }
98
+ export interface ProtoAny {
99
+ typeUrl: string;
100
+ value: string;
101
+ unknownFields: UnknownFieldSet;
102
+ valueDecoded?: string;
103
+ }
104
+ export interface UnknownFieldSet {
105
+ fields: Map_Int_Field;
106
+ }
107
+ export type Map_Int_Field = Record<string, Field>;
108
+ export interface Field {
109
+ varint?: number[];
110
+ fixed64?: number[];
111
+ fixed32?: number[];
112
+ lengthDelimited?: string[];
113
+ }
114
+ export type DeduplicationPeriod = DeduplicationDuration | DeduplicationOffset | Empty;
115
+ export interface DeduplicationDuration {
116
+ value: Duration;
117
+ }
118
+ export interface Duration {
119
+ seconds: number;
120
+ nanos: number;
121
+ /** This field is automatically added as part of protobuf to json mapping **/
122
+ unknownFields?: UnknownFieldSet;
123
+ }
124
+ export interface DeduplicationOffset {
125
+ value: number;
126
+ }
127
+ export type Empty = Record<string, any>;
128
+ export interface TraceContext {
129
+ /** https://www.w3.org/TR/trace-context/ **/
130
+ traceparent?: string;
131
+ tracestate?: string;
132
+ }
133
+ export interface SynchronizerTime {
134
+ /** The id of the synchronizer.
135
+ Required **/
136
+ synchronizerId: string;
137
+ /** All commands with a maximum record time below this value MUST be considered lost if their completion has not arrived before this checkpoint.
138
+ Required **/
139
+ recordTime?: string;
140
+ }
141
+ export type Empty1 = Record<string, any>;
142
+ export interface OffsetCheckpoint {
143
+ value: OffsetCheckpoint1;
144
+ }
145
+ export interface OffsetCheckpoint1 {
146
+ /** The participant's offset, the details of the offset field are described in ``community/ledger-api/README.md``.
147
+ Required, must be a valid absolute offset (positive integer). **/
148
+ offset: number;
149
+ synchronizerTimes?: SynchronizerTime[];
150
+ }
151
+ export interface GetActiveContractsRequest {
152
+ /** Provided for backwards compatibility, it will be removed in the Canton version 3.5.0.
153
+ Templates to include in the served snapshot, per party.
154
+ Optional, if specified event_format must be unset, if not specified event_format must be set. **/
155
+ filter?: TransactionFilter;
156
+ /** Provided for backwards compatibility, it will be removed in the Canton version 3.5.0.
157
+ If enabled, values served over the API will contain more information than strictly necessary to interpret the data.
158
+ In particular, setting the verbose flag to true triggers the ledger to include labels for record fields.
159
+ Optional, if specified event_format must be unset. **/
160
+ verbose: boolean;
161
+ /** The offset at which the snapshot of the active contracts will be computed.
162
+ Must be no greater than the current ledger end offset.
163
+ Must be greater than or equal to the last pruning offset.
164
+ Required, must be a valid absolute offset (positive integer) or ledger begin offset (zero).
165
+ If zero, the empty set will be returned. **/
166
+ activeAtOffset: number;
167
+ /** Format of the contract_entries in the result. In case of CreatedEvent the presentation will be of
168
+ TRANSACTION_SHAPE_ACS_DELTA.
169
+ Optional for backwards compatibility, defaults to an EventFormat where:
170
+
171
+ - filters_by_party is the filter.filters_by_party from this request
172
+ - filters_for_any_party is the filter.filters_for_any_party from this request
173
+ - verbose is the verbose field from this request **/
174
+ eventFormat?: EventFormat;
175
+ }
176
+ export interface TransactionFilter {
177
+ /** Each key must be a valid PartyIdString (as described in ``value.proto``).
178
+ The interpretation of the filter depends on the transaction-shape being filtered:
179
+
180
+ 1. For **transaction trees** (used in GetUpdateTreesResponse for backwards compatibility) all party keys used as
181
+ wildcard filters, and all subtrees whose root has one of the listed parties as an informee are returned.
182
+ If there are ``CumulativeFilter``s, those will control returned ``CreatedEvent`` fields where applicable, but will
183
+ not be used for template/interface filtering.
184
+ 2. For **ledger-effects** create and exercise events are returned, for which the witnesses include at least one of
185
+ the listed parties and match the per-party filter.
186
+ 3. For **transaction and active-contract-set streams** create and archive events are returned for all contracts whose
187
+ stakeholders include at least one of the listed parties and match the per-party filter. **/
188
+ filtersByParty: Map_Filters;
189
+ /** Wildcard filters that apply to all the parties existing on the participant. The interpretation of the filters is the same
190
+ with the per-party filter as described above. **/
191
+ filtersForAnyParty?: Filters;
192
+ }
193
+ export type Map_Filters = Record<string, Filters>;
194
+ export interface Filters {
195
+ /** Every filter in the cumulative list expands the scope of the resulting stream. Each interface,
196
+ template or wildcard filter means additional events that will match the query.
197
+ The impact of include_interface_view and include_created_event_blob fields in the filters will
198
+ also be accumulated.
199
+ A template or an interface SHOULD NOT appear twice in the accumulative field.
200
+ A wildcard filter SHOULD NOT be defined more than once in the accumulative field.
201
+ Optional, if no ``CumulativeFilter`` defined, the default of a single ``WildcardFilter`` with
202
+ include_created_event_blob unset is used. **/
203
+ cumulative?: CumulativeFilter[];
204
+ }
205
+ export interface CumulativeFilter {
206
+ identifierFilter: IdentifierFilter;
207
+ }
208
+ export type IdentifierFilter = Empty2 | InterfaceFilter | TemplateFilter | WildcardFilter;
209
+ export type Empty2 = Record<string, any>;
210
+ export interface InterfaceFilter {
211
+ value: InterfaceFilter1;
212
+ }
213
+ export interface InterfaceFilter1 {
214
+ /** The interface that a matching contract must implement.
215
+ The ``interface_id`` needs to be valid: corresponding interface should be defined in
216
+ one of the available packages at the time of the query.
217
+ Both package-name and package-id reference formats for the identifier are supported.
218
+ Note: The package-id reference identifier format is deprecated. We plan to end support for this format in version 3.4.
219
+
220
+ Required **/
221
+ interfaceId?: string;
222
+ /** Whether to include the interface view on the contract in the returned ``CreatedEvent``.
223
+ Use this to access contract data in a uniform manner in your API client.
224
+ Optional **/
225
+ includeInterfaceView: boolean;
226
+ /** Whether to include a ``created_event_blob`` in the returned ``CreatedEvent``.
227
+ Use this to access the contract create event payload in your API client
228
+ for submitting it as a disclosed contract with future commands.
229
+ Optional **/
230
+ includeCreatedEventBlob: boolean;
231
+ }
232
+ export interface TemplateFilter {
233
+ value: TemplateFilter1;
234
+ }
235
+ export interface TemplateFilter1 {
236
+ /** A template for which the payload should be included in the response.
237
+ The ``template_id`` needs to be valid: corresponding template should be defined in
238
+ one of the available packages at the time of the query.
239
+ Both package-name and package-id reference formats for the identifier are supported.
240
+ Note: The package-id reference identifier format is deprecated. We plan to end support for this format in version 3.4.
241
+
242
+ Required **/
243
+ templateId?: string;
244
+ /** Whether to include a ``created_event_blob`` in the returned ``CreatedEvent``.
245
+ Use this to access the contract event payload in your API client
246
+ for submitting it as a disclosed contract with future commands.
247
+ Optional **/
248
+ includeCreatedEventBlob: boolean;
249
+ }
250
+ export interface WildcardFilter {
251
+ value: WildcardFilter1;
252
+ }
253
+ export interface WildcardFilter1 {
254
+ /** Whether to include a ``created_event_blob`` in the returned ``CreatedEvent``.
255
+ Use this to access the contract create event payload in your API client
256
+ for submitting it as a disclosed contract with future commands.
257
+ Optional **/
258
+ includeCreatedEventBlob: boolean;
259
+ }
260
+ export interface EventFormat {
261
+ /** Each key must be a valid PartyIdString (as described in ``value.proto``).
262
+ The interpretation of the filter depends on the transaction-shape being filtered:
263
+
264
+ 1. For **ledger-effects** create and exercise events are returned, for which the witnesses include at least one of
265
+ the listed parties and match the per-party filter.
266
+ 2. For **transaction and active-contract-set streams** create and archive events are returned for all contracts whose
267
+ stakeholders include at least one of the listed parties and match the per-party filter.
268
+
269
+ Optional **/
270
+ filtersByParty: Map_Filters;
271
+ /** Wildcard filters that apply to all the parties existing on the participant. The interpretation of the filters is the same
272
+ with the per-party filter as described above.
273
+ Optional **/
274
+ filtersForAnyParty?: Filters;
275
+ /** If enabled, values served over the API will contain more information than strictly necessary to interpret the data.
276
+ In particular, setting the verbose flag to true triggers the ledger to include labels for record fields.
277
+ Optional **/
278
+ verbose: boolean;
279
+ }
280
+ export type Either_JsCantonError_JsGetActiveContractsResponse = JsCantonError | JsGetActiveContractsResponse;
281
+ export interface JsGetActiveContractsResponse {
282
+ /** The workflow ID used in command submission which corresponds to the contract_entry. Only set if
283
+ the ``workflow_id`` for the command was set.
284
+ Must be a valid LedgerString (as described in ``value.proto``).
285
+ Optional **/
286
+ workflowId: string;
287
+ contractEntry: JsContractEntry;
288
+ }
289
+ export type JsContractEntry = JsActiveContract | JsEmpty | JsIncompleteAssigned | JsIncompleteUnassigned;
290
+ export interface JsActiveContract {
291
+ /** Required
292
+ The event as it appeared in the context of its last update (i.e. daml transaction or
293
+ reassignment). In particular, the last offset, node_id pair is preserved.
294
+ The last update is the most recent update created or assigned this contract on synchronizer_id synchronizer.
295
+ The offset of the CreatedEvent might point to an already pruned update, therefore it cannot necessarily be used
296
+ for lookups. **/
297
+ createdEvent: CreatedEvent;
298
+ /** A valid synchronizer id
299
+ Required **/
300
+ synchronizerId: string;
301
+ /** Each corresponding assigned and unassigned event has the same reassignment_counter. This strictly increases
302
+ with each unassign command for the same contract. Creation of the contract corresponds to reassignment_counter
303
+ equals zero.
304
+ This field will be the reassignment_counter of the latest observable activation event on this synchronizer, which is
305
+ before the active_at_offset.
306
+ Required **/
307
+ reassignmentCounter: number;
308
+ }
309
+ export interface CreatedEvent {
310
+ /** The offset of origin, which has contextual meaning, please see description at messages that include a CreatedEvent.
311
+ Offsets are managed by the participant nodes.
312
+ Transactions can thus NOT be assumed to have the same offsets on different participant nodes.
313
+ Required, it is a valid absolute offset (positive integer) **/
314
+ offset: number;
315
+ /** The position of this event in the originating transaction or reassignment.
316
+ The origin has contextual meaning, please see description at messages that include a CreatedEvent.
317
+ Node IDs are not necessarily equal across participants,
318
+ as these may see different projections/parts of transactions.
319
+ Required, must be valid node ID (non-negative integer) **/
320
+ nodeId: number;
321
+ /** The ID of the created contract.
322
+ Must be a valid LedgerString (as described in ``value.proto``).
323
+ Required **/
324
+ contractId: string;
325
+ /** The template of the created contract.
326
+ The identifier uses the package-id reference format.
327
+
328
+ Required **/
329
+ templateId: string;
330
+ /** The key of the created contract.
331
+ This will be set if and only if ``template_id`` defines a contract key.
332
+ Optional **/
333
+ contractKey?: undefined;
334
+ createArgument?: undefined;
335
+ /** Opaque representation of contract create event payload intended for forwarding
336
+ to an API server as a contract disclosed as part of a command
337
+ submission.
338
+ Optional **/
339
+ createdEventBlob: string;
340
+ /** Interface views specified in the transaction filter.
341
+ Includes an ``InterfaceView`` for each interface for which there is a ``InterfaceFilter`` with
342
+
343
+ - its party in the ``witness_parties`` of this event,
344
+ - and which is implemented by the template of this event,
345
+ - and which has ``include_interface_view`` set.
346
+
347
+ Optional **/
348
+ interfaceViews?: JsInterfaceView[];
349
+ /** The parties that are notified of this event. When a ``CreatedEvent``
350
+ is returned as part of a transaction tree or ledger-effects transaction, this will include all
351
+ the parties specified in the ``TransactionFilter`` that are witnesses of the event
352
+ (the stakeholders of the contract and all informees of all the ancestors
353
+ of this create action that this participant knows about).
354
+ If served as part of a ACS delta transaction those will
355
+ be limited to all parties specified in the ``TransactionFilter`` that
356
+ are stakeholders of the contract (i.e. either signatories or observers).
357
+ If the ``CreatedEvent`` is returned as part of an AssignedEvent,
358
+ ActiveContract or IncompleteUnassigned (so the event is related to
359
+ an assignment or unassignment): this will include all parties of the
360
+ ``TransactionFilter`` that are stakeholders of the contract.
361
+
362
+ The behavior of reading create events visible to parties not hosted
363
+ on the participant node serving the Ledger API is undefined. Concretely,
364
+ there is neither a guarantee that the participant node will serve all their
365
+ create events on the ACS stream, nor is there a guarantee that matching archive
366
+ events are delivered for such create events.
367
+
368
+ For most clients this is not a problem, as they only read events for parties
369
+ that are hosted on the participant node. If you need to read events
370
+ for parties that may not be hosted at all times on the participant node,
371
+ subscribe to the ``TopologyEvent``s for that party by setting a corresponding
372
+ ``UpdateFormat``. Using these events, query the ACS as-of an offset where the
373
+ party is hosted on the participant node, and ignore create events at offsets
374
+ where the party is not hosted on the participant node.
375
+ Required **/
376
+ witnessParties?: string[];
377
+ /** The signatories for this contract as specified by the template.
378
+ Required **/
379
+ signatories?: string[];
380
+ /** The observers for this contract as specified explicitly by the template or implicitly as choice controllers.
381
+ This field never contains parties that are signatories.
382
+ Required **/
383
+ observers?: string[];
384
+ /** Ledger effective time of the transaction that created the contract.
385
+ Required **/
386
+ createdAt: string;
387
+ /** The package name of the created contract.
388
+ Required **/
389
+ packageName: string;
390
+ /** A package-id present in the participant package store that typechecks the contract's argument.
391
+ This may differ from the package-id of the template used to create the contract.
392
+ For contracts created before Canton 3.4, this field matches the contract's creation package-id.
393
+
394
+ NOTE: Experimental, server internal concept, not for client consumption. Subject to change without notice.
395
+
396
+ Required **/
397
+ representativePackageId: string;
398
+ /** Whether this event would be part of respective ACS_DELTA shaped stream,
399
+ and should therefore considered when tracking contract activeness on the client-side.
400
+ Required **/
401
+ acsDelta: boolean;
402
+ }
403
+ export interface JsInterfaceView {
404
+ /** The interface implemented by the matched event.
405
+ The identifier uses the package-id reference format.
406
+
407
+ Required **/
408
+ interfaceId: string;
409
+ /** Whether the view was successfully computed, and if not,
410
+ the reason for the error. The error is reported using the same rules
411
+ for error codes and messages as the errors returned for API requests.
412
+ Required **/
413
+ viewStatus: JsStatus;
414
+ /** The value of the interface's view method on this event.
415
+ Set if it was requested in the ``InterfaceFilter`` and it could be
416
+ successfully computed.
417
+ Optional **/
418
+ viewValue?: undefined;
419
+ }
420
+ export type JsEmpty = Record<string, any>;
421
+ export interface JsIncompleteAssigned {
422
+ /** Required **/
423
+ assignedEvent: JsAssignedEvent;
424
+ }
425
+ export interface JsAssignedEvent {
426
+ /** The ID of the source synchronizer.
427
+ Must be a valid synchronizer id.
428
+ Required **/
429
+ source: string;
430
+ /** The ID of the target synchronizer.
431
+ Must be a valid synchronizer id.
432
+ Required **/
433
+ target: string;
434
+ /** The ID from the unassigned event.
435
+ For correlation capabilities.
436
+ Must be a valid LedgerString (as described in ``value.proto``).
437
+ Required **/
438
+ reassignmentId: string;
439
+ /** Party on whose behalf the assign command was executed.
440
+ Empty if the assignment happened offline via the repair service.
441
+ Must be a valid PartyIdString (as described in ``value.proto``).
442
+ Optional **/
443
+ submitter: string;
444
+ /** Each corresponding assigned and unassigned event has the same reassignment_counter. This strictly increases
445
+ with each unassign command for the same contract. Creation of the contract corresponds to reassignment_counter
446
+ equals zero.
447
+ Required **/
448
+ reassignmentCounter: number;
449
+ /** Required
450
+ The offset of this event refers to the offset of the assignment,
451
+ while the node_id is the index of within the batch. **/
452
+ createdEvent: CreatedEvent;
453
+ }
454
+ export interface JsIncompleteUnassigned {
455
+ /** Required
456
+ The event as it appeared in the context of its last activation update (i.e. daml transaction or
457
+ reassignment). In particular, the last activation offset, node_id pair is preserved.
458
+ The last activation update is the most recent update created or assigned this contract on synchronizer_id synchronizer before
459
+ the unassigned_event.
460
+ The offset of the CreatedEvent might point to an already pruned update, therefore it cannot necessarily be used
461
+ for lookups. **/
462
+ createdEvent: CreatedEvent;
463
+ /** Required **/
464
+ unassignedEvent: UnassignedEvent;
465
+ }
466
+ export interface UnassignedEvent {
467
+ /** The ID of the unassignment. This needs to be used as an input for a assign ReassignmentCommand.
468
+ Must be a valid LedgerString (as described in ``value.proto``).
469
+ Required **/
470
+ reassignmentId: string;
471
+ /** The ID of the reassigned contract.
472
+ Must be a valid LedgerString (as described in ``value.proto``).
473
+ Required **/
474
+ contractId: string;
475
+ /** The template of the reassigned contract.
476
+ The identifier uses the package-id reference format.
477
+
478
+ Required **/
479
+ templateId?: string;
480
+ /** The ID of the source synchronizer
481
+ Must be a valid synchronizer id
482
+ Required **/
483
+ source: string;
484
+ /** The ID of the target synchronizer
485
+ Must be a valid synchronizer id
486
+ Required **/
487
+ target: string;
488
+ /** Party on whose behalf the unassign command was executed.
489
+ Empty if the unassignment happened offline via the repair service.
490
+ Must be a valid PartyIdString (as described in ``value.proto``).
491
+ Optional **/
492
+ submitter: string;
493
+ /** Each corresponding assigned and unassigned event has the same reassignment_counter. This strictly increases
494
+ with each unassign command for the same contract. Creation of the contract corresponds to reassignment_counter
495
+ equals zero.
496
+ Required **/
497
+ reassignmentCounter: number;
498
+ /** Assignment exclusivity
499
+ Before this time (measured on the target synchronizer), only the submitter of the unassignment can initiate the assignment
500
+ Defined for reassigning participants.
501
+ Optional **/
502
+ assignmentExclusivity?: string;
503
+ /** The parties that are notified of this event.
504
+ Required **/
505
+ witnessParties?: string[];
506
+ /** The package name of the contract.
507
+ Required **/
508
+ packageName: string;
509
+ /** The offset of origin.
510
+ Offsets are managed by the participant nodes.
511
+ Reassignments can thus NOT be assumed to have the same offsets on different participant nodes.
512
+ Required, it is a valid absolute offset (positive integer) **/
513
+ offset: number;
514
+ /** The position of this event in the originating reassignment.
515
+ Node IDs are not necessarily equal across participants,
516
+ as these may see different projections/parts of reassignments.
517
+ Required, must be valid node ID (non-negative integer) **/
518
+ nodeId: number;
519
+ }
520
+ export interface GetUpdatesRequest {
521
+ /** Beginning of the requested ledger section (non-negative integer).
522
+ The response will only contain transactions whose offset is strictly greater than this.
523
+ If zero, the stream will start from the beginning of the ledger.
524
+ If positive, the streaming will start after this absolute offset.
525
+ If the ledger has been pruned, this parameter must be specified and be greater than the pruning offset. **/
526
+ beginExclusive: number;
527
+ /** End of the requested ledger section.
528
+ The response will only contain transactions whose offset is less than or equal to this.
529
+ Optional, if empty, the stream will not terminate.
530
+ If specified, the stream will terminate after this absolute offset (positive integer) is reached. **/
531
+ endInclusive?: number;
532
+ /** Provided for backwards compatibility, it will be removed in the Canton version 3.5.0.
533
+ Requesting parties with template filters.
534
+ Template filters must be empty for GetUpdateTrees requests.
535
+ Optional for backwards compatibility, if defined update_format must be unset **/
536
+ filter?: TransactionFilter;
537
+ /** Provided for backwards compatibility, it will be removed in the Canton version 3.5.0.
538
+ If enabled, values served over the API will contain more information than strictly necessary to interpret the data.
539
+ In particular, setting the verbose flag to true triggers the ledger to include labels, record and variant type ids
540
+ for record fields.
541
+ Optional for backwards compatibility, if defined update_format must be unset **/
542
+ verbose: boolean;
543
+ /** Must be unset for GetUpdateTrees request.
544
+ Optional for backwards compatibility for GetUpdates request: defaults to an UpdateFormat where:
545
+
546
+ - include_transactions.event_format.filters_by_party = the filter.filters_by_party on this request
547
+ - include_transactions.event_format.filters_for_any_party = the filter.filters_for_any_party on this request
548
+ - include_transactions.event_format.verbose = the same flag specified on this request
549
+ - include_transactions.transaction_shape = TRANSACTION_SHAPE_ACS_DELTA
550
+ - include_reassignments.filter = the same filter specified on this request
551
+ - include_reassignments.verbose = the same flag specified on this request
552
+ - include_topology_events.include_participant_authorization_events.parties = all the parties specified in filter **/
553
+ updateFormat?: UpdateFormat;
554
+ }
555
+ export interface UpdateFormat {
556
+ /** Include Daml transactions in streams.
557
+ Optional, if unset, no transactions are emitted in the stream. **/
558
+ includeTransactions?: TransactionFormat;
559
+ /** Include (un)assignments in the stream.
560
+ The events in the result take the shape TRANSACTION_SHAPE_ACS_DELTA.
561
+ Optional, if unset, no (un)assignments are emitted in the stream. **/
562
+ includeReassignments?: EventFormat;
563
+ /** Include topology events in streams.
564
+ Optional, if unset no topology events are emitted in the stream. **/
565
+ includeTopologyEvents?: TopologyFormat;
566
+ }
567
+ export interface TransactionFormat {
568
+ /** Required **/
569
+ eventFormat?: EventFormat;
570
+ /** What transaction shape to use for interpreting the filters of the event format.
571
+ Required **/
572
+ transactionShape: 'TRANSACTION_SHAPE_UNSPECIFIED' | 'TRANSACTION_SHAPE_ACS_DELTA' | 'TRANSACTION_SHAPE_LEDGER_EFFECTS';
573
+ }
574
+ export interface TopologyFormat {
575
+ /** Include participant authorization topology events in streams.
576
+ Optional, if unset no participant authorization topology events are emitted in the stream. **/
577
+ includeParticipantAuthorizationEvents?: ParticipantAuthorizationTopologyFormat;
578
+ }
579
+ export interface ParticipantAuthorizationTopologyFormat {
580
+ /** List of parties for which the topology transactions should be sent.
581
+ Empty means: for all parties. **/
582
+ parties?: string[];
583
+ }
584
+ export type Either_JsCantonError_JsGetUpdatesResponse = JsCantonError | JsGetUpdatesResponse;
585
+ export interface JsGetUpdatesResponse {
586
+ update: Update;
587
+ }
588
+ export type Update = OffsetCheckpoint2 | Reassignment | TopologyTransaction | Transaction;
589
+ export interface OffsetCheckpoint2 {
590
+ value: OffsetCheckpoint1;
591
+ }
592
+ export interface Reassignment {
593
+ value: JsReassignment;
594
+ }
595
+ export interface JsReassignment {
596
+ /** Assigned by the server. Useful for correlating logs.
597
+ Must be a valid LedgerString (as described in ``value.proto``).
598
+ Required **/
599
+ updateId: string;
600
+ /** The ID of the command which resulted in this reassignment. Missing for everyone except the submitting party on the submitting participant.
601
+ Must be a valid LedgerString (as described in ``value.proto``).
602
+ Optional **/
603
+ commandId: string;
604
+ /** The workflow ID used in reassignment command submission. Only set if the ``workflow_id`` for the command was set.
605
+ Must be a valid LedgerString (as described in ``value.proto``).
606
+ Optional **/
607
+ workflowId: string;
608
+ /** The participant's offset. The details of this field are described in ``community/ledger-api/README.md``.
609
+ Required, must be a valid absolute offset (positive integer). **/
610
+ offset: number;
611
+ /** The collection of reassignment events. Required. **/
612
+ events?: JsReassignmentEvent[];
613
+ /** Optional; ledger API trace context
614
+
615
+ The trace context transported in this message corresponds to the trace context supplied
616
+ by the client application in a HTTP2 header of the original command submission.
617
+ We typically use a header to transfer this type of information. Here we use message
618
+ body, because it is used in gRPC streams which do not support per message headers.
619
+ This field will be populated with the trace context contained in the original submission.
620
+ If that was not provided, a unique ledger-api-server generated trace context will be used
621
+ instead. **/
622
+ traceContext?: TraceContext;
623
+ /** The time at which the reassignment was recorded. The record time refers to the source/target
624
+ synchronizer for an unassign/assign event respectively.
625
+ Required **/
626
+ recordTime: string;
627
+ /** A valid synchronizer id.
628
+ Identifies the synchronizer that synchronized this Reassignment.
629
+ Required **/
630
+ synchronizerId: string;
631
+ }
632
+ export type JsReassignmentEvent = JsAssignmentEvent | JsUnassignedEvent;
633
+ export interface JsAssignmentEvent {
634
+ source: string;
635
+ target: string;
636
+ reassignmentId: string;
637
+ submitter: string;
638
+ reassignmentCounter: number;
639
+ createdEvent: CreatedEvent;
640
+ }
641
+ export interface JsUnassignedEvent {
642
+ value: UnassignedEvent;
643
+ }
644
+ export interface TopologyTransaction {
645
+ value: JsTopologyTransaction;
646
+ }
647
+ export interface JsTopologyTransaction {
648
+ /** Assigned by the server. Useful for correlating logs.
649
+ Must be a valid LedgerString (as described in ``value.proto``).
650
+ Required **/
651
+ updateId: string;
652
+ /** The absolute offset. The details of this field are described in ``community/ledger-api/README.md``.
653
+ Required, it is a valid absolute offset (positive integer). **/
654
+ offset: number;
655
+ /** A valid synchronizer id.
656
+ Identifies the synchronizer that synchronized the topology transaction.
657
+ Required **/
658
+ synchronizerId: string;
659
+ /** The time at which the changes in the topology transaction become effective. There is a small delay between a
660
+ topology transaction being sequenced and the changes it contains becoming effective. Topology transactions appear
661
+ in order relative to a synchronizer based on their effective time rather than their sequencing time.
662
+ Required **/
663
+ recordTime?: string;
664
+ /** A non-empty list of topology events.
665
+ Required **/
666
+ events?: TopologyEvent[];
667
+ /** Optional; ledger API trace context
668
+
669
+ The trace context transported in this message corresponds to the trace context supplied
670
+ by the client application in a HTTP2 header of the original command submission.
671
+ We typically use a header to transfer this type of information. Here we use message
672
+ body, because it is used in gRPC streams which do not support per message headers.
673
+ This field will be populated with the trace context contained in the original submission.
674
+ If that was not provided, a unique ledger-api-server generated trace context will be used
675
+ instead. **/
676
+ traceContext?: TraceContext;
677
+ }
678
+ export interface TopologyEvent {
679
+ event: TopologyEventEvent;
680
+ }
681
+ export type TopologyEventEvent = Empty3 | ParticipantAuthorizationAdded | ParticipantAuthorizationChanged | ParticipantAuthorizationRevoked;
682
+ export type Empty3 = Record<string, any>;
683
+ export interface ParticipantAuthorizationAdded {
684
+ value: ParticipantAuthorizationAdded1;
685
+ }
686
+ export interface ParticipantAuthorizationAdded1 {
687
+ /** Required **/
688
+ partyId: string;
689
+ /** Required **/
690
+ participantId: string;
691
+ /** Required **/
692
+ participantPermission: 'PARTICIPANT_PERMISSION_UNSPECIFIED' | 'PARTICIPANT_PERMISSION_SUBMISSION' | 'PARTICIPANT_PERMISSION_CONFIRMATION' | 'PARTICIPANT_PERMISSION_OBSERVATION';
693
+ }
694
+ export interface ParticipantAuthorizationChanged {
695
+ value: ParticipantAuthorizationChanged1;
696
+ }
697
+ export interface ParticipantAuthorizationChanged1 {
698
+ /** Required **/
699
+ partyId: string;
700
+ /** Required **/
701
+ participantId: string;
702
+ /** Required **/
703
+ participantPermission: 'PARTICIPANT_PERMISSION_UNSPECIFIED' | 'PARTICIPANT_PERMISSION_SUBMISSION' | 'PARTICIPANT_PERMISSION_CONFIRMATION' | 'PARTICIPANT_PERMISSION_OBSERVATION';
704
+ }
705
+ export interface ParticipantAuthorizationRevoked {
706
+ value: ParticipantAuthorizationRevoked1;
707
+ }
708
+ export interface ParticipantAuthorizationRevoked1 {
709
+ /** Required **/
710
+ partyId: string;
711
+ /** Required **/
712
+ participantId: string;
713
+ }
714
+ export interface Transaction {
715
+ value: JsTransaction;
716
+ }
717
+ export interface JsTransaction {
718
+ /** Assigned by the server. Useful for correlating logs.
719
+ Must be a valid LedgerString (as described in ``value.proto``).
720
+ Required **/
721
+ updateId: string;
722
+ /** The ID of the command which resulted in this transaction. Missing for everyone except the submitting party.
723
+ Must be a valid LedgerString (as described in ``value.proto``).
724
+ Optional **/
725
+ commandId: string;
726
+ /** The workflow ID used in command submission.
727
+ Must be a valid LedgerString (as described in ``value.proto``).
728
+ Optional **/
729
+ workflowId: string;
730
+ /** Ledger effective time.
731
+ Required **/
732
+ effectiveAt: string;
733
+ /** The collection of events.
734
+ Contains:
735
+
736
+ - ``CreatedEvent`` or ``ArchivedEvent`` in case of ACS_DELTA transaction shape
737
+ - ``CreatedEvent`` or ``ExercisedEvent`` in case of LEDGER_EFFECTS transaction shape
738
+
739
+ Required **/
740
+ events?: Event[];
741
+ /** The absolute offset. The details of this field are described in ``community/ledger-api/README.md``.
742
+ Required, it is a valid absolute offset (positive integer). **/
743
+ offset: number;
744
+ /** A valid synchronizer id.
745
+ Identifies the synchronizer that synchronized the transaction.
746
+ Required **/
747
+ synchronizerId: string;
748
+ /** Optional; ledger API trace context
749
+
750
+ The trace context transported in this message corresponds to the trace context supplied
751
+ by the client application in a HTTP2 header of the original command submission.
752
+ We typically use a header to transfer this type of information. Here we use message
753
+ body, because it is used in gRPC streams which do not support per message headers.
754
+ This field will be populated with the trace context contained in the original submission.
755
+ If that was not provided, a unique ledger-api-server generated trace context will be used
756
+ instead. **/
757
+ traceContext?: TraceContext;
758
+ /** The time at which the transaction was recorded. The record time refers to the synchronizer
759
+ which synchronized the transaction.
760
+ Required **/
761
+ recordTime: string;
762
+ /** For transaction externally signed, contains the external transaction hash
763
+ signed by the external party. Can be used to correlate an external submission with a committed transaction.
764
+ Optional **/
765
+ externalTransactionHash?: string;
766
+ }
767
+ export type Event = ArchivedEvent | CreatedEvent | ExercisedEvent;
768
+ export interface ArchivedEvent {
769
+ /** The offset of origin.
770
+ Offsets are managed by the participant nodes.
771
+ Transactions can thus NOT be assumed to have the same offsets on different participant nodes.
772
+ Required, it is a valid absolute offset (positive integer) **/
773
+ offset: number;
774
+ /** The position of this event in the originating transaction or reassignment.
775
+ Node IDs are not necessarily equal across participants,
776
+ as these may see different projections/parts of transactions.
777
+ Required, must be valid node ID (non-negative integer) **/
778
+ nodeId: number;
779
+ /** The ID of the archived contract.
780
+ Must be a valid LedgerString (as described in ``value.proto``).
781
+ Required **/
782
+ contractId: string;
783
+ /** Identifies the template that defines the choice that archived the contract.
784
+ This template's package-id may differ from the target contract's package-id
785
+ if the target contract has been upgraded or downgraded.
786
+
787
+ The identifier uses the package-id reference format.
788
+
789
+ Required **/
790
+ templateId: string;
791
+ /** The parties that are notified of this event. For an ``ArchivedEvent``,
792
+ these are the intersection of the stakeholders of the contract in
793
+ question and the parties specified in the ``TransactionFilter``. The
794
+ stakeholders are the union of the signatories and the observers of
795
+ the contract.
796
+ Each one of its elements must be a valid PartyIdString (as described
797
+ in ``value.proto``).
798
+ Required **/
799
+ witnessParties?: string[];
800
+ /** The package name of the contract.
801
+ Required **/
802
+ packageName: string;
803
+ /** The interfaces implemented by the target template that have been
804
+ matched from the interface filter query.
805
+ Populated only in case interface filters with include_interface_view set.
806
+
807
+ If defined, the identifier uses the package-id reference format.
808
+
809
+ Optional **/
810
+ implementedInterfaces?: string[];
811
+ }
812
+ export interface ExercisedEvent {
813
+ /** The offset of origin.
814
+ Offsets are managed by the participant nodes.
815
+ Transactions can thus NOT be assumed to have the same offsets on different participant nodes.
816
+ Required, it is a valid absolute offset (positive integer) **/
817
+ offset: number;
818
+ /** The position of this event in the originating transaction or reassignment.
819
+ Node IDs are not necessarily equal across participants,
820
+ as these may see different projections/parts of transactions.
821
+ Required, must be valid node ID (non-negative integer) **/
822
+ nodeId: number;
823
+ /** The ID of the target contract.
824
+ Must be a valid LedgerString (as described in ``value.proto``).
825
+ Required **/
826
+ contractId: string;
827
+ /** Identifies the template that defines the executed choice.
828
+ This template's package-id may differ from the target contract's package-id
829
+ if the target contract has been upgraded or downgraded.
830
+
831
+ The identifier uses the package-id reference format.
832
+
833
+ Required **/
834
+ templateId: string;
835
+ /** The interface where the choice is defined, if inherited.
836
+ If defined, the identifier uses the package-id reference format.
837
+
838
+ Optional **/
839
+ interfaceId?: string;
840
+ /** The choice that was exercised on the target contract.
841
+ Must be a valid NameString (as described in ``value.proto``).
842
+ Required **/
843
+ choice: string;
844
+ /** The argument of the exercised choice.
845
+ Required **/
846
+ choiceArgument: undefined;
847
+ /** The parties that exercised the choice.
848
+ Each element must be a valid PartyIdString (as described in ``value.proto``).
849
+ Required **/
850
+ actingParties?: string[];
851
+ /** If true, the target contract may no longer be exercised.
852
+ Required **/
853
+ consuming: boolean;
854
+ /** The parties that are notified of this event. The witnesses of an exercise
855
+ node will depend on whether the exercise was consuming or not.
856
+ If consuming, the witnesses are the union of the stakeholders,
857
+ the actors and all informees of all the ancestors of this event this
858
+ participant knows about.
859
+ If not consuming, the witnesses are the union of the signatories,
860
+ the actors and all informees of all the ancestors of this event this
861
+ participant knows about.
862
+ In both cases the witnesses are limited to the querying parties, or not
863
+ limited in case anyParty filters are used.
864
+ Note that the actors might not necessarily be observers
865
+ and thus stakeholders. This is the case when the controllers of a
866
+ choice are specified using "flexible controllers", using the
867
+ ``choice ... controller`` syntax, and said controllers are not
868
+ explicitly marked as observers.
869
+ Each element must be a valid PartyIdString (as described in ``value.proto``).
870
+ Required **/
871
+ witnessParties?: string[];
872
+ /** Specifies the upper boundary of the node ids of the events in the same transaction that appeared as a result of
873
+ this ``ExercisedEvent``. This allows unambiguous identification of all the members of the subtree rooted at this
874
+ node. A full subtree can be constructed when all descendant nodes are present in the stream. If nodes are heavily
875
+ filtered, it is only possible to determine if a node is in a consequent subtree or not.
876
+ Required **/
877
+ lastDescendantNodeId: number;
878
+ /** The result of exercising the choice.
879
+ Required **/
880
+ exerciseResult: undefined;
881
+ /** The package name of the contract.
882
+ Required **/
883
+ packageName: string;
884
+ /** If the event is consuming, the interfaces implemented by the target template that have been
885
+ matched from the interface filter query.
886
+ Populated only in case interface filters with include_interface_view set.
887
+
888
+ The identifier uses the package-id reference format.
889
+
890
+ Optional **/
891
+ implementedInterfaces?: string[];
892
+ /** Whether this event would be part of respective ACS_DELTA shaped stream,
893
+ and should therefore considered when tracking contract activeness on the client-side.
894
+ Required **/
895
+ acsDelta: boolean;
896
+ }
897
+ export type Either_JsCantonError_JsGetUpdateTreesResponse = JsCantonError | JsGetUpdateTreesResponse;
898
+ export interface JsGetUpdateTreesResponse {
899
+ update: Update1;
900
+ }
901
+ export type Update1 = OffsetCheckpoint3 | Reassignment1 | TransactionTree;
902
+ export interface OffsetCheckpoint3 {
903
+ value: OffsetCheckpoint1;
904
+ }
905
+ export interface Reassignment1 {
906
+ value: JsReassignment;
907
+ }
908
+ export interface TransactionTree {
909
+ value: JsTransactionTree;
910
+ }
911
+ export interface JsTransactionTree {
912
+ /** Assigned by the server. Useful for correlating logs.
913
+ Must be a valid LedgerString (as described in ``value.proto``).
914
+ Required **/
915
+ updateId: string;
916
+ /** The ID of the command which resulted in this transaction. Missing for everyone except the submitting party.
917
+ Must be a valid LedgerString (as described in ``value.proto``).
918
+ Optional **/
919
+ commandId: string;
920
+ /** The workflow ID used in command submission. Only set if the ``workflow_id`` for the command was set.
921
+ Must be a valid LedgerString (as described in ``value.proto``).
922
+ Optional **/
923
+ workflowId: string;
924
+ /** Ledger effective time.
925
+ Required **/
926
+ effectiveAt?: string;
927
+ /** The absolute offset. The details of this field are described in ``community/ledger-api/README.md``.
928
+ Required, it is a valid absolute offset (positive integer). **/
929
+ offset: number;
930
+ /** Changes to the ledger that were caused by this transaction. Nodes of the transaction tree.
931
+ Each key must be a valid node ID (non-negative integer).
932
+ Required **/
933
+ eventsById: Map_Int_TreeEvent;
934
+ /** A valid synchronizer id.
935
+ Identifies the synchronizer that synchronized the transaction.
936
+ Required **/
937
+ synchronizerId: string;
938
+ /** Optional; ledger API trace context
939
+
940
+ The trace context transported in this message corresponds to the trace context supplied
941
+ by the client application in a HTTP2 header of the original command submission.
942
+ We typically use a header to transfer this type of information. Here we use message
943
+ body, because it is used in gRPC streams which do not support per message headers.
944
+ This field will be populated with the trace context contained in the original submission.
945
+ If that was not provided, a unique ledger-api-server generated trace context will be used
946
+ instead. **/
947
+ traceContext?: TraceContext;
948
+ /** The time at which the transaction was recorded. The record time refers to the synchronizer
949
+ which synchronized the transaction.
950
+ Required **/
951
+ recordTime: string;
952
+ }
953
+ export type Map_Int_TreeEvent = Record<string, TreeEvent>;
954
+ export type TreeEvent = CreatedTreeEvent | ExercisedTreeEvent;
955
+ export interface CreatedTreeEvent {
956
+ value: CreatedEvent;
957
+ }
958
+ export interface ExercisedTreeEvent {
959
+ value: ExercisedEvent;
960
+ }
961
+ export interface WebSocketChannels {
962
+ '/v2/commands/completions': {
963
+ subscribe: Either_JsCantonError_CompletionStreamResponse;
964
+ publish: CompletionStreamRequest;
965
+ };
966
+ '/v2/state/active-contracts': {
967
+ subscribe: Either_JsCantonError_JsGetActiveContractsResponse;
968
+ publish: GetActiveContractsRequest;
969
+ };
970
+ '/v2/updates': {
971
+ subscribe: Either_JsCantonError_JsGetUpdatesResponse;
972
+ publish: GetUpdatesRequest;
973
+ };
974
+ '/v2/updates/flats': {
975
+ subscribe: Either_JsCantonError_JsGetUpdatesResponse;
976
+ publish: GetUpdatesRequest;
977
+ };
978
+ '/v2/updates/trees': {
979
+ subscribe: Either_JsCantonError_JsGetUpdateTreesResponse;
980
+ publish: GetUpdatesRequest;
981
+ };
982
+ }
983
+ export declare const CHANNELS: {
984
+ v2_commands_completions: "/v2/commands/completions";
985
+ v2_state_active_contracts: "/v2/state/active-contracts";
986
+ v2_updates: "/v2/updates";
987
+ v2_updates_flats: "/v2/updates/flats";
988
+ v2_updates_trees: "/v2/updates/trees";
989
+ };
990
+ export declare const API_INFO: {
991
+ readonly title: "JSON Ledger API WebSocket endpoints";
992
+ readonly version: "3.4.7";
993
+ };
994
+ //# sourceMappingURL=asyncapi-3.4.7.d.ts.map