four-flap-meme-sdk 1.5.62 → 1.5.63
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 +28 -8
- package/package.json +1 -1
package/dist/xlayer/bundle.js
CHANGED
|
@@ -687,14 +687,24 @@ export class BundleExecutor {
|
|
|
687
687
|
}
|
|
688
688
|
});
|
|
689
689
|
const initCodes = accountInfos.map((ai, i) => ai.deployed ? '0x' : this.aaManager.generateInitCode(wallets[i].address));
|
|
690
|
-
|
|
691
|
-
|
|
690
|
+
// ✅ 使用固定 Gas 构建买入 UserOps(避免 Bundler 估算对未部署账户不准确)
|
|
691
|
+
const buyNonces = accountInfos.map((ai) => nonceMap.next(ai.sender));
|
|
692
|
+
const buyUserOpsBuilt = await mapWithConcurrency(accountInfos, 6, async (ai, i) => {
|
|
693
|
+
return this.aaManager.buildUserOpWithFixedGas({
|
|
694
|
+
ownerWallet: wallets[i],
|
|
692
695
|
sender: ai.sender,
|
|
693
|
-
nonce: nonceMap.next(ai.sender),
|
|
694
696
|
callData: buyCallDatas[i],
|
|
697
|
+
nonce: buyNonces[i],
|
|
695
698
|
initCode: initCodes[i],
|
|
696
|
-
|
|
699
|
+
deployed: ai.deployed,
|
|
700
|
+
fixedGas: {
|
|
701
|
+
...(effConfig.fixedGas ?? {}),
|
|
702
|
+
callGasLimit: effConfig.fixedGas?.callGasLimit ?? DEFAULT_CALL_GAS_LIMIT_BUY,
|
|
703
|
+
},
|
|
704
|
+
});
|
|
697
705
|
});
|
|
706
|
+
const buyUserOps = buyUserOpsBuilt.map((r) => r.userOp);
|
|
707
|
+
const prefundWeis = buyUserOpsBuilt.map((r) => r.prefundWei);
|
|
698
708
|
// 补足 prefund + 买入金额(使用扣除利润后的金额)
|
|
699
709
|
await mapWithConcurrency(accountInfos, 6, async (ai, i) => {
|
|
700
710
|
if (useNativeToken) {
|
|
@@ -1034,14 +1044,24 @@ export class BundleExecutor {
|
|
|
1034
1044
|
}
|
|
1035
1045
|
});
|
|
1036
1046
|
const initCodes = accountInfos.map((ai, i) => (ai.deployed ? '0x' : this.aaManager.generateInitCode(wallets[i].address)));
|
|
1037
|
-
|
|
1038
|
-
|
|
1047
|
+
// ✅ 使用固定 Gas 构建买入 UserOps(避免 Bundler 估算对未部署账户不准确)
|
|
1048
|
+
const buyNonces = accountInfos.map((ai) => nonceMap.next(ai.sender));
|
|
1049
|
+
const buyUserOpsBuilt = await mapWithConcurrency(accountInfos, 6, async (ai, i) => {
|
|
1050
|
+
return this.aaManager.buildUserOpWithFixedGas({
|
|
1051
|
+
ownerWallet: wallets[i],
|
|
1039
1052
|
sender: ai.sender,
|
|
1040
|
-
nonce: nonceMap.next(ai.sender),
|
|
1041
1053
|
callData: buyCallDatas[i],
|
|
1054
|
+
nonce: buyNonces[i],
|
|
1042
1055
|
initCode: initCodes[i],
|
|
1043
|
-
|
|
1056
|
+
deployed: ai.deployed,
|
|
1057
|
+
fixedGas: {
|
|
1058
|
+
...(effConfig.fixedGas ?? {}),
|
|
1059
|
+
callGasLimit: effConfig.fixedGas?.callGasLimit ?? DEFAULT_CALL_GAS_LIMIT_BUY,
|
|
1060
|
+
},
|
|
1061
|
+
});
|
|
1044
1062
|
});
|
|
1063
|
+
const buyUserOps = buyUserOpsBuilt.map((r) => r.userOp);
|
|
1064
|
+
const prefundWeis = buyUserOpsBuilt.map((r) => r.prefundWei);
|
|
1045
1065
|
await mapWithConcurrency(accountInfos, 6, async (ai, i) => {
|
|
1046
1066
|
const buyWei = buyWeis[i] ?? 0n;
|
|
1047
1067
|
if (useNativeToken) {
|