coinbase-wallet-sdk icon indicating copy to clipboard operation
coinbase-wallet-sdk copied to clipboard

Bug: Gasless Transactions Fail with Coinbase API Key (RPC URL)

Open KcPele opened this issue 4 months ago • 0 comments

Describe the bug

When attempting gasless transactions using a custom paymaster service URL for sponsorship, the transaction fails to complete. The UI correctly displays the sponsor name (e.g., "Sponsored by kcplele"), but upon clicking "Confirm," the transaction keeps loading and eventually cancels without completing. This issue is not present when using "Sponsored by Base," where the transaction completes successfully.

Steps

Steps to Reproduce the Error:

Clone the repository wilsoncusack/wagmi-scw:

git clone https://github.com/wilsoncusack/wagmi-scw.git

Open the project in your code editor.

Locate the part of the code where the paymaster RPC URL is specified.

Change the paymaster RPC URL to a custom Coinbase RPC URL (e.g., "https://api.developer.coinbase.com/rpc/v1/base-sepolia/").

Start the development server:

npm install npm run dev

Navigate to the app in your browser and connect a wallet using the provided interface.

Initiate a gasless transaction using the changed paymaster RPC URL.

Observe the behavior upon clicking "Confirm":

The sponsorship label displays correctly (e.g., "Sponsored by ").

The transaction keeps loading and eventually cancels without completing.

Expected behavior

When using a custom Coinbase paymaster RPC URL for gasless transactions, the transaction should successfully complete after clicking "Confirm." Specifically:

  1. The sponsorship label (e.g., "Sponsored by kcplele") should be displayed correctly.
  2. The transaction should proceed without requiring the user to pay gas fees.
  3. The transaction should not get stuck in the loading state and should not cancel.
  4. The expected action (e.g., setting a greeting or executing a smart contract function) should be successfully performed upon confirmation.

Version

4.x

Additional info

  • The issue only occurs when using a custom Coinbase paymaster RPC URL (e.g., "https://api.developer.coinbase.com/rpc/v1/base-sepolia/").

Screenshot from 2024-10-04 18-53-03

  • When the transaction is sponsored by "Base" (using the Base-specific URL), the transaction proceeds as expected. Screenshot from 2024-10-09 23-04-23
  • No clear error messages are returned when the transaction fails after clicking "Confirm." It simply gets stuck loading and then cancels.
  • The same behavior is observed regardless of the connected wallet or network being used.
  • The problem might be related to how the custom paymaster service is configured or handled within the Coinbase API or the app's integration.

Desktop

No response

Smartphone

No response

KcPele avatar Oct 09 '24 22:10 KcPele