Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Thirdweb/Thirdweb.Extensions/ThirdwebExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,19 @@ public static async Task<List<BigInteger>> ERC721A_TokensOfOwnerIn(this Thirdweb
/// <exception cref="ArgumentNullException">Thrown when the contract is null.</exception>
public static async Task<BigInteger> ERC721_TotalSupply(this ThirdwebContract contract)
{
return contract == null ? throw new ArgumentNullException(nameof(contract)) : await ThirdwebContract.Read<BigInteger>(contract, "totalSupply");
if (contract == null)
{
throw new ArgumentNullException(nameof(contract));
}

try
{
return await ThirdwebContract.Read<BigInteger>(contract, "nextTokenIdToMint");
}
catch
{
return await ThirdwebContract.Read<BigInteger>(contract, "totalSupply");
}
}

/// <summary>
Expand Down
Loading