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