Skip to content

Commit 9e4ebba

Browse files
committed
Fix base-goerli and potentially other pm_sponsor return types
1 parent ff361ae commit 9e4ebba

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Assets/Thirdweb/Core/Scripts/AccountAbstraction/Core/BundlerClient.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,14 @@ public static async Task<EthEstimateUserOperationGasResponse> EthEstimateUserOpe
3333
public static async Task<PMSponsorOperationResponse> PMSponsorUserOperation(string paymasterUrl, string apiKey, object requestId, UserOperationHexified userOp, string entryPoint)
3434
{
3535
var response = await BundlerRequest(paymasterUrl, apiKey, requestId, "pm_sponsorUserOperation", userOp, new EntryPointWrapper() { entryPoint = entryPoint });
36-
return JsonConvert.DeserializeObject<PMSponsorOperationResponse>(response.Result.ToString());
36+
try
37+
{
38+
return JsonConvert.DeserializeObject<PMSponsorOperationResponse>(response.Result.ToString());
39+
}
40+
catch
41+
{
42+
return new PMSponsorOperationResponse() { paymasterAndData = response.Result.ToString() };
43+
}
3744
}
3845

3946
// Request

0 commit comments

Comments
 (0)