Can tokens have more than 9 decimals?

Is there any token out there that have move than 9 decimals?

1 Like

Hi @J053, currently there is no token that has more than 9 decimals on the Incognito network. Are you looking for something?

2 Likes

I see that on the pool information that getpdestate returns, the pool sizes are integers, and in order to get the price rate, you need to know the decimals that each token have.

My guess is that no coin have more than 9 decimals, and that would make the code for my new bot less complex.

But are you telling me that itā€™s possible that a coin can have more than 9 decimals?

Hi @J053, you are correct. I think this api would be helpful: https://api.incognito.org/ptoken/list
You can query the exact number of the decimal for each token here: "PDecimals":

4 Likes

Awesome! This will be really useful. Thanks.

2 Likes

@Peter, is there a way to get also a list of custom tokens? And where can I read documentation about this API?

This way please :slight_smile:

2 Likes

Not every coin in the api have a PDecimals value. Do I need to assume that they have 9 decimals?

@abduraman :+1: :+1:
@J053 if the PDecimals is not available, it is considered as ā€œ0ā€ by default (except for PRV, it has 9 decimal numbers).

We donā€™t have an official doc yet for API. We could provide some upon your requests. What are you going to build? Is that related to Assets/ Provide/ pDex/ etcā€¦?

2 Likes

It is related to the pDEX.

Hi @J053, hope this helps:
1/ Getting pair on the Incognito network:

curl --location --request POST ā€˜https://device-network.incognito.org/chainā€™
ā€“header ā€˜Content-Type: application/jsonā€™
ā€“header ā€˜Cookie: __cfduid=d2bb1a7ef5205eec104cf39f7928ece491605608772ā€™
ā€“data-raw ā€˜{
ā€œjsonrpcā€: ā€œ1.0ā€,
ā€œmethodā€: ā€œgetpdestateā€,
ā€œparamsā€: [],
ā€œidā€: 1
}ā€™

2/ Getting quote of a pair on Uniswap/ Kyper

curl --location -g --request GET ā€˜https://api.incognito.org/uniswap/rate?SrcToken=${srcToken}&DestToken=${destToken}&Amount=${originaAmount}ā€™
ā€“header ā€˜Cookie: __cfduid=d2bb1a7ef5205eec104cf39f7928ece491605608772ā€™

1 Like