File tree Expand file tree Collapse file tree 3 files changed +1098
-111
lines changed
src/server/routes/contract/extensions/erc721/read Expand file tree Collapse file tree 3 files changed +1098
-111
lines changed Original file line number Diff line number Diff line change 4343 "@prisma/client" : " 5.2.0" ,
4444 "@sinclair/typebox" : " ^0.31.28" ,
4545 "@t3-oss/env-core" : " ^0.6.0" ,
46- "@thirdweb-dev/auth" : " ^4.1.0-nightly-c238fde8-20231020022304 " ,
46+ "@thirdweb-dev/auth" : " ^4.1.27 " ,
4747 "@thirdweb-dev/chains" : " ^0.1.65" ,
48- "@thirdweb-dev/sdk" : " ^4.0.23 " ,
48+ "@thirdweb-dev/sdk" : " ^4.0.30 " ,
4949 "@thirdweb-dev/service-utils" : " ^0.4.2" ,
5050 "@thirdweb-dev/wallets" : " ^2.1.5" ,
5151 "body-parser" : " ^1.20.2" ,
Original file line number Diff line number Diff line change @@ -73,6 +73,14 @@ export async function erc721GetOwned(fastify: FastifyInstance) {
7373 chainId,
7474 contractAddress,
7575 } ) ;
76+ // Check if the wallet has any tokens before querying getOwned
77+ const balance = await contract . erc721 . balanceOf ( walletAddress ) ;
78+ if ( balance . eq ( 0 ) ) {
79+ reply . status ( StatusCodes . OK ) . send ( {
80+ result : [ ] ,
81+ } ) ;
82+ return ;
83+ }
7684 const result = await contract . erc721 . getOwned ( walletAddress ) ;
7785 reply . status ( StatusCodes . OK ) . send ( {
7886 result,
You can’t perform that action at this time.
0 commit comments