Skip to content

Commit

Permalink
Use guessStdTokenType
Browse files Browse the repository at this point in the history
  • Loading branch information
h0ngcha0 committed Jul 15, 2024
1 parent 09252b3 commit 475cbb8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const useNonFungibleTokensWithBalance = (
const nonFungibleTokens: BaseTokenWithBalance[] = []
for (const token of potentialNonFungibleTokens) {
if (nonFungibleTokens.findIndex((t) => t.id == token.id) === -1) {
const tokenType = await fetchImmutable(`${token.id}-token-type`, () => nodeProvider.guessStdInterfaceId(token.id))
const tokenType = await fetchImmutable(`${token.id}-token-type`, () => nodeProvider.guessStdTokenType(token.id))
if (tokenType === 'non-fungible') {
nonFungibleTokens.push({ id: token.id, networkId: networkId, balance: token.balance })
}
Expand Down Expand Up @@ -332,7 +332,7 @@ async function getBalances(nodeProvider: NodeProvider, address: string): Promise
async function fetchFungibleTokenFromFullNode(network: Network, tokenId: string): Promise<Token | undefined> {
const nodeProvider = new NodeProvider(network.nodeUrl)
try {
const tokenType = await fetchImmutable(`${tokenId}-token-type`, () => nodeProvider.guessStdInterfaceId(tokenId))
const tokenType = await fetchImmutable(`${tokenId}-token-type`, () => nodeProvider.guessStdTokenType(tokenId))
if (tokenType !== 'fungible') {
return undefined
}
Expand Down

0 comments on commit 475cbb8

Please sign in to comment.