-
Notifications
You must be signed in to change notification settings - Fork 731
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
sdk: improve type safety + add documentation #1102
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
evan-gray
requested changes
Apr 22, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice uses of never! Three requests:
- Can we add some verbose tests for the array utils?
- Please update the CHANGELOG when making SDK changes.
- This will require a minor version bump. Can you please update the package to reflect this?
e7f6df0
to
8d35eaa
Compare
4bfbb59
to
5c4a6d9
Compare
✅ Deploy Preview for tubular-dango-1656b2 canceled.
|
✅ Deploy Preview for roaring-moonbeam-aa0ca5 canceled.
|
12d38d4
to
b040fd0
Compare
This is a legit chain id that some governance VAAs target
b040fd0
to
986b32a
Compare
986b32a
to
683e733
Compare
evan-gray
previously approved these changes
May 5, 2022
kcsongor
commented
May 5, 2022
683e733
to
063655c
Compare
evan-gray
previously approved these changes
May 5, 2022
063655c
to
a6f2b8c
Compare
panoel
approved these changes
May 5, 2022
evan-gray
approved these changes
May 5, 2022
bruce-riley
pushed a commit
that referenced
this pull request
May 25, 2022
* sdk/js: improve type safety + add documentation * sdk/js: add support for chain names * sdk/js: fix boolean conditional bug in transferFromSolana * sdk/js: remove unsafe ChainId coercions in sdk * sdk/js: Chain id 0 This is a legit chain id that some governance VAAs target * sdk/js: Add mainnet and testnet contract addresses * sdk/js: bump version to 0.3.0 * sdk/js: limit minor version changes * sdk/js: update contracts and add devnet Co-authored-by: Csongor Kiss <ckiss@jumptrading.com> Co-authored-by: Evan Gray <battledingo@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The main goal of this PR is to improve the type safety of some of the sdk functionality.
isEVMChain
now performs type refinement. This way, we can achieve exhaustivity checking in downstream code that relies on this check.null
value is returned from using the functions in an intended way (that is, passing in well-typed arguments). This obviates the need for callers to coalesce null cases to values like""
which results in a debugging nightmare.Promise<any>
, which is not that helpful.This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)