From 4cb7f84340d6fb5ddd2af9bf16a4b35f1e83aed6 Mon Sep 17 00:00:00 2001 From: "shu@unifra" Date: Mon, 21 Apr 2025 11:35:46 +0900 Subject: [PATCH] fix bug: if the nonce expired, the activity stuck. (#4) --- src/commands/helper/activity.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/commands/helper/activity.ts b/src/commands/helper/activity.ts index c14a5fe..3abc4ba 100644 --- a/src/commands/helper/activity.ts +++ b/src/commands/helper/activity.ts @@ -282,6 +282,11 @@ export default class HelperActivity extends Command { this.debugLog(`Error stack: ${error.stack}`) if ('code' in error) { this.debugLog(`Error code: ${(error as any).code}`) + if ((error as any).code === 'NONCE_EXPIRED') { + this.nonceTrackers[layer] = await wallet.getNonce(); + this.log(chalk.blue(`Nonce expired. Trying use the latest nonce. ${this.nonceTrackers[layer]}`)) + return + } } }