-
Notifications
You must be signed in to change notification settings - Fork 2
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
[FRONT-1871] Polygon Amoy support #354
Conversation
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.
It's a decent step forward.
My preference would be to keep the chain id in the page url (chainId
GET query param). There'd be no confusion when linking to entities. It may be a subject for discussion again once we intro another "live" network or something.
Anyways, I can live with the statefulness just fine, so, approved.
Have a look at the comment, too.
src/utils/nodes.ts
Outdated
@@ -2,25 +2,26 @@ import { useIsFetching, useQuery } from '@tanstack/react-query' | |||
import { MinuteMs } from '../consts' | |||
import { getOperatorNodes } from '../getters' | |||
|
|||
function getOperatorNodesForStreamQueryKey(streamId: string | undefined) { | |||
return ['useOperatorNodesForStreamQuery', streamId || ''] | |||
function getOperatorNodesForStreamQueryKey(streamId: string | undefined, chainId: number) { |
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.
I'd prefer chainId
to go first in all the chain-specific utility functions. It'd be
function foo(chainId: number, ...rest) {}
It then serves a role of a directive for where to look for streams or nodes.
Low pressure.
// eslint-disable-next-line import/no-unused-modules | ||
export function getStreamrClientConfig(chainId: number): StreamrClientConfig { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
const chainConfig = Object.values(config).find((network) => network.id === chainId) as any |
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.
Nicely typed config coming, sir! Ok to leave any
for now.
True, it would be better. I created a ticket for that: https://linear.app/streamr/issue/FRONT-1972/move-chainid-into-a-url-parameter. Let's implement that later. |
This PR adds support for Polygon Amoy network.