Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support for all of the rpc subservices that lnd exposes. The original implementation of lnrpc was loading only the services found in rpc.proto (lightning, walletUnlocker).
I ended up refactoring a lot of how lnrpc.js works by allowing a user pass which services they want to load (defaults to [lightning, walletUnlocker) so it won't break existing users.
I also bumped the version number and the version of grpc being used.
This works fine for the project I needed subservices for (router, signer) but probably needs to be cleaned up further to be merged into master.
The old code exposed all of the lightning and walletUnlocker methods on the root lnrpc object. This presents a problem because some of the subservices share the same method names as those found in the lightning service. For now I did not change how this works so if you want to use a subservice you are required to use it directly (e.g. lnrpc.signer.verifyMessage({})) whereas if you used lnrpc.verifyMessage it would default to the method exposed by the lightning service.