Skip to content

Commit 46e2897

Browse files
committed
fixup! Add api2 criptointercambio
1 parent a5bc1ba commit 46e2897

File tree

2 files changed

+118
-244
lines changed

2 files changed

+118
-244
lines changed

src/swap-helpers.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,31 @@ export const getCodesWithMainnetTranscription = (
205205
toCurrencyCode: toCurrencyCode
206206
}
207207
}
208+
209+
export const checkEthTokensOnly = (
210+
swapInfo: EdgeSwapInfo,
211+
request: EdgeSwapRequest
212+
): void => {
213+
const currencyFromWallet = request.fromWallet.currencyInfo.currencyCode
214+
const currencyToWallet = request.toWallet.currencyInfo.currencyCode
215+
216+
if (
217+
currencyFromWallet !== request.fromCurrencyCode &&
218+
currencyFromWallet !== 'ETH'
219+
) {
220+
throw new SwapCurrencyError(
221+
swapInfo,
222+
request.fromCurrencyCode,
223+
request.toCurrencyCode
224+
)
225+
} else if (
226+
currencyToWallet !== request.toCurrencyCode &&
227+
currencyToWallet !== 'ETH'
228+
) {
229+
throw new SwapCurrencyError(
230+
swapInfo,
231+
request.fromCurrencyCode,
232+
request.toCurrencyCode
233+
)
234+
}
235+
}

0 commit comments

Comments
 (0)