four-flap-meme-sdk 1.5.94 → 1.5.95
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/bundle.js +23 -10
- package/package.json +1 -1
package/dist/xlayer/bundle.js
CHANGED
|
@@ -73,7 +73,6 @@ class AANonceMap {
|
|
|
73
73
|
// 固定 gas(用于大规模减少 RPC);具体值允许通过 config.fixedGas 覆盖
|
|
74
74
|
const DEFAULT_CALL_GAS_LIMIT_BUY = DEFAULT_CALL_GAS_LIMIT_SELL; // buy 与 sell 共享一个保守值
|
|
75
75
|
const DEFAULT_CALL_GAS_LIMIT_APPROVE = 200000n;
|
|
76
|
-
const DEFAULT_CALL_GAS_LIMIT_TRANSFER = 150000n;
|
|
77
76
|
const DEFAULT_CALL_GAS_LIMIT_WITHDRAW = 120000n;
|
|
78
77
|
function resolveProfitSettings(config) {
|
|
79
78
|
const extractProfit = config?.extractProfit !== false; // 默认 true
|
|
@@ -1350,17 +1349,31 @@ export class BundleExecutor {
|
|
|
1350
1349
|
const totalBuyWei = buyerData.reduce((sum, d) => sum + d.buyWei, 0n);
|
|
1351
1350
|
const totalBuyProfitWei = buyerData.reduce((sum, d) => sum + d.profitWei, 0n);
|
|
1352
1351
|
// ✅ 并行构建和签名所有买家的 UserOps
|
|
1352
|
+
// ✅ V3/V4 代币使用 swapExactInputV3(支持 extensionData),与 bundleGraduateBuy 保持一致
|
|
1353
|
+
const extensionData = params.extensionData ?? '0x';
|
|
1353
1354
|
const signedBuyOps = await mapWithConcurrency(buyerData, 5, async (data) => {
|
|
1354
1355
|
const { buyer, buyWei, accountInfo } = data;
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1356
|
+
// ✅ V3/V4 代币使用 swapExactInputV3,否则使用旧版 swapExactInput
|
|
1357
|
+
const swapData = (useV3 || useV4)
|
|
1358
|
+
? portalIface.encodeFunctionData('swapExactInputV3', [
|
|
1359
|
+
{
|
|
1360
|
+
inputToken,
|
|
1361
|
+
outputToken: tokenAddress,
|
|
1362
|
+
inputAmount: buyWei,
|
|
1363
|
+
minOutputAmount: 0n,
|
|
1364
|
+
permitData: '0x',
|
|
1365
|
+
extensionData,
|
|
1366
|
+
},
|
|
1367
|
+
])
|
|
1368
|
+
: portalIface.encodeFunctionData('swapExactInput', [
|
|
1369
|
+
{
|
|
1370
|
+
inputToken,
|
|
1371
|
+
outputToken: tokenAddress,
|
|
1372
|
+
inputAmount: buyWei,
|
|
1373
|
+
minOutputAmount: 0n,
|
|
1374
|
+
permitData: '0x',
|
|
1375
|
+
},
|
|
1376
|
+
]);
|
|
1364
1377
|
// ✅ ERC20 代币需要先 approve,使用 executeBatch 将 approve + swap 合并为一个 UserOp
|
|
1365
1378
|
let buyCallData;
|
|
1366
1379
|
if (useNativeToken) {
|