@@ -1228,9 +1228,10 @@ public static async Task<NFT> ERC721_GetNFT(this ThirdwebContract contract, BigI
12281228 /// <param name="contract">The contract to interact with.</param>
12291229 /// <param name="startTokenId">The starting token ID (inclusive). Defaults to 0 if not specified.</param>
12301230 /// <param name="count">The number of tokens to retrieve. Defaults to 100 if not specified.</param>
1231+ /// <param name="fillOwner">A boolean indicating whether to fill the owner details. Defaults to true.</param>
12311232 /// <returns>A task representing the asynchronous operation, with a list of NFT results containing the token details.</returns>
12321233 /// <exception cref="ArgumentNullException">Thrown when the contract is null.</exception>
1233- public static async Task < List < NFT > > ERC721_GetAllNFTs ( this ThirdwebContract contract , int startTokenId = 0 , int count = 100 )
1234+ public static async Task < List < NFT > > ERC721_GetAllNFTs ( this ThirdwebContract contract , int startTokenId = 0 , int count = 100 , bool fillOwner = true )
12341235 {
12351236 if ( contract == null )
12361237 {
@@ -1243,7 +1244,7 @@ public static async Task<List<NFT>> ERC721_GetAllNFTs(this ThirdwebContract cont
12431244 var nftTasks = new List < Task < NFT > > ( ) ;
12441245 for ( var i = startTokenId ; i < startTokenId + count ; i ++ )
12451246 {
1246- nftTasks . Add ( contract . ERC721_GetNFT ( i ) ) ;
1247+ nftTasks . Add ( contract . ERC721_GetNFT ( i , fillOwner ) ) ;
12471248 }
12481249
12491250 var allNfts = await Task . WhenAll ( nftTasks ) . ConfigureAwait ( false ) ;
@@ -1377,31 +1378,32 @@ public static async Task<NFT> ERC1155_GetNFT(this ThirdwebContract contract, Big
13771378 /// <param name="contract">The contract to interact with.</param>
13781379 /// <param name="startTokenId">The starting token ID (inclusive). Defaults to 0 if not specified.</param>
13791380 /// <param name="count">The number of tokens to retrieve. Defaults to the 100 if not specified.</param>
1381+ /// <param name="fillSupply">A boolean indicating whether to fill the supply. Defaults to true if not specified.</param>
13801382 /// <returns>A task representing the asynchronous operation, with a list of NFT results containing the token details.</returns>
13811383 /// <exception cref="ArgumentNullException">Thrown when the contract is null.</exception>
1382- public static async Task < List < NFT > > ERC1155_GetAllNFTs ( this ThirdwebContract contract , int startTokenId = 0 , int count = 100 )
1384+ public static async Task < List < NFT > > ERC1155_GetAllNFTs ( this ThirdwebContract contract , int startTokenId = 0 , int count = 100 , bool fillSupply = true )
13831385 {
13841386 if ( contract == null )
13851387 {
13861388 throw new ArgumentNullException ( nameof ( contract ) ) ;
13871389 }
13881390
1389- BigInteger totalSupply ;
1391+ BigInteger totalCount ;
13901392 try
13911393 {
13921394 // Not part of IERC1155 so we fallback just in case
1393- totalSupply = await contract . ERC1155_TotalSupply ( ) . ConfigureAwait ( false ) ;
1395+ totalCount = await contract . ERC1155_TotalSupply ( ) . ConfigureAwait ( false ) ;
13941396 }
13951397 catch
13961398 {
1397- totalSupply = int . MaxValue ;
1399+ totalCount = int . MaxValue ;
13981400 }
1399- count = Math . Min ( count , ( int ) ( totalSupply - startTokenId ) ) ;
1401+ count = Math . Min ( count , ( int ) ( totalCount - startTokenId ) ) ;
14001402
14011403 var nftTasks = new List < Task < NFT > > ( ) ;
14021404 for ( var i = startTokenId ; i < startTokenId + count ; i ++ )
14031405 {
1404- nftTasks . Add ( contract . ERC1155_GetNFT ( i ) ) ;
1406+ nftTasks . Add ( contract . ERC1155_GetNFT ( i , fillSupply ) ) ;
14051407 }
14061408
14071409 var allNfts = await Task . WhenAll ( nftTasks ) . ConfigureAwait ( false ) ;
0 commit comments