@canton-network/core-ledger-client 0.7.0 → 0.9.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.
@@ -469,15 +469,18 @@ export class TransactionParser {
469
469
  if (!(archivedEvent.witnessParties || []).includes(this.partyId)) {
470
470
  return null;
471
471
  }
472
- const events = await this.ledgerClient
473
- .post('/v2/events/events-by-contract-id', {
472
+ const basePayload = {
474
473
  contractId: archivedEvent.contractId,
475
474
  eventFormat: {
476
475
  filtersByParty: filtersByParty(this.partyId, [HoldingInterface, TransferInstructionInterface], true),
477
476
  verbose: false,
478
477
  },
479
- requestingParties: [],
480
- })
478
+ };
479
+ const payload = this.ledgerClient.getCurrentClientVersion() === '3.3'
480
+ ? { ...basePayload, requestingParties: [] }
481
+ : basePayload;
482
+ const events = await this.ledgerClient
483
+ .post('/v2/events/events-by-contract-id', payload)
481
484
  .catch((err) => {
482
485
  // This will happen for holdings with consuming choices
483
486
  // where the party the script is running on is an actor on the choice
@@ -12,6 +12,7 @@ const makeLedgerClientFromEventsResponses = (responses) => {
12
12
  response.created.createdEvent.contractId,
13
13
  response,
14
14
  ]));
15
+ const getCurrentClientVersion = jest.fn(() => '3.3');
15
16
  const post = jest.fn(async (url, body) => {
16
17
  if (url !== EVENTS_BY_CID_PATH) {
17
18
  throw new Error(`Unexpected URL in mock LedgerClient: ${url}`);
@@ -24,7 +25,7 @@ const makeLedgerClientFromEventsResponses = (responses) => {
24
25
  }
25
26
  return entry;
26
27
  });
27
- return { post };
28
+ return { post, getCurrentClientVersion };
28
29
  };
29
30
  const mockLedgerClient = makeLedgerClientFromEventsResponses(eventsByContractIdResponses);
30
31
  describe('TransactionParser', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canton-network/core-ledger-client",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "description": "Provides a TypeScript Canton Network ledger client, generated by the OpenAPI spec",
6
6
  "repository": "github:hyperledger-labs/splice-wallet-kernel",
@@ -28,10 +28,10 @@
28
28
  "typescript": "^5.8.3"
29
29
  },
30
30
  "dependencies": {
31
- "@canton-network/core-ledger-proto": "^0.3.1",
32
- "@canton-network/core-splice-client": "^0.5.1",
33
- "@canton-network/core-token-standard": "^0.4.2",
34
- "@canton-network/core-types": "^0.3.2",
31
+ "@canton-network/core-ledger-proto": "^0.5.0",
32
+ "@canton-network/core-splice-client": "^0.6.0",
33
+ "@canton-network/core-token-standard": "^0.5.0",
34
+ "@canton-network/core-types": "^0.4.0",
35
35
  "@grpc/grpc-js": "^1.13.4",
36
36
  "@protobuf-ts/grpc-transport": "^2.11.1",
37
37
  "@protobuf-ts/runtime": "^2.11.1",