Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: reenable paymaster for argent #917

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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