Skip to content

Commit

Permalink
feat(swap-validator): add ethPNT as valid pegout
Browse files Browse the repository at this point in the history
  • Loading branch information
envin3 committed Jan 23, 2024
1 parent a0a851a commit 3d015cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/utils/fee.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ const getMigrationFees = (_from, _to) => {
}

const getSwapFees = async (_from, _to) => {
if (_from.id === ETHPNT_ON_ETH_MAINNET && _to.id === 'PNT')
return { basisPoints: 25, networkFee: 0, minProtocolFee: 0 }
if (_to.id === ETHPNT_ON_ETH_MAINNET) return { basisPoints: 25, networkFee: 0, minProtocolFee: 0 }
if (_from.id === ETHPNT_ON_ETH_MAINNET) return { basisPoints: 10, networkFee: 0, minProtocolFee: 0 }
try {
const fromAsset = await createAsset(_from)
Expand Down
1 change: 1 addition & 0 deletions src/utils/swap-valildator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const isValidSwap = (from, to, assets) => {
if (_.isNil(from) || _.isNil(to)) return false
if (to.id === from.id) return false
if (from.nativeSymbol === 'ethPNT' && to.nativeSymbol === 'PNT' && !to.isNative) return true
if (from.nativeSymbol === 'PNT' && to.nativeSymbol === 'ethPNT' && !from.isNative) return true
if (!assets.find(({ id }) => from.id === id) && !assets.find(({ id }) => to.id === id)) return false
if (to.isHidden) return false
if (to.nativeSymbol.toLowerCase() !== from.nativeSymbol.toLowerCase()) return false
Expand Down

0 comments on commit 3d015cb

Please sign in to comment.