flash-sdk 13.0.2-alpha.0 → 14.0.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.
@@ -5163,8 +5163,48 @@ var PerpetualsClient = (function () {
5163
5163
  });
5164
5164
  });
5165
5165
  };
5166
+ this.migrateTokenStake = function (tokenStakeAccounts) { return __awaiter(_this, void 0, void 0, function () {
5167
+ var publicKey, instructions, additionalSigners, remainingAccounts, migrateTokenStakeIx, err_19;
5168
+ return __generator(this, function (_a) {
5169
+ switch (_a.label) {
5170
+ case 0:
5171
+ publicKey = this.provider.wallet.publicKey;
5172
+ instructions = [];
5173
+ additionalSigners = [];
5174
+ remainingAccounts = tokenStakeAccounts.map(function (pubkey) { return ({
5175
+ pubkey: pubkey,
5176
+ isSigner: false,
5177
+ isWritable: true,
5178
+ }); });
5179
+ _a.label = 1;
5180
+ case 1:
5181
+ _a.trys.push([1, 3, , 4]);
5182
+ return [4, this.program.methods
5183
+ .migrateTokenStake({})
5184
+ .accountsPartial({
5185
+ admin: publicKey,
5186
+ multisig: this.multisig.publicKey,
5187
+ program: this.program.programId,
5188
+ })
5189
+ .remainingAccounts(remainingAccounts)
5190
+ .instruction()];
5191
+ case 2:
5192
+ migrateTokenStakeIx = _a.sent();
5193
+ instructions.push(migrateTokenStakeIx);
5194
+ return [3, 4];
5195
+ case 3:
5196
+ err_19 = _a.sent();
5197
+ console.log("perpClient migrateTokenStake error:: ", err_19);
5198
+ return [3, 4];
5199
+ case 4: return [2, {
5200
+ instructions: instructions,
5201
+ additionalSigners: additionalSigners,
5202
+ }];
5203
+ }
5204
+ });
5205
+ }); };
5166
5206
  this.migrateFlp = function (amount, rewardTokenMint, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5167
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, lpTokenMint, compoundingTokenMint, compoudingTokenAccount, flpStakeAccount, poolStakedLpVault, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, migrateFlp, err_19;
5207
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, lpTokenMint, compoundingTokenMint, compoudingTokenAccount, flpStakeAccount, poolStakedLpVault, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, migrateFlp, err_20;
5168
5208
  return __generator(this, function (_d) {
5169
5209
  switch (_d.label) {
5170
5210
  case 0:
@@ -5235,8 +5275,8 @@ var PerpetualsClient = (function () {
5235
5275
  instructions.push(migrateFlp);
5236
5276
  return [3, 4];
5237
5277
  case 3:
5238
- err_19 = _d.sent();
5239
- console.log("perpClient migrateFlp error:: ", err_19);
5278
+ err_20 = _d.sent();
5279
+ console.log("perpClient migrateFlp error:: ", err_20);
5240
5280
  return [3, 4];
5241
5281
  case 4: return [2, {
5242
5282
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
@@ -5251,7 +5291,7 @@ var PerpetualsClient = (function () {
5251
5291
  args_1[_i - 1] = arguments[_i];
5252
5292
  }
5253
5293
  return __awaiter(_this, __spreadArray([poolConfig_1], args_1, true), void 0, function (poolConfig, rewardTokenSymbol) {
5254
- var instructions, additionalSigners, rewardCustody, lpTokenMint, custodyAccountMetas, custodyOracleAccountMetas, markets, _a, _b, custody, _c, _d, market, compoundingFee, err_20;
5294
+ var instructions, additionalSigners, rewardCustody, lpTokenMint, custodyAccountMetas, custodyOracleAccountMetas, markets, _a, _b, custody, _c, _d, market, compoundingFee, err_21;
5255
5295
  if (rewardTokenSymbol === void 0) { rewardTokenSymbol = 'USDC'; }
5256
5296
  return __generator(this, function (_e) {
5257
5297
  switch (_e.label) {
@@ -5308,8 +5348,8 @@ var PerpetualsClient = (function () {
5308
5348
  instructions.push(compoundingFee);
5309
5349
  return [3, 4];
5310
5350
  case 3:
5311
- err_20 = _e.sent();
5312
- console.log("perpClient compoundingFee error:: ", err_20);
5351
+ err_21 = _e.sent();
5352
+ console.log("perpClient compoundingFee error:: ", err_21);
5313
5353
  return [3, 4];
5314
5354
  case 4: return [2, {
5315
5355
  instructions: __spreadArray([], instructions, true),
@@ -5320,7 +5360,7 @@ var PerpetualsClient = (function () {
5320
5360
  });
5321
5361
  };
5322
5362
  this.depositTokenStake = function (owner, feePayer, depositAmount, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5323
- var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, userTokenAccount, depositTokenStakeInstruction, err_21;
5363
+ var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, userTokenAccount, depositTokenStakeInstruction, err_22;
5324
5364
  return __generator(this, function (_a) {
5325
5365
  switch (_a.label) {
5326
5366
  case 0:
@@ -5360,9 +5400,9 @@ var PerpetualsClient = (function () {
5360
5400
  instructions.push(depositTokenStakeInstruction);
5361
5401
  return [3, 5];
5362
5402
  case 4:
5363
- err_21 = _a.sent();
5364
- console.log("perpClient depositStakingInstruction error:: ", err_21);
5365
- throw err_21;
5403
+ err_22 = _a.sent();
5404
+ console.log("perpClient depositStakingInstruction error:: ", err_22);
5405
+ throw err_22;
5366
5406
  case 5: return [2, {
5367
5407
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5368
5408
  additionalSigners: additionalSigners
@@ -5371,7 +5411,7 @@ var PerpetualsClient = (function () {
5371
5411
  });
5372
5412
  }); };
5373
5413
  this.unstakeTokenRequest = function (owner, unstakeAmount, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5374
- var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, unstakeTokenRequestInstruction, err_22;
5414
+ var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, unstakeTokenRequestInstruction, err_23;
5375
5415
  return __generator(this, function (_a) {
5376
5416
  switch (_a.label) {
5377
5417
  case 0:
@@ -5399,9 +5439,9 @@ var PerpetualsClient = (function () {
5399
5439
  instructions.push(unstakeTokenRequestInstruction);
5400
5440
  return [3, 4];
5401
5441
  case 3:
5402
- err_22 = _a.sent();
5403
- console.log("perpClient unstakeTokenRequestInstruction error:: ", err_22);
5404
- throw err_22;
5442
+ err_23 = _a.sent();
5443
+ console.log("perpClient unstakeTokenRequestInstruction error:: ", err_23);
5444
+ throw err_23;
5405
5445
  case 4: return [2, {
5406
5446
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5407
5447
  additionalSigners: additionalSigners
@@ -5410,7 +5450,7 @@ var PerpetualsClient = (function () {
5410
5450
  });
5411
5451
  }); };
5412
5452
  this.withdrawToken = function (owner, withdrawRequestId, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5413
- var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, userTokenAccount, withdrawTokenInstruction, err_23;
5453
+ var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, userTokenAccount, withdrawTokenInstruction, err_24;
5414
5454
  return __generator(this, function (_a) {
5415
5455
  switch (_a.label) {
5416
5456
  case 0:
@@ -5449,9 +5489,9 @@ var PerpetualsClient = (function () {
5449
5489
  instructions.push(withdrawTokenInstruction);
5450
5490
  return [3, 5];
5451
5491
  case 4:
5452
- err_23 = _a.sent();
5453
- console.log("perpClient withdrawTokenInstruction error:: ", err_23);
5454
- throw err_23;
5492
+ err_24 = _a.sent();
5493
+ console.log("perpClient withdrawTokenInstruction error:: ", err_24);
5494
+ throw err_24;
5455
5495
  case 5: return [2, {
5456
5496
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5457
5497
  additionalSigners: additionalSigners
@@ -5460,7 +5500,7 @@ var PerpetualsClient = (function () {
5460
5500
  });
5461
5501
  }); };
5462
5502
  this.cancelUnstakeTokenRequest = function (owner, withdrawRequestId, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5463
- var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, cancelUnstakeTokenRequestInstruction, err_24;
5503
+ var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, cancelUnstakeTokenRequestInstruction, err_25;
5464
5504
  return __generator(this, function (_a) {
5465
5505
  switch (_a.label) {
5466
5506
  case 0:
@@ -5488,9 +5528,9 @@ var PerpetualsClient = (function () {
5488
5528
  instructions.push(cancelUnstakeTokenRequestInstruction);
5489
5529
  return [3, 4];
5490
5530
  case 3:
5491
- err_24 = _a.sent();
5492
- console.log("perpClient cancelUnstakeTokenRequestInstruction error:: ", err_24);
5493
- throw err_24;
5531
+ err_25 = _a.sent();
5532
+ console.log("perpClient cancelUnstakeTokenRequestInstruction error:: ", err_25);
5533
+ throw err_25;
5494
5534
  case 4: return [2, {
5495
5535
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5496
5536
  additionalSigners: additionalSigners
@@ -5504,7 +5544,7 @@ var PerpetualsClient = (function () {
5504
5544
  args_1[_i - 2] = arguments[_i];
5505
5545
  }
5506
5546
  return __awaiter(_this, __spreadArray([owner_1, poolConfig_1], args_1, true), void 0, function (owner, poolConfig, createUserATA) {
5507
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, userTokenAccount, _a, collectTokenRewardInstruction, err_25;
5547
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, userTokenAccount, _a, collectTokenRewardInstruction, err_26;
5508
5548
  if (createUserATA === void 0) { createUserATA = true; }
5509
5549
  return __generator(this, function (_b) {
5510
5550
  switch (_b.label) {
@@ -5548,9 +5588,9 @@ var PerpetualsClient = (function () {
5548
5588
  instructions.push(collectTokenRewardInstruction);
5549
5589
  return [3, 6];
5550
5590
  case 5:
5551
- err_25 = _b.sent();
5552
- console.log("perpClient collectTokenRewardInstruction error:: ", err_25);
5553
- throw err_25;
5591
+ err_26 = _b.sent();
5592
+ console.log("perpClient collectTokenRewardInstruction error:: ", err_26);
5593
+ throw err_26;
5554
5594
  case 6: return [2, {
5555
5595
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5556
5596
  additionalSigners: additionalSigners
@@ -5565,7 +5605,7 @@ var PerpetualsClient = (function () {
5565
5605
  args_1[_i - 3] = arguments[_i];
5566
5606
  }
5567
5607
  return __awaiter(_this, __spreadArray([owner_1, rewardSymbol_1, poolConfig_1], args_1, true), void 0, function (owner, rewardSymbol, poolConfig, createUserATA) {
5568
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustodyMint, tokenStakeAccount, userTokenAccount, _a, collectRevenueInstruction, err_26;
5608
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustodyMint, tokenStakeAccount, userTokenAccount, _a, collectRevenueInstruction, err_27;
5569
5609
  if (createUserATA === void 0) { createUserATA = true; }
5570
5610
  return __generator(this, function (_b) {
5571
5611
  switch (_b.label) {
@@ -5610,9 +5650,9 @@ var PerpetualsClient = (function () {
5610
5650
  instructions.push(collectRevenueInstruction);
5611
5651
  return [3, 6];
5612
5652
  case 5:
5613
- err_26 = _b.sent();
5614
- console.log("perpClient collectRevenueInstruction error:: ", err_26);
5615
- throw err_26;
5653
+ err_27 = _b.sent();
5654
+ console.log("perpClient collectRevenueInstruction error:: ", err_27);
5655
+ throw err_27;
5616
5656
  case 6: return [2, {
5617
5657
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5618
5658
  additionalSigners: additionalSigners
@@ -5622,7 +5662,7 @@ var PerpetualsClient = (function () {
5622
5662
  });
5623
5663
  };
5624
5664
  this.refreshTokenStake = function (tokenStakeAccounts, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5625
- var instructions, additionalSigners, remainingAccounts, refreshTokenStakeInstruction, err_27;
5665
+ var instructions, additionalSigners, remainingAccounts, refreshTokenStakeInstruction, err_28;
5626
5666
  return __generator(this, function (_a) {
5627
5667
  switch (_a.label) {
5628
5668
  case 0:
@@ -5650,9 +5690,9 @@ var PerpetualsClient = (function () {
5650
5690
  instructions.push(refreshTokenStakeInstruction);
5651
5691
  return [3, 4];
5652
5692
  case 3:
5653
- err_27 = _a.sent();
5654
- console.log("perpClient refreshTokenStakeInstruction error:: ", err_27);
5655
- throw err_27;
5693
+ err_28 = _a.sent();
5694
+ console.log("perpClient refreshTokenStakeInstruction error:: ", err_28);
5695
+ throw err_28;
5656
5696
  case 4: return [2, {
5657
5697
  instructions: instructions,
5658
5698
  additionalSigners: additionalSigners
@@ -5666,7 +5706,7 @@ var PerpetualsClient = (function () {
5666
5706
  args_1[_i - 3] = arguments[_i];
5667
5707
  }
5668
5708
  return __awaiter(_this, __spreadArray([owner_1, rebateSymbol_1, poolConfig_1], args_1, true), void 0, function (owner, rebateSymbol, poolConfig, createUserATA) {
5669
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rebateMint, tokenStakeAccount, userTokenAccount, _a, collectRebateInstruction, err_28;
5709
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rebateMint, tokenStakeAccount, userTokenAccount, _a, collectRebateInstruction, err_29;
5670
5710
  if (createUserATA === void 0) { createUserATA = true; }
5671
5711
  return __generator(this, function (_b) {
5672
5712
  switch (_b.label) {
@@ -5711,9 +5751,9 @@ var PerpetualsClient = (function () {
5711
5751
  instructions.push(collectRebateInstruction);
5712
5752
  return [3, 6];
5713
5753
  case 5:
5714
- err_28 = _b.sent();
5715
- console.log("perpClient collectRebateInstruction error:: ", err_28);
5716
- throw err_28;
5754
+ err_29 = _b.sent();
5755
+ console.log("perpClient collectRebateInstruction error:: ", err_29);
5756
+ throw err_29;
5717
5757
  case 6: return [2, {
5718
5758
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5719
5759
  additionalSigners: additionalSigners
@@ -5723,7 +5763,7 @@ var PerpetualsClient = (function () {
5723
5763
  });
5724
5764
  };
5725
5765
  this.settleRebates = function (rebateSymbol, rewardSymbol, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5726
- var preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, rebateMint, settleRebatesInstruction, err_29;
5766
+ var preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, rebateMint, settleRebatesInstruction, err_30;
5727
5767
  return __generator(this, function (_a) {
5728
5768
  switch (_a.label) {
5729
5769
  case 0:
@@ -5757,9 +5797,9 @@ var PerpetualsClient = (function () {
5757
5797
  instructions.push(settleRebatesInstruction);
5758
5798
  return [3, 4];
5759
5799
  case 3:
5760
- err_29 = _a.sent();
5761
- console.log("perpClient settleRebatesInstruction error:: ", err_29);
5762
- throw err_29;
5800
+ err_30 = _a.sent();
5801
+ console.log("perpClient settleRebatesInstruction error:: ", err_30);
5802
+ throw err_30;
5763
5803
  case 4: return [2, {
5764
5804
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5765
5805
  additionalSigners: additionalSigners
@@ -5773,7 +5813,7 @@ var PerpetualsClient = (function () {
5773
5813
  args_1[_i - 11] = arguments[_i];
5774
5814
  }
5775
5815
  return __awaiter(_this, __spreadArray([targetSymbol_1, collateralSymbol_1, reserveSymbol_1, receiveSymbol_1, side_1, limitPrice_1, reserveAmount_1, sizeAmount_1, stopLossPrice_1, takeProfitPrice_1, poolConfig_1], args_1, true), void 0, function (targetSymbol, collateralSymbol, reserveSymbol, receiveSymbol, side, limitPrice, reserveAmount, sizeAmount, stopLossPrice, takeProfitPrice, poolConfig, skipBalanceChecks, ephemeralSignerPubkey) {
5776
- var publicKey, targetCustodyConfig, reserveCustodyConfig, collateralCustodyConfig, receiveCustodyConfig, marketAccount, userReserveTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, accCreationLamports, lamports, unWrappedSolBalance, _a, tokenAccountBalance, _b, positionAccount, orderAccount, placeLimitOrder, err_30;
5816
+ var publicKey, targetCustodyConfig, reserveCustodyConfig, collateralCustodyConfig, receiveCustodyConfig, marketAccount, userReserveTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, accCreationLamports, lamports, unWrappedSolBalance, _a, tokenAccountBalance, _b, positionAccount, orderAccount, placeLimitOrder, err_31;
5777
5817
  if (skipBalanceChecks === void 0) { skipBalanceChecks = false; }
5778
5818
  if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
5779
5819
  return __generator(this, function (_c) {
@@ -5877,9 +5917,9 @@ var PerpetualsClient = (function () {
5877
5917
  instructions.push(placeLimitOrder);
5878
5918
  return [3, 10];
5879
5919
  case 9:
5880
- err_30 = _c.sent();
5881
- console.log("perpClient placeLimitOrder error:: ", err_30);
5882
- throw err_30;
5920
+ err_31 = _c.sent();
5921
+ console.log("perpClient placeLimitOrder error:: ", err_31);
5922
+ throw err_31;
5883
5923
  case 10: return [2, {
5884
5924
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5885
5925
  additionalSigners: additionalSigners
@@ -5894,7 +5934,7 @@ var PerpetualsClient = (function () {
5894
5934
  args_1[_i - 11] = arguments[_i];
5895
5935
  }
5896
5936
  return __awaiter(_this, __spreadArray([targetSymbol_1, collateralSymbol_1, reserveSymbol_1, receiveSymbol_1, side_1, orderId_1, limitPrice_1, sizeAmount_1, stopLossPrice_1, takeProfitPrice_1, poolConfig_1], args_1, true), void 0, function (targetSymbol, collateralSymbol, reserveSymbol, receiveSymbol, side, orderId, limitPrice, sizeAmount, stopLossPrice, takeProfitPrice, poolConfig, createUserATA, ephemeralSignerPubkey) {
5897
- var publicKey, targetCustodyConfig, reserveCustodyConfig, collateralCustodyConfig, receiveCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, wrappedSolAccount, userReceivingTokenAccount, lamports, _a, positionAccount, orderAccount, editLimitOrder, err_31;
5937
+ var publicKey, targetCustodyConfig, reserveCustodyConfig, collateralCustodyConfig, receiveCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, wrappedSolAccount, userReceivingTokenAccount, lamports, _a, positionAccount, orderAccount, editLimitOrder, err_32;
5898
5938
  if (createUserATA === void 0) { createUserATA = true; }
5899
5939
  if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
5900
5940
  return __generator(this, function (_b) {
@@ -5983,9 +6023,9 @@ var PerpetualsClient = (function () {
5983
6023
  instructions.push(editLimitOrder);
5984
6024
  return [3, 8];
5985
6025
  case 7:
5986
- err_31 = _b.sent();
5987
- console.log("perpClient editLimitOrder error:: ", err_31);
5988
- throw err_31;
6026
+ err_32 = _b.sent();
6027
+ console.log("perpClient editLimitOrder error:: ", err_32);
6028
+ throw err_32;
5989
6029
  case 8: return [2, {
5990
6030
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5991
6031
  additionalSigners: additionalSigners
@@ -6000,7 +6040,7 @@ var PerpetualsClient = (function () {
6000
6040
  args_1[_i - 7] = arguments[_i];
6001
6041
  }
6002
6042
  return __awaiter(_this, __spreadArray([userPubkey_1, targetSymbol_1, collateralSymbol_1, side_1, orderId_1, poolConfig_1, privilege_1], args_1, true), void 0, function (userPubkey, targetSymbol, collateralSymbol, side, orderId, poolConfig, privilege, tokenStakeAccount, userReferralAccount) {
6003
- var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, executeLimitOrder, err_32;
6043
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, executeLimitOrder, err_33;
6004
6044
  if (tokenStakeAccount === void 0) { tokenStakeAccount = web3_js_1.PublicKey.default; }
6005
6045
  if (userReferralAccount === void 0) { userReferralAccount = web3_js_1.PublicKey.default; }
6006
6046
  return __generator(this, function (_a) {
@@ -6050,9 +6090,9 @@ var PerpetualsClient = (function () {
6050
6090
  instructions.push(executeLimitOrder);
6051
6091
  return [3, 4];
6052
6092
  case 3:
6053
- err_32 = _a.sent();
6054
- console.log("perpClient executeLimitOrder error:: ", err_32);
6055
- throw err_32;
6093
+ err_33 = _a.sent();
6094
+ console.log("perpClient executeLimitOrder error:: ", err_33);
6095
+ throw err_33;
6056
6096
  case 4: return [2, {
6057
6097
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6058
6098
  additionalSigners: additionalSigners
@@ -6067,7 +6107,7 @@ var PerpetualsClient = (function () {
6067
6107
  args_1[_i - 8] = arguments[_i];
6068
6108
  }
6069
6109
  return __awaiter(_this, __spreadArray([userPubkey_1, targetSymbol_1, collateralSymbol_1, reserveSymbol_1, side_1, orderId_1, poolConfig_1, privilege_1], args_1, true), void 0, function (userPubkey, targetSymbol, collateralSymbol, reserveSymbol, side, orderId, poolConfig, privilege, tokenStakeAccount, userReferralAccount) {
6070
- var publicKey, targetCustodyConfig, collateralCustodyConfig, reserveCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, executeLimitWithSwap, err_33;
6110
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, reserveCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, executeLimitWithSwap, err_34;
6071
6111
  if (tokenStakeAccount === void 0) { tokenStakeAccount = web3_js_1.PublicKey.default; }
6072
6112
  if (userReferralAccount === void 0) { userReferralAccount = web3_js_1.PublicKey.default; }
6073
6113
  return __generator(this, function (_a) {
@@ -6120,9 +6160,9 @@ var PerpetualsClient = (function () {
6120
6160
  instructions.push(executeLimitWithSwap);
6121
6161
  return [3, 4];
6122
6162
  case 3:
6123
- err_33 = _a.sent();
6124
- console.log("perpClient executeLimitWithSwap error:: ", err_33);
6125
- throw err_33;
6163
+ err_34 = _a.sent();
6164
+ console.log("perpClient executeLimitWithSwap error:: ", err_34);
6165
+ throw err_34;
6126
6166
  case 4: return [2, {
6127
6167
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6128
6168
  additionalSigners: additionalSigners
@@ -6132,7 +6172,7 @@ var PerpetualsClient = (function () {
6132
6172
  });
6133
6173
  };
6134
6174
  this.placeTriggerOrder = function (targetSymbol, collateralSymbol, receiveSymbol, side, triggerPrice, deltaSizeAmount, isStopLoss, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6135
- var publicKey, targetCustodyConfig, collateralCustodyConfig, receivingCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, placeTriggerOrder, err_34;
6175
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, receivingCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, placeTriggerOrder, err_35;
6136
6176
  return __generator(this, function (_a) {
6137
6177
  switch (_a.label) {
6138
6178
  case 0:
@@ -6178,9 +6218,9 @@ var PerpetualsClient = (function () {
6178
6218
  instructions.push(placeTriggerOrder);
6179
6219
  return [3, 4];
6180
6220
  case 3:
6181
- err_34 = _a.sent();
6182
- console.log("perpClient placeTriggerOrder error:: ", err_34);
6183
- throw err_34;
6221
+ err_35 = _a.sent();
6222
+ console.log("perpClient placeTriggerOrder error:: ", err_35);
6223
+ throw err_35;
6184
6224
  case 4: return [2, {
6185
6225
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6186
6226
  additionalSigners: additionalSigners
@@ -6189,7 +6229,7 @@ var PerpetualsClient = (function () {
6189
6229
  });
6190
6230
  }); };
6191
6231
  this.editTriggerOrder = function (targetSymbol, collateralSymbol, receiveSymbol, side, orderId, triggerPrice, deltaSizeAmount, isStopLoss, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6192
- var publicKey, targetCustodyConfig, collateralCustodyConfig, receivingCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, editTriggerOrder, err_35;
6232
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, receivingCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, editTriggerOrder, err_36;
6193
6233
  return __generator(this, function (_a) {
6194
6234
  switch (_a.label) {
6195
6235
  case 0:
@@ -6234,9 +6274,9 @@ var PerpetualsClient = (function () {
6234
6274
  instructions.push(editTriggerOrder);
6235
6275
  return [3, 4];
6236
6276
  case 3:
6237
- err_35 = _a.sent();
6238
- console.log("perpClient editTriggerOrder error:: ", err_35);
6239
- throw err_35;
6277
+ err_36 = _a.sent();
6278
+ console.log("perpClient editTriggerOrder error:: ", err_36);
6279
+ throw err_36;
6240
6280
  case 4: return [2, {
6241
6281
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6242
6282
  additionalSigners: additionalSigners
@@ -6245,7 +6285,7 @@ var PerpetualsClient = (function () {
6245
6285
  });
6246
6286
  }); };
6247
6287
  this.cancelTriggerOrder = function (targetSymbol, collateralSymbol, side, orderId, isStopLoss, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6248
- var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, orderAccount, cancelTriggerOrder, err_36;
6288
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, orderAccount, cancelTriggerOrder, err_37;
6249
6289
  return __generator(this, function (_a) {
6250
6290
  switch (_a.label) {
6251
6291
  case 0:
@@ -6276,9 +6316,9 @@ var PerpetualsClient = (function () {
6276
6316
  instructions.push(cancelTriggerOrder);
6277
6317
  return [3, 4];
6278
6318
  case 3:
6279
- err_36 = _a.sent();
6280
- console.log("perpClient cancelTriggerOrder error:: ", err_36);
6281
- throw err_36;
6319
+ err_37 = _a.sent();
6320
+ console.log("perpClient cancelTriggerOrder error:: ", err_37);
6321
+ throw err_37;
6282
6322
  case 4: return [2, {
6283
6323
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6284
6324
  additionalSigners: additionalSigners
@@ -6287,7 +6327,7 @@ var PerpetualsClient = (function () {
6287
6327
  });
6288
6328
  }); };
6289
6329
  this.cancelAllTriggerOrders = function (targetSymbol, collateralSymbol, side, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6290
- var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, orderAccount, positionAccount, cancelAllTriggerOrders, err_37;
6330
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, orderAccount, positionAccount, cancelAllTriggerOrders, err_38;
6291
6331
  return __generator(this, function (_a) {
6292
6332
  switch (_a.label) {
6293
6333
  case 0:
@@ -6316,9 +6356,9 @@ var PerpetualsClient = (function () {
6316
6356
  instructions.push(cancelAllTriggerOrders);
6317
6357
  return [3, 4];
6318
6358
  case 3:
6319
- err_37 = _a.sent();
6320
- console.log("perpClient cancelAllTriggerOrders error:: ", err_37);
6321
- throw err_37;
6359
+ err_38 = _a.sent();
6360
+ console.log("perpClient cancelAllTriggerOrders error:: ", err_38);
6361
+ throw err_38;
6322
6362
  case 4: return [2, {
6323
6363
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6324
6364
  additionalSigners: additionalSigners
@@ -6332,7 +6372,7 @@ var PerpetualsClient = (function () {
6332
6372
  args_1[_i - 9] = arguments[_i];
6333
6373
  }
6334
6374
  return __awaiter(_this, __spreadArray([owner_1, targetSymbol_1, collateralSymbol_1, receivingSymbol_1, side_1, orderId_1, isStopLoss_1, privilege_1, poolConfig_1], args_1, true), void 0, function (owner, targetSymbol, collateralSymbol, receivingSymbol, side, orderId, isStopLoss, privilege, poolConfig, createUserATA, ephemeralSignerPubkey, tokenStakeAccount, userReferralAccount) {
6335
- var payerPubkey, targetCustodyConfig, collateralCustodyConfig, receivingCustodyConfig, marketAccount, userReceivingTokenAccount, userReceivingTokenAccountCollateral, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, collateralToken, receivingToken, _a, _b, positionAccount, orderAccount, custodyAccountMetas, custodyOracleAccountMetas, _c, _d, custody, executeTriggerWithSwap, err_38;
6375
+ var payerPubkey, targetCustodyConfig, collateralCustodyConfig, receivingCustodyConfig, marketAccount, userReceivingTokenAccount, userReceivingTokenAccountCollateral, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, collateralToken, receivingToken, _a, _b, positionAccount, orderAccount, custodyAccountMetas, custodyOracleAccountMetas, _c, _d, custody, executeTriggerWithSwap, err_39;
6336
6376
  if (createUserATA === void 0) { createUserATA = true; }
6337
6377
  if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
6338
6378
  if (tokenStakeAccount === void 0) { tokenStakeAccount = web3_js_1.PublicKey.default; }
@@ -6436,9 +6476,9 @@ var PerpetualsClient = (function () {
6436
6476
  instructions.push(executeTriggerWithSwap);
6437
6477
  return [3, 10];
6438
6478
  case 9:
6439
- err_38 = _e.sent();
6440
- console.log("perpClient executeTriggerWithSwap error:: ", err_38);
6441
- throw err_38;
6479
+ err_39 = _e.sent();
6480
+ console.log("perpClient executeTriggerWithSwap error:: ", err_39);
6481
+ throw err_39;
6442
6482
  case 10: return [2, {
6443
6483
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6444
6484
  additionalSigners: additionalSigners
@@ -6453,7 +6493,7 @@ var PerpetualsClient = (function () {
6453
6493
  args_1[_i - 8] = arguments[_i];
6454
6494
  }
6455
6495
  return __awaiter(_this, __spreadArray([owner_1, targetSymbol_1, collateralSymbol_1, side_1, orderId_1, isStopLoss_1, privilege_1, poolConfig_1], args_1, true), void 0, function (owner, targetSymbol, collateralSymbol, side, orderId, isStopLoss, privilege, poolConfig, createUserATA, ephemeralSignerPubkey, tokenStakeAccount, userReferralAccount) {
6456
- var payerPubkey, targetCustodyConfig, collateralCustodyConfig, marketAccount, userReceivingTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, positionAccount, orderAccount, executeTriggerOrder, err_39;
6496
+ var payerPubkey, targetCustodyConfig, collateralCustodyConfig, marketAccount, userReceivingTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, positionAccount, orderAccount, executeTriggerOrder, err_40;
6457
6497
  if (createUserATA === void 0) { createUserATA = true; }
6458
6498
  if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
6459
6499
  if (tokenStakeAccount === void 0) { tokenStakeAccount = web3_js_1.PublicKey.default; }
@@ -6522,9 +6562,9 @@ var PerpetualsClient = (function () {
6522
6562
  instructions.push(executeTriggerOrder);
6523
6563
  return [3, 8];
6524
6564
  case 7:
6525
- err_39 = _b.sent();
6526
- console.log("perpClient executeTriggerOrder error:: ", err_39);
6527
- throw err_39;
6565
+ err_40 = _b.sent();
6566
+ console.log("perpClient executeTriggerOrder error:: ", err_40);
6567
+ throw err_40;
6528
6568
  case 8: return [2, {
6529
6569
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6530
6570
  additionalSigners: additionalSigners
@@ -6539,7 +6579,7 @@ var PerpetualsClient = (function () {
6539
6579
  args_1[_i - 5] = arguments[_i];
6540
6580
  }
6541
6581
  return __awaiter(_this, __spreadArray([userInputTokenSymbol_1, userOutputTokenSymbol_1, amountIn_1, minAmountOut_1, poolConfig_1], args_1, true), void 0, function (userInputTokenSymbol, userOutputTokenSymbol, amountIn, minAmountOut, poolConfig, useFeesPool, createUserATA, unWrapSol, skipBalanceChecks, ephemeralSignerPubkey, isWhitelistedUser) {
6542
- var userInputCustodyConfig, userOutputCustodyConfig, publicKey, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, userOutputTokenAccount, userInputTokenAccount, wsolAssociatedTokenAccount, wsolATAExist, unWrappedSolBalance, _a, wsolAssociatedTokenAccount, closeWsolATAIns, accCreationLamports, lamports, unWrappedSolBalance, _b, tokenAccountBalance, _c, lamports, _d, custodyAccountMetas, custodyOracleAccountMetas, _e, _f, custody, whitelistPda, whitelistMeta, params, inx, closeWsolATAIns, err_40;
6582
+ var userInputCustodyConfig, userOutputCustodyConfig, publicKey, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, userOutputTokenAccount, userInputTokenAccount, wsolAssociatedTokenAccount, wsolATAExist, unWrappedSolBalance, _a, wsolAssociatedTokenAccount, closeWsolATAIns, accCreationLamports, lamports, unWrappedSolBalance, _b, tokenAccountBalance, _c, lamports, _d, custodyAccountMetas, custodyOracleAccountMetas, _e, _f, custody, whitelistPda, whitelistMeta, params, inx, closeWsolATAIns, err_41;
6543
6583
  if (useFeesPool === void 0) { useFeesPool = false; }
6544
6584
  if (createUserATA === void 0) { createUserATA = true; }
6545
6585
  if (unWrapSol === void 0) { unWrapSol = false; }
@@ -6750,9 +6790,9 @@ var PerpetualsClient = (function () {
6750
6790
  }
6751
6791
  return [3, 20];
6752
6792
  case 19:
6753
- err_40 = _g.sent();
6754
- console.error("perpClient Swap error:: ", err_40);
6755
- throw err_40;
6793
+ err_41 = _g.sent();
6794
+ console.error("perpClient Swap error:: ", err_41);
6795
+ throw err_41;
6756
6796
  case 20: return [2, {
6757
6797
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6758
6798
  additionalSigners: additionalSigners
@@ -6762,7 +6802,7 @@ var PerpetualsClient = (function () {
6762
6802
  });
6763
6803
  };
6764
6804
  this.swapFeeInternal = function (rewardTokenSymbol, swapTokenSymbol, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6765
- var rewardCustody, custody, publicKey, preInstructions, instructions, postInstructions, additionalSigners, custodyAccountMetas, custodyOracleAccountMetas, _i, _a, custody_1, params, inx, err_41;
6805
+ var rewardCustody, custody, publicKey, preInstructions, instructions, postInstructions, additionalSigners, custodyAccountMetas, custodyOracleAccountMetas, _i, _a, custody_1, params, inx, err_42;
6766
6806
  return __generator(this, function (_b) {
6767
6807
  switch (_b.label) {
6768
6808
  case 0:
@@ -6816,9 +6856,9 @@ var PerpetualsClient = (function () {
6816
6856
  instructions.push(inx);
6817
6857
  return [3, 4];
6818
6858
  case 3:
6819
- err_41 = _b.sent();
6820
- console.error("perpClient Swap error:: ", err_41);
6821
- throw err_41;
6859
+ err_42 = _b.sent();
6860
+ console.error("perpClient Swap error:: ", err_42);
6861
+ throw err_42;
6822
6862
  case 4: return [2, {
6823
6863
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6824
6864
  additionalSigners: additionalSigners
@@ -6827,7 +6867,7 @@ var PerpetualsClient = (function () {
6827
6867
  });
6828
6868
  }); };
6829
6869
  this.setLpTokenPrice = function (poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6830
- var instructions, additionalSigners, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, setLpTokenPriceInstruction, err_42;
6870
+ var instructions, additionalSigners, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, setLpTokenPriceInstruction, err_43;
6831
6871
  return __generator(this, function (_d) {
6832
6872
  switch (_d.label) {
6833
6873
  case 0:
@@ -6875,9 +6915,9 @@ var PerpetualsClient = (function () {
6875
6915
  instructions.push(setLpTokenPriceInstruction);
6876
6916
  return [3, 4];
6877
6917
  case 3:
6878
- err_42 = _d.sent();
6879
- console.log("perpClient setLpTokenPriceInstruction error:: ", err_42);
6880
- throw err_42;
6918
+ err_43 = _d.sent();
6919
+ console.log("perpClient setLpTokenPriceInstruction error:: ", err_43);
6920
+ throw err_43;
6881
6921
  case 4: return [2, {
6882
6922
  instructions: __spreadArray([], instructions, true),
6883
6923
  additionalSigners: additionalSigners
@@ -6925,7 +6965,7 @@ var PerpetualsClient = (function () {
6925
6965
  });
6926
6966
  }); };
6927
6967
  this.setAdminSigners = function (admins, minSignatures) { return __awaiter(_this, void 0, void 0, function () {
6928
- var adminMetas, _i, admins_2, admin, err_43;
6968
+ var adminMetas, _i, admins_2, admin, err_44;
6929
6969
  return __generator(this, function (_a) {
6930
6970
  switch (_a.label) {
6931
6971
  case 0:
@@ -6955,11 +6995,11 @@ var PerpetualsClient = (function () {
6955
6995
  _a.sent();
6956
6996
  return [3, 4];
6957
6997
  case 3:
6958
- err_43 = _a.sent();
6998
+ err_44 = _a.sent();
6959
6999
  if (this.printErrors) {
6960
- console.error("setAdminSigners err:", err_43);
7000
+ console.error("setAdminSigners err:", err_44);
6961
7001
  }
6962
- throw err_43;
7002
+ throw err_44;
6963
7003
  case 4: return [2];
6964
7004
  }
6965
7005
  });
@@ -7156,7 +7196,7 @@ var PerpetualsClient = (function () {
7156
7196
  });
7157
7197
  }); };
7158
7198
  this.protocolWithdrawFees = function (rewardSymbol, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7159
- var publicKey, custodyConfig, receivingTokenAccount, instructions, additionalSigners, withdrawFeesIx, err_44;
7199
+ var publicKey, custodyConfig, receivingTokenAccount, instructions, additionalSigners, withdrawFeesIx, err_45;
7160
7200
  return __generator(this, function (_a) {
7161
7201
  switch (_a.label) {
7162
7202
  case 0:
@@ -7189,9 +7229,9 @@ var PerpetualsClient = (function () {
7189
7229
  instructions.push(withdrawFeesIx);
7190
7230
  return [3, 5];
7191
7231
  case 4:
7192
- err_44 = _a.sent();
7193
- console.log("perpClient setPool error:: ", err_44);
7194
- throw err_44;
7232
+ err_45 = _a.sent();
7233
+ console.log("perpClient setPool error:: ", err_45);
7234
+ throw err_45;
7195
7235
  case 5: return [2, {
7196
7236
  instructions: __spreadArray([], instructions, true),
7197
7237
  additionalSigners: additionalSigners
@@ -7200,7 +7240,7 @@ var PerpetualsClient = (function () {
7200
7240
  });
7201
7241
  }); };
7202
7242
  this.moveProtocolFees = function (rewardSymbol, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7203
- var publicKey, rewardCustodyConfig, instructions, additionalSigners, moveProtocolFeesIx, err_45;
7243
+ var publicKey, rewardCustodyConfig, instructions, additionalSigners, moveProtocolFeesIx, err_46;
7204
7244
  return __generator(this, function (_a) {
7205
7245
  switch (_a.label) {
7206
7246
  case 0:
@@ -7233,9 +7273,9 @@ var PerpetualsClient = (function () {
7233
7273
  instructions.push(moveProtocolFeesIx);
7234
7274
  return [3, 4];
7235
7275
  case 3:
7236
- err_45 = _a.sent();
7237
- console.log("perpClient setPool error:: ", err_45);
7238
- throw err_45;
7276
+ err_46 = _a.sent();
7277
+ console.log("perpClient setPool error:: ", err_46);
7278
+ throw err_46;
7239
7279
  case 4: return [2, {
7240
7280
  instructions: __spreadArray([], instructions, true),
7241
7281
  additionalSigners: additionalSigners
@@ -7244,7 +7284,7 @@ var PerpetualsClient = (function () {
7244
7284
  });
7245
7285
  }); };
7246
7286
  this.setProtocolFeeShareBps = function (feeShareBps, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7247
- var publicKey, setProtocolFeeShareBpsIx, err_46;
7287
+ var publicKey, setProtocolFeeShareBpsIx, err_47;
7248
7288
  return __generator(this, function (_a) {
7249
7289
  switch (_a.label) {
7250
7290
  case 0:
@@ -7264,15 +7304,15 @@ var PerpetualsClient = (function () {
7264
7304
  setProtocolFeeShareBpsIx = _a.sent();
7265
7305
  return [2, setProtocolFeeShareBpsIx];
7266
7306
  case 2:
7267
- err_46 = _a.sent();
7268
- console.log("perpClient setProtocolFeeShareBpsIx error:: ", err_46);
7269
- throw err_46;
7307
+ err_47 = _a.sent();
7308
+ console.log("perpClient setProtocolFeeShareBpsIx error:: ", err_47);
7309
+ throw err_47;
7270
7310
  case 3: return [2];
7271
7311
  }
7272
7312
  });
7273
7313
  }); };
7274
7314
  this.setPermissions = function (permissions) { return __awaiter(_this, void 0, void 0, function () {
7275
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setPermissionsInstruction, err_47;
7315
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setPermissionsInstruction, err_48;
7276
7316
  return __generator(this, function (_a) {
7277
7317
  switch (_a.label) {
7278
7318
  case 0:
@@ -7299,9 +7339,9 @@ var PerpetualsClient = (function () {
7299
7339
  instructions.push(setPermissionsInstruction);
7300
7340
  return [3, 4];
7301
7341
  case 3:
7302
- err_47 = _a.sent();
7303
- console.log("perpClient setPool error:: ", err_47);
7304
- throw err_47;
7342
+ err_48 = _a.sent();
7343
+ console.log("perpClient setPool error:: ", err_48);
7344
+ throw err_48;
7305
7345
  case 4: return [2, {
7306
7346
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
7307
7347
  additionalSigners: additionalSigners
@@ -7310,7 +7350,7 @@ var PerpetualsClient = (function () {
7310
7350
  });
7311
7351
  }); };
7312
7352
  this.reimburse = function (tokenMint, amountIn, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7313
- var custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, instructions, additionalSigners, custodyConfig, reimburse, _d, _e, err_48;
7353
+ var custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, instructions, additionalSigners, custodyConfig, reimburse, _d, _e, err_49;
7314
7354
  var _f;
7315
7355
  return __generator(this, function (_g) {
7316
7356
  switch (_g.label) {
@@ -7371,9 +7411,9 @@ var PerpetualsClient = (function () {
7371
7411
  instructions.push(reimburse);
7372
7412
  return [3, 5];
7373
7413
  case 4:
7374
- err_48 = _g.sent();
7375
- console.log("perpClient setPool error:: ", err_48);
7376
- throw err_48;
7414
+ err_49 = _g.sent();
7415
+ console.log("perpClient setPool error:: ", err_49);
7416
+ throw err_49;
7377
7417
  case 5: return [2, {
7378
7418
  instructions: __spreadArray([], instructions, true),
7379
7419
  additionalSigners: additionalSigners
@@ -7382,7 +7422,7 @@ var PerpetualsClient = (function () {
7382
7422
  });
7383
7423
  }); };
7384
7424
  this.setInternalOraclePriceBatch = function (useCurrentTime, tokenMintList, tokenInternalPrices, POOL_CONFIGS) { return __awaiter(_this, void 0, void 0, function () {
7385
- var ALL_CUSTODY_CONFIGS, accountMetas, _loop_1, _i, tokenMintList_1, tokenMint, instructions, additionalSigners, setInternalOraclePrice, err_49;
7425
+ var ALL_CUSTODY_CONFIGS, accountMetas, _loop_1, _i, tokenMintList_1, tokenMint, instructions, additionalSigners, setInternalOraclePrice, err_50;
7386
7426
  return __generator(this, function (_a) {
7387
7427
  switch (_a.label) {
7388
7428
  case 0:
@@ -7423,9 +7463,9 @@ var PerpetualsClient = (function () {
7423
7463
  instructions.push(setInternalOraclePrice);
7424
7464
  return [3, 4];
7425
7465
  case 3:
7426
- err_49 = _a.sent();
7427
- console.log("perpClient setInternalOracleAccount error:: ", err_49);
7428
- throw err_49;
7466
+ err_50 = _a.sent();
7467
+ console.log("perpClient setInternalOracleAccount error:: ", err_50);
7468
+ throw err_50;
7429
7469
  case 4: return [2, {
7430
7470
  instructions: __spreadArray([], instructions, true),
7431
7471
  additionalSigners: additionalSigners
@@ -7434,7 +7474,7 @@ var PerpetualsClient = (function () {
7434
7474
  });
7435
7475
  }); };
7436
7476
  this.setInternalLazerPriceBatch = function (messageData, tokenMintList, pythStorage, pythTreasury, POOL_CONFIGS) { return __awaiter(_this, void 0, void 0, function () {
7437
- var ALL_CUSTODY_CONFIGS, accountMetas, _loop_2, _i, tokenMintList_2, tokenMint, instructions, additionalSigners, setInternalLazerPrice, err_50;
7477
+ var ALL_CUSTODY_CONFIGS, accountMetas, _loop_2, _i, tokenMintList_2, tokenMint, instructions, additionalSigners, setInternalLazerPrice, err_51;
7438
7478
  return __generator(this, function (_a) {
7439
7479
  switch (_a.label) {
7440
7480
  case 0:
@@ -7475,9 +7515,9 @@ var PerpetualsClient = (function () {
7475
7515
  instructions.push(setInternalLazerPrice);
7476
7516
  return [3, 4];
7477
7517
  case 3:
7478
- err_50 = _a.sent();
7479
- console.log("perpClient setInternalLazerPriceBatch error:: ", err_50);
7480
- throw err_50;
7518
+ err_51 = _a.sent();
7519
+ console.log("perpClient setInternalLazerPriceBatch error:: ", err_51);
7520
+ throw err_51;
7481
7521
  case 4: return [2, {
7482
7522
  instructions: __spreadArray([], instructions, true),
7483
7523
  additionalSigners: additionalSigners
@@ -7486,7 +7526,7 @@ var PerpetualsClient = (function () {
7486
7526
  });
7487
7527
  }); };
7488
7528
  this.setInternalOracleEmaPriceBatch = function (tokenMintList, tokenInternalEmaPrices, POOL_CONFIGS) { return __awaiter(_this, void 0, void 0, function () {
7489
- var ALL_CUSTODY_CONFIGS, accountMetas, _loop_3, _i, tokenMintList_3, tokenMint, instructions, additionalSigners, setInternalOraclePrice, err_51;
7529
+ var ALL_CUSTODY_CONFIGS, accountMetas, _loop_3, _i, tokenMintList_3, tokenMint, instructions, additionalSigners, setInternalOraclePrice, err_52;
7490
7530
  return __generator(this, function (_a) {
7491
7531
  switch (_a.label) {
7492
7532
  case 0:
@@ -7526,9 +7566,9 @@ var PerpetualsClient = (function () {
7526
7566
  instructions.push(setInternalOraclePrice);
7527
7567
  return [3, 4];
7528
7568
  case 3:
7529
- err_51 = _a.sent();
7530
- console.log("perpClient setInternalOracleAccount error:: ", err_51);
7531
- throw err_51;
7569
+ err_52 = _a.sent();
7570
+ console.log("perpClient setInternalOracleAccount error:: ", err_52);
7571
+ throw err_52;
7532
7572
  case 4: return [2, {
7533
7573
  instructions: __spreadArray([], instructions, true),
7534
7574
  additionalSigners: additionalSigners
@@ -7537,7 +7577,7 @@ var PerpetualsClient = (function () {
7537
7577
  });
7538
7578
  }); };
7539
7579
  this.setPositionPriceImpact = function (positionPubkey, priceImpactUsd, penaltyAuthority) { return __awaiter(_this, void 0, void 0, function () {
7540
- var instructions, additionalSigners, setPositionPriceImpactIx, err_52;
7580
+ var instructions, additionalSigners, setPositionPriceImpactIx, err_53;
7541
7581
  return __generator(this, function (_a) {
7542
7582
  switch (_a.label) {
7543
7583
  case 0:
@@ -7561,9 +7601,9 @@ var PerpetualsClient = (function () {
7561
7601
  instructions.push(setPositionPriceImpactIx);
7562
7602
  return [3, 4];
7563
7603
  case 3:
7564
- err_52 = _a.sent();
7565
- console.log("perpClient setPositionPriceImpact error:: ", err_52);
7566
- throw err_52;
7604
+ err_53 = _a.sent();
7605
+ console.log("perpClient setPositionPriceImpact error:: ", err_53);
7606
+ throw err_53;
7567
7607
  case 4: return [2, {
7568
7608
  instructions: __spreadArray([], instructions, true),
7569
7609
  additionalSigners: additionalSigners
@@ -7572,7 +7612,7 @@ var PerpetualsClient = (function () {
7572
7612
  });
7573
7613
  }); };
7574
7614
  this.renameFlp = function (flag, lpTokenName, lpTokenSymbol, lpTokenUri, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7575
- var publicKey, instructions, additionalSigners, lpTokenMint, lpMetadataAccount, renameFlp, err_53;
7615
+ var publicKey, instructions, additionalSigners, lpTokenMint, lpMetadataAccount, renameFlp, err_54;
7576
7616
  return __generator(this, function (_a) {
7577
7617
  switch (_a.label) {
7578
7618
  case 0:
@@ -7610,8 +7650,8 @@ var PerpetualsClient = (function () {
7610
7650
  instructions.push(renameFlp);
7611
7651
  return [3, 4];
7612
7652
  case 3:
7613
- err_53 = _a.sent();
7614
- console.log("perpClient renameFlp error:: ", err_53);
7653
+ err_54 = _a.sent();
7654
+ console.log("perpClient renameFlp error:: ", err_54);
7615
7655
  return [3, 4];
7616
7656
  case 4: return [2, {
7617
7657
  instructions: __spreadArray([], instructions, true),
@@ -7621,7 +7661,7 @@ var PerpetualsClient = (function () {
7621
7661
  });
7622
7662
  }); };
7623
7663
  this.initStake = function (stakingFeeShareBps, rewardSymbol, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7624
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, lpTokenMint, stakedLpTokenAccount, rewardCustodyConfig, initStakeInstruction, err_54;
7664
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, lpTokenMint, stakedLpTokenAccount, rewardCustodyConfig, initStakeInstruction, err_55;
7625
7665
  return __generator(this, function (_a) {
7626
7666
  switch (_a.label) {
7627
7667
  case 0:
@@ -7659,9 +7699,9 @@ var PerpetualsClient = (function () {
7659
7699
  instructions.push(initStakeInstruction);
7660
7700
  return [3, 4];
7661
7701
  case 3:
7662
- err_54 = _a.sent();
7663
- console.log("perpClient InitStaking error:: ", err_54);
7664
- throw err_54;
7702
+ err_55 = _a.sent();
7703
+ console.log("perpClient InitStaking error:: ", err_55);
7704
+ throw err_55;
7665
7705
  case 4: return [2, {
7666
7706
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
7667
7707
  additionalSigners: additionalSigners
@@ -7670,7 +7710,7 @@ var PerpetualsClient = (function () {
7670
7710
  });
7671
7711
  }); };
7672
7712
  this.initCompounding = function (feeShareBps, metadataTitle, metadataSymbol, metadataUri, rewardSymbol, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7673
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustodyConfig, compoundingTokenMint, compoundingVault, metadataAccount, initCompoundingInstruction, err_55;
7713
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustodyConfig, compoundingTokenMint, compoundingVault, metadataAccount, initCompoundingInstruction, err_56;
7674
7714
  return __generator(this, function (_a) {
7675
7715
  switch (_a.label) {
7676
7716
  case 0:
@@ -7714,9 +7754,9 @@ var PerpetualsClient = (function () {
7714
7754
  instructions.push(initCompoundingInstruction);
7715
7755
  return [3, 4];
7716
7756
  case 3:
7717
- err_55 = _a.sent();
7718
- console.log("perpClient initCompounding error:: ", err_55);
7719
- throw err_55;
7757
+ err_56 = _a.sent();
7758
+ console.log("perpClient initCompounding error:: ", err_56);
7759
+ throw err_56;
7720
7760
  case 4: return [2, {
7721
7761
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
7722
7762
  additionalSigners: additionalSigners
@@ -7725,7 +7765,7 @@ var PerpetualsClient = (function () {
7725
7765
  });
7726
7766
  }); };
7727
7767
  this.initTokenVault = function (token_permissions, tokens_to_distribute, withdrawTimeLimit, withdrawInstantFee, stakeLevel, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7728
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, tokenMint, fundingTokenAccount, initTokenVaultInstruction, err_56;
7768
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, tokenMint, fundingTokenAccount, initTokenVaultInstruction, err_57;
7729
7769
  return __generator(this, function (_a) {
7730
7770
  switch (_a.label) {
7731
7771
  case 0:
@@ -7766,9 +7806,9 @@ var PerpetualsClient = (function () {
7766
7806
  instructions.push(initTokenVaultInstruction);
7767
7807
  return [3, 4];
7768
7808
  case 3:
7769
- err_56 = _a.sent();
7770
- console.log("perpClient InitTokenVaultInstruction error:: ", err_56);
7771
- throw err_56;
7809
+ err_57 = _a.sent();
7810
+ console.log("perpClient InitTokenVaultInstruction error:: ", err_57);
7811
+ throw err_57;
7772
7812
  case 4: return [2, {
7773
7813
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
7774
7814
  additionalSigners: additionalSigners
@@ -7777,7 +7817,7 @@ var PerpetualsClient = (function () {
7777
7817
  });
7778
7818
  }); };
7779
7819
  this.setTokenVaultConfig = function (token_permissions, withdrawTimeLimit, withdrawInstantFee, stakeLevel, unlockPeriod, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7780
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setTokenVaultConfigInstruction, err_57;
7820
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setTokenVaultConfigInstruction, err_58;
7781
7821
  return __generator(this, function (_a) {
7782
7822
  switch (_a.label) {
7783
7823
  case 0:
@@ -7809,9 +7849,9 @@ var PerpetualsClient = (function () {
7809
7849
  instructions.push(setTokenVaultConfigInstruction);
7810
7850
  return [3, 4];
7811
7851
  case 3:
7812
- err_57 = _a.sent();
7813
- console.log("perpClient setTokenVaultConfigInstruction error:: ", err_57);
7814
- throw err_57;
7852
+ err_58 = _a.sent();
7853
+ console.log("perpClient setTokenVaultConfigInstruction error:: ", err_58);
7854
+ throw err_58;
7815
7855
  case 4: return [2, {
7816
7856
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
7817
7857
  additionalSigners: additionalSigners
@@ -7820,7 +7860,7 @@ var PerpetualsClient = (function () {
7820
7860
  });
7821
7861
  }); };
7822
7862
  this.withdrawInstantFee = function (poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7823
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, receivingTokenAccount, withdrawInstantFeeInstruction, err_58;
7863
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, receivingTokenAccount, withdrawInstantFeeInstruction, err_59;
7824
7864
  return __generator(this, function (_a) {
7825
7865
  switch (_a.label) {
7826
7866
  case 0:
@@ -7859,9 +7899,9 @@ var PerpetualsClient = (function () {
7859
7899
  instructions.push(withdrawInstantFeeInstruction);
7860
7900
  return [3, 6];
7861
7901
  case 5:
7862
- err_58 = _a.sent();
7863
- console.log("perpClient withdrawInstantFeeInstruction error:: ", err_58);
7864
- throw err_58;
7902
+ err_59 = _a.sent();
7903
+ console.log("perpClient withdrawInstantFeeInstruction error:: ", err_59);
7904
+ throw err_59;
7865
7905
  case 6: return [2, {
7866
7906
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
7867
7907
  additionalSigners: additionalSigners
@@ -7870,7 +7910,7 @@ var PerpetualsClient = (function () {
7870
7910
  });
7871
7911
  }); };
7872
7912
  this.withdrawUnclaimedTokens = function (poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7873
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, receivingTokenAccount, withdrawUnclaimedTokensInstruction, err_59;
7913
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, receivingTokenAccount, withdrawUnclaimedTokensInstruction, err_60;
7874
7914
  return __generator(this, function (_a) {
7875
7915
  switch (_a.label) {
7876
7916
  case 0:
@@ -7909,9 +7949,9 @@ var PerpetualsClient = (function () {
7909
7949
  instructions.push(withdrawUnclaimedTokensInstruction);
7910
7950
  return [3, 6];
7911
7951
  case 5:
7912
- err_59 = _a.sent();
7913
- console.log("perpClient withdrawUnclaimedTokensInstruction error:: ", err_59);
7914
- throw err_59;
7952
+ err_60 = _a.sent();
7953
+ console.log("perpClient withdrawUnclaimedTokensInstruction error:: ", err_60);
7954
+ throw err_60;
7915
7955
  case 6: return [2, {
7916
7956
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
7917
7957
  additionalSigners: additionalSigners
@@ -7920,7 +7960,7 @@ var PerpetualsClient = (function () {
7920
7960
  });
7921
7961
  }); };
7922
7962
  this.initRevenueTokenAccount = function (feeShareBps, rewardSymbol, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7923
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustodyMint, initRevenueTokenAccountInstruction, err_60;
7963
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustodyMint, initRevenueTokenAccountInstruction, err_61;
7924
7964
  return __generator(this, function (_a) {
7925
7965
  switch (_a.label) {
7926
7966
  case 0:
@@ -7957,9 +7997,9 @@ var PerpetualsClient = (function () {
7957
7997
  instructions.push(initRevenueTokenAccountInstruction);
7958
7998
  return [3, 4];
7959
7999
  case 3:
7960
- err_60 = _a.sent();
7961
- console.log("perpClient initRevenueTokenAccountInstruction error:: ", err_60);
7962
- throw err_60;
8000
+ err_61 = _a.sent();
8001
+ console.log("perpClient initRevenueTokenAccountInstruction error:: ", err_61);
8002
+ throw err_61;
7963
8003
  case 4: return [2, {
7964
8004
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
7965
8005
  additionalSigners: additionalSigners
@@ -7968,7 +8008,7 @@ var PerpetualsClient = (function () {
7968
8008
  });
7969
8009
  }); };
7970
8010
  this.initRebateVault = function (allowRebatePayout, rebateSymbol, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7971
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rebateCustodyMint, initRebateVaultInstruction, err_61;
8011
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rebateCustodyMint, initRebateVaultInstruction, err_62;
7972
8012
  return __generator(this, function (_a) {
7973
8013
  switch (_a.label) {
7974
8014
  case 0:
@@ -8003,9 +8043,9 @@ var PerpetualsClient = (function () {
8003
8043
  instructions.push(initRebateVaultInstruction);
8004
8044
  return [3, 4];
8005
8045
  case 3:
8006
- err_61 = _a.sent();
8007
- console.log("perpClient initRebateVaultInstruction error:: ", err_61);
8008
- throw err_61;
8046
+ err_62 = _a.sent();
8047
+ console.log("perpClient initRebateVaultInstruction error:: ", err_62);
8048
+ throw err_62;
8009
8049
  case 4: return [2, {
8010
8050
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8011
8051
  additionalSigners: additionalSigners
@@ -8014,7 +8054,7 @@ var PerpetualsClient = (function () {
8014
8054
  });
8015
8055
  }); };
8016
8056
  this.distributeTokenReward = function (amount, epochCount, rewardSymbol, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
8017
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustodyMint, fundingTokenAccount, revenueFundingTokenAccount, distributeTokenRewardInstruction, err_62;
8057
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustodyMint, fundingTokenAccount, revenueFundingTokenAccount, distributeTokenRewardInstruction, err_63;
8018
8058
  return __generator(this, function (_a) {
8019
8059
  switch (_a.label) {
8020
8060
  case 0:
@@ -8051,9 +8091,9 @@ var PerpetualsClient = (function () {
8051
8091
  instructions.push(distributeTokenRewardInstruction);
8052
8092
  return [3, 4];
8053
8093
  case 3:
8054
- err_62 = _a.sent();
8055
- console.log("perpClient distributeTokenRewardInstruction error:: ", err_62);
8056
- throw err_62;
8094
+ err_63 = _a.sent();
8095
+ console.log("perpClient distributeTokenRewardInstruction error:: ", err_63);
8096
+ throw err_63;
8057
8097
  case 4: return [2, {
8058
8098
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8059
8099
  additionalSigners: additionalSigners
@@ -8062,7 +8102,7 @@ var PerpetualsClient = (function () {
8062
8102
  });
8063
8103
  }); };
8064
8104
  this.setTokenStakeLevel = function (owner, stakeLevel, isInitialized) { return __awaiter(_this, void 0, void 0, function () {
8065
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, setTokenStakeLevelInstruction, err_63;
8105
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, setTokenStakeLevelInstruction, err_64;
8066
8106
  return __generator(this, function (_a) {
8067
8107
  switch (_a.label) {
8068
8108
  case 0:
@@ -8091,9 +8131,9 @@ var PerpetualsClient = (function () {
8091
8131
  instructions.push(setTokenStakeLevelInstruction);
8092
8132
  return [3, 4];
8093
8133
  case 3:
8094
- err_63 = _a.sent();
8095
- console.log("perpClient setTokenStakeLevelInstruction error:: ", err_63);
8096
- throw err_63;
8134
+ err_64 = _a.sent();
8135
+ console.log("perpClient setTokenStakeLevelInstruction error:: ", err_64);
8136
+ throw err_64;
8097
8137
  case 4: return [2, {
8098
8138
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8099
8139
  additionalSigners: additionalSigners
@@ -8102,7 +8142,7 @@ var PerpetualsClient = (function () {
8102
8142
  });
8103
8143
  }); };
8104
8144
  this.setTokenReward = function (owner, amount, epochCount, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
8105
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, setTokenRewardInstruction, err_64;
8145
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, setTokenRewardInstruction, err_65;
8106
8146
  return __generator(this, function (_a) {
8107
8147
  switch (_a.label) {
8108
8148
  case 0:
@@ -8133,9 +8173,9 @@ var PerpetualsClient = (function () {
8133
8173
  instructions.push(setTokenRewardInstruction);
8134
8174
  return [3, 4];
8135
8175
  case 3:
8136
- err_64 = _a.sent();
8137
- console.log("perpClient setTokenRewardInstruction error:: ", err_64);
8138
- throw err_64;
8176
+ err_65 = _a.sent();
8177
+ console.log("perpClient setTokenRewardInstruction error:: ", err_65);
8178
+ throw err_65;
8139
8179
  case 4: return [2, {
8140
8180
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8141
8181
  additionalSigners: additionalSigners
@@ -8144,7 +8184,7 @@ var PerpetualsClient = (function () {
8144
8184
  });
8145
8185
  }); };
8146
8186
  this.resizeInternalOracle = function (lazerFeedId, tokenMint, intOracleAccount) { return __awaiter(_this, void 0, void 0, function () {
8147
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, resizeInternalOracleInstruction, err_65;
8187
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, resizeInternalOracleInstruction, err_66;
8148
8188
  return __generator(this, function (_a) {
8149
8189
  switch (_a.label) {
8150
8190
  case 0:
@@ -8173,9 +8213,9 @@ var PerpetualsClient = (function () {
8173
8213
  instructions.push(resizeInternalOracleInstruction);
8174
8214
  return [3, 4];
8175
8215
  case 3:
8176
- err_65 = _a.sent();
8177
- console.log("perpClient resizeInternalOracleInstruction error:: ", err_65);
8178
- throw err_65;
8216
+ err_66 = _a.sent();
8217
+ console.log("perpClient resizeInternalOracleInstruction error:: ", err_66);
8218
+ throw err_66;
8179
8219
  case 4: return [2, {
8180
8220
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8181
8221
  additionalSigners: additionalSigners
@@ -8184,7 +8224,7 @@ var PerpetualsClient = (function () {
8184
8224
  });
8185
8225
  }); };
8186
8226
  this.createWhitelist = function (isSwapFeeExempt, isDepositFeeExempt, isWithdrawalFeeExempt, poolAddress, owner) { return __awaiter(_this, void 0, void 0, function () {
8187
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, whitelist, createWhitelistInstruction, err_66;
8227
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, whitelist, createWhitelistInstruction, err_67;
8188
8228
  return __generator(this, function (_a) {
8189
8229
  switch (_a.label) {
8190
8230
  case 0:
@@ -8217,9 +8257,9 @@ var PerpetualsClient = (function () {
8217
8257
  instructions.push(createWhitelistInstruction);
8218
8258
  return [3, 4];
8219
8259
  case 3:
8220
- err_66 = _a.sent();
8221
- console.log("perpClient createWhitelistInstruction error:: ", err_66);
8222
- throw err_66;
8260
+ err_67 = _a.sent();
8261
+ console.log("perpClient createWhitelistInstruction error:: ", err_67);
8262
+ throw err_67;
8223
8263
  case 4: return [2, {
8224
8264
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8225
8265
  additionalSigners: additionalSigners
@@ -8228,7 +8268,7 @@ var PerpetualsClient = (function () {
8228
8268
  });
8229
8269
  }); };
8230
8270
  this.setWhitelistConfig = function (isSwapFeeExempt, isDepositFeeExempt, isWithdrawalFeeExempt, poolAddress, owner) { return __awaiter(_this, void 0, void 0, function () {
8231
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, whitelist, setWhitelistConfigInstruction, err_67;
8271
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, whitelist, setWhitelistConfigInstruction, err_68;
8232
8272
  return __generator(this, function (_a) {
8233
8273
  switch (_a.label) {
8234
8274
  case 0:
@@ -8261,9 +8301,9 @@ var PerpetualsClient = (function () {
8261
8301
  instructions.push(setWhitelistConfigInstruction);
8262
8302
  return [3, 4];
8263
8303
  case 3:
8264
- err_67 = _a.sent();
8265
- console.log("perpClient setWhitelistConfigInstruction error:: ", err_67);
8266
- throw err_67;
8304
+ err_68 = _a.sent();
8305
+ console.log("perpClient setWhitelistConfigInstruction error:: ", err_68);
8306
+ throw err_68;
8267
8307
  case 4: return [2, {
8268
8308
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8269
8309
  additionalSigners: additionalSigners
@@ -8272,7 +8312,7 @@ var PerpetualsClient = (function () {
8272
8312
  });
8273
8313
  }); };
8274
8314
  this.setPerpetualsConfig = function (allowUngatedTrading, voltageMultiplier, tradingDiscount, referralRebate, defaultRebate, tradeLimit, triggerOrderLimit, rebateLimitUsd) { return __awaiter(_this, void 0, void 0, function () {
8275
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setPerpetualsConfigInstruction, err_68;
8315
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setPerpetualsConfigInstruction, err_69;
8276
8316
  return __generator(this, function (_a) {
8277
8317
  switch (_a.label) {
8278
8318
  case 0:
@@ -8306,9 +8346,9 @@ var PerpetualsClient = (function () {
8306
8346
  instructions.push(setPerpetualsConfigInstruction);
8307
8347
  return [3, 4];
8308
8348
  case 3:
8309
- err_68 = _a.sent();
8310
- console.log("perpClient setPerpetualsConfigInstruction error:: ", err_68);
8311
- throw err_68;
8349
+ err_69 = _a.sent();
8350
+ console.log("perpClient setPerpetualsConfigInstruction error:: ", err_69);
8351
+ throw err_69;
8312
8352
  case 4: return [2, {
8313
8353
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8314
8354
  additionalSigners: additionalSigners
@@ -8317,7 +8357,7 @@ var PerpetualsClient = (function () {
8317
8357
  });
8318
8358
  }); };
8319
8359
  this.setPoolConfig = function (name, permissions, maxAumUsd, oracleAuthority, stakingFeeShareBps, vpVolumeFactor, stakingFeeBoostBps, minLpPriceUsd, maxLpPriceUsd, thresholdUsd) { return __awaiter(_this, void 0, void 0, function () {
8320
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setPoolConfigInstruction, err_69;
8360
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setPoolConfigInstruction, err_70;
8321
8361
  return __generator(this, function (_a) {
8322
8362
  switch (_a.label) {
8323
8363
  case 0:
@@ -8345,9 +8385,9 @@ var PerpetualsClient = (function () {
8345
8385
  instructions.push(setPoolConfigInstruction);
8346
8386
  return [3, 4];
8347
8387
  case 3:
8348
- err_69 = _a.sent();
8349
- console.log("perpClient setPoolConfigInstruction error:: ", err_69);
8350
- throw err_69;
8388
+ err_70 = _a.sent();
8389
+ console.log("perpClient setPoolConfigInstruction error:: ", err_70);
8390
+ throw err_70;
8351
8391
  case 4: return [2, {
8352
8392
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8353
8393
  additionalSigners: additionalSigners
@@ -8356,7 +8396,7 @@ var PerpetualsClient = (function () {
8356
8396
  });
8357
8397
  }); };
8358
8398
  this.addCustodyToken22 = function (poolName, tokenMint, tokenAccountSpace, token22) { return __awaiter(_this, void 0, void 0, function () {
8359
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, addCustodyToken22Instruction, err_70;
8399
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, addCustodyToken22Instruction, err_71;
8360
8400
  return __generator(this, function (_a) {
8361
8401
  switch (_a.label) {
8362
8402
  case 0:
@@ -8390,9 +8430,9 @@ var PerpetualsClient = (function () {
8390
8430
  instructions.push(addCustodyToken22Instruction);
8391
8431
  return [3, 4];
8392
8432
  case 3:
8393
- err_70 = _a.sent();
8394
- console.log("perpClient addCustodyToken22Instruction error:: ", err_70);
8395
- throw err_70;
8433
+ err_71 = _a.sent();
8434
+ console.log("perpClient addCustodyToken22Instruction error:: ", err_71);
8435
+ throw err_71;
8396
8436
  case 4: return [2, {
8397
8437
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8398
8438
  additionalSigners: additionalSigners
@@ -8401,7 +8441,7 @@ var PerpetualsClient = (function () {
8401
8441
  });
8402
8442
  }); };
8403
8443
  this.addMarket = function (poolName, targetCustody, collateralCustody, side, correlation, maxPayoffBps, permissions) { return __awaiter(_this, void 0, void 0, function () {
8404
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, market, addMarketInstruction, err_71;
8444
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, market, addMarketInstruction, err_72;
8405
8445
  return __generator(this, function (_a) {
8406
8446
  switch (_a.label) {
8407
8447
  case 0:
@@ -8444,9 +8484,9 @@ var PerpetualsClient = (function () {
8444
8484
  instructions.push(addMarketInstruction);
8445
8485
  return [3, 4];
8446
8486
  case 3:
8447
- err_71 = _a.sent();
8448
- console.log("perpClient addMarketInstruction error:: ", err_71);
8449
- throw err_71;
8487
+ err_72 = _a.sent();
8488
+ console.log("perpClient addMarketInstruction error:: ", err_72);
8489
+ throw err_72;
8450
8490
  case 4: return [2, {
8451
8491
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8452
8492
  additionalSigners: additionalSigners
@@ -8455,7 +8495,7 @@ var PerpetualsClient = (function () {
8455
8495
  });
8456
8496
  }); };
8457
8497
  this.setCustody = function (poolName, tokenMint, depegAdjustment, inversePrice, oracle, pricingConfig, permissions, fees, borrowRate, ratios, rewardThreshold, minReserveUsd, limitPriceBufferBps, token22) { return __awaiter(_this, void 0, void 0, function () {
8458
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setCustodyConfigInstruction, err_72;
8498
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setCustodyConfigInstruction, err_73;
8459
8499
  return __generator(this, function (_a) {
8460
8500
  switch (_a.label) {
8461
8501
  case 0:
@@ -8494,9 +8534,9 @@ var PerpetualsClient = (function () {
8494
8534
  instructions.push(setCustodyConfigInstruction);
8495
8535
  return [3, 4];
8496
8536
  case 3:
8497
- err_72 = _a.sent();
8498
- console.log("perpClient setCustodyConfigInstruction error:: ", err_72);
8499
- throw err_72;
8537
+ err_73 = _a.sent();
8538
+ console.log("perpClient setCustodyConfigInstruction error:: ", err_73);
8539
+ throw err_73;
8500
8540
  case 4: return [2, {
8501
8541
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8502
8542
  additionalSigners: additionalSigners
@@ -8505,7 +8545,7 @@ var PerpetualsClient = (function () {
8505
8545
  });
8506
8546
  }); };
8507
8547
  this.addInternalOracle = function (exponent, lazerFeedId, tokenMint, intOracleAccount) { return __awaiter(_this, void 0, void 0, function () {
8508
- var preInstructions, instructions, postInstructions, additionalSigners, addInternalOracleInstruction, err_73;
8548
+ var preInstructions, instructions, postInstructions, additionalSigners, addInternalOracleInstruction, err_74;
8509
8549
  return __generator(this, function (_a) {
8510
8550
  switch (_a.label) {
8511
8551
  case 0:
@@ -8535,9 +8575,9 @@ var PerpetualsClient = (function () {
8535
8575
  instructions.push(addInternalOracleInstruction);
8536
8576
  return [3, 4];
8537
8577
  case 3:
8538
- err_73 = _a.sent();
8539
- console.log("perpClient setCustodyConfigInstruction error:: ", err_73);
8540
- throw err_73;
8578
+ err_74 = _a.sent();
8579
+ console.log("perpClient setCustodyConfigInstruction error:: ", err_74);
8580
+ throw err_74;
8541
8581
  case 4: return [2, {
8542
8582
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8543
8583
  additionalSigners: additionalSigners
@@ -8546,7 +8586,7 @@ var PerpetualsClient = (function () {
8546
8586
  });
8547
8587
  }); };
8548
8588
  this.setMarket = function (poolName, targetCustody, collateralCustody, marketAccount, maxPayoffBps, permissions, correlation) { return __awaiter(_this, void 0, void 0, function () {
8549
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setMarketConfigInstruction, err_74;
8589
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setMarketConfigInstruction, err_75;
8550
8590
  return __generator(this, function (_a) {
8551
8591
  switch (_a.label) {
8552
8592
  case 0:
@@ -8577,9 +8617,9 @@ var PerpetualsClient = (function () {
8577
8617
  instructions.push(setMarketConfigInstruction);
8578
8618
  return [3, 4];
8579
8619
  case 3:
8580
- err_74 = _a.sent();
8581
- console.log("perpClient setCustodyConfigInstruction error:: ", err_74);
8582
- throw err_74;
8620
+ err_75 = _a.sent();
8621
+ console.log("perpClient setCustodyConfigInstruction error:: ", err_75);
8622
+ throw err_75;
8583
8623
  case 4: return [2, {
8584
8624
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8585
8625
  additionalSigners: additionalSigners
@@ -8588,7 +8628,7 @@ var PerpetualsClient = (function () {
8588
8628
  });
8589
8629
  }); };
8590
8630
  this.removeMarket = function (poolName, market, targetMint, collateralMint) { return __awaiter(_this, void 0, void 0, function () {
8591
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, removeMarketInstruction, err_75;
8631
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, removeMarketInstruction, err_76;
8592
8632
  return __generator(this, function (_a) {
8593
8633
  switch (_a.label) {
8594
8634
  case 0:
@@ -8620,9 +8660,9 @@ var PerpetualsClient = (function () {
8620
8660
  instructions.push(removeMarketInstruction);
8621
8661
  return [3, 4];
8622
8662
  case 3:
8623
- err_75 = _a.sent();
8624
- console.log("perpClient setCustodyConfigInstruction error:: ", err_75);
8625
- throw err_75;
8663
+ err_76 = _a.sent();
8664
+ console.log("perpClient setCustodyConfigInstruction error:: ", err_76);
8665
+ throw err_76;
8626
8666
  case 4: return [2, {
8627
8667
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
8628
8668
  additionalSigners: additionalSigners