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.
- package/dist/PerpetualsClient.d.ts +3 -11
- package/dist/PerpetualsClient.js +85 -203
- package/dist/PoolConfig.json +0 -220
- package/dist/idl/perpetuals.d.ts +1 -112
- package/dist/idl/perpetuals.js +1 -112
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +0 -2
- package/package.json +1 -1
@@ -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,
|
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[];
|
package/dist/PerpetualsClient.js
CHANGED
@@ -4794,68 +4794,71 @@ var PerpetualsClient = (function () {
|
|
4794
4794
|
});
|
4795
4795
|
});
|
4796
4796
|
};
|
4797
|
-
this.unstakeInstant = function (rewardSymbol, unstakeAmount, poolConfig
|
4798
|
-
|
4799
|
-
return
|
4800
|
-
|
4801
|
-
|
4802
|
-
|
4803
|
-
|
4804
|
-
|
4805
|
-
|
4806
|
-
|
4807
|
-
|
4808
|
-
|
4809
|
-
|
4810
|
-
|
4811
|
-
|
4812
|
-
|
4813
|
-
|
4814
|
-
|
4815
|
-
|
4816
|
-
|
4817
|
-
|
4818
|
-
|
4819
|
-
|
4820
|
-
|
4821
|
-
|
4822
|
-
|
4823
|
-
|
4824
|
-
|
4825
|
-
|
4826
|
-
|
4827
|
-
|
4828
|
-
|
4829
|
-
|
4830
|
-
|
4831
|
-
|
4832
|
-
|
4833
|
-
|
4834
|
-
|
4835
|
-
|
4836
|
-
|
4837
|
-
|
4838
|
-
|
4839
|
-
|
4840
|
-
|
4841
|
-
|
4842
|
-
|
4843
|
-
|
4844
|
-
|
4845
|
-
|
4846
|
-
|
4847
|
-
|
4848
|
-
|
4849
|
-
|
4850
|
-
|
4851
|
-
|
4852
|
-
|
4853
|
-
|
4854
|
-
|
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,
|
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
|
-
|
7619
|
-
console.log("perpClient addCompoundingLiquidity error:: ",
|
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,
|
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
|
-
|
7742
|
-
console.log("perpClient removeCompoundingLiquidity error:: ",
|
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,
|
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
|
-
|
7853
|
-
console.log("perpClient migrateStake error:: ",
|
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,
|
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
|
-
|
7937
|
-
console.log("perpClient migrateFlp error:: ",
|
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,
|
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
|
-
|
8007
|
-
console.log("perpClient compoundingFee error:: ",
|
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,
|
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
|
-
|
8057
|
-
console.log("perpClient renameFlp error:: ",
|
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),
|