@dstoken-solana/rwa-rbac 0.4.1 → 0.4.3

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/index.js CHANGED
@@ -1,6 +1,5054 @@
1
- export * from "./pdas";
2
- export * from "./types";
3
- export * from "./client";
4
- export * from "./constants";
5
- export * from "./utils";
6
- //# sourceMappingURL=index.js.map
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var web3_js = require('@solana/web3.js');
6
+ var anchor = require('@coral-xyz/anchor');
7
+ var splToken = require('@solana/spl-token');
8
+ var rwaTokenSdk = require('@dstoken-solana/rwa-token-sdk');
9
+
10
+ const IMR_PROGRAM = new web3_js.PublicKey("D2V7wTBbNCKgYwirgRUnSmc2QyKnHSVmRotWJ4rz8Jp9");
11
+ const RBAC_PROGRAM = new web3_js.PublicKey("3g6fUgMsJQhjPUYxNjEU5PyzGf8DerbDx8p5Qh4yMnRR");
12
+ const TL_PROGRAM = new web3_js.PublicKey("9bNt3ZiZpDdHqAt5Q1Wq6twFe5RKmMCwA7MJyK2HgGnU");
13
+
14
+ const deriveInvestorLocks = (investorId, identityRegistry, programId = TL_PROGRAM) => {
15
+ return web3_js.PublicKey.findProgramAddressSync([
16
+ Buffer.from(investorId),
17
+ identityRegistry.toBuffer(),
18
+ Buffer.from("InvestorLocks"),
19
+ ], programId)[0];
20
+ };
21
+ const deriveLockedTokenAccount = (investorId, identityRegistry, programId = TL_PROGRAM) => {
22
+ return web3_js.PublicKey.findProgramAddressSync([
23
+ Buffer.from(investorId),
24
+ identityRegistry.toBuffer(),
25
+ Buffer.from("LockedTokenAccount"),
26
+ ], programId)[0];
27
+ };
28
+ const deriveInvestorPda = (investorId, identityRegistry, programId = IMR_PROGRAM) => {
29
+ return web3_js.PublicKey.findProgramAddressSync([
30
+ Buffer.from(investorId),
31
+ identityRegistry.toBuffer(),
32
+ Buffer.from("Investor"),
33
+ ], programId)[0];
34
+ };
35
+ const deriveAssetAccessControllerPda = (uniqueSeed, programId = RBAC_PROGRAM) => {
36
+ return web3_js.PublicKey.findProgramAddressSync([uniqueSeed.toBuffer(), Buffer.from("AssetAccessController")], programId)[0];
37
+ };
38
+ const deriveControllerAuthorityPda = (assetAccessController, programId = RBAC_PROGRAM) => {
39
+ return web3_js.PublicKey.findProgramAddressSync([assetAccessController.toBuffer()], programId)[0];
40
+ };
41
+ const deriveUserRolePda = (id, assetAccessController, programId = RBAC_PROGRAM) => {
42
+ return web3_js.PublicKey.findProgramAddressSync([
43
+ id.toArrayLike(Buffer, "le", 8),
44
+ assetAccessController.toBuffer(),
45
+ Buffer.from("UserRole"),
46
+ ], programId)[0];
47
+ };
48
+ const getEventAuthority = (programId) => web3_js.PublicKey.findProgramAddressSync([Buffer.from("__event_authority")], programId)[0];
49
+
50
+ var address$1 = "3g6fUgMsJQhjPUYxNjEU5PyzGf8DerbDx8p5Qh4yMnRR";
51
+ var metadata$1 = {
52
+ name: "rwa_rbac",
53
+ version: "0.1.0",
54
+ spec: "0.1.0",
55
+ description: "Created with Anchor"
56
+ };
57
+ var instructions$1 = [
58
+ {
59
+ name: "add_levels",
60
+ discriminator: [
61
+ 101,
62
+ 239,
63
+ 15,
64
+ 85,
65
+ 60,
66
+ 13,
67
+ 183,
68
+ 192
69
+ ],
70
+ accounts: [
71
+ {
72
+ name: "payer",
73
+ writable: true,
74
+ signer: true
75
+ },
76
+ {
77
+ name: "user",
78
+ signer: true
79
+ },
80
+ {
81
+ name: "controller_authority",
82
+ relations: [
83
+ "asset_access_controller"
84
+ ]
85
+ },
86
+ {
87
+ name: "asset_access_controller",
88
+ relations: [
89
+ "authorized_user_role"
90
+ ]
91
+ },
92
+ {
93
+ name: "authorized_user_role"
94
+ },
95
+ {
96
+ name: "identity_metadata_registry_program",
97
+ address: "D2V7wTBbNCKgYwirgRUnSmc2QyKnHSVmRotWJ4rz8Jp9"
98
+ },
99
+ {
100
+ name: "investor",
101
+ writable: true
102
+ },
103
+ {
104
+ name: "identity_registry_program",
105
+ address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
106
+ },
107
+ {
108
+ name: "identity_registry"
109
+ },
110
+ {
111
+ name: "identity_account",
112
+ writable: true
113
+ },
114
+ {
115
+ name: "system_program",
116
+ address: "11111111111111111111111111111111"
117
+ },
118
+ {
119
+ name: "policy_engine_program"
120
+ },
121
+ {
122
+ name: "policy_engine",
123
+ writable: true
124
+ },
125
+ {
126
+ name: "tracker_account"
127
+ },
128
+ {
129
+ name: "asset_mint"
130
+ },
131
+ {
132
+ name: "event_authority_identity_metadata_registry"
133
+ },
134
+ {
135
+ name: "event_authority_identity_registry"
136
+ }
137
+ ],
138
+ args: [
139
+ {
140
+ name: "cpi_data",
141
+ type: "bytes"
142
+ }
143
+ ]
144
+ },
145
+ {
146
+ name: "add_lock",
147
+ discriminator: [
148
+ 242,
149
+ 102,
150
+ 183,
151
+ 107,
152
+ 109,
153
+ 168,
154
+ 82,
155
+ 140
156
+ ],
157
+ accounts: [
158
+ {
159
+ name: "payer",
160
+ writable: true,
161
+ signer: true
162
+ },
163
+ {
164
+ name: "user",
165
+ signer: true
166
+ },
167
+ {
168
+ name: "controller_authority",
169
+ relations: [
170
+ "asset_access_controller"
171
+ ]
172
+ },
173
+ {
174
+ name: "asset_access_controller",
175
+ relations: [
176
+ "authorized_user_role"
177
+ ]
178
+ },
179
+ {
180
+ name: "authorized_user_role"
181
+ },
182
+ {
183
+ name: "policy_engine_program",
184
+ address: "FsE8mCJyvgMzqJbfHbJQm3iuf3cRZC6n2vZi1Q8rQCy2"
185
+ },
186
+ {
187
+ name: "policy_engine",
188
+ writable: true
189
+ },
190
+ {
191
+ name: "asset_mint"
192
+ },
193
+ {
194
+ name: "identity_registry"
195
+ },
196
+ {
197
+ name: "identity_account"
198
+ },
199
+ {
200
+ name: "tracker_account",
201
+ writable: true
202
+ },
203
+ {
204
+ name: "event_authority"
205
+ },
206
+ {
207
+ name: "system_program",
208
+ address: "11111111111111111111111111111111"
209
+ }
210
+ ],
211
+ args: [
212
+ {
213
+ name: "cpi_data",
214
+ type: "bytes"
215
+ }
216
+ ]
217
+ },
218
+ {
219
+ name: "assign_user_role",
220
+ discriminator: [
221
+ 39,
222
+ 8,
223
+ 31,
224
+ 232,
225
+ 255,
226
+ 118,
227
+ 39,
228
+ 44
229
+ ],
230
+ accounts: [
231
+ {
232
+ name: "payer",
233
+ writable: true,
234
+ signer: true
235
+ },
236
+ {
237
+ name: "user",
238
+ signer: true
239
+ },
240
+ {
241
+ name: "asset_access_controller",
242
+ writable: true,
243
+ relations: [
244
+ "user_role",
245
+ "authorized_user_role"
246
+ ]
247
+ },
248
+ {
249
+ name: "user_role",
250
+ writable: true
251
+ },
252
+ {
253
+ name: "authorized_user_role",
254
+ optional: true
255
+ },
256
+ {
257
+ name: "system_program",
258
+ address: "11111111111111111111111111111111"
259
+ },
260
+ {
261
+ name: "event_authority",
262
+ pda: {
263
+ seeds: [
264
+ {
265
+ kind: "const",
266
+ value: [
267
+ 95,
268
+ 95,
269
+ 101,
270
+ 118,
271
+ 101,
272
+ 110,
273
+ 116,
274
+ 95,
275
+ 97,
276
+ 117,
277
+ 116,
278
+ 104,
279
+ 111,
280
+ 114,
281
+ 105,
282
+ 116,
283
+ 121
284
+ ]
285
+ }
286
+ ]
287
+ }
288
+ },
289
+ {
290
+ name: "program"
291
+ }
292
+ ],
293
+ args: [
294
+ {
295
+ name: "users_to_assign",
296
+ type: {
297
+ vec: "pubkey"
298
+ }
299
+ }
300
+ ]
301
+ },
302
+ {
303
+ name: "attach_to_policy_engine",
304
+ discriminator: [
305
+ 99,
306
+ 59,
307
+ 117,
308
+ 21,
309
+ 146,
310
+ 11,
311
+ 54,
312
+ 173
313
+ ],
314
+ accounts: [
315
+ {
316
+ name: "payer",
317
+ writable: true,
318
+ signer: true
319
+ },
320
+ {
321
+ name: "user",
322
+ signer: true
323
+ },
324
+ {
325
+ name: "controller_authority",
326
+ relations: [
327
+ "asset_access_controller"
328
+ ]
329
+ },
330
+ {
331
+ name: "asset_access_controller",
332
+ relations: [
333
+ "authorized_user_role"
334
+ ]
335
+ },
336
+ {
337
+ name: "authorized_user_role"
338
+ },
339
+ {
340
+ name: "policy_engine_program",
341
+ address: "FsE8mCJyvgMzqJbfHbJQm3iuf3cRZC6n2vZi1Q8rQCy2"
342
+ },
343
+ {
344
+ name: "policy_engine",
345
+ writable: true
346
+ },
347
+ {
348
+ name: "system_program",
349
+ address: "11111111111111111111111111111111"
350
+ },
351
+ {
352
+ name: "event_authority"
353
+ }
354
+ ],
355
+ args: [
356
+ {
357
+ name: "cpi_data",
358
+ type: "bytes"
359
+ }
360
+ ]
361
+ },
362
+ {
363
+ name: "attach_wallet_to_identity",
364
+ discriminator: [
365
+ 61,
366
+ 129,
367
+ 252,
368
+ 190,
369
+ 8,
370
+ 202,
371
+ 179,
372
+ 90
373
+ ],
374
+ accounts: [
375
+ {
376
+ name: "payer",
377
+ writable: true,
378
+ signer: true
379
+ },
380
+ {
381
+ name: "user",
382
+ signer: true
383
+ },
384
+ {
385
+ name: "controller_authority",
386
+ relations: [
387
+ "asset_access_controller"
388
+ ]
389
+ },
390
+ {
391
+ name: "asset_access_controller",
392
+ relations: [
393
+ "authorized_user_role"
394
+ ]
395
+ },
396
+ {
397
+ name: "authorized_user_role"
398
+ },
399
+ {
400
+ name: "identity_registry_program",
401
+ address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
402
+ },
403
+ {
404
+ name: "wallet_identity",
405
+ writable: true
406
+ },
407
+ {
408
+ name: "identity_account",
409
+ writable: true
410
+ },
411
+ {
412
+ name: "identity_registry"
413
+ },
414
+ {
415
+ name: "asset_mint"
416
+ },
417
+ {
418
+ name: "system_program",
419
+ address: "11111111111111111111111111111111"
420
+ },
421
+ {
422
+ name: "event_authority"
423
+ }
424
+ ],
425
+ args: [
426
+ {
427
+ name: "cpi_data",
428
+ type: "bytes"
429
+ }
430
+ ]
431
+ },
432
+ {
433
+ name: "change_counter_limits",
434
+ discriminator: [
435
+ 200,
436
+ 2,
437
+ 8,
438
+ 102,
439
+ 43,
440
+ 168,
441
+ 141,
442
+ 139
443
+ ],
444
+ accounts: [
445
+ {
446
+ name: "payer",
447
+ writable: true,
448
+ signer: true
449
+ },
450
+ {
451
+ name: "user",
452
+ signer: true
453
+ },
454
+ {
455
+ name: "controller_authority",
456
+ relations: [
457
+ "asset_access_controller"
458
+ ]
459
+ },
460
+ {
461
+ name: "asset_access_controller",
462
+ relations: [
463
+ "authorized_user_role"
464
+ ]
465
+ },
466
+ {
467
+ name: "authorized_user_role"
468
+ },
469
+ {
470
+ name: "policy_engine_program",
471
+ address: "FsE8mCJyvgMzqJbfHbJQm3iuf3cRZC6n2vZi1Q8rQCy2"
472
+ },
473
+ {
474
+ name: "policy_engine",
475
+ writable: true
476
+ },
477
+ {
478
+ name: "system_program",
479
+ address: "11111111111111111111111111111111"
480
+ },
481
+ {
482
+ name: "event_authority"
483
+ }
484
+ ],
485
+ args: [
486
+ {
487
+ name: "cpi_data",
488
+ type: "bytes"
489
+ }
490
+ ]
491
+ },
492
+ {
493
+ name: "change_counters",
494
+ discriminator: [
495
+ 156,
496
+ 107,
497
+ 88,
498
+ 204,
499
+ 113,
500
+ 131,
501
+ 241,
502
+ 192
503
+ ],
504
+ accounts: [
505
+ {
506
+ name: "payer",
507
+ writable: true,
508
+ signer: true
509
+ },
510
+ {
511
+ name: "user",
512
+ signer: true
513
+ },
514
+ {
515
+ name: "controller_authority",
516
+ relations: [
517
+ "asset_access_controller"
518
+ ]
519
+ },
520
+ {
521
+ name: "asset_access_controller",
522
+ relations: [
523
+ "authorized_user_role"
524
+ ]
525
+ },
526
+ {
527
+ name: "authorized_user_role"
528
+ },
529
+ {
530
+ name: "policy_engine_program",
531
+ address: "FsE8mCJyvgMzqJbfHbJQm3iuf3cRZC6n2vZi1Q8rQCy2"
532
+ },
533
+ {
534
+ name: "policy_engine",
535
+ writable: true
536
+ },
537
+ {
538
+ name: "system_program",
539
+ address: "11111111111111111111111111111111"
540
+ },
541
+ {
542
+ name: "event_authority"
543
+ }
544
+ ],
545
+ args: [
546
+ {
547
+ name: "cpi_data",
548
+ type: "bytes"
549
+ }
550
+ ]
551
+ },
552
+ {
553
+ name: "change_country",
554
+ discriminator: [
555
+ 208,
556
+ 227,
557
+ 224,
558
+ 246,
559
+ 9,
560
+ 254,
561
+ 62,
562
+ 179
563
+ ],
564
+ accounts: [
565
+ {
566
+ name: "payer",
567
+ writable: true,
568
+ signer: true
569
+ },
570
+ {
571
+ name: "user",
572
+ signer: true
573
+ },
574
+ {
575
+ name: "controller_authority",
576
+ relations: [
577
+ "asset_access_controller"
578
+ ]
579
+ },
580
+ {
581
+ name: "asset_access_controller",
582
+ relations: [
583
+ "authorized_user_role"
584
+ ]
585
+ },
586
+ {
587
+ name: "authorized_user_role"
588
+ },
589
+ {
590
+ name: "identity_metadata_registry_program",
591
+ address: "D2V7wTBbNCKgYwirgRUnSmc2QyKnHSVmRotWJ4rz8Jp9"
592
+ },
593
+ {
594
+ name: "investor",
595
+ writable: true
596
+ },
597
+ {
598
+ name: "identity_registry_program",
599
+ address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
600
+ },
601
+ {
602
+ name: "identity_registry"
603
+ },
604
+ {
605
+ name: "identity_account",
606
+ writable: true
607
+ },
608
+ {
609
+ name: "policy_engine_program"
610
+ },
611
+ {
612
+ name: "policy_engine",
613
+ writable: true
614
+ },
615
+ {
616
+ name: "tracker_account"
617
+ },
618
+ {
619
+ name: "asset_mint"
620
+ },
621
+ {
622
+ name: "event_authority_identity_registry"
623
+ }
624
+ ],
625
+ args: [
626
+ {
627
+ name: "cpi_data",
628
+ type: "bytes"
629
+ }
630
+ ]
631
+ },
632
+ {
633
+ name: "change_issuance_policies",
634
+ discriminator: [
635
+ 186,
636
+ 201,
637
+ 163,
638
+ 157,
639
+ 32,
640
+ 250,
641
+ 166,
642
+ 37
643
+ ],
644
+ accounts: [
645
+ {
646
+ name: "payer",
647
+ writable: true,
648
+ signer: true
649
+ },
650
+ {
651
+ name: "user",
652
+ signer: true
653
+ },
654
+ {
655
+ name: "controller_authority",
656
+ relations: [
657
+ "asset_access_controller"
658
+ ]
659
+ },
660
+ {
661
+ name: "asset_access_controller",
662
+ relations: [
663
+ "authorized_user_role"
664
+ ]
665
+ },
666
+ {
667
+ name: "authorized_user_role"
668
+ },
669
+ {
670
+ name: "policy_engine_program",
671
+ address: "FsE8mCJyvgMzqJbfHbJQm3iuf3cRZC6n2vZi1Q8rQCy2"
672
+ },
673
+ {
674
+ name: "policy_engine",
675
+ writable: true
676
+ },
677
+ {
678
+ name: "event_authority"
679
+ }
680
+ ],
681
+ args: [
682
+ {
683
+ name: "cpi_data",
684
+ type: "bytes"
685
+ }
686
+ ]
687
+ },
688
+ {
689
+ name: "change_mapping",
690
+ discriminator: [
691
+ 103,
692
+ 1,
693
+ 52,
694
+ 20,
695
+ 160,
696
+ 194,
697
+ 113,
698
+ 125
699
+ ],
700
+ accounts: [
701
+ {
702
+ name: "payer",
703
+ writable: true,
704
+ signer: true
705
+ },
706
+ {
707
+ name: "user",
708
+ signer: true
709
+ },
710
+ {
711
+ name: "controller_authority",
712
+ relations: [
713
+ "asset_access_controller"
714
+ ]
715
+ },
716
+ {
717
+ name: "asset_access_controller",
718
+ relations: [
719
+ "authorized_user_role"
720
+ ]
721
+ },
722
+ {
723
+ name: "authorized_user_role"
724
+ },
725
+ {
726
+ name: "policy_engine_program",
727
+ address: "FsE8mCJyvgMzqJbfHbJQm3iuf3cRZC6n2vZi1Q8rQCy2"
728
+ },
729
+ {
730
+ name: "policy_engine",
731
+ writable: true
732
+ },
733
+ {
734
+ name: "event_authority"
735
+ }
736
+ ],
737
+ args: [
738
+ {
739
+ name: "cpi_data",
740
+ type: "bytes"
741
+ }
742
+ ]
743
+ },
744
+ {
745
+ name: "create_controller",
746
+ discriminator: [
747
+ 176,
748
+ 246,
749
+ 168,
750
+ 148,
751
+ 10,
752
+ 12,
753
+ 2,
754
+ 48
755
+ ],
756
+ accounts: [
757
+ {
758
+ name: "payer",
759
+ writable: true,
760
+ signer: true
761
+ },
762
+ {
763
+ name: "admin",
764
+ signer: true
765
+ },
766
+ {
767
+ name: "asset_access_controller",
768
+ writable: true,
769
+ pda: {
770
+ seeds: [
771
+ {
772
+ kind: "account",
773
+ path: "asset_mint"
774
+ },
775
+ {
776
+ kind: "const",
777
+ value: [
778
+ 65,
779
+ 115,
780
+ 115,
781
+ 101,
782
+ 116,
783
+ 65,
784
+ 99,
785
+ 99,
786
+ 101,
787
+ 115,
788
+ 115,
789
+ 67,
790
+ 111,
791
+ 110,
792
+ 116,
793
+ 114,
794
+ 111,
795
+ 108,
796
+ 108,
797
+ 101,
798
+ 114
799
+ ]
800
+ }
801
+ ]
802
+ }
803
+ },
804
+ {
805
+ name: "asset_access_controller_authority",
806
+ pda: {
807
+ seeds: [
808
+ {
809
+ kind: "account",
810
+ path: "asset_access_controller"
811
+ }
812
+ ]
813
+ }
814
+ },
815
+ {
816
+ name: "asset_controller",
817
+ writable: true
818
+ },
819
+ {
820
+ name: "asset_mint",
821
+ writable: true,
822
+ signer: true
823
+ },
824
+ {
825
+ name: "extra_metas_account",
826
+ writable: true
827
+ },
828
+ {
829
+ name: "policy_engine_account",
830
+ writable: true
831
+ },
832
+ {
833
+ name: "identity_registry_account",
834
+ writable: true
835
+ },
836
+ {
837
+ name: "policy_engine_program"
838
+ },
839
+ {
840
+ name: "identity_registry_program"
841
+ },
842
+ {
843
+ name: "asset_controller_program"
844
+ },
845
+ {
846
+ name: "asset_controller_event_authority"
847
+ },
848
+ {
849
+ name: "token_program"
850
+ },
851
+ {
852
+ name: "system_program",
853
+ address: "11111111111111111111111111111111"
854
+ }
855
+ ],
856
+ args: [
857
+ {
858
+ name: "cpi_data",
859
+ type: "bytes"
860
+ }
861
+ ]
862
+ },
863
+ {
864
+ name: "create_identity_account",
865
+ discriminator: [
866
+ 82,
867
+ 240,
868
+ 35,
869
+ 129,
870
+ 113,
871
+ 134,
872
+ 116,
873
+ 70
874
+ ],
875
+ accounts: [
876
+ {
877
+ name: "payer",
878
+ writable: true,
879
+ signer: true
880
+ },
881
+ {
882
+ name: "user",
883
+ signer: true
884
+ },
885
+ {
886
+ name: "controller_authority",
887
+ relations: [
888
+ "asset_access_controller"
889
+ ]
890
+ },
891
+ {
892
+ name: "asset_access_controller",
893
+ relations: [
894
+ "authorized_user_role"
895
+ ]
896
+ },
897
+ {
898
+ name: "authorized_user_role"
899
+ },
900
+ {
901
+ name: "identity_registry_program",
902
+ address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
903
+ },
904
+ {
905
+ name: "identity_registry"
906
+ },
907
+ {
908
+ name: "identity_account",
909
+ writable: true
910
+ },
911
+ {
912
+ name: "wallet_identity",
913
+ writable: true
914
+ },
915
+ {
916
+ name: "policy_engine_program"
917
+ },
918
+ {
919
+ name: "tracker_account",
920
+ writable: true
921
+ },
922
+ {
923
+ name: "asset_mint"
924
+ },
925
+ {
926
+ name: "system_program",
927
+ address: "11111111111111111111111111111111"
928
+ },
929
+ {
930
+ name: "event_authority"
931
+ }
932
+ ],
933
+ args: [
934
+ {
935
+ name: "cpi_data",
936
+ type: "bytes"
937
+ }
938
+ ]
939
+ },
940
+ {
941
+ name: "create_user_role",
942
+ discriminator: [
943
+ 13,
944
+ 20,
945
+ 224,
946
+ 42,
947
+ 3,
948
+ 120,
949
+ 67,
950
+ 23
951
+ ],
952
+ accounts: [
953
+ {
954
+ name: "payer",
955
+ writable: true,
956
+ signer: true
957
+ },
958
+ {
959
+ name: "user",
960
+ signer: true
961
+ },
962
+ {
963
+ name: "new_user_role",
964
+ writable: true
965
+ },
966
+ {
967
+ name: "asset_access_controller",
968
+ writable: true,
969
+ relations: [
970
+ "authorized_user_role"
971
+ ]
972
+ },
973
+ {
974
+ name: "authorized_user_role",
975
+ optional: true
976
+ },
977
+ {
978
+ name: "system_program",
979
+ address: "11111111111111111111111111111111"
980
+ }
981
+ ],
982
+ args: [
983
+ {
984
+ name: "name",
985
+ type: "string"
986
+ },
987
+ {
988
+ name: "allowed_admin_ixs",
989
+ type: "u64"
990
+ },
991
+ {
992
+ name: "allowed_medici_ixs",
993
+ type: "u64"
994
+ },
995
+ {
996
+ name: "is_master_role",
997
+ type: "bool"
998
+ }
999
+ ]
1000
+ },
1001
+ {
1002
+ name: "delete_user_role",
1003
+ discriminator: [
1004
+ 177,
1005
+ 139,
1006
+ 27,
1007
+ 46,
1008
+ 113,
1009
+ 250,
1010
+ 139,
1011
+ 225
1012
+ ],
1013
+ accounts: [
1014
+ {
1015
+ name: "receiver",
1016
+ writable: true
1017
+ },
1018
+ {
1019
+ name: "user",
1020
+ signer: true
1021
+ },
1022
+ {
1023
+ name: "asset_access_controller",
1024
+ relations: [
1025
+ "user_role",
1026
+ "authorized_user_role"
1027
+ ]
1028
+ },
1029
+ {
1030
+ name: "user_role",
1031
+ writable: true
1032
+ },
1033
+ {
1034
+ name: "authorized_user_role",
1035
+ optional: true
1036
+ }
1037
+ ],
1038
+ args: [
1039
+ ]
1040
+ },
1041
+ {
1042
+ name: "detach_from_policy_engine",
1043
+ discriminator: [
1044
+ 156,
1045
+ 137,
1046
+ 67,
1047
+ 121,
1048
+ 46,
1049
+ 207,
1050
+ 45,
1051
+ 12
1052
+ ],
1053
+ accounts: [
1054
+ {
1055
+ name: "payer",
1056
+ writable: true,
1057
+ signer: true
1058
+ },
1059
+ {
1060
+ name: "user",
1061
+ signer: true
1062
+ },
1063
+ {
1064
+ name: "controller_authority",
1065
+ relations: [
1066
+ "asset_access_controller"
1067
+ ]
1068
+ },
1069
+ {
1070
+ name: "asset_access_controller",
1071
+ relations: [
1072
+ "authorized_user_role"
1073
+ ]
1074
+ },
1075
+ {
1076
+ name: "authorized_user_role"
1077
+ },
1078
+ {
1079
+ name: "policy_engine_program",
1080
+ address: "FsE8mCJyvgMzqJbfHbJQm3iuf3cRZC6n2vZi1Q8rQCy2"
1081
+ },
1082
+ {
1083
+ name: "policy_engine",
1084
+ writable: true
1085
+ },
1086
+ {
1087
+ name: "system_program",
1088
+ address: "11111111111111111111111111111111"
1089
+ },
1090
+ {
1091
+ name: "event_authority"
1092
+ }
1093
+ ],
1094
+ args: [
1095
+ {
1096
+ name: "cpi_data",
1097
+ type: "bytes"
1098
+ }
1099
+ ]
1100
+ },
1101
+ {
1102
+ name: "detach_wallet_from_identity",
1103
+ discriminator: [
1104
+ 166,
1105
+ 70,
1106
+ 236,
1107
+ 254,
1108
+ 166,
1109
+ 116,
1110
+ 201,
1111
+ 50
1112
+ ],
1113
+ accounts: [
1114
+ {
1115
+ name: "payer",
1116
+ writable: true,
1117
+ signer: true
1118
+ },
1119
+ {
1120
+ name: "user",
1121
+ signer: true
1122
+ },
1123
+ {
1124
+ name: "controller_authority",
1125
+ writable: true,
1126
+ relations: [
1127
+ "asset_access_controller"
1128
+ ]
1129
+ },
1130
+ {
1131
+ name: "asset_access_controller",
1132
+ relations: [
1133
+ "authorized_user_role"
1134
+ ]
1135
+ },
1136
+ {
1137
+ name: "authorized_user_role"
1138
+ },
1139
+ {
1140
+ name: "identity_registry_program",
1141
+ address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
1142
+ },
1143
+ {
1144
+ name: "wallet_identity",
1145
+ writable: true
1146
+ },
1147
+ {
1148
+ name: "identity_account",
1149
+ writable: true
1150
+ },
1151
+ {
1152
+ name: "identity_registry"
1153
+ },
1154
+ {
1155
+ name: "token_account"
1156
+ },
1157
+ {
1158
+ name: "asset_mint"
1159
+ },
1160
+ {
1161
+ name: "event_authority"
1162
+ }
1163
+ ],
1164
+ args: [
1165
+ {
1166
+ name: "cpi_data",
1167
+ type: "bytes"
1168
+ }
1169
+ ]
1170
+ },
1171
+ {
1172
+ name: "freeze_token_account",
1173
+ discriminator: [
1174
+ 138,
1175
+ 168,
1176
+ 178,
1177
+ 109,
1178
+ 205,
1179
+ 224,
1180
+ 209,
1181
+ 93
1182
+ ],
1183
+ accounts: [
1184
+ {
1185
+ name: "user",
1186
+ signer: true
1187
+ },
1188
+ {
1189
+ name: "controller_authority",
1190
+ relations: [
1191
+ "asset_access_controller"
1192
+ ]
1193
+ },
1194
+ {
1195
+ name: "asset_access_controller",
1196
+ relations: [
1197
+ "authorized_user_role"
1198
+ ]
1199
+ },
1200
+ {
1201
+ name: "authorized_user_role"
1202
+ },
1203
+ {
1204
+ name: "asset_controller_program",
1205
+ address: "7tXjmbkZVY3Gmg9kDBebcNXT1yC5pyoxxXVLwdbv9tvP"
1206
+ },
1207
+ {
1208
+ name: "asset_mint",
1209
+ writable: true
1210
+ },
1211
+ {
1212
+ name: "asset_controller"
1213
+ },
1214
+ {
1215
+ name: "token_account",
1216
+ writable: true
1217
+ },
1218
+ {
1219
+ name: "token_program",
1220
+ address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
1221
+ }
1222
+ ],
1223
+ args: [
1224
+ {
1225
+ name: "cpi_data",
1226
+ type: "bytes"
1227
+ }
1228
+ ]
1229
+ },
1230
+ {
1231
+ name: "issue_tokens",
1232
+ discriminator: [
1233
+ 40,
1234
+ 207,
1235
+ 145,
1236
+ 106,
1237
+ 249,
1238
+ 54,
1239
+ 23,
1240
+ 179
1241
+ ],
1242
+ accounts: [
1243
+ {
1244
+ name: "payer",
1245
+ writable: true,
1246
+ signer: true
1247
+ },
1248
+ {
1249
+ name: "user",
1250
+ signer: true
1251
+ },
1252
+ {
1253
+ name: "controller_authority",
1254
+ writable: true,
1255
+ relations: [
1256
+ "asset_access_controller"
1257
+ ]
1258
+ },
1259
+ {
1260
+ name: "asset_access_controller",
1261
+ relations: [
1262
+ "authorized_user_role"
1263
+ ]
1264
+ },
1265
+ {
1266
+ name: "authorized_user_role"
1267
+ },
1268
+ {
1269
+ name: "asset_controller_program",
1270
+ address: "7tXjmbkZVY3Gmg9kDBebcNXT1yC5pyoxxXVLwdbv9tvP"
1271
+ },
1272
+ {
1273
+ name: "asset_mint",
1274
+ writable: true
1275
+ },
1276
+ {
1277
+ name: "asset_controller"
1278
+ },
1279
+ {
1280
+ name: "to"
1281
+ },
1282
+ {
1283
+ name: "token_account",
1284
+ writable: true
1285
+ },
1286
+ {
1287
+ name: "identity_registry",
1288
+ writable: true
1289
+ },
1290
+ {
1291
+ name: "identity_account"
1292
+ },
1293
+ {
1294
+ name: "tracker_account",
1295
+ writable: true
1296
+ },
1297
+ {
1298
+ name: "token_program",
1299
+ address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
1300
+ },
1301
+ {
1302
+ name: "associated_token_program",
1303
+ address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
1304
+ },
1305
+ {
1306
+ name: "system_program",
1307
+ address: "11111111111111111111111111111111"
1308
+ },
1309
+ {
1310
+ name: "policy_engine_program",
1311
+ address: "FsE8mCJyvgMzqJbfHbJQm3iuf3cRZC6n2vZi1Q8rQCy2"
1312
+ },
1313
+ {
1314
+ name: "policy_engine",
1315
+ writable: true
1316
+ },
1317
+ {
1318
+ name: "wallet_identity_account"
1319
+ },
1320
+ {
1321
+ name: "event_authority"
1322
+ }
1323
+ ],
1324
+ args: [
1325
+ {
1326
+ name: "cpi_data",
1327
+ type: "bytes"
1328
+ }
1329
+ ]
1330
+ },
1331
+ {
1332
+ name: "modify_user_role",
1333
+ discriminator: [
1334
+ 108,
1335
+ 235,
1336
+ 68,
1337
+ 252,
1338
+ 229,
1339
+ 247,
1340
+ 71,
1341
+ 185
1342
+ ],
1343
+ accounts: [
1344
+ {
1345
+ name: "user",
1346
+ signer: true
1347
+ },
1348
+ {
1349
+ name: "asset_access_controller",
1350
+ relations: [
1351
+ "user_role",
1352
+ "authorized_user_role"
1353
+ ]
1354
+ },
1355
+ {
1356
+ name: "user_role",
1357
+ writable: true
1358
+ },
1359
+ {
1360
+ name: "authorized_user_role",
1361
+ optional: true
1362
+ }
1363
+ ],
1364
+ args: [
1365
+ {
1366
+ name: "name",
1367
+ type: "string"
1368
+ },
1369
+ {
1370
+ name: "allowed_admin_ixs",
1371
+ type: "u64"
1372
+ },
1373
+ {
1374
+ name: "allowed_medici_ixs",
1375
+ type: "u64"
1376
+ }
1377
+ ]
1378
+ },
1379
+ {
1380
+ name: "register_investor",
1381
+ discriminator: [
1382
+ 95,
1383
+ 16,
1384
+ 66,
1385
+ 212,
1386
+ 152,
1387
+ 123,
1388
+ 136,
1389
+ 173
1390
+ ],
1391
+ accounts: [
1392
+ {
1393
+ name: "payer",
1394
+ writable: true,
1395
+ signer: true
1396
+ },
1397
+ {
1398
+ name: "user",
1399
+ signer: true
1400
+ },
1401
+ {
1402
+ name: "controller_authority",
1403
+ relations: [
1404
+ "asset_access_controller"
1405
+ ]
1406
+ },
1407
+ {
1408
+ name: "asset_access_controller",
1409
+ relations: [
1410
+ "authorized_user_role"
1411
+ ]
1412
+ },
1413
+ {
1414
+ name: "authorized_user_role"
1415
+ },
1416
+ {
1417
+ name: "identity_metadata_registry_program",
1418
+ address: "D2V7wTBbNCKgYwirgRUnSmc2QyKnHSVmRotWJ4rz8Jp9"
1419
+ },
1420
+ {
1421
+ name: "investor",
1422
+ writable: true
1423
+ },
1424
+ {
1425
+ name: "identity_registry_program",
1426
+ address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
1427
+ },
1428
+ {
1429
+ name: "identity_registry"
1430
+ },
1431
+ {
1432
+ name: "identity_account",
1433
+ writable: true
1434
+ },
1435
+ {
1436
+ name: "wallet_identity",
1437
+ writable: true
1438
+ },
1439
+ {
1440
+ name: "policy_engine_program"
1441
+ },
1442
+ {
1443
+ name: "tracker_account",
1444
+ writable: true
1445
+ },
1446
+ {
1447
+ name: "asset_mint"
1448
+ },
1449
+ {
1450
+ name: "event_authority_identity_metadata_registry"
1451
+ },
1452
+ {
1453
+ name: "event_authority_identity_registry"
1454
+ },
1455
+ {
1456
+ name: "system_program",
1457
+ address: "11111111111111111111111111111111"
1458
+ }
1459
+ ],
1460
+ args: [
1461
+ {
1462
+ name: "cpi_data",
1463
+ type: "bytes"
1464
+ }
1465
+ ]
1466
+ },
1467
+ {
1468
+ name: "remove_identity_account",
1469
+ discriminator: [
1470
+ 78,
1471
+ 35,
1472
+ 174,
1473
+ 50,
1474
+ 72,
1475
+ 181,
1476
+ 12,
1477
+ 42
1478
+ ],
1479
+ accounts: [
1480
+ {
1481
+ name: "payer",
1482
+ writable: true,
1483
+ signer: true
1484
+ },
1485
+ {
1486
+ name: "user",
1487
+ signer: true
1488
+ },
1489
+ {
1490
+ name: "controller_authority",
1491
+ relations: [
1492
+ "asset_access_controller"
1493
+ ]
1494
+ },
1495
+ {
1496
+ name: "asset_access_controller",
1497
+ relations: [
1498
+ "authorized_user_role"
1499
+ ]
1500
+ },
1501
+ {
1502
+ name: "authorized_user_role"
1503
+ },
1504
+ {
1505
+ name: "identity_registry_program",
1506
+ address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
1507
+ },
1508
+ {
1509
+ name: "identity_registry"
1510
+ },
1511
+ {
1512
+ name: "identity_account",
1513
+ writable: true
1514
+ },
1515
+ {
1516
+ name: "wallet_identity",
1517
+ writable: true
1518
+ },
1519
+ {
1520
+ name: "event_authority"
1521
+ },
1522
+ {
1523
+ name: "identity_owner"
1524
+ },
1525
+ {
1526
+ name: "policy_engine_program"
1527
+ },
1528
+ {
1529
+ name: "tracker_account",
1530
+ writable: true
1531
+ },
1532
+ {
1533
+ name: "asset_mint"
1534
+ }
1535
+ ],
1536
+ args: [
1537
+ {
1538
+ name: "cpi_data",
1539
+ type: "bytes"
1540
+ }
1541
+ ]
1542
+ },
1543
+ {
1544
+ name: "remove_investor",
1545
+ discriminator: [
1546
+ 93,
1547
+ 0,
1548
+ 162,
1549
+ 199,
1550
+ 76,
1551
+ 5,
1552
+ 180,
1553
+ 2
1554
+ ],
1555
+ accounts: [
1556
+ {
1557
+ name: "payer",
1558
+ writable: true,
1559
+ signer: true
1560
+ },
1561
+ {
1562
+ name: "user",
1563
+ signer: true
1564
+ },
1565
+ {
1566
+ name: "controller_authority",
1567
+ relations: [
1568
+ "asset_access_controller"
1569
+ ]
1570
+ },
1571
+ {
1572
+ name: "asset_access_controller",
1573
+ relations: [
1574
+ "authorized_user_role"
1575
+ ]
1576
+ },
1577
+ {
1578
+ name: "authorized_user_role"
1579
+ },
1580
+ {
1581
+ name: "identity_metadata_registry_program",
1582
+ address: "D2V7wTBbNCKgYwirgRUnSmc2QyKnHSVmRotWJ4rz8Jp9"
1583
+ },
1584
+ {
1585
+ name: "investor",
1586
+ writable: true
1587
+ },
1588
+ {
1589
+ name: "identity_registry_program",
1590
+ address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
1591
+ },
1592
+ {
1593
+ name: "identity_registry"
1594
+ },
1595
+ {
1596
+ name: "identity_account",
1597
+ writable: true
1598
+ },
1599
+ {
1600
+ name: "wallet_identity",
1601
+ writable: true
1602
+ },
1603
+ {
1604
+ name: "policy_engine_program",
1605
+ address: "FsE8mCJyvgMzqJbfHbJQm3iuf3cRZC6n2vZi1Q8rQCy2"
1606
+ },
1607
+ {
1608
+ name: "tracker_account",
1609
+ writable: true
1610
+ },
1611
+ {
1612
+ name: "event_authority_identity_metadata_registry"
1613
+ },
1614
+ {
1615
+ name: "event_authority_identity_registry"
1616
+ },
1617
+ {
1618
+ name: "asset_mint"
1619
+ }
1620
+ ],
1621
+ args: [
1622
+ ]
1623
+ },
1624
+ {
1625
+ name: "remove_levels",
1626
+ discriminator: [
1627
+ 200,
1628
+ 96,
1629
+ 65,
1630
+ 253,
1631
+ 97,
1632
+ 55,
1633
+ 16,
1634
+ 192
1635
+ ],
1636
+ accounts: [
1637
+ {
1638
+ name: "payer",
1639
+ writable: true,
1640
+ signer: true
1641
+ },
1642
+ {
1643
+ name: "user",
1644
+ signer: true
1645
+ },
1646
+ {
1647
+ name: "controller_authority",
1648
+ relations: [
1649
+ "asset_access_controller"
1650
+ ]
1651
+ },
1652
+ {
1653
+ name: "asset_access_controller",
1654
+ relations: [
1655
+ "authorized_user_role"
1656
+ ]
1657
+ },
1658
+ {
1659
+ name: "authorized_user_role"
1660
+ },
1661
+ {
1662
+ name: "identity_metadata_registry_program",
1663
+ address: "D2V7wTBbNCKgYwirgRUnSmc2QyKnHSVmRotWJ4rz8Jp9"
1664
+ },
1665
+ {
1666
+ name: "investor",
1667
+ writable: true
1668
+ },
1669
+ {
1670
+ name: "identity_registry_program",
1671
+ address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
1672
+ },
1673
+ {
1674
+ name: "identity_registry"
1675
+ },
1676
+ {
1677
+ name: "identity_account",
1678
+ writable: true
1679
+ },
1680
+ {
1681
+ name: "system_program",
1682
+ address: "11111111111111111111111111111111"
1683
+ },
1684
+ {
1685
+ name: "policy_engine_program"
1686
+ },
1687
+ {
1688
+ name: "policy_engine",
1689
+ writable: true
1690
+ },
1691
+ {
1692
+ name: "tracker_account"
1693
+ },
1694
+ {
1695
+ name: "asset_mint"
1696
+ },
1697
+ {
1698
+ name: "event_authority_identity_registry"
1699
+ }
1700
+ ],
1701
+ args: [
1702
+ {
1703
+ name: "cpi_data",
1704
+ type: "bytes"
1705
+ }
1706
+ ]
1707
+ },
1708
+ {
1709
+ name: "remove_lock",
1710
+ discriminator: [
1711
+ 1,
1712
+ 17,
1713
+ 121,
1714
+ 74,
1715
+ 62,
1716
+ 241,
1717
+ 127,
1718
+ 120
1719
+ ],
1720
+ accounts: [
1721
+ {
1722
+ name: "payer",
1723
+ writable: true,
1724
+ signer: true
1725
+ },
1726
+ {
1727
+ name: "user",
1728
+ signer: true
1729
+ },
1730
+ {
1731
+ name: "controller_authority",
1732
+ relations: [
1733
+ "asset_access_controller"
1734
+ ]
1735
+ },
1736
+ {
1737
+ name: "asset_access_controller",
1738
+ relations: [
1739
+ "authorized_user_role"
1740
+ ]
1741
+ },
1742
+ {
1743
+ name: "authorized_user_role"
1744
+ },
1745
+ {
1746
+ name: "policy_engine_program",
1747
+ address: "FsE8mCJyvgMzqJbfHbJQm3iuf3cRZC6n2vZi1Q8rQCy2"
1748
+ },
1749
+ {
1750
+ name: "policy_engine",
1751
+ writable: true
1752
+ },
1753
+ {
1754
+ name: "asset_mint"
1755
+ },
1756
+ {
1757
+ name: "identity_registry"
1758
+ },
1759
+ {
1760
+ name: "identity_account"
1761
+ },
1762
+ {
1763
+ name: "tracker_account",
1764
+ writable: true
1765
+ },
1766
+ {
1767
+ name: "event_authority"
1768
+ },
1769
+ {
1770
+ name: "system_program",
1771
+ address: "11111111111111111111111111111111"
1772
+ }
1773
+ ],
1774
+ args: [
1775
+ {
1776
+ name: "cpi_data",
1777
+ type: "bytes"
1778
+ }
1779
+ ]
1780
+ },
1781
+ {
1782
+ name: "remove_user_role",
1783
+ discriminator: [
1784
+ 43,
1785
+ 242,
1786
+ 133,
1787
+ 94,
1788
+ 48,
1789
+ 124,
1790
+ 214,
1791
+ 153
1792
+ ],
1793
+ accounts: [
1794
+ {
1795
+ name: "user",
1796
+ signer: true
1797
+ },
1798
+ {
1799
+ name: "asset_access_controller",
1800
+ relations: [
1801
+ "user_role",
1802
+ "authorized_user_role"
1803
+ ]
1804
+ },
1805
+ {
1806
+ name: "user_role",
1807
+ writable: true
1808
+ },
1809
+ {
1810
+ name: "authorized_user_role",
1811
+ optional: true
1812
+ },
1813
+ {
1814
+ name: "event_authority",
1815
+ pda: {
1816
+ seeds: [
1817
+ {
1818
+ kind: "const",
1819
+ value: [
1820
+ 95,
1821
+ 95,
1822
+ 101,
1823
+ 118,
1824
+ 101,
1825
+ 110,
1826
+ 116,
1827
+ 95,
1828
+ 97,
1829
+ 117,
1830
+ 116,
1831
+ 104,
1832
+ 111,
1833
+ 114,
1834
+ 105,
1835
+ 116,
1836
+ 121
1837
+ ]
1838
+ }
1839
+ ]
1840
+ }
1841
+ },
1842
+ {
1843
+ name: "program"
1844
+ }
1845
+ ],
1846
+ args: [
1847
+ {
1848
+ name: "users_to_remove",
1849
+ type: {
1850
+ vec: "pubkey"
1851
+ }
1852
+ }
1853
+ ]
1854
+ },
1855
+ {
1856
+ name: "revoke_tokens",
1857
+ discriminator: [
1858
+ 215,
1859
+ 42,
1860
+ 15,
1861
+ 134,
1862
+ 173,
1863
+ 80,
1864
+ 33,
1865
+ 21
1866
+ ],
1867
+ accounts: [
1868
+ {
1869
+ name: "user",
1870
+ signer: true
1871
+ },
1872
+ {
1873
+ name: "controller_authority",
1874
+ writable: true,
1875
+ relations: [
1876
+ "asset_access_controller"
1877
+ ]
1878
+ },
1879
+ {
1880
+ name: "asset_access_controller",
1881
+ relations: [
1882
+ "authorized_user_role"
1883
+ ]
1884
+ },
1885
+ {
1886
+ name: "authorized_user_role"
1887
+ },
1888
+ {
1889
+ name: "asset_controller_program",
1890
+ address: "7tXjmbkZVY3Gmg9kDBebcNXT1yC5pyoxxXVLwdbv9tvP"
1891
+ },
1892
+ {
1893
+ name: "asset_mint",
1894
+ writable: true
1895
+ },
1896
+ {
1897
+ name: "asset_controller"
1898
+ },
1899
+ {
1900
+ name: "revoke_token_account",
1901
+ writable: true
1902
+ },
1903
+ {
1904
+ name: "identity_registry"
1905
+ },
1906
+ {
1907
+ name: "identity_account"
1908
+ },
1909
+ {
1910
+ name: "tracker_account",
1911
+ writable: true
1912
+ },
1913
+ {
1914
+ name: "policy_engine_program"
1915
+ },
1916
+ {
1917
+ name: "policy_engine",
1918
+ writable: true
1919
+ },
1920
+ {
1921
+ name: "wallet_identity_account"
1922
+ },
1923
+ {
1924
+ name: "token_program",
1925
+ address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
1926
+ },
1927
+ {
1928
+ name: "associated_token_program",
1929
+ address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
1930
+ },
1931
+ {
1932
+ name: "system_program",
1933
+ address: "11111111111111111111111111111111"
1934
+ },
1935
+ {
1936
+ name: "event_authority"
1937
+ }
1938
+ ],
1939
+ args: [
1940
+ {
1941
+ name: "cpi_data",
1942
+ type: "bytes"
1943
+ }
1944
+ ]
1945
+ },
1946
+ {
1947
+ name: "seize_tokens",
1948
+ discriminator: [
1949
+ 79,
1950
+ 30,
1951
+ 69,
1952
+ 54,
1953
+ 78,
1954
+ 1,
1955
+ 16,
1956
+ 23
1957
+ ],
1958
+ accounts: [
1959
+ {
1960
+ name: "user",
1961
+ signer: true
1962
+ },
1963
+ {
1964
+ name: "controller_authority",
1965
+ writable: true,
1966
+ relations: [
1967
+ "asset_access_controller"
1968
+ ]
1969
+ },
1970
+ {
1971
+ name: "asset_access_controller",
1972
+ relations: [
1973
+ "authorized_user_role"
1974
+ ]
1975
+ },
1976
+ {
1977
+ name: "authorized_user_role"
1978
+ },
1979
+ {
1980
+ name: "asset_controller_program",
1981
+ address: "7tXjmbkZVY3Gmg9kDBebcNXT1yC5pyoxxXVLwdbv9tvP"
1982
+ },
1983
+ {
1984
+ name: "asset_mint"
1985
+ },
1986
+ {
1987
+ name: "asset_controller"
1988
+ },
1989
+ {
1990
+ name: "destination_token_account",
1991
+ writable: true
1992
+ },
1993
+ {
1994
+ name: "source_token_account",
1995
+ writable: true
1996
+ },
1997
+ {
1998
+ name: "token_program",
1999
+ address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
2000
+ },
2001
+ {
2002
+ name: "event_authority"
2003
+ }
2004
+ ],
2005
+ args: [
2006
+ {
2007
+ name: "cpi_data",
2008
+ type: "bytes"
2009
+ }
2010
+ ]
2011
+ },
2012
+ {
2013
+ name: "set_counters",
2014
+ discriminator: [
2015
+ 127,
2016
+ 151,
2017
+ 147,
2018
+ 141,
2019
+ 171,
2020
+ 53,
2021
+ 28,
2022
+ 135
2023
+ ],
2024
+ accounts: [
2025
+ {
2026
+ name: "payer",
2027
+ writable: true,
2028
+ signer: true
2029
+ },
2030
+ {
2031
+ name: "user",
2032
+ signer: true
2033
+ },
2034
+ {
2035
+ name: "controller_authority",
2036
+ relations: [
2037
+ "asset_access_controller"
2038
+ ]
2039
+ },
2040
+ {
2041
+ name: "asset_access_controller",
2042
+ relations: [
2043
+ "authorized_user_role"
2044
+ ]
2045
+ },
2046
+ {
2047
+ name: "authorized_user_role"
2048
+ },
2049
+ {
2050
+ name: "policy_engine_program",
2051
+ address: "FsE8mCJyvgMzqJbfHbJQm3iuf3cRZC6n2vZi1Q8rQCy2"
2052
+ },
2053
+ {
2054
+ name: "policy_engine",
2055
+ writable: true
2056
+ },
2057
+ {
2058
+ name: "event_authority"
2059
+ }
2060
+ ],
2061
+ args: [
2062
+ {
2063
+ name: "cpi_data",
2064
+ type: "bytes"
2065
+ }
2066
+ ]
2067
+ },
2068
+ {
2069
+ name: "set_lut_address",
2070
+ discriminator: [
2071
+ 254,
2072
+ 239,
2073
+ 106,
2074
+ 70,
2075
+ 17,
2076
+ 87,
2077
+ 57,
2078
+ 202
2079
+ ],
2080
+ accounts: [
2081
+ {
2082
+ name: "user",
2083
+ signer: true
2084
+ },
2085
+ {
2086
+ name: "asset_access_controller",
2087
+ writable: true,
2088
+ relations: [
2089
+ "authorized_user_role"
2090
+ ]
2091
+ },
2092
+ {
2093
+ name: "authorized_user_role",
2094
+ optional: true
2095
+ },
2096
+ {
2097
+ name: "lut_address"
2098
+ }
2099
+ ],
2100
+ args: [
2101
+ ]
2102
+ },
2103
+ {
2104
+ name: "thaw_token_account",
2105
+ discriminator: [
2106
+ 199,
2107
+ 172,
2108
+ 96,
2109
+ 93,
2110
+ 244,
2111
+ 252,
2112
+ 137,
2113
+ 171
2114
+ ],
2115
+ accounts: [
2116
+ {
2117
+ name: "user",
2118
+ signer: true
2119
+ },
2120
+ {
2121
+ name: "controller_authority",
2122
+ relations: [
2123
+ "asset_access_controller"
2124
+ ]
2125
+ },
2126
+ {
2127
+ name: "asset_access_controller",
2128
+ relations: [
2129
+ "authorized_user_role"
2130
+ ]
2131
+ },
2132
+ {
2133
+ name: "authorized_user_role"
2134
+ },
2135
+ {
2136
+ name: "asset_controller_program",
2137
+ address: "7tXjmbkZVY3Gmg9kDBebcNXT1yC5pyoxxXVLwdbv9tvP"
2138
+ },
2139
+ {
2140
+ name: "asset_mint",
2141
+ writable: true
2142
+ },
2143
+ {
2144
+ name: "asset_controller"
2145
+ },
2146
+ {
2147
+ name: "token_account",
2148
+ writable: true
2149
+ },
2150
+ {
2151
+ name: "token_program",
2152
+ address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
2153
+ }
2154
+ ],
2155
+ args: [
2156
+ {
2157
+ name: "cpi_data",
2158
+ type: "bytes"
2159
+ }
2160
+ ]
2161
+ },
2162
+ {
2163
+ name: "update_asset_metadata",
2164
+ discriminator: [
2165
+ 217,
2166
+ 98,
2167
+ 205,
2168
+ 153,
2169
+ 242,
2170
+ 4,
2171
+ 41,
2172
+ 76
2173
+ ],
2174
+ accounts: [
2175
+ {
2176
+ name: "payer",
2177
+ writable: true,
2178
+ signer: true
2179
+ },
2180
+ {
2181
+ name: "user",
2182
+ signer: true
2183
+ },
2184
+ {
2185
+ name: "controller_authority",
2186
+ writable: true,
2187
+ relations: [
2188
+ "asset_access_controller"
2189
+ ]
2190
+ },
2191
+ {
2192
+ name: "asset_access_controller",
2193
+ relations: [
2194
+ "authorized_user_role"
2195
+ ]
2196
+ },
2197
+ {
2198
+ name: "authorized_user_role"
2199
+ },
2200
+ {
2201
+ name: "asset_controller_program",
2202
+ address: "7tXjmbkZVY3Gmg9kDBebcNXT1yC5pyoxxXVLwdbv9tvP"
2203
+ },
2204
+ {
2205
+ name: "asset_mint",
2206
+ writable: true
2207
+ },
2208
+ {
2209
+ name: "asset_controller"
2210
+ },
2211
+ {
2212
+ name: "event_authority"
2213
+ },
2214
+ {
2215
+ name: "system_program",
2216
+ address: "11111111111111111111111111111111"
2217
+ },
2218
+ {
2219
+ name: "token_program",
2220
+ address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
2221
+ }
2222
+ ],
2223
+ args: [
2224
+ {
2225
+ name: "cpi_data",
2226
+ type: "bytes"
2227
+ }
2228
+ ]
2229
+ },
2230
+ {
2231
+ name: "update_controller_admin",
2232
+ discriminator: [
2233
+ 94,
2234
+ 188,
2235
+ 33,
2236
+ 18,
2237
+ 191,
2238
+ 119,
2239
+ 128,
2240
+ 209
2241
+ ],
2242
+ accounts: [
2243
+ {
2244
+ name: "admin",
2245
+ signer: true,
2246
+ relations: [
2247
+ "asset_access_controller"
2248
+ ]
2249
+ },
2250
+ {
2251
+ name: "asset_access_controller",
2252
+ writable: true
2253
+ }
2254
+ ],
2255
+ args: [
2256
+ {
2257
+ name: "new_admin",
2258
+ type: "pubkey"
2259
+ }
2260
+ ]
2261
+ },
2262
+ {
2263
+ name: "update_interest_bearing_mint_rate",
2264
+ discriminator: [
2265
+ 29,
2266
+ 174,
2267
+ 109,
2268
+ 163,
2269
+ 227,
2270
+ 75,
2271
+ 2,
2272
+ 144
2273
+ ],
2274
+ accounts: [
2275
+ {
2276
+ name: "user",
2277
+ signer: true
2278
+ },
2279
+ {
2280
+ name: "controller_authority",
2281
+ relations: [
2282
+ "asset_access_controller"
2283
+ ]
2284
+ },
2285
+ {
2286
+ name: "asset_access_controller",
2287
+ relations: [
2288
+ "authorized_user_role"
2289
+ ]
2290
+ },
2291
+ {
2292
+ name: "authorized_user_role"
2293
+ },
2294
+ {
2295
+ name: "asset_controller_program",
2296
+ address: "7tXjmbkZVY3Gmg9kDBebcNXT1yC5pyoxxXVLwdbv9tvP"
2297
+ },
2298
+ {
2299
+ name: "asset_mint",
2300
+ writable: true
2301
+ },
2302
+ {
2303
+ name: "asset_controller"
2304
+ },
2305
+ {
2306
+ name: "event_authority"
2307
+ },
2308
+ {
2309
+ name: "token_program",
2310
+ address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
2311
+ }
2312
+ ],
2313
+ args: [
2314
+ {
2315
+ name: "cpi_data",
2316
+ type: "bytes"
2317
+ }
2318
+ ]
2319
+ },
2320
+ {
2321
+ name: "withdraw_excess_rent",
2322
+ discriminator: [
2323
+ 20,
2324
+ 25,
2325
+ 71,
2326
+ 58,
2327
+ 107,
2328
+ 60,
2329
+ 159,
2330
+ 75
2331
+ ],
2332
+ accounts: [
2333
+ {
2334
+ name: "receiver",
2335
+ writable: true
2336
+ },
2337
+ {
2338
+ name: "user",
2339
+ signer: true
2340
+ },
2341
+ {
2342
+ name: "controller_authority",
2343
+ writable: true,
2344
+ relations: [
2345
+ "asset_access_controller"
2346
+ ]
2347
+ },
2348
+ {
2349
+ name: "asset_access_controller",
2350
+ relations: [
2351
+ "authorized_user_role"
2352
+ ]
2353
+ },
2354
+ {
2355
+ name: "authorized_user_role",
2356
+ optional: true
2357
+ },
2358
+ {
2359
+ name: "system_program",
2360
+ address: "11111111111111111111111111111111"
2361
+ }
2362
+ ],
2363
+ args: [
2364
+ ]
2365
+ }
2366
+ ];
2367
+ var accounts$1 = [
2368
+ {
2369
+ name: "AssetAccessController",
2370
+ discriminator: [
2371
+ 159,
2372
+ 84,
2373
+ 3,
2374
+ 26,
2375
+ 90,
2376
+ 167,
2377
+ 134,
2378
+ 33
2379
+ ]
2380
+ },
2381
+ {
2382
+ name: "UserRole",
2383
+ discriminator: [
2384
+ 62,
2385
+ 252,
2386
+ 194,
2387
+ 137,
2388
+ 183,
2389
+ 165,
2390
+ 147,
2391
+ 28
2392
+ ]
2393
+ }
2394
+ ];
2395
+ var events$1 = [
2396
+ {
2397
+ name: "AssignUserRoleEvent",
2398
+ discriminator: [
2399
+ 66,
2400
+ 20,
2401
+ 203,
2402
+ 47,
2403
+ 242,
2404
+ 72,
2405
+ 213,
2406
+ 93
2407
+ ]
2408
+ },
2409
+ {
2410
+ name: "RemoveUserRoleEvent",
2411
+ discriminator: [
2412
+ 213,
2413
+ 162,
2414
+ 73,
2415
+ 7,
2416
+ 11,
2417
+ 89,
2418
+ 226,
2419
+ 140
2420
+ ]
2421
+ }
2422
+ ];
2423
+ var errors$1 = [
2424
+ {
2425
+ code: 6000,
2426
+ name: "UnknownInstruction",
2427
+ msg: "Unknown program instruction from CPI data"
2428
+ },
2429
+ {
2430
+ code: 6001,
2431
+ name: "InvalidName",
2432
+ msg: "Invalid name"
2433
+ },
2434
+ {
2435
+ code: 6002,
2436
+ name: "InvalidUserRole",
2437
+ msg: "Invalid user role"
2438
+ },
2439
+ {
2440
+ code: 6003,
2441
+ name: "DataIsNotEmpty",
2442
+ msg: "Data is not empty"
2443
+ },
2444
+ {
2445
+ code: 6004,
2446
+ name: "UnknownAccount",
2447
+ msg: "Unknown account discriminator"
2448
+ },
2449
+ {
2450
+ code: 6005,
2451
+ name: "MissingReason",
2452
+ msg: "Missing reason or code"
2453
+ },
2454
+ {
2455
+ code: 6006,
2456
+ name: "InvalidLevel",
2457
+ msg: "Invalid level"
2458
+ },
2459
+ {
2460
+ code: 6007,
2461
+ name: "IllegalOperation",
2462
+ msg: "Illegal operation"
2463
+ },
2464
+ {
2465
+ code: 6008,
2466
+ name: "InvalidFlags",
2467
+ msg: "Invalid flag bits"
2468
+ },
2469
+ {
2470
+ code: 6009,
2471
+ name: "CannotEmptyMasterRole",
2472
+ msg: "Cannot empty master role of users"
2473
+ },
2474
+ {
2475
+ code: 6010,
2476
+ name: "CannotVoidAuthority",
2477
+ msg: "Cannot void authority"
2478
+ },
2479
+ {
2480
+ code: 6011,
2481
+ name: "InvalidMasterRole",
2482
+ msg: "Invalid master role"
2483
+ },
2484
+ {
2485
+ code: 6012,
2486
+ name: "CannotDeleteMasterRole",
2487
+ msg: "Cannot delete master role"
2488
+ },
2489
+ {
2490
+ code: 6013,
2491
+ name: "UnauthorizedSigner",
2492
+ msg: "Unauthorized admin signer"
2493
+ }
2494
+ ];
2495
+ var types$1 = [
2496
+ {
2497
+ name: "AssetAccessController",
2498
+ type: {
2499
+ kind: "struct",
2500
+ fields: [
2501
+ {
2502
+ name: "controller_authority",
2503
+ docs: [
2504
+ "PDA generated from [asset_access_controller] as seed to be used as signer authority."
2505
+ ],
2506
+ type: "pubkey"
2507
+ },
2508
+ {
2509
+ name: "controller_authority_bump",
2510
+ docs: [
2511
+ "Bump seed for controller_authority."
2512
+ ],
2513
+ type: "u8"
2514
+ },
2515
+ {
2516
+ name: "admin",
2517
+ docs: [
2518
+ "Admin keypair that's allowed to manage this controller."
2519
+ ],
2520
+ type: "pubkey"
2521
+ },
2522
+ {
2523
+ name: "asset_mint",
2524
+ docs: [
2525
+ "Asset mint that is going to be managed by this controller."
2526
+ ],
2527
+ type: "pubkey"
2528
+ },
2529
+ {
2530
+ name: "user_roles_count",
2531
+ docs: [
2532
+ "Number of UserRoles created since initialization. Used for deriving all created UserRole PDAs."
2533
+ ],
2534
+ type: "u64"
2535
+ },
2536
+ {
2537
+ name: "has_master_role",
2538
+ docs: [
2539
+ "Whether a master role exists."
2540
+ ],
2541
+ type: "bool"
2542
+ },
2543
+ {
2544
+ name: "lut_address",
2545
+ docs: [
2546
+ "Address of the lookup table."
2547
+ ],
2548
+ type: "pubkey"
2549
+ }
2550
+ ]
2551
+ }
2552
+ },
2553
+ {
2554
+ name: "AssignUserRoleEvent",
2555
+ type: {
2556
+ kind: "struct",
2557
+ fields: [
2558
+ {
2559
+ name: "addresses",
2560
+ type: {
2561
+ vec: "pubkey"
2562
+ }
2563
+ },
2564
+ {
2565
+ name: "role",
2566
+ type: "string"
2567
+ },
2568
+ {
2569
+ name: "role_id",
2570
+ type: "u64"
2571
+ },
2572
+ {
2573
+ name: "sender",
2574
+ type: "pubkey"
2575
+ },
2576
+ {
2577
+ name: "asset_mint",
2578
+ type: "pubkey"
2579
+ }
2580
+ ]
2581
+ }
2582
+ },
2583
+ {
2584
+ name: "RemoveUserRoleEvent",
2585
+ type: {
2586
+ kind: "struct",
2587
+ fields: [
2588
+ {
2589
+ name: "addresses",
2590
+ type: {
2591
+ vec: "pubkey"
2592
+ }
2593
+ },
2594
+ {
2595
+ name: "role",
2596
+ type: "string"
2597
+ },
2598
+ {
2599
+ name: "role_id",
2600
+ type: "u64"
2601
+ },
2602
+ {
2603
+ name: "sender",
2604
+ type: "pubkey"
2605
+ },
2606
+ {
2607
+ name: "asset_mint",
2608
+ type: "pubkey"
2609
+ }
2610
+ ]
2611
+ }
2612
+ },
2613
+ {
2614
+ name: "UserRole",
2615
+ type: {
2616
+ kind: "struct",
2617
+ fields: [
2618
+ {
2619
+ name: "asset_access_controller",
2620
+ docs: [
2621
+ "Controller that user role is designated for."
2622
+ ],
2623
+ type: "pubkey"
2624
+ },
2625
+ {
2626
+ name: "id",
2627
+ docs: [
2628
+ "ID of UserRole. Matches AssetAccessController.user_roles_count at time of creation."
2629
+ ],
2630
+ type: "u64"
2631
+ },
2632
+ {
2633
+ name: "name",
2634
+ docs: [
2635
+ "Name of this role."
2636
+ ],
2637
+ type: "string"
2638
+ },
2639
+ {
2640
+ name: "allowed_admin_ixs",
2641
+ docs: [
2642
+ "Bitflag of allowed admin instructions."
2643
+ ],
2644
+ type: "u64"
2645
+ },
2646
+ {
2647
+ name: "allowed_medici_ixs",
2648
+ docs: [
2649
+ "Bitflag of allowed Medici CPI instructions."
2650
+ ],
2651
+ type: "u64"
2652
+ },
2653
+ {
2654
+ name: "is_master_role",
2655
+ docs: [
2656
+ "If true, this is the master role."
2657
+ ],
2658
+ type: "bool"
2659
+ },
2660
+ {
2661
+ name: "users",
2662
+ docs: [
2663
+ "List of users assigned with this role."
2664
+ ],
2665
+ type: {
2666
+ vec: "pubkey"
2667
+ }
2668
+ }
2669
+ ]
2670
+ }
2671
+ }
2672
+ ];
2673
+ var rwa_rbac = {
2674
+ address: address$1,
2675
+ metadata: metadata$1,
2676
+ instructions: instructions$1,
2677
+ accounts: accounts$1,
2678
+ events: events$1,
2679
+ errors: errors$1,
2680
+ types: types$1
2681
+ };
2682
+
2683
+ var rbacIDL = /*#__PURE__*/Object.freeze({
2684
+ __proto__: null,
2685
+ address: address$1,
2686
+ metadata: metadata$1,
2687
+ instructions: instructions$1,
2688
+ accounts: accounts$1,
2689
+ events: events$1,
2690
+ errors: errors$1,
2691
+ types: types$1,
2692
+ 'default': rwa_rbac
2693
+ });
2694
+
2695
+ var address = "D2V7wTBbNCKgYwirgRUnSmc2QyKnHSVmRotWJ4rz8Jp9";
2696
+ var metadata = {
2697
+ name: "rwa_imr",
2698
+ version: "0.1.0",
2699
+ spec: "0.1.0",
2700
+ description: "Created with Anchor"
2701
+ };
2702
+ var instructions = [
2703
+ {
2704
+ name: "add_levels",
2705
+ discriminator: [
2706
+ 101,
2707
+ 239,
2708
+ 15,
2709
+ 85,
2710
+ 60,
2711
+ 13,
2712
+ 183,
2713
+ 192
2714
+ ],
2715
+ accounts: [
2716
+ {
2717
+ name: "payer",
2718
+ writable: true,
2719
+ signer: true
2720
+ },
2721
+ {
2722
+ name: "authority",
2723
+ signer: true,
2724
+ relations: [
2725
+ "investor"
2726
+ ]
2727
+ },
2728
+ {
2729
+ name: "investor",
2730
+ writable: true
2731
+ },
2732
+ {
2733
+ name: "identity_registry_program",
2734
+ address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
2735
+ },
2736
+ {
2737
+ name: "identity_registry",
2738
+ relations: [
2739
+ "investor"
2740
+ ]
2741
+ },
2742
+ {
2743
+ name: "identity_account",
2744
+ writable: true,
2745
+ relations: [
2746
+ "investor"
2747
+ ]
2748
+ },
2749
+ {
2750
+ name: "system_program",
2751
+ address: "11111111111111111111111111111111"
2752
+ },
2753
+ {
2754
+ name: "policy_engine_program"
2755
+ },
2756
+ {
2757
+ name: "policy_engine",
2758
+ writable: true
2759
+ },
2760
+ {
2761
+ name: "tracker_account"
2762
+ },
2763
+ {
2764
+ name: "asset_mint"
2765
+ },
2766
+ {
2767
+ name: "event_authority_identity_registry"
2768
+ },
2769
+ {
2770
+ name: "event_authority",
2771
+ pda: {
2772
+ seeds: [
2773
+ {
2774
+ kind: "const",
2775
+ value: [
2776
+ 95,
2777
+ 95,
2778
+ 101,
2779
+ 118,
2780
+ 101,
2781
+ 110,
2782
+ 116,
2783
+ 95,
2784
+ 97,
2785
+ 117,
2786
+ 116,
2787
+ 104,
2788
+ 111,
2789
+ 114,
2790
+ 105,
2791
+ 116,
2792
+ 121
2793
+ ]
2794
+ }
2795
+ ]
2796
+ }
2797
+ },
2798
+ {
2799
+ name: "program"
2800
+ }
2801
+ ],
2802
+ args: [
2803
+ {
2804
+ name: "levels",
2805
+ type: "bytes"
2806
+ },
2807
+ {
2808
+ name: "expiries",
2809
+ type: {
2810
+ vec: "i64"
2811
+ }
2812
+ },
2813
+ {
2814
+ name: "proof_hashes",
2815
+ type: {
2816
+ vec: "string"
2817
+ }
2818
+ },
2819
+ {
2820
+ name: "enforce_limits",
2821
+ type: "bool"
2822
+ }
2823
+ ]
2824
+ },
2825
+ {
2826
+ name: "attach_wallet_by_investor",
2827
+ discriminator: [
2828
+ 252,
2829
+ 160,
2830
+ 12,
2831
+ 48,
2832
+ 159,
2833
+ 73,
2834
+ 185,
2835
+ 247
2836
+ ],
2837
+ accounts: [
2838
+ {
2839
+ name: "payer",
2840
+ writable: true,
2841
+ signer: true
2842
+ },
2843
+ {
2844
+ name: "wallet",
2845
+ signer: true
2846
+ },
2847
+ {
2848
+ name: "investor"
2849
+ },
2850
+ {
2851
+ name: "wallet_identity"
2852
+ },
2853
+ {
2854
+ name: "identity_registry_program",
2855
+ address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
2856
+ },
2857
+ {
2858
+ name: "new_wallet_identity",
2859
+ writable: true
2860
+ },
2861
+ {
2862
+ name: "identity_account",
2863
+ writable: true,
2864
+ relations: [
2865
+ "investor"
2866
+ ]
2867
+ },
2868
+ {
2869
+ name: "identity_registry",
2870
+ relations: [
2871
+ "investor"
2872
+ ]
2873
+ },
2874
+ {
2875
+ name: "asset_mint"
2876
+ },
2877
+ {
2878
+ name: "system_program",
2879
+ address: "11111111111111111111111111111111"
2880
+ },
2881
+ {
2882
+ name: "event_authority_identity_registry"
2883
+ }
2884
+ ],
2885
+ args: [
2886
+ {
2887
+ name: "new_wallet",
2888
+ type: "pubkey"
2889
+ }
2890
+ ]
2891
+ },
2892
+ {
2893
+ name: "change_country",
2894
+ discriminator: [
2895
+ 208,
2896
+ 227,
2897
+ 224,
2898
+ 246,
2899
+ 9,
2900
+ 254,
2901
+ 62,
2902
+ 179
2903
+ ],
2904
+ accounts: [
2905
+ {
2906
+ name: "payer",
2907
+ writable: true,
2908
+ signer: true
2909
+ },
2910
+ {
2911
+ name: "authority",
2912
+ signer: true,
2913
+ relations: [
2914
+ "investor"
2915
+ ]
2916
+ },
2917
+ {
2918
+ name: "investor",
2919
+ writable: true
2920
+ },
2921
+ {
2922
+ name: "identity_registry_program",
2923
+ address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
2924
+ },
2925
+ {
2926
+ name: "identity_registry",
2927
+ relations: [
2928
+ "investor"
2929
+ ]
2930
+ },
2931
+ {
2932
+ name: "identity_account",
2933
+ writable: true,
2934
+ relations: [
2935
+ "investor"
2936
+ ]
2937
+ },
2938
+ {
2939
+ name: "policy_engine_program"
2940
+ },
2941
+ {
2942
+ name: "policy_engine",
2943
+ writable: true
2944
+ },
2945
+ {
2946
+ name: "tracker_account"
2947
+ },
2948
+ {
2949
+ name: "asset_mint"
2950
+ },
2951
+ {
2952
+ name: "event_authority_identity_registry"
2953
+ }
2954
+ ],
2955
+ args: [
2956
+ {
2957
+ name: "new_country",
2958
+ type: "u8"
2959
+ },
2960
+ {
2961
+ name: "enforce_limits",
2962
+ type: "bool"
2963
+ }
2964
+ ]
2965
+ },
2966
+ {
2967
+ name: "register_investor",
2968
+ discriminator: [
2969
+ 95,
2970
+ 16,
2971
+ 66,
2972
+ 212,
2973
+ 152,
2974
+ 123,
2975
+ 136,
2976
+ 173
2977
+ ],
2978
+ accounts: [
2979
+ {
2980
+ name: "payer",
2981
+ writable: true,
2982
+ signer: true
2983
+ },
2984
+ {
2985
+ name: "authority",
2986
+ docs: [
2987
+ "Authority has to be authority or delegate of IdentityRegistry for CPI to succeed."
2988
+ ],
2989
+ signer: true
2990
+ },
2991
+ {
2992
+ name: "investor",
2993
+ writable: true,
2994
+ pda: {
2995
+ seeds: [
2996
+ {
2997
+ kind: "arg",
2998
+ path: "investor_id"
2999
+ },
3000
+ {
3001
+ kind: "account",
3002
+ path: "identity_registry"
3003
+ },
3004
+ {
3005
+ kind: "const",
3006
+ value: [
3007
+ 73,
3008
+ 110,
3009
+ 118,
3010
+ 101,
3011
+ 115,
3012
+ 116,
3013
+ 111,
3014
+ 114
3015
+ ]
3016
+ }
3017
+ ]
3018
+ }
3019
+ },
3020
+ {
3021
+ name: "identity_registry_program",
3022
+ address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
3023
+ },
3024
+ {
3025
+ name: "identity_registry"
3026
+ },
3027
+ {
3028
+ name: "identity_account",
3029
+ writable: true
3030
+ },
3031
+ {
3032
+ name: "wallet_identity",
3033
+ writable: true
3034
+ },
3035
+ {
3036
+ name: "policy_engine_program"
3037
+ },
3038
+ {
3039
+ name: "tracker_account",
3040
+ writable: true
3041
+ },
3042
+ {
3043
+ name: "asset_mint"
3044
+ },
3045
+ {
3046
+ name: "system_program",
3047
+ address: "11111111111111111111111111111111"
3048
+ },
3049
+ {
3050
+ name: "event_authority_identity_registry"
3051
+ },
3052
+ {
3053
+ name: "event_authority",
3054
+ pda: {
3055
+ seeds: [
3056
+ {
3057
+ kind: "const",
3058
+ value: [
3059
+ 95,
3060
+ 95,
3061
+ 101,
3062
+ 118,
3063
+ 101,
3064
+ 110,
3065
+ 116,
3066
+ 95,
3067
+ 97,
3068
+ 117,
3069
+ 116,
3070
+ 104,
3071
+ 111,
3072
+ 114,
3073
+ 105,
3074
+ 116,
3075
+ 121
3076
+ ]
3077
+ }
3078
+ ]
3079
+ }
3080
+ },
3081
+ {
3082
+ name: "program"
3083
+ }
3084
+ ],
3085
+ args: [
3086
+ {
3087
+ name: "investor_id",
3088
+ type: "string"
3089
+ },
3090
+ {
3091
+ name: "collision_hash",
3092
+ type: "string"
3093
+ },
3094
+ {
3095
+ name: "level",
3096
+ type: "u8"
3097
+ },
3098
+ {
3099
+ name: "expiry",
3100
+ type: "i64"
3101
+ },
3102
+ {
3103
+ name: "country",
3104
+ type: "u8"
3105
+ },
3106
+ {
3107
+ name: "proof_hash",
3108
+ type: "string"
3109
+ }
3110
+ ]
3111
+ },
3112
+ {
3113
+ name: "remove_investor",
3114
+ discriminator: [
3115
+ 93,
3116
+ 0,
3117
+ 162,
3118
+ 199,
3119
+ 76,
3120
+ 5,
3121
+ 180,
3122
+ 2
3123
+ ],
3124
+ accounts: [
3125
+ {
3126
+ name: "payer",
3127
+ writable: true,
3128
+ signer: true
3129
+ },
3130
+ {
3131
+ name: "authority",
3132
+ signer: true,
3133
+ relations: [
3134
+ "investor"
3135
+ ]
3136
+ },
3137
+ {
3138
+ name: "investor",
3139
+ writable: true
3140
+ },
3141
+ {
3142
+ name: "identity_registry_program",
3143
+ address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
3144
+ },
3145
+ {
3146
+ name: "identity_registry",
3147
+ relations: [
3148
+ "investor"
3149
+ ]
3150
+ },
3151
+ {
3152
+ name: "identity_account",
3153
+ writable: true,
3154
+ relations: [
3155
+ "investor"
3156
+ ]
3157
+ },
3158
+ {
3159
+ name: "wallet_identity",
3160
+ writable: true
3161
+ },
3162
+ {
3163
+ name: "policy_engine_program",
3164
+ address: "FsE8mCJyvgMzqJbfHbJQm3iuf3cRZC6n2vZi1Q8rQCy2"
3165
+ },
3166
+ {
3167
+ name: "tracker_account",
3168
+ writable: true
3169
+ },
3170
+ {
3171
+ name: "event_authority_identity_registry"
3172
+ },
3173
+ {
3174
+ name: "asset_mint"
3175
+ },
3176
+ {
3177
+ name: "event_authority",
3178
+ pda: {
3179
+ seeds: [
3180
+ {
3181
+ kind: "const",
3182
+ value: [
3183
+ 95,
3184
+ 95,
3185
+ 101,
3186
+ 118,
3187
+ 101,
3188
+ 110,
3189
+ 116,
3190
+ 95,
3191
+ 97,
3192
+ 117,
3193
+ 116,
3194
+ 104,
3195
+ 111,
3196
+ 114,
3197
+ 105,
3198
+ 116,
3199
+ 121
3200
+ ]
3201
+ }
3202
+ ]
3203
+ }
3204
+ },
3205
+ {
3206
+ name: "program"
3207
+ }
3208
+ ],
3209
+ args: [
3210
+ ]
3211
+ },
3212
+ {
3213
+ name: "remove_levels",
3214
+ discriminator: [
3215
+ 200,
3216
+ 96,
3217
+ 65,
3218
+ 253,
3219
+ 97,
3220
+ 55,
3221
+ 16,
3222
+ 192
3223
+ ],
3224
+ accounts: [
3225
+ {
3226
+ name: "payer",
3227
+ writable: true,
3228
+ signer: true
3229
+ },
3230
+ {
3231
+ name: "authority",
3232
+ signer: true,
3233
+ relations: [
3234
+ "investor"
3235
+ ]
3236
+ },
3237
+ {
3238
+ name: "investor",
3239
+ writable: true
3240
+ },
3241
+ {
3242
+ name: "identity_registry_program",
3243
+ address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
3244
+ },
3245
+ {
3246
+ name: "identity_registry",
3247
+ relations: [
3248
+ "investor"
3249
+ ]
3250
+ },
3251
+ {
3252
+ name: "identity_account",
3253
+ writable: true,
3254
+ relations: [
3255
+ "investor"
3256
+ ]
3257
+ },
3258
+ {
3259
+ name: "system_program",
3260
+ address: "11111111111111111111111111111111"
3261
+ },
3262
+ {
3263
+ name: "policy_engine_program"
3264
+ },
3265
+ {
3266
+ name: "policy_engine",
3267
+ writable: true
3268
+ },
3269
+ {
3270
+ name: "tracker_account"
3271
+ },
3272
+ {
3273
+ name: "asset_mint"
3274
+ },
3275
+ {
3276
+ name: "event_authority_identity_registry"
3277
+ }
3278
+ ],
3279
+ args: [
3280
+ {
3281
+ name: "levels_to_remove",
3282
+ type: "bytes"
3283
+ },
3284
+ {
3285
+ name: "enforce_limits",
3286
+ type: "bool"
3287
+ }
3288
+ ]
3289
+ }
3290
+ ];
3291
+ var accounts = [
3292
+ {
3293
+ name: "Investor",
3294
+ discriminator: [
3295
+ 174,
3296
+ 129,
3297
+ 17,
3298
+ 83,
3299
+ 36,
3300
+ 116,
3301
+ 26,
3302
+ 196
3303
+ ]
3304
+ }
3305
+ ];
3306
+ var events = [
3307
+ {
3308
+ name: "AddLevelsEvent",
3309
+ discriminator: [
3310
+ 90,
3311
+ 156,
3312
+ 44,
3313
+ 28,
3314
+ 242,
3315
+ 1,
3316
+ 130,
3317
+ 61
3318
+ ]
3319
+ },
3320
+ {
3321
+ name: "RegisterInvestorEvent",
3322
+ discriminator: [
3323
+ 137,
3324
+ 181,
3325
+ 142,
3326
+ 164,
3327
+ 140,
3328
+ 196,
3329
+ 246,
3330
+ 182
3331
+ ]
3332
+ },
3333
+ {
3334
+ name: "RemoveInvestorEvent",
3335
+ discriminator: [
3336
+ 221,
3337
+ 84,
3338
+ 243,
3339
+ 216,
3340
+ 215,
3341
+ 253,
3342
+ 246,
3343
+ 253
3344
+ ]
3345
+ },
3346
+ {
3347
+ name: "RemoveLevelsEvent",
3348
+ discriminator: [
3349
+ 145,
3350
+ 158,
3351
+ 97,
3352
+ 146,
3353
+ 126,
3354
+ 14,
3355
+ 2,
3356
+ 225
3357
+ ]
3358
+ }
3359
+ ];
3360
+ var errors = [
3361
+ {
3362
+ code: 6000,
3363
+ name: "UnknownInstruction",
3364
+ msg: "Unknown program instruction from CPI data"
3365
+ },
3366
+ {
3367
+ code: 6001,
3368
+ name: "InvalidHash",
3369
+ msg: "Invalid hash"
3370
+ },
3371
+ {
3372
+ code: 6002,
3373
+ name: "InvalidLevels",
3374
+ msg: "Invalid levels"
3375
+ },
3376
+ {
3377
+ code: 6003,
3378
+ name: "InvalidCountryLevel",
3379
+ msg: "Invalid country level"
3380
+ },
3381
+ {
3382
+ code: 6004,
3383
+ name: "InvalidRegionLevel",
3384
+ msg: "Invalid region level"
3385
+ },
3386
+ {
3387
+ code: 6005,
3388
+ name: "InvalidAttribute",
3389
+ msg: "Invalid attribute level"
3390
+ },
3391
+ {
3392
+ code: 6006,
3393
+ name: "UnknownLevel",
3394
+ msg: "Unknown level"
3395
+ }
3396
+ ];
3397
+ var types = [
3398
+ {
3399
+ name: "AddLevelsEvent",
3400
+ type: {
3401
+ kind: "struct",
3402
+ fields: [
3403
+ {
3404
+ name: "investor_id",
3405
+ type: "string"
3406
+ },
3407
+ {
3408
+ name: "sender",
3409
+ type: "pubkey"
3410
+ },
3411
+ {
3412
+ name: "levels",
3413
+ type: "bytes"
3414
+ },
3415
+ {
3416
+ name: "expiries",
3417
+ type: {
3418
+ vec: "i64"
3419
+ }
3420
+ },
3421
+ {
3422
+ name: "proof_hashes",
3423
+ type: {
3424
+ vec: "string"
3425
+ }
3426
+ }
3427
+ ]
3428
+ }
3429
+ },
3430
+ {
3431
+ name: "Investor",
3432
+ type: {
3433
+ kind: "struct",
3434
+ fields: [
3435
+ {
3436
+ name: "authority",
3437
+ docs: [
3438
+ "Authority keypair allowed to write this account, will match authority or delegate of IdentityRegistry",
3439
+ "at time of creation of IdentityAccount."
3440
+ ],
3441
+ type: "pubkey"
3442
+ },
3443
+ {
3444
+ name: "identity_account",
3445
+ docs: [
3446
+ "IdentityAccount associated with this investor."
3447
+ ],
3448
+ type: "pubkey"
3449
+ },
3450
+ {
3451
+ name: "identity_registry",
3452
+ docs: [
3453
+ "IdentityRegistryAccount associated with this investor."
3454
+ ],
3455
+ type: "pubkey"
3456
+ },
3457
+ {
3458
+ name: "bump",
3459
+ docs: [
3460
+ "PDA Seed Bump"
3461
+ ],
3462
+ type: "u8"
3463
+ },
3464
+ {
3465
+ name: "investor_id",
3466
+ docs: [
3467
+ "Unique ID for Investor, generated off-chain."
3468
+ ],
3469
+ type: "string"
3470
+ },
3471
+ {
3472
+ name: "collision_hash",
3473
+ docs: [
3474
+ "Metadata for investor, generated off-chain."
3475
+ ],
3476
+ type: "string"
3477
+ },
3478
+ {
3479
+ name: "last_updated_by",
3480
+ docs: [
3481
+ "User that last modified this investor. Read from payer of instruction."
3482
+ ],
3483
+ type: "pubkey"
3484
+ },
3485
+ {
3486
+ name: "levels",
3487
+ docs: [
3488
+ "Levels assigned to investor."
3489
+ ],
3490
+ type: {
3491
+ vec: {
3492
+ defined: {
3493
+ name: "LevelData"
3494
+ }
3495
+ }
3496
+ }
3497
+ },
3498
+ {
3499
+ name: "country",
3500
+ type: "u8"
3501
+ }
3502
+ ]
3503
+ }
3504
+ },
3505
+ {
3506
+ name: "LevelData",
3507
+ type: {
3508
+ kind: "struct",
3509
+ fields: [
3510
+ {
3511
+ name: "level",
3512
+ docs: [
3513
+ "Maps to IdentityAccount level used in RWA Token."
3514
+ ],
3515
+ type: "u8"
3516
+ },
3517
+ {
3518
+ name: "proof_hash",
3519
+ docs: [
3520
+ "Hash generated off-chain."
3521
+ ],
3522
+ type: "string"
3523
+ }
3524
+ ]
3525
+ }
3526
+ },
3527
+ {
3528
+ name: "RegisterInvestorEvent",
3529
+ type: {
3530
+ kind: "struct",
3531
+ fields: [
3532
+ {
3533
+ name: "investor_id",
3534
+ type: "string"
3535
+ },
3536
+ {
3537
+ name: "level",
3538
+ type: "u8"
3539
+ },
3540
+ {
3541
+ name: "expiry",
3542
+ type: "i64"
3543
+ },
3544
+ {
3545
+ name: "collision_hash",
3546
+ type: "string"
3547
+ },
3548
+ {
3549
+ name: "sender",
3550
+ type: "pubkey"
3551
+ },
3552
+ {
3553
+ name: "country",
3554
+ type: "u8"
3555
+ }
3556
+ ]
3557
+ }
3558
+ },
3559
+ {
3560
+ name: "RemoveInvestorEvent",
3561
+ type: {
3562
+ kind: "struct",
3563
+ fields: [
3564
+ {
3565
+ name: "investor_id",
3566
+ type: "string"
3567
+ },
3568
+ {
3569
+ name: "sender",
3570
+ type: "pubkey"
3571
+ }
3572
+ ]
3573
+ }
3574
+ },
3575
+ {
3576
+ name: "RemoveLevelsEvent",
3577
+ type: {
3578
+ kind: "struct",
3579
+ fields: [
3580
+ {
3581
+ name: "investor_id",
3582
+ type: "string"
3583
+ },
3584
+ {
3585
+ name: "sender",
3586
+ type: "pubkey"
3587
+ },
3588
+ {
3589
+ name: "levels",
3590
+ type: "bytes"
3591
+ }
3592
+ ]
3593
+ }
3594
+ }
3595
+ ];
3596
+ var rwa_imr = {
3597
+ address: address,
3598
+ metadata: metadata,
3599
+ instructions: instructions,
3600
+ accounts: accounts,
3601
+ events: events,
3602
+ errors: errors,
3603
+ types: types
3604
+ };
3605
+
3606
+ var imrIDL = /*#__PURE__*/Object.freeze({
3607
+ __proto__: null,
3608
+ address: address,
3609
+ metadata: metadata,
3610
+ instructions: instructions,
3611
+ accounts: accounts,
3612
+ events: events,
3613
+ errors: errors,
3614
+ types: types,
3615
+ 'default': rwa_imr
3616
+ });
3617
+
3618
+ exports.AdminFlags = void 0;
3619
+ (function (AdminFlags) {
3620
+ AdminFlags[AdminFlags["NONE"] = 0] = "NONE";
3621
+ AdminFlags[AdminFlags["CREATE_OR_DELETE_USER_ROLE"] = 1] = "CREATE_OR_DELETE_USER_ROLE";
3622
+ AdminFlags[AdminFlags["MODIFY_USER_ROLE"] = 2] = "MODIFY_USER_ROLE";
3623
+ AdminFlags[AdminFlags["ASSIGN_OR_REMOVE_ANY_USER_ROLE"] = 4] = "ASSIGN_OR_REMOVE_ANY_USER_ROLE";
3624
+ AdminFlags[AdminFlags["ASSIGN_OR_REMOVE_CURRENT_ROLE"] = 8] = "ASSIGN_OR_REMOVE_CURRENT_ROLE";
3625
+ AdminFlags[AdminFlags["SET_LUT_ADDRESS"] = 16] = "SET_LUT_ADDRESS";
3626
+ AdminFlags[AdminFlags["WITHDRAW_EXCESS_RENT"] = 32] = "WITHDRAW_EXCESS_RENT";
3627
+ AdminFlags[AdminFlags["ALL"] = 63] = "ALL";
3628
+ })(exports.AdminFlags || (exports.AdminFlags = {}));
3629
+ exports.MediciFlags = void 0;
3630
+ (function (MediciFlags) {
3631
+ MediciFlags[MediciFlags["NONE"] = 0] = "NONE";
3632
+ MediciFlags[MediciFlags["UPDATE_ASSET_METADATA"] = 1] = "UPDATE_ASSET_METADATA";
3633
+ MediciFlags[MediciFlags["THAW_TOKEN_ACCOUNT"] = 2] = "THAW_TOKEN_ACCOUNT";
3634
+ MediciFlags[MediciFlags["FREEZE_TOKEN_ACCOUNT"] = 4] = "FREEZE_TOKEN_ACCOUNT";
3635
+ MediciFlags[MediciFlags["ISSUE_TOKENS"] = 8] = "ISSUE_TOKENS";
3636
+ MediciFlags[MediciFlags["REVOKE_TOKENS"] = 16] = "REVOKE_TOKENS";
3637
+ MediciFlags[MediciFlags["UPDATE_INTEREST_BEARING_MINT_RATE"] = 32] = "UPDATE_INTEREST_BEARING_MINT_RATE";
3638
+ MediciFlags[MediciFlags["ATTACH_TO_POLICY_ACCOUNT"] = 64] = "ATTACH_TO_POLICY_ACCOUNT";
3639
+ MediciFlags[MediciFlags["CREATE_POLICY_ACCOUNT"] = 128] = "CREATE_POLICY_ACCOUNT";
3640
+ MediciFlags[MediciFlags["DETACH_FROM_POLICY_ACCOUNT"] = 256] = "DETACH_FROM_POLICY_ACCOUNT";
3641
+ MediciFlags[MediciFlags["ADD_LEVELS"] = 512] = "ADD_LEVELS";
3642
+ MediciFlags[MediciFlags["ADD_LEVEL_TO_IDENTITY_ACCOUNT"] = 1024] = "ADD_LEVEL_TO_IDENTITY_ACCOUNT";
3643
+ MediciFlags[MediciFlags["REGISTER_INVESTOR"] = 2048] = "REGISTER_INVESTOR";
3644
+ MediciFlags[MediciFlags["REMOVE_LEVELS"] = 4096] = "REMOVE_LEVELS";
3645
+ MediciFlags[MediciFlags["REMOVE_INVESTOR"] = 8192] = "REMOVE_INVESTOR";
3646
+ MediciFlags[MediciFlags["EDIT_IDENTITY_METADATA"] = 16384] = "EDIT_IDENTITY_METADATA";
3647
+ MediciFlags[MediciFlags["REFRESH_LEVEL_TO_IDENTITY_ACCOUNT"] = 32768] = "REFRESH_LEVEL_TO_IDENTITY_ACCOUNT";
3648
+ MediciFlags[MediciFlags["ATTACH_WALLET_TO_IDENTITY"] = 65536] = "ATTACH_WALLET_TO_IDENTITY";
3649
+ MediciFlags[MediciFlags["DETACH_WALLET_FROM_IDENTITY"] = 131072] = "DETACH_WALLET_FROM_IDENTITY";
3650
+ MediciFlags[MediciFlags["SEIZE_TOKENS"] = 262144] = "SEIZE_TOKENS";
3651
+ MediciFlags[MediciFlags["CREATE_IDENTITY_ACCOUNT"] = 524288] = "CREATE_IDENTITY_ACCOUNT";
3652
+ MediciFlags[MediciFlags["CREATE_INVESTOR_LOCKS"] = 1048576] = "CREATE_INVESTOR_LOCKS";
3653
+ MediciFlags[MediciFlags["CLOSE_INVESTOR_LOCKS"] = 2097152] = "CLOSE_INVESTOR_LOCKS";
3654
+ MediciFlags[MediciFlags["ADD_TOKEN_LOCK"] = 4194304] = "ADD_TOKEN_LOCK";
3655
+ MediciFlags[MediciFlags["REMOVE_TOKEN_LOCK"] = 8388608] = "REMOVE_TOKEN_LOCK";
3656
+ MediciFlags[MediciFlags["CHANGE_COUNTERS"] = 16777216] = "CHANGE_COUNTERS";
3657
+ MediciFlags[MediciFlags["CHANGE_COUNTER_LIMITS"] = 33554432] = "CHANGE_COUNTER_LIMITS";
3658
+ MediciFlags[MediciFlags["CHANGE_COUNTRY"] = 67108864] = "CHANGE_COUNTRY";
3659
+ MediciFlags[MediciFlags["CHANGE_MAPPING"] = 134217728] = "CHANGE_MAPPING";
3660
+ MediciFlags[MediciFlags["CHANGE_ISSUANCE_POLICIES"] = 268435456] = "CHANGE_ISSUANCE_POLICIES";
3661
+ MediciFlags[MediciFlags["REMOVE_IDENTITY_ACCOUNT"] = 536870912] = "REMOVE_IDENTITY_ACCOUNT";
3662
+ MediciFlags[MediciFlags["ALL"] = 1073741823] = "ALL";
3663
+ })(exports.MediciFlags || (exports.MediciFlags = {}));
3664
+
3665
+ /******************************************************************************
3666
+ Copyright (c) Microsoft Corporation.
3667
+
3668
+ Permission to use, copy, modify, and/or distribute this software for any
3669
+ purpose with or without fee is hereby granted.
3670
+
3671
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
3672
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
3673
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
3674
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
3675
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
3676
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
3677
+ PERFORMANCE OF THIS SOFTWARE.
3678
+ ***************************************************************************** */
3679
+
3680
+ function __awaiter(thisArg, _arguments, P, generator) {
3681
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3682
+ return new (P || (P = Promise))(function (resolve, reject) {
3683
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
3684
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
3685
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
3686
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
3687
+ });
3688
+ }
3689
+
3690
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
3691
+ var e = new Error(message);
3692
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
3693
+ };
3694
+
3695
+ /**
3696
+ * Represents the role-based access client for Asset Controller for an RWA.
3697
+ */
3698
+ class AssetController {
3699
+ constructor(rwaClient, rbacProgram) {
3700
+ this.rwaClient = rwaClient;
3701
+ this.rbacProgram = rbacProgram;
3702
+ }
3703
+ /**
3704
+ * Asynchronously generates instructions to setup a new asset controller.
3705
+ * @param args - {@link CreateAssetControllerIx}
3706
+ * @returns A Promise that resolves to the instructions to create an asset controller.
3707
+ */
3708
+ setupNewRegistry(args) {
3709
+ return __awaiter(this, void 0, void 0, function* () {
3710
+ return rwaTokenSdk.getCreateAssetControllerIx(args, this.rwaClient.provider);
3711
+ });
3712
+ }
3713
+ /**
3714
+ * Update the asset controller's metadata.
3715
+ * @param args - {@link UpdateAssetMetadataArgs}
3716
+ * @param assetAccessController - RBAC AssetAccessController account.
3717
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
3718
+ * @returns A Promise that resolves to the instructions to update the asset controller's metadata.
3719
+ * */
3720
+ updateAssetMetadata(args, assetAccessController, authorizedUserRole) {
3721
+ return __awaiter(this, void 0, void 0, function* () {
3722
+ const updateIx = yield this.rwaClient.assetController.updateAssetMetadata(args);
3723
+ const ixData = updateIx.data;
3724
+ return this.rbacProgram.methods
3725
+ .updateAssetMetadata(ixData)
3726
+ .accountsStrict({
3727
+ payer: args.payer,
3728
+ user: args.signer,
3729
+ controllerAuthority: args.authority,
3730
+ assetAccessController,
3731
+ authorizedUserRole: authorizedUserRole || null,
3732
+ assetMint: args.assetMint,
3733
+ assetController: rwaTokenSdk.getAssetControllerPda(args.assetMint),
3734
+ assetControllerProgram: rwaTokenSdk.assetControllerProgramId,
3735
+ tokenProgram: splToken.TOKEN_2022_PROGRAM_ID,
3736
+ eventAuthority: rwaTokenSdk.getAssetControllerEventAuthority(),
3737
+ systemProgram: web3_js.SystemProgram.programId,
3738
+ })
3739
+ .instruction();
3740
+ });
3741
+ }
3742
+ /**
3743
+ * Asynchronously generates instructions to issue tokens and lock tokens according to issuance policy.
3744
+ * @param args - {@link IssueTokensWithLockArgs}
3745
+ * @param assetAccessController - RBAC AssetAccessController account.
3746
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
3747
+ */
3748
+ issueTokenIxns(args, assetAccessController, authorizedUserRole) {
3749
+ return __awaiter(this, void 0, void 0, function* () {
3750
+ const identityRegistry = rwaTokenSdk.getIdentityRegistryPda(args.assetMint);
3751
+ const controllerAuthority = deriveControllerAuthorityPda(assetAccessController);
3752
+ const investorPda = deriveInvestorPda(args.investorId, identityRegistry);
3753
+ const issueTokensIxs = yield rwaTokenSdk.getIssueTokensIx({
3754
+ payer: args.payer,
3755
+ signer: args.signer,
3756
+ wallet: args.wallet,
3757
+ assetMint: args.assetMint,
3758
+ amount: args.amount,
3759
+ timestamp: args.issuanceTimestamp,
3760
+ authority: controllerAuthority.toString(),
3761
+ owner: investorPda.toString(),
3762
+ }, this.rwaClient.provider);
3763
+ const trackerAccount = rwaTokenSdk.getTrackerAccountPda(args.assetMint, investorPda.toString());
3764
+ const ixData = issueTokensIxs[0].data;
3765
+ const tokenAccount = splToken.getAssociatedTokenAddressSync(new web3_js.PublicKey(args.assetMint), new web3_js.PublicKey(args.wallet), false, splToken.TOKEN_2022_PROGRAM_ID);
3766
+ return yield this.rbacProgram.methods
3767
+ .issueTokens(ixData)
3768
+ .accountsStrict({
3769
+ payer: args.payer,
3770
+ user: args.signer,
3771
+ controllerAuthority: controllerAuthority,
3772
+ assetAccessController: assetAccessController,
3773
+ authorizedUserRole: authorizedUserRole || null,
3774
+ assetControllerProgram: rwaTokenSdk.assetControllerProgramId,
3775
+ assetMint: args.assetMint,
3776
+ assetController: rwaTokenSdk.getAssetControllerPda(args.assetMint),
3777
+ to: args.wallet,
3778
+ tokenAccount: tokenAccount,
3779
+ policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
3780
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
3781
+ identityAccount: rwaTokenSdk.getIdentityAccountPda(args.assetMint, investorPda.toString()),
3782
+ trackerAccount,
3783
+ identityRegistry,
3784
+ tokenProgram: splToken.TOKEN_2022_PROGRAM_ID,
3785
+ associatedTokenProgram: splToken.ASSOCIATED_TOKEN_PROGRAM_ID,
3786
+ systemProgram: web3_js.SystemProgram.programId,
3787
+ walletIdentityAccount: rwaTokenSdk.getWalletIdentityAccountPda(args.assetMint, args.wallet),
3788
+ eventAuthority: rwaTokenSdk.getAssetControllerEventAuthority(),
3789
+ })
3790
+ .instruction();
3791
+ });
3792
+ }
3793
+ /**
3794
+ * Executes a token transfer.
3795
+ * @param args - {@link TransferTokensArgs}
3796
+ * @returns A promise that resolves to transaction instruction.
3797
+ */
3798
+ transfer(args) {
3799
+ return __awaiter(this, void 0, void 0, function* () {
3800
+ return this.rwaClient.assetController.transfer(args);
3801
+ });
3802
+ }
3803
+ /**
3804
+ * Asynchronously generates instruction to freeze a token account.
3805
+ * @param args - {@link FreezeTokenArgs}
3806
+ * @param assetAccessController - RBAC AssetAccessController account.
3807
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
3808
+ * @returns A Promise that resolves to the instruction to freeze.
3809
+ */
3810
+ freezeTokenIxn(args, assetAccessController, authorizedUserRole) {
3811
+ return __awaiter(this, void 0, void 0, function* () {
3812
+ const freezeIx = yield rwaTokenSdk.getFreezeTokenIx(args, this.rwaClient.provider);
3813
+ const ixData = freezeIx.data;
3814
+ const tokenAccount = splToken.getAssociatedTokenAddressSync(new web3_js.PublicKey(args.assetMint), new web3_js.PublicKey(args.owner), false, splToken.TOKEN_2022_PROGRAM_ID);
3815
+ return this.rbacProgram.methods
3816
+ .freezeTokenAccount(ixData)
3817
+ .accountsStrict({
3818
+ user: args.signer,
3819
+ controllerAuthority: args.authority,
3820
+ assetAccessController: assetAccessController,
3821
+ authorizedUserRole: authorizedUserRole || null,
3822
+ assetControllerProgram: rwaTokenSdk.assetControllerProgramId,
3823
+ assetMint: args.assetMint,
3824
+ assetController: rwaTokenSdk.getAssetControllerPda(args.assetMint),
3825
+ tokenAccount,
3826
+ tokenProgram: splToken.TOKEN_2022_PROGRAM_ID,
3827
+ })
3828
+ .instruction();
3829
+ });
3830
+ }
3831
+ /**
3832
+ * Asynchronously generates instruction to thaw a token account.
3833
+ * @param args - {@link FreezeTokenArgs}
3834
+ * @param assetAccessController - RBAC AssetAccessController account.
3835
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
3836
+ * @returns A Promise that resolves to the instruction to thaw.
3837
+ */
3838
+ thawTokenIxn(args, assetAccessController, authorizedUserRole) {
3839
+ return __awaiter(this, void 0, void 0, function* () {
3840
+ const thawIx = yield rwaTokenSdk.getThawTokenIx(args, this.rwaClient.provider);
3841
+ const ixData = thawIx.data;
3842
+ const tokenAccount = splToken.getAssociatedTokenAddressSync(new web3_js.PublicKey(args.assetMint), new web3_js.PublicKey(args.owner), false, splToken.TOKEN_2022_PROGRAM_ID);
3843
+ return this.rbacProgram.methods
3844
+ .thawTokenAccount(ixData)
3845
+ .accountsStrict({
3846
+ user: args.signer,
3847
+ controllerAuthority: args.authority,
3848
+ assetAccessController: assetAccessController,
3849
+ authorizedUserRole: authorizedUserRole || null,
3850
+ assetControllerProgram: rwaTokenSdk.assetControllerProgramId,
3851
+ assetMint: args.assetMint,
3852
+ assetController: rwaTokenSdk.getAssetControllerPda(args.assetMint),
3853
+ tokenAccount,
3854
+ tokenProgram: splToken.TOKEN_2022_PROGRAM_ID,
3855
+ })
3856
+ .instruction();
3857
+ });
3858
+ }
3859
+ /**
3860
+ * Asynchronously generates instructions to revoke tokens from a user.
3861
+ * @param args - {@link RevokeTokensArgs}
3862
+ * @param signer - User signer public key.
3863
+ * @param assetAccessController - RBAC AssetAccessController account.
3864
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
3865
+ * @param investorId - Optional investorId. Required if user is not an investor.
3866
+ * @returns A Promise that resolves to the instructions to revoke.
3867
+ */
3868
+ revokeTokenIxn(args, signer, assetAccessController, authorizedUserRole, investorId) {
3869
+ return __awaiter(this, void 0, void 0, function* () {
3870
+ if (!args.wallet) {
3871
+ throw new Error("Use wallet arg for wallet to revoke tokens from.");
3872
+ }
3873
+ // Set owner (even though it is InvestorPda) as wallet to generate ix data.
3874
+ args.owner = args.wallet;
3875
+ const revokeIx = yield rwaTokenSdk.getRevokeTokensIx(args, this.rwaClient.provider);
3876
+ const identityRegistry = rwaTokenSdk.getIdentityRegistryPda(args.assetMint);
3877
+ const investorPda = investorId
3878
+ ? deriveInvestorPda(investorId, identityRegistry)
3879
+ : null;
3880
+ const ixData = revokeIx.data;
3881
+ const assetController = rwaTokenSdk.getAssetControllerPda(args.assetMint);
3882
+ const revokeTokenAccount = splToken.getAssociatedTokenAddressSync(new web3_js.PublicKey(args.assetMint), new web3_js.PublicKey(args.wallet), false, splToken.TOKEN_2022_PROGRAM_ID);
3883
+ return yield this.rbacProgram.methods
3884
+ .revokeTokens(ixData)
3885
+ .accountsStrict({
3886
+ user: signer,
3887
+ controllerAuthority: args.authority,
3888
+ assetAccessController: assetAccessController,
3889
+ authorizedUserRole: authorizedUserRole || null,
3890
+ assetControllerProgram: rwaTokenSdk.assetControllerProgramId,
3891
+ assetMint: args.assetMint,
3892
+ assetController,
3893
+ revokeTokenAccount,
3894
+ identityRegistry,
3895
+ identityAccount: rwaTokenSdk.getIdentityAccountPda(args.assetMint, investorId ? investorPda.toString() : args.owner),
3896
+ trackerAccount: rwaTokenSdk.getTrackerAccountPda(args.assetMint, investorId ? investorPda.toString() : args.owner),
3897
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
3898
+ policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
3899
+ walletIdentityAccount: rwaTokenSdk.getWalletIdentityAccountPda(args.assetMint, args.wallet),
3900
+ tokenProgram: splToken.TOKEN_2022_PROGRAM_ID,
3901
+ associatedTokenProgram: splToken.ASSOCIATED_TOKEN_PROGRAM_ID,
3902
+ systemProgram: web3_js.SystemProgram.programId,
3903
+ eventAuthority: rwaTokenSdk.getAssetControllerEventAuthority(),
3904
+ })
3905
+ .instruction();
3906
+ });
3907
+ }
3908
+ /**
3909
+ * Asynchronously generates instruction to update mint interest rate.
3910
+ * @param args - {@link UpdateInterestBearingMintRateArgs}
3911
+ * @param assetAccessController - RBAC AssetAccessController account.
3912
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
3913
+ * @returns A Promise that resolves to the instruction to update mint interest rate.
3914
+ */
3915
+ updateInterestBearingMintRateIxn(args, assetAccessController, authorizedUserRole) {
3916
+ return __awaiter(this, void 0, void 0, function* () {
3917
+ const updateIx = yield rwaTokenSdk.getUpdateInterestBearingMintRateIx(args, this.rwaClient.provider);
3918
+ const ixData = updateIx.data;
3919
+ return this.rbacProgram.methods
3920
+ .updateInterestBearingMintRate(ixData)
3921
+ .accountsStrict({
3922
+ user: args.signer,
3923
+ controllerAuthority: args.authority,
3924
+ assetAccessController: assetAccessController,
3925
+ authorizedUserRole: authorizedUserRole || null,
3926
+ assetControllerProgram: rwaTokenSdk.assetControllerProgramId,
3927
+ assetMint: args.assetMint,
3928
+ assetController: rwaTokenSdk.getAssetControllerPda(args.assetMint),
3929
+ eventAuthority: rwaTokenSdk.getAssetControllerEventAuthority(),
3930
+ tokenProgram: splToken.TOKEN_2022_PROGRAM_ID,
3931
+ })
3932
+ .instruction();
3933
+ });
3934
+ }
3935
+ /**
3936
+ * Asynchronously generates instruction to seize tokens.
3937
+ * @param args - {@link SeizeTokensArgs}
3938
+ * @param signer - User signer public key.
3939
+ * @param assetAccessController - RBAC AssetAccessController account.
3940
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
3941
+ * @returns A Promise that resolves to the instruction to seize.
3942
+ */
3943
+ seizeTokensIxn(args, investorId, signer, assetAccessController, authorizedUserRole) {
3944
+ return __awaiter(this, void 0, void 0, function* () {
3945
+ const identityRegistry = rwaTokenSdk.getIdentityRegistryPda(args.assetMint);
3946
+ const investorPda = deriveInvestorPda(investorId, identityRegistry);
3947
+ const [_, seizeIx] = yield rwaTokenSdk.getSeizeTokensIx(Object.assign(Object.assign({}, args), { wallet: args.from, from: investorPda.toString() }), this.rwaClient.provider);
3948
+ return this.rbacProgram.methods
3949
+ .seizeTokens(seizeIx.data)
3950
+ .accountsStrict({
3951
+ user: signer,
3952
+ controllerAuthority: args.authority,
3953
+ assetAccessController: assetAccessController,
3954
+ authorizedUserRole: authorizedUserRole || null,
3955
+ assetControllerProgram: rwaTokenSdk.assetControllerProgramId,
3956
+ assetMint: args.assetMint,
3957
+ assetController: rwaTokenSdk.getAssetControllerPda(args.assetMint),
3958
+ sourceTokenAccount: splToken.getAssociatedTokenAddressSync(new web3_js.PublicKey(args.assetMint), new web3_js.PublicKey(args.from), false, splToken.TOKEN_2022_PROGRAM_ID),
3959
+ destinationTokenAccount: splToken.getAssociatedTokenAddressSync(new web3_js.PublicKey(args.assetMint), new web3_js.PublicKey(args.to), true, splToken.TOKEN_2022_PROGRAM_ID),
3960
+ tokenProgram: splToken.TOKEN_2022_PROGRAM_ID,
3961
+ eventAuthority: rwaTokenSdk.getAssetControllerEventAuthority(),
3962
+ })
3963
+ .remainingAccounts([
3964
+ {
3965
+ pubkey: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
3966
+ isWritable: true,
3967
+ isSigner: false,
3968
+ },
3969
+ {
3970
+ pubkey: rwaTokenSdk.identityRegistryProgramId,
3971
+ isWritable: false,
3972
+ isSigner: false,
3973
+ },
3974
+ {
3975
+ pubkey: rwaTokenSdk.policyEngineProgramId,
3976
+ isWritable: false,
3977
+ isSigner: false,
3978
+ },
3979
+ {
3980
+ pubkey: rwaTokenSdk.getIdentityRegistryPda(args.assetMint),
3981
+ isWritable: false,
3982
+ isSigner: false,
3983
+ },
3984
+ {
3985
+ pubkey: rwaTokenSdk.getIdentityAccountPda(args.assetMint, args.to),
3986
+ isWritable: false,
3987
+ isSigner: false,
3988
+ },
3989
+ {
3990
+ pubkey: rwaTokenSdk.getIdentityAccountPda(args.assetMint, investorPda.toString()),
3991
+ isWritable: false,
3992
+ isSigner: false,
3993
+ },
3994
+ {
3995
+ pubkey: rwaTokenSdk.getTrackerAccountPda(args.assetMint, args.to),
3996
+ isWritable: true,
3997
+ isSigner: false,
3998
+ },
3999
+ {
4000
+ pubkey: rwaTokenSdk.getTrackerAccountPda(args.assetMint, investorPda.toString()),
4001
+ isWritable: true,
4002
+ isSigner: false,
4003
+ },
4004
+ {
4005
+ pubkey: rwaTokenSdk.getExtraMetasListPda(args.assetMint),
4006
+ isWritable: false,
4007
+ isSigner: false,
4008
+ },
4009
+ {
4010
+ pubkey: rwaTokenSdk.getWalletIdentityAccountPda(args.assetMint, args.to),
4011
+ isWritable: false,
4012
+ isSigner: false,
4013
+ },
4014
+ {
4015
+ pubkey: rwaTokenSdk.getWalletIdentityAccountPda(args.assetMint, args.from),
4016
+ isWritable: false,
4017
+ isSigner: false,
4018
+ },
4019
+ ])
4020
+ .instruction();
4021
+ });
4022
+ }
4023
+ }
4024
+
4025
+ /**
4026
+ * Represents the role-based access client for Policy Engine for an RWA.
4027
+ */
4028
+ class PolicyEngine {
4029
+ constructor(rwaClient, rbacProgram) {
4030
+ this.rwaClient = rwaClient;
4031
+ this.rbacProgram = rbacProgram;
4032
+ }
4033
+ /**
4034
+ * Asynchronously attaches a policy to the policy account.
4035
+ * @param args - {@link AttachPolicyArgs}
4036
+ * @param signer - User signer public key.
4037
+ * @param assetAccessController - RBAC AssetAccessController account.
4038
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
4039
+ * @returns A Promise that resolves to the instructions to attach a policy.
4040
+ * */
4041
+ attachPolicy(args, signer, assetAccessController, authorizedUserRole) {
4042
+ return __awaiter(this, void 0, void 0, function* () {
4043
+ const policyIx = yield this.rwaClient.policyEngine.attachPolicy(args);
4044
+ const ixData = policyIx.ixs[0].data;
4045
+ return this.rbacProgram.methods
4046
+ .attachToPolicyEngine(ixData)
4047
+ .accountsStrict({
4048
+ payer: args.payer,
4049
+ user: signer,
4050
+ controllerAuthority: args.authority,
4051
+ assetAccessController,
4052
+ authorizedUserRole: authorizedUserRole || null,
4053
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4054
+ policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
4055
+ systemProgram: web3_js.SystemProgram.programId,
4056
+ eventAuthority: rwaTokenSdk.getPolicyEngineEventAuthority(),
4057
+ })
4058
+ .instruction();
4059
+ });
4060
+ }
4061
+ /**
4062
+ * Asynchronously detaches a policy to the policy account.
4063
+ * @param args - {@link DetachPolicyArgs}
4064
+ * @param signer - User signer public key.
4065
+ * @param assetAccessController - RBAC AssetAccessController account.
4066
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
4067
+ * @returns A Promise that resolves to the instructions to detach a policy.
4068
+ * */
4069
+ detachPolicy(args, signer, assetAccessController, authorizedUserRole) {
4070
+ return __awaiter(this, void 0, void 0, function* () {
4071
+ const policyIx = yield this.rwaClient.policyEngine.detachPolicy(args);
4072
+ const ixData = policyIx.ixs[0].data;
4073
+ return this.rbacProgram.methods
4074
+ .detachFromPolicyEngine(ixData)
4075
+ .accountsStrict({
4076
+ payer: args.payer,
4077
+ user: signer,
4078
+ controllerAuthority: args.authority,
4079
+ assetAccessController,
4080
+ authorizedUserRole: authorizedUserRole || null,
4081
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4082
+ policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
4083
+ systemProgram: web3_js.SystemProgram.programId,
4084
+ eventAuthority: rwaTokenSdk.getPolicyEngineEventAuthority(),
4085
+ })
4086
+ .instruction();
4087
+ });
4088
+ }
4089
+ /**
4090
+ * Asynchronously changes counters on the policy account.
4091
+ * @param args - {@link ChangeCountersArgs}
4092
+ * @param signer - User signer public key.
4093
+ * @param assetAccessController - RBAC AssetAccessController account.
4094
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
4095
+ * @returns A Promise that resolves to the instructions to change the counters.
4096
+ * */
4097
+ changeCounters(args, signer, assetAccessController, authorizedUserRole) {
4098
+ return __awaiter(this, void 0, void 0, function* () {
4099
+ const policyIx = yield this.rwaClient.policyEngine.changeCounters(args);
4100
+ const ixData = policyIx.ixs[0].data;
4101
+ return this.rbacProgram.methods
4102
+ .changeCounters(ixData)
4103
+ .accountsStrict({
4104
+ payer: args.payer,
4105
+ user: signer,
4106
+ controllerAuthority: args.authority,
4107
+ assetAccessController,
4108
+ authorizedUserRole: authorizedUserRole || null,
4109
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4110
+ policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
4111
+ systemProgram: web3_js.SystemProgram.programId,
4112
+ eventAuthority: rwaTokenSdk.getPolicyEngineEventAuthority(),
4113
+ })
4114
+ .instruction();
4115
+ });
4116
+ }
4117
+ /**
4118
+ * Asynchronously sets counter values on the policy account.
4119
+ * @param args - {@link SetCountersArgs}
4120
+ * @param signer - User signer public key.
4121
+ * @param assetAccessController - RBAC AssetAccessController account.
4122
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
4123
+ * @returns A Promise that resolves to the instructions to set the counter values.
4124
+ * */
4125
+ setCounters(args, signer, assetAccessController, authorizedUserRole) {
4126
+ return __awaiter(this, void 0, void 0, function* () {
4127
+ const policyIx = yield this.rwaClient.policyEngine.setCounters(args);
4128
+ const ixData = policyIx.ixs[0].data;
4129
+ return this.rbacProgram.methods
4130
+ .setCounters(ixData)
4131
+ .accountsStrict({
4132
+ payer: args.payer,
4133
+ user: signer,
4134
+ controllerAuthority: args.authority,
4135
+ assetAccessController,
4136
+ authorizedUserRole: authorizedUserRole || null,
4137
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4138
+ policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
4139
+ eventAuthority: rwaTokenSdk.getPolicyEngineEventAuthority(),
4140
+ })
4141
+ .instruction();
4142
+ });
4143
+ }
4144
+ /**
4145
+ * Asynchronously changes counters limits on the policy account.
4146
+ * @param args - {@link ChangeCounterLimitsArgs}
4147
+ * @param signer - User signer public key.
4148
+ * @param assetAccessController - RBAC AssetAccessController account.
4149
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
4150
+ * @returns A Promise that resolves to the instructions to change the counters limits.
4151
+ * */
4152
+ changeCounterLimits(args, signer, assetAccessController, authorizedUserRole) {
4153
+ return __awaiter(this, void 0, void 0, function* () {
4154
+ const policyIx = yield this.rwaClient.policyEngine.changeCounterLimits(args);
4155
+ const ixData = policyIx.ixs[0].data;
4156
+ return this.rbacProgram.methods
4157
+ .changeCounterLimits(ixData)
4158
+ .accountsStrict({
4159
+ payer: args.payer,
4160
+ user: signer,
4161
+ controllerAuthority: args.authority,
4162
+ assetAccessController,
4163
+ authorizedUserRole: authorizedUserRole || null,
4164
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4165
+ policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
4166
+ systemProgram: web3_js.SystemProgram.programId,
4167
+ eventAuthority: rwaTokenSdk.getPolicyEngineEventAuthority(),
4168
+ })
4169
+ .instruction();
4170
+ });
4171
+ }
4172
+ /**
4173
+ * Asynchronously changes the levels mapping used in Policy Engine.
4174
+ * @param args - {@link ChangeMappingArgs}
4175
+ * @param signer - User signer public key.
4176
+ * @param assetAccessController - RBAC AssetAccessController account.
4177
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
4178
+ * */
4179
+ changeMapping(args, signer, assetAccessController, authorizedUserRole) {
4180
+ return __awaiter(this, void 0, void 0, function* () {
4181
+ const policyIx = yield this.rwaClient.policyEngine.changeMapping(args);
4182
+ const ixData = policyIx.ixs[0].data;
4183
+ return this.rbacProgram.methods
4184
+ .changeMapping(ixData)
4185
+ .accountsStrict({
4186
+ payer: args.payer,
4187
+ user: signer,
4188
+ controllerAuthority: args.authority,
4189
+ assetAccessController,
4190
+ authorizedUserRole: authorizedUserRole || null,
4191
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4192
+ policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
4193
+ eventAuthority: rwaTokenSdk.getPolicyEngineEventAuthority(),
4194
+ })
4195
+ .instruction();
4196
+ });
4197
+ }
4198
+ /**
4199
+ * Asynchronously changes the issuance policies enforced by Policy Engine.
4200
+ * @param args - {@link ChangeIssuancePoliciesArgs}
4201
+ * @param signer - User signer public key.
4202
+ * @param assetAccessController - RBAC AssetAccessController account.
4203
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
4204
+ * */
4205
+ changeIssuancePolicies(args, signer, assetAccessController, authorizedUserRole) {
4206
+ return __awaiter(this, void 0, void 0, function* () {
4207
+ const policyIx = yield this.rwaClient.policyEngine.changeIssuancePolicies(args);
4208
+ const ixData = policyIx.ixs[0].data;
4209
+ return this.rbacProgram.methods
4210
+ .changeIssuancePolicies(ixData)
4211
+ .accountsStrict({
4212
+ payer: args.payer,
4213
+ user: signer,
4214
+ controllerAuthority: args.authority,
4215
+ assetAccessController,
4216
+ authorizedUserRole: authorizedUserRole || null,
4217
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4218
+ policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
4219
+ eventAuthority: rwaTokenSdk.getPolicyEngineEventAuthority(),
4220
+ })
4221
+ .instruction();
4222
+ });
4223
+ }
4224
+ addLock(args, signer, assetAccessController, authorizedUserRole) {
4225
+ return __awaiter(this, void 0, void 0, function* () {
4226
+ const policyIx = yield this.rwaClient.policyEngine.addLock(args);
4227
+ const ixData = policyIx.ixs[0].data;
4228
+ return this.rbacProgram.methods
4229
+ .addLock(ixData)
4230
+ .accountsStrict({
4231
+ payer: args.payer,
4232
+ user: signer,
4233
+ controllerAuthority: args.authority,
4234
+ assetAccessController,
4235
+ authorizedUserRole: authorizedUserRole || null,
4236
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4237
+ policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
4238
+ systemProgram: web3_js.SystemProgram.programId,
4239
+ assetMint: new web3_js.PublicKey(args.assetMint),
4240
+ identityRegistry: rwaTokenSdk.getIdentityRegistryPda(args.assetMint),
4241
+ identityAccount: rwaTokenSdk.getIdentityAccountPda(args.assetMint, args.owner),
4242
+ trackerAccount: rwaTokenSdk.getTrackerAccountPda(args.assetMint, args.owner),
4243
+ eventAuthority: rwaTokenSdk.getPolicyEngineEventAuthority(),
4244
+ })
4245
+ .instruction();
4246
+ });
4247
+ }
4248
+ removeLock(args, signer, assetAccessController, authorizedUserRole) {
4249
+ return __awaiter(this, void 0, void 0, function* () {
4250
+ const policyIx = yield this.rwaClient.policyEngine.removeLock(args);
4251
+ const ixData = policyIx.ixs[0].data;
4252
+ return this.rbacProgram.methods
4253
+ .removeLock(ixData)
4254
+ .accountsStrict({
4255
+ payer: args.payer,
4256
+ user: signer,
4257
+ controllerAuthority: args.authority,
4258
+ assetAccessController,
4259
+ authorizedUserRole: authorizedUserRole || null,
4260
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4261
+ policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
4262
+ systemProgram: web3_js.SystemProgram.programId,
4263
+ assetMint: new web3_js.PublicKey(args.assetMint),
4264
+ identityRegistry: rwaTokenSdk.getIdentityRegistryPda(args.assetMint),
4265
+ identityAccount: rwaTokenSdk.getIdentityAccountPda(args.assetMint, args.owner),
4266
+ trackerAccount: rwaTokenSdk.getTrackerAccountPda(args.assetMint, args.owner),
4267
+ eventAuthority: rwaTokenSdk.getPolicyEngineEventAuthority(),
4268
+ })
4269
+ .instruction();
4270
+ });
4271
+ }
4272
+ }
4273
+
4274
+ /**
4275
+ * Represents the role-based access client for Identity Registry for an RWA.
4276
+ */
4277
+ class IdentityRegistry {
4278
+ constructor(rwaClient, rbacProgram) {
4279
+ this.rwaClient = rwaClient;
4280
+ this.rbacProgram = rbacProgram;
4281
+ }
4282
+ /**
4283
+ * Asynchronously generates instructions to setup a non-investor user with an identity account.
4284
+ * @param args - {@link SetupUserArgs}
4285
+ * @param authority - RBAC AssetAccessController ControllerAuthority.
4286
+ * @param assetAccessController - RBAC AssetAccessController account.
4287
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
4288
+ * @returns A Promise that resolves to the instructions to setup a user.
4289
+ *
4290
+ * It is required for at least a single user to be setup before issuing tokens.
4291
+ */
4292
+ setupUserIxns(args, assetAccessController, authorizedUserRole) {
4293
+ return __awaiter(this, void 0, void 0, function* () {
4294
+ const { ixs } = yield this.rwaClient.identityRegistry.setupUserIxns(args);
4295
+ const returnIxs = [];
4296
+ const identityAccountIx = ixs[0];
4297
+ const controllerAuthority = deriveControllerAuthorityPda(assetAccessController);
4298
+ const identityAccount = rwaTokenSdk.getIdentityAccountPda(args.assetMint, args.owner);
4299
+ returnIxs.push(yield this.rbacProgram.methods
4300
+ .createIdentityAccount(identityAccountIx.data)
4301
+ .accountsStrict({
4302
+ payer: args.payer,
4303
+ user: args.signer,
4304
+ controllerAuthority,
4305
+ assetAccessController,
4306
+ authorizedUserRole: authorizedUserRole || null,
4307
+ identityRegistryProgram: rwaTokenSdk.identityRegistryProgramId,
4308
+ identityRegistry: rwaTokenSdk.getIdentityRegistryPda(args.assetMint),
4309
+ identityAccount,
4310
+ walletIdentity: rwaTokenSdk.getWalletIdentityAccountPda(args.assetMint, args.owner),
4311
+ systemProgram: web3_js.SystemProgram.programId,
4312
+ eventAuthority: rwaTokenSdk.getIdentityRegistryEventAuthority(),
4313
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4314
+ trackerAccount: rwaTokenSdk.getTrackerAccountPda(args.assetMint, args.owner),
4315
+ assetMint: args.assetMint,
4316
+ })
4317
+ .instruction());
4318
+ return {
4319
+ ixs: returnIxs,
4320
+ signers: [],
4321
+ };
4322
+ });
4323
+ }
4324
+ /**
4325
+ * Asynchronously generates instructions to remove a non-investor user with an identity account.
4326
+ * @param args - {@link SetupUserArgs}
4327
+ * @param authority - RBAC AssetAccessController ControllerAuthority.
4328
+ * @param assetAccessController - RBAC AssetAccessController account.
4329
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
4330
+ * @returns A Promise that resolves to the instructions to setup a user.
4331
+ *
4332
+ * It is required for at least a single user to be setup before issuing tokens.
4333
+ */
4334
+ removeUserIxn(args, assetAccessController, authorizedUserRole) {
4335
+ return __awaiter(this, void 0, void 0, function* () {
4336
+ const ix = yield this.rwaClient.identityRegistry.revokeIdentityAccount(args);
4337
+ const identityAccountAddress = rwaTokenSdk.getIdentityAccountPda(args.assetMint, args.owner);
4338
+ const identityAccount = yield rwaTokenSdk.getIdentityAccount(identityAccountAddress, this.rwaClient.provider);
4339
+ const controllerAuthority = deriveControllerAuthorityPda(assetAccessController);
4340
+ const returnIx = yield this.rbacProgram.methods
4341
+ .removeIdentityAccount(ix.data)
4342
+ .accountsStrict({
4343
+ payer: args.payer,
4344
+ user: args.signer,
4345
+ controllerAuthority,
4346
+ assetAccessController,
4347
+ authorizedUserRole: authorizedUserRole || null,
4348
+ identityRegistryProgram: rwaTokenSdk.identityRegistryProgramId,
4349
+ identityRegistry: rwaTokenSdk.getIdentityRegistryPda(args.assetMint),
4350
+ identityAccount: identityAccountAddress,
4351
+ walletIdentity: rwaTokenSdk.getWalletIdentityAccountPda(args.assetMint, args.owner),
4352
+ eventAuthority: rwaTokenSdk.getIdentityRegistryEventAuthority(),
4353
+ identityOwner: identityAccount.owner,
4354
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4355
+ trackerAccount: rwaTokenSdk.getTrackerAccountPda(args.assetMint, args.owner),
4356
+ assetMint: args.assetMint,
4357
+ })
4358
+ .instruction();
4359
+ return returnIx;
4360
+ });
4361
+ }
4362
+ /**
4363
+ * Asynchronously generates instruction to attach wallet to identity.
4364
+ * @param args - {@link AttachDetachWalletArgs}
4365
+ * @param assetAccessController - RBAC AssetAccessController account.
4366
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
4367
+ * @returns A Promise that resolves to attach wallet.
4368
+ * */
4369
+ attachWalletToIdentityIxn(args, assetAccessController, authorizedUserRole) {
4370
+ return __awaiter(this, void 0, void 0, function* () {
4371
+ const controllerAuthority = deriveControllerAuthorityPda(assetAccessController);
4372
+ const identityProgram = rwaTokenSdk.getIdentityRegistryProgram(this.rwaClient.provider);
4373
+ const identityRegistry = rwaTokenSdk.getIdentityRegistryPda(args.assetMint);
4374
+ const identityAccount = rwaTokenSdk.getIdentityAccountPda(args.assetMint, args.owner);
4375
+ rwaTokenSdk.getIdentityAccountPda(args.assetMint, args.wallet);
4376
+ const walletIdentity = rwaTokenSdk.getWalletIdentityAccountPda(args.assetMint, args.wallet.toString());
4377
+ const ix = yield identityProgram.methods
4378
+ .attachWalletToIdentity(new web3_js.PublicKey(args.wallet))
4379
+ .accountsStrict({
4380
+ payer: args.payer,
4381
+ authority: controllerAuthority,
4382
+ identityAccount,
4383
+ identityRegistry,
4384
+ assetMint: args.assetMint,
4385
+ walletIdentity,
4386
+ systemProgram: web3_js.SystemProgram.programId,
4387
+ eventAuthority: rwaTokenSdk.getIdentityRegistryEventAuthority(),
4388
+ program: rwaTokenSdk.identityRegistryProgramId,
4389
+ })
4390
+ .instruction();
4391
+ return this.rbacProgram.methods
4392
+ .attachWalletToIdentity(ix.data)
4393
+ .accountsStrict({
4394
+ payer: args.payer,
4395
+ user: args.signer,
4396
+ controllerAuthority,
4397
+ assetAccessController,
4398
+ authorizedUserRole: authorizedUserRole || null,
4399
+ identityRegistryProgram: rwaTokenSdk.identityRegistryProgramId,
4400
+ identityAccount,
4401
+ identityRegistry,
4402
+ assetMint: args.assetMint,
4403
+ walletIdentity,
4404
+ systemProgram: web3_js.SystemProgram.programId,
4405
+ eventAuthority: rwaTokenSdk.getIdentityRegistryEventAuthority(),
4406
+ })
4407
+ .instruction();
4408
+ });
4409
+ }
4410
+ /**
4411
+ * Asynchronously generates instruction to detach wallet from identity.
4412
+ * @param args - {@link AttachDetachWalletArgs}
4413
+ * @param assetAccessController - RBAC AssetAccessController account.
4414
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
4415
+ * @returns A Promise that resolves to detach wallet.
4416
+ * */
4417
+ detachWalletFromIdentityIxn(args, assetAccessController, authorizedUserRole) {
4418
+ return __awaiter(this, void 0, void 0, function* () {
4419
+ const controllerAuthority = deriveControllerAuthorityPda(assetAccessController);
4420
+ const identityProgram = rwaTokenSdk.getIdentityRegistryProgram(this.rwaClient.provider);
4421
+ const identityRegistry = rwaTokenSdk.getIdentityRegistryPda(args.assetMint);
4422
+ const identityAccount = rwaTokenSdk.getIdentityAccountPda(args.assetMint, args.owner);
4423
+ const walletIdentity = rwaTokenSdk.getWalletIdentityAccountPda(args.assetMint, args.wallet.toString());
4424
+ const tokenAccount = splToken.getAssociatedTokenAddressSync(new web3_js.PublicKey(args.assetMint), new web3_js.PublicKey(args.wallet), false, splToken.TOKEN_2022_PROGRAM_ID);
4425
+ const ix = yield identityProgram.methods
4426
+ .detachWalletFromIdentity()
4427
+ .accountsStrict({
4428
+ payer: args.payer,
4429
+ authority: controllerAuthority,
4430
+ walletIdentity,
4431
+ identityAccount,
4432
+ identityRegistry,
4433
+ eventAuthority: rwaTokenSdk.getIdentityRegistryEventAuthority(),
4434
+ program: rwaTokenSdk.identityRegistryProgramId,
4435
+ tokenAccount: tokenAccount,
4436
+ assetMint: args.assetMint,
4437
+ })
4438
+ .instruction();
4439
+ return this.rbacProgram.methods
4440
+ .detachWalletFromIdentity(ix.data)
4441
+ .accountsStrict({
4442
+ payer: args.payer,
4443
+ user: args.signer,
4444
+ controllerAuthority,
4445
+ assetAccessController,
4446
+ authorizedUserRole: authorizedUserRole || null,
4447
+ identityRegistryProgram: rwaTokenSdk.identityRegistryProgramId,
4448
+ walletIdentity,
4449
+ identityAccount,
4450
+ identityRegistry,
4451
+ eventAuthority: rwaTokenSdk.getIdentityRegistryEventAuthority(),
4452
+ tokenAccount: tokenAccount,
4453
+ assetMint: args.assetMint,
4454
+ })
4455
+ .instruction();
4456
+ });
4457
+ }
4458
+ }
4459
+
4460
+ /**
4461
+ * Role-based access client for accessing Identity Metadata Registry.
4462
+ */
4463
+ class IdentityMetadataRegistry {
4464
+ constructor(rwaClient, rbacProgram, imrProgram) {
4465
+ this.rwaClient = rwaClient;
4466
+ this.rbacProgram = rbacProgram;
4467
+ this.imrProgram = imrProgram;
4468
+ }
4469
+ /**
4470
+ * Parses inner instructions data field for array of events emitted by program using CPI Events.
4471
+ * @param ixs - Array of CompiledInstruction from a transaction inner instructions.
4472
+ * @returns Array of Events
4473
+ * */
4474
+ parseEvents(ixs) {
4475
+ const eventCoder = this.imrProgram.coder.events;
4476
+ const events = ixs
4477
+ .map(({ data }) => {
4478
+ try {
4479
+ const buffer = Buffer.from(anchor.utils.bytes.bs58.decode(data));
4480
+ const event = eventCoder.decode(anchor.utils.bytes.base64.encode(buffer.slice(8)));
4481
+ return event;
4482
+ }
4483
+ catch (err) {
4484
+ console.error("Error decoding events", err);
4485
+ }
4486
+ })
4487
+ .filter((v) => v != null);
4488
+ return events;
4489
+ }
4490
+ /**
4491
+ * Asynchronously generates instructions to setup an investor.
4492
+ * @param args - {@link SetupInvestorArgs}
4493
+ * @param authority - RBAC AssetAccessController ControllerAuthority.
4494
+ * @param assetAccessController - RBAC AssetAccessController account.
4495
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
4496
+ * @returns A Promise that resolves to the instructions to setup an investor.
4497
+ *
4498
+ * It is required for at least a single user to be setup before issuing tokens.
4499
+ */
4500
+ setupUserIxns(args, assetAccessController, authorizedUserRole) {
4501
+ return __awaiter(this, void 0, void 0, function* () {
4502
+ const returnIxs = [];
4503
+ const controllerAuthority = deriveControllerAuthorityPda(assetAccessController);
4504
+ const identityRegistry = rwaTokenSdk.getIdentityRegistryPda(args.assetMint);
4505
+ const investor = deriveInvestorPda(args.investorId, identityRegistry);
4506
+ const identityAccount = rwaTokenSdk.getIdentityAccountPda(args.assetMint, investor.toString() // Investor is owner of IdentityAccount
4507
+ );
4508
+ const assetMintKey = new web3_js.PublicKey(args.assetMint);
4509
+ const registerIx = yield this.imrProgram.methods
4510
+ .registerInvestor(args.investorId, args.collisionHash, args.levels[0], args.expiries[0], args.country, args.proofHashes[0])
4511
+ .accountsStrict({
4512
+ payer: args.payer,
4513
+ authority: controllerAuthority,
4514
+ investor,
4515
+ identityRegistryProgram: rwaTokenSdk.identityRegistryProgramId,
4516
+ identityRegistry,
4517
+ identityAccount,
4518
+ walletIdentity: rwaTokenSdk.getWalletIdentityAccountPda(args.assetMint, investor.toString() // Investor is owner of IdentityAccount
4519
+ ),
4520
+ systemProgram: web3_js.SystemProgram.programId,
4521
+ eventAuthority: getEventAuthority(IMR_PROGRAM),
4522
+ eventAuthorityIdentityRegistry: rwaTokenSdk.getIdentityRegistryEventAuthority(),
4523
+ program: rwaTokenSdk.identityRegistryProgramId,
4524
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4525
+ trackerAccount: rwaTokenSdk.getTrackerAccountPda(args.assetMint, investor.toString()),
4526
+ assetMint: assetMintKey,
4527
+ })
4528
+ .instruction();
4529
+ returnIxs.push(yield this.rbacProgram.methods
4530
+ .registerInvestor(registerIx.data)
4531
+ .accountsStrict({
4532
+ payer: args.payer,
4533
+ user: args.signer,
4534
+ controllerAuthority,
4535
+ assetAccessController,
4536
+ authorizedUserRole: authorizedUserRole || null,
4537
+ identityMetadataRegistryProgram: IMR_PROGRAM,
4538
+ investor,
4539
+ identityRegistryProgram: rwaTokenSdk.identityRegistryProgramId,
4540
+ identityRegistry,
4541
+ identityAccount,
4542
+ walletIdentity: rwaTokenSdk.getWalletIdentityAccountPda(args.assetMint, investor.toString()),
4543
+ systemProgram: web3_js.SystemProgram.programId,
4544
+ eventAuthorityIdentityMetadataRegistry: getEventAuthority(IMR_PROGRAM),
4545
+ eventAuthorityIdentityRegistry: rwaTokenSdk.getIdentityRegistryEventAuthority(),
4546
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4547
+ trackerAccount: rwaTokenSdk.getTrackerAccountPda(args.assetMint, investor.toString()),
4548
+ assetMint: assetMintKey,
4549
+ })
4550
+ .instruction());
4551
+ if (args.levels.length > 1) {
4552
+ returnIxs.push(yield this.addLevels({
4553
+ payer: args.payer,
4554
+ signer: args.signer,
4555
+ investorId: args.investorId,
4556
+ assetMint: args.assetMint,
4557
+ levels: args.levels.slice(1),
4558
+ expiries: args.expiries.slice(1),
4559
+ proofHashes: args.proofHashes.slice(1),
4560
+ enforceLimits: args.enforceLimits,
4561
+ }, assetAccessController, authorizedUserRole));
4562
+ }
4563
+ return {
4564
+ ixs: returnIxs,
4565
+ signers: [],
4566
+ };
4567
+ });
4568
+ }
4569
+ /**
4570
+ * Asynchronously add levels to investor.
4571
+ * @param args - {@link AddLevelsArgs}
4572
+ * @param assetAccessController - RBAC AssetAccessController account.
4573
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
4574
+ * @returns A Promise that resolves to the instructions to add levels.
4575
+ * */
4576
+ addLevels(args, assetAccessController, authorizedUserRole) {
4577
+ return __awaiter(this, void 0, void 0, function* () {
4578
+ var _a;
4579
+ const controllerAuthority = deriveControllerAuthorityPda(assetAccessController);
4580
+ const identityRegistry = rwaTokenSdk.getIdentityRegistryPda(args.assetMint);
4581
+ const investor = deriveInvestorPda(args.investorId, identityRegistry);
4582
+ const identityAccount = rwaTokenSdk.getIdentityAccountPda(args.assetMint, investor.toString());
4583
+ const trackerAccount = rwaTokenSdk.getTrackerAccountPda(args.assetMint, investor.toString());
4584
+ const ix = yield this.imrProgram.methods
4585
+ .addLevels(Buffer.from(args.levels), args.expiries, args.proofHashes, (_a = args.enforceLimits) !== null && _a !== void 0 ? _a : false)
4586
+ .accountsStrict({
4587
+ payer: args.payer,
4588
+ authority: controllerAuthority,
4589
+ investor,
4590
+ identityRegistryProgram: rwaTokenSdk.identityRegistryProgramId,
4591
+ identityRegistry,
4592
+ identityAccount,
4593
+ systemProgram: web3_js.SystemProgram.programId,
4594
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4595
+ policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
4596
+ trackerAccount,
4597
+ assetMint: args.assetMint,
4598
+ eventAuthorityIdentityRegistry: rwaTokenSdk.getIdentityRegistryEventAuthority(),
4599
+ eventAuthority: getEventAuthority(IMR_PROGRAM),
4600
+ program: IMR_PROGRAM,
4601
+ })
4602
+ .instruction();
4603
+ return this.rbacProgram.methods
4604
+ .addLevels(ix.data)
4605
+ .accountsStrict({
4606
+ payer: args.payer,
4607
+ user: args.signer,
4608
+ controllerAuthority,
4609
+ assetAccessController,
4610
+ authorizedUserRole: authorizedUserRole || null,
4611
+ identityMetadataRegistryProgram: IMR_PROGRAM,
4612
+ investor,
4613
+ identityRegistryProgram: rwaTokenSdk.identityRegistryProgramId,
4614
+ identityRegistry,
4615
+ identityAccount,
4616
+ systemProgram: web3_js.SystemProgram.programId,
4617
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4618
+ policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
4619
+ trackerAccount,
4620
+ assetMint: args.assetMint,
4621
+ eventAuthorityIdentityRegistry: rwaTokenSdk.getIdentityRegistryEventAuthority(),
4622
+ eventAuthorityIdentityMetadataRegistry: getEventAuthority(IMR_PROGRAM),
4623
+ })
4624
+ .instruction();
4625
+ });
4626
+ }
4627
+ /**
4628
+ * Asynchronously change country for the Investor.
4629
+ * @param args - {@link ChangeCountryArgs}
4630
+ * @param assetAccessController - RBAC AssetAccessController account.
4631
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
4632
+ * @returns A Promise that resolves to the instructions to change the country.
4633
+ * */
4634
+ changeCountry(args, assetAccessController, authorizedUserRole) {
4635
+ return __awaiter(this, void 0, void 0, function* () {
4636
+ var _a;
4637
+ const controllerAuthority = deriveControllerAuthorityPda(assetAccessController);
4638
+ const identityRegistry = rwaTokenSdk.getIdentityRegistryPda(args.assetMint);
4639
+ const investor = deriveInvestorPda(args.investorId, identityRegistry);
4640
+ const identityAccount = rwaTokenSdk.getIdentityAccountPda(args.assetMint, investor.toString());
4641
+ const trackerAccount = rwaTokenSdk.getTrackerAccountPda(args.assetMint, investor.toString());
4642
+ const ix = yield this.imrProgram.methods
4643
+ .changeCountry(args.country, (_a = args.enforceLimits) !== null && _a !== void 0 ? _a : false)
4644
+ .accountsStrict({
4645
+ payer: args.payer,
4646
+ authority: controllerAuthority,
4647
+ investor,
4648
+ identityRegistryProgram: rwaTokenSdk.identityRegistryProgramId,
4649
+ identityRegistry,
4650
+ identityAccount,
4651
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4652
+ policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
4653
+ trackerAccount,
4654
+ assetMint: args.assetMint,
4655
+ eventAuthorityIdentityRegistry: rwaTokenSdk.getIdentityRegistryEventAuthority(),
4656
+ })
4657
+ .instruction();
4658
+ return this.rbacProgram.methods
4659
+ .changeCountry(ix.data)
4660
+ .accountsStrict({
4661
+ payer: args.payer,
4662
+ user: args.signer,
4663
+ controllerAuthority,
4664
+ assetAccessController,
4665
+ authorizedUserRole: authorizedUserRole || null,
4666
+ identityMetadataRegistryProgram: IMR_PROGRAM,
4667
+ investor,
4668
+ identityRegistryProgram: rwaTokenSdk.identityRegistryProgramId,
4669
+ identityRegistry,
4670
+ identityAccount,
4671
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4672
+ policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
4673
+ trackerAccount,
4674
+ assetMint: args.assetMint,
4675
+ eventAuthorityIdentityRegistry: rwaTokenSdk.getIdentityRegistryEventAuthority(),
4676
+ })
4677
+ .instruction();
4678
+ });
4679
+ }
4680
+ /**
4681
+ * Asynchronously remove levels from an investor.
4682
+ * @param args - {@link RemoveLevelsArgs}
4683
+ * @param assetAccessController - RBAC AssetAccessController account.
4684
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
4685
+ * @returns A Promise that resolves to the instructions to remove levels.
4686
+ * */
4687
+ removeLevels(args, assetAccessController, authorizedUserRole) {
4688
+ return __awaiter(this, void 0, void 0, function* () {
4689
+ var _a;
4690
+ const controllerAuthority = deriveControllerAuthorityPda(assetAccessController);
4691
+ const identityRegistry = rwaTokenSdk.getIdentityRegistryPda(args.assetMint);
4692
+ const investor = deriveInvestorPda(args.investorId, identityRegistry);
4693
+ const identityAccount = rwaTokenSdk.getIdentityAccountPda(args.assetMint, investor.toString());
4694
+ const trackerAccount = rwaTokenSdk.getTrackerAccountPda(args.assetMint, investor.toString());
4695
+ const ix = yield this.imrProgram.methods
4696
+ .removeLevels(Buffer.from(args.levels), (_a = args.enforceLimits) !== null && _a !== void 0 ? _a : false)
4697
+ .accountsStrict({
4698
+ payer: args.payer,
4699
+ authority: controllerAuthority,
4700
+ investor,
4701
+ identityRegistryProgram: rwaTokenSdk.identityRegistryProgramId,
4702
+ identityRegistry,
4703
+ identityAccount,
4704
+ systemProgram: web3_js.SystemProgram.programId,
4705
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4706
+ policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
4707
+ trackerAccount,
4708
+ assetMint: args.assetMint,
4709
+ eventAuthorityIdentityRegistry: rwaTokenSdk.getIdentityRegistryEventAuthority(),
4710
+ })
4711
+ .instruction();
4712
+ return this.rbacProgram.methods
4713
+ .removeLevels(ix.data)
4714
+ .accountsStrict({
4715
+ payer: args.payer,
4716
+ user: args.signer,
4717
+ controllerAuthority,
4718
+ assetAccessController,
4719
+ authorizedUserRole: authorizedUserRole || null,
4720
+ identityMetadataRegistryProgram: IMR_PROGRAM,
4721
+ investor,
4722
+ identityRegistryProgram: rwaTokenSdk.identityRegistryProgramId,
4723
+ identityRegistry,
4724
+ identityAccount,
4725
+ systemProgram: web3_js.SystemProgram.programId,
4726
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4727
+ policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
4728
+ trackerAccount,
4729
+ assetMint: args.assetMint,
4730
+ eventAuthorityIdentityRegistry: rwaTokenSdk.getIdentityRegistryEventAuthority(),
4731
+ })
4732
+ .instruction();
4733
+ });
4734
+ }
4735
+ /**
4736
+ * Asynchronously remove an investor.
4737
+ * @param args - {@link RemoveLevelsArgs}
4738
+ * @param assetAccessController - RBAC AssetAccessController account.
4739
+ * @param authorizedUserRole - UserRole authorized to invoke instruction.
4740
+ * @returns A Promise that resolves to the instructions to remove an investor.
4741
+ * */
4742
+ removeInvestor(args, assetAccessController, authorizedUserRole) {
4743
+ return __awaiter(this, void 0, void 0, function* () {
4744
+ const controllerAuthority = deriveControllerAuthorityPda(assetAccessController);
4745
+ const identityRegistry = rwaTokenSdk.getIdentityRegistryPda(args.assetMint);
4746
+ const investor = deriveInvestorPda(args.investorId, identityRegistry);
4747
+ const identityAccount = rwaTokenSdk.getIdentityAccountPda(args.assetMint, investor.toString());
4748
+ return this.rbacProgram.methods
4749
+ .removeInvestor()
4750
+ .accountsStrict({
4751
+ payer: args.payer,
4752
+ user: args.signer,
4753
+ controllerAuthority,
4754
+ assetAccessController,
4755
+ authorizedUserRole: authorizedUserRole || null,
4756
+ identityMetadataRegistryProgram: IMR_PROGRAM,
4757
+ investor,
4758
+ identityRegistryProgram: rwaTokenSdk.identityRegistryProgramId,
4759
+ identityRegistry,
4760
+ identityAccount,
4761
+ walletIdentity: rwaTokenSdk.getWalletIdentityAccountPda(args.assetMint, investor.toString()),
4762
+ policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
4763
+ trackerAccount: rwaTokenSdk.getTrackerAccountPda(args.assetMint, investor.toString()),
4764
+ eventAuthorityIdentityMetadataRegistry: getEventAuthority(IMR_PROGRAM),
4765
+ eventAuthorityIdentityRegistry: rwaTokenSdk.getIdentityRegistryEventAuthority(),
4766
+ assetMint: args.assetMint,
4767
+ })
4768
+ .instruction();
4769
+ });
4770
+ }
4771
+ /**
4772
+ * Asynchronously attach a wallet to IdentityAccouont for the Investor.
4773
+ * @param args - {@link AttachWalletByInvestorArgs}
4774
+ * */
4775
+ attachWalletByInvestor(args) {
4776
+ return __awaiter(this, void 0, void 0, function* () {
4777
+ const identityRegistry = rwaTokenSdk.getIdentityRegistryPda(args.assetMint);
4778
+ const investor = deriveInvestorPda(args.investorId, identityRegistry);
4779
+ const identityAccount = rwaTokenSdk.getIdentityAccountPda(args.assetMint, investor.toString());
4780
+ return this.imrProgram.methods
4781
+ .attachWalletByInvestor(args.newWallet)
4782
+ .accountsStrict({
4783
+ payer: args.payer,
4784
+ wallet: args.signer,
4785
+ investor,
4786
+ walletIdentity: rwaTokenSdk.getWalletIdentityAccountPda(args.assetMint, args.signer),
4787
+ identityRegistryProgram: rwaTokenSdk.identityRegistryProgramId,
4788
+ newWalletIdentity: rwaTokenSdk.getWalletIdentityAccountPda(args.assetMint, args.newWallet.toString()),
4789
+ identityAccount,
4790
+ identityRegistry,
4791
+ assetMint: args.assetMint,
4792
+ systemProgram: web3_js.SystemProgram.programId,
4793
+ eventAuthorityIdentityRegistry: rwaTokenSdk.getIdentityRegistryEventAuthority(),
4794
+ })
4795
+ .instruction();
4796
+ });
4797
+ }
4798
+ }
4799
+
4800
+ class RwaRbacClient {
4801
+ constructor(config, provider) {
4802
+ this.rwaClient = new rwaTokenSdk.RwaClient(config, provider);
4803
+ this.provider = provider;
4804
+ this.rbacProgram = new anchor.Program(rbacIDL, this.provider);
4805
+ this.assetController = new AssetController(this.rwaClient, this.rbacProgram);
4806
+ this.policyEngine = new PolicyEngine(this.rwaClient, this.rbacProgram);
4807
+ this.identityRegistry = new IdentityRegistry(this.rwaClient, this.rbacProgram);
4808
+ this.identityMetadataRegistry = new IdentityMetadataRegistry(this.rwaClient, this.rbacProgram, new anchor.Program(imrIDL, this.provider));
4809
+ }
4810
+ /**
4811
+ * Parses inner instructions data field for array of events emitted by program using CPI Events.
4812
+ * @param ixs - Array of CompiledInstruction from a transaction inner instructions.
4813
+ * @returns Array of Events
4814
+ * */
4815
+ parseEvents(ixs) {
4816
+ const eventCoder = this.rbacProgram.coder.events;
4817
+ const events = ixs
4818
+ .map(({ data }) => {
4819
+ try {
4820
+ const buffer = Buffer.from(anchor.utils.bytes.bs58.decode(data));
4821
+ const event = eventCoder.decode(anchor.utils.bytes.base64.encode(buffer.slice(8)));
4822
+ return event;
4823
+ }
4824
+ catch (err) {
4825
+ console.error("Error decoding events", err);
4826
+ }
4827
+ })
4828
+ .filter((v) => v != null);
4829
+ return events;
4830
+ }
4831
+ /**
4832
+ * Asynchronously generates instruction to create AssetAccessController for an organization.
4833
+ * @param args - {@link CreateControllerArgs}
4834
+ * @returns A Promise that resolves to the instruction to create AssetAccessController.
4835
+ */
4836
+ createAssetAccessControllerIxn(args) {
4837
+ return __awaiter(this, void 0, void 0, function* () {
4838
+ const assetAccessController = deriveAssetAccessControllerPda(args.assetMint);
4839
+ const assetAccessControllerAuthority = deriveControllerAuthorityPda(assetAccessController);
4840
+ const cpiInstruction = yield this.assetController.setupNewRegistry({
4841
+ decimals: args.decimals,
4842
+ authority: assetAccessControllerAuthority.toString(),
4843
+ name: args.name,
4844
+ uri: args.uri,
4845
+ symbol: args.symbol,
4846
+ interestRate: args.interestRate,
4847
+ assetMint: args.assetMint.toString(),
4848
+ payer: args.payer.toString(),
4849
+ });
4850
+ return this.rbacProgram.methods
4851
+ .createController(cpiInstruction.data)
4852
+ .accountsStrict({
4853
+ payer: args.payer,
4854
+ admin: args.admin,
4855
+ assetAccessController,
4856
+ assetAccessControllerAuthority,
4857
+ assetMint: args.assetMint,
4858
+ assetController: cpiInstruction.keys[2].pubkey,
4859
+ extraMetasAccount: cpiInstruction.keys[4].pubkey,
4860
+ policyEngineAccount: cpiInstruction.keys[5].pubkey,
4861
+ identityRegistryAccount: cpiInstruction.keys[6].pubkey,
4862
+ policyEngineProgram: cpiInstruction.keys[7].pubkey,
4863
+ identityRegistryProgram: cpiInstruction.keys[8].pubkey,
4864
+ assetControllerProgram: cpiInstruction.programId,
4865
+ tokenProgram: splToken.TOKEN_2022_PROGRAM_ID,
4866
+ systemProgram: web3_js.SystemProgram.programId,
4867
+ assetControllerEventAuthority: rwaTokenSdk.getAssetControllerEventAuthority(),
4868
+ })
4869
+ .instruction();
4870
+ });
4871
+ }
4872
+ /**
4873
+ * Asynchronously generates instruction to update admin key on AssetAccessController.
4874
+ * @param args - {@link UpdateControllerAdminArgs}
4875
+ * @returns A Promise that resolves to the instruction to update admin on AssetAccessController.
4876
+ */
4877
+ updateControllerAdminIxn(args) {
4878
+ return __awaiter(this, void 0, void 0, function* () {
4879
+ return this.rbacProgram.methods
4880
+ .updateControllerAdmin(args.newAdmin)
4881
+ .accountsStrict({
4882
+ admin: args.admin,
4883
+ assetAccessController: args.assetAccessController,
4884
+ })
4885
+ .instruction();
4886
+ });
4887
+ }
4888
+ /**
4889
+ * Asynchronously generates instruction to create a UserRole for an AssetAccessController.
4890
+ * @param args - {@link SetupUserRoleArgs}
4891
+ * @returns A Promise that resolves to the instruction to create UserRole.
4892
+ */
4893
+ createUserRoleIxn(args) {
4894
+ return __awaiter(this, void 0, void 0, function* () {
4895
+ // Fetch controller to get next UserRole id.
4896
+ const controller = yield this.rbacProgram.account.assetAccessController.fetch(args.assetAccessController);
4897
+ return this.rbacProgram.methods
4898
+ .createUserRole(args.name, new anchor.BN(args.allowedAdminIxs), new anchor.BN(args.allowedMediciIxs), args.isMasterRole || false)
4899
+ .accountsStrict({
4900
+ payer: args.payer,
4901
+ user: args.user,
4902
+ newUserRole: deriveUserRolePda(controller.userRolesCount.addn(1), args.assetAccessController),
4903
+ authorizedUserRole: args.authorizedUserRole || null,
4904
+ assetAccessController: args.assetAccessController,
4905
+ systemProgram: web3_js.SystemProgram.programId,
4906
+ })
4907
+ .instruction();
4908
+ });
4909
+ }
4910
+ /**
4911
+ * Asynchronously generates instruction to modify UserRole.
4912
+ * @param args - {@link ModifyUserRoleArgs}
4913
+ * @returns A Promise that resolves to the instruction to modify UserRole.
4914
+ */
4915
+ modifyUserRoleIxn(args) {
4916
+ return __awaiter(this, void 0, void 0, function* () {
4917
+ return this.rbacProgram.methods
4918
+ .modifyUserRole(args.name, new anchor.BN(args.allowedAdminIxs), new anchor.BN(args.allowedMediciIxs))
4919
+ .accountsStrict({
4920
+ user: args.user,
4921
+ userRole: args.userRole,
4922
+ assetAccessController: args.assetAccessController,
4923
+ authorizedUserRole: args.authorizedUserRole || null,
4924
+ })
4925
+ .instruction();
4926
+ });
4927
+ }
4928
+ /**
4929
+ * Asynchronously generates instruction to delete UserRole.
4930
+ * @param args - {@link DeleteUserRoleArgs}
4931
+ * @returns A Promise that resolves to the instruction to delete UserRole.
4932
+ */
4933
+ deleteUserRoleIxn(args) {
4934
+ return __awaiter(this, void 0, void 0, function* () {
4935
+ return this.rbacProgram.methods
4936
+ .deleteUserRole()
4937
+ .accountsStrict({
4938
+ receiver: args.receiver,
4939
+ user: args.user,
4940
+ userRole: args.userRole,
4941
+ assetAccessController: args.assetAccessController,
4942
+ authorizedUserRole: args.authorizedUserRole || null,
4943
+ })
4944
+ .instruction();
4945
+ });
4946
+ }
4947
+ /**
4948
+ * Asynchronously generates instruction to assign users to a UserRole.
4949
+ * @param args - {@link AssignUserRoleArgs}
4950
+ * @returns A Promise that resolves to the instruction to assign UserRole.
4951
+ */
4952
+ assignUserRoleIxn(args) {
4953
+ return __awaiter(this, void 0, void 0, function* () {
4954
+ return this.rbacProgram.methods
4955
+ .assignUserRole(args.usersToAssign)
4956
+ .accountsStrict({
4957
+ payer: args.payer,
4958
+ user: args.user,
4959
+ userRole: args.userRole,
4960
+ authorizedUserRole: args.authorizedUserRole || null,
4961
+ assetAccessController: args.assetAccessController,
4962
+ systemProgram: web3_js.SystemProgram.programId,
4963
+ eventAuthority: getEventAuthority(RBAC_PROGRAM),
4964
+ program: RBAC_PROGRAM,
4965
+ })
4966
+ .instruction();
4967
+ });
4968
+ }
4969
+ /**
4970
+ * Asynchronously generates instruction to remove users from a UserRole.
4971
+ * @param args - {@link RemoveUserRoleArgs}
4972
+ * @returns A Promise that resolves to the instruction to remove users from a UserRole.
4973
+ */
4974
+ removeUserRoleIxn(args) {
4975
+ return __awaiter(this, void 0, void 0, function* () {
4976
+ return this.rbacProgram.methods
4977
+ .removeUserRole(args.usersToRemove)
4978
+ .accountsStrict({
4979
+ user: args.user,
4980
+ userRole: args.userRole,
4981
+ authorizedUserRole: args.authorizedUserRole || null,
4982
+ assetAccessController: args.assetAccessController,
4983
+ eventAuthority: getEventAuthority(RBAC_PROGRAM),
4984
+ program: RBAC_PROGRAM,
4985
+ })
4986
+ .instruction();
4987
+ });
4988
+ }
4989
+ /**
4990
+ * Asynchronously generates instruction to withdraw excess rent from ControllerAuthority.
4991
+ * @param args - {@link WithdrawExcessRentArgs}
4992
+ * @returns A Promise that resolves to the instruction to withdraw excess rent from ControllerAuthority.
4993
+ */
4994
+ withdrawExcessRentIxn(args) {
4995
+ return __awaiter(this, void 0, void 0, function* () {
4996
+ return this.rbacProgram.methods
4997
+ .withdrawExcessRent()
4998
+ .accountsStrict({
4999
+ receiver: args.receiver,
5000
+ user: args.admin,
5001
+ controllerAuthority: args.controllerAuthority,
5002
+ assetAccessController: args.assetAccessController,
5003
+ systemProgram: web3_js.SystemProgram.programId,
5004
+ authorizedUserRole: args.authorizedUserRole || null,
5005
+ })
5006
+ .instruction();
5007
+ });
5008
+ }
5009
+ /**
5010
+ * Asynchronously generates instruction to set lookup table address field in the AssetAccessController.
5011
+ * @param args - {@link SetLookuptableAddressArgs}
5012
+ * @returns A Promise that resolves to the instruction to set lookup table address.
5013
+ */
5014
+ setLookuptableAddressIxn(args) {
5015
+ return __awaiter(this, void 0, void 0, function* () {
5016
+ return this.rbacProgram.methods
5017
+ .setLutAddress()
5018
+ .accountsStrict({
5019
+ user: args.signer,
5020
+ assetAccessController: args.assetAccessController,
5021
+ authorizedUserRole: args.authorizedUserRole || null,
5022
+ lutAddress: args.lutAddress,
5023
+ })
5024
+ .instruction();
5025
+ });
5026
+ }
5027
+ }
5028
+
5029
+ /**
5030
+ * Combines one ore more flag enums into a single combination flag.
5031
+ * @returns Number
5032
+ */
5033
+ const computeFlags = (...flags) => {
5034
+ return flags.reduce((accumulator, flag) => accumulator | flag, 0);
5035
+ };
5036
+
5037
+ exports.AssetController = AssetController;
5038
+ exports.IMR_PROGRAM = IMR_PROGRAM;
5039
+ exports.IdentityMetadataRegistry = IdentityMetadataRegistry;
5040
+ exports.IdentityRegistry = IdentityRegistry;
5041
+ exports.PolicyEngine = PolicyEngine;
5042
+ exports.RBAC_PROGRAM = RBAC_PROGRAM;
5043
+ exports.RwaImrIdl = rwa_imr;
5044
+ exports.RwaRbacClient = RwaRbacClient;
5045
+ exports.RwaRbacIdl = rwa_rbac;
5046
+ exports.TL_PROGRAM = TL_PROGRAM;
5047
+ exports.computeFlags = computeFlags;
5048
+ exports.deriveAssetAccessControllerPda = deriveAssetAccessControllerPda;
5049
+ exports.deriveControllerAuthorityPda = deriveControllerAuthorityPda;
5050
+ exports.deriveInvestorLocks = deriveInvestorLocks;
5051
+ exports.deriveInvestorPda = deriveInvestorPda;
5052
+ exports.deriveLockedTokenAccount = deriveLockedTokenAccount;
5053
+ exports.deriveUserRolePda = deriveUserRolePda;
5054
+ exports.getEventAuthority = getEventAuthority;