flash-sdk 2.19.6 → 2.20.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 +1 -9
- package/dist/PerpetualsClient.js +77 -264
- package/dist/PoolConfig.json +12 -12
- package/dist/idl/perpetuals.d.ts +1 -496
- package/dist/idl/perpetuals.js +1 -496
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/utils/alt.d.ts +1 -0
- package/package.json +1 -1
package/dist/PerpetualsClient.js
CHANGED
|
@@ -5583,88 +5583,8 @@ var PerpetualsClient = (function () {
|
|
|
5583
5583
|
});
|
|
5584
5584
|
});
|
|
5585
5585
|
};
|
|
5586
|
-
this.executeLimitWithSwap = function (userPubkey, targetSymbol, collateralSymbol, reserveSymbol, side, orderId, poolConfig, privilege, nftTradingAccount, nftReferralAccount, nftRebateTokenAccount) {
|
|
5587
|
-
if (nftTradingAccount === void 0) { nftTradingAccount = web3_js_1.PublicKey.default; }
|
|
5588
|
-
if (nftReferralAccount === void 0) { nftReferralAccount = web3_js_1.PublicKey.default; }
|
|
5589
|
-
if (nftRebateTokenAccount === void 0) { nftRebateTokenAccount = web3_js_1.PublicKey.default; }
|
|
5590
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
5591
|
-
var publicKey, targetCustodyConfig, collateralCustodyConfig, reserveCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, custodyAccountMetas, custodyOracleAccountMetas, _i, _a, custody, positionAccount, orderAccount, executeLimitWithSwap, err_28;
|
|
5592
|
-
return __generator(this, function (_b) {
|
|
5593
|
-
switch (_b.label) {
|
|
5594
|
-
case 0:
|
|
5595
|
-
publicKey = this.provider.wallet.publicKey;
|
|
5596
|
-
targetCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(targetSymbol).mintKey); });
|
|
5597
|
-
collateralCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(collateralSymbol).mintKey); });
|
|
5598
|
-
reserveCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(reserveSymbol).mintKey); });
|
|
5599
|
-
marketAccount = poolConfig.getMarketPk(targetCustodyConfig.custodyAccount, collateralCustodyConfig.custodyAccount, side);
|
|
5600
|
-
preInstructions = [];
|
|
5601
|
-
instructions = [];
|
|
5602
|
-
postInstructions = [];
|
|
5603
|
-
additionalSigners = [];
|
|
5604
|
-
custodyAccountMetas = [];
|
|
5605
|
-
custodyOracleAccountMetas = [];
|
|
5606
|
-
for (_i = 0, _a = poolConfig.custodies; _i < _a.length; _i++) {
|
|
5607
|
-
custody = _a[_i];
|
|
5608
|
-
custodyAccountMetas.push({
|
|
5609
|
-
pubkey: custody.custodyAccount,
|
|
5610
|
-
isSigner: false,
|
|
5611
|
-
isWritable: false,
|
|
5612
|
-
});
|
|
5613
|
-
custodyOracleAccountMetas.push({
|
|
5614
|
-
pubkey: this.useExtOracleAccount ? custody.extOracleAccount : custody.intOracleAccount,
|
|
5615
|
-
isSigner: false,
|
|
5616
|
-
isWritable: false,
|
|
5617
|
-
});
|
|
5618
|
-
}
|
|
5619
|
-
_b.label = 1;
|
|
5620
|
-
case 1:
|
|
5621
|
-
_b.trys.push([1, 3, , 4]);
|
|
5622
|
-
positionAccount = poolConfig.getPositionFromMarketPk(userPubkey, marketAccount);
|
|
5623
|
-
orderAccount = poolConfig.getOrderFromMarketPk(userPubkey, marketAccount);
|
|
5624
|
-
return [4, this.program.methods
|
|
5625
|
-
.executeLimitWithSwap({
|
|
5626
|
-
orderId: orderId,
|
|
5627
|
-
privilege: privilege
|
|
5628
|
-
})
|
|
5629
|
-
.accounts({
|
|
5630
|
-
feePayer: publicKey,
|
|
5631
|
-
perpetuals: poolConfig.perpetuals,
|
|
5632
|
-
pool: poolConfig.poolAddress,
|
|
5633
|
-
reserveCustody: reserveCustodyConfig.custodyAccount,
|
|
5634
|
-
reserveCustodyOracleAccount: this.useExtOracleAccount ? reserveCustodyConfig.extOracleAccount : reserveCustodyConfig.intOracleAccount,
|
|
5635
|
-
position: positionAccount,
|
|
5636
|
-
order: orderAccount,
|
|
5637
|
-
market: marketAccount,
|
|
5638
|
-
targetCustody: targetCustodyConfig.custodyAccount,
|
|
5639
|
-
targetOracleAccount: this.useExtOracleAccount ? targetCustodyConfig.extOracleAccount : targetCustodyConfig.intOracleAccount,
|
|
5640
|
-
collateralCustody: collateralCustodyConfig.custodyAccount,
|
|
5641
|
-
collateralOracleAccount: this.useExtOracleAccount ? collateralCustodyConfig.extOracleAccount : collateralCustodyConfig.intOracleAccount,
|
|
5642
|
-
systemProgram: web3_js_1.SystemProgram.programId,
|
|
5643
|
-
tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
|
5644
|
-
eventAuthority: this.eventAuthority.publicKey,
|
|
5645
|
-
program: this.programId,
|
|
5646
|
-
ixSysvar: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY
|
|
5647
|
-
})
|
|
5648
|
-
.remainingAccounts(__spreadArray(__spreadArray(__spreadArray([], (0, getNftAccounts_1.getNftAccounts)(nftTradingAccount, nftReferralAccount, nftRebateTokenAccount, privilege), true), custodyAccountMetas, true), custodyOracleAccountMetas, true))
|
|
5649
|
-
.instruction()];
|
|
5650
|
-
case 2:
|
|
5651
|
-
executeLimitWithSwap = _b.sent();
|
|
5652
|
-
instructions.push(executeLimitWithSwap);
|
|
5653
|
-
return [3, 4];
|
|
5654
|
-
case 3:
|
|
5655
|
-
err_28 = _b.sent();
|
|
5656
|
-
console.log("perpClient executeLimitWithSwap error:: ", err_28);
|
|
5657
|
-
throw err_28;
|
|
5658
|
-
case 4: return [2, {
|
|
5659
|
-
instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
|
|
5660
|
-
additionalSigners: additionalSigners
|
|
5661
|
-
}];
|
|
5662
|
-
}
|
|
5663
|
-
});
|
|
5664
|
-
});
|
|
5665
|
-
};
|
|
5666
5586
|
this.placeTriggerOrder = function (targetSymbol, collateralSymbol, side, triggerPrice, deltaSizeAmount, isStopLoss, receiveCustodyId, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
|
5667
|
-
var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, placeTriggerOrder,
|
|
5587
|
+
var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, placeTriggerOrder, err_28;
|
|
5668
5588
|
return __generator(this, function (_a) {
|
|
5669
5589
|
switch (_a.label) {
|
|
5670
5590
|
case 0:
|
|
@@ -5711,9 +5631,9 @@ var PerpetualsClient = (function () {
|
|
|
5711
5631
|
instructions.push(placeTriggerOrder);
|
|
5712
5632
|
return [3, 4];
|
|
5713
5633
|
case 3:
|
|
5714
|
-
|
|
5715
|
-
console.log("perpClient placeTriggerOrder error:: ",
|
|
5716
|
-
throw
|
|
5634
|
+
err_28 = _a.sent();
|
|
5635
|
+
console.log("perpClient placeTriggerOrder error:: ", err_28);
|
|
5636
|
+
throw err_28;
|
|
5717
5637
|
case 4: return [2, {
|
|
5718
5638
|
instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
|
|
5719
5639
|
additionalSigners: additionalSigners
|
|
@@ -5722,7 +5642,7 @@ var PerpetualsClient = (function () {
|
|
|
5722
5642
|
});
|
|
5723
5643
|
}); };
|
|
5724
5644
|
this.editTriggerOrder = function (targetSymbol, collateralSymbol, side, orderId, triggerPrice, deltaSizeAmount, isStopLoss, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
|
5725
|
-
var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, editTriggerOrder,
|
|
5645
|
+
var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, editTriggerOrder, err_29;
|
|
5726
5646
|
return __generator(this, function (_a) {
|
|
5727
5647
|
switch (_a.label) {
|
|
5728
5648
|
case 0:
|
|
@@ -5767,9 +5687,9 @@ var PerpetualsClient = (function () {
|
|
|
5767
5687
|
instructions.push(editTriggerOrder);
|
|
5768
5688
|
return [3, 4];
|
|
5769
5689
|
case 3:
|
|
5770
|
-
|
|
5771
|
-
console.log("perpClient editTriggerOrder error:: ",
|
|
5772
|
-
throw
|
|
5690
|
+
err_29 = _a.sent();
|
|
5691
|
+
console.log("perpClient editTriggerOrder error:: ", err_29);
|
|
5692
|
+
throw err_29;
|
|
5773
5693
|
case 4: return [2, {
|
|
5774
5694
|
instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
|
|
5775
5695
|
additionalSigners: additionalSigners
|
|
@@ -5778,7 +5698,7 @@ var PerpetualsClient = (function () {
|
|
|
5778
5698
|
});
|
|
5779
5699
|
}); };
|
|
5780
5700
|
this.cancelTriggerOrder = function (targetSymbol, collateralSymbol, side, orderId, isStopLoss, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
|
5781
|
-
var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, orderAccount, cancelTriggerOrder,
|
|
5701
|
+
var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, orderAccount, cancelTriggerOrder, err_30;
|
|
5782
5702
|
return __generator(this, function (_a) {
|
|
5783
5703
|
switch (_a.label) {
|
|
5784
5704
|
case 0:
|
|
@@ -5811,9 +5731,9 @@ var PerpetualsClient = (function () {
|
|
|
5811
5731
|
instructions.push(cancelTriggerOrder);
|
|
5812
5732
|
return [3, 4];
|
|
5813
5733
|
case 3:
|
|
5814
|
-
|
|
5815
|
-
console.log("perpClient cancelTriggerOrder error:: ",
|
|
5816
|
-
throw
|
|
5734
|
+
err_30 = _a.sent();
|
|
5735
|
+
console.log("perpClient cancelTriggerOrder error:: ", err_30);
|
|
5736
|
+
throw err_30;
|
|
5817
5737
|
case 4: return [2, {
|
|
5818
5738
|
instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
|
|
5819
5739
|
additionalSigners: additionalSigners
|
|
@@ -5821,121 +5741,11 @@ var PerpetualsClient = (function () {
|
|
|
5821
5741
|
}
|
|
5822
5742
|
});
|
|
5823
5743
|
}); };
|
|
5824
|
-
this.executeTriggerWithSwap = function (owner, targetSymbol, collateralSymbol, receivingSymbol, side, orderId, isStopLoss, poolConfig, createUserATA, ephemeralSignerPubkey) {
|
|
5825
|
-
if (createUserATA === void 0) { createUserATA = true; }
|
|
5826
|
-
if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
|
|
5827
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
5828
|
-
var payerPubkey, targetCustodyConfig, collateralCustodyConfig, receivingCustodyConfig, marketAccount, userReceivingTokenAccount, userReceivingTokenAccountCollateral, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, _b, positionAccount, orderAccount, custodyAccountMetas, custodyOracleAccountMetas, _i, _c, custody, executeTriggerWithSwap, err_32;
|
|
5829
|
-
return __generator(this, function (_d) {
|
|
5830
|
-
switch (_d.label) {
|
|
5831
|
-
case 0:
|
|
5832
|
-
payerPubkey = this.provider.wallet.publicKey;
|
|
5833
|
-
targetCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(targetSymbol).mintKey); });
|
|
5834
|
-
collateralCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(collateralSymbol).mintKey); });
|
|
5835
|
-
receivingCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(receivingSymbol).mintKey); });
|
|
5836
|
-
marketAccount = poolConfig.getMarketPk(targetCustodyConfig.custodyAccount, collateralCustodyConfig.custodyAccount, side);
|
|
5837
|
-
preInstructions = [];
|
|
5838
|
-
instructions = [];
|
|
5839
|
-
postInstructions = [];
|
|
5840
|
-
additionalSigners = [];
|
|
5841
|
-
_d.label = 1;
|
|
5842
|
-
case 1:
|
|
5843
|
-
_d.trys.push([1, 9, , 10]);
|
|
5844
|
-
if (!false) return [3, 2];
|
|
5845
|
-
return [3, 7];
|
|
5846
|
-
case 2:
|
|
5847
|
-
userReceivingTokenAccount = (0, spl_token_1.getAssociatedTokenAddressSync)(poolConfig.getTokenFromSymbol(receivingSymbol).mintKey, owner, true);
|
|
5848
|
-
_a = createUserATA;
|
|
5849
|
-
if (!_a) return [3, 4];
|
|
5850
|
-
return [4, (0, utils_1.checkIfAccountExists)(userReceivingTokenAccount, this.provider.connection)];
|
|
5851
|
-
case 3:
|
|
5852
|
-
_a = !(_d.sent());
|
|
5853
|
-
_d.label = 4;
|
|
5854
|
-
case 4:
|
|
5855
|
-
if (_a) {
|
|
5856
|
-
preInstructions.push((0, spl_token_1.createAssociatedTokenAccountInstruction)(payerPubkey, userReceivingTokenAccount, owner, poolConfig.getTokenFromSymbol(receivingSymbol).mintKey));
|
|
5857
|
-
}
|
|
5858
|
-
userReceivingTokenAccountCollateral = (0, spl_token_1.getAssociatedTokenAddressSync)(poolConfig.getTokenFromSymbol(collateralSymbol).mintKey, owner, true);
|
|
5859
|
-
_b = createUserATA;
|
|
5860
|
-
if (!_b) return [3, 6];
|
|
5861
|
-
return [4, (0, utils_1.checkIfAccountExists)(userReceivingTokenAccountCollateral, this.provider.connection)];
|
|
5862
|
-
case 5:
|
|
5863
|
-
_b = !(_d.sent());
|
|
5864
|
-
_d.label = 6;
|
|
5865
|
-
case 6:
|
|
5866
|
-
if (_b) {
|
|
5867
|
-
preInstructions.push((0, spl_token_1.createAssociatedTokenAccountInstruction)(payerPubkey, userReceivingTokenAccountCollateral, owner, poolConfig.getTokenFromSymbol(collateralSymbol).mintKey));
|
|
5868
|
-
}
|
|
5869
|
-
_d.label = 7;
|
|
5870
|
-
case 7:
|
|
5871
|
-
positionAccount = poolConfig.getPositionFromMarketPk(owner, marketAccount);
|
|
5872
|
-
orderAccount = poolConfig.getOrderFromMarketPk(owner, marketAccount);
|
|
5873
|
-
custodyAccountMetas = [];
|
|
5874
|
-
custodyOracleAccountMetas = [];
|
|
5875
|
-
for (_i = 0, _c = poolConfig.custodies; _i < _c.length; _i++) {
|
|
5876
|
-
custody = _c[_i];
|
|
5877
|
-
custodyAccountMetas.push({
|
|
5878
|
-
pubkey: custody.custodyAccount,
|
|
5879
|
-
isSigner: false,
|
|
5880
|
-
isWritable: false,
|
|
5881
|
-
});
|
|
5882
|
-
custodyOracleAccountMetas.push({
|
|
5883
|
-
pubkey: this.useExtOracleAccount ? custody.extOracleAccount : custody.intOracleAccount,
|
|
5884
|
-
isSigner: false,
|
|
5885
|
-
isWritable: false,
|
|
5886
|
-
});
|
|
5887
|
-
}
|
|
5888
|
-
return [4, this.program.methods
|
|
5889
|
-
.executeTriggerWithSwap({
|
|
5890
|
-
isStopLoss: isStopLoss,
|
|
5891
|
-
orderId: orderId
|
|
5892
|
-
})
|
|
5893
|
-
.accounts({
|
|
5894
|
-
feePayer: payerPubkey,
|
|
5895
|
-
receivingAccount: userReceivingTokenAccount,
|
|
5896
|
-
collateralAccount: userReceivingTokenAccountCollateral,
|
|
5897
|
-
transferAuthority: poolConfig.transferAuthority,
|
|
5898
|
-
perpetuals: poolConfig.perpetuals,
|
|
5899
|
-
pool: poolConfig.poolAddress,
|
|
5900
|
-
position: positionAccount,
|
|
5901
|
-
order: orderAccount,
|
|
5902
|
-
market: marketAccount,
|
|
5903
|
-
targetCustody: targetCustodyConfig.custodyAccount,
|
|
5904
|
-
targetOracleAccount: this.useExtOracleAccount ? targetCustodyConfig.extOracleAccount : targetCustodyConfig.intOracleAccount,
|
|
5905
|
-
collateralCustody: collateralCustodyConfig.custodyAccount,
|
|
5906
|
-
collateralOracleAccount: this.useExtOracleAccount ? collateralCustodyConfig.extOracleAccount : collateralCustodyConfig.intOracleAccount,
|
|
5907
|
-
collateralCustodyTokenAccount: collateralCustodyConfig.tokenAccount,
|
|
5908
|
-
dispensingCustody: receivingCustodyConfig.custodyAccount,
|
|
5909
|
-
dispensingOracleAccount: this.useExtOracleAccount ? receivingCustodyConfig.extOracleAccount : receivingCustodyConfig.intOracleAccount,
|
|
5910
|
-
dispensingCustodyTokenAccount: receivingCustodyConfig.tokenAccount,
|
|
5911
|
-
tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
|
5912
|
-
eventAuthority: this.eventAuthority.publicKey,
|
|
5913
|
-
program: this.programId,
|
|
5914
|
-
ixSysvar: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY
|
|
5915
|
-
})
|
|
5916
|
-
.remainingAccounts(__spreadArray(__spreadArray([], custodyAccountMetas, true), custodyOracleAccountMetas, true))
|
|
5917
|
-
.instruction()];
|
|
5918
|
-
case 8:
|
|
5919
|
-
executeTriggerWithSwap = _d.sent();
|
|
5920
|
-
instructions.push(executeTriggerWithSwap);
|
|
5921
|
-
return [3, 10];
|
|
5922
|
-
case 9:
|
|
5923
|
-
err_32 = _d.sent();
|
|
5924
|
-
console.log("perpClient executeTriggerWithSwap error:: ", err_32);
|
|
5925
|
-
throw err_32;
|
|
5926
|
-
case 10: return [2, {
|
|
5927
|
-
instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
|
|
5928
|
-
additionalSigners: additionalSigners
|
|
5929
|
-
}];
|
|
5930
|
-
}
|
|
5931
|
-
});
|
|
5932
|
-
});
|
|
5933
|
-
};
|
|
5934
5744
|
this.executeTriggerOrder = function (owner, targetSymbol, collateralSymbol, side, orderId, isStopLoss, poolConfig, createUserATA, ephemeralSignerPubkey) {
|
|
5935
5745
|
if (createUserATA === void 0) { createUserATA = true; }
|
|
5936
5746
|
if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
|
|
5937
5747
|
return __awaiter(_this, void 0, void 0, function () {
|
|
5938
|
-
var payerPubkey, targetCustodyConfig, collateralCustodyConfig, marketAccount, userReceivingTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, positionAccount, orderAccount, executeTriggerOrder,
|
|
5748
|
+
var payerPubkey, targetCustodyConfig, collateralCustodyConfig, marketAccount, userReceivingTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, positionAccount, orderAccount, executeTriggerOrder, err_31;
|
|
5939
5749
|
return __generator(this, function (_b) {
|
|
5940
5750
|
switch (_b.label) {
|
|
5941
5751
|
case 0:
|
|
@@ -5998,9 +5808,9 @@ var PerpetualsClient = (function () {
|
|
|
5998
5808
|
instructions.push(executeTriggerOrder);
|
|
5999
5809
|
return [3, 8];
|
|
6000
5810
|
case 7:
|
|
6001
|
-
|
|
6002
|
-
console.log("perpClient executeTriggerOrder error:: ",
|
|
6003
|
-
throw
|
|
5811
|
+
err_31 = _b.sent();
|
|
5812
|
+
console.log("perpClient executeTriggerOrder error:: ", err_31);
|
|
5813
|
+
throw err_31;
|
|
6004
5814
|
case 8: return [2, {
|
|
6005
5815
|
instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
|
|
6006
5816
|
additionalSigners: additionalSigners
|
|
@@ -6009,12 +5819,15 @@ var PerpetualsClient = (function () {
|
|
|
6009
5819
|
});
|
|
6010
5820
|
});
|
|
6011
5821
|
};
|
|
6012
|
-
this.migrateTriggerOrder = function (owner,
|
|
6013
|
-
var payerPubkey, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, migrateTriggerOrder,
|
|
5822
|
+
this.migrateTriggerOrder = function (owner, targetSymbol, collateralSymbol, side, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
|
5823
|
+
var payerPubkey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, migrateTriggerOrder, err_32;
|
|
6014
5824
|
return __generator(this, function (_a) {
|
|
6015
5825
|
switch (_a.label) {
|
|
6016
5826
|
case 0:
|
|
6017
5827
|
payerPubkey = this.provider.wallet.publicKey;
|
|
5828
|
+
targetCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(targetSymbol).mintKey); });
|
|
5829
|
+
collateralCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(collateralSymbol).mintKey); });
|
|
5830
|
+
marketAccount = poolConfig.getMarketPk(targetCustodyConfig.custodyAccount, collateralCustodyConfig.custodyAccount, side);
|
|
6018
5831
|
preInstructions = [];
|
|
6019
5832
|
instructions = [];
|
|
6020
5833
|
postInstructions = [];
|
|
@@ -6040,9 +5853,9 @@ var PerpetualsClient = (function () {
|
|
|
6040
5853
|
instructions.push(migrateTriggerOrder);
|
|
6041
5854
|
return [3, 4];
|
|
6042
5855
|
case 3:
|
|
6043
|
-
|
|
6044
|
-
console.log("perpClient migrateTriggerOrder error:: ",
|
|
6045
|
-
throw
|
|
5856
|
+
err_32 = _a.sent();
|
|
5857
|
+
console.log("perpClient migrateTriggerOrder error:: ", err_32);
|
|
5858
|
+
throw err_32;
|
|
6046
5859
|
case 4: return [2, {
|
|
6047
5860
|
instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
|
|
6048
5861
|
additionalSigners: additionalSigners
|
|
@@ -6051,7 +5864,7 @@ var PerpetualsClient = (function () {
|
|
|
6051
5864
|
});
|
|
6052
5865
|
}); };
|
|
6053
5866
|
this.getPositionData = function (position, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
|
6054
|
-
var marketConfig, targetCustodyConfig, collateralCustodyConfig, getPositionData,
|
|
5867
|
+
var marketConfig, targetCustodyConfig, collateralCustodyConfig, getPositionData, err_33;
|
|
6055
5868
|
return __generator(this, function (_a) {
|
|
6056
5869
|
switch (_a.label) {
|
|
6057
5870
|
case 0:
|
|
@@ -6080,15 +5893,15 @@ var PerpetualsClient = (function () {
|
|
|
6080
5893
|
console.log(getPositionData);
|
|
6081
5894
|
return [2, getPositionData];
|
|
6082
5895
|
case 3:
|
|
6083
|
-
|
|
6084
|
-
console.log("perpClient setPool error:: ",
|
|
6085
|
-
throw
|
|
5896
|
+
err_33 = _a.sent();
|
|
5897
|
+
console.log("perpClient setPool error:: ", err_33);
|
|
5898
|
+
throw err_33;
|
|
6086
5899
|
case 4: return [2];
|
|
6087
5900
|
}
|
|
6088
5901
|
});
|
|
6089
5902
|
}); };
|
|
6090
5903
|
this.protocolWithdrawFees = function (rewardSymbol, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
|
6091
|
-
var publicKey, custodyConfig, receivingTokenAccount, instructions, additionalSigners, withdrawFeesIx,
|
|
5904
|
+
var publicKey, custodyConfig, receivingTokenAccount, instructions, additionalSigners, withdrawFeesIx, err_34;
|
|
6092
5905
|
return __generator(this, function (_a) {
|
|
6093
5906
|
switch (_a.label) {
|
|
6094
5907
|
case 0:
|
|
@@ -6121,9 +5934,9 @@ var PerpetualsClient = (function () {
|
|
|
6121
5934
|
instructions.push(withdrawFeesIx);
|
|
6122
5935
|
return [3, 5];
|
|
6123
5936
|
case 4:
|
|
6124
|
-
|
|
6125
|
-
console.log("perpClient setPool error:: ",
|
|
6126
|
-
throw
|
|
5937
|
+
err_34 = _a.sent();
|
|
5938
|
+
console.log("perpClient setPool error:: ", err_34);
|
|
5939
|
+
throw err_34;
|
|
6127
5940
|
case 5: return [2, {
|
|
6128
5941
|
instructions: __spreadArray([], instructions, true),
|
|
6129
5942
|
additionalSigners: additionalSigners
|
|
@@ -6132,7 +5945,7 @@ var PerpetualsClient = (function () {
|
|
|
6132
5945
|
});
|
|
6133
5946
|
}); };
|
|
6134
5947
|
this.setPermissions = function (permissions) { return __awaiter(_this, void 0, void 0, function () {
|
|
6135
|
-
var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setPermissionsInstruction,
|
|
5948
|
+
var publicKey, preInstructions, instructions, postInstructions, additionalSigners, setPermissionsInstruction, err_35;
|
|
6136
5949
|
return __generator(this, function (_a) {
|
|
6137
5950
|
switch (_a.label) {
|
|
6138
5951
|
case 0:
|
|
@@ -6159,9 +5972,9 @@ var PerpetualsClient = (function () {
|
|
|
6159
5972
|
instructions.push(setPermissionsInstruction);
|
|
6160
5973
|
return [3, 4];
|
|
6161
5974
|
case 3:
|
|
6162
|
-
|
|
6163
|
-
console.log("perpClient setPool error:: ",
|
|
6164
|
-
throw
|
|
5975
|
+
err_35 = _a.sent();
|
|
5976
|
+
console.log("perpClient setPool error:: ", err_35);
|
|
5977
|
+
throw err_35;
|
|
6165
5978
|
case 4: return [2, {
|
|
6166
5979
|
instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
|
|
6167
5980
|
additionalSigners: additionalSigners
|
|
@@ -6170,7 +5983,7 @@ var PerpetualsClient = (function () {
|
|
|
6170
5983
|
});
|
|
6171
5984
|
}); };
|
|
6172
5985
|
this.reimburse = function (tokenMint, amountIn, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
|
6173
|
-
var custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, instructions, additionalSigners, custodyConfig, reimburse, _d, _e,
|
|
5986
|
+
var custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, instructions, additionalSigners, custodyConfig, reimburse, _d, _e, err_36;
|
|
6174
5987
|
var _f;
|
|
6175
5988
|
return __generator(this, function (_g) {
|
|
6176
5989
|
switch (_g.label) {
|
|
@@ -6230,9 +6043,9 @@ var PerpetualsClient = (function () {
|
|
|
6230
6043
|
instructions.push(reimburse);
|
|
6231
6044
|
return [3, 5];
|
|
6232
6045
|
case 4:
|
|
6233
|
-
|
|
6234
|
-
console.log("perpClient setPool error:: ",
|
|
6235
|
-
throw
|
|
6046
|
+
err_36 = _g.sent();
|
|
6047
|
+
console.log("perpClient setPool error:: ", err_36);
|
|
6048
|
+
throw err_36;
|
|
6236
6049
|
case 5: return [2, {
|
|
6237
6050
|
instructions: __spreadArray([], instructions, true),
|
|
6238
6051
|
additionalSigners: additionalSigners
|
|
@@ -6241,7 +6054,7 @@ var PerpetualsClient = (function () {
|
|
|
6241
6054
|
});
|
|
6242
6055
|
}); };
|
|
6243
6056
|
this.setInternalOraclePrice = function (tokenMint, price, expo, conf, ema, publishTime, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
|
6244
|
-
var instructions, additionalSigners, custodyConfig, setInternalOraclePrice,
|
|
6057
|
+
var instructions, additionalSigners, custodyConfig, setInternalOraclePrice, err_37;
|
|
6245
6058
|
return __generator(this, function (_a) {
|
|
6246
6059
|
switch (_a.label) {
|
|
6247
6060
|
case 0:
|
|
@@ -6274,9 +6087,9 @@ var PerpetualsClient = (function () {
|
|
|
6274
6087
|
instructions.push(setInternalOraclePrice);
|
|
6275
6088
|
return [3, 4];
|
|
6276
6089
|
case 3:
|
|
6277
|
-
|
|
6278
|
-
console.log("perpClient setInternalOracleAccount error:: ",
|
|
6279
|
-
throw
|
|
6090
|
+
err_37 = _a.sent();
|
|
6091
|
+
console.log("perpClient setInternalOracleAccount error:: ", err_37);
|
|
6092
|
+
throw err_37;
|
|
6280
6093
|
case 4: return [2, {
|
|
6281
6094
|
instructions: __spreadArray([], instructions, true),
|
|
6282
6095
|
additionalSigners: additionalSigners
|
|
@@ -6288,7 +6101,7 @@ var PerpetualsClient = (function () {
|
|
|
6288
6101
|
if (skipBalanceChecks === void 0) { skipBalanceChecks = false; }
|
|
6289
6102
|
if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
|
|
6290
6103
|
return __awaiter(_this, void 0, void 0, function () {
|
|
6291
|
-
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,
|
|
6104
|
+
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_38;
|
|
6292
6105
|
return __generator(this, function (_e) {
|
|
6293
6106
|
switch (_e.label) {
|
|
6294
6107
|
case 0:
|
|
@@ -6411,8 +6224,8 @@ var PerpetualsClient = (function () {
|
|
|
6411
6224
|
instructions.push(addCompoundingLiquidity);
|
|
6412
6225
|
return [3, 10];
|
|
6413
6226
|
case 9:
|
|
6414
|
-
|
|
6415
|
-
console.log("perpClient addCompoundingLiquidity error:: ",
|
|
6227
|
+
err_38 = _e.sent();
|
|
6228
|
+
console.log("perpClient addCompoundingLiquidity error:: ", err_38);
|
|
6416
6229
|
return [3, 10];
|
|
6417
6230
|
case 10: return [2, {
|
|
6418
6231
|
instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
|
|
@@ -6426,7 +6239,7 @@ var PerpetualsClient = (function () {
|
|
|
6426
6239
|
if (createUserATA === void 0) { createUserATA = true; }
|
|
6427
6240
|
if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
|
|
6428
6241
|
return __awaiter(_this, void 0, void 0, function () {
|
|
6429
|
-
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,
|
|
6242
|
+
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_39;
|
|
6430
6243
|
return __generator(this, function (_e) {
|
|
6431
6244
|
switch (_e.label) {
|
|
6432
6245
|
case 0:
|
|
@@ -6533,8 +6346,8 @@ var PerpetualsClient = (function () {
|
|
|
6533
6346
|
instructions.push(removeCompoundingLiquidity);
|
|
6534
6347
|
return [3, 8];
|
|
6535
6348
|
case 7:
|
|
6536
|
-
|
|
6537
|
-
console.log("perpClient removeCompoundingLiquidity error:: ",
|
|
6349
|
+
err_39 = _e.sent();
|
|
6350
|
+
console.log("perpClient removeCompoundingLiquidity error:: ", err_39);
|
|
6538
6351
|
return [3, 8];
|
|
6539
6352
|
case 8: return [2, {
|
|
6540
6353
|
instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
|
|
@@ -6547,7 +6360,7 @@ var PerpetualsClient = (function () {
|
|
|
6547
6360
|
this.migrateStake = function (amount, rewardTokenMint, poolConfig, createUserATA) {
|
|
6548
6361
|
if (createUserATA === void 0) { createUserATA = true; }
|
|
6549
6362
|
return __awaiter(_this, void 0, void 0, function () {
|
|
6550
|
-
var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, lpTokenMint, compoundingTokenMint, compoudingTokenAccount, _a, flpStakeAccount, poolStakedLpVault, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _b, custody, _c, _d, market, migrateStake,
|
|
6363
|
+
var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, lpTokenMint, compoundingTokenMint, compoudingTokenAccount, _a, flpStakeAccount, poolStakedLpVault, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _b, custody, _c, _d, market, migrateStake, err_40;
|
|
6551
6364
|
return __generator(this, function (_e) {
|
|
6552
6365
|
switch (_e.label) {
|
|
6553
6366
|
case 0:
|
|
@@ -6628,8 +6441,8 @@ var PerpetualsClient = (function () {
|
|
|
6628
6441
|
instructions.push(migrateStake);
|
|
6629
6442
|
return [3, 6];
|
|
6630
6443
|
case 5:
|
|
6631
|
-
|
|
6632
|
-
console.log("perpClient migrateStake error:: ",
|
|
6444
|
+
err_40 = _e.sent();
|
|
6445
|
+
console.log("perpClient migrateStake error:: ", err_40);
|
|
6633
6446
|
return [3, 6];
|
|
6634
6447
|
case 6: return [2, {
|
|
6635
6448
|
instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
|
|
@@ -6640,7 +6453,7 @@ var PerpetualsClient = (function () {
|
|
|
6640
6453
|
});
|
|
6641
6454
|
};
|
|
6642
6455
|
this.migrateFlp = function (amount, rewardTokenMint, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
|
6643
|
-
var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, lpTokenMint, compoundingTokenMint, compoudingTokenAccount, flpStakeAccount, poolStakedLpVault, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, migrateFlp,
|
|
6456
|
+
var publicKey, preInstructions, instructions, postInstructions, additionalSigners, rewardCustody, lpTokenMint, compoundingTokenMint, compoudingTokenAccount, flpStakeAccount, poolStakedLpVault, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, migrateFlp, err_41;
|
|
6644
6457
|
return __generator(this, function (_d) {
|
|
6645
6458
|
switch (_d.label) {
|
|
6646
6459
|
case 0:
|
|
@@ -6712,8 +6525,8 @@ var PerpetualsClient = (function () {
|
|
|
6712
6525
|
instructions.push(migrateFlp);
|
|
6713
6526
|
return [3, 4];
|
|
6714
6527
|
case 3:
|
|
6715
|
-
|
|
6716
|
-
console.log("perpClient migrateFlp error:: ",
|
|
6528
|
+
err_41 = _d.sent();
|
|
6529
|
+
console.log("perpClient migrateFlp error:: ", err_41);
|
|
6717
6530
|
return [3, 4];
|
|
6718
6531
|
case 4: return [2, {
|
|
6719
6532
|
instructions: __spreadArray(__spreadArray(__spreadArray([], preInstructions, true), instructions, true), postInstructions, true),
|
|
@@ -6725,7 +6538,7 @@ var PerpetualsClient = (function () {
|
|
|
6725
6538
|
this.compoundingFee = function (poolConfig, rewardTokenSymbol) {
|
|
6726
6539
|
if (rewardTokenSymbol === void 0) { rewardTokenSymbol = 'USDC'; }
|
|
6727
6540
|
return __awaiter(_this, void 0, void 0, function () {
|
|
6728
|
-
var instructions, additionalSigners, rewardCustody, lpTokenMint, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, compoundingFee,
|
|
6541
|
+
var instructions, additionalSigners, rewardCustody, lpTokenMint, custodyAccountMetas, custodyOracleAccountMetas, markets, _i, _a, custody, _b, _c, market, compoundingFee, err_42;
|
|
6729
6542
|
return __generator(this, function (_d) {
|
|
6730
6543
|
switch (_d.label) {
|
|
6731
6544
|
case 0:
|
|
@@ -6782,8 +6595,8 @@ var PerpetualsClient = (function () {
|
|
|
6782
6595
|
instructions.push(compoundingFee);
|
|
6783
6596
|
return [3, 4];
|
|
6784
6597
|
case 3:
|
|
6785
|
-
|
|
6786
|
-
console.log("perpClient compoundingFee error:: ",
|
|
6598
|
+
err_42 = _d.sent();
|
|
6599
|
+
console.log("perpClient compoundingFee error:: ", err_42);
|
|
6787
6600
|
return [3, 4];
|
|
6788
6601
|
case 4: return [2, {
|
|
6789
6602
|
instructions: __spreadArray([], instructions, true),
|
|
@@ -6794,7 +6607,7 @@ var PerpetualsClient = (function () {
|
|
|
6794
6607
|
});
|
|
6795
6608
|
};
|
|
6796
6609
|
this.renameFlp = function (flag, lpTokenName, lpTokenSymbol, lpTokenUri, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
|
6797
|
-
var publicKey, instructions, additionalSigners, lpTokenMint, lpMetadataAccount, renameFlp,
|
|
6610
|
+
var publicKey, instructions, additionalSigners, lpTokenMint, lpMetadataAccount, renameFlp, err_43;
|
|
6798
6611
|
return __generator(this, function (_a) {
|
|
6799
6612
|
switch (_a.label) {
|
|
6800
6613
|
case 0:
|
|
@@ -6832,8 +6645,8 @@ var PerpetualsClient = (function () {
|
|
|
6832
6645
|
instructions.push(renameFlp);
|
|
6833
6646
|
return [3, 4];
|
|
6834
6647
|
case 3:
|
|
6835
|
-
|
|
6836
|
-
console.log("perpClient renameFlp error:: ",
|
|
6648
|
+
err_43 = _a.sent();
|
|
6649
|
+
console.log("perpClient renameFlp error:: ", err_43);
|
|
6837
6650
|
return [3, 4];
|
|
6838
6651
|
case 4: return [2, {
|
|
6839
6652
|
instructions: __spreadArray([], instructions, true),
|
|
@@ -6843,7 +6656,7 @@ var PerpetualsClient = (function () {
|
|
|
6843
6656
|
});
|
|
6844
6657
|
}); };
|
|
6845
6658
|
this.initRewardDistribution = function (rewardSymbol, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
|
6846
|
-
var publicKey, rewardMint, instructions, additionalSigners, fbNftProgramData, rewardVault, rewardTokenAccount, transferAuthority, initRewardVault,
|
|
6659
|
+
var publicKey, rewardMint, instructions, additionalSigners, fbNftProgramData, rewardVault, rewardTokenAccount, transferAuthority, initRewardVault, err_44;
|
|
6847
6660
|
return __generator(this, function (_a) {
|
|
6848
6661
|
switch (_a.label) {
|
|
6849
6662
|
case 0:
|
|
@@ -6877,9 +6690,9 @@ var PerpetualsClient = (function () {
|
|
|
6877
6690
|
instructions.push(initRewardVault);
|
|
6878
6691
|
return [3, 4];
|
|
6879
6692
|
case 3:
|
|
6880
|
-
|
|
6881
|
-
console.log("rewardDistribution InitRewardVault error:: ",
|
|
6882
|
-
throw
|
|
6693
|
+
err_44 = _a.sent();
|
|
6694
|
+
console.log("rewardDistribution InitRewardVault error:: ", err_44);
|
|
6695
|
+
throw err_44;
|
|
6883
6696
|
case 4: return [2, {
|
|
6884
6697
|
instructions: __spreadArray([], instructions, true),
|
|
6885
6698
|
additionalSigners: additionalSigners
|
|
@@ -6888,7 +6701,7 @@ var PerpetualsClient = (function () {
|
|
|
6888
6701
|
});
|
|
6889
6702
|
}); };
|
|
6890
6703
|
this.updateCounterReward = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
6891
|
-
var publicKey, instructions, additionalSigners, rewardVault, updateCounter,
|
|
6704
|
+
var publicKey, instructions, additionalSigners, rewardVault, updateCounter, err_45;
|
|
6892
6705
|
return __generator(this, function (_a) {
|
|
6893
6706
|
switch (_a.label) {
|
|
6894
6707
|
case 0:
|
|
@@ -6911,9 +6724,9 @@ var PerpetualsClient = (function () {
|
|
|
6911
6724
|
instructions.push(updateCounter);
|
|
6912
6725
|
return [3, 4];
|
|
6913
6726
|
case 3:
|
|
6914
|
-
|
|
6915
|
-
console.log("rewardDistribution updateCounter error:: ",
|
|
6916
|
-
throw
|
|
6727
|
+
err_45 = _a.sent();
|
|
6728
|
+
console.log("rewardDistribution updateCounter error:: ", err_45);
|
|
6729
|
+
throw err_45;
|
|
6917
6730
|
case 4: return [2, {
|
|
6918
6731
|
instructions: __spreadArray([], instructions, true),
|
|
6919
6732
|
additionalSigners: additionalSigners
|
|
@@ -6922,7 +6735,7 @@ var PerpetualsClient = (function () {
|
|
|
6922
6735
|
});
|
|
6923
6736
|
}); };
|
|
6924
6737
|
this.rewardDistribution = function (counter, owner, rewardAmount, rewardSymbol, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
|
6925
|
-
var publicKey, rewardCustodyMint, instructions, additionalSigners, fundingAccount, rewardVault, rewardTokenAccount, rewardRecord, distributeReward,
|
|
6738
|
+
var publicKey, rewardCustodyMint, instructions, additionalSigners, fundingAccount, rewardVault, rewardTokenAccount, rewardRecord, distributeReward, err_46;
|
|
6926
6739
|
return __generator(this, function (_a) {
|
|
6927
6740
|
switch (_a.label) {
|
|
6928
6741
|
case 0:
|
|
@@ -6961,9 +6774,9 @@ var PerpetualsClient = (function () {
|
|
|
6961
6774
|
instructions.push(distributeReward);
|
|
6962
6775
|
return [3, 4];
|
|
6963
6776
|
case 3:
|
|
6964
|
-
|
|
6965
|
-
console.log("rewardDistribution distributeReward error:: ",
|
|
6966
|
-
throw
|
|
6777
|
+
err_46 = _a.sent();
|
|
6778
|
+
console.log("rewardDistribution distributeReward error:: ", err_46);
|
|
6779
|
+
throw err_46;
|
|
6967
6780
|
case 4: return [2, {
|
|
6968
6781
|
instructions: __spreadArray([], instructions, true),
|
|
6969
6782
|
additionalSigners: additionalSigners
|
|
@@ -6974,7 +6787,7 @@ var PerpetualsClient = (function () {
|
|
|
6974
6787
|
this.collectReward = function (counter, owner, rewardSymbol, poolConfig, createUserATA) {
|
|
6975
6788
|
if (createUserATA === void 0) { createUserATA = true; }
|
|
6976
6789
|
return __awaiter(_this, void 0, void 0, function () {
|
|
6977
|
-
var publicKey, rewardCustodyMint, instructions, additionalSigners, receivingTokenAccount, _a, rewardVault, rewardTokenAccount, rewardRecord, transferAuthority, collectRaffleReward,
|
|
6790
|
+
var publicKey, rewardCustodyMint, instructions, additionalSigners, receivingTokenAccount, _a, rewardVault, rewardTokenAccount, rewardRecord, transferAuthority, collectRaffleReward, err_47;
|
|
6978
6791
|
return __generator(this, function (_b) {
|
|
6979
6792
|
switch (_b.label) {
|
|
6980
6793
|
case 0:
|
|
@@ -7022,8 +6835,8 @@ var PerpetualsClient = (function () {
|
|
|
7022
6835
|
instructions.push(collectRaffleReward);
|
|
7023
6836
|
return [3, 6];
|
|
7024
6837
|
case 5:
|
|
7025
|
-
|
|
7026
|
-
throw
|
|
6838
|
+
err_47 = _b.sent();
|
|
6839
|
+
throw err_47;
|
|
7027
6840
|
case 6: return [2, {
|
|
7028
6841
|
instructions: __spreadArray([], instructions, true),
|
|
7029
6842
|
additionalSigners: additionalSigners
|