@startale-scs/aa-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +20 -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 +251 -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/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/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 +27 -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 +42 -0
- package/dist/_cjs/clients/createHttpClient.js.map +1 -0
- package/dist/_cjs/clients/createSCSBundlerClient.js +45 -0
- package/dist/_cjs/clients/createSCSBundlerClient.js.map +1 -0
- package/dist/_cjs/clients/createSCSPaymasterClient.js +39 -0
- package/dist/_cjs/clients/createSCSPaymasterClient.js.map +1 -0
- package/dist/_cjs/clients/decorators/bundler/getGasFeeValues.js +34 -0
- package/dist/_cjs/clients/decorators/bundler/getGasFeeValues.js.map +1 -0
- package/dist/_cjs/clients/decorators/bundler/getUserOperationStatus.js +10 -0
- package/dist/_cjs/clients/decorators/bundler/getUserOperationStatus.js.map +1 -0
- package/dist/_cjs/clients/decorators/bundler/index.js +15 -0
- package/dist/_cjs/clients/decorators/bundler/index.js.map +1 -0
- package/dist/_cjs/clients/decorators/bundler/waitForConfirmedUserOperationReceipt.js +27 -0
- package/dist/_cjs/clients/decorators/bundler/waitForConfirmedUserOperationReceipt.js.map +1 -0
- package/dist/_cjs/clients/decorators/bundler/waitForUserOperationReceipt.js +13 -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 +94 -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 +35 -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 +62 -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 +44 -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 +38 -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 +44 -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 +124 -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 +27 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/index.js.map +1 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/preparePermission.js +127 -0
- package/dist/_cjs/modules/validators/smartSessionsValidator/decorators/preparePermission.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 +327 -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/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/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 +19 -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 +43 -0
- package/dist/_esm/clients/createHttpClient.js.map +1 -0
- package/dist/_esm/clients/createSCSBundlerClient.js +56 -0
- package/dist/_esm/clients/createSCSBundlerClient.js.map +1 -0
- package/dist/_esm/clients/createSCSPaymasterClient.js +74 -0
- package/dist/_esm/clients/createSCSPaymasterClient.js.map +1 -0
- package/dist/_esm/clients/decorators/bundler/getGasFeeValues.js +53 -0
- package/dist/_esm/clients/decorators/bundler/getGasFeeValues.js.map +1 -0
- package/dist/_esm/clients/decorators/bundler/getUserOperationStatus.js +8 -0
- package/dist/_esm/clients/decorators/bundler/getUserOperationStatus.js.map +1 -0
- package/dist/_esm/clients/decorators/bundler/index.js +11 -0
- package/dist/_esm/clients/decorators/bundler/index.js.map +1 -0
- package/dist/_esm/clients/decorators/bundler/waitForConfirmedUserOperationReceipt.js +26 -0
- package/dist/_esm/clients/decorators/bundler/waitForConfirmedUserOperationReceipt.js.map +1 -0
- package/dist/_esm/clients/decorators/bundler/waitForUserOperationReceipt.js +10 -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 +109 -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 +44 -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 +70 -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 +29 -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 +52 -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 +46 -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 +63 -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 +173 -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 +79 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/decorators/grantPermission.js.map +1 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/decorators/index.js +40 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/decorators/index.js.map +1 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/decorators/preparePermission.js +191 -0
- package/dist/_esm/modules/validators/smartSessionsValidator/decorators/preparePermission.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 +110 -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/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/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 +19 -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 +71 -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/getUserOperationStatus.d.ts +17 -0
- package/dist/_types/clients/decorators/bundler/getUserOperationStatus.d.ts.map +1 -0
- package/dist/_types/clients/decorators/bundler/index.d.ts +61 -0
- package/dist/_types/clients/decorators/bundler/index.d.ts.map +1 -0
- package/dist/_types/clients/decorators/bundler/waitForConfirmedUserOperationReceipt.d.ts +8 -0
- package/dist/_types/clients/decorators/bundler/waitForConfirmedUserOperationReceipt.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 +51 -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 +88 -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 +16 -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 +110 -0
- package/dist/_types/modules/validators/smartSessionsValidator/Helpers.d.ts.map +1 -0
- package/dist/_types/modules/validators/smartSessionsValidator/Types.d.ts +223 -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 +70 -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/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,67 @@
|
|
|
1
|
+
import { readContract } from "viem/actions";
|
|
2
|
+
import { getAction, parseAccount } from "viem/utils";
|
|
3
|
+
import { AccountNotFoundError } from "../../../account/utils/AccountNotFound.js";
|
|
4
|
+
import { GENERIC_FALLBACK_SELECTOR } from "../../../account/utils/Constants.js";
|
|
5
|
+
const abi = [
|
|
6
|
+
{
|
|
7
|
+
inputs: [
|
|
8
|
+
{
|
|
9
|
+
internalType: "bytes4",
|
|
10
|
+
name: "selector",
|
|
11
|
+
type: "bytes4"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
name: "getFallbackHandlerBySelector",
|
|
15
|
+
outputs: [
|
|
16
|
+
{
|
|
17
|
+
internalType: "CallType",
|
|
18
|
+
name: "",
|
|
19
|
+
type: "bytes1"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
internalType: "address",
|
|
23
|
+
name: "",
|
|
24
|
+
type: "address"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
stateMutability: "view",
|
|
28
|
+
type: "function"
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
/**
|
|
32
|
+
* Retrieves the fallback handler for a given selector in a smart account.
|
|
33
|
+
*
|
|
34
|
+
* @param client - The client instance.
|
|
35
|
+
* @param parameters - Parameters including the smart account and optional selector.
|
|
36
|
+
* @returns A tuple containing the call type and address of the fallback handler.
|
|
37
|
+
* @throws {AccountNotFoundError} If the account is not found.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* import { getFallbackBySelector } from '@startale-scs/aa-sdk'
|
|
41
|
+
*
|
|
42
|
+
* const [callType, handlerAddress] = await getFallbackBySelector(startaleClient, {
|
|
43
|
+
* selector: '0x12345678'
|
|
44
|
+
* })
|
|
45
|
+
* console.log(callType, handlerAddress) // '0x1' '0x...'
|
|
46
|
+
*/
|
|
47
|
+
export async function getFallbackBySelector(client, parameters) {
|
|
48
|
+
const { account: account_ = client.account, selector = GENERIC_FALLBACK_SELECTOR } = parameters;
|
|
49
|
+
if (!account_) {
|
|
50
|
+
throw new AccountNotFoundError({
|
|
51
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const account = parseAccount(account_);
|
|
55
|
+
const publicClient = account.client;
|
|
56
|
+
const [getFallbackBySelectorRead] = await toGetFallbackBySelectorReads(account, selector);
|
|
57
|
+
return getAction(publicClient, readContract, "readContract")(getFallbackBySelectorRead);
|
|
58
|
+
}
|
|
59
|
+
export const toGetFallbackBySelectorReads = async (account, selector) => [
|
|
60
|
+
{
|
|
61
|
+
address: account.address,
|
|
62
|
+
abi,
|
|
63
|
+
functionName: "getFallbackHandlerBySelector",
|
|
64
|
+
args: [selector]
|
|
65
|
+
}
|
|
66
|
+
];
|
|
67
|
+
//# sourceMappingURL=getFallbackBySelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFallbackBySelector.js","sourceRoot":"","sources":["../../../../../src/sdk/clients/decorators/erc7579/getFallbackBySelector.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAC7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAA;AAS5E,MAAM,GAAG,GAAG;IACV;QACE,MAAM,EAAE;YACN;gBACE,YAAY,EAAE,QAAQ;gBACtB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;aACf;SACF;QACD,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE;YACP;gBACE,YAAY,EAAE,UAAU;gBACxB,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,QAAQ;aACf;YACD;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,SAAS;aAChB;SACF;QACD,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;CACF,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAGzC,MAA2D,EAC3D,UAA0D;IAE1D,MAAM,EACJ,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,QAAQ,GAAG,yBAAyB,EACrC,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,YAAY,GAAG,OAAO,CAAC,MAAM,CAAA;IAEnC,MAAM,CAAC,yBAAyB,CAAC,GAAG,MAAM,4BAA4B,CACpE,OAAO,EACP,QAAQ,CACT,CAAA;IAED,OAAO,SAAS,CACd,YAAY,EACZ,YAAY,EACZ,cAAc,CACf,CAAC,yBAAyB,CAAwB,CAAA;AACrD,CAAC;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,EAC/C,OAA4B,EAC5B,QAAa,EAGb,EAAE,CAAC;IACH;QACE,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,GAAG;QACH,YAAY,EAAE,8BAA8B;QAC5C,IAAI,EAAE,CAAC,QAAQ,CAAC;KACjB;CACF,CAAA"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { readContract } from "viem/actions";
|
|
2
|
+
import { getAction, parseAccount } from "viem/utils";
|
|
3
|
+
import { AccountNotFoundError } from "../../../account/utils/AccountNotFound.js";
|
|
4
|
+
import { SENTINEL_ADDRESS } from "../../../account/utils/Constants.js";
|
|
5
|
+
const abi = [
|
|
6
|
+
{
|
|
7
|
+
inputs: [
|
|
8
|
+
{
|
|
9
|
+
internalType: "address",
|
|
10
|
+
name: "cursor",
|
|
11
|
+
type: "address"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
internalType: "uint256",
|
|
15
|
+
name: "size",
|
|
16
|
+
type: "uint256"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
name: "getExecutorsPaginated",
|
|
20
|
+
outputs: [
|
|
21
|
+
{
|
|
22
|
+
internalType: "address[]",
|
|
23
|
+
name: "array",
|
|
24
|
+
type: "address[]"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
internalType: "address",
|
|
28
|
+
name: "next",
|
|
29
|
+
type: "address"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
stateMutability: "view",
|
|
33
|
+
type: "function"
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves the installed executors for a given smart account.
|
|
38
|
+
*
|
|
39
|
+
* @param client - The client instance.
|
|
40
|
+
* @param parameters - Parameters including the smart account, page size, and cursor.
|
|
41
|
+
* @returns A tuple containing an array of executor addresses and the next cursor.
|
|
42
|
+
* @throws {AccountNotFoundError} If the account is not found.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* import { getInstalledExecutors } from '@startale-scs/aa-sdk'
|
|
46
|
+
*
|
|
47
|
+
* const [executors, nextCursor] = await getInstalledExecutors(startaleClient, {
|
|
48
|
+
* pageSize: 10n
|
|
49
|
+
* })
|
|
50
|
+
* console.log(executors, nextCursor) // ['0x...', '0x...'], '0x...'
|
|
51
|
+
*/
|
|
52
|
+
export async function getInstalledExecutors(client, parameters) {
|
|
53
|
+
const account_ = parameters?.account ?? client.account;
|
|
54
|
+
const pageSize = parameters?.pageSize ?? 100n;
|
|
55
|
+
const cursor = parameters?.cursor ?? SENTINEL_ADDRESS;
|
|
56
|
+
if (!account_) {
|
|
57
|
+
throw new AccountNotFoundError({
|
|
58
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
const account = parseAccount(account_);
|
|
62
|
+
const publicClient = account.client;
|
|
63
|
+
const [getInstalledExecutorsRead] = await toGetInstalledExecutorsReads(account, { pageSize, cursor });
|
|
64
|
+
return getAction(publicClient, readContract, "readContract")(getInstalledExecutorsRead);
|
|
65
|
+
}
|
|
66
|
+
export const toGetInstalledExecutorsReads = async (account, { pageSize = 100n, cursor = SENTINEL_ADDRESS }) => [
|
|
67
|
+
{
|
|
68
|
+
address: account.address,
|
|
69
|
+
abi,
|
|
70
|
+
functionName: "getExecutorsPaginated",
|
|
71
|
+
args: [cursor, pageSize]
|
|
72
|
+
}
|
|
73
|
+
];
|
|
74
|
+
//# sourceMappingURL=getInstalledExecutors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getInstalledExecutors.js","sourceRoot":"","sources":["../../../../../src/sdk/clients/decorators/erc7579/getInstalledExecutors.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAUnE,MAAM,GAAG,GAAG;IACV;QACE,MAAM,EAAE;YACN;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,SAAS;aAChB;SACF;QACD,IAAI,EAAE,uBAAuB;QAC7B,OAAO,EAAE;YACP;gBACE,YAAY,EAAE,WAAW;gBACzB,IAAI,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 +1,72 @@
|
|
|
1
|
+
import { readContract } from "viem/actions";
|
|
2
|
+
import { getAction, parseAccount } from "viem/utils";
|
|
3
|
+
import { AccountNotFoundError } from "../../../account/utils/AccountNotFound.js";
|
|
4
|
+
import { SENTINEL_ADDRESS } from "../../../account/utils/Constants.js";
|
|
5
|
+
const abi = [
|
|
6
|
+
{
|
|
7
|
+
inputs: [
|
|
8
|
+
{
|
|
9
|
+
internalType: "address",
|
|
10
|
+
name: "cursor",
|
|
11
|
+
type: "address"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
internalType: "uint256",
|
|
15
|
+
name: "size",
|
|
16
|
+
type: "uint256"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
name: "getValidatorsPaginated",
|
|
20
|
+
outputs: [
|
|
21
|
+
{
|
|
22
|
+
internalType: "address[]",
|
|
23
|
+
name: "array",
|
|
24
|
+
type: "address[]"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
internalType: "address",
|
|
28
|
+
name: "next",
|
|
29
|
+
type: "address"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
stateMutability: "view",
|
|
33
|
+
type: "function"
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves the installed validators for a given smart account.
|
|
38
|
+
*
|
|
39
|
+
* @param client - The client instance.
|
|
40
|
+
* @param parameters - Parameters including the smart account, page size, and cursor.
|
|
41
|
+
* @returns A tuple containing an array of validator addresses and the next cursor.
|
|
42
|
+
* @throws {AccountNotFoundError} If the account is not found.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* import { getInstalledValidators } from '@startale-scs/aa-sdk'
|
|
46
|
+
*
|
|
47
|
+
* const [validators, nextCursor] = await getInstalledValidators(startaleClient, {
|
|
48
|
+
* pageSize: 10n
|
|
49
|
+
* })
|
|
50
|
+
* console.log(validators, nextCursor) // ['0x...', '0x...'], '0x...'
|
|
51
|
+
*/
|
|
52
|
+
export async function getInstalledValidators(client, parameters) {
|
|
53
|
+
const { account: account_ = client.account, pageSize = 100n, cursor = SENTINEL_ADDRESS } = parameters ?? {};
|
|
54
|
+
if (!account_) {
|
|
55
|
+
throw new AccountNotFoundError({
|
|
56
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const account = parseAccount(account_);
|
|
60
|
+
const publicClient = account.client;
|
|
61
|
+
const [getInstalledValidatorsRead] = await toGetInstalledValidatorsReads(account, { pageSize, cursor });
|
|
62
|
+
return getAction(publicClient, readContract, "readContract")(getInstalledValidatorsRead);
|
|
63
|
+
}
|
|
64
|
+
export const toGetInstalledValidatorsReads = async (account, { pageSize = 100n, cursor = SENTINEL_ADDRESS }) => [
|
|
65
|
+
{
|
|
66
|
+
address: account.address,
|
|
67
|
+
abi,
|
|
68
|
+
functionName: "getValidatorsPaginated",
|
|
69
|
+
args: [cursor, pageSize]
|
|
70
|
+
}
|
|
71
|
+
];
|
|
72
|
+
//# sourceMappingURL=getInstalledValidators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getInstalledValidators.js","sourceRoot":"","sources":["../../../../../src/sdk/clients/decorators/erc7579/getInstalledValidators.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAUnE,MAAM,GAAG,GAAG;IACV;QACE,MAAM,EAAE;YACN;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,SAAS;aAChB;SACF;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CAAC;KACzB;CACF,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { getAddress } from "viem/utils";
|
|
2
|
+
import { AccountNotFoundError } from "../../../account/utils/AccountNotFound.js";
|
|
3
|
+
const SENTINEL_ADDRESS = "0x0000000000000000000000000000000000000001";
|
|
4
|
+
/**
|
|
5
|
+
* Gets the address of the previous module of the same type as the given module.
|
|
6
|
+
*
|
|
7
|
+
* @param client - The client instance.
|
|
8
|
+
* @param parameters - Parameters including the smart account and the module to check.
|
|
9
|
+
* @returns The address of the previous module, or the sentinel address if it's the first module.
|
|
10
|
+
* @throws {AccountNotFoundError} If the account is not found.
|
|
11
|
+
* @throws {Error} If the module type is unknown or the module is not found.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* import { getPreviousModule } from '@startale-scs/aa-sdk'
|
|
15
|
+
*
|
|
16
|
+
* const previousModuleAddress = await getPreviousModule(startaleClient, {
|
|
17
|
+
* module: {
|
|
18
|
+
* type: 'validator',
|
|
19
|
+
* moduleAddress: '0x...',
|
|
20
|
+
* }
|
|
21
|
+
* })
|
|
22
|
+
* console.log(previousModuleAddress) // '0x...'
|
|
23
|
+
*/
|
|
24
|
+
export async function getPreviousModule(client, parameters) {
|
|
25
|
+
const { account: account_ = client.account, module } = parameters;
|
|
26
|
+
if (!account_) {
|
|
27
|
+
throw new AccountNotFoundError({
|
|
28
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
let installedModules;
|
|
32
|
+
if (module.type === "validator") {
|
|
33
|
+
if (!parameters.installedValidators)
|
|
34
|
+
throw Error("installedValidators parameter is missing");
|
|
35
|
+
installedModules = [...parameters.installedValidators];
|
|
36
|
+
}
|
|
37
|
+
else if (module.type === "executor") {
|
|
38
|
+
if (!parameters.installedExecutors)
|
|
39
|
+
throw Error("installedExecutors parameter is missing");
|
|
40
|
+
installedModules = [...parameters.installedExecutors];
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
throw new Error(`Unknown module type ${module.type}`);
|
|
44
|
+
}
|
|
45
|
+
const index = installedModules.indexOf(getAddress(module.address));
|
|
46
|
+
if (index === 0) {
|
|
47
|
+
return SENTINEL_ADDRESS;
|
|
48
|
+
}
|
|
49
|
+
if (index > 0) {
|
|
50
|
+
return installedModules[index - 1];
|
|
51
|
+
}
|
|
52
|
+
throw new Error(`Module ${module.address} not found in installed modules`);
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=getPreviousModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPreviousModule.js","sourceRoot":"","sources":["../../../../../src/sdk/clients/decorators/erc7579/getPreviousModule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAE7E,MAAM,gBAAgB,GAAG,4CAAqD,CAAA;AAU9E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAGrC,MAAc,EACd,UAAsD;IAEtD,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU,CAAA;IAEjE,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,oBAAoB,CAAC;YAC7B,QAAQ,EAAE,0CAA0C;SACrD,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,gBAAuB,CAAA;IAC3B,IAAI,MAAM,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAChC,IAAI,CAAC,UAAU,CAAC,mBAAmB;YACjC,MAAM,KAAK,CAAC,0CAA0C,CAAC,CAAA;QACzD,gBAAgB,GAAG,CAAC,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAA;IACxD,CAAC;SAAM,IAAI,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACtC,IAAI,CAAC,UAAU,CAAC,kBAAkB;YAChC,MAAM,KAAK,CAAC,yCAAyC,CAAC,CAAA;QACxD,gBAAgB,GAAG,CAAC,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAA;IACvD,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,uBAAuB,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;IACvD,CAAC;IAED,MAAM,KAAK,GAAG,gBAAgB,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;IAClE,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QAChB,OAAO,gBAAgB,CAAA;IACzB,CAAC;IACD,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACd,OAAO,gBAAgB,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;IACpC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,UAAU,MAAM,CAAC,OAAO,iCAAiC,CAAC,CAAA;AAC5E,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { accountId } from "./accountId.js";
|
|
2
|
+
import { getActiveHook, toGetActiveHookReads } from "./getActiveHook.js";
|
|
3
|
+
import { getFallbackBySelector, toGetFallbackBySelectorReads } from "./getFallbackBySelector.js";
|
|
4
|
+
import { getInstalledExecutors, toGetInstalledExecutorsReads } from "./getInstalledExecutors.js";
|
|
5
|
+
import { getInstalledValidators, toGetInstalledValidatorsReads } from "./getInstalledValidators.js";
|
|
6
|
+
import { getPreviousModule } from "./getPreviousModule.js";
|
|
7
|
+
import { installModule, toInstallModuleCalls, toInstallWithSafeSenderCalls, } from "./installModule.js";
|
|
8
|
+
import { installModules } from "./installModules.js";
|
|
9
|
+
import { isModuleInstalled, toIsModuleInstalledReads } from "./isModuleInstalled.js";
|
|
10
|
+
import { supportsExecutionMode, toSupportsExecutionModeReads } from "./supportsExecutionMode.js";
|
|
11
|
+
import { supportsModule, toSupportsModuleReads } from "./supportsModule.js";
|
|
12
|
+
import { toUninstallFallbackCalls } from "./uninstallFallback.js";
|
|
13
|
+
import { toUninstallModuleCalls, uninstallModule } from "./uninstallModule.js";
|
|
14
|
+
import { uninstallModules } from "./uninstallModules.js";
|
|
15
|
+
export { accountId, installModule, installModules, isModuleInstalled, supportsExecutionMode, supportsModule, uninstallModule, uninstallModules, getInstalledValidators, getInstalledExecutors, getActiveHook, getFallbackBySelector, getPreviousModule };
|
|
16
|
+
export function erc7579Actions() {
|
|
17
|
+
return (client) => ({
|
|
18
|
+
accountId: (args) => accountId(client, args),
|
|
19
|
+
installModule: (args) => installModule(client, args),
|
|
20
|
+
installModules: (args) => installModules(client, args),
|
|
21
|
+
isModuleInstalled: (args) => isModuleInstalled(client, args),
|
|
22
|
+
supportsExecutionMode: (args) => supportsExecutionMode(client, args),
|
|
23
|
+
supportsModule: (args) => supportsModule(client, args),
|
|
24
|
+
uninstallModule: (args) => uninstallModule(client, args),
|
|
25
|
+
uninstallModules: (args) => uninstallModules(client, args),
|
|
26
|
+
getInstalledValidators: (args) => getInstalledValidators(client, args),
|
|
27
|
+
getInstalledExecutors: (args) => getInstalledExecutors(client, args),
|
|
28
|
+
getActiveHook: (args) => getActiveHook(client, args),
|
|
29
|
+
getFallbackBySelector: (args) => getFallbackBySelector(client, args),
|
|
30
|
+
getPreviousModule: (args) => getPreviousModule(client, args)
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export const erc7579Calls = {
|
|
34
|
+
toInstallModuleCalls,
|
|
35
|
+
toUninstallModuleCalls,
|
|
36
|
+
toInstallWithSafeSenderCalls,
|
|
37
|
+
toUninstallFallbackCalls
|
|
38
|
+
};
|
|
39
|
+
export const erc7579Reads = {
|
|
40
|
+
toIsModuleInstalledReads,
|
|
41
|
+
toGetActiveHookReads,
|
|
42
|
+
toGetFallbackBySelectorReads,
|
|
43
|
+
toGetInstalledExecutorsReads,
|
|
44
|
+
toGetInstalledValidatorsReads,
|
|
45
|
+
toSupportsExecutionModeReads,
|
|
46
|
+
toSupportsModuleReads
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/sdk/clients/decorators/erc7579/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAEL,aAAa,EACb,oBAAoB,EACrB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAEL,qBAAqB,EACrB,4BAA4B,EAC7B,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAEL,qBAAqB,EACrB,4BAA4B,EAC7B,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAEL,sBAAsB,EACtB,6BAA6B,EAC9B,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAEL,iBAAiB,EAClB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAEL,aAAa,EACb,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAEL,cAAc,EACf,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAEL,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAEL,qBAAqB,EACrB,4BAA4B,EAC7B,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAEL,cAAc,EACd,qBAAqB,EACtB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EAEL,sBAAsB,EACtB,eAAe,EAChB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAEL,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAqD9B,OAAO,EACL,SAAS,EACT,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,qB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CAAC;KAC7D,CAAC,CAAA;AACJ,CAAC;AAOD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,oBAAoB;IACpB,sBAAsB;IACtB,4BAA4B;IAC5B,wBAAwB;CAChB,CAAA;AAEV,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,wBAAwB;IACxB,oBAAoB;IACpB,4BAA4B;IAC5B,4BAA4B;IAC5B,6BAA6B;IAC7B,4BAA4B;IAC5B,qBAAqB;CACb,CAAA"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { encodeFunctionData, getAddress } from "viem";
|
|
2
|
+
import { sendUserOperation } from "viem/account-abstraction";
|
|
3
|
+
import { getAction, parseAccount } from "viem/utils";
|
|
4
|
+
import { AccountNotFoundError } from "../../../account/utils/AccountNotFound.js";
|
|
5
|
+
import { addressEquals } from "../../../account/utils/Utils.js";
|
|
6
|
+
import { findTrustedAttesters, getTrustAttestersAction, SMART_SESSIONS_ADDRESS, RHINESTONE_ATTESTER_ADDRESS } from "../../../constants/index.js";
|
|
7
|
+
import { parseModuleTypeId } from "./supportsModule.js";
|
|
8
|
+
/**
|
|
9
|
+
* Installs a module on a given smart account.
|
|
10
|
+
*
|
|
11
|
+
* @param client - The client instance.
|
|
12
|
+
* @param parameters - Parameters including the smart account, module to install, 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 { installModule } from '@startale-scs/aa-sdk'
|
|
18
|
+
*
|
|
19
|
+
* const userOpHash = await installModule(startaleClient, {
|
|
20
|
+
* module: {
|
|
21
|
+
* type: 'executor',
|
|
22
|
+
* address: '0x...',
|
|
23
|
+
* context: '0x'
|
|
24
|
+
* }
|
|
25
|
+
* })
|
|
26
|
+
* console.log(userOpHash) // '0x...'
|
|
27
|
+
*/
|
|
28
|
+
export async function installModule(client, parameters) {
|
|
29
|
+
const { account: account_ = client.account, maxFeePerGas, maxPriorityFeePerGas, nonce, module, module: { address, initData, type }, ...rest } = parameters;
|
|
30
|
+
if (!account_) {
|
|
31
|
+
throw new AccountNotFoundError({
|
|
32
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const account = parseAccount(account_);
|
|
36
|
+
const calls = await toInstallWithSafeSenderCalls(account, {
|
|
37
|
+
address,
|
|
38
|
+
initData,
|
|
39
|
+
type
|
|
40
|
+
});
|
|
41
|
+
const sendUserOperationParams = {
|
|
42
|
+
calls,
|
|
43
|
+
maxFeePerGas,
|
|
44
|
+
maxPriorityFeePerGas,
|
|
45
|
+
nonce,
|
|
46
|
+
account,
|
|
47
|
+
...rest
|
|
48
|
+
};
|
|
49
|
+
return getAction(client, sendUserOperation, "sendUserOperation")(sendUserOperationParams);
|
|
50
|
+
}
|
|
51
|
+
export const toInstallModuleCalls = async (account, { address, initData, type }) => {
|
|
52
|
+
const calls = [
|
|
53
|
+
{
|
|
54
|
+
to: account.address,
|
|
55
|
+
value: BigInt(0),
|
|
56
|
+
data: encodeFunctionData({
|
|
57
|
+
abi: [
|
|
58
|
+
{
|
|
59
|
+
name: "installModule",
|
|
60
|
+
type: "function",
|
|
61
|
+
stateMutability: "nonpayable",
|
|
62
|
+
inputs: [
|
|
63
|
+
{
|
|
64
|
+
type: "uint256",
|
|
65
|
+
name: "moduleTypeId"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: "address",
|
|
69
|
+
name: "module"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
type: "bytes",
|
|
73
|
+
name: "initData"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
outputs: []
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
functionName: "installModule",
|
|
80
|
+
args: [parseModuleTypeId(type), getAddress(address), initData ?? "0x"]
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
// These changes are done to ensure trustAttesters is a batch action.
|
|
85
|
+
if (addressEquals(address, SMART_SESSIONS_ADDRESS)) {
|
|
86
|
+
const publicClient = account?.client;
|
|
87
|
+
const trustedAttesters = await findTrustedAttesters({
|
|
88
|
+
client: publicClient,
|
|
89
|
+
accountAddress: account.address
|
|
90
|
+
});
|
|
91
|
+
const needToAddTrustAttesters = trustedAttesters.length === 0;
|
|
92
|
+
if (needToAddTrustAttesters) {
|
|
93
|
+
const trustAttestersAction = getTrustAttestersAction({
|
|
94
|
+
attesters: [RHINESTONE_ATTESTER_ADDRESS],
|
|
95
|
+
threshold: 1
|
|
96
|
+
});
|
|
97
|
+
calls.push({
|
|
98
|
+
to: trustAttestersAction.target,
|
|
99
|
+
value: trustAttestersAction.value.valueOf(),
|
|
100
|
+
data: trustAttestersAction.callData
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return calls;
|
|
105
|
+
};
|
|
106
|
+
export const toInstallWithSafeSenderCalls = async (account, { address, initData, type }) => [
|
|
107
|
+
...(await toInstallModuleCalls(account, { address, initData, type }))
|
|
108
|
+
];
|
|
109
|
+
//# sourceMappingURL=installModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installModule.js","sourceRoot":"","sources":["../../../../../src/sdk/clients/decorators/erc7579/installModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,kBAAkB,EAClB,UAAU,EACX,MAAM,MAAM,CAAA;AACb,OAAO,EAGL,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,oBAAoB,CAAA;AAK3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,IAAI,EAAc,EACtB,EAAE,CAAC;IACpB,GAAG,CAAC,MAAM,oBAAoB,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;CACtE,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { sendUserOperation } from "viem/account-abstraction";
|
|
2
|
+
import { getAction, parseAccount } from "viem/utils";
|
|
3
|
+
import { AccountNotFoundError } from "../../../account/utils/AccountNotFound.js";
|
|
4
|
+
import { toInstallWithSafeSenderCalls } from "./installModule.js";
|
|
5
|
+
/**
|
|
6
|
+
* Installs multiple modules on a given smart account.
|
|
7
|
+
*
|
|
8
|
+
* @param client - The client instance.
|
|
9
|
+
* @param parameters - Parameters including the smart account, modules to install, and optional gas settings.
|
|
10
|
+
* @returns The hash of the user operation as a hexadecimal string.
|
|
11
|
+
* @throws {AccountNotFoundError} If the account is not found.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* import { installModules } from '@startale-scs/aa-sdk'
|
|
15
|
+
*
|
|
16
|
+
* const userOpHash = await installModules(startaleClient, {
|
|
17
|
+
* modules: [
|
|
18
|
+
* { type: 'executor', address: '0x...', context: '0x' },
|
|
19
|
+
* { type: 'validator', address: '0x...', context: '0x' }
|
|
20
|
+
* ]
|
|
21
|
+
* })
|
|
22
|
+
* console.log(userOpHash) // '0x...'
|
|
23
|
+
*/
|
|
24
|
+
export async function installModules(client, parameters) {
|
|
25
|
+
const { account: account_ = client.account, maxFeePerGas, maxPriorityFeePerGas, nonce, modules } = parameters;
|
|
26
|
+
if (!account_) {
|
|
27
|
+
throw new AccountNotFoundError({
|
|
28
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const account = parseAccount(account_);
|
|
32
|
+
const calls = (await Promise.all(modules.flatMap((module) => toInstallWithSafeSenderCalls(account, module)))).flat();
|
|
33
|
+
return getAction(client, sendUserOperation, "sendUserOperation")({
|
|
34
|
+
calls,
|
|
35
|
+
maxFeePerGas,
|
|
36
|
+
maxPriorityFeePerGas,
|
|
37
|
+
nonce,
|
|
38
|
+
account
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=installModules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installModules.js","sourceRoot":"","sources":["../../../../../src/sdk/clients/decorators/erc7579/installModules.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC/E,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAK7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAA;AAe9D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAGlC,MAA2D,EAC3D,UAAmD;IAEnD,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,4BAA4B,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAC3E,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,106 @@
|
|
|
1
|
+
import { ContractFunctionExecutionError, decodeFunctionResult, encodeFunctionData, getAddress } from "viem";
|
|
2
|
+
import { call, readContract } from "viem/actions";
|
|
3
|
+
import { getAction, parseAccount } from "viem/utils";
|
|
4
|
+
import { AccountNotFoundError } from "../../../account/utils/AccountNotFound.js";
|
|
5
|
+
import { parseModuleTypeId } from "./supportsModule.js";
|
|
6
|
+
const abi = [
|
|
7
|
+
{
|
|
8
|
+
name: "isModuleInstalled",
|
|
9
|
+
type: "function",
|
|
10
|
+
stateMutability: "view",
|
|
11
|
+
inputs: [
|
|
12
|
+
{
|
|
13
|
+
type: "uint256",
|
|
14
|
+
name: "moduleTypeId"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
type: "address",
|
|
18
|
+
name: "module"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: "bytes",
|
|
22
|
+
name: "additionalContext"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
outputs: [
|
|
26
|
+
{
|
|
27
|
+
type: "bool"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
];
|
|
32
|
+
/**
|
|
33
|
+
* Checks if a specific module is installed on a given smart account.
|
|
34
|
+
*
|
|
35
|
+
* @param client - The client instance.
|
|
36
|
+
* @param parameters - Parameters including the smart account and the module to check.
|
|
37
|
+
* @returns A boolean indicating whether the module is installed.
|
|
38
|
+
* @throws {AccountNotFoundError} If the account is not found.
|
|
39
|
+
* @throws {Error} If the accountId result is empty.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* import { isModuleInstalled } from '@startale-scs/aa-sdk'
|
|
43
|
+
*
|
|
44
|
+
* const isInstalled = await isModuleInstalled(startaleClient, {
|
|
45
|
+
* module: {
|
|
46
|
+
* type: 'executor',
|
|
47
|
+
* address: '0x...',
|
|
48
|
+
* context: '0x'
|
|
49
|
+
* }
|
|
50
|
+
* })
|
|
51
|
+
* console.log(isInstalled) // true or false
|
|
52
|
+
*/
|
|
53
|
+
export async function isModuleInstalled(client, parameters) {
|
|
54
|
+
const { account: account_ = client.account, module: { address, initData, type } } = parameters;
|
|
55
|
+
if (!account_) {
|
|
56
|
+
throw new AccountNotFoundError({
|
|
57
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
const account = parseAccount(account_);
|
|
61
|
+
const publicClient = account.client;
|
|
62
|
+
const [isModuleEnabledRead] = await toIsModuleInstalledReads(account, {
|
|
63
|
+
address,
|
|
64
|
+
initData,
|
|
65
|
+
type
|
|
66
|
+
});
|
|
67
|
+
try {
|
|
68
|
+
return (await getAction(publicClient, readContract, "readContract")(isModuleEnabledRead));
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
if (error instanceof ContractFunctionExecutionError) {
|
|
72
|
+
const { factory, factoryData } = await account.getFactoryArgs();
|
|
73
|
+
const result = await getAction(publicClient, call, "call")({
|
|
74
|
+
factory: factory,
|
|
75
|
+
factoryData: factoryData,
|
|
76
|
+
to: account.address,
|
|
77
|
+
data: encodeFunctionData({
|
|
78
|
+
abi,
|
|
79
|
+
functionName: "isModuleInstalled",
|
|
80
|
+
args: [parseModuleTypeId(type), getAddress(address), initData ?? "0x"]
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
if (!result || !result.data) {
|
|
84
|
+
throw new Error("accountId result is empty");
|
|
85
|
+
}
|
|
86
|
+
return decodeFunctionResult({
|
|
87
|
+
abi,
|
|
88
|
+
functionName: "isModuleInstalled",
|
|
89
|
+
data: result.data
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
export const toIsModuleInstalledReads = async (account, { address, initData, type }) => [
|
|
96
|
+
{
|
|
97
|
+
abi,
|
|
98
|
+
functionName: "isModuleInstalled",
|
|
99
|
+
args: [parseModuleTypeId(type), getAddress(address), initData ?? "0x"],
|
|
100
|
+
address: account.address
|
|
101
|
+
}
|
|
102
|
+
];
|
|
103
|
+
export const erc7579Reads = {
|
|
104
|
+
toIsModuleInstalledReads
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=isModuleInstalled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isModuleInstalled.js","sourceRoot":"","sources":["../../../../../src/sdk/clients/decorators/erc7579/isModuleInstalled.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,8BAA8B,EAI9B,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,EACX,MAAM,MAAM,CAAA;AAEb,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAK7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAQpD,MAAM,GAAG,GAAG;IACV;QACE,IAAI,EAAE,mBAAmB;QACzB,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,cAAc;aACrB;YACD;gBACE,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;aACf;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,mBAAmB;aAC1B;SACF;QACD,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;aACb;SACF;KACF;CACO,CAAA;AAEV;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAGrC,MAA2D,EAC3D,UAAsD;IAEtD,MAAM,EACJ,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,MAAM,EAAE,EAA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