@0dotxyz/p0-ts-sdk 2.5.5-alpha.0 → 2.5.5-alpha.2
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/index.cjs +23 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +23 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -70225,6 +70225,13 @@ async function buildInnerIxs(ctx, positions, isSync) {
|
|
|
70225
70225
|
withdrawIxs.push(...legs.withdrawIxs);
|
|
70226
70226
|
depositIxs.push(...legs.depositIxs);
|
|
70227
70227
|
}
|
|
70228
|
+
const transferredKaminoPks = collateral.filter((p) => p.bank.config.assetTag === 3 /* KAMINO */).map((p) => p.bankAddress);
|
|
70229
|
+
const kaminoReRefreshIxs = transferredKaminoPks.length > 0 ? makeRefreshKaminoBanksIxs(
|
|
70230
|
+
ctx.accountA,
|
|
70231
|
+
ctx.bankMap,
|
|
70232
|
+
transferredKaminoPks,
|
|
70233
|
+
ctx.bankMetadataMap
|
|
70234
|
+
).instructions : [];
|
|
70228
70235
|
const borrowedSoFar = [];
|
|
70229
70236
|
for (const position of debts) {
|
|
70230
70237
|
const { bank, tokenProgram } = position;
|
|
@@ -70269,7 +70276,14 @@ async function buildInnerIxs(ctx, positions, isSync) {
|
|
|
70269
70276
|
});
|
|
70270
70277
|
repayIxs.push(...repay.instructions);
|
|
70271
70278
|
}
|
|
70272
|
-
return [
|
|
70279
|
+
return [
|
|
70280
|
+
...CU_IXS(),
|
|
70281
|
+
...withdrawIxs,
|
|
70282
|
+
...kaminoReRefreshIxs,
|
|
70283
|
+
...depositIxs,
|
|
70284
|
+
...borrowIxs,
|
|
70285
|
+
...repayIxs
|
|
70286
|
+
];
|
|
70273
70287
|
}
|
|
70274
70288
|
async function buildTransferFlashloanTx(args) {
|
|
70275
70289
|
const { program, accountA, projectedActiveBanksA, innerIxs, preIxs, blockhash, luts } = args;
|
|
@@ -70396,8 +70410,15 @@ async function makeTransferPositionsTx(params) {
|
|
|
70396
70410
|
)
|
|
70397
70411
|
);
|
|
70398
70412
|
}
|
|
70413
|
+
const destinationOnlyBalances = accountB.balances.filter(
|
|
70414
|
+
(b) => b.active && !accountA.balances.some((a) => a.active && a.bankPk.equals(b.bankPk))
|
|
70415
|
+
);
|
|
70416
|
+
const crankBalanceView = {
|
|
70417
|
+
...accountA,
|
|
70418
|
+
balances: [...accountA.balances, ...destinationOnlyBalances]
|
|
70419
|
+
};
|
|
70399
70420
|
const { instructions: updateFeedIxs, luts: feedLuts } = await makeSmartCrankSwbFeedIx({
|
|
70400
|
-
marginfiAccount:
|
|
70421
|
+
marginfiAccount: crankBalanceView,
|
|
70401
70422
|
bankMap,
|
|
70402
70423
|
oraclePrices,
|
|
70403
70424
|
assetShareValueMultiplierByBank,
|