@@ -44,7 +44,7 @@ async function getTokenBalance(
4444 const formattedOwnerAddress = parseStarknetAddress ( ownerAddress ) ;
4545
4646 // Create contract instance
47- const contract = getContract ( formattedTokenAddress , provider , network ) ;
47+ const contract = await getContract ( formattedTokenAddress , provider , network ) ;
4848
4949 try {
5050 // Get balance and decimals in parallel
@@ -160,7 +160,7 @@ export async function getERC20Balance(
160160 try {
161161 // Get token symbol
162162 const provider = getProvider ( network ) ;
163- const contract = getContract ( parseStarknetAddress ( tokenAddress ) , provider , network ) ;
163+ const contract = await getContract ( parseStarknetAddress ( tokenAddress ) , provider , network ) ;
164164 const symbolResponse = await contract . call ( 'symbol' , [ ] ) ;
165165
166166 // Parse symbol
@@ -212,7 +212,7 @@ export async function isNFTOwner(
212212 const formattedOwnerAddress = parseStarknetAddress ( ownerAddress ) ;
213213
214214 // Create NFT contract
215- const contract = getContract ( formattedTokenAddress , provider , network ) ;
215+ const contract = await getContract ( formattedTokenAddress , provider , network ) ;
216216
217217 // Convert tokenId to bigint if it's a string
218218 const tokenIdBigInt = typeof tokenId === 'string' ? BigInt ( tokenId ) : tokenId ;
@@ -253,7 +253,7 @@ export async function getERC721Balance(
253253 const formattedOwnerAddress = parseStarknetAddress ( ownerAddress ) ;
254254
255255 // Create NFT contract
256- const contract = getContract ( formattedTokenAddress , provider , network ) ;
256+ const contract = await getContract ( formattedTokenAddress , provider , network ) ;
257257
258258 // Call balanceOf directly
259259 const response = await contract . call ( 'balanceOf' , [ formattedOwnerAddress ] ) ;
0 commit comments