From 58149d6ab303c441b83afb4fd933dab1c3539b77 Mon Sep 17 00:00:00 2001 From: Nico Date: Tue, 19 Nov 2024 03:40:22 +0100 Subject: [PATCH] feat: reenable paymaster for argent (#917) --- hooks/paymaster.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hooks/paymaster.tsx b/hooks/paymaster.tsx index d6493038..41efbf5e 100644 --- a/hooks/paymaster.tsx +++ b/hooks/paymaster.tsx @@ -64,7 +64,7 @@ const usePaymaster = ( [connector] ); - const paymasterEnabled = !argentWallet; + const paymasterEnabled = true; // We can conditionally enable/disable depending on the wallet + deployment info useEffect(() => { if (!gasTokenPrice) setGasTokenPrice(gasTokenPrices[0]); @@ -171,7 +171,7 @@ const usePaymaster = ( connector?.id === "argentX" && !isDeployed && !deploymentData; useEffect(() => { - if (!account) return; + if (!account || !paymasterEnabled) return; if ( !isDeployed && (!deploymentData || !argentWallet || loadingDeploymentData) @@ -206,11 +206,12 @@ const usePaymaster = ( callData, maxGasTokenAmount, loadingDeploymentData, + paymasterEnabled, ]); const handleRegister = useCallback(() => { if (!account) return; - if (typedData && !argentWallet) { + if (typedData && paymasterEnabled) { signTypedDataAsync(typedData).then((signature: Signature) => { const body: { [id: string]: object | string } = { userAddress: account.address, @@ -242,7 +243,7 @@ const usePaymaster = ( typedData, execute, isDeployed, - argentWallet, + paymasterEnabled, ]); return {