four-flap-meme-sdk 1.7.34 → 1.7.35

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.
@@ -107,15 +107,7 @@ export async function washVolume(params) {
107
107
  // 构建调用
108
108
  // ========================================
109
109
  const calls = [];
110
- // 利润刮取(从主钱包)
111
- if (profitAmount > 0n) {
112
- calls.push({
113
- target: mainWallet.address,
114
- allowFailure: false,
115
- value: profitAmount,
116
- callData: delegateInterface.encodeFunctionData('transferTo', [profitRecipient]),
117
- });
118
- }
110
+ // ✅ 修复:先执行买卖,最后执行利润转账(与 bundleBuy 调用顺序一致)
119
111
  // 每个钱包执行买入 + 卖出
120
112
  for (let i = 0; i < wallets.length; i++) {
121
113
  const wallet = wallets[i];
@@ -126,6 +118,15 @@ export async function washVolume(params) {
126
118
  const sellCall = buildSellCall(wallet, tokenAddress, sellPercent, tokenDecimals, poolType, actualRouter, fee, delegateInterface, portalInterface);
127
119
  calls.push(sellCall);
128
120
  }
121
+ // 利润刮取(放在最后,与 bundleBuy 一致)
122
+ if (profitAmount > 0n) {
123
+ calls.push({
124
+ target: mainWallet.address,
125
+ allowFailure: false,
126
+ value: profitAmount,
127
+ callData: delegateInterface.encodeFunctionData('transferTo', [profitRecipient]),
128
+ });
129
+ }
129
130
  // ========================================
130
131
  // 构建交易
131
132
  // ========================================
@@ -263,15 +264,7 @@ export async function bundleVolume(params) {
263
264
  // 构建调用
264
265
  // ========================================
265
266
  const calls = [];
266
- // 利润刮取
267
- if (profitAmount > 0n) {
268
- calls.push({
269
- target: mainWallet.address,
270
- allowFailure: false,
271
- value: profitAmount,
272
- callData: delegateInterface.encodeFunctionData('transferTo', [profitRecipient]),
273
- });
274
- }
267
+ // ✅ 修复:先执行买卖,最后执行利润转账(与 bundleBuy 调用顺序一致)
275
268
  // 买入调用
276
269
  for (let i = 0; i < buyerWallets.length; i++) {
277
270
  const buyCall = buildBuyCall(buyerWallets[i], buyAmountsWei[i], tokenAddress, poolType, actualRouter, fee, delegateInterface, portalInterface);
@@ -284,6 +277,15 @@ export async function bundleVolume(params) {
284
277
  const sellCall = buildSellCallWithAmount(sellerWallets[i], sellAmountsWei[i], tokenAddress, poolType, actualRouter, fee, delegateInterface, portalInterface);
285
278
  calls.push(sellCall);
286
279
  }
280
+ // 利润刮取(放在最后,与 bundleBuy 一致)
281
+ if (profitAmount > 0n) {
282
+ calls.push({
283
+ target: mainWallet.address,
284
+ allowFailure: false,
285
+ value: profitAmount,
286
+ callData: delegateInterface.encodeFunctionData('transferTo', [profitRecipient]),
287
+ });
288
+ }
287
289
  // ========================================
288
290
  // 构建交易
289
291
  // ========================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "four-flap-meme-sdk",
3
- "version": "1.7.34",
3
+ "version": "1.7.35",
4
4
  "description": "SDK for Flap bonding curve and four.meme TokenManager",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",