-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add api2 criptointercambio #192
base: master
Are you sure you want to change the base?
Conversation
): Promise<EdgeSwapQuote> { | ||
checkInvalidCodes(INVALID_CURRENCY_CODES, request, swapInfo) | ||
|
||
const fixedPromise = this.getFixedQuote(request, userSettings, opts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just return here. No need for the const fixedPromise
request.toCurrencyCode | ||
) | ||
|
||
const { safeFromCurrencyCode, safeToCurrencyCode } = safeCurrencyCodes( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to check limits somewhere. The code doesn't throw the SwapAboveLimitError
or SwapBelowLimitError
at all. See the changenow plugin
No description provided.