diff --git a/.gitignore b/.gitignore index e33bed9e..7c8591d9 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ dist.zip .eslintcache .vscode/ coverage/ +.hostingConfig.json + diff --git a/package-lock.json b/package-lock.json index 369fde4e..60a132ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "plain-dapp-update", - "version": "1.17.0", + "version": "1.18.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "plain-dapp-update", - "version": "1.17.0", + "version": "1.18.0", "dependencies": { "@blockshake/defly-connect": "^1.1.5", "@curvefi/api": "^2.28.0", diff --git a/package.json b/package.json index 7480c3ab..2838e8b7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "plain-dapp-update", "private": true, - "version": "1.17.0", + "version": "1.18.0", "type": "module", "scripts": { "dev": "npm run create-version-file && vite", diff --git a/src/constants/index.js b/src/constants/index.js index 25660184..6ed8346c 100755 --- a/src/constants/index.js +++ b/src/constants/index.js @@ -71,8 +71,6 @@ export const WALLET_ALGORAND_ACCOUNT_CHANGED = 'WALLET_ALGORAND_ACCOUNT_CHANGED' export const WALLET_FTM_CONNECTED = 'WALLET_FTM_CONNECTED' export const WALLET_FTM_DISCONNECTED = 'WALLET_FTM_DISCONNECTED' export const WALLET_FTM_ACCOUNT_CHANGED = 'WALLET_FTM_ACCOUNT_CHANGED' -export const WALLET_ORE_CONNECTED = 'WALLET_ORE_CONNECTED' -export const WALLET_ORE_DISCONNECTED = 'WALLET_ORE_DISCONNECTED' // swap-old-pnt export const ASSETS_LOADED_SWAP_OLD_PNT = 'ASSETS_LOADED_SWAP_OLD_PNT' @@ -157,7 +155,6 @@ export const PUSDC_ON_ALGORAND_MAINNET = 'PUSDC_ON_ALGORAND_MAINNET' export const USDC_ON_ALGORAND_MAINNET = 'USDC_ON_ALGORAND_MAINNET' export const PUSDT_ON_ALGORAND_MAINNET = 'PUSDT_ON_ALGORAND_MAINNET' export const USDT_ON_ALGORAND_MAINNET = 'USDT_ON_ALGORAND_MAINNET' -export const ORE_ON_ETH_MAINNET = 'ORE_ON_ETH_MAINNET' export const PWOMBAT_ON_EOS_MAINNET = 'PWOMBAT_ON_EOS_MAINNET' export const PFTM_ON_ETH_MAINNET = 'PFTM_ON_ETH_MAINNET' export const NUCO_ON_TELOS_MAINNET = 'NUCO_ON_TELOS_MAINNET' diff --git a/src/settings/index.js b/src/settings/index.js index b5761e40..e0e88a09 100644 --- a/src/settings/index.js +++ b/src/settings/index.js @@ -61,10 +61,6 @@ const settings = { name: 'Fantom', symbol: 'FTM', }, - { - name: 'Ore', - symbol: 'ORE', - }, ], rpc: { mainnet: { @@ -141,14 +137,6 @@ const settings = { chainId: 250, label: 'Fantom', }, - ore: { - chainId: '7900eaca71d5b213d3e1e15d54d98ad235a7a5b8166361be78e672edeeb2b47a', - host: 'https://ore-node-1.ptokens.io', - port: 443, - protocol: 'https', - endpoint: 'https://ore-node-1.ptokens.io', - label: 'ORE', - }, btc: { endpoint: 'https://blockstream.info/api/', label: 'Bitcoin', diff --git a/src/store/swap/swap.actions.js b/src/store/swap/swap.actions.js index 2514feb6..b48d257a 100644 --- a/src/store/swap/swap.actions.js +++ b/src/store/swap/swap.actions.js @@ -178,15 +178,6 @@ const loadBalances = (_account, _blockchain) => { }) break } - case 'ORE': { - loadEosioCompatibleBalances({ - assets: getAssetsByBlockchain('ORE'), - account: _account, - dispatch: _dispatch, - blockchain: 'ORE', - }) - break - } case 'BSC': { loadEvmCompatibleBalances({ assets: getAssetsByBlockchain('BSC'), @@ -278,10 +269,6 @@ const loadBalanceByAssetId = (_id) => { loadEosioCompatibleBalance({ asset, account, dispatch: _dispatch }) break } - case 'ORE': { - loadEosioCompatibleBalance({ asset, account, dispatch: _dispatch }) - break - } case 'BSC': { loadEvmCompatibleBalance({ asset, account, blockchain: 'BSC', dispatch: _dispatch }) break diff --git a/src/store/wallets/arbitrum/index.js b/src/store/wallets/arbitrum/index.js index a67b9e8b..12418f2f 100644 --- a/src/store/wallets/arbitrum/index.js +++ b/src/store/wallets/arbitrum/index.js @@ -1,22 +1,26 @@ +import { getWeb3Settings } from 'react-web3-settings' +import WalletLink from 'walletlink' import Web3 from 'web3' import Web3Modal from 'web3modal' -import WalletLink from 'walletlink' -import settings from '../../../settings' + import { WALLET_ARBITRUM_CONNECTED, WALLET_ARBITRUM_DISCONNECTED, WALLET_ARBITRUM_NETWORK_CHANGED, WALLET_ARBITRUM_ACCOUNT_CHANGED, } from '../../../constants' +import settings from '../../../settings' import { getWeb3ModalTheme } from '../../../theme/web3-modal' +import { changeNetwork, setupNetwork } from '../../../utils/wallet' import { getTheme } from '../../pages/pages.selectors' import { getWalletProviderByBlockchain } from '../wallets.selectors' -import { changeNetwork, setupNetwork } from '../../../utils/wallet' import { createWalletConnect2 } from '../wallets.utils' let web3Modal const connectWithArbitrumWallet = async (_dispatch) => { + const configs = getWeb3Settings() + try { if (document.getElementById('WEB3_CONNECT_MODAL_ID')) { document.getElementById('WEB3_CONNECT_MODAL_ID').remove() @@ -30,7 +34,7 @@ const connectWithArbitrumWallet = async (_dispatch) => { package: WalletLink, options: { appName: settings.dappName, - rpc: settings.rpc.mainnet.arbitrum.endpoint, + rpc: configs.arbitrum, chainId: settings.rpc.mainnet.arbitrum.chainId, darkMode: getTheme() === 'dark', }, @@ -78,6 +82,8 @@ const disconnectFromArbitrumWallet = async (_dispatch) => { } const _connectionSuccesfull = async (_provider, _dispatch) => { + const configs = getWeb3Settings() + try { const { accounts, chainId } = _provider const account = accounts ? accounts[0] : await _getAccount(_provider) @@ -99,7 +105,7 @@ const _connectionSuccesfull = async (_provider, _dispatch) => { symbol: 'AETH', decimals: 18, }, - nodes: [settings.rpc.mainnet.arbitrum.endpoint], + nodes: [configs.arbitrum], blockExplorerUrls: [settings.explorers.mainnet.arbitrum], }) } diff --git a/src/store/wallets/bsc/index.js b/src/store/wallets/bsc/index.js index ea8e1b6e..fd26371c 100644 --- a/src/store/wallets/bsc/index.js +++ b/src/store/wallets/bsc/index.js @@ -1,10 +1,12 @@ +import { getWeb3Settings } from 'react-web3-settings' +import WalletLink from 'walletlink' import Web3 from 'web3' import Web3Modal from 'web3modal' + import { WALLET_BSC_CONNECTED, WALLET_BSC_DISCONNECTED, WALLET_BSC_ACCOUNT_CHANGED } from '../../../constants' -import WalletLink from 'walletlink' import settings from '../../../settings' -import { changeNetwork, setupNetwork } from '../../../utils/wallet' import { getWeb3ModalTheme } from '../../../theme/web3-modal' +import { changeNetwork, setupNetwork } from '../../../utils/wallet' import { getTheme } from '../../pages/pages.selectors' import { getWalletProviderByBlockchain } from '../wallets.selectors' import { createWalletConnect2 } from '../wallets.utils' @@ -12,6 +14,8 @@ import { createWalletConnect2 } from '../wallets.utils' let web3Modal const connectWithBscWallet = async (_dispatch) => { + const configs = getWeb3Settings() + try { if (document.getElementById('WEB3_CONNECT_MODAL_ID')) { document.getElementById('WEB3_CONNECT_MODAL_ID').remove() @@ -25,7 +29,7 @@ const connectWithBscWallet = async (_dispatch) => { package: WalletLink, options: { appName: settings.dappName, - rpc: settings.rpc.mainnet.bsc.endpoint, + rpc: configs.bsc, chainId: settings.rpc.mainnet.bsc.chainId, darkMode: getTheme() === 'dark', }, @@ -70,6 +74,8 @@ const disconnectFromBscWallet = async (_dispatch) => { } const _connectionSuccesfull = async (_provider, _dispatch) => { + const configs = getWeb3Settings() + try { const { accounts, chainId } = _provider const account = accounts ? accounts[0] : await _getAccount(_provider) @@ -91,7 +97,7 @@ const _connectionSuccesfull = async (_provider, _dispatch) => { symbol: 'bnb', decimals: 18, }, - nodes: [settings.rpc.mainnet.bsc.endpoint], + nodes: [configs.bsc], blockExplorerUrls: [settings.explorers.mainnet.bsc], }) } diff --git a/src/store/wallets/eos/index.js b/src/store/wallets/eos/index.js index 493d3a97..15d88cda 100644 --- a/src/store/wallets/eos/index.js +++ b/src/store/wallets/eos/index.js @@ -1,10 +1,14 @@ -import settings from '../../../settings' +import { getWeb3Settings } from 'react-web3-settings' + import { WALLET_EOS_CONNECTED, WALLET_EOS_DISCONNECTED } from '../../../constants' import EosConnect from '../../../lib/eosConnect/' +import settings from '../../../settings' import { getWeb3ModalTheme } from '../../../theme/web3-modal' import { getTheme } from '../../pages/pages.selectors' const connectWithEosWallet = (_dispatch) => { + const configs = getWeb3Settings() + if (document.getElementById('EOS_CONNECT')) { document.getElementById('EOS_CONNECT').remove() } @@ -14,10 +18,10 @@ const connectWithEosWallet = (_dispatch) => { theme: getWeb3ModalTheme(getTheme()), providerOptions: { tokenPocket: { - settings: settings.rpc.mainnet.eos, + settings: { ...settings.rpc.mainnet.eos, endpoint: configs.eos }, }, anchor: { - settings: settings.rpc.mainnet.eos, + settings: { ...settings.rpc.mainnet.eos, endpoint: configs.eos }, }, }, }) diff --git a/src/store/wallets/eth/index.js b/src/store/wallets/eth/index.js index b6bd8c33..c25120b2 100644 --- a/src/store/wallets/eth/index.js +++ b/src/store/wallets/eth/index.js @@ -1,15 +1,17 @@ +import { getWeb3Settings } from 'react-web3-settings' +import WalletLink from 'walletlink' import Web3 from 'web3' import Web3Modal from 'web3modal' -import WalletLink from 'walletlink' -import settings from '../../../settings' -import { changeNetwork } from '../../../utils/wallet' + import { WALLET_ETH_CONNECTED, WALLET_ETH_DISCONNECTED, WALLET_ETH_NETWORK_CHANGED, WALLET_ETH_ACCOUNT_CHANGED, } from '../../../constants' +import settings from '../../../settings' import { getWeb3ModalTheme } from '../../../theme/web3-modal' +import { changeNetwork } from '../../../utils/wallet' import { getTheme } from '../../pages/pages.selectors' import { getWalletProviderByBlockchain } from '../wallets.selectors' import { createWalletConnect2 } from '../wallets.utils' @@ -17,6 +19,8 @@ import { createWalletConnect2 } from '../wallets.utils' let web3Modal const connectWithEthWallet = async (_dispatch) => { + const configs = getWeb3Settings() + try { if (document.getElementById('WEB3_CONNECT_MODAL_ID')) { document.getElementById('WEB3_CONNECT_MODAL_ID').remove() @@ -31,7 +35,7 @@ const connectWithEthWallet = async (_dispatch) => { package: WalletLink, options: { appName: settings.dappName, - rpc: settings.rpc.mainnet.eth.endpoint, + rpc: configs.eth, chainId: settings.rpc.mainnet.eth.chainId, darkMode: getTheme() === 'dark', }, diff --git a/src/store/wallets/ftm/index.js b/src/store/wallets/ftm/index.js index b1bb77b0..7ec47214 100644 --- a/src/store/wallets/ftm/index.js +++ b/src/store/wallets/ftm/index.js @@ -1,10 +1,12 @@ +import { getWeb3Settings } from 'react-web3-settings' +import WalletLink from 'walletlink' import Web3 from 'web3' import Web3Modal from 'web3modal' + import { WALLET_FTM_CONNECTED, WALLET_FTM_DISCONNECTED, WALLET_FTM_ACCOUNT_CHANGED } from '../../../constants' -import WalletLink from 'walletlink' import settings from '../../../settings' -import { changeNetwork, setupNetwork } from '../../../utils/wallet' import { getWeb3ModalTheme } from '../../../theme/web3-modal' +import { changeNetwork, setupNetwork } from '../../../utils/wallet' import { getTheme } from '../../pages/pages.selectors' import { getWalletProviderByBlockchain } from '../wallets.selectors' import { createWalletConnect2 } from '../wallets.utils' @@ -12,6 +14,8 @@ import { createWalletConnect2 } from '../wallets.utils' let web3Modal const connectWithFtmWallet = async (_dispatch) => { + const configs = getWeb3Settings() + try { if (document.getElementById('WEB3_CONNECT_MODAL_ID')) { document.getElementById('WEB3_CONNECT_MODAL_ID').remove() @@ -25,7 +29,7 @@ const connectWithFtmWallet = async (_dispatch) => { package: WalletLink, options: { appName: settings.dappName, - rpc: settings.rpc.mainnet.ftm.endpoint, + rpc: configs.ftm, chainId: settings.rpc.mainnet.ftm.chainId, darkMode: getTheme() === 'dark', }, @@ -70,6 +74,8 @@ const disconnectFromFtmWallet = async (_dispatch) => { } const _connectionSuccesfull = async (_provider, _dispatch) => { + const configs = getWeb3Settings() + try { const { accounts, chainId } = _provider const account = accounts ? accounts[0] : await _getAccount(_provider) @@ -91,7 +97,7 @@ const _connectionSuccesfull = async (_provider, _dispatch) => { symbol: 'ftm', decimals: 18, }, - nodes: [settings.rpc.mainnet.ftm.endpoint], + nodes: [configs.ftm], blockExplorerUrls: [settings.explorers.mainnet.ftm], }) } diff --git a/src/store/wallets/gnosis/index.js b/src/store/wallets/gnosis/index.js index 4a38c3dd..364da867 100644 --- a/src/store/wallets/gnosis/index.js +++ b/src/store/wallets/gnosis/index.js @@ -1,3 +1,4 @@ +import { getWeb3Settings } from 'react-web3-settings' import WalletLink from 'walletlink' import Web3 from 'web3' import Web3Modal from 'web3modal' @@ -13,6 +14,8 @@ import { createWalletConnect2 } from '../wallets.utils' let web3Modal const connectWithGnosisWallet = async (_dispatch) => { + const configs = getWeb3Settings() + try { if (document.getElementById('WEB3_CONNECT_MODAL_ID')) { document.getElementById('WEB3_CONNECT_MODAL_ID').remove() @@ -26,7 +29,7 @@ const connectWithGnosisWallet = async (_dispatch) => { package: WalletLink, options: { appName: settings.dappName, - rpc: settings.rpc.mainnet.gnosis.endpoint, + rpc: configs.gnosis, chainId: settings.rpc.mainnet.gnosis.chainId, darkMode: getTheme() === 'dark', }, @@ -64,6 +67,8 @@ const disconnectFromGnosisWallet = async (_dispatch) => { } const _connectionSuccesfull = async (_provider, _dispatch) => { + const configs = getWeb3Settings() + try { const { accounts, chainId } = _provider const account = accounts ? accounts[0] : await _getAccount(_provider) @@ -85,7 +90,7 @@ const _connectionSuccesfull = async (_provider, _dispatch) => { symbol: 'xDAI', decimals: 18, }, - nodes: [settings.rpc.mainnet.gnosis.endpoint], + nodes: [configs.gnosis], blockExplorerUrls: [settings.explorers.mainnet.gnosis], }) } diff --git a/src/store/wallets/libre/index.js b/src/store/wallets/libre/index.js index 0d1720dd..81e615e3 100644 --- a/src/store/wallets/libre/index.js +++ b/src/store/wallets/libre/index.js @@ -1,11 +1,15 @@ -import settings from '../../../settings' import { toastr } from 'react-redux-toastr' +import { getWeb3Settings } from 'react-web3-settings' + import { WALLET_LIBRE_CONNECTED, WALLET_LIBRE_DISCONNECTED } from '../../../constants' import EosConnect from '../../../lib/eosConnect/' +import settings from '../../../settings' import { getWeb3ModalTheme } from '../../../theme/web3-modal' import { getTheme } from '../../pages/pages.selectors' const connectWithLibreWallet = (_dispatch) => { + const configs = getWeb3Settings() + if (document.getElementById('EOS_CONNECT')) { document.getElementById('EOS_CONNECT').remove() } @@ -15,10 +19,10 @@ const connectWithLibreWallet = (_dispatch) => { theme: getWeb3ModalTheme(getTheme()), providerOptions: { libre: { - settings: settings.rpc.mainnet.libre, + settings: { ...settings.rpc.mainnet.libre, endpoint: configs.libre }, }, anchor: { - settings: settings.rpc.mainnet.libre, + settings: { ...settings.rpc.mainnet.libre, endpoint: configs.libre }, }, }, }) diff --git a/src/store/wallets/luxochain/index.js b/src/store/wallets/luxochain/index.js index 02c1c620..1b53b273 100644 --- a/src/store/wallets/luxochain/index.js +++ b/src/store/wallets/luxochain/index.js @@ -1,13 +1,15 @@ +import { getWeb3Settings } from 'react-web3-settings' +import WalletLink from 'walletlink' import Web3 from 'web3' import Web3Modal from 'web3modal' -import WalletLink from 'walletlink' -import settings from '../../../settings' + import { WALLET_LUXOCHAIN_CONNECTED, WALLET_LUXOCHAIN_DISCONNECTED, WALLET_LUXOCHAIN_NETWORK_CHANGED, WALLET_LUXOCHAIN_ACCOUNT_CHANGED, } from '../../../constants' +import settings from '../../../settings' import { getWeb3ModalTheme } from '../../../theme/web3-modal' import { getTheme } from '../../pages/pages.selectors' import { getWalletProviderByBlockchain } from '../wallets.selectors' @@ -16,6 +18,8 @@ import { createWalletConnect2 } from '../wallets.utils' let web3Modal const connectWithLuxochainWallet = async (_dispatch) => { + const configs = getWeb3Settings() + try { if (document.getElementById('WEB3_CONNECT_MODAL_ID')) { document.getElementById('WEB3_CONNECT_MODAL_ID').remove() @@ -29,7 +33,7 @@ const connectWithLuxochainWallet = async (_dispatch) => { package: WalletLink, options: { appName: settings.dappName, - rpc: settings.rpc.mainnet.luxochain.endpoint, + rpc: configs.luxochain, chainId: settings.rpc.mainnet.luxochain.chainId, darkMode: getTheme() === 'dark', }, diff --git a/src/store/wallets/ore/index.js b/src/store/wallets/ore/index.js deleted file mode 100644 index 0e60cce5..00000000 --- a/src/store/wallets/ore/index.js +++ /dev/null @@ -1,50 +0,0 @@ -import settings from '../../../settings' -import { toastr } from 'react-redux-toastr' -import { WALLET_ORE_CONNECTED } from '../../../constants' -import EosConnect from '../../../lib/eosConnect/' -import { getWeb3ModalTheme } from '../../../theme/web3-modal' -import { getTheme } from '../../pages/pages.selectors' - -const connectWithOreWallet = (_dispatch) => { - if (document.getElementById('EOS_CONNECT')) { - document.getElementById('EOS_CONNECT').remove() - } - - const eosConnect = new EosConnect({ - dappName: settings.dappName, - theme: getWeb3ModalTheme(getTheme()), - providerOptions: { - tokenPocket: { - settings: settings.rpc.mainnet.telos, - }, - anchor: { - settings: settings.rpc.mainnet.telos, - }, - }, - }) - - eosConnect.on('connect', ({ provider, account }) => { - _dispatch({ - type: WALLET_ORE_CONNECTED, - payload: { - provider, - account: account.actor, - permission: account.permission, - network: 'mainnet', - }, - }) - }) - eosConnect.on('error', (message) => { - toastr.error(message) - }) - - eosConnect.toggleModal() -} - -const disconnectFromOreWallet = (_dispatch) => { - _dispatch({ - type: WALLET_ORE_CONNECTED, - }) -} - -export { connectWithOreWallet, disconnectFromOreWallet } diff --git a/src/store/wallets/polygon/index.js b/src/store/wallets/polygon/index.js index eea4fe97..3244b4fd 100644 --- a/src/store/wallets/polygon/index.js +++ b/src/store/wallets/polygon/index.js @@ -1,14 +1,16 @@ +import { getWeb3Settings } from 'react-web3-settings' +import WalletLink from 'walletlink' import Web3 from 'web3' import Web3Modal from 'web3modal' -import WalletLink from 'walletlink' + import { WALLET_POLYGON_CONNECTED, WALLET_POLYGON_ACCOUNT_CHANGED, WALLET_POLYGON_DISCONNECTED, } from '../../../constants' -import { setupNetwork } from '../../../utils/wallet' import settings from '../../../settings' import { getWeb3ModalTheme } from '../../../theme/web3-modal' +import { setupNetwork } from '../../../utils/wallet' import { getTheme } from '../../pages/pages.selectors' import { getWalletProviderByBlockchain } from '../wallets.selectors' import { createWalletConnect2 } from '../wallets.utils' @@ -16,6 +18,8 @@ import { createWalletConnect2 } from '../wallets.utils' let web3Modal const connectWithPolygonWallet = async (_dispatch) => { + const configs = getWeb3Settings() + try { if (document.getElementById('WEB3_CONNECT_MODAL_ID')) { document.getElementById('WEB3_CONNECT_MODAL_ID').remove() @@ -29,7 +33,7 @@ const connectWithPolygonWallet = async (_dispatch) => { package: WalletLink, options: { appName: settings.dappName, - rpc: settings.rpc.mainnet.polygon.endpoint, + rpc: configs.polygon, chainId: settings.rpc.mainnet.polygon.chainId, darkMode: getTheme() === 'dark', }, @@ -67,6 +71,8 @@ const disconnectFromPolygonWallet = async (_dispatch) => { } const _connectionSuccesfull = async (_provider, _dispatch) => { + const configs = getWeb3Settings() + try { const { accounts, chainId } = _provider const account = accounts ? accounts[0] : await _getAccount(_provider) @@ -81,7 +87,7 @@ const _connectionSuccesfull = async (_provider, _dispatch) => { symbol: 'matic', decimals: 18, }, - nodes: [settings.rpc.mainnet.polygon.endpoint], + nodes: [configs.polygon], blockExplorerUrls: [settings.explorers.mainnet.polygon], }) diff --git a/src/store/wallets/telos/index.js b/src/store/wallets/telos/index.js index 661f04bb..9056e6ab 100644 --- a/src/store/wallets/telos/index.js +++ b/src/store/wallets/telos/index.js @@ -1,11 +1,15 @@ -import settings from '../../../settings' import { toastr } from 'react-redux-toastr' -import { WALLET_TELOS_CONNECTED } from '../../../constants' +import { getWeb3Settings } from 'react-web3-settings' + +import { WALLET_TELOS_CONNECTED, WALLET_TELOS_DISCONNECTED } from '../../../constants' import EosConnect from '../../../lib/eosConnect/' +import settings from '../../../settings' import { getWeb3ModalTheme } from '../../../theme/web3-modal' import { getTheme } from '../../pages/pages.selectors' const connectWithTelosWallet = (_dispatch) => { + const configs = getWeb3Settings() + if (document.getElementById('EOS_CONNECT')) { document.getElementById('EOS_CONNECT').remove() } @@ -15,10 +19,10 @@ const connectWithTelosWallet = (_dispatch) => { theme: getWeb3ModalTheme(getTheme()), providerOptions: { tokenPocket: { - settings: settings.rpc.mainnet.telos, + settings: { ...settings.rpc.mainnet.telos, endpoint: configs.telos }, }, anchor: { - settings: settings.rpc.mainnet.telos, + settings: { ...settings.rpc.mainnet.telos, endpoint: configs.telos }, }, }, }) @@ -43,7 +47,7 @@ const connectWithTelosWallet = (_dispatch) => { const disconnectFromTelosWallet = (_dispatch) => { _dispatch({ - type: WALLET_TELOS_CONNECTED, + type: WALLET_TELOS_DISCONNECTED, }) } diff --git a/src/store/wallets/ultra/index.js b/src/store/wallets/ultra/index.js index 02fd0d58..2345ab8d 100644 --- a/src/store/wallets/ultra/index.js +++ b/src/store/wallets/ultra/index.js @@ -1,11 +1,15 @@ -import settings from '../../../settings' import { toastr } from 'react-redux-toastr' +import { getWeb3Settings } from 'react-web3-settings' + import { WALLET_ULTRA_CONNECTED, WALLET_ULTRA_DISCONNECTED } from '../../../constants' import EosConnect from '../../../lib/eosConnect/' +import settings from '../../../settings' import { getWeb3ModalTheme } from '../../../theme/web3-modal' import { getTheme } from '../../pages/pages.selectors' const connectWithUltraWallet = (_dispatch) => { + const configs = getWeb3Settings() + if (document.getElementById('EOS_CONNECT')) { document.getElementById('EOS_CONNECT').remove() } @@ -15,10 +19,10 @@ const connectWithUltraWallet = (_dispatch) => { theme: getWeb3ModalTheme(getTheme()), providerOptions: { tokenPocket: { - settings: settings.rpc.mainnet.ultra, + settings: { ...settings.rpc.mainnet.ultra, endpoint: configs.ultra }, }, anchor: { - settings: settings.rpc.mainnet.ultra, + settings: { ...settings.rpc.mainnet.ultra, endpoint: configs.ultra }, }, }, }) diff --git a/src/store/wallets/wallets.actions.js b/src/store/wallets/wallets.actions.js index 50169e99..99f4038b 100644 --- a/src/store/wallets/wallets.actions.js +++ b/src/store/wallets/wallets.actions.js @@ -9,7 +9,6 @@ import { connectWithFtmWallet, disconnectFromFtmWallet } from './ftm' import { connectWithGnosisWallet, disconnectFromGnosisWallet } from './gnosis' import { connectWithLibreWallet, disconnectFromLibreWallet } from './libre' import { connectWithLuxochainWallet, disconnectFromLuxochainWallet } from './luxochain' -import { connectWithOreWallet, disconnectFromOreWallet } from './ore' import { connectWithPolygonWallet, disconnectFromPolygonWallet } from './polygon' import { connectWithTelosWallet, disconnectFromTelosWallet } from './telos' import { connectWithUltraWallet, disconnectFromUltraWallet } from './ultra' @@ -65,10 +64,6 @@ const connectWithWallet = (_blockchain) => { connectWithFtmWallet(_dispatch) break } - case 'ORE': { - connectWithOreWallet(_dispatch) - break - } default: break } @@ -127,10 +122,6 @@ const disconnectFromWallet = (_blockchain) => { disconnectFromFtmWallet(_dispatch) break } - case 'ORE': { - disconnectFromOreWallet(_dispatch) - break - } default: break } diff --git a/src/store/wallets/wallets.reducer.js b/src/store/wallets/wallets.reducer.js index a5609751..6e8d7689 100644 --- a/src/store/wallets/wallets.reducer.js +++ b/src/store/wallets/wallets.reducer.js @@ -31,8 +31,6 @@ import { WALLET_FTM_CONNECTED, WALLET_FTM_ACCOUNT_CHANGED, WALLET_FTM_DISCONNECTED, - WALLET_ORE_CONNECTED, - WALLET_ORE_DISCONNECTED, } from '../../constants/index' const initialState = { @@ -107,12 +105,6 @@ const initialState = { chainId: null, network: null, }, - ore: { - provider: null, - account: null, - network: null, - permission: null, - }, } const walletsReducer = (_state = initialState, _action) => { @@ -229,17 +221,6 @@ const walletsReducer = (_state = initialState, _action) => { }, }) } - if (_action.type === WALLET_ORE_CONNECTED) { - const { provider, account, network, permission } = _action.payload - return Object.assign({}, _state, { - ore: { - provider, - account, - network, - permission, - }, - }) - } if (_action.type === WALLET_ULTRA_CONNECTED) { const { provider, account, network, permission } = _action.payload return Object.assign({}, _state, { @@ -297,16 +278,6 @@ const walletsReducer = (_state = initialState, _action) => { }, }) } - if (_action.type === WALLET_ORE_DISCONNECTED) { - return Object.assign({}, _state, { - ore: { - provider: null, - account: null, - network: null, - permission: null, - }, - }) - } if (_action.type === WALLET_TELOS_DISCONNECTED) { return Object.assign({}, _state, { telos: { diff --git a/src/utils/__tests__/account-validator.test.js b/src/utils/__tests__/account-validator.test.js index 218e49aa..345788d9 100644 --- a/src/utils/__tests__/account-validator.test.js +++ b/src/utils/__tests__/account-validator.test.js @@ -33,7 +33,6 @@ describe('isValidAccountByBlockchain', () => { ${`account`} | ${'ULTRA'} | ${'0x02f9337d'} | ${'account'} ${`account`} | ${'ALGORAND'} | ${'0x03c38e67'} | ${'account'} ${`account`} | ${'FTM'} | ${'0x0022af98'} | ${'0xaccount'} - ${`account`} | ${'ORE'} | ${'0x02e7261c'} | ${'account'} ${`account`} | ${'BTC'} | ${'0x01ec97de'} | ${'account'} ${`account`} | ${'LTC'} | ${'0x01840435'} | ${'account'} `( diff --git a/src/utils/__tests__/explorer.test.js b/src/utils/__tests__/explorer.test.js index 85d7487c..9702b7b5 100644 --- a/src/utils/__tests__/explorer.test.js +++ b/src/utils/__tests__/explorer.test.js @@ -21,7 +21,6 @@ describe('getCorrespondingTxExplorerLinkByBlockchain', () => { ['LUXOCHAIN', 'https://explorer.luxochain.io/tx/txhash'], ['ALGORAND', 'https://algoexplorer.io/tx/group/txhash'], ['FTM', 'https://ftmscan.com/tx/txhash'], - ['ORE', 'https://explorer.ore.network/tx/txhash'], ])('Should get the correct %s explorer link for the transaction', (blockchain, expected) => { const txHash = 'txhash' const ret = getCorrespondingTxExplorerLinkByBlockchain(blockchain, txHash) @@ -48,7 +47,6 @@ describe('getCorrespondingTokenExplorerLinkByBlockchain', () => { ['LUXOCHAIN', 'https://explorer.luxochain.io/token/tokenaddress'], ['ALGORAND', 'https://algoexplorer.io/asset/tokenaddress'], ['FTM', 'https://ftmscan.com/token/tokenaddress'], - ['ORE', 'https://explorer.ore.network/account/tokenaddress'], ])('Should get the correct %s token link for the transaction', (blockchain, expected) => { const tokenAddress = 'tokenaddress' const ret = getCorrespondingTokenExplorerLinkByBlockchain(blockchain, tokenAddress) diff --git a/src/utils/account-validator.js b/src/utils/account-validator.js index 58fc4815..f0836648 100644 --- a/src/utils/account-validator.js +++ b/src/utils/account-validator.js @@ -28,8 +28,6 @@ const isValidAccountByBlockchain = (_account, _blockchain) => { return validators.isValidAddressByChainId(_account, ChainId.AlgorandMainnet) case 'FTM': return validators.isValidAddressByChainId(stringUtils.addHexPrefix(_account), ChainId.FantomMainnet) - case 'ORE': - return validators.isValidAddressByChainId(_account, ChainId.EosMainnet) case 'BTC': return validators.isValidAddressByChainId(_account, ChainId.BitcoinMainnet) case 'LTC': diff --git a/src/utils/account-viewer.js b/src/utils/account-viewer.js index 95fd390c..1c4861bc 100644 --- a/src/utils/account-viewer.js +++ b/src/utils/account-viewer.js @@ -14,9 +14,6 @@ const slicerByBlockchain = (_address, _blockchain) => { case 'ULTRA': { return _address } - case 'ORE': { - return _address - } default: { return _address ? slicer(_address) : _address } diff --git a/src/utils/explorer.js b/src/utils/explorer.js index cb0113bd..03ce2d4c 100644 --- a/src/utils/explorer.js +++ b/src/utils/explorer.js @@ -20,7 +20,6 @@ const transactionBaseLink = { LUXOCHAIN: `${settings.explorers.mainnet.luxochain}tx/%s`, ALGORAND: `${settings.explorers.mainnet.algorand}tx/group/%s`, FTM: `${settings.explorers.mainnet.ftm}tx/%s`, - ORE: `${settings.explorers.mainnet.ore}tx/%s`, } const tokenBaseLink = { @@ -41,7 +40,6 @@ const tokenBaseLink = { LUXOCHAIN: `${settings.explorers.mainnet.luxochain}token/%s`, ALGORAND: `${settings.explorers.mainnet.algorand}asset/%s`, FTM: `${settings.explorers.mainnet.ftm}token/%s`, - ORE: `${settings.explorers.mainnet.ore}account/%s`, } const getCorrespondingTxExplorerLinkByBlockchain = (_blockchain, _hash) => diff --git a/src/utils/maps.js b/src/utils/maps.js index d08942aa..186abe6d 100644 --- a/src/utils/maps.js +++ b/src/utils/maps.js @@ -16,7 +16,6 @@ const blockchainSymbolToName = { LUXOCHAIN: 'Luxochain', ALGORAND: 'Algorand', FTM: 'Fantom', - ORE: 'ORE', } const blockchainSymbolToCoin = { @@ -37,7 +36,6 @@ const blockchainSymbolToCoin = { LUXOCHAIN: 'Luxochain', ALGORAND: 'Algorand', FTM: 'Fantom', - ORE: 'ORE', } const getAssetFromSymbol = (_assets, _symbol) => _assets.find(({ symbol }) => symbol === _symbol) diff --git a/src/utils/read-only-providers.js b/src/utils/read-only-providers.js index 8acb0175..abef21b9 100644 --- a/src/utils/read-only-providers.js +++ b/src/utils/read-only-providers.js @@ -34,9 +34,6 @@ const getReadOnlyProviderByBlockchain = (_blockchain) => { if (_blockchain === 'ULTRA') { return new JsonRpc(configs.ultra, { fetch }) } - if (_blockchain === 'ORE') { - return new JsonRpc(configs.ore, { fetch }) - } if (_blockchain === 'ARBITRUM') { return new Web3.providers.HttpProvider(configs.arbitrum) }