flash-sdk 2.46.4 → 2.46.5

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.
@@ -4667,8 +4667,63 @@ var PerpetualsClient = (function () {
4667
4667
  }
4668
4668
  });
4669
4669
  }); };
4670
+ this.refreshStakeWithAllFlpStakeAccounts = function (rewardSymbol, poolConfig, flpStakeAccountPks) { return __awaiter(_this, void 0, void 0, function () {
4671
+ var rewardCustodyMint, rewardCustodyConfig, pool, feeDistributionTokenAccount, custodyAccountMetas, _i, _a, custody, maxFlpStakeAccountPkLength, flpStakeAccountMetas, _b, flpStakeAccountPks_1, flpStakeAccountPk, refreshStakeInstruction, err_15;
4672
+ return __generator(this, function (_c) {
4673
+ switch (_c.label) {
4674
+ case 0:
4675
+ _c.trys.push([0, 2, , 3]);
4676
+ rewardCustodyMint = poolConfig.getTokenFromSymbol(rewardSymbol).mintKey;
4677
+ rewardCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(rewardSymbol).mintKey); });
4678
+ pool = poolConfig.poolAddress;
4679
+ feeDistributionTokenAccount = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("custody_token_account"), pool.toBuffer(), rewardCustodyMint.toBuffer()], this.programId)[0];
4680
+ custodyAccountMetas = [];
4681
+ for (_i = 0, _a = poolConfig.custodies; _i < _a.length; _i++) {
4682
+ custody = _a[_i];
4683
+ custodyAccountMetas.push({
4684
+ pubkey: custody.custodyAccount,
4685
+ isSigner: false,
4686
+ isWritable: false,
4687
+ });
4688
+ }
4689
+ maxFlpStakeAccountPkLength = 32 - 4 + custodyAccountMetas.length;
4690
+ if (flpStakeAccountPks.length > maxFlpStakeAccountPkLength) {
4691
+ throw new Error("Max of ".concat(maxFlpStakeAccountPkLength, " flpStakeAccountPks can be updated at a time."));
4692
+ }
4693
+ flpStakeAccountMetas = [];
4694
+ for (_b = 0, flpStakeAccountPks_1 = flpStakeAccountPks; _b < flpStakeAccountPks_1.length; _b++) {
4695
+ flpStakeAccountPk = flpStakeAccountPks_1[_b];
4696
+ flpStakeAccountMetas.push({
4697
+ pubkey: flpStakeAccountPk,
4698
+ isSigner: false,
4699
+ isWritable: true,
4700
+ });
4701
+ }
4702
+ return [4, this.program.methods
4703
+ .refreshStake({})
4704
+ .accounts({
4705
+ perpetuals: this.perpetuals.publicKey,
4706
+ pool: pool,
4707
+ rewardCustody: rewardCustodyConfig.custodyAccount,
4708
+ feeDistributionTokenAccount: feeDistributionTokenAccount,
4709
+ eventAuthority: this.eventAuthority.publicKey,
4710
+ program: this.program.programId,
4711
+ })
4712
+ .remainingAccounts(__spreadArray(__spreadArray([], custodyAccountMetas, true), flpStakeAccountMetas, true))
4713
+ .instruction()];
4714
+ case 1:
4715
+ refreshStakeInstruction = _c.sent();
4716
+ return [2, refreshStakeInstruction];
4717
+ case 2:
4718
+ err_15 = _c.sent();
4719
+ console.log("perpClient refreshStaking error:: ", err_15);
4720
+ throw err_15;
4721
+ case 3: return [2];
4722
+ }
4723
+ });
4724
+ }); };
4670
4725
  this.refreshStakeWithTokenStake = function (rewardSymbol, poolConfig, flpStakeAccountPk) { return __awaiter(_this, void 0, void 0, function () {
4671
- var publicKey, rewardCustodyMint, rewardCustodyConfig, pool, feeDistributionTokenAccount, custodyAccountMetas, _i, _a, custody, stakeAccountMetas, tokenStakeAccount, refreshStakeInstruction, err_15;
4726
+ var publicKey, rewardCustodyMint, rewardCustodyConfig, pool, feeDistributionTokenAccount, custodyAccountMetas, _i, _a, custody, stakeAccountMetas, tokenStakeAccount, refreshStakeInstruction, err_16;
4672
4727
  return __generator(this, function (_b) {
4673
4728
  switch (_b.label) {
4674
4729
  case 0:
@@ -4715,15 +4770,15 @@ var PerpetualsClient = (function () {
4715
4770
  refreshStakeInstruction = _b.sent();
4716
4771
  return [2, refreshStakeInstruction];
4717
4772
  case 2:
4718
- err_15 = _b.sent();
4719
- console.log("perpClient refreshStaking error:: ", err_15);
4720
- throw err_15;
4773
+ err_16 = _b.sent();
4774
+ console.log("perpClient refreshStaking error:: ", err_16);
4775
+ throw err_16;
4721
4776
  case 3: return [2];
4722
4777
  }
4723
4778
  });
4724
4779
  }); };
4725
4780
  this.unstakeInstant = function (rewardSymbol, unstakeAmount, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
4726
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustodyConfig, pool, flpStakeAccount, tokenStakeAccount, tokenStakeAccounts, _a, unstakeInstantInstruction, err_16;
4781
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustodyConfig, pool, flpStakeAccount, tokenStakeAccount, tokenStakeAccounts, _a, unstakeInstantInstruction, err_17;
4727
4782
  return __generator(this, function (_b) {
4728
4783
  switch (_b.label) {
4729
4784
  case 0:
@@ -4774,9 +4829,9 @@ var PerpetualsClient = (function () {
4774
4829
  instructions.push(unstakeInstantInstruction);
4775
4830
  return [3, 6];
4776
4831
  case 5:
4777
- err_16 = _b.sent();
4778
- console.log("perpClient unstakeInstant error:: ", err_16);
4779
- throw err_16;
4832
+ err_17 = _b.sent();
4833
+ console.log("perpClient unstakeInstant error:: ", err_17);
4834
+ throw err_17;
4780
4835
  case 6: return [2, {
4781
4836
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
4782
4837
  additionalSigners: additionalSigners
@@ -4785,7 +4840,7 @@ var PerpetualsClient = (function () {
4785
4840
  });
4786
4841
  }); };
4787
4842
  this.setFeeShareBps = function (poolConfig, flpStakeAccountPks) { return __awaiter(_this, void 0, void 0, function () {
4788
- var publicKey, pool, custodyAccountMetas, _i, _a, custody, maxFlpStakeAccountPkLength, flpStakeAccountMetas, _b, flpStakeAccountPks_1, flpStakeAccountPk, refreshStakeInstruction, err_17;
4843
+ var publicKey, pool, custodyAccountMetas, _i, _a, custody, maxFlpStakeAccountPkLength, flpStakeAccountMetas, _b, flpStakeAccountPks_2, flpStakeAccountPk, refreshStakeInstruction, err_18;
4789
4844
  return __generator(this, function (_c) {
4790
4845
  switch (_c.label) {
4791
4846
  case 0:
@@ -4806,8 +4861,8 @@ var PerpetualsClient = (function () {
4806
4861
  throw new Error("Max of ".concat(maxFlpStakeAccountPkLength, " flpStakeAccountPks can be updated at a time."));
4807
4862
  }
4808
4863
  flpStakeAccountMetas = [];
4809
- for (_b = 0, flpStakeAccountPks_1 = flpStakeAccountPks; _b < flpStakeAccountPks_1.length; _b++) {
4810
- flpStakeAccountPk = flpStakeAccountPks_1[_b];
4864
+ for (_b = 0, flpStakeAccountPks_2 = flpStakeAccountPks; _b < flpStakeAccountPks_2.length; _b++) {
4865
+ flpStakeAccountPk = flpStakeAccountPks_2[_b];
4811
4866
  flpStakeAccountMetas.push({
4812
4867
  pubkey: flpStakeAccountPk,
4813
4868
  isSigner: false,
@@ -4829,15 +4884,15 @@ var PerpetualsClient = (function () {
4829
4884
  refreshStakeInstruction = _c.sent();
4830
4885
  return [2, refreshStakeInstruction];
4831
4886
  case 2:
4832
- err_17 = _c.sent();
4833
- console.log("perpClient refreshStaking error:: ", err_17);
4834
- throw err_17;
4887
+ err_18 = _c.sent();
4888
+ console.log("perpClient refreshStaking error:: ", err_18);
4889
+ throw err_18;
4835
4890
  case 3: return [2];
4836
4891
  }
4837
4892
  });
4838
4893
  }); };
4839
4894
  this.unstakeRequest = function (unstakeAmount, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
4840
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, pool, flpStakeAccount, unstakeRequestInstruction, err_18;
4895
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, pool, flpStakeAccount, unstakeRequestInstruction, err_19;
4841
4896
  return __generator(this, function (_a) {
4842
4897
  switch (_a.label) {
4843
4898
  case 0:
@@ -4871,9 +4926,9 @@ var PerpetualsClient = (function () {
4871
4926
  instructions.push(unstakeRequestInstruction);
4872
4927
  return [3, 4];
4873
4928
  case 3:
4874
- err_18 = _a.sent();
4875
- console.log("perpClient unstakeRequest error:: ", err_18);
4876
- throw err_18;
4929
+ err_19 = _a.sent();
4930
+ console.log("perpClient unstakeRequest error:: ", err_19);
4931
+ throw err_19;
4877
4932
  case 4: return [2, {
4878
4933
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
4879
4934
  additionalSigners: additionalSigners
@@ -4886,7 +4941,7 @@ var PerpetualsClient = (function () {
4886
4941
  if (deactivated === void 0) { deactivated = true; }
4887
4942
  if (createUserLPTA === void 0) { createUserLPTA = true; }
4888
4943
  return __awaiter(_this, void 0, void 0, function () {
4889
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, lpTokenMint, pool, poolStakedLpVault, flpStakeAccount, userLpTokenAccount, _a, withdrawStakeInstruction, err_19;
4944
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, lpTokenMint, pool, poolStakedLpVault, flpStakeAccount, userLpTokenAccount, _a, withdrawStakeInstruction, err_20;
4890
4945
  return __generator(this, function (_b) {
4891
4946
  switch (_b.label) {
4892
4947
  case 0:
@@ -4937,9 +4992,9 @@ var PerpetualsClient = (function () {
4937
4992
  instructions.push(withdrawStakeInstruction);
4938
4993
  return [3, 6];
4939
4994
  case 5:
4940
- err_19 = _b.sent();
4941
- console.log("perpClient withdrawStake error:: ", err_19);
4942
- throw err_19;
4995
+ err_20 = _b.sent();
4996
+ console.log("perpClient withdrawStake error:: ", err_20);
4997
+ throw err_20;
4943
4998
  case 6: return [2, {
4944
4999
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
4945
5000
  additionalSigners: additionalSigners
@@ -4951,7 +5006,7 @@ var PerpetualsClient = (function () {
4951
5006
  this.collectStakeFees = function (rewardSymbol, poolConfig, tokenStakeAccount, createUserATA) {
4952
5007
  if (createUserATA === void 0) { createUserATA = true; }
4953
5008
  return __awaiter(_this, void 0, void 0, function () {
4954
- var publicKey, rewardCustodyMint, rewardCustodyConfig, preInstructions, instructions, postInstructions, additionalSigners, pool, flpStakeAccount, receivingTokenAccount, _a, tokenStakeAccounts, withdrawStakeInstruction, err_20;
5009
+ var publicKey, rewardCustodyMint, rewardCustodyConfig, preInstructions, instructions, postInstructions, additionalSigners, pool, flpStakeAccount, receivingTokenAccount, _a, tokenStakeAccounts, withdrawStakeInstruction, err_21;
4955
5010
  return __generator(this, function (_b) {
4956
5011
  switch (_b.label) {
4957
5012
  case 0:
@@ -5010,9 +5065,9 @@ var PerpetualsClient = (function () {
5010
5065
  instructions.push(withdrawStakeInstruction);
5011
5066
  return [3, 6];
5012
5067
  case 5:
5013
- err_20 = _b.sent();
5014
- console.log("perpClient withdrawStake error:: ", err_20);
5015
- throw err_20;
5068
+ err_21 = _b.sent();
5069
+ console.log("perpClient withdrawStake error:: ", err_21);
5070
+ throw err_21;
5016
5071
  case 6: return [2, {
5017
5072
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5018
5073
  additionalSigners: additionalSigners
@@ -5022,7 +5077,7 @@ var PerpetualsClient = (function () {
5022
5077
  });
5023
5078
  };
5024
5079
  this.initTokenVault = function (token_permissions, tokens_to_distribute, withdrawTimeLimit, withdrawInstantFee, stakeLevel, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5025
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, tokenMint, fundingTokenAccount, initTokenVaultInstruction, err_21;
5080
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, tokenMint, fundingTokenAccount, initTokenVaultInstruction, err_22;
5026
5081
  return __generator(this, function (_a) {
5027
5082
  switch (_a.label) {
5028
5083
  case 0:
@@ -5063,9 +5118,9 @@ var PerpetualsClient = (function () {
5063
5118
  instructions.push(initTokenVaultInstruction);
5064
5119
  return [3, 4];
5065
5120
  case 3:
5066
- err_21 = _a.sent();
5067
- console.log("perpClient InitTokenVaultInstruction error:: ", err_21);
5068
- throw err_21;
5121
+ err_22 = _a.sent();
5122
+ console.log("perpClient InitTokenVaultInstruction error:: ", err_22);
5123
+ throw err_22;
5069
5124
  case 4: return [2, {
5070
5125
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5071
5126
  additionalSigners: additionalSigners
@@ -5074,7 +5129,7 @@ var PerpetualsClient = (function () {
5074
5129
  });
5075
5130
  }); };
5076
5131
  this.setTokenVaultConfig = function (token_permissions, withdrawTimeLimit, withdrawInstantFee, stakeLevel, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5077
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setTokenVaultConfigInstruction, err_22;
5132
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setTokenVaultConfigInstruction, err_23;
5078
5133
  return __generator(this, function (_a) {
5079
5134
  switch (_a.label) {
5080
5135
  case 0:
@@ -5104,9 +5159,9 @@ var PerpetualsClient = (function () {
5104
5159
  instructions.push(setTokenVaultConfigInstruction);
5105
5160
  return [3, 4];
5106
5161
  case 3:
5107
- err_22 = _a.sent();
5108
- console.log("perpClient setTokenVaultConfigInstruction error:: ", err_22);
5109
- throw err_22;
5162
+ err_23 = _a.sent();
5163
+ console.log("perpClient setTokenVaultConfigInstruction error:: ", err_23);
5164
+ throw err_23;
5110
5165
  case 4: return [2, {
5111
5166
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5112
5167
  additionalSigners: additionalSigners
@@ -5115,7 +5170,7 @@ var PerpetualsClient = (function () {
5115
5170
  });
5116
5171
  }); };
5117
5172
  this.withdrawInstantFee = function (poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5118
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, receivingTokenAccount, withdrawInstantFeeInstruction, err_23;
5173
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, receivingTokenAccount, withdrawInstantFeeInstruction, err_24;
5119
5174
  return __generator(this, function (_a) {
5120
5175
  switch (_a.label) {
5121
5176
  case 0:
@@ -5153,9 +5208,9 @@ var PerpetualsClient = (function () {
5153
5208
  instructions.push(withdrawInstantFeeInstruction);
5154
5209
  return [3, 6];
5155
5210
  case 5:
5156
- err_23 = _a.sent();
5157
- console.log("perpClient withdrawInstantFeeInstruction error:: ", err_23);
5158
- throw err_23;
5211
+ err_24 = _a.sent();
5212
+ console.log("perpClient withdrawInstantFeeInstruction error:: ", err_24);
5213
+ throw err_24;
5159
5214
  case 6: return [2, {
5160
5215
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5161
5216
  additionalSigners: additionalSigners
@@ -5164,7 +5219,7 @@ var PerpetualsClient = (function () {
5164
5219
  });
5165
5220
  }); };
5166
5221
  this.burnAndClaim = function (owner, nftMint, poolConfig, createAta) { return __awaiter(_this, void 0, void 0, function () {
5167
- var preInstructions, instructions, postInstructions, additionalSigners, userTokenAccount, _a, nftTokenAccount, nftTradingAccount, metadataAccount, collectionMetadata, edition, tokenRecord, burnAndClaimInstruction, err_24;
5222
+ var preInstructions, instructions, postInstructions, additionalSigners, userTokenAccount, _a, nftTokenAccount, nftTradingAccount, metadataAccount, collectionMetadata, edition, tokenRecord, burnAndClaimInstruction, err_25;
5168
5223
  return __generator(this, function (_b) {
5169
5224
  switch (_b.label) {
5170
5225
  case 0:
@@ -5228,9 +5283,9 @@ var PerpetualsClient = (function () {
5228
5283
  instructions.push(burnAndClaimInstruction);
5229
5284
  return [3, 8];
5230
5285
  case 7:
5231
- err_24 = _b.sent();
5232
- console.log("perpClient burnAndClaimInstruction error:: ", err_24);
5233
- throw err_24;
5286
+ err_25 = _b.sent();
5287
+ console.log("perpClient burnAndClaimInstruction error:: ", err_25);
5288
+ throw err_25;
5234
5289
  case 8: return [2, {
5235
5290
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5236
5291
  additionalSigners: additionalSigners
@@ -5239,7 +5294,7 @@ var PerpetualsClient = (function () {
5239
5294
  });
5240
5295
  }); };
5241
5296
  this.burnAndStake = function (owner, feePayer, nftMint, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5242
- var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, nftTokenAccount, nftTradingAccount, metadataAccount, collectionMetadata, edition, tokenRecord, burnAndStakeInstruction, err_25;
5297
+ var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, nftTokenAccount, nftTradingAccount, metadataAccount, collectionMetadata, edition, tokenRecord, burnAndStakeInstruction, err_26;
5243
5298
  return __generator(this, function (_a) {
5244
5299
  switch (_a.label) {
5245
5300
  case 0:
@@ -5290,9 +5345,9 @@ var PerpetualsClient = (function () {
5290
5345
  instructions.push(burnAndStakeInstruction);
5291
5346
  return [3, 4];
5292
5347
  case 3:
5293
- err_25 = _a.sent();
5294
- console.log("perpClient burnAndStakeInstruction error:: ", err_25);
5295
- throw err_25;
5348
+ err_26 = _a.sent();
5349
+ console.log("perpClient burnAndStakeInstruction error:: ", err_26);
5350
+ throw err_26;
5296
5351
  case 4: return [2, {
5297
5352
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5298
5353
  additionalSigners: additionalSigners
@@ -5301,7 +5356,7 @@ var PerpetualsClient = (function () {
5301
5356
  });
5302
5357
  }); };
5303
5358
  this.depositTokenStake = function (owner, feePayer, depositAmount, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5304
- var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, userTokenAccount, depositTokenStakeInstruction, err_26;
5359
+ var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, userTokenAccount, depositTokenStakeInstruction, err_27;
5305
5360
  return __generator(this, function (_a) {
5306
5361
  switch (_a.label) {
5307
5362
  case 0:
@@ -5342,9 +5397,9 @@ var PerpetualsClient = (function () {
5342
5397
  instructions.push(depositTokenStakeInstruction);
5343
5398
  return [3, 5];
5344
5399
  case 4:
5345
- err_26 = _a.sent();
5346
- console.log("perpClient depositStakingInstruction error:: ", err_26);
5347
- throw err_26;
5400
+ err_27 = _a.sent();
5401
+ console.log("perpClient depositStakingInstruction error:: ", err_27);
5402
+ throw err_27;
5348
5403
  case 5: return [2, {
5349
5404
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5350
5405
  additionalSigners: additionalSigners
@@ -5353,7 +5408,7 @@ var PerpetualsClient = (function () {
5353
5408
  });
5354
5409
  }); };
5355
5410
  this.unstakeTokenRequest = function (owner, unstakeAmount, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5356
- var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, unstakeTokenRequestInstruction, err_27;
5411
+ var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, unstakeTokenRequestInstruction, err_28;
5357
5412
  return __generator(this, function (_a) {
5358
5413
  switch (_a.label) {
5359
5414
  case 0:
@@ -5382,9 +5437,9 @@ var PerpetualsClient = (function () {
5382
5437
  instructions.push(unstakeTokenRequestInstruction);
5383
5438
  return [3, 4];
5384
5439
  case 3:
5385
- err_27 = _a.sent();
5386
- console.log("perpClient unstakeTokenRequestInstruction error:: ", err_27);
5387
- throw err_27;
5440
+ err_28 = _a.sent();
5441
+ console.log("perpClient unstakeTokenRequestInstruction error:: ", err_28);
5442
+ throw err_28;
5388
5443
  case 4: return [2, {
5389
5444
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5390
5445
  additionalSigners: additionalSigners
@@ -5393,7 +5448,7 @@ var PerpetualsClient = (function () {
5393
5448
  });
5394
5449
  }); };
5395
5450
  this.unstakeTokenInstant = function (owner, unstakeAmount, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5396
- var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, userTokenAccount, unstakeTokenInstantInstruction, err_28;
5451
+ var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, userTokenAccount, unstakeTokenInstantInstruction, err_29;
5397
5452
  return __generator(this, function (_a) {
5398
5453
  switch (_a.label) {
5399
5454
  case 0:
@@ -5433,9 +5488,9 @@ var PerpetualsClient = (function () {
5433
5488
  instructions.push(unstakeTokenInstantInstruction);
5434
5489
  return [3, 5];
5435
5490
  case 4:
5436
- err_28 = _a.sent();
5437
- console.log("perpClient unstakeTokenInstantInstruction error:: ", err_28);
5438
- throw err_28;
5491
+ err_29 = _a.sent();
5492
+ console.log("perpClient unstakeTokenInstantInstruction error:: ", err_29);
5493
+ throw err_29;
5439
5494
  case 5: return [2, {
5440
5495
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5441
5496
  additionalSigners: additionalSigners
@@ -5444,7 +5499,7 @@ var PerpetualsClient = (function () {
5444
5499
  });
5445
5500
  }); };
5446
5501
  this.withdrawToken = function (owner, withdrawRequestId, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5447
- var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, userTokenAccount, withdrawTokenInstruction, err_29;
5502
+ var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, userTokenAccount, withdrawTokenInstruction, err_30;
5448
5503
  return __generator(this, function (_a) {
5449
5504
  switch (_a.label) {
5450
5505
  case 0:
@@ -5484,9 +5539,9 @@ var PerpetualsClient = (function () {
5484
5539
  instructions.push(withdrawTokenInstruction);
5485
5540
  return [3, 5];
5486
5541
  case 4:
5487
- err_29 = _a.sent();
5488
- console.log("perpClient withdrawTokenInstruction error:: ", err_29);
5489
- throw err_29;
5542
+ err_30 = _a.sent();
5543
+ console.log("perpClient withdrawTokenInstruction error:: ", err_30);
5544
+ throw err_30;
5490
5545
  case 5: return [2, {
5491
5546
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5492
5547
  additionalSigners: additionalSigners
@@ -5495,7 +5550,7 @@ var PerpetualsClient = (function () {
5495
5550
  });
5496
5551
  }); };
5497
5552
  this.cancelUnstakeRequest = function (owner, withdrawRequestId, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5498
- var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, cancelUnstakeRequestInstruction, err_30;
5553
+ var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, cancelUnstakeRequestInstruction, err_31;
5499
5554
  return __generator(this, function (_a) {
5500
5555
  switch (_a.label) {
5501
5556
  case 0:
@@ -5524,9 +5579,9 @@ var PerpetualsClient = (function () {
5524
5579
  instructions.push(cancelUnstakeRequestInstruction);
5525
5580
  return [3, 4];
5526
5581
  case 3:
5527
- err_30 = _a.sent();
5528
- console.log("perpClient cancelUnstakeRequestInstruction error:: ", err_30);
5529
- throw err_30;
5582
+ err_31 = _a.sent();
5583
+ console.log("perpClient cancelUnstakeRequestInstruction error:: ", err_31);
5584
+ throw err_31;
5530
5585
  case 4: return [2, {
5531
5586
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5532
5587
  additionalSigners: additionalSigners
@@ -5535,7 +5590,7 @@ var PerpetualsClient = (function () {
5535
5590
  });
5536
5591
  }); };
5537
5592
  this.distributeTokenReward = function (amount, epochCount, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5538
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, fundingTokenAccount, distributeTokenRewardInstruction, err_31;
5593
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, fundingTokenAccount, distributeTokenRewardInstruction, err_32;
5539
5594
  return __generator(this, function (_a) {
5540
5595
  switch (_a.label) {
5541
5596
  case 0:
@@ -5571,9 +5626,9 @@ var PerpetualsClient = (function () {
5571
5626
  instructions.push(distributeTokenRewardInstruction);
5572
5627
  return [3, 4];
5573
5628
  case 3:
5574
- err_31 = _a.sent();
5575
- console.log("perpClient distributeTokenRewardInstruction error:: ", err_31);
5576
- throw err_31;
5629
+ err_32 = _a.sent();
5630
+ console.log("perpClient distributeTokenRewardInstruction error:: ", err_32);
5631
+ throw err_32;
5577
5632
  case 4: return [2, {
5578
5633
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5579
5634
  additionalSigners: additionalSigners
@@ -5582,7 +5637,7 @@ var PerpetualsClient = (function () {
5582
5637
  });
5583
5638
  }); };
5584
5639
  this.setTokenReward = function (owner, amount, epochCount, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5585
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, setTokenRewardInstruction, err_32;
5640
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, setTokenRewardInstruction, err_33;
5586
5641
  return __generator(this, function (_a) {
5587
5642
  switch (_a.label) {
5588
5643
  case 0:
@@ -5614,9 +5669,9 @@ var PerpetualsClient = (function () {
5614
5669
  instructions.push(setTokenRewardInstruction);
5615
5670
  return [3, 4];
5616
5671
  case 3:
5617
- err_32 = _a.sent();
5618
- console.log("perpClient setTokenRewardInstruction error:: ", err_32);
5619
- throw err_32;
5672
+ err_33 = _a.sent();
5673
+ console.log("perpClient setTokenRewardInstruction error:: ", err_33);
5674
+ throw err_33;
5620
5675
  case 4: return [2, {
5621
5676
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5622
5677
  additionalSigners: additionalSigners
@@ -5627,7 +5682,7 @@ var PerpetualsClient = (function () {
5627
5682
  this.collectTokenReward = function (owner, poolConfig, createUserATA) {
5628
5683
  if (createUserATA === void 0) { createUserATA = true; }
5629
5684
  return __awaiter(_this, void 0, void 0, function () {
5630
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, userTokenAccount, _a, collectTokenRewardInstruction, err_33;
5685
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, userTokenAccount, _a, collectTokenRewardInstruction, err_34;
5631
5686
  return __generator(this, function (_b) {
5632
5687
  switch (_b.label) {
5633
5688
  case 0:
@@ -5671,9 +5726,9 @@ var PerpetualsClient = (function () {
5671
5726
  instructions.push(collectTokenRewardInstruction);
5672
5727
  return [3, 6];
5673
5728
  case 5:
5674
- err_33 = _b.sent();
5675
- console.log("perpClient collectTokenRewardInstruction error:: ", err_33);
5676
- throw err_33;
5729
+ err_34 = _b.sent();
5730
+ console.log("perpClient collectTokenRewardInstruction error:: ", err_34);
5731
+ throw err_34;
5677
5732
  case 6: return [2, {
5678
5733
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5679
5734
  additionalSigners: additionalSigners
@@ -5683,7 +5738,7 @@ var PerpetualsClient = (function () {
5683
5738
  });
5684
5739
  };
5685
5740
  this.setTokenStakeLevel = function (owner, stakeLevel) { return __awaiter(_this, void 0, void 0, function () {
5686
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, setTokenStakeLevelInstruction, err_34;
5741
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, setTokenStakeLevelInstruction, err_35;
5687
5742
  return __generator(this, function (_a) {
5688
5743
  switch (_a.label) {
5689
5744
  case 0:
@@ -5711,9 +5766,9 @@ var PerpetualsClient = (function () {
5711
5766
  instructions.push(setTokenStakeLevelInstruction);
5712
5767
  return [3, 4];
5713
5768
  case 3:
5714
- err_34 = _a.sent();
5715
- console.log("perpClient setTokenStakeLevelInstruction error:: ", err_34);
5716
- throw err_34;
5769
+ err_35 = _a.sent();
5770
+ console.log("perpClient setTokenStakeLevelInstruction error:: ", err_35);
5771
+ throw err_35;
5717
5772
  case 4: return [2, {
5718
5773
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5719
5774
  additionalSigners: additionalSigners
@@ -5722,7 +5777,7 @@ var PerpetualsClient = (function () {
5722
5777
  });
5723
5778
  }); };
5724
5779
  this.initRewardVault = function (nftCount, rewardSymbol, collectionMint, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5725
- var publicKey, rewardCustodyMint, instructions, additionalSigners, fbNftProgramData, rewardVault, rewardTokenAccount, nftTransferAuthority, initRewardVault, err_35;
5780
+ var publicKey, rewardCustodyMint, instructions, additionalSigners, fbNftProgramData, rewardVault, rewardTokenAccount, nftTransferAuthority, initRewardVault, err_36;
5726
5781
  return __generator(this, function (_a) {
5727
5782
  switch (_a.label) {
5728
5783
  case 0:
@@ -5759,9 +5814,9 @@ var PerpetualsClient = (function () {
5759
5814
  instructions.push(initRewardVault);
5760
5815
  return [3, 4];
5761
5816
  case 3:
5762
- err_35 = _a.sent();
5763
- console.log("perpClient InitRewardVault error:: ", err_35);
5764
- throw err_35;
5817
+ err_36 = _a.sent();
5818
+ console.log("perpClient InitRewardVault error:: ", err_36);
5819
+ throw err_36;
5765
5820
  case 4: return [2, {
5766
5821
  instructions: __spreadArray([], instructions, true),
5767
5822
  additionalSigners: additionalSigners
@@ -5770,7 +5825,7 @@ var PerpetualsClient = (function () {
5770
5825
  });
5771
5826
  }); };
5772
5827
  this.distributeReward = function (rewardAmount, rewardSymbol, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5773
- var publicKey, rewardCustodyMint, instructions, additionalSigners, fundingAccount, rewardVault, rewardTokenAccount, distributeReward, err_36;
5828
+ var publicKey, rewardCustodyMint, instructions, additionalSigners, fundingAccount, rewardVault, rewardTokenAccount, distributeReward, err_37;
5774
5829
  return __generator(this, function (_a) {
5775
5830
  switch (_a.label) {
5776
5831
  case 0:
@@ -5801,9 +5856,9 @@ var PerpetualsClient = (function () {
5801
5856
  instructions.push(distributeReward);
5802
5857
  return [3, 4];
5803
5858
  case 3:
5804
- err_36 = _a.sent();
5805
- console.log("perpClient distributeReward error:: ", err_36);
5806
- throw err_36;
5859
+ err_37 = _a.sent();
5860
+ console.log("perpClient distributeReward error:: ", err_37);
5861
+ throw err_37;
5807
5862
  case 4: return [2, {
5808
5863
  instructions: __spreadArray([], instructions, true),
5809
5864
  additionalSigners: additionalSigners
@@ -5814,7 +5869,7 @@ var PerpetualsClient = (function () {
5814
5869
  this.collectNftReward = function (rewardSymbol, poolConfig, nftMint, createUserATA) {
5815
5870
  if (createUserATA === void 0) { createUserATA = true; }
5816
5871
  return __awaiter(_this, void 0, void 0, function () {
5817
- var publicKey, rewardCustodyMint, instructions, additionalSigners, nftTokenAccount, metadataAccount, receivingTokenAccount, _a, rewardRecord, rewardVault, rewardTokenAccount, nftTransferAuthority, collectNftReward, err_37;
5872
+ var publicKey, rewardCustodyMint, instructions, additionalSigners, nftTokenAccount, metadataAccount, receivingTokenAccount, _a, rewardRecord, rewardVault, rewardTokenAccount, nftTransferAuthority, collectNftReward, err_38;
5818
5873
  return __generator(this, function (_b) {
5819
5874
  switch (_b.label) {
5820
5875
  case 0:
@@ -5864,8 +5919,8 @@ var PerpetualsClient = (function () {
5864
5919
  instructions.push(collectNftReward);
5865
5920
  return [3, 6];
5866
5921
  case 5:
5867
- err_37 = _b.sent();
5868
- throw err_37;
5922
+ err_38 = _b.sent();
5923
+ throw err_38;
5869
5924
  case 6: return [2, {
5870
5925
  instructions: __spreadArray([], instructions, true),
5871
5926
  additionalSigners: additionalSigners
@@ -5877,7 +5932,7 @@ var PerpetualsClient = (function () {
5877
5932
  this.collectAndDistributeFee = function (rewardSymbol, poolConfig, createUserATA, nftTradingAccount) {
5878
5933
  if (createUserATA === void 0) { createUserATA = true; }
5879
5934
  return __awaiter(_this, void 0, void 0, function () {
5880
- var publicKey, rewardCustodyMint, rewardCustodyConfig, preInstructions, instructions, postInstructions, additionalSigners, pool, flpStakeAccount, receivingTokenAccount, _a, tradingAccount, rewardVault, rewardTokenAccount, withdrawStakeInstruction, err_38;
5935
+ var publicKey, rewardCustodyMint, rewardCustodyConfig, preInstructions, instructions, postInstructions, additionalSigners, pool, flpStakeAccount, receivingTokenAccount, _a, tradingAccount, rewardVault, rewardTokenAccount, withdrawStakeInstruction, err_39;
5881
5936
  return __generator(this, function (_b) {
5882
5937
  switch (_b.label) {
5883
5938
  case 0:
@@ -5941,9 +5996,9 @@ var PerpetualsClient = (function () {
5941
5996
  instructions.push(withdrawStakeInstruction);
5942
5997
  return [3, 6];
5943
5998
  case 5:
5944
- err_38 = _b.sent();
5945
- console.log("perpClient withdrawStake error:: ", err_38);
5946
- throw err_38;
5999
+ err_39 = _b.sent();
6000
+ console.log("perpClient withdrawStake error:: ", err_39);
6001
+ throw err_39;
5947
6002
  case 6: return [2, {
5948
6003
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5949
6004
  additionalSigners: additionalSigners
@@ -5953,7 +6008,7 @@ var PerpetualsClient = (function () {
5953
6008
  });
5954
6009
  };
5955
6010
  this.setTriggerPrice = function (targetSymbol, collateralSymbol, side, triggerPrice, isStopLoss, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5956
- var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, positionAccount, instructions, additionalSigners, setTriggerPrice, err_39;
6011
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, positionAccount, instructions, additionalSigners, setTriggerPrice, err_40;
5957
6012
  return __generator(this, function (_a) {
5958
6013
  switch (_a.label) {
5959
6014
  case 0:
@@ -5992,9 +6047,9 @@ var PerpetualsClient = (function () {
5992
6047
  instructions.push(setTriggerPrice);
5993
6048
  return [3, 4];
5994
6049
  case 3:
5995
- err_39 = _a.sent();
5996
- console.log("perpClient setTriggerPrice error:: ", err_39);
5997
- throw err_39;
6050
+ err_40 = _a.sent();
6051
+ console.log("perpClient setTriggerPrice error:: ", err_40);
6052
+ throw err_40;
5998
6053
  case 4: return [2, {
5999
6054
  instructions: __spreadArray([], instructions, true),
6000
6055
  additionalSigners: additionalSigners
@@ -6007,7 +6062,7 @@ var PerpetualsClient = (function () {
6007
6062
  if (closeUsersWSOLATA === void 0) { closeUsersWSOLATA = false; }
6008
6063
  if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
6009
6064
  return __awaiter(_this, void 0, void 0, function () {
6010
- var payerPubkey, targetCustodyConfig, collateralCustodyConfig, marketAccount, userReceivingTokenAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, forceClosePosition, closeWsolATAIns, err_40;
6065
+ var payerPubkey, targetCustodyConfig, collateralCustodyConfig, marketAccount, userReceivingTokenAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, forceClosePosition, closeWsolATAIns, err_41;
6011
6066
  return __generator(this, function (_b) {
6012
6067
  switch (_b.label) {
6013
6068
  case 0:
@@ -6068,9 +6123,9 @@ var PerpetualsClient = (function () {
6068
6123
  }
6069
6124
  return [3, 7];
6070
6125
  case 6:
6071
- err_40 = _b.sent();
6072
- console.log("perpClient forceClosePosition error:: ", err_40);
6073
- throw err_40;
6126
+ err_41 = _b.sent();
6127
+ console.log("perpClient forceClosePosition error:: ", err_41);
6128
+ throw err_41;
6074
6129
  case 7: return [2, {
6075
6130
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6076
6131
  additionalSigners: additionalSigners
@@ -6083,7 +6138,7 @@ var PerpetualsClient = (function () {
6083
6138
  if (skipBalanceChecks === void 0) { skipBalanceChecks = false; }
6084
6139
  if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
6085
6140
  return __awaiter(_this, void 0, void 0, function () {
6086
- var publicKey, targetCustodyConfig, reserveCustodyConfig, collateralCustodyConfig, receiveCustodyConfig, marketAccount, userReserveTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, accCreationLamports, lamports, unWrappedSolBalance, _a, tokenAccountBalance, _b, positionAccount, orderAccount, placeLimitOrder, err_41;
6141
+ var publicKey, targetCustodyConfig, reserveCustodyConfig, collateralCustodyConfig, receiveCustodyConfig, marketAccount, userReserveTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, accCreationLamports, lamports, unWrappedSolBalance, _a, tokenAccountBalance, _b, positionAccount, orderAccount, placeLimitOrder, err_42;
6087
6142
  return __generator(this, function (_c) {
6088
6143
  switch (_c.label) {
6089
6144
  case 0:
@@ -6188,9 +6243,9 @@ var PerpetualsClient = (function () {
6188
6243
  instructions.push(placeLimitOrder);
6189
6244
  return [3, 11];
6190
6245
  case 10:
6191
- err_41 = _c.sent();
6192
- console.log("perpClient placeLimitOrder error:: ", err_41);
6193
- throw err_41;
6246
+ err_42 = _c.sent();
6247
+ console.log("perpClient placeLimitOrder error:: ", err_42);
6248
+ throw err_42;
6194
6249
  case 11: return [2, {
6195
6250
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6196
6251
  additionalSigners: additionalSigners
@@ -6203,7 +6258,7 @@ var PerpetualsClient = (function () {
6203
6258
  if (createUserATA === void 0) { createUserATA = true; }
6204
6259
  if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
6205
6260
  return __awaiter(_this, void 0, void 0, function () {
6206
- var publicKey, targetCustodyConfig, reserveCustodyConfig, collateralCustodyConfig, receiveCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, wrappedSolAccount, userReceivingTokenAccount, lamports, _a, positionAccount, orderAccount, editLimitOrder, err_42;
6261
+ var publicKey, targetCustodyConfig, reserveCustodyConfig, collateralCustodyConfig, receiveCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, wrappedSolAccount, userReceivingTokenAccount, lamports, _a, positionAccount, orderAccount, editLimitOrder, err_43;
6207
6262
  return __generator(this, function (_b) {
6208
6263
  switch (_b.label) {
6209
6264
  case 0:
@@ -6291,9 +6346,9 @@ var PerpetualsClient = (function () {
6291
6346
  instructions.push(editLimitOrder);
6292
6347
  return [3, 8];
6293
6348
  case 7:
6294
- err_42 = _b.sent();
6295
- console.log("perpClient editLimitOrder error:: ", err_42);
6296
- throw err_42;
6349
+ err_43 = _b.sent();
6350
+ console.log("perpClient editLimitOrder error:: ", err_43);
6351
+ throw err_43;
6297
6352
  case 8: return [2, {
6298
6353
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6299
6354
  additionalSigners: additionalSigners
@@ -6307,7 +6362,7 @@ var PerpetualsClient = (function () {
6307
6362
  if (userReferralAccount === void 0) { userReferralAccount = web3_js_1.PublicKey.default; }
6308
6363
  if (rebateTokenAccount === void 0) { rebateTokenAccount = web3_js_1.PublicKey.default; }
6309
6364
  return __awaiter(_this, void 0, void 0, function () {
6310
- var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, executeLimitOrder, err_43;
6365
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, executeLimitOrder, err_44;
6311
6366
  return __generator(this, function (_a) {
6312
6367
  switch (_a.label) {
6313
6368
  case 0:
@@ -6356,9 +6411,9 @@ var PerpetualsClient = (function () {
6356
6411
  instructions.push(executeLimitOrder);
6357
6412
  return [3, 4];
6358
6413
  case 3:
6359
- err_43 = _a.sent();
6360
- console.log("perpClient executeLimitOrder error:: ", err_43);
6361
- throw err_43;
6414
+ err_44 = _a.sent();
6415
+ console.log("perpClient executeLimitOrder error:: ", err_44);
6416
+ throw err_44;
6362
6417
  case 4: return [2, {
6363
6418
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6364
6419
  additionalSigners: additionalSigners
@@ -6372,7 +6427,7 @@ var PerpetualsClient = (function () {
6372
6427
  if (userReferralAccount === void 0) { userReferralAccount = web3_js_1.PublicKey.default; }
6373
6428
  if (rebateTokenAccount === void 0) { rebateTokenAccount = web3_js_1.PublicKey.default; }
6374
6429
  return __awaiter(_this, void 0, void 0, function () {
6375
- var publicKey, targetCustodyConfig, collateralCustodyConfig, reserveCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, executeLimitWithSwap, err_44;
6430
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, reserveCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, executeLimitWithSwap, err_45;
6376
6431
  return __generator(this, function (_a) {
6377
6432
  switch (_a.label) {
6378
6433
  case 0:
@@ -6424,9 +6479,9 @@ var PerpetualsClient = (function () {
6424
6479
  instructions.push(executeLimitWithSwap);
6425
6480
  return [3, 4];
6426
6481
  case 3:
6427
- err_44 = _a.sent();
6428
- console.log("perpClient executeLimitWithSwap error:: ", err_44);
6429
- throw err_44;
6482
+ err_45 = _a.sent();
6483
+ console.log("perpClient executeLimitWithSwap error:: ", err_45);
6484
+ throw err_45;
6430
6485
  case 4: return [2, {
6431
6486
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6432
6487
  additionalSigners: additionalSigners
@@ -6436,7 +6491,7 @@ var PerpetualsClient = (function () {
6436
6491
  });
6437
6492
  };
6438
6493
  this.placeTriggerOrder = function (targetSymbol, collateralSymbol, receiveSymbol, side, triggerPrice, deltaSizeAmount, isStopLoss, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6439
- var publicKey, targetCustodyConfig, collateralCustodyConfig, receivingCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, placeTriggerOrder, err_45;
6494
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, receivingCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, placeTriggerOrder, err_46;
6440
6495
  return __generator(this, function (_a) {
6441
6496
  switch (_a.label) {
6442
6497
  case 0:
@@ -6484,9 +6539,9 @@ var PerpetualsClient = (function () {
6484
6539
  instructions.push(placeTriggerOrder);
6485
6540
  return [3, 4];
6486
6541
  case 3:
6487
- err_45 = _a.sent();
6488
- console.log("perpClient placeTriggerOrder error:: ", err_45);
6489
- throw err_45;
6542
+ err_46 = _a.sent();
6543
+ console.log("perpClient placeTriggerOrder error:: ", err_46);
6544
+ throw err_46;
6490
6545
  case 4: return [2, {
6491
6546
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6492
6547
  additionalSigners: additionalSigners
@@ -6495,7 +6550,7 @@ var PerpetualsClient = (function () {
6495
6550
  });
6496
6551
  }); };
6497
6552
  this.editTriggerOrder = function (targetSymbol, collateralSymbol, receiveSymbol, side, orderId, triggerPrice, deltaSizeAmount, isStopLoss, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6498
- var publicKey, targetCustodyConfig, collateralCustodyConfig, receivingCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, editTriggerOrder, err_46;
6553
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, receivingCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, editTriggerOrder, err_47;
6499
6554
  return __generator(this, function (_a) {
6500
6555
  switch (_a.label) {
6501
6556
  case 0:
@@ -6542,9 +6597,9 @@ var PerpetualsClient = (function () {
6542
6597
  instructions.push(editTriggerOrder);
6543
6598
  return [3, 4];
6544
6599
  case 3:
6545
- err_46 = _a.sent();
6546
- console.log("perpClient editTriggerOrder error:: ", err_46);
6547
- throw err_46;
6600
+ err_47 = _a.sent();
6601
+ console.log("perpClient editTriggerOrder error:: ", err_47);
6602
+ throw err_47;
6548
6603
  case 4: return [2, {
6549
6604
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6550
6605
  additionalSigners: additionalSigners
@@ -6553,7 +6608,7 @@ var PerpetualsClient = (function () {
6553
6608
  });
6554
6609
  }); };
6555
6610
  this.cancelTriggerOrder = function (targetSymbol, collateralSymbol, side, orderId, isStopLoss, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6556
- var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, orderAccount, cancelTriggerOrder, err_47;
6611
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, orderAccount, cancelTriggerOrder, err_48;
6557
6612
  return __generator(this, function (_a) {
6558
6613
  switch (_a.label) {
6559
6614
  case 0:
@@ -6586,9 +6641,9 @@ var PerpetualsClient = (function () {
6586
6641
  instructions.push(cancelTriggerOrder);
6587
6642
  return [3, 4];
6588
6643
  case 3:
6589
- err_47 = _a.sent();
6590
- console.log("perpClient cancelTriggerOrder error:: ", err_47);
6591
- throw err_47;
6644
+ err_48 = _a.sent();
6645
+ console.log("perpClient cancelTriggerOrder error:: ", err_48);
6646
+ throw err_48;
6592
6647
  case 4: return [2, {
6593
6648
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6594
6649
  additionalSigners: additionalSigners
@@ -6597,7 +6652,7 @@ var PerpetualsClient = (function () {
6597
6652
  });
6598
6653
  }); };
6599
6654
  this.cancelAllTriggerOrders = function (targetSymbol, collateralSymbol, side, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6600
- var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, orderAccount, positionAccount, cancelAllTriggerOrders, err_48;
6655
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, orderAccount, positionAccount, cancelAllTriggerOrders, err_49;
6601
6656
  return __generator(this, function (_a) {
6602
6657
  switch (_a.label) {
6603
6658
  case 0:
@@ -6628,9 +6683,9 @@ var PerpetualsClient = (function () {
6628
6683
  instructions.push(cancelAllTriggerOrders);
6629
6684
  return [3, 4];
6630
6685
  case 3:
6631
- err_48 = _a.sent();
6632
- console.log("perpClient cancelAllTriggerOrders error:: ", err_48);
6633
- throw err_48;
6686
+ err_49 = _a.sent();
6687
+ console.log("perpClient cancelAllTriggerOrders error:: ", err_49);
6688
+ throw err_49;
6634
6689
  case 4: return [2, {
6635
6690
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6636
6691
  additionalSigners: additionalSigners
@@ -6645,7 +6700,7 @@ var PerpetualsClient = (function () {
6645
6700
  if (userReferralAccount === void 0) { userReferralAccount = web3_js_1.PublicKey.default; }
6646
6701
  if (rebateTokenAccount === void 0) { rebateTokenAccount = web3_js_1.PublicKey.default; }
6647
6702
  return __awaiter(_this, void 0, void 0, function () {
6648
- var payerPubkey, targetCustodyConfig, collateralCustodyConfig, receivingCustodyConfig, marketAccount, userReceivingTokenAccount, userReceivingTokenAccountCollateral, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, _b, positionAccount, orderAccount, custodyAccountMetas, custodyOracleAccountMetas, _i, _c, custody, executeTriggerWithSwap, err_49;
6703
+ var payerPubkey, targetCustodyConfig, collateralCustodyConfig, receivingCustodyConfig, marketAccount, userReceivingTokenAccount, userReceivingTokenAccountCollateral, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, _b, positionAccount, orderAccount, custodyAccountMetas, custodyOracleAccountMetas, _i, _c, custody, executeTriggerWithSwap, err_50;
6649
6704
  return __generator(this, function (_d) {
6650
6705
  switch (_d.label) {
6651
6706
  case 0:
@@ -6742,9 +6797,9 @@ var PerpetualsClient = (function () {
6742
6797
  instructions.push(executeTriggerWithSwap);
6743
6798
  return [3, 10];
6744
6799
  case 9:
6745
- err_49 = _d.sent();
6746
- console.log("perpClient executeTriggerWithSwap error:: ", err_49);
6747
- throw err_49;
6800
+ err_50 = _d.sent();
6801
+ console.log("perpClient executeTriggerWithSwap error:: ", err_50);
6802
+ throw err_50;
6748
6803
  case 10: return [2, {
6749
6804
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6750
6805
  additionalSigners: additionalSigners
@@ -6760,7 +6815,7 @@ var PerpetualsClient = (function () {
6760
6815
  if (userReferralAccount === void 0) { userReferralAccount = web3_js_1.PublicKey.default; }
6761
6816
  if (rebateTokenAccount === void 0) { rebateTokenAccount = web3_js_1.PublicKey.default; }
6762
6817
  return __awaiter(_this, void 0, void 0, function () {
6763
- var payerPubkey, targetCustodyConfig, collateralCustodyConfig, marketAccount, userReceivingTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, positionAccount, orderAccount, executeTriggerOrder, err_50;
6818
+ var payerPubkey, targetCustodyConfig, collateralCustodyConfig, marketAccount, userReceivingTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, positionAccount, orderAccount, executeTriggerOrder, err_51;
6764
6819
  return __generator(this, function (_b) {
6765
6820
  switch (_b.label) {
6766
6821
  case 0:
@@ -6826,9 +6881,9 @@ var PerpetualsClient = (function () {
6826
6881
  instructions.push(executeTriggerOrder);
6827
6882
  return [3, 8];
6828
6883
  case 7:
6829
- err_50 = _b.sent();
6830
- console.log("perpClient executeTriggerOrder error:: ", err_50);
6831
- throw err_50;
6884
+ err_51 = _b.sent();
6885
+ console.log("perpClient executeTriggerOrder error:: ", err_51);
6886
+ throw err_51;
6832
6887
  case 8: return [2, {
6833
6888
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6834
6889
  additionalSigners: additionalSigners
@@ -6838,7 +6893,7 @@ var PerpetualsClient = (function () {
6838
6893
  });
6839
6894
  };
6840
6895
  this.migrateTriggerOrder = function (owner, marketAccount, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6841
- var payerPubkey, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, migrateTriggerOrder, err_51;
6896
+ var payerPubkey, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, migrateTriggerOrder, err_52;
6842
6897
  return __generator(this, function (_a) {
6843
6898
  switch (_a.label) {
6844
6899
  case 0:
@@ -6868,9 +6923,9 @@ var PerpetualsClient = (function () {
6868
6923
  instructions.push(migrateTriggerOrder);
6869
6924
  return [3, 4];
6870
6925
  case 3:
6871
- err_51 = _a.sent();
6872
- console.log("perpClient migrateTriggerOrder error:: ", err_51);
6873
- throw err_51;
6926
+ err_52 = _a.sent();
6927
+ console.log("perpClient migrateTriggerOrder error:: ", err_52);
6928
+ throw err_52;
6874
6929
  case 4: return [2, {
6875
6930
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6876
6931
  additionalSigners: additionalSigners
@@ -6879,7 +6934,7 @@ var PerpetualsClient = (function () {
6879
6934
  });
6880
6935
  }); };
6881
6936
  this.getPositionData = function (position, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6882
- var marketConfig, targetCustodyConfig, collateralCustodyConfig, getPositionData, err_52;
6937
+ var marketConfig, targetCustodyConfig, collateralCustodyConfig, getPositionData, err_53;
6883
6938
  return __generator(this, function (_a) {
6884
6939
  switch (_a.label) {
6885
6940
  case 0:
@@ -6908,15 +6963,15 @@ var PerpetualsClient = (function () {
6908
6963
  console.log(getPositionData);
6909
6964
  return [2, getPositionData];
6910
6965
  case 3:
6911
- err_52 = _a.sent();
6912
- console.log("perpClient setPool error:: ", err_52);
6913
- throw err_52;
6966
+ err_53 = _a.sent();
6967
+ console.log("perpClient setPool error:: ", err_53);
6968
+ throw err_53;
6914
6969
  case 4: return [2];
6915
6970
  }
6916
6971
  });
6917
6972
  }); };
6918
6973
  this.protocolWithdrawFees = function (rewardSymbol, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6919
- var publicKey, custodyConfig, receivingTokenAccount, instructions, additionalSigners, withdrawFeesIx, err_53;
6974
+ var publicKey, custodyConfig, receivingTokenAccount, instructions, additionalSigners, withdrawFeesIx, err_54;
6920
6975
  return __generator(this, function (_a) {
6921
6976
  switch (_a.label) {
6922
6977
  case 0:
@@ -6949,9 +7004,9 @@ var PerpetualsClient = (function () {
6949
7004
  instructions.push(withdrawFeesIx);
6950
7005
  return [3, 5];
6951
7006
  case 4:
6952
- err_53 = _a.sent();
6953
- console.log("perpClient setPool error:: ", err_53);
6954
- throw err_53;
7007
+ err_54 = _a.sent();
7008
+ console.log("perpClient setPool error:: ", err_54);
7009
+ throw err_54;
6955
7010
  case 5: return [2, {
6956
7011
  instructions: __spreadArray([], instructions, true),
6957
7012
  additionalSigners: additionalSigners
@@ -6960,7 +7015,7 @@ var PerpetualsClient = (function () {
6960
7015
  });
6961
7016
  }); };
6962
7017
  this.setPermissions = function (permissions) { return __awaiter(_this, void 0, void 0, function () {
6963
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setPermissionsInstruction, err_54;
7018
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setPermissionsInstruction, err_55;
6964
7019
  return __generator(this, function (_a) {
6965
7020
  switch (_a.label) {
6966
7021
  case 0:
@@ -6987,9 +7042,9 @@ var PerpetualsClient = (function () {
6987
7042
  instructions.push(setPermissionsInstruction);
6988
7043
  return [3, 4];
6989
7044
  case 3:
6990
- err_54 = _a.sent();
6991
- console.log("perpClient setPool error:: ", err_54);
6992
- throw err_54;
7045
+ err_55 = _a.sent();
7046
+ console.log("perpClient setPool error:: ", err_55);
7047
+ throw err_55;
6993
7048
  case 4: return [2, {
6994
7049
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6995
7050
  additionalSigners: additionalSigners
@@ -6998,7 +7053,7 @@ var PerpetualsClient = (function () {
6998
7053
  });
6999
7054
  }); };
7000
7055
  this.reimburse = function (tokenMint, amountIn, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7001
- var custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, instructions, additionalSigners, custodyConfig, reimburse, _d, _e, err_55;
7056
+ var custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, instructions, additionalSigners, custodyConfig, reimburse, _d, _e, err_56;
7002
7057
  var _f;
7003
7058
  return __generator(this, function (_g) {
7004
7059
  switch (_g.label) {
@@ -7058,9 +7113,9 @@ var PerpetualsClient = (function () {
7058
7113
  instructions.push(reimburse);
7059
7114
  return [3, 5];
7060
7115
  case 4:
7061
- err_55 = _g.sent();
7062
- console.log("perpClient setPool error:: ", err_55);
7063
- throw err_55;
7116
+ err_56 = _g.sent();
7117
+ console.log("perpClient setPool error:: ", err_56);
7118
+ throw err_56;
7064
7119
  case 5: return [2, {
7065
7120
  instructions: __spreadArray([], instructions, true),
7066
7121
  additionalSigners: additionalSigners
@@ -7069,7 +7124,7 @@ var PerpetualsClient = (function () {
7069
7124
  });
7070
7125
  }); };
7071
7126
  this.setInternalOraclePrice = function (tokenMint, price, expo, conf, ema, publishTime, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7072
- var instructions, additionalSigners, custodyConfig, setInternalOraclePrice, err_56;
7127
+ var instructions, additionalSigners, custodyConfig, setInternalOraclePrice, err_57;
7073
7128
  return __generator(this, function (_a) {
7074
7129
  switch (_a.label) {
7075
7130
  case 0:
@@ -7102,9 +7157,9 @@ var PerpetualsClient = (function () {
7102
7157
  instructions.push(setInternalOraclePrice);
7103
7158
  return [3, 4];
7104
7159
  case 3:
7105
- err_56 = _a.sent();
7106
- console.log("perpClient setInternalOracleAccount error:: ", err_56);
7107
- throw err_56;
7160
+ err_57 = _a.sent();
7161
+ console.log("perpClient setInternalOracleAccount error:: ", err_57);
7162
+ throw err_57;
7108
7163
  case 4: return [2, {
7109
7164
  instructions: __spreadArray([], instructions, true),
7110
7165
  additionalSigners: additionalSigners
@@ -7116,7 +7171,7 @@ var PerpetualsClient = (function () {
7116
7171
  if (skipBalanceChecks === void 0) { skipBalanceChecks = false; }
7117
7172
  if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
7118
7173
  return __awaiter(_this, void 0, void 0, function () {
7119
- var publicKey, preInstructions, instructions, additionalSigners, postInstructions, rewardCustody, inCustodyConfig, lpTokenMint, compoundingTokenMint, wrappedSolAccount, lpTokenAccount, compoundingTokenAccount, fundingAccount, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, lamports, unWrappedSolBalance, _d, addCompoundingLiquidity, err_57;
7174
+ var publicKey, preInstructions, instructions, additionalSigners, postInstructions, rewardCustody, inCustodyConfig, lpTokenMint, compoundingTokenMint, wrappedSolAccount, lpTokenAccount, compoundingTokenAccount, fundingAccount, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, lamports, unWrappedSolBalance, _d, addCompoundingLiquidity, err_58;
7120
7175
  return __generator(this, function (_e) {
7121
7176
  switch (_e.label) {
7122
7177
  case 0:
@@ -7239,8 +7294,8 @@ var PerpetualsClient = (function () {
7239
7294
  instructions.push(addCompoundingLiquidity);
7240
7295
  return [3, 10];
7241
7296
  case 9:
7242
- err_57 = _e.sent();
7243
- console.log("perpClient addCompoundingLiquidity error:: ", err_57);
7297
+ err_58 = _e.sent();
7298
+ console.log("perpClient addCompoundingLiquidity error:: ", err_58);
7244
7299
  return [3, 10];
7245
7300
  case 10: return [2, {
7246
7301
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
@@ -7254,7 +7309,7 @@ var PerpetualsClient = (function () {
7254
7309
  if (createUserATA === void 0) { createUserATA = true; }
7255
7310
  if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
7256
7311
  return __awaiter(_this, void 0, void 0, function () {
7257
- var publicKey, userReceivingTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, outCustodyConfig, lpTokenMint, compoundingTokenMint, lamports, _a, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _b, custody, _c, _d, market, compoundingTokenAccount, removeCompoundingLiquidity, err_58;
7312
+ var publicKey, userReceivingTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, outCustodyConfig, lpTokenMint, compoundingTokenMint, lamports, _a, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _b, custody, _c, _d, market, compoundingTokenAccount, removeCompoundingLiquidity, err_59;
7258
7313
  return __generator(this, function (_e) {
7259
7314
  switch (_e.label) {
7260
7315
  case 0:
@@ -7361,8 +7416,8 @@ var PerpetualsClient = (function () {
7361
7416
  instructions.push(removeCompoundingLiquidity);
7362
7417
  return [3, 8];
7363
7418
  case 7:
7364
- err_58 = _e.sent();
7365
- console.log("perpClient removeCompoundingLiquidity error:: ", err_58);
7419
+ err_59 = _e.sent();
7420
+ console.log("perpClient removeCompoundingLiquidity error:: ", err_59);
7366
7421
  return [3, 8];
7367
7422
  case 8: return [2, {
7368
7423
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
@@ -7375,7 +7430,7 @@ var PerpetualsClient = (function () {
7375
7430
  this.migrateStake = function (amount, rewardTokenMint, poolConfig, createUserATA) {
7376
7431
  if (createUserATA === void 0) { createUserATA = true; }
7377
7432
  return __awaiter(_this, void 0, void 0, function () {
7378
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, lpTokenMint, compoundingTokenMint, compoudingTokenAccount, _a, flpStakeAccount, tokenStakeAccount, tokenStakeAccounts, _b, poolStakedLpVault, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _c, custody, _d, _e, market, migrateStake, err_59;
7433
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, lpTokenMint, compoundingTokenMint, compoudingTokenAccount, _a, flpStakeAccount, tokenStakeAccount, tokenStakeAccounts, _b, poolStakedLpVault, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _c, custody, _d, _e, market, migrateStake, err_60;
7379
7434
  return __generator(this, function (_f) {
7380
7435
  switch (_f.label) {
7381
7436
  case 0:
@@ -7472,8 +7527,8 @@ var PerpetualsClient = (function () {
7472
7527
  instructions.push(migrateStake);
7473
7528
  return [3, 8];
7474
7529
  case 7:
7475
- err_59 = _f.sent();
7476
- console.log("perpClient migrateStake error:: ", err_59);
7530
+ err_60 = _f.sent();
7531
+ console.log("perpClient migrateStake error:: ", err_60);
7477
7532
  return [3, 8];
7478
7533
  case 8: return [2, {
7479
7534
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
@@ -7484,7 +7539,7 @@ var PerpetualsClient = (function () {
7484
7539
  });
7485
7540
  };
7486
7541
  this.migrateFlp = function (amount, rewardTokenMint, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7487
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, lpTokenMint, compoundingTokenMint, compoudingTokenAccount, flpStakeAccount, poolStakedLpVault, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, migrateFlp, err_60;
7542
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, lpTokenMint, compoundingTokenMint, compoudingTokenAccount, flpStakeAccount, poolStakedLpVault, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, migrateFlp, err_61;
7488
7543
  return __generator(this, function (_d) {
7489
7544
  switch (_d.label) {
7490
7545
  case 0:
@@ -7556,8 +7611,8 @@ var PerpetualsClient = (function () {
7556
7611
  instructions.push(migrateFlp);
7557
7612
  return [3, 4];
7558
7613
  case 3:
7559
- err_60 = _d.sent();
7560
- console.log("perpClient migrateFlp error:: ", err_60);
7614
+ err_61 = _d.sent();
7615
+ console.log("perpClient migrateFlp error:: ", err_61);
7561
7616
  return [3, 4];
7562
7617
  case 4: return [2, {
7563
7618
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
@@ -7569,7 +7624,7 @@ var PerpetualsClient = (function () {
7569
7624
  this.compoundingFee = function (poolConfig, rewardTokenSymbol) {
7570
7625
  if (rewardTokenSymbol === void 0) { rewardTokenSymbol = 'USDC'; }
7571
7626
  return __awaiter(_this, void 0, void 0, function () {
7572
- var instructions, additionalSigners, rewardCustody, lpTokenMint, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, compoundingFee, err_61;
7627
+ var instructions, additionalSigners, rewardCustody, lpTokenMint, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, compoundingFee, err_62;
7573
7628
  return __generator(this, function (_d) {
7574
7629
  switch (_d.label) {
7575
7630
  case 0:
@@ -7626,8 +7681,8 @@ var PerpetualsClient = (function () {
7626
7681
  instructions.push(compoundingFee);
7627
7682
  return [3, 4];
7628
7683
  case 3:
7629
- err_61 = _d.sent();
7630
- console.log("perpClient compoundingFee error:: ", err_61);
7684
+ err_62 = _d.sent();
7685
+ console.log("perpClient compoundingFee error:: ", err_62);
7631
7686
  return [3, 4];
7632
7687
  case 4: return [2, {
7633
7688
  instructions: __spreadArray([], instructions, true),
@@ -7638,7 +7693,7 @@ var PerpetualsClient = (function () {
7638
7693
  });
7639
7694
  };
7640
7695
  this.renameFlp = function (flag, lpTokenName, lpTokenSymbol, lpTokenUri, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7641
- var publicKey, instructions, additionalSigners, lpTokenMint, lpMetadataAccount, renameFlp, err_62;
7696
+ var publicKey, instructions, additionalSigners, lpTokenMint, lpMetadataAccount, renameFlp, err_63;
7642
7697
  return __generator(this, function (_a) {
7643
7698
  switch (_a.label) {
7644
7699
  case 0:
@@ -7676,8 +7731,8 @@ var PerpetualsClient = (function () {
7676
7731
  instructions.push(renameFlp);
7677
7732
  return [3, 4];
7678
7733
  case 3:
7679
- err_62 = _a.sent();
7680
- console.log("perpClient renameFlp error:: ", err_62);
7734
+ err_63 = _a.sent();
7735
+ console.log("perpClient renameFlp error:: ", err_63);
7681
7736
  return [3, 4];
7682
7737
  case 4: return [2, {
7683
7738
  instructions: __spreadArray([], instructions, true),