diff --git a/Thirdweb/Thirdweb.Extensions/ThirdwebExtensions.cs b/Thirdweb/Thirdweb.Extensions/ThirdwebExtensions.cs index 54c000db..531a6344 100644 --- a/Thirdweb/Thirdweb.Extensions/ThirdwebExtensions.cs +++ b/Thirdweb/Thirdweb.Extensions/ThirdwebExtensions.cs @@ -651,7 +651,19 @@ public static async Task> ERC721A_TokensOfOwnerIn(this Thirdweb /// Thrown when the contract is null. public static async Task ERC721_TotalSupply(this ThirdwebContract contract) { - return contract == null ? throw new ArgumentNullException(nameof(contract)) : await ThirdwebContract.Read(contract, "totalSupply"); + if (contract == null) + { + throw new ArgumentNullException(nameof(contract)); + } + + try + { + return await ThirdwebContract.Read(contract, "nextTokenIdToMint"); + } + catch + { + return await ThirdwebContract.Read(contract, "totalSupply"); + } } ///