@zerodev/sdk 5.3.25 → 5.4.0-beta.0
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/index.js.map +1 -1
- package/_cjs/accounts/kernel/createKernelAccount.js +171 -199
- package/_cjs/accounts/kernel/createKernelAccount.js.map +1 -1
- package/_cjs/accounts/kernel/utils/account/ep0_6/encodeCallData.js +13 -9
- package/_cjs/accounts/kernel/utils/account/ep0_6/encodeCallData.js.map +1 -1
- package/_cjs/accounts/kernel/utils/account/ep0_6/encodeDeployCallData.js.map +1 -1
- package/_cjs/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.js +18 -17
- package/_cjs/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.js.map +1 -1
- package/_cjs/accounts/kernel/utils/account/ep0_7/encodeCallData.js +12 -8
- package/_cjs/accounts/kernel/utils/account/ep0_7/encodeCallData.js.map +1 -1
- package/_cjs/accounts/kernel/utils/account/ep0_7/encodeDeployCallData.js.map +1 -1
- package/_cjs/accounts/kernel/utils/common/accountMetadata.js.map +1 -1
- package/_cjs/accounts/kernel/utils/common/getActionSelector.js +2 -2
- package/_cjs/accounts/kernel/utils/common/getActionSelector.js.map +1 -1
- package/_cjs/accounts/kernel/utils/ep0_6/encodeExecuteBatchCall.js +2 -2
- package/_cjs/accounts/kernel/utils/ep0_6/encodeExecuteBatchCall.js.map +1 -1
- package/_cjs/accounts/kernel/utils/ep0_6/encodeExecuteDelegateCall.js +1 -1
- package/_cjs/accounts/kernel/utils/ep0_6/encodeExecuteDelegateCall.js.map +1 -1
- package/_cjs/accounts/kernel/utils/ep0_6/encodeExecuteSingleCall.js +1 -1
- package/_cjs/accounts/kernel/utils/ep0_6/encodeExecuteSingleCall.js.map +1 -1
- package/_cjs/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.js +2 -2
- package/_cjs/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.js.map +1 -1
- package/_cjs/accounts/kernel/utils/ep0_7/encodeExecuteCall.js +2 -2
- package/_cjs/accounts/kernel/utils/ep0_7/encodeExecuteCall.js.map +1 -1
- package/_cjs/accounts/kernel/utils/plugins/ep0_6/getEncodedPluginsData.js.map +1 -1
- package/_cjs/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.js.map +1 -1
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js.map +1 -1
- package/_cjs/accounts/kernel/v1/createKernelAccountV1.js +81 -94
- package/_cjs/accounts/kernel/v1/createKernelAccountV1.js.map +1 -1
- package/_cjs/accounts/kernel/v2/createKernelAccountV0_2.js +104 -110
- package/_cjs/accounts/kernel/v2/createKernelAccountV0_2.js.map +1 -1
- package/_cjs/accounts/utils/getCustomNonceKeyFromString.js +2 -4
- package/_cjs/accounts/utils/getCustomNonceKeyFromString.js.map +1 -1
- package/_cjs/accounts/utils/index.js +1 -7
- package/_cjs/accounts/utils/index.js.map +1 -1
- package/_cjs/accounts/utils/multisend.js.map +1 -1
- package/_cjs/accounts/utils/toKernelPluginManager.js +14 -16
- package/_cjs/accounts/utils/toKernelPluginManager.js.map +1 -1
- package/_cjs/actions/account-client/changeSudoValidator.js +27 -21
- package/_cjs/actions/account-client/changeSudoValidator.js.map +1 -1
- package/_cjs/actions/account-client/getKernelV3ModuleCurrentNonce.js +8 -6
- package/_cjs/actions/account-client/getKernelV3ModuleCurrentNonce.js.map +1 -1
- package/_cjs/actions/account-client/invalidateNonce.js +20 -15
- package/_cjs/actions/account-client/invalidateNonce.js.map +1 -1
- package/_cjs/actions/account-client/sendTransaction.js +42 -0
- package/_cjs/actions/account-client/sendTransaction.js.map +1 -0
- package/_cjs/actions/account-client/signMessage.js +15 -0
- package/_cjs/actions/account-client/signMessage.js.map +1 -0
- package/_cjs/actions/account-client/signTypedData.js +32 -0
- package/_cjs/actions/account-client/signTypedData.js.map +1 -0
- package/_cjs/actions/account-client/signUserOperation.js +7 -5
- package/_cjs/actions/account-client/signUserOperation.js.map +1 -1
- package/_cjs/actions/account-client/uninstallPlugin.js +13 -12
- package/_cjs/actions/account-client/uninstallPlugin.js.map +1 -1
- package/_cjs/actions/account-client/writeContract.js +21 -0
- package/_cjs/actions/account-client/writeContract.js.map +1 -0
- package/_cjs/actions/index.js +13 -3
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/paymaster/estimateGasInERC20.js +4 -4
- package/_cjs/actions/paymaster/estimateGasInERC20.js.map +1 -1
- package/_cjs/actions/paymaster/sponsorUserOperation.js +4 -6
- package/_cjs/actions/paymaster/sponsorUserOperation.js.map +1 -1
- package/_cjs/actions/public/getAccountNonce.js +38 -0
- package/_cjs/actions/public/getAccountNonce.js.map +1 -0
- package/_cjs/actions/public/getSenderAddress.js +166 -0
- package/_cjs/actions/public/getSenderAddress.js.map +1 -0
- package/_cjs/actions/public/index.js +8 -0
- package/_cjs/actions/public/index.js.map +1 -0
- package/_cjs/clients/decorators/kernel.js +17 -27
- package/_cjs/clients/decorators/kernel.js.map +1 -1
- package/_cjs/clients/fallbackKernelAccountClient.js.map +1 -1
- package/_cjs/clients/kernelAccountClient.js +27 -45
- package/_cjs/clients/kernelAccountClient.js.map +1 -1
- package/_cjs/clients/paymasterClient.js +7 -18
- package/_cjs/clients/paymasterClient.js.map +1 -1
- package/_cjs/errors/index.js +18 -0
- package/_cjs/errors/index.js.map +1 -0
- package/_cjs/gasTokenAddresses.js +2 -1
- package/_cjs/gasTokenAddresses.js.map +1 -1
- package/_cjs/index.js.map +1 -1
- package/_cjs/providers/KernelEIP1193Provider.js.map +1 -1
- package/_cjs/types/kernel.js.map +1 -1
- package/_cjs/utils.js +27 -7
- package/_cjs/utils.js.map +1 -1
- package/_esm/accounts/index.js.map +1 -1
- package/_esm/accounts/kernel/createKernelAccount.js +181 -217
- package/_esm/accounts/kernel/createKernelAccount.js.map +1 -1
- package/_esm/accounts/kernel/utils/account/ep0_6/encodeCallData.js +13 -9
- package/_esm/accounts/kernel/utils/account/ep0_6/encodeCallData.js.map +1 -1
- package/_esm/accounts/kernel/utils/account/ep0_6/encodeDeployCallData.js.map +1 -1
- package/_esm/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.js +18 -17
- package/_esm/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.js.map +1 -1
- package/_esm/accounts/kernel/utils/account/ep0_7/encodeCallData.js +12 -8
- package/_esm/accounts/kernel/utils/account/ep0_7/encodeCallData.js.map +1 -1
- package/_esm/accounts/kernel/utils/account/ep0_7/encodeDeployCallData.js.map +1 -1
- package/_esm/accounts/kernel/utils/common/accountMetadata.js.map +1 -1
- package/_esm/accounts/kernel/utils/common/getActionSelector.js +2 -2
- package/_esm/accounts/kernel/utils/common/getActionSelector.js.map +1 -1
- package/_esm/accounts/kernel/utils/ep0_6/encodeExecuteBatchCall.js +2 -2
- package/_esm/accounts/kernel/utils/ep0_6/encodeExecuteBatchCall.js.map +1 -1
- package/_esm/accounts/kernel/utils/ep0_6/encodeExecuteDelegateCall.js +1 -1
- package/_esm/accounts/kernel/utils/ep0_6/encodeExecuteDelegateCall.js.map +1 -1
- package/_esm/accounts/kernel/utils/ep0_6/encodeExecuteSingleCall.js +1 -1
- package/_esm/accounts/kernel/utils/ep0_6/encodeExecuteSingleCall.js.map +1 -1
- package/_esm/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.js +2 -2
- package/_esm/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.js.map +1 -1
- package/_esm/accounts/kernel/utils/ep0_7/encodeExecuteCall.js +2 -2
- package/_esm/accounts/kernel/utils/ep0_7/encodeExecuteCall.js.map +1 -1
- package/_esm/accounts/kernel/utils/plugins/ep0_6/getEncodedPluginsData.js.map +1 -1
- package/_esm/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.js.map +1 -1
- package/_esm/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js.map +1 -1
- package/_esm/accounts/kernel/v1/createKernelAccountV1.js +91 -98
- package/_esm/accounts/kernel/v1/createKernelAccountV1.js.map +1 -1
- package/_esm/accounts/kernel/v2/createKernelAccountV0_2.js +105 -118
- package/_esm/accounts/kernel/v2/createKernelAccountV0_2.js.map +1 -1
- package/_esm/accounts/utils/getCustomNonceKeyFromString.js +2 -4
- package/_esm/accounts/utils/getCustomNonceKeyFromString.js.map +1 -1
- package/_esm/accounts/utils/index.js +0 -5
- package/_esm/accounts/utils/index.js.map +1 -1
- package/_esm/accounts/utils/multisend.js.map +1 -1
- package/_esm/accounts/utils/toKernelPluginManager.js +14 -16
- package/_esm/accounts/utils/toKernelPluginManager.js.map +1 -1
- package/_esm/actions/account-client/changeSudoValidator.js +23 -17
- package/_esm/actions/account-client/changeSudoValidator.js.map +1 -1
- package/_esm/actions/account-client/getKernelV3ModuleCurrentNonce.js +8 -6
- package/_esm/actions/account-client/getKernelV3ModuleCurrentNonce.js.map +1 -1
- package/_esm/actions/account-client/invalidateNonce.js +20 -15
- package/_esm/actions/account-client/invalidateNonce.js.map +1 -1
- package/_esm/actions/account-client/sendTransaction.js +85 -0
- package/_esm/actions/account-client/sendTransaction.js.map +1 -0
- package/_esm/actions/account-client/signMessage.js +58 -0
- package/_esm/actions/account-client/signMessage.js.map +1 -0
- package/_esm/actions/account-client/signTypedData.js +127 -0
- package/_esm/actions/account-client/signTypedData.js.map +1 -0
- package/_esm/actions/account-client/signUserOperation.js +7 -5
- package/_esm/actions/account-client/signUserOperation.js.map +1 -1
- package/_esm/actions/account-client/uninstallPlugin.js +10 -9
- package/_esm/actions/account-client/uninstallPlugin.js.map +1 -1
- package/_esm/actions/account-client/writeContract.js +18 -0
- package/_esm/actions/account-client/writeContract.js.map +1 -0
- package/_esm/actions/index.js +6 -1
- package/_esm/actions/index.js.map +1 -1
- package/_esm/actions/paymaster/estimateGasInERC20.js +3 -3
- package/_esm/actions/paymaster/estimateGasInERC20.js.map +1 -1
- package/_esm/actions/paymaster/sponsorUserOperation.js +3 -5
- package/_esm/actions/paymaster/sponsorUserOperation.js.map +1 -1
- package/_esm/actions/public/getAccountNonce.js +61 -0
- package/_esm/actions/public/getAccountNonce.js.map +1 -0
- package/_esm/actions/public/getSenderAddress.js +191 -0
- package/_esm/actions/public/getSenderAddress.js.map +1 -0
- package/_esm/actions/public/index.js +3 -0
- package/_esm/actions/public/index.js.map +1 -0
- package/_esm/clients/decorators/kernel.js +19 -28
- package/_esm/clients/decorators/kernel.js.map +1 -1
- package/_esm/clients/fallbackKernelAccountClient.js.map +1 -1
- package/_esm/clients/kernelAccountClient.js +28 -46
- package/_esm/clients/kernelAccountClient.js.map +1 -1
- package/_esm/clients/paymasterClient.js +8 -19
- package/_esm/clients/paymasterClient.js.map +1 -1
- package/_esm/errors/index.js +14 -0
- package/_esm/errors/index.js.map +1 -0
- package/_esm/gasTokenAddresses.js +2 -1
- package/_esm/gasTokenAddresses.js.map +1 -1
- package/_esm/index.js.map +1 -1
- package/_esm/providers/KernelEIP1193Provider.js.map +1 -1
- package/_esm/types/kernel.js.map +1 -1
- package/_esm/utils.js +29 -7
- package/_esm/utils.js.map +1 -1
- package/_types/accounts/index.d.ts +2 -2
- package/_types/accounts/index.d.ts.map +1 -1
- package/_types/accounts/kernel/createKernelAccount.d.ts +21 -18
- package/_types/accounts/kernel/createKernelAccount.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/account/ep0_6/encodeCallData.d.ts +8 -3
- package/_types/accounts/kernel/utils/account/ep0_6/encodeCallData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/account/ep0_6/encodeDeployCallData.d.ts +3 -2
- package/_types/accounts/kernel/utils/account/ep0_6/encodeDeployCallData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.d.ts +0 -1
- package/_types/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/account/ep0_7/encodeCallData.d.ts +8 -3
- package/_types/accounts/kernel/utils/account/ep0_7/encodeCallData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/account/ep0_7/encodeDeployCallData.d.ts +3 -2
- package/_types/accounts/kernel/utils/account/ep0_7/encodeDeployCallData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/common/accountMetadata.d.ts +2 -2
- package/_types/accounts/kernel/utils/common/accountMetadata.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/common/getActionSelector.d.ts +1 -1
- package/_types/accounts/kernel/utils/common/getActionSelector.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/ep0_6/encodeExecuteBatchCall.d.ts +1 -1
- package/_types/accounts/kernel/utils/ep0_6/encodeExecuteBatchCall.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.d.ts +1 -1
- package/_types/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/plugins/ep0_6/getEncodedPluginsData.d.ts +2 -3
- package/_types/accounts/kernel/utils/plugins/ep0_6/getEncodedPluginsData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.d.ts +4 -5
- package/_types/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.d.ts +2 -3
- package/_types/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/types.d.ts +2 -2
- package/_types/accounts/kernel/utils/types.d.ts.map +1 -1
- package/_types/accounts/kernel/v1/createKernelAccountV1.d.ts +18 -9
- package/_types/accounts/kernel/v1/createKernelAccountV1.d.ts.map +1 -1
- package/_types/accounts/kernel/v2/createKernelAccountV0_2.d.ts +9 -7
- package/_types/accounts/kernel/v2/createKernelAccountV0_2.d.ts.map +1 -1
- package/_types/accounts/utils/getCustomNonceKeyFromString.d.ts +2 -2
- package/_types/accounts/utils/getCustomNonceKeyFromString.d.ts.map +1 -1
- package/_types/accounts/utils/index.d.ts +0 -2
- package/_types/accounts/utils/index.d.ts.map +1 -1
- package/_types/accounts/utils/multisend.d.ts +2 -2
- package/_types/accounts/utils/multisend.d.ts.map +1 -1
- package/_types/accounts/utils/toKernelPluginManager.d.ts +4 -4
- package/_types/accounts/utils/toKernelPluginManager.d.ts.map +1 -1
- package/_types/actions/account-client/changeSudoValidator.d.ts +5 -11
- package/_types/actions/account-client/changeSudoValidator.d.ts.map +1 -1
- package/_types/actions/account-client/getKernelV3ModuleCurrentNonce.d.ts +2 -5
- package/_types/actions/account-client/getKernelV3ModuleCurrentNonce.d.ts.map +1 -1
- package/_types/actions/account-client/invalidateNonce.d.ts +4 -6
- package/_types/actions/account-client/invalidateNonce.d.ts.map +1 -1
- package/_types/actions/account-client/sendTransaction.d.ts +50 -0
- package/_types/actions/account-client/sendTransaction.d.ts.map +1 -0
- package/_types/actions/account-client/signMessage.d.ts +50 -0
- package/_types/actions/account-client/signMessage.d.ts.map +1 -0
- package/_types/actions/account-client/signTypedData.d.ts +104 -0
- package/_types/actions/account-client/signTypedData.d.ts.map +1 -0
- package/_types/actions/account-client/signUserOperation.d.ts +4 -6
- package/_types/actions/account-client/signUserOperation.d.ts.map +1 -1
- package/_types/actions/account-client/uninstallPlugin.d.ts +5 -7
- package/_types/actions/account-client/uninstallPlugin.d.ts.map +1 -1
- package/_types/actions/account-client/writeContract.d.ts +4 -0
- package/_types/actions/account-client/writeContract.d.ts.map +1 -0
- package/_types/actions/index.d.ts +6 -1
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/paymaster/estimateGasInERC20.d.ts +1305 -4
- package/_types/actions/paymaster/estimateGasInERC20.d.ts.map +1 -1
- package/_types/actions/paymaster/sponsorUserOperation.d.ts +1314 -10
- package/_types/actions/paymaster/sponsorUserOperation.d.ts.map +1 -1
- package/_types/actions/public/getAccountNonce.d.ts +34 -0
- package/_types/actions/public/getAccountNonce.d.ts.map +1 -0
- package/_types/actions/public/getSenderAddress.d.ts +46 -0
- package/_types/actions/public/getSenderAddress.d.ts.map +1 -0
- package/_types/actions/public/index.d.ts +3 -0
- package/_types/actions/public/index.d.ts.map +1 -0
- package/_types/clients/decorators/kernel.d.ts +774 -20
- package/_types/clients/decorators/kernel.d.ts.map +1 -1
- package/_types/clients/fallbackKernelAccountClient.d.ts +255 -4
- package/_types/clients/fallbackKernelAccountClient.d.ts.map +1 -1
- package/_types/clients/kernelAccountClient.d.ts +34 -36
- package/_types/clients/kernelAccountClient.d.ts.map +1 -1
- package/_types/clients/paymasterClient.d.ts +10 -24
- package/_types/clients/paymasterClient.d.ts.map +1 -1
- package/_types/errors/index.d.ts +7 -0
- package/_types/errors/index.d.ts.map +1 -0
- package/_types/gasTokenAddresses.d.ts +1 -1
- package/_types/gasTokenAddresses.d.ts.map +1 -1
- package/_types/index.d.ts +1 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/providers/KernelEIP1193Provider.d.ts +3 -4
- package/_types/providers/KernelEIP1193Provider.d.ts.map +1 -1
- package/_types/types/index.d.ts +1 -0
- package/_types/types/index.d.ts.map +1 -1
- package/_types/types/kernel.d.ts +25 -27
- package/_types/types/kernel.d.ts.map +1 -1
- package/_types/utils.d.ts +1310 -4
- package/_types/utils.d.ts.map +1 -1
- package/accounts/index.ts +5 -2
- package/accounts/kernel/createKernelAccount.ts +312 -357
- package/accounts/kernel/utils/account/ep0_6/encodeCallData.ts +22 -12
- package/accounts/kernel/utils/account/ep0_6/encodeDeployCallData.ts +6 -3
- package/accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.ts +22 -19
- package/accounts/kernel/utils/account/ep0_7/encodeCallData.ts +21 -11
- package/accounts/kernel/utils/account/ep0_7/encodeDeployCallData.ts +6 -3
- package/accounts/kernel/utils/common/accountMetadata.ts +2 -7
- package/accounts/kernel/utils/common/getActionSelector.ts +3 -3
- package/accounts/kernel/utils/ep0_6/encodeExecuteBatchCall.ts +3 -3
- package/accounts/kernel/utils/ep0_6/encodeExecuteDelegateCall.ts +1 -1
- package/accounts/kernel/utils/ep0_6/encodeExecuteSingleCall.ts +1 -1
- package/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.ts +3 -3
- package/accounts/kernel/utils/ep0_7/encodeExecuteCall.ts +2 -2
- package/accounts/kernel/utils/plugins/ep0_6/getEncodedPluginsData.ts +2 -8
- package/accounts/kernel/utils/plugins/ep0_6/getPluginsEnableTypedData.ts +4 -10
- package/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.ts +2 -8
- package/accounts/kernel/utils/types.ts +2 -2
- package/accounts/kernel/v1/createKernelAccountV1.ts +147 -174
- package/accounts/kernel/v2/createKernelAccountV0_2.ts +135 -179
- package/accounts/utils/getCustomNonceKeyFromString.ts +3 -6
- package/accounts/utils/index.ts +0 -9
- package/accounts/utils/multisend.ts +5 -2
- package/accounts/utils/toKernelPluginManager.ts +23 -27
- package/actions/account-client/changeSudoValidator.ts +61 -85
- package/actions/account-client/getKernelV3ModuleCurrentNonce.ts +12 -51
- package/actions/account-client/invalidateNonce.ts +38 -67
- package/actions/account-client/sendTransaction.ts +134 -0
- package/actions/account-client/signMessage.ts +75 -0
- package/actions/account-client/signTypedData.ts +159 -0
- package/actions/account-client/signUserOperation.ts +31 -63
- package/actions/account-client/uninstallPlugin.ts +35 -54
- package/actions/account-client/writeContract.ts +72 -0
- package/actions/index.ts +15 -6
- package/actions/paymaster/estimateGasInERC20.ts +12 -8
- package/actions/paymaster/sponsorUserOperation.ts +52 -50
- package/actions/public/getAccountNonce.ts +77 -0
- package/actions/public/getSenderAddress.ts +276 -0
- package/actions/public/index.ts +9 -0
- package/clients/decorators/kernel.ts +363 -159
- package/clients/fallbackKernelAccountClient.ts +9 -11
- package/clients/kernelAccountClient.ts +142 -104
- package/clients/paymasterClient.ts +69 -43
- package/errors/index.ts +17 -0
- package/gasTokenAddresses.ts +3 -2
- package/index.ts +5 -2
- package/package.json +2 -3
- package/providers/KernelEIP1193Provider.ts +4 -7
- package/types/index.ts +2 -0
- package/types/kernel.ts +64 -63
- package/utils.ts +41 -13
- package/_cjs/actions/paymaster/sponsorUserOperationEip7677.js +0 -59
- package/_cjs/actions/paymaster/sponsorUserOperationEip7677.js.map +0 -1
- package/_esm/actions/paymaster/sponsorUserOperationEip7677.js +0 -58
- package/_esm/actions/paymaster/sponsorUserOperationEip7677.js.map +0 -1
- package/_types/actions/paymaster/sponsorUserOperationEip7677.d.ts +0 -16
- package/_types/actions/paymaster/sponsorUserOperationEip7677.d.ts.map +0 -1
- package/actions/paymaster/sponsorUserOperationEip7677.ts +0 -152
|
@@ -1,30 +1,40 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { EntryPointVersion } from "viem/account-abstraction"
|
|
2
|
+
import type { CallType } from "../../../../../types/kernel.js"
|
|
3
|
+
import type { KernelSmartAccountImplementation } from "../../../createKernelAccount.js"
|
|
3
4
|
import { encodeExecuteBatchCall } from "../../ep0_6/encodeExecuteBatchCall.js"
|
|
4
5
|
import { encodeExecuteDelegateCall } from "../../ep0_6/encodeExecuteDelegateCall.js"
|
|
5
6
|
import { encodeExecuteSingleCall } from "../../ep0_6/encodeExecuteSingleCall.js"
|
|
6
7
|
|
|
7
8
|
export const encodeCallData = async <
|
|
8
|
-
|
|
9
|
+
entryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
9
10
|
>(
|
|
10
|
-
|
|
11
|
+
calls: Parameters<
|
|
12
|
+
KernelSmartAccountImplementation<entryPointVersion>["encodeCalls"]
|
|
13
|
+
>[0],
|
|
14
|
+
callType?: CallType | undefined
|
|
11
15
|
) => {
|
|
12
|
-
if (
|
|
13
|
-
if (
|
|
16
|
+
if (calls.length > 1) {
|
|
17
|
+
if (callType === "delegatecall") {
|
|
14
18
|
throw new Error("Cannot batch delegatecall")
|
|
15
19
|
}
|
|
16
|
-
return encodeExecuteBatchCall(
|
|
20
|
+
return encodeExecuteBatchCall(calls)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const call = calls.length === 0 ? undefined : calls[0]
|
|
24
|
+
|
|
25
|
+
if (!call) {
|
|
26
|
+
throw new Error("No calls to encode")
|
|
17
27
|
}
|
|
18
28
|
|
|
19
29
|
// Default to `call`
|
|
20
|
-
if (!
|
|
21
|
-
return encodeExecuteSingleCall(
|
|
30
|
+
if (!callType || callType === "call") {
|
|
31
|
+
return encodeExecuteSingleCall(call)
|
|
22
32
|
}
|
|
23
33
|
|
|
24
|
-
if (
|
|
34
|
+
if (callType === "delegatecall") {
|
|
25
35
|
return encodeExecuteDelegateCall({
|
|
26
|
-
to:
|
|
27
|
-
data:
|
|
36
|
+
to: call.to,
|
|
37
|
+
data: call.data
|
|
28
38
|
})
|
|
29
39
|
}
|
|
30
40
|
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import type { toSmartAccount } from "permissionless/accounts"
|
|
2
1
|
import { encodeDeployData } from "viem"
|
|
2
|
+
import type { EntryPointVersion } from "viem/account-abstraction"
|
|
3
3
|
import { safeCreateCallAddress } from "../../../../../constants.js"
|
|
4
|
+
import type { KernelSmartAccountImplementation } from "../../../createKernelAccount.js"
|
|
4
5
|
import { encodeSafeCreateCall } from "../../common/encodeSafeCreateCall.js"
|
|
5
6
|
import { encodeExecuteDelegateCall } from "../../ep0_6/encodeExecuteDelegateCall.js"
|
|
6
7
|
import type { DelegateCallArgs } from "../../types.js"
|
|
7
8
|
|
|
8
|
-
export const encodeDeployCallData =
|
|
9
|
+
export const encodeDeployCallData = <
|
|
10
|
+
entryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
11
|
+
>(
|
|
9
12
|
tx: Parameters<
|
|
10
|
-
|
|
13
|
+
KernelSmartAccountImplementation<entryPointVersion>["encodeDeployCallData"]
|
|
11
14
|
>[0]
|
|
12
15
|
) => {
|
|
13
16
|
const deployCalldataArgs: DelegateCallArgs = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ENTRYPOINT_ADDRESS_V06_TYPE } from "permissionless/types/entrypoint"
|
|
2
1
|
import { type Address, type Hex, encodeFunctionData } from "viem"
|
|
3
2
|
import type { PluginInstallData } from "../../../../../types/kernel.js"
|
|
4
3
|
import { KernelAccountAbi } from "../../../abi/KernelAccountAbi.js"
|
|
@@ -14,22 +13,26 @@ export const encodeModuleInstallCallData = async ({
|
|
|
14
13
|
validator
|
|
15
14
|
}: {
|
|
16
15
|
accountAddress: Address
|
|
17
|
-
} & PluginInstallData<
|
|
18
|
-
return encodeCallData(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
16
|
+
} & PluginInstallData<"0.6">): Promise<Hex> => {
|
|
17
|
+
return encodeCallData(
|
|
18
|
+
[
|
|
19
|
+
{
|
|
20
|
+
to: accountAddress,
|
|
21
|
+
value: 0n,
|
|
22
|
+
data: encodeFunctionData({
|
|
23
|
+
abi: KernelAccountAbi,
|
|
24
|
+
functionName: "setExecution",
|
|
25
|
+
args: [
|
|
26
|
+
selector,
|
|
27
|
+
executor,
|
|
28
|
+
validator,
|
|
29
|
+
validUntil,
|
|
30
|
+
validAfter,
|
|
31
|
+
enableData
|
|
32
|
+
]
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"call"
|
|
37
|
+
)
|
|
35
38
|
}
|
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EntryPointVersion } from "viem/account-abstraction"
|
|
2
2
|
import { EXEC_TYPE } from "../../../../../constants.js"
|
|
3
|
-
import type {
|
|
3
|
+
import type { CallType } from "../../../../../types/kernel.js"
|
|
4
|
+
import type { KernelSmartAccountImplementation } from "../../../createKernelAccount.js"
|
|
4
5
|
import { encodeExecuteBatchCall } from "../../ep0_7/encodeExecuteBatchCall.js"
|
|
5
6
|
import { encodeExecuteDelegateCall } from "../../ep0_7/encodeExecuteDelegateCall.js"
|
|
6
7
|
import { encodeExecuteSingleCall } from "../../ep0_7/encodeExecuteSingleCall.js"
|
|
7
8
|
|
|
8
9
|
export const encodeCallData = async <
|
|
9
|
-
|
|
10
|
+
entryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
10
11
|
>(
|
|
11
|
-
|
|
12
|
+
calls: Parameters<
|
|
13
|
+
KernelSmartAccountImplementation<entryPointVersion>["encodeCalls"]
|
|
14
|
+
>[0],
|
|
15
|
+
callType?: CallType | undefined,
|
|
12
16
|
includeHooks?: boolean
|
|
13
17
|
) => {
|
|
14
|
-
if (
|
|
15
|
-
if (
|
|
18
|
+
if (calls.length > 1) {
|
|
19
|
+
if (callType === "delegatecall") {
|
|
16
20
|
throw new Error("Cannot batch delegatecall")
|
|
17
21
|
}
|
|
18
22
|
// Encode a batched call
|
|
19
23
|
return encodeExecuteBatchCall(
|
|
20
|
-
|
|
24
|
+
calls,
|
|
21
25
|
{
|
|
22
26
|
execType: EXEC_TYPE.DEFAULT
|
|
23
27
|
},
|
|
@@ -25,10 +29,16 @@ export const encodeCallData = async <
|
|
|
25
29
|
)
|
|
26
30
|
}
|
|
27
31
|
|
|
32
|
+
const call = calls.length === 0 ? undefined : calls[0]
|
|
33
|
+
|
|
34
|
+
if (!call) {
|
|
35
|
+
throw new Error("No calls to encode")
|
|
36
|
+
}
|
|
37
|
+
|
|
28
38
|
// Default to `call`
|
|
29
|
-
if (!
|
|
39
|
+
if (!callType || callType === "call") {
|
|
30
40
|
return encodeExecuteSingleCall(
|
|
31
|
-
|
|
41
|
+
call,
|
|
32
42
|
{
|
|
33
43
|
execType: EXEC_TYPE.DEFAULT
|
|
34
44
|
},
|
|
@@ -36,9 +46,9 @@ export const encodeCallData = async <
|
|
|
36
46
|
)
|
|
37
47
|
}
|
|
38
48
|
|
|
39
|
-
if (
|
|
49
|
+
if (callType === "delegatecall") {
|
|
40
50
|
return encodeExecuteDelegateCall(
|
|
41
|
-
{ to:
|
|
51
|
+
{ to: call.to, data: call.data },
|
|
42
52
|
{
|
|
43
53
|
execType: EXEC_TYPE.DEFAULT
|
|
44
54
|
},
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import type { toSmartAccount } from "permissionless/accounts"
|
|
2
1
|
import { encodeDeployData } from "viem"
|
|
2
|
+
import type { EntryPointVersion } from "viem/account-abstraction"
|
|
3
3
|
import { EXEC_TYPE, safeCreateCallAddress } from "../../../../../constants.js"
|
|
4
|
+
import type { KernelSmartAccountImplementation } from "../../../createKernelAccount.js"
|
|
4
5
|
import { encodeSafeCreateCall } from "../../common/encodeSafeCreateCall.js"
|
|
5
6
|
import { encodeExecuteDelegateCall } from "../../ep0_7/encodeExecuteDelegateCall.js"
|
|
6
7
|
import type { DelegateCallArgs } from "../../types.js"
|
|
7
8
|
|
|
8
|
-
export const encodeDeployCallData =
|
|
9
|
+
export const encodeDeployCallData = <
|
|
10
|
+
entryPointVersion extends EntryPointVersion = EntryPointVersion
|
|
11
|
+
>(
|
|
9
12
|
tx: Parameters<
|
|
10
|
-
|
|
13
|
+
KernelSmartAccountImplementation<entryPointVersion>["encodeDeployCallData"]
|
|
11
14
|
>[0]
|
|
12
15
|
) => {
|
|
13
16
|
const deployCalldataArgs: DelegateCallArgs = {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type Address,
|
|
3
|
-
type Chain,
|
|
4
3
|
type Client,
|
|
5
|
-
type Transport,
|
|
6
4
|
decodeFunctionResult,
|
|
7
5
|
encodeFunctionData,
|
|
8
6
|
publicActions
|
|
@@ -16,11 +14,8 @@ export type AccountMetadata = {
|
|
|
16
14
|
version: string
|
|
17
15
|
chainId: bigint
|
|
18
16
|
}
|
|
19
|
-
export const accountMetadata = async
|
|
20
|
-
|
|
21
|
-
TChain extends Chain | undefined = Chain | undefined
|
|
22
|
-
>(
|
|
23
|
-
client: Client<TTransport, TChain, undefined>,
|
|
17
|
+
export const accountMetadata = async (
|
|
18
|
+
client: Client,
|
|
24
19
|
accountAddress: Address,
|
|
25
20
|
kernelVersion: KERNEL_VERSION_TYPE,
|
|
26
21
|
chainId?: number
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { EntryPointVersion } from "permissionless/types/entrypoint"
|
|
2
1
|
import { type Hex, getAbiItem, toFunctionSelector } from "viem"
|
|
2
|
+
import type { EntryPointVersion } from "viem/account-abstraction"
|
|
3
3
|
import { KernelAccountAbi } from "../../abi/KernelAccountAbi.js"
|
|
4
4
|
import { KernelV3AccountAbi } from "../../abi/kernel_v_3_0_0/KernelAccountAbi.js"
|
|
5
5
|
|
|
6
6
|
export const getActionSelector = (
|
|
7
7
|
entryPointVersion: EntryPointVersion
|
|
8
8
|
): Hex => {
|
|
9
|
-
if (entryPointVersion === "
|
|
9
|
+
if (entryPointVersion === "0.6") {
|
|
10
10
|
return toFunctionSelector(
|
|
11
11
|
getAbiItem({ abi: KernelAccountAbi, name: "execute" })
|
|
12
12
|
)
|
|
13
|
-
} else if (entryPointVersion === "
|
|
13
|
+
} else if (entryPointVersion === "0.7") {
|
|
14
14
|
return toFunctionSelector(
|
|
15
15
|
getAbiItem({ abi: KernelV3AccountAbi, name: "execute" })
|
|
16
16
|
)
|
|
@@ -2,7 +2,7 @@ import { encodeFunctionData } from "viem"
|
|
|
2
2
|
import { KernelExecuteAbi } from "../../abi/KernelAccountAbi.js"
|
|
3
3
|
import type { CallArgs } from "../types.js"
|
|
4
4
|
|
|
5
|
-
export const encodeExecuteBatchCall = (args: CallArgs[]) => {
|
|
5
|
+
export const encodeExecuteBatchCall = (args: readonly CallArgs[]) => {
|
|
6
6
|
return encodeFunctionData({
|
|
7
7
|
abi: KernelExecuteAbi,
|
|
8
8
|
functionName: "executeBatch",
|
|
@@ -10,8 +10,8 @@ export const encodeExecuteBatchCall = (args: CallArgs[]) => {
|
|
|
10
10
|
args.map((arg) => {
|
|
11
11
|
return {
|
|
12
12
|
to: arg.to,
|
|
13
|
-
value: arg.value,
|
|
14
|
-
data: arg.data
|
|
13
|
+
value: arg.value || 0n,
|
|
14
|
+
data: arg.data || "0x"
|
|
15
15
|
}
|
|
16
16
|
})
|
|
17
17
|
]
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./encodeExecuteCall.js"
|
|
8
8
|
|
|
9
9
|
export const encodeExecuteBatchCall = (
|
|
10
|
-
args: CallArgs[],
|
|
10
|
+
args: readonly CallArgs[],
|
|
11
11
|
options: Omit<EncodeExecuteOptions, "callType">,
|
|
12
12
|
includeHooks?: boolean
|
|
13
13
|
) => {
|
|
@@ -36,8 +36,8 @@ export const encodeExecuteBatchCall = (
|
|
|
36
36
|
args.map((arg) => {
|
|
37
37
|
return {
|
|
38
38
|
target: arg.to,
|
|
39
|
-
value: arg.value,
|
|
40
|
-
callData: arg.data
|
|
39
|
+
value: arg.value || 0n,
|
|
40
|
+
callData: arg.data || "0x"
|
|
41
41
|
}
|
|
42
42
|
})
|
|
43
43
|
]
|
|
@@ -33,9 +33,9 @@ export const encodeExecuteCall = <TOptions extends EncodeExecuteOptions>(
|
|
|
33
33
|
calldata = concatHex([
|
|
34
34
|
args.to,
|
|
35
35
|
options.callType !== CALL_TYPE.DELEGATE_CALL
|
|
36
|
-
? toHex(args.value, { size: 32 })
|
|
36
|
+
? toHex(args.value || 0n, { size: 32 })
|
|
37
37
|
: "0x", // No value if delegate call
|
|
38
|
-
args.data
|
|
38
|
+
args.data || "0x"
|
|
39
39
|
])
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ENTRYPOINT_ADDRESS_V06_TYPE,
|
|
3
|
-
EntryPoint
|
|
4
|
-
} from "permissionless/types/entrypoint"
|
|
5
1
|
import { type Address, type Hex, concat, pad, toHex } from "viem"
|
|
6
2
|
import {
|
|
7
3
|
type PluginValidityData,
|
|
@@ -9,9 +5,7 @@ import {
|
|
|
9
5
|
} from "../../../../../types/index.js"
|
|
10
6
|
import type { Kernel2_0_plugins } from "./getPluginsEnableTypedData.js"
|
|
11
7
|
|
|
12
|
-
export const getEncodedPluginsData = async
|
|
13
|
-
entryPoint extends EntryPoint = ENTRYPOINT_ADDRESS_V06_TYPE
|
|
14
|
-
>({
|
|
8
|
+
export const getEncodedPluginsData = async ({
|
|
15
9
|
accountAddress,
|
|
16
10
|
enableSignature,
|
|
17
11
|
action,
|
|
@@ -21,7 +15,7 @@ export const getEncodedPluginsData = async <
|
|
|
21
15
|
}: {
|
|
22
16
|
accountAddress: Address
|
|
23
17
|
enableSignature: Hex
|
|
24
|
-
} & Kernel2_0_plugins
|
|
18
|
+
} & Kernel2_0_plugins &
|
|
25
19
|
PluginValidityData) => {
|
|
26
20
|
const enableData = await validator.getEnableData(accountAddress)
|
|
27
21
|
const enableDataLength = enableData.length / 2 - 1
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ENTRYPOINT_ADDRESS_V06_TYPE,
|
|
3
|
-
EntryPoint
|
|
4
|
-
} from "permissionless/types/entrypoint"
|
|
5
1
|
import {
|
|
6
2
|
type Address,
|
|
7
3
|
type CustomSource,
|
|
@@ -16,13 +12,11 @@ import type {
|
|
|
16
12
|
PluginValidityData
|
|
17
13
|
} from "../../../../../types/index.js"
|
|
18
14
|
|
|
19
|
-
export type Kernel2_0_plugins
|
|
20
|
-
validator: KernelValidator
|
|
15
|
+
export type Kernel2_0_plugins = {
|
|
16
|
+
validator: KernelValidator
|
|
21
17
|
action: Action
|
|
22
18
|
}
|
|
23
|
-
export const getPluginsEnableTypedData = async
|
|
24
|
-
entryPoint extends EntryPoint = ENTRYPOINT_ADDRESS_V06_TYPE
|
|
25
|
-
>({
|
|
19
|
+
export const getPluginsEnableTypedData = async ({
|
|
26
20
|
accountAddress,
|
|
27
21
|
chainId,
|
|
28
22
|
kernelVersion,
|
|
@@ -34,7 +28,7 @@ export const getPluginsEnableTypedData = async <
|
|
|
34
28
|
accountAddress: Address
|
|
35
29
|
chainId: number
|
|
36
30
|
kernelVersion: string
|
|
37
|
-
} & Kernel2_0_plugins
|
|
31
|
+
} & Kernel2_0_plugins &
|
|
38
32
|
PluginValidityData): Promise<
|
|
39
33
|
Parameters<CustomSource["signTypedData"]>[0]
|
|
40
34
|
> => {
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ENTRYPOINT_ADDRESS_V07_TYPE,
|
|
3
|
-
EntryPoint
|
|
4
|
-
} from "permissionless/types/entrypoint"
|
|
5
1
|
import {
|
|
6
2
|
type Address,
|
|
7
3
|
type CustomSource,
|
|
@@ -15,9 +11,7 @@ import { CALL_TYPE, VALIDATOR_TYPE } from "../../../../../constants.js"
|
|
|
15
11
|
import type { KernelValidatorHook } from "../../../../../types/kernel.js"
|
|
16
12
|
import type { Kernel2_0_plugins } from "../ep0_6/getPluginsEnableTypedData.js"
|
|
17
13
|
|
|
18
|
-
export const getPluginsEnableTypedData = async
|
|
19
|
-
entryPoint extends EntryPoint = ENTRYPOINT_ADDRESS_V07_TYPE
|
|
20
|
-
>({
|
|
14
|
+
export const getPluginsEnableTypedData = async ({
|
|
21
15
|
accountAddress,
|
|
22
16
|
chainId,
|
|
23
17
|
kernelVersion,
|
|
@@ -31,7 +25,7 @@ export const getPluginsEnableTypedData = async <
|
|
|
31
25
|
kernelVersion: string
|
|
32
26
|
validatorNonce: number
|
|
33
27
|
hook?: KernelValidatorHook
|
|
34
|
-
} & Kernel2_0_plugins
|
|
28
|
+
} & Kernel2_0_plugins): Promise<
|
|
35
29
|
Parameters<CustomSource["signTypedData"]>[0]
|
|
36
30
|
> => {
|
|
37
31
|
return {
|