Skip to content

Commit 99f0b55

Browse files
committed
Add fallback for polygon gas station errors
1 parent 8931771 commit 99f0b55

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Assets/Thirdweb/Core/Scripts/Utils.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,14 @@ public async static Task<GasPriceParameters> GetGasPriceAsync(BigInteger chainId
501501
{
502502
if (chainId == 137 || chainId == 80001)
503503
{
504-
return await GetPolygonGasPriceParameters((int)chainId);
504+
try
505+
{
506+
return await GetPolygonGasPriceParameters((int)chainId);
507+
}
508+
catch (System.Exception e)
509+
{
510+
ThirdwebDebug.LogWarning($"Failed to get gas price from Polygon gas station, using default method: {e.Message}");
511+
}
505512
}
506513

507514
var web3 = GetWeb3(chainId);

0 commit comments

Comments
 (0)