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.
@@ -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, POTATOSWAP_SWAP_ROUTER02, } from './constants.js';
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 卖出:使用 SwapRouter02(和正常卖出一样)
343
- // SwapRouter02 是聚合 Router,可以路由到 V2/V3 池子
342
+ // ✅ V3 卖出:使用 V3 Router(和正常 V3 卖出一样)
344
343
  const expectedTokenAmount = expectedTokenAmounts[i] || 0n;
345
- const sellSwapData = encodeSwapExactTokensForETHSupportingFee(expectedTokenAmount, 0n, [params.tokenAddress, wokb], sender, deadline);
346
- sellCallData = encodeExecute(POTATOSWAP_SWAP_ROUTER02, 0n, sellSwapData);
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "four-flap-meme-sdk",
3
- "version": "1.6.72",
3
+ "version": "1.6.73",
4
4
  "description": "SDK for Flap bonding curve and four.meme TokenManager",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",