@fairmint/canton-node-sdk 0.0.34 → 0.0.36
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/build/src/clients/ledger-json-api/operations/v2/updates/get-transaction-tree-by-id.d.ts +16 -0
- package/build/src/clients/ledger-json-api/operations/v2/updates/get-transaction-tree-by-id.d.ts.map +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/updates/get-transaction-tree-by-id.js +31 -5
- package/build/src/clients/ledger-json-api/operations/v2/updates/get-transaction-tree-by-id.js.map +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/updates/get-update-by-id.d.ts +7 -5
- package/build/src/clients/ledger-json-api/operations/v2/updates/get-update-by-id.d.ts.map +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/updates/get-update-by-id.js +24 -2
- package/build/src/clients/ledger-json-api/operations/v2/updates/get-update-by-id.js.map +1 -1
- package/package.json +1 -1
package/build/src/clients/ledger-json-api/operations/v2/updates/get-transaction-tree-by-id.d.ts
CHANGED
|
@@ -4,19 +4,35 @@ declare const endpoint = "/v2/updates/transaction-tree-by-id/{update-id}";
|
|
|
4
4
|
export declare const GetTransactionTreeByIdParamsSchema: z.ZodObject<{
|
|
5
5
|
updateId: z.ZodString;
|
|
6
6
|
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
parties: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
7
8
|
}, "strip", z.ZodTypeAny, {
|
|
8
9
|
updateId: string;
|
|
10
|
+
parties?: string[] | undefined;
|
|
9
11
|
verbose?: boolean | undefined;
|
|
10
12
|
}, {
|
|
11
13
|
updateId: string;
|
|
14
|
+
parties?: string[] | undefined;
|
|
12
15
|
verbose?: boolean | undefined;
|
|
13
16
|
}>;
|
|
14
17
|
export type GetTransactionTreeByIdParams = z.infer<typeof GetTransactionTreeByIdParamsSchema>;
|
|
15
18
|
export type GetTransactionTreeByIdResponse = paths[typeof endpoint]['get']['responses']['200']['content']['application/json'];
|
|
19
|
+
/**
|
|
20
|
+
* @description Retrieves transaction tree data by update ID
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const transactionTree = await client.getTransactionTreeById({
|
|
24
|
+
* updateId: '1220d01cce13fa797bad7de3ea61e919b20dce545d41f05e026ec4b65f1a61c71215',
|
|
25
|
+
* parties: ['party1', 'party2']
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
* @param updateId - The update ID to retrieve transaction tree for
|
|
29
|
+
* @param parties - Optional array of party IDs to filter transactions by
|
|
30
|
+
*/
|
|
16
31
|
export declare const GetTransactionTreeById: {
|
|
17
32
|
new (client: import("../../../../../core").BaseClient): {
|
|
18
33
|
execute(params: {
|
|
19
34
|
updateId: string;
|
|
35
|
+
parties?: string[] | undefined;
|
|
20
36
|
verbose?: boolean | undefined;
|
|
21
37
|
}): Promise<{
|
|
22
38
|
transaction: import("../../../../../generated/openapi-types").components["schemas"]["JsTransactionTree"];
|
package/build/src/clients/ledger-json-api/operations/v2/updates/get-transaction-tree-by-id.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-transaction-tree-by-id.d.ts","sourceRoot":"","sources":["../../../../../../../src/clients/ledger-json-api/operations/v2/updates/get-transaction-tree-by-id.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAEpE,QAAA,MAAM,QAAQ,mDAAmD,CAAC;AAElE,eAAO,MAAM,kCAAkC
|
|
1
|
+
{"version":3,"file":"get-transaction-tree-by-id.d.ts","sourceRoot":"","sources":["../../../../../../../src/clients/ledger-json-api/operations/v2/updates/get-transaction-tree-by-id.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAEpE,QAAA,MAAM,QAAQ,mDAAmD,CAAC;AAElE,eAAO,MAAM,kCAAkC;;;;;;;;;;;;EAI7C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,MAAM,MAAM,8BAA8B,GAAG,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAE9H;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB;;;;;;;yBAiC672F,sEAAsB;;;;;;;;;;;;;CAAp/2F,CAAC"}
|
package/build/src/clients/ledger-json-api/operations/v2/updates/get-transaction-tree-by-id.js
CHANGED
|
@@ -7,15 +7,41 @@ const endpoint = '/v2/updates/transaction-tree-by-id/{update-id}';
|
|
|
7
7
|
exports.GetTransactionTreeByIdParamsSchema = zod_1.z.object({
|
|
8
8
|
updateId: zod_1.z.string(),
|
|
9
9
|
verbose: zod_1.z.boolean().optional(),
|
|
10
|
+
parties: zod_1.z.array(zod_1.z.string()).optional(),
|
|
10
11
|
});
|
|
12
|
+
/**
|
|
13
|
+
* @description Retrieves transaction tree data by update ID
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const transactionTree = await client.getTransactionTreeById({
|
|
17
|
+
* updateId: '1220d01cce13fa797bad7de3ea61e919b20dce545d41f05e026ec4b65f1a61c71215',
|
|
18
|
+
* parties: ['party1', 'party2']
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
* @param updateId - The update ID to retrieve transaction tree for
|
|
22
|
+
* @param parties - Optional array of party IDs to filter transactions by
|
|
23
|
+
*/
|
|
11
24
|
exports.GetTransactionTreeById = (0, core_1.createApiOperation)({
|
|
12
25
|
paramsSchema: exports.GetTransactionTreeByIdParamsSchema,
|
|
13
26
|
method: 'GET',
|
|
14
|
-
buildUrl: (params, apiUrl) => {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
27
|
+
buildUrl: (params, apiUrl, client) => {
|
|
28
|
+
const currentPartyId = client.getPartyId();
|
|
29
|
+
const readParties = Array.from(new Set([
|
|
30
|
+
currentPartyId,
|
|
31
|
+
...(params.parties || []),
|
|
32
|
+
]));
|
|
33
|
+
const baseUrl = `${apiUrl}${endpoint.replace('{update-id}', params.updateId)}`;
|
|
34
|
+
const queryParams = new URLSearchParams();
|
|
35
|
+
if (readParties.length > 0) {
|
|
36
|
+
readParties.forEach(party => {
|
|
37
|
+
queryParams.append('parties', party);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
if (params.verbose) {
|
|
41
|
+
queryParams.set('verbose', params.verbose.toString());
|
|
42
|
+
}
|
|
43
|
+
const queryString = queryParams.toString();
|
|
44
|
+
return queryString ? `${baseUrl}?${queryString}` : baseUrl;
|
|
19
45
|
},
|
|
20
46
|
});
|
|
21
47
|
//# sourceMappingURL=get-transaction-tree-by-id.js.map
|
package/build/src/clients/ledger-json-api/operations/v2/updates/get-transaction-tree-by-id.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-transaction-tree-by-id.js","sourceRoot":"","sources":["../../../../../../../src/clients/ledger-json-api/operations/v2/updates/get-transaction-tree-by-id.ts"],"names":[],"mappings":";;;AAAA,8CAAyD;AACzD,6BAAwB;AAGxB,MAAM,QAAQ,GAAG,gDAAgD,CAAC;AAErD,QAAA,kCAAkC,GAAG,OAAC,CAAC,MAAM,CAAC;IACzD,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"get-transaction-tree-by-id.js","sourceRoot":"","sources":["../../../../../../../src/clients/ledger-json-api/operations/v2/updates/get-transaction-tree-by-id.ts"],"names":[],"mappings":";;;AAA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xD,CAAC;QAED,MAAM,WAAW,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;QAC3C,OAAO,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IAC7D,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { paths } from '../../../../../generated/openapi-types';
|
|
3
3
|
declare const endpoint: "/v2/updates/update-by-id";
|
|
4
|
-
export type GetUpdateByIdParams =
|
|
4
|
+
export type GetUpdateByIdParams = {
|
|
5
|
+
/** The ID of the update to fetch. */
|
|
6
|
+
updateId: string;
|
|
7
|
+
/** Parties to read as (optional). */
|
|
8
|
+
readAs: string[];
|
|
9
|
+
};
|
|
5
10
|
export type GetUpdateByIdResponse = paths[typeof endpoint]['post']['responses']['200']['content']['application/json'];
|
|
6
11
|
export declare const GetUpdateById: {
|
|
7
12
|
new (client: import("../../../../../core").BaseClient): {
|
|
8
|
-
execute(params: {
|
|
9
|
-
updateId: string;
|
|
10
|
-
updateFormat?: import("../../../../../generated/openapi-types").components["schemas"]["UpdateFormat"];
|
|
11
|
-
}): Promise<{
|
|
13
|
+
execute(params: GetUpdateByIdParams): Promise<{
|
|
12
14
|
update: import("../../../../../generated/openapi-types").components["schemas"]["Update"];
|
|
13
15
|
}>;
|
|
14
16
|
client: import("../../../../../core").BaseClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-update-by-id.d.ts","sourceRoot":"","sources":["../../../../../../../src/clients/ledger-json-api/operations/v2/updates/get-update-by-id.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAEpE,QAAA,MAAM,QAAQ,EAAG,0BAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"get-update-by-id.d.ts","sourceRoot":"","sources":["../../../../../../../src/clients/ledger-json-api/operations/v2/updates/get-update-by-id.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAEpE,QAAA,MAAM,QAAQ,EAAG,0BAAmC,CAAC;AAGrD,MAAM,MAAM,mBAAmB,GAAG;IAChC,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAEtH,eAAO,MAAM,aAAa;;;oBA8Bs73F,sEAAsB;;;;;;;;;;;;;CAAp+3F,CAAC"}
|
|
@@ -5,9 +5,31 @@ const core_1 = require("../../../../../core");
|
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const endpoint = '/v2/updates/update-by-id';
|
|
7
7
|
exports.GetUpdateById = (0, core_1.createApiOperation)({
|
|
8
|
-
paramsSchema: zod_1.z.
|
|
8
|
+
paramsSchema: zod_1.z.object({
|
|
9
|
+
updateId: zod_1.z.string().min(1, 'updateId must be a non-empty string'),
|
|
10
|
+
readAs: zod_1.z.array(zod_1.z.string()),
|
|
11
|
+
}),
|
|
9
12
|
method: 'POST',
|
|
10
13
|
buildUrl: (_params, apiUrl) => `${apiUrl}${endpoint}`,
|
|
11
|
-
buildRequestData: (params) =>
|
|
14
|
+
buildRequestData: (params) => {
|
|
15
|
+
// Validate updateId parameter
|
|
16
|
+
if (!params.updateId || params.updateId === 'undefined' || params.updateId.trim() === '') {
|
|
17
|
+
throw new Error(`Invalid updateId: "${params.updateId}". updateId must be a non-empty string.`);
|
|
18
|
+
}
|
|
19
|
+
// Build the request body according to the API specification
|
|
20
|
+
return {
|
|
21
|
+
updateId: params.updateId,
|
|
22
|
+
updateFormat: {
|
|
23
|
+
includeTransactions: {
|
|
24
|
+
eventFormat: {
|
|
25
|
+
verbose: true,
|
|
26
|
+
},
|
|
27
|
+
transactionShape: 'TRANSACTION_SHAPE_UNSPECIFIED',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
// Include requestingParties if readAs is provided
|
|
31
|
+
...(params.readAs && params.readAs.length > 0 && { requestingParties: params.readAs }),
|
|
32
|
+
};
|
|
33
|
+
},
|
|
12
34
|
});
|
|
13
35
|
//# sourceMappingURL=get-update-by-id.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-update-by-id.js","sourceRoot":"","sources":["../../../../../../../src/clients/ledger-json-api/operations/v2/updates/get-update-by-id.ts"],"names":[],"mappings":";;;AAAA,8CAAyD;AACzD,6BAAwB;AAGxB,MAAM,QAAQ,GAAG,0BAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"get-update-by-id.js","sourceRoot":"","sources":["../../../../../../../src/clients/ledger-json-api/operations/v2/updates/get-update-by-id.ts"],"names":[],"mappings":";;;AAAA,8CAAyD;AACzD,6BAAwB;AAGxB,MAAM,QAAQ,GAAG,0BAAmC,CAAC;AAYxC,QAAA,aAAa,GAAG,IAAA,yBAAkB,EAA6C;IAC1F,YAAY,EAAE,OAAC,CAAC,MAAM,CAAC;QACrB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,qCAAqC,CAAC;QAClE,MAAM,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;KAC5B,CAAC;IACF,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,GAAG,MAAM,GAAG,QAAQ,EAAE;IACrD,gBAAgB,EAAE,CAAC,MAAM,EAAE,EAAE;QAC3B,8BAA8B;QAC9B,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,KAAK,WAAW,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACzF,MAAM,IAAI,KAAK,CACb,sBAAsB,MAAM,CAAC,QAAQ,yCAAyC,CAC/E,CAAC;QACJ,CAAC;QAED,4DAA4D;QAC5D,OAAO;YACL,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,YAAY,EAAE;gBACZ,mBAAmB,EAAE;oBACnB,WAAW,EAAE;wBACX,OAAO,EAAE,IAAI;qBACd;oBACD,gBAAgB,EAAE,+BAA+B;iBAClD;aACF;YACD,kDAAkD;YAClD,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;SACvF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|