@startale-scs/aa-sdk 0.0.0-dev.20260331120000
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/LICENSE +21 -0
- package/README.md +73 -0
- package/dist/_cjs/account/decorators/getFactoryData.js +36 -0
- package/dist/_cjs/account/decorators/getFactoryData.js.map +1 -0
- package/dist/_cjs/account/decorators/getStartaleAccountAddress.js +18 -0
- package/dist/_cjs/account/decorators/getStartaleAccountAddress.js.map +1 -0
- package/dist/_cjs/account/decorators/index.js +6 -0
- package/dist/_cjs/account/decorators/index.js.map +1 -0
- package/dist/_cjs/account/index.js +6 -0
- package/dist/_cjs/account/index.js.map +1 -0
- package/dist/_cjs/account/toStartaleSmartAccount.js +311 -0
- package/dist/_cjs/account/toStartaleSmartAccount.js.map +1 -0
- package/dist/_cjs/account/utils/AccountNotFound.js +18 -0
- package/dist/_cjs/account/utils/AccountNotFound.js.map +1 -0
- package/dist/_cjs/account/utils/Constants.js +128 -0
- package/dist/_cjs/account/utils/Constants.js.map +1 -0
- package/dist/_cjs/account/utils/Helpers.js +39 -0
- package/dist/_cjs/account/utils/Helpers.js.map +1 -0
- package/dist/_cjs/account/utils/Logger.js +35 -0
- package/dist/_cjs/account/utils/Logger.js.map +1 -0
- package/dist/_cjs/account/utils/Types.js +3 -0
- package/dist/_cjs/account/utils/Types.js.map +1 -0
- package/dist/_cjs/account/utils/Utils.js +258 -0
- package/dist/_cjs/account/utils/Utils.js.map +1 -0
- package/dist/_cjs/account/utils/addressToEmptyAccount.js +24 -0
- package/dist/_cjs/account/utils/addressToEmptyAccount.js.map +1 -0
- package/dist/_cjs/account/utils/contractSimulation.js +27 -0
- package/dist/_cjs/account/utils/contractSimulation.js.map +1 -0
- package/dist/_cjs/account/utils/deepHexlify.js +26 -0
- package/dist/_cjs/account/utils/deepHexlify.js.map +1 -0
- package/dist/_cjs/account/utils/eip7702Utils.js +21 -0
- package/dist/_cjs/account/utils/eip7702Utils.js.map +1 -0
- package/dist/_cjs/account/utils/fromBundlerClient.js +45 -0
- package/dist/_cjs/account/utils/fromBundlerClient.js.map +1 -0
- package/dist/_cjs/account/utils/getAAError.js +37 -0
- package/dist/_cjs/account/utils/getAAError.js.map +1 -0
- package/dist/_cjs/account/utils/getChain.js +66 -0
- package/dist/_cjs/account/utils/getChain.js.map +1 -0
- package/dist/_cjs/account/utils/getVersion.js +46 -0
- package/dist/_cjs/account/utils/getVersion.js.map +1 -0
- package/dist/_cjs/account/utils/index.js +28 -0
- package/dist/_cjs/account/utils/index.js.map +1 -0
- package/dist/_cjs/account/utils/parseErrorMessage.js +79 -0
- package/dist/_cjs/account/utils/parseErrorMessage.js.map +1 -0
- package/dist/_cjs/account/utils/tenderlySimulation.js +52 -0
- package/dist/_cjs/account/utils/tenderlySimulation.js.map +1 -0
- package/dist/_cjs/account/utils/toInitData.js +13 -0
- package/dist/_cjs/account/utils/toInitData.js.map +1 -0
- package/dist/_cjs/account/utils/toInstallData.js +15 -0
- package/dist/_cjs/account/utils/toInstallData.js.map +1 -0
- package/dist/_cjs/account/utils/toSigner.js +81 -0
- package/dist/_cjs/account/utils/toSigner.js.map +1 -0
- package/dist/_cjs/clients/createHttpClient.js +46 -0
- package/dist/_cjs/clients/createHttpClient.js.map +1 -0
- package/dist/_cjs/clients/createSCSBundlerClient.js +85 -0
- package/dist/_cjs/clients/createSCSBundlerClient.js.map +1 -0
- package/dist/_cjs/clients/createSCSPaymasterClient.js +48 -0
- package/dist/_cjs/clients/createSCSPaymasterClient.js.map +1 -0
- package/dist/_cjs/clients/decorators/bundler/getGasFeeValues.js +49 -0
- package/dist/_cjs/clients/decorators/bundler/getGasFeeValues.js.map +1 -0
- package/dist/_cjs/clients/decorators/bundler/index.js +11 -0
- package/dist/_cjs/clients/decorators/bundler/index.js.map +1 -0
- package/dist/_cjs/clients/decorators/bundler/waitForUserOperationReceipt.js +11 -0
- package/dist/_cjs/clients/decorators/bundler/waitForUserOperationReceipt.js.map +1 -0
- package/dist/_cjs/clients/decorators/erc7579/accountId.js +65 -0
- package/dist/_cjs/clients/decorators/erc7579/accountId.js.map +1 -0
- package/dist/_cjs/clients/decorators/erc7579/getActiveHook.js +43 -0
- package/dist/_cjs/clients/decorators/erc7579/getActiveHook.js.map +1 -0
- package/dist/_cjs/clients/decorators/erc7579/getFallbackBySelector.js +56 -0
- package/dist/_cjs/clients/decorators/erc7579/getFallbackBySelector.js.map +1 -0
- package/dist/_cjs/clients/decorators/erc7579/getInstalledExecutors.js +63 -0
- package/dist/_cjs/clients/decorators/erc7579/getInstalledExecutors.js.map +1 -0
- package/dist/_cjs/clients/decorators/erc7579/getInstalledValidators.js +61 -0
- package/dist/_cjs/clients/decorators/erc7579/getInstalledValidators.js.map +1 -0
- package/dist/_cjs/clients/decorators/erc7579/getPreviousModule.js +37 -0
- package/dist/_cjs/clients/decorators/erc7579/getPreviousModule.js.map +1 -0
- package/dist/_cjs/clients/decorators/erc7579/index.js +64 -0
- package/dist/_cjs/clients/decorators/erc7579/index.js.map +1 -0
- package/dist/_cjs/clients/decorators/erc7579/installModule.js +73 -0
- package/dist/_cjs/clients/decorators/erc7579/installModule.js.map +1 -0
- package/dist/_cjs/clients/decorators/erc7579/installModules.js +25 -0
- package/dist/_cjs/clients/decorators/erc7579/installModules.js.map +1 -0
- package/dist/_cjs/clients/decorators/erc7579/isModuleInstalled.js +90 -0
- package/dist/_cjs/clients/decorators/erc7579/isModuleInstalled.js.map +1 -0
- package/dist/_cjs/clients/decorators/erc7579/supportsExecutionMode.js +102 -0
- package/dist/_cjs/clients/decorators/erc7579/supportsExecutionMode.js.map +1 -0
- package/dist/_cjs/clients/decorators/erc7579/supportsModule.js +90 -0
- package/dist/_cjs/clients/decorators/erc7579/supportsModule.js.map +1 -0
- package/dist/_cjs/clients/decorators/erc7579/uninstallFallback.js +61 -0
- package/dist/_cjs/clients/decorators/erc7579/uninstallFallback.js.map +1 -0
- package/dist/_cjs/clients/decorators/erc7579/uninstallModule.js +79 -0
- package/dist/_cjs/clients/decorators/erc7579/uninstallModule.js.map +1 -0
- package/dist/_cjs/clients/decorators/erc7579/uninstallModules.js +26 -0
- package/dist/_cjs/clients/decorators/erc7579/uninstallModules.js.map +1 -0
- package/dist/_cjs/clients/decorators/index.js +8 -0
- package/dist/_cjs/clients/decorators/index.js.map +1 -0
- package/dist/_cjs/clients/decorators/smartAccount/debugUserOperation.js +75 -0
- package/dist/_cjs/clients/decorators/smartAccount/debugUserOperation.js.map +1 -0
- package/dist/_cjs/clients/decorators/smartAccount/index.js +32 -0
- package/dist/_cjs/clients/decorators/smartAccount/index.js.map +1 -0
- package/dist/_cjs/clients/decorators/smartAccount/prepareTokenPaymasterUserOp.js +32 -0
- package/dist/_cjs/clients/decorators/smartAccount/prepareTokenPaymasterUserOp.js.map +1 -0
- package/dist/_cjs/clients/decorators/smartAccount/prepareUserOperationWithoutSignature.js +35 -0
- package/dist/_cjs/clients/decorators/smartAccount/prepareUserOperationWithoutSignature.js.map +1 -0
- package/dist/_cjs/clients/decorators/smartAccount/sendTokenPaymasterUserOp.js +21 -0
- package/dist/_cjs/clients/decorators/smartAccount/sendTokenPaymasterUserOp.js.map +1 -0
- package/dist/_cjs/clients/decorators/smartAccount/sendTransaction.js +41 -0
- package/dist/_cjs/clients/decorators/smartAccount/sendTransaction.js.map +1 -0
- package/dist/_cjs/clients/decorators/smartAccount/signMessage.js +14 -0
- package/dist/_cjs/clients/decorators/smartAccount/signMessage.js.map +1 -0
- package/dist/_cjs/clients/decorators/smartAccount/signTypedData.js +31 -0
- package/dist/_cjs/clients/decorators/smartAccount/signTypedData.js.map +1 -0
- package/dist/_cjs/clients/decorators/smartAccount/upgradeSmartAccount.js +61 -0
- package/dist/_cjs/clients/decorators/smartAccount/upgradeSmartAccount.js.map +1 -0
- package/dist/_cjs/clients/decorators/smartAccount/waitForTransactionReceipt.js +17 -0
- package/dist/_cjs/clients/decorators/smartAccount/waitForTransactionReceipt.js.map +1 -0
- package/dist/_cjs/clients/decorators/smartAccount/writeContract.js +20 -0
- package/dist/_cjs/clients/decorators/smartAccount/writeContract.js.map +1 -0
- package/dist/_cjs/clients/decorators/tokenPaymaster/getSupportedTokens.js +25 -0
- package/dist/_cjs/clients/decorators/tokenPaymaster/getSupportedTokens.js.map +1 -0
- package/dist/_cjs/clients/decorators/tokenPaymaster/getTokenPaymasterQuotes.js +71 -0
- package/dist/_cjs/clients/decorators/tokenPaymaster/getTokenPaymasterQuotes.js.map +1 -0
- package/dist/_cjs/clients/decorators/tokenPaymaster/index.js +11 -0
- package/dist/_cjs/clients/decorators/tokenPaymaster/index.js.map +1 -0
- package/dist/_cjs/clients/index.js +8 -0
- package/dist/_cjs/clients/index.js.map +1 -0
- package/dist/_cjs/constants/abi/AccountFactory.js +337 -0
- package/dist/_cjs/constants/abi/AccountFactory.js.map +1 -0
- package/dist/_cjs/constants/abi/AccountImplementationAbi.js +1179 -0
- package/dist/_cjs/constants/abi/AccountImplementationAbi.js.map +1 -0
- package/dist/_cjs/constants/abi/BootstrapAbi.js +730 -0
- package/dist/_cjs/constants/abi/BootstrapAbi.js.map +1 -0
- package/dist/_cjs/constants/abi/ComposabilityAbi.js +274 -0
- package/dist/_cjs/constants/abi/ComposabilityAbi.js.map +1 -0
- package/dist/_cjs/constants/abi/EIP1271Abi.js +31 -0
- package/dist/_cjs/constants/abi/EIP1271Abi.js.map +1 -0
- package/dist/_cjs/constants/abi/ERC7484RegistryAbi.js +17 -0
- package/dist/_cjs/constants/abi/ERC7484RegistryAbi.js.map +1 -0
- package/dist/_cjs/constants/abi/EntryPointABI.js +661 -0
- package/dist/_cjs/constants/abi/EntryPointABI.js.map +1 -0
- package/dist/_cjs/constants/abi/SmartSessionAbi.js +1472 -0
- package/dist/_cjs/constants/abi/SmartSessionAbi.js.map +1 -0
- package/dist/_cjs/constants/abi/TokenWithPermitAbi.js +622 -0
- package/dist/_cjs/constants/abi/TokenWithPermitAbi.js.map +1 -0
- package/dist/_cjs/constants/abi/UniActionPolicyAbi.js +62 -0
- package/dist/_cjs/constants/abi/UniActionPolicyAbi.js.map +1 -0
- package/dist/_cjs/constants/abi/UniswapSwapRouterAbi.js +486 -0
- package/dist/_cjs/constants/abi/UniswapSwapRouterAbi.js.map +1 -0
- package/dist/_cjs/constants/abi/index.js +14 -0
- package/dist/_cjs/constants/abi/index.js.map +1 -0
- package/dist/_cjs/constants/index.js +64 -0
- package/dist/_cjs/constants/index.js.map +1 -0
- package/dist/_cjs/index.js +13 -0
- package/dist/_cjs/index.js.map +1 -0
- package/dist/_cjs/modules/index.js +8 -0
- package/dist/_cjs/modules/index.js.map +1 -0
- package/dist/_cjs/modules/toEmptyExecutor.js +10 -0
- package/dist/_cjs/modules/toEmptyExecutor.js.map +1 -0
- package/dist/_cjs/modules/toEmptyHook.js +10 -0
- package/dist/_cjs/modules/toEmptyHook.js.map +1 -0
- package/dist/_cjs/modules/utils/Helpers.js +59 -0
- package/dist/_cjs/modules/utils/Helpers.js.map +1 -0
- package/dist/_cjs/modules/utils/Types.js +15 -0
- package/dist/_cjs/modules/utils/Types.js.map +1 -0
- package/dist/_cjs/modules/utils/Uid.js +14 -0
- package/dist/_cjs/modules/utils/Uid.js.map +1 -0
- package/dist/_cjs/modules/utils/composabilityCalls.js +117 -0
- package/dist/_cjs/modules/utils/composabilityCalls.js.map +1 -0
- package/dist/_cjs/modules/utils/index.js +9 -0
- package/dist/_cjs/modules/utils/index.js.map +1 -0
- package/dist/_cjs/modules/utils/runtimeAbiEncoding.js +276 -0
- package/dist/_cjs/modules/utils/runtimeAbiEncoding.js.map +1 -0
- package/dist/_cjs/modules/utils/toModule.js +39 -0
- package/dist/_cjs/modules/utils/toModule.js.map +1 -0
- package/dist/_cjs/modules/validators/default/index.js +5 -0
- package/dist/_cjs/modules/validators/default/index.js.map +1 -0
- package/dist/_cjs/modules/validators/default/toDefaultModule.js +18 -0
- package/dist/_cjs/modules/validators/default/toDefaultModule.js.map +1 -0
- package/dist/_cjs/modules/validators/index.js +9 -0
- package/dist/_cjs/modules/validators/index.js.map +1 -0
- package/dist/_cjs/modules/validators/ownable/decorators/addOwner.js +48 -0
- package/dist/_cjs/modules/validators/ownable/decorators/addOwner.js.map +1 -0
- package/dist/_cjs/modules/validators/ownable/decorators/getAddOwnerTx.js +42 -0
- package/dist/_cjs/modules/validators/ownable/decorators/getAddOwnerTx.js.map +1 -0
- package/dist/_cjs/modules/validators/ownable/decorators/getOwners.js +28 -0
- package/dist/_cjs/modules/validators/ownable/decorators/getOwners.js.map +1 -0
- package/dist/_cjs/modules/validators/ownable/decorators/getRemoveOwnerTx.js +42 -0
- package/dist/_cjs/modules/validators/ownable/decorators/getRemoveOwnerTx.js.map +1 -0
- package/dist/_cjs/modules/validators/ownable/decorators/getSetThresholdTx.js +32 -0
- package/dist/_cjs/modules/validators/ownable/decorators/getSetThresholdTx.js.map +1 -0
- package/dist/_cjs/modules/validators/ownable/decorators/getThreshold.js +28 -0
- package/dist/_cjs/modules/validators/ownable/decorators/getThreshold.js.map +1 -0
- package/dist/_cjs/modules/validators/ownable/decorators/index.js +70 -0
- package/dist/_cjs/modules/validators/ownable/decorators/index.js.map +1 -0
- package/dist/_cjs/modules/validators/ownable/decorators/multiSign.js +25 -0
- package/dist/_cjs/modules/validators/ownable/decorators/multiSign.js.map +1 -0
- package/dist/_cjs/modules/validators/ownable/decorators/prepareForMultiSign.js +22 -0
- package/dist/_cjs/modules/validators/ownable/decorators/prepareForMultiSign.js.map +1 -0
- package/dist/_cjs/modules/validators/ownable/decorators/removeOwner.js +47 -0
- package/dist/_cjs/modules/validators/ownable/decorators/removeOwner.js.map +1 -0
- package/dist/_cjs/modules/validators/ownable/decorators/setThreshold.js +39 -0
- package/dist/_cjs/modules/validators/ownable/decorators/setThreshold.js.map +1 -0
- package/dist/_cjs/modules/validators/ownable/index.js +6 -0
- package/dist/_cjs/modules/validators/ownable/index.js.map +1 -0
- package/dist/_cjs/modules/validators/ownable/toOwnableModule.js +16 -0
- package/dist/_cjs/modules/validators/ownable/toOwnableModule.js.map +1 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/Helpers.js +132 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/Helpers.js.map +1 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/Types.js +13 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/Types.js.map +1 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/grantPermission.js +38 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/grantPermission.js.map +1 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/index.js +30 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/index.js.map +1 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/preparePermission.js +152 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/preparePermission.js.map +1 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/revokeSession.js +42 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/revokeSession.js.map +1 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/usePermission.js +16 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/usePermission.js.map +1 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/index.js +8 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/index.js.map +1 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/toSmartSessionsValidator.js +49 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/toSmartSessionsValidator.js.map +1 -0
- package/dist/_cjs/modules/validators/toValidator.js +21 -0
- package/dist/_cjs/modules/validators/toValidator.js.map +1 -0
- package/dist/_cjs/package.json +1 -0
- package/dist/_esm/account/decorators/getFactoryData.js +31 -0
- package/dist/_esm/account/decorators/getFactoryData.js.map +1 -0
- package/dist/_esm/account/decorators/getStartaleAccountAddress.js +31 -0
- package/dist/_esm/account/decorators/getStartaleAccountAddress.js.map +1 -0
- package/dist/_esm/account/decorators/index.js +3 -0
- package/dist/_esm/account/decorators/index.js.map +1 -0
- package/dist/_esm/account/index.js +3 -0
- package/dist/_esm/account/index.js.map +1 -0
- package/dist/_esm/account/toStartaleSmartAccount.js +403 -0
- package/dist/_esm/account/toStartaleSmartAccount.js.map +1 -0
- package/dist/_esm/account/utils/AccountNotFound.js +17 -0
- package/dist/_esm/account/utils/AccountNotFound.js.map +1 -0
- package/dist/_esm/account/utils/Constants.js +129 -0
- package/dist/_esm/account/utils/Constants.js.map +1 -0
- package/dist/_esm/account/utils/Helpers.js +45 -0
- package/dist/_esm/account/utils/Helpers.js.map +1 -0
- package/dist/_esm/account/utils/Logger.js +50 -0
- package/dist/_esm/account/utils/Logger.js.map +1 -0
- package/dist/_esm/account/utils/Types.js +2 -0
- package/dist/_esm/account/utils/Types.js.map +1 -0
- package/dist/_esm/account/utils/Utils.js +319 -0
- package/dist/_esm/account/utils/Utils.js.map +1 -0
- package/dist/_esm/account/utils/addressToEmptyAccount.js +21 -0
- package/dist/_esm/account/utils/addressToEmptyAccount.js.map +1 -0
- package/dist/_esm/account/utils/contractSimulation.js +48 -0
- package/dist/_esm/account/utils/contractSimulation.js.map +1 -0
- package/dist/_esm/account/utils/deepHexlify.js +63 -0
- package/dist/_esm/account/utils/deepHexlify.js.map +1 -0
- package/dist/_esm/account/utils/eip7702Utils.js +16 -0
- package/dist/_esm/account/utils/eip7702Utils.js.map +1 -0
- package/dist/_esm/account/utils/fromBundlerClient.js +67 -0
- package/dist/_esm/account/utils/fromBundlerClient.js.map +1 -0
- package/dist/_esm/account/utils/getAAError.js +34 -0
- package/dist/_esm/account/utils/getAAError.js.map +1 -0
- package/dist/_esm/account/utils/getChain.js +117 -0
- package/dist/_esm/account/utils/getChain.js.map +1 -0
- package/dist/_esm/account/utils/getVersion.js +163 -0
- package/dist/_esm/account/utils/getVersion.js.map +1 -0
- package/dist/_esm/account/utils/index.js +20 -0
- package/dist/_esm/account/utils/index.js.map +1 -0
- package/dist/_esm/account/utils/parseErrorMessage.js +89 -0
- package/dist/_esm/account/utils/parseErrorMessage.js.map +1 -0
- package/dist/_esm/account/utils/tenderlySimulation.js +47 -0
- package/dist/_esm/account/utils/tenderlySimulation.js.map +1 -0
- package/dist/_esm/account/utils/toInitData.js +14 -0
- package/dist/_esm/account/utils/toInitData.js.map +1 -0
- package/dist/_esm/account/utils/toInstallData.js +16 -0
- package/dist/_esm/account/utils/toInstallData.js.map +1 -0
- package/dist/_esm/account/utils/toSigner.js +91 -0
- package/dist/_esm/account/utils/toSigner.js.map +1 -0
- package/dist/_esm/clients/createHttpClient.js +47 -0
- package/dist/_esm/clients/createHttpClient.js.map +1 -0
- package/dist/_esm/clients/createSCSBundlerClient.js +96 -0
- package/dist/_esm/clients/createSCSBundlerClient.js.map +1 -0
- package/dist/_esm/clients/createSCSPaymasterClient.js +85 -0
- package/dist/_esm/clients/createSCSPaymasterClient.js.map +1 -0
- package/dist/_esm/clients/decorators/bundler/getGasFeeValues.js +77 -0
- package/dist/_esm/clients/decorators/bundler/getGasFeeValues.js.map +1 -0
- package/dist/_esm/clients/decorators/bundler/index.js +7 -0
- package/dist/_esm/clients/decorators/bundler/index.js.map +1 -0
- package/dist/_esm/clients/decorators/bundler/waitForUserOperationReceipt.js +8 -0
- package/dist/_esm/clients/decorators/bundler/waitForUserOperationReceipt.js.map +1 -0
- package/dist/_esm/clients/decorators/erc7579/accountId.js +77 -0
- package/dist/_esm/clients/decorators/erc7579/accountId.js.map +1 -0
- package/dist/_esm/clients/decorators/erc7579/getActiveHook.js +52 -0
- package/dist/_esm/clients/decorators/erc7579/getActiveHook.js.map +1 -0
- package/dist/_esm/clients/decorators/erc7579/getFallbackBySelector.js +67 -0
- package/dist/_esm/clients/decorators/erc7579/getFallbackBySelector.js.map +1 -0
- package/dist/_esm/clients/decorators/erc7579/getInstalledExecutors.js +74 -0
- package/dist/_esm/clients/decorators/erc7579/getInstalledExecutors.js.map +1 -0
- package/dist/_esm/clients/decorators/erc7579/getInstalledValidators.js +72 -0
- package/dist/_esm/clients/decorators/erc7579/getInstalledValidators.js.map +1 -0
- package/dist/_esm/clients/decorators/erc7579/getPreviousModule.js +54 -0
- package/dist/_esm/clients/decorators/erc7579/getPreviousModule.js.map +1 -0
- package/dist/_esm/clients/decorators/erc7579/index.js +48 -0
- package/dist/_esm/clients/decorators/erc7579/index.js.map +1 -0
- package/dist/_esm/clients/decorators/erc7579/installModule.js +115 -0
- package/dist/_esm/clients/decorators/erc7579/installModule.js.map +1 -0
- package/dist/_esm/clients/decorators/erc7579/installModules.js +41 -0
- package/dist/_esm/clients/decorators/erc7579/installModules.js.map +1 -0
- package/dist/_esm/clients/decorators/erc7579/isModuleInstalled.js +106 -0
- package/dist/_esm/clients/decorators/erc7579/isModuleInstalled.js.map +1 -0
- package/dist/_esm/clients/decorators/erc7579/supportsExecutionMode.js +120 -0
- package/dist/_esm/clients/decorators/erc7579/supportsExecutionMode.js.map +1 -0
- package/dist/_esm/clients/decorators/erc7579/supportsModule.js +108 -0
- package/dist/_esm/clients/decorators/erc7579/supportsModule.js.map +1 -0
- package/dist/_esm/clients/decorators/erc7579/uninstallFallback.js +76 -0
- package/dist/_esm/clients/decorators/erc7579/uninstallFallback.js.map +1 -0
- package/dist/_esm/clients/decorators/erc7579/uninstallModule.js +94 -0
- package/dist/_esm/clients/decorators/erc7579/uninstallModule.js.map +1 -0
- package/dist/_esm/clients/decorators/erc7579/uninstallModules.js +42 -0
- package/dist/_esm/clients/decorators/erc7579/uninstallModules.js.map +1 -0
- package/dist/_esm/clients/decorators/index.js +5 -0
- package/dist/_esm/clients/decorators/index.js.map +1 -0
- package/dist/_esm/clients/decorators/smartAccount/debugUserOperation.js +105 -0
- package/dist/_esm/clients/decorators/smartAccount/debugUserOperation.js.map +1 -0
- package/dist/_esm/clients/decorators/smartAccount/index.js +28 -0
- package/dist/_esm/clients/decorators/smartAccount/index.js.map +1 -0
- package/dist/_esm/clients/decorators/smartAccount/prepareTokenPaymasterUserOp.js +60 -0
- package/dist/_esm/clients/decorators/smartAccount/prepareTokenPaymasterUserOp.js.map +1 -0
- package/dist/_esm/clients/decorators/smartAccount/prepareUserOperationWithoutSignature.js +36 -0
- package/dist/_esm/clients/decorators/smartAccount/prepareUserOperationWithoutSignature.js.map +1 -0
- package/dist/_esm/clients/decorators/smartAccount/sendTokenPaymasterUserOp.js +43 -0
- package/dist/_esm/clients/decorators/smartAccount/sendTokenPaymasterUserOp.js.map +1 -0
- package/dist/_esm/clients/decorators/smartAccount/sendTransaction.js +57 -0
- package/dist/_esm/clients/decorators/smartAccount/sendTransaction.js.map +1 -0
- package/dist/_esm/clients/decorators/smartAccount/signMessage.js +30 -0
- package/dist/_esm/clients/decorators/smartAccount/signMessage.js.map +1 -0
- package/dist/_esm/clients/decorators/smartAccount/signTypedData.js +82 -0
- package/dist/_esm/clients/decorators/smartAccount/signTypedData.js.map +1 -0
- package/dist/_esm/clients/decorators/smartAccount/upgradeSmartAccount.js +75 -0
- package/dist/_esm/clients/decorators/smartAccount/upgradeSmartAccount.js.map +1 -0
- package/dist/_esm/clients/decorators/smartAccount/waitForTransactionReceipt.js +14 -0
- package/dist/_esm/clients/decorators/smartAccount/waitForTransactionReceipt.js.map +1 -0
- package/dist/_esm/clients/decorators/smartAccount/writeContract.js +40 -0
- package/dist/_esm/clients/decorators/smartAccount/writeContract.js.map +1 -0
- package/dist/_esm/clients/decorators/tokenPaymaster/getSupportedTokens.js +35 -0
- package/dist/_esm/clients/decorators/tokenPaymaster/getSupportedTokens.js.map +1 -0
- package/dist/_esm/clients/decorators/tokenPaymaster/getTokenPaymasterQuotes.js +120 -0
- package/dist/_esm/clients/decorators/tokenPaymaster/getTokenPaymasterQuotes.js.map +1 -0
- package/dist/_esm/clients/decorators/tokenPaymaster/index.js +63 -0
- package/dist/_esm/clients/decorators/tokenPaymaster/index.js.map +1 -0
- package/dist/_esm/clients/index.js +5 -0
- package/dist/_esm/clients/index.js.map +1 -0
- package/dist/_esm/constants/abi/AccountFactory.js +334 -0
- package/dist/_esm/constants/abi/AccountFactory.js.map +1 -0
- package/dist/_esm/constants/abi/AccountImplementationAbi.js +1176 -0
- package/dist/_esm/constants/abi/AccountImplementationAbi.js.map +1 -0
- package/dist/_esm/constants/abi/BootstrapAbi.js +727 -0
- package/dist/_esm/constants/abi/BootstrapAbi.js.map +1 -0
- package/dist/_esm/constants/abi/ComposabilityAbi.js +271 -0
- package/dist/_esm/constants/abi/ComposabilityAbi.js.map +1 -0
- package/dist/_esm/constants/abi/EIP1271Abi.js +28 -0
- package/dist/_esm/constants/abi/EIP1271Abi.js.map +1 -0
- package/dist/_esm/constants/abi/ERC7484RegistryAbi.js +14 -0
- package/dist/_esm/constants/abi/ERC7484RegistryAbi.js.map +1 -0
- package/dist/_esm/constants/abi/EntryPointABI.js +658 -0
- package/dist/_esm/constants/abi/EntryPointABI.js.map +1 -0
- package/dist/_esm/constants/abi/SmartSessionAbi.js +1469 -0
- package/dist/_esm/constants/abi/SmartSessionAbi.js.map +1 -0
- package/dist/_esm/constants/abi/TokenWithPermitAbi.js +619 -0
- package/dist/_esm/constants/abi/TokenWithPermitAbi.js.map +1 -0
- package/dist/_esm/constants/abi/UniActionPolicyAbi.js +59 -0
- package/dist/_esm/constants/abi/UniActionPolicyAbi.js.map +1 -0
- package/dist/_esm/constants/abi/UniswapSwapRouterAbi.js +483 -0
- package/dist/_esm/constants/abi/UniswapSwapRouterAbi.js.map +1 -0
- package/dist/_esm/constants/abi/index.js +11 -0
- package/dist/_esm/constants/abi/index.js.map +1 -0
- package/dist/_esm/constants/index.js +38 -0
- package/dist/_esm/constants/index.js.map +1 -0
- package/dist/_esm/index.js +12 -0
- package/dist/_esm/index.js.map +1 -0
- package/dist/_esm/modules/index.js +6 -0
- package/dist/_esm/modules/index.js.map +1 -0
- package/dist/_esm/modules/toEmptyExecutor.js +6 -0
- package/dist/_esm/modules/toEmptyExecutor.js.map +1 -0
- package/dist/_esm/modules/toEmptyHook.js +6 -0
- package/dist/_esm/modules/toEmptyHook.js.map +1 -0
- package/dist/_esm/modules/utils/Helpers.js +81 -0
- package/dist/_esm/modules/utils/Helpers.js.map +1 -0
- package/dist/_esm/modules/utils/Types.js +12 -0
- package/dist/_esm/modules/utils/Types.js.map +1 -0
- package/dist/_esm/modules/utils/Uid.js +11 -0
- package/dist/_esm/modules/utils/Uid.js.map +1 -0
- package/dist/_esm/modules/utils/composabilityCalls.js +127 -0
- package/dist/_esm/modules/utils/composabilityCalls.js.map +1 -0
- package/dist/_esm/modules/utils/index.js +6 -0
- package/dist/_esm/modules/utils/index.js.map +1 -0
- package/dist/_esm/modules/utils/runtimeAbiEncoding.js +365 -0
- package/dist/_esm/modules/utils/runtimeAbiEncoding.js.map +1 -0
- package/dist/_esm/modules/utils/toModule.js +61 -0
- package/dist/_esm/modules/utils/toModule.js.map +1 -0
- package/dist/_esm/modules/validators/default/index.js +2 -0
- package/dist/_esm/modules/validators/default/index.js.map +1 -0
- package/dist/_esm/modules/validators/default/toDefaultModule.js +14 -0
- package/dist/_esm/modules/validators/default/toDefaultModule.js.map +1 -0
- package/dist/_esm/modules/validators/index.js +6 -0
- package/dist/_esm/modules/validators/index.js.map +1 -0
- package/dist/_esm/modules/validators/ownable/decorators/addOwner.js +56 -0
- package/dist/_esm/modules/validators/ownable/decorators/addOwner.js.map +1 -0
- package/dist/_esm/modules/validators/ownable/decorators/getAddOwnerTx.js +50 -0
- package/dist/_esm/modules/validators/ownable/decorators/getAddOwnerTx.js.map +1 -0
- package/dist/_esm/modules/validators/ownable/decorators/getOwners.js +38 -0
- package/dist/_esm/modules/validators/ownable/decorators/getOwners.js.map +1 -0
- package/dist/_esm/modules/validators/ownable/decorators/getRemoveOwnerTx.js +50 -0
- package/dist/_esm/modules/validators/ownable/decorators/getRemoveOwnerTx.js.map +1 -0
- package/dist/_esm/modules/validators/ownable/decorators/getSetThresholdTx.js +48 -0
- package/dist/_esm/modules/validators/ownable/decorators/getSetThresholdTx.js.map +1 -0
- package/dist/_esm/modules/validators/ownable/decorators/getThreshold.js +54 -0
- package/dist/_esm/modules/validators/ownable/decorators/getThreshold.js.map +1 -0
- package/dist/_esm/modules/validators/ownable/decorators/index.js +57 -0
- package/dist/_esm/modules/validators/ownable/decorators/index.js.map +1 -0
- package/dist/_esm/modules/validators/ownable/decorators/multiSign.js +22 -0
- package/dist/_esm/modules/validators/ownable/decorators/multiSign.js.map +1 -0
- package/dist/_esm/modules/validators/ownable/decorators/prepareForMultiSign.js +21 -0
- package/dist/_esm/modules/validators/ownable/decorators/prepareForMultiSign.js.map +1 -0
- package/dist/_esm/modules/validators/ownable/decorators/removeOwner.js +66 -0
- package/dist/_esm/modules/validators/ownable/decorators/removeOwner.js.map +1 -0
- package/dist/_esm/modules/validators/ownable/decorators/setThreshold.js +62 -0
- package/dist/_esm/modules/validators/ownable/decorators/setThreshold.js.map +1 -0
- package/dist/_esm/modules/validators/ownable/index.js +3 -0
- package/dist/_esm/modules/validators/ownable/index.js.map +1 -0
- package/dist/_esm/modules/validators/ownable/toOwnableModule.js +38 -0
- package/dist/_esm/modules/validators/ownable/toOwnableModule.js.map +1 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/Helpers.js +181 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/Helpers.js.map +1 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/Types.js +13 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/Types.js.map +1 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/decorators/grantPermission.js +80 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/decorators/grantPermission.js.map +1 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/decorators/index.js +37 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/decorators/index.js.map +1 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/decorators/preparePermission.js +214 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/decorators/preparePermission.js.map +1 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/decorators/revokeSession.js +67 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/decorators/revokeSession.js.map +1 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/decorators/usePermission.js +47 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/decorators/usePermission.js.map +1 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/index.js +5 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/index.js.map +1 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/toSmartSessionsValidator.js +82 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/toSmartSessionsValidator.js.map +1 -0
- package/dist/_esm/modules/validators/toValidator.js +17 -0
- package/dist/_esm/modules/validators/toValidator.js.map +1 -0
- package/dist/_esm/package.json +1 -0
- package/dist/_types/account/decorators/getFactoryData.d.ts +25 -0
- package/dist/_types/account/decorators/getFactoryData.d.ts.map +1 -0
- package/dist/_types/account/decorators/getStartaleAccountAddress.d.ts +33 -0
- package/dist/_types/account/decorators/getStartaleAccountAddress.d.ts.map +1 -0
- package/dist/_types/account/decorators/index.d.ts +3 -0
- package/dist/_types/account/decorators/index.d.ts.map +1 -0
- package/dist/_types/account/index.d.ts +3 -0
- package/dist/_types/account/index.d.ts.map +1 -0
- package/dist/_types/account/toStartaleSmartAccount.d.ts +120 -0
- package/dist/_types/account/toStartaleSmartAccount.d.ts.map +1 -0
- package/dist/_types/account/utils/AccountNotFound.d.ts +10 -0
- package/dist/_types/account/utils/AccountNotFound.d.ts.map +1 -0
- package/dist/_types/account/utils/Constants.d.ts +73 -0
- package/dist/_types/account/utils/Constants.d.ts.map +1 -0
- package/dist/_types/account/utils/Helpers.d.ts +21 -0
- package/dist/_types/account/utils/Helpers.d.ts.map +1 -0
- package/dist/_types/account/utils/Logger.d.ts +20 -0
- package/dist/_types/account/utils/Logger.d.ts.map +1 -0
- package/dist/_types/account/utils/Types.d.ts +94 -0
- package/dist/_types/account/utils/Types.d.ts.map +1 -0
- package/dist/_types/account/utils/Utils.d.ts +129 -0
- package/dist/_types/account/utils/Utils.d.ts.map +1 -0
- package/dist/_types/account/utils/addressToEmptyAccount.d.ts +4 -0
- package/dist/_types/account/utils/addressToEmptyAccount.d.ts.map +1 -0
- package/dist/_types/account/utils/contractSimulation.d.ts +801 -0
- package/dist/_types/account/utils/contractSimulation.d.ts.map +1 -0
- package/dist/_types/account/utils/deepHexlify.d.ts +41 -0
- package/dist/_types/account/utils/deepHexlify.d.ts.map +1 -0
- package/dist/_types/account/utils/eip7702Utils.d.ts +4 -0
- package/dist/_types/account/utils/eip7702Utils.d.ts.map +1 -0
- package/dist/_types/account/utils/fromBundlerClient.d.ts +50 -0
- package/dist/_types/account/utils/fromBundlerClient.d.ts.map +1 -0
- package/dist/_types/account/utils/getAAError.d.ts +17 -0
- package/dist/_types/account/utils/getAAError.d.ts.map +1 -0
- package/dist/_types/account/utils/getChain.d.ts +64 -0
- package/dist/_types/account/utils/getChain.d.ts.map +1 -0
- package/dist/_types/account/utils/getVersion.d.ts +135 -0
- package/dist/_types/account/utils/getVersion.d.ts.map +1 -0
- package/dist/_types/account/utils/index.d.ts +20 -0
- package/dist/_types/account/utils/index.d.ts.map +1 -0
- package/dist/_types/account/utils/parseErrorMessage.d.ts +2 -0
- package/dist/_types/account/utils/parseErrorMessage.d.ts.map +1 -0
- package/dist/_types/account/utils/tenderlySimulation.d.ts +13 -0
- package/dist/_types/account/utils/tenderlySimulation.d.ts.map +1 -0
- package/dist/_types/account/utils/toInitData.d.ts +12 -0
- package/dist/_types/account/utils/toInitData.d.ts.map +1 -0
- package/dist/_types/account/utils/toInstallData.d.ts +8 -0
- package/dist/_types/account/utils/toInstallData.d.ts.map +1 -0
- package/dist/_types/account/utils/toSigner.d.ts +26 -0
- package/dist/_types/account/utils/toSigner.d.ts.map +1 -0
- package/dist/_types/clients/createHttpClient.d.ts +44 -0
- package/dist/_types/clients/createHttpClient.d.ts.map +1 -0
- package/dist/_types/clients/createSCSBundlerClient.d.ts +66 -0
- package/dist/_types/clients/createSCSBundlerClient.d.ts.map +1 -0
- package/dist/_types/clients/createSCSPaymasterClient.d.ts +70 -0
- package/dist/_types/clients/createSCSPaymasterClient.d.ts.map +1 -0
- package/dist/_types/clients/decorators/bundler/getGasFeeValues.d.ts +51 -0
- package/dist/_types/clients/decorators/bundler/getGasFeeValues.d.ts.map +1 -0
- package/dist/_types/clients/decorators/bundler/index.d.ts +43 -0
- package/dist/_types/clients/decorators/bundler/index.d.ts.map +1 -0
- package/dist/_types/clients/decorators/bundler/waitForUserOperationReceipt.d.ts +5 -0
- package/dist/_types/clients/decorators/bundler/waitForUserOperationReceipt.d.ts.map +1 -0
- package/dist/_types/clients/decorators/erc7579/accountId.d.ts +21 -0
- package/dist/_types/clients/decorators/erc7579/accountId.d.ts.map +1 -0
- package/dist/_types/clients/decorators/erc7579/getActiveHook.d.ts +35 -0
- package/dist/_types/clients/decorators/erc7579/getActiveHook.d.ts.map +1 -0
- package/dist/_types/clients/decorators/erc7579/getFallbackBySelector.d.ts +43 -0
- package/dist/_types/clients/decorators/erc7579/getFallbackBySelector.d.ts.map +1 -0
- package/dist/_types/clients/decorators/erc7579/getInstalledExecutors.d.ts +52 -0
- package/dist/_types/clients/decorators/erc7579/getInstalledExecutors.d.ts.map +1 -0
- package/dist/_types/clients/decorators/erc7579/getInstalledValidators.d.ts +52 -0
- package/dist/_types/clients/decorators/erc7579/getInstalledValidators.d.ts.map +1 -0
- package/dist/_types/clients/decorators/erc7579/getPreviousModule.d.ts +32 -0
- package/dist/_types/clients/decorators/erc7579/getPreviousModule.d.ts.map +1 -0
- package/dist/_types/clients/decorators/erc7579/index.d.ts +165 -0
- package/dist/_types/clients/decorators/erc7579/index.d.ts.map +1 -0
- package/dist/_types/clients/decorators/erc7579/installModule.d.ts +36 -0
- package/dist/_types/clients/decorators/erc7579/installModule.d.ts.map +1 -0
- package/dist/_types/clients/decorators/erc7579/installModules.d.ts +36 -0
- package/dist/_types/clients/decorators/erc7579/installModules.d.ts.map +1 -0
- package/dist/_types/clients/decorators/erc7579/isModuleInstalled.d.ts +54 -0
- package/dist/_types/clients/decorators/erc7579/isModuleInstalled.d.ts.map +1 -0
- package/dist/_types/clients/decorators/erc7579/supportsExecutionMode.d.ts +54 -0
- package/dist/_types/clients/decorators/erc7579/supportsExecutionMode.d.ts.map +1 -0
- package/dist/_types/clients/decorators/erc7579/supportsModule.d.ts +48 -0
- package/dist/_types/clients/decorators/erc7579/supportsModule.d.ts.map +1 -0
- package/dist/_types/clients/decorators/erc7579/uninstallFallback.d.ts +35 -0
- package/dist/_types/clients/decorators/erc7579/uninstallFallback.d.ts.map +1 -0
- package/dist/_types/clients/decorators/erc7579/uninstallModule.d.ts +35 -0
- package/dist/_types/clients/decorators/erc7579/uninstallModule.d.ts.map +1 -0
- package/dist/_types/clients/decorators/erc7579/uninstallModules.d.ts +32 -0
- package/dist/_types/clients/decorators/erc7579/uninstallModules.d.ts.map +1 -0
- package/dist/_types/clients/decorators/index.d.ts +5 -0
- package/dist/_types/clients/decorators/index.d.ts.map +1 -0
- package/dist/_types/clients/decorators/smartAccount/debugUserOperation.d.ts +35 -0
- package/dist/_types/clients/decorators/smartAccount/debugUserOperation.d.ts.map +1 -0
- package/dist/_types/clients/decorators/smartAccount/index.d.ts +315 -0
- package/dist/_types/clients/decorators/smartAccount/index.d.ts.map +1 -0
- package/dist/_types/clients/decorators/smartAccount/prepareTokenPaymasterUserOp.d.ts +52 -0
- package/dist/_types/clients/decorators/smartAccount/prepareTokenPaymasterUserOp.d.ts.map +1 -0
- package/dist/_types/clients/decorators/smartAccount/prepareUserOperationWithoutSignature.d.ts +16 -0
- package/dist/_types/clients/decorators/smartAccount/prepareUserOperationWithoutSignature.d.ts.map +1 -0
- package/dist/_types/clients/decorators/smartAccount/sendTokenPaymasterUserOp.d.ts +36 -0
- package/dist/_types/clients/decorators/smartAccount/sendTokenPaymasterUserOp.d.ts.map +1 -0
- package/dist/_types/clients/decorators/smartAccount/sendTransaction.d.ts +23 -0
- package/dist/_types/clients/decorators/smartAccount/sendTransaction.d.ts.map +1 -0
- package/dist/_types/clients/decorators/smartAccount/signMessage.d.ts +23 -0
- package/dist/_types/clients/decorators/smartAccount/signMessage.d.ts.map +1 -0
- package/dist/_types/clients/decorators/smartAccount/signTypedData.d.ts +60 -0
- package/dist/_types/clients/decorators/smartAccount/signTypedData.d.ts.map +1 -0
- package/dist/_types/clients/decorators/smartAccount/upgradeSmartAccount.d.ts +40 -0
- package/dist/_types/clients/decorators/smartAccount/upgradeSmartAccount.d.ts.map +1 -0
- package/dist/_types/clients/decorators/smartAccount/waitForTransactionReceipt.d.ts +6 -0
- package/dist/_types/clients/decorators/smartAccount/waitForTransactionReceipt.d.ts.map +1 -0
- package/dist/_types/clients/decorators/smartAccount/writeContract.d.ts +27 -0
- package/dist/_types/clients/decorators/smartAccount/writeContract.d.ts.map +1 -0
- package/dist/_types/clients/decorators/tokenPaymaster/getSupportedTokens.d.ts +16 -0
- package/dist/_types/clients/decorators/tokenPaymaster/getSupportedTokens.d.ts.map +1 -0
- package/dist/_types/clients/decorators/tokenPaymaster/getTokenPaymasterQuotes.d.ts +93 -0
- package/dist/_types/clients/decorators/tokenPaymaster/getTokenPaymasterQuotes.d.ts.map +1 -0
- package/dist/_types/clients/decorators/tokenPaymaster/index.d.ts +65 -0
- package/dist/_types/clients/decorators/tokenPaymaster/index.d.ts.map +1 -0
- package/dist/_types/clients/index.d.ts +5 -0
- package/dist/_types/clients/index.d.ts.map +1 -0
- package/dist/_types/constants/abi/AccountFactory.d.ts +259 -0
- package/dist/_types/constants/abi/AccountFactory.d.ts.map +1 -0
- package/dist/_types/constants/abi/AccountImplementationAbi.d.ts +903 -0
- package/dist/_types/constants/abi/AccountImplementationAbi.d.ts.map +1 -0
- package/dist/_types/constants/abi/BootstrapAbi.d.ts +554 -0
- package/dist/_types/constants/abi/BootstrapAbi.d.ts.map +1 -0
- package/dist/_types/constants/abi/ComposabilityAbi.d.ts +67 -0
- package/dist/_types/constants/abi/ComposabilityAbi.d.ts.map +1 -0
- package/dist/_types/constants/abi/EIP1271Abi.d.ts +54 -0
- package/dist/_types/constants/abi/EIP1271Abi.d.ts.map +1 -0
- package/dist/_types/constants/abi/ERC7484RegistryAbi.d.ts +16 -0
- package/dist/_types/constants/abi/ERC7484RegistryAbi.d.ts.map +1 -0
- package/dist/_types/constants/abi/EntryPointABI.d.ts +776 -0
- package/dist/_types/constants/abi/EntryPointABI.d.ts.map +1 -0
- package/dist/_types/constants/abi/SmartSessionAbi.d.ts +90 -0
- package/dist/_types/constants/abi/SmartSessionAbi.d.ts.map +1 -0
- package/dist/_types/constants/abi/TokenWithPermitAbi.d.ts +477 -0
- package/dist/_types/constants/abi/TokenWithPermitAbi.d.ts.map +1 -0
- package/dist/_types/constants/abi/UniActionPolicyAbi.d.ts +33 -0
- package/dist/_types/constants/abi/UniActionPolicyAbi.d.ts.map +1 -0
- package/dist/_types/constants/abi/UniswapSwapRouterAbi.d.ts +821 -0
- package/dist/_types/constants/abi/UniswapSwapRouterAbi.d.ts.map +1 -0
- package/dist/_types/constants/abi/index.d.ts +11 -0
- package/dist/_types/constants/abi/index.d.ts.map +1 -0
- package/dist/_types/constants/index.d.ts +20 -0
- package/dist/_types/constants/index.d.ts.map +1 -0
- package/dist/_types/index.d.ts +7 -0
- package/dist/_types/index.d.ts.map +1 -0
- package/dist/_types/modules/index.d.ts +6 -0
- package/dist/_types/modules/index.d.ts.map +1 -0
- package/dist/_types/modules/toEmptyExecutor.d.ts +3 -0
- package/dist/_types/modules/toEmptyExecutor.d.ts.map +1 -0
- package/dist/_types/modules/toEmptyHook.d.ts +3 -0
- package/dist/_types/modules/toEmptyHook.d.ts.map +1 -0
- package/dist/_types/modules/utils/Helpers.d.ts +48 -0
- package/dist/_types/modules/utils/Helpers.d.ts.map +1 -0
- package/dist/_types/modules/utils/Types.d.ts +103 -0
- package/dist/_types/modules/utils/Types.d.ts.map +1 -0
- package/dist/_types/modules/utils/Uid.d.ts +2 -0
- package/dist/_types/modules/utils/Uid.d.ts.map +1 -0
- package/dist/_types/modules/utils/composabilityCalls.d.ts +63 -0
- package/dist/_types/modules/utils/composabilityCalls.d.ts.map +1 -0
- package/dist/_types/modules/utils/index.d.ts +6 -0
- package/dist/_types/modules/utils/index.d.ts.map +1 -0
- package/dist/_types/modules/utils/runtimeAbiEncoding.d.ts +18 -0
- package/dist/_types/modules/utils/runtimeAbiEncoding.d.ts.map +1 -0
- package/dist/_types/modules/utils/toModule.d.ts +28 -0
- package/dist/_types/modules/utils/toModule.d.ts.map +1 -0
- package/dist/_types/modules/validators/default/index.d.ts +2 -0
- package/dist/_types/modules/validators/default/index.d.ts.map +1 -0
- package/dist/_types/modules/validators/default/toDefaultModule.d.ts +3 -0
- package/dist/_types/modules/validators/default/toDefaultModule.d.ts.map +1 -0
- package/dist/_types/modules/validators/index.d.ts +6 -0
- package/dist/_types/modules/validators/index.d.ts.map +1 -0
- package/dist/_types/modules/validators/ownable/decorators/addOwner.d.ts +36 -0
- package/dist/_types/modules/validators/ownable/decorators/addOwner.d.ts.map +1 -0
- package/dist/_types/modules/validators/ownable/decorators/getAddOwnerTx.d.ts +30 -0
- package/dist/_types/modules/validators/ownable/decorators/getAddOwnerTx.d.ts.map +1 -0
- package/dist/_types/modules/validators/ownable/decorators/getOwners.d.ts +25 -0
- package/dist/_types/modules/validators/ownable/decorators/getOwners.d.ts.map +1 -0
- package/dist/_types/modules/validators/ownable/decorators/getRemoveOwnerTx.d.ts +30 -0
- package/dist/_types/modules/validators/ownable/decorators/getRemoveOwnerTx.d.ts.map +1 -0
- package/dist/_types/modules/validators/ownable/decorators/getSetThresholdTx.d.ts +39 -0
- package/dist/_types/modules/validators/ownable/decorators/getSetThresholdTx.d.ts.map +1 -0
- package/dist/_types/modules/validators/ownable/decorators/getThreshold.d.ts +40 -0
- package/dist/_types/modules/validators/ownable/decorators/getThreshold.d.ts.map +1 -0
- package/dist/_types/modules/validators/ownable/decorators/index.d.ts +37 -0
- package/dist/_types/modules/validators/ownable/decorators/index.d.ts.map +1 -0
- package/dist/_types/modules/validators/ownable/decorators/multiSign.d.ts +11 -0
- package/dist/_types/modules/validators/ownable/decorators/multiSign.d.ts.map +1 -0
- package/dist/_types/modules/validators/ownable/decorators/prepareForMultiSign.d.ts +25 -0
- package/dist/_types/modules/validators/ownable/decorators/prepareForMultiSign.d.ts.map +1 -0
- package/dist/_types/modules/validators/ownable/decorators/removeOwner.d.ts +47 -0
- package/dist/_types/modules/validators/ownable/decorators/removeOwner.d.ts.map +1 -0
- package/dist/_types/modules/validators/ownable/decorators/setThreshold.d.ts +51 -0
- package/dist/_types/modules/validators/ownable/decorators/setThreshold.d.ts.map +1 -0
- package/dist/_types/modules/validators/ownable/index.d.ts +3 -0
- package/dist/_types/modules/validators/ownable/index.d.ts.map +1 -0
- package/dist/_types/modules/validators/ownable/toOwnableModule.d.ts +44 -0
- package/dist/_types/modules/validators/ownable/toOwnableModule.d.ts.map +1 -0
- package/dist/_types/modules/validators/smartSessionsValidator/Helpers.d.ts +98 -0
- package/dist/_types/modules/validators/smartSessionsValidator/Helpers.d.ts.map +1 -0
- package/dist/_types/modules/validators/smartSessionsValidator/Types.d.ts +262 -0
- package/dist/_types/modules/validators/smartSessionsValidator/Types.d.ts.map +1 -0
- package/dist/_types/modules/validators/smartSessionsValidator/decorators/grantPermission.d.ts +73 -0
- package/dist/_types/modules/validators/smartSessionsValidator/decorators/grantPermission.d.ts.map +1 -0
- package/dist/_types/modules/validators/smartSessionsValidator/decorators/index.d.ts +79 -0
- package/dist/_types/modules/validators/smartSessionsValidator/decorators/index.d.ts.map +1 -0
- package/dist/_types/modules/validators/smartSessionsValidator/decorators/preparePermission.d.ts +81 -0
- package/dist/_types/modules/validators/smartSessionsValidator/decorators/preparePermission.d.ts.map +1 -0
- package/dist/_types/modules/validators/smartSessionsValidator/decorators/revokeSession.d.ts +55 -0
- package/dist/_types/modules/validators/smartSessionsValidator/decorators/revokeSession.d.ts.map +1 -0
- package/dist/_types/modules/validators/smartSessionsValidator/decorators/usePermission.d.ts +63 -0
- package/dist/_types/modules/validators/smartSessionsValidator/decorators/usePermission.d.ts.map +1 -0
- package/dist/_types/modules/validators/smartSessionsValidator/index.d.ts +5 -0
- package/dist/_types/modules/validators/smartSessionsValidator/index.d.ts.map +1 -0
- package/dist/_types/modules/validators/smartSessionsValidator/toSmartSessionsValidator.d.ts +65 -0
- package/dist/_types/modules/validators/smartSessionsValidator/toSmartSessionsValidator.d.ts.map +1 -0
- package/dist/_types/modules/validators/toValidator.d.ts +45 -0
- package/dist/_types/modules/validators/toValidator.d.ts.map +1 -0
- package/package.json +134 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { ContractFunctionExecutionError, decodeFunctionResult, encodeFunctionData } from "viem";
|
|
2
|
+
import { call, readContract } from "viem/actions";
|
|
3
|
+
import { getAction } from "viem/utils";
|
|
4
|
+
import { parseAccount } from "viem/utils";
|
|
5
|
+
import { AccountNotFoundError } from "../../../account/utils/AccountNotFound.js";
|
|
6
|
+
const abi = [
|
|
7
|
+
{
|
|
8
|
+
name: "supportsModule",
|
|
9
|
+
type: "function",
|
|
10
|
+
stateMutability: "view",
|
|
11
|
+
inputs: [
|
|
12
|
+
{
|
|
13
|
+
type: "uint256",
|
|
14
|
+
name: "moduleTypeId"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
outputs: [
|
|
18
|
+
{
|
|
19
|
+
type: "bool"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
];
|
|
24
|
+
/**
|
|
25
|
+
* Parses a module type to its corresponding ID.
|
|
26
|
+
*
|
|
27
|
+
* @param type - The module type to parse.
|
|
28
|
+
* @returns The corresponding bigint ID for the module type.
|
|
29
|
+
* @throws {Error} If an invalid module type is provided.
|
|
30
|
+
*/
|
|
31
|
+
export function parseModuleTypeId(type) {
|
|
32
|
+
switch (type) {
|
|
33
|
+
case "validator":
|
|
34
|
+
return BigInt(1);
|
|
35
|
+
case "executor":
|
|
36
|
+
return BigInt(2);
|
|
37
|
+
case "fallback":
|
|
38
|
+
return BigInt(3);
|
|
39
|
+
case "hook":
|
|
40
|
+
return BigInt(4);
|
|
41
|
+
default:
|
|
42
|
+
throw new Error(`Invalid module type: ${type}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Checks if a smart account supports a specific module type.
|
|
47
|
+
*
|
|
48
|
+
* @param client - The client instance.
|
|
49
|
+
* @param args - Parameters including the smart account and module type to check.
|
|
50
|
+
* @returns A boolean indicating whether the module type is supported.
|
|
51
|
+
* @throws {AccountNotFoundError} If the account is not found.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* import { supportsModule } from '@startale-scs/aa-sdk'
|
|
55
|
+
*
|
|
56
|
+
* const isSupported = await supportsModule(startaleClient, {
|
|
57
|
+
* type: 'executor'
|
|
58
|
+
* })
|
|
59
|
+
* console.log(isSupported) // true or false
|
|
60
|
+
*/
|
|
61
|
+
export async function supportsModule(client, args) {
|
|
62
|
+
const { account: account_ = client.account } = args;
|
|
63
|
+
// Review: all docs paths.
|
|
64
|
+
if (!account_) {
|
|
65
|
+
throw new AccountNotFoundError({
|
|
66
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
const account = parseAccount(account_);
|
|
70
|
+
const publicClient = account.client;
|
|
71
|
+
const [supportsModuleRead] = await toSupportsModuleReads(account, args);
|
|
72
|
+
try {
|
|
73
|
+
return await getAction(publicClient, readContract, "readContract")(supportsModuleRead);
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
if (error instanceof ContractFunctionExecutionError) {
|
|
77
|
+
const { factory, factoryData } = await account.getFactoryArgs();
|
|
78
|
+
const result = await getAction(publicClient, call, "call")({
|
|
79
|
+
factory: factory,
|
|
80
|
+
factoryData: factoryData,
|
|
81
|
+
to: account.address,
|
|
82
|
+
data: encodeFunctionData({
|
|
83
|
+
abi,
|
|
84
|
+
functionName: "supportsModule",
|
|
85
|
+
args: [parseModuleTypeId(args.type)]
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
if (!result || !result.data) {
|
|
89
|
+
throw new Error("accountId result is empty");
|
|
90
|
+
}
|
|
91
|
+
return decodeFunctionResult({
|
|
92
|
+
abi,
|
|
93
|
+
functionName: "supportsModule",
|
|
94
|
+
data: result.data
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
throw error;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
export const toSupportsModuleReads = async (account, { type }) => [
|
|
101
|
+
{
|
|
102
|
+
abi,
|
|
103
|
+
functionName: "supportsModule",
|
|
104
|
+
args: [parseModuleTypeId(type)],
|
|
105
|
+
address: account.address
|
|
106
|
+
}
|
|
107
|
+
];
|
|
108
|
+
//# sourceMappingURL=supportsModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supportsModule.js","sourceRoot":"","sources":["../../../../../src/sdk/clients/decorators/erc7579/supportsModule.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { encodeFunctionData, getAddress } from "viem";
|
|
2
|
+
import { sendUserOperation } from "viem/account-abstraction";
|
|
3
|
+
import { getAction } from "viem/utils";
|
|
4
|
+
import { parseAccount } from "viem/utils";
|
|
5
|
+
import { AccountNotFoundError } from "../../../account/utils/AccountNotFound.js";
|
|
6
|
+
import { parseModuleTypeId } from "./supportsModule.js";
|
|
7
|
+
/**
|
|
8
|
+
* Uninstalls a fallback module from a smart account.
|
|
9
|
+
*
|
|
10
|
+
* @param client - The client instance.
|
|
11
|
+
* @param parameters - Parameters including the smart account, module to uninstall, and optional gas settings.
|
|
12
|
+
* @returns The hash of the user operation as a hexadecimal string.
|
|
13
|
+
* @throws {AccountNotFoundError} If the account is not found.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* import { uninstallFallback } from '@startale-scs/aa-sdk'
|
|
17
|
+
*
|
|
18
|
+
* const userOpHash = await uninstallFallback(startaleClient, {
|
|
19
|
+
* module: {
|
|
20
|
+
* type: 'fallback',
|
|
21
|
+
* address: '0x...',
|
|
22
|
+
* context: '0x'
|
|
23
|
+
* }
|
|
24
|
+
* })
|
|
25
|
+
* console.log(userOpHash) // '0x...'
|
|
26
|
+
*/
|
|
27
|
+
export async function uninstallFallback(client, parameters) {
|
|
28
|
+
const { account: account_ = client.account, maxFeePerGas, maxPriorityFeePerGas, nonce, module } = parameters;
|
|
29
|
+
if (!account_) {
|
|
30
|
+
throw new AccountNotFoundError({
|
|
31
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const account = parseAccount(account_);
|
|
35
|
+
const calls = await toUninstallFallbackCalls(account, module);
|
|
36
|
+
return getAction(client, sendUserOperation, "sendUserOperation")({
|
|
37
|
+
calls,
|
|
38
|
+
maxFeePerGas,
|
|
39
|
+
maxPriorityFeePerGas,
|
|
40
|
+
nonce,
|
|
41
|
+
account: account
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
export const toUninstallFallbackCalls = async (account, { address, initData, type }) => [
|
|
45
|
+
{
|
|
46
|
+
to: account.address,
|
|
47
|
+
value: BigInt(0),
|
|
48
|
+
data: encodeFunctionData({
|
|
49
|
+
abi: [
|
|
50
|
+
{
|
|
51
|
+
name: "uninstallFallback",
|
|
52
|
+
type: "function",
|
|
53
|
+
stateMutability: "nonpayable",
|
|
54
|
+
inputs: [
|
|
55
|
+
{
|
|
56
|
+
type: "uint256",
|
|
57
|
+
name: "moduleTypeId"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
type: "address",
|
|
61
|
+
name: "module"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
type: "bytes",
|
|
65
|
+
name: "deInitData"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
outputs: []
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
functionName: "uninstallFallback",
|
|
72
|
+
args: [parseModuleTypeId(type), getAddress(address), initData ?? "0x"]
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
//# sourceMappingURL=uninstallFallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uninstallFallback.js","sourceRoot":"","sources":["../../../../../src/sdk/clients/decorators/erc7579/uninstallFallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,kBAAkB,EAClB,UAAU,EACX,MAAM,MAAM,CAAA;AACb,OAAO,EAAqB,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAM7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAWpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAGrC,MAA2D,EAC3D,UAAsD;IAEtD,MAAM,EACJ,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,MAAM,EACP,GAAG,UAAU,CAAA;IAEd,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,oBAAoB,CAAC;YAC7B,QAAQ,EAAE,0CAA0C;SACrD,CAAC,CAAA;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAwB,CAAA;IAC7D,MAAM,KAAK,GAAG,MAAM,wBAAwB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAE7D,OAAO,SAAS,CACd,MAAM,EACN,iBAAiB,EACjB,mBAAmB,CACpB,CAAC;QACA,KAAK;QACL,YAAY;QACZ,oBAAoB;QACpB,KAAK;QACL,OAAO,EAAE,OAAO;KACjB,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,EAC3C,OAA4B,EAC5B,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAc,EACtB,EAAE,CAAC;IACpB;QACE,EAAE,EAAE,OAAO,CAAC,OAAO;QACnB,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;QAChB,IAAI,EAAE,kBAAkB,CAAC;YACvB,GAAG,EAAE;gBACH;oBACE,IAAI,EAAE,mBAAmB;oBACzB,IAAI,EAAE,UAAU;oBAChB,eAAe,EAAE,YAAY;oBAC7B,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,SAAS;4BACf,IAAI,EAAE,cAAc;yBACrB;wBACD;4BACE,IAAI,EAAE,SAAS;4BACf,IAAI,EAAE,QAAQ;yBACf;wBACD;4BACE,IAAI,EAAE,OAAO;4BACb,IAAI,EAAE,YAAY;yBACnB;qBACF;oBACD,OAAO,EAAE,EAAE;iBACZ;aACF;YACD,YAAY,EAAE,mBAAmB;YACjC,IAAI,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,QAAQ,IAAI,IAAI,CAAC;SACvE,CAAC;KACH;CACF,CAAA"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { encodeAbiParameters, encodeFunctionData, getAddress } from "viem";
|
|
2
|
+
import { sendUserOperation } from "viem/account-abstraction";
|
|
3
|
+
import { getAction } from "viem/utils";
|
|
4
|
+
import { parseAccount } from "viem/utils";
|
|
5
|
+
import { getInstalledValidators, getPreviousModule } from "./index.js";
|
|
6
|
+
import { AccountNotFoundError } from "../../../account/utils/AccountNotFound.js";
|
|
7
|
+
import { parseModuleTypeId } from "./supportsModule.js";
|
|
8
|
+
/**
|
|
9
|
+
* Uninstalls a module from a smart account.
|
|
10
|
+
*
|
|
11
|
+
* @param client - The client instance.
|
|
12
|
+
* @param parameters - Parameters including the smart account, module to uninstall, and optional gas settings.
|
|
13
|
+
* @returns The hash of the user operation as a hexadecimal string.
|
|
14
|
+
* @throws {AccountNotFoundError} If the account is not found.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* import { uninstallModule } from '@startale-scs/aa-sdk'
|
|
18
|
+
*
|
|
19
|
+
* const userOpHash = await uninstallModule(startaleClient, {
|
|
20
|
+
* module: {
|
|
21
|
+
* type: 'executor',
|
|
22
|
+
* address: '0x...',
|
|
23
|
+
* context: '0x'
|
|
24
|
+
* }
|
|
25
|
+
* })
|
|
26
|
+
* console.log(userOpHash) // '0x...'
|
|
27
|
+
*/
|
|
28
|
+
export async function uninstallModule(client, parameters) {
|
|
29
|
+
const { account: account_ = client.account, maxFeePerGas, maxPriorityFeePerGas, nonce, module: { address, initData, type } } = parameters;
|
|
30
|
+
if (!account_) {
|
|
31
|
+
throw new AccountNotFoundError({
|
|
32
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const account = parseAccount(account_);
|
|
36
|
+
const [installedValidators] = await getInstalledValidators(client);
|
|
37
|
+
const prevModule = await getPreviousModule(client, {
|
|
38
|
+
module: {
|
|
39
|
+
address,
|
|
40
|
+
type
|
|
41
|
+
},
|
|
42
|
+
installedValidators,
|
|
43
|
+
account
|
|
44
|
+
});
|
|
45
|
+
const deInitData = encodeAbiParameters([
|
|
46
|
+
{ name: "prev", type: "address" },
|
|
47
|
+
{ name: "disableModuleData", type: "bytes" }
|
|
48
|
+
], [prevModule, initData ?? "0x"]);
|
|
49
|
+
const calls = await toUninstallModuleCalls(account, {
|
|
50
|
+
address,
|
|
51
|
+
deInitData,
|
|
52
|
+
type
|
|
53
|
+
});
|
|
54
|
+
return getAction(client, sendUserOperation, "sendUserOperation")({
|
|
55
|
+
calls,
|
|
56
|
+
maxFeePerGas,
|
|
57
|
+
maxPriorityFeePerGas,
|
|
58
|
+
nonce,
|
|
59
|
+
account
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
export const toUninstallModuleCalls = async (account, { address, deInitData = "0x", type }) => [
|
|
63
|
+
{
|
|
64
|
+
to: account.address,
|
|
65
|
+
value: BigInt(0),
|
|
66
|
+
data: encodeFunctionData({
|
|
67
|
+
abi: [
|
|
68
|
+
{
|
|
69
|
+
name: "uninstallModule",
|
|
70
|
+
type: "function",
|
|
71
|
+
stateMutability: "nonpayable",
|
|
72
|
+
inputs: [
|
|
73
|
+
{
|
|
74
|
+
type: "uint256",
|
|
75
|
+
name: "moduleTypeId"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: "address",
|
|
79
|
+
name: "module"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
type: "bytes",
|
|
83
|
+
name: "deInitData"
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
outputs: []
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
functionName: "uninstallModule",
|
|
90
|
+
args: [parseModuleTypeId(type), getAddress(address), deInitData]
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
];
|
|
94
|
+
//# sourceMappingURL=uninstallModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uninstallModule.js","sourceRoot":"","sources":["../../../../../src/sdk/clients/decorators/erc7579/uninstallModule.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { sendUserOperation } from "viem/account-abstraction";
|
|
2
|
+
import { getAction } from "viem/utils";
|
|
3
|
+
import { parseAccount } from "viem/utils";
|
|
4
|
+
import { AccountNotFoundError } from "../../../account/utils/AccountNotFound.js";
|
|
5
|
+
import { toUninstallModuleCalls } from "./uninstallModule.js";
|
|
6
|
+
/**
|
|
7
|
+
* Uninstalls multiple modules from a smart account.
|
|
8
|
+
*
|
|
9
|
+
* @param client - The client instance.
|
|
10
|
+
* @param parameters - Parameters including the smart account, modules to uninstall, and optional gas settings.
|
|
11
|
+
* @returns The hash of the user operation as a hexadecimal string.
|
|
12
|
+
* @throws {AccountNotFoundError} If the account is not found.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* import { uninstallModules } from '@startale-scs/aa-sdk'
|
|
16
|
+
*
|
|
17
|
+
* const userOpHash = await uninstallModules(startaleClient, {
|
|
18
|
+
* modules: [
|
|
19
|
+
* { type: 'executor', address: '0x...', context: '0x' },
|
|
20
|
+
* { type: 'validator', address: '0x...', context: '0x' }
|
|
21
|
+
* ]
|
|
22
|
+
* })
|
|
23
|
+
* console.log(userOpHash) // '0x...'
|
|
24
|
+
*/
|
|
25
|
+
export async function uninstallModules(client, parameters) {
|
|
26
|
+
const { account: account_ = client.account, maxFeePerGas, maxPriorityFeePerGas, nonce, modules } = parameters;
|
|
27
|
+
if (!account_) {
|
|
28
|
+
throw new AccountNotFoundError({
|
|
29
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const account = parseAccount(account_);
|
|
33
|
+
const calls = (await Promise.all(modules.flatMap((module) => toUninstallModuleCalls(account, module)))).flat();
|
|
34
|
+
return getAction(client, sendUserOperation, "sendUserOperation")({
|
|
35
|
+
calls,
|
|
36
|
+
maxFeePerGas,
|
|
37
|
+
maxPriorityFeePerGas,
|
|
38
|
+
nonce,
|
|
39
|
+
account
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=uninstallModules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uninstallModules.js","sourceRoot":"","sources":["../../../../../src/sdk/clients/decorators/erc7579/uninstallModules.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAK7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAW1D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAGpC,MAA2D,EAC3D,UAAqD;IAErD,MAAM,EACJ,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,OAAO,EACR,GAAG,UAAU,CAAA;IAEd,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,oBAAoB,CAAC;YAC7B,QAAQ,EAAE,0CAA0C;SACrD,CAAC,CAAA;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAmC,CAAA;IACxE,MAAM,KAAK,GAAG,CACZ,MAAM,OAAO,CAAC,GAAG,CACf,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,sBAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CACrE,CACF,CAAC,IAAI,EAAE,CAAA;IAER,OAAO,SAAS,CACd,MAAM,EACN,iBAAiB,EACjB,mBAAmB,CACpB,CAAC;QACA,KAAK;QACL,YAAY;QACZ,oBAAoB;QACpB,KAAK;QACL,OAAO;KACR,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/sdk/clients/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { formatUserOperationRequest, getUserOperationError, toPackedUserOperation } from "viem/account-abstraction";
|
|
2
|
+
import { parseAccount } from "viem/accounts";
|
|
3
|
+
import { AccountNotFoundError } from "../../../account/utils/AccountNotFound.js";
|
|
4
|
+
import { parseRequestArguments } from "../../../account/utils/Utils.js";
|
|
5
|
+
import { deepHexlify } from "../../../account/utils/deepHexlify.js";
|
|
6
|
+
import { getAAError } from "../../../account/utils/getAAError.js";
|
|
7
|
+
import { DUMMY_SIMULATION_GAS, tenderlySimulation } from "../../../account/utils/tenderlySimulation.js";
|
|
8
|
+
/**
|
|
9
|
+
* Broadcasts a User Operation to the Bundler.
|
|
10
|
+
*
|
|
11
|
+
* - Docs: https://viem.sh/actions/bundler/debugUserOperation
|
|
12
|
+
*
|
|
13
|
+
* @param client - Client to use
|
|
14
|
+
* @param parameters - {@link DebugUserOperationParameters}
|
|
15
|
+
* @returns The User Operation hash. {@link DebugUserOperationReturnType}
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* import { createBundlerClient, http, parseEther } from 'viem'
|
|
19
|
+
* import { mainnet } from 'viem/chains'
|
|
20
|
+
* import { toSmartAccount } from 'viem/accounts'
|
|
21
|
+
* import { debugUserOperation } from 'viem/actions'
|
|
22
|
+
*
|
|
23
|
+
* const account = await toSmartAccount({ ... })
|
|
24
|
+
*
|
|
25
|
+
* const bundlerClient = createBundlerClient({
|
|
26
|
+
* chain: mainnet,
|
|
27
|
+
* transport: http(),
|
|
28
|
+
* })
|
|
29
|
+
*
|
|
30
|
+
* const values = await debugUserOperation(bundlerClient, {
|
|
31
|
+
* account,
|
|
32
|
+
* calls: [{ to: '0x...', value: parseEther('1') }],
|
|
33
|
+
* })
|
|
34
|
+
*/
|
|
35
|
+
export async function debugUserOperation(client, parameters) {
|
|
36
|
+
const chainId = Number(client.account?.client?.chain?.id?.toString() ?? 84532);
|
|
37
|
+
try {
|
|
38
|
+
const { account: account_ = client.account, entryPointAddress } = parameters;
|
|
39
|
+
if (!account_ && !parameters.sender)
|
|
40
|
+
throw new AccountNotFoundError();
|
|
41
|
+
const account = account_ ? parseAccount(account_) : undefined;
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
const callData = await account?.encodeCalls(parameters?.calls);
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
const sender = await account?.getAddress();
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
const nonce = await account?.getNonce();
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
const factoryArgs = await account?.getFactoryArgs();
|
|
50
|
+
const request = {
|
|
51
|
+
sender,
|
|
52
|
+
callData,
|
|
53
|
+
nonce,
|
|
54
|
+
...factoryArgs,
|
|
55
|
+
...parameters,
|
|
56
|
+
...DUMMY_SIMULATION_GAS
|
|
57
|
+
};
|
|
58
|
+
const signature = (parameters.signature ||
|
|
59
|
+
(await account?.signUserOperation(request)));
|
|
60
|
+
const userOpWithSignature = { ...request, signature };
|
|
61
|
+
const packed = toPackedUserOperation(userOpWithSignature);
|
|
62
|
+
console.log("Packed userOp:\n", JSON.stringify([deepHexlify(packed)], null, 2));
|
|
63
|
+
const rpcParameters = formatUserOperationRequest(userOpWithSignature);
|
|
64
|
+
console.log("Bundler userOp:", rpcParameters);
|
|
65
|
+
const tenderlyUrl = tenderlySimulation(rpcParameters, chainId);
|
|
66
|
+
console.log({ tenderlyUrl });
|
|
67
|
+
try {
|
|
68
|
+
const hash = await client.request({
|
|
69
|
+
method: "eth_sendUserOperation",
|
|
70
|
+
params: [
|
|
71
|
+
rpcParameters,
|
|
72
|
+
(entryPointAddress ?? account?.entryPoint.address)
|
|
73
|
+
]
|
|
74
|
+
}, { retryCount: 0 });
|
|
75
|
+
console.log("User Operation Hash:", hash);
|
|
76
|
+
return hash;
|
|
77
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
if (error?.details) {
|
|
81
|
+
const aaError = await getAAError(error?.details);
|
|
82
|
+
console.log({ aaError });
|
|
83
|
+
}
|
|
84
|
+
const calls = parameters.calls;
|
|
85
|
+
throw getUserOperationError(error, {
|
|
86
|
+
...request,
|
|
87
|
+
...(calls ? { calls } : {}),
|
|
88
|
+
signature
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
if (error.metaMessages) {
|
|
95
|
+
try {
|
|
96
|
+
const messageJson = parseRequestArguments(error.metaMessages);
|
|
97
|
+
const tenderlyUrl = tenderlySimulation(messageJson);
|
|
98
|
+
console.log({ tenderlyUrl });
|
|
99
|
+
}
|
|
100
|
+
catch (error) { }
|
|
101
|
+
}
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=debugUserOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugUserOperation.js","sourceRoot":"","sources":["../../../../../src/sdk/clients/decorators/smartAccount/debugUserOperation.ts"],"names":[],"mappings":"AACA,OAAO,EAML,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAA;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAC9D,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,2CAA2C,CAAA;AAUlD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAGtC,MAAqD,EACrD,UAAwC;IAExC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,KAAK,CAAC,CAAA;IAE9E,IAAI,CAAC;QACH,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG,UAAU,CAAA;QAE5E,IAAI,CAAC,QAAQ,IAAI,CAAC,UAAU,CAAC,MAAM;YAAE,MAAM,IAAI,oBAAoB,EAAE,CAAA;QACrE,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QAE7D,aAAa;QACb,MAAM,QAAQ,GAAG,MAAM,OAAO,EAAE,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;QAC9D,aAAa;QACb,MAAM,MAAM,GAAG,MAAM,OAAO,EAAE,UAAU,EAAE,CAAA;QAC1C,aAAa;QACb,MAAM,KAAK,GAAG,MAAM,OAAO,EAAE,QAAQ,EAAE,CAAA;QACvC,aAAa;QACb,MAAM,WAAW,GAAG,MAAM,OAAO,EAAE,cAAc,EAAE,CAAA;QAEnD,MAAM,OAAO,GAAG;YACd,MAAM;YACN,QAAQ;YACR,KAAK;YACL,GAAG,WAAW;YACd,GAAG,UAAU;YACb,GAAG,oBAAoB;SACxB,CAAA;QAED,MAAM,SAAS,GAAG,CAAC,UAAU,CAAC,SAAS;YACrC,CAAC,MAAM,OAAO,EAAE,iBAAiB,CAAC,OAAwB,CAAC,CAAC,CAAE,CAAA;QAEhE,MAAM,mBAAmB,GAAG,EAAE,GAAG,OAAO,EAAE,SAAS,EAAmB,CAAA;QAEtE,MAAM,MAAM,GAAG,qBAAqB,CAAC,mBAAmB,CAAC,CAAA;QACzD,OAAO,CAAC,GAAG,CACT,kBAAkB,EAClB,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAC/C,CAAA;QACD,MAAM,aAAa,GAAG,0BAA0B,CAAC,mBAAmB,CAAC,CAAA;QACrE,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAA;QAE7C,MAAM,WAAW,GAAG,kBAAkB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;QAC9D,OAAO,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,CAAA;QAE5B,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAC/B;gBACE,MAAM,EAAE,uBAAuB;gBAC/B,MAAM,EAAE;oBACN,aAAa;oBACb,CAAC,iBAAiB,IAAI,OAAO,EAAE,UAAU,CAAC,OAAO,CAAE;iBACpD;aACF,EACD,EAAE,UAAU,EAAE,CAAC,EAAE,CAClB,CAAA;YACD,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAA;YACzC,OAAO,IAAI,CAAA;YACX,4DAA4D;QAC9D,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,IAAI,KAAK,EAAE,OAAO,EAAE,CAAC;gBACnB,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;gBAChD,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,CAAA;YAC1B,CAAC;YAED,MAAM,KAAK,GAAI,UAAsB,CAAC,KAAK,CAAA;YAC3C,MAAM,qBAAqB,CAAC,KAAkB,EAAE;gBAC9C,GAAI,OAAyB;gBAC7B,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC3B,SAAS;aACV,CAAC,CAAA;QACJ,CAAC;QACD,4DAA4D;IAC9D,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;YACvB,IAAI,CAAC;gBACH,MAAM,WAAW,GAAG,qBAAqB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;gBAC7D,MAAM,WAAW,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAA;gBACnD,OAAO,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,CAAA;YAC9B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC,CAAA,CAAC;QACpB,CAAC;QACD,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { debugUserOperation } from "./debugUserOperation.js";
|
|
2
|
+
import { prepareTokenPaymasterUserOp } from "./prepareTokenPaymasterUserOp.js";
|
|
3
|
+
import { prepareUserOperationWithoutSignature } from "./prepareUserOperationWithoutSignature.js";
|
|
4
|
+
import { sendTokenPaymasterUserOp } from "./sendTokenPaymasterUserOp.js";
|
|
5
|
+
import { sendTransaction } from "./sendTransaction.js";
|
|
6
|
+
import { signMessage } from "./signMessage.js";
|
|
7
|
+
import { signTypedData } from "./signTypedData.js";
|
|
8
|
+
import { toUpgradeSmartAccountCalls, upgradeSmartAccount } from "./upgradeSmartAccount.js";
|
|
9
|
+
import { waitForTransactionReceipt } from "./waitForTransactionReceipt.js";
|
|
10
|
+
import { writeContract } from "./writeContract.js";
|
|
11
|
+
export function smartAccountActions() {
|
|
12
|
+
return (client) => ({
|
|
13
|
+
sendTokenPaymasterUserOp: (args) => sendTokenPaymasterUserOp(client, args),
|
|
14
|
+
prepareTokenPaymasterUserOp: (args) => prepareTokenPaymasterUserOp(client, args),
|
|
15
|
+
sendTransaction: (args) => sendTransaction(client, args),
|
|
16
|
+
signMessage: (args) => signMessage(client, args),
|
|
17
|
+
signTypedData: (args) => signTypedData(client, args),
|
|
18
|
+
writeContract: (args) => writeContract(client, args),
|
|
19
|
+
waitForTransactionReceipt: (args) => waitForTransactionReceipt(client, args),
|
|
20
|
+
debugUserOperation: (args) => debugUserOperation(client, args),
|
|
21
|
+
prepareUserOperation: (args) => prepareUserOperationWithoutSignature(client, args),
|
|
22
|
+
upgradeSmartAccount: (args) => upgradeSmartAccount(client, args)
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export const smartAccountCalls = {
|
|
26
|
+
toUpgradeSmartAccountCalls
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/sdk/clients/decorators/smartAccount/index.ts"],"names":[],"mappings":"AAqBA,OAAO,EAEL,kBAAkB,EACnB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAEL,2BAA2B,EAC5B,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,oCAAoC,EAAE,MAAM,wCAAwC,CAAA;AAC7F,OAAO,EAEL,wBAAwB,EACzB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAEL,0BAA0B,EAC1B,mBAAmB,EACpB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAiX/C,MAAM,UAAU,mBAAmB;IACjC,OAAO,CAIL,MAAgD,EACJ,EAAE,CAAC,CAAC;QAChD,wBAAwB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,wBAAwB,CAAC,MAAM,EAAE,IAAI,CAAC;QAC1E,2BAA2B,EAAE,CAAC,IAAI,EAAE,EAAE,CACpC,2BAA2B,CAAC,MAAM,EAAE,IAAI,CAAC;QAC3C,eAAe,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,IAAe,CAAC;QACnE,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC;QAChD,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC;QACpD,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC;QACpD,yBAAyB,EAAE,CAAC,IAAI,EAAE,EAAE,CAClC,yBAAyB,CAAC,MAAM,EAAE,IAAI,CAAC;QACzC,kBAAkB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC;QAC9D,oBAAoB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC7B,oCAAoC,CAAC,MAAM,EAAE,IAAI,CAAC;QACpD,mBAAmB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC;KACjE,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,0BAA0B;CACT,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { erc20Abi, maxUint256 } from "viem";
|
|
2
|
+
import { encodeFunctionData } from "viem";
|
|
3
|
+
import { getAction } from "viem/utils";
|
|
4
|
+
import { STARTALE_TOKEN_PAYMASTER } from "../../../account/utils/Constants.js";
|
|
5
|
+
import { prepareUserOperationWithoutSignature } from "./prepareUserOperationWithoutSignature.js";
|
|
6
|
+
/**
|
|
7
|
+
* Prepares a user operation with token paymaster configuration, including ERC20 token approval
|
|
8
|
+
*
|
|
9
|
+
* This function handles:
|
|
10
|
+
* 1. Checking current token allowance of Smart Account
|
|
11
|
+
* 2. Creating an approval transaction for the token paymaster if needed
|
|
12
|
+
* 3. Preparing the user operation with the approval and user transactions
|
|
13
|
+
*
|
|
14
|
+
* @param client - The StartaleAccountClient instance
|
|
15
|
+
* @param args.txs - Array of transactions to be executed
|
|
16
|
+
* @param args.feeTokenAddress - Token used for paying for the gas
|
|
17
|
+
* @param args.customApprovalAmount - Optional custom approval amount
|
|
18
|
+
*
|
|
19
|
+
* @returns A prepared user operation without signature (will be signed by the Smart Account when sent)
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const userOp = await prepareTokenPaymasterUserOp(startaleClient, {
|
|
24
|
+
* txs: [
|
|
25
|
+
* {
|
|
26
|
+
* to: recipientAddress,
|
|
27
|
+
* value: 1n,
|
|
28
|
+
* data: "0x"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
customApprovalAmount: usdcFeeAmount
|
|
32
|
+
})
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @throws Will throw an error if client account or paymaster context is not properly configured
|
|
36
|
+
*/
|
|
37
|
+
export async function prepareTokenPaymasterUserOp(client, args) {
|
|
38
|
+
const { calls, customApprovalAmount, feeTokenAddress } = args;
|
|
39
|
+
const userOp = await getAction(client, prepareUserOperationWithoutSignature, "prepareUserOperation")({
|
|
40
|
+
calls: [
|
|
41
|
+
{
|
|
42
|
+
to: feeTokenAddress,
|
|
43
|
+
data: encodeFunctionData({
|
|
44
|
+
functionName: "approve",
|
|
45
|
+
abi: erc20Abi,
|
|
46
|
+
args: [STARTALE_TOKEN_PAYMASTER, customApprovalAmount ?? maxUint256]
|
|
47
|
+
}),
|
|
48
|
+
value: BigInt(0)
|
|
49
|
+
},
|
|
50
|
+
...calls
|
|
51
|
+
],
|
|
52
|
+
account: client.account
|
|
53
|
+
});
|
|
54
|
+
const partialUserOp = {
|
|
55
|
+
...userOp,
|
|
56
|
+
signature: undefined
|
|
57
|
+
};
|
|
58
|
+
return partialUserOp;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=prepareTokenPaymasterUserOp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepareTokenPaymasterUserOp.js","sourceRoot":"","sources":["../../../../../src/sdk/clients/decorators/smartAccount/prepareTokenPaymasterUserOp.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,QAAQ,EACR,UAAU,EACX,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAA;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAA;AAC3E,OAAO,EAAE,oCAAoC,EAAE,MAAM,wCAAwC,CAAA;AAqB7F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAI/C,MAAyC,EACzC,IAA2C;IAE3C,MAAM,EAAE,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,GAAG,IAAI,CAAA;IAE7D,MAAM,MAAM,GAAG,MAAM,SAAS,CAC5B,MAAM,EACN,oCAAoC,EACpC,sBAAsB,CACvB,CAAC;QACA,KAAK,EAAE;YACL;gBACE,EAAE,EAAE,eAAe;gBACnB,IAAI,EAAE,kBAAkB,CAAC;oBACvB,YAAY,EAAE,SAAS;oBACvB,GAAG,EAAE,QAAQ;oBACb,IAAI,EAAE,CAAC,wBAAwB,EAAE,oBAAoB,IAAI,UAAU,CAAC;iBACrE,CAAC;gBACF,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;aACjB;YACD,GAAG,KAAK;SACT;QACD,OAAO,EAAE,MAAM,CAAC,OAAuB;KACxC,CAAC,CAAA;IAEF,MAAM,aAAa,GAAG;QACpB,GAAG,MAAM;QACT,SAAS,EAAE,SAAS;KACrB,CAAA;IAED,OAAO,aAAa,CAAA;AACtB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { prepareUserOperation } from "viem/account-abstraction";
|
|
2
|
+
import { getAction } from "viem/utils";
|
|
3
|
+
import { safeMultiplier } from "../../../account/utils/Utils.js";
|
|
4
|
+
const gasFields = [
|
|
5
|
+
"preVerificationGas",
|
|
6
|
+
"verificationGasLimit",
|
|
7
|
+
"callGasLimit",
|
|
8
|
+
"maxFeePerGas",
|
|
9
|
+
"maxPriorityFeePerGas",
|
|
10
|
+
"paymasterVerificationGasLimit",
|
|
11
|
+
"paymasterPostOpGasLimit"
|
|
12
|
+
];
|
|
13
|
+
export async function prepareUserOperationWithoutSignature(client, parameters) {
|
|
14
|
+
const { gasBuffer, ...args } = parameters;
|
|
15
|
+
let userOp = await getAction(client, prepareUserOperation, "prepareUserOperation")(args);
|
|
16
|
+
if (gasBuffer) {
|
|
17
|
+
// Fields that need gas safety margin applied
|
|
18
|
+
const { fields, factor } = gasBuffer;
|
|
19
|
+
const adjustedGasEstimates = gasFields.reduce((adjustedValues, field) => {
|
|
20
|
+
if (fields.includes(field)) {
|
|
21
|
+
adjustedValues[field] = safeMultiplier(userOp[field], factor);
|
|
22
|
+
}
|
|
23
|
+
return adjustedValues;
|
|
24
|
+
}, {});
|
|
25
|
+
// Apply gas safety margin to specified fields and merge with original userOp
|
|
26
|
+
userOp = {
|
|
27
|
+
...userOp,
|
|
28
|
+
...adjustedGasEstimates
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
// Remove signature from userOp if it exists
|
|
32
|
+
const { signature, ...userOpWithoutSignature } = userOp;
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
return userOpWithoutSignature;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=prepareUserOperationWithoutSignature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepareUserOperationWithoutSignature.js","sourceRoot":"","sources":["../../../../../src/sdk/clients/decorators/smartAccount/prepareUserOperationWithoutSignature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAS/D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAG7D,MAAM,SAAS,GAAG;IAChB,oBAAoB;IACpB,sBAAsB;IACtB,cAAc;IACd,cAAc;IACd,sBAAsB;IACtB,+BAA+B;IAC/B,yBAAyB;CACjB,CAAA;AAcV,MAAM,CAAC,KAAK,UAAU,oCAAoC,CAUxD,MAAqD,EACrD,UAC0E;IAO1E,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,UAAU,CAAA;IAEzC,IAAI,MAAM,GAAG,MAAM,SAAS,CAC1B,MAAM,EACN,oBAAoB,EACpB,sBAAsB,CACvB,CAAC,IAAe,CAAC,CAAA;IAElB,IAAI,SAAS,EAAE,CAAC;QACd,6CAA6C;QAC7C,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;QACpC,MAAM,oBAAoB,GAAG,SAAS,CAAC,MAAM,CAC3C,CAAC,cAAc,EAAE,KAAK,EAAE,EAAE;YACxB,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC3B,cAAc,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAA;YAC/D,CAAC;YACD,OAAO,cAAc,CAAA;QACvB,CAAC,EACD,EAAgD,CACjD,CAAA;QAED,6EAA6E;QAC7E,MAAM,GAAG;YACP,GAAG,MAAM;YACT,GAAG,oBAAoB;SACxB,CAAA;IACH,CAAC;IAED,4CAA4C;IAC5C,MAAM,EAAE,SAAS,EAAE,GAAG,sBAAsB,EAAE,GAAG,MAAM,CAAA;IAEvD,aAAa;IACb,OAAO,sBAAsB,CAAA;AAC/B,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { sendUserOperation } from "viem/account-abstraction";
|
|
2
|
+
import { getAction } from "viem/utils";
|
|
3
|
+
import { prepareTokenPaymasterUserOp } from "./prepareTokenPaymasterUserOp.js";
|
|
4
|
+
/**
|
|
5
|
+
* Prepares and sends a user operation with token paymaster
|
|
6
|
+
*
|
|
7
|
+
* @param client - The Startale client instance
|
|
8
|
+
* @param args - The parameters for the token paymaster user operation
|
|
9
|
+
* @param args.calls - Array of transactions to be executed
|
|
10
|
+
* @param args.feeTokenAddress - Address of the token to be used for paying gas fees
|
|
11
|
+
* @param args.customApprovalAmount - Optional custom amount to approve for the paymaster (defaults to unlimited)
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const hash = await sendTokenPaymasterUserOp(client, {
|
|
16
|
+
* calls: [{
|
|
17
|
+
* to: "0x...", // Contract address
|
|
18
|
+
* data: "0x...", // Encoded function data
|
|
19
|
+
* value: BigInt(0)
|
|
20
|
+
* }],
|
|
21
|
+
* feeTokenAddress: "0x...", // USDC/USDT/etc address
|
|
22
|
+
* customApprovalAmount: BigInt(1000) // Optional: specific approval amount
|
|
23
|
+
* })
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @returns A promise that resolves to the user operation hash {@link Hash}
|
|
27
|
+
*/
|
|
28
|
+
export async function sendTokenPaymasterUserOp(client, args) {
|
|
29
|
+
const { calls, feeTokenAddress, customApprovalAmount } = args;
|
|
30
|
+
const userOp = await getAction(client, prepareTokenPaymasterUserOp, "prepareTokenPaymasterUserOperation")({
|
|
31
|
+
calls,
|
|
32
|
+
// Removed batching approval here as it is part of prepareTokenPaymasterUserOp
|
|
33
|
+
feeTokenAddress,
|
|
34
|
+
customApprovalAmount
|
|
35
|
+
});
|
|
36
|
+
const partialUserOp = {
|
|
37
|
+
...userOp,
|
|
38
|
+
signature: undefined
|
|
39
|
+
};
|
|
40
|
+
const userOpHash = await getAction(client, sendUserOperation, "sendUserOperation")(partialUserOp);
|
|
41
|
+
return userOpHash;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=sendTokenPaymasterUserOp.js.map
|