Skip to content

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