flash-sdk 2.43.1 → 2.44.1-alpha.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/CustodyAccount.d.ts +1 -1
- package/dist/MarketAccount.d.ts +4 -2
- package/dist/PerpetualsClient.d.ts +84 -58
- package/dist/PerpetualsClient.js +62 -37
- package/dist/PoolAccount.d.ts +2 -1
- package/dist/PoolAccount.js +1 -1
- package/dist/idl/perpetuals.d.ts +540 -56
- package/dist/idl/perpetuals.js +540 -56
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/PerpetualsClient.js
CHANGED
@@ -588,27 +588,34 @@ var PerpetualsClient = (function () {
|
|
588
588
|
}
|
589
589
|
});
|
590
590
|
}); };
|
591
|
-
this.removeCustody = function (poolName, tokenMint, ratios) { return __awaiter(_this, void 0, void 0, function () {
|
591
|
+
this.removeCustody = function (poolName, tokenMint, ratios, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
592
|
+
var custodyConfig, userReceivingTokenAccount;
|
592
593
|
return __generator(this, function (_a) {
|
593
594
|
switch (_a.label) {
|
594
|
-
case 0:
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
595
|
+
case 0:
|
596
|
+
custodyConfig = poolConfig.custodies.find(function (f) { return f.mintKey.equals(tokenMint); });
|
597
|
+
userReceivingTokenAccount = (0, spl_token_1.getAssociatedTokenAddressSync)(tokenMint, this.admin, true);
|
598
|
+
return [4, this.program.methods
|
599
|
+
.removeCustody({ ratios: ratios })
|
600
|
+
.accounts({
|
601
|
+
admin: this.admin,
|
602
|
+
receivingAccount: userReceivingTokenAccount,
|
603
|
+
multisig: this.multisig.publicKey,
|
604
|
+
transferAuthority: this.authority.publicKey,
|
605
|
+
perpetuals: this.perpetuals.publicKey,
|
606
|
+
pool: this.getPoolKey(poolName),
|
607
|
+
custody: this.getCustodyKey(poolName, tokenMint),
|
608
|
+
custodyTokenAccount: this.getCustodyTokenAccountKey(poolName, tokenMint),
|
609
|
+
custodyOracleAccount: this.useExtOracleAccount ? custodyConfig.extOracleAccount : custodyConfig.intOracleAccount,
|
610
|
+
systemProgram: web3_js_1.SystemProgram.programId,
|
611
|
+
tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
612
|
+
ixSysvar: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY,
|
613
|
+
})
|
614
|
+
.rpc()
|
615
|
+
.catch(function (err) {
|
616
|
+
console.error(err);
|
617
|
+
throw err;
|
618
|
+
})];
|
612
619
|
case 1:
|
613
620
|
_a.sent();
|
614
621
|
return [2];
|
@@ -1234,8 +1241,9 @@ var PerpetualsClient = (function () {
|
|
1234
1241
|
}
|
1235
1242
|
return collateralInInputToken;
|
1236
1243
|
};
|
1237
|
-
this.getDecreaseSizeCollateralAndFeeSync = function (positionAccount, marketCorrelation, sizeDeltaUsd, keepLevSame, targetPrice, targetEmaPrice, marketConfig, targetCustodyAccount, collateralPrice, collateralEmaPrice, collateralCustodyAccount, currentTimestamp, side, poolConfig, discountBps) {
|
1244
|
+
this.getDecreaseSizeCollateralAndFeeSync = function (positionAccount, marketCorrelation, sizeDeltaUsd, keepLevSame, targetPrice, targetEmaPrice, marketConfig, targetCustodyAccount, collateralPrice, collateralEmaPrice, collateralCustodyAccount, currentTimestamp, side, poolConfig, discountBps, debugLogs) {
|
1238
1245
|
if (discountBps === void 0) { discountBps = constants_1.BN_ZERO; }
|
1246
|
+
if (debugLogs === void 0) { debugLogs = false; }
|
1239
1247
|
if (!marketConfig.marketAccount.equals(positionAccount.market)) {
|
1240
1248
|
throw new Error("marketCustodyAccount mismatch");
|
1241
1249
|
}
|
@@ -1272,6 +1280,9 @@ var PerpetualsClient = (function () {
|
|
1272
1280
|
var liabilityUsd = newPnl.lossUsd.add(totalFeesUsd);
|
1273
1281
|
var assetsUsd = newPnl.profitUsd.add(currentCollateralUsd);
|
1274
1282
|
var closeAmount, feesAmount;
|
1283
|
+
if (debugLogs) {
|
1284
|
+
console.log("assetsUsd.sub(liabilityUsd):", collateralCustodyAccount.decimals, assetsUsd.toString(), liabilityUsd.toString(), assetsUsd.sub(liabilityUsd).toString());
|
1285
|
+
}
|
1275
1286
|
if (assetsUsd.gte(liabilityUsd)) {
|
1276
1287
|
closeAmount = collateralMinMaxPrice.max.getTokenAmount(assetsUsd.sub(liabilityUsd), collateralCustodyAccount.decimals);
|
1277
1288
|
feesAmount = collateralMinMaxPrice.min.getTokenAmount(totalFeesUsd, collateralCustodyAccount.decimals);
|
@@ -1306,11 +1317,18 @@ var PerpetualsClient = (function () {
|
|
1306
1317
|
var collateralAmountReceived = closeAmount;
|
1307
1318
|
var collateralAmountRecievedUsd = collateralMinMaxPrice.min.getAssetAmountUsd(collateralAmountReceived, collateralCustodyAccount.decimals);
|
1308
1319
|
var maxWithdrawableAmount = _this.getMaxWithdrawableAmountSyncInternal(newPosition, targetPrice, targetEmaPrice, targetCustodyAccount, collateralPrice, collateralEmaPrice, collateralCustodyAccount, currentTimestamp, poolConfig, closeAmount);
|
1320
|
+
if (debugLogs) {
|
1321
|
+
console.log("maxWithdrawableAmount ", maxWithdrawableAmount.toString(), keepLevSame);
|
1322
|
+
console.log("collateralAmountReceived ", collateralAmountReceived.toString(), keepLevSame);
|
1323
|
+
}
|
1309
1324
|
if (collateralAmountReceived.lt(constants_1.BN_ZERO)) {
|
1310
1325
|
collateralAmountReceived = constants_1.BN_ZERO;
|
1311
1326
|
collateralAmountRecievedUsd = constants_1.BN_ZERO;
|
1312
1327
|
}
|
1313
1328
|
else if (collateralAmountReceived.gt(maxWithdrawableAmount)) {
|
1329
|
+
if (debugLogs) {
|
1330
|
+
console.log("exceeding to redicing maxWithdrawableAmount ", maxWithdrawableAmount.toString(), collateralAmountReceived.toString());
|
1331
|
+
}
|
1314
1332
|
collateralAmountReceived = maxWithdrawableAmount;
|
1315
1333
|
collateralAmountRecievedUsd = collateralMinMaxPrice.min.getAssetAmountUsd(maxWithdrawableAmount, collateralCustodyAccount.decimals);
|
1316
1334
|
}
|
@@ -1997,9 +2015,11 @@ var PerpetualsClient = (function () {
|
|
1997
2015
|
if (markets.length != poolAccount.markets.length || !markets[index].publicKey.equals(poolAccount.markets[index])) {
|
1998
2016
|
throw Error("incorrect markets");
|
1999
2017
|
}
|
2018
|
+
var targetCustodyId = poolAccount.getCustodyId(markets[index].targetCustody);
|
2019
|
+
var collateralCustodyId = poolAccount.getCustodyId(markets[index].collateralCustody);
|
2000
2020
|
var position = markets[index].getCollectivePosition();
|
2001
|
-
var collectivePnl = _this.getPnlSync(position, tokenPrices[
|
2002
|
-
var collateralMinMaxPrice = _this.getMinAndMaxOraclePriceSync(tokenPrices[
|
2021
|
+
var collectivePnl = _this.getPnlSync(position, tokenPrices[targetCustodyId], tokenEmaPrices[targetCustodyId], custodies[targetCustodyId], tokenPrices[collateralCustodyId], tokenEmaPrices[collateralCustodyId], custodies[collateralCustodyId], currentTime, custodies[targetCustodyId].pricing.delaySeconds, poolConfig);
|
2022
|
+
var collateralMinMaxPrice = _this.getMinAndMaxOraclePriceSync(tokenPrices[collateralCustodyId], tokenEmaPrices[collateralCustodyId], custodies[collateralCustodyId]);
|
2003
2023
|
var collectiveCollateralUsd = collateralMinMaxPrice.min.getAssetAmountUsd(position.collateralAmount, position.collateralDecimals);
|
2004
2024
|
var collectiveLossUsd = anchor_1.BN.min(collectivePnl.lossUsd, collectiveCollateralUsd);
|
2005
2025
|
poolEquityUsd = (poolEquityUsd.add(collectiveLossUsd)).sub(collectivePnl.profitUsd);
|
@@ -6049,11 +6069,11 @@ var PerpetualsClient = (function () {
|
|
6049
6069
|
});
|
6050
6070
|
});
|
6051
6071
|
};
|
6052
|
-
this.placeLimitOrder = function (targetSymbol, collateralSymbol, reserveSymbol, side, limitPrice, reserveAmount, sizeAmount, stopLossPrice, takeProfitPrice,
|
6072
|
+
this.placeLimitOrder = function (targetSymbol, collateralSymbol, reserveSymbol, receiveSymbol, side, limitPrice, reserveAmount, sizeAmount, stopLossPrice, takeProfitPrice, poolConfig, skipBalanceChecks, ephemeralSignerPubkey) {
|
6053
6073
|
if (skipBalanceChecks === void 0) { skipBalanceChecks = false; }
|
6054
6074
|
if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
|
6055
6075
|
return __awaiter(_this, void 0, void 0, function () {
|
6056
|
-
var publicKey, targetCustodyConfig, reserveCustodyConfig, collateralCustodyConfig, marketAccount, userReserveTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, accCreationLamports, lamports, unWrappedSolBalance, _a, tokenAccountBalance, _b, positionAccount, orderAccount, placeLimitOrder, err_40;
|
6076
|
+
var publicKey, targetCustodyConfig, reserveCustodyConfig, collateralCustodyConfig, receiveCustodyConfig, marketAccount, userReserveTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, accCreationLamports, lamports, unWrappedSolBalance, _a, tokenAccountBalance, _b, positionAccount, orderAccount, placeLimitOrder, err_40;
|
6057
6077
|
return __generator(this, function (_c) {
|
6058
6078
|
switch (_c.label) {
|
6059
6079
|
case 0:
|
@@ -6061,6 +6081,7 @@ var PerpetualsClient = (function () {
|
|
6061
6081
|
targetCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(targetSymbol).mintKey); });
|
6062
6082
|
reserveCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(reserveSymbol).mintKey); });
|
6063
6083
|
collateralCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(collateralSymbol).mintKey); });
|
6084
|
+
receiveCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(receiveSymbol).mintKey); });
|
6064
6085
|
marketAccount = poolConfig.getMarketPk(targetCustodyConfig.custodyAccount, collateralCustodyConfig.custodyAccount, side);
|
6065
6086
|
return [4, (0, spl_token_1.getAssociatedTokenAddress)(poolConfig.getTokenFromSymbol(reserveSymbol).mintKey, publicKey)];
|
6066
6087
|
case 1:
|
@@ -6128,8 +6149,7 @@ var PerpetualsClient = (function () {
|
|
6128
6149
|
reserveAmount: reserveAmount,
|
6129
6150
|
sizeAmount: sizeAmount,
|
6130
6151
|
stopLossPrice: stopLossPrice,
|
6131
|
-
takeProfitPrice: takeProfitPrice
|
6132
|
-
receiveCustodyId: receiveCustodyId
|
6152
|
+
takeProfitPrice: takeProfitPrice
|
6133
6153
|
})
|
6134
6154
|
.accounts({
|
6135
6155
|
owner: publicKey,
|
@@ -6145,6 +6165,7 @@ var PerpetualsClient = (function () {
|
|
6145
6165
|
reserveCustody: reserveCustodyConfig.custodyAccount,
|
6146
6166
|
reserveOracleAccount: this.useExtOracleAccount ? reserveCustodyConfig.extOracleAccount : reserveCustodyConfig.intOracleAccount,
|
6147
6167
|
reserveCustodyTokenAccount: reserveCustodyConfig.tokenAccount,
|
6168
|
+
receiveCustody: receiveCustodyConfig.custodyAccount,
|
6148
6169
|
systemProgram: web3_js_1.SystemProgram.programId,
|
6149
6170
|
tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
6150
6171
|
eventAuthority: this.eventAuthority.publicKey,
|
@@ -6168,11 +6189,11 @@ var PerpetualsClient = (function () {
|
|
6168
6189
|
});
|
6169
6190
|
});
|
6170
6191
|
};
|
6171
|
-
this.editLimitOrder = function (targetSymbol, collateralSymbol, reserveSymbol, side, orderId, limitPrice, sizeAmount, stopLossPrice, takeProfitPrice,
|
6192
|
+
this.editLimitOrder = function (targetSymbol, collateralSymbol, reserveSymbol, receiveSymbol, side, orderId, limitPrice, sizeAmount, stopLossPrice, takeProfitPrice, poolConfig, createUserATA, ephemeralSignerPubkey) {
|
6172
6193
|
if (createUserATA === void 0) { createUserATA = true; }
|
6173
6194
|
if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
|
6174
6195
|
return __awaiter(_this, void 0, void 0, function () {
|
6175
|
-
var publicKey, targetCustodyConfig, reserveCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, wrappedSolAccount, userReceivingTokenAccount, lamports, _a, positionAccount, orderAccount, editLimitOrder, err_41;
|
6196
|
+
var publicKey, targetCustodyConfig, reserveCustodyConfig, collateralCustodyConfig, receiveCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, wrappedSolAccount, userReceivingTokenAccount, lamports, _a, positionAccount, orderAccount, editLimitOrder, err_41;
|
6176
6197
|
return __generator(this, function (_b) {
|
6177
6198
|
switch (_b.label) {
|
6178
6199
|
case 0:
|
@@ -6180,6 +6201,7 @@ var PerpetualsClient = (function () {
|
|
6180
6201
|
targetCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(targetSymbol).mintKey); });
|
6181
6202
|
reserveCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(reserveSymbol).mintKey); });
|
6182
6203
|
collateralCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(collateralSymbol).mintKey); });
|
6204
|
+
receiveCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(receiveSymbol).mintKey); });
|
6183
6205
|
marketAccount = poolConfig.getMarketPk(targetCustodyConfig.custodyAccount, collateralCustodyConfig.custodyAccount, side);
|
6184
6206
|
preInstructions = [];
|
6185
6207
|
instructions = [];
|
@@ -6230,12 +6252,12 @@ var PerpetualsClient = (function () {
|
|
6230
6252
|
limitPrice: limitPrice,
|
6231
6253
|
sizeAmount: sizeAmount,
|
6232
6254
|
stopLossPrice: stopLossPrice,
|
6233
|
-
takeProfitPrice: takeProfitPrice
|
6234
|
-
receiveCustodyId: receiveCustodyId
|
6255
|
+
takeProfitPrice: takeProfitPrice
|
6235
6256
|
})
|
6236
6257
|
.accounts({
|
6237
6258
|
owner: publicKey,
|
6238
6259
|
feePayer: publicKey,
|
6260
|
+
receivingAccount: reserveSymbol == 'SOL' ? (ephemeralSignerPubkey ? ephemeralSignerPubkey : wrappedSolAccount.publicKey) : userReceivingTokenAccount,
|
6239
6261
|
transferAuthority: poolConfig.transferAuthority,
|
6240
6262
|
perpetuals: poolConfig.perpetuals,
|
6241
6263
|
pool: poolConfig.poolAddress,
|
@@ -6247,7 +6269,7 @@ var PerpetualsClient = (function () {
|
|
6247
6269
|
reserveCustody: reserveCustodyConfig.custodyAccount,
|
6248
6270
|
reserveOracleAccount: this.useExtOracleAccount ? reserveCustodyConfig.extOracleAccount : reserveCustodyConfig.intOracleAccount,
|
6249
6271
|
reserveCustodyTokenAccount: reserveCustodyConfig.tokenAccount,
|
6250
|
-
|
6272
|
+
receiveCustody: receiveCustodyConfig.custodyAccount,
|
6251
6273
|
tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
6252
6274
|
eventAuthority: this.eventAuthority.publicKey,
|
6253
6275
|
program: this.programId,
|
@@ -6403,14 +6425,15 @@ var PerpetualsClient = (function () {
|
|
6403
6425
|
});
|
6404
6426
|
});
|
6405
6427
|
};
|
6406
|
-
this.placeTriggerOrder = function (targetSymbol, collateralSymbol, side, triggerPrice, deltaSizeAmount, isStopLoss,
|
6407
|
-
var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, placeTriggerOrder, err_44;
|
6428
|
+
this.placeTriggerOrder = function (targetSymbol, collateralSymbol, receiveSymbol, side, triggerPrice, deltaSizeAmount, isStopLoss, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
6429
|
+
var publicKey, targetCustodyConfig, collateralCustodyConfig, receivingCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, placeTriggerOrder, err_44;
|
6408
6430
|
return __generator(this, function (_a) {
|
6409
6431
|
switch (_a.label) {
|
6410
6432
|
case 0:
|
6411
6433
|
publicKey = this.provider.wallet.publicKey;
|
6412
6434
|
targetCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(targetSymbol).mintKey); });
|
6413
6435
|
collateralCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(collateralSymbol).mintKey); });
|
6436
|
+
receivingCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(receiveSymbol).mintKey); });
|
6414
6437
|
marketAccount = poolConfig.getMarketPk(targetCustodyConfig.custodyAccount, collateralCustodyConfig.custodyAccount, side);
|
6415
6438
|
preInstructions = [];
|
6416
6439
|
instructions = [];
|
@@ -6425,8 +6448,7 @@ var PerpetualsClient = (function () {
|
|
6425
6448
|
.placeTriggerOrder({
|
6426
6449
|
triggerPrice: triggerPrice,
|
6427
6450
|
deltaSizeAmount: deltaSizeAmount,
|
6428
|
-
isStopLoss: isStopLoss
|
6429
|
-
receiveCustodyId: receiveCustodyId
|
6451
|
+
isStopLoss: isStopLoss
|
6430
6452
|
})
|
6431
6453
|
.accounts({
|
6432
6454
|
owner: publicKey,
|
@@ -6440,6 +6462,7 @@ var PerpetualsClient = (function () {
|
|
6440
6462
|
targetOracleAccount: this.useExtOracleAccount ? targetCustodyConfig.extOracleAccount : targetCustodyConfig.intOracleAccount,
|
6441
6463
|
collateralCustody: collateralCustodyConfig.custodyAccount,
|
6442
6464
|
collateralOracleAccount: this.useExtOracleAccount ? collateralCustodyConfig.extOracleAccount : collateralCustodyConfig.intOracleAccount,
|
6465
|
+
receiveCustody: receivingCustodyConfig.custodyAccount,
|
6443
6466
|
systemProgram: web3_js_1.SystemProgram.programId,
|
6444
6467
|
eventAuthority: this.eventAuthority.publicKey,
|
6445
6468
|
program: this.programId,
|
@@ -6461,14 +6484,15 @@ var PerpetualsClient = (function () {
|
|
6461
6484
|
}
|
6462
6485
|
});
|
6463
6486
|
}); };
|
6464
|
-
this.editTriggerOrder = function (targetSymbol, collateralSymbol, side, orderId, triggerPrice, deltaSizeAmount, isStopLoss, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
6465
|
-
var publicKey, targetCustodyConfig, collateralCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, editTriggerOrder, err_45;
|
6487
|
+
this.editTriggerOrder = function (targetSymbol, collateralSymbol, receiveSymbol, side, orderId, triggerPrice, deltaSizeAmount, isStopLoss, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
6488
|
+
var publicKey, targetCustodyConfig, collateralCustodyConfig, receivingCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, editTriggerOrder, err_45;
|
6466
6489
|
return __generator(this, function (_a) {
|
6467
6490
|
switch (_a.label) {
|
6468
6491
|
case 0:
|
6469
6492
|
publicKey = this.provider.wallet.publicKey;
|
6470
6493
|
targetCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(targetSymbol).mintKey); });
|
6471
6494
|
collateralCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(collateralSymbol).mintKey); });
|
6495
|
+
receivingCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(receiveSymbol).mintKey); });
|
6472
6496
|
marketAccount = poolConfig.getMarketPk(targetCustodyConfig.custodyAccount, collateralCustodyConfig.custodyAccount, side);
|
6473
6497
|
preInstructions = [];
|
6474
6498
|
instructions = [];
|
@@ -6497,6 +6521,7 @@ var PerpetualsClient = (function () {
|
|
6497
6521
|
targetOracleAccount: this.useExtOracleAccount ? targetCustodyConfig.extOracleAccount : targetCustodyConfig.intOracleAccount,
|
6498
6522
|
collateralCustody: collateralCustodyConfig.custodyAccount,
|
6499
6523
|
collateralOracleAccount: this.useExtOracleAccount ? collateralCustodyConfig.extOracleAccount : collateralCustodyConfig.intOracleAccount,
|
6524
|
+
receiveCustody: receivingCustodyConfig.custodyAccount,
|
6500
6525
|
eventAuthority: this.eventAuthority.publicKey,
|
6501
6526
|
program: this.programId,
|
6502
6527
|
ixSysvar: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY
|
package/dist/PoolAccount.d.ts
CHANGED
@@ -22,6 +22,7 @@ export declare class PoolAccount implements Pool {
|
|
22
22
|
lpMintBump: number;
|
23
23
|
stakedLpVaultBump: number;
|
24
24
|
vpVolumeFactor: number;
|
25
|
+
uniqueCustodyCount: number;
|
25
26
|
padding: number[];
|
26
27
|
stakingFeeBoostBps: BN[];
|
27
28
|
compoundingMint: PublicKey;
|
@@ -32,5 +33,5 @@ export declare class PoolAccount implements Pool {
|
|
32
33
|
constructor(publicKey: PublicKey, parseData: Pool);
|
33
34
|
static from(publicKey: PublicKey, parseData: Pool): PoolAccount;
|
34
35
|
updatePoolData(parseData: Pool): void;
|
35
|
-
|
36
|
+
getCustodyId(custodyKey: PublicKey): number;
|
36
37
|
}
|
package/dist/PoolAccount.js
CHANGED
@@ -12,7 +12,7 @@ var PoolAccount = (function () {
|
|
12
12
|
PoolAccount.prototype.updatePoolData = function (parseData) {
|
13
13
|
Object.assign(this, parseData);
|
14
14
|
};
|
15
|
-
PoolAccount.prototype.
|
15
|
+
PoolAccount.prototype.getCustodyId = function (custodyKey) {
|
16
16
|
return this.custodies.findIndex(function (i) { return i.toBase58() == custodyKey.toBase58(); });
|
17
17
|
};
|
18
18
|
return PoolAccount;
|