diff --git a/package-lock.json b/package-lock.json index d86deab46c..d61459d07a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@metamask/providers": "^17.1.2", "@sambego/storybook-styles": "^1.0.0", "@sentry/react": "^8.34.0", - "@streamr/config": "^5.4.0", + "@streamr/config": "^5.5.0", "@streamr/hub-contracts": "^1.1.2", "@streamr/sdk": "^102.0.0", "@streamr/streamr-icons": "^0.1.9", @@ -10842,9 +10842,10 @@ } }, "node_modules/@streamr/config": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/@streamr/config/-/config-5.4.2.tgz", - "integrity": "sha512-x+VW0s9ydY1oT16D8FP3GE/dGPpAfjvQ6ncZvxs0McuT63T1XtMAHaIDcVcw8eOhbjYToSfHEzLwZ23biEFsBg==" + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@streamr/config/-/config-5.5.0.tgz", + "integrity": "sha512-c/opTpszvtgM1F/TZDo0KwiqsI29bIYcleV+hn86vonYrEXKSr3m97nwq9oHoThyfW1foO2PkadZRuqBZyjxNA==", + "license": "STREAMR NETWORK OPEN SOURCE LICENSE" }, "node_modules/@streamr/dht": { "version": "102.0.0", diff --git a/package.json b/package.json index 2c342dfb6c..a3cfefd1f0 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "@metamask/providers": "^17.1.2", "@sambego/storybook-styles": "^1.0.0", "@sentry/react": "^8.34.0", - "@streamr/config": "^5.4.0", + "@streamr/config": "^5.5.0", "@streamr/hub-contracts": "^1.1.2", "@streamr/sdk": "^102.0.0", "@streamr/streamr-icons": "^0.1.9", diff --git a/src/components/ChainSelector.tsx b/src/components/ChainSelector.tsx index 9774f2a016..321c1a68a4 100644 --- a/src/components/ChainSelector.tsx +++ b/src/components/ChainSelector.tsx @@ -1,3 +1,4 @@ +import { Chain } from '@streamr/config' import React from 'react' import { useSearchParams } from 'react-router-dom' import styled from 'styled-components' @@ -5,10 +6,9 @@ import { SimpleDropdown, SimpleListDropdownMenu } from '~/components/SimpleDropd import { getEnvironmentConfig } from '~/getters/getEnvironmentConfig' import UnstyledNetworkIcon from '~/shared/components/NetworkIcon' import SvgIcon from '~/shared/components/SvgIcon' -import { getSymbolicChainName, useCurrentChain } from '~/utils/chains' import { COLORS, LAPTOP } from '~/shared/utils/styled' import { StreamDraft } from '~/stores/streamDraft' -import { Chain } from '~/types' +import { getSymbolicChainName, useCurrentChain } from '~/utils/chains' type MenuItemProps = { chain: Chain diff --git a/src/getters/getClientConfig.ts b/src/getters/getClientConfig.ts index cac9ea5658..17812cc9ef 100644 --- a/src/getters/getClientConfig.ts +++ b/src/getters/getClientConfig.ts @@ -17,7 +17,7 @@ export default function getClientConfig( if (chainConfig.entryPoints && chainConfig.entryPoints.length > 0) { config.network = { controlLayer: { - entryPoints: chainConfig.entryPoints, + entryPoints: [...chainConfig.entryPoints], }, } } diff --git a/src/pages/ProjectPage/ProjectEditorPage.tsx b/src/pages/ProjectPage/ProjectEditorPage.tsx index a15fcb3e95..332ed22095 100644 --- a/src/pages/ProjectPage/ProjectEditorPage.tsx +++ b/src/pages/ProjectPage/ProjectEditorPage.tsx @@ -1,3 +1,4 @@ +import { Chain } from '@streamr/config' import React, { useMemo } from 'react' import { useNavigate } from 'react-router-dom' import styled, { css } from 'styled-components' @@ -21,18 +22,17 @@ import { deleteProject } from '~/services/projects' import { DetailsPageHeader } from '~/shared/components/DetailsPageHeader' import LoadingIndicator from '~/shared/components/LoadingIndicator' import useIsMounted from '~/shared/hooks/useIsMounted' +import { ProjectType, SalePoint } from '~/shared/types' +import { ProjectDraft } from '~/stores/projectDraft' +import { SalePointsPayload } from '~/types/projects' +import { formatChainName } from '~/utils' import { getChainConfig, getChainConfigExtension, useCurrentChainId, } from '~/utils/chains' -import { ProjectType, SalePoint } from '~/shared/types' -import { ProjectDraft } from '~/stores/projectDraft' -import { Chain } from '~/types' -import { SalePointsPayload } from '~/types/projects' -import { formatChainName } from '~/utils' -import { toastedOperation } from '~/utils/toastedOperation' import { Route as R, routeOptions } from '~/utils/routes' +import { toastedOperation } from '~/utils/toastedOperation' import DataUnionFee from './DataUnionFee' import DataUnionPayment from './DataUnionPayment' import EditorHero from './EditorHero' diff --git a/src/parsers/ProjectParser.ts b/src/parsers/ProjectParser.ts index 2f03d03b41..e7da300a36 100644 --- a/src/parsers/ProjectParser.ts +++ b/src/parsers/ProjectParser.ts @@ -1,3 +1,4 @@ +import { Chain } from '@streamr/config' import { z } from 'zod' import { address0 } from '~/consts' import { getProjectImageUrl } from '~/getters' @@ -9,7 +10,6 @@ import { timeUnitSecondsMultiplierMap, timeUnits, } from '~/shared/utils/timeUnit' -import { Chain } from '~/types' import { toBigInt } from '~/utils/bn' import { getChainConfig, diff --git a/src/types/index.ts b/src/types/index.ts index fce99a7e77..efbfb99a6b 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,4 +1,3 @@ -import { config as configs } from '@streamr/config' import { MessageID } from '@streamr/sdk' import { TheGraph } from '~/shared/types' @@ -42,32 +41,6 @@ export type ChainConfigKey = | 'minimumDelegationWei' | 'earlyLeaverPenaltyWei' -type ContractAddressKey = typeof configs extends Record< - any, - Record<'contracts', Partial>> -> - ? K - : never - -export interface Chain { - name: string - id: number - theGraphUrl?: string - rpcEndpoints: { url: string }[] - contracts: Partial> - entryPoints?: { - nodeId: string - websocket: { - host: string - port: number - tls: boolean - } - }[] - nativeCurrency: { symbol: string; name: string; decimals: number } - blockExplorerUrl?: string - adminPrivateKey?: string -} - export type OrderDirection = 'asc' | 'desc' export interface DataPoint { diff --git a/src/utils/chains.ts b/src/utils/chains.ts index 7e781fd7b9..1efae3144f 100644 --- a/src/utils/chains.ts +++ b/src/utils/chains.ts @@ -1,14 +1,13 @@ -import { config as configs } from '@streamr/config' +import { Chain, Config, config as configs } from '@streamr/config' import { produce } from 'immer' import { useMemo } from 'react' import { useSearchParams } from 'react-router-dom' +import { ethereumNetworks } from '~/shared/utils/constants' import { ChainConfigExtension, fallbackChainConfigExtension, parsedChainConfigExtension, } from '~/utils/chainConfigExtension' -import { Chain } from '~/types' -import { ethereumNetworks } from '~/shared/utils/constants' import formatConfigUrl from './formatConfigUrl' function getPreferredChainName(chainName: string) { diff --git a/src/utils/contracts.ts b/src/utils/contracts.ts index 52584bb5ab..87f2035918 100644 --- a/src/utils/contracts.ts +++ b/src/utils/contracts.ts @@ -97,8 +97,6 @@ export function getContractAddress( return contracts.SponsorshipStakeWeightedAllocationPolicy case 'sponsorshipVoteKickPolicy': return contracts.SponsorshipVoteKickPolicy - case 'sponsorshipPaymentToken': - return contracts.SponsorshipPaymentToken case 'streamRegistry': return contracts.StreamRegistry case 'streamStorage':