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.
Updates sats-connect-core to derive types from (runtime) schema validators. The validators are exported, and can be used at type assertion boundaries, such as when data is passed by a third party app to the background script, or when the background script passes data via url params to the extension popup.
Given JSON RPC 2.0 is an integral part of sats-connect, schema validators for RPC calls are also inlcuded.
The validator lib is marked as a peer dependency to better integrate with third party use of sats-connect. The schema validators are pure functions, and any modern build tool should tree-shake them away if not used.
This PR updates the types of 3 methods (getInfo, getAddresses, getAccounts), with remaining methods planned to be incrementally updated with future PRs.
A couple of new methods for connecting and disconnecting the wallet are also added.