@zerodev/sdk 5.4.37 → 5.4.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_cjs/accounts/kernel/abi/kernel_v_3_3/KernelAccountAbi.js +826 -0
- package/_cjs/accounts/kernel/abi/kernel_v_3_3/KernelAccountAbi.js.map +1 -0
- package/_cjs/accounts/kernel/createKernelAccount.js +56 -18
- package/_cjs/accounts/kernel/createKernelAccount.js.map +1 -1
- package/_cjs/accounts/utils/signerTo7702Validator.js +1 -1
- package/_cjs/accounts/utils/signerTo7702Validator.js.map +1 -1
- package/_cjs/actions/account-client/changeSudoValidator.js +5 -1
- package/_cjs/actions/account-client/changeSudoValidator.js.map +1 -1
- package/_cjs/actions/account-client/uninstallPlugin.js +5 -1
- package/_cjs/actions/account-client/uninstallPlugin.js.map +1 -1
- package/_cjs/constants.js +2 -1
- package/_cjs/constants.js.map +1 -1
- package/_cjs/index.js +3 -1
- package/_cjs/index.js.map +1 -1
- package/_esm/accounts/kernel/abi/kernel_v_3_3/KernelAccountAbi.js +823 -0
- package/_esm/accounts/kernel/abi/kernel_v_3_3/KernelAccountAbi.js.map +1 -0
- package/_esm/accounts/kernel/createKernelAccount.js +56 -18
- package/_esm/accounts/kernel/createKernelAccount.js.map +1 -1
- package/_esm/accounts/utils/signerTo7702Validator.js +1 -1
- package/_esm/accounts/utils/signerTo7702Validator.js.map +1 -1
- package/_esm/actions/account-client/changeSudoValidator.js +5 -1
- package/_esm/actions/account-client/changeSudoValidator.js.map +1 -1
- package/_esm/actions/account-client/uninstallPlugin.js +5 -1
- package/_esm/actions/account-client/uninstallPlugin.js.map +1 -1
- package/_esm/constants.js +2 -1
- package/_esm/constants.js.map +1 -1
- package/_esm/index.js +1 -0
- package/_esm/index.js.map +1 -1
- package/_types/accounts/kernel/abi/kernel_v_3_3/KernelAccountAbi.d.ts +1027 -0
- package/_types/accounts/kernel/abi/kernel_v_3_3/KernelAccountAbi.d.ts.map +1 -0
- package/_types/accounts/kernel/createKernelAccount.d.ts.map +1 -1
- package/_types/actions/account-client/changeSudoValidator.d.ts.map +1 -1
- package/_types/actions/account-client/uninstallPlugin.d.ts.map +1 -1
- package/_types/constants.d.ts +1 -0
- package/_types/constants.d.ts.map +1 -1
- package/_types/index.d.ts +1 -0
- package/_types/index.d.ts.map +1 -1
- package/_types/types/kernel.d.ts +1 -1
- package/_types/types/kernel.d.ts.map +1 -1
- package/accounts/kernel/abi/kernel_v_3_3/KernelAccountAbi.ts +822 -0
- package/accounts/kernel/createKernelAccount.ts +60 -22
- package/accounts/utils/signerTo7702Validator.ts +1 -1
- package/actions/account-client/changeSudoValidator.ts +5 -3
- package/actions/account-client/uninstallPlugin.ts +5 -3
- package/constants.ts +2 -1
- package/index.ts +1 -0
- package/package.json +1 -1
- package/types/kernel.ts +1 -1
|
@@ -731,19 +731,39 @@ export async function createKernelAccount<
|
|
|
731
731
|
chainId: metadataChainId,
|
|
732
732
|
version
|
|
733
733
|
} = await getMemoizedAccountMetadata()
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
734
|
+
|
|
735
|
+
let signature: Hex
|
|
736
|
+
if (isEip7702) {
|
|
737
|
+
signature = await kernelPluginManager.signTypedData({
|
|
738
|
+
message: { hash: messageHash },
|
|
739
|
+
primaryType: "Kernel",
|
|
740
|
+
types: {
|
|
741
|
+
Kernel: [{ name: "hash", type: "bytes32" }]
|
|
742
|
+
},
|
|
743
|
+
domain: {
|
|
744
|
+
name,
|
|
745
|
+
version,
|
|
746
|
+
chainId: useReplayableSignature
|
|
747
|
+
? 0
|
|
748
|
+
: Number(metadataChainId),
|
|
749
|
+
verifyingContract: accountAddress
|
|
750
|
+
}
|
|
751
|
+
})
|
|
752
|
+
} else {
|
|
753
|
+
const wrappedMessageHash = await eip712WrapHash(
|
|
754
|
+
messageHash,
|
|
755
|
+
{
|
|
756
|
+
name,
|
|
757
|
+
chainId: Number(metadataChainId),
|
|
758
|
+
version,
|
|
759
|
+
verifyingContract: accountAddress
|
|
760
|
+
},
|
|
761
|
+
useReplayableSignature
|
|
762
|
+
)
|
|
763
|
+
signature = await kernelPluginManager.signMessage({
|
|
764
|
+
message: { raw: wrappedMessageHash }
|
|
765
|
+
})
|
|
766
|
+
}
|
|
747
767
|
|
|
748
768
|
if (
|
|
749
769
|
!hasKernelFeature(
|
|
@@ -793,15 +813,33 @@ export async function createKernelAccount<
|
|
|
793
813
|
chainId: metadataChainId,
|
|
794
814
|
version
|
|
795
815
|
} = await getMemoizedAccountMetadata()
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
816
|
+
|
|
817
|
+
let signature: Hex
|
|
818
|
+
if (isEip7702) {
|
|
819
|
+
signature = await kernelPluginManager.signTypedData({
|
|
820
|
+
message: { hash: typedHash },
|
|
821
|
+
primaryType: "Kernel",
|
|
822
|
+
types: {
|
|
823
|
+
Kernel: [{ name: "hash", type: "bytes32" }]
|
|
824
|
+
},
|
|
825
|
+
domain: {
|
|
826
|
+
name,
|
|
827
|
+
version,
|
|
828
|
+
chainId: Number(metadataChainId),
|
|
829
|
+
verifyingContract: accountAddress
|
|
830
|
+
}
|
|
831
|
+
})
|
|
832
|
+
} else {
|
|
833
|
+
const wrappedMessageHash = await eip712WrapHash(typedHash, {
|
|
834
|
+
name,
|
|
835
|
+
chainId: Number(metadataChainId),
|
|
836
|
+
version,
|
|
837
|
+
verifyingContract: accountAddress
|
|
838
|
+
})
|
|
839
|
+
signature = await kernelPluginManager.signMessage({
|
|
840
|
+
message: { raw: wrappedMessageHash }
|
|
841
|
+
})
|
|
842
|
+
}
|
|
805
843
|
if (
|
|
806
844
|
!hasKernelFeature(
|
|
807
845
|
KERNEL_FEATURES.ERC1271_WITH_VALIDATOR,
|
|
@@ -69,9 +69,11 @@ export async function changeSudoValidator<
|
|
|
69
69
|
|
|
70
70
|
let rootValidatorId: Hex
|
|
71
71
|
if (
|
|
72
|
-
[
|
|
73
|
-
VALIDATOR_TYPE
|
|
74
|
-
|
|
72
|
+
[
|
|
73
|
+
VALIDATOR_TYPE.PERMISSION,
|
|
74
|
+
VALIDATOR_TYPE.SECONDARY,
|
|
75
|
+
VALIDATOR_TYPE.EIP7702
|
|
76
|
+
].includes(VALIDATOR_TYPE[sudoValidator.validatorType])
|
|
75
77
|
) {
|
|
76
78
|
rootValidatorId = concatHex([
|
|
77
79
|
VALIDATOR_TYPE[sudoValidator.validatorType],
|
|
@@ -52,9 +52,11 @@ export async function uninstallPlugin<
|
|
|
52
52
|
|
|
53
53
|
let validatorId: Hex
|
|
54
54
|
if (
|
|
55
|
-
[
|
|
56
|
-
VALIDATOR_TYPE
|
|
57
|
-
|
|
55
|
+
[
|
|
56
|
+
VALIDATOR_TYPE.PERMISSION,
|
|
57
|
+
VALIDATOR_TYPE.SECONDARY,
|
|
58
|
+
VALIDATOR_TYPE.EIP7702
|
|
59
|
+
].includes(VALIDATOR_TYPE[plugin.validatorType])
|
|
58
60
|
) {
|
|
59
61
|
validatorId = concatHex([
|
|
60
62
|
VALIDATOR_TYPE[plugin.validatorType],
|
package/constants.ts
CHANGED
package/index.ts
CHANGED
|
@@ -51,6 +51,7 @@ export {
|
|
|
51
51
|
KernelV3InitAbi
|
|
52
52
|
} from "./accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js"
|
|
53
53
|
export { KernelV3_1AccountAbi } from "./accounts/kernel/abi/kernel_v_3_1/KernelAccountAbi.js"
|
|
54
|
+
export { KernelV3_3AccountAbi } from "./accounts/kernel/abi/kernel_v_3_3/KernelAccountAbi.js"
|
|
54
55
|
export { KernelV3FactoryAbi } from "./accounts/kernel/abi/kernel_v_3_0_0/KernelFactoryAbi.js"
|
|
55
56
|
export { KernelFactoryStakerAbi } from "./accounts/kernel/abi/kernel_v_3_0_0/KernelFactoryStakerAbi.js"
|
|
56
57
|
export { TokenActionsAbi } from "./accounts/kernel/abi/TokenActionsAbi.js"
|
package/package.json
CHANGED
package/types/kernel.ts
CHANGED
|
@@ -116,7 +116,7 @@ export type ZeroDevAccountClientRpcSchema = [
|
|
|
116
116
|
|
|
117
117
|
export type ValidatorType = Extract<
|
|
118
118
|
keyof typeof VALIDATOR_TYPE,
|
|
119
|
-
"PERMISSION" | "SECONDARY"
|
|
119
|
+
"PERMISSION" | "SECONDARY" | "EIP7702"
|
|
120
120
|
>
|
|
121
121
|
|
|
122
122
|
export type KernelValidator<Name extends string = string> =
|