@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.cjs CHANGED
@@ -54892,8 +54892,6 @@ var SWAP_ADAPTERS = {
54892
54892
  function getSwapAdapter(provider) {
54893
54893
  return SWAP_ADAPTERS[provider];
54894
54894
  }
54895
-
54896
- // src/services/account/services/swap-engine/swap-engine.service.ts
54897
54895
  function resolveAdapters(req, predicate) {
54898
54896
  const resolved = [];
54899
54897
  for (const entry of req.providers) {
@@ -54937,7 +54935,18 @@ async function runSwapEngine(req) {
54937
54935
  failures.join("; ") || "No swap route available"
54938
54936
  );
54939
54937
  }
54940
- const candidates = routes.map((route) => annotateFit(route, req));
54938
+ const wsolAta = getAssociatedTokenAddressSync(NATIVE_MINT, req.taker, true);
54939
+ const isProviderSolWrapIx = (ix) => ix.programId.equals(web3_js.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);
54940
+ const candidates = routes.map(
54941
+ (route) => annotateFit(
54942
+ {
54943
+ ...route,
54944
+ swapInstructions: route.swapInstructions.filter((ix) => !isProviderSolWrapIx(ix)),
54945
+ setupInstructions: route.setupInstructions.filter((ix) => !isProviderSolWrapIx(ix))
54946
+ },
54947
+ req
54948
+ )
54949
+ );
54941
54950
  const fitting = candidates.filter((c) => c.fits && c.outAmountNative.gtn(0));
54942
54951
  if (fitting.length === 0) {
54943
54952
  const closest = candidates.reduce((best, c) => c.fullTxSize < best.fullTxSize ? c : best);
@@ -55032,6 +55041,7 @@ async function makeEndFlashLoanIx3(program, marginfiAccountPk, group, projectedA
55032
55041
  program,
55033
55042
  {
55034
55043
  marginfiAccount: marginfiAccountPk,
55044
+ group,
55035
55045
  authority
55036
55046
  },
55037
55047
  remainingAccounts.map((account) => ({