Skip to content

Commit 8a8d2b4

Browse files
authored
Package Version Updates : thirdweb Auth & SDK (#387)
* updated Auth & SDK versions * adding balanceOf check in getOwned
1 parent 45214b2 commit 8a8d2b4

File tree

3 files changed

+1098
-111
lines changed

3 files changed

+1098
-111
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
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",

src/server/routes/contract/extensions/erc721/read/getOwned.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)