diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1c73d18..a4e87c9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,7 +19,7 @@ jobs: submodules: true - uses: actions/setup-node@v3 with: - node-version: '18.x' + node-version: '20.x' registry-url: 'https://registry.npmjs.org' - name: Prepare metadata run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 377cd5e..88da18b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [18] + node: [20] env: TEST: true steps: diff --git a/package.json b/package.json index 49cb35c..4f16c0f 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "./dist/style.css": "./dist/style.css" }, "engines": { - "node": "18" + "node": "20" }, "scripts": { "dev": "storybook dev -p 6006", diff --git a/skale-network b/skale-network index 1cb85c7..f06c279 160000 --- a/skale-network +++ b/skale-network @@ -1 +1 @@ -Subproject commit 1cb85c75f3275af23670602a791b669f167b33e7 +Subproject commit f06c279b61c8057070c5b384690467d0cded3934 diff --git a/src/core/interfaces/ChainsMetadata.ts b/src/core/interfaces/ChainsMetadata.ts index 5de4555..35d20eb 100644 --- a/src/core/interfaces/ChainsMetadata.ts +++ b/src/core/interfaces/ChainsMetadata.ts @@ -33,15 +33,23 @@ export interface ChainMetadata { gradientBackground?: string description?: string url?: string - apps?: { - [appName: string]: { - alias: string - background: string - gradientBackground?: string - description?: string - url?: string - } - } + apps?: AppMetadataMap +} + +export interface AppMetadata { + alias: string + background: string + gradientBackground?: string + description?: string + url?: string + tags?: string[] + contracts?: string[] + dappradar?: string | boolean + legacy?: boolean +} + +export interface AppMetadataMap { + [appName: string]: AppMetadata } export interface ChainsMetadataMap { diff --git a/src/core/metadata.ts b/src/core/metadata.ts index 72bddc0..044eced 100644 --- a/src/core/metadata.ts +++ b/src/core/metadata.ts @@ -55,6 +55,7 @@ export const CHAINS_META: NetworksMetadataMap = { testnet: testnetMeta } +// deprecated, remove after merge function transformChainName(chainName: string): string { return chainName .split('-') @@ -62,6 +63,7 @@ function transformChainName(chainName: string): string { .join(' ') } +// deprecated, remove after merge export function getChainAlias( skaleNetwork: SkaleNetwork, chainName: string, @@ -108,14 +110,21 @@ export function chainIconPath(skaleNetwork: SkaleNetwork, name: string, app?: st } } +// deprecated, remove after merge export function chainBg(skaleNetwork: SkaleNetwork, chainName: string, app?: string): string { if (CHAINS_META[skaleNetwork][chainName]) { if (app && CHAINS_META[skaleNetwork][chainName]['apps'][app]) { + if (CHAINS_META[skaleNetwork][chainName]['apps'][app]['gradientBackgroundLight']) { + return CHAINS_META[skaleNetwork][chainName]['apps'][app]['gradientBackgroundLight'] + } if (CHAINS_META[skaleNetwork][chainName]['apps'][app]['gradientBackground']) { return CHAINS_META[skaleNetwork][chainName]['apps'][app]['gradientBackground'] } return CHAINS_META[skaleNetwork][chainName]['apps'][app]['background'] } + if (CHAINS_META[skaleNetwork][chainName]['gradientBackgroundLight']) { + return CHAINS_META[skaleNetwork][chainName]['gradientBackgroundLight'] + } if (CHAINS_META[skaleNetwork][chainName]['gradientBackground']) { return CHAINS_META[skaleNetwork][chainName]['gradientBackground'] }