Skip to content

Commit

Permalink
chore: trouble shooting guide
Browse files Browse the repository at this point in the history
  • Loading branch information
devceline committed Feb 5, 2025
1 parent 3bc0d7c commit 11e3f6b
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions docs/appkit/recipes/sponsoring-first-transaction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,57 @@ return (
For more information on sponsoring calls, read more in [our docs](../features/sponsored-transactions.mdx).


# Troubleshooting

If you're running into issues getting a transaction to be successfully
sponsored, it's best to isolate issues. So to get started, first:

## Setup Environment

1. Use AppKit's Embedded Smart Wallet: Login using social login (Eg gmail) or
your email

2. Ensure the code performing send calls is as simple as possible, eg: hardcode
the `capabilities` object and remove any extra conditional logic.

3. Keep the network tab on your browser console open

## Ensure a call to the paymaster is being made

Since the embedded wallet lives on your browser, you can observe the network
calls it makes.

If after performing the `sendCalls` and approving it in the AppKit Embedded
Wallet, there is no call to the paymaster URL provided that most likely means
that the `capabilities` were not filled in properly.

Ensure the capabilities object you're sending looks like this:

```ts
paymasterService: {
url: 'https://paymaster-api.reown.com/<CHAIN_ID>/rpc?projectId=<YOUR_PROJECT_ID>',
}
```

## Paymaster is called but returns an error

### No calls to specified contract made

1. Ensure that the chain ID provided in the paymaster URL matches the network
you are on

2. Ensure you are targetting the contract and method specified in your policy

## Not sure if everything's set up correctly?

1. Ensure a call to the Paymaster is being made via the network tab
2. Ensure the response from the call is not `0x` or an `error`.
3. Ensure the call to the `bundler` (also viewed in the network tab) that is
performing `sendUserOperation` has filled in `paymasterData` field
4. Grab the user op hash (result from `sendUserOperation`) and paste it into a
block explorer that supports searching by User Op Hashes like BlockScout
5. Ensure that That the paymaster sponsor field is filled in

---

## Links
Expand Down

0 comments on commit 11e3f6b

Please sign in to comment.