@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.cjs +14 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -49185,23 +49185,27 @@ var getTitanSwapIxsForFlashloan = async ({
|
|
|
49185
49185
|
quoteParams.swapMode === "ExactIn" ? quoteParams.outputMint : quoteParams.inputMint
|
|
49186
49186
|
);
|
|
49187
49187
|
const { feeAccount, hasFeeAccount } = await checkTitanFeeAccount(connection, feeMint);
|
|
49188
|
+
const useFeeAccount = hasFeeAccount && !!quoteParams.platformFeeBps;
|
|
49188
49189
|
let finalQuoteParams = quoteParams;
|
|
49189
|
-
if (!
|
|
49190
|
-
|
|
49190
|
+
if (!useFeeAccount) {
|
|
49191
|
+
if (!hasFeeAccount) {
|
|
49192
|
+
console.warn("Warning: Titan fee account ATA does not exist, disabling platform fee");
|
|
49193
|
+
}
|
|
49191
49194
|
finalQuoteParams = {
|
|
49192
49195
|
...quoteParams,
|
|
49193
49196
|
platformFeeBps: void 0
|
|
49194
49197
|
};
|
|
49195
49198
|
}
|
|
49199
|
+
const effectiveFeeAccount = useFeeAccount ? feeAccount : void 0;
|
|
49196
49200
|
if (basePath.startsWith("wss://") || basePath.startsWith("ws://")) {
|
|
49197
49201
|
return getTitanSwapIxsViaWebSocket(
|
|
49198
49202
|
{ quoteParams: finalQuoteParams, authority, connection, destinationTokenAccount, apiConfig },
|
|
49199
|
-
|
|
49203
|
+
effectiveFeeAccount
|
|
49200
49204
|
);
|
|
49201
49205
|
} else {
|
|
49202
49206
|
return getTitanSwapIxsViaHttpProxy(
|
|
49203
49207
|
{ quoteParams: finalQuoteParams, authority, connection, destinationTokenAccount, apiConfig },
|
|
49204
|
-
|
|
49208
|
+
effectiveFeeAccount
|
|
49205
49209
|
);
|
|
49206
49210
|
}
|
|
49207
49211
|
};
|
|
@@ -49707,9 +49711,12 @@ var getJupiterSwapIxsForFlashloan = async ({
|
|
|
49707
49711
|
const feeMint = quoteParams.swapMode === "ExactIn" ? quoteParams.outputMint : quoteParams.inputMint;
|
|
49708
49712
|
const { feeAccount, hasFeeAccount } = await checkFeeAccount(connection, new web3_js.PublicKey(feeMint));
|
|
49709
49713
|
const project0JupiterLut = (await connection.getAddressLookupTable(ADDRESS_LOOKUP_TABLE_FOR_SWAP))?.value;
|
|
49714
|
+
const useFeeAccount = hasFeeAccount && !!quoteParams.platformFeeBps;
|
|
49710
49715
|
let finalQuoteParams = quoteParams;
|
|
49711
|
-
if (!
|
|
49712
|
-
|
|
49716
|
+
if (!useFeeAccount) {
|
|
49717
|
+
if (!hasFeeAccount) {
|
|
49718
|
+
console.warn("Warning: feeAccountInfo is undefined");
|
|
49719
|
+
}
|
|
49713
49720
|
finalQuoteParams = {
|
|
49714
49721
|
...quoteParams,
|
|
49715
49722
|
platformFeeBps: void 0
|
|
@@ -49725,7 +49732,7 @@ var getJupiterSwapIxsForFlashloan = async ({
|
|
|
49725
49732
|
swapRequest: {
|
|
49726
49733
|
quoteResponse: swapQuote,
|
|
49727
49734
|
userPublicKey: authority.toBase58(),
|
|
49728
|
-
feeAccount:
|
|
49735
|
+
feeAccount: useFeeAccount ? feeAccount : void 0,
|
|
49729
49736
|
wrapAndUnwrapSol: false,
|
|
49730
49737
|
destinationTokenAccount: destinationTokenAccount.toBase58()
|
|
49731
49738
|
}
|