@reflectmoney/stable.ts 1.0.0 → 1.0.1

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/README.md CHANGED
@@ -1,9 +1,180 @@
1
- # Reflect SDK
1
+ # Reflect Money Stable.ts SDK
2
2
 
3
- Typescript SDK for interacting with Reflect Protocol Delta-Neutral Program.
3
+ A comprehensive TypeScript SDK for interacting with the Reflect Protocol Delta-Neutral Program on Solana. This SDK provides high-level abstractions for managing stablecoins, administrative operations, and protocol integrations.
4
4
 
5
- ## Classes
6
- SDK provides three classes:
7
- - `Reflect` - general purpose class for user-level interactions. Mainly for `mint()` and `burn()` of stable.
8
- - `ReflectAdmin` - admin-level class, allowing for modification of the core protocol settings.
9
- - `ReflectCrank` - class used for cranking the protocol to capture spreads & funding.
5
+ ## Overview
6
+
7
+ The Reflect Protocol SDK enables developers to interact with three main Reflect stablecoins:
8
+
9
+ 1. **USDC+ (Strategy 0)**: Stablecoin backed by USDC deployed in money markets
10
+ 2. **JLP Hedged (Strategy 1)**: Stablecoin backed by the JLP token, neutralised with perpetual hedging strategies
11
+ 3. **LST Delta-Neutral (Strategy 2)**: Stablecoin backed by hedged LSTs
12
+
13
+ ## Architecture
14
+
15
+ The SDK is organized into several key components:
16
+
17
+ ### Core Classes
18
+
19
+ #### `Stablecoin` (Abstract Base Class)
20
+ The foundation for all stablecoin implementations. Provides common interface for:
21
+ - minting,
22
+ - redemption,
23
+ - administrative operations.
24
+
25
+ **Key Methods:**
26
+ - `initialize()` - Initialize the stablecoin strategy (admin-only)
27
+ - `mint()` - Create mint instructions
28
+ - `redeem()` - Create redemption instructions
29
+ - `rebalance()` - Create rebalancing instructions (admin-only)
30
+ - `updateCap()` - Update supply cap (admin-only)
31
+ - `updateRecipients()` - Update fee recipients (admin-only)
32
+
33
+ #### `ReflectAdmin`
34
+ Administrative client for protocol-level operations:
35
+ - Protocol initialization
36
+ - Role and permission management
37
+ - Action freezing/unfreezing
38
+ - Admin account creation
39
+
40
+ **Key Methods:**
41
+ - `initializeMain()` - Initialize the main program account
42
+ - `freezeProtocolAction()` - Freeze/unfreeze protocol actions
43
+ - `updateRoleHolderProtocol()` - Update protocol-level permissions
44
+ - `createAdminAccount()` - Create new admin accounts
45
+
46
+ #### `PdaClient`
47
+ Utility class for deriving Program Derived Addresses (PDAs):
48
+ - Main program accounts
49
+ - Controller accounts
50
+ - Permission accounts
51
+ - External protocol integrations (Drift, Jupiter)
52
+
53
+ #### `ReflectTokenisedBond`
54
+ Client for tokenized bonds program, allowing for wrapping base stablecoins into yield-bearing receipts. Allows for:
55
+ - Vault creation and management
56
+ - Receipt token generation
57
+ - Deposit and withdrawal operations
58
+
59
+ ### Stablecoin Implementations
60
+
61
+ #### `UsdcStablecoin`
62
+ Simple USDC-backed stablecoin implementation:
63
+ - Strategy ID: 0
64
+ - Collateral: USDC
65
+ - Integrated with tokenised bonds program on the protocol level
66
+
67
+ #### `JlpStablecoin`
68
+ Jupiter LP token with perpetual hedging:
69
+ - Strategy ID: 1
70
+ - Collateral: JLP (Jupiter LP tokens)
71
+
72
+ #### `LstStablecoin`
73
+ Liquid staking token delta-neutral strategy:
74
+ - Strategy ID: 2
75
+ - Collateral: Various LSTs (mSOL, jitoSOL, etc.)
76
+
77
+ ## Installation
78
+
79
+ ```bash
80
+ npm install @reflectmoney/stable.ts
81
+ # or
82
+ yarn add @reflectmoney/stable.ts
83
+ ```
84
+
85
+ ## Quick Start
86
+
87
+ ### Minting Stablecoins
88
+
89
+ ```typescript
90
+ import { LstStablecoin } from '@reflectmoney/stable.ts';
91
+ import { PublicKey } from '@solana/web3.js';
92
+ import BN from 'bn.js';
93
+
94
+ const lstStablecoin = new LstStablecoin(connection);
95
+
96
+ // Load controller data
97
+ await lstStablecoin.load(connection);
98
+
99
+ // Mint stablecoins against LST collateral
100
+ const mintInstructions = await lstStablecoin.mint(
101
+ userPublicKey,
102
+ new BN(1000000), // 1 USDC (6 decimals)
103
+ new BN(999000), // Minimum received (slippage protection)
104
+ new PublicKey("<jitoSOL mint>") // LST mint address
105
+ );
106
+ ```
107
+
108
+ ### Administrative Operations
109
+
110
+ ```typescript
111
+ import { ReflectAdmin } from '@reflectmoney/stable.ts';
112
+
113
+ const admin = new ReflectAdmin({
114
+ admin: adminPublicKey,
115
+ connection
116
+ });
117
+
118
+ // Freeze minting operations
119
+ const freezeIx = await admin.freezeProtocolAction(true, Action.Mint);
120
+
121
+ // Update supply cap
122
+ const updateCapIx = await usdcStablecoin.updateCap(adminPublicKey, new BN(1000000000));
123
+ ```
124
+
125
+ ## Advanced Usage
126
+
127
+ ### Custom Stablecoin Implementation
128
+
129
+ ```typescript
130
+ import { Stablecoin } from '@reflectmoney/stable.ts';
131
+
132
+ class CustomStablecoin extends Stablecoin {
133
+ constructor(connection: Connection) {
134
+ super(3, "Custom Strategy", connection);
135
+ this.collaterals = [{ mint: customMint, oracle: customOracle }];
136
+ }
137
+
138
+ async initialize(signer: PublicKey, ...args: any[]): Promise<TransactionInstruction[]> {
139
+ // Custom initialization logic
140
+ }
141
+
142
+ async mint(signer: PublicKey, amount: BN, minimumReceived: BN, ...args: any[]): Promise<TransactionInstruction[]> {
143
+ // Custom minting logic
144
+ }
145
+
146
+ async redeem(signer: PublicKey, amount: BN, minimumReceived: BN, ...args: any[]): Promise<TransactionInstruction[]> {
147
+ // Custom redemption logic
148
+ }
149
+
150
+ async rebalance(signer: PublicKey): Promise<TransactionInstruction[]> {
151
+ // Custom rebalancing logic
152
+ }
153
+
154
+ async constructAccounts<T>(signer: PublicKey, ...args: any[]): Promise<T> {
155
+ // Custom account construction
156
+ }
157
+
158
+ async constructRemainingAccounts(): Promise<AccountMeta[]> {
159
+ // Custom remaining accounts
160
+ }
161
+ }
162
+ ```
163
+
164
+ ### Integration with External Protocols
165
+
166
+ The SDK is built in integration with:
167
+ - **Drift Protocol**: For perpetual futures and spot trading
168
+ - **Jupiter Protocol**: For LP token operations and swaps
169
+ - **Pyth Network**: For price oracle data
170
+ - **Tokenized Bonds**: For yield generation
171
+
172
+ ## License
173
+
174
+ This SDK is licensed under the MIT License.
175
+
176
+ ## Support
177
+
178
+ For support and questions:
179
+ - Documentation: [docs.reflect.money](https://docs.reflect.money)
180
+ - GitHub Issues: [github.com/palindrome-eng/reflect-delta-neutral](https://github.com/palindrome-eng/reflect-delta-neutral)
@@ -1,19 +1,131 @@
1
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
+ */
2
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
+ */
3
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
+ */
4
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
+ */
5
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
+ */
6
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
+ */
7
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
+ */
8
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
+ */
9
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
+ */
10
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
+ */
11
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
+ */
12
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
+ */
13
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
+ */
14
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
+ */
15
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
+ */
16
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
+ */
17
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
+ */
18
130
  static deriveLpVaultPool(vaultId: number): PublicKey;
19
131
  }
@@ -20,11 +20,29 @@ const constants_1 = require("../constants");
20
20
  const bn_js_1 = __importDefault(require("bn.js"));
21
21
  const sdk_1 = require("@drift-labs/sdk");
22
22
  const mpl_token_metadata_1 = require("@metaplex-foundation/mpl-token-metadata");
23
+ /**
24
+ * Utility class for deriving Program Derived Addresses (PDAs) used throughout the Reflect protocol.
25
+ * Provides static methods to generate deterministic addresses for various program accounts
26
+ * including main program accounts, controllers, permissions, and external protocol integrations.
27
+ */
23
28
  class PdaClient {
29
+ /**
30
+ * Derives the main program account address.
31
+ * This is the primary account that stores global protocol state.
32
+ *
33
+ * @returns PublicKey of the main program account
34
+ */
24
35
  static deriveMain() {
25
36
  const [main] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("main")], reflect_main_1.PROGRAM_ID);
26
37
  return main;
27
38
  }
39
+ /**
40
+ * Derives the permissions account address for a specific user.
41
+ * This account stores the user's role-based permissions within the protocol.
42
+ *
43
+ * @param user - Public key of the user
44
+ * @returns PublicKey of the user's permissions account
45
+ */
28
46
  static derivePermissions(user) {
29
47
  const [permissions] = web3_js_1.PublicKey.findProgramAddressSync([
30
48
  Buffer.from("user_permission"),
@@ -32,6 +50,13 @@ class PdaClient {
32
50
  ], reflect_main_1.PROGRAM_ID);
33
51
  return permissions;
34
52
  }
53
+ /**
54
+ * Derives the controller account address for a specific strategy.
55
+ * Each stablecoin strategy has its own controller account.
56
+ *
57
+ * @param strategy - Strategy index (0: USDC+, 1: JLP, 2: LST)
58
+ * @returns PublicKey of the strategy controller account
59
+ */
35
60
  static deriveController(strategy) {
36
61
  const [controller] = web3_js_1.PublicKey.findProgramAddressSync([
37
62
  Buffer.from("dex_controller"),
@@ -39,12 +64,26 @@ class PdaClient {
39
64
  ], reflect_main_1.PROGRAM_ID);
40
65
  return controller;
41
66
  }
67
+ /**
68
+ * Derives the controller account address with bump seed for a specific strategy.
69
+ * Returns both the public key and the bump seed.
70
+ *
71
+ * @param strategy - Strategy index (0: USDC+, 1: JLP, 2: LST)
72
+ * @returns Array containing [PublicKey, number] where number is the bump seed
73
+ */
42
74
  static deriveControllerWithBump(strategy) {
43
75
  return web3_js_1.PublicKey.findProgramAddressSync([
44
76
  Buffer.from("dex_controller"),
45
77
  Buffer.from([strategy])
46
78
  ], reflect_main_1.PROGRAM_ID);
47
79
  }
80
+ /**
81
+ * Derives the rebalance details account address for a specific strategy.
82
+ * This account stores information about rebalancing operations.
83
+ *
84
+ * @param strategy - Strategy index (0: USDC+, 1: JLP, 2: LST)
85
+ * @returns PublicKey of the rebalance details account
86
+ */
48
87
  static deriveRebalanceDetails(strategy) {
49
88
  const [rebalanceDetails] = web3_js_1.PublicKey.findProgramAddressSync([
50
89
  Buffer.from("rebalance_details"),
@@ -52,12 +91,24 @@ class PdaClient {
52
91
  ], reflect_main_1.PROGRAM_ID);
53
92
  return rebalanceDetails;
54
93
  }
94
+ /**
95
+ * Derives the Jupiter Perpetuals program account address.
96
+ * Used for integration with Jupiter's perpetuals protocol.
97
+ *
98
+ * @returns PublicKey of the Jupiter Perpetuals account
99
+ */
55
100
  static deriveJupiterPerpetuals() {
56
101
  const [perpetuals] = web3_js_1.PublicKey.findProgramAddressSync([
57
102
  Buffer.from("perpetuals")
58
103
  ], constants_1.JUPITER_PROGRAM_ID);
59
104
  return perpetuals;
60
105
  }
106
+ /**
107
+ * Derives the Jupiter LP pool account address.
108
+ * Used for JLP (Jupiter LP) token operations.
109
+ *
110
+ * @returns PublicKey of the JLP pool account
111
+ */
61
112
  static deriveJlpPool() {
62
113
  const [jlpPool] = web3_js_1.PublicKey.findProgramAddressSync([
63
114
  Buffer.from("pool"),
@@ -65,18 +116,37 @@ class PdaClient {
65
116
  ], constants_1.JUPITER_PROGRAM_ID);
66
117
  return jlpPool;
67
118
  }
119
+ /**
120
+ * Derives the Jupiter event authority account address.
121
+ * Used for event emission in Jupiter protocol interactions.
122
+ *
123
+ * @returns PublicKey of the Jupiter event authority account
124
+ */
68
125
  static deriveEventAuthority() {
69
126
  const [eventAuthority] = web3_js_1.PublicKey.findProgramAddressSync([
70
127
  Buffer.from("__event_authority"),
71
128
  ], constants_1.JUPITER_PROGRAM_ID);
72
129
  return eventAuthority;
73
130
  }
131
+ /**
132
+ * Derives the Jupiter transfer authority account address.
133
+ * Used for token transfer operations in Jupiter protocol.
134
+ *
135
+ * @returns PublicKey of the Jupiter transfer authority account
136
+ */
74
137
  static deriveTransferAuthority() {
75
138
  const [transferAuthority] = web3_js_1.PublicKey.findProgramAddressSync([
76
139
  Buffer.from("transfer_authority"),
77
140
  ], constants_1.JUPITER_PROGRAM_ID);
78
141
  return transferAuthority;
79
142
  }
143
+ /**
144
+ * Gets the Drift vault address for a specific mint.
145
+ * Looks up the market index for the mint and derives the corresponding vault address.
146
+ *
147
+ * @param mint - Public key of the token mint
148
+ * @returns Promise resolving to the PublicKey of the Drift vault account
149
+ */
80
150
  static getDriftVaultFromMint(mint) {
81
151
  return __awaiter(this, void 0, void 0, function* () {
82
152
  const { marketIndex } = sdk_1.SpotMarkets["mainnet-beta"]
@@ -84,6 +154,13 @@ class PdaClient {
84
154
  return yield (0, sdk_1.getSpotMarketVaultPublicKey)(constants_1.DRIFT_PROGRAM_ID, marketIndex);
85
155
  });
86
156
  }
157
+ /**
158
+ * Derives the token metadata account address for a mint.
159
+ * Used for storing token metadata information.
160
+ *
161
+ * @param mint - Public key of the token mint
162
+ * @returns PublicKey of the metadata account
163
+ */
87
164
  static deriveMetadataAccount(mint) {
88
165
  const [metadata] = web3_js_1.PublicKey.findProgramAddressSync([
89
166
  Buffer.from("metadata"),
@@ -92,6 +169,14 @@ class PdaClient {
92
169
  ], mpl_token_metadata_1.PROGRAM_ID);
93
170
  return metadata;
94
171
  }
172
+ /**
173
+ * Derives the custody account address for a pool and token combination.
174
+ * Used in Jupiter protocol for token custody management.
175
+ *
176
+ * @param pool - Public key of the pool
177
+ * @param token - Public key of the token
178
+ * @returns PublicKey of the custody account
179
+ */
95
180
  static deriveCustody(pool, token) {
96
181
  const [custody] = web3_js_1.PublicKey.findProgramAddressSync([
97
182
  Buffer.from("custody"),
@@ -100,12 +185,25 @@ class PdaClient {
100
185
  ], constants_1.JUPITER_PROGRAM_ID);
101
186
  return custody;
102
187
  }
188
+ /**
189
+ * Derives the LP config account address.
190
+ * Used for tokenized bonds program configuration.
191
+ *
192
+ * @returns PublicKey of the LP config account
193
+ */
103
194
  static deriveLpConfig() {
104
195
  const [config] = web3_js_1.PublicKey.findProgramAddressSync([
105
196
  Buffer.from("config")
106
197
  ], reflect_tokenised_bonds_1.PROGRAM_ID);
107
198
  return config;
108
199
  }
200
+ /**
201
+ * Derives the LP admin account address for a specific admin.
202
+ * Used for tokenized bonds program administration.
203
+ *
204
+ * @param admin - Public key of the admin
205
+ * @returns PublicKey of the LP admin account
206
+ */
109
207
  static deriveLpAdmin(admin) {
110
208
  const [adminPda] = web3_js_1.PublicKey.findProgramAddressSync([
111
209
  Buffer.from("admin"),
@@ -113,6 +211,13 @@ class PdaClient {
113
211
  ], reflect_tokenised_bonds_1.PROGRAM_ID);
114
212
  return adminPda;
115
213
  }
214
+ /**
215
+ * Derives the LP vault account address for a specific vault ID.
216
+ * Used for tokenized bonds vault management.
217
+ *
218
+ * @param vaultId - Numeric identifier for the vault
219
+ * @returns PublicKey of the LP vault account
220
+ */
116
221
  static deriveLpVault(vaultId) {
117
222
  const [vault] = web3_js_1.PublicKey.findProgramAddressSync([
118
223
  Buffer.from("vault"),
@@ -120,6 +225,13 @@ class PdaClient {
120
225
  ], reflect_tokenised_bonds_1.PROGRAM_ID);
121
226
  return vault;
122
227
  }
228
+ /**
229
+ * Derives the LP vault pool account address for a specific vault ID.
230
+ * Used for tokenized bonds vault pool management.
231
+ *
232
+ * @param vaultId - Numeric identifier for the vault
233
+ * @returns PublicKey of the LP vault pool account
234
+ */
123
235
  static deriveLpVaultPool(vaultId) {
124
236
  const [pool] = web3_js_1.PublicKey.findProgramAddressSync([
125
237
  Buffer.from("vault_pool"),
@@ -1,19 +1,104 @@
1
1
  import { Connection, PublicKey } from "@solana/web3.js";
2
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
+ */
3
14
  export declare class ReflectAdmin {
15
+ /** Public key of the admin user */
4
16
  private admin;
17
+ /** Public key of the main program account */
5
18
  private main;
19
+ /** Solana connection instance for RPC communication */
6
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
+ */
7
27
  constructor({ admin, connection }: {
8
28
  admin: PublicKey;
9
29
  connection: Connection;
10
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
+ */
11
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
+ */
12
45
  freezeProtocolAction(freeze: boolean, action: Action): Promise<import("@solana/web3.js").TransactionInstruction>;
13
- freezeDex(freeze: boolean, programIndex: number): Promise<void>;
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
+ */
14
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
+ */
15
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
+ */
16
82
  updateRoleHolderStrategy(signer: PublicKey, strategyId: number, adminToUpdate: PublicKey, affectedRole: Role, update: Update): Promise<import("@solana/web3.js").TransactionInstruction>;
17
- updateActionRoleStrategy(signer: PublicKey, strategyId: number, action: Action, affectedRole: Role, update: Update): Promise<void>;
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
+ */
18
103
  updateActionRoleProtocol(signer: PublicKey, action: Action, affectedRole: Role, update: Update): Promise<import("@solana/web3.js").TransactionInstruction>;
19
104
  }