@0dotxyz/p0-ts-sdk 2.8.3-alpha.0 → 2.8.3

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
@@ -54864,8 +54864,6 @@ var SWAP_ADAPTERS = {
54864
54864
  function getSwapAdapter(provider) {
54865
54865
  return SWAP_ADAPTERS[provider];
54866
54866
  }
54867
-
54868
- // src/services/account/services/swap-engine/swap-engine.service.ts
54869
54867
  function resolveAdapters(req, predicate) {
54870
54868
  const resolved = [];
54871
54869
  for (const entry of req.providers) {
@@ -54909,7 +54907,18 @@ async function runSwapEngine(req) {
54909
54907
  failures.join("; ") || "No swap route available"
54910
54908
  );
54911
54909
  }
54912
- const candidates = routes.map((route) => annotateFit(route, req));
54910
+ const wsolAta = getAssociatedTokenAddressSync(NATIVE_MINT, req.taker, true);
54911
+ const isProviderSolWrapIx = (ix) => ix.programId.equals(SystemProgram.programId) && ix.data.length >= 12 && ix.data.readUInt32LE(0) === 2 && ix.keys[0]?.pubkey.equals(req.taker) && ix.keys[1]?.pubkey.equals(wsolAta) || ix.programId.equals(TOKEN_PROGRAM_ID) && (ix.data[0] === 17 /* SyncNative */ || ix.data[0] === 9 /* CloseAccount */) && ix.keys[0]?.pubkey.equals(wsolAta);
54912
+ const candidates = routes.map(
54913
+ (route) => annotateFit(
54914
+ {
54915
+ ...route,
54916
+ swapInstructions: route.swapInstructions.filter((ix) => !isProviderSolWrapIx(ix)),
54917
+ setupInstructions: route.setupInstructions.filter((ix) => !isProviderSolWrapIx(ix))
54918
+ },
54919
+ req
54920
+ )
54921
+ );
54913
54922
  const fitting = candidates.filter((c) => c.fits && c.outAmountNative.gtn(0));
54914
54923
  if (fitting.length === 0) {
54915
54924
  const closest = candidates.reduce((best, c) => c.fullTxSize < best.fullTxSize ? c : best);
@@ -55004,6 +55013,7 @@ async function makeEndFlashLoanIx3(program, marginfiAccountPk, group, projectedA
55004
55013
  program,
55005
55014
  {
55006
55015
  marginfiAccount: marginfiAccountPk,
55016
+ group,
55007
55017
  authority
55008
55018
  },
55009
55019
  remainingAccounts.map((account) => ({