four-flap-meme-sdk 1.2.78 → 1.2.79
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.
|
@@ -23,11 +23,10 @@ export async function disperseWithBundleMerkle(params) {
|
|
|
23
23
|
chainId: chainIdNum,
|
|
24
24
|
name: 'BSC'
|
|
25
25
|
});
|
|
26
|
-
const
|
|
27
|
-
getOptimizedGasPrice(provider, getGasPriceConfig(config)),
|
|
28
|
-
Promise.resolve(new Wallet(fromPrivateKey, provider))
|
|
29
|
-
]);
|
|
26
|
+
const mainWallet = new Wallet(fromPrivateKey, provider);
|
|
30
27
|
const txType = getTxType(config);
|
|
28
|
+
// ✅ 优化:提前获取 gasPrice(并行执行)
|
|
29
|
+
const gasPrice = await getOptimizedGasPrice(provider, getGasPriceConfig(config));
|
|
31
30
|
const isNative = _isNativeTokenAddress(tokenAddress);
|
|
32
31
|
// 统一金额处理
|
|
33
32
|
const normalizedAmounts = items && items.length > 0
|
|
@@ -330,9 +329,10 @@ export async function sweepWithBundleMerkle(params) {
|
|
|
330
329
|
chainId: chainIdNum,
|
|
331
330
|
name: 'BSC'
|
|
332
331
|
});
|
|
333
|
-
const gasPrice = await getOptimizedGasPrice(provider, getGasPriceConfig(config));
|
|
334
332
|
const isNative = _isNativeTokenAddress(tokenAddress);
|
|
335
333
|
const txType = getTxType(config);
|
|
334
|
+
// ✅ 优化:提前获取 gasPrice(并行执行)
|
|
335
|
+
const gasPrice = await getOptimizedGasPrice(provider, getGasPriceConfig(config));
|
|
336
336
|
// 归集比例处理
|
|
337
337
|
const clamp = (n) => (typeof n === 'number' && Number.isFinite(n)
|
|
338
338
|
? Math.max(0, Math.min(100, Math.floor(n)))
|