hyperweb-io / hyperweb-io/ts-codegen

add event emitter option for client to support messages composer

Đang mở
#76 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
126
Fork
31
Merge trung bình
19 phút
Pull request đã merge (30 ngày)
2

Mô tả

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`

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
typescript
Lĩnh vực
api
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.