@reflectmoney/stable.ts 1.1.6 → 1.1.8

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
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
+ class Integration {
13
+ load() {
14
+ return __awaiter(this, void 0, void 0, function* () {
15
+ });
16
+ }
17
+ }
@@ -0,0 +1,6 @@
1
+ declare class IntegrationController {
2
+ private supply;
3
+ private principal;
4
+ private yield;
5
+ }
6
+ export { IntegrationController };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IntegrationController = void 0;
4
+ class IntegrationController {
5
+ }
6
+ exports.IntegrationController = IntegrationController;
@@ -41,25 +41,25 @@ export declare class ReflectKeeper {
41
41
  *
42
42
  * @param freeze - Whether to freeze (true) or unfreeze (false) the action
43
43
  * @param action - The action to freeze/unfreeze
44
- * @returns Promise resolving to a TransactionInstruction
44
+ * @returns TransactionInstruction
45
45
  */
46
- freezeProtocolAction(freeze: boolean, action: Action): Promise<import("@solana/web3.js").TransactionInstruction>;
46
+ freezeProtocolAction(freeze: boolean, action: Action): import("@solana/web3.js").TransactionInstruction;
47
47
  /**
48
48
  * Freezes or unfreezes a specific DEX program.
49
49
  *
50
50
  * @param freeze - Whether to freeze (true) or unfreeze (false) the program
51
51
  * @param programIndex - Index of the program to freeze/unfreeze
52
- * @returns Promise resolving to a TransactionInstruction
52
+ * @returns TransactionInstruction
53
53
  */
54
- freezeDex(freeze: boolean, programIndex: number): Promise<import("@solana/web3.js").TransactionInstruction>;
54
+ freezeDex(freeze: boolean, programIndex: number): import("@solana/web3.js").TransactionInstruction;
55
55
  /**
56
56
  * Creates a new admin account with specified permissions.
57
57
  *
58
58
  * @param signer - Public key of the caller (must be existing admin)
59
59
  * @param newAdmin - Public key of the new admin to create
60
- * @returns Promise resolving to a TransactionInstruction
60
+ * @returns TransactionInstruction
61
61
  */
62
- createAdminAccount(signer: PublicKey, newAdmin: PublicKey, roles?: number): Promise<import("@solana/web3.js").TransactionInstruction>;
62
+ createAdminAccount(signer: PublicKey, newAdmin: PublicKey, roles?: number): import("@solana/web3.js").TransactionInstruction;
63
63
  /**
64
64
  * Updates role holder permissions at the protocol level.
65
65
  *
@@ -67,9 +67,9 @@ export declare class ReflectKeeper {
67
67
  * @param adminToUpdate - Public key of the admin whose permissions are being updated
68
68
  * @param affectedRole - The role being modified
69
69
  * @param update - The type of update (Grant or Revoke)
70
- * @returns Promise resolving to a TransactionInstruction
70
+ * @returns TransactionInstruction
71
71
  */
72
- updateRoleHolderProtocol(signer: PublicKey, adminToUpdate: PublicKey, affectedRole: Role, update: Update): Promise<import("@solana/web3.js").TransactionInstruction>;
72
+ updateRoleHolderProtocol(signer: PublicKey, adminToUpdate: PublicKey, affectedRole: Role, update: Update): import("@solana/web3.js").TransactionInstruction;
73
73
  /**
74
74
  * Updates role holder permissions for a specific strategy.
75
75
  *
@@ -78,9 +78,9 @@ export declare class ReflectKeeper {
78
78
  * @param adminToUpdate - Public key of the admin whose permissions are being updated
79
79
  * @param affectedRole - The role being modified
80
80
  * @param update - The type of update (Grant or Revoke)
81
- * @returns Promise resolving to a TransactionInstruction
81
+ * @returns TransactionInstruction
82
82
  */
83
- updateRoleHolderStrategy(signer: PublicKey, strategyId: number, adminToUpdate: PublicKey, affectedRole: Role, update: Update): Promise<import("@solana/web3.js").TransactionInstruction>;
83
+ updateRoleHolderStrategy(signer: PublicKey, strategyId: number, adminToUpdate: PublicKey, affectedRole: Role, update: Update): import("@solana/web3.js").TransactionInstruction;
84
84
  /**
85
85
  * Updates action role permissions for a specific strategy.
86
86
  *
@@ -89,9 +89,9 @@ export declare class ReflectKeeper {
89
89
  * @param action - The action being modified
90
90
  * @param affectedRole - The role being modified
91
91
  * @param update - The type of update (Grant or Revoke)
92
- * @returns Promise resolving to a TransactionInstruction
92
+ * @returns TransactionInstruction
93
93
  */
94
- updateActionRoleStrategy(signer: PublicKey, strategyId: number, action: Action, affectedRole: Role, update: Update): Promise<import("@solana/web3.js").TransactionInstruction>;
94
+ updateActionRoleStrategy(signer: PublicKey, strategyId: number, action: Action, affectedRole: Role, update: Update): import("@solana/web3.js").TransactionInstruction;
95
95
  /**
96
96
  * Updates action role permissions at the protocol level.
97
97
  *
@@ -99,7 +99,7 @@ export declare class ReflectKeeper {
99
99
  * @param action - The action being modified
100
100
  * @param affectedRole - The role being modified
101
101
  * @param update - The type of update (Grant or Revoke)
102
- * @returns Promise resolving to a TransactionInstruction
102
+ * @returns TransactionInstruction
103
103
  */
104
- updateActionRoleProtocol(signer: PublicKey, action: Action, affectedRole: Role, update: Update): Promise<import("@solana/web3.js").TransactionInstruction>;
104
+ updateActionRoleProtocol(signer: PublicKey, action: Action, affectedRole: Role, update: Update): import("@solana/web3.js").TransactionInstruction;
105
105
  }
@@ -64,62 +64,56 @@ class ReflectKeeper {
64
64
  *
65
65
  * @param freeze - Whether to freeze (true) or unfreeze (false) the action
66
66
  * @param action - The action to freeze/unfreeze
67
- * @returns Promise resolving to a TransactionInstruction
67
+ * @returns TransactionInstruction
68
68
  */
69
69
  freezeProtocolAction(freeze, action) {
70
- return __awaiter(this, void 0, void 0, function* () {
71
- const ix = (0, reflect_main_1.createFreezeProtocolActionInstruction)({
72
- admin: this.admin,
73
- main: this.main,
74
- systemProgram: web3_js_1.SystemProgram.programId,
75
- adminPermissions: PdaClient_1.PdaClient.derivePermissions(this.admin),
76
- }, {
77
- freeze,
78
- action
79
- });
80
- return ix;
70
+ const ix = (0, reflect_main_1.createFreezeProtocolActionInstruction)({
71
+ admin: this.admin,
72
+ main: this.main,
73
+ systemProgram: web3_js_1.SystemProgram.programId,
74
+ adminPermissions: PdaClient_1.PdaClient.derivePermissions(this.admin),
75
+ }, {
76
+ freeze,
77
+ action
81
78
  });
79
+ return ix;
82
80
  }
83
81
  /**
84
82
  * Freezes or unfreezes a specific DEX program.
85
83
  *
86
84
  * @param freeze - Whether to freeze (true) or unfreeze (false) the program
87
85
  * @param programIndex - Index of the program to freeze/unfreeze
88
- * @returns Promise resolving to a TransactionInstruction
86
+ * @returns TransactionInstruction
89
87
  */
90
88
  freezeDex(freeze, programIndex) {
91
- return __awaiter(this, void 0, void 0, function* () {
92
- const ix = (0, reflect_main_1.createFreezeProgramInstruction)({
93
- admin: this.admin,
94
- main: this.main,
95
- systemProgram: web3_js_1.SystemProgram.programId,
96
- adminPermissions: PdaClient_1.PdaClient.derivePermissions(this.admin),
97
- }, {
98
- freeze,
99
- programIndex
100
- });
101
- return ix;
89
+ const ix = (0, reflect_main_1.createFreezeProgramInstruction)({
90
+ admin: this.admin,
91
+ main: this.main,
92
+ systemProgram: web3_js_1.SystemProgram.programId,
93
+ adminPermissions: PdaClient_1.PdaClient.derivePermissions(this.admin),
94
+ }, {
95
+ freeze,
96
+ programIndex
102
97
  });
98
+ return ix;
103
99
  }
104
100
  /**
105
101
  * Creates a new admin account with specified permissions.
106
102
  *
107
103
  * @param signer - Public key of the caller (must be existing admin)
108
104
  * @param newAdmin - Public key of the new admin to create
109
- * @returns Promise resolving to a TransactionInstruction
105
+ * @returns TransactionInstruction
110
106
  */
111
- createAdminAccount(signer_1, newAdmin_1) {
112
- return __awaiter(this, arguments, void 0, function* (signer, newAdmin, roles = 18) {
113
- const ix = (0, reflect_main_1.createCreateAdminAccountInstruction)({
114
- caller: signer,
115
- newCreds: PdaClient_1.PdaClient.derivePermissions(newAdmin),
116
- systemProgram: web3_js_1.SystemProgram.programId,
117
- }, {
118
- newAdmin,
119
- roles
120
- }, reflect_main_1.PROGRAM_ID);
121
- return ix;
122
- });
107
+ createAdminAccount(signer, newAdmin, roles = 18) {
108
+ const ix = (0, reflect_main_1.createCreateAdminAccountInstruction)({
109
+ caller: signer,
110
+ newCreds: PdaClient_1.PdaClient.derivePermissions(newAdmin),
111
+ systemProgram: web3_js_1.SystemProgram.programId,
112
+ }, {
113
+ newAdmin,
114
+ roles
115
+ }, reflect_main_1.PROGRAM_ID);
116
+ return ix;
123
117
  }
124
118
  /**
125
119
  * Updates role holder permissions at the protocol level.
@@ -128,24 +122,22 @@ class ReflectKeeper {
128
122
  * @param adminToUpdate - Public key of the admin whose permissions are being updated
129
123
  * @param affectedRole - The role being modified
130
124
  * @param update - The type of update (Grant or Revoke)
131
- * @returns Promise resolving to a TransactionInstruction
125
+ * @returns TransactionInstruction
132
126
  */
133
127
  updateRoleHolderProtocol(signer, adminToUpdate, affectedRole, update) {
134
- return __awaiter(this, void 0, void 0, function* () {
135
- const ix = (0, reflect_main_1.createUpdateRoleHolderProtocolInstruction)({
136
- admin: signer,
137
- adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer),
138
- main: PdaClient_1.PdaClient.deriveMain(),
139
- systemProgram: web3_js_1.SystemProgram.programId,
140
- updateAdminPermissions: PdaClient_1.PdaClient.derivePermissions(adminToUpdate),
141
- // Dummy strategy account.
142
- strategy: PdaClient_1.PdaClient.deriveController(0)
143
- }, {
144
- update,
145
- accessLevel: affectedRole,
146
- }, reflect_main_1.PROGRAM_ID);
147
- return ix;
148
- });
128
+ const ix = (0, reflect_main_1.createUpdateRoleHolderProtocolInstruction)({
129
+ admin: signer,
130
+ adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer),
131
+ main: PdaClient_1.PdaClient.deriveMain(),
132
+ systemProgram: web3_js_1.SystemProgram.programId,
133
+ updateAdminPermissions: PdaClient_1.PdaClient.derivePermissions(adminToUpdate),
134
+ // Dummy strategy account.
135
+ strategy: PdaClient_1.PdaClient.deriveController(0)
136
+ }, {
137
+ update,
138
+ accessLevel: affectedRole,
139
+ }, reflect_main_1.PROGRAM_ID);
140
+ return ix;
149
141
  }
150
142
  /**
151
143
  * Updates role holder permissions for a specific strategy.
@@ -155,23 +147,21 @@ class ReflectKeeper {
155
147
  * @param adminToUpdate - Public key of the admin whose permissions are being updated
156
148
  * @param affectedRole - The role being modified
157
149
  * @param update - The type of update (Grant or Revoke)
158
- * @returns Promise resolving to a TransactionInstruction
150
+ * @returns TransactionInstruction
159
151
  */
160
152
  updateRoleHolderStrategy(signer, strategyId, adminToUpdate, affectedRole, update) {
161
- return __awaiter(this, void 0, void 0, function* () {
162
- const ix = (0, reflect_main_1.createUpdateRoleHolderStrategyInstruction)({
163
- admin: signer,
164
- adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer),
165
- main: PdaClient_1.PdaClient.deriveMain(),
166
- systemProgram: web3_js_1.SystemProgram.programId,
167
- updateAdminPermissions: PdaClient_1.PdaClient.derivePermissions(adminToUpdate),
168
- strategy: PdaClient_1.PdaClient.deriveController(strategyId)
169
- }, {
170
- update,
171
- role: affectedRole,
172
- }, reflect_main_1.PROGRAM_ID);
173
- return ix;
174
- });
153
+ const ix = (0, reflect_main_1.createUpdateRoleHolderStrategyInstruction)({
154
+ admin: signer,
155
+ adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer),
156
+ main: PdaClient_1.PdaClient.deriveMain(),
157
+ systemProgram: web3_js_1.SystemProgram.programId,
158
+ updateAdminPermissions: PdaClient_1.PdaClient.derivePermissions(adminToUpdate),
159
+ strategy: PdaClient_1.PdaClient.deriveController(strategyId)
160
+ }, {
161
+ update,
162
+ role: affectedRole,
163
+ }, reflect_main_1.PROGRAM_ID);
164
+ return ix;
175
165
  }
176
166
  /**
177
167
  * Updates action role permissions for a specific strategy.
@@ -181,23 +171,21 @@ class ReflectKeeper {
181
171
  * @param action - The action being modified
182
172
  * @param affectedRole - The role being modified
183
173
  * @param update - The type of update (Grant or Revoke)
184
- * @returns Promise resolving to a TransactionInstruction
174
+ * @returns TransactionInstruction
185
175
  */
186
176
  updateActionRoleStrategy(signer, strategyId, action, affectedRole, update) {
187
- return __awaiter(this, void 0, void 0, function* () {
188
- const ix = (0, reflect_main_1.createUpdateActionRoleStrategyInstruction)({
189
- admin: signer,
190
- adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer),
191
- main: PdaClient_1.PdaClient.deriveMain(),
192
- systemProgram: web3_js_1.SystemProgram.programId,
193
- strategy: PdaClient_1.PdaClient.deriveController(strategyId)
194
- }, {
195
- update,
196
- role: affectedRole,
197
- action
198
- }, reflect_main_1.PROGRAM_ID);
199
- return ix;
200
- });
177
+ const ix = (0, reflect_main_1.createUpdateActionRoleStrategyInstruction)({
178
+ admin: signer,
179
+ adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer),
180
+ main: PdaClient_1.PdaClient.deriveMain(),
181
+ systemProgram: web3_js_1.SystemProgram.programId,
182
+ strategy: PdaClient_1.PdaClient.deriveController(strategyId)
183
+ }, {
184
+ update,
185
+ role: affectedRole,
186
+ action
187
+ }, reflect_main_1.PROGRAM_ID);
188
+ return ix;
201
189
  }
202
190
  /**
203
191
  * Updates action role permissions at the protocol level.
@@ -206,22 +194,20 @@ class ReflectKeeper {
206
194
  * @param action - The action being modified
207
195
  * @param affectedRole - The role being modified
208
196
  * @param update - The type of update (Grant or Revoke)
209
- * @returns Promise resolving to a TransactionInstruction
197
+ * @returns TransactionInstruction
210
198
  */
211
199
  updateActionRoleProtocol(signer, action, affectedRole, update) {
212
- return __awaiter(this, void 0, void 0, function* () {
213
- const ix = (0, reflect_main_1.createUpdateActionRoleProtocolInstruction)({
214
- admin: signer,
215
- adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer),
216
- main: PdaClient_1.PdaClient.deriveMain(),
217
- systemProgram: web3_js_1.SystemProgram.programId,
218
- }, {
219
- action,
220
- role: affectedRole,
221
- update
222
- }, reflect_main_1.PROGRAM_ID);
223
- return ix;
224
- });
200
+ const ix = (0, reflect_main_1.createUpdateActionRoleProtocolInstruction)({
201
+ admin: signer,
202
+ adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer),
203
+ main: PdaClient_1.PdaClient.deriveMain(),
204
+ systemProgram: web3_js_1.SystemProgram.programId,
205
+ }, {
206
+ action,
207
+ role: affectedRole,
208
+ update
209
+ }, reflect_main_1.PROGRAM_ID);
210
+ return ix;
225
211
  }
226
212
  }
227
213
  exports.ReflectKeeper = ReflectKeeper;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reflectmoney/stable.ts",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "type": "commonjs",
5
5
  "author": "stablecoinjesus @ Palindrome Engineering",
6
6
  "repository": {