@hyperscale0/hsx 1.0.251 → 1.0.258
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/src/compile.d.ts.map +1 -1
- package/dist/src/compile.js +10 -1
- package/dist/src/compile.js.map +1 -1
- package/examples/cost-table.json +0 -492
- package/package.json +4 -4
- package/src/compile.ts +20 -0
package/examples/cost-table.json
CHANGED
|
@@ -162,497 +162,5 @@
|
|
|
162
162
|
}
|
|
163
163
|
],
|
|
164
164
|
"version": "2026-09-27.1"
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"currency": "USD",
|
|
168
|
-
"declaredMeters": [
|
|
169
|
-
"account.active_month",
|
|
170
|
-
"instrument.event.count",
|
|
171
|
-
"transfer.internal.count"
|
|
172
|
-
],
|
|
173
|
-
"effectiveTableDigest": "f2845819ad077745ed5d0af924b33f34210b20da703522e78aa2629d9be5040e",
|
|
174
|
-
"fixed": {
|
|
175
|
-
"activationBaseMinor": "133300",
|
|
176
|
-
"activationPerPointMinor": "2700",
|
|
177
|
-
"monthlyBaseMinor": "26700",
|
|
178
|
-
"monthlyPerPointMinor": "500",
|
|
179
|
-
"weights": {
|
|
180
|
-
"aggregate_invariant": 2,
|
|
181
|
-
"flow": 1,
|
|
182
|
-
"gate": 1,
|
|
183
|
-
"instrument": 3,
|
|
184
|
-
"move": 3,
|
|
185
|
-
"provider_decision": 5,
|
|
186
|
-
"timer": 1,
|
|
187
|
-
"unwind": 4
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
"rows": [
|
|
191
|
-
{
|
|
192
|
-
"bps": 0,
|
|
193
|
-
"meter": "instrument.event.count",
|
|
194
|
-
"payer": "product",
|
|
195
|
-
"perEventMinor": "0",
|
|
196
|
-
"settlement": "invoice",
|
|
197
|
-
"signature": "calculate"
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
"bps": 0,
|
|
201
|
-
"meter": "instrument.event.count",
|
|
202
|
-
"payer": "product",
|
|
203
|
-
"perEventMinor": "0",
|
|
204
|
-
"settlement": "invoice",
|
|
205
|
-
"signature": "clock.deadline"
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
"bps": 0,
|
|
209
|
-
"meter": "instrument.event.count",
|
|
210
|
-
"payer": "product",
|
|
211
|
-
"perEventMinor": "0",
|
|
212
|
-
"settlement": "invoice",
|
|
213
|
-
"signature": "clock.due"
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
"bps": 0,
|
|
217
|
-
"meter": "instrument.event.count",
|
|
218
|
-
"payer": "product",
|
|
219
|
-
"perEventMinor": "0",
|
|
220
|
-
"settlement": "invoice",
|
|
221
|
-
"signature": "holds.reserve"
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
"bps": 0,
|
|
225
|
-
"meter": "instrument.event.count",
|
|
226
|
-
"payer": "product",
|
|
227
|
-
"perEventMinor": "0",
|
|
228
|
-
"settlement": "invoice",
|
|
229
|
-
"signature": "invoke"
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
"bps": 0,
|
|
233
|
-
"meter": "account.active_month",
|
|
234
|
-
"payer": "product",
|
|
235
|
-
"perEventMinor": "133",
|
|
236
|
-
"settlement": "invoice",
|
|
237
|
-
"signature": "meters.account.active_month"
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
"bps": 0,
|
|
241
|
-
"meter": "instrument.event.count",
|
|
242
|
-
"payer": "product",
|
|
243
|
-
"perEventMinor": "7",
|
|
244
|
-
"settlement": "invoice",
|
|
245
|
-
"signature": "meters.instrument.event.count"
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
"bps": 0,
|
|
249
|
-
"meter": "transfer.internal.count",
|
|
250
|
-
"payer": "product",
|
|
251
|
-
"perEventMinor": "7",
|
|
252
|
-
"settlement": "invoice",
|
|
253
|
-
"signature": "meters.transfer.internal.count"
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
"bps": 0,
|
|
257
|
-
"meter": "instrument.event.count",
|
|
258
|
-
"payer": "product",
|
|
259
|
-
"perEventMinor": "0",
|
|
260
|
-
"settlement": "invoice",
|
|
261
|
-
"signature": "moves.transfer.internal"
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
"bps": 0,
|
|
265
|
-
"meter": "instrument.event.count",
|
|
266
|
-
"payer": "product",
|
|
267
|
-
"perEventMinor": "0",
|
|
268
|
-
"settlement": "invoice",
|
|
269
|
-
"signature": "reminder.email"
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
"bps": 0,
|
|
273
|
-
"meter": "instrument.event.count",
|
|
274
|
-
"payer": "product",
|
|
275
|
-
"perEventMinor": "0",
|
|
276
|
-
"settlement": "invoice",
|
|
277
|
-
"signature": "requires.aggregate"
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
"bps": 0,
|
|
281
|
-
"meter": "instrument.event.count",
|
|
282
|
-
"payer": "product",
|
|
283
|
-
"perEventMinor": "0",
|
|
284
|
-
"settlement": "invoice",
|
|
285
|
-
"signature": "requires.compare"
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
"bps": 0,
|
|
289
|
-
"meter": "instrument.event.count",
|
|
290
|
-
"payer": "product",
|
|
291
|
-
"perEventMinor": "0",
|
|
292
|
-
"settlement": "invoice",
|
|
293
|
-
"signature": "requires.evidence"
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
"bps": 0,
|
|
297
|
-
"meter": "instrument.event.count",
|
|
298
|
-
"payer": "product",
|
|
299
|
-
"perEventMinor": "0",
|
|
300
|
-
"settlement": "invoice",
|
|
301
|
-
"signature": "requires.hours"
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
"bps": 0,
|
|
305
|
-
"meter": "instrument.event.count",
|
|
306
|
-
"payer": "product",
|
|
307
|
-
"perEventMinor": "0",
|
|
308
|
-
"settlement": "invoice",
|
|
309
|
-
"signature": "requires.state"
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
"bps": 0,
|
|
313
|
-
"meter": "instrument.event.count",
|
|
314
|
-
"payer": "product",
|
|
315
|
-
"perEventMinor": "0",
|
|
316
|
-
"settlement": "invoice",
|
|
317
|
-
"signature": "requires.unique"
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
"bps": 0,
|
|
321
|
-
"meter": "instrument.event.count",
|
|
322
|
-
"payer": "product",
|
|
323
|
-
"perEventMinor": "0",
|
|
324
|
-
"settlement": "invoice",
|
|
325
|
-
"signature": "unwinds.void"
|
|
326
|
-
}
|
|
327
|
-
],
|
|
328
|
-
"version": "2026-09-27.1"
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
"currency": "EUR",
|
|
332
|
-
"declaredMeters": [
|
|
333
|
-
"account.active_month",
|
|
334
|
-
"instrument.event.count",
|
|
335
|
-
"transfer.internal.count"
|
|
336
|
-
],
|
|
337
|
-
"effectiveTableDigest": "f741132e1aa38a860d855a83f20f12c0ec8a7ec5379117c407799e2012e63335",
|
|
338
|
-
"fixed": {
|
|
339
|
-
"activationBaseMinor": "125000",
|
|
340
|
-
"activationPerPointMinor": "2500",
|
|
341
|
-
"monthlyBaseMinor": "25000",
|
|
342
|
-
"monthlyPerPointMinor": "500",
|
|
343
|
-
"weights": {
|
|
344
|
-
"aggregate_invariant": 2,
|
|
345
|
-
"flow": 1,
|
|
346
|
-
"gate": 1,
|
|
347
|
-
"instrument": 3,
|
|
348
|
-
"move": 3,
|
|
349
|
-
"provider_decision": 5,
|
|
350
|
-
"timer": 1,
|
|
351
|
-
"unwind": 4
|
|
352
|
-
}
|
|
353
|
-
},
|
|
354
|
-
"rows": [
|
|
355
|
-
{
|
|
356
|
-
"bps": 0,
|
|
357
|
-
"meter": "instrument.event.count",
|
|
358
|
-
"payer": "product",
|
|
359
|
-
"perEventMinor": "0",
|
|
360
|
-
"settlement": "invoice",
|
|
361
|
-
"signature": "calculate"
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
"bps": 0,
|
|
365
|
-
"meter": "instrument.event.count",
|
|
366
|
-
"payer": "product",
|
|
367
|
-
"perEventMinor": "0",
|
|
368
|
-
"settlement": "invoice",
|
|
369
|
-
"signature": "clock.deadline"
|
|
370
|
-
},
|
|
371
|
-
{
|
|
372
|
-
"bps": 0,
|
|
373
|
-
"meter": "instrument.event.count",
|
|
374
|
-
"payer": "product",
|
|
375
|
-
"perEventMinor": "0",
|
|
376
|
-
"settlement": "invoice",
|
|
377
|
-
"signature": "clock.due"
|
|
378
|
-
},
|
|
379
|
-
{
|
|
380
|
-
"bps": 0,
|
|
381
|
-
"meter": "instrument.event.count",
|
|
382
|
-
"payer": "product",
|
|
383
|
-
"perEventMinor": "0",
|
|
384
|
-
"settlement": "invoice",
|
|
385
|
-
"signature": "holds.reserve"
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
"bps": 0,
|
|
389
|
-
"meter": "instrument.event.count",
|
|
390
|
-
"payer": "product",
|
|
391
|
-
"perEventMinor": "0",
|
|
392
|
-
"settlement": "invoice",
|
|
393
|
-
"signature": "invoke"
|
|
394
|
-
},
|
|
395
|
-
{
|
|
396
|
-
"bps": 0,
|
|
397
|
-
"meter": "account.active_month",
|
|
398
|
-
"payer": "product",
|
|
399
|
-
"perEventMinor": "125",
|
|
400
|
-
"settlement": "invoice",
|
|
401
|
-
"signature": "meters.account.active_month"
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
"bps": 0,
|
|
405
|
-
"meter": "instrument.event.count",
|
|
406
|
-
"payer": "product",
|
|
407
|
-
"perEventMinor": "6",
|
|
408
|
-
"settlement": "invoice",
|
|
409
|
-
"signature": "meters.instrument.event.count"
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
"bps": 0,
|
|
413
|
-
"meter": "transfer.internal.count",
|
|
414
|
-
"payer": "product",
|
|
415
|
-
"perEventMinor": "6",
|
|
416
|
-
"settlement": "invoice",
|
|
417
|
-
"signature": "meters.transfer.internal.count"
|
|
418
|
-
},
|
|
419
|
-
{
|
|
420
|
-
"bps": 0,
|
|
421
|
-
"meter": "instrument.event.count",
|
|
422
|
-
"payer": "product",
|
|
423
|
-
"perEventMinor": "0",
|
|
424
|
-
"settlement": "invoice",
|
|
425
|
-
"signature": "moves.transfer.internal"
|
|
426
|
-
},
|
|
427
|
-
{
|
|
428
|
-
"bps": 0,
|
|
429
|
-
"meter": "instrument.event.count",
|
|
430
|
-
"payer": "product",
|
|
431
|
-
"perEventMinor": "0",
|
|
432
|
-
"settlement": "invoice",
|
|
433
|
-
"signature": "reminder.email"
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
"bps": 0,
|
|
437
|
-
"meter": "instrument.event.count",
|
|
438
|
-
"payer": "product",
|
|
439
|
-
"perEventMinor": "0",
|
|
440
|
-
"settlement": "invoice",
|
|
441
|
-
"signature": "requires.aggregate"
|
|
442
|
-
},
|
|
443
|
-
{
|
|
444
|
-
"bps": 0,
|
|
445
|
-
"meter": "instrument.event.count",
|
|
446
|
-
"payer": "product",
|
|
447
|
-
"perEventMinor": "0",
|
|
448
|
-
"settlement": "invoice",
|
|
449
|
-
"signature": "requires.compare"
|
|
450
|
-
},
|
|
451
|
-
{
|
|
452
|
-
"bps": 0,
|
|
453
|
-
"meter": "instrument.event.count",
|
|
454
|
-
"payer": "product",
|
|
455
|
-
"perEventMinor": "0",
|
|
456
|
-
"settlement": "invoice",
|
|
457
|
-
"signature": "requires.evidence"
|
|
458
|
-
},
|
|
459
|
-
{
|
|
460
|
-
"bps": 0,
|
|
461
|
-
"meter": "instrument.event.count",
|
|
462
|
-
"payer": "product",
|
|
463
|
-
"perEventMinor": "0",
|
|
464
|
-
"settlement": "invoice",
|
|
465
|
-
"signature": "requires.hours"
|
|
466
|
-
},
|
|
467
|
-
{
|
|
468
|
-
"bps": 0,
|
|
469
|
-
"meter": "instrument.event.count",
|
|
470
|
-
"payer": "product",
|
|
471
|
-
"perEventMinor": "0",
|
|
472
|
-
"settlement": "invoice",
|
|
473
|
-
"signature": "requires.state"
|
|
474
|
-
},
|
|
475
|
-
{
|
|
476
|
-
"bps": 0,
|
|
477
|
-
"meter": "instrument.event.count",
|
|
478
|
-
"payer": "product",
|
|
479
|
-
"perEventMinor": "0",
|
|
480
|
-
"settlement": "invoice",
|
|
481
|
-
"signature": "requires.unique"
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
"bps": 0,
|
|
485
|
-
"meter": "instrument.event.count",
|
|
486
|
-
"payer": "product",
|
|
487
|
-
"perEventMinor": "0",
|
|
488
|
-
"settlement": "invoice",
|
|
489
|
-
"signature": "unwinds.void"
|
|
490
|
-
}
|
|
491
|
-
],
|
|
492
|
-
"version": "2026-09-27.1"
|
|
493
|
-
},
|
|
494
|
-
{
|
|
495
|
-
"currency": "GBP",
|
|
496
|
-
"declaredMeters": [
|
|
497
|
-
"account.active_month",
|
|
498
|
-
"instrument.event.count",
|
|
499
|
-
"transfer.internal.count"
|
|
500
|
-
],
|
|
501
|
-
"effectiveTableDigest": "12ed3fa44010e80ae20c114d7dd94f277686225c040576a8bb96d12a0fe5333a",
|
|
502
|
-
"fixed": {
|
|
503
|
-
"activationBaseMinor": "104200",
|
|
504
|
-
"activationPerPointMinor": "2100",
|
|
505
|
-
"monthlyBaseMinor": "20800",
|
|
506
|
-
"monthlyPerPointMinor": "400",
|
|
507
|
-
"weights": {
|
|
508
|
-
"aggregate_invariant": 2,
|
|
509
|
-
"flow": 1,
|
|
510
|
-
"gate": 1,
|
|
511
|
-
"instrument": 3,
|
|
512
|
-
"move": 3,
|
|
513
|
-
"provider_decision": 5,
|
|
514
|
-
"timer": 1,
|
|
515
|
-
"unwind": 4
|
|
516
|
-
}
|
|
517
|
-
},
|
|
518
|
-
"rows": [
|
|
519
|
-
{
|
|
520
|
-
"bps": 0,
|
|
521
|
-
"meter": "instrument.event.count",
|
|
522
|
-
"payer": "product",
|
|
523
|
-
"perEventMinor": "0",
|
|
524
|
-
"settlement": "invoice",
|
|
525
|
-
"signature": "calculate"
|
|
526
|
-
},
|
|
527
|
-
{
|
|
528
|
-
"bps": 0,
|
|
529
|
-
"meter": "instrument.event.count",
|
|
530
|
-
"payer": "product",
|
|
531
|
-
"perEventMinor": "0",
|
|
532
|
-
"settlement": "invoice",
|
|
533
|
-
"signature": "clock.deadline"
|
|
534
|
-
},
|
|
535
|
-
{
|
|
536
|
-
"bps": 0,
|
|
537
|
-
"meter": "instrument.event.count",
|
|
538
|
-
"payer": "product",
|
|
539
|
-
"perEventMinor": "0",
|
|
540
|
-
"settlement": "invoice",
|
|
541
|
-
"signature": "clock.due"
|
|
542
|
-
},
|
|
543
|
-
{
|
|
544
|
-
"bps": 0,
|
|
545
|
-
"meter": "instrument.event.count",
|
|
546
|
-
"payer": "product",
|
|
547
|
-
"perEventMinor": "0",
|
|
548
|
-
"settlement": "invoice",
|
|
549
|
-
"signature": "holds.reserve"
|
|
550
|
-
},
|
|
551
|
-
{
|
|
552
|
-
"bps": 0,
|
|
553
|
-
"meter": "instrument.event.count",
|
|
554
|
-
"payer": "product",
|
|
555
|
-
"perEventMinor": "0",
|
|
556
|
-
"settlement": "invoice",
|
|
557
|
-
"signature": "invoke"
|
|
558
|
-
},
|
|
559
|
-
{
|
|
560
|
-
"bps": 0,
|
|
561
|
-
"meter": "account.active_month",
|
|
562
|
-
"payer": "product",
|
|
563
|
-
"perEventMinor": "104",
|
|
564
|
-
"settlement": "invoice",
|
|
565
|
-
"signature": "meters.account.active_month"
|
|
566
|
-
},
|
|
567
|
-
{
|
|
568
|
-
"bps": 0,
|
|
569
|
-
"meter": "instrument.event.count",
|
|
570
|
-
"payer": "product",
|
|
571
|
-
"perEventMinor": "5",
|
|
572
|
-
"settlement": "invoice",
|
|
573
|
-
"signature": "meters.instrument.event.count"
|
|
574
|
-
},
|
|
575
|
-
{
|
|
576
|
-
"bps": 0,
|
|
577
|
-
"meter": "transfer.internal.count",
|
|
578
|
-
"payer": "product",
|
|
579
|
-
"perEventMinor": "5",
|
|
580
|
-
"settlement": "invoice",
|
|
581
|
-
"signature": "meters.transfer.internal.count"
|
|
582
|
-
},
|
|
583
|
-
{
|
|
584
|
-
"bps": 0,
|
|
585
|
-
"meter": "instrument.event.count",
|
|
586
|
-
"payer": "product",
|
|
587
|
-
"perEventMinor": "0",
|
|
588
|
-
"settlement": "invoice",
|
|
589
|
-
"signature": "moves.transfer.internal"
|
|
590
|
-
},
|
|
591
|
-
{
|
|
592
|
-
"bps": 0,
|
|
593
|
-
"meter": "instrument.event.count",
|
|
594
|
-
"payer": "product",
|
|
595
|
-
"perEventMinor": "0",
|
|
596
|
-
"settlement": "invoice",
|
|
597
|
-
"signature": "reminder.email"
|
|
598
|
-
},
|
|
599
|
-
{
|
|
600
|
-
"bps": 0,
|
|
601
|
-
"meter": "instrument.event.count",
|
|
602
|
-
"payer": "product",
|
|
603
|
-
"perEventMinor": "0",
|
|
604
|
-
"settlement": "invoice",
|
|
605
|
-
"signature": "requires.aggregate"
|
|
606
|
-
},
|
|
607
|
-
{
|
|
608
|
-
"bps": 0,
|
|
609
|
-
"meter": "instrument.event.count",
|
|
610
|
-
"payer": "product",
|
|
611
|
-
"perEventMinor": "0",
|
|
612
|
-
"settlement": "invoice",
|
|
613
|
-
"signature": "requires.compare"
|
|
614
|
-
},
|
|
615
|
-
{
|
|
616
|
-
"bps": 0,
|
|
617
|
-
"meter": "instrument.event.count",
|
|
618
|
-
"payer": "product",
|
|
619
|
-
"perEventMinor": "0",
|
|
620
|
-
"settlement": "invoice",
|
|
621
|
-
"signature": "requires.evidence"
|
|
622
|
-
},
|
|
623
|
-
{
|
|
624
|
-
"bps": 0,
|
|
625
|
-
"meter": "instrument.event.count",
|
|
626
|
-
"payer": "product",
|
|
627
|
-
"perEventMinor": "0",
|
|
628
|
-
"settlement": "invoice",
|
|
629
|
-
"signature": "requires.hours"
|
|
630
|
-
},
|
|
631
|
-
{
|
|
632
|
-
"bps": 0,
|
|
633
|
-
"meter": "instrument.event.count",
|
|
634
|
-
"payer": "product",
|
|
635
|
-
"perEventMinor": "0",
|
|
636
|
-
"settlement": "invoice",
|
|
637
|
-
"signature": "requires.state"
|
|
638
|
-
},
|
|
639
|
-
{
|
|
640
|
-
"bps": 0,
|
|
641
|
-
"meter": "instrument.event.count",
|
|
642
|
-
"payer": "product",
|
|
643
|
-
"perEventMinor": "0",
|
|
644
|
-
"settlement": "invoice",
|
|
645
|
-
"signature": "requires.unique"
|
|
646
|
-
},
|
|
647
|
-
{
|
|
648
|
-
"bps": 0,
|
|
649
|
-
"meter": "instrument.event.count",
|
|
650
|
-
"payer": "product",
|
|
651
|
-
"perEventMinor": "0",
|
|
652
|
-
"settlement": "invoice",
|
|
653
|
-
"signature": "unwinds.void"
|
|
654
|
-
}
|
|
655
|
-
],
|
|
656
|
-
"version": "2026-09-27.1"
|
|
657
165
|
}
|
|
658
166
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperscale0/hsx",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.258",
|
|
4
4
|
"description": "The strictly typed HSX language: compile total financial programs into canonical UDL.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hsx",
|
|
@@ -84,8 +84,8 @@
|
|
|
84
84
|
"examples:bundle": "bun scripts/bundle-examples.ts"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@hyperscale0/adl": "1.0.
|
|
88
|
-
"@hyperscale0/udl": "1.0.
|
|
87
|
+
"@hyperscale0/adl": "1.0.258",
|
|
88
|
+
"@hyperscale0/udl": "1.0.258",
|
|
89
89
|
"fast-sha256": "1.3.0"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"Amir Ayub",
|
|
98
98
|
"Sara AlBakaawi"
|
|
99
99
|
],
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "20d3d1eddd70d7629f5ae6a5b14e0e89c4ce536a"
|
|
101
101
|
}
|
package/src/compile.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { buildUdlCostManifest, type UdlCostManifest } from "./cost.ts";
|
|
|
9
9
|
import {
|
|
10
10
|
validateUdl,
|
|
11
11
|
resolveField,
|
|
12
|
+
sameAccount,
|
|
12
13
|
sameObjectField,
|
|
13
14
|
subjectPartyRoles,
|
|
14
15
|
RESERVED_OBJECT_NAMES,
|
|
@@ -614,6 +615,7 @@ export function compile(
|
|
|
614
615
|
// Lowered objects lose their spans, so each keeps the expression that
|
|
615
616
|
// produced it for the name check after lowering.
|
|
616
617
|
const authored = new WeakMap<object, Expr>();
|
|
618
|
+
const splitMoves = new WeakSet<object>();
|
|
617
619
|
const declarations = new WeakMap<UdlInstrument, InstrumentDecl>();
|
|
618
620
|
const exposures: { instrument: string; action: string; entry: Entry }[] =
|
|
619
621
|
[];
|
|
@@ -2719,6 +2721,7 @@ export function compile(
|
|
|
2719
2721
|
from: moneyPath(from),
|
|
2720
2722
|
to: `party.${recipient.value}`,
|
|
2721
2723
|
});
|
|
2724
|
+
splitMoves.add(a.moves.at(-1)!);
|
|
2722
2725
|
}
|
|
2723
2726
|
if (total !== 10000)
|
|
2724
2727
|
fail(
|
|
@@ -4332,6 +4335,23 @@ export function compile(
|
|
|
4332
4335
|
);
|
|
4333
4336
|
}
|
|
4334
4337
|
}
|
|
4338
|
+
// Resolve account bindings after lowering, keeping all share calculations
|
|
4339
|
+
// and original leg keys even when a split allocation stays in its source.
|
|
4340
|
+
for (const instrument of document.instruments)
|
|
4341
|
+
for (const action of Object.values(instrument.actions))
|
|
4342
|
+
action.moves = action.moves.filter(
|
|
4343
|
+
(move) =>
|
|
4344
|
+
!splitMoves.has(move) ||
|
|
4345
|
+
!("amount" in move) ||
|
|
4346
|
+
!sameAccount(
|
|
4347
|
+
document,
|
|
4348
|
+
instrument,
|
|
4349
|
+
move.from,
|
|
4350
|
+
move.to,
|
|
4351
|
+
action.input,
|
|
4352
|
+
action,
|
|
4353
|
+
),
|
|
4354
|
+
);
|
|
4335
4355
|
const validated = validateUdl(document);
|
|
4336
4356
|
if (!validated.ok)
|
|
4337
4357
|
return {
|