@layerzerolabs/common-canton 0.2.108 → 0.2.109

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.
@@ -33,44 +33,8 @@ export declare const cantonDisclosedContractSchema: z.ZodObject<{
33
33
  createdEventBlob: z.ZodString;
34
34
  synchronizerId: z.ZodString;
35
35
  }, z.core.$strip>;
36
- /** Whose Active Contract Set a refresh entry is queried against:
37
- * - `'sender'`: the deferred register sender, resolved at sign time. Correct for
38
- * contracts the sender is a stakeholder of (e.g. its own amulet holdings).
39
- * - `{ party }`: an explicit stakeholder party known at build time. Needed for
40
- * contracts the sender cannot see — e.g. a signatory-controlled
41
- * RequestFactoryConfig, which only its handler (the signatory) is guaranteed
42
- * to have in its ACS. */
43
- export declare const refreshPartyFilterSchema: z.ZodUnion<readonly [z.ZodLiteral<"sender">, z.ZodObject<{
44
- party: z.ZodString;
45
- }, z.core.$strip>]>;
46
- /**
47
- * Declarative description of ledger contracts the building factory deferred to sign
48
- * time, resolved by a generic ledger-query refresh executor. (The amulet fee context is
49
- * refreshed automatically when a command carries its placeholder, so it isn't declared
50
- * here.)
51
- */
52
- export declare const cantonRefreshSpecSchema: z.ZodObject<{
53
- commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
54
- partyToFilter: z.ZodUnion<readonly [z.ZodLiteral<"sender">, z.ZodObject<{
55
- party: z.ZodString;
56
- }, z.core.$strip>]>;
57
- templateId: z.ZodString;
58
- placeholder: z.ZodString;
59
- multiple: z.ZodOptional<z.ZodBoolean>;
60
- }, z.core.$strip>>>;
61
- disclosedContracts: z.ZodOptional<z.ZodArray<z.ZodObject<{
62
- partyToFilter: z.ZodUnion<readonly [z.ZodLiteral<"sender">, z.ZodObject<{
63
- party: z.ZodString;
64
- }, z.core.$strip>]>;
65
- templateId: z.ZodString;
66
- }, z.core.$strip>>>;
67
- }, z.core.$strip>;
68
- export type CantonRefreshSpec = z.infer<typeof cantonRefreshSpecSchema>;
69
36
  /**
70
37
  * Canton transaction schema for Daml Ledger API commands.
71
- *
72
- * Canton uses an interactive submission (prepare-sign-submit) flow for external party signing.
73
- * The populatedTransaction contains the commands to send to prepareForSigning.
74
38
  */
75
39
  export declare const cantonTransactionSchema: z.ZodObject<{
76
40
  properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
@@ -85,8 +49,7 @@ export declare const cantonTransactionSchema: z.ZodObject<{
85
49
  type: z.ZodOptional<z.ZodString>;
86
50
  parallelizingKey: z.ZodOptional<z.ZodString>;
87
51
  populatedTransaction: z.ZodObject<{
88
- actAs: z.ZodArray<z.ZodString>;
89
- commands: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
52
+ unresolvedCommands: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
90
53
  createCommand: z.ZodObject<{
91
54
  templateId: z.ZodString;
92
55
  createArguments: z.ZodAny;
@@ -113,29 +76,14 @@ export declare const cantonTransactionSchema: z.ZodObject<{
113
76
  choiceArgument: z.ZodAny;
114
77
  }, z.core.$strip>;
115
78
  }, z.core.$strip>]>>;
116
- disclosedContracts: z.ZodArray<z.ZodObject<{
79
+ unresolvedDisclosedContracts: z.ZodArray<z.ZodObject<{
117
80
  templateId: z.ZodOptional<z.ZodString>;
118
81
  contractId: z.ZodString;
119
82
  createdEventBlob: z.ZodString;
120
83
  synchronizerId: z.ZodString;
121
84
  }, z.core.$strip>>;
85
+ actAs: z.ZodArray<z.ZodString>;
122
86
  partyToSenderEntity: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
123
- refreshSpec: z.ZodOptional<z.ZodObject<{
124
- commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
125
- partyToFilter: z.ZodUnion<readonly [z.ZodLiteral<"sender">, z.ZodObject<{
126
- party: z.ZodString;
127
- }, z.core.$strip>]>;
128
- templateId: z.ZodString;
129
- placeholder: z.ZodString;
130
- multiple: z.ZodOptional<z.ZodBoolean>;
131
- }, z.core.$strip>>>;
132
- disclosedContracts: z.ZodOptional<z.ZodArray<z.ZodObject<{
133
- partyToFilter: z.ZodUnion<readonly [z.ZodLiteral<"sender">, z.ZodObject<{
134
- party: z.ZodString;
135
- }, z.core.$strip>]>;
136
- templateId: z.ZodString;
137
- }, z.core.$strip>>>;
138
- }, z.core.$strip>>;
139
87
  }, z.core.$strip>;
140
88
  }, z.core.$strip>;
141
89
  /**
@@ -166,8 +114,7 @@ export declare const cantonAssignedTransactionSchema: z.ZodObject<{
166
114
  type: z.ZodOptional<z.ZodString>;
167
115
  parallelizingKey: z.ZodOptional<z.ZodString>;
168
116
  populatedTransaction: z.ZodObject<{
169
- actAs: z.ZodArray<z.ZodString>;
170
- commands: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
117
+ unresolvedCommands: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
171
118
  createCommand: z.ZodObject<{
172
119
  templateId: z.ZodString;
173
120
  createArguments: z.ZodAny;
@@ -194,35 +141,53 @@ export declare const cantonAssignedTransactionSchema: z.ZodObject<{
194
141
  choiceArgument: z.ZodAny;
195
142
  }, z.core.$strip>;
196
143
  }, z.core.$strip>]>>;
197
- disclosedContracts: z.ZodArray<z.ZodObject<{
144
+ unresolvedDisclosedContracts: z.ZodArray<z.ZodObject<{
198
145
  templateId: z.ZodOptional<z.ZodString>;
199
146
  contractId: z.ZodString;
200
147
  createdEventBlob: z.ZodString;
201
148
  synchronizerId: z.ZodString;
202
149
  }, z.core.$strip>>;
150
+ actAs: z.ZodArray<z.ZodString>;
203
151
  partyToSenderEntity: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
204
- refreshSpec: z.ZodOptional<z.ZodObject<{
205
- commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
206
- partyToFilter: z.ZodUnion<readonly [z.ZodLiteral<"sender">, z.ZodObject<{
207
- party: z.ZodString;
208
- }, z.core.$strip>]>;
209
- templateId: z.ZodString;
210
- placeholder: z.ZodString;
211
- multiple: z.ZodOptional<z.ZodBoolean>;
212
- }, z.core.$strip>>>;
213
- disclosedContracts: z.ZodOptional<z.ZodArray<z.ZodObject<{
214
- partyToFilter: z.ZodUnion<readonly [z.ZodLiteral<"sender">, z.ZodObject<{
215
- party: z.ZodString;
216
- }, z.core.$strip>]>;
217
- templateId: z.ZodString;
218
- }, z.core.$strip>>>;
219
- }, z.core.$strip>>;
220
152
  }, z.core.$strip>;
221
153
  }, z.core.$strip>;
222
154
  /**
223
155
  * Signed transaction includes the DER-encoded ECDSA signature.
224
156
  */
225
157
  export declare const cantonSignedTransactionSchema: z.ZodObject<{
158
+ commands: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
159
+ createCommand: z.ZodObject<{
160
+ templateId: z.ZodString;
161
+ createArguments: z.ZodAny;
162
+ }, z.core.$strip>;
163
+ }, z.core.$strip>, z.ZodObject<{
164
+ exerciseCommand: z.ZodObject<{
165
+ templateId: z.ZodString;
166
+ contractId: z.ZodString;
167
+ choice: z.ZodString;
168
+ choiceArgument: z.ZodAny;
169
+ }, z.core.$strip>;
170
+ }, z.core.$strip>, z.ZodObject<{
171
+ createAndExerciseCommand: z.ZodObject<{
172
+ templateId: z.ZodString;
173
+ createArguments: z.ZodAny;
174
+ choice: z.ZodString;
175
+ choiceArgument: z.ZodAny;
176
+ }, z.core.$strip>;
177
+ }, z.core.$strip>, z.ZodObject<{
178
+ exerciseByKeyCommand: z.ZodObject<{
179
+ templateId: z.ZodString;
180
+ contractKey: z.ZodAny;
181
+ choice: z.ZodString;
182
+ choiceArgument: z.ZodAny;
183
+ }, z.core.$strip>;
184
+ }, z.core.$strip>]>>;
185
+ disclosedContracts: z.ZodArray<z.ZodObject<{
186
+ templateId: z.ZodOptional<z.ZodString>;
187
+ contractId: z.ZodString;
188
+ createdEventBlob: z.ZodString;
189
+ synchronizerId: z.ZodString;
190
+ }, z.core.$strip>>;
226
191
  signedTransaction: z.ZodObject<{
227
192
  signatures: z.ZodArray<z.ZodObject<{
228
193
  party: z.ZodString;
@@ -258,8 +223,7 @@ export declare const cantonSignedTransactionSchema: z.ZodObject<{
258
223
  type: z.ZodOptional<z.ZodString>;
259
224
  parallelizingKey: z.ZodOptional<z.ZodString>;
260
225
  populatedTransaction: z.ZodObject<{
261
- actAs: z.ZodArray<z.ZodString>;
262
- commands: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
226
+ unresolvedCommands: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
263
227
  createCommand: z.ZodObject<{
264
228
  templateId: z.ZodString;
265
229
  createArguments: z.ZodAny;
@@ -286,38 +250,21 @@ export declare const cantonSignedTransactionSchema: z.ZodObject<{
286
250
  choiceArgument: z.ZodAny;
287
251
  }, z.core.$strip>;
288
252
  }, z.core.$strip>]>>;
289
- disclosedContracts: z.ZodArray<z.ZodObject<{
253
+ unresolvedDisclosedContracts: z.ZodArray<z.ZodObject<{
290
254
  templateId: z.ZodOptional<z.ZodString>;
291
255
  contractId: z.ZodString;
292
256
  createdEventBlob: z.ZodString;
293
257
  synchronizerId: z.ZodString;
294
258
  }, z.core.$strip>>;
259
+ actAs: z.ZodArray<z.ZodString>;
295
260
  partyToSenderEntity: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
296
- refreshSpec: z.ZodOptional<z.ZodObject<{
297
- commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
298
- partyToFilter: z.ZodUnion<readonly [z.ZodLiteral<"sender">, z.ZodObject<{
299
- party: z.ZodString;
300
- }, z.core.$strip>]>;
301
- templateId: z.ZodString;
302
- placeholder: z.ZodString;
303
- multiple: z.ZodOptional<z.ZodBoolean>;
304
- }, z.core.$strip>>>;
305
- disclosedContracts: z.ZodOptional<z.ZodArray<z.ZodObject<{
306
- partyToFilter: z.ZodUnion<readonly [z.ZodLiteral<"sender">, z.ZodObject<{
307
- party: z.ZodString;
308
- }, z.core.$strip>]>;
309
- templateId: z.ZodString;
310
- }, z.core.$strip>>>;
311
- }, z.core.$strip>>;
312
261
  }, z.core.$strip>;
313
262
  }, z.core.$strip>;
314
263
  /**
315
264
  * Mined transaction with confirmation result.
316
265
  */
317
266
  export declare const cantonMinedTransactionSchema: z.ZodObject<{
318
- result: z.ZodDiscriminatedUnion<[z.
319
- /** Template id to query. */
320
- ZodObject<{
267
+ result: z.ZodDiscriminatedUnion /** Hashing scheme version used */<[z.ZodObject<{
321
268
  type: z.ZodLiteral<"success">;
322
269
  minedTxHash: z.ZodString;
323
270
  }, z.core.$strip>, z.ZodObject<{
@@ -337,6 +284,39 @@ export declare const cantonMinedTransactionSchema: z.ZodObject<{
337
284
  commandId: z.ZodString;
338
285
  completionOffset: z.ZodOptional<z.ZodNumber>;
339
286
  }, z.core.$strip>;
287
+ commands: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
288
+ createCommand: z.ZodObject<{
289
+ templateId: z.ZodString;
290
+ createArguments: z.ZodAny;
291
+ }, z.core.$strip>;
292
+ }, z.core.$strip>, z.ZodObject<{
293
+ exerciseCommand: z.ZodObject<{
294
+ templateId: z.ZodString;
295
+ contractId: z.ZodString;
296
+ choice: z.ZodString;
297
+ choiceArgument: z.ZodAny;
298
+ }, z.core.$strip>;
299
+ }, z.core.$strip>, z.ZodObject<{
300
+ createAndExerciseCommand: z.ZodObject<{
301
+ templateId: z.ZodString;
302
+ createArguments: z.ZodAny;
303
+ choice: z.ZodString;
304
+ choiceArgument: z.ZodAny;
305
+ }, z.core.$strip>;
306
+ }, z.core.$strip>, z.ZodObject<{
307
+ exerciseByKeyCommand: z.ZodObject<{
308
+ templateId: z.ZodString;
309
+ contractKey: z.ZodAny;
310
+ choice: z.ZodString;
311
+ choiceArgument: z.ZodAny;
312
+ }, z.core.$strip>;
313
+ }, z.core.$strip>]>>;
314
+ disclosedContracts: z.ZodArray<z.ZodObject<{
315
+ templateId: z.ZodOptional<z.ZodString>;
316
+ contractId: z.ZodString;
317
+ createdEventBlob: z.ZodString;
318
+ synchronizerId: z.ZodString;
319
+ }, z.core.$strip>>;
340
320
  signedTransaction: z.ZodObject<{
341
321
  signatures: z.ZodArray<z.ZodObject<{
342
322
  party: z.ZodString;
@@ -362,8 +342,7 @@ export declare const cantonMinedTransactionSchema: z.ZodObject<{
362
342
  type: z.ZodOptional<z.ZodString>;
363
343
  parallelizingKey: z.ZodOptional<z.ZodString>;
364
344
  populatedTransaction: z.ZodObject<{
365
- actAs: z.ZodArray<z.ZodString>;
366
- commands: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
345
+ unresolvedCommands: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
367
346
  createCommand: z.ZodObject<{
368
347
  templateId: z.ZodString;
369
348
  createArguments: z.ZodAny;
@@ -390,29 +369,14 @@ export declare const cantonMinedTransactionSchema: z.ZodObject<{
390
369
  choiceArgument: z.ZodAny;
391
370
  }, z.core.$strip>;
392
371
  }, z.core.$strip>]>>;
393
- disclosedContracts: z.ZodArray<z.ZodObject<{
372
+ unresolvedDisclosedContracts: z.ZodArray<z.ZodObject<{
394
373
  templateId: z.ZodOptional<z.ZodString>;
395
374
  contractId: z.ZodString;
396
375
  createdEventBlob: z.ZodString;
397
376
  synchronizerId: z.ZodString;
398
377
  }, z.core.$strip>>;
378
+ actAs: z.ZodArray<z.ZodString>;
399
379
  partyToSenderEntity: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
400
- refreshSpec: z.ZodOptional<z.ZodObject<{
401
- commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
402
- partyToFilter: z.ZodUnion<readonly [z.ZodLiteral<"sender">, z.ZodObject<{
403
- party: z.ZodString;
404
- }, z.core.$strip>]>;
405
- templateId: z.ZodString;
406
- placeholder: z.ZodString;
407
- multiple: z.ZodOptional<z.ZodBoolean>;
408
- }, z.core.$strip>>>;
409
- disclosedContracts: z.ZodOptional<z.ZodArray<z.ZodObject<{
410
- partyToFilter: z.ZodUnion<readonly [z.ZodLiteral<"sender">, z.ZodObject<{
411
- party: z.ZodString;
412
- }, z.core.$strip>]>;
413
- templateId: z.ZodString;
414
- }, z.core.$strip>>>;
415
- }, z.core.$strip>>;
416
380
  }, z.core.$strip>;
417
381
  }, z.core.$strip>;
418
382
  export type CantonTx = z.infer<typeof cantonTransactionSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAiCjE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;mBAK9B,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;iBAKxC,CAAC;AAEH;;;;;;4BAM4B;AAC5B,eAAO,MAAM,wBAAwB;;mBAGnC,CAAC;AAWH;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;iBAgBlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAuBxE;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;gBApHjC,EAAG,WAAW,CAAC,EAAE,SAAS,CAAE,EAAC,SAAS,EAAC,EAAG,MAAM;eAE7C,EAAG,SAAS;gBAAiB,EAC/B,SAAI;iBACJ,EAAA,SAAO;uBAGX,EAAG,WAAW,CAAC,EAAE,SAAS;gBACtB,EAAE,WAAW,CAAC,EAAE,SACnB;cAAgB,EAAG,WACjB,CAAC,EAAE,SAAS;mBACH,EAAG,WAAW,CAAC,EAC3B,SAEI;OAAS,EAAG,IAAI,CAAC,MAAM;UAAY,EAAG,WACvC,CAAC,EAAE,SAAS;sBACJ,EAAG,WAAW,CAAC,EAAE,SACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsHL,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM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AS;gBACrB,EACL,SACH;iBACO,EAAA,SAAS;uBACL,EAAA,WAAO,CAAC,EAAE,SAAS;gBAClB,EAAG,WAAW,CAAC,EAAE,SAC3B;cAAiB,EAAE,WACrB,CAAW,EAAA,SAAC;mBAAqB,EAC1B,WAAG,CACP,EAAA,SACD;OAAS,EACJ,IAAJ,CAAI,MAAG;UAAY,EAAG,WAAW,CAAC,EAAE,SACpC;sBAAwB,EAAG,WACzB,CAAM,EAAA,SAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqGhB,CAAC;AAIH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC/D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAC/E,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAC3E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAIzE,MAAM,MAAM,2BAA2B,GAAG,SAAS,CAAC,QAAQ,EAAE,WAAW,GAAG,YAAY,CAAC,CAAC;AAE1F,eAAO,MAAM,sBAAsB,GAC/B,WAAW,MAAM,EACjB,IAAI,2BAA2B,KAChC,OAAO,CAAC,QAAQ,CAQlB,CAAC"}
@@ -1,4 +1,4 @@
1
- export { buildCantonTransaction, cantonAssignedTransactionSchema, cantonCommandSchema, cantonDisclosedContractSchema, cantonMinedTransactionSchema, cantonRefreshSpecSchema, cantonSignedTransactionSchema, cantonTransactionSchema, refreshPartyFilterSchema } from './ZYJRG5VO.js';
1
+ export { buildCantonTransaction, cantonAssignedTransactionSchema, cantonCommandSchema, cantonDisclosedContractSchema, cantonMinedTransactionSchema, cantonSignedTransactionSchema, cantonTransactionSchema } from './PSB6BQFH.js';
2
2
  import './VUOMXK5T.js';
3
3
  //# sourceMappingURL=transaction.js.map
4
4
  //# sourceMappingURL=transaction.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerzerolabs/common-canton",
3
- "version": "0.2.108",
3
+ "version": "0.2.109",
4
4
  "private": false,
5
5
  "description": "Canton VM client and utilities",
6
6
  "license": "MIT",
@@ -21,23 +21,23 @@
21
21
  "@protobuf-ts/grpc-transport": "^2.9.4",
22
22
  "es-toolkit": "^1.39.10",
23
23
  "zod": "4.3.5",
24
- "@layerzerolabs/common-chain-model": "0.2.108",
25
- "@layerzerolabs/common-error-utils": "0.2.108",
26
- "@layerzerolabs/typescript-utils": "0.2.108"
24
+ "@layerzerolabs/common-chain-model": "0.2.109",
25
+ "@layerzerolabs/common-error-utils": "0.2.109",
26
+ "@layerzerolabs/typescript-utils": "0.2.109"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/node": "^22.18.6",
30
- "@vitest/coverage-v8": "3.2.4",
30
+ "@vitest/coverage-v8": "3.2.6",
31
31
  "eslint": "9.39.1",
32
32
  "tsup": "^8.4.0",
33
33
  "typescript": "^5.8.2",
34
- "vitest": "^3.2.4",
35
- "@layerzerolabs/eslint-configuration": "^0.2.108",
36
- "@layerzerolabs/tsup-configuration": "0.2.108",
37
- "@layerzerolabs/typescript-configuration": "0.2.108",
38
- "@layerzerolabs/vitest-configuration": "0.2.108",
39
- "@layerzerolabs/ver-signer-adapter": "0.2.108",
40
- "@layerzerolabs/vm-tooling-canton": "0.2.108"
34
+ "vitest": "^3.2.6",
35
+ "@layerzerolabs/tsup-configuration": "0.2.109",
36
+ "@layerzerolabs/eslint-configuration": "^0.2.109",
37
+ "@layerzerolabs/typescript-configuration": "0.2.109",
38
+ "@layerzerolabs/ver-signer-adapter": "0.2.109",
39
+ "@layerzerolabs/vm-tooling-canton": "0.2.109",
40
+ "@layerzerolabs/vitest-configuration": "0.2.109"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "restricted",
@@ -0,0 +1,81 @@
1
+ import { z } from 'zod';
2
+
3
+ export const cantonRefreshPartyFilterSchema = z.union([
4
+ z.literal('sender'),
5
+ z.object({ party: z.string() }),
6
+ ]);
7
+
8
+ export const cantonDeferredValueSchema = z.discriminatedUnion('type', [
9
+ z.object({ type: z.literal('senderParty') }),
10
+ z.object({
11
+ type: z.literal('activeContractId'),
12
+ partyToFilter: cantonRefreshPartyFilterSchema,
13
+ templateId: z.string(),
14
+ contractStateFilter: z.partialRecord(z.string(), z.any()).optional(),
15
+ disclose: z.boolean().optional(),
16
+ }),
17
+ z.object({
18
+ type: z.literal('activeContractIds'),
19
+ partyToFilter: cantonRefreshPartyFilterSchema,
20
+ templateId: z.string(),
21
+ contractStateFilter: z.partialRecord(z.string(), z.any()).optional(),
22
+ disclose: z.boolean().optional(),
23
+ }),
24
+ z.object({ type: z.literal('amuletRulesCid') }),
25
+ z.object({ type: z.literal('amuletContext') }),
26
+ ]);
27
+
28
+ export type CantonRefreshPartyFilter = z.infer<typeof cantonRefreshPartyFilterSchema>;
29
+ export type CantonDeferredValue = z.infer<typeof cantonDeferredValueSchema>;
30
+ type CantonActiveContractIdRef = Omit<
31
+ Extract<CantonDeferredValue, { type: 'activeContractId' }>,
32
+ 'type'
33
+ >;
34
+ type CantonActiveContractIdsRef = Omit<
35
+ Extract<CantonDeferredValue, { type: 'activeContractIds' }>,
36
+ 'type'
37
+ >;
38
+
39
+ const CANTON_DEFERRED_VALUE_PREFIX = '<<CANTON_DEFERRED:';
40
+ const CANTON_DEFERRED_VALUE_SUFFIX = '>>';
41
+
42
+ export const encodeCantonDeferredValue = (value: CantonDeferredValue): string =>
43
+ `${CANTON_DEFERRED_VALUE_PREFIX}${JSON.stringify(value)}${CANTON_DEFERRED_VALUE_SUFFIX}`;
44
+
45
+ export const parseCantonDeferredValue = (value: unknown): CantonDeferredValue | undefined => {
46
+ if (
47
+ typeof value !== 'string' ||
48
+ !value.startsWith(CANTON_DEFERRED_VALUE_PREFIX) ||
49
+ !value.endsWith(CANTON_DEFERRED_VALUE_SUFFIX)
50
+ ) {
51
+ return undefined;
52
+ }
53
+
54
+ try {
55
+ const parsedJson = JSON.parse(
56
+ value.slice(CANTON_DEFERRED_VALUE_PREFIX.length, -CANTON_DEFERRED_VALUE_SUFFIX.length),
57
+ );
58
+ return cantonDeferredValueSchema.parse(parsedJson);
59
+ } catch {
60
+ return undefined;
61
+ }
62
+ };
63
+
64
+ export const cantonSenderPartyRef = (): string =>
65
+ encodeCantonDeferredValue({ type: 'senderParty' });
66
+
67
+ export const cantonActiveContractIdRef = (value: CantonActiveContractIdRef): string =>
68
+ encodeCantonDeferredValue({ type: 'activeContractId', ...value });
69
+
70
+ export const cantonActiveContractIdsRef = (value: CantonActiveContractIdsRef): string =>
71
+ encodeCantonDeferredValue({ type: 'activeContractIds', ...value });
72
+
73
+ export const cantonAmuletRulesCidRef = (): string =>
74
+ encodeCantonDeferredValue({ type: 'amuletRulesCid' });
75
+
76
+ export const cantonAmuletContextRef = (): string =>
77
+ encodeCantonDeferredValue({ type: 'amuletContext' });
78
+
79
+ /** Returns true if `value` is a Canton deferred-value sentinel. */
80
+ export const isCantonPlaceholder = (value: string): boolean =>
81
+ parseCantonDeferredValue(value) !== undefined;
package/src/events.ts CHANGED
@@ -59,18 +59,19 @@ export const findMatchingCreatedEventFromTx = async (
59
59
  client: ICantonClient,
60
60
  tx: unknown,
61
61
  ): Promise<CreatedEvent | null> => {
62
- if (!tx) return null;
63
-
64
62
  const parsed = cantonTxWithResultSchema.safeParse(tx);
65
63
  if (!parsed.success) return null;
64
+
66
65
  if (parsed.data.result.type !== 'success') return null;
67
66
 
68
- const { commands, actAs } = parsed.data.populatedTransaction;
67
+ const {
68
+ populatedTransaction: { actAs, unresolvedCommands },
69
+ } = parsed.data;
69
70
  const updateId = parsed.data.result.minedTxHash;
70
71
 
71
72
  if (!updateId || !actAs.length) return null;
72
73
 
73
- const createCommand = commands[0];
74
+ const createCommand = unresolvedCommands[0];
74
75
  if (!createCommand || !('createCommand' in createCommand)) return null;
75
76
 
76
77
  const createdEvents = await fetchCreatedEvents(client, updateId, actAs);
package/src/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export * from './auth';
2
+ export * from './deferredValue';
2
3
  export * from './events';
3
4
  export * from './provider';
4
- export * from './senderPlaceholder';
5
5
  export * from './transaction';
6
6
 
7
7
  // Core types