From 08f69ca1203cb14463a3a0e3df0efe8180a2d47a Mon Sep 17 00:00:00 2001 From: lukaw3d Date: Wed, 21 Jun 2023 01:30:44 +0200 Subject: [PATCH] Fix token supply formatting --- .changelog/570.trivial.md | 1 + src/oasis-indexer/api.ts | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 .changelog/570.trivial.md diff --git a/.changelog/570.trivial.md b/.changelog/570.trivial.md new file mode 100644 index 000000000..9a74ac8a6 --- /dev/null +++ b/.changelog/570.trivial.md @@ -0,0 +1 @@ +Fix token supply formatting diff --git a/src/oasis-indexer/api.ts b/src/oasis-indexer/api.ts index 56ba64805..3a64c2d21 100644 --- a/src/oasis-indexer/api.ts +++ b/src/oasis-indexer/api.ts @@ -458,6 +458,10 @@ export const useGetRuntimeEvmTokens: typeof generated.useGetRuntimeEvmTokens = ( return { ...token, evm_contract_addr: `0x${token.evm_contract_addr}`, + total_supply: + token.total_supply != null && token.decimals != null + ? fromBaseUnits(token.total_supply, token.decimals) + : token.total_supply, layer: runtime, network, }