Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

CriptointercambioDev
Copy link

No description provided.

): Promise<EdgeSwapQuote> {
checkInvalidCodes(INVALID_CURRENCY_CODES, request, swapInfo)

const fixedPromise = this.getFixedQuote(request, userSettings, opts)
Copy link
Member

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(
Copy link
Member

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

params: {
from: safeFromCurrencyCode,
to: safeToCurrencyCode,
amountFrom: quoteAmount
Copy link
Member

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.

amountFrom: quoteAmount
}
})
const fixedRateQuote = asFixedRateQuote(fixedRateQuoteResponse)
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants