You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The result states it returns a number, but that is not what the stream actually sends.
Impact
These issues make it difficult to rely on the openrpc.json as a source of truth for interacting with the RPC server. Developers are forced to figure out the actual behavior themselves, which leads to a poor developer experience.
Proposed Improvements
Ensure all relevant types from the source code are included in the openrpc.json.
Correct the typings for the subscribe methods to accurately represent the structure and type of the data they return.
Thank you for addressing this issue!
The text was updated successfully, but these errors were encountered:
While I agree that certain types are wrong or missing, specifically the subscribe method is actually correct. It is an RPC call that returns a number, which is the subscription ID. This ID can be used to unsubscribe, and the actual subscription events are sent outside this call as "server-sent events", which contain the subscription ID in their body and are not documented anywhere unfortunately.
While working on creating TypeScript typings from the generated
openrpc.json
file, I noticed some issues:1. Missing Types
Certain types that are defined in the source code are missing from the
openrpc.json
. For example, the following type is not included:Type Definition
There may be other missing types as well.
2. Incorrect Typings for Subscribe Methods
The typings for all
subscribe
methods in theopenrpc.json
appear to be incorrect. For example:The result states it returns a number, but that is not what the stream actually sends.
Impact
These issues make it difficult to rely on the openrpc.json as a source of truth for interacting with the RPC server. Developers are forced to figure out the actual behavior themselves, which leads to a poor developer experience.
Proposed Improvements
Ensure all relevant types from the source code are included in the openrpc.json.
Correct the typings for the subscribe methods to accurately represent the structure and type of the data they return.
Thank you for addressing this issue!
The text was updated successfully, but these errors were encountered: