@almadar/std 14.27.0 → 14.28.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.
Files changed (25) hide show
  1. package/behaviors/registry/app/atoms/std-approval-chain.orb +106 -0
  2. package/behaviors/registry/app/atoms/std-multi-party-transaction.orb +130 -0
  3. package/behaviors/registry/app/atoms/std-pipeline.orb +139 -0
  4. package/behaviors/registry/app/atoms/std-recurring-schedule.orb +94 -0
  5. package/behaviors/registry/app/atoms/std-timeline.orb +108 -0
  6. package/behaviors/registry/app/atoms/std-wizard-branching.orb +129 -0
  7. package/behaviors/registry/core/atoms/std-board.orb +1367 -0
  8. package/behaviors/registry/core/atoms/std-event-log.orb +777 -0
  9. package/behaviors/registry/core/atoms/std-multi-party-flow.orb +1313 -0
  10. package/behaviors/registry/core/atoms/std-recurrence.orb +937 -0
  11. package/behaviors/registry/core/atoms/std-step-flow.orb +1155 -0
  12. package/behaviors/registry/core/atoms/std-wizard.orb +1085 -0
  13. package/dist/behaviors/registry/app/atoms/std-approval-chain.orb +106 -0
  14. package/dist/behaviors/registry/app/atoms/std-multi-party-transaction.orb +130 -0
  15. package/dist/behaviors/registry/app/atoms/std-pipeline.orb +139 -0
  16. package/dist/behaviors/registry/app/atoms/std-recurring-schedule.orb +94 -0
  17. package/dist/behaviors/registry/app/atoms/std-timeline.orb +108 -0
  18. package/dist/behaviors/registry/app/atoms/std-wizard-branching.orb +129 -0
  19. package/dist/behaviors/registry/core/atoms/std-board.orb +1367 -0
  20. package/dist/behaviors/registry/core/atoms/std-event-log.orb +777 -0
  21. package/dist/behaviors/registry/core/atoms/std-multi-party-flow.orb +1313 -0
  22. package/dist/behaviors/registry/core/atoms/std-recurrence.orb +937 -0
  23. package/dist/behaviors/registry/core/atoms/std-step-flow.orb +1155 -0
  24. package/dist/behaviors/registry/core/atoms/std-wizard.orb +1085 -0
  25. package/package.json +1 -1
@@ -0,0 +1,1313 @@
1
+ {
2
+ "name": "std-multi-party-flow",
3
+ "version": "1.0.0",
4
+ "description": "std-multi-party-flow — generic N-party transactional state machine (escrow, signing, multi-stakeholder approval). `config.parties` is an array of party definitions; @entity.currentPartyIndex walks through them; PARTY_CONFIRM self-loops, FINALIZE moves to funded, RELEASE/DISPUTE/CANCEL terminate. Topology = loading / awaiting / funded / released / disputed / cancelled / error — the awaiting state owns N via data, not states.",
5
+ "orbitals": [
6
+ {
7
+ "name": "MultiPartyFlowOrbital",
8
+ "entity": {
9
+ "name": "MultiPartyView",
10
+ "persistence": "runtime",
11
+ "fields": [
12
+ {
13
+ "name": "id",
14
+ "type": "string",
15
+ "required": true
16
+ },
17
+ {
18
+ "name": "parties",
19
+ "type": "array",
20
+ "default": [],
21
+ "items": {
22
+ "type": "object",
23
+ "properties": {
24
+ "actionIcon": {
25
+ "name": "actionIcon",
26
+ "type": "string"
27
+ },
28
+ "key": {
29
+ "name": "key",
30
+ "type": "string"
31
+ },
32
+ "label": {
33
+ "name": "label",
34
+ "type": "string"
35
+ },
36
+ "actionLabel": {
37
+ "name": "actionLabel",
38
+ "type": "string"
39
+ },
40
+ "description": {
41
+ "name": "description",
42
+ "type": "string"
43
+ },
44
+ "icon": {
45
+ "name": "icon",
46
+ "type": "string"
47
+ },
48
+ "status": {
49
+ "name": "status",
50
+ "type": "string",
51
+ "values": [
52
+ "waiting",
53
+ "ready",
54
+ "completed"
55
+ ]
56
+ }
57
+ }
58
+ }
59
+ },
60
+ {
61
+ "name": "currentPartyIndex",
62
+ "type": "number",
63
+ "default": 0.0
64
+ },
65
+ {
66
+ "name": "totalParties",
67
+ "type": "number",
68
+ "default": 0.0
69
+ },
70
+ {
71
+ "name": "audit",
72
+ "type": "array",
73
+ "default": [],
74
+ "items": {
75
+ "type": "object",
76
+ "properties": {
77
+ "timestamp": {
78
+ "name": "timestamp",
79
+ "type": "string"
80
+ },
81
+ "id": {
82
+ "name": "id",
83
+ "type": "string"
84
+ },
85
+ "action": {
86
+ "name": "action",
87
+ "type": "string"
88
+ },
89
+ "actor": {
90
+ "name": "actor",
91
+ "type": "string"
92
+ }
93
+ }
94
+ }
95
+ },
96
+ {
97
+ "name": "disputeReason",
98
+ "type": "string",
99
+ "default": ""
100
+ },
101
+ {
102
+ "name": "cancelReason",
103
+ "type": "string",
104
+ "default": ""
105
+ },
106
+ {
107
+ "name": "errorMessage",
108
+ "type": "string",
109
+ "default": ""
110
+ }
111
+ ]
112
+ },
113
+ "traits": [
114
+ {
115
+ "name": "MultiPartyTransaction",
116
+ "category": "interaction",
117
+ "linkedEntity": "MultiPartyView",
118
+ "emits": [
119
+ {
120
+ "event": "PARTY_CONFIRM",
121
+ "payloadSchema": [
122
+ {
123
+ "name": "partyKey",
124
+ "type": "string"
125
+ }
126
+ ]
127
+ },
128
+ {
129
+ "event": "FINALIZE"
130
+ },
131
+ {
132
+ "event": "RELEASE"
133
+ },
134
+ {
135
+ "event": "OPEN_DISPUTE",
136
+ "payloadSchema": [
137
+ {
138
+ "name": "reason",
139
+ "type": "string"
140
+ }
141
+ ]
142
+ },
143
+ {
144
+ "event": "CANCEL_TRANSACTION",
145
+ "payloadSchema": [
146
+ {
147
+ "name": "reason",
148
+ "type": "string"
149
+ }
150
+ ]
151
+ },
152
+ {
153
+ "event": "RESTART"
154
+ },
155
+ {
156
+ "event": "FlowLoaded",
157
+ "payloadSchema": [
158
+ {
159
+ "name": "data",
160
+ "type": "[object]"
161
+ }
162
+ ]
163
+ },
164
+ {
165
+ "event": "FlowLoadFailed",
166
+ "payloadSchema": [
167
+ {
168
+ "name": "error",
169
+ "type": "string"
170
+ },
171
+ {
172
+ "name": "code",
173
+ "type": "string"
174
+ }
175
+ ]
176
+ }
177
+ ],
178
+ "stateMachine": {
179
+ "states": [
180
+ {
181
+ "name": "loading",
182
+ "isInitial": true
183
+ },
184
+ {
185
+ "name": "awaiting"
186
+ },
187
+ {
188
+ "name": "funded"
189
+ },
190
+ {
191
+ "name": "released"
192
+ },
193
+ {
194
+ "name": "disputed"
195
+ },
196
+ {
197
+ "name": "cancelled"
198
+ },
199
+ {
200
+ "name": "error"
201
+ }
202
+ ],
203
+ "events": [
204
+ {
205
+ "key": "INIT",
206
+ "name": "Initialize"
207
+ },
208
+ {
209
+ "key": "FlowLoaded",
210
+ "name": "Flow loaded",
211
+ "payloadSchema": [
212
+ {
213
+ "name": "data",
214
+ "type": "[object]"
215
+ }
216
+ ]
217
+ },
218
+ {
219
+ "key": "FlowLoadFailed",
220
+ "name": "Flow load failed",
221
+ "payloadSchema": [
222
+ {
223
+ "name": "error",
224
+ "type": "string"
225
+ },
226
+ {
227
+ "name": "code",
228
+ "type": "string"
229
+ }
230
+ ]
231
+ },
232
+ {
233
+ "key": "FlowSaved",
234
+ "name": "Flow saved",
235
+ "payloadSchema": [
236
+ {
237
+ "name": "row",
238
+ "type": "object"
239
+ }
240
+ ]
241
+ },
242
+ {
243
+ "key": "FlowSaveFailed",
244
+ "name": "Flow save failed",
245
+ "payloadSchema": [
246
+ {
247
+ "name": "error",
248
+ "type": "string"
249
+ },
250
+ {
251
+ "name": "code",
252
+ "type": "string"
253
+ }
254
+ ]
255
+ },
256
+ {
257
+ "key": "PARTY_CONFIRM",
258
+ "name": "Party Confirm",
259
+ "payloadSchema": [
260
+ {
261
+ "name": "partyKey",
262
+ "type": "string"
263
+ }
264
+ ]
265
+ },
266
+ {
267
+ "key": "FINALIZE",
268
+ "name": "Finalize"
269
+ },
270
+ {
271
+ "key": "OPEN_DISPUTE",
272
+ "name": "Open Dispute",
273
+ "payloadSchema": [
274
+ {
275
+ "name": "reason",
276
+ "type": "string"
277
+ }
278
+ ]
279
+ },
280
+ {
281
+ "key": "CANCEL_TRANSACTION",
282
+ "name": "Cancel Transaction",
283
+ "payloadSchema": [
284
+ {
285
+ "name": "reason",
286
+ "type": "string"
287
+ }
288
+ ]
289
+ },
290
+ {
291
+ "key": "RELEASE",
292
+ "name": "Release"
293
+ },
294
+ {
295
+ "key": "RESTART",
296
+ "name": "Restart"
297
+ }
298
+ ],
299
+ "transitions": [
300
+ {
301
+ "from": "loading",
302
+ "to": "loading",
303
+ "event": "INIT",
304
+ "effects": [
305
+ [
306
+ "fetch",
307
+ "MultiPartyView",
308
+ {
309
+ "emit": {
310
+ "success": "FlowLoaded",
311
+ "failure": "FlowLoadFailed"
312
+ }
313
+ }
314
+ ],
315
+ [
316
+ "render-ui",
317
+ "main",
318
+ {
319
+ "type": "loading-state",
320
+ "title": "Loading transaction…"
321
+ }
322
+ ]
323
+ ]
324
+ },
325
+ {
326
+ "from": "loading",
327
+ "to": "awaiting",
328
+ "event": "FlowLoaded",
329
+ "effects": [
330
+ [
331
+ "set",
332
+ "@entity.currentPartyIndex",
333
+ 0.0
334
+ ],
335
+ [
336
+ "set",
337
+ "@entity.totalParties",
338
+ [
339
+ "array/len",
340
+ "@config.parties"
341
+ ]
342
+ ],
343
+ [
344
+ "set",
345
+ "@entity.parties",
346
+ [
347
+ "array/map",
348
+ "@config.parties",
349
+ [
350
+ "fn",
351
+ "party",
352
+ {
353
+ "description": [
354
+ "object/get",
355
+ "@party",
356
+ "description",
357
+ ""
358
+ ],
359
+ "key": [
360
+ "object/get",
361
+ "@party",
362
+ "key"
363
+ ],
364
+ "icon": [
365
+ "object/get",
366
+ "@party",
367
+ "icon",
368
+ "user"
369
+ ],
370
+ "label": [
371
+ "object/get",
372
+ "@party",
373
+ "label"
374
+ ],
375
+ "actionLabel": [
376
+ "object/get",
377
+ "@party",
378
+ "actionLabel",
379
+ "Confirm"
380
+ ],
381
+ "status": "ready",
382
+ "actionIcon": [
383
+ "object/get",
384
+ "@party",
385
+ "actionIcon",
386
+ "check"
387
+ ]
388
+ }
389
+ ]
390
+ ]
391
+ ],
392
+ [
393
+ "set",
394
+ "@entity.audit",
395
+ [
396
+ "array/map",
397
+ "@payload.data",
398
+ [
399
+ "fn",
400
+ "row",
401
+ {
402
+ "action": [
403
+ "object/get",
404
+ "@row",
405
+ "action",
406
+ ""
407
+ ],
408
+ "timestamp": [
409
+ "object/get",
410
+ "@row",
411
+ "createdAt",
412
+ ""
413
+ ],
414
+ "id": [
415
+ "object/get",
416
+ "@row",
417
+ "id",
418
+ ""
419
+ ],
420
+ "actor": [
421
+ "object/get",
422
+ "@row",
423
+ "actor",
424
+ "system"
425
+ ]
426
+ }
427
+ ]
428
+ ]
429
+ ],
430
+ [
431
+ "render-ui",
432
+ "main",
433
+ {
434
+ "children": [
435
+ {
436
+ "gap": "sm",
437
+ "type": "stack",
438
+ "direction": "horizontal",
439
+ "align": "center",
440
+ "children": [
441
+ {
442
+ "name": "git-pull-request",
443
+ "type": "icon"
444
+ },
445
+ {
446
+ "content": "@config.title",
447
+ "variant": "h3",
448
+ "type": "typography"
449
+ }
450
+ ]
451
+ },
452
+ {
453
+ "type": "divider"
454
+ },
455
+ {
456
+ "gap": "sm",
457
+ "type": "data-list",
458
+ "entity": "@entity.parties",
459
+ "fields": [],
460
+ "renderItem": [
461
+ "fn",
462
+ "party",
463
+ {
464
+ "type": "card",
465
+ "children": [
466
+ {
467
+ "children": [
468
+ {
469
+ "name": "@party.icon",
470
+ "type": "icon"
471
+ },
472
+ {
473
+ "type": "stack",
474
+ "children": [
475
+ {
476
+ "type": "typography",
477
+ "content": "@party.label",
478
+ "variant": "h4"
479
+ },
480
+ {
481
+ "type": "typography",
482
+ "color": "muted",
483
+ "variant": "caption",
484
+ "content": "@party.description"
485
+ }
486
+ ],
487
+ "gap": "xs",
488
+ "direction": "vertical"
489
+ },
490
+ {
491
+ "label": "@party.status",
492
+ "variant": "primary",
493
+ "type": "badge"
494
+ },
495
+ {
496
+ "label": "@party.actionLabel",
497
+ "actionPayload": {
498
+ "partyKey": "@party.key"
499
+ },
500
+ "icon": "@party.actionIcon",
501
+ "action": "PARTY_CONFIRM",
502
+ "variant": "primary",
503
+ "type": "button"
504
+ }
505
+ ],
506
+ "gap": "sm",
507
+ "align": "center",
508
+ "type": "stack",
509
+ "direction": "horizontal"
510
+ }
511
+ ]
512
+ }
513
+ ]
514
+ },
515
+ {
516
+ "type": "divider"
517
+ },
518
+ {
519
+ "type": "typography",
520
+ "color": "muted",
521
+ "variant": "caption",
522
+ "content": "Audit Log"
523
+ },
524
+ {
525
+ "gap": "sm",
526
+ "type": "data-list",
527
+ "entity": "@entity.audit",
528
+ "renderItem": [
529
+ "fn",
530
+ "ev",
531
+ {
532
+ "children": [
533
+ {
534
+ "align": "center",
535
+ "gap": "sm",
536
+ "children": [
537
+ {
538
+ "name": "clock",
539
+ "type": "icon"
540
+ },
541
+ {
542
+ "type": "stack",
543
+ "direction": "vertical",
544
+ "gap": "xs",
545
+ "children": [
546
+ {
547
+ "variant": "h4",
548
+ "type": "typography",
549
+ "content": "@ev.action"
550
+ },
551
+ {
552
+ "color": "muted",
553
+ "variant": "caption",
554
+ "content": "@ev.timestamp",
555
+ "type": "typography"
556
+ }
557
+ ]
558
+ },
559
+ {
560
+ "type": "badge",
561
+ "variant": "primary",
562
+ "label": "@ev.actor"
563
+ }
564
+ ],
565
+ "direction": "horizontal",
566
+ "type": "stack"
567
+ }
568
+ ],
569
+ "type": "card"
570
+ }
571
+ ],
572
+ "fields": []
573
+ },
574
+ {
575
+ "direction": "horizontal",
576
+ "type": "stack",
577
+ "gap": "sm",
578
+ "align": "center",
579
+ "children": [
580
+ {
581
+ "type": "button",
582
+ "label": "Mark Funded",
583
+ "action": "FINALIZE",
584
+ "icon": "lock",
585
+ "variant": "success"
586
+ },
587
+ {
588
+ "label": "@config.disputeLabel",
589
+ "variant": "danger",
590
+ "type": "button",
591
+ "action": "OPEN_DISPUTE",
592
+ "icon": "@config.disputeIcon"
593
+ },
594
+ {
595
+ "variant": "ghost",
596
+ "label": "@config.cancelLabel",
597
+ "action": "CANCEL_TRANSACTION",
598
+ "type": "button",
599
+ "icon": "@config.cancelIcon"
600
+ }
601
+ ]
602
+ }
603
+ ],
604
+ "type": "stack",
605
+ "gap": "md",
606
+ "direction": "vertical"
607
+ }
608
+ ]
609
+ ]
610
+ },
611
+ {
612
+ "from": "loading",
613
+ "to": "error",
614
+ "event": "FlowLoadFailed",
615
+ "effects": [
616
+ [
617
+ "set",
618
+ "@entity.errorMessage",
619
+ "@payload.error"
620
+ ],
621
+ [
622
+ "render-ui",
623
+ "main",
624
+ {
625
+ "title": "Failed to load",
626
+ "type": "error-state",
627
+ "message": "@entity.errorMessage"
628
+ }
629
+ ]
630
+ ]
631
+ },
632
+ {
633
+ "from": "loading",
634
+ "to": "awaiting",
635
+ "event": "FlowSaved",
636
+ "effects": [
637
+ [
638
+ "render-ui",
639
+ "main",
640
+ {
641
+ "title": "Refreshing…",
642
+ "type": "loading-state"
643
+ }
644
+ ]
645
+ ]
646
+ },
647
+ {
648
+ "from": "loading",
649
+ "to": "error",
650
+ "event": "FlowSaveFailed",
651
+ "effects": [
652
+ [
653
+ "set",
654
+ "@entity.errorMessage",
655
+ "@payload.error"
656
+ ],
657
+ [
658
+ "render-ui",
659
+ "main",
660
+ {
661
+ "type": "error-state",
662
+ "title": "Save failed",
663
+ "message": "@entity.errorMessage"
664
+ }
665
+ ]
666
+ ]
667
+ },
668
+ {
669
+ "from": "awaiting",
670
+ "to": "awaiting",
671
+ "event": "PARTY_CONFIRM",
672
+ "effects": [
673
+ [
674
+ "set",
675
+ "@entity.currentPartyIndex",
676
+ [
677
+ "+",
678
+ "@entity.currentPartyIndex",
679
+ 1.0
680
+ ]
681
+ ],
682
+ [
683
+ "set",
684
+ "@entity.parties",
685
+ [
686
+ "array/map",
687
+ "@config.parties",
688
+ [
689
+ "fn",
690
+ "party",
691
+ {
692
+ "label": [
693
+ "object/get",
694
+ "@party",
695
+ "label"
696
+ ],
697
+ "description": [
698
+ "object/get",
699
+ "@party",
700
+ "description",
701
+ ""
702
+ ],
703
+ "icon": [
704
+ "object/get",
705
+ "@party",
706
+ "icon",
707
+ "user"
708
+ ],
709
+ "actionLabel": [
710
+ "object/get",
711
+ "@party",
712
+ "actionLabel",
713
+ "Confirm"
714
+ ],
715
+ "actionIcon": [
716
+ "object/get",
717
+ "@party",
718
+ "actionIcon",
719
+ "check"
720
+ ],
721
+ "status": "completed",
722
+ "key": [
723
+ "object/get",
724
+ "@party",
725
+ "key"
726
+ ]
727
+ }
728
+ ]
729
+ ]
730
+ ],
731
+ [
732
+ "render-ui",
733
+ "main",
734
+ {
735
+ "gap": "md",
736
+ "direction": "vertical",
737
+ "children": [
738
+ {
739
+ "direction": "horizontal",
740
+ "align": "center",
741
+ "children": [
742
+ {
743
+ "name": "git-pull-request",
744
+ "type": "icon"
745
+ },
746
+ {
747
+ "type": "typography",
748
+ "content": "@config.title",
749
+ "variant": "h3"
750
+ }
751
+ ],
752
+ "type": "stack",
753
+ "gap": "sm"
754
+ },
755
+ {
756
+ "type": "divider"
757
+ },
758
+ {
759
+ "entity": "@entity.parties",
760
+ "gap": "sm",
761
+ "type": "data-list",
762
+ "renderItem": [
763
+ "fn",
764
+ "party",
765
+ {
766
+ "children": [
767
+ {
768
+ "gap": "sm",
769
+ "direction": "horizontal",
770
+ "children": [
771
+ {
772
+ "name": "@party.icon",
773
+ "type": "icon"
774
+ },
775
+ {
776
+ "direction": "vertical",
777
+ "gap": "xs",
778
+ "type": "stack",
779
+ "children": [
780
+ {
781
+ "content": "@party.label",
782
+ "type": "typography",
783
+ "variant": "h4"
784
+ },
785
+ {
786
+ "content": "@party.description",
787
+ "type": "typography",
788
+ "color": "muted",
789
+ "variant": "caption"
790
+ }
791
+ ]
792
+ },
793
+ {
794
+ "type": "badge",
795
+ "variant": "primary",
796
+ "label": "@party.status"
797
+ },
798
+ {
799
+ "type": "button",
800
+ "action": "PARTY_CONFIRM",
801
+ "icon": "@party.actionIcon",
802
+ "label": "@party.actionLabel",
803
+ "variant": "primary",
804
+ "actionPayload": {
805
+ "partyKey": "@party.key"
806
+ }
807
+ }
808
+ ],
809
+ "align": "center",
810
+ "type": "stack"
811
+ }
812
+ ],
813
+ "type": "card"
814
+ }
815
+ ],
816
+ "fields": []
817
+ },
818
+ {
819
+ "gap": "sm",
820
+ "align": "center",
821
+ "type": "stack",
822
+ "direction": "horizontal",
823
+ "children": [
824
+ {
825
+ "label": "Mark Funded",
826
+ "type": "button",
827
+ "action": "FINALIZE",
828
+ "variant": "success",
829
+ "icon": "lock"
830
+ },
831
+ {
832
+ "icon": "@config.disputeIcon",
833
+ "label": "@config.disputeLabel",
834
+ "variant": "danger",
835
+ "action": "OPEN_DISPUTE",
836
+ "type": "button"
837
+ },
838
+ {
839
+ "icon": "@config.cancelIcon",
840
+ "action": "CANCEL_TRANSACTION",
841
+ "label": "@config.cancelLabel",
842
+ "type": "button",
843
+ "variant": "ghost"
844
+ }
845
+ ]
846
+ }
847
+ ],
848
+ "type": "stack"
849
+ }
850
+ ]
851
+ ]
852
+ },
853
+ {
854
+ "from": "awaiting",
855
+ "to": "funded",
856
+ "event": "FINALIZE",
857
+ "effects": [
858
+ [
859
+ "render-ui",
860
+ "main",
861
+ {
862
+ "children": [
863
+ {
864
+ "children": [
865
+ {
866
+ "name": "lock",
867
+ "type": "icon"
868
+ },
869
+ {
870
+ "variant": "h3",
871
+ "content": "Funded",
872
+ "type": "typography"
873
+ }
874
+ ],
875
+ "direction": "horizontal",
876
+ "type": "stack",
877
+ "gap": "sm",
878
+ "align": "center"
879
+ },
880
+ {
881
+ "type": "divider"
882
+ },
883
+ {
884
+ "variant": "body",
885
+ "content": "All parties have confirmed. Awaiting release.",
886
+ "type": "typography"
887
+ },
888
+ {
889
+ "gap": "sm",
890
+ "align": "center",
891
+ "type": "stack",
892
+ "direction": "horizontal",
893
+ "children": [
894
+ {
895
+ "icon": "@config.releaseIcon",
896
+ "variant": "primary",
897
+ "type": "button",
898
+ "action": "RELEASE",
899
+ "label": "@config.releaseLabel"
900
+ },
901
+ {
902
+ "label": "@config.disputeLabel",
903
+ "action": "OPEN_DISPUTE",
904
+ "type": "button",
905
+ "variant": "danger",
906
+ "icon": "@config.disputeIcon"
907
+ }
908
+ ]
909
+ }
910
+ ],
911
+ "gap": "md",
912
+ "direction": "vertical",
913
+ "type": "stack"
914
+ }
915
+ ]
916
+ ]
917
+ },
918
+ {
919
+ "from": "awaiting",
920
+ "to": "disputed",
921
+ "event": "OPEN_DISPUTE",
922
+ "effects": [
923
+ [
924
+ "set",
925
+ "@entity.disputeReason",
926
+ "@payload.reason"
927
+ ],
928
+ [
929
+ "render-ui",
930
+ "main",
931
+ {
932
+ "children": [
933
+ {
934
+ "align": "center",
935
+ "children": [
936
+ {
937
+ "type": "icon",
938
+ "name": "alert-triangle"
939
+ },
940
+ {
941
+ "content": "Disputed",
942
+ "type": "typography",
943
+ "variant": "h3"
944
+ }
945
+ ],
946
+ "gap": "sm",
947
+ "type": "stack",
948
+ "direction": "horizontal"
949
+ },
950
+ {
951
+ "type": "divider"
952
+ },
953
+ {
954
+ "type": "card",
955
+ "children": [
956
+ {
957
+ "direction": "vertical",
958
+ "children": [
959
+ {
960
+ "type": "typography",
961
+ "content": "Reason",
962
+ "color": "muted",
963
+ "variant": "caption"
964
+ },
965
+ {
966
+ "type": "typography",
967
+ "content": "@entity.disputeReason",
968
+ "variant": "body"
969
+ }
970
+ ],
971
+ "gap": "sm",
972
+ "type": "stack"
973
+ }
974
+ ]
975
+ },
976
+ {
977
+ "icon": "rotate-ccw",
978
+ "label": "Restart",
979
+ "action": "RESTART",
980
+ "type": "button",
981
+ "variant": "secondary"
982
+ }
983
+ ],
984
+ "direction": "vertical",
985
+ "type": "stack",
986
+ "gap": "md"
987
+ }
988
+ ]
989
+ ]
990
+ },
991
+ {
992
+ "from": "awaiting",
993
+ "to": "cancelled",
994
+ "event": "CANCEL_TRANSACTION",
995
+ "effects": [
996
+ [
997
+ "set",
998
+ "@entity.cancelReason",
999
+ "@payload.reason"
1000
+ ],
1001
+ [
1002
+ "render-ui",
1003
+ "main",
1004
+ {
1005
+ "direction": "vertical",
1006
+ "gap": "md",
1007
+ "type": "stack",
1008
+ "children": [
1009
+ {
1010
+ "type": "stack",
1011
+ "direction": "horizontal",
1012
+ "gap": "sm",
1013
+ "align": "center",
1014
+ "children": [
1015
+ {
1016
+ "type": "icon",
1017
+ "name": "x-circle"
1018
+ },
1019
+ {
1020
+ "content": "Cancelled",
1021
+ "variant": "h3",
1022
+ "type": "typography"
1023
+ }
1024
+ ]
1025
+ },
1026
+ {
1027
+ "type": "divider"
1028
+ },
1029
+ {
1030
+ "content": "Transaction cancelled.",
1031
+ "type": "typography",
1032
+ "variant": "body"
1033
+ },
1034
+ {
1035
+ "icon": "rotate-ccw",
1036
+ "label": "Restart",
1037
+ "type": "button",
1038
+ "action": "RESTART",
1039
+ "variant": "secondary"
1040
+ }
1041
+ ]
1042
+ }
1043
+ ]
1044
+ ]
1045
+ },
1046
+ {
1047
+ "from": "funded",
1048
+ "to": "released",
1049
+ "event": "RELEASE",
1050
+ "effects": [
1051
+ [
1052
+ "render-ui",
1053
+ "main",
1054
+ {
1055
+ "children": [
1056
+ {
1057
+ "align": "center",
1058
+ "children": [
1059
+ {
1060
+ "name": "check-circle",
1061
+ "type": "icon"
1062
+ },
1063
+ {
1064
+ "variant": "h3",
1065
+ "content": "Released",
1066
+ "type": "typography"
1067
+ }
1068
+ ],
1069
+ "type": "stack",
1070
+ "gap": "sm",
1071
+ "direction": "horizontal"
1072
+ },
1073
+ {
1074
+ "type": "divider"
1075
+ },
1076
+ {
1077
+ "type": "typography",
1078
+ "variant": "body",
1079
+ "content": "Funds released. Transaction complete."
1080
+ },
1081
+ {
1082
+ "type": "button",
1083
+ "label": "Restart",
1084
+ "action": "RESTART",
1085
+ "variant": "secondary",
1086
+ "icon": "rotate-ccw"
1087
+ }
1088
+ ],
1089
+ "gap": "md",
1090
+ "type": "stack",
1091
+ "direction": "vertical"
1092
+ }
1093
+ ]
1094
+ ]
1095
+ },
1096
+ {
1097
+ "from": "funded",
1098
+ "to": "disputed",
1099
+ "event": "OPEN_DISPUTE",
1100
+ "effects": [
1101
+ [
1102
+ "set",
1103
+ "@entity.disputeReason",
1104
+ "@payload.reason"
1105
+ ],
1106
+ [
1107
+ "render-ui",
1108
+ "main",
1109
+ {
1110
+ "children": [
1111
+ {
1112
+ "direction": "horizontal",
1113
+ "align": "center",
1114
+ "type": "stack",
1115
+ "gap": "sm",
1116
+ "children": [
1117
+ {
1118
+ "name": "alert-triangle",
1119
+ "type": "icon"
1120
+ },
1121
+ {
1122
+ "content": "Disputed",
1123
+ "type": "typography",
1124
+ "variant": "h3"
1125
+ }
1126
+ ]
1127
+ },
1128
+ {
1129
+ "type": "divider"
1130
+ },
1131
+ {
1132
+ "type": "card",
1133
+ "children": [
1134
+ {
1135
+ "type": "stack",
1136
+ "direction": "vertical",
1137
+ "gap": "sm",
1138
+ "children": [
1139
+ {
1140
+ "color": "muted",
1141
+ "content": "Reason",
1142
+ "type": "typography",
1143
+ "variant": "caption"
1144
+ },
1145
+ {
1146
+ "content": "@entity.disputeReason",
1147
+ "variant": "body",
1148
+ "type": "typography"
1149
+ }
1150
+ ]
1151
+ }
1152
+ ]
1153
+ },
1154
+ {
1155
+ "icon": "rotate-ccw",
1156
+ "label": "Restart",
1157
+ "type": "button",
1158
+ "variant": "secondary",
1159
+ "action": "RESTART"
1160
+ }
1161
+ ],
1162
+ "type": "stack",
1163
+ "gap": "md",
1164
+ "direction": "vertical"
1165
+ }
1166
+ ]
1167
+ ]
1168
+ },
1169
+ {
1170
+ "from": "released",
1171
+ "to": "loading",
1172
+ "event": "RESTART",
1173
+ "effects": [
1174
+ [
1175
+ "set",
1176
+ "@entity.currentPartyIndex",
1177
+ 0.0
1178
+ ],
1179
+ [
1180
+ "render-ui",
1181
+ "main",
1182
+ {
1183
+ "type": "loading-state",
1184
+ "title": "Restarting…"
1185
+ }
1186
+ ]
1187
+ ]
1188
+ },
1189
+ {
1190
+ "from": "disputed",
1191
+ "to": "loading",
1192
+ "event": "RESTART",
1193
+ "effects": [
1194
+ [
1195
+ "set",
1196
+ "@entity.currentPartyIndex",
1197
+ 0.0
1198
+ ],
1199
+ [
1200
+ "render-ui",
1201
+ "main",
1202
+ {
1203
+ "title": "Restarting…",
1204
+ "type": "loading-state"
1205
+ }
1206
+ ]
1207
+ ]
1208
+ },
1209
+ {
1210
+ "from": "cancelled",
1211
+ "to": "loading",
1212
+ "event": "RESTART",
1213
+ "effects": [
1214
+ [
1215
+ "set",
1216
+ "@entity.currentPartyIndex",
1217
+ 0.0
1218
+ ],
1219
+ [
1220
+ "render-ui",
1221
+ "main",
1222
+ {
1223
+ "title": "Restarting…",
1224
+ "type": "loading-state"
1225
+ }
1226
+ ]
1227
+ ]
1228
+ },
1229
+ {
1230
+ "from": "error",
1231
+ "to": "loading",
1232
+ "event": "INIT",
1233
+ "effects": [
1234
+ [
1235
+ "render-ui",
1236
+ "main",
1237
+ {
1238
+ "title": "Retrying…",
1239
+ "type": "loading-state"
1240
+ }
1241
+ ]
1242
+ ]
1243
+ }
1244
+ ]
1245
+ },
1246
+ "config": {
1247
+ "disputeLabel": {
1248
+ "type": "string",
1249
+ "default": "Open Dispute"
1250
+ },
1251
+ "cancelLabel": {
1252
+ "type": "string",
1253
+ "default": "Cancel Transaction"
1254
+ },
1255
+ "parties": {
1256
+ "type": "[object]",
1257
+ "default": [
1258
+ {
1259
+ "icon": "user",
1260
+ "description": "Initiates transaction",
1261
+ "actionLabel": "Confirm",
1262
+ "actionIcon": "check",
1263
+ "key": "buyer",
1264
+ "label": "Buyer"
1265
+ },
1266
+ {
1267
+ "description": "Fulfills transaction",
1268
+ "key": "seller",
1269
+ "label": "Seller",
1270
+ "icon": "user-check",
1271
+ "actionLabel": "Confirm",
1272
+ "actionIcon": "check"
1273
+ }
1274
+ ]
1275
+ },
1276
+ "cancelIcon": {
1277
+ "type": "string",
1278
+ "default": "x"
1279
+ },
1280
+ "disputeIcon": {
1281
+ "type": "string",
1282
+ "default": "alert-triangle"
1283
+ },
1284
+ "releaseLabel": {
1285
+ "type": "string",
1286
+ "default": "Release Escrow"
1287
+ },
1288
+ "title": {
1289
+ "type": "string",
1290
+ "default": "Multi-Party Transaction"
1291
+ },
1292
+ "releaseIcon": {
1293
+ "type": "string",
1294
+ "default": "unlock"
1295
+ }
1296
+ },
1297
+ "scope": "instance"
1298
+ }
1299
+ ],
1300
+ "pages": [
1301
+ {
1302
+ "name": "MultiPartyFlowPage",
1303
+ "path": "/multi-party-flow",
1304
+ "traits": [
1305
+ {
1306
+ "ref": "MultiPartyTransaction"
1307
+ }
1308
+ ]
1309
+ }
1310
+ ]
1311
+ }
1312
+ ]
1313
+ }