@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,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ACCOUNT_MODES = exports.EXECUTE_BATCH = exports.EXECUTE_SINGLE = exports.eip1271MagicValue = exports.PARENT_TYPEHASH = exports.ACCOUNT_DOMAIN_TYPEHASH = exports.ACCOUNT_DOMAIN_VERSION = exports.ACCOUNT_DOMAIN_NAME = exports.MODULE_TYPE_MULTI = exports.MOCK_MULTI_MODULE_ADDRESS = exports.MODULE_ENABLE_MODE_TYPE_HASH = exports.MODE_MODULE_ENABLE = exports.MODE_VALIDATION = exports.SENTINEL_ADDRESS = exports.GENERIC_FALLBACK_SELECTOR = exports.MODE_PAYLOAD = exports.UNUSED = exports.MODE_DEFAULT = exports.EXECTYPE_DELEGATE = exports.EXECTYPE_TRY = exports.EXECTYPE_DEFAULT = exports.CALLTYPE_BATCH = exports.CALLTYPE_SINGLE = exports.ERC20_ABI = exports.NATIVE_TOKEN_ALIAS = exports.ERROR_MESSAGES = exports.LargeGasLimit = exports.DefaultGasLimit = exports.ADDRESS_RESOLVER_ADDRESS = exports.PROXY_CREATION_CODE = exports.EIP1559_UNSUPPORTED_NETWORKS = exports.STARTALE_TOKEN_PAYMASTER = exports.ADDRESS_ZERO = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
exports.ADDRESS_ZERO = "0x0000000000000000000000000000000000000000";
|
|
6
|
+
exports.STARTALE_TOKEN_PAYMASTER = "0x0000006C18daC1Ff8F50Df743F7587a8b7d8a8a7";
|
|
7
|
+
exports.EIP1559_UNSUPPORTED_NETWORKS = [97, 56, 1442, 1101];
|
|
8
|
+
exports.PROXY_CREATION_CODE = "0x603d3d8160223d3973600966Ae45ad5BE4be08a70AD99e9cF41e6d6884B06F5155f3363d3d373d3d363d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc545af43d6000803e6038573d6000fd5b3d6000f3";
|
|
9
|
+
exports.ADDRESS_RESOLVER_ADDRESS = "0x00000E81673606e07fC79CE5F1b3B26957844468";
|
|
10
|
+
exports.DefaultGasLimit = {
|
|
11
|
+
callGasLimit: 800000n,
|
|
12
|
+
verificationGasLimit: 1000000n,
|
|
13
|
+
preVerificationGas: 100000n
|
|
14
|
+
};
|
|
15
|
+
exports.LargeGasLimit = {
|
|
16
|
+
callGasLimit: 10000000n,
|
|
17
|
+
verificationGasLimit: 15000000n,
|
|
18
|
+
preVerificationGas: 1500000n
|
|
19
|
+
};
|
|
20
|
+
exports.ERROR_MESSAGES = {
|
|
21
|
+
KEY_GEN_DATA_NOT_FOUND: "Key generation data is not available",
|
|
22
|
+
SIGNATURE_NOT_FOUND: "Signature not found from Dan",
|
|
23
|
+
FAILED_COMPUTE_ACCOUNT_ADDRESS: "Failed to compute account address. Possible reasons:\n" +
|
|
24
|
+
"- The factory contract does not have the function 'computeAccountAddress'\n" +
|
|
25
|
+
"- The parameters passed to the factory contract function may be invalid\n" +
|
|
26
|
+
"- The provided factory address is not a contract",
|
|
27
|
+
SIGNER_REQUIRED_FOR_CREATE_SESSION: "Signer is required",
|
|
28
|
+
ACCOUNT_REQUIRED: "Account is required",
|
|
29
|
+
MODULE_NOT_ACTIVATED: "Module not activated",
|
|
30
|
+
SMART_SESSION_DATA_REQUIRED: "Data is required for using smart session module",
|
|
31
|
+
MISSING_ACCOUNT_CONTRACT: 'The contract function "computeAccountAddress" returned no data ("0x")',
|
|
32
|
+
INVALID_HEX: "Invalid hex, if you are targeting a number, consider using pad() and toHex() from viem: pad(toHex(BigInt(2000))",
|
|
33
|
+
CONTRACT_NOT_DEPLOYED: "Address is not a contract. Make sure that the contract you are trying to use is deployed.",
|
|
34
|
+
ACCOUNT_NOT_DEPLOYED: "Account has not yet been deployed",
|
|
35
|
+
ACCOUNT_ALREADY_DEPLOYED: "Account already deployed",
|
|
36
|
+
NO_NATIVE_TOKEN_BALANCE_DURING_DEPLOY: "Smart Account does not have sufficient funds to execute the User Operation.",
|
|
37
|
+
SPENDER_REQUIRED: "spender is required for ERC20 mode",
|
|
38
|
+
NO_FEE_QUOTE: "FeeQuote was not provided, please call smartAccount.getTokenFees() to get feeQuote",
|
|
39
|
+
FAILED_FEE_QUOTE_FETCH: "Failed to fetch fee quote",
|
|
40
|
+
CHAIN_NOT_FOUND: "Chain not found",
|
|
41
|
+
NO_RECIPIENT: "Recipient is required",
|
|
42
|
+
NATIVE_TOKEN_WITHDRAWAL_WITHOUT_AMOUNT: "'Amount' is required for withdrawal of native token without using a paymaster",
|
|
43
|
+
MISSING_RPC_URL: "rpcUrl is required for this signer type, please provide it in the config",
|
|
44
|
+
INVALID_SESSION_INDEXES: "Session indexes and transactions must be of the same length and correspond to each other",
|
|
45
|
+
SIGNER_REQUIRED: "Signer is required for creating a smart account",
|
|
46
|
+
UNKNOW_SESSION_ARGUMENTS: "You have not provided the necessary information to find and use a session"
|
|
47
|
+
};
|
|
48
|
+
exports.NATIVE_TOKEN_ALIAS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
|
49
|
+
exports.ERC20_ABI = [
|
|
50
|
+
"function transfer(address to, uint256 value) external returns (bool)",
|
|
51
|
+
"function transferFrom(address from, address to, uint256 value) external returns (bool)",
|
|
52
|
+
"function approve(address spender, uint256 value) external returns (bool)",
|
|
53
|
+
"function allowance(address owner, address spender) external view returns (uint256)",
|
|
54
|
+
"function balanceOf(address owner) external view returns (uint256)",
|
|
55
|
+
"function decimals() external view returns (uint8)"
|
|
56
|
+
];
|
|
57
|
+
exports.CALLTYPE_SINGLE = "0x00";
|
|
58
|
+
exports.CALLTYPE_BATCH = "0x01";
|
|
59
|
+
exports.EXECTYPE_DEFAULT = "0x00";
|
|
60
|
+
exports.EXECTYPE_TRY = "0x01";
|
|
61
|
+
exports.EXECTYPE_DELEGATE = "0xFF";
|
|
62
|
+
exports.MODE_DEFAULT = "0x00000000";
|
|
63
|
+
exports.UNUSED = "0x00000000";
|
|
64
|
+
exports.MODE_PAYLOAD = "0x00000000000000000000000000000000000000000000";
|
|
65
|
+
exports.GENERIC_FALLBACK_SELECTOR = "0xcb5baf0f";
|
|
66
|
+
exports.SENTINEL_ADDRESS = "0x0000000000000000000000000000000000000001";
|
|
67
|
+
exports.MODE_VALIDATION = "0x00";
|
|
68
|
+
exports.MODE_MODULE_ENABLE = "0x01";
|
|
69
|
+
exports.MODULE_ENABLE_MODE_TYPE_HASH = (0, viem_1.keccak256)((0, viem_1.toHex)("ModuleEnableMode(address module, bytes32 initDataHash)"));
|
|
70
|
+
exports.MOCK_MULTI_MODULE_ADDRESS = "0x9C992f91E7Cd4697B81E137007f446E826b8378b";
|
|
71
|
+
exports.MODULE_TYPE_MULTI = 0;
|
|
72
|
+
exports.ACCOUNT_DOMAIN_NAME = "Startale";
|
|
73
|
+
exports.ACCOUNT_DOMAIN_VERSION = "1.0.0";
|
|
74
|
+
exports.ACCOUNT_DOMAIN_TYPEHASH = "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)";
|
|
75
|
+
exports.PARENT_TYPEHASH = "TypedDataSign(Contents contents,string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)Contents(bytes32 stuff)";
|
|
76
|
+
exports.eip1271MagicValue = "0x1626ba7e";
|
|
77
|
+
exports.EXECUTE_SINGLE = (0, viem_1.concat)([
|
|
78
|
+
exports.CALLTYPE_SINGLE,
|
|
79
|
+
exports.EXECTYPE_DEFAULT,
|
|
80
|
+
exports.MODE_DEFAULT,
|
|
81
|
+
exports.UNUSED,
|
|
82
|
+
exports.MODE_PAYLOAD
|
|
83
|
+
]);
|
|
84
|
+
exports.EXECUTE_BATCH = (0, viem_1.concat)([
|
|
85
|
+
exports.CALLTYPE_BATCH,
|
|
86
|
+
exports.EXECTYPE_DEFAULT,
|
|
87
|
+
exports.MODE_DEFAULT,
|
|
88
|
+
exports.UNUSED,
|
|
89
|
+
exports.MODE_PAYLOAD
|
|
90
|
+
]);
|
|
91
|
+
exports.ACCOUNT_MODES = {
|
|
92
|
+
DEFAULT_SINGLE: (0, viem_1.concat)([
|
|
93
|
+
(0, viem_1.pad)(exports.EXECTYPE_DEFAULT, { size: 1 }),
|
|
94
|
+
(0, viem_1.pad)(exports.CALLTYPE_SINGLE, { size: 1 }),
|
|
95
|
+
(0, viem_1.pad)(exports.UNUSED, { size: 4 }),
|
|
96
|
+
(0, viem_1.pad)(exports.MODE_DEFAULT, { size: 4 }),
|
|
97
|
+
(0, viem_1.pad)(exports.MODE_PAYLOAD, { size: 22 })
|
|
98
|
+
]),
|
|
99
|
+
DEFAULT_BATCH: (0, viem_1.concat)([
|
|
100
|
+
(0, viem_1.pad)(exports.EXECTYPE_DEFAULT, { size: 1 }),
|
|
101
|
+
(0, viem_1.pad)(exports.CALLTYPE_BATCH, { size: 1 }),
|
|
102
|
+
(0, viem_1.pad)(exports.UNUSED, { size: 4 }),
|
|
103
|
+
(0, viem_1.pad)(exports.MODE_DEFAULT, { size: 4 }),
|
|
104
|
+
(0, viem_1.pad)(exports.MODE_PAYLOAD, { size: 22 })
|
|
105
|
+
]),
|
|
106
|
+
TRY_BATCH: (0, viem_1.concat)([
|
|
107
|
+
(0, viem_1.pad)(exports.EXECTYPE_TRY, { size: 1 }),
|
|
108
|
+
(0, viem_1.pad)(exports.CALLTYPE_BATCH, { size: 1 }),
|
|
109
|
+
(0, viem_1.pad)(exports.UNUSED, { size: 4 }),
|
|
110
|
+
(0, viem_1.pad)(exports.MODE_DEFAULT, { size: 4 }),
|
|
111
|
+
(0, viem_1.pad)(exports.MODE_PAYLOAD, { size: 22 })
|
|
112
|
+
]),
|
|
113
|
+
TRY_SINGLE: (0, viem_1.concat)([
|
|
114
|
+
(0, viem_1.pad)(exports.EXECTYPE_TRY, { size: 1 }),
|
|
115
|
+
(0, viem_1.pad)(exports.CALLTYPE_SINGLE, { size: 1 }),
|
|
116
|
+
(0, viem_1.pad)(exports.UNUSED, { size: 4 }),
|
|
117
|
+
(0, viem_1.pad)(exports.MODE_DEFAULT, { size: 4 }),
|
|
118
|
+
(0, viem_1.pad)(exports.MODE_PAYLOAD, { size: 22 })
|
|
119
|
+
]),
|
|
120
|
+
DELEGATE_SINGLE: (0, viem_1.concat)([
|
|
121
|
+
(0, viem_1.pad)(exports.EXECTYPE_DELEGATE, { size: 1 }),
|
|
122
|
+
(0, viem_1.pad)(exports.CALLTYPE_SINGLE, { size: 1 }),
|
|
123
|
+
(0, viem_1.pad)(exports.UNUSED, { size: 4 }),
|
|
124
|
+
(0, viem_1.pad)(exports.MODE_DEFAULT, { size: 4 }),
|
|
125
|
+
(0, viem_1.pad)(exports.MODE_PAYLOAD, { size: 22 })
|
|
126
|
+
])
|
|
127
|
+
};
|
|
128
|
+
//# sourceMappingURL=Constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../../src/sdk/account/utils/Constants.ts"],"names":[],"mappings":";;;AAAA,+BAA8D;AACjD,QAAA,YAAY,GAAQ,4CAA4C,CAAA;AAGhE,QAAA,wBAAwB,GACnC,4CAA4C,CAAA;AAEjC,QAAA,4BAA4B,GAAkB,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAElE,QAAA,mBAAmB,GAC9B,kMAAkM,CAAA;AAGvL,QAAA,wBAAwB,GACnC,4CAA4C,CAAA;AAEjC,QAAA,eAAe,GAAG;IAC7B,YAAY,EAAE,OAAO;IACrB,oBAA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QACxB,IAAA,UAAG,EAAC,oBAAY,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QAC9B,IAAA,UAAG,EAAC,oBAAY,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;KAChC,CAAC;IACF,eAAe,EAAE,IAAA,aAAM,EAAC;QACtB,IAAA,UAAG,EAAC,yBAAiB,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QACnC,IAAA,UAAG,EAAC,uBAAe,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QACjC,IAAA,UAAG,EAAC,cAAM,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QACxB,IAAA,UAAG,EAAC,oBAAY,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QAC9B,IAAA,UAAG,EAAC,oBAAY,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;KAChC,CAAC;CACH,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRandomBigInt = exports.getRandomInt = exports.bigIntReplacer = exports.isStaging = exports.isDebugging = void 0;
|
|
4
|
+
const isDebugging = () => {
|
|
5
|
+
try {
|
|
6
|
+
return (process?.env?.SDK_DEBUG === "true" ||
|
|
7
|
+
process?.env?.REACT_APP_SDK_DEBUG === "true" ||
|
|
8
|
+
process?.env?.NEXT_PUBLIC_SDK_DEBUG === "true");
|
|
9
|
+
}
|
|
10
|
+
catch (e) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
exports.isDebugging = isDebugging;
|
|
15
|
+
const isStaging = () => {
|
|
16
|
+
try {
|
|
17
|
+
return process?.env?.STAGING?.toString() === "true";
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.isStaging = isStaging;
|
|
24
|
+
const bigIntReplacer = (_, value) => {
|
|
25
|
+
if (typeof value === "bigint") {
|
|
26
|
+
return `${value.toString()}n`;
|
|
27
|
+
}
|
|
28
|
+
return value;
|
|
29
|
+
};
|
|
30
|
+
exports.bigIntReplacer = bigIntReplacer;
|
|
31
|
+
const getRandomInt = (min = 1, max = 10000000000000) => {
|
|
32
|
+
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
33
|
+
};
|
|
34
|
+
exports.getRandomInt = getRandomInt;
|
|
35
|
+
const getRandomBigInt = (min = 1n, max = 10000000000000n) => {
|
|
36
|
+
return (BigInt(Math.floor(Math.random() * (Number(max) - Number(min) + 1))) + min);
|
|
37
|
+
};
|
|
38
|
+
exports.getRandomBigInt = getRandomBigInt;
|
|
39
|
+
//# sourceMappingURL=Helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Helpers.js","sourceRoot":"","sources":["../../../../src/sdk/account/utils/Helpers.ts"],"names":[],"mappings":";;;AAEO,MAAM,WAAW,GAAG,GAAG,EAAE;IAC9B,IAAI,CAAC;QACH,OAAO,CACL,OAAO,EAAE,GAAG,EAAE,SAAS,KAAK,MAAM;YAClC,OAAO,EAAE,GAAG,EAAE,mBAAmB,KAAK,MAAM;YAC5C,OAAO,EAAE,GAAG,EAAE,qBAAqB,KAAK,MAAM,CAC/C,CAAA;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC,CAAA;AAVY,QAAA,WAAW,eAUvB;AAEM,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,IAAI,CAAC;QACH,OAAO,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,MAAM,CAAA;IACrD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC,CAAA;AANY,QAAA,SAAS,aAMrB;AAEM,MAAM,cAAc,GAAG,CAAC,CAAS,EAAE,KAAc,EAAW,EAAE;IACnE,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAA;IAC/B,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AALY,QAAA,cAAc,kBAK1B;AASM,MAAM,YAAY,GAAG,CAAC,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,cAAc,EAAE,EAAE;IAC5D,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAA;AAC1D,CAAC,CAAA;AAFY,QAAA,YAAY,gBAExB;AASM,MAAM,eAAe,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,GAAG,GAAG,eAAe,EAAE,EAAE;IACjE,OAAO,CACL,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAC1E,CAAA;AACH,CAAC,CAAA;AAJY,QAAA,eAAe,mBAI3B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Logger = void 0;
|
|
4
|
+
const Helpers_1 = require("./Helpers.js");
|
|
5
|
+
class Logger {
|
|
6
|
+
static log(message, value = "") {
|
|
7
|
+
const timestamp = new Date().toISOString();
|
|
8
|
+
const logMessage = `\x1b[35m[${timestamp}]\x1b[0m \x1b[36m${message}\x1b[0m:`;
|
|
9
|
+
if (Logger.isDebug) {
|
|
10
|
+
console.log(logMessage, value === undefined ? "" : value);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
static warn(message, value = "") {
|
|
14
|
+
const timestamp = new Date().toISOString();
|
|
15
|
+
const warnMessage = `\x1b[35m[${timestamp}]\x1b[0m \x1b[33mWARN\x1b[0m: \x1b[36m${message}\x1b[0m`;
|
|
16
|
+
if (Logger.isDebug) {
|
|
17
|
+
console.warn(warnMessage, value === undefined ? "" : value);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
static error(message, value = "") {
|
|
21
|
+
const timestamp = new Date().toISOString();
|
|
22
|
+
const errorMessage = `\x1b[35m[${timestamp}]\x1b[0m \x1b[31mERROR\x1b[0m: \x1b[36m${message}\x1b[0m`;
|
|
23
|
+
if (Logger.isDebug) {
|
|
24
|
+
console.error(errorMessage, value === undefined ? "" : value);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.Logger = Logger;
|
|
29
|
+
Object.defineProperty(Logger, "isDebug", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: (0, Helpers_1.isDebugging)()
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=Logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../../../src/sdk/account/utils/Logger.ts"],"names":[],"mappings":";;;AAOA,uCAAuC;AAGvC,MAAM,MAAM;IAaV,MAAM,CAAC,GAAG,CAAC,OAAe,EAAE,QAAa,EAAE;QACzC,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;QAC1C,MAAM,UAAU,GAAG,YAAY,SAAS,oBAAoB,OAAO,UAAU,CAAA;QAE7E,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;QAC3D,CAAC;IACH,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,OAAe,EAAE,QAAa,EAAE;QAC1C,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;QAC1C,MAAM,WAAW,GAAG,YAAY,SAAS,yCAAyC,OAAO,SAAS,CAAA;QAElG,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;QAC7D,CAAC;IACH,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAAe,EAAE,QAAa,EAAE;QAC3C,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;QAC1C,MAAM,YAAY,GAAG,YAAY,SAAS,0CAA0C,OAAO,SAAS,CAAA;QAEpG,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;QAC/D,CAAC;IACH,CAAC;;AAGM,wBAAM;AAvCN;;;;WAAmB,IAAA,qBAAW,GAAE;GAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Types.js","sourceRoot":"","sources":["../../../../src/sdk/account/utils/Types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAllowance = exports.safeMultiplier = exports.getTenderlyDetails = exports.playgroundTrue = exports.inProduction = exports.getAccountDomainStructFields = exports.eip712WrapHash = exports.getAccountMeta = exports.wrapSignatureWith6492 = exports.addressEquals = exports.isValidRpcUrl = exports.isNullOrUndefined = void 0;
|
|
4
|
+
exports.percentage = percentage;
|
|
5
|
+
exports.convertToFactor = convertToFactor;
|
|
6
|
+
exports.makeInstallDataAndHash = makeInstallDataAndHash;
|
|
7
|
+
exports._hashTypedData = _hashTypedData;
|
|
8
|
+
exports.getTypesForEIP712Domain = getTypesForEIP712Domain;
|
|
9
|
+
exports.typeToString = typeToString;
|
|
10
|
+
exports.bigIntReplacer = bigIntReplacer;
|
|
11
|
+
exports.numberTo3Bytes = numberTo3Bytes;
|
|
12
|
+
exports.toHexString = toHexString;
|
|
13
|
+
exports.parseRequestArguments = parseRequestArguments;
|
|
14
|
+
const viem_1 = require("viem");
|
|
15
|
+
const Constants_1 = require("../../account/utils/Constants.js");
|
|
16
|
+
const abi_1 = require("../../constants/abi/index.js");
|
|
17
|
+
const Types_1 = require("../../modules/utils/Types.js");
|
|
18
|
+
const isNullOrUndefined = (value) => {
|
|
19
|
+
return value === null || value === undefined;
|
|
20
|
+
};
|
|
21
|
+
exports.isNullOrUndefined = isNullOrUndefined;
|
|
22
|
+
const isValidRpcUrl = (url) => {
|
|
23
|
+
const regex = /^(http:\/\/|wss:\/\/|https:\/\/).*/;
|
|
24
|
+
return regex.test(url);
|
|
25
|
+
};
|
|
26
|
+
exports.isValidRpcUrl = isValidRpcUrl;
|
|
27
|
+
const addressEquals = (a, b) => !!a && !!b && a?.toLowerCase() === b.toLowerCase();
|
|
28
|
+
exports.addressEquals = addressEquals;
|
|
29
|
+
const wrapSignatureWith6492 = ({ factoryAddress, factoryCalldata, signature }) => {
|
|
30
|
+
return (0, viem_1.concat)([
|
|
31
|
+
(0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)("address, bytes, bytes"), [
|
|
32
|
+
factoryAddress,
|
|
33
|
+
factoryCalldata,
|
|
34
|
+
signature
|
|
35
|
+
]),
|
|
36
|
+
"0x6492649264926492649264926492649264926492649264926492649264926492"
|
|
37
|
+
]);
|
|
38
|
+
};
|
|
39
|
+
exports.wrapSignatureWith6492 = wrapSignatureWith6492;
|
|
40
|
+
function percentage(partialValue, totalValue) {
|
|
41
|
+
return (100 * partialValue) / totalValue;
|
|
42
|
+
}
|
|
43
|
+
function convertToFactor(percentage) {
|
|
44
|
+
if (percentage) {
|
|
45
|
+
if (percentage < 1 || percentage > 100) {
|
|
46
|
+
throw new Error("The percentage value should be between 1 and 100.");
|
|
47
|
+
}
|
|
48
|
+
const factor = percentage / 100 + 1;
|
|
49
|
+
return factor;
|
|
50
|
+
}
|
|
51
|
+
return 1;
|
|
52
|
+
}
|
|
53
|
+
function makeInstallDataAndHash(accountOwner, modules, domainName = Constants_1.ACCOUNT_DOMAIN_NAME, domainVersion = Constants_1.ACCOUNT_DOMAIN_VERSION) {
|
|
54
|
+
const types = modules.map((module) => BigInt(Types_1.moduleTypeIds[module.type]));
|
|
55
|
+
const initDatas = modules.map((module) => (0, viem_1.toHex)((0, viem_1.concat)([(0, viem_1.toBytes)(BigInt(Types_1.moduleTypeIds[module.type])), module.config])));
|
|
56
|
+
const multiInstallData = (0, viem_1.encodeAbiParameters)([{ type: "uint256[]" }, { type: "bytes[]" }], [types, initDatas]);
|
|
57
|
+
const structHash = (0, viem_1.keccak256)((0, viem_1.encodeAbiParameters)([{ type: "bytes32" }, { type: "address" }, { type: "bytes32" }], [
|
|
58
|
+
Constants_1.MODULE_ENABLE_MODE_TYPE_HASH,
|
|
59
|
+
Constants_1.MOCK_MULTI_MODULE_ADDRESS,
|
|
60
|
+
(0, viem_1.keccak256)(multiInstallData)
|
|
61
|
+
]));
|
|
62
|
+
const hashToSign = _hashTypedData(structHash, domainName, domainVersion, accountOwner);
|
|
63
|
+
return [multiInstallData, hashToSign];
|
|
64
|
+
}
|
|
65
|
+
function _hashTypedData(structHash, name, version, verifyingContract) {
|
|
66
|
+
const DOMAIN_SEPARATOR = (0, viem_1.keccak256)((0, viem_1.encodeAbiParameters)([
|
|
67
|
+
{ type: "bytes32" },
|
|
68
|
+
{ type: "bytes32" },
|
|
69
|
+
{ type: "bytes32" },
|
|
70
|
+
{ type: "address" }
|
|
71
|
+
], [
|
|
72
|
+
(0, viem_1.keccak256)((0, viem_1.stringToBytes)(Constants_1.ACCOUNT_DOMAIN_TYPEHASH)),
|
|
73
|
+
(0, viem_1.keccak256)((0, viem_1.stringToBytes)(name)),
|
|
74
|
+
(0, viem_1.keccak256)((0, viem_1.stringToBytes)(version)),
|
|
75
|
+
verifyingContract
|
|
76
|
+
]));
|
|
77
|
+
return (0, viem_1.keccak256)((0, viem_1.concat)([
|
|
78
|
+
(0, viem_1.stringToBytes)("\x19\x01"),
|
|
79
|
+
(0, viem_1.hexToBytes)(DOMAIN_SEPARATOR),
|
|
80
|
+
(0, viem_1.hexToBytes)(structHash)
|
|
81
|
+
]));
|
|
82
|
+
}
|
|
83
|
+
function getTypesForEIP712Domain({ domain }) {
|
|
84
|
+
return [
|
|
85
|
+
typeof domain?.name === "string" && { name: "name", type: "string" },
|
|
86
|
+
domain?.version && { name: "version", type: "string" },
|
|
87
|
+
typeof domain?.chainId === "number" && {
|
|
88
|
+
name: "chainId",
|
|
89
|
+
type: "uint256"
|
|
90
|
+
},
|
|
91
|
+
domain?.verifyingContract && {
|
|
92
|
+
name: "verifyingContract",
|
|
93
|
+
type: "address"
|
|
94
|
+
},
|
|
95
|
+
domain?.salt && { name: "salt", type: "bytes32" }
|
|
96
|
+
].filter(Boolean);
|
|
97
|
+
}
|
|
98
|
+
const getAccountMeta = async (client, accountAddress) => {
|
|
99
|
+
try {
|
|
100
|
+
const domain = await client.request({
|
|
101
|
+
method: "eth_call",
|
|
102
|
+
params: [
|
|
103
|
+
{
|
|
104
|
+
to: accountAddress,
|
|
105
|
+
data: (0, viem_1.encodeFunctionData)({
|
|
106
|
+
abi: abi_1.EIP1271Abi,
|
|
107
|
+
functionName: "eip712Domain"
|
|
108
|
+
})
|
|
109
|
+
},
|
|
110
|
+
"latest"
|
|
111
|
+
]
|
|
112
|
+
});
|
|
113
|
+
if (domain !== "0x") {
|
|
114
|
+
const decoded = (0, viem_1.decodeFunctionResult)({
|
|
115
|
+
abi: abi_1.EIP1271Abi,
|
|
116
|
+
functionName: "eip712Domain",
|
|
117
|
+
data: domain
|
|
118
|
+
});
|
|
119
|
+
return {
|
|
120
|
+
name: decoded?.[1],
|
|
121
|
+
version: decoded?.[2],
|
|
122
|
+
chainId: decoded?.[3]
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
catch (error) { }
|
|
127
|
+
return {
|
|
128
|
+
name: Constants_1.ACCOUNT_DOMAIN_NAME,
|
|
129
|
+
version: Constants_1.ACCOUNT_DOMAIN_VERSION,
|
|
130
|
+
chainId: client.chain
|
|
131
|
+
? BigInt(client.chain.id)
|
|
132
|
+
: BigInt(await client.extend(viem_1.publicActions).getChainId())
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
exports.getAccountMeta = getAccountMeta;
|
|
136
|
+
const eip712WrapHash = (typedHash, appDomainSeparator) => (0, viem_1.keccak256)((0, viem_1.concat)(["0x1901", appDomainSeparator, typedHash]));
|
|
137
|
+
exports.eip712WrapHash = eip712WrapHash;
|
|
138
|
+
function typeToString(typeDef) {
|
|
139
|
+
return Object.entries(typeDef).map(([key, fields]) => {
|
|
140
|
+
const fieldStrings = (fields ?? [])
|
|
141
|
+
.map((field) => `${field.type} ${field.name}`)
|
|
142
|
+
.join(",");
|
|
143
|
+
return `${key}(${fieldStrings})`;
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function bigIntReplacer(_key, value) {
|
|
147
|
+
return typeof value === "bigint" ? value.toString() : value;
|
|
148
|
+
}
|
|
149
|
+
function numberTo3Bytes(key) {
|
|
150
|
+
const buffer = new Uint8Array(3);
|
|
151
|
+
buffer[0] = Number((key >> 16n) & 0xffn);
|
|
152
|
+
buffer[1] = Number((key >> 8n) & 0xffn);
|
|
153
|
+
buffer[2] = Number(key & 0xffn);
|
|
154
|
+
return buffer;
|
|
155
|
+
}
|
|
156
|
+
function toHexString(byteArray) {
|
|
157
|
+
return Array.from(byteArray)
|
|
158
|
+
.map((byte) => byte.toString(16).padStart(2, "0"))
|
|
159
|
+
.join("");
|
|
160
|
+
}
|
|
161
|
+
const getAccountDomainStructFields = async (publicClient, accountAddress) => {
|
|
162
|
+
const accountDomainStructFields = (await publicClient.readContract({
|
|
163
|
+
address: accountAddress,
|
|
164
|
+
abi: (0, viem_1.parseAbi)([
|
|
165
|
+
"function eip712Domain() public view returns (bytes1 fields, string memory name, string memory version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] memory extensions)"
|
|
166
|
+
]),
|
|
167
|
+
functionName: "eip712Domain"
|
|
168
|
+
}));
|
|
169
|
+
const [, name, version, chainId, verifyingContract, salt] = accountDomainStructFields;
|
|
170
|
+
const params = (0, viem_1.parseAbiParameters)([
|
|
171
|
+
"bytes32",
|
|
172
|
+
"bytes32",
|
|
173
|
+
"uint256",
|
|
174
|
+
"address",
|
|
175
|
+
"bytes32"
|
|
176
|
+
]);
|
|
177
|
+
return (0, viem_1.encodeAbiParameters)(params, [
|
|
178
|
+
(0, viem_1.keccak256)((0, viem_1.toBytes)(name)),
|
|
179
|
+
(0, viem_1.keccak256)((0, viem_1.toBytes)(version)),
|
|
180
|
+
chainId,
|
|
181
|
+
verifyingContract,
|
|
182
|
+
salt
|
|
183
|
+
]);
|
|
184
|
+
};
|
|
185
|
+
exports.getAccountDomainStructFields = getAccountDomainStructFields;
|
|
186
|
+
const inProduction = () => {
|
|
187
|
+
try {
|
|
188
|
+
return process?.env?.environment === "production";
|
|
189
|
+
}
|
|
190
|
+
catch (e) {
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
exports.inProduction = inProduction;
|
|
195
|
+
const playgroundTrue = () => {
|
|
196
|
+
try {
|
|
197
|
+
return process?.env?.RUN_PLAYGROUND === "true";
|
|
198
|
+
}
|
|
199
|
+
catch (e) {
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
exports.playgroundTrue = playgroundTrue;
|
|
204
|
+
const getTenderlyDetails = () => {
|
|
205
|
+
try {
|
|
206
|
+
const accountSlug = process?.env?.TENDERLY_ACCOUNT_SLUG;
|
|
207
|
+
const projectSlug = process?.env?.TENDERLY_PROJECT_SLUG;
|
|
208
|
+
const apiKey = process?.env?.TENDERLY_API_KEY;
|
|
209
|
+
if (!accountSlug || !projectSlug || !apiKey) {
|
|
210
|
+
return null;
|
|
211
|
+
}
|
|
212
|
+
return {
|
|
213
|
+
accountSlug,
|
|
214
|
+
projectSlug,
|
|
215
|
+
apiKey
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
catch (e) {
|
|
219
|
+
return null;
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
exports.getTenderlyDetails = getTenderlyDetails;
|
|
223
|
+
const safeMultiplier = (bI, multiplier) => BigInt(Math.round(Number(bI) * multiplier));
|
|
224
|
+
exports.safeMultiplier = safeMultiplier;
|
|
225
|
+
const getAllowance = async (client, owner, tokenAddress, grantee = Constants_1.STARTALE_TOKEN_PAYMASTER) => {
|
|
226
|
+
const approval = await client.readContract({
|
|
227
|
+
address: tokenAddress,
|
|
228
|
+
abi: viem_1.erc20Abi,
|
|
229
|
+
functionName: "allowance",
|
|
230
|
+
args: [owner, grantee]
|
|
231
|
+
});
|
|
232
|
+
return approval;
|
|
233
|
+
};
|
|
234
|
+
exports.getAllowance = getAllowance;
|
|
235
|
+
function parseRequestArguments(input) {
|
|
236
|
+
const fieldsToOmit = [
|
|
237
|
+
"callGasLimit",
|
|
238
|
+
"preVerificationGas",
|
|
239
|
+
"maxFeePerGas",
|
|
240
|
+
"maxPriorityFeePerGas",
|
|
241
|
+
"paymasterAndData",
|
|
242
|
+
"verificationGasLimit"
|
|
243
|
+
];
|
|
244
|
+
const argsString = input.slice(1).join("");
|
|
245
|
+
const lines = argsString.split("\n").filter((line) => line.trim());
|
|
246
|
+
const result = lines.reduce((acc, line) => {
|
|
247
|
+
const [key, value] = line.split(":").map((s) => s.trim());
|
|
248
|
+
const cleanKey = key.trim();
|
|
249
|
+
const cleanValue = value.replace("gwei", "").trim();
|
|
250
|
+
if (fieldsToOmit.includes(cleanKey)) {
|
|
251
|
+
return acc;
|
|
252
|
+
}
|
|
253
|
+
acc[cleanKey] = cleanValue;
|
|
254
|
+
return acc;
|
|
255
|
+
}, {});
|
|
256
|
+
return result;
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=Utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../../src/sdk/account/utils/Utils.ts"],"names":[],"mappings":";;;AAqHA,gCAEC;AASD,0CAaC;AAWD,wDAmCC;AAED,wCA8BC;AAED,0DAgBC;AAgED,oCAOC;AAGD,wCAEC;AAED,wCAOC;AAED,kCAIC;AA8GD,sDAuCC;AA7dD,+BAsBa;AACb,6DAOsC;AACtC,6CAAgD;AAChD,qDAIkC;AAS3B,MAAM,iBAAiB,GAAG,CAAC,KAAc,EAAsB,EAAE;IACtE,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAA;AAC9C,CAAC,CAAA;AAFY,QAAA,iBAAiB,qBAE7B;AAQM,MAAM,aAAa,GAAG,CAAC,GAAW,EAAW,EAAE;IACpD,MAAM,KAAK,GAAG,oCAAoC,CAAA;IAClD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC,CAAA;AAHY,QAAA,aAAa,iBAGzB;AASM,MAAM,aAAa,GAAG,CAAC,CAAU,EAAE,CAAU,EAAW,EAAE,CAC/D,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,WAAW,EAAE,CAAA;AADvC,QAAA,aAAa,iBAC0B;AAoB7C,MAAM,qBAAqB,GAAG,CAAC,EACpC,cAAc,EACd,eAAe,EACf,SAAS,EACU,EAAQ,EAAE;IAQ7B,OAAO,IAAA,aAAM,EAAC;QACZ,IAAA,0BAAmB,EAAC,IA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EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;QAEpE,IAAI,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YACpC,OAAO,GAAG,CAAA;QACZ,CAAC;QAED,GAAG,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAA;QAC1B,OAAO,GAAG,CAAA;IACZ,CAAC,EACD,EAAqC,CACtC,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addressToEmptyAccount = addressToEmptyAccount;
|
|
4
|
+
const accounts_1 = require("viem/accounts");
|
|
5
|
+
function addressToEmptyAccount(address) {
|
|
6
|
+
const account = (0, accounts_1.toAccount)({
|
|
7
|
+
address,
|
|
8
|
+
async signMessage() {
|
|
9
|
+
throw new Error("Method not supported");
|
|
10
|
+
},
|
|
11
|
+
async signTransaction(_transaction) {
|
|
12
|
+
throw new Error("Method not supported");
|
|
13
|
+
},
|
|
14
|
+
async signTypedData(_typedData) {
|
|
15
|
+
throw new Error("Method not supported");
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return {
|
|
19
|
+
...account,
|
|
20
|
+
publicKey: "0x",
|
|
21
|
+
source: "empty"
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=addressToEmptyAccount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addressToEmptyAccount.js","sourceRoot":"","sources":["../../../../src/sdk/account/utils/addressToEmptyAccount.ts"],"names":[],"mappings":";;AAIA,sDAmBC;AAtBD,4CAAyC;AAGzC,SAAgB,qBAAqB,CAAC,OAAgB;IACpD,MAAM,OAAO,GAAG,IAAA,oBAAS,EAAC;QACxB,OAAO;QACP,KAAK,CAAC,WAAW;YACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAA;QACzC,CAAC;QACD,KAAK,CAAC,eAAe,CAAC,YAAY;YAChC,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAA;QACzC,CAAC;QACD,KAAK,CAAC,aAAa,CAAC,UAAU;YAC5B,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAA;QACzC,CAAC;KACF,CAAC,CAAA;IAEF,OAAO;QACL,GAAG,OAAO;QACV,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,OAAO;KAChB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.contractSimulation = contractSimulation;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const constants_1 = require("../../constants/index.js");
|
|
6
|
+
const getChain_1 = require("./getChain.js");
|
|
7
|
+
const tenderlySimulation_1 = require("./tenderlySimulation.js");
|
|
8
|
+
async function contractSimulation(partialUserOp, chainId) {
|
|
9
|
+
const packed = (0, tenderlySimulation_1.getSimulationUserOp)(partialUserOp);
|
|
10
|
+
return (0, viem_1.createPublicClient)({
|
|
11
|
+
chain: (0, getChain_1.getChain)(chainId),
|
|
12
|
+
transport: (0, viem_1.http)()
|
|
13
|
+
}).simulateContract({
|
|
14
|
+
account: partialUserOp.sender,
|
|
15
|
+
address: constants_1.ENTRY_POINT_ADDRESS,
|
|
16
|
+
abi: constants_1.EntrypointAbi,
|
|
17
|
+
functionName: "handleOps",
|
|
18
|
+
args: [[packed], packed.sender],
|
|
19
|
+
stateOverride: [
|
|
20
|
+
{
|
|
21
|
+
address: partialUserOp.sender,
|
|
22
|
+
balance: (0, viem_1.parseEther)("1000")
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=contractSimulation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contractSimulation.js","sourceRoot":"","sources":["../../../../src/sdk/account/utils/contractSimulation.ts"],"names":[],"mappings":";;AA8BA,gDAsBC;AApDD,+BAAyE;AACzE,+CAAoE;AACpE,yCAAqC;AACrC,6DAA0D;AA2BnD,KAAK,UAAU,kBAAkB,CACtC,aAA+B,EAC/B,OAAe;IAEf,MAAM,MAAM,GAAG,IAAA,wCAAmB,EAAC,aAAa,CAAC,CAAA;IAEjD,OAAO,IAAA,yBAAkB,EAAC;QACxB,KAAK,EAAE,IAAA,mBAAQ,EAAC,OAAO,CAAC;QACxB,SAAS,EAAE,IAAA,WAAI,GAAE;KAClB,CAAC,CAAC,gBAAgB,CAAC;QAClB,OAAO,EAAE,aAAa,CAAC,MAAiB;QACxC,OAAO,EAAE,+BAAmB;QAC5B,GAAG,EAAE,yBAAa;QAClB,YAAY,EAAE,WAAW;QACzB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC;QAC/B,aAAa,EAAE;YACb;gBACE,OAAO,EAAE,aAAa,CAAC,MAAiB;gBACxC,OAAO,EAAE,IAAA,iBAAU,EAAC,MAAM,CAAC;aAC5B;SACF;KACF,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deepHexlify = deepHexlify;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
function deepHexlify(obj) {
|
|
6
|
+
if (typeof obj === "function") {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
if (obj == null || typeof obj === "string" || typeof obj === "boolean") {
|
|
10
|
+
return obj;
|
|
11
|
+
}
|
|
12
|
+
if (typeof obj === "bigint") {
|
|
13
|
+
return (0, viem_1.toHex)(obj);
|
|
14
|
+
}
|
|
15
|
+
if (obj._isBigNumber != null || typeof obj !== "object") {
|
|
16
|
+
return (0, viem_1.toHex)(obj).replace(/^0x0/, "0x");
|
|
17
|
+
}
|
|
18
|
+
if (Array.isArray(obj)) {
|
|
19
|
+
return obj.map((member) => deepHexlify(member));
|
|
20
|
+
}
|
|
21
|
+
return Object.keys(obj).reduce((set, key) => {
|
|
22
|
+
set[key] = deepHexlify(obj[key]);
|
|
23
|
+
return set;
|
|
24
|
+
}, {});
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=deepHexlify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepHexlify.js","sourceRoot":"","sources":["../../../../src/sdk/account/utils/deepHexlify.ts"],"names":[],"mappings":";;AAyCA,kCA0BC;AAnED,+BAA4B;AAyC5B,SAAgB,WAAW,CAAC,GAAY;IACtC,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;QAC9B,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,IAAI,GAAG,IAAI,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,SAAS,EAAE,CAAC;QACvE,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,IAAA,YAAK,EAAC,GAAG,CAAC,CAAA;IACnB,CAAC;IAED,IAAI,GAAG,CAAC,YAAY,IAAI,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACxD,OAAO,IAAA,YAAK,EAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;IACzC,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAA;IACjD,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAE5B,CAAC,GAAQ,EAAE,GAAW,EAAE,EAAE;QACxB,GAAG,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;QAChC,OAAO,GAAG,CAAA;IACZ,CAAC,EACD,EAAE,CACH,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEip7702Authorization = exports.isEip7702 = void 0;
|
|
4
|
+
const constants_1 = require("../../constants/index.js");
|
|
5
|
+
const isEip7702 = async (publicClient, address) => {
|
|
6
|
+
const code = await publicClient.getCode({ address });
|
|
7
|
+
return (!!code &&
|
|
8
|
+
code
|
|
9
|
+
?.toLowerCase()
|
|
10
|
+
.includes(constants_1.STARTALE_7702_DELEGATION_ADDRESS.substring(2).toLowerCase()));
|
|
11
|
+
};
|
|
12
|
+
exports.isEip7702 = isEip7702;
|
|
13
|
+
const getEip7702Authorization = async (walletClient, delegationAddress) => {
|
|
14
|
+
const contractAddress = delegationAddress || constants_1.STARTALE_7702_DELEGATION_ADDRESS;
|
|
15
|
+
const authorization = await walletClient.signAuthorization({
|
|
16
|
+
address: contractAddress
|
|
17
|
+
});
|
|
18
|
+
return authorization;
|
|
19
|
+
};
|
|
20
|
+
exports.getEip7702Authorization = getEip7702Authorization;
|
|
21
|
+
//# sourceMappingURL=eip7702Utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eip7702Utils.js","sourceRoot":"","sources":["../../../../src/sdk/account/utils/eip7702Utils.ts"],"names":[],"mappings":";;;AAUA,+CAAkE;AAE3D,MAAM,SAAS,GAAG,KAAK,EAC5B,YAA0B,EAC1B,OAAgB,EAChB,EAAE;IACF,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,CAAA;IACpD,OAAO,CACL,CAAC,CAAC,IAAI;QACN,IAAI;YACF,EAAE,WAAW,EAAE;aACd,QAAQ,CAAC,4CAAgC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CACzE,CAAA;AACH,CAAC,CAAA;AAXY,QAAA,SAAS,aAWrB;AAEM,MAAM,uBAAuB,GAAG,KAAK,EAC1C,YAA4E,EAC5E,iBAA2B,EACW,EAAE;IACxC,MAAM,eAAe,GAAG,iBAAiB,IAAI,4CAAgC,CAAA;IAC7E,MAAM,aAAa,GAAG,MAAM,YAAY,CAAC,iBAAiB,CAAC;QACzD,OAAO,EAAE,eAAe;KACzB,CAAC,CAAA;IACF,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA;AATY,QAAA,uBAAuB,2BASnC"}
|