Add api2 criptointercambio#192
Conversation
| ): Promise<EdgeSwapQuote> { | ||
| checkInvalidCodes(INVALID_CURRENCY_CODES, request, swapInfo) | ||
|
|
||
| const fixedPromise = this.getFixedQuote(request, userSettings, opts) |
There was a problem hiding this comment.
just return here. No need for the const fixedPromise
| request.toCurrencyCode | ||
| ) | ||
|
|
||
| const { safeFromCurrencyCode, safeToCurrencyCode } = safeCurrencyCodes( |
There was a problem hiding this comment.
This is a bit concerning. Your native API should support specifying the chaincode separately from the token code. Without that, there could easily be confusion on what token the user wants to send or purchase.
The CURRENCY_CODE_TRANSCRIPTION is a quick hack for prior partners but all new partners should have an explicit chaincode and tokencode. See the Changenow plugin
https://github.com/EdgeApp/edge-exchange-plugins/blob/master/src/swap/changenow.js#L110
src/swap/criptointercambio.js
Outdated
| params: { | ||
| from: safeFromCurrencyCode, | ||
| to: safeToCurrencyCode, | ||
| amountFrom: quoteAmount |
There was a problem hiding this comment.
quoteAmount is not always the FROM amount. Need to check the request.quoteFor value and check if it's from or to. If you can't do quotes coming from to amounts, then you need to throw.
src/swap/criptointercambio.js
Outdated
| amountFrom: quoteAmount | ||
| } | ||
| }) | ||
| const fixedRateQuote = asFixedRateQuote(fixedRateQuoteResponse) |
There was a problem hiding this comment.
Need to check limits somewhere. The code doesn't throw the SwapAboveLimitError or SwapBelowLimitError at all. See the changenow plugin
No description provided.