@reflectmoney/stable.ts 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/dist/index.js +1 -0
  2. package/package.json +1 -1
  3. package/dist/classes/PdaClient.d.ts +0 -131
  4. package/dist/classes/Reflect.d.ts +0 -7
  5. package/dist/classes/ReflectAdmin.d.ts +0 -104
  6. package/dist/classes/ReflectAdmin.js +0 -219
  7. package/dist/classes/ReflectKeeper.d.ts +0 -107
  8. package/dist/classes/ReflectTokenisedBond.d.ts +0 -75
  9. package/dist/classes/Stablecoin.d.ts +0 -187
  10. package/dist/classes/index.d.ts +0 -4
  11. package/dist/constants/drift.d.ts +0 -6
  12. package/dist/constants/index.d.ts +0 -7
  13. package/dist/constants/jupiter.d.ts +0 -4
  14. package/dist/constants/lookupTables.d.ts +0 -4
  15. package/dist/constants/lst.d.ts +0 -3
  16. package/dist/constants/pyth.d.ts +0 -1
  17. package/dist/constants/usdc.d.ts +0 -6
  18. package/dist/constants/wsol.d.ts +0 -6
  19. package/dist/errors/ReflectError.d.ts +0 -4
  20. package/dist/generated/reflect_main/accounts/DriftJlpController.d.ts +0 -116
  21. package/dist/generated/reflect_main/accounts/DriftLstController.d.ts +0 -110
  22. package/dist/generated/reflect_main/accounts/DriftUsdcController.d.ts +0 -136
  23. package/dist/generated/reflect_main/accounts/Main.d.ts +0 -112
  24. package/dist/generated/reflect_main/accounts/PerpMarket.d.ts +0 -228
  25. package/dist/generated/reflect_main/accounts/PrelaunchOracle.d.ts +0 -132
  26. package/dist/generated/reflect_main/accounts/PythLazerOracle.d.ts +0 -126
  27. package/dist/generated/reflect_main/accounts/RebalanceLst.d.ts +0 -113
  28. package/dist/generated/reflect_main/accounts/SpotMarket.d.ts +0 -379
  29. package/dist/generated/reflect_main/accounts/User.d.ts +0 -223
  30. package/dist/generated/reflect_main/accounts/UserPermissions.d.ts +0 -108
  31. package/dist/generated/reflect_main/accounts/UserStats.d.ts +0 -213
  32. package/dist/generated/reflect_main/accounts/index.d.ts +0 -38
  33. package/dist/generated/reflect_main/errors/index.d.ts +0 -969
  34. package/dist/generated/reflect_main/index.d.ts +0 -19
  35. package/dist/generated/reflect_main/instructions/addLstDrift.d.ts +0 -49
  36. package/dist/generated/reflect_main/instructions/addSubAccount.d.ts +0 -54
  37. package/dist/generated/reflect_main/instructions/captureSpreadDrift.d.ts +0 -66
  38. package/dist/generated/reflect_main/instructions/captureSpreadDriftS1.d.ts +0 -58
  39. package/dist/generated/reflect_main/instructions/createAdminAccount.d.ts +0 -51
  40. package/dist/generated/reflect_main/instructions/createUserStatsAccount.d.ts +0 -52
  41. package/dist/generated/reflect_main/instructions/depositDrift.d.ts +0 -73
  42. package/dist/generated/reflect_main/instructions/freezeProgram.d.ts +0 -54
  43. package/dist/generated/reflect_main/instructions/freezeProtocolAction.d.ts +0 -55
  44. package/dist/generated/reflect_main/instructions/freezeStrategyAction.d.ts +0 -58
  45. package/dist/generated/reflect_main/instructions/index.d.ts +0 -34
  46. package/dist/generated/reflect_main/instructions/initDriftAccountsS1.d.ts +0 -54
  47. package/dist/generated/reflect_main/instructions/initDriftControllerS1.d.ts +0 -60
  48. package/dist/generated/reflect_main/instructions/initDriftControllerS3.d.ts +0 -58
  49. package/dist/generated/reflect_main/instructions/initMain.d.ts +0 -43
  50. package/dist/generated/reflect_main/instructions/mintDriftS1.d.ts +0 -86
  51. package/dist/generated/reflect_main/instructions/mintDriftS3.d.ts +0 -86
  52. package/dist/generated/reflect_main/instructions/processSwapDeposit.d.ts +0 -69
  53. package/dist/generated/reflect_main/instructions/processSwapWithdraw.d.ts +0 -69
  54. package/dist/generated/reflect_main/instructions/redeemDriftS1.d.ts +0 -87
  55. package/dist/generated/reflect_main/instructions/redeemDriftS3.d.ts +0 -87
  56. package/dist/generated/reflect_main/instructions/settlePnl.d.ts +0 -55
  57. package/dist/generated/reflect_main/instructions/settlePnlMulti.d.ts +0 -65
  58. package/dist/generated/reflect_main/instructions/suspendSplProtocol.d.ts +0 -54
  59. package/dist/generated/reflect_main/instructions/suspendSplStrategy.d.ts +0 -56
  60. package/dist/generated/reflect_main/instructions/swapOrca.d.ts +0 -81
  61. package/dist/generated/reflect_main/instructions/swapOrcaTwoHop.d.ts +0 -101
  62. package/dist/generated/reflect_main/instructions/updateActionRoleProtocol.d.ts +0 -58
  63. package/dist/generated/reflect_main/instructions/updateActionRoleStrategy.d.ts +0 -60
  64. package/dist/generated/reflect_main/instructions/updateAttenuation.d.ts +0 -57
  65. package/dist/generated/reflect_main/instructions/updateCap.d.ts +0 -55
  66. package/dist/generated/reflect_main/instructions/updateRebalanceSlippage.d.ts +0 -55
  67. package/dist/generated/reflect_main/instructions/updateRecipients.d.ts +0 -56
  68. package/dist/generated/reflect_main/instructions/updateRoleHolderProtocol.d.ts +0 -60
  69. package/dist/generated/reflect_main/instructions/updateRoleHolderStrategy.d.ts +0 -60
  70. package/dist/generated/reflect_main/types/AMM.d.ts +0 -102
  71. package/dist/generated/reflect_main/types/AccKey.d.ts +0 -15
  72. package/dist/generated/reflect_main/types/AccessControl.d.ts +0 -18
  73. package/dist/generated/reflect_main/types/AccessMap.d.ts +0 -17
  74. package/dist/generated/reflect_main/types/Action.d.ts +0 -35
  75. package/dist/generated/reflect_main/types/ActionMapping.d.ts +0 -19
  76. package/dist/generated/reflect_main/types/AssetTier.d.ts +0 -23
  77. package/dist/generated/reflect_main/types/Attenuation.d.ts +0 -16
  78. package/dist/generated/reflect_main/types/BalanceType.d.ts +0 -20
  79. package/dist/generated/reflect_main/types/Capture.d.ts +0 -17
  80. package/dist/generated/reflect_main/types/ContractTier.d.ts +0 -24
  81. package/dist/generated/reflect_main/types/ContractType.d.ts +0 -20
  82. package/dist/generated/reflect_main/types/CorpAction.d.ts +0 -19
  83. package/dist/generated/reflect_main/types/CustodyInfo.d.ts +0 -20
  84. package/dist/generated/reflect_main/types/DirectionCollateral.d.ts +0 -20
  85. package/dist/generated/reflect_main/types/DirectionPosition.d.ts +0 -20
  86. package/dist/generated/reflect_main/types/DriftControllerBase.d.ts +0 -15
  87. package/dist/generated/reflect_main/types/DriftJlpControllerFixedAccounts.d.ts +0 -18
  88. package/dist/generated/reflect_main/types/DriftLstData.d.ts +0 -17
  89. package/dist/generated/reflect_main/types/Ema.d.ts +0 -17
  90. package/dist/generated/reflect_main/types/Externals.d.ts +0 -16
  91. package/dist/generated/reflect_main/types/FlowControl.d.ts +0 -17
  92. package/dist/generated/reflect_main/types/HistoricalIndexData.d.ts +0 -19
  93. package/dist/generated/reflect_main/types/HistoricalOracleData.d.ts +0 -20
  94. package/dist/generated/reflect_main/types/Holding.d.ts +0 -21
  95. package/dist/generated/reflect_main/types/Holdings.d.ts +0 -17
  96. package/dist/generated/reflect_main/types/InsuranceClaim.d.ts +0 -19
  97. package/dist/generated/reflect_main/types/InsuranceFund.d.ts +0 -24
  98. package/dist/generated/reflect_main/types/JlpRebalanceSettings.d.ts +0 -15
  99. package/dist/generated/reflect_main/types/KillSwitch.d.ts +0 -15
  100. package/dist/generated/reflect_main/types/LevelRoles.d.ts +0 -16
  101. package/dist/generated/reflect_main/types/MarketStatus.d.ts +0 -27
  102. package/dist/generated/reflect_main/types/MarketType.d.ts +0 -20
  103. package/dist/generated/reflect_main/types/ModifyOrderParams.d.ts +0 -32
  104. package/dist/generated/reflect_main/types/ModifyOrderPolicy.d.ts +0 -20
  105. package/dist/generated/reflect_main/types/Movements.d.ts +0 -19
  106. package/dist/generated/reflect_main/types/OracleGuardRails.d.ts +0 -18
  107. package/dist/generated/reflect_main/types/OracleSource.d.ts +0 -34
  108. package/dist/generated/reflect_main/types/OracleValidity.d.ts +0 -25
  109. package/dist/generated/reflect_main/types/Order.d.ts +0 -43
  110. package/dist/generated/reflect_main/types/OrderDirection.d.ts +0 -20
  111. package/dist/generated/reflect_main/types/OrderParams.d.ts +0 -36
  112. package/dist/generated/reflect_main/types/OrderStatus.d.ts +0 -22
  113. package/dist/generated/reflect_main/types/OrderTriggerCondition.d.ts +0 -22
  114. package/dist/generated/reflect_main/types/OrderType.d.ts +0 -23
  115. package/dist/generated/reflect_main/types/PermissionLevel.d.ts +0 -51
  116. package/dist/generated/reflect_main/types/PerpHedge.d.ts +0 -17
  117. package/dist/generated/reflect_main/types/PerpPosition.d.ts +0 -29
  118. package/dist/generated/reflect_main/types/PoolBalance.d.ts +0 -17
  119. package/dist/generated/reflect_main/types/Position.d.ts +0 -20
  120. package/dist/generated/reflect_main/types/PositionDirection.d.ts +0 -20
  121. package/dist/generated/reflect_main/types/PositionDrift.d.ts +0 -18
  122. package/dist/generated/reflect_main/types/PostOnlyParam.d.ts +0 -22
  123. package/dist/generated/reflect_main/types/Price.d.ts +0 -41
  124. package/dist/generated/reflect_main/types/PriceComp.d.ts +0 -19
  125. package/dist/generated/reflect_main/types/PriceDivergenceGuardRails.d.ts +0 -16
  126. package/dist/generated/reflect_main/types/PriceInfo.d.ts +0 -21
  127. package/dist/generated/reflect_main/types/PriceStatus.d.ts +0 -22
  128. package/dist/generated/reflect_main/types/PriceType.d.ts +0 -20
  129. package/dist/generated/reflect_main/types/Program.d.ts +0 -19
  130. package/dist/generated/reflect_main/types/ProgramStatus.d.ts +0 -20
  131. package/dist/generated/reflect_main/types/Recipient.d.ts +0 -17
  132. package/dist/generated/reflect_main/types/Recipients.d.ts +0 -17
  133. package/dist/generated/reflect_main/types/Role.d.ts +0 -25
  134. package/dist/generated/reflect_main/types/ShiftCollateral.d.ts +0 -19
  135. package/dist/generated/reflect_main/types/ShiftPosition.d.ts +0 -17
  136. package/dist/generated/reflect_main/types/ShortHolding.d.ts +0 -17
  137. package/dist/generated/reflect_main/types/SplBase.d.ts +0 -17
  138. package/dist/generated/reflect_main/types/SplMain.d.ts +0 -22
  139. package/dist/generated/reflect_main/types/Spls.d.ts +0 -17
  140. package/dist/generated/reflect_main/types/SpotBalanceType.d.ts +0 -20
  141. package/dist/generated/reflect_main/types/SpotPosition.d.ts +0 -23
  142. package/dist/generated/reflect_main/types/Status.d.ts +0 -21
  143. package/dist/generated/reflect_main/types/Strategy.d.ts +0 -32
  144. package/dist/generated/reflect_main/types/StrategyPadding.d.ts +0 -15
  145. package/dist/generated/reflect_main/types/StrategyRoleEntry.d.ts +0 -17
  146. package/dist/generated/reflect_main/types/SubAccount.d.ts +0 -17
  147. package/dist/generated/reflect_main/types/Update.d.ts +0 -20
  148. package/dist/generated/reflect_main/types/UserFees.d.ts +0 -20
  149. package/dist/generated/reflect_main/types/ValidityGuardRails.d.ts +0 -18
  150. package/dist/generated/reflect_main/types/index.d.ts +0 -80
  151. package/dist/generated/reflect_tokenised_bonds/accounts/Admin.d.ts +0 -101
  152. package/dist/generated/reflect_tokenised_bonds/accounts/Config.d.ts +0 -108
  153. package/dist/generated/reflect_tokenised_bonds/accounts/Vault.d.ts +0 -116
  154. package/dist/generated/reflect_tokenised_bonds/accounts/index.d.ts +0 -11
  155. package/dist/generated/reflect_tokenised_bonds/errors/index.d.ts +0 -144
  156. package/dist/generated/reflect_tokenised_bonds/index.d.ts +0 -19
  157. package/dist/generated/reflect_tokenised_bonds/instructions/createVault.d.ts +0 -50
  158. package/dist/generated/reflect_tokenised_bonds/instructions/deposit.d.ts +0 -62
  159. package/dist/generated/reflect_tokenised_bonds/instructions/index.d.ts +0 -4
  160. package/dist/generated/reflect_tokenised_bonds/instructions/initialize.d.ts +0 -43
  161. package/dist/generated/reflect_tokenised_bonds/instructions/withdraw.d.ts +0 -62
  162. package/dist/generated/reflect_tokenised_bonds/types/DepositArgs.d.ts +0 -17
  163. package/dist/generated/reflect_tokenised_bonds/types/Permissions.d.ts +0 -21
  164. package/dist/generated/reflect_tokenised_bonds/types/WithdrawArgs.d.ts +0 -16
  165. package/dist/generated/reflect_tokenised_bonds/types/index.d.ts +0 -3
  166. package/dist/helpers/getOrcaQuote.d.ts +0 -3
  167. package/dist/idl/perpetuals.d.ts +0 -5771
  168. package/dist/index.d.ts +0 -8
  169. package/dist/stablecoins/JlpStablecoin.d.ts +0 -1
  170. package/dist/stablecoins/JlpStablecoin.js +0 -44
  171. package/dist/stablecoins/LstStablecoin.d.ts +0 -65
  172. package/dist/stablecoins/UsdcPlusStablecoin.d.ts +0 -68
  173. package/dist/stablecoins/UsdcStablecoin.d.ts +0 -64
  174. package/dist/stablecoins/UsdcStablecoin.js +0 -145
  175. package/dist/stablecoins/UsdjStablecoin.d.ts +0 -1
  176. package/dist/stablecoins/index.d.ts +0 -3
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.TOKENISED_BONDS_PROGRAM_ID = exports.DELTA_NEUTRAL_PROGRAM_ID = void 0;
18
18
  __exportStar(require("./stablecoins"), exports);
19
19
  __exportStar(require("./classes"), exports);
20
+ __exportStar(require("./types"), exports);
20
21
  var reflect_main_1 = require("./generated/reflect_main");
21
22
  Object.defineProperty(exports, "DELTA_NEUTRAL_PROGRAM_ID", { enumerable: true, get: function () { return reflect_main_1.PROGRAM_ID; } });
22
23
  var reflect_tokenised_bonds_1 = require("./generated/reflect_tokenised_bonds");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reflectmoney/stable.ts",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "type": "commonjs",
5
5
  "author": "stablecoinjesus @ Palindrome Engineering",
6
6
  "repository": {
@@ -1,131 +0,0 @@
1
- import { PublicKey } from "@solana/web3.js";
2
- /**
3
- * Utility class for deriving Program Derived Addresses (PDAs) used throughout the Reflect protocol.
4
- * Provides static methods to generate deterministic addresses for various program accounts
5
- * including main program accounts, controllers, permissions, and external protocol integrations.
6
- */
7
- export declare class PdaClient {
8
- /**
9
- * Derives the main program account address.
10
- * This is the primary account that stores global protocol state.
11
- *
12
- * @returns PublicKey of the main program account
13
- */
14
- static deriveMain(): PublicKey;
15
- /**
16
- * Derives the permissions account address for a specific user.
17
- * This account stores the user's role-based permissions within the protocol.
18
- *
19
- * @param user - Public key of the user
20
- * @returns PublicKey of the user's permissions account
21
- */
22
- static derivePermissions(user: PublicKey): PublicKey;
23
- /**
24
- * Derives the controller account address for a specific strategy.
25
- * Each stablecoin strategy has its own controller account.
26
- *
27
- * @param strategy - Strategy index (0: USDC+, 1: JLP, 2: LST)
28
- * @returns PublicKey of the strategy controller account
29
- */
30
- static deriveController(strategy: number): PublicKey;
31
- /**
32
- * Derives the controller account address with bump seed for a specific strategy.
33
- * Returns both the public key and the bump seed.
34
- *
35
- * @param strategy - Strategy index (0: USDC+, 1: JLP, 2: LST)
36
- * @returns Array containing [PublicKey, number] where number is the bump seed
37
- */
38
- static deriveControllerWithBump(strategy: number): [PublicKey, number];
39
- /**
40
- * Derives the rebalance details account address for a specific strategy.
41
- * This account stores information about rebalancing operations.
42
- *
43
- * @param strategy - Strategy index (0: USDC+, 1: JLP, 2: LST)
44
- * @returns PublicKey of the rebalance details account
45
- */
46
- static deriveRebalanceDetails(strategy: number): PublicKey;
47
- /**
48
- * Derives the Jupiter Perpetuals program account address.
49
- * Used for integration with Jupiter's perpetuals protocol.
50
- *
51
- * @returns PublicKey of the Jupiter Perpetuals account
52
- */
53
- static deriveJupiterPerpetuals(): PublicKey;
54
- /**
55
- * Derives the Jupiter LP pool account address.
56
- * Used for JLP (Jupiter LP) token operations.
57
- *
58
- * @returns PublicKey of the JLP pool account
59
- */
60
- static deriveJlpPool(): PublicKey;
61
- /**
62
- * Derives the Jupiter event authority account address.
63
- * Used for event emission in Jupiter protocol interactions.
64
- *
65
- * @returns PublicKey of the Jupiter event authority account
66
- */
67
- static deriveEventAuthority(): PublicKey;
68
- /**
69
- * Derives the Jupiter transfer authority account address.
70
- * Used for token transfer operations in Jupiter protocol.
71
- *
72
- * @returns PublicKey of the Jupiter transfer authority account
73
- */
74
- static deriveTransferAuthority(): PublicKey;
75
- /**
76
- * Gets the Drift vault address for a specific mint.
77
- * Looks up the market index for the mint and derives the corresponding vault address.
78
- *
79
- * @param mint - Public key of the token mint
80
- * @returns Promise resolving to the PublicKey of the Drift vault account
81
- */
82
- static getDriftVaultFromMint(mint: PublicKey): Promise<PublicKey>;
83
- /**
84
- * Derives the token metadata account address for a mint.
85
- * Used for storing token metadata information.
86
- *
87
- * @param mint - Public key of the token mint
88
- * @returns PublicKey of the metadata account
89
- */
90
- static deriveMetadataAccount(mint: PublicKey): PublicKey;
91
- /**
92
- * Derives the custody account address for a pool and token combination.
93
- * Used in Jupiter protocol for token custody management.
94
- *
95
- * @param pool - Public key of the pool
96
- * @param token - Public key of the token
97
- * @returns PublicKey of the custody account
98
- */
99
- static deriveCustody(pool: PublicKey, token: PublicKey): PublicKey;
100
- /**
101
- * Derives the LP config account address.
102
- * Used for tokenized bonds program configuration.
103
- *
104
- * @returns PublicKey of the LP config account
105
- */
106
- static deriveLpConfig(): PublicKey;
107
- /**
108
- * Derives the LP admin account address for a specific admin.
109
- * Used for tokenized bonds program administration.
110
- *
111
- * @param admin - Public key of the admin
112
- * @returns PublicKey of the LP admin account
113
- */
114
- static deriveLpAdmin(admin: PublicKey): PublicKey;
115
- /**
116
- * Derives the LP vault account address for a specific vault ID.
117
- * Used for tokenized bonds vault management.
118
- *
119
- * @param vaultId - Numeric identifier for the vault
120
- * @returns PublicKey of the LP vault account
121
- */
122
- static deriveLpVault(vaultId: number): PublicKey;
123
- /**
124
- * Derives the LP vault pool account address for a specific vault ID.
125
- * Used for tokenized bonds vault pool management.
126
- *
127
- * @param vaultId - Numeric identifier for the vault
128
- * @returns PublicKey of the LP vault pool account
129
- */
130
- static deriveLpVaultPool(vaultId: number): PublicKey;
131
- }
@@ -1,7 +0,0 @@
1
- import { Connection } from "@solana/web3.js";
2
- import { Main } from "../generated/reflect_main";
3
- export declare class Reflect {
4
- connection: Connection;
5
- constructor(connection: Connection);
6
- fetchMain(): Promise<Main>;
7
- }
@@ -1,104 +0,0 @@
1
- import { Connection, PublicKey } from "@solana/web3.js";
2
- import { Action, Role, Update } from "../generated/reflect_main";
3
- /**
4
- * Administrative client for the Reflect protocol.
5
- * Provides functionality for protocol-level administration including:
6
- * - Protocol initialization and setup
7
- * - Role and permission management
8
- * - Action freezing/unfreezing
9
- * - Admin account creation and management
10
- *
11
- * This class is used by protocol administrators to manage global settings,
12
- * user permissions, and protocol-wide configurations.
13
- */
14
- export declare class ReflectAdmin {
15
- /** Public key of the admin user */
16
- private admin;
17
- /** Public key of the main program account */
18
- private main;
19
- /** Solana connection instance for RPC communication */
20
- private connection;
21
- /**
22
- * Creates a new ReflectAdmin instance.
23
- *
24
- * @param admin - Public key of the admin user
25
- * @param connection - Solana connection instance
26
- */
27
- constructor({ admin, connection }: {
28
- admin: PublicKey;
29
- connection: Connection;
30
- });
31
- /**
32
- * Creates the main program account. This is the initial step of protocol setup.
33
- *
34
- * @param admin - Public key of the initial admin
35
- * @returns TransactionInstruction for initializing the main account
36
- */
37
- static initializeMain(admin: PublicKey): import("@solana/web3.js").TransactionInstruction;
38
- /**
39
- * Freezes or unfreezes a specific protocol action.
40
- *
41
- * @param freeze - Whether to freeze (true) or unfreeze (false) the action
42
- * @param action - The action to freeze/unfreeze
43
- * @returns Promise resolving to a TransactionInstruction
44
- */
45
- freezeProtocolAction(freeze: boolean, action: Action): Promise<import("@solana/web3.js").TransactionInstruction>;
46
- /**
47
- * Freezes or unfreezes a specific DEX program.
48
- *
49
- * @param freeze - Whether to freeze (true) or unfreeze (false) the program
50
- * @param programIndex - Index of the program to freeze/unfreeze
51
- * @returns Promise resolving to a TransactionInstruction
52
- */
53
- freezeDex(freeze: boolean, programIndex: number): Promise<import("@solana/web3.js").TransactionInstruction>;
54
- /**
55
- * Creates a new admin account with specified permissions.
56
- *
57
- * @param signer - Public key of the caller (must be existing admin)
58
- * @param newAdmin - Public key of the new admin to create
59
- * @returns Promise resolving to a TransactionInstruction
60
- */
61
- createAdminAccount(signer: PublicKey, newAdmin: PublicKey): Promise<import("@solana/web3.js").TransactionInstruction>;
62
- /**
63
- * Updates role holder permissions at the protocol level.
64
- *
65
- * @param signer - Public key of the admin signer
66
- * @param adminToUpdate - Public key of the admin whose permissions are being updated
67
- * @param affectedRole - The role being modified
68
- * @param update - The type of update (Grant or Revoke)
69
- * @returns Promise resolving to a TransactionInstruction
70
- */
71
- updateRoleHolderProtocol(signer: PublicKey, adminToUpdate: PublicKey, affectedRole: Role, update: Update): Promise<import("@solana/web3.js").TransactionInstruction>;
72
- /**
73
- * Updates role holder permissions for a specific strategy.
74
- *
75
- * @param signer - Public key of the admin signer
76
- * @param strategyId - ID of the strategy to update permissions for
77
- * @param adminToUpdate - Public key of the admin whose permissions are being updated
78
- * @param affectedRole - The role being modified
79
- * @param update - The type of update (Grant or Revoke)
80
- * @returns Promise resolving to a TransactionInstruction
81
- */
82
- updateRoleHolderStrategy(signer: PublicKey, strategyId: number, adminToUpdate: PublicKey, affectedRole: Role, update: Update): Promise<import("@solana/web3.js").TransactionInstruction>;
83
- /**
84
- * Updates action role permissions for a specific strategy.
85
- *
86
- * @param signer - Public key of the admin signer
87
- * @param strategyId - ID of the strategy to update permissions for
88
- * @param action - The action being modified
89
- * @param affectedRole - The role being modified
90
- * @param update - The type of update (Grant or Revoke)
91
- * @returns Promise resolving to a TransactionInstruction
92
- */
93
- updateActionRoleStrategy(signer: PublicKey, strategyId: number, action: Action, affectedRole: Role, update: Update): Promise<import("@solana/web3.js").TransactionInstruction>;
94
- /**
95
- * Updates action role permissions at the protocol level.
96
- *
97
- * @param signer - Public key of the admin signer
98
- * @param action - The action being modified
99
- * @param affectedRole - The role being modified
100
- * @param update - The type of update (Grant or Revoke)
101
- * @returns Promise resolving to a TransactionInstruction
102
- */
103
- updateActionRoleProtocol(signer: PublicKey, action: Action, affectedRole: Role, update: Update): Promise<import("@solana/web3.js").TransactionInstruction>;
104
- }
@@ -1,219 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ReflectAdmin = void 0;
13
- const web3_js_1 = require("@solana/web3.js");
14
- const reflect_main_1 = require("../generated/reflect_main");
15
- const PdaClient_1 = require("./PdaClient");
16
- /**
17
- * Administrative client for the Reflect protocol.
18
- * Provides functionality for protocol-level administration including:
19
- * - Protocol initialization and setup
20
- * - Role and permission management
21
- * - Action freezing/unfreezing
22
- * - Admin account creation and management
23
- *
24
- * This class is used by protocol administrators to manage global settings,
25
- * user permissions, and protocol-wide configurations.
26
- */
27
- class ReflectAdmin {
28
- /**
29
- * Creates a new ReflectAdmin instance.
30
- *
31
- * @param admin - Public key of the admin user
32
- * @param connection - Solana connection instance
33
- */
34
- constructor({ admin, connection }) {
35
- this.admin = admin;
36
- this.connection = connection;
37
- this.main = PdaClient_1.PdaClient.deriveMain();
38
- }
39
- /**
40
- * Creates the main program account. This is the initial step of protocol setup.
41
- *
42
- * @param admin - Public key of the initial admin
43
- * @returns TransactionInstruction for initializing the main account
44
- */
45
- static initializeMain(admin) {
46
- const [main] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("main")], reflect_main_1.PROGRAM_ID);
47
- const ix = (0, reflect_main_1.createInitMainInstruction)({
48
- main,
49
- admin,
50
- systemProgram: web3_js_1.SystemProgram.programId,
51
- creds: PdaClient_1.PdaClient.derivePermissions(admin)
52
- }, reflect_main_1.PROGRAM_ID);
53
- return ix;
54
- }
55
- /**
56
- * Freezes or unfreezes a specific protocol action.
57
- *
58
- * @param freeze - Whether to freeze (true) or unfreeze (false) the action
59
- * @param action - The action to freeze/unfreeze
60
- * @returns Promise resolving to a TransactionInstruction
61
- */
62
- freezeProtocolAction(freeze, action) {
63
- return __awaiter(this, void 0, void 0, function* () {
64
- const ix = (0, reflect_main_1.createFreezeProtocolActionInstruction)({
65
- admin: this.admin,
66
- main: this.main,
67
- systemProgram: web3_js_1.SystemProgram.programId,
68
- adminPermissions: PdaClient_1.PdaClient.derivePermissions(this.admin),
69
- }, {
70
- freeze,
71
- action
72
- });
73
- return ix;
74
- });
75
- }
76
- /**
77
- * Freezes or unfreezes a specific DEX program.
78
- *
79
- * @param freeze - Whether to freeze (true) or unfreeze (false) the program
80
- * @param programIndex - Index of the program to freeze/unfreeze
81
- * @returns Promise resolving to a TransactionInstruction
82
- */
83
- freezeDex(freeze, programIndex) {
84
- return __awaiter(this, void 0, void 0, function* () {
85
- const ix = (0, reflect_main_1.createFreezeProgramInstruction)({
86
- admin: this.admin,
87
- main: this.main,
88
- systemProgram: web3_js_1.SystemProgram.programId,
89
- adminPermissions: PdaClient_1.PdaClient.derivePermissions(this.admin),
90
- }, {
91
- freeze,
92
- programIndex
93
- });
94
- return ix;
95
- });
96
- }
97
- /**
98
- * Creates a new admin account with specified permissions.
99
- *
100
- * @param signer - Public key of the caller (must be existing admin)
101
- * @param newAdmin - Public key of the new admin to create
102
- * @returns Promise resolving to a TransactionInstruction
103
- */
104
- createAdminAccount(signer, newAdmin) {
105
- return __awaiter(this, void 0, void 0, function* () {
106
- const ix = (0, reflect_main_1.createCreateAdminAccountInstruction)({
107
- caller: signer,
108
- newCreds: PdaClient_1.PdaClient.derivePermissions(newAdmin),
109
- systemProgram: web3_js_1.SystemProgram.programId,
110
- }, {
111
- newAdmin
112
- }, reflect_main_1.PROGRAM_ID);
113
- return ix;
114
- });
115
- }
116
- /**
117
- * Updates role holder permissions at the protocol level.
118
- *
119
- * @param signer - Public key of the admin signer
120
- * @param adminToUpdate - Public key of the admin whose permissions are being updated
121
- * @param affectedRole - The role being modified
122
- * @param update - The type of update (Grant or Revoke)
123
- * @returns Promise resolving to a TransactionInstruction
124
- */
125
- updateRoleHolderProtocol(signer, adminToUpdate, affectedRole, update) {
126
- return __awaiter(this, void 0, void 0, function* () {
127
- const ix = (0, reflect_main_1.createUpdateRoleHolderProtocolInstruction)({
128
- admin: signer,
129
- adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer),
130
- main: PdaClient_1.PdaClient.deriveMain(),
131
- systemProgram: web3_js_1.SystemProgram.programId,
132
- updateAdminPermissions: PdaClient_1.PdaClient.derivePermissions(adminToUpdate),
133
- // Dummy strategy account.
134
- strategy: PdaClient_1.PdaClient.deriveController(0)
135
- }, {
136
- update,
137
- accessLevel: affectedRole,
138
- }, reflect_main_1.PROGRAM_ID);
139
- return ix;
140
- });
141
- }
142
- /**
143
- * Updates role holder permissions for a specific strategy.
144
- *
145
- * @param signer - Public key of the admin signer
146
- * @param strategyId - ID of the strategy to update permissions for
147
- * @param adminToUpdate - Public key of the admin whose permissions are being updated
148
- * @param affectedRole - The role being modified
149
- * @param update - The type of update (Grant or Revoke)
150
- * @returns Promise resolving to a TransactionInstruction
151
- */
152
- updateRoleHolderStrategy(signer, strategyId, adminToUpdate, affectedRole, update) {
153
- return __awaiter(this, void 0, void 0, function* () {
154
- const ix = (0, reflect_main_1.createUpdateRoleHolderStrategyInstruction)({
155
- admin: signer,
156
- adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer),
157
- main: PdaClient_1.PdaClient.deriveMain(),
158
- systemProgram: web3_js_1.SystemProgram.programId,
159
- updateAdminPermissions: PdaClient_1.PdaClient.derivePermissions(adminToUpdate),
160
- strategy: PdaClient_1.PdaClient.deriveController(strategyId)
161
- }, {
162
- update,
163
- role: affectedRole,
164
- }, reflect_main_1.PROGRAM_ID);
165
- return ix;
166
- });
167
- }
168
- /**
169
- * Updates action role permissions for a specific strategy.
170
- *
171
- * @param signer - Public key of the admin signer
172
- * @param strategyId - ID of the strategy to update permissions for
173
- * @param action - The action being modified
174
- * @param affectedRole - The role being modified
175
- * @param update - The type of update (Grant or Revoke)
176
- * @returns Promise resolving to a TransactionInstruction
177
- */
178
- updateActionRoleStrategy(signer, strategyId, action, affectedRole, update) {
179
- return __awaiter(this, void 0, void 0, function* () {
180
- const ix = (0, reflect_main_1.createUpdateActionRoleStrategyInstruction)({
181
- admin: signer,
182
- adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer),
183
- main: PdaClient_1.PdaClient.deriveMain(),
184
- systemProgram: web3_js_1.SystemProgram.programId,
185
- strategy: PdaClient_1.PdaClient.deriveController(strategyId)
186
- }, {
187
- update,
188
- role: affectedRole,
189
- action
190
- }, reflect_main_1.PROGRAM_ID);
191
- return ix;
192
- });
193
- }
194
- /**
195
- * Updates action role permissions at the protocol level.
196
- *
197
- * @param signer - Public key of the admin signer
198
- * @param action - The action being modified
199
- * @param affectedRole - The role being modified
200
- * @param update - The type of update (Grant or Revoke)
201
- * @returns Promise resolving to a TransactionInstruction
202
- */
203
- updateActionRoleProtocol(signer, action, affectedRole, update) {
204
- return __awaiter(this, void 0, void 0, function* () {
205
- const ix = (0, reflect_main_1.createUpdateActionRoleProtocolInstruction)({
206
- admin: signer,
207
- adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer),
208
- main: PdaClient_1.PdaClient.deriveMain(),
209
- systemProgram: web3_js_1.SystemProgram.programId,
210
- }, {
211
- action,
212
- role: affectedRole,
213
- update
214
- }, reflect_main_1.PROGRAM_ID);
215
- return ix;
216
- });
217
- }
218
- }
219
- exports.ReflectAdmin = ReflectAdmin;
@@ -1,107 +0,0 @@
1
- /// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
2
- /// <reference types="jito-ts/node_modules/@solana/web3.js" />
3
- import { Connection, PublicKey } from "@solana/web3.js";
4
- import { Action, Role, Update, UserPermissions } from "../generated/reflect_main";
5
- /**
6
- * Administrative client for the Reflect protocol.
7
- * Provides functionality for protocol-level administration including:
8
- * - Protocol initialization and setup
9
- * - Role and permission management
10
- * - Action freezing/unfreezing
11
- * - Admin account creation and management
12
- *
13
- * This class is used by protocol administrators to manage global settings,
14
- * user permissions, and protocol-wide configurations.
15
- */
16
- export declare class ReflectKeeper {
17
- /** Public key of the admin user */
18
- private admin;
19
- /** Public key of the main program account */
20
- private main;
21
- /** Solana connection instance for RPC communication */
22
- private connection;
23
- /**
24
- * Creates a new ReflectKeeper instance.
25
- *
26
- * @param admin - Public key of the admin user
27
- * @param connection - Solana connection instance
28
- */
29
- constructor({ admin, connection }: {
30
- admin: PublicKey;
31
- connection: Connection;
32
- });
33
- /**
34
- * Creates the main program account. This is the initial step of protocol setup.
35
- *
36
- * @param admin - Public key of the initial admin
37
- * @returns TransactionInstruction for initializing the main account
38
- */
39
- static initializeMain(admin: PublicKey): import("@solana/web3.js").TransactionInstruction;
40
- getPermissionAccount(): Promise<UserPermissions>;
41
- /**
42
- * Freezes or unfreezes a specific protocol action.
43
- *
44
- * @param freeze - Whether to freeze (true) or unfreeze (false) the action
45
- * @param action - The action to freeze/unfreeze
46
- * @returns Promise resolving to a TransactionInstruction
47
- */
48
- freezeProtocolAction(freeze: boolean, action: Action): Promise<import("@solana/web3.js").TransactionInstruction>;
49
- /**
50
- * Freezes or unfreezes a specific DEX program.
51
- *
52
- * @param freeze - Whether to freeze (true) or unfreeze (false) the program
53
- * @param programIndex - Index of the program to freeze/unfreeze
54
- * @returns Promise resolving to a TransactionInstruction
55
- */
56
- freezeDex(freeze: boolean, programIndex: number): Promise<import("@solana/web3.js").TransactionInstruction>;
57
- /**
58
- * Creates a new admin account with specified permissions.
59
- *
60
- * @param signer - Public key of the caller (must be existing admin)
61
- * @param newAdmin - Public key of the new admin to create
62
- * @returns Promise resolving to a TransactionInstruction
63
- */
64
- createAdminAccount(signer: PublicKey, newAdmin: PublicKey): Promise<import("@solana/web3.js").TransactionInstruction>;
65
- /**
66
- * Updates role holder permissions at the protocol level.
67
- *
68
- * @param signer - Public key of the admin signer
69
- * @param adminToUpdate - Public key of the admin whose permissions are being updated
70
- * @param affectedRole - The role being modified
71
- * @param update - The type of update (Grant or Revoke)
72
- * @returns Promise resolving to a TransactionInstruction
73
- */
74
- updateRoleHolderProtocol(signer: PublicKey, adminToUpdate: PublicKey, affectedRole: Role, update: Update): Promise<import("@solana/web3.js").TransactionInstruction>;
75
- /**
76
- * Updates role holder permissions for a specific strategy.
77
- *
78
- * @param signer - Public key of the admin signer
79
- * @param strategyId - ID of the strategy to update permissions for
80
- * @param adminToUpdate - Public key of the admin whose permissions are being updated
81
- * @param affectedRole - The role being modified
82
- * @param update - The type of update (Grant or Revoke)
83
- * @returns Promise resolving to a TransactionInstruction
84
- */
85
- updateRoleHolderStrategy(signer: PublicKey, strategyId: number, adminToUpdate: PublicKey, affectedRole: Role, update: Update): Promise<import("@solana/web3.js").TransactionInstruction>;
86
- /**
87
- * Updates action role permissions for a specific strategy.
88
- *
89
- * @param signer - Public key of the admin signer
90
- * @param strategyId - ID of the strategy to update permissions for
91
- * @param action - The action being modified
92
- * @param affectedRole - The role being modified
93
- * @param update - The type of update (Grant or Revoke)
94
- * @returns Promise resolving to a TransactionInstruction
95
- */
96
- updateActionRoleStrategy(signer: PublicKey, strategyId: number, action: Action, affectedRole: Role, update: Update): Promise<import("@solana/web3.js").TransactionInstruction>;
97
- /**
98
- * Updates action role permissions at the protocol level.
99
- *
100
- * @param signer - Public key of the admin signer
101
- * @param action - The action being modified
102
- * @param affectedRole - The role being modified
103
- * @param update - The type of update (Grant or Revoke)
104
- * @returns Promise resolving to a TransactionInstruction
105
- */
106
- updateActionRoleProtocol(signer: PublicKey, action: Action, affectedRole: Role, update: Update): Promise<import("@solana/web3.js").TransactionInstruction>;
107
- }
@@ -1,75 +0,0 @@
1
- /// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
2
- /// <reference types="jito-ts/node_modules/@solana/web3.js" />
3
- import { Connection } from "@solana/web3.js";
4
- import { PublicKey } from "@solana/web3.js";
5
- import BN from "bn.js";
6
- import { Keypair } from "@solana/web3.js";
7
- /**
8
- * Client class for interacting with the Reflect Tokenised Bonds program.
9
- * Provides functionality for creating and managing tokenized bond vaults,
10
- * including receipt token creation, vault initialization, deposits, and withdrawals.
11
- *
12
- * This class handles the tokenized bonds aspect of the Reflect protocol,
13
- * allowing users to deposit assets and receive receipt tokens representing
14
- * their share of the vault.
15
- */
16
- export declare class ReflectTokenisedBond {
17
- /** Solana connection instance for RPC communication */
18
- connection: Connection;
19
- /**
20
- * Creates a new ReflectTokenisedBond instance.
21
- *
22
- * @param connection - Solana connection instance
23
- */
24
- constructor(connection: Connection);
25
- /**
26
- * Creates a receipt token for a vault.
27
- * Generates a new keypair for the receipt token mint and creates the necessary instructions.
28
- *
29
- * @param connection - Solana connection instance
30
- * @param signer - Public key of the transaction signer
31
- * @param vault - Public key of the vault account
32
- * @returns Promise resolving to an object containing instructions and signers
33
- */
34
- createReceiptToken(connection: Connection, signer: PublicKey, vault: PublicKey): Promise<{
35
- instructions: import("@solana/web3.js").TransactionInstruction[];
36
- signers: Keypair[];
37
- }>;
38
- /**
39
- * Initializes the tokenized bonds program.
40
- * Creates the config and admin accounts for the program.
41
- *
42
- * @param signer - Public key of the admin signer
43
- * @returns Promise resolving to a TransactionInstruction
44
- */
45
- initialize(signer: PublicKey): Promise<import("@solana/web3.js").TransactionInstruction>;
46
- /**
47
- * Initializes a new vault with specified deposit and receipt mints.
48
- *
49
- * @param signer - Public key of the admin signer
50
- * @param depositMint - Public key of the deposit token mint
51
- * @param receiptMint - Public key of the receipt token mint
52
- * @returns Promise resolving to a TransactionInstruction
53
- */
54
- initializeVault(signer: PublicKey, depositMint: PublicKey, receiptMint: PublicKey): Promise<import("@solana/web3.js").TransactionInstruction>;
55
- /**
56
- * Creates a deposit instruction for a vault.
57
- * Allows users to deposit assets and receive receipt tokens.
58
- *
59
- * @param signer - Public key of the user making the deposit
60
- * @param vaultId - Numeric identifier for the vault
61
- * @param amount - Amount of deposit tokens to deposit
62
- * @returns Promise resolving to a TransactionInstruction
63
- */
64
- deposit(signer: PublicKey, vaultId: number, amount: BN): Promise<import("@solana/web3.js").TransactionInstruction>;
65
- /**
66
- * Creates a withdrawal instruction for a vault.
67
- * Allows users to burn receipt tokens and receive back their deposit tokens.
68
- *
69
- * @param signer - Public key of the user making the withdrawal
70
- * @param vaultId - Numeric identifier for the vault
71
- * @param amount - Amount of receipt tokens to burn for withdrawal
72
- * @returns Promise resolving to a TransactionInstruction
73
- */
74
- withdraw(signer: PublicKey, vaultId: number, amount: BN): Promise<import("@solana/web3.js").TransactionInstruction>;
75
- }