@zerodev/sdk 5.3.26 → 5.4.0-beta.1
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 +173 -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 +83 -94
- package/_cjs/accounts/kernel/v1/createKernelAccountV1.js.map +1 -1
- package/_cjs/accounts/kernel/v2/createKernelAccountV0_2.js +106 -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 +15 -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 +10 -0
- package/_cjs/actions/public/index.js.map +1 -0
- package/_cjs/actions/public/isSmartAccountDeployed.js +14 -0
- package/_cjs/actions/public/isSmartAccountDeployed.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 +26 -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 +1 -0
- package/_cjs/index.js.map +1 -1
- package/_cjs/providers/KernelEIP1193Provider.js.map +1 -1
- package/_cjs/types/index.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 +183 -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 +93 -98
- package/_esm/accounts/kernel/v1/createKernelAccountV1.js.map +1 -1
- package/_esm/accounts/kernel/v2/createKernelAccountV0_2.js +107 -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 +7 -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 +4 -0
- package/_esm/actions/public/index.js.map +1 -0
- package/_esm/actions/public/isSmartAccountDeployed.js +10 -0
- package/_esm/actions/public/isSmartAccountDeployed.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 +21 -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 +1 -0
- package/_esm/index.js.map +1 -1
- package/_esm/providers/KernelEIP1193Provider.js.map +1 -1
- package/_esm/types/index.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 +10 -8
- 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 +7 -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 +4 -0
- package/_types/actions/public/index.d.ts.map +1 -0
- package/_types/actions/public/isSmartAccountDeployed.d.ts +3 -0
- package/_types/actions/public/isSmartAccountDeployed.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 +10 -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 +2 -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 +2 -1
- 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 +315 -359
- 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 +151 -176
- package/accounts/kernel/v2/createKernelAccountV0_2.ts +141 -196
- 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 -56
- package/actions/account-client/writeContract.ts +72 -0
- package/actions/index.ts +16 -5
- 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 +10 -0
- package/actions/public/isSmartAccountDeployed.ts +18 -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 +25 -0
- package/gasTokenAddresses.ts +3 -2
- package/index.ts +6 -2
- package/package.json +11 -34
- package/providers/KernelEIP1193Provider.ts +4 -7
- package/types/index.ts +4 -1
- 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
package/_types/types/kernel.d.ts
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type { UserOperation, UserOperationWithBigIntAsHex } from "permissionless/types/userOperation";
|
|
4
|
-
import type { Address, CustomSource, Hex, LocalAccount } from "viem";
|
|
5
|
-
import type { PartialBy } from "viem/types/utils";
|
|
1
|
+
import type { Address, CustomSource, Hex, LocalAccount, PartialBy } from "viem";
|
|
2
|
+
import type { EntryPointVersion, UserOperation, entryPoint06Abi, entryPoint07Abi } from "viem/account-abstraction";
|
|
6
3
|
import type { VALIDATOR_TYPE } from "../constants.js";
|
|
7
|
-
export type ZeroDevPaymasterRpcSchema<
|
|
4
|
+
export type ZeroDevPaymasterRpcSchema<entryPointVersion extends EntryPointVersion> = [
|
|
8
5
|
{
|
|
9
6
|
Method: "zd_sponsorUserOperation";
|
|
10
7
|
Parameters: [
|
|
11
8
|
{
|
|
12
9
|
chainId: number;
|
|
13
|
-
userOp:
|
|
10
|
+
userOp: entryPointVersion extends "0.6" ? PartialBy<UserOperation<"0.6">, "callGasLimit" | "preVerificationGas" | "verificationGasLimit"> : PartialBy<UserOperation<"0.7">, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "paymasterVerificationGasLimit" | "paymasterPostOpGasLimit">;
|
|
14
11
|
entryPointAddress: Address;
|
|
15
12
|
gasTokenData?: {
|
|
16
13
|
tokenAddress: Hex;
|
|
@@ -20,7 +17,7 @@ export type ZeroDevPaymasterRpcSchema<entryPoint extends EntryPoint> = [
|
|
|
20
17
|
shouldConsume?: boolean;
|
|
21
18
|
}
|
|
22
19
|
];
|
|
23
|
-
ReturnType:
|
|
20
|
+
ReturnType: entryPointVersion extends "0.6" ? {
|
|
24
21
|
paymasterAndData: Hex;
|
|
25
22
|
preVerificationGas: Hex;
|
|
26
23
|
verificationGasLimit: Hex;
|
|
@@ -59,7 +56,7 @@ export type ZeroDevPaymasterRpcSchema<entryPoint extends EntryPoint> = [
|
|
|
59
56
|
Parameters: [
|
|
60
57
|
{
|
|
61
58
|
chainId: number;
|
|
62
|
-
userOp:
|
|
59
|
+
userOp: UserOperation<"0.6">;
|
|
63
60
|
entryPointAddress: Address;
|
|
64
61
|
tokenAddress: Address;
|
|
65
62
|
}
|
|
@@ -92,12 +89,14 @@ export type ZeroDevAccountClientRpcSchema = [
|
|
|
92
89
|
}
|
|
93
90
|
];
|
|
94
91
|
export type ValidatorType = Extract<keyof typeof VALIDATOR_TYPE, "PERMISSION" | "SECONDARY">;
|
|
95
|
-
export type KernelValidator<
|
|
92
|
+
export type KernelValidator<Name extends string = string> = LocalAccount<Name> & {
|
|
96
93
|
validatorType: ValidatorType;
|
|
97
94
|
supportedKernelVersions: string;
|
|
98
95
|
getNonceKey: (accountAddress?: Address, customNonceKey?: bigint) => Promise<bigint>;
|
|
99
|
-
|
|
100
|
-
signUserOperation: (userOperation: UserOperation
|
|
96
|
+
getStubSignature(userOperation: UserOperation, pluginEnableSignature?: Hex): Promise<Hex>;
|
|
97
|
+
signUserOperation: (userOperation: UserOperation & {
|
|
98
|
+
chainId?: number | undefined;
|
|
99
|
+
}, pluginEnableSignature?: Hex) => Promise<Hex>;
|
|
101
100
|
getEnableData(accountAddress?: Address): Promise<Hex>;
|
|
102
101
|
isEnabled(accountAddress: Address, selector: Hex): Promise<boolean>;
|
|
103
102
|
getIdentifier: () => Hex;
|
|
@@ -112,9 +111,9 @@ export type ValidatorInitData = {
|
|
|
112
111
|
identifier: Hex;
|
|
113
112
|
initConfig?: Hex[];
|
|
114
113
|
};
|
|
115
|
-
export type KernelPluginManager<
|
|
116
|
-
sudoValidator?: KernelValidator
|
|
117
|
-
regularValidator?: KernelValidator
|
|
114
|
+
export type KernelPluginManager<entryPointVersion extends EntryPointVersion> = KernelValidator & {
|
|
115
|
+
sudoValidator?: KernelValidator;
|
|
116
|
+
regularValidator?: KernelValidator;
|
|
118
117
|
hook?: KernelValidatorHook;
|
|
119
118
|
getPluginEnableSignature(accountAddress: Address): Promise<Hex>;
|
|
120
119
|
getValidatorInitData(): Promise<ValidatorInitData>;
|
|
@@ -123,9 +122,9 @@ export type KernelPluginManager<entryPoint extends EntryPoint> = KernelValidator
|
|
|
123
122
|
getIdentifier(isSudo?: boolean): Hex;
|
|
124
123
|
encodeModuleInstallCallData: (accountAddress: Address) => Promise<Hex>;
|
|
125
124
|
getPluginsEnableTypedData: (accountAddress: Address) => Promise<Parameters<CustomSource["signTypedData"]>[0]>;
|
|
126
|
-
signUserOperationWithActiveValidator: (userOperation: UserOperation<
|
|
125
|
+
signUserOperationWithActiveValidator: (userOperation: UserOperation<entryPointVersion>) => Promise<Hex>;
|
|
127
126
|
};
|
|
128
|
-
export type PluginInstallData<
|
|
127
|
+
export type PluginInstallData<entryPointVersion extends EntryPointVersion> = entryPointVersion extends "0.6" ? {
|
|
129
128
|
selector: Hex;
|
|
130
129
|
executor: Address;
|
|
131
130
|
validator: Address;
|
|
@@ -133,14 +132,17 @@ export type PluginInstallData<entryPoint extends EntryPoint> = entryPoint extend
|
|
|
133
132
|
validAfter: number;
|
|
134
133
|
enableData: Hex;
|
|
135
134
|
} : never;
|
|
136
|
-
export type KernelPluginManagerParams<
|
|
137
|
-
sudo?: KernelValidator
|
|
138
|
-
regular?: KernelValidator
|
|
135
|
+
export type KernelPluginManagerParams<entryPointVersion extends EntryPointVersion> = {
|
|
136
|
+
sudo?: KernelValidator;
|
|
137
|
+
regular?: KernelValidator;
|
|
139
138
|
hook?: KernelValidatorHook;
|
|
140
139
|
pluginEnableSignature?: Hex;
|
|
141
140
|
validatorInitData?: ValidatorInitData;
|
|
142
141
|
action?: Action;
|
|
143
|
-
entryPoint:
|
|
142
|
+
entryPoint: {
|
|
143
|
+
address: Address;
|
|
144
|
+
version: entryPointVersion;
|
|
145
|
+
};
|
|
144
146
|
kernelVersion: KERNEL_VERSION_TYPE;
|
|
145
147
|
chainId?: number;
|
|
146
148
|
} & Partial<PluginValidityData>;
|
|
@@ -167,12 +169,8 @@ export type KernelEncodeCallDataArgs = {
|
|
|
167
169
|
value: bigint;
|
|
168
170
|
data: Hex;
|
|
169
171
|
callType: CallType | undefined;
|
|
170
|
-
} | {
|
|
171
|
-
to: Address;
|
|
172
|
-
value: bigint;
|
|
173
|
-
data: Hex;
|
|
174
|
-
callType: CallType | undefined;
|
|
175
172
|
}[];
|
|
173
|
+
export type GetEntryPointAbi<entryPointVersion extends EntryPointVersion> = entryPointVersion extends "0.6" ? typeof entryPoint06Abi : typeof entryPoint07Abi;
|
|
176
174
|
export type Execution = {
|
|
177
175
|
target: Address;
|
|
178
176
|
value: bigint;
|
|
@@ -181,5 +179,5 @@ export type Execution = {
|
|
|
181
179
|
export type KERNEL_V2_VERSION_TYPE = "0.0.2" | "0.2.2" | "0.2.3" | "0.2.4";
|
|
182
180
|
export type KERNEL_V3_VERSION_TYPE = "0.3.0" | "0.3.1";
|
|
183
181
|
export type KERNEL_VERSION_TYPE = KERNEL_V2_VERSION_TYPE | KERNEL_V3_VERSION_TYPE;
|
|
184
|
-
export type GetKernelVersion<
|
|
182
|
+
export type GetKernelVersion<entryPointVersion extends EntryPointVersion> = entryPointVersion extends "0.6" ? KERNEL_V2_VERSION_TYPE : KERNEL_V3_VERSION_TYPE;
|
|
185
183
|
//# sourceMappingURL=kernel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../types/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../types/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAC/E,OAAO,KAAK,EACR,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,eAAe,EAClB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,MAAM,MAAM,yBAAyB,CACjC,iBAAiB,SAAS,iBAAiB,IAC3C;IACA;QACI,MAAM,EAAE,yBAAyB,CAAA;QACjC,UAAU,EAAE;YACR;gBACI,OAAO,EAAE,MAAM,CAAA;gBACf,MAAM,EAAE,iBAAiB,SAAS,KAAK,GACjC,SAAS,CACL,aAAa,CAAC,KAAK,CAAC,EAClB,cAAc,GACd,oBAAoB,GACpB,sBAAsB,CAC3B,GACD,SAAS,CACL,aAAa,CAAC,KAAK,CAAC,EAClB,cAAc,GACd,oBAAoB,GACpB,sBAAsB,GACtB,+BAA+B,GAC/B,yBAAyB,CAC9B,CAAA;gBACP,iBAAiB,EAAE,OAAO,CAAA;gBAC1B,YAAY,CAAC,EAAE;oBACX,YAAY,EAAE,GAAG,CAA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