four-flap-meme-sdk 1.3.27 → 1.3.29
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/clients/merkle.js
CHANGED
|
@@ -292,7 +292,6 @@ export class MerkleClient {
|
|
|
292
292
|
// 获取起始 Nonce(使用 latest 避免 pending 状态问题)
|
|
293
293
|
let nonce = options?.startNonce;
|
|
294
294
|
if (nonce === undefined) {
|
|
295
|
-
// 使用 latest 更可靠,在高并发场景下更安全
|
|
296
295
|
nonce = await this.provider.getTransactionCount(wallet.address, 'latest');
|
|
297
296
|
}
|
|
298
297
|
// 获取 Gas Price
|
|
@@ -32,7 +32,8 @@ export class NonceManager {
|
|
|
32
32
|
this.tempNonceCache.set(key, cachedNonce + 1);
|
|
33
33
|
return cachedNonce;
|
|
34
34
|
}
|
|
35
|
-
//
|
|
35
|
+
// ✅ 使用 'latest' 获取 nonce(已确认的交易)
|
|
36
|
+
// 由于前端已移除 nonce 缓存,SDK 每次都从链上获取最新状态
|
|
36
37
|
const onchainNonce = await this.provider.getTransactionCount(address, 'latest');
|
|
37
38
|
// 缓存下一个值(仅在当前批次内有效)
|
|
38
39
|
this.tempNonceCache.set(key, onchainNonce + 1);
|