Skip to main content
PATCH
/
v1
/
tokens
/
{id}
/
decimals
Update token decimals and scale related entities
curl --request PATCH \
  --url https://api.endaoment.org/v1/tokens/{id}/decimals \
  --header 'Content-Type: application/json' \
  --data '{
  "newDecimals": 18
}'
{
  "token": {},
  "donationsUpdated": 5,
  "cryptoPledgesUpdated": 3,
  "itemsWithPrecisionLoss": [
    {
      "oldInputAmount": "1000000000000000001",
      "newInputAmount": "1000000",
      "entityId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "entityName": "Donation"
    }
  ]
}

Path Parameters

id
number
required

Token ID

Body

application/json
newDecimals
number
required

New decimal places for the token

Required range: 1 <= x <= 32
Example:

18

Response

200 - application/json

Token decimals successfully updated with detailed report

token
object
required

The updated token

donationsUpdated
number
required

Number of donations updated without precision loss

Example:

5

cryptoPledgesUpdated
number
required

Number of crypto pledges updated without precision loss

Example:

3

itemsWithPrecisionLoss
object[]
required

Array of items that experienced precision loss during the update