-
Notifications
You must be signed in to change notification settings - Fork 592
feat(typescript): add ListSpendPermissions and UseSpendPermissions #818
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
Conversation
✅ Heimdall Review Status
|
b8a30ca to
280d0c3
Compare
| * A wallet provider that uses the Coinbase CDP SDK smart wallets. | ||
| */ | ||
| export class CdpSmartWalletProvider extends EvmWalletProvider implements WalletProviderWithClient { | ||
| public smartAccount: EvmSmartAccount; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I think this is fine because the smartAccount provides lots of convenience methods, in particular .useSpendPermission which is used in this PR. Other convenience methods may be used in future actions (like .swap – cc @phdargen re: fix: swap api)
| /** | ||
| * Lists spend permissions for a smart account. | ||
| * | ||
| * @param walletProvider - The server wallet provider to use for listing permissions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we add context on how these spend permissions can be created?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Will follow up with Ryan and fast-follow with the info
Description
This PR implements two Spend Permissions actions in both EvmWallet and SmartWallet:
list_spend_permissionsuse_spend_permissionsTests
Setup:
Transcript of chat with Vercel AI Chatbot
Transcript of chat with Vercel AI Chatbot modified to use EVM Server Wallet
Note: There was a slight hiccup where the agent seemed to not respond after the first time requesting to use the spend permission. This is because it didn't have funds to cover gas. The reason it didn't print anything is because the action was throwing an error instead of returning a string – this has since been fixed.
Checklist
A couple of things to include in your PR for completeness: