@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,22 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.changeSudoValidator = void 0;
|
|
4
|
-
const smartAccount_1 = require("permissionless/actions/smartAccount");
|
|
5
|
-
const utils_1 = require("permissionless/utils");
|
|
6
4
|
const viem_1 = require("viem");
|
|
7
|
-
const
|
|
5
|
+
const account_abstraction_1 = require("viem/account-abstraction");
|
|
6
|
+
const utils_1 = require("viem/utils");
|
|
8
7
|
const KernelAccountAbi_js_1 = require("../../accounts/kernel/abi/kernel_v_3_1/KernelAccountAbi.js");
|
|
9
8
|
const constants_js_1 = require("../../constants.js");
|
|
9
|
+
const index_js_1 = require("../../errors/index.js");
|
|
10
10
|
async function changeSudoValidator(client, args) {
|
|
11
11
|
const { account: account_ = client.account, sudoValidator, hook } = args;
|
|
12
12
|
if (!account_)
|
|
13
|
-
throw new
|
|
13
|
+
throw new index_js_1.AccountNotFoundError({
|
|
14
|
+
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
15
|
+
});
|
|
14
16
|
const account = (0, utils_1.parseAccount)(account_);
|
|
15
17
|
let rootValidatorId;
|
|
16
18
|
if ([constants_js_1.VALIDATOR_TYPE.PERMISSION, constants_js_1.VALIDATOR_TYPE.SECONDARY].includes(constants_js_1.VALIDATOR_TYPE[sudoValidator.validatorType])) {
|
|
17
|
-
rootValidatorId = (0,
|
|
19
|
+
rootValidatorId = (0, utils_1.concatHex)([
|
|
18
20
|
constants_js_1.VALIDATOR_TYPE[sudoValidator.validatorType],
|
|
19
|
-
(0,
|
|
21
|
+
(0, utils_1.pad)(sudoValidator.getIdentifier(), {
|
|
20
22
|
size: 20,
|
|
21
23
|
dir: "right"
|
|
22
24
|
})
|
|
@@ -29,36 +31,40 @@ async function changeSudoValidator(client, args) {
|
|
|
29
31
|
const hookId = hook?.getIdentifier() ?? viem_1.zeroAddress;
|
|
30
32
|
const hookData = (await hook?.getEnableData(account.address)) ?? "0x";
|
|
31
33
|
if (account.kernelVersion === constants_js_1.KERNEL_V3_0) {
|
|
32
|
-
return await (0,
|
|
34
|
+
return await (0, utils_1.getAction)(client, account_abstraction_1.sendUserOperation, "sendUserOperation")({
|
|
33
35
|
...args,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
callData: await account.encodeCalls([
|
|
37
|
+
{
|
|
36
38
|
to: constants_js_1.KernelVersionToAddressesMap[constants_js_1.KERNEL_V3_1]
|
|
37
39
|
.accountImplementationAddress,
|
|
38
40
|
value: 0n,
|
|
39
|
-
data: (0,
|
|
41
|
+
data: (0, utils_1.encodeFunctionData)({
|
|
40
42
|
abi: KernelAccountAbi_js_1.KernelV3_1AccountAbi,
|
|
41
43
|
functionName: "changeRootValidator",
|
|
42
|
-
args: [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
args: [
|
|
45
|
+
rootValidatorId,
|
|
46
|
+
hookId,
|
|
47
|
+
validatorData,
|
|
48
|
+
hookData
|
|
49
|
+
]
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
], "delegatecall")
|
|
47
53
|
});
|
|
48
54
|
}
|
|
49
|
-
return await (0,
|
|
55
|
+
return await (0, utils_1.getAction)(client, account_abstraction_1.sendUserOperation, "sendUserOperation")({
|
|
50
56
|
...args,
|
|
51
|
-
|
|
52
|
-
|
|
57
|
+
callData: await account.encodeCalls([
|
|
58
|
+
{
|
|
53
59
|
to: account.address,
|
|
54
60
|
value: 0n,
|
|
55
|
-
data: (0,
|
|
61
|
+
data: (0, utils_1.encodeFunctionData)({
|
|
56
62
|
abi: KernelAccountAbi_js_1.KernelV3_1AccountAbi,
|
|
57
63
|
functionName: "changeRootValidator",
|
|
58
64
|
args: [rootValidatorId, hookId, validatorData, hookData]
|
|
59
65
|
})
|
|
60
|
-
}
|
|
61
|
-
|
|
66
|
+
}
|
|
67
|
+
])
|
|
62
68
|
});
|
|
63
69
|
}
|
|
64
70
|
exports.changeSudoValidator = changeSudoValidator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeSudoValidator.js","sourceRoot":"","sources":["../../../actions/account-client/changeSudoValidator.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"changeSudoValidator.js","sourceRoot":"","sources":["../../../actions/account-client/changeSudoValidator.ts"],"names":[],"mappings":";;;AAAA,+BAQa;AACb,kEAIiC;AACjC,sCAMmB;AAEnB,oGAAiG;AACjG,qDAK2B;AAK3B,oDAA6D;AAatD,KAAK,UAAU,mBAAmB,CAMrC,MAAyC,EACzC,IAEC;IAED,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,IAAI,CAAA;IACxE,IAAI,CAAC,QAAQ;QACT,MAAM,IAAI,+BAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IAEN,MAAM,OAAO,GAAG,IAAA,oBAAY,EACxB,QAAQ,CACuC,CAAA;IAEnD,IAAI,eAAoB,CAAA;IACxB,IACI,CAAC,6BAAc,CAAC,UAAU,EAAE,6BAAc,CAAC,SAAS,CAAC,CAAC,QAAQ,CAC1D,6BAAc,CAAC,aAAa,CAAC,aAAa,CAAC,CAC9C,EACH,CAAC;QACC,eAAe,GAAG,IAAA,iBAAS,EAAC;YACxB,6BAAc,CAAC,aAAa,CAAC,aAAa,CAAC;YAC3C,IAAA,WAAG,EAAC,aAAa,CAAC,aAAa,EAAE,EAAE;gBAC/B,IAAI,EAAE,EAAE;gBACR,GAAG,EAAE,OAAO;aACf,CAAC;SACL,CAAC,CAAA;IACN,CAAC;SAAM,CAAC;QACJ,MAAM,IAAI,KAAK,CACX,wCAAwC,aAAa,CAAC,aAAa,EAAE,CACxE,CAAA;IACL,CAAC;IAED,MAAM,aAAa,GAAG,MAAM,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAExE,MAAM,MAAM,GAAG,IAAI,EAAE,aAAa,EAAE,IAAI,kBAAW,CAAA;IAEnD,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,IAAI,CAAA;IAKrE,IAAI,OAAO,CAAC,aAAa,KAAK,0BAAW,EAAE,CAAC;QACxC,OAAO,MAAM,IAAA,iBAAS,EAClB,MAAM,EACN,uCAAiB,EACjB,mBAAmB,CACtB,CAAC;YACE,GAAG,IAAI;YACP,QAAQ,EAAE,MAAM,OAAO,CAAC,WAAW,CAC/B;gBACI;oBACI,EAAE,EAAE,0CAA2B,CAAC,0BAAW,CAAC;yBACvC,4BAA4B;oBACjC,KAAK,EAAE,EAAE;oBACT,IAAI,EAAE,IAAA,0BAAkB,EAAC;wBACrB,GAAG,EAAE,0CAAoB;wBACzB,YAAY,EAAE,qBAAqB;wBACnC,IAAI,EAAE;4BACF,eAAe;4BACf,MAAM;4BACN,aAAa;4BACb,QAAQ;yBACX;qBACJ,CAAC;iBACL;aACJ,EACD,cAAc,CACjB;SAC2B,CAAC,CAAA;IACrC,CAAC;IAKD,OAAO,MAAM,IAAA,iBAAS,EAClB,MAAM,EACN,uCAAiB,EACjB,mBAAmB,CACtB,CAAC;QACE,GAAG,IAAI;QACP,QAAQ,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC;YAChC;gBACI,EAAE,EAAE,OAAO,CAAC,OAAO;gBACnB,KAAK,EAAE,EAAE;gBACT,IAAI,EAAE,IAAA,0BAAkB,EAAC;oBACrB,GAAG,EAAE,0CAAoB;oBACzB,YAAY,EAAE,qBAAqB;oBACnC,IAAI,EAAE,CAAC,eAAe,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,CAAC;iBAC3D,CAAC;aACL;SACJ,CAAC;KAC0B,CAAC,CAAA;AACrC,CAAC;AApGD,kDAoGC"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getKernelV3ModuleCurrentNonce = void 0;
|
|
4
|
-
const utils_1 = require("permissionless/utils");
|
|
5
4
|
const actions_1 = require("viem/actions");
|
|
6
|
-
const
|
|
5
|
+
const utils_1 = require("viem/utils");
|
|
7
6
|
const KernelAccountAbi_js_1 = require("../../accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js");
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const index_js_1 = require("../../errors/index.js");
|
|
8
|
+
async function getKernelV3ModuleCurrentNonce(client) {
|
|
9
|
+
const account_ = client.account;
|
|
10
10
|
if (!account_)
|
|
11
|
-
throw new
|
|
11
|
+
throw new index_js_1.AccountNotFoundError({
|
|
12
|
+
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
13
|
+
});
|
|
12
14
|
const account = (0, utils_1.parseAccount)(account_);
|
|
13
15
|
try {
|
|
14
|
-
const nonce = await (0,
|
|
16
|
+
const nonce = await (0, utils_1.getAction)(client, actions_1.readContract, "readContract")({
|
|
15
17
|
abi: KernelAccountAbi_js_1.KernelV3AccountAbi,
|
|
16
18
|
address: account.address,
|
|
17
19
|
functionName: "currentNonce",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getKernelV3ModuleCurrentNonce.js","sourceRoot":"","sources":["../../../actions/account-client/getKernelV3ModuleCurrentNonce.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"getKernelV3ModuleCurrentNonce.js","sourceRoot":"","sources":["../../../actions/account-client/getKernelV3ModuleCurrentNonce.ts"],"names":[],"mappings":";;;AAEA,0CAA2C;AAC3C,sCAAoD;AACpD,sGAAiG;AACjG,oDAA4D;AAErD,KAAK,UAAU,6BAA6B,CAIjD,MAA4C;IAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAA;IAC/B,IAAI,CAAC,QAAQ;QACT,MAAM,IAAI,+BAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IAEN,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAAiB,CAAA;IAEtD,IAAI,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,IAAA,iBAAS,EACzB,MAAM,EACN,sBAAY,EACZ,cAAc,CACjB,CAAC;YACE,GAAG,EAAE,wCAAkB;YACvB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,YAAY,EAAE,cAAc;YAC5B,IAAI,EAAE,EAAE;SACX,CAAC,CAAA;QACF,OAAO,KAAK,CAAA;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,CAAA;IACZ,CAAC;AACL,CAAC;AA5BD,sEA4BC"}
|
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.invalidateNonce = void 0;
|
|
4
|
-
const
|
|
5
|
-
const utils_1 = require("
|
|
6
|
-
const utils_2 = require("viem/utils");
|
|
4
|
+
const account_abstraction_1 = require("viem/account-abstraction");
|
|
5
|
+
const utils_1 = require("viem/utils");
|
|
7
6
|
const KernelAccountAbi_js_1 = require("../../accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js");
|
|
7
|
+
const index_js_1 = require("../../errors/index.js");
|
|
8
8
|
async function invalidateNonce(client, args) {
|
|
9
|
-
const { account: account_ = client.account,
|
|
9
|
+
const { account: account_ = client.account, nonceToSet } = args;
|
|
10
10
|
if (!account_)
|
|
11
|
-
throw new
|
|
11
|
+
throw new index_js_1.AccountNotFoundError({
|
|
12
|
+
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
13
|
+
});
|
|
12
14
|
const account = (0, utils_1.parseAccount)(account_);
|
|
13
|
-
return await (0,
|
|
15
|
+
return await (0, utils_1.getAction)(client, account_abstraction_1.sendUserOperation, "sendUserOperation")({
|
|
14
16
|
...args,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
calls: [
|
|
18
|
+
{
|
|
19
|
+
to: account.address,
|
|
20
|
+
data: (0, utils_1.encodeFunctionData)({
|
|
21
|
+
abi: KernelAccountAbi_js_1.KernelV3AccountAbi,
|
|
22
|
+
functionName: "invalidateNonce",
|
|
23
|
+
args: [nonceToSet]
|
|
24
|
+
}),
|
|
25
|
+
value: 0n
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
account
|
|
24
29
|
});
|
|
25
30
|
}
|
|
26
31
|
exports.invalidateNonce = invalidateNonce;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invalidateNonce.js","sourceRoot":"","sources":["../../../actions/account-client/invalidateNonce.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"invalidateNonce.js","sourceRoot":"","sources":["../../../actions/account-client/invalidateNonce.ts"],"names":[],"mappings":";;;AACA,kEAIiC;AACjC,sCAAwE;AACxE,sGAAiG;AACjG,oDAA4D;AAYrD,KAAK,UAAU,eAAe,CAMjC,MAAyC,EACzC,IAA0E;IAE1E,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAC/D,IAAI,CAAC,QAAQ;QACT,MAAM,IAAI,+BAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IAEN,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAAiB,CAAA;IAEtD,OAAO,MAAM,IAAA,iBAAS,EAClB,MAAM,EACN,uCAAiB,EACjB,mBAAmB,CACtB,CAAC;QACE,GAAG,IAAI;QACP,KAAK,EAAE;YACH;gBACI,EAAE,EAAE,OAAO,CAAC,OAAO;gBACnB,IAAI,EAAE,IAAA,0BAAkB,EAAC;oBACrB,GAAG,EAAE,wCAAkB;oBACvB,YAAY,EAAE,iBAAiB;oBAC/B,IAAI,EAAE,CAAC,UAAU,CAAC;iBACrB,CAAC;gBACF,KAAK,EAAE,EAAE;aACZ;SACJ;QACD,OAAO;KACqB,CAAC,CAAA;AACrC,CAAC;AApCD,0CAoCC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendTransaction = void 0;
|
|
4
|
+
const account_abstraction_1 = require("viem/account-abstraction");
|
|
5
|
+
const utils_1 = require("viem/utils");
|
|
6
|
+
const errors_1 = require("../../errors");
|
|
7
|
+
async function sendTransaction(client, args) {
|
|
8
|
+
let userOpHash;
|
|
9
|
+
if ("to" in args) {
|
|
10
|
+
const { account: account_ = client.account, data, maxFeePerGas, maxPriorityFeePerGas, to, value, nonce } = args;
|
|
11
|
+
if (!account_) {
|
|
12
|
+
throw new errors_1.AccountNotFoundError({
|
|
13
|
+
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
const account = (0, utils_1.parseAccount)(account_);
|
|
17
|
+
if (!to)
|
|
18
|
+
throw new Error("Missing to address");
|
|
19
|
+
userOpHash = await (0, utils_1.getAction)(client, account_abstraction_1.sendUserOperation, "sendUserOperation")({
|
|
20
|
+
calls: [
|
|
21
|
+
{
|
|
22
|
+
to,
|
|
23
|
+
value: value || BigInt(0),
|
|
24
|
+
data: data || "0x"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
account,
|
|
28
|
+
maxFeePerGas,
|
|
29
|
+
maxPriorityFeePerGas,
|
|
30
|
+
nonce: nonce ? BigInt(nonce) : undefined
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
userOpHash = await (0, utils_1.getAction)(client, account_abstraction_1.sendUserOperation, "sendUserOperation")({ ...args });
|
|
35
|
+
}
|
|
36
|
+
const userOperationReceipt = await (0, utils_1.getAction)(client, account_abstraction_1.waitForUserOperationReceipt, "waitForUserOperationReceipt")({
|
|
37
|
+
hash: userOpHash
|
|
38
|
+
});
|
|
39
|
+
return userOperationReceipt?.receipt.transactionHash;
|
|
40
|
+
}
|
|
41
|
+
exports.sendTransaction = sendTransaction;
|
|
42
|
+
//# sourceMappingURL=sendTransaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendTransaction.js","sourceRoot":"","sources":["../../../actions/account-client/sendTransaction.ts"],"names":[],"mappings":";;;AASA,kEAKiC;AACjC,sCAAoD;AACpD,yCAAmD;AAgD5C,KAAK,UAAU,eAAe,CAOjC,MAAyC,EACzC,IAEkE;IAElE,IAAI,UAAgB,CAAA;IAEpB,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACf,MAAM,EACF,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,IAAI,EACJ,YAAY,EACZ,oBAAoB,EACpB,EAAE,EACF,KAAK,EACL,KAAK,EACR,GAAG,IAAI,CAAA;QAER,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,MAAM,IAAI,6BAAoB,CAAC;gBAC3B,QAAQ,EAAE,sCAAsC;aACnD,CAAC,CAAA;QACN,CAAC;QAED,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAAiB,CAAA;QAEtD,IAAI,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAA;QAE9C,UAAU,GAAG,MAAM,IAAA,iBAAS,EACxB,MAAM,EACN,uCAAiB,EACjB,mBAAmB,CACtB,CAAC;YACE,KAAK,EAAE;gBACH;oBACI,EAAE;oBACF,KAAK,EAAE,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC;oBACzB,IAAI,EAAE,IAAI,IAAI,IAAI;iBACrB;aACJ;YACD,OAAO;YACP,YAAY;YACZ,oBAAoB;YACpB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;SAC3C,CAAC,CAAA;IACN,CAAC;SAAM,CAAC;QACJ,UAAU,GAAG,MAAM,IAAA,iBAAS,EACxB,MAAM,EACN,uCAAiB,EACjB,mBAAmB,CACtB,CAAC,EAAE,GAAG,IAAI,EAA2D,CAAC,CAAA;IAC3E,CAAC;IAED,MAAM,oBAAoB,GAAG,MAAM,IAAA,iBAAS,EACxC,MAAM,EACN,iDAA2B,EAC3B,6BAA6B,CAChC,CAAC;QACE,IAAI,EAAE,UAAU;KACnB,CAAC,CAAA;IAEF,OAAO,oBAAoB,EAAE,OAAO,CAAC,eAAe,CAAA;AACxD,CAAC;AArED,0CAqEC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.signMessage = void 0;
|
|
4
|
+
const utils_1 = require("viem/utils");
|
|
5
|
+
const errors_1 = require("../../errors");
|
|
6
|
+
async function signMessage(client, { account: account_ = client.account, message }) {
|
|
7
|
+
if (!account_)
|
|
8
|
+
throw new errors_1.AccountNotFoundError({
|
|
9
|
+
docsPath: "/docs/actions/wallet/signMessage"
|
|
10
|
+
});
|
|
11
|
+
const account = (0, utils_1.parseAccount)(account_);
|
|
12
|
+
return account.signMessage({ message });
|
|
13
|
+
}
|
|
14
|
+
exports.signMessage = signMessage;
|
|
15
|
+
//# sourceMappingURL=signMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signMessage.js","sourceRoot":"","sources":["../../../actions/account-client/signMessage.ts"],"names":[],"mappings":";;;AAUA,sCAAyC;AACzC,yCAAmD;AAgD5C,KAAK,UAAU,WAAW,CAC7B,MAAsD,EACtD,EACI,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,OAAO,EACuB;IAElC,IAAI,CAAC,QAAQ;QACT,MAAM,IAAI,6BAAoB,CAAC;YAC3B,QAAQ,EAAE,kCAAkC;SAC/C,CAAC,CAAA;IAEN,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAAiB,CAAA;IAEtD,OAAO,OAAO,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC,CAAA;AAC3C,CAAC;AAfD,kCAeC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.signTypedData = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const utils_1 = require("viem/utils");
|
|
6
|
+
const errors_1 = require("../../errors");
|
|
7
|
+
async function signTypedData(client, { account: account_ = client.account, domain, message, primaryType, types: types_ }) {
|
|
8
|
+
if (!account_) {
|
|
9
|
+
throw new errors_1.AccountNotFoundError({
|
|
10
|
+
docsPath: "/docs/actions/wallet/signMessage"
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
const account = (0, utils_1.parseAccount)(account_);
|
|
14
|
+
const types = {
|
|
15
|
+
EIP712Domain: (0, viem_1.getTypesForEIP712Domain)({ domain }),
|
|
16
|
+
...types_
|
|
17
|
+
};
|
|
18
|
+
(0, viem_1.validateTypedData)({
|
|
19
|
+
domain,
|
|
20
|
+
message,
|
|
21
|
+
primaryType,
|
|
22
|
+
types
|
|
23
|
+
});
|
|
24
|
+
return account.signTypedData({
|
|
25
|
+
domain,
|
|
26
|
+
primaryType,
|
|
27
|
+
types,
|
|
28
|
+
message
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
exports.signTypedData = signTypedData;
|
|
32
|
+
//# sourceMappingURL=signTypedData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signTypedData.js","sourceRoot":"","sources":["../../../actions/account-client/signTypedData.ts"],"names":[],"mappings":";;;AAEA,+BAWa;AAEb,sCAAyC;AACzC,yCAAmD;AAoG5C,KAAK,UAAU,aAAa,CAK/B,MAAsD,EACtD,EACI,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,MAAM,EACN,OAAO,EACP,WAAW,EACX,KAAK,EAAE,MAAM,EAC6C;IAE9D,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,6BAAoB,CAAC;YAC3B,QAAQ,EAAE,kCAAkC;SAC/C,CAAC,CAAA;IACN,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAAiB,CAAA;IAEtD,MAAM,KAAK,GAAG;QACV,YAAY,EAAE,IAAA,8BAAuB,EAAC,EAAE,MAAM,EAE7C,CAAC;QACF,GAAI,MAAqB;KAC5B,CAAA;IAED,IAAA,wBAAiB,EAAC;QACd,MAAM;QACN,OAAO;QACP,WAAW;QACX,KAAK;KACe,CAAC,CAAA;IAEzB,OAAO,OAAO,CAAC,aAAa,CAAC;QACzB,MAAM;QACN,WAAW;QACX,KAAK;QACL,OAAO;KACa,CAAC,CAAA;AAC7B,CAAC;AA1CD,sCA0CC"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.signUserOperation = void 0;
|
|
4
|
-
const
|
|
5
|
-
const utils_1 = require("
|
|
6
|
-
const
|
|
4
|
+
const account_abstraction_1 = require("viem/account-abstraction");
|
|
5
|
+
const utils_1 = require("viem/utils");
|
|
6
|
+
const errors_1 = require("../../errors");
|
|
7
7
|
async function signUserOperation(client, args) {
|
|
8
8
|
const { account: account_ = client.account } = args;
|
|
9
9
|
if (!account_)
|
|
10
|
-
throw new
|
|
10
|
+
throw new errors_1.AccountNotFoundError({
|
|
11
|
+
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
12
|
+
});
|
|
11
13
|
const account = (0, utils_1.parseAccount)(account_);
|
|
12
|
-
const userOperation = await (0,
|
|
14
|
+
const userOperation = await (0, utils_1.getAction)(client, account_abstraction_1.prepareUserOperation, "prepareUserOperation")({ ...args, account });
|
|
13
15
|
userOperation.signature = await account.signUserOperation(userOperation);
|
|
14
16
|
return userOperation;
|
|
15
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signUserOperation.js","sourceRoot":"","sources":["../../../actions/account-client/signUserOperation.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"signUserOperation.js","sourceRoot":"","sources":["../../../actions/account-client/signUserOperation.ts"],"names":[],"mappings":";;;AACA,kEAMiC;AACjC,sCAAoD;AACpD,yCAAmD;AAU5C,KAAK,UAAU,iBAAiB,CAMnC,MAAyC,EACzC,IAAkE;IAElE,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAA;IACnD,IAAI,CAAC,QAAQ;QACT,MAAM,IAAI,6BAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IAEN,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAAiB,CAAA;IAEtD,MAAM,aAAa,GAAG,MAAM,IAAA,iBAAS,EACjC,MAAM,EACN,0CAAoB,EACpB,sBAAsB,CACzB,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAoC,CAAC,CAAA;IAEzD,aAAa,CAAC,SAAS,GAAG,MAAM,OAAO,CAAC,iBAAiB,CACrD,aAA8B,CACjC,CAAA;IAED,OAAO,aAAa,CAAA;AACxB,CAAC;AA5BD,8CA4BC"}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.uninstallPlugin = void 0;
|
|
4
|
-
const
|
|
5
|
-
const utils_1 = require("
|
|
6
|
-
const utils_2 = require("viem/utils");
|
|
4
|
+
const account_abstraction_1 = require("viem/account-abstraction");
|
|
5
|
+
const utils_1 = require("viem/utils");
|
|
7
6
|
const KernelAccountAbi_js_1 = require("../../accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js");
|
|
8
7
|
const constants_js_1 = require("../../constants.js");
|
|
8
|
+
const index_js_1 = require("../../errors/index.js");
|
|
9
9
|
async function uninstallPlugin(client, args) {
|
|
10
|
-
const { account: account_ = client.account,
|
|
10
|
+
const { account: account_ = client.account, plugin, hook } = args;
|
|
11
11
|
if (!account_)
|
|
12
|
-
throw new
|
|
12
|
+
throw new index_js_1.AccountNotFoundError({
|
|
13
|
+
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
14
|
+
});
|
|
13
15
|
const account = (0, utils_1.parseAccount)(account_);
|
|
14
16
|
let validatorId;
|
|
15
17
|
if ([constants_js_1.VALIDATOR_TYPE.PERMISSION, constants_js_1.VALIDATOR_TYPE.SECONDARY].includes(constants_js_1.VALIDATOR_TYPE[plugin.validatorType])) {
|
|
16
|
-
validatorId = (0,
|
|
18
|
+
validatorId = (0, utils_1.concatHex)([
|
|
17
19
|
constants_js_1.VALIDATOR_TYPE[plugin.validatorType],
|
|
18
|
-
(0,
|
|
20
|
+
(0, utils_1.pad)(plugin.getIdentifier(), {
|
|
19
21
|
size: 20,
|
|
20
22
|
dir: "right"
|
|
21
23
|
})
|
|
@@ -26,12 +28,12 @@ async function uninstallPlugin(client, args) {
|
|
|
26
28
|
}
|
|
27
29
|
const validatorData = await plugin.getEnableData(account.address);
|
|
28
30
|
const hookData = (await hook?.getEnableData(account.address)) ?? "0x";
|
|
29
|
-
return await (0,
|
|
31
|
+
return await (0, utils_1.getAction)(client, account_abstraction_1.sendUserOperation, "sendUserOperation")({
|
|
30
32
|
...args,
|
|
31
|
-
|
|
33
|
+
calls: [
|
|
32
34
|
{
|
|
33
35
|
to: account.address,
|
|
34
|
-
data: (0,
|
|
36
|
+
data: (0, utils_1.encodeFunctionData)({
|
|
35
37
|
abi: KernelAccountAbi_js_1.KernelV3AccountAbi,
|
|
36
38
|
functionName: "uninstallValidation",
|
|
37
39
|
args: [validatorId, validatorData, hookData]
|
|
@@ -39,8 +41,7 @@ async function uninstallPlugin(client, args) {
|
|
|
39
41
|
value: 0n
|
|
40
42
|
}
|
|
41
43
|
],
|
|
42
|
-
account
|
|
43
|
-
middleware
|
|
44
|
+
account
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
47
|
exports.uninstallPlugin = uninstallPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uninstallPlugin.js","sourceRoot":"","sources":["../../../actions/account-client/uninstallPlugin.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"uninstallPlugin.js","sourceRoot":"","sources":["../../../actions/account-client/uninstallPlugin.ts"],"names":[],"mappings":";;;AACA,kEAIiC;AACjC,sCAMmB;AACnB,sGAAiG;AACjG,qDAAmD;AACnD,oDAA4D;AAerD,KAAK,UAAU,eAAe,CAMjC,MAAyC,EACzC,IAAgE;IAEhE,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAA;IACjE,IAAI,CAAC,QAAQ;QACT,MAAM,IAAI,+BAAoB,CAAC;YAC3B,QAAQ,EAAE,sCAAsC;SACnD,CAAC,CAAA;IAEN,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAAiB,CAAA;IAEtD,IAAI,WAAgB,CAAA;IACpB,IACI,CAAC,6BAAc,CAAC,UAAU,EAAE,6BAAc,CAAC,SAAS,CAAC,CAAC,QAAQ,CAC1D,6BAAc,CAAC,MAAM,CAAC,aAAa,CAAC,CACvC,EACH,CAAC;QACC,WAAW,GAAG,IAAA,iBAAS,EAAC;YACpB,6BAAc,CAAC,MAAM,CAAC,aAAa,CAAC;YACpC,IAAA,WAAG,EAAC,MAAM,CAAC,aAAa,EAAE,EAAE;gBACxB,IAAI,EAAE,EAAE;gBACR,GAAG,EAAE,OAAO;aACf,CAAC;SACL,CAAC,CAAA;IACN,CAAC;SAAM,CAAC;QACJ,MAAM,IAAI,KAAK,CAAC,oBAAoB,MAAM,CAAC,aAAa,SAAS,CAAC,CAAA;IACtE,CAAC;IAED,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAEjE,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,IAAI,CAAA;IACrE,OAAO,MAAM,IAAA,iBAAS,EAClB,MAAM,EACN,uCAAiB,EACjB,mBAAmB,CACtB,CAAC;QACE,GAAG,IAAI;QACP,KAAK,EAAE;YACH;gBACI,EAAE,EAAE,OAAO,CAAC,OAAO;gBACnB,IAAI,EAAE,IAAA,0BAAkB,EAAC;oBACrB,GAAG,EAAE,wCAAkB;oBACvB,YAAY,EAAE,qBAAqB;oBACnC,IAAI,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,QAAQ,CAAC;iBAC/C,CAAC;gBACF,KAAK,EAAE,EAAE;aACZ;SACJ;QACD,OAAO;KACqB,CAAC,CAAA;AACrC,CAAC;AAxDD,0CAwDC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.writeContract = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const utils_1 = require("viem/utils");
|
|
6
|
+
const sendTransaction_js_1 = require("./sendTransaction.js");
|
|
7
|
+
async function writeContract(client, { abi, address, args, dataSuffix, functionName, ...request }) {
|
|
8
|
+
const data = (0, viem_1.encodeFunctionData)({
|
|
9
|
+
abi,
|
|
10
|
+
args,
|
|
11
|
+
functionName
|
|
12
|
+
});
|
|
13
|
+
const hash = await (0, utils_1.getAction)(client, (sendTransaction_js_1.sendTransaction), "sendTransaction")({
|
|
14
|
+
data: `${data}${dataSuffix ? dataSuffix.replace("0x", "") : ""}`,
|
|
15
|
+
to: address,
|
|
16
|
+
...request
|
|
17
|
+
});
|
|
18
|
+
return hash;
|
|
19
|
+
}
|
|
20
|
+
exports.writeContract = writeContract;
|
|
21
|
+
//# sourceMappingURL=writeContract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeContract.js","sourceRoot":"","sources":["../../../actions/account-client/writeContract.ts"],"names":[],"mappings":";;;AAEA,+BAYa;AAEb,sCAAsC;AACtC,6DAAsD;AAE/C,KAAK,UAAU,aAAa,CAe/B,MAA2C,EAC3C,EACI,GAAG,EACH,OAAO,EACP,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,GAAG,OAAO,EAQb;IAED,MAAM,IAAI,GAAG,IAAA,yBAAkB,EAAsB;QACjD,GAAG;QACH,IAAI;QACJ,YAAY;KACsC,CAAC,CAAA;IAEvD,MAAM,IAAI,GAAG,MAAM,IAAA,iBAAS,EACxB,MAAM,EACN,CAAA,oCAA+C,CAAA,EAC/C,iBAAiB,CACpB,CAAC;QACE,IAAI,EAAE,GAAG,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;QAChE,EAAE,EAAE,OAAO;QACX,GAAG,OAAO;KAKb,CAAC,CAAA;IACF,OAAO,IAAI,CAAA;AACf,CAAC;AApDD,sCAoDC"}
|
package/_cjs/actions/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.estimateGasInERC20 = exports.changeSudoValidator = exports.writeContract = exports.signTypedData = exports.signMessage = exports.sendTransaction = exports.invalidateNonce = exports.getKernelV3ModuleCurrentNonce = exports.uninstallPlugin = exports.getUserOperationGasPrice = exports.signUserOperation = exports.sponsorUserOperation = void 0;
|
|
4
4
|
var sponsorUserOperation_js_1 = require("./paymaster/sponsorUserOperation.js");
|
|
5
5
|
Object.defineProperty(exports, "sponsorUserOperation", { enumerable: true, get: function () { return sponsorUserOperation_js_1.sponsorUserOperation; } });
|
|
6
6
|
var signUserOperation_js_1 = require("./account-client/signUserOperation.js");
|
|
@@ -9,10 +9,20 @@ var getUserOperationGasPrice_js_1 = require("./account-client/getUserOperationGa
|
|
|
9
9
|
Object.defineProperty(exports, "getUserOperationGasPrice", { enumerable: true, get: function () { return getUserOperationGasPrice_js_1.getUserOperationGasPrice; } });
|
|
10
10
|
var uninstallPlugin_js_1 = require("./account-client/uninstallPlugin.js");
|
|
11
11
|
Object.defineProperty(exports, "uninstallPlugin", { enumerable: true, get: function () { return uninstallPlugin_js_1.uninstallPlugin; } });
|
|
12
|
+
var getKernelV3ModuleCurrentNonce_js_1 = require("./account-client/getKernelV3ModuleCurrentNonce.js");
|
|
13
|
+
Object.defineProperty(exports, "getKernelV3ModuleCurrentNonce", { enumerable: true, get: function () { return getKernelV3ModuleCurrentNonce_js_1.getKernelV3ModuleCurrentNonce; } });
|
|
14
|
+
var invalidateNonce_js_1 = require("./account-client/invalidateNonce.js");
|
|
15
|
+
Object.defineProperty(exports, "invalidateNonce", { enumerable: true, get: function () { return invalidateNonce_js_1.invalidateNonce; } });
|
|
16
|
+
var sendTransaction_js_1 = require("./account-client/sendTransaction.js");
|
|
17
|
+
Object.defineProperty(exports, "sendTransaction", { enumerable: true, get: function () { return sendTransaction_js_1.sendTransaction; } });
|
|
18
|
+
var signMessage_js_1 = require("./account-client/signMessage.js");
|
|
19
|
+
Object.defineProperty(exports, "signMessage", { enumerable: true, get: function () { return signMessage_js_1.signMessage; } });
|
|
20
|
+
var signTypedData_js_1 = require("./account-client/signTypedData.js");
|
|
21
|
+
Object.defineProperty(exports, "signTypedData", { enumerable: true, get: function () { return signTypedData_js_1.signTypedData; } });
|
|
22
|
+
var writeContract_js_1 = require("./account-client/writeContract.js");
|
|
23
|
+
Object.defineProperty(exports, "writeContract", { enumerable: true, get: function () { return writeContract_js_1.writeContract; } });
|
|
12
24
|
var changeSudoValidator_js_1 = require("./account-client/changeSudoValidator.js");
|
|
13
25
|
Object.defineProperty(exports, "changeSudoValidator", { enumerable: true, get: function () { return changeSudoValidator_js_1.changeSudoValidator; } });
|
|
14
26
|
var estimateGasInERC20_js_1 = require("./paymaster/estimateGasInERC20.js");
|
|
15
27
|
Object.defineProperty(exports, "estimateGasInERC20", { enumerable: true, get: function () { return estimateGasInERC20_js_1.estimateGasInERC20; } });
|
|
16
|
-
var sponsorUserOperationEip7677_js_1 = require("./paymaster/sponsorUserOperationEip7677.js");
|
|
17
|
-
Object.defineProperty(exports, "sponsorUserOperationEip7677", { enumerable: true, get: function () { return sponsorUserOperationEip7677_js_1.sponsorUserOperationEip7677; } });
|
|
18
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":";;;AAAA,+EAI4C;AAHxC,+HAAA,oBAAoB,OAAA;AAKxB,8EAI8C;AAH1C,yHAAA,iBAAiB,OAAA;AAKrB,4FAGqD;AAFjD,uIAAA,wBAAwB,OAAA;AAI5B,0EAG4C;AAFxC,qHAAA,eAAe,OAAA;AAInB,kFAGgD;AAF5C,6HAAA,mBAAmB,OAAA;AAIvB,2EAI0C;AAHtC,2HAAA,kBAAkB,OAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":";;;AAAA,+EAI4C;AAHxC,+HAAA,oBAAoB,OAAA;AAKxB,8EAI8C;AAH1C,yHAAA,iBAAiB,OAAA;AAKrB,4FAGqD;AAFjD,uIAAA,wBAAwB,OAAA;AAI5B,0EAG4C;AAFxC,qHAAA,eAAe,OAAA;AAInB,sGAAiG;AAAxF,iJAAA,6BAA6B,OAAA;AAEtC,0EAG4C;AADxC,qHAAA,eAAe,OAAA;AAGnB,0EAAqE;AAA5D,qHAAA,eAAe,OAAA;AAExB,kEAA6D;AAApD,6GAAA,WAAW,OAAA;AAEpB,sEAAiE;AAAxD,iHAAA,aAAa,OAAA;AAEtB,sEAAiE;AAAxD,iHAAA,aAAa,OAAA;AAEtB,kFAGgD;AAF5C,6HAAA,mBAAmB,OAAA;AAIvB,2EAI0C;AAHtC,2HAAA,kBAAkB,OAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.estimateGasInERC20 = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const account_abstraction_1 = require("viem/account-abstraction");
|
|
5
|
+
const utils_js_1 = require("../../utils.js");
|
|
6
6
|
const estimateGasInERC20 = async (client, args) => {
|
|
7
7
|
const response = await client.request({
|
|
8
8
|
method: "stackup_getERC20TokenQuotes",
|
|
@@ -10,11 +10,11 @@ const estimateGasInERC20 = async (client, args) => {
|
|
|
10
10
|
{
|
|
11
11
|
chainId: client.chain?.id,
|
|
12
12
|
userOp: {
|
|
13
|
-
...(0,
|
|
13
|
+
...(0, utils_js_1.deepHexlify)(args.userOperation),
|
|
14
14
|
initCode: args.userOperation.initCode || "0x"
|
|
15
15
|
},
|
|
16
16
|
tokenAddress: args.gasTokenAddress,
|
|
17
|
-
entryPointAddress: args.entryPoint ??
|
|
17
|
+
entryPointAddress: args.entryPoint ?? account_abstraction_1.entryPoint06Address
|
|
18
18
|
}
|
|
19
19
|
]
|
|
20
20
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"estimateGasInERC20.js","sourceRoot":"","sources":["../../../actions/paymaster/estimateGasInERC20.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"estimateGasInERC20.js","sourceRoot":"","sources":["../../../actions/paymaster/estimateGasInERC20.ts"],"names":[],"mappings":";;;AACA,kEAIiC;AAEjC,6CAA4C;AAqBrC,MAAM,kBAAkB,GAAG,KAAK,EAGnC,MAAiD,EACjD,IAAkC,EACG,EAAE;IACvC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,6BAA6B;QACrC,MAAM,EAAE;YACJ;gBACI,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,EAAY;gBACnC,MAAM,EAAE;oBACJ,GAAG,IAAA,sBAAW,EAAC,IAAI,CAAC,aAAa,CAAC;oBAClC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,IAAI,IAAI;iBAChD;gBACD,YAAY,EAAE,IAAI,CAAC,eAAe;gBAClC,iBAAiB,EAAE,IAAI,CAAC,UAAU,IAAI,yCAAmB;aAC5D;SACJ;KACJ,CAAC,CAAA;IAEF,MAAM,MAAM,GAAkC;QAC1C,eAAe,EAAE,QAAQ,CAAC,eAAe;QACzC,aAAa,EAAE,QAAQ,CAAC,aAAa;KACxC,CAAA;IAED,MAAM,MAAM,GACR,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;IAEvE,OAAO,EAAE,MAAM,EAAE,CAAA;AACrB,CAAC,CAAA;AA9BY,QAAA,kBAAkB,sBA8B9B"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sponsorUserOperation = void 0;
|
|
4
|
-
const
|
|
5
|
-
const utils_1 = require("permissionless/utils");
|
|
4
|
+
const utils_js_1 = require("../../utils.js");
|
|
6
5
|
const sponsorUserOperation = async (client, args) => {
|
|
7
6
|
const response = await client.request({
|
|
8
7
|
method: "zd_sponsorUserOperation",
|
|
9
8
|
params: [
|
|
10
9
|
{
|
|
11
10
|
chainId: client.chain?.id,
|
|
12
|
-
userOp: (0,
|
|
13
|
-
entryPointAddress: args.entryPoint,
|
|
11
|
+
userOp: (0, utils_js_1.deepHexlify)(args.userOperation),
|
|
12
|
+
entryPointAddress: args.entryPoint.address,
|
|
14
13
|
gasTokenData: args.gasToken && {
|
|
15
14
|
tokenAddress: args.gasToken
|
|
16
15
|
},
|
|
@@ -19,8 +18,7 @@ const sponsorUserOperation = async (client, args) => {
|
|
|
19
18
|
}
|
|
20
19
|
]
|
|
21
20
|
});
|
|
22
|
-
|
|
23
|
-
if (entryPointVersion === "v0.6") {
|
|
21
|
+
if (args.entryPoint.version === "0.6") {
|
|
24
22
|
return {
|
|
25
23
|
paymasterAndData: response.paymasterAndData,
|
|
26
24
|
preVerificationGas: BigInt(response.preVerificationGas),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/paymaster/sponsorUserOperation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/paymaster/sponsorUserOperation.ts"],"names":[],"mappings":";;;AAKA,6CAA4C;AA2DrC,MAAM,oBAAoB,GAAG,KAAK,EAGrC,MAAiD,EACjD,IAAuD,EACG,EAAE;IAC5D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,yBAAyB;QACjC,MAAM,EAAE;YACJ;gBACI,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,EAAY;gBACnC,MAAM,EAAE,IAAA,sBAAW,EAAC,IAAI,CAAC,aAAa,CAAC;gBACvC,iBAAiB,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO;gBAC1C,YAAY,EAAE,IAAI,CAAC,QAAQ,IAAI;oBAC3B,YAAY,EAAE,IAAI,CAAC,QAAQ;iBAC9B;gBACD,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,IAAI,KAAK;gBAClD,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,IAAI;aAC5C;SACJ;KACJ,CAAC,CAAA;IACF,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;QACpC,OAAO;YACH,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;YAC3C,kBAAkB,EAAE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC;YACvD,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC;YAC3D,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;YAC3C,YAAY,EACR,QAAQ,CAAC,YAAY,IAAI,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;YAC1D,oBAAoB,EAChB,QAAQ,CAAC,oBAAoB;gBAC7B,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC;SACS,CAAA;IAC1D,CAAC;IACD,MAAM,WAAW,GAAG,QAWnB,CAAA;IAED,OAAO;QACH,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,oBAAoB,EAAE,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC;QAC9D,kBAAkB,EAAE,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC;QAC1D,SAAS,EAAE,WAAW,CAAC,SAAS;QAChC,6BAA6B,EAAE,MAAM,CACjC,WAAW,CAAC,6BAA6B,CAC5C;QACD,uBAAuB,EAAE,MAAM,CAAC,WAAW,CAAC,uBAAuB,CAAC;QACpE,aAAa,EAAE,WAAW,CAAC,aAAa;QACxC,YAAY,EAAE,QAAQ,CAAC,YAAY,IAAI,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;QACpE,oBAAoB,EAChB,QAAQ,CAAC,oBAAoB;YAC7B,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC;KACS,CAAA;AAC1D,CAAC,CAAA;AA9DY,QAAA,oBAAoB,wBA8DhC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAccountNonce = void 0;
|
|
4
|
+
const actions_1 = require("viem/actions");
|
|
5
|
+
const utils_1 = require("viem/utils");
|
|
6
|
+
const getAccountNonce = async (client, args) => {
|
|
7
|
+
const { address, entryPointAddress, key = BigInt(0) } = args;
|
|
8
|
+
return await (0, utils_1.getAction)(client, actions_1.readContract, "readContract")({
|
|
9
|
+
address: entryPointAddress,
|
|
10
|
+
abi: [
|
|
11
|
+
{
|
|
12
|
+
inputs: [
|
|
13
|
+
{
|
|
14
|
+
name: "sender",
|
|
15
|
+
type: "address"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "key",
|
|
19
|
+
type: "uint192"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
name: "getNonce",
|
|
23
|
+
outputs: [
|
|
24
|
+
{
|
|
25
|
+
name: "nonce",
|
|
26
|
+
type: "uint256"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
stateMutability: "view",
|
|
30
|
+
type: "function"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
functionName: "getNonce",
|
|
34
|
+
args: [address, key]
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
exports.getAccountNonce = getAccountNonce;
|
|
38
|
+
//# sourceMappingURL=getAccountNonce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAccountNonce.js","sourceRoot":"","sources":["../../../actions/public/getAccountNonce.ts"],"names":[],"mappings":";;;AAGA,0CAA2C;AAC3C,sCAAsC;AAkC/B,MAAM,eAAe,GAAG,KAAK,EAChC,MAAc,EACd,IAA2B,EACZ,EAAE;IACjB,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAA;IAE5D,OAAO,MAAM,IAAA,iBAAS,EAClB,MAAM,EACN,sBAAY,EACZ,cAAc,CACjB,CAAC;QACE,OAAO,EAAE,iBAAiB;QAC1B,GAAG,EAAE;YACD;gBACI,MAAM,EAAE;oBACJ;wBACI,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,SAAS;qBAClB;oBACD;wBACI,IAAI,EAAE,KAAK;wBACX,IAAI,EAAE,SAAS;qBAClB;iBACJ;gBACD,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,OAAO;wBACb,IAAI,EAAE,SAAS;qBAClB;iBACJ;gBACD,eAAe,EAAE,MAAM;gBACvB,IAAI,EAAE,UAAU;aACnB;SACJ;QACD,YAAY,EAAE,UAAU;QACxB,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC;KACvB,CAAC,CAAA;AACN,CAAC,CAAA;AAtCY,QAAA,eAAe,mBAsC3B"}
|