-
-
Notifications
You must be signed in to change notification settings - Fork 249
Chore/bridge bridge status superstruct #5408
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
Conversation
7a7a917
to
9bae550
Compare
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.
LGTM!
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!
const url = `${BRIDGE_STATUS_BASE_URL}?${params.toString()}`; | ||
|
||
const rawTxStatus = await fetchFn(url, { | ||
const rawTxStatus: unknown = await fetchFn(url, { |
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 improvement in type safety by explicitly marking API responses as unknown before validation.
Explanation
This PR refactors the
BridgeController
andBridgeStatusController
to use Superstruct for increased readability of API response validators.References
Changelog
@metamask/bridge-controller
@metamask/bridge-status-controller
Checklist