@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 @@
|
|
|
1
|
+
{"version":3,"file":"getOwners.js","sourceRoot":"","sources":["../../../../../../src/sdk/modules/validators/ownable/decorators/getOwners.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAAE,UAAU,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AAe7E;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAG7B,MAAkE,EAClE,UAAsD;IAEtD,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,UAAU,IAAI,EAAE,CAAA;IAE/D,yBAAyB;IACzB,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,YAAY,GAAG,OAAO,EAAE,MAAsB,CAAA;IAEpD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAA;IAC5C,CAAC;IAED,MAAM,eAAe,GAAG,UAAU,CAAC;QACjC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,IAAI,EAAE,wBAAwB;KAC/B,CAAC,CAAA;IAEF,OAAO,yBAAyB,CAAC;QAC/B,OAAO,EAAE,eAAe;QACxB,MAAM,EAAE,YAAmB;KAC5B,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { parseAccount } from "viem/utils";
|
|
2
|
+
import { AccountNotFoundError } from "../../../../account/utils/AccountNotFound.js";
|
|
3
|
+
import { getRemoveOwnableValidatorOwnerAction } from "../../../../constants/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* Generates the transaction data for removing an owner from a smart account.
|
|
6
|
+
*
|
|
7
|
+
* This function prepares the necessary transaction data to remove an owner from the specified smart account.
|
|
8
|
+
* It doesn't send the transaction, but returns the data needed to do so.
|
|
9
|
+
*
|
|
10
|
+
* @template TModularSmartAccount - The type of the smart account, which can be a ModularSmartAccount or undefined.
|
|
11
|
+
* @param client - The client used to interact with the blockchain.
|
|
12
|
+
* @param parameters - The parameters for removing the owner.
|
|
13
|
+
* @returns A promise that resolves to a Call object containing the transaction data.
|
|
14
|
+
* @throws {AccountNotFoundError} If no account is provided and the client doesn't have an associated account.
|
|
15
|
+
* @throws {Error} If there's an error getting the remove owner action or if the public client is not found.
|
|
16
|
+
*/
|
|
17
|
+
export async function getRemoveOwnerTx(client, parameters) {
|
|
18
|
+
const { account: account_ = client.account, owner } = parameters;
|
|
19
|
+
if (!account_) {
|
|
20
|
+
throw new AccountNotFoundError({
|
|
21
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
const account = parseAccount(account_);
|
|
25
|
+
const publicClient = account.client;
|
|
26
|
+
if (!publicClient) {
|
|
27
|
+
throw new Error("Public client not found");
|
|
28
|
+
}
|
|
29
|
+
const action = await getRemoveOwnableValidatorOwnerAction({
|
|
30
|
+
account: {
|
|
31
|
+
address: account.address,
|
|
32
|
+
deployedOnChains: [],
|
|
33
|
+
type: "erc7579-implementation"
|
|
34
|
+
},
|
|
35
|
+
client: publicClient,
|
|
36
|
+
owner
|
|
37
|
+
});
|
|
38
|
+
if (!("callData" in action)) {
|
|
39
|
+
throw new Error("Error getting remove owner action");
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
to: action.target,
|
|
43
|
+
value: BigInt(action.value.toString()),
|
|
44
|
+
data: action.callData
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export const toRemoveOwnerCalls = async (account, parameters) => {
|
|
48
|
+
return [await getRemoveOwnerTx({}, { ...parameters, account })];
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=getRemoveOwnerTx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRemoveOwnerTx.js","sourceRoot":"","sources":["../../../../../../src/sdk/modules/validators/ownable/decorators/getRemoveOwnerTx.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAEhF,OAAO,EAAE,oCAAoC,EAAE,MAAM,uBAAuB,CAAA;AAc5E;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAGpC,MAAkE,EAClE,UAA4D;IAE5D,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,UAAU,CAAA;IAEhE,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,YAAY,GAAG,OAAO,CAAC,MAAM,CAAA;IAEnC,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAA;IAC5C,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,oCAAoC,CAAC;QACxD,OAAO,EAAE;YACP,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,gBAAgB,EAAE,EAAE;YACpB,IAAI,EAAE,wBAAwB;SAC/B;QACD,MAAM,EAAE,YAAmB;QAC3B,KAAK;KACN,CAAC,CAAA;IAEF,IAAI,CAAC,CAAC,UAAU,IAAI,MAAM,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;IACtD,CAAC;IAED,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,MAAM;QACjB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QACtC,IAAI,EAAE,MAAM,CAAC,QAAQ;KACtB,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EACrC,OAA4B,EAC5B,UAAuE,EACtD,EAAE;IACnB,OAAO,CAAC,MAAM,gBAAgB,CAAC,EAAa,EAAE,EAAE,GAAG,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAAA;AAC5E,CAAC,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { parseAccount } from "viem/utils";
|
|
2
|
+
import { AccountNotFoundError } from "../../../../account/utils/AccountNotFound.js";
|
|
3
|
+
import { getSetOwnableValidatorThresholdAction } from "../../../../constants/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* Generates transaction data for setting a new threshold on a smart account.
|
|
6
|
+
*
|
|
7
|
+
* The threshold in a multi-signature wallet determines how many owners need to approve
|
|
8
|
+
* a transaction before it can be executed. This function prepares the transaction data
|
|
9
|
+
* needed to change this threshold, but does not actually send the transaction.
|
|
10
|
+
*
|
|
11
|
+
* @template TSmartAccount - Type of the smart account, extending SmartAccount or undefined.
|
|
12
|
+
* @param client - The client instance used for blockchain interactions.
|
|
13
|
+
* @param parameters - Object containing the account and new threshold value.
|
|
14
|
+
* @returns A Promise resolving to a Call object with the transaction data.
|
|
15
|
+
*
|
|
16
|
+
* @throws {AccountNotFoundError} When no account is provided and the client lacks an associated account.
|
|
17
|
+
* @throws {Error} If the account parsing fails or if there's an issue generating the action data.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const txData = await getSetThresholdTx(client, { threshold: 2 });
|
|
22
|
+
* console.log(txData); // { to: '0x...', value: 0n, data: '0x...' }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export async function getSetThresholdTx(client, parameters) {
|
|
26
|
+
const { account: account_ = client.account, threshold } = parameters;
|
|
27
|
+
if (!account_) {
|
|
28
|
+
throw new AccountNotFoundError({
|
|
29
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const account = parseAccount(account_);
|
|
33
|
+
if (!account)
|
|
34
|
+
throw new Error("Account not found");
|
|
35
|
+
const action = getSetOwnableValidatorThresholdAction({ threshold });
|
|
36
|
+
if (!("callData" in action)) {
|
|
37
|
+
throw new Error("Error getting set threshold actions");
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
to: action.target,
|
|
41
|
+
value: BigInt(action.value.toString()),
|
|
42
|
+
data: action.callData
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export const toSetThresholdCalls = async (account, parameters) => {
|
|
46
|
+
return [await getSetThresholdTx({}, { ...parameters, account })];
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=getSetThresholdTx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSetThresholdTx.js","sourceRoot":"","sources":["../../../../../../src/sdk/modules/validators/ownable/decorators/getSetThresholdTx.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAEhF,OAAO,EAAE,qCAAqC,EAAE,MAAM,uBAAuB,CAAA;AAiB7E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAGrC,MAA2D,EAC3D,UAAsD;IAEtD,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,UAAU,CAAA;IAEpE,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,CAAiB,CAAA;IAEtD,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAA;IAElD,MAAM,MAAM,GAAG,qCAAqC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAA;IAEnE,IAAI,CAAC,CAAC,UAAU,IAAI,MAAM,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;IACxD,CAAC;IAED,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,MAAM;QACjB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QACtC,IAAI,EAAE,MAAM,CAAC,QAAQ;KACtB,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EACtC,OAA4B,EAC5B,UAAwE,EACvD,EAAE;IACnB,OAAO,CAAC,MAAM,iBAAiB,CAAC,EAAa,EAAE,EAAE,GAAG,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAAA;AAC7E,CAAC,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { parseAccount } from "viem/utils";
|
|
2
|
+
import { AccountNotFoundError } from "../../../../account/utils/AccountNotFound.js";
|
|
3
|
+
import { getAccount, getOwnableValidatorThreshold } from "../../../../constants/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves the current approval threshold for a modular smart account.
|
|
6
|
+
*
|
|
7
|
+
* In the context of multi-signature wallets or modular smart accounts, the threshold
|
|
8
|
+
* represents the minimum number of approvals required to execute a transaction.
|
|
9
|
+
* This function queries the blockchain to fetch the current threshold value.
|
|
10
|
+
*
|
|
11
|
+
* @template TModularSmartAccount - Type of the modular smart account, extending ModularSmartAccount or undefined.
|
|
12
|
+
*
|
|
13
|
+
* @param client - The client instance used for blockchain interactions.
|
|
14
|
+
* @param parameters - Optional. Specifies the account to query. If omitted, the client's default account is used.
|
|
15
|
+
*
|
|
16
|
+
* @returns A Promise that resolves to the current threshold value as a number.
|
|
17
|
+
*
|
|
18
|
+
* @throws {AccountNotFoundError} If no account is specified and the client has no default account.
|
|
19
|
+
* @throws {Error} If the public client is not available or if there's an issue fetching the threshold.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const startaleClient = createSmartAccountClient({ ... });
|
|
24
|
+
* const threshold = await getThreshold(startaleClient);
|
|
25
|
+
* console.log(`Current approval threshold: ${threshold}`);
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* - Ensure the client is properly initialized and connected to the correct network.
|
|
30
|
+
* - The threshold value is specific to the queried account and may vary between different accounts.
|
|
31
|
+
* - This function is read-only and does not modify the blockchain state.
|
|
32
|
+
*/
|
|
33
|
+
export async function getThreshold(client, parameters) {
|
|
34
|
+
const { account: account_ = client.account } = parameters ?? {};
|
|
35
|
+
if (!account_) {
|
|
36
|
+
throw new AccountNotFoundError({
|
|
37
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const account = parseAccount(account_);
|
|
41
|
+
const publicClient = account?.client;
|
|
42
|
+
if (!publicClient) {
|
|
43
|
+
throw new Error("Public client not found");
|
|
44
|
+
}
|
|
45
|
+
const startaleAccount = getAccount({
|
|
46
|
+
address: account.address,
|
|
47
|
+
type: "erc7579-implementation"
|
|
48
|
+
});
|
|
49
|
+
return await getOwnableValidatorThreshold({
|
|
50
|
+
account: startaleAccount,
|
|
51
|
+
client: publicClient
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=getThreshold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getThreshold.js","sourceRoot":"","sources":["../../../../../../src/sdk/modules/validators/ownable/decorators/getThreshold.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAAE,UAAU,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAA;AAYhF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAGhC,MAAkE,EAClE,UAAyD;IAEzD,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,UAAU,IAAI,EAAE,CAAA;IAE/D,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,YAAY,GAAG,OAAO,EAAE,MAAsB,CAAA;IAEpD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAA;IAC5C,CAAC;IAED,MAAM,eAAe,GAAG,UAAU,CAAC;QACjC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,IAAI,EAAE,wBAAwB;KAC/B,CAAC,CAAA;IAEF,OAAO,MAAM,4BAA4B,CAAC;QACxC,OAAO,EAAE,eAAe;QACxB,MAAM,EAAE,YAAmB;KAC5B,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { addOwner } from "./addOwner.js";
|
|
2
|
+
import { getAddOwnerTx, toAddOwnerCalls } from "./getAddOwnerTx.js";
|
|
3
|
+
import { getOwners } from "./getOwners.js";
|
|
4
|
+
import { getRemoveOwnerTx, toRemoveOwnerCalls } from "./getRemoveOwnerTx.js";
|
|
5
|
+
import { getSetThresholdTx, toSetThresholdCalls } from "./getSetThresholdTx.js";
|
|
6
|
+
import { getThreshold } from "./getThreshold.js";
|
|
7
|
+
import { multiSign } from "./multiSign.js";
|
|
8
|
+
import { prepareForMultiSign } from "./prepareForMultiSign.js";
|
|
9
|
+
import { removeOwner } from "./removeOwner.js";
|
|
10
|
+
import { setThreshold } from "./setThreshold.js";
|
|
11
|
+
export function ownableActions() {
|
|
12
|
+
return (client) => {
|
|
13
|
+
return {
|
|
14
|
+
prepareForMultiSign: async (args) => {
|
|
15
|
+
return await prepareForMultiSign(client, args);
|
|
16
|
+
},
|
|
17
|
+
multiSign: async (args) => {
|
|
18
|
+
return await multiSign(client, args);
|
|
19
|
+
},
|
|
20
|
+
getThreshold: (args) => {
|
|
21
|
+
return getThreshold(client, args);
|
|
22
|
+
},
|
|
23
|
+
getAddOwnerTx: (args) => {
|
|
24
|
+
return getAddOwnerTx(client, args);
|
|
25
|
+
},
|
|
26
|
+
getOwners: (args) => {
|
|
27
|
+
return getOwners(client, args);
|
|
28
|
+
},
|
|
29
|
+
getSetThresholdTx: (args) => {
|
|
30
|
+
return getSetThresholdTx(client, args);
|
|
31
|
+
},
|
|
32
|
+
getRemoveOwnerTx: (args) => {
|
|
33
|
+
return getRemoveOwnerTx(client, args);
|
|
34
|
+
},
|
|
35
|
+
addOwner: (args) => {
|
|
36
|
+
return addOwner(client, args);
|
|
37
|
+
},
|
|
38
|
+
removeOwner: (args) => {
|
|
39
|
+
return removeOwner(client, args);
|
|
40
|
+
},
|
|
41
|
+
setThreshold: (args) => {
|
|
42
|
+
return setThreshold(client, args);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export const ownableCalls = {
|
|
48
|
+
toAddOwnerCalls,
|
|
49
|
+
toSetThresholdCalls,
|
|
50
|
+
toRemoveOwnerCalls
|
|
51
|
+
};
|
|
52
|
+
export const ownableReads = {
|
|
53
|
+
toGetOwnersReads: getOwners,
|
|
54
|
+
toGetThresholdReads: getThreshold
|
|
55
|
+
};
|
|
56
|
+
export { prepareForMultiSign, multiSign, addOwner, removeOwner, setThreshold, getOwners, getThreshold, getAddOwnerTx, getRemoveOwnerTx, getSetThresholdTx };
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/sdk/modules/validators/ownable/decorators/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAA2B,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAChE,OAAO,EAA4B,SAAS,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,EAEL,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAEL,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAA+B,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC1E,OAAO,EAA4B,SAAS,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,EAGL,mBAAmB,EACpB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAA8B,WAAW,EAAE,MAAM,eAAe,CAAA;AACvE,OAAO,EAA+B,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAiC1E,MAAM,UAAU,cAAc;IAC5B,OAAO,CACL,MAAkE,EAC5B,EAAE;QACxC,OAAO;YACL,mBAAmB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;gBAClC,OAAO,MAAM,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YAChD,CAAC;YACD,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;gBACxB,OAAO,MAAM,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YACtC,CAAC;YACD,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE;gBACrB,OAAO,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YACnC,CAAC;YACD,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE;gBACtB,OAAO,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YACpC,CAAC;YACD,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE;gBAClB,OAAO,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YAChC,CAAC;YACD,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE;gBAC1B,OAAO,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YACxC,CAAC;YACD,gBAAgB,EAAE,CAAC,IAAI,EAAE,EAAE;gBACzB,OAAO,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YACvC,CAAC;YACD,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;gBACjB,OAAO,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YAC/B,CAAC;YACD,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE;gBACpB,OAAO,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YAClC,CAAC;YACD,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE;gBACrB,OAAO,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YACnC,CAAC;SACF,CAAA;IACH,CAAC,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,eAAe;IACf,mBAAmB;IACnB,kBAAkB;CACV,CAAA;AAEV,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,gBAAgB,EAAE,SAAS;IAC3B,mBAAmB,EAAE,YAAY;CACzB,CAAA;AAEV,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { sendUserOperation } from "viem/account-abstraction";
|
|
2
|
+
import { parseAccount } from "viem/utils";
|
|
3
|
+
import { AccountNotFoundError } from "../../../../account/utils/AccountNotFound.js";
|
|
4
|
+
import { getOwnableValidatorSignature } from "../../../../constants/index.js";
|
|
5
|
+
export async function multiSign(client, parameters) {
|
|
6
|
+
const { account: account_ = client.account, signatures, ...rest } = parameters;
|
|
7
|
+
if (!account_) {
|
|
8
|
+
throw new AccountNotFoundError({
|
|
9
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
const account = parseAccount(account_);
|
|
13
|
+
const publicClient = account?.client;
|
|
14
|
+
if (!publicClient) {
|
|
15
|
+
throw new Error("Public client not found");
|
|
16
|
+
}
|
|
17
|
+
return sendUserOperation(client, {
|
|
18
|
+
...rest,
|
|
19
|
+
signature: getOwnableValidatorSignature({ signatures })
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=multiSign.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiSign.js","sourceRoot":"","sources":["../../../../../../src/sdk/modules/validators/ownable/decorators/multiSign.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAA;AAUpE,MAAM,CAAC,KAAK,UAAU,SAAS,CAG7B,MAAkE,EAClE,UAAqD;IAErD,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,UAAU,CAAA;IAE9E,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,YAAY,GAAG,OAAO,EAAE,MAAsB,CAAA;IAEpD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAA;IAC5C,CAAC;IAED,OAAO,iBAAiB,CAAC,MAAM,EAAE;QAC/B,GAAG,IAAI;QACP,SAAS,EAAE,4BAA4B,CAAC,EAAE,UAAU,EAAE,CAAC;KAC7C,CAAC,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { parseAccount } from "viem/utils";
|
|
2
|
+
import { AccountNotFoundError } from "../../../../account/utils/AccountNotFound.js";
|
|
3
|
+
export async function prepareForMultiSign(startaleAccountClient, parameters) {
|
|
4
|
+
const { account: account_ = startaleAccountClient.account, ...rest } = parameters;
|
|
5
|
+
if (!account_) {
|
|
6
|
+
throw new AccountNotFoundError({
|
|
7
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
const startaleAccount = parseAccount(account_);
|
|
11
|
+
const publicClient = startaleAccount?.client;
|
|
12
|
+
if (!publicClient) {
|
|
13
|
+
throw new Error("Public client not found");
|
|
14
|
+
}
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
const userOp = await startaleAccountClient.prepareUserOperation(rest);
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
const userOpHash = startaleAccount.getUserOpHash(userOp);
|
|
19
|
+
return { userOpHash, userOp };
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=prepareForMultiSign.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepareForMultiSign.js","sourceRoot":"","sources":["../../../../../../src/sdk/modules/validators/ownable/decorators/prepareForMultiSign.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AA0BhF,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAGvC,qBAIC,EACD,UAA+D;IAE/D,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,qBAAqB,CAAC,OAAO,EAAE,GAAG,IAAI,EAAE,GAClE,UAAU,CAAA;IAEZ,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,oBAAoB,CAAC;YAC7B,QAAQ,EAAE,0CAA0C;SACrD,CAAC,CAAA;IACJ,CAAC;IAED,MAAM,eAAe,GAAG,YAAY,CAAC,QAAQ,CAAwB,CAAA;IACrE,MAAM,YAAY,GAAG,eAAe,EAAE,MAAsB,CAAA;IAE5D,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAA;IAC5C,CAAC;IAED,aAAa;IACb,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;IAErE,aAAa;IACb,MAAM,UAAU,GAAG,eAAe,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;IAExD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;AAC/B,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { sendUserOperation } from "viem/account-abstraction";
|
|
2
|
+
import { getAction, parseAccount } from "viem/utils";
|
|
3
|
+
import { AccountNotFoundError } from "../../../../account/utils/AccountNotFound.js";
|
|
4
|
+
import { getAccount, getRemoveOwnableValidatorOwnerAction } from "../../../../constants/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* Removes an owner from a smart account.
|
|
7
|
+
*
|
|
8
|
+
* This function prepares and sends a user operation to remove an existing owner from the specified smart account.
|
|
9
|
+
* It handles the creation of the necessary action data and sends the user operation.
|
|
10
|
+
*
|
|
11
|
+
* @template TModularSmartAccount - Type of the smart account, extending SmartAccount or undefined.
|
|
12
|
+
* @param client - The client used to interact with the blockchain.
|
|
13
|
+
* @param parameters - The parameters for removing the owner.
|
|
14
|
+
* @returns A promise that resolves to the hash of the sent user operation.
|
|
15
|
+
*
|
|
16
|
+
* @throws {AccountNotFoundError} If no account is provide
|
|
17
|
+
* @throws {Error} If there's an error getting the remove owner action.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { removeOwner } from '@startale-scs/aa-sdk'
|
|
22
|
+
*
|
|
23
|
+
* const userOpHash = await removeOwner(startaleClient, {
|
|
24
|
+
* owner: '0x...'
|
|
25
|
+
* })
|
|
26
|
+
* console.log(userOpHash) // '0x...'
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export async function removeOwner(client, parameters) {
|
|
30
|
+
const { account: account_ = client.account, maxFeePerGas, maxPriorityFeePerGas, nonce, owner } = parameters;
|
|
31
|
+
if (!account_) {
|
|
32
|
+
throw new AccountNotFoundError({
|
|
33
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const account = parseAccount(account_);
|
|
37
|
+
const calls = await toRemoveOwnerCalls(account, { owner });
|
|
38
|
+
return getAction(client, sendUserOperation, "sendUserOperation")({
|
|
39
|
+
calls,
|
|
40
|
+
maxFeePerGas,
|
|
41
|
+
maxPriorityFeePerGas,
|
|
42
|
+
nonce,
|
|
43
|
+
account
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
export const toRemoveOwnerCalls = async (account, parameters) => {
|
|
47
|
+
const action = await getRemoveOwnableValidatorOwnerAction({
|
|
48
|
+
account: getAccount({
|
|
49
|
+
address: account.address,
|
|
50
|
+
type: "erc7579-implementation"
|
|
51
|
+
}),
|
|
52
|
+
client: account.client,
|
|
53
|
+
owner: parameters.owner
|
|
54
|
+
});
|
|
55
|
+
if (!("callData" in action)) {
|
|
56
|
+
throw new Error("Error getting remove owner action");
|
|
57
|
+
}
|
|
58
|
+
return [
|
|
59
|
+
{
|
|
60
|
+
to: action.target,
|
|
61
|
+
value: BigInt(action.value.toString()),
|
|
62
|
+
data: action.callData
|
|
63
|
+
}
|
|
64
|
+
];
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=removeOwner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeOwner.js","sourceRoot":"","sources":["../../../../../../src/sdk/modules/validators/ownable/decorators/removeOwner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAEhF,OAAO,EACL,UAAU,EACV,oCAAoC,EACrC,MAAM,uBAAuB,CAAA;AAuB9B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAG/B,MAAkE,EAClE,UAAuD;IAEvD,MAAM,EACJ,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,KAAK,EACN,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,kBAAkB,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;IAC1D,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;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EACrC,OAA4B,EAC5B,UAAkE,EACjD,EAAE;IACnB,MAAM,MAAM,GAAG,MAAM,oCAAoC,CAAC;QACxD,OAAO,EAAE,UAAU,CAAC;YAClB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,IAAI,EAAE,wBAAwB;SAC/B,CAAC;QACF,MAAM,EAAE,OAAO,CAAC,MAAa;QAC7B,KAAK,EAAE,UAAU,CAAC,KAAK;KACxB,CAAC,CAAA;IAEF,IAAI,CAAC,CAAC,UAAU,IAAI,MAAM,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;IACtD,CAAC;IAED,OAAO;QACL;YACE,EAAE,EAAE,MAAM,CAAC,MAAM;YACjB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACtC,IAAI,EAAE,MAAM,CAAC,QAAQ;SACtB;KACF,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { sendUserOperation } from "viem/account-abstraction";
|
|
2
|
+
import { getAction, parseAccount } from "viem/utils";
|
|
3
|
+
import { AccountNotFoundError } from "../../../../account/utils/AccountNotFound.js";
|
|
4
|
+
import { getSetOwnableValidatorThresholdAction } from "../../../../constants/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* Sets a new threshold for a modular smart account.
|
|
7
|
+
*
|
|
8
|
+
* This function prepares and sends a user operation to change the threshold of the specified modular smart account.
|
|
9
|
+
* The threshold determines how many owners need to approve a transaction before it can be executed.
|
|
10
|
+
*
|
|
11
|
+
* @template TModularSmartAccount - Type of the modular smart account, extending ModularSmartAccount or undefined.
|
|
12
|
+
* @param client - The client used to interact with the blockchain.
|
|
13
|
+
* @param parameters - The parameters for setting the new threshold.
|
|
14
|
+
* @returns A promise that resolves to the hash of the sent user operation.
|
|
15
|
+
*
|
|
16
|
+
* @throws {AccountNotFoundError} If no account is provided and the client doesn't have an associated account.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const startaleClient = createSmartAccountClient({ ... });
|
|
21
|
+
* const hash = await setThreshold(startaleClient, {
|
|
22
|
+
* threshold: 2,
|
|
23
|
+
* maxFeePerGas: 1000000000n
|
|
24
|
+
* });
|
|
25
|
+
* console.log(`Set threshold transaction hash: ${hash}`);
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* - Ensure that the new threshold is valid for the current number of owners in the account.
|
|
30
|
+
* - This operation will modify the state of the smart account on the blockchain.
|
|
31
|
+
* - The transaction may fail if the caller doesn't have the necessary permissions to change the threshold.
|
|
32
|
+
*/
|
|
33
|
+
export async function setThreshold(client, parameters) {
|
|
34
|
+
const { account: account_ = client.account, maxFeePerGas, maxPriorityFeePerGas, nonce } = parameters;
|
|
35
|
+
if (!account_) {
|
|
36
|
+
throw new AccountNotFoundError({
|
|
37
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const account = parseAccount(account_);
|
|
41
|
+
const calls = await toSetThresholdCalls(account, parameters);
|
|
42
|
+
return getAction(client, sendUserOperation, "sendUserOperation")({
|
|
43
|
+
calls,
|
|
44
|
+
maxFeePerGas,
|
|
45
|
+
maxPriorityFeePerGas,
|
|
46
|
+
nonce,
|
|
47
|
+
account
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
export const toSetThresholdCalls = async (_, parameters) => {
|
|
51
|
+
const action = getSetOwnableValidatorThresholdAction({
|
|
52
|
+
threshold: parameters.threshold
|
|
53
|
+
});
|
|
54
|
+
return [
|
|
55
|
+
{
|
|
56
|
+
to: action.target,
|
|
57
|
+
value: BigInt(action.value.toString()),
|
|
58
|
+
data: action.callData
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=setThreshold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setThreshold.js","sourceRoot":"","sources":["../../../../../../src/sdk/modules/validators/ownable/decorators/setThreshold.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAEhF,OAAO,EAAE,qCAAqC,EAAE,MAAM,uBAAuB,CAAA;AAuB7E;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAGhC,MAAkE,EAClE,UAAwD;IAExD,MAAM,EACJ,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACN,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;IAE7D,MAAM,KAAK,GAAG,MAAM,mBAAmB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;IAE5D,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;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EACtC,CAAsB,EACtB,UAAmE,EAClD,EAAE;IACnB,MAAM,MAAM,GAAG,qCAAqC,CAAC;QACnD,SAAS,EAAE,UAAU,CAAC,SAAS;KAChC,CAAC,CAAA;IAEF,OAAO;QACL;YACE,EAAE,EAAE,MAAM,CAAC,MAAM;YACjB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACtC,IAAI,EAAE,MAAM,CAAC,QAAQ;SACtB;KACF,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/sdk/modules/validators/ownable/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { getOwnableValidator, getOwnableValidatorMockSignature } from "../../../constants/index.js";
|
|
2
|
+
import { toValidator } from "../toValidator.js";
|
|
3
|
+
/**
|
|
4
|
+
* Creates an Ownable module for a modular smart account.
|
|
5
|
+
*
|
|
6
|
+
* This function sets up an Ownable module with the specified parameters,
|
|
7
|
+
* including threshold and owners for the smart account.
|
|
8
|
+
*
|
|
9
|
+
* @param parameters - The parameters for creating the Ownable module.
|
|
10
|
+
* @returns A Module object representing the created Ownable module.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const ownableModule = toOwnableModule({
|
|
15
|
+
* account: mySmartAccount,
|
|
16
|
+
* signer: mySigner,
|
|
17
|
+
* moduleInitArgs: {
|
|
18
|
+
* threshold: 2,
|
|
19
|
+
* owners: ['0x123...', '0x456...']
|
|
20
|
+
* }
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* - If the module is already installed, it will use the existing threshold.
|
|
26
|
+
* - If not installed, it will use the threshold from the initialization parameters.
|
|
27
|
+
* - The function generates a mock signature based on the threshold.
|
|
28
|
+
*/
|
|
29
|
+
export const toOwnableModule = (parameters) => {
|
|
30
|
+
const { signer, threshold, owners } = parameters;
|
|
31
|
+
return toValidator({
|
|
32
|
+
...getOwnableValidator({ threshold, owners }),
|
|
33
|
+
type: "validator",
|
|
34
|
+
signer,
|
|
35
|
+
getStubSignature: async () => getOwnableValidatorMockSignature({ threshold })
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=toOwnableModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toOwnableModule.js","sourceRoot":"","sources":["../../../../../src/sdk/modules/validators/ownable/toOwnableModule.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,gCAAgC,EACjC,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAkB,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAe5D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,UAAqC,EAC1B,EAAE;IACb,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,UAAU,CAAA;IAEhD,OAAO,WAAW,CAAC;QACjB,GAAG,mBAAmB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QAC7C,IAAI,EAAE,WAAW;QACjB,MAAM;QACN,gBAAgB,EAAE,KAAK,IAAkB,EAAE,CACzC,gCAAgC,CAAC,EAAE,SAAS,EAAE,CAAC;KAClD,CAAC,CAAA;AACJ,CAAC,CAAA"}
|