diff --git a/schema.graphql b/schema.graphql index 6b10e59b..630c727d 100644 --- a/schema.graphql +++ b/schema.graphql @@ -45,7 +45,7 @@ type Token @entity { # token decimals decimals: BigInt! # token total supply - totalSupply: BigInt! + totalSupply: BigInt # volume in token units volume: BigDecimal! # volume in derived USD diff --git a/src/utils/token.ts b/src/utils/token.ts index db21b4e6..08751653 100644 --- a/src/utils/token.ts +++ b/src/utils/token.ts @@ -67,9 +67,9 @@ export function fetchTokenTotalSupply(tokenAddress: Address): BigInt { let totalSupplyValue = null let totalSupplyResult = contract.try_totalSupply() if (!totalSupplyResult.reverted) { - totalSupplyValue = totalSupplyResult as i32 + return null } - return BigInt.fromI32(totalSupplyValue as i32) + return BigInt.fromString(totalSupplyValue) } export function fetchTokenDecimals(tokenAddress: Address): BigInt {