Skip to content

Commit d9fcbf0

Browse files
lukaw3dlukaw3d
authored andcommitted
Move account names source URLs to externalLinks
1 parent a4ac7bd commit d9fcbf0

File tree

4 files changed

+30
-19
lines changed

4 files changed

+30
-19
lines changed

.changelog/1905.trivial.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Move account names source URLs to externalLinks

src/app/data/oasis-account-names.ts

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,20 @@ import {
1717
AccountNameSearchRuntimeMatch,
1818
} from './named-accounts'
1919
import { hasTextMatch } from '../components/HighlightedText/text-matching'
20+
import * as externalLinks from '../utils/externalLinks'
2021

2122
const dataSources: Record<Network, Partial<Record<Layer, string>>> = {
2223
[Network.mainnet]: {
23-
[Layer.consensus]:
24-
'https://raw.githubusercontent.com/oasisprotocol/nexus/main/named-addresses/mainnet_consensus.json',
25-
[Layer.emerald]:
26-
'https://raw.githubusercontent.com/oasisprotocol/nexus/main/named-addresses/mainnet_emerald.json',
27-
[Layer.sapphire]:
28-
'https://raw.githubusercontent.com/oasisprotocol/nexus/main/named-addresses/mainnet_sapphire.json',
24+
[Layer.consensus]: externalLinks.api.oasis_named_addresses_mainnet_consensus,
25+
[Layer.emerald]: externalLinks.api.oasis_named_addresses_mainnet_emerald,
26+
[Layer.sapphire]: externalLinks.api.oasis_named_addresses_mainnet_sapphire,
2927
},
3028
[Network.testnet]: {
31-
[Layer.consensus]:
32-
'https://raw.githubusercontent.com/oasisprotocol/nexus/main/named-addresses/testnet_consensus.json',
33-
[Layer.emerald]:
34-
'https://raw.githubusercontent.com/oasisprotocol/nexus/main/named-addresses/testnet_emerald.json',
35-
[Layer.sapphire]:
36-
'https://raw.githubusercontent.com/oasisprotocol/nexus/main/named-addresses/testnet_sapphire.json',
37-
[Layer.pontusxdev]:
38-
'https://raw.githubusercontent.com/oasisprotocol/nexus/main/named-addresses/testnet_pontusxdev.json',
39-
[Layer.pontusxtest]:
40-
'https://raw.githubusercontent.com/oasisprotocol/nexus/main/named-addresses/testnet_pontusxtest.json',
29+
[Layer.consensus]: externalLinks.api.oasis_named_addresses_testnet_consensus,
30+
[Layer.emerald]: externalLinks.api.oasis_named_addresses_testnet_emerald,
31+
[Layer.sapphire]: externalLinks.api.oasis_named_addresses_testnet_sapphire,
32+
[Layer.pontusxdev]: externalLinks.api.oasis_named_addresses_testnet_pontusxdev,
33+
[Layer.pontusxtest]: externalLinks.api.oasis_named_addresses_testnet_pontusxtest,
4134
},
4235
[Network.localnet]: {
4336
[Layer.consensus]: undefined,

src/app/data/pontusx-account-names.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,15 @@ import { Layer, useGetRuntimeAccountsAddresses } from '../../oasis-nexus/api'
1111
import { Network } from '../../types/network'
1212
import { hasTextMatch } from '../components/HighlightedText/text-matching'
1313
import { getOasisAddress } from '../utils/helpers'
14-
15-
const DATA_SOURCE_URL = 'https://raw.githubusercontent.com/deltaDAO/mvg-portal/main/pontusxAddresses.json'
14+
import * as externalLinks from '../utils/externalLinks'
1615

1716
type PontusXAccountsMetadata = {
1817
map: AccountMap
1918
list: AccountMetadata[]
2019
}
2120

2221
const getPontusXAccountsMetadata = async (): Promise<PontusXAccountsMetadata> => {
23-
const response = await axios.get(DATA_SOURCE_URL)
22+
const response = await axios.get(externalLinks.api.deltadao_named_addresses)
2423
if (response.status !== 200) throw new Error("Couldn't load names")
2524
if (!response.data) throw new Error("Couldn't load names")
2625
const map: AccountMap = new Map()

src/app/utils/externalLinks.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,24 @@ export const dapps = {
6262

6363
export const api = {
6464
spec: `${process.env.REACT_APP_API}spec/v1.html`,
65+
oasis_named_addresses_mainnet_consensus:
66+
'https://raw.githubusercontent.com/oasisprotocol/nexus/main/named-addresses/mainnet_consensus.json',
67+
oasis_named_addresses_mainnet_emerald:
68+
'https://raw.githubusercontent.com/oasisprotocol/nexus/main/named-addresses/mainnet_emerald.json',
69+
oasis_named_addresses_mainnet_sapphire:
70+
'https://raw.githubusercontent.com/oasisprotocol/nexus/main/named-addresses/mainnet_sapphire.json',
71+
oasis_named_addresses_testnet_consensus:
72+
'https://raw.githubusercontent.com/oasisprotocol/nexus/main/named-addresses/testnet_consensus.json',
73+
oasis_named_addresses_testnet_emerald:
74+
'https://raw.githubusercontent.com/oasisprotocol/nexus/main/named-addresses/testnet_emerald.json',
75+
oasis_named_addresses_testnet_sapphire:
76+
'https://raw.githubusercontent.com/oasisprotocol/nexus/main/named-addresses/testnet_sapphire.json',
77+
oasis_named_addresses_testnet_pontusxdev:
78+
'https://raw.githubusercontent.com/oasisprotocol/nexus/main/named-addresses/testnet_pontusxdev.json',
79+
oasis_named_addresses_testnet_pontusxtest:
80+
'https://raw.githubusercontent.com/oasisprotocol/nexus/main/named-addresses/testnet_pontusxtest.json',
81+
deltadao_named_addresses:
82+
'https://raw.githubusercontent.com/deltaDAO/mvg-portal/main/pontusxAddresses.json',
6583
}
6684

6785
export const ipfs = {

0 commit comments

Comments
 (0)