@dstoken-solana/rwa-rbac 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/AssetController.d.ts +16 -30
- package/dist/client/AssetController.d.ts.map +1 -1
- package/dist/client/IdentityMetadataRegistry.d.ts +5 -5
- package/dist/client/IdentityMetadataRegistry.d.ts.map +1 -1
- package/dist/client/IdentityRegistry.d.ts +6 -30
- package/dist/client/IdentityRegistry.d.ts.map +1 -1
- package/dist/client/PolicyEngine.d.ts +7 -7
- package/dist/client/RwaRbacClient.d.ts.map +1 -1
- package/dist/index.es.js +303 -592
- package/dist/index.js +302 -591
- package/dist/pdas.d.ts.map +1 -1
- package/dist/types/flags.d.ts +26 -27
- package/dist/types/flags.d.ts.map +1 -1
- package/dist/types/generated/rwa_imr.d.ts +13 -0
- package/dist/types/generated/rwa_imr.d.ts.map +1 -1
- package/dist/types/generated/rwa_rbac.d.ts +136 -321
- package/dist/types/generated/rwa_rbac.d.ts.map +1 -1
- package/dist/types/instructions.d.ts +7 -1
- package/dist/types/instructions.d.ts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -55,98 +55,6 @@ var metadata$1 = {
|
|
|
55
55
|
description: "Created with Anchor"
|
|
56
56
|
};
|
|
57
57
|
var instructions$1 = [
|
|
58
|
-
{
|
|
59
|
-
name: "add_level_to_identity_account",
|
|
60
|
-
discriminator: [
|
|
61
|
-
102,
|
|
62
|
-
204,
|
|
63
|
-
64,
|
|
64
|
-
169,
|
|
65
|
-
252,
|
|
66
|
-
177,
|
|
67
|
-
192,
|
|
68
|
-
232
|
|
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
|
-
optional: true
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
name: "identity_registry_program",
|
|
98
|
-
address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
name: "identity_registry"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
name: "identity_account",
|
|
105
|
-
writable: true
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
name: "identity_account_owner",
|
|
109
|
-
docs: [
|
|
110
|
-
"to ensure that it is not an Investor account. If it is an Investor account,",
|
|
111
|
-
"CPI to IdentityMetadataRegistry should be called."
|
|
112
|
-
]
|
|
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"
|
|
133
|
-
}
|
|
134
|
-
],
|
|
135
|
-
args: [
|
|
136
|
-
{
|
|
137
|
-
name: "level",
|
|
138
|
-
type: "u8"
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
name: "expiry",
|
|
142
|
-
type: "i64"
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
name: "enforce_limits",
|
|
146
|
-
type: "bool"
|
|
147
|
-
}
|
|
148
|
-
]
|
|
149
|
-
},
|
|
150
58
|
{
|
|
151
59
|
name: "add_levels",
|
|
152
60
|
discriminator: [
|
|
@@ -182,8 +90,7 @@ var instructions$1 = [
|
|
|
182
90
|
]
|
|
183
91
|
},
|
|
184
92
|
{
|
|
185
|
-
name: "authorized_user_role"
|
|
186
|
-
optional: true
|
|
93
|
+
name: "authorized_user_role"
|
|
187
94
|
},
|
|
188
95
|
{
|
|
189
96
|
name: "identity_metadata_registry_program",
|
|
@@ -270,8 +177,7 @@ var instructions$1 = [
|
|
|
270
177
|
]
|
|
271
178
|
},
|
|
272
179
|
{
|
|
273
|
-
name: "authorized_user_role"
|
|
274
|
-
optional: true
|
|
180
|
+
name: "authorized_user_role"
|
|
275
181
|
},
|
|
276
182
|
{
|
|
277
183
|
name: "policy_engine_program",
|
|
@@ -333,6 +239,7 @@ var instructions$1 = [
|
|
|
333
239
|
},
|
|
334
240
|
{
|
|
335
241
|
name: "asset_access_controller",
|
|
242
|
+
writable: true,
|
|
336
243
|
relations: [
|
|
337
244
|
"user_role",
|
|
338
245
|
"authorized_user_role"
|
|
@@ -427,8 +334,7 @@ var instructions$1 = [
|
|
|
427
334
|
]
|
|
428
335
|
},
|
|
429
336
|
{
|
|
430
|
-
name: "authorized_user_role"
|
|
431
|
-
optional: true
|
|
337
|
+
name: "authorized_user_role"
|
|
432
338
|
},
|
|
433
339
|
{
|
|
434
340
|
name: "policy_engine_program",
|
|
@@ -488,8 +394,7 @@ var instructions$1 = [
|
|
|
488
394
|
]
|
|
489
395
|
},
|
|
490
396
|
{
|
|
491
|
-
name: "authorized_user_role"
|
|
492
|
-
optional: true
|
|
397
|
+
name: "authorized_user_role"
|
|
493
398
|
},
|
|
494
399
|
{
|
|
495
400
|
name: "identity_registry_program",
|
|
@@ -559,8 +464,7 @@ var instructions$1 = [
|
|
|
559
464
|
]
|
|
560
465
|
},
|
|
561
466
|
{
|
|
562
|
-
name: "authorized_user_role"
|
|
563
|
-
optional: true
|
|
467
|
+
name: "authorized_user_role"
|
|
564
468
|
},
|
|
565
469
|
{
|
|
566
470
|
name: "policy_engine_program",
|
|
@@ -620,8 +524,7 @@ var instructions$1 = [
|
|
|
620
524
|
]
|
|
621
525
|
},
|
|
622
526
|
{
|
|
623
|
-
name: "authorized_user_role"
|
|
624
|
-
optional: true
|
|
527
|
+
name: "authorized_user_role"
|
|
625
528
|
},
|
|
626
529
|
{
|
|
627
530
|
name: "policy_engine_program",
|
|
@@ -681,8 +584,7 @@ var instructions$1 = [
|
|
|
681
584
|
]
|
|
682
585
|
},
|
|
683
586
|
{
|
|
684
|
-
name: "authorized_user_role"
|
|
685
|
-
optional: true
|
|
587
|
+
name: "authorized_user_role"
|
|
686
588
|
},
|
|
687
589
|
{
|
|
688
590
|
name: "identity_metadata_registry_program",
|
|
@@ -762,8 +664,7 @@ var instructions$1 = [
|
|
|
762
664
|
]
|
|
763
665
|
},
|
|
764
666
|
{
|
|
765
|
-
name: "authorized_user_role"
|
|
766
|
-
optional: true
|
|
667
|
+
name: "authorized_user_role"
|
|
767
668
|
},
|
|
768
669
|
{
|
|
769
670
|
name: "policy_engine_program",
|
|
@@ -819,8 +720,7 @@ var instructions$1 = [
|
|
|
819
720
|
]
|
|
820
721
|
},
|
|
821
722
|
{
|
|
822
|
-
name: "authorized_user_role"
|
|
823
|
-
optional: true
|
|
723
|
+
name: "authorized_user_role"
|
|
824
724
|
},
|
|
825
725
|
{
|
|
826
726
|
name: "policy_engine_program",
|
|
@@ -841,63 +741,6 @@ var instructions$1 = [
|
|
|
841
741
|
}
|
|
842
742
|
]
|
|
843
743
|
},
|
|
844
|
-
{
|
|
845
|
-
name: "close_mint_account",
|
|
846
|
-
discriminator: [
|
|
847
|
-
14,
|
|
848
|
-
121,
|
|
849
|
-
72,
|
|
850
|
-
246,
|
|
851
|
-
96,
|
|
852
|
-
224,
|
|
853
|
-
42,
|
|
854
|
-
162
|
|
855
|
-
],
|
|
856
|
-
accounts: [
|
|
857
|
-
{
|
|
858
|
-
name: "user",
|
|
859
|
-
signer: true
|
|
860
|
-
},
|
|
861
|
-
{
|
|
862
|
-
name: "controller_authority",
|
|
863
|
-
writable: true,
|
|
864
|
-
relations: [
|
|
865
|
-
"asset_access_controller"
|
|
866
|
-
]
|
|
867
|
-
},
|
|
868
|
-
{
|
|
869
|
-
name: "asset_access_controller",
|
|
870
|
-
relations: [
|
|
871
|
-
"authorized_user_role"
|
|
872
|
-
]
|
|
873
|
-
},
|
|
874
|
-
{
|
|
875
|
-
name: "authorized_user_role",
|
|
876
|
-
optional: true
|
|
877
|
-
},
|
|
878
|
-
{
|
|
879
|
-
name: "asset_controller_program",
|
|
880
|
-
address: "7tXjmbkZVY3Gmg9kDBebcNXT1yC5pyoxxXVLwdbv9tvP"
|
|
881
|
-
},
|
|
882
|
-
{
|
|
883
|
-
name: "asset_mint",
|
|
884
|
-
writable: true
|
|
885
|
-
},
|
|
886
|
-
{
|
|
887
|
-
name: "asset_controller"
|
|
888
|
-
},
|
|
889
|
-
{
|
|
890
|
-
name: "token_program",
|
|
891
|
-
address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
|
|
892
|
-
}
|
|
893
|
-
],
|
|
894
|
-
args: [
|
|
895
|
-
{
|
|
896
|
-
name: "cpi_data",
|
|
897
|
-
type: "bytes"
|
|
898
|
-
}
|
|
899
|
-
]
|
|
900
|
-
},
|
|
901
744
|
{
|
|
902
745
|
name: "create_controller",
|
|
903
746
|
discriminator: [
|
|
@@ -926,8 +769,8 @@ var instructions$1 = [
|
|
|
926
769
|
pda: {
|
|
927
770
|
seeds: [
|
|
928
771
|
{
|
|
929
|
-
kind: "
|
|
930
|
-
path: "
|
|
772
|
+
kind: "account",
|
|
773
|
+
path: "asset_mint"
|
|
931
774
|
},
|
|
932
775
|
{
|
|
933
776
|
kind: "const",
|
|
@@ -958,6 +801,53 @@ var instructions$1 = [
|
|
|
958
801
|
]
|
|
959
802
|
}
|
|
960
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
|
+
},
|
|
961
851
|
{
|
|
962
852
|
name: "system_program",
|
|
963
853
|
address: "11111111111111111111111111111111"
|
|
@@ -965,8 +855,8 @@ var instructions$1 = [
|
|
|
965
855
|
],
|
|
966
856
|
args: [
|
|
967
857
|
{
|
|
968
|
-
name: "
|
|
969
|
-
type: "
|
|
858
|
+
name: "cpi_data",
|
|
859
|
+
type: "bytes"
|
|
970
860
|
}
|
|
971
861
|
]
|
|
972
862
|
},
|
|
@@ -1005,8 +895,7 @@ var instructions$1 = [
|
|
|
1005
895
|
]
|
|
1006
896
|
},
|
|
1007
897
|
{
|
|
1008
|
-
name: "authorized_user_role"
|
|
1009
|
-
optional: true
|
|
898
|
+
name: "authorized_user_role"
|
|
1010
899
|
},
|
|
1011
900
|
{
|
|
1012
901
|
name: "identity_registry_program",
|
|
@@ -1023,6 +912,16 @@ var instructions$1 = [
|
|
|
1023
912
|
name: "wallet_identity",
|
|
1024
913
|
writable: true
|
|
1025
914
|
},
|
|
915
|
+
{
|
|
916
|
+
name: "policy_engine_program"
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
name: "tracker_account",
|
|
920
|
+
writable: true
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
name: "asset_mint"
|
|
924
|
+
},
|
|
1026
925
|
{
|
|
1027
926
|
name: "system_program",
|
|
1028
927
|
address: "11111111111111111111111111111111"
|
|
@@ -1092,6 +991,10 @@ var instructions$1 = [
|
|
|
1092
991
|
{
|
|
1093
992
|
name: "allowed_medici_ixs",
|
|
1094
993
|
type: "u64"
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
name: "is_master_role",
|
|
997
|
+
type: "bool"
|
|
1095
998
|
}
|
|
1096
999
|
]
|
|
1097
1000
|
},
|
|
@@ -1170,8 +1073,7 @@ var instructions$1 = [
|
|
|
1170
1073
|
]
|
|
1171
1074
|
},
|
|
1172
1075
|
{
|
|
1173
|
-
name: "authorized_user_role"
|
|
1174
|
-
optional: true
|
|
1076
|
+
name: "authorized_user_role"
|
|
1175
1077
|
},
|
|
1176
1078
|
{
|
|
1177
1079
|
name: "policy_engine_program",
|
|
@@ -1232,8 +1134,7 @@ var instructions$1 = [
|
|
|
1232
1134
|
]
|
|
1233
1135
|
},
|
|
1234
1136
|
{
|
|
1235
|
-
name: "authorized_user_role"
|
|
1236
|
-
optional: true
|
|
1137
|
+
name: "authorized_user_role"
|
|
1237
1138
|
},
|
|
1238
1139
|
{
|
|
1239
1140
|
name: "identity_registry_program",
|
|
@@ -1250,6 +1151,12 @@ var instructions$1 = [
|
|
|
1250
1151
|
{
|
|
1251
1152
|
name: "identity_registry"
|
|
1252
1153
|
},
|
|
1154
|
+
{
|
|
1155
|
+
name: "token_account"
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
name: "asset_mint"
|
|
1159
|
+
},
|
|
1253
1160
|
{
|
|
1254
1161
|
name: "event_authority"
|
|
1255
1162
|
}
|
|
@@ -1291,8 +1198,7 @@ var instructions$1 = [
|
|
|
1291
1198
|
]
|
|
1292
1199
|
},
|
|
1293
1200
|
{
|
|
1294
|
-
name: "authorized_user_role"
|
|
1295
|
-
optional: true
|
|
1201
|
+
name: "authorized_user_role"
|
|
1296
1202
|
},
|
|
1297
1203
|
{
|
|
1298
1204
|
name: "asset_controller_program",
|
|
@@ -1357,8 +1263,7 @@ var instructions$1 = [
|
|
|
1357
1263
|
]
|
|
1358
1264
|
},
|
|
1359
1265
|
{
|
|
1360
|
-
name: "authorized_user_role"
|
|
1361
|
-
optional: true
|
|
1266
|
+
name: "authorized_user_role"
|
|
1362
1267
|
},
|
|
1363
1268
|
{
|
|
1364
1269
|
name: "asset_controller_program",
|
|
@@ -1471,63 +1376,6 @@ var instructions$1 = [
|
|
|
1471
1376
|
}
|
|
1472
1377
|
]
|
|
1473
1378
|
},
|
|
1474
|
-
{
|
|
1475
|
-
name: "refresh_level_to_identity_account",
|
|
1476
|
-
discriminator: [
|
|
1477
|
-
23,
|
|
1478
|
-
68,
|
|
1479
|
-
237,
|
|
1480
|
-
111,
|
|
1481
|
-
144,
|
|
1482
|
-
169,
|
|
1483
|
-
239,
|
|
1484
|
-
91
|
|
1485
|
-
],
|
|
1486
|
-
accounts: [
|
|
1487
|
-
{
|
|
1488
|
-
name: "payer",
|
|
1489
|
-
writable: true,
|
|
1490
|
-
signer: true
|
|
1491
|
-
},
|
|
1492
|
-
{
|
|
1493
|
-
name: "user",
|
|
1494
|
-
signer: true
|
|
1495
|
-
},
|
|
1496
|
-
{
|
|
1497
|
-
name: "controller_authority",
|
|
1498
|
-
relations: [
|
|
1499
|
-
"asset_access_controller"
|
|
1500
|
-
]
|
|
1501
|
-
},
|
|
1502
|
-
{
|
|
1503
|
-
name: "asset_access_controller",
|
|
1504
|
-
relations: [
|
|
1505
|
-
"authorized_user_role"
|
|
1506
|
-
]
|
|
1507
|
-
},
|
|
1508
|
-
{
|
|
1509
|
-
name: "authorized_user_role",
|
|
1510
|
-
optional: true
|
|
1511
|
-
},
|
|
1512
|
-
{
|
|
1513
|
-
name: "identity_registry_program",
|
|
1514
|
-
address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
|
|
1515
|
-
},
|
|
1516
|
-
{
|
|
1517
|
-
name: "identity_registry"
|
|
1518
|
-
},
|
|
1519
|
-
{
|
|
1520
|
-
name: "identity_account",
|
|
1521
|
-
writable: true
|
|
1522
|
-
}
|
|
1523
|
-
],
|
|
1524
|
-
args: [
|
|
1525
|
-
{
|
|
1526
|
-
name: "cpi_data",
|
|
1527
|
-
type: "bytes"
|
|
1528
|
-
}
|
|
1529
|
-
]
|
|
1530
|
-
},
|
|
1531
1379
|
{
|
|
1532
1380
|
name: "register_investor",
|
|
1533
1381
|
discriminator: [
|
|
@@ -1563,8 +1411,7 @@ var instructions$1 = [
|
|
|
1563
1411
|
]
|
|
1564
1412
|
},
|
|
1565
1413
|
{
|
|
1566
|
-
name: "authorized_user_role"
|
|
1567
|
-
optional: true
|
|
1414
|
+
name: "authorized_user_role"
|
|
1568
1415
|
},
|
|
1569
1416
|
{
|
|
1570
1417
|
name: "identity_metadata_registry_program",
|
|
@@ -1589,6 +1436,16 @@ var instructions$1 = [
|
|
|
1589
1436
|
name: "wallet_identity",
|
|
1590
1437
|
writable: true
|
|
1591
1438
|
},
|
|
1439
|
+
{
|
|
1440
|
+
name: "policy_engine_program"
|
|
1441
|
+
},
|
|
1442
|
+
{
|
|
1443
|
+
name: "tracker_account",
|
|
1444
|
+
writable: true
|
|
1445
|
+
},
|
|
1446
|
+
{
|
|
1447
|
+
name: "asset_mint"
|
|
1448
|
+
},
|
|
1592
1449
|
{
|
|
1593
1450
|
name: "event_authority_identity_metadata_registry"
|
|
1594
1451
|
},
|
|
@@ -1613,78 +1470,11 @@ var instructions$1 = [
|
|
|
1613
1470
|
78,
|
|
1614
1471
|
35,
|
|
1615
1472
|
174,
|
|
1616
|
-
50,
|
|
1617
|
-
72,
|
|
1618
|
-
181,
|
|
1619
|
-
12,
|
|
1620
|
-
42
|
|
1621
|
-
],
|
|
1622
|
-
accounts: [
|
|
1623
|
-
{
|
|
1624
|
-
name: "payer",
|
|
1625
|
-
writable: true,
|
|
1626
|
-
signer: true
|
|
1627
|
-
},
|
|
1628
|
-
{
|
|
1629
|
-
name: "user",
|
|
1630
|
-
signer: true
|
|
1631
|
-
},
|
|
1632
|
-
{
|
|
1633
|
-
name: "controller_authority",
|
|
1634
|
-
relations: [
|
|
1635
|
-
"asset_access_controller"
|
|
1636
|
-
]
|
|
1637
|
-
},
|
|
1638
|
-
{
|
|
1639
|
-
name: "asset_access_controller",
|
|
1640
|
-
relations: [
|
|
1641
|
-
"authorized_user_role"
|
|
1642
|
-
]
|
|
1643
|
-
},
|
|
1644
|
-
{
|
|
1645
|
-
name: "authorized_user_role",
|
|
1646
|
-
optional: true
|
|
1647
|
-
},
|
|
1648
|
-
{
|
|
1649
|
-
name: "identity_registry_program",
|
|
1650
|
-
address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
|
|
1651
|
-
},
|
|
1652
|
-
{
|
|
1653
|
-
name: "identity_registry"
|
|
1654
|
-
},
|
|
1655
|
-
{
|
|
1656
|
-
name: "identity_account",
|
|
1657
|
-
writable: true
|
|
1658
|
-
},
|
|
1659
|
-
{
|
|
1660
|
-
name: "wallet_identity",
|
|
1661
|
-
writable: true
|
|
1662
|
-
},
|
|
1663
|
-
{
|
|
1664
|
-
name: "event_authority"
|
|
1665
|
-
},
|
|
1666
|
-
{
|
|
1667
|
-
name: "identity_owner"
|
|
1668
|
-
}
|
|
1669
|
-
],
|
|
1670
|
-
args: [
|
|
1671
|
-
{
|
|
1672
|
-
name: "cpi_data",
|
|
1673
|
-
type: "bytes"
|
|
1674
|
-
}
|
|
1675
|
-
]
|
|
1676
|
-
},
|
|
1677
|
-
{
|
|
1678
|
-
name: "remove_investor",
|
|
1679
|
-
discriminator: [
|
|
1680
|
-
93,
|
|
1681
|
-
0,
|
|
1682
|
-
162,
|
|
1683
|
-
199,
|
|
1684
|
-
76,
|
|
1685
|
-
5,
|
|
1686
|
-
180,
|
|
1687
|
-
2
|
|
1473
|
+
50,
|
|
1474
|
+
72,
|
|
1475
|
+
181,
|
|
1476
|
+
12,
|
|
1477
|
+
42
|
|
1688
1478
|
],
|
|
1689
1479
|
accounts: [
|
|
1690
1480
|
{
|
|
@@ -1709,16 +1499,7 @@ var instructions$1 = [
|
|
|
1709
1499
|
]
|
|
1710
1500
|
},
|
|
1711
1501
|
{
|
|
1712
|
-
name: "authorized_user_role"
|
|
1713
|
-
optional: true
|
|
1714
|
-
},
|
|
1715
|
-
{
|
|
1716
|
-
name: "identity_metadata_registry_program",
|
|
1717
|
-
address: "D2V7wTBbNCKgYwirgRUnSmc2QyKnHSVmRotWJ4rz8Jp9"
|
|
1718
|
-
},
|
|
1719
|
-
{
|
|
1720
|
-
name: "investor",
|
|
1721
|
-
writable: true
|
|
1502
|
+
name: "authorized_user_role"
|
|
1722
1503
|
},
|
|
1723
1504
|
{
|
|
1724
1505
|
name: "identity_registry_program",
|
|
@@ -1736,34 +1517,40 @@ var instructions$1 = [
|
|
|
1736
1517
|
writable: true
|
|
1737
1518
|
},
|
|
1738
1519
|
{
|
|
1739
|
-
name: "
|
|
1740
|
-
address: "FsE8mCJyvgMzqJbfHbJQm3iuf3cRZC6n2vZi1Q8rQCy2"
|
|
1520
|
+
name: "event_authority"
|
|
1741
1521
|
},
|
|
1742
1522
|
{
|
|
1743
|
-
name: "
|
|
1744
|
-
writable: true
|
|
1523
|
+
name: "identity_owner"
|
|
1745
1524
|
},
|
|
1746
1525
|
{
|
|
1747
|
-
name: "
|
|
1526
|
+
name: "policy_engine_program"
|
|
1748
1527
|
},
|
|
1749
1528
|
{
|
|
1750
|
-
name: "
|
|
1529
|
+
name: "tracker_account",
|
|
1530
|
+
writable: true
|
|
1531
|
+
},
|
|
1532
|
+
{
|
|
1533
|
+
name: "asset_mint"
|
|
1751
1534
|
}
|
|
1752
1535
|
],
|
|
1753
1536
|
args: [
|
|
1537
|
+
{
|
|
1538
|
+
name: "cpi_data",
|
|
1539
|
+
type: "bytes"
|
|
1540
|
+
}
|
|
1754
1541
|
]
|
|
1755
1542
|
},
|
|
1756
1543
|
{
|
|
1757
|
-
name: "
|
|
1544
|
+
name: "remove_investor",
|
|
1758
1545
|
discriminator: [
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1546
|
+
93,
|
|
1547
|
+
0,
|
|
1548
|
+
162,
|
|
1549
|
+
199,
|
|
1550
|
+
76,
|
|
1551
|
+
5,
|
|
1552
|
+
180,
|
|
1553
|
+
2
|
|
1767
1554
|
],
|
|
1768
1555
|
accounts: [
|
|
1769
1556
|
{
|
|
@@ -1788,8 +1575,15 @@ var instructions$1 = [
|
|
|
1788
1575
|
]
|
|
1789
1576
|
},
|
|
1790
1577
|
{
|
|
1791
|
-
name: "authorized_user_role"
|
|
1792
|
-
|
|
1578
|
+
name: "authorized_user_role"
|
|
1579
|
+
},
|
|
1580
|
+
{
|
|
1581
|
+
name: "identity_metadata_registry_program",
|
|
1582
|
+
address: "D2V7wTBbNCKgYwirgRUnSmc2QyKnHSVmRotWJ4rz8Jp9"
|
|
1583
|
+
},
|
|
1584
|
+
{
|
|
1585
|
+
name: "investor",
|
|
1586
|
+
writable: true
|
|
1793
1587
|
},
|
|
1794
1588
|
{
|
|
1795
1589
|
name: "identity_registry_program",
|
|
@@ -1803,38 +1597,28 @@ var instructions$1 = [
|
|
|
1803
1597
|
writable: true
|
|
1804
1598
|
},
|
|
1805
1599
|
{
|
|
1806
|
-
name: "
|
|
1807
|
-
|
|
1808
|
-
"to ensure that it is not an Investor account. If it is an Investor account,",
|
|
1809
|
-
"CPI to IdentityMetadataRegistry should be called."
|
|
1810
|
-
]
|
|
1811
|
-
},
|
|
1812
|
-
{
|
|
1813
|
-
name: "system_program",
|
|
1814
|
-
address: "11111111111111111111111111111111"
|
|
1600
|
+
name: "wallet_identity",
|
|
1601
|
+
writable: true
|
|
1815
1602
|
},
|
|
1816
1603
|
{
|
|
1817
|
-
name: "policy_engine_program"
|
|
1604
|
+
name: "policy_engine_program",
|
|
1605
|
+
address: "FsE8mCJyvgMzqJbfHbJQm3iuf3cRZC6n2vZi1Q8rQCy2"
|
|
1818
1606
|
},
|
|
1819
1607
|
{
|
|
1820
|
-
name: "
|
|
1608
|
+
name: "tracker_account",
|
|
1821
1609
|
writable: true
|
|
1822
1610
|
},
|
|
1823
1611
|
{
|
|
1824
|
-
name: "
|
|
1612
|
+
name: "event_authority_identity_metadata_registry"
|
|
1825
1613
|
},
|
|
1826
1614
|
{
|
|
1827
|
-
name: "
|
|
1615
|
+
name: "event_authority_identity_registry"
|
|
1828
1616
|
},
|
|
1829
1617
|
{
|
|
1830
|
-
name: "
|
|
1618
|
+
name: "asset_mint"
|
|
1831
1619
|
}
|
|
1832
1620
|
],
|
|
1833
1621
|
args: [
|
|
1834
|
-
{
|
|
1835
|
-
name: "cpi_data",
|
|
1836
|
-
type: "bytes"
|
|
1837
|
-
}
|
|
1838
1622
|
]
|
|
1839
1623
|
},
|
|
1840
1624
|
{
|
|
@@ -1872,8 +1656,7 @@ var instructions$1 = [
|
|
|
1872
1656
|
]
|
|
1873
1657
|
},
|
|
1874
1658
|
{
|
|
1875
|
-
name: "authorized_user_role"
|
|
1876
|
-
optional: true
|
|
1659
|
+
name: "authorized_user_role"
|
|
1877
1660
|
},
|
|
1878
1661
|
{
|
|
1879
1662
|
name: "identity_metadata_registry_program",
|
|
@@ -1957,8 +1740,7 @@ var instructions$1 = [
|
|
|
1957
1740
|
]
|
|
1958
1741
|
},
|
|
1959
1742
|
{
|
|
1960
|
-
name: "authorized_user_role"
|
|
1961
|
-
optional: true
|
|
1743
|
+
name: "authorized_user_role"
|
|
1962
1744
|
},
|
|
1963
1745
|
{
|
|
1964
1746
|
name: "policy_engine_program",
|
|
@@ -2101,8 +1883,7 @@ var instructions$1 = [
|
|
|
2101
1883
|
]
|
|
2102
1884
|
},
|
|
2103
1885
|
{
|
|
2104
|
-
name: "authorized_user_role"
|
|
2105
|
-
optional: true
|
|
1886
|
+
name: "authorized_user_role"
|
|
2106
1887
|
},
|
|
2107
1888
|
{
|
|
2108
1889
|
name: "asset_controller_program",
|
|
@@ -2193,8 +1974,7 @@ var instructions$1 = [
|
|
|
2193
1974
|
]
|
|
2194
1975
|
},
|
|
2195
1976
|
{
|
|
2196
|
-
name: "authorized_user_role"
|
|
2197
|
-
optional: true
|
|
1977
|
+
name: "authorized_user_role"
|
|
2198
1978
|
},
|
|
2199
1979
|
{
|
|
2200
1980
|
name: "asset_controller_program",
|
|
@@ -2264,8 +2044,7 @@ var instructions$1 = [
|
|
|
2264
2044
|
]
|
|
2265
2045
|
},
|
|
2266
2046
|
{
|
|
2267
|
-
name: "authorized_user_role"
|
|
2268
|
-
optional: true
|
|
2047
|
+
name: "authorized_user_role"
|
|
2269
2048
|
},
|
|
2270
2049
|
{
|
|
2271
2050
|
name: "policy_engine_program",
|
|
@@ -2351,8 +2130,7 @@ var instructions$1 = [
|
|
|
2351
2130
|
]
|
|
2352
2131
|
},
|
|
2353
2132
|
{
|
|
2354
|
-
name: "authorized_user_role"
|
|
2355
|
-
optional: true
|
|
2133
|
+
name: "authorized_user_role"
|
|
2356
2134
|
},
|
|
2357
2135
|
{
|
|
2358
2136
|
name: "asset_controller_program",
|
|
@@ -2421,8 +2199,7 @@ var instructions$1 = [
|
|
|
2421
2199
|
]
|
|
2422
2200
|
},
|
|
2423
2201
|
{
|
|
2424
|
-
name: "authorized_user_role"
|
|
2425
|
-
optional: true
|
|
2202
|
+
name: "authorized_user_role"
|
|
2426
2203
|
},
|
|
2427
2204
|
{
|
|
2428
2205
|
name: "asset_controller_program",
|
|
@@ -2516,8 +2293,7 @@ var instructions$1 = [
|
|
|
2516
2293
|
]
|
|
2517
2294
|
},
|
|
2518
2295
|
{
|
|
2519
|
-
name: "authorized_user_role"
|
|
2520
|
-
optional: true
|
|
2296
|
+
name: "authorized_user_role"
|
|
2521
2297
|
},
|
|
2522
2298
|
{
|
|
2523
2299
|
name: "asset_controller_program",
|
|
@@ -2684,6 +2460,31 @@ var errors$1 = [
|
|
|
2684
2460
|
code: 6007,
|
|
2685
2461
|
name: "IllegalOperation",
|
|
2686
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"
|
|
2687
2488
|
}
|
|
2688
2489
|
];
|
|
2689
2490
|
var types$1 = [
|
|
@@ -2714,9 +2515,9 @@ var types$1 = [
|
|
|
2714
2515
|
type: "pubkey"
|
|
2715
2516
|
},
|
|
2716
2517
|
{
|
|
2717
|
-
name: "
|
|
2518
|
+
name: "asset_mint",
|
|
2718
2519
|
docs: [
|
|
2719
|
-
"
|
|
2520
|
+
"Asset mint that is going to be managed by this controller."
|
|
2720
2521
|
],
|
|
2721
2522
|
type: "pubkey"
|
|
2722
2523
|
},
|
|
@@ -2727,6 +2528,13 @@ var types$1 = [
|
|
|
2727
2528
|
],
|
|
2728
2529
|
type: "u64"
|
|
2729
2530
|
},
|
|
2531
|
+
{
|
|
2532
|
+
name: "has_master_role",
|
|
2533
|
+
docs: [
|
|
2534
|
+
"Whether a master role exists."
|
|
2535
|
+
],
|
|
2536
|
+
type: "bool"
|
|
2537
|
+
},
|
|
2730
2538
|
{
|
|
2731
2539
|
name: "lut_address",
|
|
2732
2540
|
docs: [
|
|
@@ -2761,7 +2569,7 @@ var types$1 = [
|
|
|
2761
2569
|
type: "pubkey"
|
|
2762
2570
|
},
|
|
2763
2571
|
{
|
|
2764
|
-
name: "
|
|
2572
|
+
name: "asset_mint",
|
|
2765
2573
|
type: "pubkey"
|
|
2766
2574
|
}
|
|
2767
2575
|
]
|
|
@@ -2791,7 +2599,7 @@ var types$1 = [
|
|
|
2791
2599
|
type: "pubkey"
|
|
2792
2600
|
},
|
|
2793
2601
|
{
|
|
2794
|
-
name: "
|
|
2602
|
+
name: "asset_mint",
|
|
2795
2603
|
type: "pubkey"
|
|
2796
2604
|
}
|
|
2797
2605
|
]
|
|
@@ -2837,6 +2645,13 @@ var types$1 = [
|
|
|
2837
2645
|
],
|
|
2838
2646
|
type: "u64"
|
|
2839
2647
|
},
|
|
2648
|
+
{
|
|
2649
|
+
name: "is_master_role",
|
|
2650
|
+
docs: [
|
|
2651
|
+
"If true, this is the master role."
|
|
2652
|
+
],
|
|
2653
|
+
type: "bool"
|
|
2654
|
+
},
|
|
2840
2655
|
{
|
|
2841
2656
|
name: "users",
|
|
2842
2657
|
docs: [
|
|
@@ -3200,6 +3015,16 @@ var instructions = [
|
|
|
3200
3015
|
name: "wallet_identity",
|
|
3201
3016
|
writable: true
|
|
3202
3017
|
},
|
|
3018
|
+
{
|
|
3019
|
+
name: "policy_engine_program"
|
|
3020
|
+
},
|
|
3021
|
+
{
|
|
3022
|
+
name: "tracker_account",
|
|
3023
|
+
writable: true
|
|
3024
|
+
},
|
|
3025
|
+
{
|
|
3026
|
+
name: "asset_mint"
|
|
3027
|
+
},
|
|
3203
3028
|
{
|
|
3204
3029
|
name: "system_program",
|
|
3205
3030
|
address: "11111111111111111111111111111111"
|
|
@@ -3322,6 +3147,9 @@ var instructions = [
|
|
|
3322
3147
|
{
|
|
3323
3148
|
name: "event_authority_identity_registry"
|
|
3324
3149
|
},
|
|
3150
|
+
{
|
|
3151
|
+
name: "asset_mint"
|
|
3152
|
+
},
|
|
3325
3153
|
{
|
|
3326
3154
|
name: "event_authority",
|
|
3327
3155
|
pda: {
|
|
@@ -3776,33 +3604,32 @@ exports.MediciFlags = void 0;
|
|
|
3776
3604
|
MediciFlags[MediciFlags["FREEZE_TOKEN_ACCOUNT"] = 4] = "FREEZE_TOKEN_ACCOUNT";
|
|
3777
3605
|
MediciFlags[MediciFlags["ISSUE_TOKENS"] = 8] = "ISSUE_TOKENS";
|
|
3778
3606
|
MediciFlags[MediciFlags["REVOKE_TOKENS"] = 16] = "REVOKE_TOKENS";
|
|
3779
|
-
MediciFlags[MediciFlags["
|
|
3780
|
-
MediciFlags[MediciFlags["
|
|
3781
|
-
MediciFlags[MediciFlags["
|
|
3782
|
-
MediciFlags[MediciFlags["
|
|
3783
|
-
MediciFlags[MediciFlags["
|
|
3784
|
-
MediciFlags[MediciFlags["
|
|
3785
|
-
MediciFlags[MediciFlags["
|
|
3786
|
-
MediciFlags[MediciFlags["
|
|
3787
|
-
MediciFlags[MediciFlags["
|
|
3788
|
-
MediciFlags[MediciFlags["
|
|
3789
|
-
MediciFlags[MediciFlags["
|
|
3790
|
-
MediciFlags[MediciFlags["
|
|
3791
|
-
MediciFlags[MediciFlags["
|
|
3792
|
-
MediciFlags[MediciFlags["
|
|
3793
|
-
MediciFlags[MediciFlags["
|
|
3794
|
-
MediciFlags[MediciFlags["
|
|
3795
|
-
MediciFlags[MediciFlags["
|
|
3796
|
-
MediciFlags[MediciFlags["
|
|
3797
|
-
MediciFlags[MediciFlags["
|
|
3798
|
-
MediciFlags[MediciFlags["
|
|
3799
|
-
MediciFlags[MediciFlags["
|
|
3800
|
-
MediciFlags[MediciFlags["
|
|
3801
|
-
MediciFlags[MediciFlags["
|
|
3802
|
-
MediciFlags[MediciFlags["
|
|
3803
|
-
MediciFlags[MediciFlags["
|
|
3804
|
-
MediciFlags[MediciFlags["
|
|
3805
|
-
MediciFlags[MediciFlags["ALL"] = 2147483647] = "ALL";
|
|
3607
|
+
MediciFlags[MediciFlags["UPDATE_INTEREST_BEARING_MINT_RATE"] = 32] = "UPDATE_INTEREST_BEARING_MINT_RATE";
|
|
3608
|
+
MediciFlags[MediciFlags["ATTACH_TO_POLICY_ACCOUNT"] = 64] = "ATTACH_TO_POLICY_ACCOUNT";
|
|
3609
|
+
MediciFlags[MediciFlags["CREATE_POLICY_ACCOUNT"] = 128] = "CREATE_POLICY_ACCOUNT";
|
|
3610
|
+
MediciFlags[MediciFlags["DETACH_FROM_POLICY_ACCOUNT"] = 256] = "DETACH_FROM_POLICY_ACCOUNT";
|
|
3611
|
+
MediciFlags[MediciFlags["ADD_LEVELS"] = 512] = "ADD_LEVELS";
|
|
3612
|
+
MediciFlags[MediciFlags["ADD_LEVEL_TO_IDENTITY_ACCOUNT"] = 1024] = "ADD_LEVEL_TO_IDENTITY_ACCOUNT";
|
|
3613
|
+
MediciFlags[MediciFlags["REGISTER_INVESTOR"] = 2048] = "REGISTER_INVESTOR";
|
|
3614
|
+
MediciFlags[MediciFlags["REMOVE_LEVELS"] = 4096] = "REMOVE_LEVELS";
|
|
3615
|
+
MediciFlags[MediciFlags["REMOVE_INVESTOR"] = 8192] = "REMOVE_INVESTOR";
|
|
3616
|
+
MediciFlags[MediciFlags["EDIT_IDENTITY_METADATA"] = 16384] = "EDIT_IDENTITY_METADATA";
|
|
3617
|
+
MediciFlags[MediciFlags["REFRESH_LEVEL_TO_IDENTITY_ACCOUNT"] = 32768] = "REFRESH_LEVEL_TO_IDENTITY_ACCOUNT";
|
|
3618
|
+
MediciFlags[MediciFlags["ATTACH_WALLET_TO_IDENTITY"] = 65536] = "ATTACH_WALLET_TO_IDENTITY";
|
|
3619
|
+
MediciFlags[MediciFlags["DETACH_WALLET_FROM_IDENTITY"] = 131072] = "DETACH_WALLET_FROM_IDENTITY";
|
|
3620
|
+
MediciFlags[MediciFlags["SEIZE_TOKENS"] = 262144] = "SEIZE_TOKENS";
|
|
3621
|
+
MediciFlags[MediciFlags["CREATE_IDENTITY_ACCOUNT"] = 524288] = "CREATE_IDENTITY_ACCOUNT";
|
|
3622
|
+
MediciFlags[MediciFlags["CREATE_INVESTOR_LOCKS"] = 1048576] = "CREATE_INVESTOR_LOCKS";
|
|
3623
|
+
MediciFlags[MediciFlags["CLOSE_INVESTOR_LOCKS"] = 2097152] = "CLOSE_INVESTOR_LOCKS";
|
|
3624
|
+
MediciFlags[MediciFlags["ADD_TOKEN_LOCK"] = 4194304] = "ADD_TOKEN_LOCK";
|
|
3625
|
+
MediciFlags[MediciFlags["REMOVE_TOKEN_LOCK"] = 8388608] = "REMOVE_TOKEN_LOCK";
|
|
3626
|
+
MediciFlags[MediciFlags["CHANGE_COUNTERS"] = 16777216] = "CHANGE_COUNTERS";
|
|
3627
|
+
MediciFlags[MediciFlags["CHANGE_COUNTER_LIMITS"] = 33554432] = "CHANGE_COUNTER_LIMITS";
|
|
3628
|
+
MediciFlags[MediciFlags["CHANGE_COUNTRY"] = 67108864] = "CHANGE_COUNTRY";
|
|
3629
|
+
MediciFlags[MediciFlags["CHANGE_MAPPING"] = 134217728] = "CHANGE_MAPPING";
|
|
3630
|
+
MediciFlags[MediciFlags["CHANGE_ISSUANCE_POLICIES"] = 268435456] = "CHANGE_ISSUANCE_POLICIES";
|
|
3631
|
+
MediciFlags[MediciFlags["REMOVE_IDENTITY_ACCOUNT"] = 536870912] = "REMOVE_IDENTITY_ACCOUNT";
|
|
3632
|
+
MediciFlags[MediciFlags["ALL"] = 1073741823] = "ALL";
|
|
3806
3633
|
})(exports.MediciFlags || (exports.MediciFlags = {}));
|
|
3807
3634
|
|
|
3808
3635
|
/******************************************************************************
|
|
@@ -3857,7 +3684,7 @@ class AssetController {
|
|
|
3857
3684
|
* Update the asset controller's metadata.
|
|
3858
3685
|
* @param args - {@link UpdateAssetMetadataArgs}
|
|
3859
3686
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
3860
|
-
* @param authorizedUserRole -
|
|
3687
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
3861
3688
|
* @returns A Promise that resolves to the instructions to update the asset controller's metadata.
|
|
3862
3689
|
* */
|
|
3863
3690
|
updateAssetMetadata(args, assetAccessController, authorizedUserRole) {
|
|
@@ -3886,7 +3713,7 @@ class AssetController {
|
|
|
3886
3713
|
* Asynchronously generates instructions to issue tokens and lock tokens according to issuance policy.
|
|
3887
3714
|
* @param args - {@link IssueTokensWithLockArgs}
|
|
3888
3715
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
3889
|
-
* @param authorizedUserRole -
|
|
3716
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
3890
3717
|
*/
|
|
3891
3718
|
issueTokenIxns(args, assetAccessController, authorizedUserRole) {
|
|
3892
3719
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -3933,16 +3760,6 @@ class AssetController {
|
|
|
3933
3760
|
.instruction();
|
|
3934
3761
|
});
|
|
3935
3762
|
}
|
|
3936
|
-
/**
|
|
3937
|
-
* Asynchronously generates instructions to revoke assets.
|
|
3938
|
-
* @param args - {@link VoidTokensArgs}
|
|
3939
|
-
* @returns A Promise that resolves to the instructions to revoke assets.
|
|
3940
|
-
*/
|
|
3941
|
-
voidTokenIxns(args) {
|
|
3942
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3943
|
-
return this.rwaClient.assetController.voidTokenIxns(args);
|
|
3944
|
-
});
|
|
3945
|
-
}
|
|
3946
3763
|
/**
|
|
3947
3764
|
* Executes a token transfer.
|
|
3948
3765
|
* @param args - {@link TransferTokensArgs}
|
|
@@ -3957,7 +3774,7 @@ class AssetController {
|
|
|
3957
3774
|
* Asynchronously generates instruction to freeze a token account.
|
|
3958
3775
|
* @param args - {@link FreezeTokenArgs}
|
|
3959
3776
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
3960
|
-
* @param authorizedUserRole -
|
|
3777
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
3961
3778
|
* @returns A Promise that resolves to the instruction to freeze.
|
|
3962
3779
|
*/
|
|
3963
3780
|
freezeTokenIxn(args, assetAccessController, authorizedUserRole) {
|
|
@@ -3985,7 +3802,7 @@ class AssetController {
|
|
|
3985
3802
|
* Asynchronously generates instruction to thaw a token account.
|
|
3986
3803
|
* @param args - {@link FreezeTokenArgs}
|
|
3987
3804
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
3988
|
-
* @param authorizedUserRole -
|
|
3805
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
3989
3806
|
* @returns A Promise that resolves to the instruction to thaw.
|
|
3990
3807
|
*/
|
|
3991
3808
|
thawTokenIxn(args, assetAccessController, authorizedUserRole) {
|
|
@@ -4013,13 +3830,13 @@ class AssetController {
|
|
|
4013
3830
|
/**
|
|
4014
3831
|
* Asynchronously generates instructions to revoke tokens from a user.
|
|
4015
3832
|
* @param args - {@link RevokeTokensArgs}
|
|
4016
|
-
* @param payer - Payer public key.
|
|
4017
3833
|
* @param signer - User signer public key.
|
|
4018
3834
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4019
|
-
* @param authorizedUserRole -
|
|
3835
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
3836
|
+
* @param investorId - Optional investorId. Required if user is not an investor.
|
|
4020
3837
|
* @returns A Promise that resolves to the instructions to revoke.
|
|
4021
3838
|
*/
|
|
4022
|
-
revokeTokenIxn(args,
|
|
3839
|
+
revokeTokenIxn(args, signer, assetAccessController, authorizedUserRole, investorId) {
|
|
4023
3840
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4024
3841
|
if (!args.wallet) {
|
|
4025
3842
|
throw new Error("Use wallet arg for wallet to revoke tokens from.");
|
|
@@ -4028,7 +3845,9 @@ class AssetController {
|
|
|
4028
3845
|
args.owner = args.wallet;
|
|
4029
3846
|
const revokeIx = yield rwaTokenSdk.getRevokeTokensIx(args, this.rwaClient.provider);
|
|
4030
3847
|
const identityRegistry = rwaTokenSdk.getIdentityRegistryPda(args.assetMint);
|
|
4031
|
-
const investorPda =
|
|
3848
|
+
const investorPda = investorId
|
|
3849
|
+
? deriveInvestorPda(investorId, identityRegistry)
|
|
3850
|
+
: null;
|
|
4032
3851
|
const ixData = revokeIx.data;
|
|
4033
3852
|
const assetController = rwaTokenSdk.getAssetControllerPda(args.assetMint);
|
|
4034
3853
|
const revokeTokenAccount = splToken.getAssociatedTokenAddressSync(new web3_js.PublicKey(args.assetMint), new web3_js.PublicKey(args.wallet), false, splToken.TOKEN_2022_PROGRAM_ID);
|
|
@@ -4044,8 +3863,8 @@ class AssetController {
|
|
|
4044
3863
|
assetController,
|
|
4045
3864
|
revokeTokenAccount,
|
|
4046
3865
|
identityRegistry,
|
|
4047
|
-
identityAccount: rwaTokenSdk.getIdentityAccountPda(args.assetMint, investorPda.toString()),
|
|
4048
|
-
trackerAccount: rwaTokenSdk.getTrackerAccountPda(args.assetMint, investorPda.toString()),
|
|
3866
|
+
identityAccount: rwaTokenSdk.getIdentityAccountPda(args.assetMint, investorId ? investorPda.toString() : args.owner),
|
|
3867
|
+
trackerAccount: rwaTokenSdk.getTrackerAccountPda(args.assetMint, investorId ? investorPda.toString() : args.owner),
|
|
4049
3868
|
policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
|
|
4050
3869
|
policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
|
|
4051
3870
|
walletIdentityAccount: rwaTokenSdk.getWalletIdentityAccountPda(args.assetMint, args.wallet),
|
|
@@ -4057,37 +3876,11 @@ class AssetController {
|
|
|
4057
3876
|
.instruction();
|
|
4058
3877
|
});
|
|
4059
3878
|
}
|
|
4060
|
-
/**
|
|
4061
|
-
* Asynchronously generates instruction to close mint.
|
|
4062
|
-
* @param args - {@link CloseMintArgs}
|
|
4063
|
-
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4064
|
-
* @param authorizedUserRole - Optional UserRole account. Required if user is not an admin.
|
|
4065
|
-
* @returns A Promise that resolves to the instruction to close mint.
|
|
4066
|
-
*/
|
|
4067
|
-
closeMintIxn(args, assetAccessController, authorizedUserRole) {
|
|
4068
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
4069
|
-
const closeIx = yield rwaTokenSdk.getCloseMintIx(args, this.rwaClient.provider);
|
|
4070
|
-
const ixData = closeIx.data;
|
|
4071
|
-
return this.rbacProgram.methods
|
|
4072
|
-
.closeMintAccount(ixData)
|
|
4073
|
-
.accountsStrict({
|
|
4074
|
-
user: args.signer,
|
|
4075
|
-
controllerAuthority: args.authority,
|
|
4076
|
-
assetAccessController,
|
|
4077
|
-
authorizedUserRole: authorizedUserRole || null,
|
|
4078
|
-
assetControllerProgram: rwaTokenSdk.assetControllerProgramId,
|
|
4079
|
-
assetMint: args.assetMint,
|
|
4080
|
-
assetController: rwaTokenSdk.getAssetControllerPda(args.assetMint),
|
|
4081
|
-
tokenProgram: splToken.TOKEN_2022_PROGRAM_ID,
|
|
4082
|
-
})
|
|
4083
|
-
.instruction();
|
|
4084
|
-
});
|
|
4085
|
-
}
|
|
4086
3879
|
/**
|
|
4087
3880
|
* Asynchronously generates instruction to update mint interest rate.
|
|
4088
3881
|
* @param args - {@link UpdateInterestBearingMintRateArgs}
|
|
4089
3882
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4090
|
-
* @param authorizedUserRole -
|
|
3883
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
4091
3884
|
* @returns A Promise that resolves to the instruction to update mint interest rate.
|
|
4092
3885
|
*/
|
|
4093
3886
|
updateInterestBearingMintRateIxn(args, assetAccessController, authorizedUserRole) {
|
|
@@ -4115,7 +3908,7 @@ class AssetController {
|
|
|
4115
3908
|
* @param args - {@link SeizeTokensArgs}
|
|
4116
3909
|
* @param signer - User signer public key.
|
|
4117
3910
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4118
|
-
* @param authorizedUserRole -
|
|
3911
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
4119
3912
|
* @returns A Promise that resolves to the instruction to seize.
|
|
4120
3913
|
*/
|
|
4121
3914
|
seizeTokensIxn(args, investorId, signer, assetAccessController, authorizedUserRole) {
|
|
@@ -4213,7 +4006,7 @@ class PolicyEngine {
|
|
|
4213
4006
|
* @param args - {@link AttachPolicyArgs}
|
|
4214
4007
|
* @param signer - User signer public key.
|
|
4215
4008
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4216
|
-
* @param authorizedUserRole -
|
|
4009
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
4217
4010
|
* @returns A Promise that resolves to the instructions to attach a policy.
|
|
4218
4011
|
* */
|
|
4219
4012
|
attachPolicy(args, signer, assetAccessController, authorizedUserRole) {
|
|
@@ -4241,7 +4034,7 @@ class PolicyEngine {
|
|
|
4241
4034
|
* @param args - {@link DetachPolicyArgs}
|
|
4242
4035
|
* @param signer - User signer public key.
|
|
4243
4036
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4244
|
-
* @param authorizedUserRole -
|
|
4037
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
4245
4038
|
* @returns A Promise that resolves to the instructions to detach a policy.
|
|
4246
4039
|
* */
|
|
4247
4040
|
detachPolicy(args, signer, assetAccessController, authorizedUserRole) {
|
|
@@ -4269,7 +4062,7 @@ class PolicyEngine {
|
|
|
4269
4062
|
* @param args - {@link ChangeCountersArgs}
|
|
4270
4063
|
* @param signer - User signer public key.
|
|
4271
4064
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4272
|
-
* @param authorizedUserRole -
|
|
4065
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
4273
4066
|
* @returns A Promise that resolves to the instructions to change the counters.
|
|
4274
4067
|
* */
|
|
4275
4068
|
changeCounters(args, signer, assetAccessController, authorizedUserRole) {
|
|
@@ -4297,7 +4090,7 @@ class PolicyEngine {
|
|
|
4297
4090
|
* @param args - {@link SetCountersArgs}
|
|
4298
4091
|
* @param signer - User signer public key.
|
|
4299
4092
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4300
|
-
* @param authorizedUserRole -
|
|
4093
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
4301
4094
|
* @returns A Promise that resolves to the instructions to set the counter values.
|
|
4302
4095
|
* */
|
|
4303
4096
|
setCounters(args, signer, assetAccessController, authorizedUserRole) {
|
|
@@ -4324,7 +4117,7 @@ class PolicyEngine {
|
|
|
4324
4117
|
* @param args - {@link ChangeCounterLimitsArgs}
|
|
4325
4118
|
* @param signer - User signer public key.
|
|
4326
4119
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4327
|
-
* @param authorizedUserRole -
|
|
4120
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
4328
4121
|
* @returns A Promise that resolves to the instructions to change the counters limits.
|
|
4329
4122
|
* */
|
|
4330
4123
|
changeCounterLimits(args, signer, assetAccessController, authorizedUserRole) {
|
|
@@ -4352,7 +4145,7 @@ class PolicyEngine {
|
|
|
4352
4145
|
* @param args - {@link ChangeMappingArgs}
|
|
4353
4146
|
* @param signer - User signer public key.
|
|
4354
4147
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4355
|
-
* @param authorizedUserRole -
|
|
4148
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
4356
4149
|
* */
|
|
4357
4150
|
changeMapping(args, signer, assetAccessController, authorizedUserRole) {
|
|
4358
4151
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -4378,7 +4171,7 @@ class PolicyEngine {
|
|
|
4378
4171
|
* @param args - {@link ChangeIssuancePoliciesArgs}
|
|
4379
4172
|
* @param signer - User signer public key.
|
|
4380
4173
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4381
|
-
* @param authorizedUserRole -
|
|
4174
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
4382
4175
|
* */
|
|
4383
4176
|
changeIssuancePolicies(args, signer, assetAccessController, authorizedUserRole) {
|
|
4384
4177
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -4462,7 +4255,7 @@ class IdentityRegistry {
|
|
|
4462
4255
|
* @param args - {@link SetupUserArgs}
|
|
4463
4256
|
* @param authority - RBAC AssetAccessController ControllerAuthority.
|
|
4464
4257
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4465
|
-
* @param authorizedUserRole -
|
|
4258
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
4466
4259
|
* @returns A Promise that resolves to the instructions to setup a user.
|
|
4467
4260
|
*
|
|
4468
4261
|
* It is required for at least a single user to be setup before issuing tokens.
|
|
@@ -4472,7 +4265,6 @@ class IdentityRegistry {
|
|
|
4472
4265
|
const { ixs } = yield this.rwaClient.identityRegistry.setupUserIxns(args);
|
|
4473
4266
|
const returnIxs = [];
|
|
4474
4267
|
const identityAccountIx = ixs[0];
|
|
4475
|
-
const trackerAccountIx = ixs[1];
|
|
4476
4268
|
const controllerAuthority = deriveControllerAuthorityPda(assetAccessController);
|
|
4477
4269
|
const identityAccount = rwaTokenSdk.getIdentityAccountPda(args.assetMint, args.owner);
|
|
4478
4270
|
returnIxs.push(yield this.rbacProgram.methods
|
|
@@ -4489,9 +4281,11 @@ class IdentityRegistry {
|
|
|
4489
4281
|
walletIdentity: rwaTokenSdk.getWalletIdentityAccountPda(args.assetMint, args.owner),
|
|
4490
4282
|
systemProgram: web3_js.SystemProgram.programId,
|
|
4491
4283
|
eventAuthority: rwaTokenSdk.getIdentityRegistryEventAuthority(),
|
|
4284
|
+
policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
|
|
4285
|
+
trackerAccount: rwaTokenSdk.getTrackerAccountPda(args.assetMint, args.owner),
|
|
4286
|
+
assetMint: args.assetMint,
|
|
4492
4287
|
})
|
|
4493
4288
|
.instruction());
|
|
4494
|
-
returnIxs.push(trackerAccountIx);
|
|
4495
4289
|
return {
|
|
4496
4290
|
ixs: returnIxs,
|
|
4497
4291
|
signers: [],
|
|
@@ -4503,7 +4297,7 @@ class IdentityRegistry {
|
|
|
4503
4297
|
* @param args - {@link SetupUserArgs}
|
|
4504
4298
|
* @param authority - RBAC AssetAccessController ControllerAuthority.
|
|
4505
4299
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4506
|
-
* @param authorizedUserRole -
|
|
4300
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
4507
4301
|
* @returns A Promise that resolves to the instructions to setup a user.
|
|
4508
4302
|
*
|
|
4509
4303
|
* It is required for at least a single user to be setup before issuing tokens.
|
|
@@ -4528,122 +4322,19 @@ class IdentityRegistry {
|
|
|
4528
4322
|
walletIdentity: rwaTokenSdk.getWalletIdentityAccountPda(args.assetMint, args.owner),
|
|
4529
4323
|
eventAuthority: rwaTokenSdk.getIdentityRegistryEventAuthority(),
|
|
4530
4324
|
identityOwner: identityAccount.owner,
|
|
4531
|
-
})
|
|
4532
|
-
.instruction();
|
|
4533
|
-
return returnIx;
|
|
4534
|
-
});
|
|
4535
|
-
}
|
|
4536
|
-
/**
|
|
4537
|
-
* Asynchronously update a non-investor user identity account level.
|
|
4538
|
-
* @param args - {@link AddLevelToIdentityAccountArgs}
|
|
4539
|
-
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4540
|
-
* @param authorizedUserRole - Optional UserRole account. Required if user is not an admin.
|
|
4541
|
-
* @returns A Promise that resolves to the instructions to update user account identity.
|
|
4542
|
-
* */
|
|
4543
|
-
addIdentityLevelToUserAccount(args, assetAccessController, authorizedUserRole) {
|
|
4544
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
4545
|
-
var _a;
|
|
4546
|
-
const identityAccount = rwaTokenSdk.getIdentityAccountPda(args.assetMint, args.owner);
|
|
4547
|
-
const controllerAuthority = deriveControllerAuthorityPda(assetAccessController);
|
|
4548
|
-
return this.rbacProgram.methods
|
|
4549
|
-
.addLevelToIdentityAccount(args.levels[0], args.expiries[0], (_a = args.ignorePolicy) !== null && _a !== void 0 ? _a : false)
|
|
4550
|
-
.accountsStrict({
|
|
4551
|
-
payer: args.payer,
|
|
4552
|
-
user: args.signer,
|
|
4553
|
-
controllerAuthority,
|
|
4554
|
-
assetAccessController,
|
|
4555
|
-
authorizedUserRole: authorizedUserRole || null,
|
|
4556
|
-
identityRegistryProgram: rwaTokenSdk.identityRegistryProgramId,
|
|
4557
|
-
identityRegistry: rwaTokenSdk.getIdentityRegistryPda(args.assetMint),
|
|
4558
|
-
identityAccount,
|
|
4559
|
-
identityAccountOwner: args.owner,
|
|
4560
|
-
systemProgram: web3_js.SystemProgram.programId,
|
|
4561
|
-
policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
|
|
4562
|
-
policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
|
|
4563
|
-
trackerAccount: rwaTokenSdk.getTrackerAccountPda(args.assetMint, args.owner),
|
|
4564
|
-
assetMint: args.assetMint,
|
|
4565
|
-
eventAuthority: rwaTokenSdk.getIdentityRegistryEventAuthority(),
|
|
4566
|
-
})
|
|
4567
|
-
.instruction();
|
|
4568
|
-
});
|
|
4569
|
-
}
|
|
4570
|
-
/**
|
|
4571
|
-
* Asynchronously reduces a non-Investor user identity account level.
|
|
4572
|
-
* @param args - {@link RemoveLevelFromIdentityAccount}
|
|
4573
|
-
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4574
|
-
* @param authorizedUserRole - Optional UserRole account. Required if user is not an admin.
|
|
4575
|
-
* @returns A Promise that resolves to the instructions to reduce the level of a user identity account.
|
|
4576
|
-
*/
|
|
4577
|
-
removeIdentityLevelFromUserAccount(args, assetAccessController, authorizedUserRole) {
|
|
4578
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
4579
|
-
const removeLevelIx = yield rwaTokenSdk.getRemoveLevelFromIdentityAccount(args, this.rwaClient.provider);
|
|
4580
|
-
const ixData = removeLevelIx.data;
|
|
4581
|
-
const controllerAuthority = deriveControllerAuthorityPda(assetAccessController);
|
|
4582
|
-
const identityAccount = rwaTokenSdk.getIdentityAccountPda(args.assetMint, args.owner);
|
|
4583
|
-
return this.rbacProgram.methods
|
|
4584
|
-
.removeLevelFromIdentityAccount(ixData)
|
|
4585
|
-
.accountsStrict({
|
|
4586
|
-
payer: args.payer,
|
|
4587
|
-
user: args.signer,
|
|
4588
|
-
controllerAuthority,
|
|
4589
|
-
assetAccessController,
|
|
4590
|
-
authorizedUserRole: authorizedUserRole || null,
|
|
4591
|
-
identityRegistryProgram: rwaTokenSdk.identityRegistryProgramId,
|
|
4592
|
-
identityRegistry: rwaTokenSdk.getIdentityRegistryPda(args.assetMint),
|
|
4593
|
-
identityAccount,
|
|
4594
|
-
identityAccountOwner: args.owner,
|
|
4595
|
-
systemProgram: web3_js.SystemProgram.programId,
|
|
4596
4325
|
policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
|
|
4597
|
-
policyEngine: rwaTokenSdk.getPolicyEnginePda(args.assetMint),
|
|
4598
4326
|
trackerAccount: rwaTokenSdk.getTrackerAccountPda(args.assetMint, args.owner),
|
|
4599
4327
|
assetMint: args.assetMint,
|
|
4600
|
-
eventAuthority: rwaTokenSdk.getIdentityRegistryEventAuthority(),
|
|
4601
|
-
})
|
|
4602
|
-
.instruction();
|
|
4603
|
-
});
|
|
4604
|
-
}
|
|
4605
|
-
/**
|
|
4606
|
-
* Asynchronously generates instruction to refresh expiry on an Identity Account level.
|
|
4607
|
-
* @param args - {@link RefreshLevelArgs}
|
|
4608
|
-
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4609
|
-
* @param authorizedUserRole - Optional UserRole account. Required if user is not an admin.
|
|
4610
|
-
* @returns A Promise that resolves to refresh expiry on an Identity Account level.
|
|
4611
|
-
* */
|
|
4612
|
-
refreshLevelToIdentityAccountIxn(args, assetAccessController, authorizedUserRole) {
|
|
4613
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
4614
|
-
const identityProgram = rwaTokenSdk.getIdentityRegistryProgram(this.rwaClient.provider);
|
|
4615
|
-
const identityRegistry = rwaTokenSdk.getIdentityRegistryPda(args.assetMint);
|
|
4616
|
-
const identityAccount = rwaTokenSdk.getIdentityAccountPda(args.assetMint, args.owner);
|
|
4617
|
-
const controllerAuthority = deriveControllerAuthorityPda(assetAccessController);
|
|
4618
|
-
const refreshIx = yield identityProgram.methods
|
|
4619
|
-
.refreshLevelToIdentityAccount(args.level, args.expiry)
|
|
4620
|
-
.accountsStrict({
|
|
4621
|
-
payer: args.payer,
|
|
4622
|
-
signer: controllerAuthority,
|
|
4623
|
-
identityRegistry,
|
|
4624
|
-
identityAccount,
|
|
4625
|
-
})
|
|
4626
|
-
.instruction();
|
|
4627
|
-
return this.rbacProgram.methods
|
|
4628
|
-
.refreshLevelToIdentityAccount(refreshIx.data)
|
|
4629
|
-
.accountsStrict({
|
|
4630
|
-
payer: args.payer,
|
|
4631
|
-
user: args.signer,
|
|
4632
|
-
controllerAuthority,
|
|
4633
|
-
assetAccessController,
|
|
4634
|
-
authorizedUserRole: authorizedUserRole || null,
|
|
4635
|
-
identityRegistryProgram: rwaTokenSdk.identityRegistryProgramId,
|
|
4636
|
-
identityRegistry,
|
|
4637
|
-
identityAccount,
|
|
4638
4328
|
})
|
|
4639
4329
|
.instruction();
|
|
4330
|
+
return returnIx;
|
|
4640
4331
|
});
|
|
4641
4332
|
}
|
|
4642
4333
|
/**
|
|
4643
4334
|
* Asynchronously generates instruction to attach wallet to identity.
|
|
4644
4335
|
* @param args - {@link AttachDetachWalletArgs}
|
|
4645
4336
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4646
|
-
* @param authorizedUserRole -
|
|
4337
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
4647
4338
|
* @returns A Promise that resolves to attach wallet.
|
|
4648
4339
|
* */
|
|
4649
4340
|
attachWalletToIdentityIxn(args, assetAccessController, authorizedUserRole) {
|
|
@@ -4691,7 +4382,7 @@ class IdentityRegistry {
|
|
|
4691
4382
|
* Asynchronously generates instruction to detach wallet from identity.
|
|
4692
4383
|
* @param args - {@link AttachDetachWalletArgs}
|
|
4693
4384
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4694
|
-
* @param authorizedUserRole -
|
|
4385
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
4695
4386
|
* @returns A Promise that resolves to detach wallet.
|
|
4696
4387
|
* */
|
|
4697
4388
|
detachWalletFromIdentityIxn(args, assetAccessController, authorizedUserRole) {
|
|
@@ -4701,6 +4392,7 @@ class IdentityRegistry {
|
|
|
4701
4392
|
const identityRegistry = rwaTokenSdk.getIdentityRegistryPda(args.assetMint);
|
|
4702
4393
|
const identityAccount = rwaTokenSdk.getIdentityAccountPda(args.assetMint, args.owner);
|
|
4703
4394
|
const walletIdentity = rwaTokenSdk.getWalletIdentityAccountPda(args.assetMint, args.wallet.toString());
|
|
4395
|
+
const tokenAccount = splToken.getAssociatedTokenAddressSync(new web3_js.PublicKey(args.assetMint), new web3_js.PublicKey(args.wallet), false, splToken.TOKEN_2022_PROGRAM_ID);
|
|
4704
4396
|
const ix = yield identityProgram.methods
|
|
4705
4397
|
.detachWalletFromIdentity()
|
|
4706
4398
|
.accountsStrict({
|
|
@@ -4711,6 +4403,8 @@ class IdentityRegistry {
|
|
|
4711
4403
|
identityRegistry,
|
|
4712
4404
|
eventAuthority: rwaTokenSdk.getIdentityRegistryEventAuthority(),
|
|
4713
4405
|
program: rwaTokenSdk.identityRegistryProgramId,
|
|
4406
|
+
tokenAccount: tokenAccount,
|
|
4407
|
+
assetMint: args.assetMint,
|
|
4714
4408
|
})
|
|
4715
4409
|
.instruction();
|
|
4716
4410
|
return this.rbacProgram.methods
|
|
@@ -4726,6 +4420,8 @@ class IdentityRegistry {
|
|
|
4726
4420
|
identityAccount,
|
|
4727
4421
|
identityRegistry,
|
|
4728
4422
|
eventAuthority: rwaTokenSdk.getIdentityRegistryEventAuthority(),
|
|
4423
|
+
tokenAccount: tokenAccount,
|
|
4424
|
+
assetMint: args.assetMint,
|
|
4729
4425
|
})
|
|
4730
4426
|
.instruction();
|
|
4731
4427
|
});
|
|
@@ -4767,7 +4463,7 @@ class IdentityMetadataRegistry {
|
|
|
4767
4463
|
* @param args - {@link SetupInvestorArgs}
|
|
4768
4464
|
* @param authority - RBAC AssetAccessController ControllerAuthority.
|
|
4769
4465
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4770
|
-
* @param authorizedUserRole -
|
|
4466
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
4771
4467
|
* @returns A Promise that resolves to the instructions to setup an investor.
|
|
4772
4468
|
*
|
|
4773
4469
|
* It is required for at least a single user to be setup before issuing tokens.
|
|
@@ -4796,6 +4492,9 @@ class IdentityMetadataRegistry {
|
|
|
4796
4492
|
eventAuthority: getEventAuthority(IMR_PROGRAM),
|
|
4797
4493
|
eventAuthorityIdentityRegistry: rwaTokenSdk.getIdentityRegistryEventAuthority(),
|
|
4798
4494
|
program: rwaTokenSdk.identityRegistryProgramId,
|
|
4495
|
+
policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
|
|
4496
|
+
trackerAccount: rwaTokenSdk.getTrackerAccountPda(args.assetMint, investor.toString()),
|
|
4497
|
+
assetMint: assetMintKey,
|
|
4799
4498
|
})
|
|
4800
4499
|
.instruction();
|
|
4801
4500
|
returnIxs.push(yield this.rbacProgram.methods
|
|
@@ -4815,21 +4514,9 @@ class IdentityMetadataRegistry {
|
|
|
4815
4514
|
systemProgram: web3_js.SystemProgram.programId,
|
|
4816
4515
|
eventAuthorityIdentityMetadataRegistry: getEventAuthority(IMR_PROGRAM),
|
|
4817
4516
|
eventAuthorityIdentityRegistry: rwaTokenSdk.getIdentityRegistryEventAuthority(),
|
|
4818
|
-
|
|
4819
|
-
.
|
|
4820
|
-
const policyProgram = rwaTokenSdk.getPolicyEngineProgram(this.imrProgram.provider);
|
|
4821
|
-
const trackerAccount = web3_js.PublicKey.findProgramAddressSync([assetMintKey.toBuffer(), identityAccount.toBuffer()], policyProgram.programId)[0];
|
|
4822
|
-
returnIxs.push(yield policyProgram.methods
|
|
4823
|
-
.createTrackerAccount()
|
|
4824
|
-
.accountsStrict({
|
|
4825
|
-
payer: args.payer,
|
|
4826
|
-
trackerAccount,
|
|
4827
|
-
systemProgram: web3_js.SystemProgram.programId,
|
|
4828
|
-
program: policyProgram.programId,
|
|
4517
|
+
policyEngineProgram: rwaTokenSdk.policyEngineProgramId,
|
|
4518
|
+
trackerAccount: rwaTokenSdk.getTrackerAccountPda(args.assetMint, investor.toString()),
|
|
4829
4519
|
assetMint: assetMintKey,
|
|
4830
|
-
eventAuthority: rwaTokenSdk.getPolicyEngineEventAuthority(),
|
|
4831
|
-
identityRegistry,
|
|
4832
|
-
identityAccount,
|
|
4833
4520
|
})
|
|
4834
4521
|
.instruction());
|
|
4835
4522
|
if (args.levels.length > 1) {
|
|
@@ -4854,7 +4541,7 @@ class IdentityMetadataRegistry {
|
|
|
4854
4541
|
* Asynchronously add levels to investor.
|
|
4855
4542
|
* @param args - {@link AddLevelsArgs}
|
|
4856
4543
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4857
|
-
* @param authorizedUserRole -
|
|
4544
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
4858
4545
|
* @returns A Promise that resolves to the instructions to add levels.
|
|
4859
4546
|
* */
|
|
4860
4547
|
addLevels(args, assetAccessController, authorizedUserRole) {
|
|
@@ -4912,7 +4599,7 @@ class IdentityMetadataRegistry {
|
|
|
4912
4599
|
* Asynchronously change country for the Investor.
|
|
4913
4600
|
* @param args - {@link ChangeCountryArgs}
|
|
4914
4601
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4915
|
-
* @param authorizedUserRole -
|
|
4602
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
4916
4603
|
* @returns A Promise that resolves to the instructions to change the country.
|
|
4917
4604
|
* */
|
|
4918
4605
|
changeCountry(args, assetAccessController, authorizedUserRole) {
|
|
@@ -4965,7 +4652,7 @@ class IdentityMetadataRegistry {
|
|
|
4965
4652
|
* Asynchronously remove levels from an investor.
|
|
4966
4653
|
* @param args - {@link RemoveLevelsArgs}
|
|
4967
4654
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4968
|
-
* @param authorizedUserRole -
|
|
4655
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
4969
4656
|
* @returns A Promise that resolves to the instructions to remove levels.
|
|
4970
4657
|
* */
|
|
4971
4658
|
removeLevels(args, assetAccessController, authorizedUserRole) {
|
|
@@ -5020,7 +4707,7 @@ class IdentityMetadataRegistry {
|
|
|
5020
4707
|
* Asynchronously remove an investor.
|
|
5021
4708
|
* @param args - {@link RemoveLevelsArgs}
|
|
5022
4709
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
5023
|
-
* @param authorizedUserRole -
|
|
4710
|
+
* @param authorizedUserRole - UserRole authorized to invoke instruction.
|
|
5024
4711
|
* @returns A Promise that resolves to the instructions to remove an investor.
|
|
5025
4712
|
* */
|
|
5026
4713
|
removeInvestor(args, assetAccessController, authorizedUserRole) {
|
|
@@ -5047,6 +4734,7 @@ class IdentityMetadataRegistry {
|
|
|
5047
4734
|
trackerAccount: rwaTokenSdk.getTrackerAccountPda(args.assetMint, investor.toString()),
|
|
5048
4735
|
eventAuthorityIdentityMetadataRegistry: getEventAuthority(IMR_PROGRAM),
|
|
5049
4736
|
eventAuthorityIdentityRegistry: rwaTokenSdk.getIdentityRegistryEventAuthority(),
|
|
4737
|
+
assetMint: args.assetMint,
|
|
5050
4738
|
})
|
|
5051
4739
|
.instruction();
|
|
5052
4740
|
});
|
|
@@ -5118,13 +4806,36 @@ class RwaRbacClient {
|
|
|
5118
4806
|
*/
|
|
5119
4807
|
createAssetAccessControllerIxn(args) {
|
|
5120
4808
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4809
|
+
const assetAccessController = deriveAssetAccessControllerPda(args.assetMint);
|
|
4810
|
+
const assetAccessControllerAuthority = deriveControllerAuthorityPda(assetAccessController);
|
|
4811
|
+
const cpiInstruction = yield this.assetController.setupNewRegistry({
|
|
4812
|
+
decimals: args.decimals,
|
|
4813
|
+
authority: assetAccessControllerAuthority.toString(),
|
|
4814
|
+
name: args.name,
|
|
4815
|
+
uri: args.uri,
|
|
4816
|
+
symbol: args.symbol,
|
|
4817
|
+
interestRate: args.interestRate,
|
|
4818
|
+
assetMint: args.assetMint.toString(),
|
|
4819
|
+
payer: args.payer.toString(),
|
|
4820
|
+
});
|
|
5121
4821
|
return this.rbacProgram.methods
|
|
5122
|
-
.createController(
|
|
4822
|
+
.createController(cpiInstruction.data)
|
|
5123
4823
|
.accountsStrict({
|
|
5124
4824
|
payer: args.payer,
|
|
5125
4825
|
admin: args.admin,
|
|
5126
|
-
assetAccessController
|
|
4826
|
+
assetAccessController,
|
|
4827
|
+
assetAccessControllerAuthority,
|
|
4828
|
+
assetMint: args.assetMint,
|
|
4829
|
+
assetController: cpiInstruction.keys[2].pubkey,
|
|
4830
|
+
extraMetasAccount: cpiInstruction.keys[4].pubkey,
|
|
4831
|
+
policyEngineAccount: cpiInstruction.keys[5].pubkey,
|
|
4832
|
+
identityRegistryAccount: cpiInstruction.keys[6].pubkey,
|
|
4833
|
+
policyEngineProgram: cpiInstruction.keys[7].pubkey,
|
|
4834
|
+
identityRegistryProgram: cpiInstruction.keys[8].pubkey,
|
|
4835
|
+
assetControllerProgram: cpiInstruction.programId,
|
|
4836
|
+
tokenProgram: splToken.TOKEN_2022_PROGRAM_ID,
|
|
5127
4837
|
systemProgram: web3_js.SystemProgram.programId,
|
|
4838
|
+
assetControllerEventAuthority: rwaTokenSdk.getAssetControllerEventAuthority(),
|
|
5128
4839
|
})
|
|
5129
4840
|
.instruction();
|
|
5130
4841
|
});
|
|
@@ -5155,7 +4866,7 @@ class RwaRbacClient {
|
|
|
5155
4866
|
// Fetch controller to get next UserRole id.
|
|
5156
4867
|
const controller = yield this.rbacProgram.account.assetAccessController.fetch(args.assetAccessController);
|
|
5157
4868
|
return this.rbacProgram.methods
|
|
5158
|
-
.createUserRole(args.name, new anchor.BN(args.allowedAdminIxs), new anchor.BN(args.allowedMediciIxs))
|
|
4869
|
+
.createUserRole(args.name, new anchor.BN(args.allowedAdminIxs), new anchor.BN(args.allowedMediciIxs), args.isMasterRole || false)
|
|
5159
4870
|
.accountsStrict({
|
|
5160
4871
|
payer: args.payer,
|
|
5161
4872
|
user: args.user,
|