Skip to content

Commit

Permalink
Merge pull request #266 from skalenetwork/update-apps-meta
Browse files Browse the repository at this point in the history
Update apps metadata format, update skale-network
  • Loading branch information
dmytrotkk authored Jun 12, 2024
2 parents 4fae88a + cab70da commit 39affe6
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [18]
node: [20]
env:
TEST: true
steps:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"./dist/style.css": "./dist/style.css"
},
"engines": {
"node": "18"
"node": "20"
},
"scripts": {
"dev": "storybook dev -p 6006",
Expand Down
2 changes: 1 addition & 1 deletion skale-network
Submodule skale-network updated 52 files
+722 −27 metadata/mainnet/chains.json
+ metadata/mainnet/logos/elated-tan-skat-aquas-trade.png
+ metadata/mainnet/logos/elated-tan-skat-coinsender.png
+1 −0 metadata/mainnet/logos/elated-tan-skat-rehold.svg
+ metadata/mainnet/logos/elated-tan-skat-ruby-exchange.png
+ metadata/mainnet/logos/green-giddy-denebola-arena-games-platform.png
+ metadata/mainnet/logos/green-giddy-denebola-ballers-city.png
+ metadata/mainnet/logos/green-giddy-denebola-bit-hotel.png
+ metadata/mainnet/logos/green-giddy-denebola-booja-world.png
+ metadata/mainnet/logos/green-giddy-denebola-chainguardians.png
+ metadata/mainnet/logos/green-giddy-denebola-cryptocrusades.png
+ metadata/mainnet/logos/green-giddy-denebola-dexgo.png
+ metadata/mainnet/logos/green-giddy-denebola-earnscape.png
+ metadata/mainnet/logos/green-giddy-denebola-fivetars.png
+ metadata/mainnet/logos/green-giddy-denebola-floki-cyber-punk.png
+ metadata/mainnet/logos/green-giddy-denebola-gamifly.png
+ metadata/mainnet/logos/green-giddy-denebola-hangry-animals.png
+ metadata/mainnet/logos/green-giddy-denebola-hatchyverse.png
+16 −0 metadata/mainnet/logos/green-giddy-denebola-heavens-compass.svg
+ metadata/mainnet/logos/green-giddy-denebola-heroes-battle-arena.png
+ metadata/mainnet/logos/green-giddy-denebola-hurley-super-surfer.png
+ metadata/mainnet/logos/green-giddy-denebola-interverse.png
+34 −0 metadata/mainnet/logos/green-giddy-denebola-jump-trade.svg
+ metadata/mainnet/logos/green-giddy-denebola-katana-inu.png
+ metadata/mainnet/logos/green-giddy-denebola-metasoccer.png
+ metadata/mainnet/logos/green-giddy-denebola-motodex.png
+41 −0 metadata/mainnet/logos/green-giddy-denebola-mystrios.svg
+9 −0 metadata/mainnet/logos/green-giddy-denebola-nftb.svg
+ metadata/mainnet/logos/green-giddy-denebola-nftmining.png
+ metadata/mainnet/logos/green-giddy-denebola-omniaverse.png
+ metadata/mainnet/logos/green-giddy-denebola-rise-online-world.png
+ metadata/mainnet/logos/green-giddy-denebola-roco-finance.png
+ metadata/mainnet/logos/green-giddy-denebola-space-rush-odyssey.png
+ metadata/mainnet/logos/green-giddy-denebola-spells-of-genesis.png
+ metadata/mainnet/logos/green-giddy-denebola-sportzchain.png
+ metadata/mainnet/logos/green-giddy-denebola-starwolvez.png
+ metadata/mainnet/logos/green-giddy-denebola-starzplay-fantasy-sports.png
+ metadata/mainnet/logos/green-giddy-denebola-world-of-dypians.png
+ metadata/mainnet/logos/green-giddy-denebola-yomi-games.png
+ metadata/mainnet/logos/green-giddy-denebola-zeus.png
+ metadata/mainnet/logos/honorable-steel-rasalhague-clet-name-service.png
+ metadata/mainnet/logos/honorable-steel-rasalhague-collab-land.png
+ metadata/mainnet/logos/honorable-steel-rasalhague-dmail.png
+ metadata/mainnet/logos/honorable-steel-rasalhague-dripverse.png
+ metadata/mainnet/logos/honorable-steel-rasalhague-hurley.png
+ metadata/mainnet/logos/honorable-steel-rasalhague-pixudi.png
+ metadata/mainnet/logos/honorable-steel-rasalhague-solo-network.png
+ metadata/mainnet/logos/honorable-steel-rasalhague-tank-wars-zone.png
+ metadata/mainnet/logos/parallel-stormy-spica-chaingpt.png
+ metadata/mainnet/logos/parallel-stormy-spica-palm-ai.png
+3 −0 metadata/mainnet/logos/parallel-stormy-spica-sirkl.svg
+26 −0 metadata/mainnet/logos/parallel-stormy-spica-skillful-ai.svg
26 changes: 17 additions & 9 deletions src/core/interfaces/ChainsMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 9 additions & 0 deletions src/core/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ export const CHAINS_META: NetworksMetadataMap = {
testnet: testnetMeta
}

// deprecated, remove after merge
function transformChainName(chainName: string): string {
return chainName
.split('-')
.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
.join(' ')
}

// deprecated, remove after merge
export function getChainAlias(
skaleNetwork: SkaleNetwork,
chainName: string,
Expand Down Expand Up @@ -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']
}
Expand Down

0 comments on commit 39affe6

Please sign in to comment.