-
Notifications
You must be signed in to change notification settings - Fork 637
feat: jit spend permissions #1611
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
|
c2348c8
to
df64701
Compare
faeda99
to
a193064
Compare
d48cc89
to
2375f21
Compare
2375f21
to
8bf75cf
Compare
export function createWalletSendCallsRequest({ | ||
to, | ||
data, | ||
value, | ||
from, | ||
chainId, | ||
}: { | ||
to: Address; | ||
data: Hex; | ||
value: Hex; | ||
from: Address; | ||
chainId: Hex; | ||
}) { |
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.
This has been changed to accept an array of calls instead of a single call in #1612
* feat: paymaster urls in config * fix: capabilties arg in createWalletSendCallsRequest * fix: createWalletSendCallsRequest chainId type
const { request: subAccountRequest } = await createSubAccountSigner({ | ||
address: subAccount.address, | ||
owner: ownerAccount.account, | ||
client: client, | ||
factory: subAccount.factory, | ||
factoryData: subAccount.factoryData, | ||
parentAddress: globalAccountAddress, |
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.
nit: we should standardize naming for the global account. No strong preference global, parent, universal are all good with me
capabilities: Record<string, unknown> | ||
) { | ||
// Modify request to include auto sub account capabilities | ||
const modifiedRequest = { ...request }; | ||
|
||
if (capabilities && ['wallet_sendCalls', 'wallet_connect'].includes(request.method)) { | ||
if (capabilities && request.method.startsWith('wallet_')) { |
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.
would still prefer tighter restriction here, non blocker for this PR thoooo
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.
actually leaning towards removing this conditional from here entirely because it it's kinda outside of the scope of the function
}, | ||
{ | ||
isRed: false, | ||
info: 'Continue in Popup', |
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.
non blocker: have we finalized on the "continue in popup" messaging
* fix: account ordering for wallet_addSubAccount * feat: signer selector on /auto-sub-account page * fix: convert errors thrown by viem * fix: handle errors from other versions of viem
* feat: sub accounts data suffix support * fix: capabilities type * fix: tests
Review Error for cb-jake @ 2025-04-25 21:18:20 UTC |
Summary
Implements behavior to request spend permissions from the global wallet at transaction time
dynamicSpendLimits
config in SDK constructorSCWSigner
withhandleInsufficientBalanceError
parentAddress
arg tocreateSubAccountSigner
How did you test your changes?
/auto-sub-accounts