diff --git a/apps/ui/src/composables/useWeb3.ts b/apps/ui/src/composables/useWeb3.ts index 4216c7ced..db042bbc1 100644 --- a/apps/ui/src/composables/useWeb3.ts +++ b/apps/ui/src/composables/useWeb3.ts @@ -1,8 +1,8 @@ import { Web3Provider } from '@ethersproject/providers'; import { formatUnits } from '@ethersproject/units'; import { getInstance } from '@snapshot-labs/lock/plugins/vue3'; +import networks from '@snapshot-labs/snapshot.js/src/networks.json'; import { constants } from 'starknet'; -import networks from '@/helpers/networks.json'; import { formatAddress } from '@/helpers/utils'; import { STARKNET_CONNECTORS } from '@/networks/common/constants'; import { Connector } from '@/networks/types'; @@ -11,12 +11,12 @@ const STARKNET_NETWORKS = { [constants.StarknetChainId.SN_MAIN]: { key: constants.StarknetChainId.SN_MAIN, chainId: constants.StarknetChainId.SN_MAIN, - explorer: 'https://starkscan.co' + explorer: { url: 'https://starkscan.co' } }, [constants.StarknetChainId.SN_SEPOLIA]: { key: constants.StarknetChainId.SN_SEPOLIA, chainId: constants.StarknetChainId.SN_SEPOLIA, - explorer: 'https://sepolia.starkscan.co' + explorer: { url: 'https://sepolia.starkscan.co' } } }; diff --git a/apps/ui/src/helpers/call.ts b/apps/ui/src/helpers/call.ts index f8851f4e0..d4cc8141d 100644 --- a/apps/ui/src/helpers/call.ts +++ b/apps/ui/src/helpers/call.ts @@ -1,6 +1,6 @@ import { Interface } from '@ethersproject/abi'; import { Contract } from '@ethersproject/contracts'; -import networks from '@/helpers/networks.json'; +import networks from '@snapshot-labs/snapshot.js/src/networks.json'; export async function call(provider, abi: any[], call: any[], options?) { const contract = new Contract(call[0], abi, provider); diff --git a/apps/ui/src/helpers/networks.json b/apps/ui/src/helpers/networks.json deleted file mode 100644 index ed66c4203..000000000 --- a/apps/ui/src/helpers/networks.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "1": { - "key": "1", - "chainId": 1, - "multicall": "0xeefba1e63905ef1d7acba5a8513c70307c1ce441", - "explorer": "https://etherscan.io" - }, - "10": { - "key": "10", - "chainId": 10, - "multicall": "0xcA11bde05977b3631167028862bE2a173976CA11", - "explorer": "https://optimistic.etherscan.io" - }, - "56": { - "key": "56", - "chainId": 56, - "multicall": "0x1Ee38d535d541c55C9dae27B12edf090C608E6Fb", - "explorer": "https://bscscan.com" - }, - "100": { - "key": "100", - "chainId": 100, - "multicall": "0xb5b692a88BDFc81ca69dcB1d924f59f0413A602a", - "explorer": "https://gnosis.blockscout.com" - }, - "137": { - "key": "137", - "chainId": 137, - "multicall": "0xCBca837161be50EfA5925bB9Cc77406468e76751", - "explorer": "https://polygonscan.com" - }, - "250": { - "key": "250", - "chainId": 250, - "multicall": "0x7f6A10218264a22B4309F3896745687E712962a0", - "explorer": "https://ftmscan.com" - }, - "8453": { - "key": "8453", - "chainId": 8453, - "multicall": "0xcA11bde05977b3631167028862bE2a173976CA11", - "explorer": "https://basescan.org/" - }, - "42161": { - "key": "42161", - "chainId": 42161, - "multicall": "0x7A7443F8c577d537f1d8cD4a629d40a3148Dd7ee", - "explorer": "https://arbiscan.io" - }, - "11155111": { - "key": "11155111", - "chainId": 11155111, - "multicall": "0xcA11bde05977b3631167028862bE2a173976CA11", - "explorer": "https://sepolia.etherscan.io" - } -} diff --git a/apps/ui/src/networks/evm/index.ts b/apps/ui/src/networks/evm/index.ts index 2e704f241..facdd5b0c 100644 --- a/apps/ui/src/networks/evm/index.ts +++ b/apps/ui/src/networks/evm/index.ts @@ -1,4 +1,4 @@ -import networks from '@/helpers/networks.json'; +import networks from '@snapshot-labs/snapshot.js/src/networks.json'; import { pinGraph } from '@/helpers/pin'; import { getProvider } from '@/helpers/provider'; import { Network } from '@/networks/types'; @@ -110,7 +110,7 @@ export function createEvmNetwork(networkId: NetworkID): Network { else if (['address', 'contract', 'strategy'].includes(type)) dataType = 'address'; - return `${networks[chainId].explorer}/${dataType}/${id}`; + return `${networks[chainId].explorer.url}/${dataType}/${id}`; } }; diff --git a/apps/ui/src/networks/offchain/index.ts b/apps/ui/src/networks/offchain/index.ts index 727112371..08e432458 100644 --- a/apps/ui/src/networks/offchain/index.ts +++ b/apps/ui/src/networks/offchain/index.ts @@ -1,5 +1,5 @@ +import networks from '@snapshot-labs/snapshot.js/src/networks.json'; import { getSpaceController } from '@/helpers/ens'; -import networks from '@/helpers/networks.json'; import { pinPineapple } from '@/helpers/pin'; import { getProvider } from '@/helpers/provider'; import { Network } from '@/networks/types'; @@ -60,7 +60,7 @@ export function createOffchainNetwork(networkId: NetworkID): Network { switch (type) { case 'transaction': if (id.startsWith('0x')) { - return `${network.explorer}/tx/${id}`; + return network ? `${network.explorer.url}/tx/${id}` : ''; } return `https://signator.io/view?ipfs=${id}`; @@ -68,7 +68,7 @@ export function createOffchainNetwork(networkId: NetworkID): Network { return `${SNAPSHOT_URLS[networkId]}/#/strategy/${id}`; case 'contract': case 'address': - return network ? `${network.explorer}/address/${id}` : ''; + return network ? `${network.explorer.url}/address/${id}` : ''; default: throw new Error('Not implemented'); }