@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
|
@@ -1,139 +1,177 @@
|
|
|
1
|
-
import { getEntryPointVersion } from "permissionless"
|
|
2
|
-
import type { SmartAccount } from "permissionless/accounts"
|
|
3
|
-
import type { Middleware } from "permissionless/actions/smartAccount"
|
|
4
|
-
import type { EntryPoint, Prettify } from "permissionless/types"
|
|
5
|
-
import type { BundlerRpcSchema } from "permissionless/types/bundler"
|
|
6
1
|
import {
|
|
7
|
-
|
|
2
|
+
type BundlerRpcSchema,
|
|
8
3
|
type Chain,
|
|
9
4
|
type Client,
|
|
10
5
|
type ClientConfig,
|
|
6
|
+
type EstimateFeesPerGasReturnType,
|
|
7
|
+
type Prettify,
|
|
8
|
+
type RpcSchema,
|
|
11
9
|
type Transport,
|
|
12
10
|
createClient
|
|
13
11
|
} from "viem"
|
|
14
|
-
import
|
|
15
|
-
|
|
12
|
+
import {
|
|
13
|
+
type BundlerActions,
|
|
14
|
+
type BundlerClientConfig,
|
|
15
|
+
type PaymasterActions,
|
|
16
|
+
type PrepareUserOperationParameters,
|
|
17
|
+
type SmartAccount,
|
|
18
|
+
type UserOperationRequest,
|
|
19
|
+
bundlerActions,
|
|
20
|
+
type prepareUserOperation as viemPrepareUserOperation
|
|
21
|
+
} from "viem/account-abstraction"
|
|
16
22
|
import {
|
|
17
23
|
type KernelAccountClientActions,
|
|
18
24
|
kernelAccountClientActions
|
|
19
25
|
} from "./decorators/kernel.js"
|
|
20
|
-
import { isProviderSet, setPimlicoAsProvider } from "./utils.js"
|
|
21
26
|
|
|
22
27
|
export type KernelAccountClient<
|
|
23
|
-
entryPoint extends EntryPoint,
|
|
24
28
|
transport extends Transport = Transport,
|
|
25
29
|
chain extends Chain | undefined = Chain | undefined,
|
|
26
|
-
account extends
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
account extends SmartAccount | undefined = SmartAccount | undefined,
|
|
31
|
+
client extends Client | undefined = Client | undefined,
|
|
32
|
+
rpcSchema extends RpcSchema | undefined = undefined
|
|
33
|
+
> = Prettify<
|
|
34
|
+
Client<
|
|
35
|
+
transport,
|
|
36
|
+
chain extends Chain
|
|
37
|
+
? chain
|
|
38
|
+
: // biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
39
|
+
client extends Client<any, infer chain>
|
|
40
|
+
? chain
|
|
41
|
+
: undefined,
|
|
42
|
+
account,
|
|
43
|
+
rpcSchema extends RpcSchema
|
|
44
|
+
? [...BundlerRpcSchema, ...rpcSchema]
|
|
45
|
+
: BundlerRpcSchema,
|
|
46
|
+
BundlerActions<account> & KernelAccountClientActions<chain, account>
|
|
47
|
+
>
|
|
48
|
+
> & {
|
|
49
|
+
client: client
|
|
50
|
+
paymaster: BundlerClientConfig["paymaster"] | undefined
|
|
51
|
+
paymasterContext: BundlerClientConfig["paymasterContext"] | undefined
|
|
52
|
+
userOperation: BundlerClientConfig["userOperation"] | undefined
|
|
53
|
+
}
|
|
38
54
|
|
|
39
55
|
export type SmartAccountClientConfig<
|
|
40
|
-
entryPoint extends EntryPoint,
|
|
41
56
|
transport extends Transport = Transport,
|
|
42
57
|
chain extends Chain | undefined = Chain | undefined,
|
|
43
|
-
account extends
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
| SmartAccount<entryPoint, string, transport, chain>
|
|
47
|
-
| undefined
|
|
58
|
+
account extends SmartAccount | undefined = SmartAccount | undefined,
|
|
59
|
+
client extends Client | undefined = Client | undefined,
|
|
60
|
+
rpcSchema extends RpcSchema | undefined = undefined
|
|
48
61
|
> = Prettify<
|
|
49
62
|
Pick<
|
|
50
|
-
ClientConfig<transport, chain, account>,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
63
|
+
ClientConfig<transport, chain, account, rpcSchema>,
|
|
64
|
+
| "account"
|
|
65
|
+
| "cacheTime"
|
|
66
|
+
| "chain"
|
|
67
|
+
| "key"
|
|
68
|
+
| "name"
|
|
69
|
+
| "pollingInterval"
|
|
70
|
+
| "rpcSchema"
|
|
71
|
+
>
|
|
72
|
+
> & {
|
|
73
|
+
bundlerTransport: transport
|
|
74
|
+
/** Client that points to an Execution RPC URL. */
|
|
75
|
+
client?: client | Client | undefined
|
|
76
|
+
/** Paymaster configuration. */
|
|
77
|
+
paymaster?:
|
|
78
|
+
| true
|
|
79
|
+
| {
|
|
80
|
+
/** Retrieves paymaster-related User Operation properties to be used for sending the User Operation. */
|
|
81
|
+
getPaymasterData?:
|
|
82
|
+
| PaymasterActions["getPaymasterData"]
|
|
83
|
+
| undefined
|
|
84
|
+
/** Retrieves paymaster-related User Operation properties to be used for gas estimation. */
|
|
85
|
+
getPaymasterStubData?:
|
|
86
|
+
| PaymasterActions["getPaymasterStubData"]
|
|
87
|
+
| undefined
|
|
88
|
+
}
|
|
89
|
+
| undefined
|
|
90
|
+
/** Paymaster context to pass to `getPaymasterData` and `getPaymasterStubData` calls. */
|
|
91
|
+
paymasterContext?: unknown
|
|
92
|
+
/** User Operation configuration. */
|
|
93
|
+
userOperation?:
|
|
94
|
+
| {
|
|
95
|
+
/** Prepares fee properties for the User Operation request. */
|
|
96
|
+
estimateFeesPerGas?:
|
|
97
|
+
| ((parameters: {
|
|
98
|
+
account: account | SmartAccount
|
|
99
|
+
bundlerClient: Client
|
|
100
|
+
userOperation: UserOperationRequest
|
|
101
|
+
}) => Promise<EstimateFeesPerGasReturnType<"eip1559">>)
|
|
102
|
+
| undefined
|
|
103
|
+
/** Prepare User Operation configuration. */
|
|
104
|
+
prepareUserOperation?: typeof viemPrepareUserOperation | undefined
|
|
105
|
+
}
|
|
68
106
|
| undefined
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function createKernelAccountClient<
|
|
110
|
+
transport extends Transport,
|
|
111
|
+
chain extends Chain | undefined = undefined,
|
|
112
|
+
account extends SmartAccount | undefined = undefined,
|
|
113
|
+
client extends Client | undefined = undefined,
|
|
114
|
+
rpcSchema extends RpcSchema | undefined = undefined
|
|
69
115
|
>(
|
|
70
116
|
parameters: SmartAccountClientConfig<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
117
|
+
transport,
|
|
118
|
+
chain,
|
|
119
|
+
account,
|
|
120
|
+
client,
|
|
121
|
+
rpcSchema
|
|
75
122
|
>
|
|
76
|
-
): KernelAccountClient<
|
|
123
|
+
): KernelAccountClient<transport, chain, account, client, rpcSchema>
|
|
124
|
+
|
|
125
|
+
export function createKernelAccountClient(
|
|
126
|
+
parameters: SmartAccountClientConfig
|
|
127
|
+
): KernelAccountClient {
|
|
77
128
|
const {
|
|
129
|
+
client: client_,
|
|
78
130
|
key = "Account",
|
|
79
131
|
name = "Kernel Account Client",
|
|
132
|
+
paymaster,
|
|
133
|
+
paymasterContext,
|
|
80
134
|
bundlerTransport,
|
|
81
|
-
|
|
135
|
+
userOperation
|
|
82
136
|
} = parameters
|
|
83
|
-
const entryPointVersion = getEntryPointVersion(entryPoint)
|
|
84
|
-
const shouldIncludePimlicoProvider =
|
|
85
|
-
bundlerTransport({}).config.key === "http" &&
|
|
86
|
-
entryPointVersion === "v0.7"
|
|
87
137
|
|
|
88
|
-
const client =
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
!shouldIncludePimlicoProvider ||
|
|
100
|
-
isProviderSet(_bundlerTransport.value?.url, "ALCHEMY") ||
|
|
101
|
-
isProviderSet(_bundlerTransport.value?.url, "ZERODEV") ||
|
|
102
|
-
isProviderSet(_bundlerTransport.value?.url, "THIRDWEB") ||
|
|
103
|
-
isProviderSet(_bundlerTransport.value?.url, "CONDUIT")
|
|
104
|
-
)
|
|
105
|
-
return _bundlerTransport
|
|
106
|
-
_bundlerTransport = http(
|
|
107
|
-
setPimlicoAsProvider(_bundlerTransport.value?.url)
|
|
108
|
-
)({
|
|
109
|
-
...opts,
|
|
110
|
-
timeout: bundlerTransport({}).config.timeout,
|
|
111
|
-
retryCount: 0
|
|
112
|
-
})
|
|
113
|
-
return _bundlerTransport
|
|
114
|
-
},
|
|
115
|
-
type: "kernelAccountClient"
|
|
116
|
-
})
|
|
138
|
+
const client = Object.assign(
|
|
139
|
+
createClient({
|
|
140
|
+
...parameters,
|
|
141
|
+
chain: parameters.chain ?? client_?.chain,
|
|
142
|
+
transport: bundlerTransport,
|
|
143
|
+
key,
|
|
144
|
+
name,
|
|
145
|
+
type: "kernelAccountClient"
|
|
146
|
+
}),
|
|
147
|
+
{ client: client_, paymaster, paymasterContext, userOperation }
|
|
148
|
+
)
|
|
117
149
|
|
|
118
|
-
|
|
150
|
+
if (parameters.userOperation?.prepareUserOperation) {
|
|
151
|
+
const customPrepareUserOp =
|
|
152
|
+
parameters.userOperation.prepareUserOperation
|
|
119
153
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
154
|
+
return client
|
|
155
|
+
.extend(bundlerActions)
|
|
156
|
+
.extend((client) => ({
|
|
157
|
+
prepareUserOperation: (
|
|
158
|
+
args: PrepareUserOperationParameters
|
|
159
|
+
) => {
|
|
160
|
+
return customPrepareUserOp(client, args)
|
|
161
|
+
}
|
|
162
|
+
}))
|
|
163
|
+
.extend(bundlerActions)
|
|
164
|
+
.extend((client) => ({
|
|
165
|
+
prepareUserOperation: (
|
|
166
|
+
args: PrepareUserOperationParameters
|
|
167
|
+
) => {
|
|
168
|
+
return customPrepareUserOp(client, args)
|
|
169
|
+
}
|
|
170
|
+
}))
|
|
171
|
+
.extend(kernelAccountClientActions()) as KernelAccountClient
|
|
133
172
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
) as KernelAccountClient<TEntryPoint, TTransport, TChain, TSmartAccount>
|
|
173
|
+
|
|
174
|
+
return client
|
|
175
|
+
.extend(bundlerActions)
|
|
176
|
+
.extend(kernelAccountClientActions()) as KernelAccountClient
|
|
139
177
|
}
|
|
@@ -1,28 +1,71 @@
|
|
|
1
|
-
import { getEntryPointVersion } from "permissionless"
|
|
2
|
-
import type { EntryPoint } from "permissionless/types/entrypoint"
|
|
3
1
|
import {
|
|
4
|
-
|
|
5
|
-
type Account,
|
|
2
|
+
type Address,
|
|
6
3
|
type Chain,
|
|
7
4
|
type Client,
|
|
5
|
+
type ClientConfig,
|
|
6
|
+
type Prettify,
|
|
8
7
|
type PublicClientConfig,
|
|
8
|
+
type RpcSchema,
|
|
9
9
|
type Transport,
|
|
10
10
|
createClient
|
|
11
11
|
} from "viem"
|
|
12
|
-
import type { ZeroDevPaymasterRpcSchema } from "../types/kernel.js"
|
|
13
12
|
import {
|
|
14
|
-
type
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
type PaymasterActions,
|
|
14
|
+
type SmartAccount,
|
|
15
|
+
entryPoint07Address,
|
|
16
|
+
paymasterActions
|
|
17
|
+
} from "viem/account-abstraction"
|
|
18
|
+
import type { ZeroDevPaymasterRpcSchema } from "../types/kernel.js"
|
|
19
|
+
import { zerodevPaymasterActions } from "./decorators/kernel.js"
|
|
18
20
|
|
|
19
|
-
export type ZeroDevPaymasterClient<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
export type ZeroDevPaymasterClient<
|
|
22
|
+
entryPointVersion extends "0.6" | "0.7" = "0.7",
|
|
23
|
+
transport extends Transport = Transport,
|
|
24
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
25
|
+
account extends SmartAccount | undefined = SmartAccount | undefined,
|
|
26
|
+
client extends Client | undefined = Client | undefined,
|
|
27
|
+
rpcSchema extends RpcSchema | undefined = undefined
|
|
28
|
+
> = Prettify<
|
|
29
|
+
Client<
|
|
30
|
+
transport,
|
|
31
|
+
chain extends Chain
|
|
32
|
+
? chain
|
|
33
|
+
: // biome-ignore lint/suspicious/noExplicitAny: We need any to infer the chain type
|
|
34
|
+
client extends Client<any, infer chain>
|
|
35
|
+
? chain
|
|
36
|
+
: undefined,
|
|
37
|
+
account,
|
|
38
|
+
rpcSchema extends RpcSchema
|
|
39
|
+
? [...ZeroDevPaymasterRpcSchema<entryPointVersion>, ...rpcSchema]
|
|
40
|
+
: ZeroDevPaymasterRpcSchema<entryPointVersion>,
|
|
41
|
+
PaymasterActions
|
|
42
|
+
>
|
|
25
43
|
>
|
|
44
|
+
|
|
45
|
+
export type ZeroDevPaymasterClientConfig<
|
|
46
|
+
entryPointVersion extends "0.6" | "0.7" = "0.7" | "0.6",
|
|
47
|
+
transport extends Transport = Transport,
|
|
48
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
49
|
+
account extends SmartAccount | undefined = SmartAccount | undefined,
|
|
50
|
+
rpcSchema extends RpcSchema | undefined = undefined
|
|
51
|
+
> = Prettify<
|
|
52
|
+
Pick<
|
|
53
|
+
ClientConfig<transport, chain, account, rpcSchema>,
|
|
54
|
+
| "account"
|
|
55
|
+
| "cacheTime"
|
|
56
|
+
| "chain"
|
|
57
|
+
| "key"
|
|
58
|
+
| "name"
|
|
59
|
+
| "pollingInterval"
|
|
60
|
+
| "rpcSchema"
|
|
61
|
+
| "transport"
|
|
62
|
+
>
|
|
63
|
+
> & {
|
|
64
|
+
entryPoint?: {
|
|
65
|
+
address: Address
|
|
66
|
+
version: entryPointVersion
|
|
67
|
+
}
|
|
68
|
+
}
|
|
26
69
|
/**
|
|
27
70
|
* Creates a ZeroDev-specific Paymaster Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
|
|
28
71
|
*
|
|
@@ -40,48 +83,31 @@ export type ZeroDevPaymasterClient<entryPoint extends EntryPoint> = Client<
|
|
|
40
83
|
* transport: http(`https://rpc.zerodev.app/api/v2/paymaster/${projectId}`),
|
|
41
84
|
* })
|
|
42
85
|
*/
|
|
43
|
-
export const createZeroDevPaymasterClient =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
chain extends Chain | undefined = undefined
|
|
47
|
-
>(
|
|
48
|
-
parameters: PublicClientConfig<transport, chain> & {
|
|
49
|
-
entryPoint: entryPoint
|
|
50
|
-
}
|
|
51
|
-
): ZeroDevPaymasterClient<entryPoint> => {
|
|
86
|
+
export const createZeroDevPaymasterClient = (
|
|
87
|
+
parameters: ZeroDevPaymasterClientConfig
|
|
88
|
+
): ZeroDevPaymasterClient => {
|
|
52
89
|
const {
|
|
53
90
|
key = "public",
|
|
54
91
|
name = "ZeroDev Paymaster Client",
|
|
55
|
-
entryPoint
|
|
92
|
+
entryPoint,
|
|
56
93
|
transport
|
|
57
94
|
} = parameters
|
|
58
|
-
const entryPointVersion = getEntryPointVersion(entryPointAddress)
|
|
59
|
-
const shouldIncludePimlicoProvider =
|
|
60
|
-
transport({}).config.key === "http" && entryPointVersion === "v0.7"
|
|
61
95
|
const client = createClient({
|
|
62
96
|
...parameters,
|
|
63
97
|
transport: (opts) => {
|
|
64
|
-
|
|
65
|
-
...opts,
|
|
66
|
-
retryCount: 0
|
|
67
|
-
})
|
|
68
|
-
if (
|
|
69
|
-
!shouldIncludePimlicoProvider ||
|
|
70
|
-
isProviderSet(_transport.value?.url, "ALCHEMY") ||
|
|
71
|
-
isProviderSet(_transport.value?.url, "ZERODEV") ||
|
|
72
|
-
isProviderSet(_transport.value?.url, "THIRDWEB") ||
|
|
73
|
-
isProviderSet(_transport.value?.url, "CONDUIT")
|
|
74
|
-
)
|
|
75
|
-
return _transport
|
|
76
|
-
_transport = http(setPimlicoAsProvider(_transport.value?.url))({
|
|
98
|
+
return transport({
|
|
77
99
|
...opts,
|
|
78
100
|
retryCount: 0
|
|
79
101
|
})
|
|
80
|
-
return _transport
|
|
81
102
|
},
|
|
82
103
|
key,
|
|
83
104
|
name,
|
|
84
105
|
type: "zerodevPaymasterClient"
|
|
85
106
|
})
|
|
86
|
-
return client.extend(
|
|
107
|
+
return client.extend(paymasterActions).extend(
|
|
108
|
+
zerodevPaymasterActions({
|
|
109
|
+
address: entryPoint?.address ?? entryPoint07Address,
|
|
110
|
+
version: entryPoint?.version ?? "0.7"
|
|
111
|
+
})
|
|
112
|
+
)
|
|
87
113
|
}
|
package/errors/index.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BaseError } from "viem"
|
|
2
|
+
|
|
3
|
+
export class AccountNotFoundError extends BaseError {
|
|
4
|
+
constructor({ docsPath }: { docsPath?: string | undefined } = {}) {
|
|
5
|
+
super(
|
|
6
|
+
[
|
|
7
|
+
"Could not find an Account to execute with this Action.",
|
|
8
|
+
"Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."
|
|
9
|
+
].join("\n"),
|
|
10
|
+
{
|
|
11
|
+
docsPath,
|
|
12
|
+
docsSlug: "account",
|
|
13
|
+
name: "AccountNotFoundError"
|
|
14
|
+
}
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class SignTransactionNotSupportedBySmartAccountError extends BaseError {
|
|
20
|
+
constructor() {
|
|
21
|
+
super("Smart account signer doesn't need to sign transactions", {
|
|
22
|
+
name: "SignTransactionNotSupportedError"
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
}
|
package/gasTokenAddresses.ts
CHANGED
|
@@ -306,7 +306,7 @@ export type TokenSymbolsMap = {
|
|
|
306
306
|
84532: "6TEST"
|
|
307
307
|
421613: "USDC" | "6TEST"
|
|
308
308
|
421614: "6TEST"
|
|
309
|
-
11155111: "6TEST"
|
|
309
|
+
11155111: "6TEST" | "USDC"
|
|
310
310
|
11155420: "6TEST"
|
|
311
311
|
}
|
|
312
312
|
|
|
@@ -662,7 +662,8 @@ export const gasTokenAddresses: {
|
|
|
662
662
|
"6TEST": "0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"
|
|
663
663
|
},
|
|
664
664
|
11155111: {
|
|
665
|
-
"6TEST": "0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"
|
|
665
|
+
"6TEST": "0x3870419Ba2BBf0127060bCB37f69A1b1C090992B",
|
|
666
|
+
USDC: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"
|
|
666
667
|
},
|
|
667
668
|
11155420: {
|
|
668
669
|
"6TEST": "0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"
|
package/index.ts
CHANGED
|
@@ -2,8 +2,11 @@ export {
|
|
|
2
2
|
createKernelAccount,
|
|
3
3
|
createKernelAccountV0_2,
|
|
4
4
|
createKernelAccountV1,
|
|
5
|
-
type
|
|
6
|
-
type
|
|
5
|
+
type CreateKernelAccountParameters,
|
|
6
|
+
type CreateKernelAccountReturnType,
|
|
7
|
+
type CreateKernelAccountV1ReturnType,
|
|
8
|
+
type KernelSmartAccountImplementation,
|
|
9
|
+
type KernelSmartAccountV1Implementation,
|
|
7
10
|
KERNEL_ADDRESSES,
|
|
8
11
|
addressToEmptyAccount,
|
|
9
12
|
EIP1271Abi,
|
|
@@ -63,3 +66,4 @@ export { getEncodedPluginsData } from "./accounts/kernel/utils/plugins/ep0_7/get
|
|
|
63
66
|
export { isProviderSet, setPimlicoAsProvider } from "./clients/utils.js"
|
|
64
67
|
export { getUserOperationGasPrice } from "./actions/account-client/getUserOperationGasPrice.js"
|
|
65
68
|
export { isPluginInitialized } from "./accounts/kernel/utils/plugins/ep0_7/isPluginInitialized.js"
|
|
69
|
+
export * from "./errors/index.js"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zerodev/sdk",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0-beta.1",
|
|
4
4
|
"author": "ZeroDev",
|
|
5
5
|
"main": "./_cjs/index.js",
|
|
6
6
|
"module": "./_esm/index.js",
|
|
@@ -9,13 +9,7 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"sideEffects": false,
|
|
11
11
|
"description": "A utility library for working with ERC-4337",
|
|
12
|
-
"keywords": [
|
|
13
|
-
"ethereum",
|
|
14
|
-
"erc-4337",
|
|
15
|
-
"eip-4337",
|
|
16
|
-
"paymaster",
|
|
17
|
-
"bundler"
|
|
18
|
-
],
|
|
12
|
+
"keywords": ["ethereum", "erc-4337", "eip-4337", "paymaster", "bundler"],
|
|
19
13
|
"license": "MIT",
|
|
20
14
|
"files": [
|
|
21
15
|
"_esm",
|
|
@@ -96,35 +90,18 @@
|
|
|
96
90
|
},
|
|
97
91
|
"typesVersions": {
|
|
98
92
|
"*": {
|
|
99
|
-
"accounts": [
|
|
100
|
-
|
|
101
|
-
],
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
],
|
|
105
|
-
"
|
|
106
|
-
|
|
107
|
-
],
|
|
108
|
-
"types": [
|
|
109
|
-
"./_types/types/index.d.ts"
|
|
110
|
-
],
|
|
111
|
-
"actions/kernel": [
|
|
112
|
-
"./_types/actions/kernel/index.d.ts"
|
|
113
|
-
],
|
|
114
|
-
"clients": [
|
|
115
|
-
"./_types/clients/index.d.ts"
|
|
116
|
-
],
|
|
117
|
-
"clients/kernel": [
|
|
118
|
-
"./_types/clients/kernel/index.d.ts"
|
|
119
|
-
],
|
|
120
|
-
"providers": [
|
|
121
|
-
"./_types/providers/index.d.ts"
|
|
122
|
-
]
|
|
93
|
+
"accounts": ["./_types/accounts/index.d.ts"],
|
|
94
|
+
"plugins": ["./_types/plugins/index.d.ts"],
|
|
95
|
+
"actions": ["./_types/actions/index.d.ts"],
|
|
96
|
+
"types": ["./_types/types/index.d.ts"],
|
|
97
|
+
"actions/kernel": ["./_types/actions/kernel/index.d.ts"],
|
|
98
|
+
"clients": ["./_types/clients/index.d.ts"],
|
|
99
|
+
"clients/kernel": ["./_types/clients/kernel/index.d.ts"],
|
|
100
|
+
"providers": ["./_types/providers/index.d.ts"]
|
|
123
101
|
}
|
|
124
102
|
},
|
|
125
103
|
"peerDependencies": {
|
|
126
|
-
"viem": "
|
|
127
|
-
"permissionless": ">=0.1.44 <=0.1.45"
|
|
104
|
+
"viem": "^2.21.40"
|
|
128
105
|
},
|
|
129
106
|
"dependencies": {
|
|
130
107
|
"semver": "^7.6.0"
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { EventEmitter } from "events"
|
|
2
|
-
import type { KernelAccountClient } from "@zerodev/sdk"
|
|
3
|
-
import type { EntryPoint } from "permissionless/types"
|
|
4
2
|
import type {
|
|
5
3
|
EIP1193Parameters,
|
|
6
4
|
EIP1193RequestFn,
|
|
7
5
|
Hash,
|
|
8
6
|
SendTransactionParameters
|
|
9
7
|
} from "viem"
|
|
8
|
+
import type { KernelAccountClient } from "../clients/kernelAccountClient.js"
|
|
10
9
|
|
|
11
|
-
export class KernelEIP1193Provider
|
|
12
|
-
|
|
13
|
-
> extends EventEmitter {
|
|
14
|
-
private kernelClient: KernelAccountClient<entryPoint>
|
|
10
|
+
export class KernelEIP1193Provider extends EventEmitter {
|
|
11
|
+
private kernelClient: KernelAccountClient
|
|
15
12
|
|
|
16
|
-
constructor(kernelClient: KernelAccountClient
|
|
13
|
+
constructor(kernelClient: KernelAccountClient) {
|
|
17
14
|
super()
|
|
18
15
|
this.kernelClient = kernelClient
|
|
19
16
|
}
|
package/types/index.ts
CHANGED
|
@@ -12,9 +12,12 @@ export type {
|
|
|
12
12
|
KERNEL_V2_VERSION_TYPE,
|
|
13
13
|
KERNEL_V3_VERSION_TYPE,
|
|
14
14
|
KERNEL_VERSION_TYPE,
|
|
15
|
-
GetKernelVersion
|
|
15
|
+
GetKernelVersion,
|
|
16
|
+
GetEntryPointAbi
|
|
16
17
|
} from "./kernel.js"
|
|
17
18
|
|
|
18
19
|
export { ValidatorMode } from "./kernel.js"
|
|
19
20
|
|
|
20
21
|
export type WithRequired<T, K extends keyof T> = Required<Pick<T, K>>
|
|
22
|
+
|
|
23
|
+
export type PartialPick<T, K extends keyof T> = Partial<Pick<T, K>>
|