@0dotxyz/p0-ts-sdk 2.2.0-alpha.7 → 2.2.0-alpha.8

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
@@ -49158,23 +49158,27 @@ var getTitanSwapIxsForFlashloan = async ({
49158
49158
  quoteParams.swapMode === "ExactIn" ? quoteParams.outputMint : quoteParams.inputMint
49159
49159
  );
49160
49160
  const { feeAccount, hasFeeAccount } = await checkTitanFeeAccount(connection, feeMint);
49161
+ const useFeeAccount = hasFeeAccount && !!quoteParams.platformFeeBps;
49161
49162
  let finalQuoteParams = quoteParams;
49162
- if (!hasFeeAccount) {
49163
- console.warn("Warning: Titan fee account ATA does not exist, disabling platform fee");
49163
+ if (!useFeeAccount) {
49164
+ if (!hasFeeAccount) {
49165
+ console.warn("Warning: Titan fee account ATA does not exist, disabling platform fee");
49166
+ }
49164
49167
  finalQuoteParams = {
49165
49168
  ...quoteParams,
49166
49169
  platformFeeBps: void 0
49167
49170
  };
49168
49171
  }
49172
+ const effectiveFeeAccount = useFeeAccount ? feeAccount : void 0;
49169
49173
  if (basePath.startsWith("wss://") || basePath.startsWith("ws://")) {
49170
49174
  return getTitanSwapIxsViaWebSocket(
49171
49175
  { quoteParams: finalQuoteParams, authority, connection, destinationTokenAccount, apiConfig },
49172
- hasFeeAccount ? feeAccount : void 0
49176
+ effectiveFeeAccount
49173
49177
  );
49174
49178
  } else {
49175
49179
  return getTitanSwapIxsViaHttpProxy(
49176
49180
  { quoteParams: finalQuoteParams, authority, connection, destinationTokenAccount, apiConfig },
49177
- hasFeeAccount ? feeAccount : void 0
49181
+ effectiveFeeAccount
49178
49182
  );
49179
49183
  }
49180
49184
  };
@@ -49680,9 +49684,12 @@ var getJupiterSwapIxsForFlashloan = async ({
49680
49684
  const feeMint = quoteParams.swapMode === "ExactIn" ? quoteParams.outputMint : quoteParams.inputMint;
49681
49685
  const { feeAccount, hasFeeAccount } = await checkFeeAccount(connection, new PublicKey(feeMint));
49682
49686
  const project0JupiterLut = (await connection.getAddressLookupTable(ADDRESS_LOOKUP_TABLE_FOR_SWAP))?.value;
49687
+ const useFeeAccount = hasFeeAccount && !!quoteParams.platformFeeBps;
49683
49688
  let finalQuoteParams = quoteParams;
49684
- if (!hasFeeAccount) {
49685
- console.warn("Warning: feeAccountInfo is undefined");
49689
+ if (!useFeeAccount) {
49690
+ if (!hasFeeAccount) {
49691
+ console.warn("Warning: feeAccountInfo is undefined");
49692
+ }
49686
49693
  finalQuoteParams = {
49687
49694
  ...quoteParams,
49688
49695
  platformFeeBps: void 0
@@ -49698,7 +49705,7 @@ var getJupiterSwapIxsForFlashloan = async ({
49698
49705
  swapRequest: {
49699
49706
  quoteResponse: swapQuote,
49700
49707
  userPublicKey: authority.toBase58(),
49701
- feeAccount: hasFeeAccount ? feeAccount : void 0,
49708
+ feeAccount: useFeeAccount ? feeAccount : void 0,
49702
49709
  wrapAndUnwrapSol: false,
49703
49710
  destinationTokenAccount: destinationTokenAccount.toBase58()
49704
49711
  }