Skip to content

chore: paymaster support fixes for protocols#49

Merged
0xdeval merged 11 commits intodevelopfrom
chore/paymaster-support-fix
Jan 23, 2026
Merged

chore: paymaster support fixes for protocols#49
0xdeval merged 11 commits intodevelopfrom
chore/paymaster-support-fix

Conversation

@0xdeval
Copy link
Copy Markdown
Collaborator

@0xdeval 0xdeval commented Jan 15, 2026

What was done?

  1. Added paymaster to ProxyProtocol to use with DeFi opportunities with Mycelium Cloud
  2. Updated tests for ProxyProtocol
  3. Added Paymaster support for DefaultSmartWallet
  4. Updated tests for DefaultSmartWallet.ts

TODO:

  • Support paymaster for Spark
  • Change tests for Spark and ProxyProtocol
  • Added to documentation the usage of paymaster

Copilot AI review requested due to automatic review settings January 15, 2026 22:02
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 paymasterToken parameter to earn() and withdraw() 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.

Comment thread packages/cli/src/cli.ts
Comment thread packages/cli/src/cli.ts
Comment thread packages/sdk/src/protocols/implementations/ProxyProtocol.ts Outdated
Comment thread packages/sdk/src/protocols/implementations/ProxyProtocol.ts Outdated
Comment thread packages/sdk/src/protocols/implementations/ProxyProtocol.ts Outdated
Comment thread packages/sdk/src/protocols/implementations/ProxyProtocol.ts Outdated
Comment thread packages/sdk/src/protocols/implementations/ProxyProtocol.ts Outdated
Comment thread packages/sdk/src/protocols/implementations/ProxyProtocol.ts Outdated
Comment thread packages/sdk/src/protocols/implementations/ProxyProtocol.ts Outdated
Copilot AI review requested due to automatic review settings January 22, 2026 21:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread packages/cli/src/cli.ts
Comment thread packages/sdk/CHANGELOG.md
Comment thread packages/sdk/src/protocols/implementations/SparkProtocol.ts Outdated
Comment thread packages/sdk/src/protocols/implementations/SparkProtocol.ts Outdated
Comment thread packages/sdk/src/protocols/implementations/SparkProtocol.ts Outdated
Comment thread packages/sdk/src/protocols/implementations/ProxyProtocol.ts Outdated
Comment thread packages/sdk/src/protocols/implementations/SparkProtocol.spec.ts Outdated
Comment thread packages/sdk/src/protocols/implementations/SparkProtocol.ts
Comment thread packages/sdk/src/protocols/implementations/ProxyProtocol.ts Outdated
Comment thread packages/sdk/src/protocols/implementations/ProxyProtocol.ts Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 22, 2026 21:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread packages/sdk/src/protocols/implementations/SparkProtocol.ts Outdated
Comment thread packages/sdk/src/protocols/implementations/ProxyProtocol.ts
Comment thread packages/sdk/src/protocols/base/BaseProtocol.ts
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread packages/sdk/src/protocols/base/BaseProtocol.ts Outdated
Comment thread packages/sdk/src/protocols/base/BaseProtocol.ts
Comment thread packages/sdk/src/protocols/base/BaseProtocol.ts Outdated
Comment thread packages/sdk/src/protocols/base/BaseProtocol.ts Outdated
Comment thread packages/sdk/src/protocols/implementations/ProxyProtocol.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 23, 2026 19:17
0xdeval and others added 2 commits January 23, 2026 19:19
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI commented Jan 23, 2026

@0xdeval I've opened a new pull request, #52, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread packages/sdk/src/protocols/base/BaseProtocol.ts Outdated
Comment thread packages/cli/src/cli.ts
Comment thread packages/sdk/CHANGELOG.md
Comment thread packages/sdk/src/protocols/implementations/SparkProtocol.spec.ts Outdated
@0xdeval 0xdeval merged commit a1329c8 into develop Jan 23, 2026
4 checks passed
@0xdeval 0xdeval review requested due to automatic review settings March 23, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactoring: paymaster checks for protocols operations Gas sponsorship

3 participants