-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to include custom RPC in polkadotjs (+types) #4954
Comments
Thank you @jacogr, I didn't see this one. It is working for the js decoration. |
Assuming you have the RPCs in your definitions when building the types, it should create augmented types for those as well. Basically it should create a |
I thought those were taken automatically from the rpc nodes |
There is no way it can be - the nodes only expose the names of the methods, no parameters whatsoever. See the Unlike the runtime none of this is fully-specified and it seems unlikely that this will become a reality (Substrate tracking issue) The consensus from the Substrate side seems to be that there should be no manual RPCs, you can also check in on the other links as part of this API issue, which just moves the issue around to |
Interesting, that would definitely be valuable to include the types in there. |
I tried adding |
Ummm... will checkout that branch and run it, it certainly looks correct. |
@jacogr Were you able to find some information? Otherwise I'll try to dig into the typegen. |
Have it on the list of TODOs, have not gotten there to look. |
Add the
This added the |
Thank you @jacogr it worked as expected :) |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query. |
When generating the api-augment with typegen, the additional RPC methods are not included.
Additionally those rpc_method are not recognized when polkadotjs connect to the network and load the types.
Ex: using
npm install @moonbeam-network/[email protected]
This will fail to compile (because of missing
moon
) and fail to execute because moon is not decorated in the api object.The text was updated successfully, but these errors were encountered: