@zerodev/sdk 5.3.26 → 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 -56
- 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 +11 -34
- 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,12 +1,8 @@
|
|
|
1
|
-
import { getEntryPointVersion } from "permissionless"
|
|
2
|
-
import type { EntryPoint } from "permissionless/types/entrypoint"
|
|
3
1
|
import { satisfies } from "semver"
|
|
4
2
|
import {
|
|
5
3
|
type Address,
|
|
6
|
-
type Chain,
|
|
7
4
|
type Client,
|
|
8
5
|
type Hex,
|
|
9
|
-
type Transport,
|
|
10
6
|
concat,
|
|
11
7
|
concatHex,
|
|
12
8
|
maxUint16,
|
|
@@ -15,6 +11,7 @@ import {
|
|
|
15
11
|
toHex,
|
|
16
12
|
zeroAddress
|
|
17
13
|
} from "viem"
|
|
14
|
+
import type { EntryPointVersion } from "viem/account-abstraction"
|
|
18
15
|
import { getChainId } from "viem/actions"
|
|
19
16
|
import { encodeModuleInstallCallData as encodeModuleInstallCallDataEpV06 } from "../../accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.js"
|
|
20
17
|
import {
|
|
@@ -36,19 +33,19 @@ import { getEncodedPluginsData as getEncodedPluginsDataV2 } from "../kernel/util
|
|
|
36
33
|
import { getPluginsEnableTypedData as getPluginsEnableTypedDataV2 } from "../kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js"
|
|
37
34
|
import { isPluginInitialized } from "../kernel/utils/plugins/ep0_7/isPluginInitialized.js"
|
|
38
35
|
|
|
39
|
-
export function isKernelPluginManager<
|
|
36
|
+
export function isKernelPluginManager<
|
|
37
|
+
entryPointVersion extends EntryPointVersion
|
|
38
|
+
>(
|
|
40
39
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
41
40
|
plugin: any
|
|
42
|
-
): plugin is KernelPluginManager<
|
|
41
|
+
): plugin is KernelPluginManager<entryPointVersion> {
|
|
43
42
|
return plugin.getPluginEnableSignature !== undefined
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
export async function toKernelPluginManager<
|
|
47
|
-
|
|
48
|
-
TTransport extends Transport = Transport,
|
|
49
|
-
TChain extends Chain | undefined = Chain | undefined
|
|
46
|
+
entryPointVersion extends EntryPointVersion
|
|
50
47
|
>(
|
|
51
|
-
client: Client
|
|
48
|
+
client: Client,
|
|
52
49
|
{
|
|
53
50
|
sudo,
|
|
54
51
|
regular,
|
|
@@ -58,11 +55,11 @@ export async function toKernelPluginManager<
|
|
|
58
55
|
action,
|
|
59
56
|
validAfter = 0,
|
|
60
57
|
validUntil = 0,
|
|
61
|
-
entryPoint
|
|
58
|
+
entryPoint,
|
|
62
59
|
kernelVersion,
|
|
63
60
|
chainId
|
|
64
|
-
}: KernelPluginManagerParams<
|
|
65
|
-
): Promise<KernelPluginManager<
|
|
61
|
+
}: KernelPluginManagerParams<entryPointVersion>
|
|
62
|
+
): Promise<KernelPluginManager<entryPointVersion>> {
|
|
66
63
|
if (
|
|
67
64
|
(sudo && !satisfies(kernelVersion, sudo?.supportedKernelVersions)) ||
|
|
68
65
|
(regular && !satisfies(kernelVersion, regular?.supportedKernelVersions))
|
|
@@ -72,20 +69,19 @@ export async function toKernelPluginManager<
|
|
|
72
69
|
)
|
|
73
70
|
}
|
|
74
71
|
let pluginEnabled: boolean
|
|
75
|
-
const entryPointVersion = getEntryPointVersion(entryPointAddress)
|
|
76
72
|
const activeValidator = regular || sudo
|
|
77
73
|
if (!activeValidator) {
|
|
78
74
|
throw new Error("One of `sudo` or `regular` validator must be set")
|
|
79
75
|
}
|
|
80
76
|
action = {
|
|
81
|
-
selector: action?.selector ?? getActionSelector(
|
|
77
|
+
selector: action?.selector ?? getActionSelector(entryPoint.version),
|
|
82
78
|
address: action?.address ?? zeroAddress
|
|
83
79
|
}
|
|
84
80
|
if (
|
|
85
|
-
|
|
81
|
+
entryPoint.version === "0.7" &&
|
|
86
82
|
(action.address.toLowerCase() !== zeroAddress.toLowerCase() ||
|
|
87
83
|
action.selector.toLowerCase() !==
|
|
88
|
-
getActionSelector(
|
|
84
|
+
getActionSelector(entryPoint.version).toLowerCase()) &&
|
|
89
85
|
kernelVersion === "0.3.0"
|
|
90
86
|
) {
|
|
91
87
|
action.hook = {
|
|
@@ -105,7 +101,7 @@ export async function toKernelPluginManager<
|
|
|
105
101
|
if (!action) {
|
|
106
102
|
throw new Error("Action data must be set")
|
|
107
103
|
}
|
|
108
|
-
if (
|
|
104
|
+
if (entryPoint.version === "0.6") {
|
|
109
105
|
if (regular) {
|
|
110
106
|
if (pluginEnabled) {
|
|
111
107
|
return ValidatorMode.plugin
|
|
@@ -163,7 +159,7 @@ export async function toKernelPluginManager<
|
|
|
163
159
|
throw new Error("Action data must be set")
|
|
164
160
|
}
|
|
165
161
|
if (!regular) throw new Error("regular validator not set")
|
|
166
|
-
if (
|
|
162
|
+
if (entryPoint.version === "0.6") {
|
|
167
163
|
return regular.isEnabled(accountAddress, selector)
|
|
168
164
|
}
|
|
169
165
|
const isEnabled =
|
|
@@ -195,7 +191,7 @@ export async function toKernelPluginManager<
|
|
|
195
191
|
chainId = client.chain?.id ?? (await getChainId(client))
|
|
196
192
|
}
|
|
197
193
|
let ownerSig: Hex
|
|
198
|
-
if (
|
|
194
|
+
if (entryPoint.version === "0.6") {
|
|
199
195
|
const typeData = await getPluginsEnableTypedDataV1({
|
|
200
196
|
accountAddress,
|
|
201
197
|
chainId,
|
|
@@ -276,7 +272,7 @@ export async function toKernelPluginManager<
|
|
|
276
272
|
throw new Error("Action data must be set")
|
|
277
273
|
}
|
|
278
274
|
if (!regular) throw new Error("regular validator not set")
|
|
279
|
-
if (
|
|
275
|
+
if (entryPoint.version === "0.6") {
|
|
280
276
|
return await encodeModuleInstallCallDataEpV06({
|
|
281
277
|
accountAddress,
|
|
282
278
|
selector: action.selector,
|
|
@@ -292,7 +288,7 @@ export async function toKernelPluginManager<
|
|
|
292
288
|
signUserOperation: async (userOperation) => {
|
|
293
289
|
const userOpSig =
|
|
294
290
|
await activeValidator.signUserOperation(userOperation)
|
|
295
|
-
if (
|
|
291
|
+
if (entryPoint.version === "0.6") {
|
|
296
292
|
return concatHex([
|
|
297
293
|
await getSignatureData(
|
|
298
294
|
userOperation.sender,
|
|
@@ -317,10 +313,10 @@ export async function toKernelPluginManager<
|
|
|
317
313
|
validAfter,
|
|
318
314
|
validUntil
|
|
319
315
|
}),
|
|
320
|
-
|
|
316
|
+
getStubSignature: async (userOperation) => {
|
|
321
317
|
const userOpSig =
|
|
322
|
-
await activeValidator.
|
|
323
|
-
if (
|
|
318
|
+
await activeValidator.getStubSignature(userOperation)
|
|
319
|
+
if (entryPoint.version === "0.6") {
|
|
324
320
|
return concatHex([
|
|
325
321
|
await getSignatureData(
|
|
326
322
|
userOperation.sender,
|
|
@@ -342,10 +338,10 @@ export async function toKernelPluginManager<
|
|
|
342
338
|
if (!action) {
|
|
343
339
|
throw new Error("Action data must be set")
|
|
344
340
|
}
|
|
345
|
-
if (
|
|
341
|
+
if (entryPoint.version === "0.6") {
|
|
346
342
|
if (customNonceKey > maxUint192) {
|
|
347
343
|
throw new Error(
|
|
348
|
-
"Custom nonce key must be equal or less than maxUint192 for
|
|
344
|
+
"Custom nonce key must be equal or less than maxUint192 for 0.6"
|
|
349
345
|
)
|
|
350
346
|
}
|
|
351
347
|
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type SendUserOperationParameters,
|
|
3
|
-
sendUserOperation
|
|
4
|
-
} from "permissionless/actions/smartAccount"
|
|
5
|
-
import type { EntryPoint, Prettify } from "permissionless/types"
|
|
6
|
-
import {
|
|
7
|
-
AccountOrClientNotFoundError,
|
|
8
|
-
parseAccount
|
|
9
|
-
} from "permissionless/utils"
|
|
10
1
|
import {
|
|
11
2
|
type Chain,
|
|
12
3
|
type Client,
|
|
13
4
|
type Hash,
|
|
14
5
|
type Hex,
|
|
6
|
+
type Prettify,
|
|
15
7
|
type Transport,
|
|
16
8
|
zeroAddress
|
|
17
9
|
} from "viem"
|
|
18
|
-
import {
|
|
19
|
-
|
|
10
|
+
import {
|
|
11
|
+
type SendUserOperationParameters,
|
|
12
|
+
type SmartAccount,
|
|
13
|
+
sendUserOperation
|
|
14
|
+
} from "viem/account-abstraction"
|
|
15
|
+
import {
|
|
16
|
+
concatHex,
|
|
17
|
+
encodeFunctionData,
|
|
18
|
+
getAction,
|
|
19
|
+
pad,
|
|
20
|
+
parseAccount
|
|
21
|
+
} from "viem/utils"
|
|
22
|
+
import type { KernelSmartAccountImplementation } from "../../accounts/index.js"
|
|
20
23
|
import { KernelV3_1AccountAbi } from "../../accounts/kernel/abi/kernel_v_3_1/KernelAccountAbi.js"
|
|
21
24
|
import {
|
|
22
25
|
KERNEL_V3_0,
|
|
@@ -28,68 +31,39 @@ import type {
|
|
|
28
31
|
KernelValidator,
|
|
29
32
|
KernelValidatorHook
|
|
30
33
|
} from "../../types/kernel.js"
|
|
31
|
-
|
|
32
|
-
type OptionalUserOperationParameters<
|
|
33
|
-
entryPoint extends EntryPoint,
|
|
34
|
-
TTransport extends Transport = Transport,
|
|
35
|
-
TChain extends Chain | undefined = Chain | undefined,
|
|
36
|
-
TAccount extends
|
|
37
|
-
| KernelSmartAccount<entryPoint, TTransport, TChain>
|
|
38
|
-
| undefined =
|
|
39
|
-
| KernelSmartAccount<entryPoint, TTransport, TChain>
|
|
40
|
-
| undefined
|
|
41
|
-
> = Omit<
|
|
42
|
-
SendUserOperationParameters<entryPoint, TTransport, TChain, TAccount>,
|
|
43
|
-
"userOperation"
|
|
44
|
-
> & {
|
|
45
|
-
userOperation?: SendUserOperationParameters<
|
|
46
|
-
entryPoint,
|
|
47
|
-
TTransport,
|
|
48
|
-
TChain,
|
|
49
|
-
TAccount
|
|
50
|
-
>["userOperation"]
|
|
51
|
-
}
|
|
34
|
+
import { AccountNotFoundError } from "../../errors/index.js";
|
|
52
35
|
|
|
53
36
|
export type ChangeSudoValidatorParameters<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
TAccount extends
|
|
58
|
-
| KernelSmartAccount<entryPoint, TTransport, TChain>
|
|
59
|
-
| undefined =
|
|
60
|
-
| KernelSmartAccount<entryPoint, TTransport, TChain>
|
|
61
|
-
| undefined
|
|
37
|
+
account extends SmartAccount | undefined,
|
|
38
|
+
accountOverride extends SmartAccount | undefined = undefined,
|
|
39
|
+
calls extends readonly unknown[] = readonly unknown[]
|
|
62
40
|
> = Prettify<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
TTransport,
|
|
66
|
-
TChain,
|
|
67
|
-
TAccount
|
|
68
|
-
> & {
|
|
69
|
-
sudoValidator: KernelValidator<entryPoint, string>
|
|
41
|
+
Partial<SendUserOperationParameters<account, accountOverride, calls>> & {
|
|
42
|
+
sudoValidator: KernelValidator<string>
|
|
70
43
|
hook?: KernelValidatorHook
|
|
71
44
|
}
|
|
72
45
|
>
|
|
73
46
|
|
|
74
47
|
export async function changeSudoValidator<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
| KernelSmartAccount<entryPoint, TTransport, TChain>
|
|
80
|
-
| undefined =
|
|
81
|
-
| KernelSmartAccount<entryPoint, TTransport, TChain>
|
|
82
|
-
| undefined
|
|
48
|
+
account extends SmartAccount | undefined,
|
|
49
|
+
chain extends Chain | undefined,
|
|
50
|
+
accountOverride extends SmartAccount | undefined = undefined,
|
|
51
|
+
calls extends readonly unknown[] = readonly unknown[]
|
|
83
52
|
>(
|
|
84
|
-
client: Client<
|
|
53
|
+
client: Client<Transport, chain, account>,
|
|
85
54
|
args: Prettify<
|
|
86
|
-
ChangeSudoValidatorParameters<
|
|
55
|
+
ChangeSudoValidatorParameters<account, accountOverride, calls>
|
|
87
56
|
>
|
|
88
57
|
): Promise<Hash> {
|
|
89
58
|
const { account: account_ = client.account, sudoValidator, hook } = args
|
|
90
|
-
if (!account_)
|
|
59
|
+
if (!account_)
|
|
60
|
+
throw new AccountNotFoundError({
|
|
61
|
+
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
62
|
+
})
|
|
91
63
|
|
|
92
|
-
const account = parseAccount(
|
|
64
|
+
const account = parseAccount(
|
|
65
|
+
account_
|
|
66
|
+
) as SmartAccount<KernelSmartAccountImplementation>
|
|
93
67
|
|
|
94
68
|
let rootValidatorId: Hex
|
|
95
69
|
if (
|
|
@@ -122,29 +96,31 @@ export async function changeSudoValidator<
|
|
|
122
96
|
if (account.kernelVersion === KERNEL_V3_0) {
|
|
123
97
|
return await getAction(
|
|
124
98
|
client,
|
|
125
|
-
sendUserOperation
|
|
99
|
+
sendUserOperation,
|
|
126
100
|
"sendUserOperation"
|
|
127
101
|
)({
|
|
128
102
|
...args,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
103
|
+
callData: await account.encodeCalls(
|
|
104
|
+
[
|
|
105
|
+
{
|
|
106
|
+
to: KernelVersionToAddressesMap[KERNEL_V3_1]
|
|
107
|
+
.accountImplementationAddress,
|
|
108
|
+
value: 0n,
|
|
109
|
+
data: encodeFunctionData({
|
|
110
|
+
abi: KernelV3_1AccountAbi,
|
|
111
|
+
functionName: "changeRootValidator",
|
|
112
|
+
args: [
|
|
113
|
+
rootValidatorId,
|
|
114
|
+
hookId,
|
|
115
|
+
validatorData,
|
|
116
|
+
hookData
|
|
117
|
+
]
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"delegatecall"
|
|
122
|
+
)
|
|
123
|
+
} as SendUserOperationParameters)
|
|
148
124
|
}
|
|
149
125
|
|
|
150
126
|
/**
|
|
@@ -152,12 +128,12 @@ export async function changeSudoValidator<
|
|
|
152
128
|
*/
|
|
153
129
|
return await getAction(
|
|
154
130
|
client,
|
|
155
|
-
sendUserOperation
|
|
131
|
+
sendUserOperation,
|
|
156
132
|
"sendUserOperation"
|
|
157
133
|
)({
|
|
158
134
|
...args,
|
|
159
|
-
|
|
160
|
-
|
|
135
|
+
callData: await account.encodeCalls([
|
|
136
|
+
{
|
|
161
137
|
to: account.address,
|
|
162
138
|
value: 0n,
|
|
163
139
|
data: encodeFunctionData({
|
|
@@ -165,7 +141,7 @@ export async function changeSudoValidator<
|
|
|
165
141
|
functionName: "changeRootValidator",
|
|
166
142
|
args: [rootValidatorId, hookId, validatorData, hookData]
|
|
167
143
|
})
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
} as SendUserOperationParameters
|
|
144
|
+
}
|
|
145
|
+
])
|
|
146
|
+
} as SendUserOperationParameters)
|
|
171
147
|
}
|
|
@@ -1,67 +1,28 @@
|
|
|
1
|
-
import type { SendTransactionWithPaymasterParameters } from "permissionless/actions/smartAccount"
|
|
2
|
-
import type { EntryPoint, Prettify } from "permissionless/types"
|
|
3
|
-
import {
|
|
4
|
-
AccountOrClientNotFoundError,
|
|
5
|
-
parseAccount
|
|
6
|
-
} from "permissionless/utils"
|
|
7
1
|
import type { Chain, Client, Transport } from "viem"
|
|
2
|
+
import type { SmartAccount } from "viem/account-abstraction"
|
|
8
3
|
import { readContract } from "viem/actions"
|
|
9
|
-
import { getAction } from "viem/utils"
|
|
10
|
-
import type { KernelSmartAccount } from "../../accounts/index.js"
|
|
4
|
+
import { getAction, parseAccount } from "viem/utils"
|
|
11
5
|
import { KernelV3AccountAbi } from "../../accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js"
|
|
12
|
-
|
|
13
|
-
export type GetKernelV3ModuleCurrentNonceParameters<
|
|
14
|
-
entryPoint extends EntryPoint,
|
|
15
|
-
TTransport extends Transport = Transport,
|
|
16
|
-
TChain extends Chain | undefined = Chain | undefined,
|
|
17
|
-
TAccount extends
|
|
18
|
-
| KernelSmartAccount<entryPoint, TTransport, TChain>
|
|
19
|
-
| undefined =
|
|
20
|
-
| KernelSmartAccount<entryPoint, TTransport, TChain>
|
|
21
|
-
| undefined,
|
|
22
|
-
TChainOverride extends Chain | undefined = Chain | undefined
|
|
23
|
-
> = Prettify<
|
|
24
|
-
SendTransactionWithPaymasterParameters<
|
|
25
|
-
entryPoint,
|
|
26
|
-
TTransport,
|
|
27
|
-
TChain,
|
|
28
|
-
TAccount,
|
|
29
|
-
TChainOverride
|
|
30
|
-
>
|
|
31
|
-
>
|
|
6
|
+
import { AccountNotFoundError } from "../../errors/index.js"
|
|
32
7
|
|
|
33
8
|
export async function getKernelV3ModuleCurrentNonce<
|
|
34
|
-
entryPoint extends EntryPoint,
|
|
35
9
|
TTransport extends Transport = Transport,
|
|
36
10
|
TChain extends Chain | undefined = Chain | undefined,
|
|
37
|
-
TAccount extends
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
client: Client<TTransport, TChain, TAccount>,
|
|
45
|
-
args: Prettify<
|
|
46
|
-
GetKernelV3ModuleCurrentNonceParameters<
|
|
47
|
-
entryPoint,
|
|
48
|
-
TTransport,
|
|
49
|
-
TChain,
|
|
50
|
-
TAccount,
|
|
51
|
-
TChainOverride
|
|
52
|
-
>
|
|
53
|
-
>
|
|
54
|
-
): Promise<number> {
|
|
55
|
-
const { account: account_ = client.account } = args
|
|
56
|
-
if (!account_) throw new AccountOrClientNotFoundError()
|
|
11
|
+
TAccount extends SmartAccount | undefined = SmartAccount | undefined
|
|
12
|
+
>(client: Client<TTransport, TChain, TAccount>): Promise<number> {
|
|
13
|
+
const account_ = client.account
|
|
14
|
+
if (!account_)
|
|
15
|
+
throw new AccountNotFoundError({
|
|
16
|
+
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
17
|
+
})
|
|
57
18
|
|
|
58
|
-
const account = parseAccount(account_) as
|
|
19
|
+
const account = parseAccount(account_) as SmartAccount
|
|
59
20
|
|
|
60
21
|
try {
|
|
61
22
|
const nonce = await getAction(
|
|
62
23
|
client,
|
|
63
24
|
readContract,
|
|
64
|
-
"
|
|
25
|
+
"readContract"
|
|
65
26
|
)({
|
|
66
27
|
abi: KernelV3AccountAbi,
|
|
67
28
|
address: account.address,
|
|
@@ -1,86 +1,57 @@
|
|
|
1
|
+
import type { Chain, Client, Hash, Prettify, Transport } from "viem"
|
|
1
2
|
import {
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
AccountOrClientNotFoundError,
|
|
8
|
-
parseAccount
|
|
9
|
-
} from "permissionless/utils"
|
|
10
|
-
import type { Chain, Client, Hash, Transport } from "viem"
|
|
11
|
-
import { encodeFunctionData, getAction } from "viem/utils"
|
|
12
|
-
import type { KernelSmartAccount } from "../../accounts/index.js"
|
|
3
|
+
type SendUserOperationParameters,
|
|
4
|
+
type SmartAccount,
|
|
5
|
+
sendUserOperation
|
|
6
|
+
} from "viem/account-abstraction"
|
|
7
|
+
import { encodeFunctionData, getAction, parseAccount } from "viem/utils"
|
|
13
8
|
import { KernelV3AccountAbi } from "../../accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js"
|
|
9
|
+
import { AccountNotFoundError } from "../../errors/index.js"
|
|
14
10
|
|
|
15
11
|
export type InvalidateNonceParameters<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
TAccount extends
|
|
20
|
-
| KernelSmartAccount<entryPoint, TTransport, TChain>
|
|
21
|
-
| undefined =
|
|
22
|
-
| KernelSmartAccount<entryPoint, TTransport, TChain>
|
|
23
|
-
| undefined,
|
|
24
|
-
TChainOverride extends Chain | undefined = Chain | undefined
|
|
12
|
+
account extends SmartAccount | undefined,
|
|
13
|
+
accountOverride extends SmartAccount | undefined = undefined,
|
|
14
|
+
calls extends readonly unknown[] = readonly unknown[]
|
|
25
15
|
> = Prettify<
|
|
26
|
-
|
|
27
|
-
entryPoint,
|
|
28
|
-
TTransport,
|
|
29
|
-
TChain,
|
|
30
|
-
TAccount,
|
|
31
|
-
TChainOverride
|
|
32
|
-
> & {
|
|
16
|
+
Partial<SendUserOperationParameters<account, accountOverride, calls>> & {
|
|
33
17
|
nonceToSet: number
|
|
34
18
|
}
|
|
35
19
|
>
|
|
36
20
|
|
|
37
21
|
export async function invalidateNonce<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
| KernelSmartAccount<entryPoint, TTransport, TChain>
|
|
43
|
-
| undefined =
|
|
44
|
-
| KernelSmartAccount<entryPoint, TTransport, TChain>
|
|
45
|
-
| undefined,
|
|
46
|
-
TChainOverride extends Chain | undefined = Chain | undefined
|
|
22
|
+
account extends SmartAccount | undefined,
|
|
23
|
+
chain extends Chain | undefined,
|
|
24
|
+
accountOverride extends SmartAccount | undefined = undefined,
|
|
25
|
+
calls extends readonly unknown[] = readonly unknown[]
|
|
47
26
|
>(
|
|
48
|
-
client: Client<
|
|
49
|
-
args: Prettify<
|
|
50
|
-
InvalidateNonceParameters<
|
|
51
|
-
entryPoint,
|
|
52
|
-
TTransport,
|
|
53
|
-
TChain,
|
|
54
|
-
TAccount,
|
|
55
|
-
TChainOverride
|
|
56
|
-
>
|
|
57
|
-
>
|
|
27
|
+
client: Client<Transport, chain, account>,
|
|
28
|
+
args: Prettify<InvalidateNonceParameters<account, accountOverride, calls>>
|
|
58
29
|
): Promise<Hash> {
|
|
59
|
-
const { account: account_ = client.account,
|
|
60
|
-
if (!account_)
|
|
30
|
+
const { account: account_ = client.account, nonceToSet } = args
|
|
31
|
+
if (!account_)
|
|
32
|
+
throw new AccountNotFoundError({
|
|
33
|
+
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
34
|
+
})
|
|
61
35
|
|
|
62
|
-
const account = parseAccount(account_) as
|
|
36
|
+
const account = parseAccount(account_) as SmartAccount
|
|
63
37
|
|
|
64
38
|
return await getAction(
|
|
65
39
|
client,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
TChain,
|
|
69
|
-
TAccount,
|
|
70
|
-
entryPoint,
|
|
71
|
-
TChainOverride
|
|
72
|
-
>,
|
|
73
|
-
"sendTransaction"
|
|
40
|
+
sendUserOperation,
|
|
41
|
+
"sendUserOperation"
|
|
74
42
|
)({
|
|
75
43
|
...args,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
44
|
+
calls: [
|
|
45
|
+
{
|
|
46
|
+
to: account.address,
|
|
47
|
+
data: encodeFunctionData({
|
|
48
|
+
abi: KernelV3AccountAbi,
|
|
49
|
+
functionName: "invalidateNonce",
|
|
50
|
+
args: [nonceToSet]
|
|
51
|
+
}),
|
|
52
|
+
value: 0n
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
account
|
|
56
|
+
} as SendUserOperationParameters)
|
|
86
57
|
}
|