@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,191 @@
|
|
|
1
|
+
import { getUniversalActionPolicy } from "@rhinestone/module-sdk";
|
|
2
|
+
import { getPermissionId } from "@rhinestone/module-sdk";
|
|
3
|
+
import { encodeFunctionData, parseAccount } from "viem/utils";
|
|
4
|
+
import { ERROR_MESSAGES } from "../../../../account/index.js";
|
|
5
|
+
import { AccountNotFoundError } from "../../../../account/utils/AccountNotFound.js";
|
|
6
|
+
import { OWNABLE_VALIDATOR_ADDRESS, SMART_SESSIONS_ADDRESS, encodeValidationData, getSpendingLimitsPolicy, getSudoPolicy, getUsageLimitPolicy, getValueLimitPolicy } from "../../../../constants/index.js";
|
|
7
|
+
import { SmartSessionAbi } from "../../../../constants/abi/SmartSessionAbi.js";
|
|
8
|
+
import { abiToPoliciesInfo, applyDefaults, createActionConfig, createActionData, generateSalt, toActionConfig } from "../Helpers.js";
|
|
9
|
+
export const ONE_YEAR_FROM_NOW_IN_SECONDS = Date.now() + 60 * 60 * 24 * 365;
|
|
10
|
+
/**
|
|
11
|
+
* Generates the action data for creating sessions in the SmartSessionValidator.
|
|
12
|
+
*
|
|
13
|
+
* @param sessionRequestedInfo - Array of session data parameters.
|
|
14
|
+
* @param client - The public client for blockchain interactions.
|
|
15
|
+
* @returns A promise that resolves to the action data and permission IDs, or an Error.
|
|
16
|
+
*/
|
|
17
|
+
export const getPermissionAction = async ({ chainId, sessionRequestedInfo, withPaymaster = false }) => {
|
|
18
|
+
const sessions = [];
|
|
19
|
+
const permissionIds = [];
|
|
20
|
+
const resolvedPolicyInfo2ActionData = (actionPolicyInfo) => {
|
|
21
|
+
const policyData = [];
|
|
22
|
+
// create time frame policy here..
|
|
23
|
+
// const timeFramePolicy = getTimeFramePolicy({
|
|
24
|
+
// validUntil: actionPolicyInfo.validUntil ?? ONE_YEAR_FROM_NOW_IN_SECONDS,
|
|
25
|
+
// validAfter: actionPolicyInfo.validAfter ?? 0
|
|
26
|
+
// })
|
|
27
|
+
// Todo: Get TimeFramePolicy audited and deploy on Soneium
|
|
28
|
+
// Note: currently this throws UnsupportedPolicy
|
|
29
|
+
// policyData.push(timeFramePolicy)
|
|
30
|
+
const hasValidRules = actionPolicyInfo?.rules && actionPolicyInfo?.rules?.length > 0;
|
|
31
|
+
if (hasValidRules) {
|
|
32
|
+
const actionConfig = createActionConfig(actionPolicyInfo.rules ?? [], actionPolicyInfo.valueLimit);
|
|
33
|
+
// create uni action policy here..
|
|
34
|
+
const uniActionPolicyInfo = getUniversalActionPolicy(toActionConfig(actionConfig));
|
|
35
|
+
policyData.push(uniActionPolicyInfo);
|
|
36
|
+
}
|
|
37
|
+
// create sudo policy here..
|
|
38
|
+
if (actionPolicyInfo.sudo || !hasValidRules) {
|
|
39
|
+
const sudoPolicy = getSudoPolicy();
|
|
40
|
+
policyData.push(sudoPolicy);
|
|
41
|
+
}
|
|
42
|
+
// create value limit policy here..
|
|
43
|
+
if (actionPolicyInfo.valueLimit) {
|
|
44
|
+
const valueLimitPolicy = getValueLimitPolicy({
|
|
45
|
+
limit: actionPolicyInfo.valueLimit
|
|
46
|
+
});
|
|
47
|
+
policyData.push(valueLimitPolicy);
|
|
48
|
+
}
|
|
49
|
+
// create usage limit policy here..
|
|
50
|
+
if (actionPolicyInfo.usageLimit) {
|
|
51
|
+
const usageLimitPolicy = getUsageLimitPolicy({
|
|
52
|
+
limit: actionPolicyInfo.usageLimit
|
|
53
|
+
});
|
|
54
|
+
policyData.push(usageLimitPolicy);
|
|
55
|
+
}
|
|
56
|
+
// create token spending limit policy here..
|
|
57
|
+
if (actionPolicyInfo.tokenLimits?.length) {
|
|
58
|
+
const spendingLimitPolicy = getSpendingLimitsPolicy(actionPolicyInfo.tokenLimits);
|
|
59
|
+
policyData.push(spendingLimitPolicy);
|
|
60
|
+
}
|
|
61
|
+
// Create ActionData
|
|
62
|
+
const actionPolicy = createActionData(actionPolicyInfo.contractAddress, actionPolicyInfo.functionSelector, policyData);
|
|
63
|
+
return actionPolicy;
|
|
64
|
+
};
|
|
65
|
+
// Start populating the session for each param provided
|
|
66
|
+
for (const sessionInfo of sessionRequestedInfo) {
|
|
67
|
+
const actionPolicies = [];
|
|
68
|
+
for (const actionPolicyInfo of sessionInfo.actionPoliciesInfo ?? []) {
|
|
69
|
+
if (actionPolicyInfo.abi) {
|
|
70
|
+
// Resolve the abi to multiple function selectors...
|
|
71
|
+
const resolvedPolicyInfos = abiToPoliciesInfo(actionPolicyInfo);
|
|
72
|
+
const actionPolicies_ = resolvedPolicyInfos.map(resolvedPolicyInfo2ActionData);
|
|
73
|
+
actionPolicies.push(...actionPolicies_);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
const actionPolicy = resolvedPolicyInfo2ActionData(actionPolicyInfo);
|
|
77
|
+
actionPolicies.push(actionPolicy);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const userOpPolicies = withPaymaster ? [getSudoPolicy()] : [];
|
|
81
|
+
const session = {
|
|
82
|
+
chainId: BigInt(chainId),
|
|
83
|
+
permitERC4337Paymaster: withPaymaster,
|
|
84
|
+
sessionValidator: OWNABLE_VALIDATOR_ADDRESS,
|
|
85
|
+
sessionValidatorInitData: encodeValidationData({
|
|
86
|
+
threshold: 1,
|
|
87
|
+
owners: [sessionInfo.sessionKeyData]
|
|
88
|
+
}),
|
|
89
|
+
salt: sessionInfo.salt ?? generateSalt(),
|
|
90
|
+
userOpPolicies,
|
|
91
|
+
actions: actionPolicies,
|
|
92
|
+
erc7739Policies: {
|
|
93
|
+
allowedERC7739Content: [],
|
|
94
|
+
erc1271Policies: []
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const permissionId = getPermissionId({
|
|
98
|
+
session
|
|
99
|
+
});
|
|
100
|
+
// push permissionId to the array
|
|
101
|
+
permissionIds.push(permissionId);
|
|
102
|
+
// Push to sessions array
|
|
103
|
+
sessions.push(session);
|
|
104
|
+
}
|
|
105
|
+
const preparePermissionData = encodeFunctionData({
|
|
106
|
+
abi: SmartSessionAbi,
|
|
107
|
+
functionName: "enableSessions",
|
|
108
|
+
args: [sessions]
|
|
109
|
+
});
|
|
110
|
+
return {
|
|
111
|
+
action: {
|
|
112
|
+
target: SMART_SESSIONS_ADDRESS,
|
|
113
|
+
value: BigInt(0),
|
|
114
|
+
callData: preparePermissionData
|
|
115
|
+
},
|
|
116
|
+
permissionIds: permissionIds,
|
|
117
|
+
sessions
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Adds multiple sessions to the SmartSessionValidator module of a given smart account.
|
|
122
|
+
*
|
|
123
|
+
* This function prepares and sends a user operation to create multiple sessions
|
|
124
|
+
* for the specified modular smart account. Each session can have its own policies
|
|
125
|
+
* and permissions.
|
|
126
|
+
*
|
|
127
|
+
* @template TModularSmartAccount - Type of the modular smart account, extending ModularSmartAccount or undefined.
|
|
128
|
+
* @param client - The client used to interact with the blockchain.
|
|
129
|
+
* @param parameters - Parameters including the smart account, required session specific policies info, and optional gas settings.
|
|
130
|
+
* @returns A promise that resolves to an object containing the user operation hash and an array of permission IDs.
|
|
131
|
+
*
|
|
132
|
+
* @throws {AccountNotFoundError} If the account is not found.
|
|
133
|
+
* @throws {Error} If there's an error getting the enable sessions action.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```typescript
|
|
137
|
+
* import { preparePermission } from '@startale-scs/aa-sdk'
|
|
138
|
+
*
|
|
139
|
+
* const result = await preparePermission(startaleClient, {
|
|
140
|
+
* sessionRequestedInfo: [
|
|
141
|
+
* {
|
|
142
|
+
* sessionKeyData: '0x...',
|
|
143
|
+
* actionPoliciesInfo: [
|
|
144
|
+
* {
|
|
145
|
+
* contractAddress: '0x...',
|
|
146
|
+
* functionSelector: '0x...',
|
|
147
|
+
* rules: [...],
|
|
148
|
+
* valueLimit: 1000000000000000000n
|
|
149
|
+
* }
|
|
150
|
+
* ],
|
|
151
|
+
* sessionValidUntil: 1234567890
|
|
152
|
+
* }
|
|
153
|
+
* ]
|
|
154
|
+
* });
|
|
155
|
+
* console.log(result.userOpHash); // '0x...'
|
|
156
|
+
* console.log(result.permissionIds); // ['0x...', '0x...']
|
|
157
|
+
* ```
|
|
158
|
+
*
|
|
159
|
+
* @remarks
|
|
160
|
+
* - Ensure that the client has sufficient gas to cover the transaction.
|
|
161
|
+
* - The number of sessions created is determined by the length of the `sessionRequestedInfo` array.
|
|
162
|
+
* - Each session's policies and permissions are determined by the `actionPoliciesInfo` provided.
|
|
163
|
+
*/
|
|
164
|
+
export async function preparePermission(client, parameters) {
|
|
165
|
+
const { publicClient: publicClient_ = client.account?.client, account: account_ = client.account, sessionRequestedInfo } = parameters;
|
|
166
|
+
if (!account_) {
|
|
167
|
+
throw new AccountNotFoundError({
|
|
168
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
const account = parseAccount(account_);
|
|
172
|
+
if (!account || !account.address) {
|
|
173
|
+
throw new Error("Account not found");
|
|
174
|
+
}
|
|
175
|
+
const withPaymaster = !!client?.paymaster;
|
|
176
|
+
const chainId = publicClient_?.chain?.id;
|
|
177
|
+
if (!chainId) {
|
|
178
|
+
throw new Error(ERROR_MESSAGES.CHAIN_NOT_FOUND);
|
|
179
|
+
}
|
|
180
|
+
const defaultedSessionRequestedInfo = sessionRequestedInfo.map(applyDefaults);
|
|
181
|
+
const actionResponse = await getPermissionAction({
|
|
182
|
+
chainId,
|
|
183
|
+
sessionRequestedInfo: defaultedSessionRequestedInfo,
|
|
184
|
+
withPaymaster
|
|
185
|
+
});
|
|
186
|
+
if (actionResponse instanceof Error) {
|
|
187
|
+
throw actionResponse;
|
|
188
|
+
}
|
|
189
|
+
return actionResponse;
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=preparePermission.js.map
|
package/dist/_esm/modules/validators/smartSessionsValidator/decorators/preparePermission.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preparePermission.js","sourceRoot":"","sources":["../../../../../../src/sdk/modules/validators/smartSessionsValidator/decorators/preparePermission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAEL,yBAAyB,EAEzB,sBAAsB,EAEtB,oBAAoB,EACpB,uBAAuB,EACvB,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAA;AAE3E,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACf,MAAM,YAAY,CAAA;AAQnB,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,CAAA;AAwB3E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EAAE,EACxC,OAAO,EACP,oBAAoB,EACpB,aAAa,GAAG,KAAK,EAKtB,EAA8C,EAAE;IAC/C,MAAM,QAAQ,GAAc,EAAE,CAAA;IAC9B,MAAM,aAAa,GAAU,EAAE,CAAA;IAE/B,MAAM,6BAA6B,GAAG,CACpC,gBAA0C,EAC1C,EAAE;QACF,MAAM,UAAU,GAAiB,EAAE,CAAA;QAEnC,kCAAkC;QAClC,+CAA+C;QAC/C,6EA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BAAmB,CAAC,CAAA;IACtC,CAAC;IAED,MAAM,aAAa,GAAG,CAAC,CAAE,MAAkB,EAAE,SAAS,CAAA;IACtD,MAAM,OAAO,GAAG,aAAa,EAAE,KAAK,EAAE,EAAE,CAAA;IAExC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAA;IACjD,CAAC;IAED,MAAM,6BAA6B,GAAG,oBAAoB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;IAE7E,MAAM,cAAc,GAAG,MAAM,mBAAmB,CAAC;QAC/C,OAAO;QACP,oBAAoB,EAAE,6BAA6B;QACnD,aAAa;KACd,CAAC,CAAA;IAEF,IAAI,cAAc,YAAY,KAAK,EAAE,CAAC;QACpC,MAAM,cAAc,CAAA;IACtB,CAAC;IAED,OAAO,cAAc,CAAA;AACvB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { sendUserOperation } from "viem/account-abstraction";
|
|
2
|
+
import { getAction } from "viem/utils";
|
|
3
|
+
import { AccountNotFoundError } from "../../../../account/utils/AccountNotFound.js";
|
|
4
|
+
/**
|
|
5
|
+
* Executes actions using a smart session.
|
|
6
|
+
*
|
|
7
|
+
* This function allows for the execution of one or more actions within an enabled smart session.
|
|
8
|
+
* It can handle batch transactions if the session is configured for multiple actions.
|
|
9
|
+
*
|
|
10
|
+
* @template TModularSmartAccount - Type of the modular smart account, extending ModularSmartAccount or undefined.
|
|
11
|
+
* @param client - The client used to interact with the blockchain.
|
|
12
|
+
* @param parameters - Parameters for using the session, including actions to execute and optional gas settings.
|
|
13
|
+
* @returns A promise that resolves to the hash of the sent user operation.
|
|
14
|
+
*
|
|
15
|
+
* @throws {AccountNotFoundError} If no account is provided and the client doesn't have an associated account.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const result = await usePermission(startaleClient, {
|
|
20
|
+
* calls: [
|
|
21
|
+
* {
|
|
22
|
+
* to: '0x1234...',
|
|
23
|
+
* data: '0xabcdef...'
|
|
24
|
+
* }
|
|
25
|
+
* ],
|
|
26
|
+
* maxFeePerGas: 1000000000n
|
|
27
|
+
* });
|
|
28
|
+
* console.log(`Transaction hash: ${result}`);
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* - Ensure that the session is enabled and has the necessary permissions for the actions being executed.
|
|
33
|
+
* - For batch transactions, all actions must be permitted within the same session.
|
|
34
|
+
* - The function uses the `sendUserOperation` method, which is specific to account abstraction implementations.
|
|
35
|
+
*/
|
|
36
|
+
export async function usePermission(client, parameters) {
|
|
37
|
+
const { account: account_ = client.account } = parameters;
|
|
38
|
+
if (!account_) {
|
|
39
|
+
throw new AccountNotFoundError({
|
|
40
|
+
docsPath: "/startale-client/methods#sendtransaction"
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return await getAction(client, sendUserOperation, "sendUserOperation"
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
)(parameters);
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=usePermission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePermission.js","sourceRoot":"","sources":["../../../../../../src/sdk/modules/validators/smartSessionsValidator/decorators/usePermission.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAiChF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAGjC,MAAkE,EAClE,UAAyD;IAEzD,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,UAAU,CAAA;IAEzD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,oBAAoB,CAAC;YAC7B,QAAQ,EAAE,0CAA0C;SACrD,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,MAAM,SAAS,CACpB,MAAM,EACN,iBAAiB,EACjB,mBAAmB;IACnB,aAAa;KACd,CAAC,UAAU,CAAC,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/sdk/modules/validators/smartSessionsValidator/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { encodePacked } from "viem";
|
|
2
|
+
import { SMART_SESSIONS_ADDRESS, SmartSessionMode, encodeSmartSessionSignature, getOwnableValidatorMockSignature, getSmartSessionsValidator } from "../../../constants/index.js";
|
|
3
|
+
import { toModule } from "../../utils/toModule.js";
|
|
4
|
+
export const DUMMY_ECDSA_SIG = "0xe8b94748580ca0b4993c9a1b86b5be851bfc076ff5ce3a1ff65bf16392acfcb800f9b4f1aef1555c7fce5599fffb17e7c635502154a0333ba21f3ae491839af51c";
|
|
5
|
+
/**
|
|
6
|
+
* Gets the initialization data for a Use Session module.
|
|
7
|
+
*
|
|
8
|
+
* @param _ - Optional arguments (currently unused).
|
|
9
|
+
* @returns The module metadata including address, type, and initialization data.
|
|
10
|
+
*/
|
|
11
|
+
export const getUsePermissionModuleInitData = (_) => ({
|
|
12
|
+
address: SMART_SESSIONS_ADDRESS,
|
|
13
|
+
type: "validator",
|
|
14
|
+
initData: "0x"
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* Gets the initialization data for a Use Session.
|
|
18
|
+
*
|
|
19
|
+
* @param signerAddress - The address of the signer for the session.
|
|
20
|
+
* @returns The encoded initialization data as a hexadecimal string.
|
|
21
|
+
*/
|
|
22
|
+
export const getUsePermissionInitData = ({ signerAddress }) => encodePacked(["address"], [signerAddress]);
|
|
23
|
+
/**
|
|
24
|
+
* Creates a Smart Sessions module for a modular smart account.
|
|
25
|
+
*
|
|
26
|
+
* This function sets up a Smart Sessions module with the specified parameters,
|
|
27
|
+
* including session mode, permission ID, and session data.
|
|
28
|
+
*
|
|
29
|
+
* @param parameters - The parameters for creating the Smart Sessions module.
|
|
30
|
+
* @returns A Module object representing the created Smart Sessions module.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const smartSessionsModule = toSmartSessionsValidator({
|
|
35
|
+
* account: mySmartAccount,
|
|
36
|
+
* signer: mySigner,
|
|
37
|
+
* moduleData: {
|
|
38
|
+
* permissionId: '0x1234...',
|
|
39
|
+
* mode: SmartSessionMode.USE,
|
|
40
|
+
* enableSessionData: '0x5678...'
|
|
41
|
+
* }
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @remarks
|
|
46
|
+
* - The function generates stub signatures and can sign user operation hashes.
|
|
47
|
+
* - It uses the SmartSession address from the predefined addresses.
|
|
48
|
+
* - The default session mode is USE if not specified.
|
|
49
|
+
*/
|
|
50
|
+
export const toSmartSessionsValidator = (parameters) => {
|
|
51
|
+
const { account, signer, moduleInitData: moduleInitData_, deInitData = "0x", initData: initData_, initArgs: initArgs_ = { signerAddress: signer.address }, moduleData: { permissionIdIndex = 0, permissionIds = [], mode = SmartSessionMode.USE, enableSessionData } = {} } = parameters;
|
|
52
|
+
const initData = initData_ ?? getUsePermissionInitData(initArgs_);
|
|
53
|
+
const moduleInitData = moduleInitData_ ?? getSmartSessionsValidator({ useRegistry: false });
|
|
54
|
+
return toModule({
|
|
55
|
+
...parameters,
|
|
56
|
+
signer,
|
|
57
|
+
accountAddress: account.address,
|
|
58
|
+
address: SMART_SESSIONS_ADDRESS,
|
|
59
|
+
initData,
|
|
60
|
+
moduleInitData,
|
|
61
|
+
deInitData,
|
|
62
|
+
getStubSignature: async () => encodeSmartSessionSignature({
|
|
63
|
+
mode,
|
|
64
|
+
permissionId: permissionIds[permissionIdIndex],
|
|
65
|
+
enableSessionData,
|
|
66
|
+
signature: getOwnableValidatorMockSignature({
|
|
67
|
+
threshold: 1
|
|
68
|
+
})
|
|
69
|
+
}),
|
|
70
|
+
signUserOpHash: async (userOpHash) => {
|
|
71
|
+
return encodeSmartSessionSignature({
|
|
72
|
+
mode,
|
|
73
|
+
permissionId: permissionIds[permissionIdIndex],
|
|
74
|
+
enableSessionData,
|
|
75
|
+
signature: await signer.signMessage({
|
|
76
|
+
message: { raw: userOpHash }
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=toSmartSessionsValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toSmartSessionsValidator.js","sourceRoot":"","sources":["../../../../../src/sdk/modules/validators/smartSessionsValidator/toSmartSessionsValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,YAAY,EAAE,MAAM,MAAM,CAAA;AAC3D,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,2BAA2B,EAC3B,gCAAgC,EAChC,yBAAyB,EAC1B,MAAM,oBAAoB,CAAA;AAI3B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAG/C,MAAM,CAAC,MAAM,eAAe,GAC1B,sIAAsI,CAAA;AAwBxI;;;;;GAKG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAC5C,CAAsC,EAC1B,EAAE,CAAC,CAAC;IAChB,OAAO,EAAE,sBAAsB;IAC/B,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,IAAI;CACf,CAAC,CAAA;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,EACvC,aAAa,EACsB,EAAO,EAAE,CAC5C,YAAY,CAAC,CAAC,S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,OAAO,EAAE,EAAE,GAAG,EAAE,UAAiB,EAAE;iBACpC,CAAC;aACH,CAAC,CAAA;QACJ,CAAC;KACF,CAAuB,CAAA;AAC1B,CAAC,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DUMMY_SIGNATURE } from "../index.js";
|
|
2
|
+
export const toValidator = (parameters) => {
|
|
3
|
+
const { deInitData = "0x", type = "validator", signer, data = "0x", module, ...rest } = parameters;
|
|
4
|
+
return {
|
|
5
|
+
deInitData,
|
|
6
|
+
data,
|
|
7
|
+
module,
|
|
8
|
+
address: module,
|
|
9
|
+
signer,
|
|
10
|
+
type,
|
|
11
|
+
getStubSignature: async () => DUMMY_SIGNATURE,
|
|
12
|
+
signUserOpHash: async (userOpHash) => await signer.signMessage({ message: { raw: userOpHash } }),
|
|
13
|
+
signMessage: async (message) => await signer.signMessage({ message }),
|
|
14
|
+
...rest
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=toValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toValidator.js","sourceRoot":"","sources":["../../../../src/sdk/modules/validators/toValidator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAA;AAuDpC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,UAA+B,EAAa,EAAE;IACxE,MAAM,EACJ,UAAU,GAAG,IAAI,EACjB,IAAI,GAAG,WAAW,EAClB,MAAM,EACN,IAAI,GAAG,IAAI,EACX,MAAM,EACN,GAAG,IAAI,EACR,GAAG,UAAU,CAAA;IAEd,OAAO;QACL,UAAU;QACV,IAAI;QACJ,MAAM;QACN,OAAO,EAAE,MAAM;QACf,MAAM;QACN,IAAI;QACJ,gBAAgB,EAAE,KAAK,IAAI,EAAE,CAAC,eAAe;QAC7C,cAAc,EAAE,KAAK,EAAE,UAAe,EAAE,EAAE,CACxC,MAAM,MAAM,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,CAAC;QAC5D,WAAW,EAAE,KAAK,EAAE,OAAwB,EAAE,EAAE,CAC9C,MAAM,MAAM,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC;QACvC,GAAG,IAAI;KACR,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type": "module","sideEffects":false}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type Address, type Hex } from "viem";
|
|
2
|
+
import type { GenericModuleConfig, PrevalidationHookModuleConfig } from "../toStartaleSmartAccount";
|
|
3
|
+
export type GetFactoryDataParams = {
|
|
4
|
+
/** Hex string of the validator init data */
|
|
5
|
+
initData: Hex;
|
|
6
|
+
/** Account index for deterministic deployment */
|
|
7
|
+
index: bigint;
|
|
8
|
+
};
|
|
9
|
+
export declare const getFactoryData: ({ initData, index }: GetFactoryDataParams) => Hex;
|
|
10
|
+
export type ModuleConfig = {
|
|
11
|
+
module: Address;
|
|
12
|
+
data: Hex;
|
|
13
|
+
};
|
|
14
|
+
export type GetInitDataParams = {
|
|
15
|
+
defaultValidator: GenericModuleConfig;
|
|
16
|
+
prevalidationHooks: PrevalidationHookModuleConfig[];
|
|
17
|
+
validators: GenericModuleConfig[];
|
|
18
|
+
executors: GenericModuleConfig[];
|
|
19
|
+
hook: GenericModuleConfig;
|
|
20
|
+
fallbacks: GenericModuleConfig[];
|
|
21
|
+
registryAddress: Address;
|
|
22
|
+
bootStrapAddress: Address;
|
|
23
|
+
};
|
|
24
|
+
export declare const getInitData: (params: GetInitDataParams) => Hex;
|
|
25
|
+
//# sourceMappingURL=getFactoryData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFactoryData.d.ts","sourceRoot":"","sources":["../../../../src/sdk/account/decorators/getFactoryData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EAMT,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EACV,mBAAmB,EACnB,6BAA6B,EAC9B,MAAM,2BAA2B,CAAA;AAElC,MAAM,MAAM,oBAAoB,GAAG;IACjC,4CAA4C;IAC5C,QAAQ,EAAE,GAAG,CAAA;IACb,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,qBAG5B,oBAAoB,KAAG,GAUzB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,GAAG,CAAA;CACV,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,gBAAgB,EAAE,mBAAmB,CAAA;IACrC,kBAAkB,EAAE,6BAA6B,EAAE,CAAA;IACnD,UAAU,EAAE,mBAAmB,EAAE,CAAA;IACjC,SAAS,EAAE,mBAAmB,EAAE,CAAA;IAChC,IAAI,EAAE,mBAAmB,CAAA;IACzB,SAAS,EAAE,mBAAmB,EAAE,CAAA;IAChC,eAAe,EAAE,OAAO,CAAA;IACxB,gBAAgB,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,QAAQ,iBAAiB,KAAG,GAqBrD,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Address } from "viem";
|
|
2
|
+
import type { PublicClient } from "viem";
|
|
3
|
+
/**
|
|
4
|
+
* Parameters for getting the MEE counterfactual address
|
|
5
|
+
* @property publicClient - {@link PublicClient} The public client to use for the read contract
|
|
6
|
+
* @property signerAddress - {@link Address} The address of the EOA signer
|
|
7
|
+
* @property index - Optional BigInt index for deterministic deployment (defaults to 0)
|
|
8
|
+
*/
|
|
9
|
+
export type GetUniversalAddressParams<ExtendedPublicClient extends PublicClient> = {
|
|
10
|
+
factoryAddress: Address;
|
|
11
|
+
publicClient: ExtendedPublicClient;
|
|
12
|
+
initData: Address;
|
|
13
|
+
index: bigint;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Gets the counterfactual address for the smart account
|
|
17
|
+
*
|
|
18
|
+
* @param params - {@link GetUniversalAddressParams} Configuration for address computation
|
|
19
|
+
* @param params.publicClient - The public client to use for the read contract
|
|
20
|
+
* @param params.signerAddress - The address of the EOA signer
|
|
21
|
+
* @param params.index - Optional account index (defaults to 0)
|
|
22
|
+
*
|
|
23
|
+
* @returns Promise resolving to the {@link Address} of the counterfactual account
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const accountAddress = await getSmartAccountAddress({
|
|
27
|
+
* publicClient: viemPublicClient,
|
|
28
|
+
* initData: "0x123...",
|
|
29
|
+
* index: BigInt(0)
|
|
30
|
+
* });
|
|
31
|
+
*/
|
|
32
|
+
export declare const getStartaleAccountAddress: (params: GetUniversalAddressParams<PublicClient>) => Promise<Address>;
|
|
33
|
+
//# sourceMappingURL=getStartaleAccountAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getStartaleAccountAddress.d.ts","sourceRoot":"","sources":["../../../../src/sdk/account/decorators/getStartaleAccountAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,MAAM,CAAA;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAIxC;;;;;GAKG;AACH,MAAM,MAAM,yBAAyB,CACnC,oBAAoB,SAAS,YAAY,IACvC;IACF,cAAc,EAAE,OAAO,CAAA;IACvB,YAAY,EAAE,oBAAoB,CAAA;IAClC,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,yBAAyB,GACpC,QAAQ,yBAAyB,CAAC,YAAY,CAAC,KAC9C,OAAO,CAAC,OAAO,CAgBjB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sdk/account/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAA;AAC9C,cAAc,qBAAqB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/account/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,0BAA0B,CAAA"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { type Account, type Address, type Chain, type ClientConfig, type Hex, type LocalAccount, type OneOf, type Prettify, type PublicClient, type RpcSchema, type Transport, type WalletClient } from "viem";
|
|
2
|
+
import { type SmartAccount, type SmartAccountImplementation, type UserOperation } from "viem/account-abstraction";
|
|
3
|
+
import { EntrypointAbi } from "../constants/abi";
|
|
4
|
+
import type { ComposableCall } from "../modules";
|
|
5
|
+
import type { Validator } from "../modules/validators/toValidator";
|
|
6
|
+
import type { Module } from "../modules/utils/Types";
|
|
7
|
+
import type { Call } from "./utils/Types";
|
|
8
|
+
import { type EthersWallet } from "./utils/Utils";
|
|
9
|
+
import { type EthereumProvider, type Signer } from "./utils/toSigner";
|
|
10
|
+
/**
|
|
11
|
+
* Base module configuration type
|
|
12
|
+
*/
|
|
13
|
+
export type MinimalModuleConfig = {
|
|
14
|
+
module: Address;
|
|
15
|
+
data: Hex;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Generic module configuration type that can be extended with additional properties
|
|
19
|
+
*/
|
|
20
|
+
export type GenericModuleConfig<T extends MinimalModuleConfig = MinimalModuleConfig> = T;
|
|
21
|
+
export type PrevalidationHookModuleConfig = GenericModuleConfig & {
|
|
22
|
+
hookType: bigint;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Parameters for creating a Startale Smart Account
|
|
26
|
+
*/
|
|
27
|
+
export type ToStartaleSmartAccountParameters = {
|
|
28
|
+
/** The blockchain network */
|
|
29
|
+
chain: Chain;
|
|
30
|
+
/** The transport configuration */
|
|
31
|
+
transport: ClientConfig["transport"];
|
|
32
|
+
/** The signer account or address */
|
|
33
|
+
signer: OneOf<EthereumProvider | WalletClient<Transport, Chain | undefined, Account> | LocalAccount | EthersWallet>;
|
|
34
|
+
/** Optional index for the account */
|
|
35
|
+
index?: bigint | undefined;
|
|
36
|
+
/** Optional account address override */
|
|
37
|
+
accountAddress?: Address;
|
|
38
|
+
/** Optional validator modules configuration */
|
|
39
|
+
validators?: Array<Validator>;
|
|
40
|
+
/** Optional executor modules configuration */
|
|
41
|
+
executors?: Array<GenericModuleConfig>;
|
|
42
|
+
/** Optional prevalidation hook modules configuration */
|
|
43
|
+
prevalidationHooks?: Array<PrevalidationHookModuleConfig>;
|
|
44
|
+
/** Optional hook module configuration */
|
|
45
|
+
hook?: GenericModuleConfig;
|
|
46
|
+
/** Optional fallback modules configuration */
|
|
47
|
+
fallbacks?: Array<GenericModuleConfig>;
|
|
48
|
+
/** Optional registry address */
|
|
49
|
+
registryAddress?: Address;
|
|
50
|
+
/** Optional factory address */
|
|
51
|
+
factoryAddress?: Address;
|
|
52
|
+
/** Optional bootstrap address */
|
|
53
|
+
bootStrapAddress?: Address;
|
|
54
|
+
} & Prettify<Pick<ClientConfig<Transport, Chain, Account, RpcSchema>, "account" | "cacheTime" | "chain" | "key" | "name" | "pollingInterval" | "rpcSchema">>;
|
|
55
|
+
/**
|
|
56
|
+
* Startale Smart Account type
|
|
57
|
+
*/
|
|
58
|
+
export type StartaleSmartAccount = Prettify<SmartAccount<StartaleSmartAccountImplementation>>;
|
|
59
|
+
/**
|
|
60
|
+
* Startale Smart Account Implementation
|
|
61
|
+
*/
|
|
62
|
+
export type StartaleSmartAccountImplementation = SmartAccountImplementation<typeof EntrypointAbi, "0.7", {
|
|
63
|
+
/** Gets the counterfactual address of the account */
|
|
64
|
+
getAddress: () => Promise<Address>;
|
|
65
|
+
/** Gets the init code for the account */
|
|
66
|
+
getInitCode: () => Hex;
|
|
67
|
+
/** Encodes a single call for execution */
|
|
68
|
+
encodeExecute: (call: Call) => Promise<Hex>;
|
|
69
|
+
/** Encodes a batch of calls for execution */
|
|
70
|
+
encodeExecuteBatch: (calls: readonly Call[]) => Promise<Hex>;
|
|
71
|
+
/** Encodes a composable call for execution */
|
|
72
|
+
encodeExecuteComposable: (calls: ComposableCall[]) => Promise<Hex>;
|
|
73
|
+
/** Calculates the hash of a user operation */
|
|
74
|
+
getUserOpHash: (userOp: UserOperation) => Hex;
|
|
75
|
+
/** Factory data used for account creation */
|
|
76
|
+
factoryData: Hex;
|
|
77
|
+
/** Factory address used for account creation */
|
|
78
|
+
factoryAddress: Address;
|
|
79
|
+
/** The signer instance */
|
|
80
|
+
signer: Signer;
|
|
81
|
+
/** The public client instance */
|
|
82
|
+
publicClient: PublicClient;
|
|
83
|
+
/** The wallet client instance */
|
|
84
|
+
walletClient: WalletClient;
|
|
85
|
+
/** The blockchain network */
|
|
86
|
+
chain: Chain;
|
|
87
|
+
/** Get the active module */
|
|
88
|
+
getModule: () => Validator;
|
|
89
|
+
/** Set the active module */
|
|
90
|
+
setModule: (validationModule: Module) => void;
|
|
91
|
+
}>;
|
|
92
|
+
/**
|
|
93
|
+
* @description Create a Startale Smart Account.
|
|
94
|
+
*
|
|
95
|
+
* @param parameters - {@link ToStartaleSmartAccountParameters}
|
|
96
|
+
* @returns Startale Smart Account. {@link StartaleSmartAccount}
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* import { toStartaleAccount } from '@startale-scs/aa-sdk'
|
|
100
|
+
* import { createWalletClient, http } from 'viem'
|
|
101
|
+
* import { mainnet } from 'viem/chains'
|
|
102
|
+
*
|
|
103
|
+
* const account = await toStartaleAccount({
|
|
104
|
+
* chain: mainnet,
|
|
105
|
+
* transport: http(),
|
|
106
|
+
* signer: '0x...',
|
|
107
|
+
* })
|
|
108
|
+
*/
|
|
109
|
+
export declare const toStartaleSmartAccount: (parameters: ToStartaleSmartAccountParameters) => Promise<StartaleSmartAccount>;
|
|
110
|
+
//# sourceMappingURL=toStartaleSmartAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toStartaleSmartAccount.d.ts","sourceRoot":"","sources":["../../../src/sdk/account/toStartaleSmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,GAAG,EACR,KAAK,YAAY,EACjB,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,SAAS,EAId,KAAK,YAAY,EAkBlB,MAAM,MAAM,CAAA;AACb,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAInB,MAAM,0BAA0B,CAAA;AAQjC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,OAAO,KAAK,EAAsB,cAAc,EAAE,MAAM,YAAY,CAAA;AAGpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AASpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EACL,KAAK,YAAY,EAQlB,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,MAAM,EAAY,MAAM,kBAAkB,CAAA;AAE/E;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,GAAG,CAAA;CACV,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAC7B,CAAC,SAAS,mBAAmB,GAAG,mBAAmB,IACjD,CAAC,CAAA;AAEL,MAAM,MAAM,6BAA6B,GAAG,mBAAmB,GAAG;IAChE,QAAQ,EAAE,MAAM,CAAA;CACjB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