Skip to content

Commit

Permalink
Update metadata format, update skale-network submodule, remove staging
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytrotkk committed Aug 19, 2024
1 parent 278aba2 commit 010c243
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 62 deletions.
2 changes: 1 addition & 1 deletion skale-network
3 changes: 0 additions & 3 deletions src/core/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,20 @@ export const HTTPS_PREFIX = 'https://'

export const MAINNET_EXPLORER_URLS: { [skaleNetwork: string]: string } = {
mainnet: 'https://etherscan.io',
staging: 'https://goerli.etherscan.io/',
legacy: 'https://holesky.etherscan.io/',
regression: 'https://goerli.etherscan.io/',
testnet: 'https://holesky.etherscan.io/'
}

export const BASE_EXPLORER_URLS: { [skaleNetwork: string]: string } = {
mainnet: 'explorer.mainnet.skalenodes.com',
staging: 'explorer.staging-v3.skalenodes.com',
legacy: 'legacy-explorer.skalenodes.com',
regression: 'regression-explorer.skalenodes.com',
testnet: 'explorer.testnet.skalenodes.com'
}

export const MAINNET_WS_ENDPOINTS: { [skaleNetwork: string]: string } = {
mainnet: 'wss://ethereum.publicnode.com',
staging: 'wss://ethereum-goerli.publicnode.com',
legacy: 'wss://ethereum-holesky.publicnode.com',
regression: 'wss://ethereum-goerli.publicnode.com',
testnet: 'wss://ethereum-holesky.publicnode.com'
Expand Down
2 changes: 0 additions & 2 deletions src/core/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import erc20WrapperAbi from '../metadata/erc20_wrapper_abi.json'
import sFuelWrapperAbi from '../metadata/sfuel_wrapper_abi.json'

import mainnetAddresses from '../metadata/addresses/mainnet.json'
import stagingAddresses from '../metadata/addresses/staging.json'
import legacyAddresses from '../metadata/addresses/legacy.json'
import regressionAddresses from '../metadata/addresses/regression.json'
import testnetAddresses from '../metadata/addresses/testnet.json'
Expand All @@ -51,7 +50,6 @@ export const ERC_ABIS: { [tokenType in CustomAbiTokenType | TokenType]: { ['abi'

export const IMA_ADDRESSES = {
mainnet: mainnetAddresses,
staging: stagingAddresses,
legacy: legacyAddresses,
regression: regressionAddresses,
testnet: testnetAddresses
Expand Down
28 changes: 20 additions & 8 deletions src/core/interfaces/ChainsMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export interface ChainMetadata {
shortAlias?: string
minSfuelWei?: string
faucetUrl?: string
category: string | string[]
background: string
categories: CategoriesMap
background?: string
gradientBackground?: string
description?: string
url?: string
Expand All @@ -38,15 +38,17 @@ export interface ChainMetadata {

export interface AppMetadata {
alias: string
background: string
gradientBackground?: string
description?: string
url?: string
tags?: string[]
contracts?: string[]
dappradar?: string | boolean
legacy?: boolean
featured?: boolean
social?: AppSocials
tags?: string[]
added?: number
categories: CategoriesMap
}

export interface CategoriesMap {
[category: string]: string[] | null
}

export interface AppMetadataMap {
Expand All @@ -60,3 +62,13 @@ export interface ChainsMetadataMap {
export type NetworksMetadataMap = {
[key in SkaleNetwork]: ChainsMetadataMap
}

export interface AppSocials {
website?: string
x?: string
telegram?: string
github?: string
discord?: string
swell?: string
dappradar?: string
}
2 changes: 1 addition & 1 deletion src/core/interfaces/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import { TokenConnectionsMap, TokenMetadataMap, MetaportTheme } from '.'

export type SkaleNetwork = 'mainnet' | 'staging' | 'legacy' | 'regression' | 'testnet'
export type SkaleNetwork = 'mainnet' | 'legacy' | 'regression' | 'testnet'

export interface MetaportConfig {
openOnLoad?: boolean
Expand Down
7 changes: 1 addition & 6 deletions src/core/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ import { SkaleNetwork, NetworksMetadataMap } from './interfaces'
import { MAINNET_CHAIN_NAME } from './constants'

import mainnetMeta from '../meta/mainnet/chains.json'
import stagingMeta from '../meta/staging/chains.json'
import legacyMeta from '../meta/legacy/chains.json'
import regressionMeta from '../meta/regression/chains.json'
import testnetMeta from '../meta/testnet/chains.json'

import * as MAINNET_CHAIN_ICONS from '../meta/mainnet/icons'
import * as STAGING_CHAIN_ICONS from '../meta/staging/icons'
import * as LEGACY_CHAIN_ICONS from '../meta/legacy/icons'
import * as REGRESSION_CHAIN_ICONS from '../meta/regression/icons'
import * as TESTNET_CHAIN_ICONS from '../meta/testnet/icons'
Expand All @@ -41,15 +39,13 @@ import * as icons from '../icons'

const CHAIN_ICONS: { [network in SkaleNetwork]: any } = {
mainnet: MAINNET_CHAIN_ICONS,
staging: STAGING_CHAIN_ICONS,
legacy: LEGACY_CHAIN_ICONS,
regression: REGRESSION_CHAIN_ICONS,
testnet: TESTNET_CHAIN_ICONS
}

export const CHAINS_META: NetworksMetadataMap = {
mainnet: mainnetMeta,
staging: stagingMeta,
legacy: legacyMeta,
regression: regressionMeta,
testnet: testnetMeta
Expand All @@ -72,8 +68,7 @@ export function getChainAlias(
): string {
if (chainName === MAINNET_CHAIN_NAME) {
if (skaleNetwork != MAINNET_CHAIN_NAME) {
const network = skaleNetwork === 'staging' ? 'Goerli' : skaleNetwork
return `Ethereum (${network})`
return `Ethereum (${skaleNetwork})`
}
return 'Ethereum'
}
Expand Down
4 changes: 0 additions & 4 deletions src/core/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const PROTOCOL: { [protocol in 'http' | 'ws']: string } = {
}

export const CHAIN_IDS: { [network in SkaleNetwork]: number } = {
staging: 5,
legacy: 17000,
regression: 5,
mainnet: 1,
Expand Down Expand Up @@ -86,9 +85,6 @@ function getProxyEndpoint(network: SkaleNetwork) {
}

export function getMainnetAbi(network: string) {
if (network === 'staging') {
return { ...IMA_ABIS.mainnet, ...IMA_ADDRESSES.staging }
}
if (network === 'legacy') {
return { ...IMA_ABIS.mainnet, ...IMA_ADDRESSES.legacy }
}
Expand Down
10 changes: 0 additions & 10 deletions src/metadata/addresses/staging.json

This file was deleted.

26 changes: 0 additions & 26 deletions src/metadata/faucet.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,6 @@
"func": "0x0c11dedd"
}
},
"staging": {
"staging-perfect-parallel-gacrux": {
"address": "0x4576d1B9eeaE16d6Ca643e55D21E0Dc00e8A7b6D",
"func": "0x0c11dedd"
},
"staging-severe-violet-wezen": {
"address": "0x37412E23bBF1058A7e325A16C01FF654E1D53562",
"func": "0x0c11dedd"
},
"staging-legal-crazy-castor": {
"address": "0x436389289aEAFefD1d7471b7FbEc67539Bde3E34",
"func": "0x6a627842"
},
"staging-utter-unripe-menkar": {
"address": "0x84b7265Bc964BB69b4275d4Dac4df0FD87556960",
"func": "0x0c11dedd"
},
"staging-faint-slimy-achird": {
"address": "0xfd56A3456fbAB0fc013213edCc830B9d32403C8B",
"func": "0x0c11dedd"
},
"staging-fast-active-bellatrix": {
"address": "0x1B2e7E6E66a6c202cdC0C31DF996b530af22CBee",
"func": "0x0c11dedd"
}
},
"legacy": {
"adorable-quaint-bellatrix": {
"address": "0x94977628d2EeDa78E2A56Abe178F432c46E13a6b",
Expand Down
1 change: 0 additions & 1 deletion src/metadata/proxy.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"mainnet": "mainnet.skalenodes.com",
"staging": "staging-v3.skalenodes.com",
"legacy": "legacy-proxy.skaleserver.com",
"regression": "regression-proxy.skalenodes.com",
"qatestnet": "new-testnet-proxy.skalenodes.com",
Expand Down

0 comments on commit 010c243

Please sign in to comment.