four-flap-meme-sdk 1.7.68 → 1.7.69
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.
|
@@ -771,11 +771,12 @@ export async function pairwiseTransfer(params) {
|
|
|
771
771
|
// 直接转账:sender → receiver
|
|
772
772
|
// ========================================
|
|
773
773
|
if (isNative) {
|
|
774
|
+
// ✅ 使用 transferAmount 转移指定金额(而不是 transferTo 全额)
|
|
774
775
|
calls.push({
|
|
775
776
|
target: senderWallet.address,
|
|
776
777
|
allowFailure: false,
|
|
777
778
|
value: shouldPassValue ? amtWei : 0n,
|
|
778
|
-
callData: delegateInterface.encodeFunctionData('
|
|
779
|
+
callData: delegateInterface.encodeFunctionData('transferAmount', [receiver, amtWei]),
|
|
779
780
|
});
|
|
780
781
|
}
|
|
781
782
|
else {
|
|
@@ -810,14 +811,14 @@ export async function pairwiseTransfer(params) {
|
|
|
810
811
|
const lastHop = hopWallets[hopWallets.length - 1];
|
|
811
812
|
if (isNative) {
|
|
812
813
|
// 原生 OKB 多跳
|
|
813
|
-
// sender →
|
|
814
|
+
// ✅ sender → 第一个中间钱包(使用 transferAmount 转移指定金额)
|
|
814
815
|
calls.push({
|
|
815
816
|
target: senderWallet.address,
|
|
816
817
|
allowFailure: false,
|
|
817
818
|
value: shouldPassValue ? amtWei : 0n,
|
|
818
|
-
callData: delegateInterface.encodeFunctionData('
|
|
819
|
+
callData: delegateInterface.encodeFunctionData('transferAmount', [firstHop.address, amtWei]),
|
|
819
820
|
});
|
|
820
|
-
//
|
|
821
|
+
// 中间钱包之间转账(使用 transferTo,因为中间钱包只有这笔钱)
|
|
821
822
|
for (let j = 0; j < hopWallets.length - 1; j++) {
|
|
822
823
|
calls.push({
|
|
823
824
|
target: hopWallets[j].address,
|
|
@@ -826,7 +827,7 @@ export async function pairwiseTransfer(params) {
|
|
|
826
827
|
callData: delegateInterface.encodeFunctionData('transferTo', [hopWallets[j + 1].address]),
|
|
827
828
|
});
|
|
828
829
|
}
|
|
829
|
-
// 最后一个中间钱包 → receiver
|
|
830
|
+
// 最后一个中间钱包 → receiver(使用 transferTo 转移全部)
|
|
830
831
|
calls.push({
|
|
831
832
|
target: lastHop.address,
|
|
832
833
|
allowFailure: false,
|