-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from zerodevapp/feat/enable-recovery
feat: added encodeModuleInstallCallData to kernelAccount, a flow for enabling recovery using that | updated to latest permissionless and viem with getAction bug fix
- Loading branch information
Showing
32 changed files
with
344 additions
and
94 deletions.
There are no files selected for viewing
This file contains 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
35 changes: 35 additions & 0 deletions
35
packages/core/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import type { ENTRYPOINT_ADDRESS_V06_TYPE } from "permissionless/types/entrypoint" | ||
import { type Address, type Hex, encodeFunctionData } from "viem" | ||
import type { PluginInstallData } from "../../../../../types/kernel.js" | ||
import { KernelAccountAbi } from "../../../abi/KernelAccountAbi.js" | ||
import { encodeCallData } from "./encodeCallData.js" | ||
|
||
export const encodeModuleInstallCallData = async ({ | ||
accountAddress, | ||
enableData, | ||
executor, | ||
selector, | ||
validAfter, | ||
validUntil, | ||
validator | ||
}: { | ||
accountAddress: Address | ||
} & PluginInstallData<ENTRYPOINT_ADDRESS_V06_TYPE>): Promise<Hex> => { | ||
return encodeCallData({ | ||
to: accountAddress, | ||
value: 0n, | ||
data: encodeFunctionData({ | ||
abi: KernelAccountAbi, | ||
functionName: "setExecution", | ||
args: [ | ||
selector, | ||
executor, | ||
validator, | ||
validUntil, | ||
validAfter, | ||
enableData | ||
] | ||
}), | ||
callType: "call" | ||
}) | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.