Skip to content

Commit

Permalink
Merge pull request #100 from pnetwork-association/feat/pegout-all
Browse files Browse the repository at this point in the history
feat: enable pegout on all token
  • Loading branch information
envin3 authored Nov 14, 2024
2 parents adabb92 + 0810949 commit 338ffa5
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/three-falcons-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'ptokens-dapp-v2': minor
---

enable all pegout
27 changes: 21 additions & 6 deletions src/components/pages/swap/Swap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -457,27 +457,42 @@ const Swap = ({
direct control (i.e. not a CEX deposit address).
</InfoEta>
) : null}
{from &&
{/* {from &&
to &&
(from.blockchain == 'EOS' || to.blockchain == 'EOS') &&
!(dismissedAssets.includes(from.id) || dismissedAssets.includes(to.id)) ? (
<WarningEta>
EOS chain will soon be upgraded to pNetwork v4 and has been disabled on v2. Swaps will soon be resumed
on v4.
</WarningEta>
) : null}
{from && to && disabledAssets.includes(to.id) ? (
) : null} */}
{/* {from && to && (disabledAssets.includes(to.id) || to.blockchain == 'EOS')? (
<WarningEta>{`${to.name} on ${to.blockchain} has been dismissed and pegins are disabled. Pegout the native token ASAP for a smooth redeem process.`}</WarningEta>
) : null}
{from && to && disabledAssets.includes(from.id) ? (
{from && to && (disabledAssets.includes(from.id) || from.blockchain == 'EOS') ? (
<WarningEta>{`${from.name} on ${from.blockchain} has been dismissed. Proceed ASAP for a smooth redeem process.`}</WarningEta>
) : null}
{from && to && (dismissedAssets.includes(to.id) || dismissedAssets.includes(from.id)) ? (
) : null} */}
{/* {from && to && (dismissedAssets.includes(to.id) || dismissedAssets.includes(from.id) ||
disabledAssets.includes(to.id)
) ? (
<WarningEta>
{
'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 [email protected].'
}
</WarningEta>
) : null} */}
{from &&
to &&
(dismissedAssets.includes(to.id) ||
dismissedAssets.includes(from.id) ||
(disabledAssets.includes(to.id) && disabledAssets.includes(from.id)) ||
(from.blockchain == 'EOS' && disabledAssets.includes(to.id)) ||
(to.blockchain == 'EOS' && disabledAssets.includes(from.id))) ? (
<WarningEta>{`Token no longer supported. Please pegout towards native ${to.nativeSymbol}`}</WarningEta>
) : from && to && (disabledAssets.includes(from.id) || from.blockchain == 'EOS') ? (
<WarningEta>{`${from.name} on ${from.blockchain} has been dismissed. Proceed ASAP for a smooth redeem process.`}</WarningEta>
) : from && to && (disabledAssets.includes(to.id) || to.blockchain == 'EOS') ? (
<WarningEta>{`${to.name} on ${to.blockchain} has been dismissed and pegins are disabled. Pegout the native token ASAP for a smooth redeem process.`}</WarningEta>
) : null}
{to &&
(to.id === 'PUSDC_ON_ALGORAND_MAINNET' ||
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/use-swap.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ const useSwap = ({
disabledAssets.includes(to.id) ||
dismissedAssets.includes(from.id) ||
dismissedAssets.includes(to.id) ||
from.blockchain === 'EOS' ||
// from.blockchain === 'EOS' ||
to.blockchain === 'EOS'
) {
updateSwapButton('Disabled Swap', true)
Expand Down
10 changes: 7 additions & 3 deletions src/settings/swap-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,19 @@ export const disabledAssets = [
'WSB_ON_ETH_MAINNET',
'PLTC_ON_ETH_MAINNET',
'BIST_ON_BSC_MAINNET',
]

export const dismissedAssets = [
'PUSDT_ON_LIBRE_MAINNET',
'PBTC_ON_LIBRE_MAINNET',
'IQ_ON_ETH_MAINNET',
'PBTC_ON_EOS_MAINNET',
]

export const dismissedAssets = [
// 'PUSDT_ON_LIBRE_MAINNET',
// 'PBTC_ON_LIBRE_MAINNET',
// 'IQ_ON_ETH_MAINNET',
// 'PBTC_ON_EOS_MAINNET',
]

const swapAssets = [
/* ################# pTokens #################*/
{
Expand Down

0 comments on commit 338ffa5

Please sign in to comment.