@fairmint/canton-node-sdk 0.0.80 → 0.0.81
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/utils/index.d.ts +1 -0
- package/build/src/utils/index.d.ts.map +1 -1
- package/build/src/utils/index.js +1 -0
- package/build/src/utils/index.js.map +1 -1
- package/build/src/utils/transactions/find-created-event.d.ts +12 -0
- package/build/src/utils/transactions/find-created-event.d.ts.map +1 -0
- package/build/src/utils/transactions/find-created-event.js +32 -0
- package/build/src/utils/transactions/find-created-event.js.map +1 -0
- package/build/src/utils/transactions/index.d.ts +2 -0
- package/build/src/utils/transactions/index.d.ts.map +1 -0
- package/build/src/utils/transactions/index.js +18 -0
- package/build/src/utils/transactions/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC"}
|
package/build/src/utils/index.js
CHANGED
|
@@ -19,4 +19,5 @@ __exportStar(require("./contracts"), exports);
|
|
|
19
19
|
__exportStar(require("./mining"), exports);
|
|
20
20
|
__exportStar(require("./amulet"), exports);
|
|
21
21
|
__exportStar(require("./party"), exports);
|
|
22
|
+
__exportStar(require("./transactions"), exports);
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,iDAA+B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SubmitAndWaitForTransactionTreeResponse } from '../../clients/ledger-json-api/operations/v2/commands/submit-and-wait-for-transaction-tree';
|
|
2
|
+
import type { CreatedTreeEvent } from '../../clients/ledger-json-api/schemas/api/events';
|
|
3
|
+
/**
|
|
4
|
+
* Finds a CreatedTreeEvent for a given template name from a transaction tree response.
|
|
5
|
+
* The template name search excludes the templateId prefix and matches the template name portion.
|
|
6
|
+
*
|
|
7
|
+
* @param response - The SubmitAndWaitForTransactionTreeResponse containing the transaction tree
|
|
8
|
+
* @param templateName - The template name to search for (e.g., "Splice.Amulet:FeaturedAppActivityMarker")
|
|
9
|
+
* @returns The CreatedTreeEvent if found, undefined otherwise
|
|
10
|
+
*/
|
|
11
|
+
export declare function findCreatedEventByTemplateName(response: SubmitAndWaitForTransactionTreeResponse, templateName: string): CreatedTreeEvent | undefined;
|
|
12
|
+
//# sourceMappingURL=find-created-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-created-event.d.ts","sourceRoot":"","sources":["../../../../src/utils/transactions/find-created-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,2FAA2F,CAAC;AACzJ,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AAEzF;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,uCAAuC,EACjD,YAAY,EAAE,MAAM,GACnB,gBAAgB,GAAG,SAAS,CAwB9B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findCreatedEventByTemplateName = findCreatedEventByTemplateName;
|
|
4
|
+
/**
|
|
5
|
+
* Finds a CreatedTreeEvent for a given template name from a transaction tree response.
|
|
6
|
+
* The template name search excludes the templateId prefix and matches the template name portion.
|
|
7
|
+
*
|
|
8
|
+
* @param response - The SubmitAndWaitForTransactionTreeResponse containing the transaction tree
|
|
9
|
+
* @param templateName - The template name to search for (e.g., "Splice.Amulet:FeaturedAppActivityMarker")
|
|
10
|
+
* @returns The CreatedTreeEvent if found, undefined otherwise
|
|
11
|
+
*/
|
|
12
|
+
function findCreatedEventByTemplateName(response, templateName) {
|
|
13
|
+
const transactionTree = response.transactionTree;
|
|
14
|
+
if (!transactionTree || !transactionTree.eventsById) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
// Iterate through all events in the transaction tree
|
|
18
|
+
for (const event of Object.values(transactionTree.eventsById)) {
|
|
19
|
+
// Check if this is a CreatedTreeEvent
|
|
20
|
+
if ('CreatedTreeEvent' in event) {
|
|
21
|
+
const createdEvent = event.CreatedTreeEvent.value;
|
|
22
|
+
const fullTemplateId = createdEvent.templateId;
|
|
23
|
+
// Extract the template name part (after the last colon)
|
|
24
|
+
const templateNamePart = fullTemplateId.split(':').pop();
|
|
25
|
+
if (templateNamePart === templateName) {
|
|
26
|
+
return event;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=find-created-event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-created-event.js","sourceRoot":"","sources":["../../../../src/utils/transactions/find-created-event.ts"],"names":[],"mappings":";;AAWA,wEA2BC;AAnCD;;;;;;;GAOG;AACH,SAAgB,8BAA8B,CAC5C,QAAiD,EACjD,YAAoB;IAEpB,MAAM,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC;IAEjD,IAAI,CAAC,eAAe,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;QACpD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,qDAAqD;IACrD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9D,sCAAsC;QACtC,IAAI,kBAAkB,IAAI,KAAK,EAAE,CAAC;YAChC,MAAM,YAAY,GAAG,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC;YAClD,MAAM,cAAc,GAAG,YAAY,CAAC,UAAU,CAAC;YAE/C,wDAAwD;YACxD,MAAM,gBAAgB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;YAEzD,IAAI,gBAAgB,KAAK,YAAY,EAAE,CAAC;gBACtC,OAAO,KAAoC,CAAC;YAC9C,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/transactions/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./find-created-event"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/transactions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC"}
|