-
Notifications
You must be signed in to change notification settings - Fork 13
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
Use provider's chainId as default if present #8
Conversation
…Cow Explorer builds fine
ESLint Summary View Full Report
[failure] @typescript-eslint/no-explicit-any
[failure] @typescript-eslint/no-non-null-assertion
Report generated by eslint-plus-action |
src/utils/context.ts
Outdated
private context: CowContext | ||
#chainId: ChainId |
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.
What's the reason for using TS private (private
) for context and JS private (#
) for chainId?
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.
good catch! when I updated the chainId accessor didn't change the context one. This was to enforce runtime access outside of TS
Close #3
This improves how the chainId was handled due to the possibility of a mismatch between the chainId used in the constructor to instantiate the sdk and the provider's chainId:
You can still instantiate the sdk without passing any signer just for querying purposes and also update the current chainId
The chainId getter/setter was moved to the Context and made it async.