How to get a list of tokens, and the details of tokens, such as decimal, name

463 Views Asked by At

I would like to get the list of tokens, or is there any way to know if a transaction is a token creation transaction?

1

There are 1 best solutions below

0
mDuo13 On

Since anyone can issue a token in the XRPL at little effort, there are a lot of tokens that are not worth anything to most people. But if you want the full set of tokens in existence, you need to download the full ledger data and read through it for RippleState objects (trust lines) with a nonzero Balance. This is a lot of effort (a full ledger is several gigabytes last I heard, about half of which is RippleState objects).

As for the second half of your question, "token creation" in the XRPL is not always a singular event. More tokens can be created and destroyed "on demand" by Payment or OfferCreate transactions in various contexts. But as a general rule, in transaction metadata if you see a ModifiedNode entry for a RippleState object whose Balance changed, that represents a change in token balances. Depending on which account is considered the "high" or "low" node, the Balance going up or down can represent adding or removing tokens from that line. The larger context also matters: sometimes you have an increase in tokens in one line that corresponds to a decrease in tokens on another line. (This is called rippling and that's the only way tokens can be transferred from one holder to another.)