@0dotxyz/p0-ts-sdk 2.0.0-alpha.2 → 2.0.0-alpha.4

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 CHANGED
@@ -13359,6 +13359,7 @@ var EmodeTag = /* @__PURE__ */ ((EmodeTag3) => {
13359
13359
  EmodeTag3[EmodeTag3["SOL"] = 501] = "SOL";
13360
13360
  EmodeTag3[EmodeTag3["LST_T1"] = 1571] = "LST_T1";
13361
13361
  EmodeTag3[EmodeTag3["LST_T2"] = 1572] = "LST_T2";
13362
+ EmodeTag3[EmodeTag3["LST_PT"] = 15787] = "LST_PT";
13362
13363
  EmodeTag3[EmodeTag3["JLP"] = 619] = "JLP";
13363
13364
  EmodeTag3[EmodeTag3["STABLE_T1"] = 57481] = "STABLE_T1";
13364
13365
  EmodeTag3[EmodeTag3["STABLE_T2"] = 57482] = "STABLE_T2";
@@ -14181,6 +14182,18 @@ function parseEmodeTag(emodeTagRaw) {
14181
14182
  return 1571 /* LST_T1 */;
14182
14183
  case 1572:
14183
14184
  return 1572 /* LST_T2 */;
14185
+ case 15787:
14186
+ return 15787 /* LST_PT */;
14187
+ case 619:
14188
+ return 619 /* JLP */;
14189
+ case 57481:
14190
+ return 57481 /* STABLE_T1 */;
14191
+ case 57482:
14192
+ return 57482 /* STABLE_T2 */;
14193
+ case 871:
14194
+ return 871 /* BTC_T1 */;
14195
+ case 872:
14196
+ return 872 /* BTC_T2 */;
14184
14197
  case 0:
14185
14198
  default:
14186
14199
  return 0 /* UNSET */;
@@ -40760,14 +40773,8 @@ var SEED_USER_STATE = "user";
40760
40773
  function getAllDerivedKaminoAccounts(lendingMarket, reserveLiquidityMint) {
40761
40774
  return {
40762
40775
  lendingMarketAuthority: deriveLendingMarketAuthority(lendingMarket)[0],
40763
- reserveLiquiditySupply: deriveReserveLiquiditySupply(
40764
- lendingMarket,
40765
- reserveLiquidityMint
40766
- )[0],
40767
- reserveCollateralMint: deriveReserveCollateralMint(
40768
- lendingMarket,
40769
- reserveLiquidityMint
40770
- )[0],
40776
+ reserveLiquiditySupply: deriveReserveLiquiditySupply(lendingMarket, reserveLiquidityMint)[0],
40777
+ reserveCollateralMint: deriveReserveCollateralMint(lendingMarket, reserveLiquidityMint)[0],
40771
40778
  reserveDestinationDepositCollateral: deriveReserveCollateralSupply(
40772
40779
  lendingMarket,
40773
40780
  reserveLiquidityMint
@@ -42097,12 +42104,10 @@ async function makeKaminoWithdrawIx3({
42097
42104
  }
42098
42105
  const healthAccounts = withdrawAll ? computeHealthCheckAccounts(marginfiAccount.balances, bankMap, [], [bank.address]) : computeHealthCheckAccounts(marginfiAccount.balances, bankMap, [bank.address], []);
42099
42106
  const lendingMarket = reserve.lendingMarket;
42100
- const {
42101
- lendingMarketAuthority,
42102
- reserveLiquiditySupply,
42103
- reserveCollateralMint,
42104
- reserveDestinationDepositCollateral
42105
- } = getAllDerivedKaminoAccounts(reserve.lendingMarket, bank.mint);
42107
+ const reserveLiquiditySupply = reserve.liquidity.supplyVault;
42108
+ const reserveCollateralMint = reserve.collateral.mintPubkey;
42109
+ const reserveDestinationDepositCollateral = reserve.collateral.supplyVault;
42110
+ const { lendingMarketAuthority } = getAllDerivedKaminoAccounts(reserve.lendingMarket, bank.mint);
42106
42111
  if (!bank.kaminoIntegrationAccounts) {
42107
42112
  throw new Error("Bank has no kamino integration accounts");
42108
42113
  }
@@ -42695,12 +42700,10 @@ async function makeKaminoDepositIx3({
42695
42700
  const wSolBalanceUi = opts.wSolBalanceUi ?? 0;
42696
42701
  const depositIxs = [];
42697
42702
  const userTokenAtaPk = getAssociatedTokenAddressSync(bank.mint, authority, true, tokenProgram);
42698
- const {
42699
- lendingMarketAuthority,
42700
- reserveLiquiditySupply,
42701
- reserveCollateralMint,
42702
- reserveDestinationDepositCollateral
42703
- } = getAllDerivedKaminoAccounts(reserve.lendingMarket, bank.mint);
42703
+ const reserveLiquiditySupply = reserve.liquidity.supplyVault;
42704
+ const reserveCollateralMint = reserve.collateral.mintPubkey;
42705
+ const reserveDestinationDepositCollateral = reserve.collateral.supplyVault;
42706
+ const { lendingMarketAuthority } = getAllDerivedKaminoAccounts(reserve.lendingMarket, bank.mint);
42704
42707
  if (bank.mint.equals(NATIVE_MINT) && wrapAndUnwrapSol) {
42705
42708
  depositIxs.push(...makeWrapSolIxs(authority, new BigNumber4__default.default(amount).minus(wSolBalanceUi)));
42706
42709
  }