@dstoken-solana/rwa-rbac 0.2.0 → 0.3.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 +3 -9
- package/dist/client/AssetController.d.ts.map +1 -1
- package/dist/client/IdentityRegistry.d.ts +2 -26
- package/dist/client/IdentityRegistry.d.ts.map +1 -1
- package/dist/client/RwaRbacClient.d.ts +7 -1
- package/dist/client/RwaRbacClient.d.ts.map +1 -1
- package/dist/index.es.js +79 -356
- package/dist/index.js +78 -355
- package/dist/types/flags.d.ts +2 -1
- package/dist/types/flags.d.ts.map +1 -1
- package/dist/types/generated/rwa_rbac.d.ts +47 -233
- package/dist/types/generated/rwa_rbac.d.ts.map +1 -1
- package/dist/types/instructions.d.ts +7 -0
- package/dist/types/instructions.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@ import { Program } from "@coral-xyz/anchor";
|
|
|
2
2
|
import { PublicKey, TransactionInstruction } from "@solana/web3.js";
|
|
3
3
|
import { IssueTokensArgs, UpdateInterestBearingMintRateArgs } from "../types/instructions";
|
|
4
4
|
import { RwaRbac } from "../types/generated/rwa_rbac";
|
|
5
|
-
import { CloseMintArgs, CreateAssetControllerIx, FreezeTokenArgs, RevokeTokensArgs, RwaClient, SeizeTokensArgs, TransferTokensArgs, UpdateAssetMetadataArgs
|
|
5
|
+
import { CloseMintArgs, CreateAssetControllerIx, FreezeTokenArgs, RevokeTokensArgs, RwaClient, SeizeTokensArgs, TransferTokensArgs, UpdateAssetMetadataArgs } from "@dstoken-solana/rwa-token-sdk";
|
|
6
6
|
/**
|
|
7
7
|
* Represents the role-based access client for Asset Controller for an RWA.
|
|
8
8
|
*/
|
|
@@ -31,12 +31,6 @@ export declare class AssetController {
|
|
|
31
31
|
* @param authorizedUserRole - Optional UserRole account. Required if user is not an admin.
|
|
32
32
|
*/
|
|
33
33
|
issueTokenIxns(args: IssueTokensArgs, assetAccessController: PublicKey, authorizedUserRole?: PublicKey): Promise<TransactionInstruction>;
|
|
34
|
-
/**
|
|
35
|
-
* Asynchronously generates instructions to revoke assets.
|
|
36
|
-
* @param args - {@link VoidTokensArgs}
|
|
37
|
-
* @returns A Promise that resolves to the instructions to revoke assets.
|
|
38
|
-
*/
|
|
39
|
-
voidTokenIxns(args: VoidTokensArgs): Promise<TransactionInstruction>;
|
|
40
34
|
/**
|
|
41
35
|
* Executes a token transfer.
|
|
42
36
|
* @param args - {@link TransferTokensArgs}
|
|
@@ -62,13 +56,13 @@ export declare class AssetController {
|
|
|
62
56
|
/**
|
|
63
57
|
* Asynchronously generates instructions to revoke tokens from a user.
|
|
64
58
|
* @param args - {@link RevokeTokensArgs}
|
|
65
|
-
* @param payer - Payer public key.
|
|
66
59
|
* @param signer - User signer public key.
|
|
67
60
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
61
|
+
* @param investorId - Optional investorId. Required if user is not an investor.
|
|
68
62
|
* @param authorizedUserRole - Optional UserRole account. Required if user is not an admin.
|
|
69
63
|
* @returns A Promise that resolves to the instructions to revoke.
|
|
70
64
|
*/
|
|
71
|
-
revokeTokenIxn(args: RevokeTokensArgs,
|
|
65
|
+
revokeTokenIxn(args: RevokeTokensArgs, signer: PublicKey, assetAccessController: PublicKey, investorId?: string, authorizedUserRole?: PublicKey): Promise<TransactionInstruction>;
|
|
72
66
|
/**
|
|
73
67
|
* Asynchronously generates instruction to close mint.
|
|
74
68
|
* @param args - {@link CloseMintArgs}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetController.d.ts","sourceRoot":"","sources":["../../src/client/AssetController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EACL,SAAS,EAGT,sBAAsB,EACvB,MAAM,iBAAiB,CAAC;AAQzB,OAAO,EACL,eAAe,EAEf,iCAAiC,EAClC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAEL,aAAa,EACb,uBAAuB,EACvB,eAAe,EAoBf,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"AssetController.d.ts","sourceRoot":"","sources":["../../src/client/AssetController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EACL,SAAS,EAGT,sBAAsB,EACvB,MAAM,iBAAiB,CAAC;AAQzB,OAAO,EACL,eAAe,EAEf,iCAAiC,EAClC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAEL,aAAa,EACb,uBAAuB,EACvB,eAAe,EAoBf,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,+BAA+B,CAAC;AAUvC;;GAEG;AACH,qBAAa,eAAe;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;gBAElB,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC;IAK/D;;;;OAIG;IACG,gBAAgB,CAAC,IAAI,EAAE,uBAAuB;IAIpD;;;;;;SAMK;IACC,mBAAmB,CACvB,IAAI,EAAE,uBAAuB,EAC7B,qBAAqB,EAAE,SAAS,EAChC,kBAAkB,CAAC,EAAE,SAAS,GAC7B,OAAO,CAAC,sBAAsB,CAAC;IAuBlC;;;;;OAKG;IACG,cAAc,CAAC,IAAI,EAAE,eAAe,EACxC,qBAAqB,EAAE,SAAS,EAChC,kBAAkB,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAkElE;;;;OAIG;IACG,QAAQ,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAI3E;;;;;;OAMG;IACG,cAAc,CAClB,IAAI,EAAE,eAAe,EACrB,qBAAqB,EAAE,SAAS,EAChC,kBAAkB,CAAC,EAAE,SAAS,GAC7B,OAAO,CAAC,sBAAsB,CAAC;IAyBlC;;;;;;OAMG;IACG,YAAY,CAChB,IAAI,EAAE,eAAe,EACrB,qBAAqB,EAAE,SAAS,EAChC,kBAAkB,CAAC,EAAE,SAAS,GAC7B,OAAO,CAAC,sBAAsB,CAAC;IA0BlC;;;;;;;;OAQG;IACG,cAAc,CAClB,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAE,SAAS,EACjB,qBAAqB,EAAE,SAAS,EAChC,UAAU,CAAC,EAAE,MAAM,EACnB,kBAAkB,CAAC,EAAE,SAAS,GAC7B,OAAO,CAAC,sBAAsB,CAAC;IAqDlC;;;;;;OAMG;IACG,YAAY,CAChB,IAAI,EAAE,aAAa,EACnB,qBAAqB,EAAE,SAAS,EAChC,kBAAkB,CAAC,EAAE,SAAS,GAC7B,OAAO,CAAC,sBAAsB,CAAC;IAkBlC;;;;;;OAMG;IACG,gCAAgC,CACpC,IAAI,EAAE,iCAAiC,EACvC,qBAAqB,EAAE,SAAS,EAChC,kBAAkB,CAAC,EAAE,SAAS,GAC7B,OAAO,CAAC,sBAAsB,CAAC;IAsBlC;;;;;;;OAOG;IACG,cAAc,CAClB,IAAI,EAAE,eAAe,EACrB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,SAAS,EACjB,qBAAqB,EAAE,SAAS,EAChC,kBAAkB,CAAC,EAAE,SAAS,GAC7B,OAAO,CAAC,sBAAsB,CAAC;CAwFnC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Program } from "@coral-xyz/anchor";
|
|
2
2
|
import { PublicKey, TransactionInstruction } from "@solana/web3.js";
|
|
3
3
|
import { RwaRbac } from "../types/generated/rwa_rbac";
|
|
4
|
-
import { AttachDetachWalletArgs,
|
|
5
|
-
import {
|
|
4
|
+
import { AttachDetachWalletArgs, RevokeIdentityArgs } from "../types/instructions";
|
|
5
|
+
import { IxReturn, RwaClient, SetupUserArgs } from "@dstoken-solana/rwa-token-sdk";
|
|
6
6
|
/**
|
|
7
7
|
* Represents the role-based access client for Identity Registry for an RWA.
|
|
8
8
|
*/
|
|
@@ -32,30 +32,6 @@ export declare class IdentityRegistry {
|
|
|
32
32
|
* It is required for at least a single user to be setup before issuing tokens.
|
|
33
33
|
*/
|
|
34
34
|
removeUserIxn(args: RevokeIdentityArgs, assetAccessController: PublicKey, authorizedUserRole?: PublicKey): Promise<TransactionInstruction>;
|
|
35
|
-
/**
|
|
36
|
-
* Asynchronously update a non-investor user identity account level.
|
|
37
|
-
* @param args - {@link AddLevelToIdentityAccountArgs}
|
|
38
|
-
* @param assetAccessController - RBAC AssetAccessController account.
|
|
39
|
-
* @param authorizedUserRole - Optional UserRole account. Required if user is not an admin.
|
|
40
|
-
* @returns A Promise that resolves to the instructions to update user account identity.
|
|
41
|
-
* */
|
|
42
|
-
addIdentityLevelToUserAccount(args: AddLevelToIdentityAccountArgs, assetAccessController: PublicKey, authorizedUserRole?: PublicKey): Promise<TransactionInstruction>;
|
|
43
|
-
/**
|
|
44
|
-
* Asynchronously reduces a non-Investor user identity account level.
|
|
45
|
-
* @param args - {@link RemoveLevelFromIdentityAccount}
|
|
46
|
-
* @param assetAccessController - RBAC AssetAccessController account.
|
|
47
|
-
* @param authorizedUserRole - Optional UserRole account. Required if user is not an admin.
|
|
48
|
-
* @returns A Promise that resolves to the instructions to reduce the level of a user identity account.
|
|
49
|
-
*/
|
|
50
|
-
removeIdentityLevelFromUserAccount(args: RemoveLevelFromIdentityAccountArgs, assetAccessController: PublicKey, authorizedUserRole?: PublicKey): Promise<TransactionInstruction>;
|
|
51
|
-
/**
|
|
52
|
-
* Asynchronously generates instruction to refresh expiry on an Identity Account level.
|
|
53
|
-
* @param args - {@link RefreshLevelArgs}
|
|
54
|
-
* @param assetAccessController - RBAC AssetAccessController account.
|
|
55
|
-
* @param authorizedUserRole - Optional UserRole account. Required if user is not an admin.
|
|
56
|
-
* @returns A Promise that resolves to refresh expiry on an Identity Account level.
|
|
57
|
-
* */
|
|
58
|
-
refreshLevelToIdentityAccountIxn(args: RefreshLevelArgs, assetAccessController: PublicKey, authorizedUserRole?: PublicKey): Promise<TransactionInstruction>;
|
|
59
35
|
/**
|
|
60
36
|
* Asynchronously generates instruction to attach wallet to identity.
|
|
61
37
|
* @param args - {@link AttachDetachWalletArgs}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityRegistry.d.ts","sourceRoot":"","sources":["../../src/client/IdentityRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EACL,sBAAsB,
|
|
1
|
+
{"version":3,"file":"IdentityRegistry.d.ts","sourceRoot":"","sources":["../../src/client/IdentityRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EACL,sBAAsB,EAEtB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAYL,QAAQ,EAGR,SAAS,EACT,aAAa,EACd,MAAM,+BAA+B,CAAC;AAKvC;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;gBAElB,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC;IAK/D;;;;;;;;;OASG;IACG,aAAa,CACjB,IAAI,EAAE,aAAa,EACnB,qBAAqB,EAAE,SAAS,EAChC,kBAAkB,CAAC,EAAE,SAAS,GAC7B,OAAO,CAAC,QAAQ,CAAC;IAyCpB;;;;;;;;;OASG;IACG,aAAa,CACjB,IAAI,EAAE,kBAAkB,EACxB,qBAAqB,EAAE,SAAS,EAChC,kBAAkB,CAAC,EAAE,SAAS,GAC7B,OAAO,CAAC,sBAAsB,CAAC;IAgClC;;;;;;SAMK;IACC,yBAAyB,CAC7B,IAAI,EAAE,sBAAsB,EAC5B,qBAAqB,EAAE,SAAS,EAChC,kBAAkB,CAAC,EAAE,SAAS,GAC7B,OAAO,CAAC,sBAAsB,CAAC;IAiDlC;;;;;;SAMK;IACC,2BAA2B,CAC/B,IAAI,EAAE,sBAAsB,EAC5B,qBAAqB,EAAE,SAAS,EAChC,kBAAkB,CAAC,EAAE,SAAS,GAC7B,OAAO,CAAC,sBAAsB,CAAC;CAmDnC"}
|
|
@@ -4,7 +4,7 @@ import { RwaRbac } from "../types/generated/rwa_rbac";
|
|
|
4
4
|
import { AssetController } from "./AssetController";
|
|
5
5
|
import { PolicyEngine } from "./PolicyEngine";
|
|
6
6
|
import { IdentityRegistry } from "./IdentityRegistry";
|
|
7
|
-
import { AssignUserRoleArgs, CreateControllerArgs, DeleteUserRoleArgs, ModifyUserRoleArgs, RemoveUserRoleArgs, SetupUserRoleArgs, UpdateControllerAdminArgs, WithdrawExcessRentArgs } from "../types/instructions";
|
|
7
|
+
import { AssignUserRoleArgs, CreateControllerArgs, DeleteUserRoleArgs, ModifyUserRoleArgs, RemoveUserRoleArgs, SetLookuptableAddressArgs, SetupUserRoleArgs, UpdateControllerAdminArgs, WithdrawExcessRentArgs } from "../types/instructions";
|
|
8
8
|
import { RwaClient } from "@dstoken-solana/rwa-token-sdk";
|
|
9
9
|
import { Config } from "@dstoken-solana/rwa-token-sdk";
|
|
10
10
|
import { IdentityMetadataRegistry } from "./IdentityMetadataRegistry";
|
|
@@ -71,5 +71,11 @@ export declare class RwaRbacClient {
|
|
|
71
71
|
* @returns A Promise that resolves to the instruction to withdraw excess rent from ControllerAuthority.
|
|
72
72
|
*/
|
|
73
73
|
withdrawExcessRentIxn(args: WithdrawExcessRentArgs): Promise<import("@solana/web3.js").TransactionInstruction>;
|
|
74
|
+
/**
|
|
75
|
+
* Asynchronously generates instruction to set lookup table address field in the AssetAccessController.
|
|
76
|
+
* @param args - {@link SetLookuptableAddressArgs}
|
|
77
|
+
* @returns A Promise that resolves to the instruction to set lookup table address.
|
|
78
|
+
*/
|
|
79
|
+
setLookuptableAddressIxn(args: SetLookuptableAddressArgs): Promise<import("@solana/web3.js").TransactionInstruction>;
|
|
74
80
|
}
|
|
75
81
|
//# sourceMappingURL=RwaRbacClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RwaRbacClient.d.ts","sourceRoot":"","sources":["../../src/client/RwaRbacClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,OAAO,EAAE,QAAQ,EAAS,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAiB,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAItD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAMtD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAGtE,qBAAa,aAAa;IACxB,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9B,SAAS,EAAE,SAAS,CAAC;IACrB,eAAe,EAAE,eAAe,CAAC;IACjC,YAAY,EAAE,YAAY,CAAC;IAC3B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,QAAQ,EAAE,QAAQ,CAAC;gBAEP,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;IAoB9C;;;;SAIK;IACL,WAAW,CAAC,GAAG,EAAE,mBAAmB,EAAE;IAkBtC;;;;OAIG;IACG,8BAA8B,CAAC,IAAI,EAAE,oBAAoB;IAY/D;;;;OAIG;IACG,wBAAwB,CAAC,IAAI,EAAE,yBAAyB;IAU9D;;;;OAIG;IACG,iBAAiB,CAAC,IAAI,EAAE,iBAAiB;IA2B/C;;;;OAIG;IACG,iBAAiB,CAAC,IAAI,EAAE,kBAAkB;IAgBhD;;;;OAIG;IACG,iBAAiB,CAAC,IAAI,EAAE,kBAAkB;IAahD;;;;OAIG;IACG,iBAAiB,CAAC,IAAI,EAAE,kBAAkB;IAgBhD;;;;OAIG;IACG,iBAAiB,CAAC,IAAI,EAAE,kBAAkB;IAchD;;;;OAIG;IACG,qBAAqB,CAAC,IAAI,EAAE,sBAAsB;
|
|
1
|
+
{"version":3,"file":"RwaRbacClient.d.ts","sourceRoot":"","sources":["../../src/client/RwaRbacClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,OAAO,EAAE,QAAQ,EAAS,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAiB,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAItD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAMtD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAGtE,qBAAa,aAAa;IACxB,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9B,SAAS,EAAE,SAAS,CAAC;IACrB,eAAe,EAAE,eAAe,CAAC;IACjC,YAAY,EAAE,YAAY,CAAC;IAC3B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,QAAQ,EAAE,QAAQ,CAAC;gBAEP,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;IAoB9C;;;;SAIK;IACL,WAAW,CAAC,GAAG,EAAE,mBAAmB,EAAE;IAkBtC;;;;OAIG;IACG,8BAA8B,CAAC,IAAI,EAAE,oBAAoB;IAY/D;;;;OAIG;IACG,wBAAwB,CAAC,IAAI,EAAE,yBAAyB;IAU9D;;;;OAIG;IACG,iBAAiB,CAAC,IAAI,EAAE,iBAAiB;IA2B/C;;;;OAIG;IACG,iBAAiB,CAAC,IAAI,EAAE,kBAAkB;IAgBhD;;;;OAIG;IACG,iBAAiB,CAAC,IAAI,EAAE,kBAAkB;IAahD;;;;OAIG;IACG,iBAAiB,CAAC,IAAI,EAAE,kBAAkB;IAgBhD;;;;OAIG;IACG,iBAAiB,CAAC,IAAI,EAAE,kBAAkB;IAchD;;;;OAIG;IACG,qBAAqB,CAAC,IAAI,EAAE,sBAAsB;IAaxD;;;;OAIG;IACG,wBAAwB,CAAC,IAAI,EAAE,yBAAyB;CAW/D"}
|
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PublicKey, SystemProgram } from '@solana/web3.js';
|
|
2
2
|
import { utils, Program, BN } from '@coral-xyz/anchor';
|
|
3
3
|
import { TOKEN_2022_PROGRAM_ID, getAssociatedTokenAddressSync, ASSOCIATED_TOKEN_PROGRAM_ID } from '@solana/spl-token';
|
|
4
|
-
import { getCreateAssetControllerIx, getAssetControllerPda, assetControllerProgramId, getAssetControllerEventAuthority, getIdentityRegistryPda, getIssueTokensIx, getTrackerAccountPda, getPolicyEnginePda, policyEngineProgramId, getIdentityAccountPda, getWalletIdentityAccountPda, getFreezeTokenIx, getThawTokenIx, getRevokeTokensIx, getCloseMintIx, getUpdateInterestBearingMintRateIx, getSeizeTokensIx, identityRegistryProgramId, getExtraMetasListPda, getPolicyEngineEventAuthority, getIdentityRegistryEventAuthority, getIdentityAccount,
|
|
4
|
+
import { getCreateAssetControllerIx, getAssetControllerPda, assetControllerProgramId, getAssetControllerEventAuthority, getIdentityRegistryPda, getIssueTokensIx, getTrackerAccountPda, getPolicyEnginePda, policyEngineProgramId, getIdentityAccountPda, getWalletIdentityAccountPda, getFreezeTokenIx, getThawTokenIx, getRevokeTokensIx, getCloseMintIx, getUpdateInterestBearingMintRateIx, getSeizeTokensIx, identityRegistryProgramId, getExtraMetasListPda, getPolicyEngineEventAuthority, getIdentityRegistryEventAuthority, getIdentityAccount, getIdentityRegistryProgram, getPolicyEngineProgram, RwaClient } from '@dstoken-solana/rwa-token-sdk';
|
|
5
5
|
|
|
6
6
|
const IMR_PROGRAM = new PublicKey("D2V7wTBbNCKgYwirgRUnSmc2QyKnHSVmRotWJ4rz8Jp9");
|
|
7
7
|
const RBAC_PROGRAM = new PublicKey("3g6fUgMsJQhjPUYxNjEU5PyzGf8DerbDx8p5Qh4yMnRR");
|
|
@@ -51,98 +51,6 @@ var metadata$1 = {
|
|
|
51
51
|
description: "Created with Anchor"
|
|
52
52
|
};
|
|
53
53
|
var instructions$1 = [
|
|
54
|
-
{
|
|
55
|
-
name: "add_level_to_identity_account",
|
|
56
|
-
discriminator: [
|
|
57
|
-
102,
|
|
58
|
-
204,
|
|
59
|
-
64,
|
|
60
|
-
169,
|
|
61
|
-
252,
|
|
62
|
-
177,
|
|
63
|
-
192,
|
|
64
|
-
232
|
|
65
|
-
],
|
|
66
|
-
accounts: [
|
|
67
|
-
{
|
|
68
|
-
name: "payer",
|
|
69
|
-
writable: true,
|
|
70
|
-
signer: true
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
name: "user",
|
|
74
|
-
signer: true
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: "controller_authority",
|
|
78
|
-
relations: [
|
|
79
|
-
"asset_access_controller"
|
|
80
|
-
]
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: "asset_access_controller",
|
|
84
|
-
relations: [
|
|
85
|
-
"authorized_user_role"
|
|
86
|
-
]
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
name: "authorized_user_role",
|
|
90
|
-
optional: true
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
name: "identity_registry_program",
|
|
94
|
-
address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
name: "identity_registry"
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
name: "identity_account",
|
|
101
|
-
writable: true
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
name: "identity_account_owner",
|
|
105
|
-
docs: [
|
|
106
|
-
"to ensure that it is not an Investor account. If it is an Investor account,",
|
|
107
|
-
"CPI to IdentityMetadataRegistry should be called."
|
|
108
|
-
]
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
name: "system_program",
|
|
112
|
-
address: "11111111111111111111111111111111"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: "policy_engine_program"
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
name: "policy_engine",
|
|
119
|
-
writable: true
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
name: "tracker_account"
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
name: "asset_mint"
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
name: "event_authority"
|
|
129
|
-
}
|
|
130
|
-
],
|
|
131
|
-
args: [
|
|
132
|
-
{
|
|
133
|
-
name: "level",
|
|
134
|
-
type: "u8"
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
name: "expiry",
|
|
138
|
-
type: "i64"
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
name: "enforce_limits",
|
|
142
|
-
type: "bool"
|
|
143
|
-
}
|
|
144
|
-
]
|
|
145
|
-
},
|
|
146
54
|
{
|
|
147
55
|
name: "add_levels",
|
|
148
56
|
discriminator: [
|
|
@@ -1246,6 +1154,12 @@ var instructions$1 = [
|
|
|
1246
1154
|
{
|
|
1247
1155
|
name: "identity_registry"
|
|
1248
1156
|
},
|
|
1157
|
+
{
|
|
1158
|
+
name: "token_account"
|
|
1159
|
+
},
|
|
1160
|
+
{
|
|
1161
|
+
name: "asset_mint"
|
|
1162
|
+
},
|
|
1249
1163
|
{
|
|
1250
1164
|
name: "event_authority"
|
|
1251
1165
|
}
|
|
@@ -1467,63 +1381,6 @@ var instructions$1 = [
|
|
|
1467
1381
|
}
|
|
1468
1382
|
]
|
|
1469
1383
|
},
|
|
1470
|
-
{
|
|
1471
|
-
name: "refresh_level_to_identity_account",
|
|
1472
|
-
discriminator: [
|
|
1473
|
-
23,
|
|
1474
|
-
68,
|
|
1475
|
-
237,
|
|
1476
|
-
111,
|
|
1477
|
-
144,
|
|
1478
|
-
169,
|
|
1479
|
-
239,
|
|
1480
|
-
91
|
|
1481
|
-
],
|
|
1482
|
-
accounts: [
|
|
1483
|
-
{
|
|
1484
|
-
name: "payer",
|
|
1485
|
-
writable: true,
|
|
1486
|
-
signer: true
|
|
1487
|
-
},
|
|
1488
|
-
{
|
|
1489
|
-
name: "user",
|
|
1490
|
-
signer: true
|
|
1491
|
-
},
|
|
1492
|
-
{
|
|
1493
|
-
name: "controller_authority",
|
|
1494
|
-
relations: [
|
|
1495
|
-
"asset_access_controller"
|
|
1496
|
-
]
|
|
1497
|
-
},
|
|
1498
|
-
{
|
|
1499
|
-
name: "asset_access_controller",
|
|
1500
|
-
relations: [
|
|
1501
|
-
"authorized_user_role"
|
|
1502
|
-
]
|
|
1503
|
-
},
|
|
1504
|
-
{
|
|
1505
|
-
name: "authorized_user_role",
|
|
1506
|
-
optional: true
|
|
1507
|
-
},
|
|
1508
|
-
{
|
|
1509
|
-
name: "identity_registry_program",
|
|
1510
|
-
address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
|
|
1511
|
-
},
|
|
1512
|
-
{
|
|
1513
|
-
name: "identity_registry"
|
|
1514
|
-
},
|
|
1515
|
-
{
|
|
1516
|
-
name: "identity_account",
|
|
1517
|
-
writable: true
|
|
1518
|
-
}
|
|
1519
|
-
],
|
|
1520
|
-
args: [
|
|
1521
|
-
{
|
|
1522
|
-
name: "cpi_data",
|
|
1523
|
-
type: "bytes"
|
|
1524
|
-
}
|
|
1525
|
-
]
|
|
1526
|
-
},
|
|
1527
1384
|
{
|
|
1528
1385
|
name: "register_investor",
|
|
1529
1386
|
discriminator: [
|
|
@@ -1749,90 +1606,6 @@ var instructions$1 = [
|
|
|
1749
1606
|
args: [
|
|
1750
1607
|
]
|
|
1751
1608
|
},
|
|
1752
|
-
{
|
|
1753
|
-
name: "remove_level_from_identity_account",
|
|
1754
|
-
discriminator: [
|
|
1755
|
-
194,
|
|
1756
|
-
231,
|
|
1757
|
-
187,
|
|
1758
|
-
54,
|
|
1759
|
-
197,
|
|
1760
|
-
136,
|
|
1761
|
-
170,
|
|
1762
|
-
55
|
|
1763
|
-
],
|
|
1764
|
-
accounts: [
|
|
1765
|
-
{
|
|
1766
|
-
name: "payer",
|
|
1767
|
-
writable: true,
|
|
1768
|
-
signer: true
|
|
1769
|
-
},
|
|
1770
|
-
{
|
|
1771
|
-
name: "user",
|
|
1772
|
-
signer: true
|
|
1773
|
-
},
|
|
1774
|
-
{
|
|
1775
|
-
name: "controller_authority",
|
|
1776
|
-
relations: [
|
|
1777
|
-
"asset_access_controller"
|
|
1778
|
-
]
|
|
1779
|
-
},
|
|
1780
|
-
{
|
|
1781
|
-
name: "asset_access_controller",
|
|
1782
|
-
relations: [
|
|
1783
|
-
"authorized_user_role"
|
|
1784
|
-
]
|
|
1785
|
-
},
|
|
1786
|
-
{
|
|
1787
|
-
name: "authorized_user_role",
|
|
1788
|
-
optional: true
|
|
1789
|
-
},
|
|
1790
|
-
{
|
|
1791
|
-
name: "identity_registry_program",
|
|
1792
|
-
address: "GZsnjqT3c5zbHqsctrJ4EG4rbEfo7ZXyyUG7aDJNmxfA"
|
|
1793
|
-
},
|
|
1794
|
-
{
|
|
1795
|
-
name: "identity_registry"
|
|
1796
|
-
},
|
|
1797
|
-
{
|
|
1798
|
-
name: "identity_account",
|
|
1799
|
-
writable: true
|
|
1800
|
-
},
|
|
1801
|
-
{
|
|
1802
|
-
name: "identity_account_owner",
|
|
1803
|
-
docs: [
|
|
1804
|
-
"to ensure that it is not an Investor account. If it is an Investor account,",
|
|
1805
|
-
"CPI to IdentityMetadataRegistry should be called."
|
|
1806
|
-
]
|
|
1807
|
-
},
|
|
1808
|
-
{
|
|
1809
|
-
name: "system_program",
|
|
1810
|
-
address: "11111111111111111111111111111111"
|
|
1811
|
-
},
|
|
1812
|
-
{
|
|
1813
|
-
name: "policy_engine_program"
|
|
1814
|
-
},
|
|
1815
|
-
{
|
|
1816
|
-
name: "policy_engine",
|
|
1817
|
-
writable: true
|
|
1818
|
-
},
|
|
1819
|
-
{
|
|
1820
|
-
name: "tracker_account"
|
|
1821
|
-
},
|
|
1822
|
-
{
|
|
1823
|
-
name: "asset_mint"
|
|
1824
|
-
},
|
|
1825
|
-
{
|
|
1826
|
-
name: "event_authority"
|
|
1827
|
-
}
|
|
1828
|
-
],
|
|
1829
|
-
args: [
|
|
1830
|
-
{
|
|
1831
|
-
name: "cpi_data",
|
|
1832
|
-
type: "bytes"
|
|
1833
|
-
}
|
|
1834
|
-
]
|
|
1835
|
-
},
|
|
1836
1609
|
{
|
|
1837
1610
|
name: "remove_levels",
|
|
1838
1611
|
discriminator: [
|
|
@@ -2282,6 +2055,41 @@ var instructions$1 = [
|
|
|
2282
2055
|
}
|
|
2283
2056
|
]
|
|
2284
2057
|
},
|
|
2058
|
+
{
|
|
2059
|
+
name: "set_lut_address",
|
|
2060
|
+
discriminator: [
|
|
2061
|
+
254,
|
|
2062
|
+
239,
|
|
2063
|
+
106,
|
|
2064
|
+
70,
|
|
2065
|
+
17,
|
|
2066
|
+
87,
|
|
2067
|
+
57,
|
|
2068
|
+
202
|
|
2069
|
+
],
|
|
2070
|
+
accounts: [
|
|
2071
|
+
{
|
|
2072
|
+
name: "user",
|
|
2073
|
+
signer: true
|
|
2074
|
+
},
|
|
2075
|
+
{
|
|
2076
|
+
name: "asset_access_controller",
|
|
2077
|
+
writable: true,
|
|
2078
|
+
relations: [
|
|
2079
|
+
"authorized_user_role"
|
|
2080
|
+
]
|
|
2081
|
+
},
|
|
2082
|
+
{
|
|
2083
|
+
name: "authorized_user_role",
|
|
2084
|
+
optional: true
|
|
2085
|
+
},
|
|
2086
|
+
{
|
|
2087
|
+
name: "lut_address"
|
|
2088
|
+
}
|
|
2089
|
+
],
|
|
2090
|
+
args: [
|
|
2091
|
+
]
|
|
2092
|
+
},
|
|
2285
2093
|
{
|
|
2286
2094
|
name: "thaw_token_account",
|
|
2287
2095
|
discriminator: [
|
|
@@ -2687,6 +2495,13 @@ var types$1 = [
|
|
|
2687
2495
|
"Number of UserRoles created since initialization. Used for deriving all created UserRole PDAs."
|
|
2688
2496
|
],
|
|
2689
2497
|
type: "u64"
|
|
2498
|
+
},
|
|
2499
|
+
{
|
|
2500
|
+
name: "lut_address",
|
|
2501
|
+
docs: [
|
|
2502
|
+
"Address of the lookup table."
|
|
2503
|
+
],
|
|
2504
|
+
type: "pubkey"
|
|
2690
2505
|
}
|
|
2691
2506
|
]
|
|
2692
2507
|
}
|
|
@@ -3719,7 +3534,8 @@ var AdminFlags;
|
|
|
3719
3534
|
AdminFlags[AdminFlags["MODIFY_USER_ROLE"] = 2] = "MODIFY_USER_ROLE";
|
|
3720
3535
|
AdminFlags[AdminFlags["ASSIGN_OR_REMOVE_ANY_USER_ROLE"] = 4] = "ASSIGN_OR_REMOVE_ANY_USER_ROLE";
|
|
3721
3536
|
AdminFlags[AdminFlags["ASSIGN_OR_REMOVE_CURRENT_ROLE"] = 8] = "ASSIGN_OR_REMOVE_CURRENT_ROLE";
|
|
3722
|
-
AdminFlags[AdminFlags["
|
|
3537
|
+
AdminFlags[AdminFlags["SET_LUT_ADDRESS"] = 16] = "SET_LUT_ADDRESS";
|
|
3538
|
+
AdminFlags[AdminFlags["ALL"] = 31] = "ALL";
|
|
3723
3539
|
})(AdminFlags || (AdminFlags = {}));
|
|
3724
3540
|
var MediciFlags;
|
|
3725
3541
|
(function (MediciFlags) {
|
|
@@ -3886,16 +3702,6 @@ class AssetController {
|
|
|
3886
3702
|
.instruction();
|
|
3887
3703
|
});
|
|
3888
3704
|
}
|
|
3889
|
-
/**
|
|
3890
|
-
* Asynchronously generates instructions to revoke assets.
|
|
3891
|
-
* @param args - {@link VoidTokensArgs}
|
|
3892
|
-
* @returns A Promise that resolves to the instructions to revoke assets.
|
|
3893
|
-
*/
|
|
3894
|
-
voidTokenIxns(args) {
|
|
3895
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3896
|
-
return this.rwaClient.assetController.voidTokenIxns(args);
|
|
3897
|
-
});
|
|
3898
|
-
}
|
|
3899
3705
|
/**
|
|
3900
3706
|
* Executes a token transfer.
|
|
3901
3707
|
* @param args - {@link TransferTokensArgs}
|
|
@@ -3966,13 +3772,13 @@ class AssetController {
|
|
|
3966
3772
|
/**
|
|
3967
3773
|
* Asynchronously generates instructions to revoke tokens from a user.
|
|
3968
3774
|
* @param args - {@link RevokeTokensArgs}
|
|
3969
|
-
* @param payer - Payer public key.
|
|
3970
3775
|
* @param signer - User signer public key.
|
|
3971
3776
|
* @param assetAccessController - RBAC AssetAccessController account.
|
|
3777
|
+
* @param investorId - Optional investorId. Required if user is not an investor.
|
|
3972
3778
|
* @param authorizedUserRole - Optional UserRole account. Required if user is not an admin.
|
|
3973
3779
|
* @returns A Promise that resolves to the instructions to revoke.
|
|
3974
3780
|
*/
|
|
3975
|
-
revokeTokenIxn(args,
|
|
3781
|
+
revokeTokenIxn(args, signer, assetAccessController, investorId, authorizedUserRole) {
|
|
3976
3782
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3977
3783
|
if (!args.wallet) {
|
|
3978
3784
|
throw new Error("Use wallet arg for wallet to revoke tokens from.");
|
|
@@ -3981,7 +3787,7 @@ class AssetController {
|
|
|
3981
3787
|
args.owner = args.wallet;
|
|
3982
3788
|
const revokeIx = yield getRevokeTokensIx(args, this.rwaClient.provider);
|
|
3983
3789
|
const identityRegistry = getIdentityRegistryPda(args.assetMint);
|
|
3984
|
-
const investorPda = deriveInvestorPda(investorId, identityRegistry);
|
|
3790
|
+
const investorPda = investorId ? deriveInvestorPda(investorId, identityRegistry) : null;
|
|
3985
3791
|
const ixData = revokeIx.data;
|
|
3986
3792
|
const assetController = getAssetControllerPda(args.assetMint);
|
|
3987
3793
|
const revokeTokenAccount = getAssociatedTokenAddressSync(new PublicKey(args.assetMint), new PublicKey(args.wallet), false, TOKEN_2022_PROGRAM_ID);
|
|
@@ -3997,8 +3803,8 @@ class AssetController {
|
|
|
3997
3803
|
assetController,
|
|
3998
3804
|
revokeTokenAccount,
|
|
3999
3805
|
identityRegistry,
|
|
4000
|
-
identityAccount: getIdentityAccountPda(args.assetMint, investorPda.toString()),
|
|
4001
|
-
trackerAccount: getTrackerAccountPda(args.assetMint, investorPda.toString()),
|
|
3806
|
+
identityAccount: getIdentityAccountPda(args.assetMint, investorId ? investorPda.toString() : args.owner),
|
|
3807
|
+
trackerAccount: getTrackerAccountPda(args.assetMint, investorId ? investorPda.toString() : args.owner),
|
|
4002
3808
|
policyEngineProgram: policyEngineProgramId,
|
|
4003
3809
|
policyEngine: getPolicyEnginePda(args.assetMint),
|
|
4004
3810
|
walletIdentityAccount: getWalletIdentityAccountPda(args.assetMint, args.wallet),
|
|
@@ -4486,112 +4292,6 @@ class IdentityRegistry {
|
|
|
4486
4292
|
return returnIx;
|
|
4487
4293
|
});
|
|
4488
4294
|
}
|
|
4489
|
-
/**
|
|
4490
|
-
* Asynchronously update a non-investor user identity account level.
|
|
4491
|
-
* @param args - {@link AddLevelToIdentityAccountArgs}
|
|
4492
|
-
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4493
|
-
* @param authorizedUserRole - Optional UserRole account. Required if user is not an admin.
|
|
4494
|
-
* @returns A Promise that resolves to the instructions to update user account identity.
|
|
4495
|
-
* */
|
|
4496
|
-
addIdentityLevelToUserAccount(args, assetAccessController, authorizedUserRole) {
|
|
4497
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
4498
|
-
var _a;
|
|
4499
|
-
const identityAccount = getIdentityAccountPda(args.assetMint, args.owner);
|
|
4500
|
-
const controllerAuthority = deriveControllerAuthorityPda(assetAccessController);
|
|
4501
|
-
return this.rbacProgram.methods
|
|
4502
|
-
.addLevelToIdentityAccount(args.levels[0], args.expiries[0], (_a = args.ignorePolicy) !== null && _a !== void 0 ? _a : false)
|
|
4503
|
-
.accountsStrict({
|
|
4504
|
-
payer: args.payer,
|
|
4505
|
-
user: args.signer,
|
|
4506
|
-
controllerAuthority,
|
|
4507
|
-
assetAccessController,
|
|
4508
|
-
authorizedUserRole: authorizedUserRole || null,
|
|
4509
|
-
identityRegistryProgram: identityRegistryProgramId,
|
|
4510
|
-
identityRegistry: getIdentityRegistryPda(args.assetMint),
|
|
4511
|
-
identityAccount,
|
|
4512
|
-
identityAccountOwner: args.owner,
|
|
4513
|
-
systemProgram: SystemProgram.programId,
|
|
4514
|
-
policyEngineProgram: policyEngineProgramId,
|
|
4515
|
-
policyEngine: getPolicyEnginePda(args.assetMint),
|
|
4516
|
-
trackerAccount: getTrackerAccountPda(args.assetMint, args.owner),
|
|
4517
|
-
assetMint: args.assetMint,
|
|
4518
|
-
eventAuthority: getIdentityRegistryEventAuthority(),
|
|
4519
|
-
})
|
|
4520
|
-
.instruction();
|
|
4521
|
-
});
|
|
4522
|
-
}
|
|
4523
|
-
/**
|
|
4524
|
-
* Asynchronously reduces a non-Investor user identity account level.
|
|
4525
|
-
* @param args - {@link RemoveLevelFromIdentityAccount}
|
|
4526
|
-
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4527
|
-
* @param authorizedUserRole - Optional UserRole account. Required if user is not an admin.
|
|
4528
|
-
* @returns A Promise that resolves to the instructions to reduce the level of a user identity account.
|
|
4529
|
-
*/
|
|
4530
|
-
removeIdentityLevelFromUserAccount(args, assetAccessController, authorizedUserRole) {
|
|
4531
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
4532
|
-
const removeLevelIx = yield getRemoveLevelFromIdentityAccount(args, this.rwaClient.provider);
|
|
4533
|
-
const ixData = removeLevelIx.data;
|
|
4534
|
-
const controllerAuthority = deriveControllerAuthorityPda(assetAccessController);
|
|
4535
|
-
const identityAccount = getIdentityAccountPda(args.assetMint, args.owner);
|
|
4536
|
-
return this.rbacProgram.methods
|
|
4537
|
-
.removeLevelFromIdentityAccount(ixData)
|
|
4538
|
-
.accountsStrict({
|
|
4539
|
-
payer: args.payer,
|
|
4540
|
-
user: args.signer,
|
|
4541
|
-
controllerAuthority,
|
|
4542
|
-
assetAccessController,
|
|
4543
|
-
authorizedUserRole: authorizedUserRole || null,
|
|
4544
|
-
identityRegistryProgram: identityRegistryProgramId,
|
|
4545
|
-
identityRegistry: getIdentityRegistryPda(args.assetMint),
|
|
4546
|
-
identityAccount,
|
|
4547
|
-
identityAccountOwner: args.owner,
|
|
4548
|
-
systemProgram: SystemProgram.programId,
|
|
4549
|
-
policyEngineProgram: policyEngineProgramId,
|
|
4550
|
-
policyEngine: getPolicyEnginePda(args.assetMint),
|
|
4551
|
-
trackerAccount: getTrackerAccountPda(args.assetMint, args.owner),
|
|
4552
|
-
assetMint: args.assetMint,
|
|
4553
|
-
eventAuthority: getIdentityRegistryEventAuthority(),
|
|
4554
|
-
})
|
|
4555
|
-
.instruction();
|
|
4556
|
-
});
|
|
4557
|
-
}
|
|
4558
|
-
/**
|
|
4559
|
-
* Asynchronously generates instruction to refresh expiry on an Identity Account level.
|
|
4560
|
-
* @param args - {@link RefreshLevelArgs}
|
|
4561
|
-
* @param assetAccessController - RBAC AssetAccessController account.
|
|
4562
|
-
* @param authorizedUserRole - Optional UserRole account. Required if user is not an admin.
|
|
4563
|
-
* @returns A Promise that resolves to refresh expiry on an Identity Account level.
|
|
4564
|
-
* */
|
|
4565
|
-
refreshLevelToIdentityAccountIxn(args, assetAccessController, authorizedUserRole) {
|
|
4566
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
4567
|
-
const identityProgram = getIdentityRegistryProgram(this.rwaClient.provider);
|
|
4568
|
-
const identityRegistry = getIdentityRegistryPda(args.assetMint);
|
|
4569
|
-
const identityAccount = getIdentityAccountPda(args.assetMint, args.owner);
|
|
4570
|
-
const controllerAuthority = deriveControllerAuthorityPda(assetAccessController);
|
|
4571
|
-
const refreshIx = yield identityProgram.methods
|
|
4572
|
-
.refreshLevelToIdentityAccount(args.level, args.expiry)
|
|
4573
|
-
.accountsStrict({
|
|
4574
|
-
payer: args.payer,
|
|
4575
|
-
signer: controllerAuthority,
|
|
4576
|
-
identityRegistry,
|
|
4577
|
-
identityAccount,
|
|
4578
|
-
})
|
|
4579
|
-
.instruction();
|
|
4580
|
-
return this.rbacProgram.methods
|
|
4581
|
-
.refreshLevelToIdentityAccount(refreshIx.data)
|
|
4582
|
-
.accountsStrict({
|
|
4583
|
-
payer: args.payer,
|
|
4584
|
-
user: args.signer,
|
|
4585
|
-
controllerAuthority,
|
|
4586
|
-
assetAccessController,
|
|
4587
|
-
authorizedUserRole: authorizedUserRole || null,
|
|
4588
|
-
identityRegistryProgram: identityRegistryProgramId,
|
|
4589
|
-
identityRegistry,
|
|
4590
|
-
identityAccount,
|
|
4591
|
-
})
|
|
4592
|
-
.instruction();
|
|
4593
|
-
});
|
|
4594
|
-
}
|
|
4595
4295
|
/**
|
|
4596
4296
|
* Asynchronously generates instruction to attach wallet to identity.
|
|
4597
4297
|
* @param args - {@link AttachDetachWalletArgs}
|
|
@@ -4654,6 +4354,7 @@ class IdentityRegistry {
|
|
|
4654
4354
|
const identityRegistry = getIdentityRegistryPda(args.assetMint);
|
|
4655
4355
|
const identityAccount = getIdentityAccountPda(args.assetMint, args.owner);
|
|
4656
4356
|
const walletIdentity = getWalletIdentityAccountPda(args.assetMint, args.wallet.toString());
|
|
4357
|
+
const tokenAccount = getAssociatedTokenAddressSync(new PublicKey(args.assetMint), new PublicKey(args.wallet), false, TOKEN_2022_PROGRAM_ID);
|
|
4657
4358
|
const ix = yield identityProgram.methods
|
|
4658
4359
|
.detachWalletFromIdentity()
|
|
4659
4360
|
.accountsStrict({
|
|
@@ -4664,6 +4365,8 @@ class IdentityRegistry {
|
|
|
4664
4365
|
identityRegistry,
|
|
4665
4366
|
eventAuthority: getIdentityRegistryEventAuthority(),
|
|
4666
4367
|
program: identityRegistryProgramId,
|
|
4368
|
+
tokenAccount: tokenAccount,
|
|
4369
|
+
assetMint: args.assetMint,
|
|
4667
4370
|
})
|
|
4668
4371
|
.instruction();
|
|
4669
4372
|
return this.rbacProgram.methods
|
|
@@ -4679,6 +4382,8 @@ class IdentityRegistry {
|
|
|
4679
4382
|
identityAccount,
|
|
4680
4383
|
identityRegistry,
|
|
4681
4384
|
eventAuthority: getIdentityRegistryEventAuthority(),
|
|
4385
|
+
tokenAccount: tokenAccount,
|
|
4386
|
+
assetMint: args.assetMint,
|
|
4682
4387
|
})
|
|
4683
4388
|
.instruction();
|
|
4684
4389
|
});
|
|
@@ -5218,6 +4923,24 @@ class RwaRbacClient {
|
|
|
5218
4923
|
.instruction();
|
|
5219
4924
|
});
|
|
5220
4925
|
}
|
|
4926
|
+
/**
|
|
4927
|
+
* Asynchronously generates instruction to set lookup table address field in the AssetAccessController.
|
|
4928
|
+
* @param args - {@link SetLookuptableAddressArgs}
|
|
4929
|
+
* @returns A Promise that resolves to the instruction to set lookup table address.
|
|
4930
|
+
*/
|
|
4931
|
+
setLookuptableAddressIxn(args) {
|
|
4932
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4933
|
+
return this.rbacProgram.methods
|
|
4934
|
+
.setLutAddress()
|
|
4935
|
+
.accountsStrict({
|
|
4936
|
+
user: args.signer,
|
|
4937
|
+
assetAccessController: args.assetAccessController,
|
|
4938
|
+
authorizedUserRole: args.authorizedUserRole || null,
|
|
4939
|
+
lutAddress: args.lutAddress,
|
|
4940
|
+
})
|
|
4941
|
+
.instruction();
|
|
4942
|
+
});
|
|
4943
|
+
}
|
|
5221
4944
|
}
|
|
5222
4945
|
|
|
5223
4946
|
/**
|