four-flap-meme-sdk 1.7.40 → 1.7.41

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.
@@ -410,15 +410,7 @@ export async function bundleBatchSwap(params) {
410
410
  // ========================================
411
411
  const delegateInterface = new ethers.Interface(UNIFIED_DELEGATE_ABI);
412
412
  const calls = [];
413
- // ✅ 利润刮取(从卖家钱包)
414
- if (profitAmount > 0n) {
415
- calls.push({
416
- target: sellerWallet.address,
417
- allowFailure: false,
418
- value: profitAmount,
419
- callData: delegateInterface.encodeFunctionData('transferTo', [profitRecipient]),
420
- });
421
- }
413
+ // ✅ 修复:先执行卖出和转账,最后再刮取利润(与 bundleBuy/volume 一致)
422
414
  // 卖家卖币并转账给第一个中间钱包(或第一个买家)
423
415
  const firstRecipient = hopWallets.length > 0 ? hopWallets[0].address : buyerWallets[0].address;
424
416
  const sellCall = buildSellAndTransferCall(sellerWallet, sellAmountWei, tokenAddress, firstRecipient, tradeType, actualRouter, fee);
@@ -455,6 +447,15 @@ export async function bundleBatchSwap(params) {
455
447
  const buyCall = buildBuyCall(buyerWallet, tokenAddress, tradeType, actualRouter, fee);
456
448
  calls.push(buyCall);
457
449
  }
450
+ // ✅ 利润刮取放在最后(从卖家钱包)
451
+ if (profitAmount > 0n) {
452
+ calls.push({
453
+ target: sellerWallet.address,
454
+ allowFailure: false,
455
+ value: profitAmount,
456
+ callData: delegateInterface.encodeFunctionData('transferTo', [profitRecipient]),
457
+ });
458
+ }
458
459
  // ========================================
459
460
  // 同步签署授权(并行)
460
461
  // ========================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "four-flap-meme-sdk",
3
- "version": "1.7.40",
3
+ "version": "1.7.41",
4
4
  "description": "SDK for Flap bonding curve and four.meme TokenManager",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",