diff --git a/.env.master b/.env.master index f59918dd..db9868d8 100644 --- a/.env.master +++ b/.env.master @@ -11,6 +11,7 @@ APP_AUTO_DELEGATION_API_URL=https://autodelegator-api.minter.network/api/v1/ APP_EXPLORER_API_URL=https://explorer-api.minter.network/api/v2/ APP_EXPLORER_RTM_URL=wss://explorer-rtm.minter.network/connection/websocket APP_EXPLORER_HOST=https://explorer.minter.network +APP_EXPLORER_STATIC_HOST=https://explorer-static.minter.network APP_HUB_API_URL=https://hub-api.minter.network/ APP_ETHEREUM_API_URL=https://mainnet.infura.io/v3/0ab122c0f98043eda95266a862528e4c APP_BSC_API_URL=https://bsc-dataseed.binance.org/ diff --git a/.env.taconet b/.env.taconet index 6496a1d5..fc4f0b57 100644 --- a/.env.taconet +++ b/.env.taconet @@ -6,6 +6,7 @@ APP_AUTO_DELEGATION_API_URL=https://autodelegator.testnet.minter.network/api/v1/ APP_EXPLORER_API_URL=https://explorer-api.taconet.minter.network/api/v2/ APP_EXPLORER_RTM_URL=wss://explorer-rtm.taconet.minter.network/connection/websocket APP_EXPLORER_HOST=https://explorer.taconet.minter.network +APP_EXPLORER_STATIC_HOST=https://explorer-static.taconet.minter.network APP_HUB_API_URL=http://46.101.215.17:9091 APP_ETHEREUM_API_URL=https://ropsten.infura.io/v3/7b534be6f59742f9843c7e7562924f44 APP_BSC_API_URL=https://data-seed-prebsc-1-s3.binance.org:8545/ diff --git a/.env.testnet b/.env.testnet index d76088c9..417cbc4b 100644 --- a/.env.testnet +++ b/.env.testnet @@ -6,6 +6,7 @@ APP_AUTO_DELEGATION_API_URL=https://autodelegator.testnet.minter.network/api/v1/ APP_EXPLORER_API_URL=https://explorer-api.testnet.minter.network/api/v2/ APP_EXPLORER_RTM_URL=wss://explorer-rtm.testnet.minter.network/connection/websocket APP_EXPLORER_HOST=https://explorer.testnet.minter.network +APP_EXPLORER_STATIC_HOST=https://explorer-static.testnet.minter.network APP_HUB_API_URL=https://hub-api.kubernetes.icu/ APP_ETHEREUM_API_URL=https://ropsten.infura.io/v3/7b534be6f59742f9843c7e7562924f44 APP_BSC_API_URL=https://data-seed-prebsc-2-s3.binance.org:8545/ diff --git a/assets/variables.js b/assets/variables.js index 1b653989..cc930986 100644 --- a/assets/variables.js +++ b/assets/variables.js @@ -20,6 +20,7 @@ export const AUTO_DELEGATION_API_URL = process.env.APP_AUTO_DELEGATION_API_URL; export const EXPLORER_API_URL = process.env.APP_EXPLORER_API_URL; export const EXPLORER_RTM_URL = process.env.APP_EXPLORER_RTM_URL; export const EXPLORER_HOST = process.env.APP_EXPLORER_HOST; +export const EXPLORER_STATIC_HOST = process.env.APP_EXPLORER_STATIC_HOST; export const MNS_API_URL = process.env.APP_MNS_API_URL; export const MNS_PUBLIC_KEY = process.env.APP_MNS_PUBLIC_KEY; export const CHAINIK_API_URL = 'https://chainik.io/json/'; diff --git a/store/explorer.js b/store/explorer.js index 38ab2280..074cab0d 100644 --- a/store/explorer.js +++ b/store/explorer.js @@ -1,12 +1,14 @@ -import {isCoinId} from 'minter-js-sdk/src/utils.js'; +// import {isCoinId} from 'minter-js-sdk/src/utils.js'; import {getStatus, getCoinList} from '~/api/explorer.js'; -import {ACCOUNTS_API_URL, BASE_URL_PREFIX} from '~/assets/variables.js'; +import {ACCOUNTS_API_URL, BASE_URL_PREFIX, EXPLORER_STATIC_HOST} from '~/assets/variables.js'; export const state = () => ({ /** @type Status|null */ status: null, /** @type Array */ coinList: [], + /** @type {Object.} */ + coinMap: {}, /** @type {Object.} */ coinIconMap: {}, /** @type {Object.} */ @@ -32,7 +34,7 @@ export const getters = { // chainik icon if (coinIcon) { - return coinIcon; + return `${EXPLORER_STATIC_HOST}/coins/${state.coinMap[coinSymbol].id}.png`; } // archived coins @@ -66,9 +68,11 @@ export const mutations = { state.status = statusData; }, SET_COIN_LIST(state, data) { + let coinMap = {}; let coinIconMap = {}; let coinVerifiedMap = {}; data.forEach((coin) => { + coinMap[coin.symbol] = coin; if (coin.icon) { coinIconMap[coin.symbol] = coin.icon; } @@ -78,6 +82,7 @@ export const mutations = { }); state.coinList = Object.freeze(data); + state.coinMap = Object.freeze(coinMap); state.coinIconMap = Object.freeze(coinIconMap); state.coinVerifiedMap = Object.freeze(coinVerifiedMap); },