four-flap-meme-sdk 1.6.72 → 1.6.73
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/xlayer/wash-ops.js +15 -6
- package/package.json +1 -1
package/dist/xlayer/wash-ops.js
CHANGED
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
import { ethers } from 'ethers';
|
|
16
16
|
import { createAAAccountManager, encodeExecute, createWallet } from './aa-account.js';
|
|
17
17
|
import { encodeBuyCall, encodeSellCall, PortalQuery, lpFeeProfileToV3Fee } from './portal-ops.js';
|
|
18
|
-
import { encodeSwapExactETHForTokensSupportingFee, encodeSwapExactTokensForETHSupportingFee, encodeSwapExactETHForTokensV3, DexQuery, } from './dex.js';
|
|
19
|
-
import { FLAP_PORTAL, WOKB, XLAYER_CHAIN_ID, DEFAULT_RPC_URL, ENTRYPOINT_V06, SIMPLE_ACCOUNT_FACTORY, PARTICLE_BUNDLER_URL, POTATOSWAP_V2_ROUTER, POTATOSWAP_V3_ROUTER, POTATOSWAP_V3_FACTORY,
|
|
18
|
+
import { encodeSwapExactETHForTokensSupportingFee, encodeSwapExactTokensForETHSupportingFee, encodeSwapExactETHForTokensV3, encodeSwapExactTokensForETHV3, DexQuery, } from './dex.js';
|
|
19
|
+
import { FLAP_PORTAL, WOKB, XLAYER_CHAIN_ID, DEFAULT_RPC_URL, ENTRYPOINT_V06, SIMPLE_ACCOUNT_FACTORY, PARTICLE_BUNDLER_URL, POTATOSWAP_V2_ROUTER, POTATOSWAP_V3_ROUTER, POTATOSWAP_V3_FACTORY, } from './constants.js';
|
|
20
20
|
import { PROFIT_CONFIG, ZERO_ADDRESS } from '../utils/constants.js';
|
|
21
21
|
import { mapWithConcurrency } from '../utils/concurrency.js';
|
|
22
22
|
// ============================================================================
|
|
@@ -339,11 +339,20 @@ export async function buildWashOps(params) {
|
|
|
339
339
|
sqrtPriceLimitX96: 0n,
|
|
340
340
|
});
|
|
341
341
|
buyCallData = encodeExecute(routerAddress, buyWei, buySwapData);
|
|
342
|
-
// ✅ V3 卖出:使用
|
|
343
|
-
// SwapRouter02 是聚合 Router,可以路由到 V2/V3 池子
|
|
342
|
+
// ✅ V3 卖出:使用 V3 Router(和正常 V3 卖出一样)
|
|
344
343
|
const expectedTokenAmount = expectedTokenAmounts[i] || 0n;
|
|
345
|
-
const sellSwapData =
|
|
346
|
-
|
|
344
|
+
const sellSwapData = encodeSwapExactTokensForETHV3({
|
|
345
|
+
tokenIn: params.tokenAddress,
|
|
346
|
+
tokenOut: wokb,
|
|
347
|
+
fee: v3Fee,
|
|
348
|
+
recipient: sender,
|
|
349
|
+
unwrapRecipient: sender,
|
|
350
|
+
deadline,
|
|
351
|
+
amountIn: expectedTokenAmount,
|
|
352
|
+
amountOutMinimum: 0n,
|
|
353
|
+
sqrtPriceLimitX96: 0n,
|
|
354
|
+
});
|
|
355
|
+
sellCallData = encodeExecute(routerAddress, 0n, sellSwapData);
|
|
347
356
|
}
|
|
348
357
|
else {
|
|
349
358
|
// V2
|