fetchTokenDecimals

suspend fun fetchTokenDecimals(tokenContract: String): Int

Reads the decimals() value from a SEP-41 token contract.

Simulates the token contract's decimals function and returns the reported u32 scale.

Return

The token's decimal scale

Parameters

tokenContract

The SEP-41 token contract address (C-address)

Throws

if tokenContract is not a valid contract address

if the simulation fails or the contract does not return a valid u32 value