@alchemy/smart-accounts 0.0.0-alpha.0
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/dist/esm/errors/EntityIdOverrideError.d.ts +11 -0
- package/dist/esm/errors/EntityIdOverrideError.js +19 -0
- package/dist/esm/errors/EntityIdOverrideError.js.map +1 -0
- package/dist/esm/errors/InvalidDeferredActionNonceError.d.ts +11 -0
- package/dist/esm/errors/InvalidDeferredActionNonceError.js +19 -0
- package/dist/esm/errors/InvalidDeferredActionNonceError.js.map +1 -0
- package/dist/esm/errors/InvalidEntityIdError.d.ts +13 -0
- package/dist/esm/errors/InvalidEntityIdError.js +21 -0
- package/dist/esm/errors/InvalidEntityIdError.js.map +1 -0
- package/dist/esm/errors/InvalidNonceKeyError.d.ts +13 -0
- package/dist/esm/errors/InvalidNonceKeyError.js +21 -0
- package/dist/esm/errors/InvalidNonceKeyError.js.map +1 -0
- package/dist/esm/errors/InvalidOwnerError.d.ts +13 -0
- package/dist/esm/errors/InvalidOwnerError.js +21 -0
- package/dist/esm/errors/InvalidOwnerError.js.map +1 -0
- package/dist/esm/errors/permissionBuilderErrors.d.ts +150 -0
- package/dist/esm/errors/permissionBuilderErrors.js +233 -0
- package/dist/esm/errors/permissionBuilderErrors.js.map +1 -0
- package/dist/esm/index.d.ts +59 -0
- package/dist/esm/index.js +40 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/light-account/abis/LightAccountAbi_v1.d.ts +532 -0
- package/dist/esm/light-account/abis/LightAccountAbi_v1.js +379 -0
- package/dist/esm/light-account/abis/LightAccountAbi_v1.js.map +1 -0
- package/dist/esm/light-account/abis/LightAccountAbi_v2.d.ts +491 -0
- package/dist/esm/light-account/abis/LightAccountAbi_v2.js +355 -0
- package/dist/esm/light-account/abis/LightAccountAbi_v2.js.map +1 -0
- package/dist/esm/light-account/abis/LightAccountFactoryAbi_v1.d.ts +55 -0
- package/dist/esm/light-account/abis/LightAccountFactoryAbi_v1.js +75 -0
- package/dist/esm/light-account/abis/LightAccountFactoryAbi_v1.js.map +1 -0
- package/dist/esm/light-account/abis/LightAccountFactoryAbi_v2.d.ts +256 -0
- package/dist/esm/light-account/abis/LightAccountFactoryAbi_v2.js +210 -0
- package/dist/esm/light-account/abis/LightAccountFactoryAbi_v2.js.map +1 -0
- package/dist/esm/light-account/abis/MultiOwnerLightAccountAbi.d.ts +507 -0
- package/dist/esm/light-account/abis/MultiOwnerLightAccountAbi.js +372 -0
- package/dist/esm/light-account/abis/MultiOwnerLightAccountAbi.js.map +1 -0
- package/dist/esm/light-account/abis/MultiOwnerLightAccountFactoryAbi.d.ts +286 -0
- package/dist/esm/light-account/abis/MultiOwnerLightAccountFactoryAbi.js +229 -0
- package/dist/esm/light-account/abis/MultiOwnerLightAccountFactoryAbi.js.map +1 -0
- package/dist/esm/light-account/abis/OZ_ERC1967Proxy.d.ts +13 -0
- package/dist/esm/light-account/abis/OZ_ERC1967Proxy.js +20 -0
- package/dist/esm/light-account/abis/OZ_ERC1967Proxy.js.map +1 -0
- package/dist/esm/light-account/accounts/account.d.ts +22 -0
- package/dist/esm/light-account/accounts/account.js +86 -0
- package/dist/esm/light-account/accounts/account.js.map +1 -0
- package/dist/esm/light-account/accounts/base.d.ts +28 -0
- package/dist/esm/light-account/accounts/base.js +170 -0
- package/dist/esm/light-account/accounts/base.js.map +1 -0
- package/dist/esm/light-account/accounts/calldataCodec.d.ts +3 -0
- package/dist/esm/light-account/accounts/calldataCodec.js +74 -0
- package/dist/esm/light-account/accounts/calldataCodec.js.map +1 -0
- package/dist/esm/light-account/accounts/multi-owner-account.d.ts +20 -0
- package/dist/esm/light-account/accounts/multi-owner-account.js +79 -0
- package/dist/esm/light-account/accounts/multi-owner-account.js.map +1 -0
- package/dist/esm/light-account/decorators/multiOwner.d.ts +17 -0
- package/dist/esm/light-account/decorators/multiOwner.js +38 -0
- package/dist/esm/light-account/decorators/multiOwner.js.map +1 -0
- package/dist/esm/light-account/decorators/singleOwner.d.ts +16 -0
- package/dist/esm/light-account/decorators/singleOwner.js +35 -0
- package/dist/esm/light-account/decorators/singleOwner.js.map +1 -0
- package/dist/esm/light-account/lightAccountStaticImpl.d.ts +24 -0
- package/dist/esm/light-account/lightAccountStaticImpl.js +112 -0
- package/dist/esm/light-account/lightAccountStaticImpl.js.map +1 -0
- package/dist/esm/light-account/predictAddress.d.ts +35 -0
- package/dist/esm/light-account/predictAddress.js +113 -0
- package/dist/esm/light-account/predictAddress.js.map +1 -0
- package/dist/esm/light-account/registry.d.ts +7115 -0
- package/dist/esm/light-account/registry.js +18 -0
- package/dist/esm/light-account/registry.js.map +1 -0
- package/dist/esm/light-account/utils.d.ts +1454 -0
- package/dist/esm/light-account/utils.js +65 -0
- package/dist/esm/light-account/utils.js.map +1 -0
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.js +8 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/ma-v1/abis/IStandardExecutor.d.ts +50 -0
- package/dist/esm/ma-v1/abis/IStandardExecutor.js +32 -0
- package/dist/esm/ma-v1/abis/IStandardExecutor.js.map +1 -0
- package/dist/esm/ma-v1/abis/MultiOwnerModularAccountFactory.d.ts +234 -0
- package/dist/esm/ma-v1/abis/MultiOwnerModularAccountFactory.js +191 -0
- package/dist/esm/ma-v1/abis/MultiOwnerModularAccountFactory.js.map +1 -0
- package/dist/esm/ma-v1/abis/MultiOwnerPlugin.d.ts +698 -0
- package/dist/esm/ma-v1/abis/MultiOwnerPlugin.js +529 -0
- package/dist/esm/ma-v1/abis/MultiOwnerPlugin.js.map +1 -0
- package/dist/esm/ma-v1/abis/MultiOwnerPluginExecutionFunction.d.ts +67 -0
- package/dist/esm/ma-v1/abis/MultiOwnerPluginExecutionFunction.js +38 -0
- package/dist/esm/ma-v1/abis/MultiOwnerPluginExecutionFunction.js.map +1 -0
- package/dist/esm/ma-v1/abis/UpgradeableModularAccount.d.ts +880 -0
- package/dist/esm/ma-v1/abis/UpgradeableModularAccount.js +646 -0
- package/dist/esm/ma-v1/abis/UpgradeableModularAccount.js.map +1 -0
- package/dist/esm/ma-v1/account.d.ts +16 -0
- package/dist/esm/ma-v1/account.js +17 -0
- package/dist/esm/ma-v1/account.js.map +1 -0
- package/dist/esm/ma-v1/accounts/base.d.ts +29 -0
- package/dist/esm/ma-v1/accounts/base.js +150 -0
- package/dist/esm/ma-v1/accounts/base.js.map +1 -0
- package/dist/esm/ma-v1/accounts/multi-owner-account.d.ts +22 -0
- package/dist/esm/ma-v1/accounts/multi-owner-account.js +101 -0
- package/dist/esm/ma-v1/accounts/multi-owner-account.js.map +1 -0
- package/dist/esm/ma-v1/decorators/multiOwner.d.ts +17 -0
- package/dist/esm/ma-v1/decorators/multiOwner.js +38 -0
- package/dist/esm/ma-v1/decorators/multiOwner.js.map +1 -0
- package/dist/esm/ma-v1/mav1StaticImpl.d.ts +15 -0
- package/dist/esm/ma-v1/mav1StaticImpl.js +38 -0
- package/dist/esm/ma-v1/mav1StaticImpl.js.map +1 -0
- package/dist/esm/ma-v1/predictAddress.d.ts +28 -0
- package/dist/esm/ma-v1/predictAddress.js +51 -0
- package/dist/esm/ma-v1/predictAddress.js.map +1 -0
- package/dist/esm/ma-v2/abis/accountFactoryAbi.d.ts +348 -0
- package/dist/esm/ma-v2/abis/accountFactoryAbi.js +645 -0
- package/dist/esm/ma-v2/abis/accountFactoryAbi.js.map +1 -0
- package/dist/esm/ma-v2/abis/entityIdAndNonceReader.d.ts +9 -0
- package/dist/esm/ma-v2/abis/entityIdAndNonceReader.js +24 -0
- package/dist/esm/ma-v2/abis/entityIdAndNonceReader.js.map +1 -0
- package/dist/esm/ma-v2/abis/modularAccountAbi.d.ts +954 -0
- package/dist/esm/ma-v2/abis/modularAccountAbi.js +1242 -0
- package/dist/esm/ma-v2/abis/modularAccountAbi.js.map +1 -0
- package/dist/esm/ma-v2/abis/semiModularAccountBytecodeAbi.d.ts +991 -0
- package/dist/esm/ma-v2/abis/semiModularAccountBytecodeAbi.js +1289 -0
- package/dist/esm/ma-v2/abis/semiModularAccountBytecodeAbi.js.map +1 -0
- package/dist/esm/ma-v2/abis/semiModularAccountStorageAbi.d.ts +1001 -0
- package/dist/esm/ma-v2/abis/semiModularAccountStorageAbi.js +1302 -0
- package/dist/esm/ma-v2/abis/semiModularAccountStorageAbi.js.map +1 -0
- package/dist/esm/ma-v2/abis/webAuthnFactoryAbi.d.ts +330 -0
- package/dist/esm/ma-v2/abis/webAuthnFactoryAbi.js +260 -0
- package/dist/esm/ma-v2/abis/webAuthnFactoryAbi.js.map +1 -0
- package/dist/esm/ma-v2/accounts/account.d.ts +32 -0
- package/dist/esm/ma-v2/accounts/account.js +134 -0
- package/dist/esm/ma-v2/accounts/account.js.map +1 -0
- package/dist/esm/ma-v2/accounts/base.d.ts +40 -0
- package/dist/esm/ma-v2/accounts/base.js +371 -0
- package/dist/esm/ma-v2/accounts/base.js.map +1 -0
- package/dist/esm/ma-v2/decorators/deferralActions.d.ts +51 -0
- package/dist/esm/ma-v2/decorators/deferralActions.js +100 -0
- package/dist/esm/ma-v2/decorators/deferralActions.js.map +1 -0
- package/dist/esm/ma-v2/decorators/installValidation.d.ts +71 -0
- package/dist/esm/ma-v2/decorators/installValidation.js +137 -0
- package/dist/esm/ma-v2/decorators/installValidation.js.map +1 -0
- package/dist/esm/ma-v2/mav2StaticImpl.d.ts +37 -0
- package/dist/esm/ma-v2/mav2StaticImpl.js +88 -0
- package/dist/esm/ma-v2/mav2StaticImpl.js.map +1 -0
- package/dist/esm/ma-v2/modules/allowlist-module/abis/allowlistModuleAbi.d.ts +556 -0
- package/dist/esm/ma-v2/modules/allowlist-module/abis/allowlistModuleAbi.js +716 -0
- package/dist/esm/ma-v2/modules/allowlist-module/abis/allowlistModuleAbi.js.map +1 -0
- package/dist/esm/ma-v2/modules/allowlist-module/module.d.ts +593 -0
- package/dist/esm/ma-v2/modules/allowlist-module/module.js +70 -0
- package/dist/esm/ma-v2/modules/allowlist-module/module.js.map +1 -0
- package/dist/esm/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModuleAbi.d.ts +312 -0
- package/dist/esm/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModuleAbi.js +404 -0
- package/dist/esm/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModuleAbi.js.map +1 -0
- package/dist/esm/ma-v2/modules/native-token-limit-module/module.d.ts +322 -0
- package/dist/esm/ma-v2/modules/native-token-limit-module/module.js +14 -0
- package/dist/esm/ma-v2/modules/native-token-limit-module/module.js.map +1 -0
- package/dist/esm/ma-v2/modules/paymaster-guard-module/abis/paymasterGuardModuleAbi.d.ts +186 -0
- package/dist/esm/ma-v2/modules/paymaster-guard-module/abis/paymasterGuardModuleAbi.js +242 -0
- package/dist/esm/ma-v2/modules/paymaster-guard-module/abis/paymasterGuardModuleAbi.js.map +1 -0
- package/dist/esm/ma-v2/modules/paymaster-guard-module/module.d.ts +196 -0
- package/dist/esm/ma-v2/modules/paymaster-guard-module/module.js +25 -0
- package/dist/esm/ma-v2/modules/paymaster-guard-module/module.js.map +1 -0
- package/dist/esm/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModuleAbi.d.ts +45 -0
- package/dist/esm/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModuleAbi.js +331 -0
- package/dist/esm/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModuleAbi.js.map +1 -0
- package/dist/esm/ma-v2/modules/single-signer-validation/module.d.ts +10 -0
- package/dist/esm/ma-v2/modules/single-signer-validation/module.js +16 -0
- package/dist/esm/ma-v2/modules/single-signer-validation/module.js.map +1 -0
- package/dist/esm/ma-v2/modules/time-range-module/abis/timeRangeModuleAbi.d.ts +229 -0
- package/dist/esm/ma-v2/modules/time-range-module/abis/timeRangeModuleAbi.js +296 -0
- package/dist/esm/ma-v2/modules/time-range-module/abis/timeRangeModuleAbi.js.map +1 -0
- package/dist/esm/ma-v2/modules/time-range-module/module.d.ts +254 -0
- package/dist/esm/ma-v2/modules/time-range-module/module.js +62 -0
- package/dist/esm/ma-v2/modules/time-range-module/module.js.map +1 -0
- package/dist/esm/ma-v2/modules/webauthn-validation/abis/webauthnValidationAbi.d.ts +287 -0
- package/dist/esm/ma-v2/modules/webauthn-validation/abis/webauthnValidationAbi.js +374 -0
- package/dist/esm/ma-v2/modules/webauthn-validation/abis/webauthnValidationAbi.js.map +1 -0
- package/dist/esm/ma-v2/modules/webauthn-validation/module.d.ts +11 -0
- package/dist/esm/ma-v2/modules/webauthn-validation/module.js +16 -0
- package/dist/esm/ma-v2/modules/webauthn-validation/module.js.map +1 -0
- package/dist/esm/ma-v2/permissionBuilder.d.ts +158 -0
- package/dist/esm/ma-v2/permissionBuilder.js +557 -0
- package/dist/esm/ma-v2/permissionBuilder.js.map +1 -0
- package/dist/esm/ma-v2/predictAddress.d.ts +37 -0
- package/dist/esm/ma-v2/predictAddress.js +73 -0
- package/dist/esm/ma-v2/predictAddress.js.map +1 -0
- package/dist/esm/ma-v2/types.d.ts +57 -0
- package/dist/esm/ma-v2/types.js +9 -0
- package/dist/esm/ma-v2/types.js.map +1 -0
- package/dist/esm/ma-v2/utils/account.d.ts +85 -0
- package/dist/esm/ma-v2/utils/account.js +96 -0
- package/dist/esm/ma-v2/utils/account.js.map +1 -0
- package/dist/esm/ma-v2/utils/deferredActions.d.ts +29 -0
- package/dist/esm/ma-v2/utils/deferredActions.js +38 -0
- package/dist/esm/ma-v2/utils/deferredActions.js.map +1 -0
- package/dist/esm/ma-v2/utils/hooks.d.ts +55 -0
- package/dist/esm/ma-v2/utils/hooks.js +78 -0
- package/dist/esm/ma-v2/utils/hooks.js.map +1 -0
- package/dist/esm/ma-v2/utils/signature.d.ts +63 -0
- package/dist/esm/ma-v2/utils/signature.js +84 -0
- package/dist/esm/ma-v2/utils/signature.js.map +1 -0
- package/dist/esm/test-utils/getAccountAddressViaEntryPoint.d.ts +18 -0
- package/dist/esm/test-utils/getAccountAddressViaEntryPoint.js +31 -0
- package/dist/esm/test-utils/getAccountAddressViaEntryPoint.js.map +1 -0
- package/dist/esm/types.d.ts +30 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils.d.ts +6 -0
- package/dist/esm/utils.js +52 -0
- package/dist/esm/utils.js.map +1 -0
- package/dist/esm/version.d.ts +1 -0
- package/dist/esm/version.js +4 -0
- package/dist/esm/version.js.map +1 -0
- package/dist/types/errors/EntityIdOverrideError.d.ts +12 -0
- package/dist/types/errors/EntityIdOverrideError.d.ts.map +1 -0
- package/dist/types/errors/InvalidDeferredActionNonceError.d.ts +12 -0
- package/dist/types/errors/InvalidDeferredActionNonceError.d.ts.map +1 -0
- package/dist/types/errors/InvalidEntityIdError.d.ts +14 -0
- package/dist/types/errors/InvalidEntityIdError.d.ts.map +1 -0
- package/dist/types/errors/InvalidNonceKeyError.d.ts +14 -0
- package/dist/types/errors/InvalidNonceKeyError.d.ts.map +1 -0
- package/dist/types/errors/InvalidOwnerError.d.ts +14 -0
- package/dist/types/errors/InvalidOwnerError.d.ts.map +1 -0
- package/dist/types/errors/permissionBuilderErrors.d.ts +151 -0
- package/dist/types/errors/permissionBuilderErrors.d.ts.map +1 -0
- package/dist/types/index.d.ts +60 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/light-account/abis/LightAccountAbi_v1.d.ts +533 -0
- package/dist/types/light-account/abis/LightAccountAbi_v1.d.ts.map +1 -0
- package/dist/types/light-account/abis/LightAccountAbi_v2.d.ts +492 -0
- package/dist/types/light-account/abis/LightAccountAbi_v2.d.ts.map +1 -0
- package/dist/types/light-account/abis/LightAccountFactoryAbi_v1.d.ts +56 -0
- package/dist/types/light-account/abis/LightAccountFactoryAbi_v1.d.ts.map +1 -0
- package/dist/types/light-account/abis/LightAccountFactoryAbi_v2.d.ts +257 -0
- package/dist/types/light-account/abis/LightAccountFactoryAbi_v2.d.ts.map +1 -0
- package/dist/types/light-account/abis/MultiOwnerLightAccountAbi.d.ts +508 -0
- package/dist/types/light-account/abis/MultiOwnerLightAccountAbi.d.ts.map +1 -0
- package/dist/types/light-account/abis/MultiOwnerLightAccountFactoryAbi.d.ts +287 -0
- package/dist/types/light-account/abis/MultiOwnerLightAccountFactoryAbi.d.ts.map +1 -0
- package/dist/types/light-account/abis/OZ_ERC1967Proxy.d.ts +14 -0
- package/dist/types/light-account/abis/OZ_ERC1967Proxy.d.ts.map +1 -0
- package/dist/types/light-account/accounts/account.d.ts +23 -0
- package/dist/types/light-account/accounts/account.d.ts.map +1 -0
- package/dist/types/light-account/accounts/base.d.ts +29 -0
- package/dist/types/light-account/accounts/base.d.ts.map +1 -0
- package/dist/types/light-account/accounts/calldataCodec.d.ts +4 -0
- package/dist/types/light-account/accounts/calldataCodec.d.ts.map +1 -0
- package/dist/types/light-account/accounts/multi-owner-account.d.ts +21 -0
- package/dist/types/light-account/accounts/multi-owner-account.d.ts.map +1 -0
- package/dist/types/light-account/decorators/multiOwner.d.ts +18 -0
- package/dist/types/light-account/decorators/multiOwner.d.ts.map +1 -0
- package/dist/types/light-account/decorators/singleOwner.d.ts +17 -0
- package/dist/types/light-account/decorators/singleOwner.d.ts.map +1 -0
- package/dist/types/light-account/lightAccountStaticImpl.d.ts +25 -0
- package/dist/types/light-account/lightAccountStaticImpl.d.ts.map +1 -0
- package/dist/types/light-account/predictAddress.d.ts +36 -0
- package/dist/types/light-account/predictAddress.d.ts.map +1 -0
- package/dist/types/light-account/registry.d.ts +7116 -0
- package/dist/types/light-account/registry.d.ts.map +1 -0
- package/dist/types/light-account/utils.d.ts +1455 -0
- package/dist/types/light-account/utils.d.ts.map +1 -0
- package/dist/types/logger.d.ts +3 -0
- package/dist/types/logger.d.ts.map +1 -0
- package/dist/types/ma-v1/abis/IStandardExecutor.d.ts +51 -0
- package/dist/types/ma-v1/abis/IStandardExecutor.d.ts.map +1 -0
- package/dist/types/ma-v1/abis/MultiOwnerModularAccountFactory.d.ts +235 -0
- package/dist/types/ma-v1/abis/MultiOwnerModularAccountFactory.d.ts.map +1 -0
- package/dist/types/ma-v1/abis/MultiOwnerPlugin.d.ts +699 -0
- package/dist/types/ma-v1/abis/MultiOwnerPlugin.d.ts.map +1 -0
- package/dist/types/ma-v1/abis/MultiOwnerPluginExecutionFunction.d.ts +68 -0
- package/dist/types/ma-v1/abis/MultiOwnerPluginExecutionFunction.d.ts.map +1 -0
- package/dist/types/ma-v1/abis/UpgradeableModularAccount.d.ts +881 -0
- package/dist/types/ma-v1/abis/UpgradeableModularAccount.d.ts.map +1 -0
- package/dist/types/ma-v1/account.d.ts +17 -0
- package/dist/types/ma-v1/account.d.ts.map +1 -0
- package/dist/types/ma-v1/accounts/base.d.ts +30 -0
- package/dist/types/ma-v1/accounts/base.d.ts.map +1 -0
- package/dist/types/ma-v1/accounts/multi-owner-account.d.ts +23 -0
- package/dist/types/ma-v1/accounts/multi-owner-account.d.ts.map +1 -0
- package/dist/types/ma-v1/decorators/multiOwner.d.ts +18 -0
- package/dist/types/ma-v1/decorators/multiOwner.d.ts.map +1 -0
- package/dist/types/ma-v1/mav1StaticImpl.d.ts +16 -0
- package/dist/types/ma-v1/mav1StaticImpl.d.ts.map +1 -0
- package/dist/types/ma-v1/predictAddress.d.ts +29 -0
- package/dist/types/ma-v1/predictAddress.d.ts.map +1 -0
- package/dist/types/ma-v2/abis/accountFactoryAbi.d.ts +349 -0
- package/dist/types/ma-v2/abis/accountFactoryAbi.d.ts.map +1 -0
- package/dist/types/ma-v2/abis/entityIdAndNonceReader.d.ts +10 -0
- package/dist/types/ma-v2/abis/entityIdAndNonceReader.d.ts.map +1 -0
- package/dist/types/ma-v2/abis/modularAccountAbi.d.ts +955 -0
- package/dist/types/ma-v2/abis/modularAccountAbi.d.ts.map +1 -0
- package/dist/types/ma-v2/abis/semiModularAccountBytecodeAbi.d.ts +992 -0
- package/dist/types/ma-v2/abis/semiModularAccountBytecodeAbi.d.ts.map +1 -0
- package/dist/types/ma-v2/abis/semiModularAccountStorageAbi.d.ts +1002 -0
- package/dist/types/ma-v2/abis/semiModularAccountStorageAbi.d.ts.map +1 -0
- package/dist/types/ma-v2/abis/webAuthnFactoryAbi.d.ts +331 -0
- package/dist/types/ma-v2/abis/webAuthnFactoryAbi.d.ts.map +1 -0
- package/dist/types/ma-v2/accounts/account.d.ts +33 -0
- package/dist/types/ma-v2/accounts/account.d.ts.map +1 -0
- package/dist/types/ma-v2/accounts/base.d.ts +41 -0
- package/dist/types/ma-v2/accounts/base.d.ts.map +1 -0
- package/dist/types/ma-v2/decorators/deferralActions.d.ts +52 -0
- package/dist/types/ma-v2/decorators/deferralActions.d.ts.map +1 -0
- package/dist/types/ma-v2/decorators/installValidation.d.ts +72 -0
- package/dist/types/ma-v2/decorators/installValidation.d.ts.map +1 -0
- package/dist/types/ma-v2/mav2StaticImpl.d.ts +38 -0
- package/dist/types/ma-v2/mav2StaticImpl.d.ts.map +1 -0
- package/dist/types/ma-v2/modules/allowlist-module/abis/allowlistModuleAbi.d.ts +557 -0
- package/dist/types/ma-v2/modules/allowlist-module/abis/allowlistModuleAbi.d.ts.map +1 -0
- package/dist/types/ma-v2/modules/allowlist-module/module.d.ts +594 -0
- package/dist/types/ma-v2/modules/allowlist-module/module.d.ts.map +1 -0
- package/dist/types/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModuleAbi.d.ts +313 -0
- package/dist/types/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModuleAbi.d.ts.map +1 -0
- package/dist/types/ma-v2/modules/native-token-limit-module/module.d.ts +323 -0
- package/dist/types/ma-v2/modules/native-token-limit-module/module.d.ts.map +1 -0
- package/dist/types/ma-v2/modules/paymaster-guard-module/abis/paymasterGuardModuleAbi.d.ts +187 -0
- package/dist/types/ma-v2/modules/paymaster-guard-module/abis/paymasterGuardModuleAbi.d.ts.map +1 -0
- package/dist/types/ma-v2/modules/paymaster-guard-module/module.d.ts +197 -0
- package/dist/types/ma-v2/modules/paymaster-guard-module/module.d.ts.map +1 -0
- package/dist/types/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModuleAbi.d.ts +46 -0
- package/dist/types/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModuleAbi.d.ts.map +1 -0
- package/dist/types/ma-v2/modules/single-signer-validation/module.d.ts +11 -0
- package/dist/types/ma-v2/modules/single-signer-validation/module.d.ts.map +1 -0
- package/dist/types/ma-v2/modules/time-range-module/abis/timeRangeModuleAbi.d.ts +230 -0
- package/dist/types/ma-v2/modules/time-range-module/abis/timeRangeModuleAbi.d.ts.map +1 -0
- package/dist/types/ma-v2/modules/time-range-module/module.d.ts +255 -0
- package/dist/types/ma-v2/modules/time-range-module/module.d.ts.map +1 -0
- package/dist/types/ma-v2/modules/webauthn-validation/abis/webauthnValidationAbi.d.ts +288 -0
- package/dist/types/ma-v2/modules/webauthn-validation/abis/webauthnValidationAbi.d.ts.map +1 -0
- package/dist/types/ma-v2/modules/webauthn-validation/module.d.ts +12 -0
- package/dist/types/ma-v2/modules/webauthn-validation/module.d.ts.map +1 -0
- package/dist/types/ma-v2/permissionBuilder.d.ts +159 -0
- package/dist/types/ma-v2/permissionBuilder.d.ts.map +1 -0
- package/dist/types/ma-v2/predictAddress.d.ts +38 -0
- package/dist/types/ma-v2/predictAddress.d.ts.map +1 -0
- package/dist/types/ma-v2/types.d.ts +58 -0
- package/dist/types/ma-v2/types.d.ts.map +1 -0
- package/dist/types/ma-v2/utils/account.d.ts +86 -0
- package/dist/types/ma-v2/utils/account.d.ts.map +1 -0
- package/dist/types/ma-v2/utils/deferredActions.d.ts +30 -0
- package/dist/types/ma-v2/utils/deferredActions.d.ts.map +1 -0
- package/dist/types/ma-v2/utils/hooks.d.ts +56 -0
- package/dist/types/ma-v2/utils/hooks.d.ts.map +1 -0
- package/dist/types/ma-v2/utils/signature.d.ts +64 -0
- package/dist/types/ma-v2/utils/signature.d.ts.map +1 -0
- package/dist/types/test-utils/getAccountAddressViaEntryPoint.d.ts +19 -0
- package/dist/types/test-utils/getAccountAddressViaEntryPoint.d.ts.map +1 -0
- package/dist/types/types.d.ts +31 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/utils.d.ts +7 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types/version.d.ts +2 -0
- package/dist/types/version.d.ts.map +1 -0
- package/package.json +63 -0
- package/src/errors/EntityIdOverrideError.ts +15 -0
- package/src/errors/InvalidDeferredActionNonceError.ts +15 -0
- package/src/errors/InvalidEntityIdError.ts +19 -0
- package/src/errors/InvalidNonceKeyError.ts +19 -0
- package/src/errors/InvalidOwnerError.ts +17 -0
- package/src/errors/permissionBuilderErrors.ts +212 -0
- package/src/index.ts +152 -0
- package/src/light-account/abis/LightAccountAbi_v1.ts +378 -0
- package/src/light-account/abis/LightAccountAbi_v2.ts +354 -0
- package/src/light-account/abis/LightAccountFactoryAbi_v1.ts +74 -0
- package/src/light-account/abis/LightAccountFactoryAbi_v2.ts +209 -0
- package/src/light-account/abis/MultiOwnerLightAccountAbi.ts +371 -0
- package/src/light-account/abis/MultiOwnerLightAccountFactoryAbi.ts +228 -0
- package/src/light-account/abis/OZ_ERC1967Proxy.ts +19 -0
- package/src/light-account/accounts/account.ts +154 -0
- package/src/light-account/accounts/base.ts +340 -0
- package/src/light-account/accounts/calldataCodec.ts +101 -0
- package/src/light-account/accounts/multi-owner-account.ts +138 -0
- package/src/light-account/decorators/multiOwner.ts +69 -0
- package/src/light-account/decorators/singleOwner.ts +61 -0
- package/src/light-account/lightAccountStaticImpl.ts +172 -0
- package/src/light-account/predictAddress.ts +174 -0
- package/src/light-account/registry.ts +72 -0
- package/src/light-account/utils.ts +95 -0
- package/src/logger.ts +9 -0
- package/src/ma-v1/abis/IStandardExecutor.ts +31 -0
- package/src/ma-v1/abis/MultiOwnerModularAccountFactory.ts +190 -0
- package/src/ma-v1/abis/MultiOwnerPlugin.ts +528 -0
- package/src/ma-v1/abis/MultiOwnerPluginExecutionFunction.ts +37 -0
- package/src/ma-v1/abis/UpgradeableModularAccount.ts +645 -0
- package/src/ma-v1/account.ts +19 -0
- package/src/ma-v1/accounts/base.ts +245 -0
- package/src/ma-v1/accounts/multi-owner-account.ts +162 -0
- package/src/ma-v1/decorators/multiOwner.ts +69 -0
- package/src/ma-v1/mav1StaticImpl.ts +53 -0
- package/src/ma-v1/predictAddress.ts +85 -0
- package/src/ma-v2/abis/accountFactoryAbi.ts +644 -0
- package/src/ma-v2/abis/entityIdAndNonceReader.ts +23 -0
- package/src/ma-v2/abis/modularAccountAbi.ts +1241 -0
- package/src/ma-v2/abis/semiModularAccountBytecodeAbi.ts +1288 -0
- package/src/ma-v2/abis/semiModularAccountStorageAbi.ts +1301 -0
- package/src/ma-v2/abis/webAuthnFactoryAbi.ts +259 -0
- package/src/ma-v2/accounts/account.ts +211 -0
- package/src/ma-v2/accounts/base.ts +569 -0
- package/src/ma-v2/decorators/deferralActions.ts +193 -0
- package/src/ma-v2/decorators/installValidation.ts +257 -0
- package/src/ma-v2/mav2StaticImpl.ts +134 -0
- package/src/ma-v2/modules/allowlist-module/abis/allowlistModuleAbi.ts +715 -0
- package/src/ma-v2/modules/allowlist-module/module.ts +116 -0
- package/src/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModuleAbi.ts +403 -0
- package/src/ma-v2/modules/native-token-limit-module/module.ts +21 -0
- package/src/ma-v2/modules/paymaster-guard-module/abis/paymasterGuardModuleAbi.ts +241 -0
- package/src/ma-v2/modules/paymaster-guard-module/module.ts +35 -0
- package/src/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModuleAbi.ts +330 -0
- package/src/ma-v2/modules/single-signer-validation/module.ts +24 -0
- package/src/ma-v2/modules/time-range-module/abis/timeRangeModuleAbi.ts +295 -0
- package/src/ma-v2/modules/time-range-module/module.ts +96 -0
- package/src/ma-v2/modules/webauthn-validation/abis/webauthnValidationAbi.ts +373 -0
- package/src/ma-v2/modules/webauthn-validation/module.ts +28 -0
- package/src/ma-v2/permissionBuilder.ts +761 -0
- package/src/ma-v2/predictAddress.ts +149 -0
- package/src/ma-v2/types.ts +73 -0
- package/src/ma-v2/utils/account.ts +137 -0
- package/src/ma-v2/utils/deferredActions.ts +66 -0
- package/src/ma-v2/utils/hooks.ts +79 -0
- package/src/ma-v2/utils/signature.ts +129 -0
- package/src/test-utils/getAccountAddressViaEntryPoint.ts +43 -0
- package/src/types.ts +58 -0
- package/src/utils.ts +85 -0
- package/src/version.ts +3 -0
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@alchemy/smart-accounts",
|
|
3
|
+
"version": "0.0.0-alpha.0",
|
|
4
|
+
"description": "This package contains all of the viem interfaces for Alchemy's Smart Contract Accounts",
|
|
5
|
+
"author": "Alchemy",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"private": false,
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "./dist/esm/index.js",
|
|
10
|
+
"module": "./dist/esm/index.js",
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
12
|
+
"typings": "./dist/types/index.d.ts",
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"src/**/*.ts",
|
|
17
|
+
"!dist/**/*.tsbuildinfo",
|
|
18
|
+
"!vitest.config.ts",
|
|
19
|
+
"!.env",
|
|
20
|
+
"!src/**/*.test.ts",
|
|
21
|
+
"!src/**/*.test-d.ts",
|
|
22
|
+
"!src/__tests__/**/*"
|
|
23
|
+
],
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/types/index.d.ts",
|
|
27
|
+
"import": "./dist/esm/index.js",
|
|
28
|
+
"default": "./dist/esm/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./package.json": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"prebuild": "tsx ./inject-version.ts",
|
|
34
|
+
"build": "yarn clean && yarn build:esm && yarn build:types",
|
|
35
|
+
"build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm",
|
|
36
|
+
"build:types": "tsc --project tsconfig.build.json --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
|
|
37
|
+
"clean": "rm -rf ./dist",
|
|
38
|
+
"test": "vitest",
|
|
39
|
+
"test:run": "vitest run"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@alchemy/aa-infra": "0.0.0-alpha.0",
|
|
43
|
+
"typescript-template": "*"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@alchemy/common": "0.0.0-alpha.0",
|
|
47
|
+
"ox": "^0.9.6",
|
|
48
|
+
"viem": "^2.32.0"
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public",
|
|
52
|
+
"registry": "https://registry.npmjs.org/"
|
|
53
|
+
},
|
|
54
|
+
"repository": {
|
|
55
|
+
"type": "git",
|
|
56
|
+
"url": "git+https://github.com/alchemyplatform/aa-sdk.git"
|
|
57
|
+
},
|
|
58
|
+
"bugs": {
|
|
59
|
+
"url": "https://github.com/alchemyplatform/aa-sdk/issues"
|
|
60
|
+
},
|
|
61
|
+
"homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
|
|
62
|
+
"gitHead": "c0301f7bb5f4499fe35b5850293be6170057fae6"
|
|
63
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseError } from "@alchemy/common";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Error class denoting that the provided entity id is invalid because it's overriding the native entity id.
|
|
5
|
+
*/
|
|
6
|
+
export class EntityIdOverrideError extends BaseError {
|
|
7
|
+
override name = "EntityIdOverrideError";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Initializes a new instance of the error message with a default message indicating that the nonce key is invalid.
|
|
11
|
+
*/
|
|
12
|
+
constructor() {
|
|
13
|
+
super(`EntityId of 0 is reserved for the owner and cannot be used`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseError } from "@alchemy/common";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Error class denoting that the deferred action nonce used is invalid.
|
|
5
|
+
*/
|
|
6
|
+
export class InvalidDeferredActionNonceError extends BaseError {
|
|
7
|
+
override name = "InvalidDeferredActionNonce";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Initializes a new instance of the error message with a default message indicating that the provided deferred action nonce is invalid.
|
|
11
|
+
*/
|
|
12
|
+
constructor() {
|
|
13
|
+
super(`The provided deferred action nonce is invalid`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseError } from "@alchemy/common";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Error class denoting that the provided entity id is invalid because it's too large.
|
|
5
|
+
*/
|
|
6
|
+
export class InvalidEntityIdError extends BaseError {
|
|
7
|
+
override name = "InvalidEntityIdError";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Initializes a new instance of the error message with a default message indicating that the entity id is invalid because it's too large.
|
|
11
|
+
*
|
|
12
|
+
* @param {number} entityId the invalid entityId used
|
|
13
|
+
*/
|
|
14
|
+
constructor(entityId: number) {
|
|
15
|
+
super(
|
|
16
|
+
`Entity ID used is ${entityId}, but must be less than or equal to uint32.max`,
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseError } from "@alchemy/common";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Error class denoting that the nonce key is invalid because its too large.
|
|
5
|
+
*/
|
|
6
|
+
export class InvalidNonceKeyError extends BaseError {
|
|
7
|
+
override name = "InvalidNonceKeyError";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Initializes a new instance of the error message with a default message indicating that the nonce key is invalid.
|
|
11
|
+
*
|
|
12
|
+
* @param {bigint} nonceKey the invalid nonceKey used
|
|
13
|
+
*/
|
|
14
|
+
constructor(nonceKey: bigint) {
|
|
15
|
+
super(
|
|
16
|
+
`Nonce key is ${nonceKey} but has to be less than or equal to 2**152`,
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseError } from "@alchemy/common";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Error class denoting that the owner for an account is invalid
|
|
5
|
+
*/
|
|
6
|
+
export class InvalidOwnerError extends BaseError {
|
|
7
|
+
override name = "InvalidOwnerError";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Initializes a new instance of the error message with a default message indicating that the owner is invalid
|
|
11
|
+
*
|
|
12
|
+
* @param {string} reason the reason the owner is invalid
|
|
13
|
+
*/
|
|
14
|
+
constructor(reason: string) {
|
|
15
|
+
super(`Owner is invalid (${reason}).`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { BaseError } from "@alchemy/common";
|
|
2
|
+
import type { Permission } from "../ma-v2/permissionBuilder.js";
|
|
3
|
+
import type { Address } from "viem";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Abstract class representing a Permission Builder Error, subclassed by all permission builder errors.
|
|
7
|
+
*/
|
|
8
|
+
export abstract class PermissionBuilderError extends BaseError {}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Error class for when a root permission is added to a permission builder.
|
|
12
|
+
*/
|
|
13
|
+
export class RootPermissionOnlyError extends PermissionBuilderError {
|
|
14
|
+
override name = "PermissionBuilder: RootPermissionOnlyError";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Constructor for initializing an error message indicating that the root permission cannot be combined with other permissions.
|
|
18
|
+
*
|
|
19
|
+
* @param {Permission} permission The permission trying to be added atop the root permission
|
|
20
|
+
*/
|
|
21
|
+
constructor(permission: Permission) {
|
|
22
|
+
super(
|
|
23
|
+
`Adding ${permission.type}: Cannot add permissions with ROOT permission`,
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Error class for when an account address is used as target.
|
|
30
|
+
*/
|
|
31
|
+
export class AccountAddressAsTargetError extends PermissionBuilderError {
|
|
32
|
+
override name = "PermissionBuilder: AccountAddressAsTargetError";
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Constructor for initializing an error message indicating that account address is used as target.
|
|
36
|
+
*
|
|
37
|
+
* @param {Permission} permission The permission with account address as target
|
|
38
|
+
*/
|
|
39
|
+
constructor(permission: Permission) {
|
|
40
|
+
super(
|
|
41
|
+
`${permission.type}: Account address as target, use ACCOUNT_FUNCTIONS for account address`,
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Error class for when a duplicate target address is added to a permission builder.
|
|
48
|
+
*/
|
|
49
|
+
export class DuplicateTargetAddressError extends PermissionBuilderError {
|
|
50
|
+
override name = "PermissionBuilder: DuplicateTargetAddressError";
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Constructor for initializing an error message indicating duplicate target address in permissions.
|
|
54
|
+
*
|
|
55
|
+
* @param {Permission} permission The permission with duplicate target address
|
|
56
|
+
* @param {Address} targetAddress The duplicate target address
|
|
57
|
+
*/
|
|
58
|
+
constructor(permission: Permission, targetAddress: Address) {
|
|
59
|
+
super(
|
|
60
|
+
`${permission.type}: Address ${targetAddress} already has a permission. Cannot add multiple CONTRACT_ACCESS or FUNCTIONS_ON_CONTRACT permissions for the same target address.`,
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Error class for when no functions are provided to a permission builder.
|
|
67
|
+
*/
|
|
68
|
+
export class NoFunctionsProvidedError extends PermissionBuilderError {
|
|
69
|
+
override name = "PermissionBuilder: NoFunctionsProvidedError";
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Constructor for initializing an error message indicating no functions were provided.
|
|
73
|
+
*
|
|
74
|
+
* @param {Permission} permission The permission missing functions
|
|
75
|
+
*/
|
|
76
|
+
constructor(permission: Permission) {
|
|
77
|
+
super(`${permission.type}: No functions provided`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Error class for when a deadline is expired.
|
|
83
|
+
*/
|
|
84
|
+
export class ExpiredDeadlineError extends PermissionBuilderError {
|
|
85
|
+
override name = "PermissionBuilder: ExpiredDeadlineError";
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Constructor for initializing an error message indicating the deadline has expired.
|
|
89
|
+
*
|
|
90
|
+
* @param {number} deadline The expired deadline timestamp
|
|
91
|
+
* @param {number} currentTime The current timestamp
|
|
92
|
+
*/
|
|
93
|
+
constructor(deadline: number, currentTime: number) {
|
|
94
|
+
super(
|
|
95
|
+
`compileDeferred(): deadline ${deadline} cannot be before now (${currentTime})`,
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Error class for when a deadline is over the limit.
|
|
102
|
+
*/
|
|
103
|
+
export class DeadlineOverLimitError extends PermissionBuilderError {
|
|
104
|
+
override name = "PermissionBuilder: DeadlineOverLimitError";
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Constructor for initializing an error message indicating the deadline has expired.
|
|
108
|
+
*
|
|
109
|
+
* @param {number} deadline The expired deadline timestamp
|
|
110
|
+
*/
|
|
111
|
+
constructor(deadline: number) {
|
|
112
|
+
super(
|
|
113
|
+
`compileDeferred(): deadline ${deadline} cannot be > max uint48 (2^48 - 1)`,
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Error class for when a validation config is unset.
|
|
120
|
+
*/
|
|
121
|
+
export class ValidationConfigUnsetError extends PermissionBuilderError {
|
|
122
|
+
override name = "PermissionBuilder: ValidationConfigUnsetError";
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Constructor for initializing an error message indicating the validation config is unset.
|
|
126
|
+
*/
|
|
127
|
+
constructor() {
|
|
128
|
+
super(
|
|
129
|
+
"Missing permission among: functions on contract, functions on all contracts, account functions, contract access, or erc20 token transfer",
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Error class for when a multiple native token transfer permission is added to a permission builder.
|
|
136
|
+
*/
|
|
137
|
+
export class MultipleNativeTokenTransferError extends PermissionBuilderError {
|
|
138
|
+
override name = "PermissionBuilder: MultipleNativeTokenTransferError";
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Constructor for initializing an error message indicating multiple native token transfer permissions.
|
|
142
|
+
*
|
|
143
|
+
* @param {Permission} permission The duplicate native token transfer permission
|
|
144
|
+
*/
|
|
145
|
+
constructor(permission: Permission) {
|
|
146
|
+
super(
|
|
147
|
+
`${permission.type}: Must have at most ONE native token transfer permission`,
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Error class for when a zero address is provided to a permission builder.
|
|
154
|
+
*/
|
|
155
|
+
export class ZeroAddressError extends PermissionBuilderError {
|
|
156
|
+
override name = "PermissionBuilder: ZeroAddressError";
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Constructor for initializing an error message indicating zero address was provided.
|
|
160
|
+
*
|
|
161
|
+
* @param {Permission} permission The permission with zero address
|
|
162
|
+
*/
|
|
163
|
+
constructor(permission: Permission) {
|
|
164
|
+
super(`${permission.type}: Zero address provided`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Error class for when a multiple gas limit permission is added to a permission builder.
|
|
170
|
+
*/
|
|
171
|
+
export class MultipleGasLimitError extends PermissionBuilderError {
|
|
172
|
+
override name = "PermissionBuilder: MultipleGasLimitError";
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Constructor for initializing an error message indicating multiple gas limit permissions.
|
|
176
|
+
*
|
|
177
|
+
* @param {Permission} permission The duplicate gas limit permission
|
|
178
|
+
*/
|
|
179
|
+
constructor(permission: Permission) {
|
|
180
|
+
super(`${permission.type}: Must have at most ONE gas limit permission`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Error class for when an unsupported permission type is added to a permission builder.
|
|
186
|
+
*/
|
|
187
|
+
export class UnsupportedPermissionTypeError extends PermissionBuilderError {
|
|
188
|
+
override name = "PermissionBuilder: UnsupportedPermissionTypeError";
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Constructor for initializing an error message indicating an unsupported permission type.
|
|
192
|
+
*/
|
|
193
|
+
constructor() {
|
|
194
|
+
super(`Unsupported permission type`);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Error class for when a selector is not allowed.
|
|
200
|
+
*/
|
|
201
|
+
export class SelectorNotAllowed extends PermissionBuilderError {
|
|
202
|
+
override name = "SelectorNotAllowed";
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Constructor for initializing an error message indicating that the selector being added is not allowed.
|
|
206
|
+
*
|
|
207
|
+
* @param {string} functionName The function name of the selector that is being added.
|
|
208
|
+
*/
|
|
209
|
+
constructor(functionName: string) {
|
|
210
|
+
super(`Cannot add ${functionName} on the account`);
|
|
211
|
+
}
|
|
212
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// LightAccount
|
|
2
|
+
export type * from "./light-account/accounts/account.js";
|
|
3
|
+
export { toLightAccount } from "./light-account/accounts/account.js";
|
|
4
|
+
|
|
5
|
+
export type * from "./light-account/accounts/multi-owner-account.js";
|
|
6
|
+
export { toMultiOwnerLightAccount } from "./light-account/accounts/multi-owner-account.js";
|
|
7
|
+
|
|
8
|
+
// TODO(v5): Something to consider for v5 - can we cut the exports for the account-specific actions
|
|
9
|
+
// from the public interface, and just consume these internally with account + rely on the standard
|
|
10
|
+
// bundlerClient actions for performing state writes (i.e. rotating owners)? I'm not sure it's useful
|
|
11
|
+
// to consumers outside of attaching to instances of a client with the right action.
|
|
12
|
+
export type * from "./light-account/decorators/singleOwner.js";
|
|
13
|
+
export { singleOwnerLightAccountActions } from "./light-account/decorators/singleOwner.js";
|
|
14
|
+
|
|
15
|
+
export type * from "./light-account/decorators/multiOwner.js";
|
|
16
|
+
export { multiOwnerLightAccountActions } from "./light-account/decorators/multiOwner.js";
|
|
17
|
+
|
|
18
|
+
export type * from "./light-account/predictAddress.js";
|
|
19
|
+
export {
|
|
20
|
+
predictLightAccountAddress,
|
|
21
|
+
predictMultiOwnerLightAccountAddress,
|
|
22
|
+
} from "./light-account/predictAddress.js";
|
|
23
|
+
|
|
24
|
+
export { AccountVersionRegistry } from "./light-account/registry.js";
|
|
25
|
+
export type * from "./light-account/registry.js";
|
|
26
|
+
export {
|
|
27
|
+
defaultLightAccountVersion,
|
|
28
|
+
getLightAccountImplAddress,
|
|
29
|
+
LightAccountUnsupported1271Factories,
|
|
30
|
+
LightAccountUnsupported1271Impls,
|
|
31
|
+
} from "./light-account/utils.js";
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
lightAccountStaticImplV1_0_1,
|
|
35
|
+
lightAccountStaticImplV1_0_2,
|
|
36
|
+
lightAccountStaticImplV1_1_0,
|
|
37
|
+
lightAccountStaticImplV2_0_0,
|
|
38
|
+
multiOwnerLightAccountStaticImplV2_0_0,
|
|
39
|
+
} from "./light-account/lightAccountStaticImpl.js";
|
|
40
|
+
|
|
41
|
+
// ModularAccountV1
|
|
42
|
+
export type * from "./ma-v1/accounts/base.js";
|
|
43
|
+
export { toModularAccountV1Base } from "./ma-v1/accounts/base.js";
|
|
44
|
+
|
|
45
|
+
export type * from "./ma-v1/accounts/multi-owner-account.js";
|
|
46
|
+
export { toMultiOwnerModularAccountV1 } from "./ma-v1/accounts/multi-owner-account.js";
|
|
47
|
+
|
|
48
|
+
export type * from "./ma-v1/decorators/multiOwner.js";
|
|
49
|
+
export { multiOwnerModularAccountV1Actions } from "./ma-v1/decorators/multiOwner.js";
|
|
50
|
+
|
|
51
|
+
export type * from "./ma-v1/predictAddress.js";
|
|
52
|
+
export { predictMultiOwnerModularAccountV1Address } from "./ma-v1/predictAddress.js";
|
|
53
|
+
|
|
54
|
+
export { multiOwnerModularAccountStaticImpl } from "./ma-v1/mav1StaticImpl.js";
|
|
55
|
+
|
|
56
|
+
export {
|
|
57
|
+
DefaultMaV1Address,
|
|
58
|
+
DefaultMaV1PluginAddress,
|
|
59
|
+
} from "./ma-v1/account.js";
|
|
60
|
+
|
|
61
|
+
// ModularAccountV2
|
|
62
|
+
export type * from "./ma-v2/accounts/account.js";
|
|
63
|
+
export { toModularAccountV2 } from "./ma-v2/accounts/account.js";
|
|
64
|
+
|
|
65
|
+
export type * from "./ma-v2/accounts/base.js";
|
|
66
|
+
export { toModularAccountV2Base } from "./ma-v2/accounts/base.js";
|
|
67
|
+
|
|
68
|
+
export type * from "./ma-v2/decorators/deferralActions.js";
|
|
69
|
+
export { deferralActions } from "./ma-v2/decorators/deferralActions.js";
|
|
70
|
+
|
|
71
|
+
export type * from "./ma-v2/decorators/installValidation.js";
|
|
72
|
+
export { installValidationActions } from "./ma-v2/decorators/installValidation.js";
|
|
73
|
+
|
|
74
|
+
export {
|
|
75
|
+
semiModularAccountV2StaticImpl,
|
|
76
|
+
semiModularAccount7702StaticImpl,
|
|
77
|
+
webAuthnModularAccountV2StaticImpl,
|
|
78
|
+
} from "./ma-v2/mav2StaticImpl.js";
|
|
79
|
+
export type * from "./ma-v2/mav2StaticImpl.js";
|
|
80
|
+
|
|
81
|
+
// Modules
|
|
82
|
+
export { AllowlistModule } from "./ma-v2/modules/allowlist-module/module.js";
|
|
83
|
+
export { NativeTokenLimitModule } from "./ma-v2/modules/native-token-limit-module/module.js";
|
|
84
|
+
export { PaymasterGuardModule } from "./ma-v2/modules/paymaster-guard-module/module.js";
|
|
85
|
+
export { SingleSignerValidationModule } from "./ma-v2/modules/single-signer-validation/module.js";
|
|
86
|
+
export { TimeRangeModule } from "./ma-v2/modules/time-range-module/module.js";
|
|
87
|
+
export { WebAuthnValidationModule } from "./ma-v2/modules/webauthn-validation/module.js";
|
|
88
|
+
|
|
89
|
+
export type * from "./ma-v2/permissionBuilder.js";
|
|
90
|
+
export {
|
|
91
|
+
PermissionBuilder,
|
|
92
|
+
PermissionType,
|
|
93
|
+
} from "./ma-v2/permissionBuilder.js";
|
|
94
|
+
|
|
95
|
+
export type * from "./ma-v2/predictAddress.js";
|
|
96
|
+
export { predictModularAccountV2Address } from "./ma-v2/predictAddress.js";
|
|
97
|
+
|
|
98
|
+
export type * from "./ma-v2/types.js";
|
|
99
|
+
|
|
100
|
+
export type * from "./ma-v2/utils/account.js";
|
|
101
|
+
export {
|
|
102
|
+
DefaultAddress,
|
|
103
|
+
DefaultModuleAddress,
|
|
104
|
+
DEFAULT_OWNER_ENTITY_ID,
|
|
105
|
+
EXECUTE_USER_OP_SELECTOR,
|
|
106
|
+
getMAV2UpgradeToData,
|
|
107
|
+
buildFullNonceKey,
|
|
108
|
+
serializeModuleEntity,
|
|
109
|
+
isModularAccountV2,
|
|
110
|
+
} from "./ma-v2/utils/account.js";
|
|
111
|
+
|
|
112
|
+
export type * from "./ma-v2/utils/deferredActions.js";
|
|
113
|
+
export {
|
|
114
|
+
parseDeferredAction,
|
|
115
|
+
buildDeferredActionDigest,
|
|
116
|
+
} from "./ma-v2/utils/deferredActions.js";
|
|
117
|
+
|
|
118
|
+
export type * from "./ma-v2/utils/hooks.js";
|
|
119
|
+
export {
|
|
120
|
+
serializeValidationConfig,
|
|
121
|
+
serializeHookConfig,
|
|
122
|
+
} from "./ma-v2/utils/hooks.js";
|
|
123
|
+
|
|
124
|
+
export type * from "./ma-v2/utils/signature.js";
|
|
125
|
+
export {
|
|
126
|
+
packUOSignature,
|
|
127
|
+
pack1271Signature,
|
|
128
|
+
toReplaySafeTypedData,
|
|
129
|
+
toWebAuthnSignature,
|
|
130
|
+
} from "./ma-v2/utils/signature.js";
|
|
131
|
+
|
|
132
|
+
// Errors
|
|
133
|
+
export { EntityIdOverrideError } from "./errors/EntityIdOverrideError.js";
|
|
134
|
+
export { InvalidDeferredActionNonceError } from "./errors/InvalidDeferredActionNonceError.js";
|
|
135
|
+
export { InvalidEntityIdError } from "./errors/InvalidEntityIdError.js";
|
|
136
|
+
export { InvalidNonceKeyError } from "./errors/InvalidNonceKeyError.js";
|
|
137
|
+
export { InvalidOwnerError } from "./errors/InvalidOwnerError.js";
|
|
138
|
+
export {
|
|
139
|
+
PermissionBuilderError,
|
|
140
|
+
RootPermissionOnlyError,
|
|
141
|
+
AccountAddressAsTargetError,
|
|
142
|
+
DuplicateTargetAddressError,
|
|
143
|
+
NoFunctionsProvidedError,
|
|
144
|
+
ExpiredDeadlineError,
|
|
145
|
+
DeadlineOverLimitError,
|
|
146
|
+
ValidationConfigUnsetError,
|
|
147
|
+
MultipleNativeTokenTransferError,
|
|
148
|
+
ZeroAddressError,
|
|
149
|
+
MultipleGasLimitError,
|
|
150
|
+
UnsupportedPermissionTypeError,
|
|
151
|
+
SelectorNotAllowed,
|
|
152
|
+
} from "./errors/permissionBuilderErrors.js";
|