diff --git a/composables/facilitator/index.ts b/composables/facilitator/index.ts index d5fdc82..9f2de3b 100755 --- a/composables/facilitator/index.ts +++ b/composables/facilitator/index.ts @@ -407,7 +407,28 @@ export class Facilitator { const to = await this.contract.getAddress(); const result = await this.signer.sendTransaction({ to, value }); - await result.wait(); + + const maxRetries = 3; + const delay = (ms: number) => + new Promise((resolve) => setTimeout(resolve, ms)); + + for (let attempt = 1; attempt <= maxRetries; attempt++) { + try { + await result.wait(); + break; + } catch (error) { + if (attempt < maxRetries) { + this.logger.warn( + `Attempt ${attempt} failed, retrying in 2 seconds...` + ); + await delay(2000); + } else { + throw new Error( + `Transaction confirmation failed after ${maxRetries} attempts` + ); + } + } + } const block = await result.getBlock(); const timestamp = block?.timestamp || Math.floor(Date.now() / 1000); useFacilitatorStore().addPendingClaim(result.hash, timestamp); diff --git a/composables/registrator/index.ts b/composables/registrator/index.ts index d0229a1..a31d1ba 100755 --- a/composables/registrator/index.ts +++ b/composables/registrator/index.ts @@ -260,7 +260,7 @@ export class Registrator { icon: 'i-heroicons-x-circle', color: 'amber', title: 'Error', - description: `Error redeem rewards: ${msg}`, + description: `Error locking rewards ${formatEther(registratorStore.currentLockSize || '0')} $ANYONE: ${msg}`, }); } else { toast.add({ diff --git a/nuxt.config.ts b/nuxt.config.ts index 0aadbcb..3ff1887 100755 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -72,7 +72,7 @@ export default defineNuxtConfig({ supportWalletPublicKeyBase64: 'K3jnSGVyHj4kSzgce3+k8gJsfHvUoQeJMNPO8CcsO2s=', commitHash: process.env.NUXT_PUBLIC_COMMIT_HASH || 'dev', - version: '1.2.3', + version: '1.2.4', }, }, plugins: [{ src: '~/plugins/vue-query.client.ts', mode: 'client' }],