@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.
- package/dist/generated-clients/openapi-3.4.0-SNAPSHOT.d.ts +5563 -0
- package/dist/generated-clients/openapi-3.4.0-SNAPSHOT.d.ts.map +1 -0
- package/dist/generated-clients/openapi-3.4.0-SNAPSHOT.js +5 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/ledger-api-utils.d.ts.map +1 -1
- package/dist/ledger-api-utils.js +28 -29
- package/dist/ledger-client.d.ts +22 -12
- package/dist/ledger-client.d.ts.map +1 -1
- package/dist/ledger-client.js +70 -26
- package/dist/token-standard-service.d.ts +16 -3
- package/dist/token-standard-service.d.ts.map +1 -1
- package/dist/token-standard-service.js +50 -1
- package/dist/txparse/parser.d.ts.map +1 -1
- package/dist/txparse/parser.js +7 -4
- package/dist/txparse/parser.test.js +2 -1
- package/package.json +5 -5
package/dist/txparse/parser.js
CHANGED
|
@@ -469,15 +469,18 @@ export class TransactionParser {
|
|
|
469
469
|
if (!(archivedEvent.witnessParties || []).includes(this.partyId)) {
|
|
470
470
|
return null;
|
|
471
471
|
}
|
|
472
|
-
const
|
|
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
|
-
|
|
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.
|
|
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.
|
|
32
|
-
"@canton-network/core-splice-client": "^0.
|
|
33
|
-
"@canton-network/core-token-standard": "^0.
|
|
34
|
-
"@canton-network/core-types": "^0.
|
|
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",
|