hyperweb-io / hyperweb-io/ts-codegen
add event emitter option for client to support messages composer
- Lenguaje dominante
- TypeScript
- Estrellas
- 126
- Forks
- 31
- Merge medio
- 19 min
- PR fusionados (30 d)
- 2
Descripción
Some users may want to control state a bit more than what `client.execute` provides, which is the default way the client operates. For example, `client.execute` current does this:
1. composes the messages
2. signs the message
3. broadcasts the message
The issue is that, during #2, the user may be signing via keplr, and technically there is more state involved, if perhaps you wanted to display a spinning loader to the user interfaces.
Example of separating these out using the current message composer option:
https://github.com/EquilibriumEtf/frontend/blob/main/contexts/tx.tsx
https://gist.github.com/pyramation/0ce63b6026cc15a68c46454af2c879de
However, this implementation is conflating UI and transaction state. I think a solid implementation could involve adding an option to the `client` option that enables an emitter, or some state object that can emit state to objects outside of the class instance during a transaction, potentially messages/state like `is_signing`, `is_broadcasting`
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Start by tracing the client.execute entry point and the existing message composer option, then compare the linked frontend example and gist to understand the current transaction flow. Define the required externally visible states, including signing and broadcasting, and confirm completion with a focused client-level test or documented behavior; the issue does not name specific files or tests.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- api
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100