four-flap-meme-sdk 1.6.21 → 1.6.23

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.
@@ -299,8 +299,8 @@ export async function buildTransfersWithProfit(params) {
299
299
  const unsigned = [];
300
300
  const opOwnerIndex = [];
301
301
  // ✅ 第二步:构建 UserOps
302
- // - Native (OKB):只转 toWei,利润保留在 AA 钱包(可能需要用于后续 gas)
303
- // - ERC20:全部转出,profitWei 给利润地址 + toWei 给目标地址
302
+ // 每个钱包只转归集金额(扣除利润后)给目标地址,不转利润
303
+ // 利润保留在 AA 钱包或由其他机制处理(类似 BSC 的做法)
304
304
  for (let idx = 0; idx < transferInfos.length; idx++) {
305
305
  const info = transferInfos[idx];
306
306
  const i = info.walletIndex;
@@ -311,7 +311,7 @@ export async function buildTransfersWithProfit(params) {
311
311
  let callData;
312
312
  let callGasLimit;
313
313
  if (params.kind === 'native') {
314
- // ✅ Native (OKB):只转 toWei,利润保留在 AA 钱包
314
+ // ✅ Native (OKB):只转 toWei,利润保留在 AA 钱包(用于后续 gas)
315
315
  callData = encodeExecute(info.to, info.toWei, '0x');
316
316
  callGasLimit = 120000n;
317
317
  }
@@ -1561,9 +1561,14 @@ export class BundleExecutor {
1561
1561
  ops1.push(signedCreateOp.userOp);
1562
1562
  // --- 3. 构建内盘买入 Ops(并行优化)---
1563
1563
  // ✅ 预计算所有买入金额
1564
+ // Gas Limit 策略:
1565
+ // - 最后一笔内盘买入(触发毕业):800W
1566
+ // - 其他内盘买入:50W
1567
+ const lastCurveIndex = curveBuyerWallets.length - 1;
1564
1568
  const curveBuyData = curveBuyerWallets.map((wallet, i) => {
1565
1569
  const buyWei = parseOkb(curveBuyAmounts[i]);
1566
- const gasLimit = 8000000n; // 统一给 800W,不再区分是否最后一笔
1570
+ const isGraduationTrigger = (i === lastCurveIndex);
1571
+ const gasLimit = isGraduationTrigger ? 8000000n : 500000n;
1567
1572
  return { wallet, info: curveBuyerInfos[i], buyWei, gasLimit };
1568
1573
  });
1569
1574
  totalCurveBuyWei = curveBuyData.reduce((sum, d) => sum + d.buyWei, 0n);
@@ -1636,7 +1641,7 @@ export class BundleExecutor {
1636
1641
  nonce: nonceMap.next(info.sender),
1637
1642
  initCode: info.deployed ? '0x' : (await aaManager.generateInitCode(wallet.address)),
1638
1643
  deployed: info.deployed,
1639
- fixedGas: { callGasLimit: 600000n }
1644
+ fixedGas: { callGasLimit: 500000n } // 外盘买入:50W
1640
1645
  });
1641
1646
  const signedDexBuyOp = await aaManager.signUserOp(dexBuyOpRes.userOp, wallet);
1642
1647
  return signedDexBuyOp.userOp;
@@ -1660,10 +1665,7 @@ export class BundleExecutor {
1660
1665
  initCode: '0x', // Payer 已在发币时部署
1661
1666
  callData: profitCallData,
1662
1667
  deployed: true,
1663
- fixedGas: {
1664
- ...(effConfig.fixedGas ?? {}),
1665
- callGasLimit: effConfig.fixedGas?.callGasLimit ?? DEFAULT_CALL_GAS_LIMIT_WITHDRAW,
1666
- },
1668
+ fixedGas: { callGasLimit: DEFAULT_CALL_GAS_LIMIT_WITHDRAW }, // 利润转账:12W(固定值)
1667
1669
  });
1668
1670
  const signedProfitOp = await aaManager.signUserOp(profitOp, payerWallet);
1669
1671
  allOps.push(signedProfitOp.userOp);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "four-flap-meme-sdk",
3
- "version": "1.6.21",
3
+ "version": "1.6.23",
4
4
  "description": "SDK for Flap bonding curve and four.meme TokenManager",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",