feat(sessions): permission co-signer API#244
Open
geekbrother wants to merge 3 commits intofeat/bcapi_permissionsfrom
Open
feat(sessions): permission co-signer API#244geekbrother wants to merge 3 commits intofeat/bcapi_permissionsfrom
geekbrother wants to merge 3 commits intofeat/bcapi_permissionsfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
nopestack
reviewed
Jul 9, 2024
nopestack
reviewed
Jul 9, 2024
lukaisailovic
approved these changes
Jul 9, 2024
KannuSingh
reviewed
Jul 9, 2024
Comment on lines
+194
to
+207
| 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.
@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.
Yes. The dapp needs to build userOp and sign it first.
chris13524
reviewed
Jul 10, 2024
Comment on lines
+193
to
+206
| 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. |
Member
There was a problem hiding this comment.
Any max-lengths on these fields? E.g. pci maybe max 64 chars or whatever the spec says?
chris13524
approved these changes
Jul 10, 2024
892e380 to
e471921
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds session permission co-signer API.
The corresponding Notion document.