flash-sdk 2.0.22 → 2.0.23
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/PerpetualsClient.d.ts +2 -783
- package/dist/PerpetualsClient.js +56 -341
- package/dist/idl/perpetuals.d.ts +19 -70
- package/dist/idl/perpetuals.js +19 -70
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/PerpetualsClient.js
CHANGED
@@ -189,72 +189,6 @@ var PerpetualsClient = (function () {
|
|
189
189
|
return [2, this.program.account.trading.fetch(tradingAccount)];
|
190
190
|
});
|
191
191
|
}); };
|
192
|
-
this.getCustodyOracleAccountKey = function (poolName, tokenMint) { return __awaiter(_this, void 0, void 0, function () {
|
193
|
-
return __generator(this, function (_a) {
|
194
|
-
switch (_a.label) {
|
195
|
-
case 0: return [4, this.getCustody(poolName, tokenMint)];
|
196
|
-
case 1: return [2, (_a.sent()).oracle.oracleAccount];
|
197
|
-
}
|
198
|
-
});
|
199
|
-
}); };
|
200
|
-
this.getCustodyTestOracleAccountKey = function (poolName, tokenMint) {
|
201
|
-
return _this.findProgramAddress("oracle_account", [
|
202
|
-
_this.getPoolKey(poolName),
|
203
|
-
tokenMint,
|
204
|
-
]).publicKey;
|
205
|
-
};
|
206
|
-
this.getCustody = function (poolName, tokenMint) { return __awaiter(_this, void 0, void 0, function () {
|
207
|
-
return __generator(this, function (_a) {
|
208
|
-
return [2, this.program.account.custody.fetch(this.getCustodyKey(poolName, tokenMint))];
|
209
|
-
});
|
210
|
-
}); };
|
211
|
-
this.getCustodies = function (poolName) { return __awaiter(_this, void 0, void 0, function () {
|
212
|
-
var pool;
|
213
|
-
return __generator(this, function (_a) {
|
214
|
-
switch (_a.label) {
|
215
|
-
case 0: return [4, this.getPool(poolName)];
|
216
|
-
case 1:
|
217
|
-
pool = _a.sent();
|
218
|
-
return [2, this.program.account.custody.fetchMultiple(pool.custodies)];
|
219
|
-
}
|
220
|
-
});
|
221
|
-
}); };
|
222
|
-
this.getCustodyMetas = function (poolName) { return __awaiter(_this, void 0, void 0, function () {
|
223
|
-
var pool, custodies, custodyMetas, _i, _a, custody, _b, custodies_1, custody;
|
224
|
-
return __generator(this, function (_c) {
|
225
|
-
switch (_c.label) {
|
226
|
-
case 0: return [4, this.getPool(poolName)];
|
227
|
-
case 1:
|
228
|
-
pool = _c.sent();
|
229
|
-
return [4, this.program.account.custody.fetchMultiple(pool.custodies)];
|
230
|
-
case 2:
|
231
|
-
custodies = _c.sent();
|
232
|
-
custodyMetas = [];
|
233
|
-
for (_i = 0, _a = pool.custodies; _i < _a.length; _i++) {
|
234
|
-
custody = _a[_i];
|
235
|
-
custodyMetas.push({
|
236
|
-
isSigner: false,
|
237
|
-
isWritable: false,
|
238
|
-
pubkey: custody,
|
239
|
-
});
|
240
|
-
}
|
241
|
-
for (_b = 0, custodies_1 = custodies; _b < custodies_1.length; _b++) {
|
242
|
-
custody = custodies_1[_b];
|
243
|
-
custodyMetas.push({
|
244
|
-
isSigner: false,
|
245
|
-
isWritable: false,
|
246
|
-
pubkey: custody === null || custody === void 0 ? void 0 : custody.oracle.oracleAccount,
|
247
|
-
});
|
248
|
-
}
|
249
|
-
return [2, custodyMetas];
|
250
|
-
}
|
251
|
-
});
|
252
|
-
}); };
|
253
|
-
this.getMultisig = function () { return __awaiter(_this, void 0, void 0, function () {
|
254
|
-
return __generator(this, function (_a) {
|
255
|
-
return [2, this.program.account.multisig.fetch(this.multisig.publicKey)];
|
256
|
-
});
|
257
|
-
}); };
|
258
192
|
this.getPosition = function (postionKey) { return __awaiter(_this, void 0, void 0, function () {
|
259
193
|
return __generator(this, function (_a) {
|
260
194
|
return [2, this.program.account.position.fetch(postionKey)];
|
@@ -577,73 +511,59 @@ var PerpetualsClient = (function () {
|
|
577
511
|
}
|
578
512
|
});
|
579
513
|
}); };
|
580
|
-
this.getLiquidationState = function (
|
581
|
-
var
|
582
|
-
|
583
|
-
|
584
|
-
switch (_d.label) {
|
514
|
+
this.getLiquidationState = function (positionAccount, poolName, tokenMint, collateralMint, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
515
|
+
var targetCustodyConfig, collateralCustodyConfig;
|
516
|
+
return __generator(this, function (_a) {
|
517
|
+
switch (_a.label) {
|
585
518
|
case 0:
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
.catch(function (err) {
|
607
|
-
console.error(err);
|
608
|
-
throw err;
|
609
|
-
})];
|
610
|
-
case 3: return [2, _d.sent()];
|
519
|
+
targetCustodyConfig = poolConfig.custodies.find(function (f) { return f.mintKey.equals(tokenMint); });
|
520
|
+
collateralCustodyConfig = poolConfig.custodies.find(function (f) { return f.mintKey.equals(collateralMint); });
|
521
|
+
return [4, this.program.methods
|
522
|
+
.getLiquidationState({})
|
523
|
+
.accounts({
|
524
|
+
perpetuals: this.perpetuals.publicKey,
|
525
|
+
pool: poolConfig.poolAddress,
|
526
|
+
position: positionAccount,
|
527
|
+
targetCustody: this.getCustodyKey(poolName, tokenMint),
|
528
|
+
targetOracleAccount: targetCustodyConfig.custodyAccount,
|
529
|
+
collateralCustody: this.getCustodyKey(poolName, collateralMint),
|
530
|
+
collateralOracleAccount: collateralCustodyConfig.custodyAccount,
|
531
|
+
ixSysvar: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY
|
532
|
+
})
|
533
|
+
.view()
|
534
|
+
.catch(function (err) {
|
535
|
+
console.error(err);
|
536
|
+
throw err;
|
537
|
+
})];
|
538
|
+
case 1: return [2, _a.sent()];
|
611
539
|
}
|
612
540
|
});
|
613
541
|
}); };
|
614
|
-
this.liquidate = function (positionAccount,
|
615
|
-
var
|
616
|
-
|
617
|
-
|
618
|
-
switch (_d.label) {
|
542
|
+
this.liquidate = function (positionAccount, poolConfig, tokenMint, collateralMint, marketPk) { return __awaiter(_this, void 0, void 0, function () {
|
543
|
+
var targetCustodyConfig, collateralCustodyConfig;
|
544
|
+
return __generator(this, function (_a) {
|
545
|
+
switch (_a.label) {
|
619
546
|
case 0:
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
_c)])
|
641
|
-
.rpc()
|
642
|
-
.catch(function (err) {
|
643
|
-
console.error(err);
|
644
|
-
throw err;
|
645
|
-
})];
|
646
|
-
case 3: return [2, _d.sent()];
|
547
|
+
targetCustodyConfig = poolConfig.custodies.find(function (f) { return f.mintKey.equals(tokenMint); });
|
548
|
+
collateralCustodyConfig = poolConfig.custodies.find(function (f) { return f.mintKey.equals(collateralMint); });
|
549
|
+
return [4, this.program.methods
|
550
|
+
.liquidate({})
|
551
|
+
.accounts({
|
552
|
+
signer: this.provider.wallet.publicKey,
|
553
|
+
perpetuals: this.perpetuals.publicKey,
|
554
|
+
pool: poolConfig.poolAddress,
|
555
|
+
position: positionAccount,
|
556
|
+
market: marketPk,
|
557
|
+
targetCustody: targetCustodyConfig.custodyAccount,
|
558
|
+
targetOracleAccount: targetCustodyConfig.oracleAddress,
|
559
|
+
collateralCustody: collateralCustodyConfig.custodyAccount,
|
560
|
+
collateralOracleAccount: collateralCustodyConfig.oracleAddress,
|
561
|
+
eventAuthority: this.eventAuthority.publicKey,
|
562
|
+
program: this.program.programId,
|
563
|
+
ixSysvar: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY
|
564
|
+
})
|
565
|
+
.instruction()];
|
566
|
+
case 1: return [2, _a.sent()];
|
647
567
|
}
|
648
568
|
});
|
649
569
|
}); };
|
@@ -3333,213 +3253,8 @@ var PerpetualsClient = (function () {
|
|
3333
3253
|
}
|
3334
3254
|
});
|
3335
3255
|
}); };
|
3336
|
-
this.activeStake = function (rewardSymbol, poolName, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
3337
|
-
var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustodyMint, rewardCustodyConfig, pool, feeDistributionTokenAccount, custodyAccountMetas, flpStakeAccountMetas, _i, _a, custody, activateStakeInstruction, err_11;
|
3338
|
-
return __generator(this, function (_b) {
|
3339
|
-
switch (_b.label) {
|
3340
|
-
case 0:
|
3341
|
-
publicKey = this.provider.wallet.publicKey;
|
3342
|
-
preInstructions = [];
|
3343
|
-
instructions = [];
|
3344
|
-
postInstructions = [];
|
3345
|
-
additionalSigners = [];
|
3346
|
-
_b.label = 1;
|
3347
|
-
case 1:
|
3348
|
-
_b.trys.push([1, 3, , 4]);
|
3349
|
-
rewardCustodyMint = poolConfig.getTokenFromSymbol(rewardSymbol).mintKey;
|
3350
|
-
rewardCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(rewardSymbol).mintKey); });
|
3351
|
-
pool = this.getPoolKey(poolName);
|
3352
|
-
feeDistributionTokenAccount = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("custody_token_account"), pool.toBuffer(), rewardCustodyMint.toBuffer()], this.programId)[0];
|
3353
|
-
custodyAccountMetas = [];
|
3354
|
-
flpStakeAccountMetas = [];
|
3355
|
-
for (_i = 0, _a = poolConfig.custodies; _i < _a.length; _i++) {
|
3356
|
-
custody = _a[_i];
|
3357
|
-
custodyAccountMetas.push({
|
3358
|
-
pubkey: custody.custodyAccount,
|
3359
|
-
isSigner: false,
|
3360
|
-
isWritable: false,
|
3361
|
-
});
|
3362
|
-
}
|
3363
|
-
return [4, this.program.methods
|
3364
|
-
.activateStake({})
|
3365
|
-
.accounts({
|
3366
|
-
perpetuals: this.perpetuals.publicKey,
|
3367
|
-
pool: pool,
|
3368
|
-
rewardCustody: rewardCustodyConfig.custodyAccount,
|
3369
|
-
feeDistributionTokenAccount: feeDistributionTokenAccount,
|
3370
|
-
})
|
3371
|
-
.remainingAccounts(__spreadArray(__spreadArray([], custodyAccountMetas, true), flpStakeAccountMetas, true))
|
3372
|
-
.instruction()];
|
3373
|
-
case 2:
|
3374
|
-
activateStakeInstruction = _b.sent();
|
3375
|
-
instructions.push(activateStakeInstruction);
|
3376
|
-
return [3, 4];
|
3377
|
-
case 3:
|
3378
|
-
err_11 = _b.sent();
|
3379
|
-
console.log("perpClient activateStaking error:: ", err_11);
|
3380
|
-
throw err_11;
|
3381
|
-
case 4: return [2, {
|
3382
|
-
instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
|
3383
|
-
additionalSigners: additionalSigners
|
3384
|
-
}];
|
3385
|
-
}
|
3386
|
-
});
|
3387
|
-
}); };
|
3388
|
-
this.unstakeRequest = function (unstakeAmount, poolName, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
3389
|
-
var publicKey, preInstructions, instructions, postInstructions, additionalSigners, lpTokenMint, pool, poolFlpTokenAccount, flpStakeAccount, userLpTokenAccount, unstakeRequestInstruction, err_12;
|
3390
|
-
return __generator(this, function (_a) {
|
3391
|
-
switch (_a.label) {
|
3392
|
-
case 0:
|
3393
|
-
publicKey = this.provider.wallet.publicKey;
|
3394
|
-
preInstructions = [];
|
3395
|
-
instructions = [];
|
3396
|
-
postInstructions = [];
|
3397
|
-
additionalSigners = [];
|
3398
|
-
_a.label = 1;
|
3399
|
-
case 1:
|
3400
|
-
_a.trys.push([1, 4, , 5]);
|
3401
|
-
lpTokenMint = poolConfig.lpTokenMint;
|
3402
|
-
pool = this.getPoolKey(poolName);
|
3403
|
-
poolFlpTokenAccount = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("staked_lp_token_account"), pool.toBuffer(), lpTokenMint.toBuffer()], this.programId)[0];
|
3404
|
-
flpStakeAccount = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("stake"), publicKey.toBuffer(), pool.toBuffer()], this.programId)[0];
|
3405
|
-
return [4, (0, spl_token_1.getAssociatedTokenAddress)(poolConfig.lpTokenMint, publicKey)];
|
3406
|
-
case 2:
|
3407
|
-
userLpTokenAccount = _a.sent();
|
3408
|
-
return [4, this.program.methods
|
3409
|
-
.unstakeRequest({
|
3410
|
-
unstakeAmount: unstakeAmount
|
3411
|
-
})
|
3412
|
-
.accounts({
|
3413
|
-
owner: publicKey,
|
3414
|
-
perpetuals: this.perpetuals.publicKey,
|
3415
|
-
pool: pool,
|
3416
|
-
flpStakeAccount: flpStakeAccount,
|
3417
|
-
systemProgram: web3_js_1.SystemProgram.programId,
|
3418
|
-
tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
3419
|
-
eventAuthority: this.eventAuthority.publicKey,
|
3420
|
-
})
|
3421
|
-
.instruction()];
|
3422
|
-
case 3:
|
3423
|
-
unstakeRequestInstruction = _a.sent();
|
3424
|
-
instructions.push(unstakeRequestInstruction);
|
3425
|
-
return [3, 5];
|
3426
|
-
case 4:
|
3427
|
-
err_12 = _a.sent();
|
3428
|
-
console.log("perpClient unstakeRequest error:: ", err_12);
|
3429
|
-
throw err_12;
|
3430
|
-
case 5: return [2, {
|
3431
|
-
instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
|
3432
|
-
additionalSigners: additionalSigners
|
3433
|
-
}];
|
3434
|
-
}
|
3435
|
-
});
|
3436
|
-
}); };
|
3437
|
-
this.deactiveStake = function (rewardSymbol, poolName, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
3438
|
-
var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustodyMint, rewardCustodyConfig, pool, feeDistributionTokenAccount, custodyAccountMetas, flpStakeAccountMetas, _i, _a, custody, deactivateStakeInstruction, err_13;
|
3439
|
-
return __generator(this, function (_b) {
|
3440
|
-
switch (_b.label) {
|
3441
|
-
case 0:
|
3442
|
-
publicKey = this.provider.wallet.publicKey;
|
3443
|
-
preInstructions = [];
|
3444
|
-
instructions = [];
|
3445
|
-
postInstructions = [];
|
3446
|
-
additionalSigners = [];
|
3447
|
-
_b.label = 1;
|
3448
|
-
case 1:
|
3449
|
-
_b.trys.push([1, 3, , 4]);
|
3450
|
-
rewardCustodyMint = poolConfig.getTokenFromSymbol(rewardSymbol).mintKey;
|
3451
|
-
rewardCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(rewardSymbol).mintKey); });
|
3452
|
-
pool = this.getPoolKey(poolName);
|
3453
|
-
feeDistributionTokenAccount = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("custody_token_account"), pool.toBuffer(), rewardCustodyMint.toBuffer()], this.programId)[0];
|
3454
|
-
custodyAccountMetas = [];
|
3455
|
-
flpStakeAccountMetas = [];
|
3456
|
-
for (_i = 0, _a = poolConfig.custodies; _i < _a.length; _i++) {
|
3457
|
-
custody = _a[_i];
|
3458
|
-
custodyAccountMetas.push({
|
3459
|
-
pubkey: custody.custodyAccount,
|
3460
|
-
isSigner: false,
|
3461
|
-
isWritable: false,
|
3462
|
-
});
|
3463
|
-
}
|
3464
|
-
return [4, this.program.methods
|
3465
|
-
.deactivateStake({})
|
3466
|
-
.accounts({
|
3467
|
-
perpetuals: this.perpetuals.publicKey,
|
3468
|
-
pool: pool,
|
3469
|
-
rewardCustody: rewardCustodyConfig.custodyAccount,
|
3470
|
-
feeDistributionTokenAccount: feeDistributionTokenAccount,
|
3471
|
-
})
|
3472
|
-
.remainingAccounts(__spreadArray(__spreadArray([], custodyAccountMetas, true), flpStakeAccountMetas, true))
|
3473
|
-
.instruction()];
|
3474
|
-
case 2:
|
3475
|
-
deactivateStakeInstruction = _b.sent();
|
3476
|
-
instructions.push(deactivateStakeInstruction);
|
3477
|
-
return [3, 4];
|
3478
|
-
case 3:
|
3479
|
-
err_13 = _b.sent();
|
3480
|
-
console.log("perpClient deactivateStaking error:: ", err_13);
|
3481
|
-
throw err_13;
|
3482
|
-
case 4: return [2, {
|
3483
|
-
instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
|
3484
|
-
additionalSigners: additionalSigners
|
3485
|
-
}];
|
3486
|
-
}
|
3487
|
-
});
|
3488
|
-
}); };
|
3489
|
-
this.withdrawStake = function (withdrawAmount, poolName, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
3490
|
-
var publicKey, preInstructions, instructions, postInstructions, additionalSigners, lpTokenMint, pool, poolFlpTokenAccount, flpStakeAccount, userLpTokenAccount, withdrawStakeInstruction, err_14;
|
3491
|
-
return __generator(this, function (_a) {
|
3492
|
-
switch (_a.label) {
|
3493
|
-
case 0:
|
3494
|
-
publicKey = this.provider.wallet.publicKey;
|
3495
|
-
preInstructions = [];
|
3496
|
-
instructions = [];
|
3497
|
-
postInstructions = [];
|
3498
|
-
additionalSigners = [];
|
3499
|
-
_a.label = 1;
|
3500
|
-
case 1:
|
3501
|
-
_a.trys.push([1, 4, , 5]);
|
3502
|
-
lpTokenMint = poolConfig.lpTokenMint;
|
3503
|
-
pool = this.getPoolKey(poolName);
|
3504
|
-
poolFlpTokenAccount = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("staked_lp_token_account"), pool.toBuffer(), lpTokenMint.toBuffer()], constants_1.METAPLEX_PROGRAM_ID)[0];
|
3505
|
-
flpStakeAccount = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("stake"), publicKey.toBuffer(), pool.toBuffer()], constants_1.METAPLEX_PROGRAM_ID)[0];
|
3506
|
-
return [4, (0, spl_token_1.getAssociatedTokenAddress)(poolConfig.lpTokenMint, publicKey)];
|
3507
|
-
case 2:
|
3508
|
-
userLpTokenAccount = _a.sent();
|
3509
|
-
return [4, this.program.methods
|
3510
|
-
.withdrawStake({
|
3511
|
-
withdrawAmount: withdrawAmount
|
3512
|
-
})
|
3513
|
-
.accounts({
|
3514
|
-
owner: publicKey,
|
3515
|
-
receivingFlpTokenAccount: userLpTokenAccount,
|
3516
|
-
transferAuthority: poolConfig.transferAuthority,
|
3517
|
-
perpetuals: this.perpetuals.publicKey,
|
3518
|
-
pool: pool,
|
3519
|
-
flpStakeAccount: flpStakeAccount,
|
3520
|
-
poolFlpTokenAccount: poolFlpTokenAccount,
|
3521
|
-
systemProgram: web3_js_1.SystemProgram.programId,
|
3522
|
-
tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
3523
|
-
eventAuthority: this.eventAuthority.publicKey,
|
3524
|
-
})
|
3525
|
-
.instruction()];
|
3526
|
-
case 3:
|
3527
|
-
withdrawStakeInstruction = _a.sent();
|
3528
|
-
instructions.push(withdrawStakeInstruction);
|
3529
|
-
return [3, 5];
|
3530
|
-
case 4:
|
3531
|
-
err_14 = _a.sent();
|
3532
|
-
console.log("perpClient withdrawStake error:: ", err_14);
|
3533
|
-
throw err_14;
|
3534
|
-
case 5: return [2, {
|
3535
|
-
instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
|
3536
|
-
additionalSigners: additionalSigners
|
3537
|
-
}];
|
3538
|
-
}
|
3539
|
-
});
|
3540
|
-
}); };
|
3541
3256
|
this.setPoolConfig = function (permissions, oracleAuthority, maxAumUsd, stakingFeeShareBps, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
3542
|
-
var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setPoolConfigInstruction,
|
3257
|
+
var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setPoolConfigInstruction, err_11;
|
3543
3258
|
return __generator(this, function (_a) {
|
3544
3259
|
switch (_a.label) {
|
3545
3260
|
case 0:
|
@@ -3569,9 +3284,9 @@ var PerpetualsClient = (function () {
|
|
3569
3284
|
instructions.push(setPoolConfigInstruction);
|
3570
3285
|
return [3, 4];
|
3571
3286
|
case 3:
|
3572
|
-
|
3573
|
-
console.log("perpClient setPool error:: ",
|
3574
|
-
throw
|
3287
|
+
err_11 = _a.sent();
|
3288
|
+
console.log("perpClient setPool error:: ", err_11);
|
3289
|
+
throw err_11;
|
3575
3290
|
case 4: return [2, {
|
3576
3291
|
instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
|
3577
3292
|
additionalSigners: additionalSigners
|
@@ -3580,7 +3295,7 @@ var PerpetualsClient = (function () {
|
|
3580
3295
|
});
|
3581
3296
|
}); };
|
3582
3297
|
this.setPermissions = function (permissions) { return __awaiter(_this, void 0, void 0, function () {
|
3583
|
-
var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setPermissionsInstruction,
|
3298
|
+
var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setPermissionsInstruction, err_12;
|
3584
3299
|
return __generator(this, function (_a) {
|
3585
3300
|
switch (_a.label) {
|
3586
3301
|
case 0:
|
@@ -3607,9 +3322,9 @@ var PerpetualsClient = (function () {
|
|
3607
3322
|
instructions.push(setPermissionsInstruction);
|
3608
3323
|
return [3, 4];
|
3609
3324
|
case 3:
|
3610
|
-
|
3611
|
-
console.log("perpClient setPool error:: ",
|
3612
|
-
throw
|
3325
|
+
err_12 = _a.sent();
|
3326
|
+
console.log("perpClient setPool error:: ", err_12);
|
3327
|
+
throw err_12;
|
3613
3328
|
case 4: return [2, {
|
3614
3329
|
instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
|
3615
3330
|
additionalSigners: additionalSigners
|
package/dist/idl/perpetuals.d.ts
CHANGED
@@ -1322,7 +1322,7 @@ export type Perpetuals = {
|
|
1322
1322
|
];
|
1323
1323
|
},
|
1324
1324
|
{
|
1325
|
-
"name": "
|
1325
|
+
"name": "refreshStake";
|
1326
1326
|
"accounts": [
|
1327
1327
|
{
|
1328
1328
|
"name": "perpetuals";
|
@@ -1349,40 +1349,7 @@ export type Perpetuals = {
|
|
1349
1349
|
{
|
1350
1350
|
"name": "params";
|
1351
1351
|
"type": {
|
1352
|
-
"defined": "
|
1353
|
-
};
|
1354
|
-
}
|
1355
|
-
];
|
1356
|
-
},
|
1357
|
-
{
|
1358
|
-
"name": "deactivateStake";
|
1359
|
-
"accounts": [
|
1360
|
-
{
|
1361
|
-
"name": "perpetuals";
|
1362
|
-
"isMut": false;
|
1363
|
-
"isSigner": false;
|
1364
|
-
},
|
1365
|
-
{
|
1366
|
-
"name": "pool";
|
1367
|
-
"isMut": true;
|
1368
|
-
"isSigner": false;
|
1369
|
-
},
|
1370
|
-
{
|
1371
|
-
"name": "rewardCustody";
|
1372
|
-
"isMut": true;
|
1373
|
-
"isSigner": false;
|
1374
|
-
},
|
1375
|
-
{
|
1376
|
-
"name": "feeDistributionTokenAccount";
|
1377
|
-
"isMut": false;
|
1378
|
-
"isSigner": false;
|
1379
|
-
}
|
1380
|
-
];
|
1381
|
-
"args": [
|
1382
|
-
{
|
1383
|
-
"name": "params";
|
1384
|
-
"type": {
|
1385
|
-
"defined": "DeactivateStakeParams";
|
1352
|
+
"defined": "RefreshStakeParams";
|
1386
1353
|
};
|
1387
1354
|
}
|
1388
1355
|
];
|
@@ -3525,13 +3492,6 @@ export type Perpetuals = {
|
|
3525
3492
|
}
|
3526
3493
|
];
|
3527
3494
|
"types": [
|
3528
|
-
{
|
3529
|
-
"name": "ActivateStakeParams";
|
3530
|
-
"type": {
|
3531
|
-
"kind": "struct";
|
3532
|
-
"fields": [];
|
3533
|
-
};
|
3534
|
-
},
|
3535
3495
|
{
|
3536
3496
|
"name": "AddCollateralParams";
|
3537
3497
|
"type": {
|
@@ -3733,13 +3693,6 @@ export type Perpetuals = {
|
|
3733
3693
|
];
|
3734
3694
|
};
|
3735
3695
|
},
|
3736
|
-
{
|
3737
|
-
"name": "DeactivateStakeParams";
|
3738
|
-
"type": {
|
3739
|
-
"kind": "struct";
|
3740
|
-
"fields": [];
|
3741
|
-
};
|
3742
|
-
},
|
3743
3696
|
{
|
3744
3697
|
"name": "DecreaseSizeParams";
|
3745
3698
|
"type": {
|
@@ -3971,6 +3924,13 @@ export type Perpetuals = {
|
|
3971
3924
|
];
|
3972
3925
|
};
|
3973
3926
|
},
|
3927
|
+
{
|
3928
|
+
"name": "RefreshStakeParams";
|
3929
|
+
"type": {
|
3930
|
+
"kind": "struct";
|
3931
|
+
"fields": [];
|
3932
|
+
};
|
3933
|
+
},
|
3974
3934
|
{
|
3975
3935
|
"name": "RemoveCollateralParams";
|
3976
3936
|
"type": {
|
@@ -4351,7 +4311,16 @@ export type Perpetuals = {
|
|
4351
4311
|
"name": "WithdrawStakeParams";
|
4352
4312
|
"type": {
|
4353
4313
|
"kind": "struct";
|
4354
|
-
"fields": [
|
4314
|
+
"fields": [
|
4315
|
+
{
|
4316
|
+
"name": "pendingActivation";
|
4317
|
+
"type": "bool";
|
4318
|
+
},
|
4319
|
+
{
|
4320
|
+
"name": "deactivated";
|
4321
|
+
"type": "bool";
|
4322
|
+
}
|
4323
|
+
];
|
4355
4324
|
};
|
4356
4325
|
},
|
4357
4326
|
{
|
@@ -5206,16 +5175,6 @@ export type Perpetuals = {
|
|
5206
5175
|
}
|
5207
5176
|
];
|
5208
5177
|
"events": [
|
5209
|
-
{
|
5210
|
-
"name": "ActivateStakeLog";
|
5211
|
-
"fields": [
|
5212
|
-
{
|
5213
|
-
"name": "activated";
|
5214
|
-
"type": "u64";
|
5215
|
-
"index": false;
|
5216
|
-
}
|
5217
|
-
];
|
5218
|
-
},
|
5219
5178
|
{
|
5220
5179
|
"name": "AddCollateralLog";
|
5221
5180
|
"fields": [
|
@@ -5336,16 +5295,6 @@ export type Perpetuals = {
|
|
5336
5295
|
}
|
5337
5296
|
];
|
5338
5297
|
},
|
5339
|
-
{
|
5340
|
-
"name": "DeactivateStakeLog";
|
5341
|
-
"fields": [
|
5342
|
-
{
|
5343
|
-
"name": "deactivated";
|
5344
|
-
"type": "u64";
|
5345
|
-
"index": false;
|
5346
|
-
}
|
5347
|
-
];
|
5348
|
-
},
|
5349
5298
|
{
|
5350
5299
|
"name": "DecreaseSizeLog";
|
5351
5300
|
"fields": [
|