From f6caa18a780f4a49a64cef4502e6acf6e438d908 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Wed, 12 Jun 2024 13:02:16 +0100 Subject: [PATCH 1/5] Update apps metadata format, update skale-network --- .gitmodules | 2 +- skale-network | 2 +- src/core/interfaces/ChainsMetadata.ts | 26 +++++++++++++++++--------- src/core/metadata.ts | 9 +++++++++ 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/.gitmodules b/.gitmodules index 883b2b7..88f78d1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,4 +5,4 @@ [submodule "skale-network"] path = skale-network url = https://github.com/skalenetwork/skale-network.git - branch = master + branch = update-mainnet-chains-metadata diff --git a/skale-network b/skale-network index 1cb85c7..036cf02 160000 --- a/skale-network +++ b/skale-network @@ -1 +1 @@ -Subproject commit 1cb85c75f3275af23670602a791b669f167b33e7 +Subproject commit 036cf02bd52b9f97de05b617c745550242396f78 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'] } From cd72128e1ec6ac9e2346ce926f36655be8a65d63 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Wed, 12 Jun 2024 13:07:09 +0100 Subject: [PATCH 2/5] Bump node version in test pipeline --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: From c8daa8d2d8f20604db3edff2186dccf83362fa83 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Wed, 12 Jun 2024 13:25:30 +0100 Subject: [PATCH 3/5] Bump node version in publish pipeline --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: | From 6864e77a93942e0b1d05abab620daf32b10dcad8 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Wed, 12 Jun 2024 13:25:53 +0100 Subject: [PATCH 4/5] Bump node version in package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", From cab70dae868a25c65f6992bd549cecb693b0c262 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Wed, 12 Jun 2024 15:27:25 +0100 Subject: [PATCH 5/5] Update skale-network submodule --- .gitmodules | 2 +- skale-network | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 88f78d1..883b2b7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,4 +5,4 @@ [submodule "skale-network"] path = skale-network url = https://github.com/skalenetwork/skale-network.git - branch = update-mainnet-chains-metadata + branch = master diff --git a/skale-network b/skale-network index 036cf02..f06c279 160000 --- a/skale-network +++ b/skale-network @@ -1 +1 @@ -Subproject commit 036cf02bd52b9f97de05b617c745550242396f78 +Subproject commit f06c279b61c8057070c5b384690467d0cded3934