@canton-network/core-ledger-client 0.24.0 → 0.25.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"amulet-service.d.ts","sourceRoot":"","sources":["../src/amulet-service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,EACH,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACvB,MAAM,6BAA6B,CAAA;AAMpC;;;;;;GAMG;AACH,qBAAa,aAAa;IAElB,QAAQ,CAAC,aAAa,EAAE,oBAAoB;IAC5C,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAFlB,aAAa,EAAE,oBAAoB,EAC3B,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,GAAG,SAAS;IAGjD,6BAA6B,CAAC,OAAO,EAAE,OAAO;kBA2JlD,wFAAsB;;;IA9IlB,sBAAsB,CAAC,OAAO,EAAE,OAAO;;;;;;;IAavC,gBAAgB,CAClB,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,OAAO,EACjB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,CAAC,eAAe,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAkE5C,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;wBAiMsnlF,kFAAsB;;IAjLrslF,wBAAwB,CAC1B,eAAe,EAAE,OAAO,EACxB,cAAc,EAAE,MAAM,GACvB,OAAO,CAAC,CAAC,eAAe,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAsB5C,yBAAyB,CAC3B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,OAAO,GACf,OAAO,CAAC,CAAC,eAAe,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAU5C,wBAAwB,CAC1B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,OAAO,EACjB,cAAc,EAAE,OAAO,EACvB,YAAY,CAAC,EAAE,IAAI,EACnB,UAAU,CAAC,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,CAAC,eAAe,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAiE5C,SAAS,CACX,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,EAAE,0CAA0C;IACnE,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,CAAC,eAAe,EAAE,iBAAiB,EAAE,CAAC,CAAC;CA2DrD"}
1
+ {"version":3,"file":"amulet-service.d.ts","sourceRoot":"","sources":["../src/amulet-service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,EACH,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACvB,MAAM,6BAA6B,CAAA;AAMpC;;;;;;GAMG;AACH,qBAAa,aAAa;IAElB,QAAQ,CAAC,aAAa,EAAE,oBAAoB;IAC5C,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAFlB,aAAa,EAAE,oBAAoB,EAC3B,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,GAAG,SAAS;IAGjD,6BAA6B,CAAC,OAAO,EAAE,OAAO;kBA2JlD,wFAAsB;;;IA9IlB,sBAAsB,CAAC,OAAO,EAAE,OAAO;;;;;;;IAavC,gBAAgB,CAClB,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,OAAO,EACjB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,CAAC,eAAe,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAkE5C,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;wBAiM+/lF,kFAAsB;;IAjL9kmF,wBAAwB,CAC1B,eAAe,EAAE,OAAO,EACxB,cAAc,EAAE,MAAM,GACvB,OAAO,CAAC,CAAC,eAAe,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAsB5C,yBAAyB,CAC3B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,OAAO,GACf,OAAO,CAAC,CAAC,eAAe,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAU5C,wBAAwB,CAC1B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,OAAO,EACjB,cAAc,EAAE,OAAO,EACvB,YAAY,CAAC,EAAE,IAAI,EACnB,UAAU,CAAC,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,CAAC,eAAe,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAiE5C,SAAS,CACX,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,EAAE,0CAA0C;IACnE,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,CAAC,eAAe,EAAE,iBAAiB,EAAE,CAAC,CAAC;CA2DrD"}
package/dist/index.cjs CHANGED
@@ -50,93 +50,131 @@ var AllKnownMetaKeys = [
50
50
  ReasonMetaKey,
51
51
  BurnedMetaKey
52
52
  ];
53
- function EventFilterBySetup(interfaceNames, options = { includeWildcard: false, isMasterUser: false }) {
54
- const interfaceArrayed = Array.isArray(interfaceNames) ? interfaceNames : [interfaceNames];
55
- if (options.isMasterUser)
53
+ function createIdentiferFilter(type, id) {
54
+ if (type === "Template") {
56
55
  return {
57
- filtersByParty: {},
58
- filtersForAnyParty: filtersForAnyParty(
59
- interfaceArrayed,
60
- options.includeWildcard ?? false
61
- ) ?? {},
62
- verbose: options.verbose ?? false
56
+ identifierFilter: {
57
+ TemplateFilter: {
58
+ value: {
59
+ templateId: id,
60
+ includeCreatedEventBlob: true
61
+ }
62
+ }
63
+ }
63
64
  };
64
- else if (!options.partyId || options.partyId === void 0)
65
- throw new Error("Party must be provided for non-master users");
66
- else
65
+ } else {
67
66
  return {
68
- filtersByParty: filtersByParty(
69
- options.partyId,
70
- interfaceArrayed,
71
- options.includeWildcard ?? false
72
- ) ?? {},
73
- verbose: options.verbose ?? false
74
- };
75
- }
76
- function filtersByParty(party, interfaceNames, includeWildcard) {
77
- const wildcardFilter = includeWildcard ? [
78
- {
79
67
  identifierFilter: {
80
- WildcardFilter: {
68
+ InterfaceFilter: {
81
69
  value: {
70
+ interfaceId: id,
71
+ includeInterfaceView: true,
82
72
  includeCreatedEventBlob: true
83
73
  }
84
74
  }
85
75
  }
76
+ };
77
+ }
78
+ }
79
+ function createWildcardFilter() {
80
+ return {
81
+ identifierFilter: {
82
+ WildcardFilter: {
83
+ value: {
84
+ includeCreatedEventBlob: true
85
+ }
86
+ }
86
87
  }
87
- ] : [];
88
+ };
89
+ }
90
+ function buildCumulativeFilters(templateIds, interfaceIds, includeWildcard) {
91
+ if (templateIds.length > 0) {
92
+ return [
93
+ ...templateIds.map(
94
+ (templateId) => createIdentiferFilter("Template", templateId)
95
+ ),
96
+ ...includeWildcard ? [createWildcardFilter()] : []
97
+ ];
98
+ } else {
99
+ return [
100
+ ...interfaceIds.map(
101
+ (interfaceId) => createIdentiferFilter("Interface", interfaceId)
102
+ ),
103
+ ...includeWildcard ? [createWildcardFilter()] : []
104
+ ];
105
+ }
106
+ }
107
+ function buildFilter(templateIds, interfaceIds, options, additionalProps) {
108
+ const { isMasterUser = false, partyId, includeWildcard = false } = options;
109
+ if (isMasterUser) {
110
+ return {
111
+ filtersByParty: {},
112
+ filtersForAnyParty: filtersForAnyParty(
113
+ templateIds,
114
+ interfaceIds,
115
+ includeWildcard
116
+ ),
117
+ ...additionalProps
118
+ };
119
+ }
120
+ if (!partyId) {
121
+ throw new Error("Party must be provided for non-master users");
122
+ }
123
+ return {
124
+ filtersByParty: filtersByParty(
125
+ partyId,
126
+ templateIds,
127
+ interfaceIds,
128
+ includeWildcard
129
+ ),
130
+ ...additionalProps
131
+ };
132
+ }
133
+ function TransactionFilterBySetup(options) {
134
+ const { templateIds, interfaceIds, ...baseOptions } = options;
135
+ return buildFilter(
136
+ normalizeToArray(templateIds || []),
137
+ normalizeToArray(interfaceIds || []),
138
+ baseOptions
139
+ );
140
+ }
141
+ function EventFilterBySetup(options) {
142
+ const {
143
+ templateIds,
144
+ interfaceIds,
145
+ verbose = false,
146
+ ...baseOptions
147
+ } = options;
148
+ return buildFilter(
149
+ normalizeToArray(templateIds || []),
150
+ normalizeToArray(interfaceIds || []),
151
+ baseOptions,
152
+ { verbose }
153
+ );
154
+ }
155
+ function filtersByParty(party, templateIds, interfaceIds, includeWildcard) {
88
156
  return {
89
157
  [party]: {
90
- cumulative: [
91
- ...interfaceNames.map((interfaceName) => {
92
- return {
93
- identifierFilter: {
94
- InterfaceFilter: {
95
- value: {
96
- interfaceId: interfaceName,
97
- includeInterfaceView: true,
98
- includeCreatedEventBlob: true
99
- }
100
- }
101
- }
102
- };
103
- }),
104
- ...wildcardFilter
105
- ]
158
+ cumulative: buildCumulativeFilters(
159
+ templateIds,
160
+ interfaceIds,
161
+ includeWildcard
162
+ )
106
163
  }
107
164
  };
108
165
  }
109
- function filtersForAnyParty(interfaceNames, includeWildcard) {
110
- const wildcardFilter = includeWildcard ? [
111
- {
112
- identifierFilter: {
113
- WildcardFilter: {
114
- value: {
115
- includeCreatedEventBlob: true
116
- }
117
- }
118
- }
119
- }
120
- ] : [];
166
+ function filtersForAnyParty(interfaceNames, templateIds, includeWildcard) {
121
167
  return {
122
- cumulative: [
123
- ...interfaceNames.map((interfaceName) => {
124
- return {
125
- identifierFilter: {
126
- InterfaceFilter: {
127
- value: {
128
- interfaceId: interfaceName,
129
- includeInterfaceView: true,
130
- includeCreatedEventBlob: true
131
- }
132
- }
133
- }
134
- };
135
- }),
136
- ...wildcardFilter
137
- ]
168
+ cumulative: buildCumulativeFilters(
169
+ templateIds,
170
+ interfaceNames,
171
+ includeWildcard
172
+ )
138
173
  };
139
174
  }
175
+ function normalizeToArray(value) {
176
+ return Array.isArray(value) ? value : [value];
177
+ }
140
178
  function hasInterface(interfaceId, event) {
141
179
  return (event.implementedInterfaces || []).some(
142
180
  (id) => matchInterfaceIds(id, interfaceId)
@@ -985,14 +1023,15 @@ var TransactionParser = class {
985
1023
  }
986
1024
  const basePayload = {
987
1025
  contractId: archivedEvent.contractId,
988
- eventFormat: EventFilterBySetup(
989
- [coreTokenStandard.HOLDING_INTERFACE_ID, coreTokenStandard.TRANSFER_INSTRUCTION_INTERFACE_ID],
990
- {
991
- isMasterUser: this.isMasterUser,
992
- partyId: this.partyId,
993
- verbose: true
994
- }
995
- )
1026
+ eventFormat: EventFilterBySetup({
1027
+ interfaceIds: [
1028
+ coreTokenStandard.HOLDING_INTERFACE_ID,
1029
+ coreTokenStandard.TRANSFER_INSTRUCTION_INTERFACE_ID
1030
+ ],
1031
+ isMasterUser: this.isMasterUser,
1032
+ partyId: this.partyId,
1033
+ verbose: true
1034
+ })
996
1035
  };
997
1036
  const payload = this.ledgerClient.getCurrentClientVersion() === "3.3" ? { ...basePayload, requestingParties: [] } : basePayload;
998
1037
  const events = await this.ledgerClient.postWithRetry("/v2/events/events-by-contract-id", payload).catch((err) => {
@@ -1486,7 +1525,9 @@ var AllocationService = class {
1486
1525
  async fetchExecuteTransferChoiceContext(allocationId, registryUrl) {
1487
1526
  return this.core.getTokenStandardClient(registryUrl).post(
1488
1527
  "/registry/allocations/v1/{allocationId}/choice-contexts/execute-transfer",
1489
- {},
1528
+ {
1529
+ excludeDebugFields: true
1530
+ },
1490
1531
  {
1491
1532
  path: {
1492
1533
  allocationId
@@ -1521,7 +1562,9 @@ var AllocationService = class {
1521
1562
  async fetchWithdrawAllocationChoiceContext(allocationCid, registryUrl) {
1522
1563
  return this.core.getTokenStandardClient(registryUrl).post(
1523
1564
  "/registry/allocations/v1/{allocationId}/choice-contexts/withdraw",
1524
- {},
1565
+ {
1566
+ excludeDebugFields: true
1567
+ },
1525
1568
  { path: { allocationId: allocationCid } }
1526
1569
  );
1527
1570
  }
@@ -1552,7 +1595,9 @@ var AllocationService = class {
1552
1595
  async fetchCancelAllocationChoiceContext(allocationCid, registryUrl) {
1553
1596
  return this.core.getTokenStandardClient(registryUrl).post(
1554
1597
  "/registry/allocations/v1/{allocationId}/choice-contexts/cancel",
1555
- {},
1598
+ {
1599
+ excludeDebugFields: true
1600
+ },
1556
1601
  { path: { allocationId: allocationCid } }
1557
1602
  );
1558
1603
  }
@@ -1734,7 +1779,9 @@ var TransferService = class {
1734
1779
  const client = this.core.getTokenStandardClient(registryUrl);
1735
1780
  const choiceContext = await client.post(
1736
1781
  "/registry/transfer-instruction/v1/{transferInstructionId}/choice-contexts/accept",
1737
- {},
1782
+ {
1783
+ excludeDebugFields: true
1784
+ },
1738
1785
  {
1739
1786
  path: {
1740
1787
  transferInstructionId: transferInstructionCid
@@ -1867,7 +1914,9 @@ var TransferService = class {
1867
1914
  const client = this.core.getTokenStandardClient(registryUrl);
1868
1915
  const choiceContext = await client.post(
1869
1916
  "/registry/transfer-instruction/v1/{transferInstructionId}/choice-contexts/reject",
1870
- {},
1917
+ {
1918
+ excludeDebugFields: true
1919
+ },
1871
1920
  {
1872
1921
  path: {
1873
1922
  transferInstructionId: transferInstructionCid
@@ -1924,7 +1973,9 @@ var TransferService = class {
1924
1973
  const client = this.core.getTokenStandardClient(registryUrl);
1925
1974
  const choiceContext = await client.post(
1926
1975
  "/registry/transfer-instruction/v1/{transferInstructionId}/choice-contexts/withdraw",
1927
- {},
1976
+ {
1977
+ excludeDebugFields: true
1978
+ },
1928
1979
  {
1929
1980
  path: {
1930
1981
  transferInstructionId: transferInstructionCid
@@ -2074,14 +2125,12 @@ var TokenStandardService = class {
2074
2125
  const updatesResponse = await this.ledgerClient.postWithRetry("/v2/updates/flats", {
2075
2126
  updateFormat: {
2076
2127
  includeTransactions: {
2077
- eventFormat: EventFilterBySetup(
2078
- TokenStandardTransactionInterfaces,
2079
- {
2080
- includeWildcard: true,
2081
- isMasterUser: this.isMasterUser,
2082
- partyId
2083
- }
2084
- ),
2128
+ eventFormat: EventFilterBySetup({
2129
+ interfaceIds: TokenStandardTransactionInterfaces,
2130
+ isMasterUser: this.isMasterUser,
2131
+ partyId,
2132
+ includeWildcard: true
2133
+ }),
2085
2134
  transactionShape: "TRANSACTION_SHAPE_LEDGER_EFFECTS"
2086
2135
  }
2087
2136
  },
@@ -2101,14 +2150,12 @@ var TokenStandardService = class {
2101
2150
  }
2102
2151
  async getTransactionById(updateId, partyId) {
2103
2152
  const transactionFormat = {
2104
- eventFormat: EventFilterBySetup(
2105
- TokenStandardTransactionInterfaces,
2106
- {
2107
- includeWildcard: true,
2108
- isMasterUser: this.isMasterUser,
2109
- partyId
2110
- }
2111
- ),
2153
+ eventFormat: EventFilterBySetup({
2154
+ interfaceIds: TokenStandardTransactionInterfaces,
2155
+ isMasterUser: this.isMasterUser,
2156
+ partyId,
2157
+ includeWildcard: true
2158
+ }),
2112
2159
  transactionShape: "TRANSACTION_SHAPE_LEDGER_EFFECTS"
2113
2160
  };
2114
2161
  const getTransactionResponse = await this.ledgerClient.postWithRetry(
@@ -3330,18 +3377,11 @@ var LedgerClient = class {
3330
3377
  };
3331
3378
  this.logger.info(options, "active contract query options");
3332
3379
  if (options?.filterByParty && options.parties && options.parties.length > 0) {
3333
- if (options?.templateIds && !options?.interfaceIds) {
3334
- for (const party of options.parties) {
3335
- filter.filter.filtersByParty[party] = {
3336
- cumulative: options.templateIds ? buildTemplateFilter(options.templateIds) : []
3337
- };
3338
- }
3339
- } else if (options?.interfaceIds && !options?.templateIds) {
3340
- for (const party of options.parties) {
3341
- filter.filter.filtersByParty[party] = {
3342
- cumulative: options.interfaceIds ? buildInterfaceFilter(options.interfaceIds) : []
3343
- };
3344
- }
3380
+ const cumulativeFilter = options?.templateIds && !options?.interfaceIds ? buildTemplateFilter(options.templateIds) : options?.interfaceIds && !options?.templateIds ? buildInterfaceFilter(options.interfaceIds) : [];
3381
+ for (const party of options.parties) {
3382
+ filter.filter.filtersByParty[party] = {
3383
+ cumulative: cumulativeFilter
3384
+ };
3345
3385
  }
3346
3386
  } else if (options?.templateIds) {
3347
3387
  filter.filter.filtersForAnyParty = {
@@ -3453,6 +3493,118 @@ var WSSupportWithBackOffSwitch = class {
3453
3493
  }
3454
3494
  };
3455
3495
 
3496
+ // src/generated-clients/asyncapi-3.4.7.ts
3497
+ var CHANNELS = {
3498
+ v2_commands_completions: "/v2/commands/completions",
3499
+ v2_updates: "/v2/updates"};
3500
+
3501
+ // src/web-socket-client.ts
3502
+ var WebSocketClient = class {
3503
+ constructor({
3504
+ baseUrl,
3505
+ isAdmin,
3506
+ accessTokenProvider,
3507
+ logger,
3508
+ wsSupportBackOff
3509
+ }) {
3510
+ __publicField(this, "ws", null);
3511
+ __publicField(this, "baseUrl");
3512
+ __publicField(this, "token", "");
3513
+ __publicField(this, "isAdmin");
3514
+ __publicField(this, "protocol", []);
3515
+ __publicField(this, "logger");
3516
+ __publicField(this, "wsSupportBackOff");
3517
+ __publicField(this, "accessTokenProvider");
3518
+ this.logger = logger.child({ component: "WebSocketClient" });
3519
+ this.baseUrl = baseUrl;
3520
+ this.wsSupportBackOff = wsSupportBackOff;
3521
+ this.accessTokenProvider = accessTokenProvider;
3522
+ this.isAdmin = isAdmin ?? false;
3523
+ }
3524
+ async init() {
3525
+ this.token = this.isAdmin ? await this.accessTokenProvider.getAdminAccessToken() : await this.accessTokenProvider.getUserAccessToken();
3526
+ this.protocol = [`jwt.token.${this.token}`, "daml.ws.auth"];
3527
+ this.logger.info(
3528
+ `initializing websocket client with ${this.protocol.length} protocols`
3529
+ );
3530
+ }
3531
+ generate(wsUrl, request) {
3532
+ const messageQueue = [];
3533
+ let resolveNext = null;
3534
+ let isClosed = false;
3535
+ let streamError = null;
3536
+ const generator = async function* () {
3537
+ await this.init();
3538
+ this.logger.debug(request);
3539
+ const ws = new WebSocket(wsUrl, this.protocol);
3540
+ ws.onopen = () => {
3541
+ ws.send(JSON.stringify(request));
3542
+ };
3543
+ ws.onmessage = (event) => {
3544
+ messageQueue.push(JSON.parse(event.data));
3545
+ this.logger.debug(event.data, `Received event`);
3546
+ resolveNext?.();
3547
+ };
3548
+ ws.onerror = () => {
3549
+ streamError = new Error("WebSocket Handshake/Connection failed");
3550
+ this.logger.error(`Encountered ws.onError`);
3551
+ isClosed = true;
3552
+ resolveNext?.();
3553
+ };
3554
+ ws.onclose = (event) => {
3555
+ this.logger.debug(
3556
+ `CLOSING WEBSOCKET CONNECTION code: ${event.code}, reason: ${event.reason}`
3557
+ );
3558
+ isClosed = true;
3559
+ resolveNext?.();
3560
+ };
3561
+ try {
3562
+ while (true) {
3563
+ if (messageQueue.length === 0) {
3564
+ if (isClosed) break;
3565
+ await new Promise((r) => resolveNext = r);
3566
+ }
3567
+ if (streamError) throw streamError;
3568
+ while (messageQueue.length > 0) {
3569
+ yield messageQueue.shift();
3570
+ }
3571
+ if (isClosed && messageQueue.length === 0) break;
3572
+ }
3573
+ } finally {
3574
+ if (ws.readyState === WebSocket.OPEN) ws.close();
3575
+ this.logger.info("Generator cleanup: WebSocket closed.");
3576
+ }
3577
+ };
3578
+ return generator.call(this);
3579
+ }
3580
+ streamUpdates(options) {
3581
+ const wsUpdatesUrl = `${this.baseUrl}${CHANNELS.v2_updates}`;
3582
+ const filter = options.templateIds ? TransactionFilterBySetup({
3583
+ templateIds: options.templateIds,
3584
+ partyId: options.partyId
3585
+ }) : TransactionFilterBySetup({
3586
+ interfaceIds: options.interfaceIds,
3587
+ partyId: options.partyId
3588
+ });
3589
+ const request = {
3590
+ beginExclusive: options.beginExclusive,
3591
+ endInclusive: options.endInclusive,
3592
+ verbose: options.verbose ?? true,
3593
+ filter
3594
+ };
3595
+ return this.generate(wsUpdatesUrl, request);
3596
+ }
3597
+ streamCompletions(options) {
3598
+ const wsCompletionsUrl = `${this.baseUrl}${CHANNELS.v2_commands_completions}`;
3599
+ const request = {
3600
+ beginExclusive: options.beginExclusive,
3601
+ userId: options.userId,
3602
+ parties: options.parties
3603
+ };
3604
+ return this.generate(wsCompletionsUrl, request);
3605
+ }
3606
+ };
3607
+
3456
3608
  exports.ACSContainer = ACSContainer;
3457
3609
  exports.ACS_UPDATE_CONFIG = ACS_UPDATE_CONFIG;
3458
3610
  exports.AmuletService = AmuletService;
@@ -3462,6 +3614,7 @@ exports.TokenStandardService = TokenStandardService;
3462
3614
  exports.TokenStandardTransactionInterfaces = TokenStandardTransactionInterfaces;
3463
3615
  exports.TransactionParser = TransactionParser;
3464
3616
  exports.WSSupportWithBackOffSwitch = WSSupportWithBackOffSwitch;
3617
+ exports.WebSocketClient = WebSocketClient;
3465
3618
  exports.asJsCantonError = asJsCantonError;
3466
3619
  exports.awaitCompletion = awaitCompletion;
3467
3620
  exports.defaultRetryableOptions = defaultRetryableOptions;