chore: paymaster support fixes for protocols#49
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds paymaster support to the SDK, enabling users to pay for gas using ERC-20 tokens (e.g., USDC) when depositing to and withdrawing from DeFi protocol vaults. The changes extend the earn() and withdraw() methods across SmartWallet and protocol implementations to accept an optional paymasterToken parameter.
Changes:
- Added optional
paymasterTokenparameter toearn()andwithdraw()methods in SmartWallet and protocol implementations - Implemented gas reserve logic in ProxyProtocol to ensure sufficient tokens are available for gas payment
- Updated tests and documentation to reflect the new paymaster functionality
- Bumped SDK version from 2.0.0-alpha.0 to 2.0.0-alpha.1
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/sdk/src/wallet/base/wallets/SmartWallet.ts | Added optional options parameter with paymasterToken to abstract earn() and withdraw() methods |
| packages/sdk/src/wallet/DefaultSmartWallet.ts | Updated earn() and withdraw() to pass options to protocol provider; removed unused getSupportedChain() call |
| packages/sdk/src/wallet/DefaultSmartWallet.spec.ts | Updated test expectations to include undefined as fourth parameter in protocol method calls |
| packages/sdk/src/tools/ApiClient.ts | Extended body parameter type to accept number in addition to string and VaultInfo |
| packages/sdk/src/protocols/implementations/ProxyProtocol.ts | Added paymaster support with gas reserve validation for deposit and withdraw operations; changed chainId from string to number in withdraw API call |
| packages/sdk/src/protocols/implementations/ProxyProtocol.spec.ts | Updated test expectations to pass undefined as options parameter and changed chainId to number in withdraw tests |
| packages/sdk/src/protocols/base/BaseProtocol.ts | Added optional options parameter to abstract deposit() and withdraw() methods |
| packages/sdk/package.json | Bumped version from 2.0.0-alpha.0 to 2.0.0-alpha.1 |
| packages/sdk/CHANGELOG.md | Added changelog entry describing paymaster support additions |
| packages/cli/src/cli.ts | Updated CLI to use USDC as paymaster token for earn, withdraw, and send operations |
| packages/cli/package.json | Bumped version from 1.0.2-alpha.0 to 1.0.2-alpha.1 |
| packages/cli/CHANGELOG.md | Added changelog entry noting dependency update |
| .changeset/pre.json | Added "late-clowns-add" changeset to pre-release tracking |
| .changeset/late-clowns-add.md | Created changeset documenting the paymaster support changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ts; updated DefualtSmartWallet tests
…ts; updated DefualtSmartWallet tests
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 17 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What was done?
TODO: