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

XRPDEX - don't convert currency field #372

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

Conversation

peachbits
Copy link
Contributor

@peachbits peachbits commented Feb 25, 2025

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

none

There are two correct 'currency' formats for XRP https://xrpl.org/docs/references/protocol/data-types/currency-formats#currency-codes

We should use the one found in the networkLocation instead of converting or looking for it in the tokenId.
const toCurrency =
toTokenId != null ? toTokenId.split('-')[0] : toCurrencyCode
let fromIssuer: string | undefined
let fromCurrency: string = fromCurrencyCode
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fromCurrencyCode is getting deprecated, we shouldn't be using it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if tokenId == null then set the fromCurrency to the main asset of the wallet

wallet.currencyInfo.currencyCode

}

let toIssuer: string | undefined
let toCurrency: string = toCurrencyCode
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same with toCurrencyCode

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