Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/utils/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down