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: Add onchain kit paymaster utilities #515

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

cpcramer
Copy link
Contributor

@cpcramer cpcramer commented Jun 10, 2024

What changed? Why?
Add isValidAAEntrypoint and isWalletASmartWallet OnchainKit utilities to the paymaster proxy.

Update and add unit tests.

Notes to reviewers

How has it been tested?
Tested locally and in Dev.

package.json Outdated Show resolved Hide resolved
template/web/jest.config.js Outdated Show resolved Hide resolved
tsconfig.json Outdated Show resolved Hide resolved
Comment on lines +8 to +11
export const client = createPublicClient({
chain: baseSepolia,
transport: http(),
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used as the client to pass into isWalletASmartWallet

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we already have a client, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to use client rather than paymasterClient because client is created using createPublicClient and is of type PublicClient, which is what isWalletASmartWallet expects.

Maybe we should update isWalletASmartWallet to use createClient rather than createPublicClient from Viem?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that isWalletASmartWallet should continue to use createClient because it is a "public" endpoint that doesn't require authentication to use.

@Zizzamia Zizzamia merged commit 0540295 into main Jun 13, 2024
9 checks passed
@Zizzamia Zizzamia deleted the paul/add-onchain-kit-paymaster-utilities branch June 13, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants