flash-sdk 2.40.20 → 2.40.22

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.
@@ -1973,6 +1973,17 @@ var PerpetualsClient = (function () {
1973
1973
  return { discountBn: perpetualsAccount.tradingDiscount[nftTradingAccount.level - 1] };
1974
1974
  }
1975
1975
  };
1976
+ this.getFeeDiscount = function (perpetualsAccount, tokenStakeAccount, currentTime) {
1977
+ if (tokenStakeAccount.level === 0) {
1978
+ return { discountBn: constants_1.BN_ZERO };
1979
+ }
1980
+ else if (currentTime.sub(tokenStakeAccount.tradeTimestamp).lt(constants_1.DAY_SECONDS) && (new anchor_1.BN(tokenStakeAccount.tradeCounter)).gt(new anchor_1.BN(perpetualsAccount.tradeLimit))) {
1981
+ return { discountBn: constants_1.BN_ZERO };
1982
+ }
1983
+ else {
1984
+ return { discountBn: perpetualsAccount.tradingDiscount[tokenStakeAccount.level - 1] };
1985
+ }
1986
+ };
1976
1987
  this.getIndexPriceAtParticularTime = function (poolConfig, targetPricesAtT1Ui, targetPricesAtT2Ui, tokenRatiosAtT2BN) {
1977
1988
  var custodyTokens = poolConfig.custodies;
1978
1989
  var finalIndexPriceAtT1 = new bignumber_js_1.default(0);
@@ -5492,8 +5503,143 @@ var PerpetualsClient = (function () {
5492
5503
  }
5493
5504
  });
5494
5505
  }); };
5506
+ this.distributeTokenReward = function (amount, epochCount, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5507
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, fundingTokenAccount, distributeTokenRewardInstruction, err_31;
5508
+ return __generator(this, function (_a) {
5509
+ switch (_a.label) {
5510
+ case 0:
5511
+ publicKey = this.provider.wallet.publicKey;
5512
+ preInstructions = [];
5513
+ instructions = [];
5514
+ postInstructions = [];
5515
+ additionalSigners = [];
5516
+ _a.label = 1;
5517
+ case 1:
5518
+ _a.trys.push([1, 3, , 4]);
5519
+ fundingTokenAccount = (0, spl_token_1.getAssociatedTokenAddressSync)(poolConfig.tokenMint, publicKey, true);
5520
+ return [4, this.program.methods
5521
+ .distributeTokenReward({
5522
+ amount: amount,
5523
+ epochCount: epochCount,
5524
+ })
5525
+ .accounts({
5526
+ admin: publicKey,
5527
+ multisig: this.multisig.publicKey,
5528
+ perpetuals: this.perpetuals.publicKey,
5529
+ transferAuthority: poolConfig.transferAuthority,
5530
+ fundingTokenAccount: fundingTokenAccount,
5531
+ tokenVault: poolConfig.tokenVault,
5532
+ tokenVaultTokenAccount: poolConfig.tokenVaultTokenAccount,
5533
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
5534
+ eventAuthority: this.eventAuthority.publicKey,
5535
+ program: this.programId
5536
+ })
5537
+ .instruction()];
5538
+ case 2:
5539
+ distributeTokenRewardInstruction = _a.sent();
5540
+ instructions.push(distributeTokenRewardInstruction);
5541
+ return [3, 4];
5542
+ case 3:
5543
+ err_31 = _a.sent();
5544
+ console.log("perpClient distributeTokenRewardInstruction error:: ", err_31);
5545
+ throw err_31;
5546
+ case 4: return [2, {
5547
+ instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5548
+ additionalSigners: additionalSigners
5549
+ }];
5550
+ }
5551
+ });
5552
+ }); };
5553
+ this.setTokenReward = function (owner, amount, epochCount, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5554
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, setTokenRewardInstruction, err_32;
5555
+ return __generator(this, function (_a) {
5556
+ switch (_a.label) {
5557
+ case 0:
5558
+ publicKey = this.provider.wallet.publicKey;
5559
+ preInstructions = [];
5560
+ instructions = [];
5561
+ postInstructions = [];
5562
+ additionalSigners = [];
5563
+ _a.label = 1;
5564
+ case 1:
5565
+ _a.trys.push([1, 3, , 4]);
5566
+ tokenStakeAccount = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("token_stake"), owner.toBuffer()], this.programId)[0];
5567
+ return [4, this.program.methods
5568
+ .setTokenReward({
5569
+ amount: amount,
5570
+ epochCount: epochCount,
5571
+ })
5572
+ .accounts({
5573
+ admin: publicKey,
5574
+ multisig: this.multisig.publicKey,
5575
+ tokenVault: poolConfig.tokenVault,
5576
+ tokenStakeAccount: tokenStakeAccount,
5577
+ eventAuthority: this.eventAuthority.publicKey,
5578
+ program: this.programId
5579
+ })
5580
+ .instruction()];
5581
+ case 2:
5582
+ setTokenRewardInstruction = _a.sent();
5583
+ instructions.push(setTokenRewardInstruction);
5584
+ return [3, 4];
5585
+ case 3:
5586
+ err_32 = _a.sent();
5587
+ console.log("perpClient setTokenRewardInstruction error:: ", err_32);
5588
+ throw err_32;
5589
+ case 4: return [2, {
5590
+ instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5591
+ additionalSigners: additionalSigners
5592
+ }];
5593
+ }
5594
+ });
5595
+ }); };
5596
+ this.collectTokenReward = function (owner, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5597
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, userTokenAccount, collectTokenRewardInstruction, err_33;
5598
+ return __generator(this, function (_a) {
5599
+ switch (_a.label) {
5600
+ case 0:
5601
+ publicKey = this.provider.wallet.publicKey;
5602
+ preInstructions = [];
5603
+ instructions = [];
5604
+ postInstructions = [];
5605
+ additionalSigners = [];
5606
+ _a.label = 1;
5607
+ case 1:
5608
+ _a.trys.push([1, 3, , 4]);
5609
+ tokenStakeAccount = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("token_stake"), owner.toBuffer()], this.programId)[0];
5610
+ userTokenAccount = (0, spl_token_1.getAssociatedTokenAddressSync)(poolConfig.tokenMint, owner, true);
5611
+ return [4, this.program.methods
5612
+ .collectTokenReward({})
5613
+ .accounts({
5614
+ owner: owner,
5615
+ receivingTokenAccount: userTokenAccount,
5616
+ perpetuals: this.perpetuals.publicKey,
5617
+ transferAuthority: poolConfig.transferAuthority,
5618
+ tokenVault: poolConfig.tokenVault,
5619
+ tokenVaultTokenAccount: poolConfig.tokenVaultTokenAccount,
5620
+ tokenStakeAccount: tokenStakeAccount,
5621
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
5622
+ eventAuthority: this.eventAuthority.publicKey,
5623
+ program: this.programId
5624
+ })
5625
+ .instruction()];
5626
+ case 2:
5627
+ collectTokenRewardInstruction = _a.sent();
5628
+ instructions.push(collectTokenRewardInstruction);
5629
+ return [3, 4];
5630
+ case 3:
5631
+ err_33 = _a.sent();
5632
+ console.log("perpClient collectTokenRewardInstruction error:: ", err_33);
5633
+ throw err_33;
5634
+ case 4: return [2, {
5635
+ instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5636
+ additionalSigners: additionalSigners
5637
+ }];
5638
+ }
5639
+ });
5640
+ }); };
5495
5641
  this.initRewardVault = function (nftCount, rewardSymbol, collectionMint, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5496
- var publicKey, rewardCustodyMint, instructions, additionalSigners, fbNftProgramData, rewardVault, rewardTokenAccount, nftTransferAuthority, initRewardVault, err_31;
5642
+ var publicKey, rewardCustodyMint, instructions, additionalSigners, fbNftProgramData, rewardVault, rewardTokenAccount, nftTransferAuthority, initRewardVault, err_34;
5497
5643
  return __generator(this, function (_a) {
5498
5644
  switch (_a.label) {
5499
5645
  case 0:
@@ -5530,9 +5676,9 @@ var PerpetualsClient = (function () {
5530
5676
  instructions.push(initRewardVault);
5531
5677
  return [3, 4];
5532
5678
  case 3:
5533
- err_31 = _a.sent();
5534
- console.log("perpClient InitRewardVault error:: ", err_31);
5535
- throw err_31;
5679
+ err_34 = _a.sent();
5680
+ console.log("perpClient InitRewardVault error:: ", err_34);
5681
+ throw err_34;
5536
5682
  case 4: return [2, {
5537
5683
  instructions: __spreadArray([], instructions, true),
5538
5684
  additionalSigners: additionalSigners
@@ -5541,7 +5687,7 @@ var PerpetualsClient = (function () {
5541
5687
  });
5542
5688
  }); };
5543
5689
  this.distributeReward = function (rewardAmount, rewardSymbol, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5544
- var publicKey, rewardCustodyMint, instructions, additionalSigners, fundingAccount, rewardVault, rewardTokenAccount, distributeReward, err_32;
5690
+ var publicKey, rewardCustodyMint, instructions, additionalSigners, fundingAccount, rewardVault, rewardTokenAccount, distributeReward, err_35;
5545
5691
  return __generator(this, function (_a) {
5546
5692
  switch (_a.label) {
5547
5693
  case 0:
@@ -5572,9 +5718,9 @@ var PerpetualsClient = (function () {
5572
5718
  instructions.push(distributeReward);
5573
5719
  return [3, 4];
5574
5720
  case 3:
5575
- err_32 = _a.sent();
5576
- console.log("perpClient distributeReward error:: ", err_32);
5577
- throw err_32;
5721
+ err_35 = _a.sent();
5722
+ console.log("perpClient distributeReward error:: ", err_35);
5723
+ throw err_35;
5578
5724
  case 4: return [2, {
5579
5725
  instructions: __spreadArray([], instructions, true),
5580
5726
  additionalSigners: additionalSigners
@@ -5585,7 +5731,7 @@ var PerpetualsClient = (function () {
5585
5731
  this.collectNftReward = function (rewardSymbol, poolConfig, nftMint, createUserATA) {
5586
5732
  if (createUserATA === void 0) { createUserATA = true; }
5587
5733
  return __awaiter(_this, void 0, void 0, function () {
5588
- var publicKey, rewardCustodyMint, instructions, additionalSigners, nftTokenAccount, metadataAccount, receivingTokenAccount, _a, rewardRecord, rewardVault, rewardTokenAccount, nftTransferAuthority, collectNftReward, err_33;
5734
+ var publicKey, rewardCustodyMint, instructions, additionalSigners, nftTokenAccount, metadataAccount, receivingTokenAccount, _a, rewardRecord, rewardVault, rewardTokenAccount, nftTransferAuthority, collectNftReward, err_36;
5589
5735
  return __generator(this, function (_b) {
5590
5736
  switch (_b.label) {
5591
5737
  case 0:
@@ -5635,8 +5781,8 @@ var PerpetualsClient = (function () {
5635
5781
  instructions.push(collectNftReward);
5636
5782
  return [3, 6];
5637
5783
  case 5:
5638
- err_33 = _b.sent();
5639
- throw err_33;
5784
+ err_36 = _b.sent();
5785
+ throw err_36;
5640
5786
  case 6: return [2, {
5641
5787
  instructions: __spreadArray([], instructions, true),
5642
5788
  additionalSigners: additionalSigners
@@ -5648,7 +5794,7 @@ var PerpetualsClient = (function () {
5648
5794
  this.collectAndDistributeFee = function (rewardSymbol, poolConfig, createUserATA, nftTradingAccount) {
5649
5795
  if (createUserATA === void 0) { createUserATA = true; }
5650
5796
  return __awaiter(_this, void 0, void 0, function () {
5651
- var publicKey, rewardCustodyMint, rewardCustodyConfig, preInstructions, instructions, postInstructions, additionalSigners, pool, flpStakeAccount, receivingTokenAccount, _a, tradingAccount, rewardVault, rewardTokenAccount, withdrawStakeInstruction, err_34;
5797
+ var publicKey, rewardCustodyMint, rewardCustodyConfig, preInstructions, instructions, postInstructions, additionalSigners, pool, flpStakeAccount, receivingTokenAccount, _a, tradingAccount, rewardVault, rewardTokenAccount, withdrawStakeInstruction, err_37;
5652
5798
  return __generator(this, function (_b) {
5653
5799
  switch (_b.label) {
5654
5800
  case 0:
@@ -5712,9 +5858,9 @@ var PerpetualsClient = (function () {
5712
5858
  instructions.push(withdrawStakeInstruction);
5713
5859
  return [3, 6];
5714
5860
  case 5:
5715
- err_34 = _b.sent();
5716
- console.log("perpClient withdrawStake error:: ", err_34);
5717
- throw err_34;
5861
+ err_37 = _b.sent();
5862
+ console.log("perpClient withdrawStake error:: ", err_37);
5863
+ throw err_37;
5718
5864
  case 6: return [2, {
5719
5865
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5720
5866
  additionalSigners: additionalSigners
@@ -5724,7 +5870,7 @@ var PerpetualsClient = (function () {
5724
5870
  });
5725
5871
  };
5726
5872
  this.setTriggerPrice = function (targetSymbol, collateralSymbol, side, triggerPrice, isStopLoss, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
5727
- var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, positionAccount, instructions, additionalSigners, setTriggerPrice, err_35;
5873
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, positionAccount, instructions, additionalSigners, setTriggerPrice, err_38;
5728
5874
  return __generator(this, function (_a) {
5729
5875
  switch (_a.label) {
5730
5876
  case 0:
@@ -5763,9 +5909,9 @@ var PerpetualsClient = (function () {
5763
5909
  instructions.push(setTriggerPrice);
5764
5910
  return [3, 4];
5765
5911
  case 3:
5766
- err_35 = _a.sent();
5767
- console.log("perpClient setTriggerPrice error:: ", err_35);
5768
- throw err_35;
5912
+ err_38 = _a.sent();
5913
+ console.log("perpClient setTriggerPrice error:: ", err_38);
5914
+ throw err_38;
5769
5915
  case 4: return [2, {
5770
5916
  instructions: __spreadArray([], instructions, true),
5771
5917
  additionalSigners: additionalSigners
@@ -5778,7 +5924,7 @@ var PerpetualsClient = (function () {
5778
5924
  if (closeUsersWSOLATA === void 0) { closeUsersWSOLATA = false; }
5779
5925
  if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
5780
5926
  return __awaiter(_this, void 0, void 0, function () {
5781
- var payerPubkey, targetCustodyConfig, collateralCustodyConfig, marketAccount, userReceivingTokenAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, forceClosePosition, closeWsolATAIns, err_36;
5927
+ var payerPubkey, targetCustodyConfig, collateralCustodyConfig, marketAccount, userReceivingTokenAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, forceClosePosition, closeWsolATAIns, err_39;
5782
5928
  return __generator(this, function (_b) {
5783
5929
  switch (_b.label) {
5784
5930
  case 0:
@@ -5839,9 +5985,9 @@ var PerpetualsClient = (function () {
5839
5985
  }
5840
5986
  return [3, 7];
5841
5987
  case 6:
5842
- err_36 = _b.sent();
5843
- console.log("perpClient forceClosePosition error:: ", err_36);
5844
- throw err_36;
5988
+ err_39 = _b.sent();
5989
+ console.log("perpClient forceClosePosition error:: ", err_39);
5990
+ throw err_39;
5845
5991
  case 7: return [2, {
5846
5992
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5847
5993
  additionalSigners: additionalSigners
@@ -5854,7 +6000,7 @@ var PerpetualsClient = (function () {
5854
6000
  if (skipBalanceChecks === void 0) { skipBalanceChecks = false; }
5855
6001
  if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
5856
6002
  return __awaiter(_this, void 0, void 0, function () {
5857
- var publicKey, targetCustodyConfig, reserveCustodyConfig, collateralCustodyConfig, marketAccount, userReserveTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, accCreationLamports, lamports, unWrappedSolBalance, _a, tokenAccountBalance, _b, positionAccount, orderAccount, placeLimitOrder, err_37;
6003
+ var publicKey, targetCustodyConfig, reserveCustodyConfig, collateralCustodyConfig, marketAccount, userReserveTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, accCreationLamports, lamports, unWrappedSolBalance, _a, tokenAccountBalance, _b, positionAccount, orderAccount, placeLimitOrder, err_40;
5858
6004
  return __generator(this, function (_c) {
5859
6005
  switch (_c.label) {
5860
6006
  case 0:
@@ -5958,9 +6104,9 @@ var PerpetualsClient = (function () {
5958
6104
  instructions.push(placeLimitOrder);
5959
6105
  return [3, 11];
5960
6106
  case 10:
5961
- err_37 = _c.sent();
5962
- console.log("perpClient placeLimitOrder error:: ", err_37);
5963
- throw err_37;
6107
+ err_40 = _c.sent();
6108
+ console.log("perpClient placeLimitOrder error:: ", err_40);
6109
+ throw err_40;
5964
6110
  case 11: return [2, {
5965
6111
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
5966
6112
  additionalSigners: additionalSigners
@@ -5973,7 +6119,7 @@ var PerpetualsClient = (function () {
5973
6119
  if (createUserATA === void 0) { createUserATA = true; }
5974
6120
  if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
5975
6121
  return __awaiter(_this, void 0, void 0, function () {
5976
- var publicKey, targetCustodyConfig, reserveCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, wrappedSolAccount, userReceivingTokenAccount, lamports, _a, positionAccount, orderAccount, editLimitOrder, err_38;
6122
+ var publicKey, targetCustodyConfig, reserveCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, wrappedSolAccount, userReceivingTokenAccount, lamports, _a, positionAccount, orderAccount, editLimitOrder, err_41;
5977
6123
  return __generator(this, function (_b) {
5978
6124
  switch (_b.label) {
5979
6125
  case 0:
@@ -6060,9 +6206,9 @@ var PerpetualsClient = (function () {
6060
6206
  instructions.push(editLimitOrder);
6061
6207
  return [3, 8];
6062
6208
  case 7:
6063
- err_38 = _b.sent();
6064
- console.log("perpClient editLimitOrder error:: ", err_38);
6065
- throw err_38;
6209
+ err_41 = _b.sent();
6210
+ console.log("perpClient editLimitOrder error:: ", err_41);
6211
+ throw err_41;
6066
6212
  case 8: return [2, {
6067
6213
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6068
6214
  additionalSigners: additionalSigners
@@ -6076,7 +6222,7 @@ var PerpetualsClient = (function () {
6076
6222
  if (userReferralAccount === void 0) { userReferralAccount = web3_js_1.PublicKey.default; }
6077
6223
  if (rebateTokenAccount === void 0) { rebateTokenAccount = web3_js_1.PublicKey.default; }
6078
6224
  return __awaiter(_this, void 0, void 0, function () {
6079
- var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, executeLimitOrder, err_39;
6225
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, executeLimitOrder, err_42;
6080
6226
  return __generator(this, function (_a) {
6081
6227
  switch (_a.label) {
6082
6228
  case 0:
@@ -6125,9 +6271,9 @@ var PerpetualsClient = (function () {
6125
6271
  instructions.push(executeLimitOrder);
6126
6272
  return [3, 4];
6127
6273
  case 3:
6128
- err_39 = _a.sent();
6129
- console.log("perpClient executeLimitOrder error:: ", err_39);
6130
- throw err_39;
6274
+ err_42 = _a.sent();
6275
+ console.log("perpClient executeLimitOrder error:: ", err_42);
6276
+ throw err_42;
6131
6277
  case 4: return [2, {
6132
6278
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6133
6279
  additionalSigners: additionalSigners
@@ -6141,7 +6287,7 @@ var PerpetualsClient = (function () {
6141
6287
  if (userReferralAccount === void 0) { userReferralAccount = web3_js_1.PublicKey.default; }
6142
6288
  if (rebateTokenAccount === void 0) { rebateTokenAccount = web3_js_1.PublicKey.default; }
6143
6289
  return __awaiter(_this, void 0, void 0, function () {
6144
- var publicKey, targetCustodyConfig, collateralCustodyConfig, reserveCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, executeLimitWithSwap, err_40;
6290
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, reserveCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, executeLimitWithSwap, err_43;
6145
6291
  return __generator(this, function (_a) {
6146
6292
  switch (_a.label) {
6147
6293
  case 0:
@@ -6193,9 +6339,9 @@ var PerpetualsClient = (function () {
6193
6339
  instructions.push(executeLimitWithSwap);
6194
6340
  return [3, 4];
6195
6341
  case 3:
6196
- err_40 = _a.sent();
6197
- console.log("perpClient executeLimitWithSwap error:: ", err_40);
6198
- throw err_40;
6342
+ err_43 = _a.sent();
6343
+ console.log("perpClient executeLimitWithSwap error:: ", err_43);
6344
+ throw err_43;
6199
6345
  case 4: return [2, {
6200
6346
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6201
6347
  additionalSigners: additionalSigners
@@ -6205,7 +6351,7 @@ var PerpetualsClient = (function () {
6205
6351
  });
6206
6352
  };
6207
6353
  this.placeTriggerOrder = function (targetSymbol, collateralSymbol, side, triggerPrice, deltaSizeAmount, isStopLoss, receiveCustodyId, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6208
- var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, placeTriggerOrder, err_41;
6354
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, placeTriggerOrder, err_44;
6209
6355
  return __generator(this, function (_a) {
6210
6356
  switch (_a.label) {
6211
6357
  case 0:
@@ -6252,9 +6398,9 @@ var PerpetualsClient = (function () {
6252
6398
  instructions.push(placeTriggerOrder);
6253
6399
  return [3, 4];
6254
6400
  case 3:
6255
- err_41 = _a.sent();
6256
- console.log("perpClient placeTriggerOrder error:: ", err_41);
6257
- throw err_41;
6401
+ err_44 = _a.sent();
6402
+ console.log("perpClient placeTriggerOrder error:: ", err_44);
6403
+ throw err_44;
6258
6404
  case 4: return [2, {
6259
6405
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6260
6406
  additionalSigners: additionalSigners
@@ -6263,7 +6409,7 @@ var PerpetualsClient = (function () {
6263
6409
  });
6264
6410
  }); };
6265
6411
  this.editTriggerOrder = function (targetSymbol, collateralSymbol, side, orderId, triggerPrice, deltaSizeAmount, isStopLoss, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6266
- var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, editTriggerOrder, err_42;
6412
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, editTriggerOrder, err_45;
6267
6413
  return __generator(this, function (_a) {
6268
6414
  switch (_a.label) {
6269
6415
  case 0:
@@ -6308,9 +6454,9 @@ var PerpetualsClient = (function () {
6308
6454
  instructions.push(editTriggerOrder);
6309
6455
  return [3, 4];
6310
6456
  case 3:
6311
- err_42 = _a.sent();
6312
- console.log("perpClient editTriggerOrder error:: ", err_42);
6313
- throw err_42;
6457
+ err_45 = _a.sent();
6458
+ console.log("perpClient editTriggerOrder error:: ", err_45);
6459
+ throw err_45;
6314
6460
  case 4: return [2, {
6315
6461
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6316
6462
  additionalSigners: additionalSigners
@@ -6319,7 +6465,7 @@ var PerpetualsClient = (function () {
6319
6465
  });
6320
6466
  }); };
6321
6467
  this.cancelTriggerOrder = function (targetSymbol, collateralSymbol, side, orderId, isStopLoss, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6322
- var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, orderAccount, cancelTriggerOrder, err_43;
6468
+ var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, orderAccount, cancelTriggerOrder, err_46;
6323
6469
  return __generator(this, function (_a) {
6324
6470
  switch (_a.label) {
6325
6471
  case 0:
@@ -6352,9 +6498,9 @@ var PerpetualsClient = (function () {
6352
6498
  instructions.push(cancelTriggerOrder);
6353
6499
  return [3, 4];
6354
6500
  case 3:
6355
- err_43 = _a.sent();
6356
- console.log("perpClient cancelTriggerOrder error:: ", err_43);
6357
- throw err_43;
6501
+ err_46 = _a.sent();
6502
+ console.log("perpClient cancelTriggerOrder error:: ", err_46);
6503
+ throw err_46;
6358
6504
  case 4: return [2, {
6359
6505
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6360
6506
  additionalSigners: additionalSigners
@@ -6369,7 +6515,7 @@ var PerpetualsClient = (function () {
6369
6515
  if (userReferralAccount === void 0) { userReferralAccount = web3_js_1.PublicKey.default; }
6370
6516
  if (rebateTokenAccount === void 0) { rebateTokenAccount = web3_js_1.PublicKey.default; }
6371
6517
  return __awaiter(_this, void 0, void 0, function () {
6372
- var payerPubkey, targetCustodyConfig, collateralCustodyConfig, receivingCustodyConfig, marketAccount, userReceivingTokenAccount, userReceivingTokenAccountCollateral, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, _b, positionAccount, orderAccount, custodyAccountMetas, custodyOracleAccountMetas, _i, _c, custody, executeTriggerWithSwap, err_44;
6518
+ var payerPubkey, targetCustodyConfig, collateralCustodyConfig, receivingCustodyConfig, marketAccount, userReceivingTokenAccount, userReceivingTokenAccountCollateral, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, _b, positionAccount, orderAccount, custodyAccountMetas, custodyOracleAccountMetas, _i, _c, custody, executeTriggerWithSwap, err_47;
6373
6519
  return __generator(this, function (_d) {
6374
6520
  switch (_d.label) {
6375
6521
  case 0:
@@ -6466,9 +6612,9 @@ var PerpetualsClient = (function () {
6466
6612
  instructions.push(executeTriggerWithSwap);
6467
6613
  return [3, 10];
6468
6614
  case 9:
6469
- err_44 = _d.sent();
6470
- console.log("perpClient executeTriggerWithSwap error:: ", err_44);
6471
- throw err_44;
6615
+ err_47 = _d.sent();
6616
+ console.log("perpClient executeTriggerWithSwap error:: ", err_47);
6617
+ throw err_47;
6472
6618
  case 10: return [2, {
6473
6619
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6474
6620
  additionalSigners: additionalSigners
@@ -6484,7 +6630,7 @@ var PerpetualsClient = (function () {
6484
6630
  if (userReferralAccount === void 0) { userReferralAccount = web3_js_1.PublicKey.default; }
6485
6631
  if (rebateTokenAccount === void 0) { rebateTokenAccount = web3_js_1.PublicKey.default; }
6486
6632
  return __awaiter(_this, void 0, void 0, function () {
6487
- var payerPubkey, targetCustodyConfig, collateralCustodyConfig, marketAccount, userReceivingTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, positionAccount, orderAccount, executeTriggerOrder, err_45;
6633
+ var payerPubkey, targetCustodyConfig, collateralCustodyConfig, marketAccount, userReceivingTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, positionAccount, orderAccount, executeTriggerOrder, err_48;
6488
6634
  return __generator(this, function (_b) {
6489
6635
  switch (_b.label) {
6490
6636
  case 0:
@@ -6550,9 +6696,9 @@ var PerpetualsClient = (function () {
6550
6696
  instructions.push(executeTriggerOrder);
6551
6697
  return [3, 8];
6552
6698
  case 7:
6553
- err_45 = _b.sent();
6554
- console.log("perpClient executeTriggerOrder error:: ", err_45);
6555
- throw err_45;
6699
+ err_48 = _b.sent();
6700
+ console.log("perpClient executeTriggerOrder error:: ", err_48);
6701
+ throw err_48;
6556
6702
  case 8: return [2, {
6557
6703
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6558
6704
  additionalSigners: additionalSigners
@@ -6562,7 +6708,7 @@ var PerpetualsClient = (function () {
6562
6708
  });
6563
6709
  };
6564
6710
  this.migrateTriggerOrder = function (owner, marketAccount, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6565
- var payerPubkey, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, migrateTriggerOrder, err_46;
6711
+ var payerPubkey, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, migrateTriggerOrder, err_49;
6566
6712
  return __generator(this, function (_a) {
6567
6713
  switch (_a.label) {
6568
6714
  case 0:
@@ -6592,9 +6738,9 @@ var PerpetualsClient = (function () {
6592
6738
  instructions.push(migrateTriggerOrder);
6593
6739
  return [3, 4];
6594
6740
  case 3:
6595
- err_46 = _a.sent();
6596
- console.log("perpClient migrateTriggerOrder error:: ", err_46);
6597
- throw err_46;
6741
+ err_49 = _a.sent();
6742
+ console.log("perpClient migrateTriggerOrder error:: ", err_49);
6743
+ throw err_49;
6598
6744
  case 4: return [2, {
6599
6745
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6600
6746
  additionalSigners: additionalSigners
@@ -6603,7 +6749,7 @@ var PerpetualsClient = (function () {
6603
6749
  });
6604
6750
  }); };
6605
6751
  this.getPositionData = function (position, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6606
- var marketConfig, targetCustodyConfig, collateralCustodyConfig, getPositionData, err_47;
6752
+ var marketConfig, targetCustodyConfig, collateralCustodyConfig, getPositionData, err_50;
6607
6753
  return __generator(this, function (_a) {
6608
6754
  switch (_a.label) {
6609
6755
  case 0:
@@ -6632,15 +6778,15 @@ var PerpetualsClient = (function () {
6632
6778
  console.log(getPositionData);
6633
6779
  return [2, getPositionData];
6634
6780
  case 3:
6635
- err_47 = _a.sent();
6636
- console.log("perpClient setPool error:: ", err_47);
6637
- throw err_47;
6781
+ err_50 = _a.sent();
6782
+ console.log("perpClient setPool error:: ", err_50);
6783
+ throw err_50;
6638
6784
  case 4: return [2];
6639
6785
  }
6640
6786
  });
6641
6787
  }); };
6642
6788
  this.protocolWithdrawFees = function (rewardSymbol, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6643
- var publicKey, custodyConfig, receivingTokenAccount, instructions, additionalSigners, withdrawFeesIx, err_48;
6789
+ var publicKey, custodyConfig, receivingTokenAccount, instructions, additionalSigners, withdrawFeesIx, err_51;
6644
6790
  return __generator(this, function (_a) {
6645
6791
  switch (_a.label) {
6646
6792
  case 0:
@@ -6673,9 +6819,9 @@ var PerpetualsClient = (function () {
6673
6819
  instructions.push(withdrawFeesIx);
6674
6820
  return [3, 5];
6675
6821
  case 4:
6676
- err_48 = _a.sent();
6677
- console.log("perpClient setPool error:: ", err_48);
6678
- throw err_48;
6822
+ err_51 = _a.sent();
6823
+ console.log("perpClient setPool error:: ", err_51);
6824
+ throw err_51;
6679
6825
  case 5: return [2, {
6680
6826
  instructions: __spreadArray([], instructions, true),
6681
6827
  additionalSigners: additionalSigners
@@ -6684,7 +6830,7 @@ var PerpetualsClient = (function () {
6684
6830
  });
6685
6831
  }); };
6686
6832
  this.setPermissions = function (permissions) { return __awaiter(_this, void 0, void 0, function () {
6687
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setPermissionsInstruction, err_49;
6833
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setPermissionsInstruction, err_52;
6688
6834
  return __generator(this, function (_a) {
6689
6835
  switch (_a.label) {
6690
6836
  case 0:
@@ -6711,9 +6857,9 @@ var PerpetualsClient = (function () {
6711
6857
  instructions.push(setPermissionsInstruction);
6712
6858
  return [3, 4];
6713
6859
  case 3:
6714
- err_49 = _a.sent();
6715
- console.log("perpClient setPool error:: ", err_49);
6716
- throw err_49;
6860
+ err_52 = _a.sent();
6861
+ console.log("perpClient setPool error:: ", err_52);
6862
+ throw err_52;
6717
6863
  case 4: return [2, {
6718
6864
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
6719
6865
  additionalSigners: additionalSigners
@@ -6722,7 +6868,7 @@ var PerpetualsClient = (function () {
6722
6868
  });
6723
6869
  }); };
6724
6870
  this.reimburse = function (tokenMint, amountIn, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6725
- var custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, instructions, additionalSigners, custodyConfig, reimburse, _d, _e, err_50;
6871
+ var custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, instructions, additionalSigners, custodyConfig, reimburse, _d, _e, err_53;
6726
6872
  var _f;
6727
6873
  return __generator(this, function (_g) {
6728
6874
  switch (_g.label) {
@@ -6782,9 +6928,9 @@ var PerpetualsClient = (function () {
6782
6928
  instructions.push(reimburse);
6783
6929
  return [3, 5];
6784
6930
  case 4:
6785
- err_50 = _g.sent();
6786
- console.log("perpClient setPool error:: ", err_50);
6787
- throw err_50;
6931
+ err_53 = _g.sent();
6932
+ console.log("perpClient setPool error:: ", err_53);
6933
+ throw err_53;
6788
6934
  case 5: return [2, {
6789
6935
  instructions: __spreadArray([], instructions, true),
6790
6936
  additionalSigners: additionalSigners
@@ -6793,7 +6939,7 @@ var PerpetualsClient = (function () {
6793
6939
  });
6794
6940
  }); };
6795
6941
  this.setInternalOraclePrice = function (tokenMint, price, expo, conf, ema, publishTime, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
6796
- var instructions, additionalSigners, custodyConfig, setInternalOraclePrice, err_51;
6942
+ var instructions, additionalSigners, custodyConfig, setInternalOraclePrice, err_54;
6797
6943
  return __generator(this, function (_a) {
6798
6944
  switch (_a.label) {
6799
6945
  case 0:
@@ -6826,9 +6972,9 @@ var PerpetualsClient = (function () {
6826
6972
  instructions.push(setInternalOraclePrice);
6827
6973
  return [3, 4];
6828
6974
  case 3:
6829
- err_51 = _a.sent();
6830
- console.log("perpClient setInternalOracleAccount error:: ", err_51);
6831
- throw err_51;
6975
+ err_54 = _a.sent();
6976
+ console.log("perpClient setInternalOracleAccount error:: ", err_54);
6977
+ throw err_54;
6832
6978
  case 4: return [2, {
6833
6979
  instructions: __spreadArray([], instructions, true),
6834
6980
  additionalSigners: additionalSigners
@@ -6840,7 +6986,7 @@ var PerpetualsClient = (function () {
6840
6986
  if (skipBalanceChecks === void 0) { skipBalanceChecks = false; }
6841
6987
  if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
6842
6988
  return __awaiter(_this, void 0, void 0, function () {
6843
- 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_52;
6989
+ 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_55;
6844
6990
  return __generator(this, function (_e) {
6845
6991
  switch (_e.label) {
6846
6992
  case 0:
@@ -6963,8 +7109,8 @@ var PerpetualsClient = (function () {
6963
7109
  instructions.push(addCompoundingLiquidity);
6964
7110
  return [3, 10];
6965
7111
  case 9:
6966
- err_52 = _e.sent();
6967
- console.log("perpClient addCompoundingLiquidity error:: ", err_52);
7112
+ err_55 = _e.sent();
7113
+ console.log("perpClient addCompoundingLiquidity error:: ", err_55);
6968
7114
  return [3, 10];
6969
7115
  case 10: return [2, {
6970
7116
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
@@ -6978,7 +7124,7 @@ var PerpetualsClient = (function () {
6978
7124
  if (createUserATA === void 0) { createUserATA = true; }
6979
7125
  if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
6980
7126
  return __awaiter(_this, void 0, void 0, function () {
6981
- 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_53;
7127
+ 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_56;
6982
7128
  return __generator(this, function (_e) {
6983
7129
  switch (_e.label) {
6984
7130
  case 0:
@@ -7085,8 +7231,8 @@ var PerpetualsClient = (function () {
7085
7231
  instructions.push(removeCompoundingLiquidity);
7086
7232
  return [3, 8];
7087
7233
  case 7:
7088
- err_53 = _e.sent();
7089
- console.log("perpClient removeCompoundingLiquidity error:: ", err_53);
7234
+ err_56 = _e.sent();
7235
+ console.log("perpClient removeCompoundingLiquidity error:: ", err_56);
7090
7236
  return [3, 8];
7091
7237
  case 8: return [2, {
7092
7238
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
@@ -7099,7 +7245,7 @@ var PerpetualsClient = (function () {
7099
7245
  this.migrateStake = function (amount, rewardTokenMint, poolConfig, createUserATA) {
7100
7246
  if (createUserATA === void 0) { createUserATA = true; }
7101
7247
  return __awaiter(_this, void 0, void 0, function () {
7102
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, lpTokenMint, compoundingTokenMint, compoudingTokenAccount, _a, flpStakeAccount, poolStakedLpVault, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _b, custody, _c, _d, market, migrateStake, err_54;
7248
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, lpTokenMint, compoundingTokenMint, compoudingTokenAccount, _a, flpStakeAccount, poolStakedLpVault, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _b, custody, _c, _d, market, migrateStake, err_57;
7103
7249
  return __generator(this, function (_e) {
7104
7250
  switch (_e.label) {
7105
7251
  case 0:
@@ -7180,8 +7326,8 @@ var PerpetualsClient = (function () {
7180
7326
  instructions.push(migrateStake);
7181
7327
  return [3, 6];
7182
7328
  case 5:
7183
- err_54 = _e.sent();
7184
- console.log("perpClient migrateStake error:: ", err_54);
7329
+ err_57 = _e.sent();
7330
+ console.log("perpClient migrateStake error:: ", err_57);
7185
7331
  return [3, 6];
7186
7332
  case 6: return [2, {
7187
7333
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
@@ -7192,7 +7338,7 @@ var PerpetualsClient = (function () {
7192
7338
  });
7193
7339
  };
7194
7340
  this.migrateFlp = function (amount, rewardTokenMint, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7195
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, lpTokenMint, compoundingTokenMint, compoudingTokenAccount, flpStakeAccount, poolStakedLpVault, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, migrateFlp, err_55;
7341
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, lpTokenMint, compoundingTokenMint, compoudingTokenAccount, flpStakeAccount, poolStakedLpVault, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, migrateFlp, err_58;
7196
7342
  return __generator(this, function (_d) {
7197
7343
  switch (_d.label) {
7198
7344
  case 0:
@@ -7264,8 +7410,8 @@ var PerpetualsClient = (function () {
7264
7410
  instructions.push(migrateFlp);
7265
7411
  return [3, 4];
7266
7412
  case 3:
7267
- err_55 = _d.sent();
7268
- console.log("perpClient migrateFlp error:: ", err_55);
7413
+ err_58 = _d.sent();
7414
+ console.log("perpClient migrateFlp error:: ", err_58);
7269
7415
  return [3, 4];
7270
7416
  case 4: return [2, {
7271
7417
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
@@ -7277,7 +7423,7 @@ var PerpetualsClient = (function () {
7277
7423
  this.compoundingFee = function (poolConfig, rewardTokenSymbol) {
7278
7424
  if (rewardTokenSymbol === void 0) { rewardTokenSymbol = 'USDC'; }
7279
7425
  return __awaiter(_this, void 0, void 0, function () {
7280
- var instructions, additionalSigners, rewardCustody, lpTokenMint, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, compoundingFee, err_56;
7426
+ var instructions, additionalSigners, rewardCustody, lpTokenMint, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, compoundingFee, err_59;
7281
7427
  return __generator(this, function (_d) {
7282
7428
  switch (_d.label) {
7283
7429
  case 0:
@@ -7334,8 +7480,8 @@ var PerpetualsClient = (function () {
7334
7480
  instructions.push(compoundingFee);
7335
7481
  return [3, 4];
7336
7482
  case 3:
7337
- err_56 = _d.sent();
7338
- console.log("perpClient compoundingFee error:: ", err_56);
7483
+ err_59 = _d.sent();
7484
+ console.log("perpClient compoundingFee error:: ", err_59);
7339
7485
  return [3, 4];
7340
7486
  case 4: return [2, {
7341
7487
  instructions: __spreadArray([], instructions, true),
@@ -7346,7 +7492,7 @@ var PerpetualsClient = (function () {
7346
7492
  });
7347
7493
  };
7348
7494
  this.renameFlp = function (flag, lpTokenName, lpTokenSymbol, lpTokenUri, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7349
- var publicKey, instructions, additionalSigners, lpTokenMint, lpMetadataAccount, renameFlp, err_57;
7495
+ var publicKey, instructions, additionalSigners, lpTokenMint, lpMetadataAccount, renameFlp, err_60;
7350
7496
  return __generator(this, function (_a) {
7351
7497
  switch (_a.label) {
7352
7498
  case 0:
@@ -7384,8 +7530,8 @@ var PerpetualsClient = (function () {
7384
7530
  instructions.push(renameFlp);
7385
7531
  return [3, 4];
7386
7532
  case 3:
7387
- err_57 = _a.sent();
7388
- console.log("perpClient renameFlp error:: ", err_57);
7533
+ err_60 = _a.sent();
7534
+ console.log("perpClient renameFlp error:: ", err_60);
7389
7535
  return [3, 4];
7390
7536
  case 4: return [2, {
7391
7537
  instructions: __spreadArray([], instructions, true),