@lavarage/sdk 6.0.1 → 6.0.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
@@ -3004,10 +3004,10 @@ var closeTradeV2 = (lavarageProgram, position, offer, jupInstruction, quoteToken
3004
3004
  }] : []).instruction();
3005
3005
  const { setupInstructions, swapInstruction: swapInstructionPayload, cleanupInstruction, addressLookupTableAddresses } = jupiterSellIx;
3006
3006
  jupiterIxs = [
3007
- ...setupInstructions.map(deserializeInstruction),
3008
- deserializeInstruction(swapInstructionPayload),
3009
- deserializeInstruction(cleanupInstruction)
3010
- ];
3007
+ ...setupInstructions.filter((i) => !!i).map(deserializeInstruction),
3008
+ swapInstructionPayload ? deserializeInstruction(swapInstructionPayload) : null,
3009
+ cleanupInstruction ? deserializeInstruction(cleanupInstruction) : null
3010
+ ].filter((i) => !!i);
3011
3011
  addressLookupTableAccounts.push(...yield getAddressLookupTableAccounts(addressLookupTableAddresses));
3012
3012
  }
3013
3013
  const profit = new import_anchor.BN(jupInstruction.quoteResponse.outAmount).sub(position.account.amount).sub(position.account.userPaid);