`getTokenBalance` returns 0 on RPC errors, showing a false "0 USDC"

Abierto
#60 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
66/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

Start with getTokenBalance in web/lib/contract.ts, where the isSimulationError || !retval branch returns 0n, then find its callers in web/app/pay/[id]/page.tsx, web/app/dashboard/page.tsx and web/app/withdraw/page.tsx. Decide whether to throw or return null, and make callers show a placeholder with a retry instead of 0. Done when a simulated RPC failure never displays 0, the insufficient-balance prompt appears only for a real balance, and the withdraw page change is coordinated with #26.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug difficulty: beginner help wanted web

Difficulty: Beginner

Problem

getTokenBalance does if (isSimulationError || !retval) return 0n;, hiding failures. The pay page then concludes the balance is insufficient and nudges the client to the faucet, and Withdraw shows a balance of 0.

Why it matters

Showing wrong money information on a payment screen erodes trust and causes confusing prompts.

Scope of work

Throw (or return null) on error. Callers show "—" with a retry, and keep 0 for a genuine zero balance.

Acceptance criteria

  • A simulated RPC failure shows an error or placeholder, never 0.
  • The insufficient-balance prompt only appears for a real balance.

Relevant files

  • web/lib/contract.ts, web/app/pay/[id]/page.tsx, web/app/dashboard/page.tsx, web/app/withdraw/page.tsx

Dependencies

None. Note that #26 also edits the Withdraw page.

Maintainer discussion needed?

No.

Lenguaje dominante
TypeScript
Estrellas
0
Forks
4
Merge medio
54 min
PR fusionados (30 d)
6

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Yormee-103/PayLoop

Todos los issues de Yormee-103/PayLoop

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.