Closed binaryechoes closed 3 months ago
There is no way to convert directly from an AMM currency code to something human readable. The AMM currency code needs to represent more data than can fit in one currency code (namely, two currency codes), so it just doesn't have what you need.
If you know the AMM's info, you can replace the currency code with a string that represents "LP Tokens from this AMM" in whatever way makes sense, but the data in the currency code can only serve as a checksum or on that info at best.
Great, thank you for the confirmation/info @mDuo13!
Hello,
What is the recommended approach for converting the AMM LP token code to a human readable string (eg. 03930D02208264E2E40EC1B0C09E4DB96EE197B1 -> XRP/USD) using Python?
For example, here's how I convert 5553444300000000000000000000000000000000 to USDC.
However, this does not work for AMM LP token codes.
Reference: https://xrpl.org/docs/concepts/tokens/decentralized-exchange/automated-market-makers/#lp-token-currency-codes https://xrpl.org/docs/references/protocol/data-types/currency-formats/#currency-codes https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0030-automated-market-maker
Thanks, Justin