Skip to content
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

Merged
merged 4 commits into from
Feb 4, 2025
Merged

[FRONT-1871] Polygon Amoy support #354

merged 4 commits into from
Feb 4, 2025

Conversation

tumppi
Copy link
Contributor

@tumppi tumppi commented Nov 19, 2024

This PR adds support for Polygon Amoy network.

  • Added network selector UI component with Mainnet/Amoy options
  • Implemented selected chain persistence in localStorage
  • Updated API clients and queries to use chain-specific endpoints
  • Added chain-specific StreamrClient configuration

Copy link

linear bot commented Nov 19, 2024

@tumppi tumppi requested a review from mondoreale November 19, 2024 07:23
Copy link
Contributor

@mondoreale mondoreale left a 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.

@@ -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) {
Copy link
Contributor

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
Copy link
Contributor

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.

@tumppi
Copy link
Contributor Author

tumppi commented Feb 4, 2025

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.

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.

@tumppi tumppi merged commit d0ea60f into master Feb 4, 2025
3 checks passed
@tumppi tumppi deleted the FRONT-1871-amoy-support branch February 4, 2025 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants