@0dotxyz/p0-ts-sdk 2.2.0 → 2.2.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.js CHANGED
@@ -21347,7 +21347,10 @@ function computeProjectedActiveBalancesNoCpi(balances, instructions2, program, b
21347
21347
  if (!bank) {
21348
21348
  throw Error(`Bank ${targetBank.toBase58()} not found in bankMap`);
21349
21349
  }
21350
- const withdrawShares = getAssetShares(bank, withdrawTokenAmount);
21350
+ const isKaminoWithdraw = decoded.name === "kaminoWithdraw";
21351
+ const assetShareValueMultiplier = isKaminoWithdraw ? new BigNumber3(1) : assetShareValueMultiplierByBank.get(targetBank.toBase58()) ?? new BigNumber3(1);
21352
+ const cTokenAmount = withdrawTokenAmount.div(assetShareValueMultiplier);
21353
+ const withdrawShares = getAssetShares(bank, cTokenAmount);
21351
21354
  targetBalance.assetShares = BigNumber3.max(
21352
21355
  0,
21353
21356
  targetBalance.assetShares.minus(withdrawShares)
@@ -47984,7 +47987,7 @@ async function buildSwapCollateralFlashloanTx({
47984
47987
  authority: marginfiAccount.authority,
47985
47988
  reserve,
47986
47989
  withdrawAll: isFullWithdraw,
47987
- isSync: true,
47990
+ isSync: false,
47988
47991
  opts: {
47989
47992
  createAtas: false,
47990
47993
  wrapAndUnwrapSol: false,
@@ -48059,7 +48062,7 @@ async function buildSwapCollateralFlashloanTx({
48059
48062
  marginfiAccount,
48060
48063
  authority: marginfiAccount.authority,
48061
48064
  withdrawAll: isFullWithdraw,
48062
- isSync: true,
48065
+ isSync: false,
48063
48066
  opts: {
48064
48067
  createAtas: false,
48065
48068
  wrapAndUnwrapSol: false,
@@ -48222,7 +48225,7 @@ async function buildSwapCollateralFlashloanTx({
48222
48225
  addressLookupTableAccounts: luts,
48223
48226
  blockhash,
48224
48227
  ixs: allNonFlIxs,
48225
- isSync: true
48228
+ isSync: false
48226
48229
  });
48227
48230
  const txSize = getTxSize(flashloanTx);
48228
48231
  const totalKeys = getTotalAccountKeys(flashloanTx);
@@ -49126,7 +49129,7 @@ function computeMaxWithdrawForBank(params) {
49126
49129
  const maxWithdraw = initUntiedCollateralForBank.div(initWeightedPrice);
49127
49130
  return maxWithdraw;
49128
49131
  }
49129
- var TITAN_FEE_WALLET = new PublicKey("6ryqDDCwKFZfSiHQrYRkjTEarbsLjg9TmuFg1RJorBk3");
49132
+ var TITAN_FEE_WALLET = new PublicKey("FEES6XLN7dMz2iBwKab9Hri9Kwc4WJ6TmDAiT4BNhyej");
49130
49133
  var getTitanFeeAccount = (mint) => {
49131
49134
  return getAssociatedTokenAddressSync(mint, TITAN_FEE_WALLET, true);
49132
49135
  };