-
Notifications
You must be signed in to change notification settings - Fork 22
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(sessions): permission co-signer API #244
base: feat/bcapi_permissions
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
userOp: // ERC-4337 pseudo transaction object: | ||
{ | ||
sender: string, // The address of the smart contract account. | ||
nonce: number, // Anti-replay protection; also used as the salt for first-time account creation. | ||
initCode: string, // Code used to deploy the account if not yet on-chain. | ||
callData: string, // Data that's passed to the sender for execution. | ||
callGasLimit: number, // Gas limit for execution phase. | ||
verificationGasLimit: number, // Gas limit for verification phase. | ||
preVerificationGas: number, // Gas to compensate the bundler. | ||
maxFeePerGas: number, // Maximum fee per gas (similar to EIP-1559(opens in a new tab) max_fee_per_gas). | ||
maxPriorityFeePerGas: number, // Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas). | ||
paymasterAndData: string, // Paymaster Contract address and any extra data required for verification and execution (empty for self-sponsored transaction). | ||
signature: string // Signature of all `userOp` fields hashed by keccak256 and signed by the key provided during the permission creation. | ||
} |
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.
@lukaisailovic Is it expected for the dapp to build the userOp and then call this API to validate permissions before submission by the co-signer? Or will the co-signer build and submit the userOp?
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.
Yes. The dapp needs to build userOp and sign it first.
pci: String, // Permission controller identifier. | ||
userOp: // ERC-4337 pseudo transaction object: | ||
{ | ||
sender: string, // The address of the smart contract account. | ||
nonce: number, // Anti-replay protection; also used as the salt for first-time account creation. | ||
initCode: string, // Code used to deploy the account if not yet on-chain. | ||
callData: string, // Data that's passed to the sender for execution. | ||
callGasLimit: number, // Gas limit for execution phase. | ||
verificationGasLimit: number, // Gas limit for verification phase. | ||
preVerificationGas: number, // Gas to compensate the bundler. | ||
maxFeePerGas: number, // Maximum fee per gas (similar to EIP-1559(opens in a new tab) max_fee_per_gas). | ||
maxPriorityFeePerGas: number, // Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas). | ||
paymasterAndData: string, // Paymaster Contract address and any extra data required for verification and execution (empty for self-sponsored transaction). | ||
signature: string // Signature of all `userOp` fields hashed by keccak256 and signed by the key provided during the permission creation. |
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.
Any max-lengths on these fields? E.g. pci
maybe max 64 chars or whatever the spec says?
892e380
to
e471921
Compare
This PR adds session permission co-signer API.
The corresponding Notion document.