Skip to content

Commit

Permalink
feat: Allowed to pass enableSignature param in serializePermissionAcc…
Browse files Browse the repository at this point in the history
…ount util
  • Loading branch information
SahilVasava committed Oct 14, 2024
1 parent df6733b commit 04dd2bb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 6 additions & 0 deletions plugins/permission/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @zerodev/permissions

## 5.4.10

### Patch Changes

- Allowed to pass enableSignature param in serializePermissionAccount util

## 5.4.9

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion plugins/permission/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zerodev/permissions",
"version": "5.4.9",
"version": "5.4.10",
"author": "ZeroDev",
"main": "./_cjs/index.js",
"module": "./_esm/index.js",
Expand Down
12 changes: 7 additions & 5 deletions plugins/permission/serializePermissionAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@ import {

export const serializePermissionAccount = async <entryPoint extends EntryPoint>(
account: KernelSmartAccount<entryPoint>,
privateKey?: Hex
privateKey?: Hex,
enableSignature?: Hex
): Promise<string> => {
if (!isPermissionValidatorPlugin(account.kernelPluginManager))
throw new Error("Account plugin is not a permission validator")
const permissionParams =
account.kernelPluginManager.getPluginSerializationParams()
const action = account.kernelPluginManager.getAction()
const validityData = account.kernelPluginManager.getValidityData()
const enableSignature =
await account.kernelPluginManager.getPluginEnableSignature(
const _enableSignature =
enableSignature ??
(await account.kernelPluginManager.getPluginEnableSignature(
account.address
)
))
const accountParams = {
initCode: await account.generateInitCode(),
accountAddress: account.address
Expand All @@ -30,7 +32,7 @@ export const serializePermissionAccount = async <entryPoint extends EntryPoint>(
action,
validityData,
accountParams,
enableSignature,
enableSignature: _enableSignature,
privateKey
}

Expand Down

0 comments on commit 04dd2bb

Please sign in to comment.