flash-sdk 2.49.0-alpha.3 → 2.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ import { Program, AnchorProvider, BN } from "@coral-xyz/anchor";
3
3
  import { PublicKey, TransactionInstruction, Commitment, Signer, AddressLookupTableAccount, VersionedTransaction } from "@solana/web3.js";
4
4
  import { PoolAccount } from "./PoolAccount";
5
5
  import { PositionAccount } from "./PositionAccount";
6
- import { AddLiquidityAmountAndFee, InternalPrice, BorrowRateParams, ExitPriceAndFee, Fees, OracleParams, Permissions, PricingParams, RemoveCollateralData, RemoveLiquidityAmountAndFee, Side, TokenRatios, MinAndMaxPrice, FeesAction, ContractOraclePrice, Privilege, PerpetualsAccount, Trading, EntryPriceAndFeeV2, EntryPriceAndFee, TokenPermissions, TokenStake, InternalEmaPrice } from "./types";
6
+ import { AddLiquidityAmountAndFee, BorrowRateParams, ExitPriceAndFee, Fees, OracleParams, Permissions, PricingParams, RemoveCollateralData, RemoveLiquidityAmountAndFee, Side, TokenRatios, MinAndMaxPrice, FeesAction, ContractOraclePrice, Privilege, PerpetualsAccount, Trading, EntryPriceAndFeeV2, EntryPriceAndFee, TokenPermissions, TokenStake } from "./types";
7
7
  import { OraclePrice } from "./OraclePrice";
8
8
  import { CustodyAccount } from "./CustodyAccount";
9
9
  import { Perpetuals } from "./idl/perpetuals";
@@ -4631,7 +4631,7 @@ export declare class PerpetualsClient {
4631
4631
  }>;
4632
4632
  refreshStakeWithAllFlpStakeAccounts: (rewardSymbol: string, poolConfig: PoolConfig, flpStakeAccountPks: PublicKey[]) => Promise<TransactionInstruction>;
4633
4633
  refreshStakeWithTokenStake: (rewardSymbol: string, poolConfig: PoolConfig, flpStakeAccountPk: PublicKey, userPublicKey?: PublicKey | undefined) => Promise<TransactionInstruction>;
4634
- unstakeInstant: (rewardSymbol: string, unstakeAmount: BN, poolConfig: PoolConfig) => Promise<{
4634
+ unstakeInstant: (rewardSymbol: string, unstakeAmount: BN, poolConfig: PoolConfig, userPublicKey?: PublicKey | undefined) => Promise<{
4635
4635
  instructions: TransactionInstruction[];
4636
4636
  additionalSigners: Signer[];
4637
4637
  }>;
@@ -4640,7 +4640,7 @@ export declare class PerpetualsClient {
4640
4640
  instructions: TransactionInstruction[];
4641
4641
  additionalSigners: Signer[];
4642
4642
  }>;
4643
- withdrawStake: (poolConfig: PoolConfig, pendingActivation?: boolean, deactivated?: boolean, createUserLPTA?: boolean) => Promise<{
4643
+ withdrawStake: (poolConfig: PoolConfig, pendingActivation?: boolean, deactivated?: boolean, createUserLPTA?: boolean, userPublicKey?: PublicKey | undefined) => Promise<{
4644
4644
  instructions: TransactionInstruction[];
4645
4645
  additionalSigners: Signer[];
4646
4646
  }>;
@@ -4802,14 +4802,6 @@ export declare class PerpetualsClient {
4802
4802
  instructions: TransactionInstruction[];
4803
4803
  additionalSigners: Signer[];
4804
4804
  }>;
4805
- setInternalOraclePriceBatch: (tokenMintList: PublicKey[], tokenInternalPrices: InternalPrice[], POOL_CONFIGS: PoolConfig[]) => Promise<{
4806
- instructions: TransactionInstruction[];
4807
- additionalSigners: Signer[];
4808
- }>;
4809
- setInternalOracleEmaPriceBatch: (tokenMintList: PublicKey[], tokenInternalEmaPrices: InternalEmaPrice[], POOL_CONFIGS: PoolConfig[]) => Promise<{
4810
- instructions: TransactionInstruction[];
4811
- additionalSigners: Signer[];
4812
- }>;
4813
4805
  addCompoundingLiquidity: (amountIn: BN, minCompoundingAmountOut: BN, inTokenSymbol: string, rewardTokenMint: PublicKey, poolConfig: PoolConfig, skipBalanceChecks?: boolean, ephemeralSignerPubkey?: any, userPublicKey?: PublicKey | undefined) => Promise<{
4814
4806
  instructions: TransactionInstruction[];
4815
4807
  additionalSigners: Signer[];
@@ -4794,68 +4794,71 @@ var PerpetualsClient = (function () {
4794
4794
  });
4795
4795
  });
4796
4796
  };
4797
- this.unstakeInstant = function (rewardSymbol, unstakeAmount, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
4798
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustodyConfig, pool, flpStakeAccount, tokenStakeAccount, tokenStakeAccounts, _a, unstakeInstantInstruction, err_17;
4799
- return __generator(this, function (_b) {
4800
- switch (_b.label) {
4801
- case 0:
4802
- publicKey = this.provider.wallet.publicKey;
4803
- preInstructions = [];
4804
- instructions = [];
4805
- postInstructions = [];
4806
- additionalSigners = [];
4807
- _b.label = 1;
4808
- case 1:
4809
- _b.trys.push([1, 5, , 6]);
4810
- rewardCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(rewardSymbol).mintKey); });
4811
- pool = poolConfig.poolAddress;
4812
- flpStakeAccount = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("stake"), publicKey.toBuffer(), pool.toBuffer()], this.programId)[0];
4813
- tokenStakeAccount = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("token_stake"), publicKey.toBuffer()], this.programId)[0];
4814
- tokenStakeAccounts = [];
4815
- _a = tokenStakeAccount;
4816
- if (!_a) return [3, 3];
4817
- return [4, (0, utils_1.checkIfAccountExists)(tokenStakeAccount, this.provider.connection)];
4818
- case 2:
4819
- _a = (_b.sent());
4820
- _b.label = 3;
4821
- case 3:
4822
- if (_a) {
4823
- tokenStakeAccounts.push({
4824
- pubkey: tokenStakeAccount,
4825
- isSigner: false,
4826
- isWritable: false,
4827
- });
4828
- }
4829
- return [4, this.program.methods
4830
- .unstakeInstant({
4831
- unstakeAmount: unstakeAmount
4832
- })
4833
- .accounts({
4834
- owner: publicKey,
4835
- perpetuals: this.perpetuals.publicKey,
4836
- pool: pool,
4837
- flpStakeAccount: flpStakeAccount,
4838
- rewardCustody: rewardCustodyConfig.custodyAccount,
4839
- eventAuthority: this.eventAuthority.publicKey,
4840
- program: this.program.programId,
4841
- })
4842
- .remainingAccounts(__spreadArray([], tokenStakeAccounts, true))
4843
- .instruction()];
4844
- case 4:
4845
- unstakeInstantInstruction = _b.sent();
4846
- instructions.push(unstakeInstantInstruction);
4847
- return [3, 6];
4848
- case 5:
4849
- err_17 = _b.sent();
4850
- console.log("perpClient unstakeInstant error:: ", err_17);
4851
- throw err_17;
4852
- case 6: return [2, {
4853
- instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
4854
- additionalSigners: additionalSigners
4855
- }];
4856
- }
4797
+ this.unstakeInstant = function (rewardSymbol, unstakeAmount, poolConfig, userPublicKey) {
4798
+ if (userPublicKey === void 0) { userPublicKey = undefined; }
4799
+ return __awaiter(_this, void 0, void 0, function () {
4800
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustodyConfig, pool, flpStakeAccount, tokenStakeAccount, tokenStakeAccounts, _a, unstakeInstantInstruction, err_17;
4801
+ return __generator(this, function (_b) {
4802
+ switch (_b.label) {
4803
+ case 0:
4804
+ publicKey = userPublicKey !== null && userPublicKey !== void 0 ? userPublicKey : this.provider.wallet.publicKey;
4805
+ preInstructions = [];
4806
+ instructions = [];
4807
+ postInstructions = [];
4808
+ additionalSigners = [];
4809
+ _b.label = 1;
4810
+ case 1:
4811
+ _b.trys.push([1, 5, , 6]);
4812
+ rewardCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(rewardSymbol).mintKey); });
4813
+ pool = poolConfig.poolAddress;
4814
+ flpStakeAccount = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("stake"), publicKey.toBuffer(), pool.toBuffer()], this.programId)[0];
4815
+ tokenStakeAccount = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("token_stake"), publicKey.toBuffer()], this.programId)[0];
4816
+ tokenStakeAccounts = [];
4817
+ _a = tokenStakeAccount;
4818
+ if (!_a) return [3, 3];
4819
+ return [4, (0, utils_1.checkIfAccountExists)(tokenStakeAccount, this.provider.connection)];
4820
+ case 2:
4821
+ _a = (_b.sent());
4822
+ _b.label = 3;
4823
+ case 3:
4824
+ if (_a) {
4825
+ tokenStakeAccounts.push({
4826
+ pubkey: tokenStakeAccount,
4827
+ isSigner: false,
4828
+ isWritable: false,
4829
+ });
4830
+ }
4831
+ return [4, this.program.methods
4832
+ .unstakeInstant({
4833
+ unstakeAmount: unstakeAmount
4834
+ })
4835
+ .accounts({
4836
+ owner: publicKey,
4837
+ perpetuals: this.perpetuals.publicKey,
4838
+ pool: pool,
4839
+ flpStakeAccount: flpStakeAccount,
4840
+ rewardCustody: rewardCustodyConfig.custodyAccount,
4841
+ eventAuthority: this.eventAuthority.publicKey,
4842
+ program: this.program.programId,
4843
+ })
4844
+ .remainingAccounts(__spreadArray([], tokenStakeAccounts, true))
4845
+ .instruction()];
4846
+ case 4:
4847
+ unstakeInstantInstruction = _b.sent();
4848
+ instructions.push(unstakeInstantInstruction);
4849
+ return [3, 6];
4850
+ case 5:
4851
+ err_17 = _b.sent();
4852
+ console.log("perpClient unstakeInstant error:: ", err_17);
4853
+ throw err_17;
4854
+ case 6: return [2, {
4855
+ instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
4856
+ additionalSigners: additionalSigners
4857
+ }];
4858
+ }
4859
+ });
4857
4860
  });
4858
- }); };
4861
+ };
4859
4862
  this.setFeeShareBps = function (poolConfig, flpStakeAccountPks) { return __awaiter(_this, void 0, void 0, function () {
4860
4863
  var publicKey, pool, custodyAccountMetas, _i, _a, custody, maxFlpStakeAccountPkLength, flpStakeAccountMetas, _b, flpStakeAccountPks_2, flpStakeAccountPk, refreshStakeInstruction, err_18;
4861
4864
  return __generator(this, function (_c) {
@@ -4953,16 +4956,17 @@ var PerpetualsClient = (function () {
4953
4956
  }
4954
4957
  });
4955
4958
  }); };
4956
- this.withdrawStake = function (poolConfig, pendingActivation, deactivated, createUserLPTA) {
4959
+ this.withdrawStake = function (poolConfig, pendingActivation, deactivated, createUserLPTA, userPublicKey) {
4957
4960
  if (pendingActivation === void 0) { pendingActivation = true; }
4958
4961
  if (deactivated === void 0) { deactivated = true; }
4959
4962
  if (createUserLPTA === void 0) { createUserLPTA = true; }
4963
+ if (userPublicKey === void 0) { userPublicKey = undefined; }
4960
4964
  return __awaiter(_this, void 0, void 0, function () {
4961
4965
  var publicKey, preInstructions, instructions, postInstructions, additionalSigners, lpTokenMint, pool, poolStakedLpVault, flpStakeAccount, userLpTokenAccount, _a, withdrawStakeInstruction, err_20;
4962
4966
  return __generator(this, function (_b) {
4963
4967
  switch (_b.label) {
4964
4968
  case 0:
4965
- publicKey = this.provider.wallet.publicKey;
4969
+ publicKey = userPublicKey !== null && userPublicKey !== void 0 ? userPublicKey : this.provider.wallet.publicKey;
4966
4970
  preInstructions = [];
4967
4971
  instructions = [];
4968
4972
  postInstructions = [];
@@ -7365,134 +7369,12 @@ var PerpetualsClient = (function () {
7365
7369
  }
7366
7370
  });
7367
7371
  }); };
7368
- this.setInternalOraclePriceBatch = function (tokenMintList, tokenInternalPrices, POOL_CONFIGS) { return __awaiter(_this, void 0, void 0, function () {
7369
- var ALL_CUSTODY_CONFIGS, accountMetas, _loop_1, _i, tokenMintList_1, tokenMint, instructions, additionalSigners, setInternalOraclePrice, err_62;
7370
- return __generator(this, function (_a) {
7371
- switch (_a.label) {
7372
- case 0:
7373
- if (tokenMintList.length !== tokenInternalPrices.length) {
7374
- throw new Error("tokenMintList and tokenInternalPrices length mismatch");
7375
- }
7376
- ALL_CUSTODY_CONFIGS = POOL_CONFIGS.map(function (f) { return f.custodies; }).flat();
7377
- accountMetas = [];
7378
- _loop_1 = function (tokenMint) {
7379
- var custody = ALL_CUSTODY_CONFIGS.find(function (i) { return i.mintKey.equals(tokenMint); });
7380
- accountMetas.push({
7381
- pubkey: custody.custodyAccount,
7382
- isSigner: false,
7383
- isWritable: false,
7384
- });
7385
- accountMetas.push({
7386
- pubkey: custody.intOracleAccount,
7387
- isSigner: false,
7388
- isWritable: true,
7389
- });
7390
- accountMetas.push({
7391
- pubkey: custody.extOracleAccount,
7392
- isSigner: false,
7393
- isWritable: false,
7394
- });
7395
- };
7396
- for (_i = 0, tokenMintList_1 = tokenMintList; _i < tokenMintList_1.length; _i++) {
7397
- tokenMint = tokenMintList_1[_i];
7398
- _loop_1(tokenMint);
7399
- }
7400
- instructions = [];
7401
- additionalSigners = [];
7402
- _a.label = 1;
7403
- case 1:
7404
- _a.trys.push([1, 3, , 4]);
7405
- return [4, this.program.methods
7406
- .setInternalCurrentPrice({
7407
- prices: tokenInternalPrices
7408
- })
7409
- .accounts({
7410
- authority: POOL_CONFIGS[0].backupOracle,
7411
- })
7412
- .remainingAccounts(__spreadArray([], accountMetas, true))
7413
- .instruction()];
7414
- case 2:
7415
- setInternalOraclePrice = _a.sent();
7416
- instructions.push(setInternalOraclePrice);
7417
- return [3, 4];
7418
- case 3:
7419
- err_62 = _a.sent();
7420
- console.log("perpClient setInternalOracleAccount error:: ", err_62);
7421
- throw err_62;
7422
- case 4: return [2, {
7423
- instructions: __spreadArray([], instructions, true),
7424
- additionalSigners: additionalSigners
7425
- }];
7426
- }
7427
- });
7428
- }); };
7429
- this.setInternalOracleEmaPriceBatch = function (tokenMintList, tokenInternalEmaPrices, POOL_CONFIGS) { return __awaiter(_this, void 0, void 0, function () {
7430
- var ALL_CUSTODY_CONFIGS, accountMetas, _loop_2, _i, tokenMintList_2, tokenMint, instructions, additionalSigners, setInternalOraclePrice, err_63;
7431
- return __generator(this, function (_a) {
7432
- switch (_a.label) {
7433
- case 0:
7434
- if (tokenMintList.length !== tokenInternalEmaPrices.length) {
7435
- throw new Error("tokenMintList and tokenInternalPrices length mismatch");
7436
- }
7437
- ALL_CUSTODY_CONFIGS = POOL_CONFIGS.map(function (f) { return f.custodies; }).flat();
7438
- accountMetas = [];
7439
- _loop_2 = function (tokenMint) {
7440
- var custody = ALL_CUSTODY_CONFIGS.find(function (i) { return i.mintKey.equals(tokenMint); });
7441
- accountMetas.push({
7442
- pubkey: custody.custodyAccount,
7443
- isSigner: false,
7444
- isWritable: false,
7445
- });
7446
- accountMetas.push({
7447
- pubkey: custody.intOracleAccount,
7448
- isSigner: false,
7449
- isWritable: true,
7450
- });
7451
- accountMetas.push({
7452
- pubkey: custody.extOracleAccount,
7453
- isSigner: false,
7454
- isWritable: false,
7455
- });
7456
- };
7457
- for (_i = 0, tokenMintList_2 = tokenMintList; _i < tokenMintList_2.length; _i++) {
7458
- tokenMint = tokenMintList_2[_i];
7459
- _loop_2(tokenMint);
7460
- }
7461
- instructions = [];
7462
- additionalSigners = [];
7463
- _a.label = 1;
7464
- case 1:
7465
- _a.trys.push([1, 3, , 4]);
7466
- return [4, this.program.methods
7467
- .setInternalEmaPrice({
7468
- prices: tokenInternalEmaPrices
7469
- })
7470
- .accounts({
7471
- authority: POOL_CONFIGS[0].backupOracle,
7472
- })
7473
- .remainingAccounts(__spreadArray([], accountMetas, true))
7474
- .instruction()];
7475
- case 2:
7476
- setInternalOraclePrice = _a.sent();
7477
- instructions.push(setInternalOraclePrice);
7478
- return [3, 4];
7479
- case 3:
7480
- err_63 = _a.sent();
7481
- console.log("perpClient setInternalOracleAccount error:: ", err_63);
7482
- throw err_63;
7483
- case 4: return [2, {
7484
- instructions: __spreadArray([], instructions, true),
7485
- additionalSigners: additionalSigners
7486
- }];
7487
- }
7488
- });
7489
- }); };
7490
7372
  this.addCompoundingLiquidity = function (amountIn, minCompoundingAmountOut, inTokenSymbol, rewardTokenMint, poolConfig, skipBalanceChecks, ephemeralSignerPubkey, userPublicKey) {
7491
7373
  if (skipBalanceChecks === void 0) { skipBalanceChecks = false; }
7492
7374
  if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
7493
7375
  if (userPublicKey === void 0) { userPublicKey = undefined; }
7494
7376
  return __awaiter(_this, void 0, void 0, function () {
7495
- 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_64;
7377
+ 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_62;
7496
7378
  return __generator(this, function (_e) {
7497
7379
  switch (_e.label) {
7498
7380
  case 0:
@@ -7615,8 +7497,8 @@ var PerpetualsClient = (function () {
7615
7497
  instructions.push(addCompoundingLiquidity);
7616
7498
  return [3, 10];
7617
7499
  case 9:
7618
- err_64 = _e.sent();
7619
- console.log("perpClient addCompoundingLiquidity error:: ", err_64);
7500
+ err_62 = _e.sent();
7501
+ console.log("perpClient addCompoundingLiquidity error:: ", err_62);
7620
7502
  return [3, 10];
7621
7503
  case 10: return [2, {
7622
7504
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
@@ -7631,7 +7513,7 @@ var PerpetualsClient = (function () {
7631
7513
  if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
7632
7514
  if (userPublicKey === void 0) { userPublicKey = undefined; }
7633
7515
  return __awaiter(_this, void 0, void 0, function () {
7634
- 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_65;
7516
+ 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_63;
7635
7517
  return __generator(this, function (_e) {
7636
7518
  switch (_e.label) {
7637
7519
  case 0:
@@ -7738,8 +7620,8 @@ var PerpetualsClient = (function () {
7738
7620
  instructions.push(removeCompoundingLiquidity);
7739
7621
  return [3, 8];
7740
7622
  case 7:
7741
- err_65 = _e.sent();
7742
- console.log("perpClient removeCompoundingLiquidity error:: ", err_65);
7623
+ err_63 = _e.sent();
7624
+ console.log("perpClient removeCompoundingLiquidity error:: ", err_63);
7743
7625
  return [3, 8];
7744
7626
  case 8: return [2, {
7745
7627
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
@@ -7752,7 +7634,7 @@ var PerpetualsClient = (function () {
7752
7634
  this.migrateStake = function (amount, rewardTokenMint, poolConfig, createUserATA) {
7753
7635
  if (createUserATA === void 0) { createUserATA = true; }
7754
7636
  return __awaiter(_this, void 0, void 0, function () {
7755
- 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_66;
7637
+ 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_64;
7756
7638
  return __generator(this, function (_f) {
7757
7639
  switch (_f.label) {
7758
7640
  case 0:
@@ -7849,8 +7731,8 @@ var PerpetualsClient = (function () {
7849
7731
  instructions.push(migrateStake);
7850
7732
  return [3, 8];
7851
7733
  case 7:
7852
- err_66 = _f.sent();
7853
- console.log("perpClient migrateStake error:: ", err_66);
7734
+ err_64 = _f.sent();
7735
+ console.log("perpClient migrateStake error:: ", err_64);
7854
7736
  return [3, 8];
7855
7737
  case 8: return [2, {
7856
7738
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
@@ -7861,7 +7743,7 @@ var PerpetualsClient = (function () {
7861
7743
  });
7862
7744
  };
7863
7745
  this.migrateFlp = function (amount, rewardTokenMint, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
7864
- var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, lpTokenMint, compoundingTokenMint, compoudingTokenAccount, flpStakeAccount, poolStakedLpVault, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, migrateFlp, err_67;
7746
+ var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, lpTokenMint, compoundingTokenMint, compoudingTokenAccount, flpStakeAccount, poolStakedLpVault, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, migrateFlp, err_65;
7865
7747
  return __generator(this, function (_d) {
7866
7748
  switch (_d.label) {
7867
7749
  case 0:
@@ -7933,8 +7815,8 @@ var PerpetualsClient = (function () {
7933
7815
  instructions.push(migrateFlp);
7934
7816
  return [3, 4];
7935
7817
  case 3:
7936
- err_67 = _d.sent();
7937
- console.log("perpClient migrateFlp error:: ", err_67);
7818
+ err_65 = _d.sent();
7819
+ console.log("perpClient migrateFlp error:: ", err_65);
7938
7820
  return [3, 4];
7939
7821
  case 4: return [2, {
7940
7822
  instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
@@ -7946,7 +7828,7 @@ var PerpetualsClient = (function () {
7946
7828
  this.compoundingFee = function (poolConfig, rewardTokenSymbol) {
7947
7829
  if (rewardTokenSymbol === void 0) { rewardTokenSymbol = 'USDC'; }
7948
7830
  return __awaiter(_this, void 0, void 0, function () {
7949
- var instructions, additionalSigners, rewardCustody, lpTokenMint, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, compoundingFee, err_68;
7831
+ var instructions, additionalSigners, rewardCustody, lpTokenMint, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, compoundingFee, err_66;
7950
7832
  return __generator(this, function (_d) {
7951
7833
  switch (_d.label) {
7952
7834
  case 0:
@@ -8003,8 +7885,8 @@ var PerpetualsClient = (function () {
8003
7885
  instructions.push(compoundingFee);
8004
7886
  return [3, 4];
8005
7887
  case 3:
8006
- err_68 = _d.sent();
8007
- console.log("perpClient compoundingFee error:: ", err_68);
7888
+ err_66 = _d.sent();
7889
+ console.log("perpClient compoundingFee error:: ", err_66);
8008
7890
  return [3, 4];
8009
7891
  case 4: return [2, {
8010
7892
  instructions: __spreadArray([], instructions, true),
@@ -8015,7 +7897,7 @@ var PerpetualsClient = (function () {
8015
7897
  });
8016
7898
  };
8017
7899
  this.renameFlp = function (flag, lpTokenName, lpTokenSymbol, lpTokenUri, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
8018
- var publicKey, instructions, additionalSigners, lpTokenMint, lpMetadataAccount, renameFlp, err_69;
7900
+ var publicKey, instructions, additionalSigners, lpTokenMint, lpMetadataAccount, renameFlp, err_67;
8019
7901
  return __generator(this, function (_a) {
8020
7902
  switch (_a.label) {
8021
7903
  case 0:
@@ -8053,8 +7935,8 @@ var PerpetualsClient = (function () {
8053
7935
  instructions.push(renameFlp);
8054
7936
  return [3, 4];
8055
7937
  case 3:
8056
- err_69 = _a.sent();
8057
- console.log("perpClient renameFlp error:: ", err_69);
7938
+ err_67 = _a.sent();
7939
+ console.log("perpClient renameFlp error:: ", err_67);
8058
7940
  return [3, 4];
8059
7941
  case 4: return [2, {
8060
7942
  instructions: __spreadArray([], instructions, true),