diff --git a/.changeset/six-bears-play.md b/.changeset/six-bears-play.md new file mode 100644 index 00000000..b4de8304 --- /dev/null +++ b/.changeset/six-bears-play.md @@ -0,0 +1,5 @@ +--- +'ptokens-dapp-v2': minor +--- + +update dismissed list diff --git a/.snyk b/.snyk index d22ef4fa..403964d2 100644 --- a/.snyk +++ b/.snyk @@ -5,31 +5,47 @@ ignore: SNYK-JS-WEB3UTILS-6229337: - '*': reason: will be fixed in v4 - fix planned - expires: 2024-09-10T00:00:00.000Z + expires: 2024-12-10T00:00:00.000Z created: 2024-04-04T11:30:11.068Z SNYK-JS-WS-7266574: - '*': reason: will be fixed in v4 - fix planned - expires: 2024-09-10T00:00:00.000Z + expires: 2024-12-10T00:00:00.000Z created: 2024-08-28T11:30:11.068Z SNYK-JS-ELLIPTIC-7577916: - '*': reason: Will be fixed in v4 - fix planned - expires: 2024-09-10T00:00:00.000Z + expires: 2024-12-10T00:00:00.000Z created: 2024-08-28T11:30:11.068Z SNYK-JS-ELLIPTIC-7577917: - '*': reason: Will be fixed in v4 - fix planned - expires: 2024-09-10T00:00:00.000Z + expires: 2024-12-10T00:00:00.000Z created: 2024-08-28T11:30:11.068Z SNYK-JS-ELLIPTIC-7577918: - '*': reason: Will be fixed in v4 - fix planned - expires: 2024-09-10T00:00:00.000Z + expires: 2024-12-10T00:00:00.000Z created: 2024-08-28T11:30:11.068Z SNYK-JS-MICROMATCH-6838728: - '*': reason: Will be fixed in v4 - fix planned - expires: 2024-09-10T00:00:00.000Z + expires: 2024-12-10T00:00:00.000Z + SNYK-JS-ELLIPTIC-8187303: + - '*': + reason: Will be fixed in v4 - fix planned + expires: 2024-12-10T00:00:00.000Z + SNYK-JS-BODYPARSER-7926860: + - '*': + reason: Will be fixed in v4 - fix planned + expires: 2024-12-10T00:00:00.000Z + SNYK-JS-ELLIPTIC-8172694: + - '*': + reason: Will be fixed in v4 - fix planned + expires: 2024-12-10T00:00:00.000Z + SNYK-JS-SECP256K1-8237220: + - '*': + reason: Will be fixed in v4 - fix planned + expires: 2024-12-10T00:00:00.000Z created: 2024-08-28T11:30:11.068Z patch: {} diff --git a/src/components/pages/swap/Swap.jsx b/src/components/pages/swap/Swap.jsx index 942d3b67..99d1b4ed 100644 --- a/src/components/pages/swap/Swap.jsx +++ b/src/components/pages/swap/Swap.jsx @@ -11,7 +11,7 @@ import { MAX_IMPACT, PBTC_ON_ETH_MAINNET_V1_MIGRATION, PUOS_ON_ULTRA_MAINNET } f import { sendEvent } from '../../../ga4' import { useAssets } from '../../../hooks/use-assets' import { useSwap } from '../../../hooks/use-swap' -import defaultAssets, { disabledAssets } from '../../../settings/swap-assets' +import defaultAssets, { disabledAssets, dismissedAssets } from '../../../settings/swap-assets' import Button from '../../atoms/button/Button' import Icon from '../../atoms/icon/Icon' import Switch from '../../atoms/switch/Switch' @@ -416,7 +416,8 @@ const Swap = ({ to.notifyDepositAddressWarning && to.id !== 'PBTC_ON_ARBITRUM_MAINNET' && to.id !== 'PBTC_ON_TELOS_MAINNET' && - to.id !== 'PBTC_ON_LIBRE_MAINNET' && ( + to.id !== 'PBTC_ON_LIBRE_MAINNET' && + !(dismissedAssets.includes(from.id) || dismissedAssets.includes(to.id)) && ( Please refrain from using previously generated deposit addresses, as doing so may result in a loss of funds. @@ -456,9 +457,28 @@ const Swap = ({ direct control (i.e. not a CEX deposit address). ) : null} - {from && to && (disabledAssets.includes(from.id) || disabledAssets.includes(to.id)) ? ( + {from && + to && + (from.blockchain == 'EOS' || to.blockchain == 'EOS') && + !(dismissedAssets.includes(from.id) || dismissedAssets.includes(to.id)) ? ( + + EOS chain will soon be upgraded to pNetwork v4 and has been disabled on v2. Swaps will soon be resumed + on v4. + + ) : null} + {from && to && disabledAssets.includes(to.id) ? ( {`${to.name} on ${to.blockchain} has been dismissed and pegins are disabled. Pegout the native token ASAP for a smooth redeem process.`} ) : null} + {from && to && disabledAssets.includes(from.id) ? ( + {`${from.name} on ${from.blockchain} has been dismissed. Proceed ASAP for a smooth redeem process.`} + ) : null} + {from && to && (dismissedAssets.includes(to.id) || dismissedAssets.includes(from.id)) ? ( + + { + 'Token no longer supported. This token is no longer active on pNetwork and the redemption window via the official dApp has closed. For further assistance, please contact hello@p.network.' + } + + ) : null} {to && (to.id === 'PUSDC_ON_ALGORAND_MAINNET' || to.id === 'USDC_ON_ALGORAND_MAINNET' || diff --git a/src/hooks/use-swap.js b/src/hooks/use-swap.js index 3904d37c..850095de 100644 --- a/src/hooks/use-swap.js +++ b/src/hooks/use-swap.js @@ -10,7 +10,7 @@ import { CURVE_MAX_AMOUNT, } from '../constants' import { sendEvent } from '../ga4' -import { disabledAssets } from '../settings/swap-assets' +import { disabledAssets, dismissedAssets } from '../settings/swap-assets' import { maybeOptInAlgoApp, maybeOptInAlgoAsset } from '../store/swap/utils/opt-in-algo' import { isValidAccountByBlockchain } from '../utils/account-validator' import { getSwapFees, computeSwapAmount } from '../utils/fee' @@ -320,7 +320,13 @@ const useSwap = ({ return } - if (disabledAssets.includes(to.id)) { + if ( + disabledAssets.includes(to.id) || + dismissedAssets.includes(from.id) || + dismissedAssets.includes(to.id) || + from.blockchain === 'EOS' || + to.blockchain === 'EOS' + ) { updateSwapButton('Disabled Swap', true) return } diff --git a/src/settings/index.js b/src/settings/index.js index 50045313..e7b33c7f 100644 --- a/src/settings/index.js +++ b/src/settings/index.js @@ -74,7 +74,7 @@ const settings = { host: 'https://eos.greymass.com', port: 443, protocol: 'https', - endpoint: 'https://corsproxy.ptokens.io/v1/?apiurl=https://eos.greymass.com', + endpoint: 'https://eos.greymass.com', label: 'EOS', }, telos: { @@ -110,10 +110,10 @@ const settings = { }, ultra: { chainId: 'a9c481dfbc7d9506dc7e87e9a137c931b0a9303f64fd7a1d08b8230133920097', - host: 'https://corsproxy.ptokens.io/v1/?apiurl=https://api.ultra.eossweden.org', + host: 'https://api.ultra.eossweden.org', port: 443, protocol: 'https', - endpoint: 'https://corsproxy.ptokens.io/v1/?apiurl=https://api.ultra.eossweden.org', + endpoint: 'https://api.ultra.eossweden.org', label: 'Ultra', }, arbitrum: { @@ -122,7 +122,7 @@ const settings = { label: 'Arbitrum', }, luxochain: { - endpoint: 'https://corsproxy.ptokens.io/v1/?apiurl=https://lugano.nodes.luxochain.io', + endpoint: 'https://lugano.nodes.luxochain.io', chainId: 110, label: 'Luxochain', }, diff --git a/src/settings/swap-assets.js b/src/settings/swap-assets.js index 138545fc..85e121c7 100644 --- a/src/settings/swap-assets.js +++ b/src/settings/swap-assets.js @@ -2,12 +2,10 @@ import { ChainId } from '@p.network/ptokens-constants' export const disabledAssets = [ 'GALA_ON_BSC_MAINNET', - 'ANRX_ON_BSC_MAINNET', + '$ANRX_ON_BSC_MAINNET', 'PBTC_ON_ARBITRUM_MAINNET', - 'PBTC_ON_LIBRE_MAINNET', 'PBTC_ON_TELOS_MAINNET', 'PNT_ON_ARBITRUM_MAINNET', - 'IQ_ON_ETH_MAINNET', 'PKEYS_ON_BSC_MAINNET', 'LUXO_ON_BSC_MAINNET', 'POPEN_ON_BSC_MAINNET', @@ -16,11 +14,19 @@ export const disabledAssets = [ 'PSEEDS_ON_ETH_MAINNET', 'TLOS_ON_ETH_MAINNET', 'TLOS_ON_BSC_MAINNET', - 'PUSDT_ON_LIBRE_MAINNET', + 'PUSDC_ON_TELOS_MAINNET', 'PUSDT_ON_TELOS_MAINNET', 'PETH_ON_TELOS_MAINNET', 'NUCO_ON_TELOS_MAINNET', 'ZMT_ON_BSC_MAINNET', + 'PUOS_ON_ULTRA_MAINNET', +] + +export const dismissedAssets = [ + 'PUSDT_ON_LIBRE_MAINNET', + 'PBTC_ON_LIBRE_MAINNET', + 'IQ_ON_ETH_MAINNET', + 'PBTC_ON_EOS_MAINNET', ] const swapAssets = [