four-flap-meme-sdk 1.2.25 → 1.2.27
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,8 +410,13 @@ export async function sweepWithBundleMerkle(params) {
|
|
|
410
410
|
return null;
|
|
411
411
|
let actualToSend = toSend;
|
|
412
412
|
if (extractProfit) {
|
|
413
|
-
|
|
414
|
-
|
|
413
|
+
// ✅ 如果是支付者,扣除所有利润总和;其他钱包不扣利润,归集干净
|
|
414
|
+
if (i === maxSweepIndex && totalProfit > 0n) {
|
|
415
|
+
actualToSend = toSend - totalProfit; // 支付者扣除所有利润总和
|
|
416
|
+
}
|
|
417
|
+
else {
|
|
418
|
+
actualToSend = toSend; // 其他钱包不扣利润,归集全部
|
|
419
|
+
}
|
|
415
420
|
}
|
|
416
421
|
// ✅ 支付者使用预留的第一个 nonce,其他钱包正常获取
|
|
417
422
|
const nonce = (i === maxSweepIndex && payerProfitNonce !== undefined)
|
|
@@ -522,8 +527,13 @@ export async function sweepWithBundleMerkle(params) {
|
|
|
522
527
|
return null;
|
|
523
528
|
let actualToSend = toSend;
|
|
524
529
|
if (extractProfit) {
|
|
525
|
-
|
|
526
|
-
|
|
530
|
+
// ✅ 如果是支付者,扣除所有利润总和;其他钱包不扣利润,归集干净
|
|
531
|
+
if (i === maxSweepIndex && totalProfit > 0n) {
|
|
532
|
+
actualToSend = toSend - totalProfit; // 支付者扣除所有利润总和
|
|
533
|
+
}
|
|
534
|
+
else {
|
|
535
|
+
actualToSend = toSend; // 其他钱包不扣利润,归集全部
|
|
536
|
+
}
|
|
527
537
|
}
|
|
528
538
|
// ✅ 支付者使用预留的第一个 nonce,其他钱包正常获取
|
|
529
539
|
const nonce = (i === maxSweepIndex && payerProfitNonce !== undefined)
|