Skip to content

Commit

Permalink
feat: reenable paymaster for argent (#917)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marchand-Nicolas authored Nov 19, 2024
1 parent adf07a3 commit 58149d6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions hooks/paymaster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down Expand Up @@ -171,7 +171,7 @@ const usePaymaster = (
connector?.id === "argentX" && !isDeployed && !deploymentData;

useEffect(() => {
if (!account) return;
if (!account || !paymasterEnabled) return;
if (
!isDeployed &&
(!deploymentData || !argentWallet || loadingDeploymentData)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -242,7 +243,7 @@ const usePaymaster = (
typedData,
execute,
isDeployed,
argentWallet,
paymasterEnabled,
]);

return {
Expand Down

0 comments on commit 58149d6

Please sign in to comment.