Skip to content

Commit

Permalink
fixup! Add api2 criptointercambio
Browse files Browse the repository at this point in the history
  • Loading branch information
paullinator committed Aug 22, 2022
1 parent a5bc1ba commit 46e2897
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 244 deletions.
28 changes: 28 additions & 0 deletions src/swap-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,31 @@ export const getCodesWithMainnetTranscription = (
toCurrencyCode: toCurrencyCode
}
}

export const checkEthTokensOnly = (
swapInfo: EdgeSwapInfo,
request: EdgeSwapRequest
): void => {
const currencyFromWallet = request.fromWallet.currencyInfo.currencyCode
const currencyToWallet = request.toWallet.currencyInfo.currencyCode

if (
currencyFromWallet !== request.fromCurrencyCode &&
currencyFromWallet !== 'ETH'
) {
throw new SwapCurrencyError(
swapInfo,
request.fromCurrencyCode,
request.toCurrencyCode
)
} else if (
currencyToWallet !== request.toCurrencyCode &&
currencyToWallet !== 'ETH'
) {
throw new SwapCurrencyError(
swapInfo,
request.fromCurrencyCode,
request.toCurrencyCode
)
}
}
Loading

0 comments on commit 46e2897

Please sign in to comment.