@reflectmoney/stable.ts 2.8.0 → 2.8.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/dist/classes/ReflectKeeper.js +18 -18
- package/package.json +1 -1
|
@@ -35,8 +35,8 @@ class ReflectKeeper {
|
|
|
35
35
|
constructor({ admin, connection, devnet = false, }) {
|
|
36
36
|
this.admin = admin;
|
|
37
37
|
this.connection = connection;
|
|
38
|
-
this.main = PdaClient_1.PdaClient.deriveMain();
|
|
39
38
|
this.devnet = devnet;
|
|
39
|
+
this.main = PdaClient_1.PdaClient.deriveMain(devnet);
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Creates the main program account. This is the initial step of protocol setup.
|
|
@@ -50,7 +50,7 @@ class ReflectKeeper {
|
|
|
50
50
|
main,
|
|
51
51
|
admin,
|
|
52
52
|
systemProgram: web3_js_1.SystemProgram.programId,
|
|
53
|
-
creds: PdaClient_1.PdaClient.derivePermissions(admin),
|
|
53
|
+
creds: PdaClient_1.PdaClient.derivePermissions(admin, devnet),
|
|
54
54
|
}, devnet ? devnet_1.DEVNET_PROGRAM_ID : reflect_main_1.PROGRAM_ID);
|
|
55
55
|
return ix;
|
|
56
56
|
}
|
|
@@ -73,7 +73,7 @@ class ReflectKeeper {
|
|
|
73
73
|
admin: this.admin,
|
|
74
74
|
main: this.main,
|
|
75
75
|
systemProgram: web3_js_1.SystemProgram.programId,
|
|
76
|
-
adminPermissions: PdaClient_1.PdaClient.derivePermissions(this.admin),
|
|
76
|
+
adminPermissions: PdaClient_1.PdaClient.derivePermissions(this.admin, this.devnet),
|
|
77
77
|
}, {
|
|
78
78
|
freeze,
|
|
79
79
|
action,
|
|
@@ -92,7 +92,7 @@ class ReflectKeeper {
|
|
|
92
92
|
admin: this.admin,
|
|
93
93
|
main: this.main,
|
|
94
94
|
systemProgram: web3_js_1.SystemProgram.programId,
|
|
95
|
-
adminPermissions: PdaClient_1.PdaClient.derivePermissions(this.admin),
|
|
95
|
+
adminPermissions: PdaClient_1.PdaClient.derivePermissions(this.admin, this.devnet),
|
|
96
96
|
}, {
|
|
97
97
|
freeze,
|
|
98
98
|
programIndex,
|
|
@@ -109,7 +109,7 @@ class ReflectKeeper {
|
|
|
109
109
|
createAdminAccount(signer, newAdmin, roles = 18) {
|
|
110
110
|
const ix = (0, reflect_main_1.createCreateAdminAccountInstruction)({
|
|
111
111
|
caller: signer,
|
|
112
|
-
newCreds: PdaClient_1.PdaClient.derivePermissions(newAdmin),
|
|
112
|
+
newCreds: PdaClient_1.PdaClient.derivePermissions(newAdmin, this.devnet),
|
|
113
113
|
systemProgram: web3_js_1.SystemProgram.programId,
|
|
114
114
|
}, {
|
|
115
115
|
newAdmin,
|
|
@@ -129,12 +129,12 @@ class ReflectKeeper {
|
|
|
129
129
|
updateRoleHolderProtocol(signer, adminToUpdate, affectedRole, update) {
|
|
130
130
|
const ix = (0, reflect_main_1.createUpdateRoleHolderProtocolInstruction)({
|
|
131
131
|
admin: signer,
|
|
132
|
-
adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer),
|
|
133
|
-
main: PdaClient_1.PdaClient.deriveMain(),
|
|
132
|
+
adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer, this.devnet),
|
|
133
|
+
main: PdaClient_1.PdaClient.deriveMain(this.devnet),
|
|
134
134
|
systemProgram: web3_js_1.SystemProgram.programId,
|
|
135
|
-
updateAdminPermissions: PdaClient_1.PdaClient.derivePermissions(adminToUpdate),
|
|
135
|
+
updateAdminPermissions: PdaClient_1.PdaClient.derivePermissions(adminToUpdate, this.devnet),
|
|
136
136
|
// Dummy strategy account.
|
|
137
|
-
strategy: PdaClient_1.PdaClient.deriveController(0),
|
|
137
|
+
strategy: PdaClient_1.PdaClient.deriveController(0, this.devnet),
|
|
138
138
|
}, {
|
|
139
139
|
update,
|
|
140
140
|
accessLevel: affectedRole,
|
|
@@ -154,11 +154,11 @@ class ReflectKeeper {
|
|
|
154
154
|
updateRoleHolderStrategy(signer, strategyId, adminToUpdate, affectedRole, update) {
|
|
155
155
|
const ix = (0, reflect_main_1.createUpdateRoleHolderStrategyInstruction)({
|
|
156
156
|
admin: signer,
|
|
157
|
-
adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer),
|
|
158
|
-
main: PdaClient_1.PdaClient.deriveMain(),
|
|
157
|
+
adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer, this.devnet),
|
|
158
|
+
main: PdaClient_1.PdaClient.deriveMain(this.devnet),
|
|
159
159
|
systemProgram: web3_js_1.SystemProgram.programId,
|
|
160
|
-
updateAdminPermissions: PdaClient_1.PdaClient.derivePermissions(adminToUpdate),
|
|
161
|
-
strategy: PdaClient_1.PdaClient.deriveController(strategyId),
|
|
160
|
+
updateAdminPermissions: PdaClient_1.PdaClient.derivePermissions(adminToUpdate, this.devnet),
|
|
161
|
+
strategy: PdaClient_1.PdaClient.deriveController(strategyId, this.devnet),
|
|
162
162
|
}, {
|
|
163
163
|
update,
|
|
164
164
|
role: affectedRole,
|
|
@@ -178,10 +178,10 @@ class ReflectKeeper {
|
|
|
178
178
|
updateActionRoleStrategy(signer, strategyId, action, affectedRole, update) {
|
|
179
179
|
const ix = (0, reflect_main_1.createUpdateActionRoleStrategyInstruction)({
|
|
180
180
|
admin: signer,
|
|
181
|
-
adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer),
|
|
182
|
-
main: PdaClient_1.PdaClient.deriveMain(),
|
|
181
|
+
adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer, this.devnet),
|
|
182
|
+
main: PdaClient_1.PdaClient.deriveMain(this.devnet),
|
|
183
183
|
systemProgram: web3_js_1.SystemProgram.programId,
|
|
184
|
-
strategy: PdaClient_1.PdaClient.deriveController(strategyId),
|
|
184
|
+
strategy: PdaClient_1.PdaClient.deriveController(strategyId, this.devnet),
|
|
185
185
|
}, {
|
|
186
186
|
update,
|
|
187
187
|
role: affectedRole,
|
|
@@ -201,8 +201,8 @@ class ReflectKeeper {
|
|
|
201
201
|
updateActionRoleProtocol(signer, action, affectedRole, update) {
|
|
202
202
|
const ix = (0, reflect_main_1.createUpdateActionRoleProtocolInstruction)({
|
|
203
203
|
admin: signer,
|
|
204
|
-
adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer),
|
|
205
|
-
main: PdaClient_1.PdaClient.deriveMain(),
|
|
204
|
+
adminPermissions: PdaClient_1.PdaClient.derivePermissions(signer, this.devnet),
|
|
205
|
+
main: PdaClient_1.PdaClient.deriveMain(this.devnet),
|
|
206
206
|
systemProgram: web3_js_1.SystemProgram.programId,
|
|
207
207
|
}, {
|
|
208
208
|
action,
|