@streamflow/staking 8.2.1 → 8.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/README.md +103 -17
- package/dist/cjs/index.cjs +3493 -352
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +1827 -16
- package/dist/cjs/solana/descriptor/fee_manager.d.cts +303 -151
- package/dist/cjs/solana/descriptor/reward_pool.d.cts +1095 -513
- package/dist/cjs/solana/descriptor/stake_pool.d.cts +1055 -539
- package/dist/esm/index.d.ts +1827 -16
- package/dist/esm/index.js +3494 -353
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/descriptor/fee_manager.d.ts +303 -151
- package/dist/esm/solana/descriptor/idl/fee_manager.json +183 -31
- package/dist/esm/solana/descriptor/idl/reward_pool.json +745 -133
- package/dist/esm/solana/descriptor/idl/reward_pool_dynamic.json +1725 -0
- package/dist/esm/solana/descriptor/idl/stake_pool.json +623 -107
- package/dist/esm/solana/descriptor/reward_pool.d.ts +1095 -513
- package/dist/esm/solana/descriptor/stake_pool.d.ts +1055 -539
- package/package.json +6 -6
package/dist/cjs/index.d.cts
CHANGED
|
@@ -60,6 +60,7 @@ declare const REWARD_ENTRY_BYTE_OFFSETS: {
|
|
|
60
60
|
};
|
|
61
61
|
declare const STAKE_POOL_PROGRAM_ID: Record<ICluster, string>;
|
|
62
62
|
declare const REWARD_POOL_PROGRAM_ID: Record<ICluster, string>;
|
|
63
|
+
declare const REWARD_POOL_DYNAMIC_PROGRAM_ID: Record<ICluster, string>;
|
|
63
64
|
declare const FEE_PROGRAM_ID: Record<ICluster, string>;
|
|
64
65
|
|
|
65
66
|
declare const constants_ANCHOR_DISCRIMINATOR_OFFSET: typeof ANCHOR_DISCRIMINATOR_OFFSET;
|
|
@@ -78,6 +79,7 @@ declare const constants_REWARD_ENTRY_PREFIX: typeof REWARD_ENTRY_PREFIX;
|
|
|
78
79
|
declare const constants_REWARD_ENTRY_REWARD_POOL_OFFSET: typeof REWARD_ENTRY_REWARD_POOL_OFFSET;
|
|
79
80
|
declare const constants_REWARD_ENTRY_STAKE_ENTRY_OFFSET: typeof REWARD_ENTRY_STAKE_ENTRY_OFFSET;
|
|
80
81
|
declare const constants_REWARD_POOL_BYTE_OFFSETS: typeof REWARD_POOL_BYTE_OFFSETS;
|
|
82
|
+
declare const constants_REWARD_POOL_DYNAMIC_PROGRAM_ID: typeof REWARD_POOL_DYNAMIC_PROGRAM_ID;
|
|
81
83
|
declare const constants_REWARD_POOL_MINT_OFFSET: typeof REWARD_POOL_MINT_OFFSET;
|
|
82
84
|
declare const constants_REWARD_POOL_PREFIX: typeof REWARD_POOL_PREFIX;
|
|
83
85
|
declare const constants_REWARD_POOL_PROGRAM_ID: typeof REWARD_POOL_PROGRAM_ID;
|
|
@@ -101,9 +103,1741 @@ declare const constants_STAKE_VAULT_PREFIX: typeof STAKE_VAULT_PREFIX;
|
|
|
101
103
|
declare const constants_STREAMFLOW_TREASURY_PUBLIC_KEY: typeof STREAMFLOW_TREASURY_PUBLIC_KEY;
|
|
102
104
|
declare const constants_U64_MAX: typeof U64_MAX;
|
|
103
105
|
declare namespace constants {
|
|
104
|
-
export { constants_ANCHOR_DISCRIMINATOR_OFFSET as ANCHOR_DISCRIMINATOR_OFFSET, constants_CONFIG_PREFIX as CONFIG_PREFIX, constants_DEFAULT_FEE as DEFAULT_FEE, constants_DEFAULT_FEE_BN as DEFAULT_FEE_BN, constants_FEE_PRECISION_FACTOR as FEE_PRECISION_FACTOR, constants_FEE_PRECISION_FACTOR_BN as FEE_PRECISION_FACTOR_BN, constants_FEE_PROGRAM_ID as FEE_PROGRAM_ID, constants_FEE_VALUE_PREFIX as FEE_VALUE_PREFIX, constants_REWARD_AMOUNT_DECIMALS as REWARD_AMOUNT_DECIMALS, constants_REWARD_AMOUNT_PRECISION_FACTOR as REWARD_AMOUNT_PRECISION_FACTOR, constants_REWARD_AMOUNT_PRECISION_FACTOR_BN as REWARD_AMOUNT_PRECISION_FACTOR_BN, constants_REWARD_ENTRY_BYTE_OFFSETS as REWARD_ENTRY_BYTE_OFFSETS, constants_REWARD_ENTRY_PREFIX as REWARD_ENTRY_PREFIX, constants_REWARD_ENTRY_REWARD_POOL_OFFSET as REWARD_ENTRY_REWARD_POOL_OFFSET, constants_REWARD_ENTRY_STAKE_ENTRY_OFFSET as REWARD_ENTRY_STAKE_ENTRY_OFFSET, constants_REWARD_POOL_BYTE_OFFSETS as REWARD_POOL_BYTE_OFFSETS, constants_REWARD_POOL_MINT_OFFSET as REWARD_POOL_MINT_OFFSET, constants_REWARD_POOL_PREFIX as REWARD_POOL_PREFIX, constants_REWARD_POOL_PROGRAM_ID as REWARD_POOL_PROGRAM_ID, constants_REWARD_POOL_STAKE_POOL_OFFSET as REWARD_POOL_STAKE_POOL_OFFSET, constants_REWARD_VAULT_PREFIX as REWARD_VAULT_PREFIX, constants_SCALE_PRECISION_FACTOR as SCALE_PRECISION_FACTOR, constants_SCALE_PRECISION_FACTOR_BN as SCALE_PRECISION_FACTOR_BN, constants_STAKE_ENTRY_BYTE_OFFSETS as STAKE_ENTRY_BYTE_OFFSETS, constants_STAKE_ENTRY_DISCRIMINATOR as STAKE_ENTRY_DISCRIMINATOR, constants_STAKE_ENTRY_OWNER_OFFSET as STAKE_ENTRY_OWNER_OFFSET, constants_STAKE_ENTRY_PAYER_OFFSET as STAKE_ENTRY_PAYER_OFFSET, constants_STAKE_ENTRY_PREFIX as STAKE_ENTRY_PREFIX, constants_STAKE_ENTRY_STAKE_POOL_OFFSET as STAKE_ENTRY_STAKE_POOL_OFFSET, constants_STAKE_MINT_PREFIX as STAKE_MINT_PREFIX, constants_STAKE_POOL_BYTE_OFFSETS as STAKE_POOL_BYTE_OFFSETS, constants_STAKE_POOL_CREATOR_OFFSET as STAKE_POOL_CREATOR_OFFSET, constants_STAKE_POOL_MINT_OFFSET as STAKE_POOL_MINT_OFFSET, constants_STAKE_POOL_PREFIX as STAKE_POOL_PREFIX, constants_STAKE_POOL_PROGRAM_ID as STAKE_POOL_PROGRAM_ID, constants_STAKE_VAULT_PREFIX as STAKE_VAULT_PREFIX, constants_STREAMFLOW_TREASURY_PUBLIC_KEY as STREAMFLOW_TREASURY_PUBLIC_KEY, constants_U64_MAX as U64_MAX };
|
|
106
|
+
export { constants_ANCHOR_DISCRIMINATOR_OFFSET as ANCHOR_DISCRIMINATOR_OFFSET, constants_CONFIG_PREFIX as CONFIG_PREFIX, constants_DEFAULT_FEE as DEFAULT_FEE, constants_DEFAULT_FEE_BN as DEFAULT_FEE_BN, constants_FEE_PRECISION_FACTOR as FEE_PRECISION_FACTOR, constants_FEE_PRECISION_FACTOR_BN as FEE_PRECISION_FACTOR_BN, constants_FEE_PROGRAM_ID as FEE_PROGRAM_ID, constants_FEE_VALUE_PREFIX as FEE_VALUE_PREFIX, constants_REWARD_AMOUNT_DECIMALS as REWARD_AMOUNT_DECIMALS, constants_REWARD_AMOUNT_PRECISION_FACTOR as REWARD_AMOUNT_PRECISION_FACTOR, constants_REWARD_AMOUNT_PRECISION_FACTOR_BN as REWARD_AMOUNT_PRECISION_FACTOR_BN, constants_REWARD_ENTRY_BYTE_OFFSETS as REWARD_ENTRY_BYTE_OFFSETS, constants_REWARD_ENTRY_PREFIX as REWARD_ENTRY_PREFIX, constants_REWARD_ENTRY_REWARD_POOL_OFFSET as REWARD_ENTRY_REWARD_POOL_OFFSET, constants_REWARD_ENTRY_STAKE_ENTRY_OFFSET as REWARD_ENTRY_STAKE_ENTRY_OFFSET, constants_REWARD_POOL_BYTE_OFFSETS as REWARD_POOL_BYTE_OFFSETS, constants_REWARD_POOL_DYNAMIC_PROGRAM_ID as REWARD_POOL_DYNAMIC_PROGRAM_ID, constants_REWARD_POOL_MINT_OFFSET as REWARD_POOL_MINT_OFFSET, constants_REWARD_POOL_PREFIX as REWARD_POOL_PREFIX, constants_REWARD_POOL_PROGRAM_ID as REWARD_POOL_PROGRAM_ID, constants_REWARD_POOL_STAKE_POOL_OFFSET as REWARD_POOL_STAKE_POOL_OFFSET, constants_REWARD_VAULT_PREFIX as REWARD_VAULT_PREFIX, constants_SCALE_PRECISION_FACTOR as SCALE_PRECISION_FACTOR, constants_SCALE_PRECISION_FACTOR_BN as SCALE_PRECISION_FACTOR_BN, constants_STAKE_ENTRY_BYTE_OFFSETS as STAKE_ENTRY_BYTE_OFFSETS, constants_STAKE_ENTRY_DISCRIMINATOR as STAKE_ENTRY_DISCRIMINATOR, constants_STAKE_ENTRY_OWNER_OFFSET as STAKE_ENTRY_OWNER_OFFSET, constants_STAKE_ENTRY_PAYER_OFFSET as STAKE_ENTRY_PAYER_OFFSET, constants_STAKE_ENTRY_PREFIX as STAKE_ENTRY_PREFIX, constants_STAKE_ENTRY_STAKE_POOL_OFFSET as STAKE_ENTRY_STAKE_POOL_OFFSET, constants_STAKE_MINT_PREFIX as STAKE_MINT_PREFIX, constants_STAKE_POOL_BYTE_OFFSETS as STAKE_POOL_BYTE_OFFSETS, constants_STAKE_POOL_CREATOR_OFFSET as STAKE_POOL_CREATOR_OFFSET, constants_STAKE_POOL_MINT_OFFSET as STAKE_POOL_MINT_OFFSET, constants_STAKE_POOL_PREFIX as STAKE_POOL_PREFIX, constants_STAKE_POOL_PROGRAM_ID as STAKE_POOL_PROGRAM_ID, constants_STAKE_VAULT_PREFIX as STAKE_VAULT_PREFIX, constants_STREAMFLOW_TREASURY_PUBLIC_KEY as STREAMFLOW_TREASURY_PUBLIC_KEY, constants_U64_MAX as U64_MAX };
|
|
105
107
|
}
|
|
106
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Program IDL in camelCase format in order to be used in JS/TS.
|
|
111
|
+
*
|
|
112
|
+
* Note that this is only a type helper and is not the actual IDL. The original
|
|
113
|
+
* IDL can be found at `target/idl/reward_pool_dynamic.json`.
|
|
114
|
+
*/
|
|
115
|
+
type RewardPoolDynamic = {
|
|
116
|
+
"address": "RWRDyfZa6Rk9UYi85yjYYfGmoUqffLqjo6vZdFawEez";
|
|
117
|
+
"metadata": {
|
|
118
|
+
"name": "rewardPoolDynamic";
|
|
119
|
+
"version": "2.2.0";
|
|
120
|
+
"spec": "0.1.0";
|
|
121
|
+
"description": "Reward pools with dynamic rewards distribution";
|
|
122
|
+
};
|
|
123
|
+
"instructions": [
|
|
124
|
+
{
|
|
125
|
+
"name": "changeAuthority";
|
|
126
|
+
"discriminator": [
|
|
127
|
+
50,
|
|
128
|
+
106,
|
|
129
|
+
66,
|
|
130
|
+
104,
|
|
131
|
+
99,
|
|
132
|
+
118,
|
|
133
|
+
145,
|
|
134
|
+
88
|
|
135
|
+
];
|
|
136
|
+
"accounts": [
|
|
137
|
+
{
|
|
138
|
+
"name": "rewardPool";
|
|
139
|
+
"docs": [
|
|
140
|
+
"Reward Pool"
|
|
141
|
+
];
|
|
142
|
+
"writable": true;
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"name": "authority";
|
|
146
|
+
"docs": [
|
|
147
|
+
"Current Authority"
|
|
148
|
+
];
|
|
149
|
+
"writable": true;
|
|
150
|
+
"signer": true;
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "newAuthority";
|
|
154
|
+
}
|
|
155
|
+
];
|
|
156
|
+
"args": [];
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "claimRewards";
|
|
160
|
+
"discriminator": [
|
|
161
|
+
4,
|
|
162
|
+
144,
|
|
163
|
+
132,
|
|
164
|
+
71,
|
|
165
|
+
116,
|
|
166
|
+
23,
|
|
167
|
+
151,
|
|
168
|
+
80
|
|
169
|
+
];
|
|
170
|
+
"accounts": [
|
|
171
|
+
{
|
|
172
|
+
"name": "stakePool";
|
|
173
|
+
"docs": [
|
|
174
|
+
"Original Stake Pool"
|
|
175
|
+
];
|
|
176
|
+
"relations": [
|
|
177
|
+
"rewardPool"
|
|
178
|
+
];
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"name": "rewardPool";
|
|
182
|
+
"docs": [
|
|
183
|
+
"Reward Pool"
|
|
184
|
+
];
|
|
185
|
+
"writable": true;
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"name": "stakeEntry";
|
|
189
|
+
"docs": [
|
|
190
|
+
"Stake Entry for which rewards are being claimed"
|
|
191
|
+
];
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"name": "rewardEntry";
|
|
195
|
+
"docs": [
|
|
196
|
+
"Reward Entry that stores metadata about claimed rewards"
|
|
197
|
+
];
|
|
198
|
+
"writable": true;
|
|
199
|
+
"pda": {
|
|
200
|
+
"seeds": [
|
|
201
|
+
{
|
|
202
|
+
"kind": "const";
|
|
203
|
+
"value": [
|
|
204
|
+
114,
|
|
205
|
+
101,
|
|
206
|
+
119,
|
|
207
|
+
97,
|
|
208
|
+
114,
|
|
209
|
+
100,
|
|
210
|
+
45,
|
|
211
|
+
101,
|
|
212
|
+
110,
|
|
213
|
+
116,
|
|
214
|
+
114,
|
|
215
|
+
121
|
|
216
|
+
];
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"kind": "account";
|
|
220
|
+
"path": "rewardPool";
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"kind": "account";
|
|
224
|
+
"path": "stakeEntry";
|
|
225
|
+
}
|
|
226
|
+
];
|
|
227
|
+
};
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"name": "vault";
|
|
231
|
+
"docs": [
|
|
232
|
+
"Reward Pool Vault that stores tokens"
|
|
233
|
+
];
|
|
234
|
+
"writable": true;
|
|
235
|
+
"relations": [
|
|
236
|
+
"rewardPool"
|
|
237
|
+
];
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"name": "to";
|
|
241
|
+
"docs": [
|
|
242
|
+
"Account to send the reward tokens to."
|
|
243
|
+
];
|
|
244
|
+
"writable": true;
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"name": "claimant";
|
|
248
|
+
"docs": [
|
|
249
|
+
"Who is claiming the tokens."
|
|
250
|
+
];
|
|
251
|
+
"writable": true;
|
|
252
|
+
"signer": true;
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"name": "mint";
|
|
256
|
+
"docs": [
|
|
257
|
+
"The mint to claim."
|
|
258
|
+
];
|
|
259
|
+
"relations": [
|
|
260
|
+
"rewardPool"
|
|
261
|
+
];
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"name": "governor";
|
|
265
|
+
"docs": [
|
|
266
|
+
"Reward Pool governor"
|
|
267
|
+
];
|
|
268
|
+
"optional": true;
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"name": "vote";
|
|
272
|
+
"docs": [
|
|
273
|
+
"Vote for the active proposal"
|
|
274
|
+
];
|
|
275
|
+
"optional": true;
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"name": "tokenProgram";
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"name": "systemProgram";
|
|
282
|
+
"address": "11111111111111111111111111111111";
|
|
283
|
+
}
|
|
284
|
+
];
|
|
285
|
+
"args": [];
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"name": "closeEntry";
|
|
289
|
+
"discriminator": [
|
|
290
|
+
132,
|
|
291
|
+
26,
|
|
292
|
+
202,
|
|
293
|
+
145,
|
|
294
|
+
190,
|
|
295
|
+
37,
|
|
296
|
+
114,
|
|
297
|
+
67
|
|
298
|
+
];
|
|
299
|
+
"accounts": [
|
|
300
|
+
{
|
|
301
|
+
"name": "stakePool";
|
|
302
|
+
"docs": [
|
|
303
|
+
"Stake Pool"
|
|
304
|
+
];
|
|
305
|
+
"relations": [
|
|
306
|
+
"rewardPool"
|
|
307
|
+
];
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"name": "rewardPool";
|
|
311
|
+
"docs": [
|
|
312
|
+
"Reward Pool"
|
|
313
|
+
];
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"name": "stakeEntry";
|
|
317
|
+
"pda": {
|
|
318
|
+
"seeds": [
|
|
319
|
+
{
|
|
320
|
+
"kind": "const";
|
|
321
|
+
"value": [
|
|
322
|
+
115,
|
|
323
|
+
116,
|
|
324
|
+
97,
|
|
325
|
+
107,
|
|
326
|
+
101,
|
|
327
|
+
45,
|
|
328
|
+
101,
|
|
329
|
+
110,
|
|
330
|
+
116,
|
|
331
|
+
114,
|
|
332
|
+
121
|
|
333
|
+
];
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"kind": "account";
|
|
337
|
+
"path": "stakePool";
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"kind": "account";
|
|
341
|
+
"path": "authority";
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"kind": "arg";
|
|
345
|
+
"path": "stakeNonce";
|
|
346
|
+
}
|
|
347
|
+
];
|
|
348
|
+
"program": {
|
|
349
|
+
"kind": "const";
|
|
350
|
+
"value": [
|
|
351
|
+
6,
|
|
352
|
+
133,
|
|
353
|
+
25,
|
|
354
|
+
160,
|
|
355
|
+
130,
|
|
356
|
+
0,
|
|
357
|
+
119,
|
|
358
|
+
110,
|
|
359
|
+
227,
|
|
360
|
+
8,
|
|
361
|
+
28,
|
|
362
|
+
85,
|
|
363
|
+
214,
|
|
364
|
+
116,
|
|
365
|
+
67,
|
|
366
|
+
41,
|
|
367
|
+
155,
|
|
368
|
+
152,
|
|
369
|
+
181,
|
|
370
|
+
139,
|
|
371
|
+
124,
|
|
372
|
+
208,
|
|
373
|
+
85,
|
|
374
|
+
71,
|
|
375
|
+
175,
|
|
376
|
+
40,
|
|
377
|
+
123,
|
|
378
|
+
71,
|
|
379
|
+
139,
|
|
380
|
+
170,
|
|
381
|
+
201,
|
|
382
|
+
178
|
|
383
|
+
];
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"name": "rewardEntry";
|
|
389
|
+
"docs": [
|
|
390
|
+
"Reward Entry that stores metadata about claimed rewards"
|
|
391
|
+
];
|
|
392
|
+
"writable": true;
|
|
393
|
+
"pda": {
|
|
394
|
+
"seeds": [
|
|
395
|
+
{
|
|
396
|
+
"kind": "const";
|
|
397
|
+
"value": [
|
|
398
|
+
114,
|
|
399
|
+
101,
|
|
400
|
+
119,
|
|
401
|
+
97,
|
|
402
|
+
114,
|
|
403
|
+
100,
|
|
404
|
+
45,
|
|
405
|
+
101,
|
|
406
|
+
110,
|
|
407
|
+
116,
|
|
408
|
+
114,
|
|
409
|
+
121
|
|
410
|
+
];
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
"kind": "account";
|
|
414
|
+
"path": "rewardPool";
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
"kind": "account";
|
|
418
|
+
"path": "stakeEntry";
|
|
419
|
+
}
|
|
420
|
+
];
|
|
421
|
+
};
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"name": "authority";
|
|
425
|
+
"writable": true;
|
|
426
|
+
"signer": true;
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"name": "rentSponsor";
|
|
430
|
+
"writable": true;
|
|
431
|
+
"pda": {
|
|
432
|
+
"seeds": [
|
|
433
|
+
{
|
|
434
|
+
"kind": "const";
|
|
435
|
+
"value": [
|
|
436
|
+
114,
|
|
437
|
+
101,
|
|
438
|
+
110,
|
|
439
|
+
116,
|
|
440
|
+
45,
|
|
441
|
+
115,
|
|
442
|
+
112,
|
|
443
|
+
111,
|
|
444
|
+
110,
|
|
445
|
+
115,
|
|
446
|
+
111,
|
|
447
|
+
114
|
|
448
|
+
];
|
|
449
|
+
}
|
|
450
|
+
];
|
|
451
|
+
};
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"name": "systemProgram";
|
|
455
|
+
"address": "11111111111111111111111111111111";
|
|
456
|
+
}
|
|
457
|
+
];
|
|
458
|
+
"args": [
|
|
459
|
+
{
|
|
460
|
+
"name": "stakeNonce";
|
|
461
|
+
"type": "u32";
|
|
462
|
+
}
|
|
463
|
+
];
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
"name": "createEntry";
|
|
467
|
+
"discriminator": [
|
|
468
|
+
248,
|
|
469
|
+
207,
|
|
470
|
+
142,
|
|
471
|
+
242,
|
|
472
|
+
66,
|
|
473
|
+
162,
|
|
474
|
+
150,
|
|
475
|
+
16
|
|
476
|
+
];
|
|
477
|
+
"accounts": [
|
|
478
|
+
{
|
|
479
|
+
"name": "stakePool";
|
|
480
|
+
"docs": [
|
|
481
|
+
"Original Stake Pool"
|
|
482
|
+
];
|
|
483
|
+
"relations": [
|
|
484
|
+
"rewardPool",
|
|
485
|
+
"stakeEntry"
|
|
486
|
+
];
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
"name": "rewardPool";
|
|
490
|
+
"docs": [
|
|
491
|
+
"Reward Pool"
|
|
492
|
+
];
|
|
493
|
+
"writable": true;
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"name": "stakeEntry";
|
|
497
|
+
"docs": [
|
|
498
|
+
"Stake Entry for which rewards are being claimed"
|
|
499
|
+
];
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"name": "rewardEntry";
|
|
503
|
+
"docs": [
|
|
504
|
+
"Reward Entry that stores metadata about claimed rewards"
|
|
505
|
+
];
|
|
506
|
+
"writable": true;
|
|
507
|
+
"pda": {
|
|
508
|
+
"seeds": [
|
|
509
|
+
{
|
|
510
|
+
"kind": "const";
|
|
511
|
+
"value": [
|
|
512
|
+
114,
|
|
513
|
+
101,
|
|
514
|
+
119,
|
|
515
|
+
97,
|
|
516
|
+
114,
|
|
517
|
+
100,
|
|
518
|
+
45,
|
|
519
|
+
101,
|
|
520
|
+
110,
|
|
521
|
+
116,
|
|
522
|
+
114,
|
|
523
|
+
121
|
|
524
|
+
];
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
"kind": "account";
|
|
528
|
+
"path": "rewardPool";
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
"kind": "account";
|
|
532
|
+
"path": "stakeEntry";
|
|
533
|
+
}
|
|
534
|
+
];
|
|
535
|
+
};
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
"name": "payer";
|
|
539
|
+
"docs": [
|
|
540
|
+
"Rent payer"
|
|
541
|
+
];
|
|
542
|
+
"writable": true;
|
|
543
|
+
"signer": true;
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
"name": "authority";
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"name": "rentSponsor";
|
|
550
|
+
"writable": true;
|
|
551
|
+
"pda": {
|
|
552
|
+
"seeds": [
|
|
553
|
+
{
|
|
554
|
+
"kind": "const";
|
|
555
|
+
"value": [
|
|
556
|
+
114,
|
|
557
|
+
101,
|
|
558
|
+
110,
|
|
559
|
+
116,
|
|
560
|
+
45,
|
|
561
|
+
115,
|
|
562
|
+
112,
|
|
563
|
+
111,
|
|
564
|
+
110,
|
|
565
|
+
115,
|
|
566
|
+
111,
|
|
567
|
+
114
|
|
568
|
+
];
|
|
569
|
+
}
|
|
570
|
+
];
|
|
571
|
+
};
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
"name": "systemProgram";
|
|
575
|
+
"address": "11111111111111111111111111111111";
|
|
576
|
+
}
|
|
577
|
+
];
|
|
578
|
+
"args": [];
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"name": "createPool";
|
|
582
|
+
"discriminator": [
|
|
583
|
+
233,
|
|
584
|
+
146,
|
|
585
|
+
209,
|
|
586
|
+
142,
|
|
587
|
+
207,
|
|
588
|
+
104,
|
|
589
|
+
64,
|
|
590
|
+
188
|
|
591
|
+
];
|
|
592
|
+
"accounts": [
|
|
593
|
+
{
|
|
594
|
+
"name": "stakePool";
|
|
595
|
+
"docs": [
|
|
596
|
+
"Stake Pool to Which Reward Pool is being added"
|
|
597
|
+
];
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
"name": "rewardPool";
|
|
601
|
+
"docs": [
|
|
602
|
+
"Reward Pool to add"
|
|
603
|
+
];
|
|
604
|
+
"writable": true;
|
|
605
|
+
"pda": {
|
|
606
|
+
"seeds": [
|
|
607
|
+
{
|
|
608
|
+
"kind": "const";
|
|
609
|
+
"value": [
|
|
610
|
+
114,
|
|
611
|
+
101,
|
|
612
|
+
119,
|
|
613
|
+
97,
|
|
614
|
+
114,
|
|
615
|
+
100,
|
|
616
|
+
45,
|
|
617
|
+
112,
|
|
618
|
+
111,
|
|
619
|
+
111,
|
|
620
|
+
108
|
|
621
|
+
];
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
"kind": "account";
|
|
625
|
+
"path": "stakePool";
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
"kind": "account";
|
|
629
|
+
"path": "mint";
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
"kind": "arg";
|
|
633
|
+
"path": "nonce";
|
|
634
|
+
}
|
|
635
|
+
];
|
|
636
|
+
};
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
"name": "mint";
|
|
640
|
+
"docs": [
|
|
641
|
+
"Mint used for rewards"
|
|
642
|
+
];
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
"name": "vault";
|
|
646
|
+
"docs": [
|
|
647
|
+
"Escrow Account that will store the tokens"
|
|
648
|
+
];
|
|
649
|
+
"writable": true;
|
|
650
|
+
"pda": {
|
|
651
|
+
"seeds": [
|
|
652
|
+
{
|
|
653
|
+
"kind": "const";
|
|
654
|
+
"value": [
|
|
655
|
+
114,
|
|
656
|
+
101,
|
|
657
|
+
119,
|
|
658
|
+
97,
|
|
659
|
+
114,
|
|
660
|
+
100,
|
|
661
|
+
45,
|
|
662
|
+
118,
|
|
663
|
+
97,
|
|
664
|
+
117,
|
|
665
|
+
108,
|
|
666
|
+
116
|
|
667
|
+
];
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
"kind": "account";
|
|
671
|
+
"path": "rewardPool";
|
|
672
|
+
}
|
|
673
|
+
];
|
|
674
|
+
};
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
"name": "governor";
|
|
678
|
+
"docs": [
|
|
679
|
+
"Governor to be set for the RewardPool"
|
|
680
|
+
];
|
|
681
|
+
"optional": true;
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
"name": "creator";
|
|
685
|
+
"docs": [
|
|
686
|
+
"Reward Pool creator"
|
|
687
|
+
];
|
|
688
|
+
"writable": true;
|
|
689
|
+
"signer": true;
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
"name": "tokenProgram";
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
"name": "systemProgram";
|
|
696
|
+
"address": "11111111111111111111111111111111";
|
|
697
|
+
}
|
|
698
|
+
];
|
|
699
|
+
"args": [
|
|
700
|
+
{
|
|
701
|
+
"name": "nonce";
|
|
702
|
+
"type": "u8";
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
"name": "permissionless";
|
|
706
|
+
"type": "bool";
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
"name": "claimPeriod";
|
|
710
|
+
"type": "u64";
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
"name": "claimStartTs";
|
|
714
|
+
"type": "u64";
|
|
715
|
+
}
|
|
716
|
+
];
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
"name": "fundPool";
|
|
720
|
+
"discriminator": [
|
|
721
|
+
36,
|
|
722
|
+
57,
|
|
723
|
+
233,
|
|
724
|
+
176,
|
|
725
|
+
181,
|
|
726
|
+
20,
|
|
727
|
+
87,
|
|
728
|
+
159
|
|
729
|
+
];
|
|
730
|
+
"accounts": [
|
|
731
|
+
{
|
|
732
|
+
"name": "funder";
|
|
733
|
+
"docs": [
|
|
734
|
+
"Reward Pool funder"
|
|
735
|
+
];
|
|
736
|
+
"writable": true;
|
|
737
|
+
"signer": true;
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
"name": "from";
|
|
741
|
+
"docs": [
|
|
742
|
+
"Token Account from which tokens will be transferred"
|
|
743
|
+
];
|
|
744
|
+
"writable": true;
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
"name": "vault";
|
|
748
|
+
"docs": [
|
|
749
|
+
"Reward Pool Vault that stores tokens"
|
|
750
|
+
];
|
|
751
|
+
"writable": true;
|
|
752
|
+
"relations": [
|
|
753
|
+
"rewardPool"
|
|
754
|
+
];
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
"name": "mint";
|
|
758
|
+
"docs": [
|
|
759
|
+
"Mint of reward tokens"
|
|
760
|
+
];
|
|
761
|
+
"relations": [
|
|
762
|
+
"rewardPool"
|
|
763
|
+
];
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
"name": "stakePool";
|
|
767
|
+
"docs": [
|
|
768
|
+
"Original Stake Pool"
|
|
769
|
+
];
|
|
770
|
+
"relations": [
|
|
771
|
+
"rewardPool"
|
|
772
|
+
];
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
"name": "rewardPool";
|
|
776
|
+
"docs": [
|
|
777
|
+
"Reward Pool"
|
|
778
|
+
];
|
|
779
|
+
"writable": true;
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
"name": "streamflowTreasury";
|
|
783
|
+
"writable": true;
|
|
784
|
+
"address": "5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw";
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
"name": "streamflowTreasuryTokens";
|
|
788
|
+
"writable": true;
|
|
789
|
+
"pda": {
|
|
790
|
+
"seeds": [
|
|
791
|
+
{
|
|
792
|
+
"kind": "account";
|
|
793
|
+
"path": "streamflowTreasury";
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
"kind": "account";
|
|
797
|
+
"path": "tokenProgram";
|
|
798
|
+
},
|
|
799
|
+
{
|
|
800
|
+
"kind": "account";
|
|
801
|
+
"path": "mint";
|
|
802
|
+
}
|
|
803
|
+
];
|
|
804
|
+
"program": {
|
|
805
|
+
"kind": "const";
|
|
806
|
+
"value": [
|
|
807
|
+
140,
|
|
808
|
+
151,
|
|
809
|
+
37,
|
|
810
|
+
143,
|
|
811
|
+
78,
|
|
812
|
+
36,
|
|
813
|
+
137,
|
|
814
|
+
241,
|
|
815
|
+
187,
|
|
816
|
+
61,
|
|
817
|
+
16,
|
|
818
|
+
41,
|
|
819
|
+
20,
|
|
820
|
+
142,
|
|
821
|
+
13,
|
|
822
|
+
131,
|
|
823
|
+
11,
|
|
824
|
+
90,
|
|
825
|
+
19,
|
|
826
|
+
153,
|
|
827
|
+
218,
|
|
828
|
+
255,
|
|
829
|
+
16,
|
|
830
|
+
132,
|
|
831
|
+
4,
|
|
832
|
+
142,
|
|
833
|
+
123,
|
|
834
|
+
216,
|
|
835
|
+
219,
|
|
836
|
+
233,
|
|
837
|
+
248,
|
|
838
|
+
89
|
|
839
|
+
];
|
|
840
|
+
};
|
|
841
|
+
};
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
"name": "config";
|
|
845
|
+
"docs": [
|
|
846
|
+
"Fee Configuration"
|
|
847
|
+
];
|
|
848
|
+
"pda": {
|
|
849
|
+
"seeds": [
|
|
850
|
+
{
|
|
851
|
+
"kind": "const";
|
|
852
|
+
"value": [
|
|
853
|
+
99,
|
|
854
|
+
111,
|
|
855
|
+
110,
|
|
856
|
+
102,
|
|
857
|
+
105,
|
|
858
|
+
103
|
|
859
|
+
];
|
|
860
|
+
}
|
|
861
|
+
];
|
|
862
|
+
"program": {
|
|
863
|
+
"kind": "account";
|
|
864
|
+
"path": "feeProgram";
|
|
865
|
+
};
|
|
866
|
+
};
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
"name": "feeValue";
|
|
870
|
+
"docs": [
|
|
871
|
+
"Fee Value for the funder account"
|
|
872
|
+
];
|
|
873
|
+
"optional": true;
|
|
874
|
+
"pda": {
|
|
875
|
+
"seeds": [
|
|
876
|
+
{
|
|
877
|
+
"kind": "const";
|
|
878
|
+
"value": [
|
|
879
|
+
102,
|
|
880
|
+
101,
|
|
881
|
+
101,
|
|
882
|
+
45,
|
|
883
|
+
118,
|
|
884
|
+
97,
|
|
885
|
+
108,
|
|
886
|
+
117,
|
|
887
|
+
101
|
|
888
|
+
];
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
"kind": "account";
|
|
892
|
+
"path": "funder";
|
|
893
|
+
}
|
|
894
|
+
];
|
|
895
|
+
"program": {
|
|
896
|
+
"kind": "account";
|
|
897
|
+
"path": "feeProgram";
|
|
898
|
+
};
|
|
899
|
+
};
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
"name": "feeProgram";
|
|
903
|
+
"address": "FEELzfBhsWXTNJX53zZcDVfRNoFYZQ6cZA3jLiGVL16V";
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
"name": "tokenProgram";
|
|
907
|
+
}
|
|
908
|
+
];
|
|
909
|
+
"args": [
|
|
910
|
+
{
|
|
911
|
+
"name": "amount";
|
|
912
|
+
"type": "u64";
|
|
913
|
+
}
|
|
914
|
+
];
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
"name": "setGovernor";
|
|
918
|
+
"discriminator": [
|
|
919
|
+
47,
|
|
920
|
+
75,
|
|
921
|
+
9,
|
|
922
|
+
199,
|
|
923
|
+
215,
|
|
924
|
+
187,
|
|
925
|
+
161,
|
|
926
|
+
161
|
|
927
|
+
];
|
|
928
|
+
"accounts": [
|
|
929
|
+
{
|
|
930
|
+
"name": "stakePool";
|
|
931
|
+
"docs": [
|
|
932
|
+
"Stake Pool - to verify the governor belongs to the same stake pool"
|
|
933
|
+
];
|
|
934
|
+
"relations": [
|
|
935
|
+
"rewardPool",
|
|
936
|
+
"governor"
|
|
937
|
+
];
|
|
938
|
+
},
|
|
939
|
+
{
|
|
940
|
+
"name": "rewardPool";
|
|
941
|
+
"docs": [
|
|
942
|
+
"Reward Pool - to be updated with new governor"
|
|
943
|
+
];
|
|
944
|
+
"writable": true;
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
"name": "governor";
|
|
948
|
+
"docs": [
|
|
949
|
+
"New Governor to be set for the RewardPool"
|
|
950
|
+
];
|
|
951
|
+
},
|
|
952
|
+
{
|
|
953
|
+
"name": "authority";
|
|
954
|
+
"docs": [
|
|
955
|
+
"Current Authority - only authority can set the governor"
|
|
956
|
+
];
|
|
957
|
+
"writable": true;
|
|
958
|
+
"signer": true;
|
|
959
|
+
}
|
|
960
|
+
];
|
|
961
|
+
"args": [];
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
"name": "updatePool";
|
|
965
|
+
"discriminator": [
|
|
966
|
+
239,
|
|
967
|
+
214,
|
|
968
|
+
170,
|
|
969
|
+
78,
|
|
970
|
+
36,
|
|
971
|
+
35,
|
|
972
|
+
30,
|
|
973
|
+
34
|
|
974
|
+
];
|
|
975
|
+
"accounts": [
|
|
976
|
+
{
|
|
977
|
+
"name": "authority";
|
|
978
|
+
"docs": [
|
|
979
|
+
"Current Authority"
|
|
980
|
+
];
|
|
981
|
+
"writable": true;
|
|
982
|
+
"signer": true;
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
"name": "rewardPool";
|
|
986
|
+
"docs": [
|
|
987
|
+
"Reward Pool"
|
|
988
|
+
];
|
|
989
|
+
"writable": true;
|
|
990
|
+
}
|
|
991
|
+
];
|
|
992
|
+
"args": [
|
|
993
|
+
{
|
|
994
|
+
"name": "claimPeriod";
|
|
995
|
+
"type": {
|
|
996
|
+
"option": "u64";
|
|
997
|
+
};
|
|
998
|
+
},
|
|
999
|
+
{
|
|
1000
|
+
"name": "permissionless";
|
|
1001
|
+
"type": {
|
|
1002
|
+
"option": "bool";
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
];
|
|
1006
|
+
}
|
|
1007
|
+
];
|
|
1008
|
+
"accounts": [
|
|
1009
|
+
{
|
|
1010
|
+
"name": "config";
|
|
1011
|
+
"discriminator": [
|
|
1012
|
+
155,
|
|
1013
|
+
12,
|
|
1014
|
+
170,
|
|
1015
|
+
224,
|
|
1016
|
+
30,
|
|
1017
|
+
250,
|
|
1018
|
+
204,
|
|
1019
|
+
130
|
|
1020
|
+
];
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
"name": "feeValue";
|
|
1024
|
+
"discriminator": [
|
|
1025
|
+
10,
|
|
1026
|
+
188,
|
|
1027
|
+
89,
|
|
1028
|
+
64,
|
|
1029
|
+
4,
|
|
1030
|
+
183,
|
|
1031
|
+
231,
|
|
1032
|
+
0
|
|
1033
|
+
];
|
|
1034
|
+
},
|
|
1035
|
+
{
|
|
1036
|
+
"name": "governor";
|
|
1037
|
+
"discriminator": [
|
|
1038
|
+
37,
|
|
1039
|
+
136,
|
|
1040
|
+
44,
|
|
1041
|
+
80,
|
|
1042
|
+
68,
|
|
1043
|
+
85,
|
|
1044
|
+
213,
|
|
1045
|
+
178
|
|
1046
|
+
];
|
|
1047
|
+
},
|
|
1048
|
+
{
|
|
1049
|
+
"name": "rewardEntry";
|
|
1050
|
+
"discriminator": [
|
|
1051
|
+
208,
|
|
1052
|
+
191,
|
|
1053
|
+
173,
|
|
1054
|
+
14,
|
|
1055
|
+
213,
|
|
1056
|
+
84,
|
|
1057
|
+
179,
|
|
1058
|
+
162
|
|
1059
|
+
];
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
"name": "rewardPool";
|
|
1063
|
+
"discriminator": [
|
|
1064
|
+
134,
|
|
1065
|
+
121,
|
|
1066
|
+
197,
|
|
1067
|
+
211,
|
|
1068
|
+
133,
|
|
1069
|
+
154,
|
|
1070
|
+
82,
|
|
1071
|
+
32
|
|
1072
|
+
];
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
"name": "stakeEntry";
|
|
1076
|
+
"discriminator": [
|
|
1077
|
+
187,
|
|
1078
|
+
127,
|
|
1079
|
+
9,
|
|
1080
|
+
35,
|
|
1081
|
+
155,
|
|
1082
|
+
68,
|
|
1083
|
+
86,
|
|
1084
|
+
40
|
|
1085
|
+
];
|
|
1086
|
+
},
|
|
1087
|
+
{
|
|
1088
|
+
"name": "stakePool";
|
|
1089
|
+
"discriminator": [
|
|
1090
|
+
121,
|
|
1091
|
+
34,
|
|
1092
|
+
206,
|
|
1093
|
+
21,
|
|
1094
|
+
79,
|
|
1095
|
+
127,
|
|
1096
|
+
255,
|
|
1097
|
+
28
|
|
1098
|
+
];
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
"name": "vote";
|
|
1102
|
+
"discriminator": [
|
|
1103
|
+
96,
|
|
1104
|
+
91,
|
|
1105
|
+
104,
|
|
1106
|
+
57,
|
|
1107
|
+
145,
|
|
1108
|
+
35,
|
|
1109
|
+
172,
|
|
1110
|
+
155
|
|
1111
|
+
];
|
|
1112
|
+
}
|
|
1113
|
+
];
|
|
1114
|
+
"errors": [
|
|
1115
|
+
{
|
|
1116
|
+
"code": 6000;
|
|
1117
|
+
"name": "arithmeticError";
|
|
1118
|
+
"msg": "Arithmetic Error (overflow/underflow)";
|
|
1119
|
+
},
|
|
1120
|
+
{
|
|
1121
|
+
"code": 6001;
|
|
1122
|
+
"name": "unauthorized";
|
|
1123
|
+
"msg": "Account is not authorized to execute this instruction";
|
|
1124
|
+
},
|
|
1125
|
+
{
|
|
1126
|
+
"code": 6002;
|
|
1127
|
+
"name": "ownerMismatch";
|
|
1128
|
+
"msg": "Token account owner did not match intended owner";
|
|
1129
|
+
},
|
|
1130
|
+
{
|
|
1131
|
+
"code": 6003;
|
|
1132
|
+
"name": "invalidRewardPool";
|
|
1133
|
+
"msg": "Provided Reward Pool is Invalid";
|
|
1134
|
+
},
|
|
1135
|
+
{
|
|
1136
|
+
"code": 6004;
|
|
1137
|
+
"name": "invalidRewardVault";
|
|
1138
|
+
"msg": "Incorrect vault for RewardPool";
|
|
1139
|
+
},
|
|
1140
|
+
{
|
|
1141
|
+
"code": 6005;
|
|
1142
|
+
"name": "invalidRewardEntry";
|
|
1143
|
+
"msg": "Provided Reward Entry is Invalid";
|
|
1144
|
+
},
|
|
1145
|
+
{
|
|
1146
|
+
"code": 6006;
|
|
1147
|
+
"name": "invalidStakeEntry";
|
|
1148
|
+
"msg": "Provided Stake Entry is Invalid";
|
|
1149
|
+
},
|
|
1150
|
+
{
|
|
1151
|
+
"code": 6007;
|
|
1152
|
+
"name": "invalidStakePool";
|
|
1153
|
+
"msg": "Provided Stake Pool does not equal the Governor Stake Pool";
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
"code": 6008;
|
|
1157
|
+
"name": "invalidMint";
|
|
1158
|
+
"msg": "Provided Mint does not equal the Pool Mint";
|
|
1159
|
+
},
|
|
1160
|
+
{
|
|
1161
|
+
"code": 6009;
|
|
1162
|
+
"name": "stakeEntryClosed";
|
|
1163
|
+
"msg": "Stake Entry is closed, rewards are not claimable anymore";
|
|
1164
|
+
},
|
|
1165
|
+
{
|
|
1166
|
+
"code": 6010;
|
|
1167
|
+
"name": "stakeEntryOpened";
|
|
1168
|
+
"msg": "Stake Entry is still opened, closing is not possible";
|
|
1169
|
+
},
|
|
1170
|
+
{
|
|
1171
|
+
"code": 6011;
|
|
1172
|
+
"name": "invalidClaimStartTs";
|
|
1173
|
+
"msg": "Invalid claim start ts provided";
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
"code": 6012;
|
|
1177
|
+
"name": "claimTooEarly";
|
|
1178
|
+
"msg": "Claiming is not possible until claim period has passed";
|
|
1179
|
+
},
|
|
1180
|
+
{
|
|
1181
|
+
"code": 6013;
|
|
1182
|
+
"name": "rewardPoolDrained";
|
|
1183
|
+
"msg": "Reward Pool does not have enough Rewards for Claiming";
|
|
1184
|
+
},
|
|
1185
|
+
{
|
|
1186
|
+
"code": 6014;
|
|
1187
|
+
"name": "invalidGovernor";
|
|
1188
|
+
"msg": "Provided governor is invalid";
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
"code": 6015;
|
|
1192
|
+
"name": "invalidVote";
|
|
1193
|
+
"msg": "Provided vote is invalid";
|
|
1194
|
+
},
|
|
1195
|
+
{
|
|
1196
|
+
"code": 6016;
|
|
1197
|
+
"name": "voteRequired";
|
|
1198
|
+
"msg": "Vote is required for claiming";
|
|
1199
|
+
}
|
|
1200
|
+
];
|
|
1201
|
+
"types": [
|
|
1202
|
+
{
|
|
1203
|
+
"name": "config";
|
|
1204
|
+
"type": {
|
|
1205
|
+
"kind": "struct";
|
|
1206
|
+
"fields": [
|
|
1207
|
+
{
|
|
1208
|
+
"name": "authority";
|
|
1209
|
+
"docs": [
|
|
1210
|
+
"Fee Manager authority"
|
|
1211
|
+
];
|
|
1212
|
+
"type": "pubkey";
|
|
1213
|
+
},
|
|
1214
|
+
{
|
|
1215
|
+
"name": "streamflowFee";
|
|
1216
|
+
"docs": [
|
|
1217
|
+
"Default fee"
|
|
1218
|
+
];
|
|
1219
|
+
"type": "u64";
|
|
1220
|
+
},
|
|
1221
|
+
{
|
|
1222
|
+
"name": "buffer1";
|
|
1223
|
+
"docs": [
|
|
1224
|
+
"Buffer for additional fields"
|
|
1225
|
+
];
|
|
1226
|
+
"type": {
|
|
1227
|
+
"array": [
|
|
1228
|
+
"u8",
|
|
1229
|
+
64
|
|
1230
|
+
];
|
|
1231
|
+
};
|
|
1232
|
+
},
|
|
1233
|
+
{
|
|
1234
|
+
"name": "buffer2";
|
|
1235
|
+
"docs": [
|
|
1236
|
+
"Buffer for additional fields"
|
|
1237
|
+
];
|
|
1238
|
+
"type": {
|
|
1239
|
+
"array": [
|
|
1240
|
+
"u8",
|
|
1241
|
+
64
|
|
1242
|
+
];
|
|
1243
|
+
};
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
"name": "buffer3";
|
|
1247
|
+
"docs": [
|
|
1248
|
+
"Buffer for additional fields"
|
|
1249
|
+
];
|
|
1250
|
+
"type": {
|
|
1251
|
+
"array": [
|
|
1252
|
+
"u8",
|
|
1253
|
+
64
|
|
1254
|
+
];
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
];
|
|
1258
|
+
};
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
"name": "feeValue";
|
|
1262
|
+
"type": {
|
|
1263
|
+
"kind": "struct";
|
|
1264
|
+
"fields": [
|
|
1265
|
+
{
|
|
1266
|
+
"name": "streamflowFee";
|
|
1267
|
+
"type": "u64";
|
|
1268
|
+
},
|
|
1269
|
+
{
|
|
1270
|
+
"name": "buffer";
|
|
1271
|
+
"docs": [
|
|
1272
|
+
"Buffer for additional fields"
|
|
1273
|
+
];
|
|
1274
|
+
"type": {
|
|
1275
|
+
"array": [
|
|
1276
|
+
"u8",
|
|
1277
|
+
64
|
|
1278
|
+
];
|
|
1279
|
+
};
|
|
1280
|
+
}
|
|
1281
|
+
];
|
|
1282
|
+
};
|
|
1283
|
+
},
|
|
1284
|
+
{
|
|
1285
|
+
"name": "governor";
|
|
1286
|
+
"type": {
|
|
1287
|
+
"kind": "struct";
|
|
1288
|
+
"fields": [
|
|
1289
|
+
{
|
|
1290
|
+
"name": "bump";
|
|
1291
|
+
"docs": [
|
|
1292
|
+
"Bump Seed used to sign transactions"
|
|
1293
|
+
];
|
|
1294
|
+
"type": "u8";
|
|
1295
|
+
},
|
|
1296
|
+
{
|
|
1297
|
+
"name": "nonce";
|
|
1298
|
+
"docs": [
|
|
1299
|
+
"Nonce to support multiple governors for the same pool"
|
|
1300
|
+
];
|
|
1301
|
+
"type": "u8";
|
|
1302
|
+
},
|
|
1303
|
+
{
|
|
1304
|
+
"name": "stakePool";
|
|
1305
|
+
"docs": [
|
|
1306
|
+
"Stake Pool for which Reward Pool was added"
|
|
1307
|
+
];
|
|
1308
|
+
"type": "pubkey";
|
|
1309
|
+
},
|
|
1310
|
+
{
|
|
1311
|
+
"name": "authority";
|
|
1312
|
+
"docs": [
|
|
1313
|
+
"Authority of the Governor that can add proposals and set the current one"
|
|
1314
|
+
];
|
|
1315
|
+
"type": "pubkey";
|
|
1316
|
+
},
|
|
1317
|
+
{
|
|
1318
|
+
"name": "currentProposal";
|
|
1319
|
+
"docs": [
|
|
1320
|
+
"Address of the current proposal"
|
|
1321
|
+
];
|
|
1322
|
+
"type": "pubkey";
|
|
1323
|
+
},
|
|
1324
|
+
{
|
|
1325
|
+
"name": "totalProposals";
|
|
1326
|
+
"docs": [
|
|
1327
|
+
"Total number of created proposals"
|
|
1328
|
+
];
|
|
1329
|
+
"type": "u64";
|
|
1330
|
+
},
|
|
1331
|
+
{
|
|
1332
|
+
"name": "buffer";
|
|
1333
|
+
"docs": [
|
|
1334
|
+
"Buffer for additional fields"
|
|
1335
|
+
];
|
|
1336
|
+
"type": {
|
|
1337
|
+
"array": [
|
|
1338
|
+
"u8",
|
|
1339
|
+
128
|
|
1340
|
+
];
|
|
1341
|
+
};
|
|
1342
|
+
}
|
|
1343
|
+
];
|
|
1344
|
+
};
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
"name": "rewardEntry";
|
|
1348
|
+
"type": {
|
|
1349
|
+
"kind": "struct";
|
|
1350
|
+
"fields": [
|
|
1351
|
+
{
|
|
1352
|
+
"name": "rewardPool";
|
|
1353
|
+
"docs": [
|
|
1354
|
+
"Reward Pool"
|
|
1355
|
+
];
|
|
1356
|
+
"type": "pubkey";
|
|
1357
|
+
},
|
|
1358
|
+
{
|
|
1359
|
+
"name": "stakeEntry";
|
|
1360
|
+
"docs": [
|
|
1361
|
+
"Stake Entry for which reward entry was initialized"
|
|
1362
|
+
];
|
|
1363
|
+
"type": "pubkey";
|
|
1364
|
+
},
|
|
1365
|
+
{
|
|
1366
|
+
"name": "createdTs";
|
|
1367
|
+
"docs": [
|
|
1368
|
+
"Timestamp when reward entry has been created"
|
|
1369
|
+
];
|
|
1370
|
+
"type": "u64";
|
|
1371
|
+
},
|
|
1372
|
+
{
|
|
1373
|
+
"name": "rewardsState";
|
|
1374
|
+
"docs": [
|
|
1375
|
+
"State of the reward disitrbution, accounts for the last state in the reward pool"
|
|
1376
|
+
];
|
|
1377
|
+
"type": "u128";
|
|
1378
|
+
},
|
|
1379
|
+
{
|
|
1380
|
+
"name": "claimedAmount";
|
|
1381
|
+
"docs": [
|
|
1382
|
+
"Sum of already claimed rewards"
|
|
1383
|
+
];
|
|
1384
|
+
"type": "u64";
|
|
1385
|
+
},
|
|
1386
|
+
{
|
|
1387
|
+
"name": "lastClaimedTs";
|
|
1388
|
+
"docs": [
|
|
1389
|
+
"Timestamp when rewards have been claimed last time"
|
|
1390
|
+
];
|
|
1391
|
+
"type": "u64";
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
"name": "isSponsored";
|
|
1395
|
+
"docs": [
|
|
1396
|
+
"Whether the entry rent has been sponsored by the rent vault"
|
|
1397
|
+
];
|
|
1398
|
+
"type": "bool";
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
"name": "buffer";
|
|
1402
|
+
"docs": [
|
|
1403
|
+
"Buffer for additional fields"
|
|
1404
|
+
];
|
|
1405
|
+
"type": {
|
|
1406
|
+
"array": [
|
|
1407
|
+
"u8",
|
|
1408
|
+
31
|
|
1409
|
+
];
|
|
1410
|
+
};
|
|
1411
|
+
}
|
|
1412
|
+
];
|
|
1413
|
+
};
|
|
1414
|
+
},
|
|
1415
|
+
{
|
|
1416
|
+
"name": "rewardPool";
|
|
1417
|
+
"type": {
|
|
1418
|
+
"kind": "struct";
|
|
1419
|
+
"fields": [
|
|
1420
|
+
{
|
|
1421
|
+
"name": "bump";
|
|
1422
|
+
"docs": [
|
|
1423
|
+
"Bump Seed used to sign transactions"
|
|
1424
|
+
];
|
|
1425
|
+
"type": "u8";
|
|
1426
|
+
},
|
|
1427
|
+
{
|
|
1428
|
+
"name": "nonce";
|
|
1429
|
+
"docs": [
|
|
1430
|
+
"Nonce to differentiate pools for the same mint"
|
|
1431
|
+
];
|
|
1432
|
+
"type": "u8";
|
|
1433
|
+
},
|
|
1434
|
+
{
|
|
1435
|
+
"name": "stakePool";
|
|
1436
|
+
"docs": [
|
|
1437
|
+
"Stake Pool for which Reward Pool was added"
|
|
1438
|
+
];
|
|
1439
|
+
"type": "pubkey";
|
|
1440
|
+
},
|
|
1441
|
+
{
|
|
1442
|
+
"name": "governor";
|
|
1443
|
+
"docs": [
|
|
1444
|
+
"Governor of the Stake Pool, should be passed at claiming if set"
|
|
1445
|
+
];
|
|
1446
|
+
"type": "pubkey";
|
|
1447
|
+
},
|
|
1448
|
+
{
|
|
1449
|
+
"name": "mint";
|
|
1450
|
+
"docs": [
|
|
1451
|
+
"Mint of Reward Pool"
|
|
1452
|
+
];
|
|
1453
|
+
"type": "pubkey";
|
|
1454
|
+
},
|
|
1455
|
+
{
|
|
1456
|
+
"name": "creator";
|
|
1457
|
+
"docs": [
|
|
1458
|
+
"Creator of the Pool"
|
|
1459
|
+
];
|
|
1460
|
+
"type": "pubkey";
|
|
1461
|
+
},
|
|
1462
|
+
{
|
|
1463
|
+
"name": "authority";
|
|
1464
|
+
"docs": [
|
|
1465
|
+
"Current authority"
|
|
1466
|
+
];
|
|
1467
|
+
"type": "pubkey";
|
|
1468
|
+
},
|
|
1469
|
+
{
|
|
1470
|
+
"name": "permissionless";
|
|
1471
|
+
"docs": [
|
|
1472
|
+
"Whether anyone can fund the Pool"
|
|
1473
|
+
];
|
|
1474
|
+
"type": "bool";
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
"name": "claimPeriod";
|
|
1478
|
+
"docs": [
|
|
1479
|
+
"Period of claims, may be used to block consecutive claims within the same period"
|
|
1480
|
+
];
|
|
1481
|
+
"type": "u64";
|
|
1482
|
+
},
|
|
1483
|
+
{
|
|
1484
|
+
"name": "claimStartTs";
|
|
1485
|
+
"docs": [
|
|
1486
|
+
"Time when claiming starts, will be used as a base timestamp if claim_period is set"
|
|
1487
|
+
];
|
|
1488
|
+
"type": "u64";
|
|
1489
|
+
},
|
|
1490
|
+
{
|
|
1491
|
+
"name": "vault";
|
|
1492
|
+
"docs": [
|
|
1493
|
+
"Escrow Account that stores reward tokens"
|
|
1494
|
+
];
|
|
1495
|
+
"type": "pubkey";
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
"name": "fundedAmount";
|
|
1499
|
+
"docs": [
|
|
1500
|
+
"Total funded amount"
|
|
1501
|
+
];
|
|
1502
|
+
"type": "u64";
|
|
1503
|
+
},
|
|
1504
|
+
{
|
|
1505
|
+
"name": "claimedAmount";
|
|
1506
|
+
"docs": [
|
|
1507
|
+
"Total number of rewards claimed"
|
|
1508
|
+
];
|
|
1509
|
+
"type": "u64";
|
|
1510
|
+
},
|
|
1511
|
+
{
|
|
1512
|
+
"name": "rewardsState";
|
|
1513
|
+
"docs": [
|
|
1514
|
+
"Ever increasing accumulator of the amount of rewards per effective stake.\n Said another way, if a user deposited before any rewards were added to the\n `vault`, then this would be the token amount per effective stake they could\n claim."
|
|
1515
|
+
];
|
|
1516
|
+
"type": "u128";
|
|
1517
|
+
},
|
|
1518
|
+
{
|
|
1519
|
+
"name": "lastAmount";
|
|
1520
|
+
"docs": [
|
|
1521
|
+
"latest amount of tokens in the vault"
|
|
1522
|
+
];
|
|
1523
|
+
"type": "u64";
|
|
1524
|
+
},
|
|
1525
|
+
{
|
|
1526
|
+
"name": "createdTs";
|
|
1527
|
+
"docs": [
|
|
1528
|
+
"Time when Reward Pool was created"
|
|
1529
|
+
];
|
|
1530
|
+
"type": "u64";
|
|
1531
|
+
},
|
|
1532
|
+
{
|
|
1533
|
+
"name": "buffer";
|
|
1534
|
+
"docs": [
|
|
1535
|
+
"Buffer for additional fields"
|
|
1536
|
+
];
|
|
1537
|
+
"type": {
|
|
1538
|
+
"array": [
|
|
1539
|
+
"u8",
|
|
1540
|
+
128
|
|
1541
|
+
];
|
|
1542
|
+
};
|
|
1543
|
+
}
|
|
1544
|
+
];
|
|
1545
|
+
};
|
|
1546
|
+
},
|
|
1547
|
+
{
|
|
1548
|
+
"name": "stakeEntry";
|
|
1549
|
+
"type": {
|
|
1550
|
+
"kind": "struct";
|
|
1551
|
+
"fields": [
|
|
1552
|
+
{
|
|
1553
|
+
"name": "nonce";
|
|
1554
|
+
"docs": [
|
|
1555
|
+
"Nonce to differentiate stakes for the same pool"
|
|
1556
|
+
];
|
|
1557
|
+
"type": "u32";
|
|
1558
|
+
},
|
|
1559
|
+
{
|
|
1560
|
+
"name": "stakePool";
|
|
1561
|
+
"docs": [
|
|
1562
|
+
"Stake Pool for which tokens were staked"
|
|
1563
|
+
];
|
|
1564
|
+
"type": "pubkey";
|
|
1565
|
+
},
|
|
1566
|
+
{
|
|
1567
|
+
"name": "payer";
|
|
1568
|
+
"docs": [
|
|
1569
|
+
"Original Owner of Staked tokens"
|
|
1570
|
+
];
|
|
1571
|
+
"type": "pubkey";
|
|
1572
|
+
},
|
|
1573
|
+
{
|
|
1574
|
+
"name": "authority";
|
|
1575
|
+
"docs": [
|
|
1576
|
+
"Authority of the Entry"
|
|
1577
|
+
];
|
|
1578
|
+
"type": "pubkey";
|
|
1579
|
+
},
|
|
1580
|
+
{
|
|
1581
|
+
"name": "amount";
|
|
1582
|
+
"docs": [
|
|
1583
|
+
"Amount of deposited funds"
|
|
1584
|
+
];
|
|
1585
|
+
"type": "u64";
|
|
1586
|
+
},
|
|
1587
|
+
{
|
|
1588
|
+
"name": "duration";
|
|
1589
|
+
"docs": [
|
|
1590
|
+
"Duration of the lockup"
|
|
1591
|
+
];
|
|
1592
|
+
"type": "u64";
|
|
1593
|
+
},
|
|
1594
|
+
{
|
|
1595
|
+
"name": "effectiveAmount";
|
|
1596
|
+
"docs": [
|
|
1597
|
+
"Effective Amount staked, does not equal to deposited amount, accounts for Stake Weight"
|
|
1598
|
+
];
|
|
1599
|
+
"type": "u128";
|
|
1600
|
+
},
|
|
1601
|
+
{
|
|
1602
|
+
"name": "createdTs";
|
|
1603
|
+
"docs": [
|
|
1604
|
+
"Timestamp when Deposit was made"
|
|
1605
|
+
];
|
|
1606
|
+
"type": "u64";
|
|
1607
|
+
},
|
|
1608
|
+
{
|
|
1609
|
+
"name": "closedTs";
|
|
1610
|
+
"docs": [
|
|
1611
|
+
"Timestamp when entry has been closed"
|
|
1612
|
+
];
|
|
1613
|
+
"type": "u64";
|
|
1614
|
+
},
|
|
1615
|
+
{
|
|
1616
|
+
"name": "priorTotalEffectiveStake";
|
|
1617
|
+
"docs": [
|
|
1618
|
+
"Total effective stake at the time of staking"
|
|
1619
|
+
];
|
|
1620
|
+
"type": "u128";
|
|
1621
|
+
},
|
|
1622
|
+
{
|
|
1623
|
+
"name": "unstakeTs";
|
|
1624
|
+
"docs": [
|
|
1625
|
+
"Timestamp when unstake was requested, will be used in case `unstake_period` is set"
|
|
1626
|
+
];
|
|
1627
|
+
"type": "u64";
|
|
1628
|
+
},
|
|
1629
|
+
{
|
|
1630
|
+
"name": "isSponsored";
|
|
1631
|
+
"docs": [
|
|
1632
|
+
"Whether the entry rent has been sponsored by the rent vault"
|
|
1633
|
+
];
|
|
1634
|
+
"type": "bool";
|
|
1635
|
+
},
|
|
1636
|
+
{
|
|
1637
|
+
"name": "buffer";
|
|
1638
|
+
"docs": [
|
|
1639
|
+
"Buffer for additional fields"
|
|
1640
|
+
];
|
|
1641
|
+
"type": {
|
|
1642
|
+
"array": [
|
|
1643
|
+
"u8",
|
|
1644
|
+
39
|
|
1645
|
+
];
|
|
1646
|
+
};
|
|
1647
|
+
}
|
|
1648
|
+
];
|
|
1649
|
+
};
|
|
1650
|
+
},
|
|
1651
|
+
{
|
|
1652
|
+
"name": "stakePool";
|
|
1653
|
+
"type": {
|
|
1654
|
+
"kind": "struct";
|
|
1655
|
+
"fields": [
|
|
1656
|
+
{
|
|
1657
|
+
"name": "bump";
|
|
1658
|
+
"docs": [
|
|
1659
|
+
"Bump Seed used to sign transactions"
|
|
1660
|
+
];
|
|
1661
|
+
"type": "u8";
|
|
1662
|
+
},
|
|
1663
|
+
{
|
|
1664
|
+
"name": "nonce";
|
|
1665
|
+
"docs": [
|
|
1666
|
+
"Nonce to differentiate pools for the same mint"
|
|
1667
|
+
];
|
|
1668
|
+
"type": "u8";
|
|
1669
|
+
},
|
|
1670
|
+
{
|
|
1671
|
+
"name": "mint";
|
|
1672
|
+
"docs": [
|
|
1673
|
+
"Mint of the Stake Pool"
|
|
1674
|
+
];
|
|
1675
|
+
"type": "pubkey";
|
|
1676
|
+
},
|
|
1677
|
+
{
|
|
1678
|
+
"name": "creator";
|
|
1679
|
+
"docs": [
|
|
1680
|
+
"Initial Creator"
|
|
1681
|
+
];
|
|
1682
|
+
"type": "pubkey";
|
|
1683
|
+
},
|
|
1684
|
+
{
|
|
1685
|
+
"name": "authority";
|
|
1686
|
+
"docs": [
|
|
1687
|
+
"Current authority"
|
|
1688
|
+
];
|
|
1689
|
+
"type": "pubkey";
|
|
1690
|
+
},
|
|
1691
|
+
{
|
|
1692
|
+
"name": "minWeight";
|
|
1693
|
+
"docs": [
|
|
1694
|
+
"The lowest weight awarded for staking, measured as a fraction of `1 / SCALE_FACTOR_BASE`.",
|
|
1695
|
+
"For instance:",
|
|
1696
|
+
"* `min_weight = 1 x SCALE_FACTOR_BASE` signifies a minimum multiplier of 1x for min staking duration",
|
|
1697
|
+
"* `min_weight = 2 x SCALE_FACTOR_BASE` indicates a minimum multiplier of 2x for min staking duration"
|
|
1698
|
+
];
|
|
1699
|
+
"type": "u64";
|
|
1700
|
+
},
|
|
1701
|
+
{
|
|
1702
|
+
"name": "maxWeight";
|
|
1703
|
+
"docs": [
|
|
1704
|
+
"The highest weight awarded for staking, measured as a fraction of `1 / SCALE_FACTOR_BASE`.",
|
|
1705
|
+
"For instance:",
|
|
1706
|
+
"* `max_weight = 1 x SCALE_FACTOR_BASE` signifies a max multiplier of 1x for max staking duration",
|
|
1707
|
+
"* `max_weight = 2 x SCALE_FACTOR_BASE` indicates a max multiplier of 2x for max staking duration"
|
|
1708
|
+
];
|
|
1709
|
+
"type": "u64";
|
|
1710
|
+
},
|
|
1711
|
+
{
|
|
1712
|
+
"name": "minDuration";
|
|
1713
|
+
"docs": [
|
|
1714
|
+
"Min Duration of stake in seconds"
|
|
1715
|
+
];
|
|
1716
|
+
"type": "u64";
|
|
1717
|
+
},
|
|
1718
|
+
{
|
|
1719
|
+
"name": "maxDuration";
|
|
1720
|
+
"docs": [
|
|
1721
|
+
"Max Duration of stake in seconds, the more duration, the more weight the stake has"
|
|
1722
|
+
];
|
|
1723
|
+
"type": "u64";
|
|
1724
|
+
},
|
|
1725
|
+
{
|
|
1726
|
+
"name": "permissionless";
|
|
1727
|
+
"docs": [
|
|
1728
|
+
"Whether anyone can add Reward Pools or just admin"
|
|
1729
|
+
];
|
|
1730
|
+
"type": "bool";
|
|
1731
|
+
},
|
|
1732
|
+
{
|
|
1733
|
+
"name": "vault";
|
|
1734
|
+
"docs": [
|
|
1735
|
+
"Escrow Account that stores staked tokens"
|
|
1736
|
+
];
|
|
1737
|
+
"type": "pubkey";
|
|
1738
|
+
},
|
|
1739
|
+
{
|
|
1740
|
+
"name": "stakeMint";
|
|
1741
|
+
"docs": [
|
|
1742
|
+
"Stake Mint, will be returned in exchange for stake tokens"
|
|
1743
|
+
];
|
|
1744
|
+
"type": "pubkey";
|
|
1745
|
+
},
|
|
1746
|
+
{
|
|
1747
|
+
"name": "totalStake";
|
|
1748
|
+
"docs": [
|
|
1749
|
+
"Total number of Staked tokens"
|
|
1750
|
+
];
|
|
1751
|
+
"type": "u64";
|
|
1752
|
+
},
|
|
1753
|
+
{
|
|
1754
|
+
"name": "totalEffectiveStake";
|
|
1755
|
+
"docs": [
|
|
1756
|
+
"Total staked tokens accounting for each stake weight, does not equal `total_stake`,",
|
|
1757
|
+
"represents a sum of effective stake multiplied by 10^9 for precision"
|
|
1758
|
+
];
|
|
1759
|
+
"type": "u128";
|
|
1760
|
+
},
|
|
1761
|
+
{
|
|
1762
|
+
"name": "freezeStakeMint";
|
|
1763
|
+
"docs": [
|
|
1764
|
+
"Whether we should freeze stake mint token accounts"
|
|
1765
|
+
];
|
|
1766
|
+
"type": "bool";
|
|
1767
|
+
},
|
|
1768
|
+
{
|
|
1769
|
+
"name": "unstakePeriod";
|
|
1770
|
+
"docs": [
|
|
1771
|
+
"Period for unstaking, if set unstake at first should be requested, and the real unstake can only happen after this period"
|
|
1772
|
+
];
|
|
1773
|
+
"type": "u64";
|
|
1774
|
+
},
|
|
1775
|
+
{
|
|
1776
|
+
"name": "buffer";
|
|
1777
|
+
"docs": [
|
|
1778
|
+
"Buffer for additional fields"
|
|
1779
|
+
];
|
|
1780
|
+
"type": {
|
|
1781
|
+
"array": [
|
|
1782
|
+
"u8",
|
|
1783
|
+
55
|
|
1784
|
+
];
|
|
1785
|
+
};
|
|
1786
|
+
}
|
|
1787
|
+
];
|
|
1788
|
+
};
|
|
1789
|
+
},
|
|
1790
|
+
{
|
|
1791
|
+
"name": "vote";
|
|
1792
|
+
"type": {
|
|
1793
|
+
"kind": "struct";
|
|
1794
|
+
"fields": [
|
|
1795
|
+
{
|
|
1796
|
+
"name": "proposal";
|
|
1797
|
+
"docs": [
|
|
1798
|
+
"Question to which vote was provided"
|
|
1799
|
+
];
|
|
1800
|
+
"type": "pubkey";
|
|
1801
|
+
},
|
|
1802
|
+
{
|
|
1803
|
+
"name": "voter";
|
|
1804
|
+
"docs": [
|
|
1805
|
+
"Voter that voted on the proposal"
|
|
1806
|
+
];
|
|
1807
|
+
"type": "pubkey";
|
|
1808
|
+
},
|
|
1809
|
+
{
|
|
1810
|
+
"name": "optionIndex";
|
|
1811
|
+
"docs": [
|
|
1812
|
+
"Index of the option used for voting"
|
|
1813
|
+
];
|
|
1814
|
+
"type": "u8";
|
|
1815
|
+
},
|
|
1816
|
+
{
|
|
1817
|
+
"name": "weight";
|
|
1818
|
+
"docs": [
|
|
1819
|
+
"Weight of the vote, correspond to number of sTokens used"
|
|
1820
|
+
];
|
|
1821
|
+
"type": "u64";
|
|
1822
|
+
},
|
|
1823
|
+
{
|
|
1824
|
+
"name": "buffer";
|
|
1825
|
+
"docs": [
|
|
1826
|
+
"Buffer for additional fields"
|
|
1827
|
+
];
|
|
1828
|
+
"type": {
|
|
1829
|
+
"array": [
|
|
1830
|
+
"u8",
|
|
1831
|
+
64
|
|
1832
|
+
];
|
|
1833
|
+
};
|
|
1834
|
+
}
|
|
1835
|
+
];
|
|
1836
|
+
};
|
|
1837
|
+
}
|
|
1838
|
+
];
|
|
1839
|
+
};
|
|
1840
|
+
|
|
107
1841
|
type StakePool = IdlAccounts<StakePool$1>["stakePool"];
|
|
108
1842
|
type StakeEntry = IdlAccounts<StakePool$1>["stakeEntry"];
|
|
109
1843
|
type RewardEntry = IdlAccounts<RewardPool$1>["rewardEntry"];
|
|
@@ -120,23 +1854,47 @@ interface BaseStakePoolArgs {
|
|
|
120
1854
|
interface TokenProgram {
|
|
121
1855
|
tokenProgramId?: Address;
|
|
122
1856
|
}
|
|
1857
|
+
interface RewardPoolProgram {
|
|
1858
|
+
rewardPoolType?: "fixed" | "dynamic";
|
|
1859
|
+
}
|
|
123
1860
|
interface StakeBaseArgs extends BaseStakePoolArgs, TokenProgram {
|
|
124
1861
|
nonce: number;
|
|
125
1862
|
}
|
|
126
|
-
type UnstakeArgs = StakeBaseArgs;
|
|
127
1863
|
interface StakeArgs extends StakeBaseArgs {
|
|
128
1864
|
amount: BN;
|
|
129
1865
|
duration: BN;
|
|
130
1866
|
payer?: Keypair;
|
|
131
1867
|
authority?: Address;
|
|
132
1868
|
}
|
|
133
|
-
interface
|
|
1869
|
+
interface RewardPoolArgs extends TokenProgram, RewardPoolProgram {
|
|
1870
|
+
nonce: number;
|
|
1871
|
+
mint: Address;
|
|
1872
|
+
}
|
|
1873
|
+
/**
|
|
1874
|
+
* Used only with dynamic reward pools
|
|
1875
|
+
*/
|
|
1876
|
+
interface GovernorWithVoteArgs {
|
|
1877
|
+
governor?: Address;
|
|
1878
|
+
vote?: Address;
|
|
1879
|
+
}
|
|
1880
|
+
interface StakeAndCreateEntriesArgs extends StakeArgs {
|
|
1881
|
+
rewardPools: RewardPoolArgs[];
|
|
1882
|
+
}
|
|
1883
|
+
interface UnstakeArgs extends StakeBaseArgs {
|
|
1884
|
+
shouldClose?: boolean;
|
|
1885
|
+
}
|
|
1886
|
+
interface UnstakeAndCloseArgs extends UnstakeArgs {
|
|
1887
|
+
rewardPools: (RewardPoolArgs & GovernorWithVoteArgs)[];
|
|
1888
|
+
}
|
|
1889
|
+
type UnstakeAndClaimArgs = UnstakeAndCloseArgs;
|
|
1890
|
+
type CloseStakeEntryArgs = Omit<StakeBaseArgs, "stakePoolMint" | "tokenProgramId">;
|
|
1891
|
+
interface FundPoolArgs extends BaseStakePoolArgs, TokenProgram, RewardPoolProgram {
|
|
134
1892
|
amount: BN;
|
|
135
1893
|
nonce: number;
|
|
136
1894
|
rewardMint: Address;
|
|
137
1895
|
feeValue: Address | null;
|
|
138
1896
|
}
|
|
139
|
-
interface CreateRewardEntryArgs extends BaseStakePoolArgs, TokenProgram {
|
|
1897
|
+
interface CreateRewardEntryArgs extends BaseStakePoolArgs, TokenProgram, RewardPoolProgram {
|
|
140
1898
|
depositNonce: number;
|
|
141
1899
|
rewardPoolNonce: number;
|
|
142
1900
|
rewardMint: Address;
|
|
@@ -156,11 +1914,8 @@ interface UpdateRewardPoolArgs {
|
|
|
156
1914
|
rewardPeriod: BN | null;
|
|
157
1915
|
rewardPool: Address;
|
|
158
1916
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
rewardMint: Address;
|
|
162
|
-
rewardPoolNonce: number;
|
|
163
|
-
}
|
|
1917
|
+
type ClaimRewardPoolArgs = CreateRewardEntryArgs & GovernorWithVoteArgs;
|
|
1918
|
+
type CloseRewardEntryArgs = CreateRewardEntryArgs;
|
|
164
1919
|
interface CreateStakePoolArgs extends TokenProgram {
|
|
165
1920
|
mint: Address;
|
|
166
1921
|
nonce: number;
|
|
@@ -176,6 +1931,7 @@ interface CreateStakePoolArgs extends TokenProgram {
|
|
|
176
1931
|
interface Programs {
|
|
177
1932
|
stakePoolProgram: Program<StakePool$1>;
|
|
178
1933
|
rewardPoolProgram: Program<RewardPool$1>;
|
|
1934
|
+
rewardPoolDynamicProgram: Program<RewardPoolDynamic>;
|
|
179
1935
|
feeManagerProgram: Program<FeeManager>;
|
|
180
1936
|
}
|
|
181
1937
|
type CreationResult = ITransactionResult & {
|
|
@@ -188,6 +1944,7 @@ interface IInitOptions {
|
|
|
188
1944
|
programIds?: {
|
|
189
1945
|
stakePool?: string;
|
|
190
1946
|
rewardPool?: string;
|
|
1947
|
+
rewardPoolDynamic?: string;
|
|
191
1948
|
feeManager?: string;
|
|
192
1949
|
};
|
|
193
1950
|
sendRate?: number;
|
|
@@ -217,11 +1974,56 @@ declare class SolanaStakingClient {
|
|
|
217
1974
|
publicKey: PublicKey;
|
|
218
1975
|
}>;
|
|
219
1976
|
stake(data: StakeArgs, extParams: IInteractSolanaExt): Promise<ITransactionResult>;
|
|
1977
|
+
/**
|
|
1978
|
+
* Stake into a Pool and creates Reward Entries to track rewards.
|
|
1979
|
+
*
|
|
1980
|
+
* Resulting transaction may bee too large for execution if there are too many reward pools.
|
|
1981
|
+
*
|
|
1982
|
+
* @param data - enriched stake params with an array of reward pools
|
|
1983
|
+
* @param extParams - parameter required for transaction execution
|
|
1984
|
+
*/
|
|
1985
|
+
stakeAndCreateEntries(data: StakeAndCreateEntriesArgs, extParams: IInteractSolanaExt): Promise<ITransactionResult>;
|
|
1986
|
+
prepareStakeAndCreateEntriesInstructions(data: StakeAndCreateEntriesArgs, extParams: IInteractSolanaExt): Promise<{
|
|
1987
|
+
ixs: TransactionInstruction[];
|
|
1988
|
+
}>;
|
|
220
1989
|
prepareStakeInstructions({ nonce, amount, duration, stakePool, stakePoolMint, tokenProgramId }: StakeArgs, extParams: IInteractSolanaExt): Promise<{
|
|
221
1990
|
ixs: TransactionInstruction[];
|
|
222
1991
|
}>;
|
|
223
1992
|
unstake(data: UnstakeArgs, extParams: IInteractSolanaExt): Promise<ITransactionResult>;
|
|
224
|
-
|
|
1993
|
+
/**
|
|
1994
|
+
* Unstake from a pool, claiming all rewards prior to that.
|
|
1995
|
+
*
|
|
1996
|
+
* Resulting transaction may be too large for execution if there are too many reward pools.
|
|
1997
|
+
*
|
|
1998
|
+
* @param data - enriched unstake args with reward pools
|
|
1999
|
+
* @param extParams - parameter required for transaction execution
|
|
2000
|
+
*/
|
|
2001
|
+
unstakeAndClaim(data: UnstakeAndClaimArgs, extParams: IInteractSolanaExt): Promise<ITransactionResult>;
|
|
2002
|
+
prepareUnstakeAndClaimInstructions(data: UnstakeAndClaimArgs, extParams: IInteractSolanaExt): Promise<{
|
|
2003
|
+
ixs: TransactionInstruction[];
|
|
2004
|
+
}>;
|
|
2005
|
+
/**
|
|
2006
|
+
* Unstake from a pool, closing all related stake and reward entries.
|
|
2007
|
+
*
|
|
2008
|
+
* REWARDS WON'T be claimed - use this call only if user can't unstake with rewards claims, i.e. when reward pool is drained.
|
|
2009
|
+
*
|
|
2010
|
+
* Resulting transaction may be too large for execution if there are too many reward pools.
|
|
2011
|
+
*
|
|
2012
|
+
* @param data - enriched unstake args with reward pools
|
|
2013
|
+
* @param extParams - parameter required for transaction execution
|
|
2014
|
+
*/
|
|
2015
|
+
unstakeAndClose(data: UnstakeAndCloseArgs, extParams: IInteractSolanaExt): Promise<ITransactionResult>;
|
|
2016
|
+
prepareUnstakeAndCloseInstructions(data: UnstakeAndCloseArgs, extParams: IInteractSolanaExt): Promise<{
|
|
2017
|
+
ixs: TransactionInstruction[];
|
|
2018
|
+
}>;
|
|
2019
|
+
prepareUnstakeInstructions({ stakePool, stakePoolMint, nonce, tokenProgramId, shouldClose }: UnstakeArgs, extParams: IInteractSolanaExt): Promise<{
|
|
2020
|
+
ixs: TransactionInstruction[];
|
|
2021
|
+
}>;
|
|
2022
|
+
closeStakeEntry(data: CloseStakeEntryArgs, extParams: IInteractSolanaExt): Promise<{
|
|
2023
|
+
ixs: TransactionInstruction[];
|
|
2024
|
+
txId: string;
|
|
2025
|
+
}>;
|
|
2026
|
+
prepareCloseStakeEntryInstructions({ stakePool, nonce }: CloseStakeEntryArgs, extParams: IInteractSolanaExt): Promise<{
|
|
225
2027
|
ixs: TransactionInstruction[];
|
|
226
2028
|
}>;
|
|
227
2029
|
createRewardPool(data: CreateRewardPoolArgs, extParams: IInteractSolanaExt): Promise<CreationResult>;
|
|
@@ -230,15 +2032,19 @@ declare class SolanaStakingClient {
|
|
|
230
2032
|
ixs: TransactionInstruction[];
|
|
231
2033
|
}>;
|
|
232
2034
|
claimRewards(data: ClaimRewardPoolArgs, extParams: IInteractSolanaExt): Promise<ITransactionResult>;
|
|
233
|
-
prepareClaimRewardsInstructions({ rewardPoolNonce, depositNonce, stakePool, tokenProgramId, rewardMint }: ClaimRewardPoolArgs, extParams: IInteractSolanaExt): Promise<{
|
|
2035
|
+
prepareClaimRewardsInstructions({ rewardPoolNonce, depositNonce, stakePool, tokenProgramId, rewardMint, rewardPoolType, governor, vote, }: ClaimRewardPoolArgs, extParams: IInteractSolanaExt): Promise<{
|
|
234
2036
|
ixs: TransactionInstruction[];
|
|
235
2037
|
}>;
|
|
236
2038
|
fundPool(data: FundPoolArgs, extParams: IInteractSolanaExt): Promise<ITransactionResult>;
|
|
237
|
-
prepareFundPoolInstructions({ amount, tokenProgramId, rewardMint, stakePool, feeValue, nonce }: FundPoolArgs, extParams: IInteractSolanaExt): Promise<{
|
|
2039
|
+
prepareFundPoolInstructions({ amount, tokenProgramId, rewardMint, stakePool, feeValue, nonce, rewardPoolType, }: FundPoolArgs, extParams: IInteractSolanaExt): Promise<{
|
|
238
2040
|
ixs: TransactionInstruction[];
|
|
239
2041
|
}>;
|
|
240
2042
|
createRewardEntry(data: CreateRewardEntryArgs, extParams: IInteractSolanaExt): Promise<ITransactionResult>;
|
|
241
|
-
prepareCreateRewardEntryInstructions({ stakePool, rewardPoolNonce, depositNonce, rewardMint }: CreateRewardEntryArgs, extParams: IInteractSolanaExt): Promise<{
|
|
2043
|
+
prepareCreateRewardEntryInstructions({ stakePool, rewardPoolNonce, depositNonce, rewardMint, rewardPoolType }: CreateRewardEntryArgs, extParams: IInteractSolanaExt): Promise<{
|
|
2044
|
+
ixs: TransactionInstruction[];
|
|
2045
|
+
}>;
|
|
2046
|
+
closeRewardEntry(data: CloseRewardEntryArgs, extParams: IInteractSolanaExt): Promise<ITransactionResult>;
|
|
2047
|
+
prepareCloseRewardEntryInstructions({ stakePool, rewardPoolNonce, depositNonce, rewardMint, rewardPoolType }: CreateRewardEntryArgs, extParams: IInteractSolanaExt): Promise<{
|
|
242
2048
|
ixs: TransactionInstruction[];
|
|
243
2049
|
}>;
|
|
244
2050
|
updateRewardPool(data: UpdateRewardPoolArgs, extParams: IInteractSolanaExt): Promise<{
|
|
@@ -250,7 +2056,11 @@ declare class SolanaStakingClient {
|
|
|
250
2056
|
}>;
|
|
251
2057
|
decode<ProgramName extends keyof Programs = keyof Programs, DecodingProgram = Programs[ProgramName], DerivedIdl extends Idl = DecodingProgram extends Program<infer IDLType> ? IDLType : never, AccountName extends keyof IdlAccounts<DerivedIdl> = keyof IdlAccounts<DerivedIdl>, DecodedAccount = IdlAccounts<DerivedIdl>[AccountName]>(programKey: ProgramName, accountName: AccountName, accInfo: Parameters<AccountsCoder["decode"]>[1]): DecodedAccount;
|
|
252
2058
|
getDiscriminator<ProgramName extends keyof Programs = keyof Programs, DecodingProgram = Programs[ProgramName], DerivedIdl extends Idl = DecodingProgram extends Program<infer IDLType> ? IDLType : never, AccountName extends keyof IdlAccounts<DerivedIdl> = keyof IdlAccounts<DerivedIdl>>(programKey: ProgramName, accountName: AccountName): number[];
|
|
253
|
-
|
|
2059
|
+
execute(ixs: TransactionInstruction[], extParams: IInteractSolanaExt): Promise<{
|
|
2060
|
+
signature: string;
|
|
2061
|
+
}>;
|
|
2062
|
+
private getRewardProgram;
|
|
2063
|
+
private isDynamicRewardProgram;
|
|
254
2064
|
}
|
|
255
2065
|
|
|
256
2066
|
declare const deriveStakePoolPDA: (programId: PublicKey, mint: PublicKey, authority: PublicKey, nonce: number) => PublicKey;
|
|
@@ -272,8 +2082,9 @@ declare class RewardEntryAccumulator implements RewardEntry {
|
|
|
272
2082
|
createdTs: BN;
|
|
273
2083
|
lastRewardAmount: BN;
|
|
274
2084
|
lastRewardPeriod: BN;
|
|
2085
|
+
isSponsored: boolean;
|
|
275
2086
|
buffer: number[];
|
|
276
|
-
constructor(lastAccountedTs: BN, claimedAmount: BN, accountedAmount: BN, rewardPool: PublicKey, stakeEntry: PublicKey, createdTs: BN, lastRewardAmount: BN, lastRewardPeriod: BN, buffer: number[]);
|
|
2087
|
+
constructor(lastAccountedTs: BN, claimedAmount: BN, accountedAmount: BN, rewardPool: PublicKey, stakeEntry: PublicKey, createdTs: BN, lastRewardAmount: BN, lastRewardPeriod: BN, isSponsored: boolean, buffer: number[]);
|
|
277
2088
|
static fromEntry(entry: RewardEntry): RewardEntryAccumulator;
|
|
278
2089
|
getAccountableAmount(stakedTs: BN, accountableTs: BN, effectiveStakedAmount: BN, rewardAmount: BN, rewardPeriod: BN): BN;
|
|
279
2090
|
getClaimableAmount(): BN;
|
|
@@ -295,4 +2106,4 @@ declare function calculateAmountWithTransferFees(connection: Connection, transfe
|
|
|
295
2106
|
|
|
296
2107
|
declare const calculateStakeWeight: (minDuration: BN, maxDuration: BN, maxWeight: BN, duration: BN) => BN;
|
|
297
2108
|
|
|
298
|
-
export { type BaseStakePoolArgs, type ClaimRewardPoolArgs, type CreateRewardEntryArgs, type CreateRewardPoolArgs, type CreateStakePoolArgs, type DefaultFeeValueConfig, type FeeValue, type FundPoolArgs, type IInteractSolanaExt, type RewardEntry, RewardEntryAccumulator, type RewardPool, SolanaStakingClient, type StakeArgs, type StakeEntry, type StakePool, type UnstakeArgs, type UpdateRewardPoolArgs, calcRewards, calculateAmountWithTransferFees, calculateDecimalsShift, calculateFeeAmount, calculateRewardAmountFromRate, calculateRewardAmountFromValue, calculateRewardRateFromAmount, calculateStakeWeight, constants, deriveConfigPDA, deriveFeeValuePDA, deriveRewardEntryPDA, deriveRewardPoolPDA, deriveRewardVaultPDA, deriveStakeEntryPDA, deriveStakeMintPDA, deriveStakePoolPDA, deriveStakeVaultPDA };
|
|
2109
|
+
export { type BaseStakePoolArgs, type ClaimRewardPoolArgs, type CloseRewardEntryArgs, type CloseStakeEntryArgs, type CreateRewardEntryArgs, type CreateRewardPoolArgs, type CreateStakePoolArgs, type DefaultFeeValueConfig, type FeeValue, type FundPoolArgs, type IInteractSolanaExt, type RewardEntry, RewardEntryAccumulator, type RewardPool, SolanaStakingClient, type StakeAndCreateEntriesArgs, type StakeArgs, type StakeEntry, type StakePool, type UnstakeAndClaimArgs, type UnstakeAndCloseArgs, type UnstakeArgs, type UpdateRewardPoolArgs, calcRewards, calculateAmountWithTransferFees, calculateDecimalsShift, calculateFeeAmount, calculateRewardAmountFromRate, calculateRewardAmountFromValue, calculateRewardRateFromAmount, calculateStakeWeight, constants, deriveConfigPDA, deriveFeeValuePDA, deriveRewardEntryPDA, deriveRewardPoolPDA, deriveRewardVaultPDA, deriveStakeEntryPDA, deriveStakeMintPDA, deriveStakePoolPDA, deriveStakeVaultPDA };
|