From 9cb9d9283db899d5a2f632767993c04135eb1de8 Mon Sep 17 00:00:00 2001 From: Michael Moldoveanu Date: Fri, 14 Jun 2024 16:06:45 -0400 Subject: [PATCH 001/169] refactor: split aa-alchemy into account-kit packages (#704) * refactor: split aa-alchemy into account-kit packages BREAKING CHANGE: this removes the @alchemy/aa-alchemy package in favor of @account-kit/* * refactor: delete aa-accounts and move to @account-kit/accounts (#706) BREAKING CHANGE: @alchemy/aa-accounts was deleted in favor of @account-kit/accounts * refactor: further rename packages --- {packages => aa-sdk}/core/CHANGELOG.md | 0 {packages => aa-sdk}/core/README.md | 0 .../core/e2e-tests/constants.ts | 0 .../simple-account-staging.e2e.test.ts | 0 .../core/e2e-tests/simple-account.e2e.test.ts | 0 .../alchemy => aa-sdk/core}/inject-version.ts | 0 {packages => aa-sdk}/core/package.json | 0 .../core/src/__tests__/utils.test.ts | 0 .../core/src/abis/EntryPointAbi_v6.ts | 0 .../core/src/abis/EntryPointAbi_v7.ts | 0 .../core/src/abis/SimpleAccountAbi_v6.ts | 0 .../core/src/abis/SimpleAccountAbi_v7.ts | 0 .../core/src/abis/SimpleAccountFactoryAbi.ts | 0 .../core/src/account/__tests__/simple.test.ts | 0 {packages => aa-sdk}/core/src/account/base.ts | 0 .../core/src/account/schema.ts | 0 .../core/src/account/simple.ts | 0 .../core/src/account/smartContractAccount.ts | 0 .../core/src/account/types.ts | 0 .../bundler/estimateUserOperationGas.ts | 0 .../bundler/getSupportedEntryPoints.ts | 0 .../actions/bundler/getUserOperationByHash.ts | 0 .../bundler/getUserOperationReceipt.ts | 0 .../actions/bundler/sendRawUserOperation.ts | 0 .../smartAccount/buildUserOperation.ts | 0 .../smartAccount/buildUserOperationFromTx.ts | 0 .../smartAccount/buildUserOperationFromTxs.ts | 0 .../checkGasSponsorshipEligibility.ts | 0 .../dropAndReplaceUserOperation.ts | 0 .../smartAccount/estimateUserOperationGas.ts | 0 .../src/actions/smartAccount/getAddress.ts | 0 .../internal/initUserOperation.ts | 0 .../internal/runMiddlewareStack.ts | 0 .../internal/sendUserOperation.ts | 0 .../actions/smartAccount/sendTransaction.ts | 0 .../actions/smartAccount/sendTransactions.ts | 0 .../actions/smartAccount/sendUserOperation.ts | 0 .../src/actions/smartAccount/signMessage.ts | 0 .../smartAccount/signMessageWith6492.ts | 0 .../src/actions/smartAccount/signTypedData.ts | 0 .../smartAccount/signTypedDataWith6492.ts | 0 .../actions/smartAccount/signUserOperation.ts | 0 .../core/src/actions/smartAccount/types.ts | 0 .../actions/smartAccount/upgradeAccount.ts | 0 .../waitForUserOperationTransacation.ts | 0 {packages => aa-sdk}/core/src/chains/index.ts | 0 .../core/src/client/bundlerClient.ts | 0 .../src/client/decorators/bundlerClient.ts | 0 .../client/decorators/smartAccountClient.ts | 0 .../core/src/client/isSmartAccountClient.ts | 0 .../core/src/client/schema.ts | 0 .../src/client/smartAccountClient.test.ts | 0 .../core/src/client/smartAccountClient.ts | 0 {packages => aa-sdk}/core/src/client/types.ts | 0 {packages => aa-sdk}/core/src/ens/utils.ts | 0 .../core/src/entrypoint/0.6.ts | 0 .../core/src/entrypoint/0.7.ts | 0 .../core/src/entrypoint/index.ts | 0 .../core/src/entrypoint/types.ts | 0 .../core/src/errors/account.ts | 0 {packages => aa-sdk}/core/src/errors/base.ts | 0 .../core/src/errors/client.ts | 0 .../core/src/errors/entrypoint.ts | 0 .../core/src/errors/signer.ts | 0 .../core/src/errors/transaction.ts | 0 .../core/src/errors/useroperation.ts | 0 {packages => aa-sdk}/core/src/index.ts | 0 {packages => aa-sdk}/core/src/logger.ts | 0 .../core/src/middleware/actions.ts | 0 .../src/middleware/defaults/feeEstimator.ts | 0 .../src/middleware/defaults/gasEstimator.ts | 0 .../middleware/defaults/paymasterAndData.ts | 0 .../src/middleware/defaults/userOpSigner.ts | 0 .../core/src/middleware/noopMiddleware.ts | 0 .../core/src/middleware/types.ts | 0 .../signer/__tests__/local-account.test.ts | 0 .../signer/__tests__/wallet-client.test.ts | 0 .../core/src/signer/local-account.ts | 0 .../core/src/signer/schema.ts | 0 {packages => aa-sdk}/core/src/signer/types.ts | 0 {packages => aa-sdk}/core/src/signer/utils.ts | 0 .../core/src/signer/wallet-client.ts | 0 .../core/src/transport/split.ts | 0 {packages => aa-sdk}/core/src/types.ts | 0 .../core/src/utils/__tests__/bigint.test.ts | 0 {packages => aa-sdk}/core/src/utils/bigint.ts | 0 {packages => aa-sdk}/core/src/utils/bytes.ts | 0 .../core/src/utils/defaults.ts | 0 {packages => aa-sdk}/core/src/utils/index.ts | 0 {packages => aa-sdk}/core/src/utils/schema.ts | 0 .../core/src/utils/stateOverride.ts | 0 .../core/src/utils/testUtils.ts | 0 {packages => aa-sdk}/core/src/utils/types.ts | 0 {packages => aa-sdk}/core/src/utils/userop.ts | 0 .../alchemy => aa-sdk/core}/src/version.ts | 0 {packages => aa-sdk}/core/tsconfig.build.json | 0 .../accounts => aa-sdk/core}/tsconfig.json | 0 .../core/vitest.config.e2e.ts | 0 {packages => aa-sdk}/core/vitest.config.ts | 0 {packages => aa-sdk}/ethers/CHANGELOG.md | 0 {packages => aa-sdk}/ethers/README.md | 0 .../ethers/e2e-tests/constants.ts | 0 .../e2e-tests/simple-account.e2e.test.ts | 0 {packages => aa-sdk}/ethers/package.json | 0 .../src/__tests__/provider-adapter.test.ts | 0 .../ethers/src/account-signer.ts | 0 {packages => aa-sdk}/ethers/src/index.ts | 0 .../ethers/src/provider-adapter.ts | 0 {packages => aa-sdk}/ethers/src/types.ts | 0 {packages => aa-sdk}/ethers/src/utils.ts | 0 .../ethers/tsconfig.build.json | 0 .../core => aa-sdk/ethers}/tsconfig.json | 0 .../ethers/vitest.config.e2e.ts | 0 {packages => aa-sdk}/ethers/vitest.config.ts | 0 {packages => aa-sdk}/plugingen/CHANGELOG.md | 0 .../plugingen}/inject-version.ts | 0 {packages => aa-sdk}/plugingen/package.json | 0 .../abis => aa-sdk/plugingen/src}/IPlugin.ts | 0 {packages => aa-sdk}/plugingen/src/cli.ts | 0 .../plugingen/src/commands/generate/index.ts | 2 +- .../generate/phases/contract-abi-gen.ts | 0 .../generate/phases/contract-addresses-gen.ts | 0 .../generate/phases/execution-abi-gen.ts | 0 .../generate/phases/plugin-actions/index.ts | 6 +- .../plugin-actions/management-actions.ts | 12 +- .../phases/plugin-actions/read-actions.ts | 5 +- .../plugin-generator/get-contract-gen.ts | 0 .../generate/phases/plugin-generator/index.ts | 2 +- .../phases/plugin-generator/meta-gen.ts | 0 .../plugingen/src/commands/generate/types.ts | 2 +- .../plugingen/src/commands/generate}/utils.ts | 0 .../plugingen/src/commands/init.ts | 0 {packages => aa-sdk}/plugingen/src/config.ts | 0 {packages => aa-sdk}/plugingen/src/errors.ts | 0 .../plugingen/src/exports/config.ts | 0 .../plugingen/src/exports/index.ts | 0 aa-sdk/plugingen/src/exports/types.ts | 1 + {packages => aa-sdk}/plugingen/src/logger.ts | 0 {packages => aa-sdk}/plugingen/src/types.ts | 0 .../plugingen/src/utils/findConfig.ts | 0 .../plugingen/src/utils/format.ts | 0 .../plugingen/src/utils/isUsingTypescript.ts | 0 .../plugingen/src/utils/loadEnv.ts | 0 .../plugingen/src/utils/resolveConfig.ts | 0 .../core => aa-sdk/plugingen}/src/version.ts | 0 .../plugingen/tsconfig.build.json | 0 .../ethers => aa-sdk/plugingen}/tsconfig.json | 0 .../plugingen/vitest.config.e2e.ts | 0 .../plugingen/vitest.config.ts | 0 .../core}/inject-version.ts | 0 account-kit/core/package.json | 77 ++ .../core/src}/actions/createAccount.ts | 8 +- .../core/src}/actions/getAccount.ts | 2 +- .../core/src}/actions/getBundlerClient.ts | 2 +- .../core/src}/actions/getChain.ts | 0 .../core/src}/actions/getConnection.ts | 2 +- .../core/src}/actions/getSigner.ts | 6 +- .../core/src}/actions/getSignerStatus.ts | 0 .../core/src}/actions/getUser.ts | 2 +- .../core/src}/actions/reconnect.ts | 2 +- .../core/src}/actions/setChain.ts | 4 +- .../core/src}/actions/watchAccount.ts | 2 +- .../core/src}/actions/watchBundlerClient.ts | 2 +- .../core/src}/actions/watchChain.ts | 0 .../core/src}/actions/watchConnection.ts | 0 .../core/src}/actions/watchSigner.ts | 4 +- .../core/src}/actions/watchSignerStatus.ts | 2 +- .../core/src}/actions/watchUser.ts | 2 +- .../core/src}/createConfig.ts | 4 +- .../config => account-kit/core/src}/errors.ts | 8 +- .../core/src}/hydrate.ts | 6 +- account-kit/core/src/index.ts | 39 + .../core/src}/store/client.ts | 7 +- .../core/src}/store/core.ts | 4 +- .../core/src}/store/types.ts | 20 +- .../config => account-kit/core/src}/types.ts | 22 +- .../core/src}/utils/cookies.ts | 4 +- .../core/src}/utils/deserialize.ts | 0 .../core/src}/utils/replacer.ts | 0 .../core/src}/utils/reviver.ts | 0 .../core}/src/version.ts | 0 .../core}/tsconfig.build.json | 0 .../core}/tsconfig.json | 0 .../core}/vitest.config.e2e.ts | 3 +- .../core}/vitest.config.ts | 3 +- .../infra}/e2e-tests/constants.ts | 0 .../e2e-tests/light-account.e2e.test.ts | 0 .../modular-account-multi-owner.e2e.test.ts | 0 .../multi-owner-light-account.e2e.test.ts | 0 .../e2e-tests/multisig-account.e2e.test.ts | 0 .../e2e-tests/simple-account-v7.e2e.test.ts | 0 account-kit/infra/inject-version.ts | 19 + account-kit/infra/package.json | 81 ++ .../actions/simulateUserOperationChanges.ts | 4 +- .../infra}/src/actions/types.ts | 0 .../infra}/src/chains.ts | 0 .../lightAccountClient.test.ts.snap | 0 .../multiOwnerLightAccountClient.test.ts.snap | 0 .../client/decorators/alchemyEnhancedApis.ts | 0 .../src/client/decorators/smartAccount.ts | 0 .../internal/smartAccountClientFromRpc.ts | 4 +- .../src/client/isAlchemySmartAccountClient.ts | 0 .../src/client/lightAccountClient.test.ts | 0 .../infra}/src/client/lightAccountClient.ts | 2 +- .../infra}/src/client/modularAccountClient.ts | 4 +- .../multiOwnerLightAccountClient.test.ts | 0 .../client/multiOwnerLightAccountClient.ts | 2 +- .../src/client/multisigAccountClient.ts | 4 +- .../infra}/src/client/rpcClient.ts | 0 .../src/client/smartAccountClient.test.ts | 2 +- .../infra}/src/client/smartAccountClient.ts | 0 .../infra}/src/client/types.ts | 0 .../infra}/src/defaults.ts | 0 .../infra}/src/errors/base.ts | 0 .../infra}/src/errors/rpcUrl.ts | 0 .../infra}/src/gas-manager.ts | 0 .../infra}/src/index.ts | 34 +- .../infra}/src/middleware/feeEstimator.ts | 0 .../infra}/src/middleware/gasManager.ts | 0 .../src/middleware/userOperationSimulator.ts | 0 .../infra}/src/schema.ts | 0 .../infra}/src/signer/base.ts | 0 .../infra}/src/signer/client/base.ts | 2 +- .../infra}/src/signer/client/index.ts | 2 +- .../infra}/src/signer/client/types.ts | 0 .../infra}/src/signer/errors.ts | 0 account-kit/infra/src/signer/index.ts | 10 + .../infra}/src/signer/session/manager.ts | 0 .../infra}/src/signer/session/types.ts | 0 .../infra}/src/signer/signer.ts | 4 +- .../infra}/src/signer/types.ts | 0 .../src/signer/utils/base64UrlEncode.ts | 0 .../src/signer/utils/generateRandomBuffer.ts | 0 .../alchemy => account-kit/infra}/src/type.ts | 0 account-kit/infra/src/version.ts | 3 + .../infra}/tsconfig.build.json | 3 +- account-kit/infra/tsconfig.json | 6 + .../infra}/vitest.config.e2e.ts | 0 .../infra}/vitest.config.ts | 0 account-kit/react/inject-version.ts | 19 + .../react}/package.json | 48 +- .../src}/components/auth/card/add-passkey.tsx | 0 .../src}/components/auth/card/content.tsx | 0 .../react/src}/components/auth/card/eoa.tsx | 0 .../react/src}/components/auth/card/index.tsx | 0 .../components/auth/card/loading/email.tsx | 0 .../components/auth/card/loading/index.tsx | 0 .../components/auth/card/loading/passkey.tsx | 0 .../react/src}/components/auth/card/main.tsx | 0 .../components/auth/card/passkey-added.tsx | 0 .../react/src}/components/auth/card/steps.tsx | 0 .../react/src}/components/auth/context.ts | 0 .../components/auth/hooks/usePasskeyVerify.ts | 0 .../react/src}/components/auth/modal.tsx | 0 .../components/auth/sections/AuthSection.tsx | 0 .../components/auth/sections/EmailAuth.tsx | 0 .../auth/sections/InjectedProvidersAuth.tsx | 0 .../components/auth/sections/PasskeyAuth.tsx | 0 .../react/src}/components/auth/types.ts | 0 .../react/src}/components/button.tsx | 0 .../react/src}/components/constants.ts | 0 .../react/src}/components/divider.tsx | 0 account-kit/react/src/components/error.tsx | 17 + .../react/src}/components/input.tsx | 0 .../react/src}/components/navigation.tsx | 0 .../react/src}/components/notification.tsx | 0 .../react/src}/components/poweredby.tsx | 0 .../react/src}/context.tsx | 9 +- .../react => account-kit/react/src}/errors.ts | 8 +- .../react/src}/hooks/useAccount.ts | 16 +- .../react/src}/hooks/useAddPasskey.ts | 0 .../react/src}/hooks/useAuthError.ts | 0 .../react/src}/hooks/useAuthModal.ts | 0 .../react/src}/hooks/useAuthenticate.ts | 5 +- .../react/src}/hooks/useBundlerClient.ts | 5 +- .../react/src}/hooks/useChain.ts | 8 +- .../react/src}/hooks/useClientActions.ts | 2 +- .../react/src}/hooks/useConnect.ts | 0 .../react/src}/hooks/useConnection.ts | 3 +- .../hooks/useDropAndReplaceUserOperation.ts | 2 +- .../react/src}/hooks/useExportAccount.ts | 4 +- .../react/src}/hooks/useLogout.ts | 0 .../react/src}/hooks/useSendTransaction.ts | 0 .../react/src}/hooks/useSendTransactions.ts | 2 +- .../react/src}/hooks/useSendUserOperation.ts | 2 +- .../react/src}/hooks/useSignMessage.ts | 0 .../react/src}/hooks/useSignTypedData.ts | 0 .../react/src}/hooks/useSigner.ts | 7 +- .../react/src}/hooks/useSignerStatus.ts | 5 +- .../react/src}/hooks/useSmartAccountClient.ts | 36 +- .../react/src}/hooks/useUser.ts | 5 +- .../useWaitForUserOperationTransaction.ts | 0 .../react/src}/hydrate.ts | 10 +- .../react/src}/icons/alchemy.tsx | 0 .../react/src}/icons/chevron.tsx | 0 .../react/src}/icons/google.tsx | 0 .../react/src}/icons/hourglass.tsx | 0 .../react/src}/icons/mail.tsx | 0 .../react/src}/icons/nav.tsx | 0 .../react/src}/icons/passkey.tsx | 0 .../react/src}/icons/spinner.tsx | 0 .../react => account-kit/react/src}/index.ts | 5 + .../react/src}/strings.ts | 0 .../react}/src/tailwind/components/buttons.ts | 0 .../src/tailwind/components/colorsvars.ts | 0 .../src/tailwind/components/form-controls.ts | 0 .../react}/src/tailwind/components/input.ts | 0 .../react}/src/tailwind/components/modal.ts | 0 .../react}/src/tailwind/index.ts | 0 .../react}/src/tailwind/plugin.ts | 2 +- .../react}/src/tailwind/theme.ts | 0 .../react}/src/tailwind/types.ts | 0 .../react}/src/tailwind/utilities/borders.ts | 0 .../react}/src/tailwind/utils.test.ts | 0 .../react}/src/tailwind/utils.ts | 0 .../react => account-kit/react/src}/types.ts | 0 account-kit/react/src/version.ts | 3 + .../react}/tsconfig.build.json | 5 +- account-kit/react/tsconfig.json | 6 + .../react}/vitest.config.e2e.ts | 2 +- .../react}/vitest.config.ts | 2 +- .../smart-contracts}/CHANGELOG.md | 0 .../smart-contracts}/package.json | 12 +- .../smart-contracts}/plugindefs/index.ts | 0 .../plugindefs/multi-owner/abi.ts | 0 .../plugindefs/multi-owner/config.ts | 11 +- .../plugindefs/multisig/abi.ts | 0 .../plugindefs/multisig/config.ts | 19 +- .../plugindefs/session-key/abi.ts | 0 .../plugindefs/session-key/config.ts | 11 +- .../smart-contracts}/plugindefs/types.ts | 0 .../smart-contracts/plugingen.config.ts | 18 + .../smart-contracts}/src/index.ts | 6 - .../light-account/abis/LightAccountAbi_v1.ts | 0 .../light-account/abis/LightAccountAbi_v2.ts | 0 .../abis/LightAccountFactoryAbi_v1.ts | 0 .../abis/LightAccountFactoryAbi_v2.ts | 0 .../abis/MultiOwnerLightAccountAbi.ts | 0 .../abis/MultiOwnerLightAccountFactoryAbi.ts | 0 .../light-account/accounts/account.test.ts | 0 .../src/light-account/accounts/account.ts | 0 .../src/light-account/accounts/base.ts | 0 .../src/light-account/accounts/multiOwner.ts | 0 .../actions/transferOwnership.ts | 0 .../src/light-account/actions/updateOwners.ts | 0 .../src/light-account/clients/lightAccount.ts | 0 .../clients/multiOwnerLightAccount.ts | 0 .../light-account/decorators/lightAccount.ts | 0 .../decorators/multiOwnerLightAccount.ts | 0 .../src/light-account/e2e-tests/constants.ts | 0 .../e2e-tests/light-account-v2.e2e.test.ts | 0 .../e2e-tests/light-account.e2e.test.ts | 0 .../multi-owner-light-account.e2e.test.ts | 0 .../src/light-account/schema.ts | 0 .../src/light-account/types.ts | 0 .../src/light-account/utils.ts | 0 .../src/msca/abis/IAccountLoupe.ts | 0 .../smart-contracts/src/msca/abis/IPlugin.ts | 396 ++++++++++ .../src/msca/abis/IPluginManager.ts | 0 .../src/msca/abis/IStandardExecutor.ts | 0 .../abis/MultiOwnerModularAccountFactory.ts | 0 .../abis/MultisigModularAccountFactory.ts | 0 .../msca/abis/UpgradeableModularAccount.ts | 0 .../src/msca/account-loupe/decorator.ts | 0 .../src/msca/account-loupe/types.ts | 0 .../src/msca/account/multiOwnerAccount.ts | 0 .../src/msca/account/multisigAccount.ts | 0 .../src/msca/account/standardExecutor.ts | 0 .../smart-contracts}/src/msca/client.ts | 0 .../src/msca/e2e-tests/constants.ts | 0 .../multisig-modular-account.e2e.test.ts | 0 .../smart-contracts}/src/msca/errors.ts | 0 .../src/msca/plugin-manager/decorator.ts | 0 .../src/msca/plugin-manager/installPlugin.ts | 0 .../msca/plugin-manager/uninstallPlugin.ts | 0 .../src/msca/plugins/multi-owner/extension.ts | 0 .../src/msca/plugins/multi-owner/index.ts | 0 .../src/msca/plugins/multi-owner/plugin.ts | 394 +++++----- .../src/msca/plugins/multi-owner/signer.ts | 0 .../plugins/multisig/actions/getThreshold.ts | 0 .../plugins/multisig/actions/isOwnerOf.ts | 0 .../multisig/actions/proposeUserOperation.ts | 0 .../plugins/multisig/actions/readOwners.ts | 0 .../actions/signMultisigUserOperation.ts | 0 .../src/msca/plugins/multisig/extension.ts | 0 .../src/msca/plugins/multisig/index.ts | 0 .../src/msca/plugins/multisig/middleware.ts | 0 .../src/msca/plugins/multisig/plugin.ts | 444 ++++++----- .../src/msca/plugins/multisig/signer.ts | 0 .../src/msca/plugins/multisig/types.ts | 0 .../multisig/utils/combineSignatures.ts | 0 .../multisig/utils/formatSignatures.ts | 0 .../plugins/multisig/utils/getSignerType.ts | 0 .../src/msca/plugins/multisig/utils/index.ts | 0 .../utils/splitAggregatedSignature.ts | 2 +- .../SessionKeyPermissionsUpdatesAbi.ts | 0 .../src/msca/plugins/session-key/extension.ts | 0 .../src/msca/plugins/session-key/index.ts | 0 .../msca/plugins/session-key/permissions.ts | 0 .../src/msca/plugins/session-key/plugin.ts | 596 +++++++------- .../src/msca/plugins/session-key/signer.ts | 0 .../src/msca/plugins/session-key/utils.ts | 0 .../src/msca/plugins/types.ts | 0 .../smart-contracts}/src/msca/utils.ts | 0 .../smart-contracts/tsconfig.build.json | 18 + account-kit/smart-contracts/tsconfig.json | 8 + .../smart-contracts/vitest.config.e2e.ts | 11 + account-kit/smart-contracts/vitest.config.ts | 11 + examples/ui-demo/package.json | 3 +- package.json | 3 +- packages/accounts/README.md | 46 -- packages/accounts/plugingen/index.ts | 165 ---- .../plugingen/phases/contract-abi-gen.ts | 10 - .../phases/contract-addresses-gen.ts | 18 - .../plugingen/phases/execution-abi-gen.ts | 17 - .../plugingen/phases/plugin-actions/index.ts | 152 ---- .../plugin-actions/management-actions.ts | 146 ---- .../phases/plugin-actions/read-actions.ts | 91 --- .../plugin-generator/get-contract-gen.ts | 30 - .../phases/plugin-generator/index.ts | 25 - .../phases/plugin-generator/meta-gen.ts | 17 - packages/accounts/plugingen/types.ts | 20 - .../nani-account/__tests__/account.test.ts | 108 --- .../src/nani-account/abis/NaniAccountAbi.ts | 307 -------- .../abis/NaniAccountFactoryAbi.ts | 56 -- packages/accounts/src/nani-account/account.ts | 270 ------- packages/accounts/src/nani-account/schema.ts | 29 - .../transferNaniAccountOwnership.ts | 64 -- packages/accounts/src/nani-account/utils.ts | 47 -- packages/accounts/wagmi.config.ts | 39 - packages/alchemy/CHANGELOG.md | 741 ------------------ packages/alchemy/README.md | 51 -- packages/alchemy/src/config/index.ts | 18 - packages/alchemy/src/signer/index.ts | 18 - .../plugingen/src/commands/generate/utils.ts | 26 - packages/plugingen/tsconfig.json | 3 - packages/signers/CHANGELOG.md | 453 ----------- packages/signers/README.md | 34 - packages/signers/package.json | 156 ---- .../src/arcana-auth/__tests__/signer.test.ts | 120 --- packages/signers/src/arcana-auth/index.ts | 2 - packages/signers/src/arcana-auth/signer.ts | 108 --- packages/signers/src/arcana-auth/types.ts | 4 - .../src/capsule/__tests__/signer.test.ts | 130 --- packages/signers/src/capsule/index.ts | 2 - packages/signers/src/capsule/signer.ts | 103 --- packages/signers/src/capsule/types.ts | 53 -- packages/signers/src/constants.ts | 1 - .../fireblocks/__tests__/mock-private-key.txt | 1 - .../src/fireblocks/__tests__/signer.test.ts | 113 --- packages/signers/src/fireblocks/index.ts | 2 - packages/signers/src/fireblocks/signer.ts | 97 --- packages/signers/src/fireblocks/types.ts | 5 - .../src/fordefi/__tests__/signer.test.ts | 127 --- packages/signers/src/fordefi/index.ts | 1 - packages/signers/src/fordefi/signer.ts | 121 --- packages/signers/src/index.ts | 36 - .../src/lit-protocol/__tests__/data.ts | 69 -- .../src/lit-protocol/__tests__/signer.test.ts | 95 --- packages/signers/src/lit-protocol/index.ts | 2 - packages/signers/src/lit-protocol/signer.ts | 232 ------ packages/signers/src/lit-protocol/types.ts | 40 - .../src/magic/__tests__/signer.test.ts | 119 --- packages/signers/src/magic/index.ts | 2 - packages/signers/src/magic/signer.ts | 85 -- packages/signers/src/magic/types.ts | 16 - .../src/particle/__tests__/signer.test.ts | 149 ---- packages/signers/src/particle/index.ts | 2 - packages/signers/src/particle/signer.ts | 141 ---- packages/signers/src/particle/types.ts | 8 - .../src/passport/__tests__/signer.test.ts | 159 ---- packages/signers/src/passport/index.ts | 2 - packages/signers/src/passport/signer.ts | 106 --- packages/signers/src/passport/types.ts | 39 - .../src/portal/__tests__/signer.test.ts | 130 --- packages/signers/src/portal/index.ts | 2 - packages/signers/src/portal/signer.ts | 87 -- packages/signers/src/portal/types.ts | 15 - .../src/turnkey/__tests__/signer.test.ts | 144 ---- packages/signers/src/turnkey/index.ts | 3 - packages/signers/src/turnkey/signer.ts | 102 --- packages/signers/src/turnkey/types.ts | 28 - .../src/web3auth/__tests__/signer.test.ts | 136 ---- packages/signers/src/web3auth/index.ts | 2 - packages/signers/src/web3auth/signer.ts | 105 --- packages/signers/src/web3auth/types.ts | 8 - packages/signers/tsconfig.json | 3 - site/package.json | 7 +- .../get-installed-plugins.md | 4 +- .../install-plugins.md | 11 +- site/pages/getting-started/overview.mdx | 2 +- site/pages/getting-started/setup-app.md | 8 +- site/pages/index.mdx | 2 +- .../pages/migration-guides/migrating-to-v3.md | 6 +- site/pages/packages/aa-accounts/index.md | 8 +- .../actions/transferOwnership.md | 2 +- .../getDefaultLightAccountFactoryAddress.md | 2 +- .../aa-alchemy/light-account-client/index.md | 2 +- .../middleware/alchemyFeeEstimator.md | 2 +- .../middleware/alchemyGasManagerMiddleware.md | 2 +- .../alchemyUserOperationSimulator.md | 2 +- .../multisig-account-client.md | 4 +- .../actions/alchemyEnhancedApiActions.md | 2 +- .../aa-alchemy/smart-account-client/index.md | 2 +- .../aa-alchemy/utils/defineAlchemyChain.md | 2 +- .../actions/buildUserOperationFromTxs.mdx | 4 +- .../actions/sendTransactions.mdx | 2 +- .../actions/signUserOperation.mdx | 2 +- .../actions/upgradeAccount.mdx | 2 +- .../aa-core/smart-account-client/index.md | 2 +- .../smart-account-client/middleware/index.md | 4 +- .../aa-ethers/provider-adapter/constructor.md | 2 +- .../provider-adapter/introduction.md | 2 +- .../aa-signers/arcana-auth/authenticate.md | 52 -- .../aa-signers/arcana-auth/constructor.md | 53 -- .../aa-signers/arcana-auth/getAddress.md | 34 - .../aa-signers/arcana-auth/getAuthDetails.md | 45 -- .../aa-signers/arcana-auth/introduction.md | 86 -- .../aa-signers/arcana-auth/signMessage.md | 40 - .../aa-signers/arcana-auth/signTypedData.md | 73 -- .../aa-signers/capsule/authenticate.md | 48 -- .../aa-signers/capsule/constructor.md | 82 -- .../packages/aa-signers/capsule/getAddress.md | 34 - .../aa-signers/capsule/getAuthDetails.md | 44 -- .../aa-signers/capsule/introduction.md | 68 -- .../aa-signers/capsule/signMessage.md | 38 - .../aa-signers/capsule/signTypedData.md | 73 -- .../pages/packages/aa-signers/contributing.md | 16 - .../aa-signers/fireblocks/authenticate.md | 34 - .../aa-signers/fireblocks/constructor.md | 83 -- .../aa-signers/fireblocks/getAddress.md | 34 - .../aa-signers/fireblocks/getAuthDetails.md | 36 - .../aa-signers/fireblocks/introduction.md | 68 -- .../aa-signers/fireblocks/signMessage.md | 38 - .../aa-signers/fireblocks/signTypedData.md | 73 -- .../aa-signers/fordefi/authenticate.md | 26 - .../aa-signers/fordefi/constructor.md | 44 -- .../packages/aa-signers/fordefi/getAddress.md | 34 - .../aa-signers/fordefi/getAuthDetails.md | 35 - .../aa-signers/fordefi/introduction.md | 71 -- .../aa-signers/fordefi/signMessage.md | 38 - .../aa-signers/fordefi/signTypedData.md | 73 -- site/pages/packages/aa-signers/index.md | 28 - .../aa-signers/lit-protocol/authenticate.md | 86 -- .../aa-signers/lit-protocol/constructor.md | 51 -- .../aa-signers/lit-protocol/getAddress.md | 35 - .../aa-signers/lit-protocol/getAuthDetails.md | 46 -- .../aa-signers/lit-protocol/introduction.md | 34 - .../aa-signers/lit-protocol/signMessage.md | 39 - .../aa-signers/lit-protocol/signTypedData.md | 74 -- .../packages/aa-signers/magic/authenticate.md | 47 -- .../packages/aa-signers/magic/constructor.md | 51 -- .../packages/aa-signers/magic/getAddress.md | 34 - .../aa-signers/magic/getAuthDetails.md | 41 - .../packages/aa-signers/magic/introduction.md | 75 -- .../packages/aa-signers/magic/signMessage.md | 38 - .../aa-signers/magic/signTypedData.md | 73 -- .../aa-signers/particle/authenticate.md | 59 -- .../aa-signers/particle/constructor.md | 92 --- .../aa-signers/particle/getAddress.md | 34 - .../aa-signers/particle/getAuthDetails.md | 34 - .../aa-signers/particle/introduction.md | 71 -- .../aa-signers/particle/signMessage.md | 38 - .../aa-signers/particle/signTypedData.md | 73 -- .../aa-signers/passport/authenticate.md | 65 -- .../aa-signers/passport/constructor.md | 76 -- .../aa-signers/passport/getAddress.md | 34 - .../aa-signers/passport/getAuthDetails.md | 41 - .../aa-signers/passport/introduction.md | 73 -- .../aa-signers/passport/signMessage.md | 38 - .../aa-signers/passport/signTypedData.md | 73 -- .../aa-signers/portal/authenticate.md | 41 - .../packages/aa-signers/portal/constructor.md | 69 -- .../packages/aa-signers/portal/getAddress.md | 34 - .../aa-signers/portal/getAuthDetails.md | 44 -- .../aa-signers/portal/introduction.md | 68 -- .../packages/aa-signers/portal/signMessage.md | 38 - .../aa-signers/portal/signTypedData.md | 73 -- .../aa-signers/turnkey/authenticate.md | 115 --- .../aa-signers/turnkey/constructor.md | 41 - .../packages/aa-signers/turnkey/getAddress.md | 34 - .../aa-signers/turnkey/getAuthDetails.md | 39 - .../aa-signers/turnkey/introduction.md | 93 --- .../aa-signers/turnkey/signMessage.md | 38 - .../aa-signers/turnkey/signTypedData.md | 73 -- .../aa-signers/web3auth/authenticate.md | 63 -- .../aa-signers/web3auth/constructor.md | 101 --- .../aa-signers/web3auth/getAddress.md | 34 - .../aa-signers/web3auth/getAuthDetails.md | 49 -- .../aa-signers/web3auth/introduction.md | 70 -- .../aa-signers/web3auth/signMessage.md | 38 - .../aa-signers/web3auth/signTypedData.md | 73 -- site/pages/packages/index.md | 20 - site/pages/react/createConfig.mdx | 10 +- site/pages/react/overview.mdx | 10 +- site/pages/react/ssr.mdx | 4 +- site/pages/react/useAccount.mdx | 10 +- site/pages/react/useAddPasskey.mdx | 4 +- site/pages/react/useAuthenticate.mdx | 4 +- site/pages/react/useBundlerClient.mdx | 4 +- site/pages/react/useChain.mdx | 4 +- site/pages/react/useClientActions.mdx | 6 +- .../react/useDropAndReplaceUserOperation.mdx | 10 +- site/pages/react/useExportAccount.mdx | 4 +- site/pages/react/useLogout.mdx | 4 +- site/pages/react/useSendTransaction.mdx | 6 +- site/pages/react/useSendTransactions.mdx | 8 +- site/pages/react/useSendUserOperation.mdx | 8 +- site/pages/react/useSignMessage.mdx | 4 +- site/pages/react/useSignTypedData.mdx | 4 +- site/pages/react/useSigner.mdx | 4 +- site/pages/react/useSignerStatus.mdx | 4 +- site/pages/react/useSmartAccountClient.mdx | 12 +- site/pages/react/useUser.mdx | 4 +- .../useWaitForUserOperationTransaction.mdx | 6 +- site/pages/resources/react-native.mdx | 4 +- site/pages/resources/types.mdx | 48 +- site/pages/signers/contributing.md | 110 --- site/pages/signers/guides/arcana-auth.md | 68 -- site/pages/signers/guides/capsule.md | 86 -- site/pages/signers/guides/custom-signer.md | 8 +- site/pages/signers/guides/dfns.md | 63 -- site/pages/signers/guides/dynamic.md | 90 --- site/pages/signers/guides/fireblocks.md | 66 -- site/pages/signers/guides/lit.md | 87 -- site/pages/signers/guides/magic.md | 67 -- site/pages/signers/guides/particle-network.md | 74 -- site/pages/signers/guides/passport.md | 70 -- site/pages/signers/guides/portal.md | 65 -- site/pages/signers/guides/privy.md | 53 -- site/pages/signers/guides/turnkey.md | 70 -- site/pages/signers/guides/walletkit.md | 99 --- site/pages/signers/guides/web3auth.md | 65 -- .../smart-accounts/custom/using-your-own.md | 8 +- .../modular-account/getting-started.md | 10 +- .../multisig-plugin/getting-started.md | 8 +- .../modular-account/upgrade-la-to-ma.md | 8 +- .../session-keys/getting-started.md | 10 +- .../session-keys/supported-permissions.md | 2 +- .../transfer-ownership/light-account.md | 2 +- .../transfer-ownership/modular-account.md | 6 +- .../multi-owner-light-account.md | 2 +- .../aa-accounts/lightAccountClient.ts | 2 +- site/snippets/aa-alchemy/base-client.ts | 2 +- site/snippets/aa-alchemy/connected-client.ts | 2 +- .../snippets/aa-alchemy/gas-manager-client.ts | 2 +- .../aa-alchemy/light-account-client.ts | 2 +- site/snippets/aa-alchemy/light-account.ts | 2 +- .../multi-owner-light-account-client.ts | 2 +- .../aa-alchemy/multi-owner-light-account.ts | 2 +- site/snippets/aa-core/custom-account.ts | 25 +- site/snippets/aa-core/lightAccountClient.ts | 2 +- site/snippets/aa-core/send-uo-param.mdx | 4 +- site/snippets/aa-core/smartAccountClient.ts | 2 +- site/snippets/aa-ethers/ethers-signer.ts | 2 +- site/snippets/enhanced-apis-example/nft.ts | 2 +- site/snippets/enhanced-apis-example/token.ts | 2 +- .../log-in-users/LogInCard-2.tsx | 2 +- .../log-in-users/ProfileCard.tsx | 2 +- .../getting-started/log-in-users/page-2.tsx | 2 +- .../getting-started/send-uos/ProfileCard.tsx | 2 +- .../getting-started/send-uos/SendUOButton.tsx | 2 +- .../getting-started/setup-app/config.ts | 2 +- .../getting-started/setup-app/layout.tsx | 2 +- .../getting-started/setup-app/providers.tsx | 4 +- site/snippets/nani-account.ts | 4 +- site/snippets/react/app.tsx | 2 +- site/snippets/react/config.ts | 2 +- site/snippets/react/login.tsx | 2 +- site/snippets/react/multi-chain-config.ts | 2 +- site/snippets/react/useAccount.tsx | 2 +- site/snippets/react/useAddPasskey.tsx | 2 +- site/snippets/react/useBundlerClient.tsx | 2 +- site/snippets/react/useChain.tsx | 2 +- site/snippets/react/useClientActions.tsx | 7 +- .../react/useDropAndReplaceUserOperation.tsx | 2 +- site/snippets/react/useExportAccount.tsx | 2 +- site/snippets/react/useLogout.tsx | 2 +- site/snippets/react/useSendTransaction.tsx | 5 +- site/snippets/react/useSendTransactions.tsx | 5 +- site/snippets/react/useSendUserOperation.tsx | 2 +- .../react/useSendUserOperationWithRetries.tsx | 2 +- site/snippets/react/useSignMessage.tsx | 5 +- site/snippets/react/useSignTypedData.tsx | 5 +- site/snippets/react/useSigner.tsx | 2 +- site/snippets/react/useSignerStatus.tsx | 2 +- site/snippets/react/useSmartAccountClient.tsx | 2 +- site/snippets/react/useUser.tsx | 2 +- .../useWaitForUserOperationTransaction.tsx | 2 +- site/snippets/send-uo-example/full-example.ts | 2 +- site/snippets/session-keys/add-session-key.ts | 2 +- site/snippets/session-keys/base-client.ts | 4 +- site/snippets/session-keys/full-example.ts | 4 +- .../session-keys/supported-permissions.ts | 2 +- .../session-keys/update-session-key.ts | 2 +- .../signers/alchemy/SignupLoginComponent.tsx | 2 +- .../alchemy/components/PasskeyAuth.tsx | 2 +- .../alchemy/components/PasskeySignup.tsx | 2 +- site/snippets/signers/alchemy/signer.ts | 2 +- site/snippets/signers/arcana-auth.ts | 19 - site/snippets/signers/capsule.ts | 21 - site/snippets/signers/dfns.ts | 42 - site/snippets/signers/dynamic.ts | 13 - site/snippets/signers/fireblocks.ts | 15 - site/snippets/signers/fordefi.ts | 17 - site/snippets/signers/lit.ts | 13 - site/snippets/signers/magic.ts | 16 - site/snippets/signers/particle.ts | 28 - site/snippets/signers/passport.ts | 28 - site/snippets/signers/portal.ts | 14 - site/snippets/signers/privy.ts | 49 -- site/snippets/signers/turnkey.ts | 31 - site/snippets/signers/web3auth.ts | 21 - site/snippets/sim-uo-example/sim-method.ts | 2 +- .../snippets/sim-uo-example/sim-middleware.ts | 2 +- yarn.lock | 292 +------ 716 files changed, 1956 insertions(+), 13446 deletions(-) rename {packages => aa-sdk}/core/CHANGELOG.md (100%) rename {packages => aa-sdk}/core/README.md (100%) rename {packages => aa-sdk}/core/e2e-tests/constants.ts (100%) rename {packages => aa-sdk}/core/e2e-tests/simple-account-staging.e2e.test.ts (100%) rename {packages => aa-sdk}/core/e2e-tests/simple-account.e2e.test.ts (100%) rename {packages/alchemy => aa-sdk/core}/inject-version.ts (100%) rename {packages => aa-sdk}/core/package.json (100%) rename {packages => aa-sdk}/core/src/__tests__/utils.test.ts (100%) rename {packages => aa-sdk}/core/src/abis/EntryPointAbi_v6.ts (100%) rename {packages => aa-sdk}/core/src/abis/EntryPointAbi_v7.ts (100%) rename {packages => aa-sdk}/core/src/abis/SimpleAccountAbi_v6.ts (100%) rename {packages => aa-sdk}/core/src/abis/SimpleAccountAbi_v7.ts (100%) rename {packages => aa-sdk}/core/src/abis/SimpleAccountFactoryAbi.ts (100%) rename {packages => aa-sdk}/core/src/account/__tests__/simple.test.ts (100%) rename {packages => aa-sdk}/core/src/account/base.ts (100%) rename {packages => aa-sdk}/core/src/account/schema.ts (100%) rename {packages => aa-sdk}/core/src/account/simple.ts (100%) rename {packages => aa-sdk}/core/src/account/smartContractAccount.ts (100%) rename {packages => aa-sdk}/core/src/account/types.ts (100%) rename {packages => aa-sdk}/core/src/actions/bundler/estimateUserOperationGas.ts (100%) rename {packages => aa-sdk}/core/src/actions/bundler/getSupportedEntryPoints.ts (100%) rename {packages => aa-sdk}/core/src/actions/bundler/getUserOperationByHash.ts (100%) rename {packages => aa-sdk}/core/src/actions/bundler/getUserOperationReceipt.ts (100%) rename {packages => aa-sdk}/core/src/actions/bundler/sendRawUserOperation.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/buildUserOperation.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/buildUserOperationFromTx.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/buildUserOperationFromTxs.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/checkGasSponsorshipEligibility.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/dropAndReplaceUserOperation.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/estimateUserOperationGas.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/getAddress.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/internal/initUserOperation.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/internal/runMiddlewareStack.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/internal/sendUserOperation.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/sendTransaction.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/sendTransactions.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/sendUserOperation.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/signMessage.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/signMessageWith6492.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/signTypedData.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/signTypedDataWith6492.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/signUserOperation.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/types.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/upgradeAccount.ts (100%) rename {packages => aa-sdk}/core/src/actions/smartAccount/waitForUserOperationTransacation.ts (100%) rename {packages => aa-sdk}/core/src/chains/index.ts (100%) rename {packages => aa-sdk}/core/src/client/bundlerClient.ts (100%) rename {packages => aa-sdk}/core/src/client/decorators/bundlerClient.ts (100%) rename {packages => aa-sdk}/core/src/client/decorators/smartAccountClient.ts (100%) rename {packages => aa-sdk}/core/src/client/isSmartAccountClient.ts (100%) rename {packages => aa-sdk}/core/src/client/schema.ts (100%) rename {packages => aa-sdk}/core/src/client/smartAccountClient.test.ts (100%) rename {packages => aa-sdk}/core/src/client/smartAccountClient.ts (100%) rename {packages => aa-sdk}/core/src/client/types.ts (100%) rename {packages => aa-sdk}/core/src/ens/utils.ts (100%) rename {packages => aa-sdk}/core/src/entrypoint/0.6.ts (100%) rename {packages => aa-sdk}/core/src/entrypoint/0.7.ts (100%) rename {packages => aa-sdk}/core/src/entrypoint/index.ts (100%) rename {packages => aa-sdk}/core/src/entrypoint/types.ts (100%) rename {packages => aa-sdk}/core/src/errors/account.ts (100%) rename {packages => aa-sdk}/core/src/errors/base.ts (100%) rename {packages => aa-sdk}/core/src/errors/client.ts (100%) rename {packages => aa-sdk}/core/src/errors/entrypoint.ts (100%) rename {packages => aa-sdk}/core/src/errors/signer.ts (100%) rename {packages => aa-sdk}/core/src/errors/transaction.ts (100%) rename {packages => aa-sdk}/core/src/errors/useroperation.ts (100%) rename {packages => aa-sdk}/core/src/index.ts (100%) rename {packages => aa-sdk}/core/src/logger.ts (100%) rename {packages => aa-sdk}/core/src/middleware/actions.ts (100%) rename {packages => aa-sdk}/core/src/middleware/defaults/feeEstimator.ts (100%) rename {packages => aa-sdk}/core/src/middleware/defaults/gasEstimator.ts (100%) rename {packages => aa-sdk}/core/src/middleware/defaults/paymasterAndData.ts (100%) rename {packages => aa-sdk}/core/src/middleware/defaults/userOpSigner.ts (100%) rename {packages => aa-sdk}/core/src/middleware/noopMiddleware.ts (100%) rename {packages => aa-sdk}/core/src/middleware/types.ts (100%) rename {packages => aa-sdk}/core/src/signer/__tests__/local-account.test.ts (100%) rename {packages => aa-sdk}/core/src/signer/__tests__/wallet-client.test.ts (100%) rename {packages => aa-sdk}/core/src/signer/local-account.ts (100%) rename {packages => aa-sdk}/core/src/signer/schema.ts (100%) rename {packages => aa-sdk}/core/src/signer/types.ts (100%) rename {packages => aa-sdk}/core/src/signer/utils.ts (100%) rename {packages => aa-sdk}/core/src/signer/wallet-client.ts (100%) rename {packages => aa-sdk}/core/src/transport/split.ts (100%) rename {packages => aa-sdk}/core/src/types.ts (100%) rename {packages => aa-sdk}/core/src/utils/__tests__/bigint.test.ts (100%) rename {packages => aa-sdk}/core/src/utils/bigint.ts (100%) rename {packages => aa-sdk}/core/src/utils/bytes.ts (100%) rename {packages => aa-sdk}/core/src/utils/defaults.ts (100%) rename {packages => aa-sdk}/core/src/utils/index.ts (100%) rename {packages => aa-sdk}/core/src/utils/schema.ts (100%) rename {packages => aa-sdk}/core/src/utils/stateOverride.ts (100%) rename {packages => aa-sdk}/core/src/utils/testUtils.ts (100%) rename {packages => aa-sdk}/core/src/utils/types.ts (100%) rename {packages => aa-sdk}/core/src/utils/userop.ts (100%) rename {packages/alchemy => aa-sdk/core}/src/version.ts (100%) rename {packages => aa-sdk}/core/tsconfig.build.json (100%) rename {packages/accounts => aa-sdk/core}/tsconfig.json (100%) rename {packages => aa-sdk}/core/vitest.config.e2e.ts (100%) rename {packages => aa-sdk}/core/vitest.config.ts (100%) rename {packages => aa-sdk}/ethers/CHANGELOG.md (100%) rename {packages => aa-sdk}/ethers/README.md (100%) rename {packages => aa-sdk}/ethers/e2e-tests/constants.ts (100%) rename {packages => aa-sdk}/ethers/e2e-tests/simple-account.e2e.test.ts (100%) rename {packages => aa-sdk}/ethers/package.json (100%) rename {packages => aa-sdk}/ethers/src/__tests__/provider-adapter.test.ts (100%) rename {packages => aa-sdk}/ethers/src/account-signer.ts (100%) rename {packages => aa-sdk}/ethers/src/index.ts (100%) rename {packages => aa-sdk}/ethers/src/provider-adapter.ts (100%) rename {packages => aa-sdk}/ethers/src/types.ts (100%) rename {packages => aa-sdk}/ethers/src/utils.ts (100%) rename {packages => aa-sdk}/ethers/tsconfig.build.json (100%) rename {packages/core => aa-sdk/ethers}/tsconfig.json (100%) rename {packages => aa-sdk}/ethers/vitest.config.e2e.ts (100%) rename {packages => aa-sdk}/ethers/vitest.config.ts (100%) rename {packages => aa-sdk}/plugingen/CHANGELOG.md (100%) rename {packages/core => aa-sdk/plugingen}/inject-version.ts (100%) rename {packages => aa-sdk}/plugingen/package.json (100%) rename {packages/accounts/src/msca/abis => aa-sdk/plugingen/src}/IPlugin.ts (100%) rename {packages => aa-sdk}/plugingen/src/cli.ts (100%) rename {packages => aa-sdk}/plugingen/src/commands/generate/index.ts (99%) rename {packages => aa-sdk}/plugingen/src/commands/generate/phases/contract-abi-gen.ts (100%) rename {packages => aa-sdk}/plugingen/src/commands/generate/phases/contract-addresses-gen.ts (100%) rename {packages => aa-sdk}/plugingen/src/commands/generate/phases/execution-abi-gen.ts (100%) rename {packages => aa-sdk}/plugingen/src/commands/generate/phases/plugin-actions/index.ts (97%) rename {packages => aa-sdk}/plugingen/src/commands/generate/phases/plugin-actions/management-actions.ts (94%) rename {packages => aa-sdk}/plugingen/src/commands/generate/phases/plugin-actions/read-actions.ts (94%) rename {packages => aa-sdk}/plugingen/src/commands/generate/phases/plugin-generator/get-contract-gen.ts (100%) rename {packages => aa-sdk}/plugingen/src/commands/generate/phases/plugin-generator/index.ts (89%) rename {packages => aa-sdk}/plugingen/src/commands/generate/phases/plugin-generator/meta-gen.ts (100%) rename {packages => aa-sdk}/plugingen/src/commands/generate/types.ts (90%) rename {packages/accounts/plugingen => aa-sdk/plugingen/src/commands/generate}/utils.ts (100%) rename {packages => aa-sdk}/plugingen/src/commands/init.ts (100%) rename {packages => aa-sdk}/plugingen/src/config.ts (100%) rename {packages => aa-sdk}/plugingen/src/errors.ts (100%) rename {packages => aa-sdk}/plugingen/src/exports/config.ts (100%) rename {packages => aa-sdk}/plugingen/src/exports/index.ts (100%) create mode 100644 aa-sdk/plugingen/src/exports/types.ts rename {packages => aa-sdk}/plugingen/src/logger.ts (100%) rename {packages => aa-sdk}/plugingen/src/types.ts (100%) rename {packages => aa-sdk}/plugingen/src/utils/findConfig.ts (100%) rename {packages => aa-sdk}/plugingen/src/utils/format.ts (100%) rename {packages => aa-sdk}/plugingen/src/utils/isUsingTypescript.ts (100%) rename {packages => aa-sdk}/plugingen/src/utils/loadEnv.ts (100%) rename {packages => aa-sdk}/plugingen/src/utils/resolveConfig.ts (100%) rename {packages/core => aa-sdk/plugingen}/src/version.ts (100%) rename {packages => aa-sdk}/plugingen/tsconfig.build.json (100%) rename {packages/ethers => aa-sdk/plugingen}/tsconfig.json (100%) rename {packages => aa-sdk}/plugingen/vitest.config.e2e.ts (100%) rename {packages => aa-sdk}/plugingen/vitest.config.ts (100%) rename {packages/plugingen => account-kit/core}/inject-version.ts (100%) create mode 100644 account-kit/core/package.json rename {packages/alchemy/src/config => account-kit/core/src}/actions/createAccount.ts (96%) rename {packages/alchemy/src/config => account-kit/core/src}/actions/getAccount.ts (98%) rename {packages/alchemy/src/config => account-kit/core/src}/actions/getBundlerClient.ts (75%) rename {packages/alchemy/src/config => account-kit/core/src}/actions/getChain.ts (100%) rename {packages/alchemy/src/config => account-kit/core/src}/actions/getConnection.ts (99%) rename {packages/alchemy/src/config => account-kit/core/src}/actions/getSigner.ts (80%) rename {packages/alchemy/src/config => account-kit/core/src}/actions/getSignerStatus.ts (100%) rename {packages/alchemy/src/config => account-kit/core/src}/actions/getUser.ts (92%) rename {packages/alchemy/src/config => account-kit/core/src}/actions/reconnect.ts (96%) rename {packages/alchemy/src/config => account-kit/core/src}/actions/setChain.ts (86%) rename {packages/alchemy/src/config => account-kit/core/src}/actions/watchAccount.ts (98%) rename {packages/alchemy/src/config => account-kit/core/src}/actions/watchBundlerClient.ts (81%) rename {packages/alchemy/src/config => account-kit/core/src}/actions/watchChain.ts (100%) rename {packages/alchemy/src/config => account-kit/core/src}/actions/watchConnection.ts (100%) rename {packages/alchemy/src/config => account-kit/core/src}/actions/watchSigner.ts (79%) rename {packages/alchemy/src/config => account-kit/core/src}/actions/watchSignerStatus.ts (85%) rename {packages/alchemy/src/config => account-kit/core/src}/actions/watchUser.ts (86%) rename {packages/alchemy/src/config => account-kit/core/src}/createConfig.ts (97%) rename {packages/alchemy/src/config => account-kit/core/src}/errors.ts (64%) rename {packages/alchemy/src/config => account-kit/core/src}/hydrate.ts (97%) create mode 100644 account-kit/core/src/index.ts rename {packages/alchemy/src/config => account-kit/core/src}/store/client.ts (96%) rename {packages/alchemy/src/config => account-kit/core/src}/store/core.ts (96%) rename {packages/alchemy/src/config => account-kit/core/src}/store/types.ts (91%) rename {packages/alchemy/src/config => account-kit/core/src}/types.ts (85%) rename {packages/alchemy/src/config => account-kit/core/src}/utils/cookies.ts (95%) rename {packages/alchemy/src/config => account-kit/core/src}/utils/deserialize.ts (100%) rename {packages/alchemy/src/config => account-kit/core/src}/utils/replacer.ts (100%) rename {packages/alchemy/src/config => account-kit/core/src}/utils/reviver.ts (100%) rename {packages/plugingen => account-kit/core}/src/version.ts (100%) rename {packages/alchemy => account-kit/core}/tsconfig.build.json (100%) rename {packages/alchemy => account-kit/core}/tsconfig.json (100%) rename {packages/signers => account-kit/core}/vitest.config.e2e.ts (82%) rename {packages/signers => account-kit/core}/vitest.config.ts (85%) rename {packages/alchemy => account-kit/infra}/e2e-tests/constants.ts (100%) rename {packages/alchemy => account-kit/infra}/e2e-tests/light-account.e2e.test.ts (100%) rename {packages/alchemy => account-kit/infra}/e2e-tests/modular-account-multi-owner.e2e.test.ts (100%) rename {packages/alchemy => account-kit/infra}/e2e-tests/multi-owner-light-account.e2e.test.ts (100%) rename {packages/alchemy => account-kit/infra}/e2e-tests/multisig-account.e2e.test.ts (100%) rename {packages/alchemy => account-kit/infra}/e2e-tests/simple-account-v7.e2e.test.ts (100%) create mode 100644 account-kit/infra/inject-version.ts create mode 100644 account-kit/infra/package.json rename {packages/alchemy => account-kit/infra}/src/actions/simulateUserOperationChanges.ts (94%) rename {packages/alchemy => account-kit/infra}/src/actions/types.ts (100%) rename {packages/alchemy => account-kit/infra}/src/chains.ts (100%) rename {packages/alchemy => account-kit/infra}/src/client/__snapshots__/lightAccountClient.test.ts.snap (100%) rename {packages/alchemy => account-kit/infra}/src/client/__snapshots__/multiOwnerLightAccountClient.test.ts.snap (100%) rename {packages/alchemy => account-kit/infra}/src/client/decorators/alchemyEnhancedApis.ts (100%) rename {packages/alchemy => account-kit/infra}/src/client/decorators/smartAccount.ts (100%) rename {packages/alchemy => account-kit/infra}/src/client/internal/smartAccountClientFromRpc.ts (97%) rename {packages/alchemy => account-kit/infra}/src/client/isAlchemySmartAccountClient.ts (100%) rename {packages/alchemy => account-kit/infra}/src/client/lightAccountClient.test.ts (100%) rename {packages/alchemy => account-kit/infra}/src/client/lightAccountClient.ts (97%) rename {packages/alchemy => account-kit/infra}/src/client/modularAccountClient.ts (96%) rename {packages/alchemy => account-kit/infra}/src/client/multiOwnerLightAccountClient.test.ts (100%) rename {packages/alchemy => account-kit/infra}/src/client/multiOwnerLightAccountClient.ts (98%) rename {packages/alchemy => account-kit/infra}/src/client/multisigAccountClient.ts (97%) rename {packages/alchemy => account-kit/infra}/src/client/rpcClient.ts (100%) rename {packages/alchemy => account-kit/infra}/src/client/smartAccountClient.test.ts (98%) rename {packages/alchemy => account-kit/infra}/src/client/smartAccountClient.ts (100%) rename {packages/alchemy => account-kit/infra}/src/client/types.ts (100%) rename {packages/alchemy => account-kit/infra}/src/defaults.ts (100%) rename {packages/alchemy => account-kit/infra}/src/errors/base.ts (100%) rename {packages/alchemy => account-kit/infra}/src/errors/rpcUrl.ts (100%) rename {packages/alchemy => account-kit/infra}/src/gas-manager.ts (100%) rename {packages/alchemy => account-kit/infra}/src/index.ts (73%) rename {packages/alchemy => account-kit/infra}/src/middleware/feeEstimator.ts (100%) rename {packages/alchemy => account-kit/infra}/src/middleware/gasManager.ts (100%) rename {packages/alchemy => account-kit/infra}/src/middleware/userOperationSimulator.ts (100%) rename {packages/alchemy => account-kit/infra}/src/schema.ts (100%) rename {packages/alchemy => account-kit/infra}/src/signer/base.ts (100%) rename {packages/alchemy => account-kit/infra}/src/signer/client/base.ts (99%) rename {packages/alchemy => account-kit/infra}/src/signer/client/index.ts (99%) rename {packages/alchemy => account-kit/infra}/src/signer/client/types.ts (100%) rename {packages/alchemy => account-kit/infra}/src/signer/errors.ts (100%) create mode 100644 account-kit/infra/src/signer/index.ts rename {packages/alchemy => account-kit/infra}/src/signer/session/manager.ts (100%) rename {packages/alchemy => account-kit/infra}/src/signer/session/types.ts (100%) rename {packages/alchemy => account-kit/infra}/src/signer/signer.ts (93%) rename {packages/alchemy => account-kit/infra}/src/signer/types.ts (100%) rename {packages/alchemy => account-kit/infra}/src/signer/utils/base64UrlEncode.ts (100%) rename {packages/alchemy => account-kit/infra}/src/signer/utils/generateRandomBuffer.ts (100%) rename {packages/alchemy => account-kit/infra}/src/type.ts (100%) create mode 100644 account-kit/infra/src/version.ts rename {packages/signers => account-kit/infra}/tsconfig.build.json (85%) create mode 100644 account-kit/infra/tsconfig.json rename {packages/alchemy => account-kit/infra}/vitest.config.e2e.ts (100%) rename {packages/alchemy => account-kit/infra}/vitest.config.ts (100%) create mode 100644 account-kit/react/inject-version.ts rename {packages/alchemy => account-kit/react}/package.json (69%) rename {packages/alchemy/src/react => account-kit/react/src}/components/auth/card/add-passkey.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/auth/card/content.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/auth/card/eoa.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/auth/card/index.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/auth/card/loading/email.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/auth/card/loading/index.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/auth/card/loading/passkey.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/auth/card/main.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/auth/card/passkey-added.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/auth/card/steps.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/auth/context.ts (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/auth/hooks/usePasskeyVerify.ts (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/auth/modal.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/auth/sections/AuthSection.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/auth/sections/EmailAuth.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/auth/sections/InjectedProvidersAuth.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/auth/sections/PasskeyAuth.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/auth/types.ts (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/button.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/constants.ts (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/divider.tsx (100%) create mode 100644 account-kit/react/src/components/error.tsx rename {packages/alchemy/src/react => account-kit/react/src}/components/input.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/navigation.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/notification.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/components/poweredby.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/context.tsx (98%) rename {packages/alchemy/src/react => account-kit/react/src}/errors.ts (82%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useAccount.ts (91%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useAddPasskey.ts (100%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useAuthError.ts (100%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useAuthModal.ts (100%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useAuthenticate.ts (87%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useBundlerClient.ts (66%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useChain.ts (85%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useClientActions.ts (98%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useConnect.ts (100%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useConnection.ts (73%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useDropAndReplaceUserOperation.ts (97%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useExportAccount.ts (96%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useLogout.ts (100%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useSendTransaction.ts (100%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useSendTransactions.ts (98%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useSendUserOperation.ts (98%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useSignMessage.ts (100%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useSignTypedData.ts (100%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useSigner.ts (70%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useSignerStatus.ts (69%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useSmartAccountClient.ts (82%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useUser.ts (85%) rename {packages/alchemy/src/react => account-kit/react/src}/hooks/useWaitForUserOperationTransaction.ts (100%) rename {packages/alchemy/src/react => account-kit/react/src}/hydrate.ts (88%) rename {packages/alchemy/src/react => account-kit/react/src}/icons/alchemy.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/icons/chevron.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/icons/google.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/icons/hourglass.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/icons/mail.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/icons/nav.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/icons/passkey.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/icons/spinner.tsx (100%) rename {packages/alchemy/src/react => account-kit/react/src}/index.ts (96%) rename {packages/alchemy/src/react => account-kit/react/src}/strings.ts (100%) rename {packages/alchemy => account-kit/react}/src/tailwind/components/buttons.ts (100%) rename {packages/alchemy => account-kit/react}/src/tailwind/components/colorsvars.ts (100%) rename {packages/alchemy => account-kit/react}/src/tailwind/components/form-controls.ts (100%) rename {packages/alchemy => account-kit/react}/src/tailwind/components/input.ts (100%) rename {packages/alchemy => account-kit/react}/src/tailwind/components/modal.ts (100%) rename {packages/alchemy => account-kit/react}/src/tailwind/index.ts (100%) rename {packages/alchemy => account-kit/react}/src/tailwind/plugin.ts (99%) rename {packages/alchemy => account-kit/react}/src/tailwind/theme.ts (100%) rename {packages/alchemy => account-kit/react}/src/tailwind/types.ts (100%) rename {packages/alchemy => account-kit/react}/src/tailwind/utilities/borders.ts (100%) rename {packages/alchemy => account-kit/react}/src/tailwind/utils.test.ts (100%) rename {packages/alchemy => account-kit/react}/src/tailwind/utils.ts (100%) rename {packages/alchemy/src/react => account-kit/react/src}/types.ts (100%) create mode 100644 account-kit/react/src/version.ts rename {packages/accounts => account-kit/react}/tsconfig.build.json (77%) create mode 100644 account-kit/react/tsconfig.json rename {packages/accounts => account-kit/react}/vitest.config.e2e.ts (90%) rename {packages/accounts => account-kit/react}/vitest.config.ts (92%) rename {packages/accounts => account-kit/smart-contracts}/CHANGELOG.md (100%) rename {packages/accounts => account-kit/smart-contracts}/package.json (87%) rename {packages/accounts => account-kit/smart-contracts}/plugindefs/index.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/plugindefs/multi-owner/abi.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/plugindefs/multi-owner/config.ts (92%) rename {packages/accounts => account-kit/smart-contracts}/plugindefs/multisig/abi.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/plugindefs/multisig/config.ts (91%) rename {packages/accounts => account-kit/smart-contracts}/plugindefs/session-key/abi.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/plugindefs/session-key/config.ts (93%) rename {packages/accounts => account-kit/smart-contracts}/plugindefs/types.ts (100%) create mode 100644 account-kit/smart-contracts/plugingen.config.ts rename {packages/accounts => account-kit/smart-contracts}/src/index.ts (93%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/abis/LightAccountAbi_v1.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/abis/LightAccountAbi_v2.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/abis/LightAccountFactoryAbi_v1.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/abis/LightAccountFactoryAbi_v2.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/abis/MultiOwnerLightAccountAbi.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/abis/MultiOwnerLightAccountFactoryAbi.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/accounts/account.test.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/accounts/account.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/accounts/base.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/accounts/multiOwner.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/actions/transferOwnership.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/actions/updateOwners.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/clients/lightAccount.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/clients/multiOwnerLightAccount.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/decorators/lightAccount.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/decorators/multiOwnerLightAccount.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/e2e-tests/constants.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/e2e-tests/light-account-v2.e2e.test.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/e2e-tests/light-account.e2e.test.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/e2e-tests/multi-owner-light-account.e2e.test.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/schema.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/types.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/light-account/utils.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/abis/IAccountLoupe.ts (100%) create mode 100644 account-kit/smart-contracts/src/msca/abis/IPlugin.ts rename {packages/accounts => account-kit/smart-contracts}/src/msca/abis/IPluginManager.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/abis/IStandardExecutor.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/abis/MultiOwnerModularAccountFactory.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/abis/MultisigModularAccountFactory.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/abis/UpgradeableModularAccount.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/account-loupe/decorator.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/account-loupe/types.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/account/multiOwnerAccount.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/account/multisigAccount.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/account/standardExecutor.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/client.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/e2e-tests/constants.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/e2e-tests/multisig-modular-account.e2e.test.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/errors.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugin-manager/decorator.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugin-manager/installPlugin.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugin-manager/uninstallPlugin.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multi-owner/extension.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multi-owner/index.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multi-owner/plugin.ts (74%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multi-owner/signer.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multisig/actions/getThreshold.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multisig/actions/isOwnerOf.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multisig/actions/proposeUserOperation.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multisig/actions/readOwners.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multisig/actions/signMultisigUserOperation.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multisig/extension.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multisig/index.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multisig/middleware.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multisig/plugin.ts (72%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multisig/signer.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multisig/types.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multisig/utils/combineSignatures.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multisig/utils/formatSignatures.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multisig/utils/getSignerType.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multisig/utils/index.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/multisig/utils/splitAggregatedSignature.ts (98%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/session-key/SessionKeyPermissionsUpdatesAbi.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/session-key/extension.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/session-key/index.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/session-key/permissions.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/session-key/plugin.ts (73%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/session-key/signer.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/session-key/utils.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/plugins/types.ts (100%) rename {packages/accounts => account-kit/smart-contracts}/src/msca/utils.ts (100%) create mode 100644 account-kit/smart-contracts/tsconfig.build.json create mode 100644 account-kit/smart-contracts/tsconfig.json create mode 100644 account-kit/smart-contracts/vitest.config.e2e.ts create mode 100644 account-kit/smart-contracts/vitest.config.ts delete mode 100644 packages/accounts/README.md delete mode 100644 packages/accounts/plugingen/index.ts delete mode 100644 packages/accounts/plugingen/phases/contract-abi-gen.ts delete mode 100644 packages/accounts/plugingen/phases/contract-addresses-gen.ts delete mode 100644 packages/accounts/plugingen/phases/execution-abi-gen.ts delete mode 100644 packages/accounts/plugingen/phases/plugin-actions/index.ts delete mode 100644 packages/accounts/plugingen/phases/plugin-actions/management-actions.ts delete mode 100644 packages/accounts/plugingen/phases/plugin-actions/read-actions.ts delete mode 100644 packages/accounts/plugingen/phases/plugin-generator/get-contract-gen.ts delete mode 100644 packages/accounts/plugingen/phases/plugin-generator/index.ts delete mode 100644 packages/accounts/plugingen/phases/plugin-generator/meta-gen.ts delete mode 100644 packages/accounts/plugingen/types.ts delete mode 100644 packages/accounts/src/nani-account/__tests__/account.test.ts delete mode 100644 packages/accounts/src/nani-account/abis/NaniAccountAbi.ts delete mode 100644 packages/accounts/src/nani-account/abis/NaniAccountFactoryAbi.ts delete mode 100644 packages/accounts/src/nani-account/account.ts delete mode 100644 packages/accounts/src/nani-account/schema.ts delete mode 100644 packages/accounts/src/nani-account/transferNaniAccountOwnership.ts delete mode 100644 packages/accounts/src/nani-account/utils.ts delete mode 100644 packages/accounts/wagmi.config.ts delete mode 100644 packages/alchemy/CHANGELOG.md delete mode 100644 packages/alchemy/README.md delete mode 100644 packages/alchemy/src/config/index.ts delete mode 100644 packages/alchemy/src/signer/index.ts delete mode 100644 packages/plugingen/src/commands/generate/utils.ts delete mode 100644 packages/plugingen/tsconfig.json delete mode 100644 packages/signers/CHANGELOG.md delete mode 100644 packages/signers/README.md delete mode 100644 packages/signers/package.json delete mode 100644 packages/signers/src/arcana-auth/__tests__/signer.test.ts delete mode 100644 packages/signers/src/arcana-auth/index.ts delete mode 100644 packages/signers/src/arcana-auth/signer.ts delete mode 100644 packages/signers/src/arcana-auth/types.ts delete mode 100644 packages/signers/src/capsule/__tests__/signer.test.ts delete mode 100644 packages/signers/src/capsule/index.ts delete mode 100644 packages/signers/src/capsule/signer.ts delete mode 100644 packages/signers/src/capsule/types.ts delete mode 100644 packages/signers/src/constants.ts delete mode 100644 packages/signers/src/fireblocks/__tests__/mock-private-key.txt delete mode 100644 packages/signers/src/fireblocks/__tests__/signer.test.ts delete mode 100644 packages/signers/src/fireblocks/index.ts delete mode 100644 packages/signers/src/fireblocks/signer.ts delete mode 100644 packages/signers/src/fireblocks/types.ts delete mode 100644 packages/signers/src/fordefi/__tests__/signer.test.ts delete mode 100644 packages/signers/src/fordefi/index.ts delete mode 100644 packages/signers/src/fordefi/signer.ts delete mode 100644 packages/signers/src/index.ts delete mode 100644 packages/signers/src/lit-protocol/__tests__/data.ts delete mode 100644 packages/signers/src/lit-protocol/__tests__/signer.test.ts delete mode 100644 packages/signers/src/lit-protocol/index.ts delete mode 100644 packages/signers/src/lit-protocol/signer.ts delete mode 100644 packages/signers/src/lit-protocol/types.ts delete mode 100644 packages/signers/src/magic/__tests__/signer.test.ts delete mode 100644 packages/signers/src/magic/index.ts delete mode 100644 packages/signers/src/magic/signer.ts delete mode 100644 packages/signers/src/magic/types.ts delete mode 100644 packages/signers/src/particle/__tests__/signer.test.ts delete mode 100644 packages/signers/src/particle/index.ts delete mode 100644 packages/signers/src/particle/signer.ts delete mode 100644 packages/signers/src/particle/types.ts delete mode 100644 packages/signers/src/passport/__tests__/signer.test.ts delete mode 100644 packages/signers/src/passport/index.ts delete mode 100644 packages/signers/src/passport/signer.ts delete mode 100644 packages/signers/src/passport/types.ts delete mode 100644 packages/signers/src/portal/__tests__/signer.test.ts delete mode 100644 packages/signers/src/portal/index.ts delete mode 100644 packages/signers/src/portal/signer.ts delete mode 100644 packages/signers/src/portal/types.ts delete mode 100644 packages/signers/src/turnkey/__tests__/signer.test.ts delete mode 100644 packages/signers/src/turnkey/index.ts delete mode 100644 packages/signers/src/turnkey/signer.ts delete mode 100644 packages/signers/src/turnkey/types.ts delete mode 100644 packages/signers/src/web3auth/__tests__/signer.test.ts delete mode 100644 packages/signers/src/web3auth/index.ts delete mode 100644 packages/signers/src/web3auth/signer.ts delete mode 100644 packages/signers/src/web3auth/types.ts delete mode 100644 packages/signers/tsconfig.json delete mode 100644 site/pages/packages/aa-signers/arcana-auth/authenticate.md delete mode 100644 site/pages/packages/aa-signers/arcana-auth/constructor.md delete mode 100644 site/pages/packages/aa-signers/arcana-auth/getAddress.md delete mode 100644 site/pages/packages/aa-signers/arcana-auth/getAuthDetails.md delete mode 100644 site/pages/packages/aa-signers/arcana-auth/introduction.md delete mode 100644 site/pages/packages/aa-signers/arcana-auth/signMessage.md delete mode 100644 site/pages/packages/aa-signers/arcana-auth/signTypedData.md delete mode 100644 site/pages/packages/aa-signers/capsule/authenticate.md delete mode 100644 site/pages/packages/aa-signers/capsule/constructor.md delete mode 100644 site/pages/packages/aa-signers/capsule/getAddress.md delete mode 100644 site/pages/packages/aa-signers/capsule/getAuthDetails.md delete mode 100644 site/pages/packages/aa-signers/capsule/introduction.md delete mode 100644 site/pages/packages/aa-signers/capsule/signMessage.md delete mode 100644 site/pages/packages/aa-signers/capsule/signTypedData.md delete mode 100644 site/pages/packages/aa-signers/contributing.md delete mode 100644 site/pages/packages/aa-signers/fireblocks/authenticate.md delete mode 100644 site/pages/packages/aa-signers/fireblocks/constructor.md delete mode 100644 site/pages/packages/aa-signers/fireblocks/getAddress.md delete mode 100644 site/pages/packages/aa-signers/fireblocks/getAuthDetails.md delete mode 100644 site/pages/packages/aa-signers/fireblocks/introduction.md delete mode 100644 site/pages/packages/aa-signers/fireblocks/signMessage.md delete mode 100644 site/pages/packages/aa-signers/fireblocks/signTypedData.md delete mode 100644 site/pages/packages/aa-signers/fordefi/authenticate.md delete mode 100644 site/pages/packages/aa-signers/fordefi/constructor.md delete mode 100644 site/pages/packages/aa-signers/fordefi/getAddress.md delete mode 100644 site/pages/packages/aa-signers/fordefi/getAuthDetails.md delete mode 100644 site/pages/packages/aa-signers/fordefi/introduction.md delete mode 100644 site/pages/packages/aa-signers/fordefi/signMessage.md delete mode 100644 site/pages/packages/aa-signers/fordefi/signTypedData.md delete mode 100644 site/pages/packages/aa-signers/index.md delete mode 100644 site/pages/packages/aa-signers/lit-protocol/authenticate.md delete mode 100644 site/pages/packages/aa-signers/lit-protocol/constructor.md delete mode 100644 site/pages/packages/aa-signers/lit-protocol/getAddress.md delete mode 100644 site/pages/packages/aa-signers/lit-protocol/getAuthDetails.md delete mode 100644 site/pages/packages/aa-signers/lit-protocol/introduction.md delete mode 100644 site/pages/packages/aa-signers/lit-protocol/signMessage.md delete mode 100644 site/pages/packages/aa-signers/lit-protocol/signTypedData.md delete mode 100644 site/pages/packages/aa-signers/magic/authenticate.md delete mode 100644 site/pages/packages/aa-signers/magic/constructor.md delete mode 100644 site/pages/packages/aa-signers/magic/getAddress.md delete mode 100644 site/pages/packages/aa-signers/magic/getAuthDetails.md delete mode 100644 site/pages/packages/aa-signers/magic/introduction.md delete mode 100644 site/pages/packages/aa-signers/magic/signMessage.md delete mode 100644 site/pages/packages/aa-signers/magic/signTypedData.md delete mode 100644 site/pages/packages/aa-signers/particle/authenticate.md delete mode 100644 site/pages/packages/aa-signers/particle/constructor.md delete mode 100644 site/pages/packages/aa-signers/particle/getAddress.md delete mode 100644 site/pages/packages/aa-signers/particle/getAuthDetails.md delete mode 100644 site/pages/packages/aa-signers/particle/introduction.md delete mode 100644 site/pages/packages/aa-signers/particle/signMessage.md delete mode 100644 site/pages/packages/aa-signers/particle/signTypedData.md delete mode 100644 site/pages/packages/aa-signers/passport/authenticate.md delete mode 100644 site/pages/packages/aa-signers/passport/constructor.md delete mode 100644 site/pages/packages/aa-signers/passport/getAddress.md delete mode 100644 site/pages/packages/aa-signers/passport/getAuthDetails.md delete mode 100644 site/pages/packages/aa-signers/passport/introduction.md delete mode 100644 site/pages/packages/aa-signers/passport/signMessage.md delete mode 100644 site/pages/packages/aa-signers/passport/signTypedData.md delete mode 100644 site/pages/packages/aa-signers/portal/authenticate.md delete mode 100644 site/pages/packages/aa-signers/portal/constructor.md delete mode 100644 site/pages/packages/aa-signers/portal/getAddress.md delete mode 100644 site/pages/packages/aa-signers/portal/getAuthDetails.md delete mode 100644 site/pages/packages/aa-signers/portal/introduction.md delete mode 100644 site/pages/packages/aa-signers/portal/signMessage.md delete mode 100644 site/pages/packages/aa-signers/portal/signTypedData.md delete mode 100644 site/pages/packages/aa-signers/turnkey/authenticate.md delete mode 100644 site/pages/packages/aa-signers/turnkey/constructor.md delete mode 100644 site/pages/packages/aa-signers/turnkey/getAddress.md delete mode 100644 site/pages/packages/aa-signers/turnkey/getAuthDetails.md delete mode 100644 site/pages/packages/aa-signers/turnkey/introduction.md delete mode 100644 site/pages/packages/aa-signers/turnkey/signMessage.md delete mode 100644 site/pages/packages/aa-signers/turnkey/signTypedData.md delete mode 100644 site/pages/packages/aa-signers/web3auth/authenticate.md delete mode 100644 site/pages/packages/aa-signers/web3auth/constructor.md delete mode 100644 site/pages/packages/aa-signers/web3auth/getAddress.md delete mode 100644 site/pages/packages/aa-signers/web3auth/getAuthDetails.md delete mode 100644 site/pages/packages/aa-signers/web3auth/introduction.md delete mode 100644 site/pages/packages/aa-signers/web3auth/signMessage.md delete mode 100644 site/pages/packages/aa-signers/web3auth/signTypedData.md delete mode 100644 site/pages/signers/contributing.md delete mode 100644 site/pages/signers/guides/arcana-auth.md delete mode 100644 site/pages/signers/guides/capsule.md delete mode 100644 site/pages/signers/guides/dfns.md delete mode 100644 site/pages/signers/guides/dynamic.md delete mode 100644 site/pages/signers/guides/fireblocks.md delete mode 100644 site/pages/signers/guides/lit.md delete mode 100644 site/pages/signers/guides/magic.md delete mode 100644 site/pages/signers/guides/particle-network.md delete mode 100644 site/pages/signers/guides/passport.md delete mode 100644 site/pages/signers/guides/portal.md delete mode 100644 site/pages/signers/guides/privy.md delete mode 100644 site/pages/signers/guides/turnkey.md delete mode 100644 site/pages/signers/guides/walletkit.md delete mode 100644 site/pages/signers/guides/web3auth.md delete mode 100644 site/snippets/signers/arcana-auth.ts delete mode 100644 site/snippets/signers/capsule.ts delete mode 100644 site/snippets/signers/dfns.ts delete mode 100644 site/snippets/signers/dynamic.ts delete mode 100644 site/snippets/signers/fireblocks.ts delete mode 100644 site/snippets/signers/fordefi.ts delete mode 100644 site/snippets/signers/lit.ts delete mode 100644 site/snippets/signers/magic.ts delete mode 100644 site/snippets/signers/particle.ts delete mode 100644 site/snippets/signers/passport.ts delete mode 100644 site/snippets/signers/portal.ts delete mode 100644 site/snippets/signers/privy.ts delete mode 100644 site/snippets/signers/turnkey.ts delete mode 100644 site/snippets/signers/web3auth.ts diff --git a/packages/core/CHANGELOG.md b/aa-sdk/core/CHANGELOG.md similarity index 100% rename from packages/core/CHANGELOG.md rename to aa-sdk/core/CHANGELOG.md diff --git a/packages/core/README.md b/aa-sdk/core/README.md similarity index 100% rename from packages/core/README.md rename to aa-sdk/core/README.md diff --git a/packages/core/e2e-tests/constants.ts b/aa-sdk/core/e2e-tests/constants.ts similarity index 100% rename from packages/core/e2e-tests/constants.ts rename to aa-sdk/core/e2e-tests/constants.ts diff --git a/packages/core/e2e-tests/simple-account-staging.e2e.test.ts b/aa-sdk/core/e2e-tests/simple-account-staging.e2e.test.ts similarity index 100% rename from packages/core/e2e-tests/simple-account-staging.e2e.test.ts rename to aa-sdk/core/e2e-tests/simple-account-staging.e2e.test.ts diff --git a/packages/core/e2e-tests/simple-account.e2e.test.ts b/aa-sdk/core/e2e-tests/simple-account.e2e.test.ts similarity index 100% rename from packages/core/e2e-tests/simple-account.e2e.test.ts rename to aa-sdk/core/e2e-tests/simple-account.e2e.test.ts diff --git a/packages/alchemy/inject-version.ts b/aa-sdk/core/inject-version.ts similarity index 100% rename from packages/alchemy/inject-version.ts rename to aa-sdk/core/inject-version.ts diff --git a/packages/core/package.json b/aa-sdk/core/package.json similarity index 100% rename from packages/core/package.json rename to aa-sdk/core/package.json diff --git a/packages/core/src/__tests__/utils.test.ts b/aa-sdk/core/src/__tests__/utils.test.ts similarity index 100% rename from packages/core/src/__tests__/utils.test.ts rename to aa-sdk/core/src/__tests__/utils.test.ts diff --git a/packages/core/src/abis/EntryPointAbi_v6.ts b/aa-sdk/core/src/abis/EntryPointAbi_v6.ts similarity index 100% rename from packages/core/src/abis/EntryPointAbi_v6.ts rename to aa-sdk/core/src/abis/EntryPointAbi_v6.ts diff --git a/packages/core/src/abis/EntryPointAbi_v7.ts b/aa-sdk/core/src/abis/EntryPointAbi_v7.ts similarity index 100% rename from packages/core/src/abis/EntryPointAbi_v7.ts rename to aa-sdk/core/src/abis/EntryPointAbi_v7.ts diff --git a/packages/core/src/abis/SimpleAccountAbi_v6.ts b/aa-sdk/core/src/abis/SimpleAccountAbi_v6.ts similarity index 100% rename from packages/core/src/abis/SimpleAccountAbi_v6.ts rename to aa-sdk/core/src/abis/SimpleAccountAbi_v6.ts diff --git a/packages/core/src/abis/SimpleAccountAbi_v7.ts b/aa-sdk/core/src/abis/SimpleAccountAbi_v7.ts similarity index 100% rename from packages/core/src/abis/SimpleAccountAbi_v7.ts rename to aa-sdk/core/src/abis/SimpleAccountAbi_v7.ts diff --git a/packages/core/src/abis/SimpleAccountFactoryAbi.ts b/aa-sdk/core/src/abis/SimpleAccountFactoryAbi.ts similarity index 100% rename from packages/core/src/abis/SimpleAccountFactoryAbi.ts rename to aa-sdk/core/src/abis/SimpleAccountFactoryAbi.ts diff --git a/packages/core/src/account/__tests__/simple.test.ts b/aa-sdk/core/src/account/__tests__/simple.test.ts similarity index 100% rename from packages/core/src/account/__tests__/simple.test.ts rename to aa-sdk/core/src/account/__tests__/simple.test.ts diff --git a/packages/core/src/account/base.ts b/aa-sdk/core/src/account/base.ts similarity index 100% rename from packages/core/src/account/base.ts rename to aa-sdk/core/src/account/base.ts diff --git a/packages/core/src/account/schema.ts b/aa-sdk/core/src/account/schema.ts similarity index 100% rename from packages/core/src/account/schema.ts rename to aa-sdk/core/src/account/schema.ts diff --git a/packages/core/src/account/simple.ts b/aa-sdk/core/src/account/simple.ts similarity index 100% rename from packages/core/src/account/simple.ts rename to aa-sdk/core/src/account/simple.ts diff --git a/packages/core/src/account/smartContractAccount.ts b/aa-sdk/core/src/account/smartContractAccount.ts similarity index 100% rename from packages/core/src/account/smartContractAccount.ts rename to aa-sdk/core/src/account/smartContractAccount.ts diff --git a/packages/core/src/account/types.ts b/aa-sdk/core/src/account/types.ts similarity index 100% rename from packages/core/src/account/types.ts rename to aa-sdk/core/src/account/types.ts diff --git a/packages/core/src/actions/bundler/estimateUserOperationGas.ts b/aa-sdk/core/src/actions/bundler/estimateUserOperationGas.ts similarity index 100% rename from packages/core/src/actions/bundler/estimateUserOperationGas.ts rename to aa-sdk/core/src/actions/bundler/estimateUserOperationGas.ts diff --git a/packages/core/src/actions/bundler/getSupportedEntryPoints.ts b/aa-sdk/core/src/actions/bundler/getSupportedEntryPoints.ts similarity index 100% rename from packages/core/src/actions/bundler/getSupportedEntryPoints.ts rename to aa-sdk/core/src/actions/bundler/getSupportedEntryPoints.ts diff --git a/packages/core/src/actions/bundler/getUserOperationByHash.ts b/aa-sdk/core/src/actions/bundler/getUserOperationByHash.ts similarity index 100% rename from packages/core/src/actions/bundler/getUserOperationByHash.ts rename to aa-sdk/core/src/actions/bundler/getUserOperationByHash.ts diff --git a/packages/core/src/actions/bundler/getUserOperationReceipt.ts b/aa-sdk/core/src/actions/bundler/getUserOperationReceipt.ts similarity index 100% rename from packages/core/src/actions/bundler/getUserOperationReceipt.ts rename to aa-sdk/core/src/actions/bundler/getUserOperationReceipt.ts diff --git a/packages/core/src/actions/bundler/sendRawUserOperation.ts b/aa-sdk/core/src/actions/bundler/sendRawUserOperation.ts similarity index 100% rename from packages/core/src/actions/bundler/sendRawUserOperation.ts rename to aa-sdk/core/src/actions/bundler/sendRawUserOperation.ts diff --git a/packages/core/src/actions/smartAccount/buildUserOperation.ts b/aa-sdk/core/src/actions/smartAccount/buildUserOperation.ts similarity index 100% rename from packages/core/src/actions/smartAccount/buildUserOperation.ts rename to aa-sdk/core/src/actions/smartAccount/buildUserOperation.ts diff --git a/packages/core/src/actions/smartAccount/buildUserOperationFromTx.ts b/aa-sdk/core/src/actions/smartAccount/buildUserOperationFromTx.ts similarity index 100% rename from packages/core/src/actions/smartAccount/buildUserOperationFromTx.ts rename to aa-sdk/core/src/actions/smartAccount/buildUserOperationFromTx.ts diff --git a/packages/core/src/actions/smartAccount/buildUserOperationFromTxs.ts b/aa-sdk/core/src/actions/smartAccount/buildUserOperationFromTxs.ts similarity index 100% rename from packages/core/src/actions/smartAccount/buildUserOperationFromTxs.ts rename to aa-sdk/core/src/actions/smartAccount/buildUserOperationFromTxs.ts diff --git a/packages/core/src/actions/smartAccount/checkGasSponsorshipEligibility.ts b/aa-sdk/core/src/actions/smartAccount/checkGasSponsorshipEligibility.ts similarity index 100% rename from packages/core/src/actions/smartAccount/checkGasSponsorshipEligibility.ts rename to aa-sdk/core/src/actions/smartAccount/checkGasSponsorshipEligibility.ts diff --git a/packages/core/src/actions/smartAccount/dropAndReplaceUserOperation.ts b/aa-sdk/core/src/actions/smartAccount/dropAndReplaceUserOperation.ts similarity index 100% rename from packages/core/src/actions/smartAccount/dropAndReplaceUserOperation.ts rename to aa-sdk/core/src/actions/smartAccount/dropAndReplaceUserOperation.ts diff --git a/packages/core/src/actions/smartAccount/estimateUserOperationGas.ts b/aa-sdk/core/src/actions/smartAccount/estimateUserOperationGas.ts similarity index 100% rename from packages/core/src/actions/smartAccount/estimateUserOperationGas.ts rename to aa-sdk/core/src/actions/smartAccount/estimateUserOperationGas.ts diff --git a/packages/core/src/actions/smartAccount/getAddress.ts b/aa-sdk/core/src/actions/smartAccount/getAddress.ts similarity index 100% rename from packages/core/src/actions/smartAccount/getAddress.ts rename to aa-sdk/core/src/actions/smartAccount/getAddress.ts diff --git a/packages/core/src/actions/smartAccount/internal/initUserOperation.ts b/aa-sdk/core/src/actions/smartAccount/internal/initUserOperation.ts similarity index 100% rename from packages/core/src/actions/smartAccount/internal/initUserOperation.ts rename to aa-sdk/core/src/actions/smartAccount/internal/initUserOperation.ts diff --git a/packages/core/src/actions/smartAccount/internal/runMiddlewareStack.ts b/aa-sdk/core/src/actions/smartAccount/internal/runMiddlewareStack.ts similarity index 100% rename from packages/core/src/actions/smartAccount/internal/runMiddlewareStack.ts rename to aa-sdk/core/src/actions/smartAccount/internal/runMiddlewareStack.ts diff --git a/packages/core/src/actions/smartAccount/internal/sendUserOperation.ts b/aa-sdk/core/src/actions/smartAccount/internal/sendUserOperation.ts similarity index 100% rename from packages/core/src/actions/smartAccount/internal/sendUserOperation.ts rename to aa-sdk/core/src/actions/smartAccount/internal/sendUserOperation.ts diff --git a/packages/core/src/actions/smartAccount/sendTransaction.ts b/aa-sdk/core/src/actions/smartAccount/sendTransaction.ts similarity index 100% rename from packages/core/src/actions/smartAccount/sendTransaction.ts rename to aa-sdk/core/src/actions/smartAccount/sendTransaction.ts diff --git a/packages/core/src/actions/smartAccount/sendTransactions.ts b/aa-sdk/core/src/actions/smartAccount/sendTransactions.ts similarity index 100% rename from packages/core/src/actions/smartAccount/sendTransactions.ts rename to aa-sdk/core/src/actions/smartAccount/sendTransactions.ts diff --git a/packages/core/src/actions/smartAccount/sendUserOperation.ts b/aa-sdk/core/src/actions/smartAccount/sendUserOperation.ts similarity index 100% rename from packages/core/src/actions/smartAccount/sendUserOperation.ts rename to aa-sdk/core/src/actions/smartAccount/sendUserOperation.ts diff --git a/packages/core/src/actions/smartAccount/signMessage.ts b/aa-sdk/core/src/actions/smartAccount/signMessage.ts similarity index 100% rename from packages/core/src/actions/smartAccount/signMessage.ts rename to aa-sdk/core/src/actions/smartAccount/signMessage.ts diff --git a/packages/core/src/actions/smartAccount/signMessageWith6492.ts b/aa-sdk/core/src/actions/smartAccount/signMessageWith6492.ts similarity index 100% rename from packages/core/src/actions/smartAccount/signMessageWith6492.ts rename to aa-sdk/core/src/actions/smartAccount/signMessageWith6492.ts diff --git a/packages/core/src/actions/smartAccount/signTypedData.ts b/aa-sdk/core/src/actions/smartAccount/signTypedData.ts similarity index 100% rename from packages/core/src/actions/smartAccount/signTypedData.ts rename to aa-sdk/core/src/actions/smartAccount/signTypedData.ts diff --git a/packages/core/src/actions/smartAccount/signTypedDataWith6492.ts b/aa-sdk/core/src/actions/smartAccount/signTypedDataWith6492.ts similarity index 100% rename from packages/core/src/actions/smartAccount/signTypedDataWith6492.ts rename to aa-sdk/core/src/actions/smartAccount/signTypedDataWith6492.ts diff --git a/packages/core/src/actions/smartAccount/signUserOperation.ts b/aa-sdk/core/src/actions/smartAccount/signUserOperation.ts similarity index 100% rename from packages/core/src/actions/smartAccount/signUserOperation.ts rename to aa-sdk/core/src/actions/smartAccount/signUserOperation.ts diff --git a/packages/core/src/actions/smartAccount/types.ts b/aa-sdk/core/src/actions/smartAccount/types.ts similarity index 100% rename from packages/core/src/actions/smartAccount/types.ts rename to aa-sdk/core/src/actions/smartAccount/types.ts diff --git a/packages/core/src/actions/smartAccount/upgradeAccount.ts b/aa-sdk/core/src/actions/smartAccount/upgradeAccount.ts similarity index 100% rename from packages/core/src/actions/smartAccount/upgradeAccount.ts rename to aa-sdk/core/src/actions/smartAccount/upgradeAccount.ts diff --git a/packages/core/src/actions/smartAccount/waitForUserOperationTransacation.ts b/aa-sdk/core/src/actions/smartAccount/waitForUserOperationTransacation.ts similarity index 100% rename from packages/core/src/actions/smartAccount/waitForUserOperationTransacation.ts rename to aa-sdk/core/src/actions/smartAccount/waitForUserOperationTransacation.ts diff --git a/packages/core/src/chains/index.ts b/aa-sdk/core/src/chains/index.ts similarity index 100% rename from packages/core/src/chains/index.ts rename to aa-sdk/core/src/chains/index.ts diff --git a/packages/core/src/client/bundlerClient.ts b/aa-sdk/core/src/client/bundlerClient.ts similarity index 100% rename from packages/core/src/client/bundlerClient.ts rename to aa-sdk/core/src/client/bundlerClient.ts diff --git a/packages/core/src/client/decorators/bundlerClient.ts b/aa-sdk/core/src/client/decorators/bundlerClient.ts similarity index 100% rename from packages/core/src/client/decorators/bundlerClient.ts rename to aa-sdk/core/src/client/decorators/bundlerClient.ts diff --git a/packages/core/src/client/decorators/smartAccountClient.ts b/aa-sdk/core/src/client/decorators/smartAccountClient.ts similarity index 100% rename from packages/core/src/client/decorators/smartAccountClient.ts rename to aa-sdk/core/src/client/decorators/smartAccountClient.ts diff --git a/packages/core/src/client/isSmartAccountClient.ts b/aa-sdk/core/src/client/isSmartAccountClient.ts similarity index 100% rename from packages/core/src/client/isSmartAccountClient.ts rename to aa-sdk/core/src/client/isSmartAccountClient.ts diff --git a/packages/core/src/client/schema.ts b/aa-sdk/core/src/client/schema.ts similarity index 100% rename from packages/core/src/client/schema.ts rename to aa-sdk/core/src/client/schema.ts diff --git a/packages/core/src/client/smartAccountClient.test.ts b/aa-sdk/core/src/client/smartAccountClient.test.ts similarity index 100% rename from packages/core/src/client/smartAccountClient.test.ts rename to aa-sdk/core/src/client/smartAccountClient.test.ts diff --git a/packages/core/src/client/smartAccountClient.ts b/aa-sdk/core/src/client/smartAccountClient.ts similarity index 100% rename from packages/core/src/client/smartAccountClient.ts rename to aa-sdk/core/src/client/smartAccountClient.ts diff --git a/packages/core/src/client/types.ts b/aa-sdk/core/src/client/types.ts similarity index 100% rename from packages/core/src/client/types.ts rename to aa-sdk/core/src/client/types.ts diff --git a/packages/core/src/ens/utils.ts b/aa-sdk/core/src/ens/utils.ts similarity index 100% rename from packages/core/src/ens/utils.ts rename to aa-sdk/core/src/ens/utils.ts diff --git a/packages/core/src/entrypoint/0.6.ts b/aa-sdk/core/src/entrypoint/0.6.ts similarity index 100% rename from packages/core/src/entrypoint/0.6.ts rename to aa-sdk/core/src/entrypoint/0.6.ts diff --git a/packages/core/src/entrypoint/0.7.ts b/aa-sdk/core/src/entrypoint/0.7.ts similarity index 100% rename from packages/core/src/entrypoint/0.7.ts rename to aa-sdk/core/src/entrypoint/0.7.ts diff --git a/packages/core/src/entrypoint/index.ts b/aa-sdk/core/src/entrypoint/index.ts similarity index 100% rename from packages/core/src/entrypoint/index.ts rename to aa-sdk/core/src/entrypoint/index.ts diff --git a/packages/core/src/entrypoint/types.ts b/aa-sdk/core/src/entrypoint/types.ts similarity index 100% rename from packages/core/src/entrypoint/types.ts rename to aa-sdk/core/src/entrypoint/types.ts diff --git a/packages/core/src/errors/account.ts b/aa-sdk/core/src/errors/account.ts similarity index 100% rename from packages/core/src/errors/account.ts rename to aa-sdk/core/src/errors/account.ts diff --git a/packages/core/src/errors/base.ts b/aa-sdk/core/src/errors/base.ts similarity index 100% rename from packages/core/src/errors/base.ts rename to aa-sdk/core/src/errors/base.ts diff --git a/packages/core/src/errors/client.ts b/aa-sdk/core/src/errors/client.ts similarity index 100% rename from packages/core/src/errors/client.ts rename to aa-sdk/core/src/errors/client.ts diff --git a/packages/core/src/errors/entrypoint.ts b/aa-sdk/core/src/errors/entrypoint.ts similarity index 100% rename from packages/core/src/errors/entrypoint.ts rename to aa-sdk/core/src/errors/entrypoint.ts diff --git a/packages/core/src/errors/signer.ts b/aa-sdk/core/src/errors/signer.ts similarity index 100% rename from packages/core/src/errors/signer.ts rename to aa-sdk/core/src/errors/signer.ts diff --git a/packages/core/src/errors/transaction.ts b/aa-sdk/core/src/errors/transaction.ts similarity index 100% rename from packages/core/src/errors/transaction.ts rename to aa-sdk/core/src/errors/transaction.ts diff --git a/packages/core/src/errors/useroperation.ts b/aa-sdk/core/src/errors/useroperation.ts similarity index 100% rename from packages/core/src/errors/useroperation.ts rename to aa-sdk/core/src/errors/useroperation.ts diff --git a/packages/core/src/index.ts b/aa-sdk/core/src/index.ts similarity index 100% rename from packages/core/src/index.ts rename to aa-sdk/core/src/index.ts diff --git a/packages/core/src/logger.ts b/aa-sdk/core/src/logger.ts similarity index 100% rename from packages/core/src/logger.ts rename to aa-sdk/core/src/logger.ts diff --git a/packages/core/src/middleware/actions.ts b/aa-sdk/core/src/middleware/actions.ts similarity index 100% rename from packages/core/src/middleware/actions.ts rename to aa-sdk/core/src/middleware/actions.ts diff --git a/packages/core/src/middleware/defaults/feeEstimator.ts b/aa-sdk/core/src/middleware/defaults/feeEstimator.ts similarity index 100% rename from packages/core/src/middleware/defaults/feeEstimator.ts rename to aa-sdk/core/src/middleware/defaults/feeEstimator.ts diff --git a/packages/core/src/middleware/defaults/gasEstimator.ts b/aa-sdk/core/src/middleware/defaults/gasEstimator.ts similarity index 100% rename from packages/core/src/middleware/defaults/gasEstimator.ts rename to aa-sdk/core/src/middleware/defaults/gasEstimator.ts diff --git a/packages/core/src/middleware/defaults/paymasterAndData.ts b/aa-sdk/core/src/middleware/defaults/paymasterAndData.ts similarity index 100% rename from packages/core/src/middleware/defaults/paymasterAndData.ts rename to aa-sdk/core/src/middleware/defaults/paymasterAndData.ts diff --git a/packages/core/src/middleware/defaults/userOpSigner.ts b/aa-sdk/core/src/middleware/defaults/userOpSigner.ts similarity index 100% rename from packages/core/src/middleware/defaults/userOpSigner.ts rename to aa-sdk/core/src/middleware/defaults/userOpSigner.ts diff --git a/packages/core/src/middleware/noopMiddleware.ts b/aa-sdk/core/src/middleware/noopMiddleware.ts similarity index 100% rename from packages/core/src/middleware/noopMiddleware.ts rename to aa-sdk/core/src/middleware/noopMiddleware.ts diff --git a/packages/core/src/middleware/types.ts b/aa-sdk/core/src/middleware/types.ts similarity index 100% rename from packages/core/src/middleware/types.ts rename to aa-sdk/core/src/middleware/types.ts diff --git a/packages/core/src/signer/__tests__/local-account.test.ts b/aa-sdk/core/src/signer/__tests__/local-account.test.ts similarity index 100% rename from packages/core/src/signer/__tests__/local-account.test.ts rename to aa-sdk/core/src/signer/__tests__/local-account.test.ts diff --git a/packages/core/src/signer/__tests__/wallet-client.test.ts b/aa-sdk/core/src/signer/__tests__/wallet-client.test.ts similarity index 100% rename from packages/core/src/signer/__tests__/wallet-client.test.ts rename to aa-sdk/core/src/signer/__tests__/wallet-client.test.ts diff --git a/packages/core/src/signer/local-account.ts b/aa-sdk/core/src/signer/local-account.ts similarity index 100% rename from packages/core/src/signer/local-account.ts rename to aa-sdk/core/src/signer/local-account.ts diff --git a/packages/core/src/signer/schema.ts b/aa-sdk/core/src/signer/schema.ts similarity index 100% rename from packages/core/src/signer/schema.ts rename to aa-sdk/core/src/signer/schema.ts diff --git a/packages/core/src/signer/types.ts b/aa-sdk/core/src/signer/types.ts similarity index 100% rename from packages/core/src/signer/types.ts rename to aa-sdk/core/src/signer/types.ts diff --git a/packages/core/src/signer/utils.ts b/aa-sdk/core/src/signer/utils.ts similarity index 100% rename from packages/core/src/signer/utils.ts rename to aa-sdk/core/src/signer/utils.ts diff --git a/packages/core/src/signer/wallet-client.ts b/aa-sdk/core/src/signer/wallet-client.ts similarity index 100% rename from packages/core/src/signer/wallet-client.ts rename to aa-sdk/core/src/signer/wallet-client.ts diff --git a/packages/core/src/transport/split.ts b/aa-sdk/core/src/transport/split.ts similarity index 100% rename from packages/core/src/transport/split.ts rename to aa-sdk/core/src/transport/split.ts diff --git a/packages/core/src/types.ts b/aa-sdk/core/src/types.ts similarity index 100% rename from packages/core/src/types.ts rename to aa-sdk/core/src/types.ts diff --git a/packages/core/src/utils/__tests__/bigint.test.ts b/aa-sdk/core/src/utils/__tests__/bigint.test.ts similarity index 100% rename from packages/core/src/utils/__tests__/bigint.test.ts rename to aa-sdk/core/src/utils/__tests__/bigint.test.ts diff --git a/packages/core/src/utils/bigint.ts b/aa-sdk/core/src/utils/bigint.ts similarity index 100% rename from packages/core/src/utils/bigint.ts rename to aa-sdk/core/src/utils/bigint.ts diff --git a/packages/core/src/utils/bytes.ts b/aa-sdk/core/src/utils/bytes.ts similarity index 100% rename from packages/core/src/utils/bytes.ts rename to aa-sdk/core/src/utils/bytes.ts diff --git a/packages/core/src/utils/defaults.ts b/aa-sdk/core/src/utils/defaults.ts similarity index 100% rename from packages/core/src/utils/defaults.ts rename to aa-sdk/core/src/utils/defaults.ts diff --git a/packages/core/src/utils/index.ts b/aa-sdk/core/src/utils/index.ts similarity index 100% rename from packages/core/src/utils/index.ts rename to aa-sdk/core/src/utils/index.ts diff --git a/packages/core/src/utils/schema.ts b/aa-sdk/core/src/utils/schema.ts similarity index 100% rename from packages/core/src/utils/schema.ts rename to aa-sdk/core/src/utils/schema.ts diff --git a/packages/core/src/utils/stateOverride.ts b/aa-sdk/core/src/utils/stateOverride.ts similarity index 100% rename from packages/core/src/utils/stateOverride.ts rename to aa-sdk/core/src/utils/stateOverride.ts diff --git a/packages/core/src/utils/testUtils.ts b/aa-sdk/core/src/utils/testUtils.ts similarity index 100% rename from packages/core/src/utils/testUtils.ts rename to aa-sdk/core/src/utils/testUtils.ts diff --git a/packages/core/src/utils/types.ts b/aa-sdk/core/src/utils/types.ts similarity index 100% rename from packages/core/src/utils/types.ts rename to aa-sdk/core/src/utils/types.ts diff --git a/packages/core/src/utils/userop.ts b/aa-sdk/core/src/utils/userop.ts similarity index 100% rename from packages/core/src/utils/userop.ts rename to aa-sdk/core/src/utils/userop.ts diff --git a/packages/alchemy/src/version.ts b/aa-sdk/core/src/version.ts similarity index 100% rename from packages/alchemy/src/version.ts rename to aa-sdk/core/src/version.ts diff --git a/packages/core/tsconfig.build.json b/aa-sdk/core/tsconfig.build.json similarity index 100% rename from packages/core/tsconfig.build.json rename to aa-sdk/core/tsconfig.build.json diff --git a/packages/accounts/tsconfig.json b/aa-sdk/core/tsconfig.json similarity index 100% rename from packages/accounts/tsconfig.json rename to aa-sdk/core/tsconfig.json diff --git a/packages/core/vitest.config.e2e.ts b/aa-sdk/core/vitest.config.e2e.ts similarity index 100% rename from packages/core/vitest.config.e2e.ts rename to aa-sdk/core/vitest.config.e2e.ts diff --git a/packages/core/vitest.config.ts b/aa-sdk/core/vitest.config.ts similarity index 100% rename from packages/core/vitest.config.ts rename to aa-sdk/core/vitest.config.ts diff --git a/packages/ethers/CHANGELOG.md b/aa-sdk/ethers/CHANGELOG.md similarity index 100% rename from packages/ethers/CHANGELOG.md rename to aa-sdk/ethers/CHANGELOG.md diff --git a/packages/ethers/README.md b/aa-sdk/ethers/README.md similarity index 100% rename from packages/ethers/README.md rename to aa-sdk/ethers/README.md diff --git a/packages/ethers/e2e-tests/constants.ts b/aa-sdk/ethers/e2e-tests/constants.ts similarity index 100% rename from packages/ethers/e2e-tests/constants.ts rename to aa-sdk/ethers/e2e-tests/constants.ts diff --git a/packages/ethers/e2e-tests/simple-account.e2e.test.ts b/aa-sdk/ethers/e2e-tests/simple-account.e2e.test.ts similarity index 100% rename from packages/ethers/e2e-tests/simple-account.e2e.test.ts rename to aa-sdk/ethers/e2e-tests/simple-account.e2e.test.ts diff --git a/packages/ethers/package.json b/aa-sdk/ethers/package.json similarity index 100% rename from packages/ethers/package.json rename to aa-sdk/ethers/package.json diff --git a/packages/ethers/src/__tests__/provider-adapter.test.ts b/aa-sdk/ethers/src/__tests__/provider-adapter.test.ts similarity index 100% rename from packages/ethers/src/__tests__/provider-adapter.test.ts rename to aa-sdk/ethers/src/__tests__/provider-adapter.test.ts diff --git a/packages/ethers/src/account-signer.ts b/aa-sdk/ethers/src/account-signer.ts similarity index 100% rename from packages/ethers/src/account-signer.ts rename to aa-sdk/ethers/src/account-signer.ts diff --git a/packages/ethers/src/index.ts b/aa-sdk/ethers/src/index.ts similarity index 100% rename from packages/ethers/src/index.ts rename to aa-sdk/ethers/src/index.ts diff --git a/packages/ethers/src/provider-adapter.ts b/aa-sdk/ethers/src/provider-adapter.ts similarity index 100% rename from packages/ethers/src/provider-adapter.ts rename to aa-sdk/ethers/src/provider-adapter.ts diff --git a/packages/ethers/src/types.ts b/aa-sdk/ethers/src/types.ts similarity index 100% rename from packages/ethers/src/types.ts rename to aa-sdk/ethers/src/types.ts diff --git a/packages/ethers/src/utils.ts b/aa-sdk/ethers/src/utils.ts similarity index 100% rename from packages/ethers/src/utils.ts rename to aa-sdk/ethers/src/utils.ts diff --git a/packages/ethers/tsconfig.build.json b/aa-sdk/ethers/tsconfig.build.json similarity index 100% rename from packages/ethers/tsconfig.build.json rename to aa-sdk/ethers/tsconfig.build.json diff --git a/packages/core/tsconfig.json b/aa-sdk/ethers/tsconfig.json similarity index 100% rename from packages/core/tsconfig.json rename to aa-sdk/ethers/tsconfig.json diff --git a/packages/ethers/vitest.config.e2e.ts b/aa-sdk/ethers/vitest.config.e2e.ts similarity index 100% rename from packages/ethers/vitest.config.e2e.ts rename to aa-sdk/ethers/vitest.config.e2e.ts diff --git a/packages/ethers/vitest.config.ts b/aa-sdk/ethers/vitest.config.ts similarity index 100% rename from packages/ethers/vitest.config.ts rename to aa-sdk/ethers/vitest.config.ts diff --git a/packages/plugingen/CHANGELOG.md b/aa-sdk/plugingen/CHANGELOG.md similarity index 100% rename from packages/plugingen/CHANGELOG.md rename to aa-sdk/plugingen/CHANGELOG.md diff --git a/packages/core/inject-version.ts b/aa-sdk/plugingen/inject-version.ts similarity index 100% rename from packages/core/inject-version.ts rename to aa-sdk/plugingen/inject-version.ts diff --git a/packages/plugingen/package.json b/aa-sdk/plugingen/package.json similarity index 100% rename from packages/plugingen/package.json rename to aa-sdk/plugingen/package.json diff --git a/packages/accounts/src/msca/abis/IPlugin.ts b/aa-sdk/plugingen/src/IPlugin.ts similarity index 100% rename from packages/accounts/src/msca/abis/IPlugin.ts rename to aa-sdk/plugingen/src/IPlugin.ts diff --git a/packages/plugingen/src/cli.ts b/aa-sdk/plugingen/src/cli.ts similarity index 100% rename from packages/plugingen/src/cli.ts rename to aa-sdk/plugingen/src/cli.ts diff --git a/packages/plugingen/src/commands/generate/index.ts b/aa-sdk/plugingen/src/commands/generate/index.ts similarity index 99% rename from packages/plugingen/src/commands/generate/index.ts rename to aa-sdk/plugingen/src/commands/generate/index.ts index 4b34b13967..6d194cb933 100644 --- a/packages/plugingen/src/commands/generate/index.ts +++ b/aa-sdk/plugingen/src/commands/generate/index.ts @@ -1,4 +1,3 @@ -import { IPluginAbi } from "@alchemy/aa-accounts"; import { asyncPipe } from "@alchemy/aa-core"; import { kebabCase } from "change-case"; import dedent from "dedent"; @@ -14,6 +13,7 @@ import { } from "viem"; import z from "zod"; import type { Config, PluginConfig } from "../../config.js"; +import { IPluginAbi } from "../../IPlugin.js"; import * as logger from "../../logger.js"; import { findConfig } from "../../utils/findConfig.js"; import { format } from "../../utils/format.js"; diff --git a/packages/plugingen/src/commands/generate/phases/contract-abi-gen.ts b/aa-sdk/plugingen/src/commands/generate/phases/contract-abi-gen.ts similarity index 100% rename from packages/plugingen/src/commands/generate/phases/contract-abi-gen.ts rename to aa-sdk/plugingen/src/commands/generate/phases/contract-abi-gen.ts diff --git a/packages/plugingen/src/commands/generate/phases/contract-addresses-gen.ts b/aa-sdk/plugingen/src/commands/generate/phases/contract-addresses-gen.ts similarity index 100% rename from packages/plugingen/src/commands/generate/phases/contract-addresses-gen.ts rename to aa-sdk/plugingen/src/commands/generate/phases/contract-addresses-gen.ts diff --git a/packages/plugingen/src/commands/generate/phases/execution-abi-gen.ts b/aa-sdk/plugingen/src/commands/generate/phases/execution-abi-gen.ts similarity index 100% rename from packages/plugingen/src/commands/generate/phases/execution-abi-gen.ts rename to aa-sdk/plugingen/src/commands/generate/phases/execution-abi-gen.ts diff --git a/packages/plugingen/src/commands/generate/phases/plugin-actions/index.ts b/aa-sdk/plugingen/src/commands/generate/phases/plugin-actions/index.ts similarity index 97% rename from packages/plugingen/src/commands/generate/phases/plugin-actions/index.ts rename to aa-sdk/plugingen/src/commands/generate/phases/plugin-actions/index.ts index 561b211710..5c7296dec8 100644 --- a/packages/plugingen/src/commands/generate/phases/plugin-actions/index.ts +++ b/aa-sdk/plugingen/src/commands/generate/phases/plugin-actions/index.ts @@ -32,7 +32,11 @@ export const PluginActionsGenPhase: Phase = async (input) => { isType: true, }); addImport("@alchemy/aa-core", { - name: "EntryPointVersion", + name: "GetEntryPointFromAccount", + isType: true, + }); + addImport("@alchemy/aa-core", { + name: "UserOperationOverridesParameter", isType: true, }); addImport("@alchemy/aa-core", { diff --git a/packages/plugingen/src/commands/generate/phases/plugin-actions/management-actions.ts b/aa-sdk/plugingen/src/commands/generate/phases/plugin-actions/management-actions.ts similarity index 94% rename from packages/plugingen/src/commands/generate/phases/plugin-actions/management-actions.ts rename to aa-sdk/plugingen/src/commands/generate/phases/plugin-actions/management-actions.ts index 2083c5c93e..0d9c987d13 100644 --- a/packages/plugingen/src/commands/generate/phases/plugin-actions/management-actions.ts +++ b/aa-sdk/plugingen/src/commands/generate/phases/plugin-actions/management-actions.ts @@ -118,20 +118,24 @@ const addImports = ( addImport("@alchemy/aa-core", { name: "ChainNotFoundError" }); addImport("viem", { name: "encodeAbiParameters" }); - addImport("@alchemy/aa-accounts", { + addImport("@account-kit/smart-contracts", { name: "installPlugin as installPlugin_", }); addImport("@alchemy/aa-core", { name: "GetAccountParameter", isType: true, }); - addImport("@alchemy/aa-accounts", { - name: "FunctionReference", + addImport("@alchemy/aa-core", { + name: "GetEntryPointFromAccount", isType: true, }); - addImport("@alchemy/aa-accounts", { + addImport("@alchemy/aa-core", { name: "UserOperationContext", isType: true, }); + addImport("@account-kit/smart-contracts", { + name: "FunctionReference", + isType: true, + }); addImport("@alchemy/aa-core", { name: "GetContextParameter", isType: true }); }; diff --git a/packages/plugingen/src/commands/generate/phases/plugin-actions/read-actions.ts b/aa-sdk/plugingen/src/commands/generate/phases/plugin-actions/read-actions.ts similarity index 94% rename from packages/plugingen/src/commands/generate/phases/plugin-actions/read-actions.ts rename to aa-sdk/plugingen/src/commands/generate/phases/plugin-actions/read-actions.ts index 504e3e9a1f..fc261a5e2c 100644 --- a/packages/plugingen/src/commands/generate/phases/plugin-actions/read-actions.ts +++ b/aa-sdk/plugingen/src/commands/generate/phases/plugin-actions/read-actions.ts @@ -50,9 +50,9 @@ export const AccountReadActionsGenPhase: Phase = async (input) => { n.inputs.length > 0 ? dedent`${readMethodName}: ( args: Pick, "args"> & - GetAccountParameter + GetAccountParameter ) => Promise>` - : dedent`${readMethodName}: (args: GetAccountParameter) => + : dedent`${readMethodName}: (args: GetAccountParameter) => Promise>` ); @@ -82,7 +82,6 @@ export const AccountReadActionsGenPhase: Phase = async (input) => { const typeName = input.hasReadMethods ? `ReadAndEncodeActions< TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, - TEntryPointVersion extends GetEntryPointFromAccount = GetEntryPointFromAccount, >` : "ReadAndEncodeActions"; diff --git a/packages/plugingen/src/commands/generate/phases/plugin-generator/get-contract-gen.ts b/aa-sdk/plugingen/src/commands/generate/phases/plugin-generator/get-contract-gen.ts similarity index 100% rename from packages/plugingen/src/commands/generate/phases/plugin-generator/get-contract-gen.ts rename to aa-sdk/plugingen/src/commands/generate/phases/plugin-generator/get-contract-gen.ts diff --git a/packages/plugingen/src/commands/generate/phases/plugin-generator/index.ts b/aa-sdk/plugingen/src/commands/generate/phases/plugin-generator/index.ts similarity index 89% rename from packages/plugingen/src/commands/generate/phases/plugin-generator/index.ts rename to aa-sdk/plugingen/src/commands/generate/phases/plugin-generator/index.ts index 885894e0a4..f808121ee3 100644 --- a/packages/plugingen/src/commands/generate/phases/plugin-generator/index.ts +++ b/aa-sdk/plugingen/src/commands/generate/phases/plugin-generator/index.ts @@ -13,7 +13,7 @@ export const PluginGeneratorPhase: Phase = async (input) => { content: [], }); - addImport("@alchemy/aa-accounts", { name: "Plugin", isType: true }); + addImport("@account-kit/smart-contracts", { name: "Plugin", isType: true }); input.content.push(dedent` export const ${pluginConfig.name}: Plugin ./dist/cjs/package.json '{\"type\":\"commonjs\"}'", + "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir ./dist/esm --removeComments && echo > ./dist/esm/package.json '{\"type\":\"module\"}'", + "build:types": "tsc --project tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap", + "clean": "rm -rf ./dist", + "test": "vitest --passWithNoTests", + "test:run": "vitest run --passWithNoTests", + "test:run-e2e": "vitest run --config vitest.config.e2e.ts --passWithNoTests" + }, + "devDependencies": { + "typescript": "^5.0.4", + "typescript-template": "*", + "vitest": "^0.31.0" + }, + "dependencies": { + "@account-kit/infra": "^3.18.2", + "@wagmi/core": "^2.9.8", + "js-cookie": "^3.0.5", + "viem": "2.8.6", + "zod": "^3.22.4", + "zustand": "^4.5.2" + }, + "peerDependencies": { + "viem": "2.8.6" + }, + "resolutions": { + "viem": "2.8.6" + }, + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/alchemyplatform/aa-sdk.git" + }, + "bugs": { + "url": "https://github.com/alchemyplatform/aa-sdk/issues" + }, + "homepage": "https://github.com/alchemyplatform/aa-sdk#readme", + "gitHead": "ee46e8bb857de3b631044fa70714ea706d9e317d", + "optionalDependencies": { + "alchemy-sdk": "^3.0.0" + } +} diff --git a/packages/alchemy/src/config/actions/createAccount.ts b/account-kit/core/src/actions/createAccount.ts similarity index 96% rename from packages/alchemy/src/config/actions/createAccount.ts rename to account-kit/core/src/actions/createAccount.ts index d3a28ab7d3..9505aa8d11 100644 --- a/packages/alchemy/src/config/actions/createAccount.ts +++ b/account-kit/core/src/actions/createAccount.ts @@ -1,10 +1,10 @@ import { createLightAccount, - createMultiOwnerModularAccount, + createModularAccount, type CreateLightAccountParams, type CreateMultiOwnerModularAccountParams, type GetLightAccountVersion, -} from "@alchemy/aa-accounts"; +} from "@account-kit/infra"; import { type SmartAccountSigner } from "@alchemy/aa-core"; import { custom, type Transport } from "viem"; import { ClientOnlyPropertyError } from "../errors.js"; @@ -12,7 +12,7 @@ import type { AlchemyAccountsConfig, SupportedAccountTypes, SupportedAccounts, -} from "../types"; +} from "../types.js"; import { getBundlerClient } from "./getBundlerClient.js"; import { getSigner } from "./getSigner.js"; import { getSignerStatus } from "./getSignerStatus.js"; @@ -75,7 +75,7 @@ export async function createAccount( chain, }); case "MultiOwnerModularAccount": - return createMultiOwnerModularAccount({ + return createModularAccount({ ...params, ...cachedConfig, signer, diff --git a/packages/alchemy/src/config/actions/getAccount.ts b/account-kit/core/src/actions/getAccount.ts similarity index 98% rename from packages/alchemy/src/config/actions/getAccount.ts rename to account-kit/core/src/actions/getAccount.ts index 7bfab1921d..da5aa328c3 100644 --- a/packages/alchemy/src/config/actions/getAccount.ts +++ b/account-kit/core/src/actions/getAccount.ts @@ -1,5 +1,5 @@ import type { AccountState } from "../store/types.js"; -import type { AlchemyAccountsConfig, SupportedAccountTypes } from "../types"; +import type { AlchemyAccountsConfig, SupportedAccountTypes } from "../types.js"; import { type CreateAccountParams } from "./createAccount.js"; import { getChain } from "./getChain.js"; diff --git a/packages/alchemy/src/config/actions/getBundlerClient.ts b/account-kit/core/src/actions/getBundlerClient.ts similarity index 75% rename from packages/alchemy/src/config/actions/getBundlerClient.ts rename to account-kit/core/src/actions/getBundlerClient.ts index f4928877bb..ae64f98ea6 100644 --- a/packages/alchemy/src/config/actions/getBundlerClient.ts +++ b/account-kit/core/src/actions/getBundlerClient.ts @@ -1,4 +1,4 @@ -import type { ClientWithAlchemyMethods } from "../../client/types"; +import type { ClientWithAlchemyMethods } from "@account-kit/infra"; import type { AlchemyAccountsConfig } from "../types"; export const getBundlerClient = ( diff --git a/packages/alchemy/src/config/actions/getChain.ts b/account-kit/core/src/actions/getChain.ts similarity index 100% rename from packages/alchemy/src/config/actions/getChain.ts rename to account-kit/core/src/actions/getChain.ts diff --git a/packages/alchemy/src/config/actions/getConnection.ts b/account-kit/core/src/actions/getConnection.ts similarity index 99% rename from packages/alchemy/src/config/actions/getConnection.ts rename to account-kit/core/src/actions/getConnection.ts index 2999497143..3831483364 100644 --- a/packages/alchemy/src/config/actions/getConnection.ts +++ b/account-kit/core/src/actions/getConnection.ts @@ -1,5 +1,5 @@ import { ChainNotFoundError } from "../errors.js"; -import type { AlchemyAccountsConfig, Connection } from "../types"; +import type { AlchemyAccountsConfig, Connection } from "../types.js"; import { getChain } from "./getChain.js"; /** diff --git a/packages/alchemy/src/config/actions/getSigner.ts b/account-kit/core/src/actions/getSigner.ts similarity index 80% rename from packages/alchemy/src/config/actions/getSigner.ts rename to account-kit/core/src/actions/getSigner.ts index 3d375d1926..a96d34a858 100644 --- a/packages/alchemy/src/config/actions/getSigner.ts +++ b/account-kit/core/src/actions/getSigner.ts @@ -1,6 +1,6 @@ -import type { AlchemySigner } from "../../signer/signer.js"; -import type { AlchemyAccountsConfig } from "../types"; +import type { AlchemyAccountsConfig } from "../types.js"; // eslint-disable-next-line @typescript-eslint/no-unused-vars +import type { AlchemyWebSigner } from "@account-kit/infra"; import type { hydrate } from "../hydrate.js"; /** @@ -13,6 +13,6 @@ import type { hydrate } from "../hydrate.js"; */ export const getSigner = ( config: AlchemyAccountsConfig -): AlchemySigner | null => { +): AlchemyWebSigner | null => { return config.clientStore.getState().signer ?? null; }; diff --git a/packages/alchemy/src/config/actions/getSignerStatus.ts b/account-kit/core/src/actions/getSignerStatus.ts similarity index 100% rename from packages/alchemy/src/config/actions/getSignerStatus.ts rename to account-kit/core/src/actions/getSignerStatus.ts diff --git a/packages/alchemy/src/config/actions/getUser.ts b/account-kit/core/src/actions/getUser.ts similarity index 92% rename from packages/alchemy/src/config/actions/getUser.ts rename to account-kit/core/src/actions/getUser.ts index c63cabbd7b..a446c69519 100644 --- a/packages/alchemy/src/config/actions/getUser.ts +++ b/account-kit/core/src/actions/getUser.ts @@ -1,4 +1,4 @@ -import type { User } from "../../signer"; +import type { User } from "@account-kit/infra"; import type { AlchemyAccountsConfig } from "../types"; /** diff --git a/packages/alchemy/src/config/actions/reconnect.ts b/account-kit/core/src/actions/reconnect.ts similarity index 96% rename from packages/alchemy/src/config/actions/reconnect.ts rename to account-kit/core/src/actions/reconnect.ts index a96b1e4bca..3ccf38bbc2 100644 --- a/packages/alchemy/src/config/actions/reconnect.ts +++ b/account-kit/core/src/actions/reconnect.ts @@ -1,5 +1,5 @@ import { createSigner } from "../store/client.js"; -import type { AlchemyAccountsConfig } from "../types"; +import type { AlchemyAccountsConfig } from "../types.js"; import { createAccount } from "./createAccount.js"; import { getChain } from "./getChain.js"; diff --git a/packages/alchemy/src/config/actions/setChain.ts b/account-kit/core/src/actions/setChain.ts similarity index 86% rename from packages/alchemy/src/config/actions/setChain.ts rename to account-kit/core/src/actions/setChain.ts index 155bd629cc..3e25ffee09 100644 --- a/packages/alchemy/src/config/actions/setChain.ts +++ b/account-kit/core/src/actions/setChain.ts @@ -1,8 +1,8 @@ +import { createAlchemyPublicRpcClient } from "@account-kit/infra"; import { switchChain } from "@wagmi/core"; import type { Chain } from "viem"; -import { createAlchemyPublicRpcClient } from "../../client/rpcClient.js"; import { ChainNotFoundError } from "../errors.js"; -import type { AlchemyAccountsConfig } from "../types"; +import type { AlchemyAccountsConfig } from "../types.js"; /** * Allows you to change the current chain in the core store diff --git a/packages/alchemy/src/config/actions/watchAccount.ts b/account-kit/core/src/actions/watchAccount.ts similarity index 98% rename from packages/alchemy/src/config/actions/watchAccount.ts rename to account-kit/core/src/actions/watchAccount.ts index 00c587a6d6..b0bce06886 100644 --- a/packages/alchemy/src/config/actions/watchAccount.ts +++ b/account-kit/core/src/actions/watchAccount.ts @@ -1,5 +1,5 @@ import { ClientOnlyPropertyError } from "../errors.js"; -import type { AlchemyAccountsConfig, SupportedAccountTypes } from "../types"; +import type { AlchemyAccountsConfig, SupportedAccountTypes } from "../types.js"; import { type GetAccountResult } from "./getAccount.js"; import { getChain } from "./getChain.js"; diff --git a/packages/alchemy/src/config/actions/watchBundlerClient.ts b/account-kit/core/src/actions/watchBundlerClient.ts similarity index 81% rename from packages/alchemy/src/config/actions/watchBundlerClient.ts rename to account-kit/core/src/actions/watchBundlerClient.ts index b18c6cc626..3174bb4c46 100644 --- a/packages/alchemy/src/config/actions/watchBundlerClient.ts +++ b/account-kit/core/src/actions/watchBundlerClient.ts @@ -1,4 +1,4 @@ -import type { ClientWithAlchemyMethods } from "../../client/types"; +import type { ClientWithAlchemyMethods } from "@account-kit/infra"; import type { AlchemyAccountsConfig } from "../types"; export const watchBundlerClient = diff --git a/packages/alchemy/src/config/actions/watchChain.ts b/account-kit/core/src/actions/watchChain.ts similarity index 100% rename from packages/alchemy/src/config/actions/watchChain.ts rename to account-kit/core/src/actions/watchChain.ts diff --git a/packages/alchemy/src/config/actions/watchConnection.ts b/account-kit/core/src/actions/watchConnection.ts similarity index 100% rename from packages/alchemy/src/config/actions/watchConnection.ts rename to account-kit/core/src/actions/watchConnection.ts diff --git a/packages/alchemy/src/config/actions/watchSigner.ts b/account-kit/core/src/actions/watchSigner.ts similarity index 79% rename from packages/alchemy/src/config/actions/watchSigner.ts rename to account-kit/core/src/actions/watchSigner.ts index dfbead87dd..cd7878101e 100644 --- a/packages/alchemy/src/config/actions/watchSigner.ts +++ b/account-kit/core/src/actions/watchSigner.ts @@ -1,4 +1,4 @@ -import type { AlchemySigner } from "../../signer"; +import type { AlchemyWebSigner } from "@account-kit/infra"; import type { AlchemyAccountsConfig } from "../types"; /** @@ -9,6 +9,6 @@ import type { AlchemyAccountsConfig } from "../types"; */ export const watchSigner = (config: AlchemyAccountsConfig) => - (onChange: (signer?: AlchemySigner) => void) => { + (onChange: (signer?: AlchemyWebSigner) => void) => { return config.clientStore.subscribe(({ signer }) => signer, onChange); }; diff --git a/packages/alchemy/src/config/actions/watchSignerStatus.ts b/account-kit/core/src/actions/watchSignerStatus.ts similarity index 85% rename from packages/alchemy/src/config/actions/watchSignerStatus.ts rename to account-kit/core/src/actions/watchSignerStatus.ts index 13ef0f47d0..390f325a0b 100644 --- a/packages/alchemy/src/config/actions/watchSignerStatus.ts +++ b/account-kit/core/src/actions/watchSignerStatus.ts @@ -1,5 +1,5 @@ import type { SignerStatus } from "../store/types.js"; -import type { AlchemyAccountsConfig } from "../types"; +import type { AlchemyAccountsConfig } from "../types.js"; export const watchSignerStatus = (config: AlchemyAccountsConfig) => diff --git a/packages/alchemy/src/config/actions/watchUser.ts b/account-kit/core/src/actions/watchUser.ts similarity index 86% rename from packages/alchemy/src/config/actions/watchUser.ts rename to account-kit/core/src/actions/watchUser.ts index e6ba1afdec..60547a4b5f 100644 --- a/packages/alchemy/src/config/actions/watchUser.ts +++ b/account-kit/core/src/actions/watchUser.ts @@ -1,4 +1,4 @@ -import type { User } from "../../signer"; +import type { User } from "@account-kit/infra"; import type { AlchemyAccountsConfig } from "../types"; export const watchUser = diff --git a/packages/alchemy/src/config/createConfig.ts b/account-kit/core/src/createConfig.ts similarity index 97% rename from packages/alchemy/src/config/createConfig.ts rename to account-kit/core/src/createConfig.ts index 61fa842c9d..8c3ef495f5 100644 --- a/packages/alchemy/src/config/createConfig.ts +++ b/account-kit/core/src/createConfig.ts @@ -1,6 +1,6 @@ +import { DEFAULT_SESSION_MS } from "@account-kit/infra"; import { ConnectionConfigSchema } from "@alchemy/aa-core"; import { createStorage, createConfig as createWagmiConfig } from "@wagmi/core"; -import { DEFAULT_SESSION_MS } from "../signer/session/manager.js"; import { createClientStore } from "./store/client.js"; import { createCoreStore } from "./store/core.js"; import { DEFAULT_STORAGE_KEY } from "./store/types.js"; @@ -8,7 +8,7 @@ import type { AlchemyAccountsConfig, Connection, CreateConfigProps, -} from "./types"; +} from "./types.js"; export const DEFAULT_IFRAME_CONTAINER_ID = "alchemy-signer-iframe-container"; diff --git a/packages/alchemy/src/config/errors.ts b/account-kit/core/src/errors.ts similarity index 64% rename from packages/alchemy/src/config/errors.ts rename to account-kit/core/src/errors.ts index a8242c4d9b..2ad3c920f7 100644 --- a/packages/alchemy/src/config/errors.ts +++ b/account-kit/core/src/errors.ts @@ -1,5 +1,11 @@ +import { BaseError as CoreBaseError } from "@alchemy/aa-core"; import type { Chain } from "viem"; -import { BaseError } from "../errors/base.js"; +import { VERSION } from "./version.js"; + +export abstract class BaseError extends CoreBaseError { + // This version could be different from the aa-core version so we overwrite this here. + override version = VERSION; +} export class ClientOnlyPropertyError extends BaseError { name: string = "ClientOnlyPropertyError"; diff --git a/packages/alchemy/src/config/hydrate.ts b/account-kit/core/src/hydrate.ts similarity index 97% rename from packages/alchemy/src/config/hydrate.ts rename to account-kit/core/src/hydrate.ts index 75f6edd7ac..1c833f04a1 100644 --- a/packages/alchemy/src/config/hydrate.ts +++ b/account-kit/core/src/hydrate.ts @@ -1,14 +1,14 @@ +import { AlchemySignerStatus } from "@account-kit/infra"; import type { Address } from "@alchemy/aa-core"; import { hydrate as wagmi_hydrate } from "@wagmi/core"; -import { AlchemySignerStatus } from "../signer/index.js"; import { reconnect } from "./actions/reconnect.js"; import { convertSignerStatusToState, createDefaultAccountState, defaultAccountState, } from "./store/client.js"; -import type { AccountState, ClientState, StoredState } from "./store/types"; -import type { AlchemyAccountsConfig, SupportedAccountTypes } from "./types"; +import type { AccountState, ClientState, StoredState } from "./store/types.js"; +import type { AlchemyAccountsConfig, SupportedAccountTypes } from "./types.js"; /** * Will hydrate the client store with the provided initial state if one is provided. diff --git a/account-kit/core/src/index.ts b/account-kit/core/src/index.ts new file mode 100644 index 0000000000..51eb3f75ae --- /dev/null +++ b/account-kit/core/src/index.ts @@ -0,0 +1,39 @@ +export type * from "./actions/createAccount.js"; +export { createAccount } from "./actions/createAccount.js"; +export type * from "./actions/getAccount.js"; +export { getAccount } from "./actions/getAccount.js"; +export type * from "./actions/getBundlerClient.js"; +export { getBundlerClient } from "./actions/getBundlerClient.js"; +export { getChain } from "./actions/getChain.js"; +export type * from "./actions/getConnection.js"; +export { getConnection } from "./actions/getConnection.js"; +export type * from "./actions/getSigner.js"; +export { getSigner } from "./actions/getSigner.js"; +export type * from "./actions/getSignerStatus.js"; +export { getSignerStatus } from "./actions/getSignerStatus.js"; +export type * from "./actions/getUser.js"; +export { getUser } from "./actions/getUser.js"; +export type * from "./actions/reconnect.js"; +export { reconnect } from "./actions/reconnect.js"; +export { setChain } from "./actions/setChain.js"; +export type * from "./actions/watchAccount.js"; +export { watchAccount } from "./actions/watchAccount.js"; +export type * from "./actions/watchBundlerClient.js"; +export { watchBundlerClient } from "./actions/watchBundlerClient.js"; +export { watchChain } from "./actions/watchChain.js"; +export type * from "./actions/watchConnection.js"; +export { watchConnection } from "./actions/watchConnection.js"; +export type * from "./actions/watchSigner.js"; +export { watchSigner } from "./actions/watchSigner.js"; +export type * from "./actions/watchSignerStatus.js"; +export { watchSignerStatus } from "./actions/watchSignerStatus.js"; +export type * from "./actions/watchUser.js"; +export { watchUser } from "./actions/watchUser.js"; +export { DEFAULT_IFRAME_CONTAINER_ID, createConfig } from "./createConfig.js"; +export type * from "./createConfig.js"; +export { ClientOnlyPropertyError } from "./errors.js"; +export { hydrate } from "./hydrate.js"; +export { defaultAccountState } from "./store/client.js"; +export type { SignerStatus } from "./store/types.js"; +export type * from "./types.js"; +export { cookieStorage, cookieToInitialState } from "./utils/cookies.js"; diff --git a/packages/alchemy/src/config/store/client.ts b/account-kit/core/src/store/client.ts similarity index 96% rename from packages/alchemy/src/config/store/client.ts rename to account-kit/core/src/store/client.ts index 1d7e0cc408..04da52f5ee 100644 --- a/packages/alchemy/src/config/store/client.ts +++ b/account-kit/core/src/store/client.ts @@ -1,13 +1,12 @@ +import { AlchemySignerStatus, AlchemyWebSigner } from "@account-kit/infra"; import type { NoUndefined } from "@alchemy/aa-core"; import type { Chain } from "viem"; import { createJSONStorage, persist, subscribeWithSelector, -} from "zustand/middleware"; +} from "zustand/middleware.js"; import { createStore } from "zustand/vanilla"; -import { AlchemySigner } from "../../signer/signer.js"; -import { AlchemySignerStatus } from "../../signer/types.js"; import { DEFAULT_IFRAME_CONTAINER_ID } from "../createConfig.js"; import type { SupportedAccountTypes } from "../types.js"; import { bigintMapReplacer } from "../utils/replacer.js"; @@ -80,7 +79,7 @@ export const createSigner = (params: CreateClientStoreParams) => { document.body.appendChild(iframeContainer); } - const signer = new AlchemySigner({ + const signer = new AlchemyWebSigner({ client: { ...client, iframeConfig: { diff --git a/packages/alchemy/src/config/store/core.ts b/account-kit/core/src/store/core.ts similarity index 96% rename from packages/alchemy/src/config/store/core.ts rename to account-kit/core/src/store/core.ts index 673b521c3f..39a48e2138 100644 --- a/packages/alchemy/src/config/store/core.ts +++ b/account-kit/core/src/store/core.ts @@ -1,11 +1,11 @@ +import { createAlchemyPublicRpcClient } from "@account-kit/infra"; import type { Chain } from "viem"; import { createJSONStorage, persist, subscribeWithSelector, -} from "zustand/middleware"; +} from "zustand/middleware.js"; import { createStore } from "zustand/vanilla"; -import { createAlchemyPublicRpcClient } from "../../client/rpcClient.js"; import type { Connection } from "../types.js"; import { bigintMapReplacer } from "../utils/replacer.js"; import { bigintMapReviver } from "../utils/reviver.js"; diff --git a/packages/alchemy/src/config/store/types.ts b/account-kit/core/src/store/types.ts similarity index 91% rename from packages/alchemy/src/config/store/types.ts rename to account-kit/core/src/store/types.ts index 96c99ba256..1585fea765 100644 --- a/packages/alchemy/src/config/store/types.ts +++ b/account-kit/core/src/store/types.ts @@ -1,15 +1,15 @@ -import type { State as WagmiState } from "@wagmi/core"; -import type { Address, Chain } from "viem"; -import type { PartialBy } from "viem/chains"; -import type { Mutate, StoreApi } from "zustand/vanilla"; -import type { ClientWithAlchemyMethods } from "../../client/types"; import type { - AlchemySigner, - AlchemySignerClient, AlchemySignerParams, AlchemySignerStatus, + AlchemySignerWebClient, + AlchemyWebSigner, + ClientWithAlchemyMethods, User, -} from "../../signer"; +} from "@account-kit/infra"; +import type { State as WagmiState } from "@wagmi/core"; +import type { Address, Chain } from "viem"; +import type { PartialBy } from "viem/chains"; +import type { Mutate, StoreApi } from "zustand/vanilla"; import type { AccountConfig } from "../actions/createAccount"; import type { Connection, @@ -39,7 +39,7 @@ export type AccountState = export type CreateClientStoreParams = { client: PartialBy< - Exclude, + Exclude, "iframeConfig" >; chains: Chain[]; @@ -59,7 +59,7 @@ export type SignerStatus = { export type ClientState = { // non-serializable // getting this state should throw an error if not on the client - signer?: AlchemySigner; + signer?: AlchemyWebSigner; accounts?: { [chain: number]: { [key in SupportedAccountTypes]: AccountState; diff --git a/packages/alchemy/src/config/types.ts b/account-kit/core/src/types.ts similarity index 85% rename from packages/alchemy/src/config/types.ts rename to account-kit/core/src/types.ts index 7ac2c9a193..e2e22efa1b 100644 --- a/packages/alchemy/src/config/types.ts +++ b/account-kit/core/src/types.ts @@ -1,31 +1,29 @@ import type { + AlchemyGasManagerConfig, + AlchemySignerParams, + AlchemySignerWebClient, + AlchemyWebSigner, LightAccount, MultiOwnerModularAccount, -} from "@alchemy/aa-accounts"; +} from "@account-kit/infra"; import type { ConnectionConfig } from "@alchemy/aa-core"; import type { CreateConnectorFn } from "@wagmi/core"; import { type Config as WagmiConfig } from "@wagmi/core"; import type { Chain } from "viem"; import type { PartialBy } from "viem/chains"; -import type { AlchemyGasManagerConfig } from "../middleware/gasManager"; -import type { - AlchemySigner, - AlchemySignerClient, - AlchemySignerParams, -} from "../signer"; import type { ClientStore, CoreStore, StoredState } from "./store/types"; export type SupportedAccountTypes = "LightAccount" | "MultiOwnerModularAccount"; export type SupportedAccounts = - | LightAccount - | MultiOwnerModularAccount; + | LightAccount + | MultiOwnerModularAccount; export type SupportedAccount = T extends "LightAccount" - ? LightAccount + ? LightAccount : T extends "MultiOwnerModularAccount" - ? MultiOwnerModularAccount + ? MultiOwnerModularAccount : never; export type AlchemyAccountsConfig = { @@ -81,7 +79,7 @@ export type CreateConfigProps = RpcConnectionConfig & { connectors?: CreateConnectorFn[]; } & Omit< PartialBy< - Exclude, + Exclude, "iframeConfig" >, "connection" diff --git a/packages/alchemy/src/config/utils/cookies.ts b/account-kit/core/src/utils/cookies.ts similarity index 95% rename from packages/alchemy/src/config/utils/cookies.ts rename to account-kit/core/src/utils/cookies.ts index 05e418a2ee..733a7575a8 100644 --- a/packages/alchemy/src/config/utils/cookies.ts +++ b/account-kit/core/src/utils/cookies.ts @@ -1,8 +1,8 @@ +import { DEFAULT_SESSION_MS } from "@account-kit/infra"; import { cookieToInitialState as wagmiCookieToInitialState } from "@wagmi/core"; import Cookies from "js-cookie"; -import { DEFAULT_SESSION_MS } from "../../signer/session/manager.js"; import type { ClientState, StoredState } from "../store/types.js"; -import type { AlchemyAccountsConfig } from "../types"; +import type { AlchemyAccountsConfig } from "../types.js"; import { deserialize } from "./deserialize.js"; /** diff --git a/packages/alchemy/src/config/utils/deserialize.ts b/account-kit/core/src/utils/deserialize.ts similarity index 100% rename from packages/alchemy/src/config/utils/deserialize.ts rename to account-kit/core/src/utils/deserialize.ts diff --git a/packages/alchemy/src/config/utils/replacer.ts b/account-kit/core/src/utils/replacer.ts similarity index 100% rename from packages/alchemy/src/config/utils/replacer.ts rename to account-kit/core/src/utils/replacer.ts diff --git a/packages/alchemy/src/config/utils/reviver.ts b/account-kit/core/src/utils/reviver.ts similarity index 100% rename from packages/alchemy/src/config/utils/reviver.ts rename to account-kit/core/src/utils/reviver.ts diff --git a/packages/plugingen/src/version.ts b/account-kit/core/src/version.ts similarity index 100% rename from packages/plugingen/src/version.ts rename to account-kit/core/src/version.ts diff --git a/packages/alchemy/tsconfig.build.json b/account-kit/core/tsconfig.build.json similarity index 100% rename from packages/alchemy/tsconfig.build.json rename to account-kit/core/tsconfig.build.json diff --git a/packages/alchemy/tsconfig.json b/account-kit/core/tsconfig.json similarity index 100% rename from packages/alchemy/tsconfig.json rename to account-kit/core/tsconfig.json diff --git a/packages/signers/vitest.config.e2e.ts b/account-kit/core/vitest.config.e2e.ts similarity index 82% rename from packages/signers/vitest.config.e2e.ts rename to account-kit/core/vitest.config.e2e.ts index 03eab4d06e..c610340362 100644 --- a/packages/signers/vitest.config.e2e.ts +++ b/account-kit/core/vitest.config.e2e.ts @@ -6,7 +6,6 @@ export default defineProject({ globals: true, setupFiles: ["../../.vitest/setupTests.ts"], include: ["**/*/*.e2e.test.ts"], - name: "signers", - environment: "jsdom", + name: "account-kit/state", }, }); diff --git a/packages/signers/vitest.config.ts b/account-kit/core/vitest.config.ts similarity index 85% rename from packages/signers/vitest.config.ts rename to account-kit/core/vitest.config.ts index f39e1f3da9..2021fe81f4 100644 --- a/packages/signers/vitest.config.ts +++ b/account-kit/core/vitest.config.ts @@ -6,7 +6,6 @@ export default defineProject({ globals: true, setupFiles: ["../../.vitest/setupTests.ts"], exclude: [...configDefaults.exclude, "**/e2e-tests/**/*.test.ts"], - name: "signers", - environment: "jsdom", + name: "account-kit/state", }, }); diff --git a/packages/alchemy/e2e-tests/constants.ts b/account-kit/infra/e2e-tests/constants.ts similarity index 100% rename from packages/alchemy/e2e-tests/constants.ts rename to account-kit/infra/e2e-tests/constants.ts diff --git a/packages/alchemy/e2e-tests/light-account.e2e.test.ts b/account-kit/infra/e2e-tests/light-account.e2e.test.ts similarity index 100% rename from packages/alchemy/e2e-tests/light-account.e2e.test.ts rename to account-kit/infra/e2e-tests/light-account.e2e.test.ts diff --git a/packages/alchemy/e2e-tests/modular-account-multi-owner.e2e.test.ts b/account-kit/infra/e2e-tests/modular-account-multi-owner.e2e.test.ts similarity index 100% rename from packages/alchemy/e2e-tests/modular-account-multi-owner.e2e.test.ts rename to account-kit/infra/e2e-tests/modular-account-multi-owner.e2e.test.ts diff --git a/packages/alchemy/e2e-tests/multi-owner-light-account.e2e.test.ts b/account-kit/infra/e2e-tests/multi-owner-light-account.e2e.test.ts similarity index 100% rename from packages/alchemy/e2e-tests/multi-owner-light-account.e2e.test.ts rename to account-kit/infra/e2e-tests/multi-owner-light-account.e2e.test.ts diff --git a/packages/alchemy/e2e-tests/multisig-account.e2e.test.ts b/account-kit/infra/e2e-tests/multisig-account.e2e.test.ts similarity index 100% rename from packages/alchemy/e2e-tests/multisig-account.e2e.test.ts rename to account-kit/infra/e2e-tests/multisig-account.e2e.test.ts diff --git a/packages/alchemy/e2e-tests/simple-account-v7.e2e.test.ts b/account-kit/infra/e2e-tests/simple-account-v7.e2e.test.ts similarity index 100% rename from packages/alchemy/e2e-tests/simple-account-v7.e2e.test.ts rename to account-kit/infra/e2e-tests/simple-account-v7.e2e.test.ts diff --git a/account-kit/infra/inject-version.ts b/account-kit/infra/inject-version.ts new file mode 100644 index 0000000000..cb554c0632 --- /dev/null +++ b/account-kit/infra/inject-version.ts @@ -0,0 +1,19 @@ +import { readFileSync, writeFileSync } from "fs"; +import { dirname, resolve } from "path"; +import { fileURLToPath } from "url"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +const VERSION_FILE_PATH = "src/version.ts"; + +const packageJSON = JSON.parse(readFileSync("./package.json").toString()); + +writeFileSync( + resolve(__dirname, VERSION_FILE_PATH), + `// This file is autogenerated by inject-version.ts. Any changes will be +// overwritten on commit! +export const VERSION = "${packageJSON.version}"; +` +); +console.log(`Wrote version to ${VERSION_FILE_PATH}.`); diff --git a/account-kit/infra/package.json b/account-kit/infra/package.json new file mode 100644 index 0000000000..3a4eb81b9b --- /dev/null +++ b/account-kit/infra/package.json @@ -0,0 +1,81 @@ +{ + "name": "@account-kit/infra", + "version": "3.18.2", + "description": "adapters for @alchemy/aa-core for interacting with alchemy services", + "author": "Alchemy", + "license": "MIT", + "private": false, + "type": "module", + "main": "./dist/cjs/index.js", + "module": "./dist/esm/index.js", + "types": "./dist/types/index.d.ts", + "typings": "./dist/types/index.d.ts", + "sideEffects": false, + "files": [ + "dist", + "src/**/*.ts", + "!dist/**/*.tsbuildinfo", + "!vitest.config.ts", + "!.env", + "!src/**/*.test.ts", + "!src/__tests__/**/*" + ], + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/esm/index.js", + "default": "./dist/cjs/index.js" + }, + "./package.json": "./package.json" + }, + "scripts": { + "prebuild": "node --loader ts-node/esm ./inject-version.ts", + "build": "yarn clean && yarn build:cjs && yarn build:esm && yarn build:types", + "build:cjs": "tsc --project tsconfig.build.json --module commonjs --outDir ./dist/cjs --removeComments --verbatimModuleSyntax false && echo > ./dist/cjs/package.json '{\"type\":\"commonjs\"}'", + "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir ./dist/esm --removeComments && echo > ./dist/esm/package.json '{\"type\":\"module\"}'", + "build:types": "tsc --project tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap", + "clean": "rm -rf ./dist", + "test": "vitest", + "test:run": "vitest run", + "test:run-e2e": "vitest run --config vitest.config.e2e.ts" + }, + "devDependencies": { + "typescript": "^5.0.4", + "typescript-template": "*", + "vitest": "^0.31.0" + }, + "dependencies": { + "@account-kit/smart-contracts": "^3.18.2", + "@alchemy/aa-core": "^3.18.2", + "@turnkey/http": "^2.6.2", + "@turnkey/iframe-stamper": "^1.0.0", + "@turnkey/viem": "^0.4.8", + "@turnkey/webauthn-stamper": "^0.4.3", + "eventemitter3": "^5.0.1", + "viem": "2.8.6", + "zod": "^3.22.4" + }, + "peerDependencies": { + "viem": "2.8.6" + }, + "resolutions": { + "viem": "2.8.6" + }, + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/alchemyplatform/aa-sdk.git" + }, + "bugs": { + "url": "https://github.com/alchemyplatform/aa-sdk/issues" + }, + "homepage": "https://github.com/alchemyplatform/aa-sdk#readme", + "gitHead": "ee46e8bb857de3b631044fa70714ea706d9e317d", + "optionalDependencies": { + "@account-kit/smart-contracts": "^3.18.0", + "alchemy-sdk": "^3.0.0" + } +} diff --git a/packages/alchemy/src/actions/simulateUserOperationChanges.ts b/account-kit/infra/src/actions/simulateUserOperationChanges.ts similarity index 94% rename from packages/alchemy/src/actions/simulateUserOperationChanges.ts rename to account-kit/infra/src/actions/simulateUserOperationChanges.ts index 5c359467bc..0989d665f9 100644 --- a/packages/alchemy/src/actions/simulateUserOperationChanges.ts +++ b/account-kit/infra/src/actions/simulateUserOperationChanges.ts @@ -7,8 +7,8 @@ import { } from "@alchemy/aa-core"; import type { Chain, Client, Transport } from "viem"; import { isAlchemySmartAccountClient } from "../client/isAlchemySmartAccountClient.js"; -import type { AlchemyRpcSchema } from "../client/types"; -import type { SimulateUserOperationAssetChangesResponse } from "./types"; +import type { AlchemyRpcSchema } from "../client/types.js"; +import type { SimulateUserOperationAssetChangesResponse } from "./types.js"; export const simulateUserOperationChanges: < TChain extends Chain | undefined = Chain | undefined, diff --git a/packages/alchemy/src/actions/types.ts b/account-kit/infra/src/actions/types.ts similarity index 100% rename from packages/alchemy/src/actions/types.ts rename to account-kit/infra/src/actions/types.ts diff --git a/packages/alchemy/src/chains.ts b/account-kit/infra/src/chains.ts similarity index 100% rename from packages/alchemy/src/chains.ts rename to account-kit/infra/src/chains.ts diff --git a/packages/alchemy/src/client/__snapshots__/lightAccountClient.test.ts.snap b/account-kit/infra/src/client/__snapshots__/lightAccountClient.test.ts.snap similarity index 100% rename from packages/alchemy/src/client/__snapshots__/lightAccountClient.test.ts.snap rename to account-kit/infra/src/client/__snapshots__/lightAccountClient.test.ts.snap diff --git a/packages/alchemy/src/client/__snapshots__/multiOwnerLightAccountClient.test.ts.snap b/account-kit/infra/src/client/__snapshots__/multiOwnerLightAccountClient.test.ts.snap similarity index 100% rename from packages/alchemy/src/client/__snapshots__/multiOwnerLightAccountClient.test.ts.snap rename to account-kit/infra/src/client/__snapshots__/multiOwnerLightAccountClient.test.ts.snap diff --git a/packages/alchemy/src/client/decorators/alchemyEnhancedApis.ts b/account-kit/infra/src/client/decorators/alchemyEnhancedApis.ts similarity index 100% rename from packages/alchemy/src/client/decorators/alchemyEnhancedApis.ts rename to account-kit/infra/src/client/decorators/alchemyEnhancedApis.ts diff --git a/packages/alchemy/src/client/decorators/smartAccount.ts b/account-kit/infra/src/client/decorators/smartAccount.ts similarity index 100% rename from packages/alchemy/src/client/decorators/smartAccount.ts rename to account-kit/infra/src/client/decorators/smartAccount.ts diff --git a/packages/alchemy/src/client/internal/smartAccountClientFromRpc.ts b/account-kit/infra/src/client/internal/smartAccountClientFromRpc.ts similarity index 97% rename from packages/alchemy/src/client/internal/smartAccountClientFromRpc.ts rename to account-kit/infra/src/client/internal/smartAccountClientFromRpc.ts index 46400252f1..eb468278f9 100644 --- a/packages/alchemy/src/client/internal/smartAccountClientFromRpc.ts +++ b/account-kit/infra/src/client/internal/smartAccountClientFromRpc.ts @@ -14,8 +14,8 @@ import { alchemyActions } from "../decorators/smartAccount.js"; import type { AlchemySmartAccountClient, AlchemySmartAccountClientConfig, -} from "../smartAccountClient"; -import type { ClientWithAlchemyMethods } from "../types"; +} from "../smartAccountClient.js"; +import type { ClientWithAlchemyMethods } from "../types.js"; export type CreateAlchemySmartAccountClientFromRpcClient< TAccount extends SmartContractAccount | undefined = diff --git a/packages/alchemy/src/client/isAlchemySmartAccountClient.ts b/account-kit/infra/src/client/isAlchemySmartAccountClient.ts similarity index 100% rename from packages/alchemy/src/client/isAlchemySmartAccountClient.ts rename to account-kit/infra/src/client/isAlchemySmartAccountClient.ts diff --git a/packages/alchemy/src/client/lightAccountClient.test.ts b/account-kit/infra/src/client/lightAccountClient.test.ts similarity index 100% rename from packages/alchemy/src/client/lightAccountClient.test.ts rename to account-kit/infra/src/client/lightAccountClient.test.ts diff --git a/packages/alchemy/src/client/lightAccountClient.ts b/account-kit/infra/src/client/lightAccountClient.ts similarity index 97% rename from packages/alchemy/src/client/lightAccountClient.ts rename to account-kit/infra/src/client/lightAccountClient.ts index e1b914c691..206749fced 100644 --- a/packages/alchemy/src/client/lightAccountClient.ts +++ b/account-kit/infra/src/client/lightAccountClient.ts @@ -4,7 +4,7 @@ import { type CreateLightAccountParams, type LightAccount, type LightAccountClientActions, -} from "@alchemy/aa-accounts"; +} from "@account-kit/smart-contracts"; import type { HttpTransport, SmartAccountSigner } from "@alchemy/aa-core"; import { custom, type Chain, type CustomTransport, type Transport } from "viem"; import { AlchemyProviderConfigSchema } from "../schema.js"; diff --git a/packages/alchemy/src/client/modularAccountClient.ts b/account-kit/infra/src/client/modularAccountClient.ts similarity index 96% rename from packages/alchemy/src/client/modularAccountClient.ts rename to account-kit/infra/src/client/modularAccountClient.ts index 28251f2fc6..215ad7bb33 100644 --- a/packages/alchemy/src/client/modularAccountClient.ts +++ b/account-kit/infra/src/client/modularAccountClient.ts @@ -9,7 +9,7 @@ import { type MultiOwnerModularAccount, type MultiOwnerPluginActions, type PluginManagerActions, -} from "@alchemy/aa-accounts"; +} from "@account-kit/smart-contracts"; import type { SmartAccountSigner } from "@alchemy/aa-core"; import { custom, @@ -24,7 +24,7 @@ import { createAlchemyPublicRpcClient } from "./rpcClient.js"; import type { AlchemySmartAccountClient, AlchemySmartAccountClientConfig, -} from "./smartAccountClient"; +} from "./smartAccountClient.js"; export type AlchemyModularAccountClientConfig< TSigner extends SmartAccountSigner = SmartAccountSigner diff --git a/packages/alchemy/src/client/multiOwnerLightAccountClient.test.ts b/account-kit/infra/src/client/multiOwnerLightAccountClient.test.ts similarity index 100% rename from packages/alchemy/src/client/multiOwnerLightAccountClient.test.ts rename to account-kit/infra/src/client/multiOwnerLightAccountClient.test.ts diff --git a/packages/alchemy/src/client/multiOwnerLightAccountClient.ts b/account-kit/infra/src/client/multiOwnerLightAccountClient.ts similarity index 98% rename from packages/alchemy/src/client/multiOwnerLightAccountClient.ts rename to account-kit/infra/src/client/multiOwnerLightAccountClient.ts index 43f51bbe0f..b2f2e18581 100644 --- a/packages/alchemy/src/client/multiOwnerLightAccountClient.ts +++ b/account-kit/infra/src/client/multiOwnerLightAccountClient.ts @@ -4,7 +4,7 @@ import { type CreateMultiOwnerLightAccountParams, type MultiOwnerLightAccount, type MultiOwnerLightAccountClientActions, -} from "@alchemy/aa-accounts"; +} from "@account-kit/smart-contracts"; import type { HttpTransport, SmartAccountSigner } from "@alchemy/aa-core"; import { custom, type Chain, type CustomTransport, type Transport } from "viem"; import { AlchemyProviderConfigSchema } from "../schema.js"; diff --git a/packages/alchemy/src/client/multisigAccountClient.ts b/account-kit/infra/src/client/multisigAccountClient.ts similarity index 97% rename from packages/alchemy/src/client/multisigAccountClient.ts rename to account-kit/infra/src/client/multisigAccountClient.ts index 9d9afb24b5..94eb8294bd 100644 --- a/packages/alchemy/src/client/multisigAccountClient.ts +++ b/account-kit/infra/src/client/multisigAccountClient.ts @@ -11,7 +11,7 @@ import { type MultisigPluginActions, type MultisigUserOperationContext, type PluginManagerActions, -} from "@alchemy/aa-accounts"; +} from "@account-kit/smart-contracts"; import { smartAccountClientActions, type SmartAccountSigner, @@ -29,7 +29,7 @@ import { createAlchemyPublicRpcClient } from "./rpcClient.js"; import type { AlchemySmartAccountClient, AlchemySmartAccountClientConfig, -} from "./smartAccountClient"; +} from "./smartAccountClient.js"; // todo: this file seems somewhat duplicated with ./modularAccountClient.ts, but that file has some multi-owner specific fields. Is there a way to refactor these two to de-dupe? diff --git a/packages/alchemy/src/client/rpcClient.ts b/account-kit/infra/src/client/rpcClient.ts similarity index 100% rename from packages/alchemy/src/client/rpcClient.ts rename to account-kit/infra/src/client/rpcClient.ts diff --git a/packages/alchemy/src/client/smartAccountClient.test.ts b/account-kit/infra/src/client/smartAccountClient.test.ts similarity index 98% rename from packages/alchemy/src/client/smartAccountClient.test.ts rename to account-kit/infra/src/client/smartAccountClient.test.ts index e42e3350dc..2b5f211d53 100644 --- a/packages/alchemy/src/client/smartAccountClient.test.ts +++ b/account-kit/infra/src/client/smartAccountClient.test.ts @@ -1,4 +1,4 @@ -import { createLightAccount } from "@alchemy/aa-accounts"; +import { createLightAccount } from "@account-kit/smart-contracts"; import { LocalAccountSigner, sepolia, diff --git a/packages/alchemy/src/client/smartAccountClient.ts b/account-kit/infra/src/client/smartAccountClient.ts similarity index 100% rename from packages/alchemy/src/client/smartAccountClient.ts rename to account-kit/infra/src/client/smartAccountClient.ts diff --git a/packages/alchemy/src/client/types.ts b/account-kit/infra/src/client/types.ts similarity index 100% rename from packages/alchemy/src/client/types.ts rename to account-kit/infra/src/client/types.ts diff --git a/packages/alchemy/src/defaults.ts b/account-kit/infra/src/defaults.ts similarity index 100% rename from packages/alchemy/src/defaults.ts rename to account-kit/infra/src/defaults.ts diff --git a/packages/alchemy/src/errors/base.ts b/account-kit/infra/src/errors/base.ts similarity index 100% rename from packages/alchemy/src/errors/base.ts rename to account-kit/infra/src/errors/base.ts diff --git a/packages/alchemy/src/errors/rpcUrl.ts b/account-kit/infra/src/errors/rpcUrl.ts similarity index 100% rename from packages/alchemy/src/errors/rpcUrl.ts rename to account-kit/infra/src/errors/rpcUrl.ts diff --git a/packages/alchemy/src/gas-manager.ts b/account-kit/infra/src/gas-manager.ts similarity index 100% rename from packages/alchemy/src/gas-manager.ts rename to account-kit/infra/src/gas-manager.ts diff --git a/packages/alchemy/src/index.ts b/account-kit/infra/src/index.ts similarity index 73% rename from packages/alchemy/src/index.ts rename to account-kit/infra/src/index.ts index 50bd578c43..0f2f09f111 100644 --- a/packages/alchemy/src/index.ts +++ b/account-kit/infra/src/index.ts @@ -1,3 +1,4 @@ +// core exports export type * from "./actions/simulateUserOperationChanges.js"; export { simulateUserOperationChanges } from "./actions/simulateUserOperationChanges.js"; export type * from "./actions/types.js"; @@ -31,11 +32,40 @@ export type * from "./schema.js"; export { AlchemyProviderConfigSchema } from "./schema.js"; export type { AlchemyProviderConfig } from "./type.js"; +// Accounts +export type * from "@account-kit/smart-contracts"; +export { + MultiOwnerPlugin, + MultisigPlugin, + MultisigPluginAbi, + MultisigPluginExecutionFunctionAbi, + SessionKeyAccessListType, + SessionKeyPermissionsBuilder, + SessionKeyPlugin, + SessionKeyPluginAbi, + SessionKeyPluginExecutionFunctionAbi, + SessionKeySigner, + accountLoupeActions, + createLightAccount, + createMultiOwnerModularAccount as createModularAccount, + createMultiOwnerLightAccount, + createMultisigModularAccount, + getMAInitializationData, + getMSCAUpgradeToData, + lightAccountClientActions, + multiOwnerLightAccountClientActions, + multiOwnerPluginActions, + multisigPluginActions, + multisigSignatureMiddleware, + pluginManagerActions, + sessionKeyPluginActions, +} from "@account-kit/smart-contracts"; + +// Signer export type * from "./signer/index.js"; export { - AlchemySigner, - AlchemySignerClient, AlchemySignerStatus, AlchemySignerWebClient, AlchemyWebSigner, + DEFAULT_SESSION_MS, } from "./signer/index.js"; diff --git a/packages/alchemy/src/middleware/feeEstimator.ts b/account-kit/infra/src/middleware/feeEstimator.ts similarity index 100% rename from packages/alchemy/src/middleware/feeEstimator.ts rename to account-kit/infra/src/middleware/feeEstimator.ts diff --git a/packages/alchemy/src/middleware/gasManager.ts b/account-kit/infra/src/middleware/gasManager.ts similarity index 100% rename from packages/alchemy/src/middleware/gasManager.ts rename to account-kit/infra/src/middleware/gasManager.ts diff --git a/packages/alchemy/src/middleware/userOperationSimulator.ts b/account-kit/infra/src/middleware/userOperationSimulator.ts similarity index 100% rename from packages/alchemy/src/middleware/userOperationSimulator.ts rename to account-kit/infra/src/middleware/userOperationSimulator.ts diff --git a/packages/alchemy/src/schema.ts b/account-kit/infra/src/schema.ts similarity index 100% rename from packages/alchemy/src/schema.ts rename to account-kit/infra/src/schema.ts diff --git a/packages/alchemy/src/signer/base.ts b/account-kit/infra/src/signer/base.ts similarity index 100% rename from packages/alchemy/src/signer/base.ts rename to account-kit/infra/src/signer/base.ts diff --git a/packages/alchemy/src/signer/client/base.ts b/account-kit/infra/src/signer/client/base.ts similarity index 99% rename from packages/alchemy/src/signer/client/base.ts rename to account-kit/infra/src/signer/client/base.ts index 40b0c40b84..70e0f9642e 100644 --- a/packages/alchemy/src/signer/client/base.ts +++ b/account-kit/infra/src/signer/client/base.ts @@ -18,7 +18,7 @@ import type { SignerRoutes, SignupResponse, User, -} from "./types"; +} from "./types.js"; export interface BaseSignerClientParams { stamper: TurnkeyClient["stamper"]; diff --git a/packages/alchemy/src/signer/client/index.ts b/account-kit/infra/src/signer/client/index.ts similarity index 99% rename from packages/alchemy/src/signer/client/index.ts rename to account-kit/infra/src/signer/client/index.ts index 68a7cbc3b0..d97dc75cd8 100644 --- a/packages/alchemy/src/signer/client/index.ts +++ b/account-kit/infra/src/signer/client/index.ts @@ -12,7 +12,7 @@ import type { EmailAuthParams, ExportWalletParams, User, -} from "./types"; +} from "./types.js"; export const AlchemySignerClientParamsSchema = z.object({ connection: ConnectionConfigSchema, diff --git a/packages/alchemy/src/signer/client/types.ts b/account-kit/infra/src/signer/client/types.ts similarity index 100% rename from packages/alchemy/src/signer/client/types.ts rename to account-kit/infra/src/signer/client/types.ts diff --git a/packages/alchemy/src/signer/errors.ts b/account-kit/infra/src/signer/errors.ts similarity index 100% rename from packages/alchemy/src/signer/errors.ts rename to account-kit/infra/src/signer/errors.ts diff --git a/account-kit/infra/src/signer/index.ts b/account-kit/infra/src/signer/index.ts new file mode 100644 index 0000000000..76d4188425 --- /dev/null +++ b/account-kit/infra/src/signer/index.ts @@ -0,0 +1,10 @@ +export type * from "./signer.js"; +export { AlchemyWebSigner } from "./signer.js"; + +export type * from "./types.js"; +export { AlchemySignerStatus } from "./types.js"; + +export { BaseSignerClient } from "./client/base.js"; +export { AlchemySignerWebClient } from "./client/index.js"; +export type * from "./client/types.js"; +export { DEFAULT_SESSION_MS } from "./session/manager.js"; diff --git a/packages/alchemy/src/signer/session/manager.ts b/account-kit/infra/src/signer/session/manager.ts similarity index 100% rename from packages/alchemy/src/signer/session/manager.ts rename to account-kit/infra/src/signer/session/manager.ts diff --git a/packages/alchemy/src/signer/session/types.ts b/account-kit/infra/src/signer/session/types.ts similarity index 100% rename from packages/alchemy/src/signer/session/types.ts rename to account-kit/infra/src/signer/session/types.ts diff --git a/packages/alchemy/src/signer/signer.ts b/account-kit/infra/src/signer/signer.ts similarity index 93% rename from packages/alchemy/src/signer/signer.ts rename to account-kit/infra/src/signer/signer.ts index d0f2b61fa9..80929f92d4 100644 --- a/packages/alchemy/src/signer/signer.ts +++ b/account-kit/infra/src/signer/signer.ts @@ -4,7 +4,7 @@ import { AlchemySignerClientParamsSchema, AlchemySignerWebClient, } from "./client/index.js"; -import type { CredentialCreationOptionOverrides } from "./client/types"; +import type { CredentialCreationOptionOverrides } from "./client/types.js"; import { SessionManagerParamsSchema } from "./session/manager.js"; export type AuthParams = @@ -36,7 +36,7 @@ export type AlchemySignerParams = z.input; /** * A SmartAccountSigner that can be used with any SmartContractAccount */ -export class AlchemySigner extends BaseAlchemySigner { +export class AlchemyWebSigner extends BaseAlchemySigner { constructor(params_: AlchemySignerParams) { const { sessionConfig, ...params } = AlchemySignerParamsSchema.parse(params_); diff --git a/packages/alchemy/src/signer/types.ts b/account-kit/infra/src/signer/types.ts similarity index 100% rename from packages/alchemy/src/signer/types.ts rename to account-kit/infra/src/signer/types.ts diff --git a/packages/alchemy/src/signer/utils/base64UrlEncode.ts b/account-kit/infra/src/signer/utils/base64UrlEncode.ts similarity index 100% rename from packages/alchemy/src/signer/utils/base64UrlEncode.ts rename to account-kit/infra/src/signer/utils/base64UrlEncode.ts diff --git a/packages/alchemy/src/signer/utils/generateRandomBuffer.ts b/account-kit/infra/src/signer/utils/generateRandomBuffer.ts similarity index 100% rename from packages/alchemy/src/signer/utils/generateRandomBuffer.ts rename to account-kit/infra/src/signer/utils/generateRandomBuffer.ts diff --git a/packages/alchemy/src/type.ts b/account-kit/infra/src/type.ts similarity index 100% rename from packages/alchemy/src/type.ts rename to account-kit/infra/src/type.ts diff --git a/account-kit/infra/src/version.ts b/account-kit/infra/src/version.ts new file mode 100644 index 0000000000..aed1937226 --- /dev/null +++ b/account-kit/infra/src/version.ts @@ -0,0 +1,3 @@ +// This file is autogenerated by inject-version.ts. Any changes will be +// overwritten on commit! +export const VERSION = "3.18.2"; diff --git a/packages/signers/tsconfig.build.json b/account-kit/infra/tsconfig.build.json similarity index 85% rename from packages/signers/tsconfig.build.json rename to account-kit/infra/tsconfig.build.json index 7bae05bd62..605911996a 100644 --- a/packages/signers/tsconfig.build.json +++ b/account-kit/infra/tsconfig.build.json @@ -10,6 +10,7 @@ ], "include": ["src"], "compilerOptions": { - "sourceMap": true + "sourceMap": true, + "jsx": "react-jsx" } } diff --git a/account-kit/infra/tsconfig.json b/account-kit/infra/tsconfig.json new file mode 100644 index 0000000000..ece75e6070 --- /dev/null +++ b/account-kit/infra/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "typescript-template/base.json", + "compilerOptions": { + "jsx": "preserve" + } +} diff --git a/packages/alchemy/vitest.config.e2e.ts b/account-kit/infra/vitest.config.e2e.ts similarity index 100% rename from packages/alchemy/vitest.config.e2e.ts rename to account-kit/infra/vitest.config.e2e.ts diff --git a/packages/alchemy/vitest.config.ts b/account-kit/infra/vitest.config.ts similarity index 100% rename from packages/alchemy/vitest.config.ts rename to account-kit/infra/vitest.config.ts diff --git a/account-kit/react/inject-version.ts b/account-kit/react/inject-version.ts new file mode 100644 index 0000000000..cb554c0632 --- /dev/null +++ b/account-kit/react/inject-version.ts @@ -0,0 +1,19 @@ +import { readFileSync, writeFileSync } from "fs"; +import { dirname, resolve } from "path"; +import { fileURLToPath } from "url"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +const VERSION_FILE_PATH = "src/version.ts"; + +const packageJSON = JSON.parse(readFileSync("./package.json").toString()); + +writeFileSync( + resolve(__dirname, VERSION_FILE_PATH), + `// This file is autogenerated by inject-version.ts. Any changes will be +// overwritten on commit! +export const VERSION = "${packageJSON.version}"; +` +); +console.log(`Wrote version to ${VERSION_FILE_PATH}.`); diff --git a/packages/alchemy/package.json b/account-kit/react/package.json similarity index 69% rename from packages/alchemy/package.json rename to account-kit/react/package.json index eddec3bbcc..214336de30 100644 --- a/packages/alchemy/package.json +++ b/account-kit/react/package.json @@ -1,7 +1,7 @@ { - "name": "@alchemy/aa-alchemy", + "name": "@account-kit/react", "version": "3.19.0", - "description": "adapters for @alchemy/aa-core for interacting with alchemy services", + "description": "React components and hooks for using Account Kit", "author": "Alchemy", "license": "MIT", "private": false, @@ -26,16 +26,6 @@ "import": "./dist/esm/index.js", "default": "./dist/cjs/index.js" }, - "./config": { - "types": "./dist/types/config/index.d.ts", - "import": "./dist/esm/config/index.js", - "default": "./dist/cjs/config/index.js" - }, - "./react": { - "types": "./dist/types/react/index.d.ts", - "import": "./dist/esm/react/index.js", - "default": "./dist/cjs/react/index.js" - }, "./tailwind": { "types": "./dist/types/tailwind/index.d.ts", "import": "./dist/esm/tailwind/index.js", @@ -50,12 +40,11 @@ "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir ./dist/esm --removeComments && echo > ./dist/esm/package.json '{\"type\":\"module\"}'", "build:types": "tsc --project tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap", "clean": "rm -rf ./dist", - "test": "vitest", - "test:run": "vitest run", - "test:run-e2e": "vitest run --config vitest.config.e2e.ts" + "test": "vitest --passWithNoTests", + "test:run": "vitest run --passWithNoTests", + "test:run-e2e": "vitest run --config vitest.config.e2e.ts --passWithNoTests" }, "devDependencies": { - "@alchemy/aa-accounts": "*", "@tanstack/react-query": "^5.28.9", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -65,22 +54,16 @@ "vitest": "^0.31.0" }, "dependencies": { - "@alchemy/aa-core": "^3.19.0", + "@account-kit/core": "^3.18.2", + "@account-kit/infra": "^3.18.2", "@tanstack/react-form": "^0.19.4", "@tanstack/zod-form-adapter": "^0.19.4", - "@turnkey/http": "^2.6.2", - "@turnkey/iframe-stamper": "^1.0.0", - "@turnkey/viem": "^0.4.8", - "@turnkey/webauthn-stamper": "^0.4.3", "@wagmi/connectors": "^4.3.9", "@wagmi/core": "^2.9.8", - "eventemitter3": "^5.0.1", - "js-cookie": "^3.0.5", "tailwindcss": "^3.4.3", "viem": "2.8.6", "wagmi": "^2.8.8", - "zod": "^3.22.4", - "zustand": "^4.5.2" + "zod": "^3.22.4" }, "peerDependencies": { "@tanstack/react-query": "^5.28.9", @@ -89,20 +72,6 @@ "tailwindcss": "^3.4.3", "viem": "2.8.6" }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - }, - "tailwindcss": { - "optional": true - }, - "@tanstack/react-query": { - "optional": true - } - }, "resolutions": { "viem": "2.8.6" }, @@ -120,7 +89,6 @@ "homepage": "https://github.com/alchemyplatform/aa-sdk#readme", "gitHead": "ee46e8bb857de3b631044fa70714ea706d9e317d", "optionalDependencies": { - "@alchemy/aa-accounts": "^3.19.0", "alchemy-sdk": "^3.0.0" } } diff --git a/packages/alchemy/src/react/components/auth/card/add-passkey.tsx b/account-kit/react/src/components/auth/card/add-passkey.tsx similarity index 100% rename from packages/alchemy/src/react/components/auth/card/add-passkey.tsx rename to account-kit/react/src/components/auth/card/add-passkey.tsx diff --git a/packages/alchemy/src/react/components/auth/card/content.tsx b/account-kit/react/src/components/auth/card/content.tsx similarity index 100% rename from packages/alchemy/src/react/components/auth/card/content.tsx rename to account-kit/react/src/components/auth/card/content.tsx diff --git a/packages/alchemy/src/react/components/auth/card/eoa.tsx b/account-kit/react/src/components/auth/card/eoa.tsx similarity index 100% rename from packages/alchemy/src/react/components/auth/card/eoa.tsx rename to account-kit/react/src/components/auth/card/eoa.tsx diff --git a/packages/alchemy/src/react/components/auth/card/index.tsx b/account-kit/react/src/components/auth/card/index.tsx similarity index 100% rename from packages/alchemy/src/react/components/auth/card/index.tsx rename to account-kit/react/src/components/auth/card/index.tsx diff --git a/packages/alchemy/src/react/components/auth/card/loading/email.tsx b/account-kit/react/src/components/auth/card/loading/email.tsx similarity index 100% rename from packages/alchemy/src/react/components/auth/card/loading/email.tsx rename to account-kit/react/src/components/auth/card/loading/email.tsx diff --git a/packages/alchemy/src/react/components/auth/card/loading/index.tsx b/account-kit/react/src/components/auth/card/loading/index.tsx similarity index 100% rename from packages/alchemy/src/react/components/auth/card/loading/index.tsx rename to account-kit/react/src/components/auth/card/loading/index.tsx diff --git a/packages/alchemy/src/react/components/auth/card/loading/passkey.tsx b/account-kit/react/src/components/auth/card/loading/passkey.tsx similarity index 100% rename from packages/alchemy/src/react/components/auth/card/loading/passkey.tsx rename to account-kit/react/src/components/auth/card/loading/passkey.tsx diff --git a/packages/alchemy/src/react/components/auth/card/main.tsx b/account-kit/react/src/components/auth/card/main.tsx similarity index 100% rename from packages/alchemy/src/react/components/auth/card/main.tsx rename to account-kit/react/src/components/auth/card/main.tsx diff --git a/packages/alchemy/src/react/components/auth/card/passkey-added.tsx b/account-kit/react/src/components/auth/card/passkey-added.tsx similarity index 100% rename from packages/alchemy/src/react/components/auth/card/passkey-added.tsx rename to account-kit/react/src/components/auth/card/passkey-added.tsx diff --git a/packages/alchemy/src/react/components/auth/card/steps.tsx b/account-kit/react/src/components/auth/card/steps.tsx similarity index 100% rename from packages/alchemy/src/react/components/auth/card/steps.tsx rename to account-kit/react/src/components/auth/card/steps.tsx diff --git a/packages/alchemy/src/react/components/auth/context.ts b/account-kit/react/src/components/auth/context.ts similarity index 100% rename from packages/alchemy/src/react/components/auth/context.ts rename to account-kit/react/src/components/auth/context.ts diff --git a/packages/alchemy/src/react/components/auth/hooks/usePasskeyVerify.ts b/account-kit/react/src/components/auth/hooks/usePasskeyVerify.ts similarity index 100% rename from packages/alchemy/src/react/components/auth/hooks/usePasskeyVerify.ts rename to account-kit/react/src/components/auth/hooks/usePasskeyVerify.ts diff --git a/packages/alchemy/src/react/components/auth/modal.tsx b/account-kit/react/src/components/auth/modal.tsx similarity index 100% rename from packages/alchemy/src/react/components/auth/modal.tsx rename to account-kit/react/src/components/auth/modal.tsx diff --git a/packages/alchemy/src/react/components/auth/sections/AuthSection.tsx b/account-kit/react/src/components/auth/sections/AuthSection.tsx similarity index 100% rename from packages/alchemy/src/react/components/auth/sections/AuthSection.tsx rename to account-kit/react/src/components/auth/sections/AuthSection.tsx diff --git a/packages/alchemy/src/react/components/auth/sections/EmailAuth.tsx b/account-kit/react/src/components/auth/sections/EmailAuth.tsx similarity index 100% rename from packages/alchemy/src/react/components/auth/sections/EmailAuth.tsx rename to account-kit/react/src/components/auth/sections/EmailAuth.tsx diff --git a/packages/alchemy/src/react/components/auth/sections/InjectedProvidersAuth.tsx b/account-kit/react/src/components/auth/sections/InjectedProvidersAuth.tsx similarity index 100% rename from packages/alchemy/src/react/components/auth/sections/InjectedProvidersAuth.tsx rename to account-kit/react/src/components/auth/sections/InjectedProvidersAuth.tsx diff --git a/packages/alchemy/src/react/components/auth/sections/PasskeyAuth.tsx b/account-kit/react/src/components/auth/sections/PasskeyAuth.tsx similarity index 100% rename from packages/alchemy/src/react/components/auth/sections/PasskeyAuth.tsx rename to account-kit/react/src/components/auth/sections/PasskeyAuth.tsx diff --git a/packages/alchemy/src/react/components/auth/types.ts b/account-kit/react/src/components/auth/types.ts similarity index 100% rename from packages/alchemy/src/react/components/auth/types.ts rename to account-kit/react/src/components/auth/types.ts diff --git a/packages/alchemy/src/react/components/button.tsx b/account-kit/react/src/components/button.tsx similarity index 100% rename from packages/alchemy/src/react/components/button.tsx rename to account-kit/react/src/components/button.tsx diff --git a/packages/alchemy/src/react/components/constants.ts b/account-kit/react/src/components/constants.ts similarity index 100% rename from packages/alchemy/src/react/components/constants.ts rename to account-kit/react/src/components/constants.ts diff --git a/packages/alchemy/src/react/components/divider.tsx b/account-kit/react/src/components/divider.tsx similarity index 100% rename from packages/alchemy/src/react/components/divider.tsx rename to account-kit/react/src/components/divider.tsx diff --git a/account-kit/react/src/components/error.tsx b/account-kit/react/src/components/error.tsx new file mode 100644 index 0000000000..3ccf3a0b8f --- /dev/null +++ b/account-kit/react/src/components/error.tsx @@ -0,0 +1,17 @@ +interface ErrorContainerProps { + error?: Error | string; +} + +// eslint-disable-next-line jsdoc/require-jsdoc +export const ErrorContainer = ({ error }: ErrorContainerProps) => { + return ( +
+
+ Error +
+
+ {error != null ? error.toString() : "Oops! Something went wrong"} +
+
+ ); +}; diff --git a/packages/alchemy/src/react/components/input.tsx b/account-kit/react/src/components/input.tsx similarity index 100% rename from packages/alchemy/src/react/components/input.tsx rename to account-kit/react/src/components/input.tsx diff --git a/packages/alchemy/src/react/components/navigation.tsx b/account-kit/react/src/components/navigation.tsx similarity index 100% rename from packages/alchemy/src/react/components/navigation.tsx rename to account-kit/react/src/components/navigation.tsx diff --git a/packages/alchemy/src/react/components/notification.tsx b/account-kit/react/src/components/notification.tsx similarity index 100% rename from packages/alchemy/src/react/components/notification.tsx rename to account-kit/react/src/components/notification.tsx diff --git a/packages/alchemy/src/react/components/poweredby.tsx b/account-kit/react/src/components/poweredby.tsx similarity index 100% rename from packages/alchemy/src/react/components/poweredby.tsx rename to account-kit/react/src/components/poweredby.tsx diff --git a/packages/alchemy/src/react/context.tsx b/account-kit/react/src/context.tsx similarity index 98% rename from packages/alchemy/src/react/context.tsx rename to account-kit/react/src/context.tsx index b05d1988da..af9d4b94a5 100644 --- a/packages/alchemy/src/react/context.tsx +++ b/account-kit/react/src/context.tsx @@ -1,5 +1,9 @@ "use client"; +import type { + AlchemyAccountsConfig, + AlchemyClientState, +} from "@account-kit/core"; import type { NoUndefined } from "@alchemy/aa-core"; import { QueryClientProvider, type QueryClient } from "@tanstack/react-query"; import { @@ -10,14 +14,13 @@ import { useRef, useState, } from "react"; -import type { AlchemyAccountsConfig, AlchemyClientState } from "../config"; import type { AuthCardProps } from "./components/auth/card/index.js"; +import { AuthModalContext, type AuthStep } from "./components/auth/context.js"; +import { AuthModal } from "./components/auth/modal.js"; import { IS_SIGNUP_QP } from "./components/constants.js"; import { NoAlchemyAccountContextError } from "./errors.js"; import { useSignerStatus } from "./hooks/useSignerStatus.js"; import { Hydrate } from "./hydrate.js"; -import { AuthModalContext, type AuthStep } from "./components/auth/context.js"; -import { AuthModal } from "./components/auth/modal.js"; export type AlchemyAccountContextProps = | { diff --git a/packages/alchemy/src/react/errors.ts b/account-kit/react/src/errors.ts similarity index 82% rename from packages/alchemy/src/react/errors.ts rename to account-kit/react/src/errors.ts index 2dcdb44652..f475421df1 100644 --- a/packages/alchemy/src/react/errors.ts +++ b/account-kit/react/src/errors.ts @@ -1,4 +1,10 @@ -import { BaseError } from "../errors/base.js"; +import { BaseError as CoreBaseError } from "@alchemy/aa-core"; +import { VERSION } from "./version.js"; + +export abstract class BaseError extends CoreBaseError { + // This version could be different from the aa-core version so we overwrite this here. + override version = VERSION; +} /** * Error thrown when a hook is called without a AlchemyAccountProvider. diff --git a/packages/alchemy/src/react/hooks/useAccount.ts b/account-kit/react/src/hooks/useAccount.ts similarity index 91% rename from packages/alchemy/src/react/hooks/useAccount.ts rename to account-kit/react/src/hooks/useAccount.ts index ace95cba9f..8e1c1bc1df 100644 --- a/packages/alchemy/src/react/hooks/useAccount.ts +++ b/account-kit/react/src/hooks/useAccount.ts @@ -1,19 +1,17 @@ "use client"; -import { useMutation } from "@tanstack/react-query"; -import { useEffect, useSyncExternalStore } from "react"; -import type { Address } from "viem"; -import { createAccount } from "../../config/actions/createAccount.js"; import { + createAccount, getAccount, + watchAccount, type GetAccountParams, -} from "../../config/actions/getAccount.js"; -import { watchAccount } from "../../config/actions/watchAccount.js"; -import { type SupportedAccount, - type SupportedAccountTypes, type SupportedAccounts, -} from "../../config/index.js"; + type SupportedAccountTypes, +} from "@account-kit/core"; +import { useMutation } from "@tanstack/react-query"; +import { useEffect, useSyncExternalStore } from "react"; +import type { Address } from "viem"; import { useAlchemyAccountContext } from "../context.js"; import type { BaseHookMutationArgs } from "../types.js"; import { useSignerStatus } from "./useSignerStatus.js"; diff --git a/packages/alchemy/src/react/hooks/useAddPasskey.ts b/account-kit/react/src/hooks/useAddPasskey.ts similarity index 100% rename from packages/alchemy/src/react/hooks/useAddPasskey.ts rename to account-kit/react/src/hooks/useAddPasskey.ts diff --git a/packages/alchemy/src/react/hooks/useAuthError.ts b/account-kit/react/src/hooks/useAuthError.ts similarity index 100% rename from packages/alchemy/src/react/hooks/useAuthError.ts rename to account-kit/react/src/hooks/useAuthError.ts diff --git a/packages/alchemy/src/react/hooks/useAuthModal.ts b/account-kit/react/src/hooks/useAuthModal.ts similarity index 100% rename from packages/alchemy/src/react/hooks/useAuthModal.ts rename to account-kit/react/src/hooks/useAuthModal.ts diff --git a/packages/alchemy/src/react/hooks/useAuthenticate.ts b/account-kit/react/src/hooks/useAuthenticate.ts similarity index 87% rename from packages/alchemy/src/react/hooks/useAuthenticate.ts rename to account-kit/react/src/hooks/useAuthenticate.ts index c1990a9cb1..a4d8735679 100644 --- a/packages/alchemy/src/react/hooks/useAuthenticate.ts +++ b/account-kit/react/src/hooks/useAuthenticate.ts @@ -1,13 +1,12 @@ "use client"; +import { ClientOnlyPropertyError } from "@account-kit/core"; +import type { AuthParams, User } from "@account-kit/infra"; import { useMutation, type UseMutateAsyncFunction, type UseMutateFunction, } from "@tanstack/react-query"; -import { ClientOnlyPropertyError } from "../../config/errors.js"; -import type { User } from "../../signer/index.js"; -import type { AuthParams } from "../../signer/signer.js"; import { useAlchemyAccountContext } from "../context.js"; import type { BaseHookMutationArgs } from "../types.js"; import { useSigner } from "./useSigner.js"; diff --git a/packages/alchemy/src/react/hooks/useBundlerClient.ts b/account-kit/react/src/hooks/useBundlerClient.ts similarity index 66% rename from packages/alchemy/src/react/hooks/useBundlerClient.ts rename to account-kit/react/src/hooks/useBundlerClient.ts index 10a69a65c0..f8841fe59e 100644 --- a/packages/alchemy/src/react/hooks/useBundlerClient.ts +++ b/account-kit/react/src/hooks/useBundlerClient.ts @@ -1,9 +1,8 @@ "use client"; +import { getBundlerClient, watchBundlerClient } from "@account-kit/core"; +import type { ClientWithAlchemyMethods } from "@account-kit/infra"; import { useSyncExternalStore } from "react"; -import type { ClientWithAlchemyMethods } from "../../client/types.js"; -import { watchBundlerClient } from "../../config/actions/watchBundlerClient.js"; -import { getBundlerClient } from "../../config/index.js"; import { useAlchemyAccountContext } from "../context.js"; export type UseBundlerClientResult = ClientWithAlchemyMethods; diff --git a/packages/alchemy/src/react/hooks/useChain.ts b/account-kit/react/src/hooks/useChain.ts similarity index 85% rename from packages/alchemy/src/react/hooks/useChain.ts rename to account-kit/react/src/hooks/useChain.ts index 4f5537d6d7..7e8b37457b 100644 --- a/packages/alchemy/src/react/hooks/useChain.ts +++ b/account-kit/react/src/hooks/useChain.ts @@ -1,9 +1,11 @@ +import { + getChain, + setChain as setChainInternal, + watchChain, +} from "@account-kit/core"; import { useMutation } from "@tanstack/react-query"; import { useSyncExternalStore } from "react"; import type { Chain } from "viem"; -import { getChain } from "../../config/actions/getChain.js"; -import { setChain as setChainInternal } from "../../config/actions/setChain.js"; -import { watchChain } from "../../config/actions/watchChain.js"; import { useAlchemyAccountContext } from "../context.js"; import type { BaseHookMutationArgs } from "../types.js"; diff --git a/packages/alchemy/src/react/hooks/useClientActions.ts b/account-kit/react/src/hooks/useClientActions.ts similarity index 98% rename from packages/alchemy/src/react/hooks/useClientActions.ts rename to account-kit/react/src/hooks/useClientActions.ts index d437a7f966..d02d4266c6 100644 --- a/packages/alchemy/src/react/hooks/useClientActions.ts +++ b/account-kit/react/src/hooks/useClientActions.ts @@ -1,7 +1,7 @@ +import type { SupportedAccounts } from "@account-kit/core"; import { useMutation } from "@tanstack/react-query"; import { useCallback } from "react"; import type { Chain, Client, Transport } from "viem"; -import type { SupportedAccounts } from "../../config"; import { ClientUndefinedHookError } from "../errors.js"; import type { UseSmartAccountClientResult } from "./useSmartAccountClient"; diff --git a/packages/alchemy/src/react/hooks/useConnect.ts b/account-kit/react/src/hooks/useConnect.ts similarity index 100% rename from packages/alchemy/src/react/hooks/useConnect.ts rename to account-kit/react/src/hooks/useConnect.ts diff --git a/packages/alchemy/src/react/hooks/useConnection.ts b/account-kit/react/src/hooks/useConnection.ts similarity index 73% rename from packages/alchemy/src/react/hooks/useConnection.ts rename to account-kit/react/src/hooks/useConnection.ts index be928de904..43b5357b30 100644 --- a/packages/alchemy/src/react/hooks/useConnection.ts +++ b/account-kit/react/src/hooks/useConnection.ts @@ -1,6 +1,5 @@ +import { getConnection, watchConnection } from "@account-kit/core"; import { useSyncExternalStore } from "react"; -import { getConnection } from "../../config/actions/getConnection.js"; -import { watchConnection } from "../../config/actions/watchConnection.js"; import { useAlchemyAccountContext } from "../context.js"; /** diff --git a/packages/alchemy/src/react/hooks/useDropAndReplaceUserOperation.ts b/account-kit/react/src/hooks/useDropAndReplaceUserOperation.ts similarity index 97% rename from packages/alchemy/src/react/hooks/useDropAndReplaceUserOperation.ts rename to account-kit/react/src/hooks/useDropAndReplaceUserOperation.ts index 0cc279f2e5..a63b3e9bb6 100644 --- a/packages/alchemy/src/react/hooks/useDropAndReplaceUserOperation.ts +++ b/account-kit/react/src/hooks/useDropAndReplaceUserOperation.ts @@ -1,12 +1,12 @@ "use client"; +import type { SupportedAccounts } from "@account-kit/core"; import type { DropAndReplaceUserOperationParameters, GetEntryPointFromAccount, SendUserOperationResult, } from "@alchemy/aa-core"; import { useMutation, type UseMutateFunction } from "@tanstack/react-query"; -import type { SupportedAccounts } from "../../config/types.js"; import { useAlchemyAccountContext } from "../context.js"; import { ClientUndefinedHookError } from "../errors.js"; import type { BaseHookMutationArgs } from "../types.js"; diff --git a/packages/alchemy/src/react/hooks/useExportAccount.ts b/account-kit/react/src/hooks/useExportAccount.ts similarity index 96% rename from packages/alchemy/src/react/hooks/useExportAccount.ts rename to account-kit/react/src/hooks/useExportAccount.ts index ad8bf4caff..160cbe7c9e 100644 --- a/packages/alchemy/src/react/hooks/useExportAccount.ts +++ b/account-kit/react/src/hooks/useExportAccount.ts @@ -1,9 +1,9 @@ "use client"; +import { DEFAULT_IFRAME_CONTAINER_ID } from "@account-kit/core"; +import type { ExportWalletParams as ExportAccountParams } from "@account-kit/infra"; import { useMutation, type UseMutateFunction } from "@tanstack/react-query"; import { createElement, useCallback, type CSSProperties } from "react"; -import { DEFAULT_IFRAME_CONTAINER_ID } from "../../config/createConfig.js"; -import type { ExportWalletParams as ExportAccountParams } from "../../index.js"; import { useAlchemyAccountContext } from "../context.js"; import type { BaseHookMutationArgs } from "../types.js"; import { useSigner } from "./useSigner.js"; diff --git a/packages/alchemy/src/react/hooks/useLogout.ts b/account-kit/react/src/hooks/useLogout.ts similarity index 100% rename from packages/alchemy/src/react/hooks/useLogout.ts rename to account-kit/react/src/hooks/useLogout.ts diff --git a/packages/alchemy/src/react/hooks/useSendTransaction.ts b/account-kit/react/src/hooks/useSendTransaction.ts similarity index 100% rename from packages/alchemy/src/react/hooks/useSendTransaction.ts rename to account-kit/react/src/hooks/useSendTransaction.ts diff --git a/packages/alchemy/src/react/hooks/useSendTransactions.ts b/account-kit/react/src/hooks/useSendTransactions.ts similarity index 98% rename from packages/alchemy/src/react/hooks/useSendTransactions.ts rename to account-kit/react/src/hooks/useSendTransactions.ts index 4c21f6f17a..867f32251d 100644 --- a/packages/alchemy/src/react/hooks/useSendTransactions.ts +++ b/account-kit/react/src/hooks/useSendTransactions.ts @@ -1,5 +1,6 @@ "use client"; +import type { SupportedAccounts } from "@account-kit/core"; import { type GetEntryPointFromAccount, type SendTransactionsParameters, @@ -12,7 +13,6 @@ import { } from "@tanstack/react-query"; import { type Chain, type Hash, type Hex, type Transport } from "viem"; import { useAccount as wagmi_useAccount } from "wagmi"; -import type { SupportedAccounts } from "../../config/types.js"; import { useAlchemyAccountContext } from "../context.js"; import { ClientUndefinedHookError, diff --git a/packages/alchemy/src/react/hooks/useSendUserOperation.ts b/account-kit/react/src/hooks/useSendUserOperation.ts similarity index 98% rename from packages/alchemy/src/react/hooks/useSendUserOperation.ts rename to account-kit/react/src/hooks/useSendUserOperation.ts index 74aa21f0e2..ad71b97652 100644 --- a/packages/alchemy/src/react/hooks/useSendUserOperation.ts +++ b/account-kit/react/src/hooks/useSendUserOperation.ts @@ -1,5 +1,6 @@ "use client"; +import type { SupportedAccounts } from "@account-kit/core"; import type { EntryPointVersion, GetEntryPointFromAccount, @@ -15,7 +16,6 @@ import { import { sendTransaction as wagmi_sendTransaction } from "@wagmi/core"; import type { Hex } from "viem"; import { useAccount as wagmi_useAccount } from "wagmi"; -import type { SupportedAccounts } from "../../config/types.js"; import { useAlchemyAccountContext } from "../context.js"; import { ClientUndefinedHookError, diff --git a/packages/alchemy/src/react/hooks/useSignMessage.ts b/account-kit/react/src/hooks/useSignMessage.ts similarity index 100% rename from packages/alchemy/src/react/hooks/useSignMessage.ts rename to account-kit/react/src/hooks/useSignMessage.ts diff --git a/packages/alchemy/src/react/hooks/useSignTypedData.ts b/account-kit/react/src/hooks/useSignTypedData.ts similarity index 100% rename from packages/alchemy/src/react/hooks/useSignTypedData.ts rename to account-kit/react/src/hooks/useSignTypedData.ts diff --git a/packages/alchemy/src/react/hooks/useSigner.ts b/account-kit/react/src/hooks/useSigner.ts similarity index 70% rename from packages/alchemy/src/react/hooks/useSigner.ts rename to account-kit/react/src/hooks/useSigner.ts index 9671b66442..8ff1fb0e40 100644 --- a/packages/alchemy/src/react/hooks/useSigner.ts +++ b/account-kit/react/src/hooks/useSigner.ts @@ -1,12 +1,11 @@ "use client"; +import { getSigner, watchSigner } from "@account-kit/core"; +import type { AlchemyWebSigner } from "@account-kit/infra"; import { useSyncExternalStore } from "react"; -import { watchSigner } from "../../config/actions/watchSigner.js"; -import { getSigner } from "../../config/index.js"; -import type { AlchemySigner } from "../../signer/index.js"; import { useAlchemyAccountContext } from "../context.js"; -export const useSigner = (): AlchemySigner | null => { +export const useSigner = (): AlchemyWebSigner | null => { const { config } = useAlchemyAccountContext(); // TODO: figure out how to handle this on the server diff --git a/packages/alchemy/src/react/hooks/useSignerStatus.ts b/account-kit/react/src/hooks/useSignerStatus.ts similarity index 69% rename from packages/alchemy/src/react/hooks/useSignerStatus.ts rename to account-kit/react/src/hooks/useSignerStatus.ts index 656f6ab535..5adc3f3b57 100644 --- a/packages/alchemy/src/react/hooks/useSignerStatus.ts +++ b/account-kit/react/src/hooks/useSignerStatus.ts @@ -1,9 +1,8 @@ "use client"; +import type { SignerStatus } from "@account-kit/core"; +import { getSignerStatus, watchSignerStatus } from "@account-kit/core"; import { useSyncExternalStore } from "react"; -import { getSignerStatus } from "../../config/actions/getSignerStatus.js"; -import { watchSignerStatus } from "../../config/actions/watchSignerStatus.js"; -import type { SignerStatus } from "../../config/store/types.js"; import { useAlchemyAccountContext, type AlchemyAccountContextProps, diff --git a/packages/alchemy/src/react/hooks/useSmartAccountClient.ts b/account-kit/react/src/hooks/useSmartAccountClient.ts similarity index 82% rename from packages/alchemy/src/react/hooks/useSmartAccountClient.ts rename to account-kit/react/src/hooks/useSmartAccountClient.ts index c56c6dae6d..cce9890a1f 100644 --- a/packages/alchemy/src/react/hooks/useSmartAccountClient.ts +++ b/account-kit/react/src/hooks/useSmartAccountClient.ts @@ -1,32 +1,30 @@ "use client"; +import type { + GetAccountParams, + SupportedAccount, + SupportedAccounts, + SupportedAccountTypes, +} from "@account-kit/core"; import { accountLoupeActions, + createAlchemySmartAccountClientFromExisting, lightAccountClientActions, multiOwnerPluginActions, pluginManagerActions, type AccountLoupeActions, + type AlchemySmartAccountClient, + type AlchemySmartAccountClientConfig, + type AlchemyWebSigner, type LightAccount, type LightAccountClientActions, type MultiOwnerModularAccount, type MultiOwnerPluginActions, type PluginManagerActions, -} from "@alchemy/aa-accounts"; +} from "@account-kit/infra"; import { useMemo } from "react"; import type { Address, Chain, Transport } from "viem"; import { useAccount as wagmi_useAccount } from "wagmi"; -import { createAlchemySmartAccountClientFromRpcClient } from "../../client/internal/smartAccountClientFromRpc.js"; -import type { - AlchemySmartAccountClient, - AlchemySmartAccountClientConfig, -} from "../../client/smartAccountClient"; -import type { - SupportedAccount, - SupportedAccountTypes, - SupportedAccounts, -} from "../../config"; -import type { GetAccountParams } from "../../config/actions/getAccount.js"; -import type { AlchemySigner } from "../../signer"; import { useAlchemyAccountContext } from "../context.js"; import { useAccount } from "./useAccount.js"; import { useBundlerClient } from "./useBundlerClient.js"; @@ -49,11 +47,11 @@ export type UseSmartAccountClientProps< export type ClientActions< TAccount extends SupportedAccounts = SupportedAccounts > = TAccount extends LightAccount - ? LightAccountClientActions + ? LightAccountClientActions : TAccount extends MultiOwnerModularAccount - ? MultiOwnerPluginActions> & - PluginManagerActions> & - AccountLoupeActions> + ? MultiOwnerPluginActions> & + PluginManagerActions> & + AccountLoupeActions> : never; export type UseSmartAccountClientResult< @@ -128,7 +126,7 @@ export function useSmartAccountClient({ switch (account.source) { case "LightAccount": return { - client: createAlchemySmartAccountClientFromRpcClient({ + client: createAlchemySmartAccountClientFromExisting({ client: bundlerClient, account, gasManagerConfig: connection.gasManagerConfig, @@ -139,7 +137,7 @@ export function useSmartAccountClient({ }; case "MultiOwnerModularAccount": return { - client: createAlchemySmartAccountClientFromRpcClient({ + client: createAlchemySmartAccountClientFromExisting({ client: bundlerClient, account, gasManagerConfig: connection.gasManagerConfig, diff --git a/packages/alchemy/src/react/hooks/useUser.ts b/account-kit/react/src/hooks/useUser.ts similarity index 85% rename from packages/alchemy/src/react/hooks/useUser.ts rename to account-kit/react/src/hooks/useUser.ts index 02fbfabdaf..f7174eb55d 100644 --- a/packages/alchemy/src/react/hooks/useUser.ts +++ b/account-kit/react/src/hooks/useUser.ts @@ -1,10 +1,9 @@ "use client"; +import { getUser, watchUser } from "@account-kit/core"; +import type { User } from "@account-kit/infra"; import { useMemo, useSyncExternalStore } from "react"; import { useAccount as wagmi_useAccount } from "wagmi"; -import { getUser } from "../../config/actions/getUser.js"; -import { watchUser } from "../../config/actions/watchUser.js"; -import type { User } from "../../signer/index.js"; import { useAlchemyAccountContext } from "../context.js"; export type UseUserResult = (User & { type: "eoa" | "sca" }) | null; diff --git a/packages/alchemy/src/react/hooks/useWaitForUserOperationTransaction.ts b/account-kit/react/src/hooks/useWaitForUserOperationTransaction.ts similarity index 100% rename from packages/alchemy/src/react/hooks/useWaitForUserOperationTransaction.ts rename to account-kit/react/src/hooks/useWaitForUserOperationTransaction.ts diff --git a/packages/alchemy/src/react/hydrate.ts b/account-kit/react/src/hydrate.ts similarity index 88% rename from packages/alchemy/src/react/hydrate.ts rename to account-kit/react/src/hydrate.ts index d16ffa7cdf..9694d397a2 100644 --- a/packages/alchemy/src/react/hydrate.ts +++ b/account-kit/react/src/hydrate.ts @@ -1,13 +1,15 @@ "use client"; +import { + hydrate, + type AlchemyAccountsConfig, + type AlchemyClientState, +} from "@account-kit/core"; import { useEffect, useRef, type PropsWithChildren } from "react"; -import type { AlchemyAccountsConfig } from "../config"; -import { hydrate } from "../config/hydrate.js"; -import type { StoredState } from "../config/store/types"; export type HydrateProps = { config: AlchemyAccountsConfig; - initialState?: StoredState; + initialState?: AlchemyClientState; }; /** diff --git a/packages/alchemy/src/react/icons/alchemy.tsx b/account-kit/react/src/icons/alchemy.tsx similarity index 100% rename from packages/alchemy/src/react/icons/alchemy.tsx rename to account-kit/react/src/icons/alchemy.tsx diff --git a/packages/alchemy/src/react/icons/chevron.tsx b/account-kit/react/src/icons/chevron.tsx similarity index 100% rename from packages/alchemy/src/react/icons/chevron.tsx rename to account-kit/react/src/icons/chevron.tsx diff --git a/packages/alchemy/src/react/icons/google.tsx b/account-kit/react/src/icons/google.tsx similarity index 100% rename from packages/alchemy/src/react/icons/google.tsx rename to account-kit/react/src/icons/google.tsx diff --git a/packages/alchemy/src/react/icons/hourglass.tsx b/account-kit/react/src/icons/hourglass.tsx similarity index 100% rename from packages/alchemy/src/react/icons/hourglass.tsx rename to account-kit/react/src/icons/hourglass.tsx diff --git a/packages/alchemy/src/react/icons/mail.tsx b/account-kit/react/src/icons/mail.tsx similarity index 100% rename from packages/alchemy/src/react/icons/mail.tsx rename to account-kit/react/src/icons/mail.tsx diff --git a/packages/alchemy/src/react/icons/nav.tsx b/account-kit/react/src/icons/nav.tsx similarity index 100% rename from packages/alchemy/src/react/icons/nav.tsx rename to account-kit/react/src/icons/nav.tsx diff --git a/packages/alchemy/src/react/icons/passkey.tsx b/account-kit/react/src/icons/passkey.tsx similarity index 100% rename from packages/alchemy/src/react/icons/passkey.tsx rename to account-kit/react/src/icons/passkey.tsx diff --git a/packages/alchemy/src/react/icons/spinner.tsx b/account-kit/react/src/icons/spinner.tsx similarity index 100% rename from packages/alchemy/src/react/icons/spinner.tsx rename to account-kit/react/src/icons/spinner.tsx diff --git a/packages/alchemy/src/react/index.ts b/account-kit/react/src/index.ts similarity index 96% rename from packages/alchemy/src/react/index.ts rename to account-kit/react/src/index.ts index a6be010a51..f922cf67b9 100644 --- a/packages/alchemy/src/react/index.ts +++ b/account-kit/react/src/index.ts @@ -1,3 +1,8 @@ +export { + cookieStorage, + createConfig, + type CreateConfigProps, +} from "@account-kit/core"; export type * from "./context.js"; export { AlchemyAccountContext, diff --git a/packages/alchemy/src/react/strings.ts b/account-kit/react/src/strings.ts similarity index 100% rename from packages/alchemy/src/react/strings.ts rename to account-kit/react/src/strings.ts diff --git a/packages/alchemy/src/tailwind/components/buttons.ts b/account-kit/react/src/tailwind/components/buttons.ts similarity index 100% rename from packages/alchemy/src/tailwind/components/buttons.ts rename to account-kit/react/src/tailwind/components/buttons.ts diff --git a/packages/alchemy/src/tailwind/components/colorsvars.ts b/account-kit/react/src/tailwind/components/colorsvars.ts similarity index 100% rename from packages/alchemy/src/tailwind/components/colorsvars.ts rename to account-kit/react/src/tailwind/components/colorsvars.ts diff --git a/packages/alchemy/src/tailwind/components/form-controls.ts b/account-kit/react/src/tailwind/components/form-controls.ts similarity index 100% rename from packages/alchemy/src/tailwind/components/form-controls.ts rename to account-kit/react/src/tailwind/components/form-controls.ts diff --git a/packages/alchemy/src/tailwind/components/input.ts b/account-kit/react/src/tailwind/components/input.ts similarity index 100% rename from packages/alchemy/src/tailwind/components/input.ts rename to account-kit/react/src/tailwind/components/input.ts diff --git a/packages/alchemy/src/tailwind/components/modal.ts b/account-kit/react/src/tailwind/components/modal.ts similarity index 100% rename from packages/alchemy/src/tailwind/components/modal.ts rename to account-kit/react/src/tailwind/components/modal.ts diff --git a/packages/alchemy/src/tailwind/index.ts b/account-kit/react/src/tailwind/index.ts similarity index 100% rename from packages/alchemy/src/tailwind/index.ts rename to account-kit/react/src/tailwind/index.ts diff --git a/packages/alchemy/src/tailwind/plugin.ts b/account-kit/react/src/tailwind/plugin.ts similarity index 99% rename from packages/alchemy/src/tailwind/plugin.ts rename to account-kit/react/src/tailwind/plugin.ts index 9fea2d5219..af00eaff81 100644 --- a/packages/alchemy/src/tailwind/plugin.ts +++ b/account-kit/react/src/tailwind/plugin.ts @@ -6,7 +6,7 @@ import { formControlComponents } from "./components/form-controls.js"; import { inputComponents } from "./components/input.js"; import { modalComponents } from "./components/modal.js"; import { createDefaultTheme } from "./theme.js"; -import type { AccountKitThemeColor, AccountKitThemeOverride } from "./types"; +import type { AccountKitThemeColor, AccountKitThemeOverride } from "./types.js"; import { borderUtilities } from "./utilities/borders.js"; import { apply, getColorVariableName } from "./utils.js"; diff --git a/packages/alchemy/src/tailwind/theme.ts b/account-kit/react/src/tailwind/theme.ts similarity index 100% rename from packages/alchemy/src/tailwind/theme.ts rename to account-kit/react/src/tailwind/theme.ts diff --git a/packages/alchemy/src/tailwind/types.ts b/account-kit/react/src/tailwind/types.ts similarity index 100% rename from packages/alchemy/src/tailwind/types.ts rename to account-kit/react/src/tailwind/types.ts diff --git a/packages/alchemy/src/tailwind/utilities/borders.ts b/account-kit/react/src/tailwind/utilities/borders.ts similarity index 100% rename from packages/alchemy/src/tailwind/utilities/borders.ts rename to account-kit/react/src/tailwind/utilities/borders.ts diff --git a/packages/alchemy/src/tailwind/utils.test.ts b/account-kit/react/src/tailwind/utils.test.ts similarity index 100% rename from packages/alchemy/src/tailwind/utils.test.ts rename to account-kit/react/src/tailwind/utils.test.ts diff --git a/packages/alchemy/src/tailwind/utils.ts b/account-kit/react/src/tailwind/utils.ts similarity index 100% rename from packages/alchemy/src/tailwind/utils.ts rename to account-kit/react/src/tailwind/utils.ts diff --git a/packages/alchemy/src/react/types.ts b/account-kit/react/src/types.ts similarity index 100% rename from packages/alchemy/src/react/types.ts rename to account-kit/react/src/types.ts diff --git a/account-kit/react/src/version.ts b/account-kit/react/src/version.ts new file mode 100644 index 0000000000..aed1937226 --- /dev/null +++ b/account-kit/react/src/version.ts @@ -0,0 +1,3 @@ +// This file is autogenerated by inject-version.ts. Any changes will be +// overwritten on commit! +export const VERSION = "3.18.2"; diff --git a/packages/accounts/tsconfig.build.json b/account-kit/react/tsconfig.build.json similarity index 77% rename from packages/accounts/tsconfig.build.json rename to account-kit/react/tsconfig.build.json index 25e4c9b948..605911996a 100644 --- a/packages/accounts/tsconfig.build.json +++ b/account-kit/react/tsconfig.build.json @@ -8,8 +8,9 @@ "vitest.config.ts", "vitest.config.e2e.ts" ], - "include": ["src", "plugingen", "plugindefs"], + "include": ["src"], "compilerOptions": { - "sourceMap": true + "sourceMap": true, + "jsx": "react-jsx" } } diff --git a/account-kit/react/tsconfig.json b/account-kit/react/tsconfig.json new file mode 100644 index 0000000000..ece75e6070 --- /dev/null +++ b/account-kit/react/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "typescript-template/base.json", + "compilerOptions": { + "jsx": "preserve" + } +} diff --git a/packages/accounts/vitest.config.e2e.ts b/account-kit/react/vitest.config.e2e.ts similarity index 90% rename from packages/accounts/vitest.config.e2e.ts rename to account-kit/react/vitest.config.e2e.ts index 454ab5757f..cb2d44aca7 100644 --- a/packages/accounts/vitest.config.e2e.ts +++ b/account-kit/react/vitest.config.e2e.ts @@ -6,6 +6,6 @@ export default defineProject({ globals: true, setupFiles: ["../../.vitest/setupTests.ts"], include: ["**/*/*.e2e.test.ts"], - name: "accounts", + name: "aa-alchemy", }, }); diff --git a/packages/accounts/vitest.config.ts b/account-kit/react/vitest.config.ts similarity index 92% rename from packages/accounts/vitest.config.ts rename to account-kit/react/vitest.config.ts index 2cfffbd66f..64869aeaa1 100644 --- a/packages/accounts/vitest.config.ts +++ b/account-kit/react/vitest.config.ts @@ -6,6 +6,6 @@ export default defineProject({ globals: true, setupFiles: ["../../.vitest/setupTests.ts"], exclude: [...configDefaults.exclude, "**/e2e-tests/**/*.test.ts"], - name: "accounts", + name: "aa-alchemy", }, }); diff --git a/packages/accounts/CHANGELOG.md b/account-kit/smart-contracts/CHANGELOG.md similarity index 100% rename from packages/accounts/CHANGELOG.md rename to account-kit/smart-contracts/CHANGELOG.md diff --git a/packages/accounts/package.json b/account-kit/smart-contracts/package.json similarity index 87% rename from packages/accounts/package.json rename to account-kit/smart-contracts/package.json index cc1b09b551..50470cba8a 100644 --- a/packages/accounts/package.json +++ b/account-kit/smart-contracts/package.json @@ -1,7 +1,7 @@ { - "name": "@alchemy/aa-accounts", + "name": "@account-kit/smart-contracts", "version": "3.19.0", - "description": "A collection of ERC-4337 compliant smart contract account interfaces", + "description": "aa-sdk compatible interfaces for Alchemy Smart Accounts", "author": "Alchemy", "license": "MIT", "private": false, @@ -28,11 +28,6 @@ "import": "./dist/esm/src/index.js", "default": "./dist/cjs/src/index.js" }, - "./plugin-gen": { - "types": "./dist/types/plugingen/index.d.ts", - "import": "./dist/esm/plugingen/index.js", - "default": "./dist/cjs/plugingen/index.js" - }, "./plugin-defs": { "types": "./dist/types/plugindefs/index.d.ts", "import": "./dist/esm/plugindefs/index.js", @@ -41,7 +36,7 @@ "./package.json": "./package.json" }, "scripts": { - "generate": "npx wagmi generate", + "generate": "npx tsx ../../aa-sdk/plugingen/src/cli.ts generate", "build": "yarn clean && yarn build:cjs && yarn build:esm && yarn build:types", "build:cjs": "tsc --project tsconfig.build.json --module commonjs --outDir ./dist/cjs --removeComments --verbatimModuleSyntax false && echo > ./dist/cjs/package.json '{\"type\":\"commonjs\"}'", "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir ./dist/esm --removeComments && echo > ./dist/esm/package.json '{\"type\":\"module\"}'", @@ -52,6 +47,7 @@ "test:run-e2e": "vitest run --config vitest.config.e2e.ts" }, "devDependencies": { + "@alchemy/plugingen": "*", "@wagmi/cli": "^1.5.2", "change-case": "^5.1.2", "dedent": "^1.5.1", diff --git a/packages/accounts/plugindefs/index.ts b/account-kit/smart-contracts/plugindefs/index.ts similarity index 100% rename from packages/accounts/plugindefs/index.ts rename to account-kit/smart-contracts/plugindefs/index.ts diff --git a/packages/accounts/plugindefs/multi-owner/abi.ts b/account-kit/smart-contracts/plugindefs/multi-owner/abi.ts similarity index 100% rename from packages/accounts/plugindefs/multi-owner/abi.ts rename to account-kit/smart-contracts/plugindefs/multi-owner/abi.ts diff --git a/packages/accounts/plugindefs/multi-owner/config.ts b/account-kit/smart-contracts/plugindefs/multi-owner/config.ts similarity index 92% rename from packages/accounts/plugindefs/multi-owner/config.ts rename to account-kit/smart-contracts/plugindefs/multi-owner/config.ts index 907a972fbc..d397160848 100644 --- a/packages/accounts/plugindefs/multi-owner/config.ts +++ b/account-kit/smart-contracts/plugindefs/multi-owner/config.ts @@ -3,23 +3,23 @@ import { arbitrumSepolia, base, baseSepolia, + fraxtal, + fraxtalSepolia, + mainnet, optimism, optimismSepolia, polygon, polygonAmoy, polygonMumbai, sepolia, - fraxtal, - fraxtalSepolia, zora, zoraSepolia, - mainnet, } from "@alchemy/aa-core"; +import type { PluginConfig } from "@alchemy/plugingen"; import { parseAbiParameters } from "viem"; -import type { PluginGenConfig } from "../types"; import { MultiOwnerPluginAbi } from "./abi.js"; -export const MultiOwnerPluginGenConfig: PluginGenConfig = { +export const MultiOwnerPluginGenConfig: PluginConfig = { name: "MultiOwnerPlugin", abi: MultiOwnerPluginAbi, addresses: { @@ -40,7 +40,6 @@ export const MultiOwnerPluginGenConfig: PluginGenConfig = { [zoraSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647", [mainnet.id]: "0xcE0000007B008F50d762D155002600004cD6c647", }, - chain: sepolia, installConfig: { initAbiParams: parseAbiParameters("address[]"), }, diff --git a/packages/accounts/plugindefs/multisig/abi.ts b/account-kit/smart-contracts/plugindefs/multisig/abi.ts similarity index 100% rename from packages/accounts/plugindefs/multisig/abi.ts rename to account-kit/smart-contracts/plugindefs/multisig/abi.ts diff --git a/packages/accounts/plugindefs/multisig/config.ts b/account-kit/smart-contracts/plugindefs/multisig/config.ts similarity index 91% rename from packages/accounts/plugindefs/multisig/config.ts rename to account-kit/smart-contracts/plugindefs/multisig/config.ts index 3ffee157df..8e9f1bf2e4 100644 --- a/packages/accounts/plugindefs/multisig/config.ts +++ b/account-kit/smart-contracts/plugindefs/multisig/config.ts @@ -1,24 +1,24 @@ import { - baseSepolia, - sepolia, - polygon, - mainnet, - polygonAmoy, - optimism, - optimismSepolia, arbitrum, arbitrumSepolia, base, + baseSepolia, fraxtal, fraxtalSepolia, + mainnet, + optimism, + optimismSepolia, + polygon, + polygonAmoy, + sepolia, zora, zoraSepolia, } from "@alchemy/aa-core"; +import type { PluginConfig } from "@alchemy/plugingen"; import { parseAbiParameters } from "viem"; -import type { PluginGenConfig } from "../types"; import { MultisigPluginAbi } from "./abi.js"; -export const MultisigPluginGenConfig: PluginGenConfig = { +export const MultisigPluginGenConfig: PluginConfig = { name: "MultisigPlugin", abi: MultisigPluginAbi, addresses: { @@ -37,7 +37,6 @@ export const MultisigPluginGenConfig: PluginGenConfig = { [zora.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7", [zoraSepolia.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7", }, - chain: sepolia, installConfig: { initAbiParams: parseAbiParameters("address[], uint"), }, diff --git a/packages/accounts/plugindefs/session-key/abi.ts b/account-kit/smart-contracts/plugindefs/session-key/abi.ts similarity index 100% rename from packages/accounts/plugindefs/session-key/abi.ts rename to account-kit/smart-contracts/plugindefs/session-key/abi.ts diff --git a/packages/accounts/plugindefs/session-key/config.ts b/account-kit/smart-contracts/plugindefs/session-key/config.ts similarity index 93% rename from packages/accounts/plugindefs/session-key/config.ts rename to account-kit/smart-contracts/plugindefs/session-key/config.ts index 01dd15a6ed..7e5d67c3c1 100644 --- a/packages/accounts/plugindefs/session-key/config.ts +++ b/account-kit/smart-contracts/plugindefs/session-key/config.ts @@ -3,24 +3,24 @@ import { arbitrumSepolia, base, baseSepolia, + fraxtal, + fraxtalSepolia, + mainnet, optimism, optimismSepolia, polygon, polygonAmoy, polygonMumbai, sepolia, - fraxtal, - fraxtalSepolia, zora, zoraSepolia, - mainnet, } from "@alchemy/aa-core"; +import type { PluginConfig } from "@alchemy/plugingen"; import { parseAbiParameters } from "viem"; import { MultiOwnerPluginGenConfig } from "../multi-owner/config.js"; -import type { PluginGenConfig } from "../types"; import { SessionKeyPluginAbi } from "./abi.js"; -export const SessionKeyPluginGenConfig: PluginGenConfig = { +export const SessionKeyPluginGenConfig: PluginConfig = { name: "SessionKeyPlugin", abi: SessionKeyPluginAbi, addresses: { @@ -41,7 +41,6 @@ export const SessionKeyPluginGenConfig: PluginGenConfig = { [zoraSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d", [mainnet.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d", }, - chain: sepolia, installConfig: { initAbiParams: parseAbiParameters( "address[] initialKeys, bytes32[] tags, bytes[][] initialPermissions" diff --git a/packages/accounts/plugindefs/types.ts b/account-kit/smart-contracts/plugindefs/types.ts similarity index 100% rename from packages/accounts/plugindefs/types.ts rename to account-kit/smart-contracts/plugindefs/types.ts diff --git a/account-kit/smart-contracts/plugingen.config.ts b/account-kit/smart-contracts/plugingen.config.ts new file mode 100644 index 0000000000..6f35b616ed --- /dev/null +++ b/account-kit/smart-contracts/plugingen.config.ts @@ -0,0 +1,18 @@ +import { defineConfig } from "@alchemy/plugingen"; +import { sepolia } from "viem/chains"; +import { + MultiOwnerPluginGenConfig, + MultisigPluginGenConfig, + SessionKeyPluginGenConfig, +} from "./plugindefs/index.js"; + +export default defineConfig({ + outDir: "./src/msca/plugins", + chain: sepolia, + rpcUrl: "https://ethereum-sepolia.publicnode.com", + plugins: [ + MultiOwnerPluginGenConfig, + MultisigPluginGenConfig, + SessionKeyPluginGenConfig, + ], +}); diff --git a/packages/accounts/src/index.ts b/account-kit/smart-contracts/src/index.ts similarity index 93% rename from packages/accounts/src/index.ts rename to account-kit/smart-contracts/src/index.ts index af8ab89931..16639a3b4b 100644 --- a/packages/accounts/src/index.ts +++ b/account-kit/smart-contracts/src/index.ts @@ -27,12 +27,6 @@ export { createMultiOwnerLightAccountClient } from "./light-account/clients/mult export type * from "./light-account/decorators/multiOwnerLightAccount.js"; export { multiOwnerLightAccountClientActions } from "./light-account/decorators/multiOwnerLightAccount.js"; -//nani-account exports -export { createNaniAccount } from "./nani-account/account.js"; -export type { NaniAccount } from "./nani-account/account.js"; -export { transferOwnership as transferNaniAccountOwnership } from "./nani-account/transferNaniAccountOwnership.js"; -export { getDefaultNaniAccountFactoryAddress } from "./nani-account/utils.js"; - // msca exports export { IAccountLoupeAbi } from "./msca/abis/IAccountLoupe.js"; export { IPluginAbi } from "./msca/abis/IPlugin.js"; diff --git a/packages/accounts/src/light-account/abis/LightAccountAbi_v1.ts b/account-kit/smart-contracts/src/light-account/abis/LightAccountAbi_v1.ts similarity index 100% rename from packages/accounts/src/light-account/abis/LightAccountAbi_v1.ts rename to account-kit/smart-contracts/src/light-account/abis/LightAccountAbi_v1.ts diff --git a/packages/accounts/src/light-account/abis/LightAccountAbi_v2.ts b/account-kit/smart-contracts/src/light-account/abis/LightAccountAbi_v2.ts similarity index 100% rename from packages/accounts/src/light-account/abis/LightAccountAbi_v2.ts rename to account-kit/smart-contracts/src/light-account/abis/LightAccountAbi_v2.ts diff --git a/packages/accounts/src/light-account/abis/LightAccountFactoryAbi_v1.ts b/account-kit/smart-contracts/src/light-account/abis/LightAccountFactoryAbi_v1.ts similarity index 100% rename from packages/accounts/src/light-account/abis/LightAccountFactoryAbi_v1.ts rename to account-kit/smart-contracts/src/light-account/abis/LightAccountFactoryAbi_v1.ts diff --git a/packages/accounts/src/light-account/abis/LightAccountFactoryAbi_v2.ts b/account-kit/smart-contracts/src/light-account/abis/LightAccountFactoryAbi_v2.ts similarity index 100% rename from packages/accounts/src/light-account/abis/LightAccountFactoryAbi_v2.ts rename to account-kit/smart-contracts/src/light-account/abis/LightAccountFactoryAbi_v2.ts diff --git a/packages/accounts/src/light-account/abis/MultiOwnerLightAccountAbi.ts b/account-kit/smart-contracts/src/light-account/abis/MultiOwnerLightAccountAbi.ts similarity index 100% rename from packages/accounts/src/light-account/abis/MultiOwnerLightAccountAbi.ts rename to account-kit/smart-contracts/src/light-account/abis/MultiOwnerLightAccountAbi.ts diff --git a/packages/accounts/src/light-account/abis/MultiOwnerLightAccountFactoryAbi.ts b/account-kit/smart-contracts/src/light-account/abis/MultiOwnerLightAccountFactoryAbi.ts similarity index 100% rename from packages/accounts/src/light-account/abis/MultiOwnerLightAccountFactoryAbi.ts rename to account-kit/smart-contracts/src/light-account/abis/MultiOwnerLightAccountFactoryAbi.ts diff --git a/packages/accounts/src/light-account/accounts/account.test.ts b/account-kit/smart-contracts/src/light-account/accounts/account.test.ts similarity index 100% rename from packages/accounts/src/light-account/accounts/account.test.ts rename to account-kit/smart-contracts/src/light-account/accounts/account.test.ts diff --git a/packages/accounts/src/light-account/accounts/account.ts b/account-kit/smart-contracts/src/light-account/accounts/account.ts similarity index 100% rename from packages/accounts/src/light-account/accounts/account.ts rename to account-kit/smart-contracts/src/light-account/accounts/account.ts diff --git a/packages/accounts/src/light-account/accounts/base.ts b/account-kit/smart-contracts/src/light-account/accounts/base.ts similarity index 100% rename from packages/accounts/src/light-account/accounts/base.ts rename to account-kit/smart-contracts/src/light-account/accounts/base.ts diff --git a/packages/accounts/src/light-account/accounts/multiOwner.ts b/account-kit/smart-contracts/src/light-account/accounts/multiOwner.ts similarity index 100% rename from packages/accounts/src/light-account/accounts/multiOwner.ts rename to account-kit/smart-contracts/src/light-account/accounts/multiOwner.ts diff --git a/packages/accounts/src/light-account/actions/transferOwnership.ts b/account-kit/smart-contracts/src/light-account/actions/transferOwnership.ts similarity index 100% rename from packages/accounts/src/light-account/actions/transferOwnership.ts rename to account-kit/smart-contracts/src/light-account/actions/transferOwnership.ts diff --git a/packages/accounts/src/light-account/actions/updateOwners.ts b/account-kit/smart-contracts/src/light-account/actions/updateOwners.ts similarity index 100% rename from packages/accounts/src/light-account/actions/updateOwners.ts rename to account-kit/smart-contracts/src/light-account/actions/updateOwners.ts diff --git a/packages/accounts/src/light-account/clients/lightAccount.ts b/account-kit/smart-contracts/src/light-account/clients/lightAccount.ts similarity index 100% rename from packages/accounts/src/light-account/clients/lightAccount.ts rename to account-kit/smart-contracts/src/light-account/clients/lightAccount.ts diff --git a/packages/accounts/src/light-account/clients/multiOwnerLightAccount.ts b/account-kit/smart-contracts/src/light-account/clients/multiOwnerLightAccount.ts similarity index 100% rename from packages/accounts/src/light-account/clients/multiOwnerLightAccount.ts rename to account-kit/smart-contracts/src/light-account/clients/multiOwnerLightAccount.ts diff --git a/packages/accounts/src/light-account/decorators/lightAccount.ts b/account-kit/smart-contracts/src/light-account/decorators/lightAccount.ts similarity index 100% rename from packages/accounts/src/light-account/decorators/lightAccount.ts rename to account-kit/smart-contracts/src/light-account/decorators/lightAccount.ts diff --git a/packages/accounts/src/light-account/decorators/multiOwnerLightAccount.ts b/account-kit/smart-contracts/src/light-account/decorators/multiOwnerLightAccount.ts similarity index 100% rename from packages/accounts/src/light-account/decorators/multiOwnerLightAccount.ts rename to account-kit/smart-contracts/src/light-account/decorators/multiOwnerLightAccount.ts diff --git a/packages/accounts/src/light-account/e2e-tests/constants.ts b/account-kit/smart-contracts/src/light-account/e2e-tests/constants.ts similarity index 100% rename from packages/accounts/src/light-account/e2e-tests/constants.ts rename to account-kit/smart-contracts/src/light-account/e2e-tests/constants.ts diff --git a/packages/accounts/src/light-account/e2e-tests/light-account-v2.e2e.test.ts b/account-kit/smart-contracts/src/light-account/e2e-tests/light-account-v2.e2e.test.ts similarity index 100% rename from packages/accounts/src/light-account/e2e-tests/light-account-v2.e2e.test.ts rename to account-kit/smart-contracts/src/light-account/e2e-tests/light-account-v2.e2e.test.ts diff --git a/packages/accounts/src/light-account/e2e-tests/light-account.e2e.test.ts b/account-kit/smart-contracts/src/light-account/e2e-tests/light-account.e2e.test.ts similarity index 100% rename from packages/accounts/src/light-account/e2e-tests/light-account.e2e.test.ts rename to account-kit/smart-contracts/src/light-account/e2e-tests/light-account.e2e.test.ts diff --git a/packages/accounts/src/light-account/e2e-tests/multi-owner-light-account.e2e.test.ts b/account-kit/smart-contracts/src/light-account/e2e-tests/multi-owner-light-account.e2e.test.ts similarity index 100% rename from packages/accounts/src/light-account/e2e-tests/multi-owner-light-account.e2e.test.ts rename to account-kit/smart-contracts/src/light-account/e2e-tests/multi-owner-light-account.e2e.test.ts diff --git a/packages/accounts/src/light-account/schema.ts b/account-kit/smart-contracts/src/light-account/schema.ts similarity index 100% rename from packages/accounts/src/light-account/schema.ts rename to account-kit/smart-contracts/src/light-account/schema.ts diff --git a/packages/accounts/src/light-account/types.ts b/account-kit/smart-contracts/src/light-account/types.ts similarity index 100% rename from packages/accounts/src/light-account/types.ts rename to account-kit/smart-contracts/src/light-account/types.ts diff --git a/packages/accounts/src/light-account/utils.ts b/account-kit/smart-contracts/src/light-account/utils.ts similarity index 100% rename from packages/accounts/src/light-account/utils.ts rename to account-kit/smart-contracts/src/light-account/utils.ts diff --git a/packages/accounts/src/msca/abis/IAccountLoupe.ts b/account-kit/smart-contracts/src/msca/abis/IAccountLoupe.ts similarity index 100% rename from packages/accounts/src/msca/abis/IAccountLoupe.ts rename to account-kit/smart-contracts/src/msca/abis/IAccountLoupe.ts diff --git a/account-kit/smart-contracts/src/msca/abis/IPlugin.ts b/account-kit/smart-contracts/src/msca/abis/IPlugin.ts new file mode 100644 index 0000000000..893d5eee91 --- /dev/null +++ b/account-kit/smart-contracts/src/msca/abis/IPlugin.ts @@ -0,0 +1,396 @@ +export const IPluginAbi = [ + { + type: "function", + name: "onInstall", + inputs: [{ name: "data", type: "bytes", internalType: "bytes" }], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "onUninstall", + inputs: [{ name: "data", type: "bytes", internalType: "bytes" }], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "pluginManifest", + inputs: [], + outputs: [ + { + name: "", + type: "tuple", + internalType: "struct PluginManifest", + components: [ + { name: "interfaceIds", type: "bytes4[]", internalType: "bytes4[]" }, + { + name: "dependencyInterfaceIds", + type: "bytes4[]", + internalType: "bytes4[]", + }, + { + name: "executionFunctions", + type: "bytes4[]", + internalType: "bytes4[]", + }, + { + name: "permittedExecutionSelectors", + type: "bytes4[]", + internalType: "bytes4[]", + }, + { + name: "permitAnyExternalAddress", + type: "bool", + internalType: "bool", + }, + { name: "canSpendNativeToken", type: "bool", internalType: "bool" }, + { + name: "permittedExternalCalls", + type: "tuple[]", + internalType: "struct ManifestExternalCallPermission[]", + components: [ + { + name: "externalAddress", + type: "address", + internalType: "address", + }, + { name: "permitAnySelector", type: "bool", internalType: "bool" }, + { name: "selectors", type: "bytes4[]", internalType: "bytes4[]" }, + ], + }, + { + name: "userOpValidationFunctions", + type: "tuple[]", + internalType: "struct ManifestAssociatedFunction[]", + components: [ + { + name: "executionSelector", + type: "bytes4", + internalType: "bytes4", + }, + { + name: "associatedFunction", + type: "tuple", + internalType: "struct ManifestFunction", + components: [ + { + name: "functionType", + type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", + }, + { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "dependencyIndex", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + }, + { + name: "runtimeValidationFunctions", + type: "tuple[]", + internalType: "struct ManifestAssociatedFunction[]", + components: [ + { + name: "executionSelector", + type: "bytes4", + internalType: "bytes4", + }, + { + name: "associatedFunction", + type: "tuple", + internalType: "struct ManifestFunction", + components: [ + { + name: "functionType", + type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", + }, + { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "dependencyIndex", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + }, + { + name: "preUserOpValidationHooks", + type: "tuple[]", + internalType: "struct ManifestAssociatedFunction[]", + components: [ + { + name: "executionSelector", + type: "bytes4", + internalType: "bytes4", + }, + { + name: "associatedFunction", + type: "tuple", + internalType: "struct ManifestFunction", + components: [ + { + name: "functionType", + type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", + }, + { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "dependencyIndex", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + }, + { + name: "preRuntimeValidationHooks", + type: "tuple[]", + internalType: "struct ManifestAssociatedFunction[]", + components: [ + { + name: "executionSelector", + type: "bytes4", + internalType: "bytes4", + }, + { + name: "associatedFunction", + type: "tuple", + internalType: "struct ManifestFunction", + components: [ + { + name: "functionType", + type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", + }, + { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "dependencyIndex", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + }, + { + name: "executionHooks", + type: "tuple[]", + internalType: "struct ManifestExecutionHook[]", + components: [ + { + name: "executionSelector", + type: "bytes4", + internalType: "bytes4", + }, + { + name: "preExecHook", + type: "tuple", + internalType: "struct ManifestFunction", + components: [ + { + name: "functionType", + type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", + }, + { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "dependencyIndex", + type: "uint256", + internalType: "uint256", + }, + ], + }, + { + name: "postExecHook", + type: "tuple", + internalType: "struct ManifestFunction", + components: [ + { + name: "functionType", + type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", + }, + { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "dependencyIndex", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + }, + ], + }, + ], + stateMutability: "pure", + }, + { + type: "function", + name: "pluginMetadata", + inputs: [], + outputs: [ + { + name: "", + type: "tuple", + internalType: "struct PluginMetadata", + components: [ + { name: "name", type: "string", internalType: "string" }, + { name: "version", type: "string", internalType: "string" }, + { name: "author", type: "string", internalType: "string" }, + { + name: "permissionDescriptors", + type: "tuple[]", + internalType: "struct SelectorPermission[]", + components: [ + { + name: "functionSelector", + type: "bytes4", + internalType: "bytes4", + }, + { + name: "permissionDescription", + type: "string", + internalType: "string", + }, + ], + }, + ], + }, + ], + stateMutability: "pure", + }, + { + type: "function", + name: "postExecutionHook", + inputs: [ + { name: "functionId", type: "uint8", internalType: "uint8" }, + { name: "preExecHookData", type: "bytes", internalType: "bytes" }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "preExecutionHook", + inputs: [ + { name: "functionId", type: "uint8", internalType: "uint8" }, + { name: "sender", type: "address", internalType: "address" }, + { name: "value", type: "uint256", internalType: "uint256" }, + { name: "data", type: "bytes", internalType: "bytes" }, + ], + outputs: [{ name: "", type: "bytes", internalType: "bytes" }], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "preRuntimeValidationHook", + inputs: [ + { name: "functionId", type: "uint8", internalType: "uint8" }, + { name: "sender", type: "address", internalType: "address" }, + { name: "value", type: "uint256", internalType: "uint256" }, + { name: "data", type: "bytes", internalType: "bytes" }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "preUserOpValidationHook", + inputs: [ + { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "userOp", + type: "tuple", + internalType: "struct UserOperation", + components: [ + { name: "sender", type: "address", internalType: "address" }, + { name: "nonce", type: "uint256", internalType: "uint256" }, + { name: "initCode", type: "bytes", internalType: "bytes" }, + { name: "callData", type: "bytes", internalType: "bytes" }, + { name: "callGasLimit", type: "uint256", internalType: "uint256" }, + { + name: "verificationGasLimit", + type: "uint256", + internalType: "uint256", + }, + { + name: "preVerificationGas", + type: "uint256", + internalType: "uint256", + }, + { name: "maxFeePerGas", type: "uint256", internalType: "uint256" }, + { + name: "maxPriorityFeePerGas", + type: "uint256", + internalType: "uint256", + }, + { name: "paymasterAndData", type: "bytes", internalType: "bytes" }, + { name: "signature", type: "bytes", internalType: "bytes" }, + ], + }, + { name: "userOpHash", type: "bytes32", internalType: "bytes32" }, + ], + outputs: [{ name: "", type: "uint256", internalType: "uint256" }], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "runtimeValidationFunction", + inputs: [ + { name: "functionId", type: "uint8", internalType: "uint8" }, + { name: "sender", type: "address", internalType: "address" }, + { name: "value", type: "uint256", internalType: "uint256" }, + { name: "data", type: "bytes", internalType: "bytes" }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "userOpValidationFunction", + inputs: [ + { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "userOp", + type: "tuple", + internalType: "struct UserOperation", + components: [ + { name: "sender", type: "address", internalType: "address" }, + { name: "nonce", type: "uint256", internalType: "uint256" }, + { name: "initCode", type: "bytes", internalType: "bytes" }, + { name: "callData", type: "bytes", internalType: "bytes" }, + { name: "callGasLimit", type: "uint256", internalType: "uint256" }, + { + name: "verificationGasLimit", + type: "uint256", + internalType: "uint256", + }, + { + name: "preVerificationGas", + type: "uint256", + internalType: "uint256", + }, + { name: "maxFeePerGas", type: "uint256", internalType: "uint256" }, + { + name: "maxPriorityFeePerGas", + type: "uint256", + internalType: "uint256", + }, + { name: "paymasterAndData", type: "bytes", internalType: "bytes" }, + { name: "signature", type: "bytes", internalType: "bytes" }, + ], + }, + { name: "userOpHash", type: "bytes32", internalType: "bytes32" }, + ], + outputs: [{ name: "", type: "uint256", internalType: "uint256" }], + stateMutability: "nonpayable", + }, +] as const; diff --git a/packages/accounts/src/msca/abis/IPluginManager.ts b/account-kit/smart-contracts/src/msca/abis/IPluginManager.ts similarity index 100% rename from packages/accounts/src/msca/abis/IPluginManager.ts rename to account-kit/smart-contracts/src/msca/abis/IPluginManager.ts diff --git a/packages/accounts/src/msca/abis/IStandardExecutor.ts b/account-kit/smart-contracts/src/msca/abis/IStandardExecutor.ts similarity index 100% rename from packages/accounts/src/msca/abis/IStandardExecutor.ts rename to account-kit/smart-contracts/src/msca/abis/IStandardExecutor.ts diff --git a/packages/accounts/src/msca/abis/MultiOwnerModularAccountFactory.ts b/account-kit/smart-contracts/src/msca/abis/MultiOwnerModularAccountFactory.ts similarity index 100% rename from packages/accounts/src/msca/abis/MultiOwnerModularAccountFactory.ts rename to account-kit/smart-contracts/src/msca/abis/MultiOwnerModularAccountFactory.ts diff --git a/packages/accounts/src/msca/abis/MultisigModularAccountFactory.ts b/account-kit/smart-contracts/src/msca/abis/MultisigModularAccountFactory.ts similarity index 100% rename from packages/accounts/src/msca/abis/MultisigModularAccountFactory.ts rename to account-kit/smart-contracts/src/msca/abis/MultisigModularAccountFactory.ts diff --git a/packages/accounts/src/msca/abis/UpgradeableModularAccount.ts b/account-kit/smart-contracts/src/msca/abis/UpgradeableModularAccount.ts similarity index 100% rename from packages/accounts/src/msca/abis/UpgradeableModularAccount.ts rename to account-kit/smart-contracts/src/msca/abis/UpgradeableModularAccount.ts diff --git a/packages/accounts/src/msca/account-loupe/decorator.ts b/account-kit/smart-contracts/src/msca/account-loupe/decorator.ts similarity index 100% rename from packages/accounts/src/msca/account-loupe/decorator.ts rename to account-kit/smart-contracts/src/msca/account-loupe/decorator.ts diff --git a/packages/accounts/src/msca/account-loupe/types.ts b/account-kit/smart-contracts/src/msca/account-loupe/types.ts similarity index 100% rename from packages/accounts/src/msca/account-loupe/types.ts rename to account-kit/smart-contracts/src/msca/account-loupe/types.ts diff --git a/packages/accounts/src/msca/account/multiOwnerAccount.ts b/account-kit/smart-contracts/src/msca/account/multiOwnerAccount.ts similarity index 100% rename from packages/accounts/src/msca/account/multiOwnerAccount.ts rename to account-kit/smart-contracts/src/msca/account/multiOwnerAccount.ts diff --git a/packages/accounts/src/msca/account/multisigAccount.ts b/account-kit/smart-contracts/src/msca/account/multisigAccount.ts similarity index 100% rename from packages/accounts/src/msca/account/multisigAccount.ts rename to account-kit/smart-contracts/src/msca/account/multisigAccount.ts diff --git a/packages/accounts/src/msca/account/standardExecutor.ts b/account-kit/smart-contracts/src/msca/account/standardExecutor.ts similarity index 100% rename from packages/accounts/src/msca/account/standardExecutor.ts rename to account-kit/smart-contracts/src/msca/account/standardExecutor.ts diff --git a/packages/accounts/src/msca/client.ts b/account-kit/smart-contracts/src/msca/client.ts similarity index 100% rename from packages/accounts/src/msca/client.ts rename to account-kit/smart-contracts/src/msca/client.ts diff --git a/packages/accounts/src/msca/e2e-tests/constants.ts b/account-kit/smart-contracts/src/msca/e2e-tests/constants.ts similarity index 100% rename from packages/accounts/src/msca/e2e-tests/constants.ts rename to account-kit/smart-contracts/src/msca/e2e-tests/constants.ts diff --git a/packages/accounts/src/msca/e2e-tests/multisig-modular-account.e2e.test.ts b/account-kit/smart-contracts/src/msca/e2e-tests/multisig-modular-account.e2e.test.ts similarity index 100% rename from packages/accounts/src/msca/e2e-tests/multisig-modular-account.e2e.test.ts rename to account-kit/smart-contracts/src/msca/e2e-tests/multisig-modular-account.e2e.test.ts diff --git a/packages/accounts/src/msca/errors.ts b/account-kit/smart-contracts/src/msca/errors.ts similarity index 100% rename from packages/accounts/src/msca/errors.ts rename to account-kit/smart-contracts/src/msca/errors.ts diff --git a/packages/accounts/src/msca/plugin-manager/decorator.ts b/account-kit/smart-contracts/src/msca/plugin-manager/decorator.ts similarity index 100% rename from packages/accounts/src/msca/plugin-manager/decorator.ts rename to account-kit/smart-contracts/src/msca/plugin-manager/decorator.ts diff --git a/packages/accounts/src/msca/plugin-manager/installPlugin.ts b/account-kit/smart-contracts/src/msca/plugin-manager/installPlugin.ts similarity index 100% rename from packages/accounts/src/msca/plugin-manager/installPlugin.ts rename to account-kit/smart-contracts/src/msca/plugin-manager/installPlugin.ts diff --git a/packages/accounts/src/msca/plugin-manager/uninstallPlugin.ts b/account-kit/smart-contracts/src/msca/plugin-manager/uninstallPlugin.ts similarity index 100% rename from packages/accounts/src/msca/plugin-manager/uninstallPlugin.ts rename to account-kit/smart-contracts/src/msca/plugin-manager/uninstallPlugin.ts diff --git a/packages/accounts/src/msca/plugins/multi-owner/extension.ts b/account-kit/smart-contracts/src/msca/plugins/multi-owner/extension.ts similarity index 100% rename from packages/accounts/src/msca/plugins/multi-owner/extension.ts rename to account-kit/smart-contracts/src/msca/plugins/multi-owner/extension.ts diff --git a/packages/accounts/src/msca/plugins/multi-owner/index.ts b/account-kit/smart-contracts/src/msca/plugins/multi-owner/index.ts similarity index 100% rename from packages/accounts/src/msca/plugins/multi-owner/index.ts rename to account-kit/smart-contracts/src/msca/plugins/multi-owner/index.ts diff --git a/packages/accounts/src/msca/plugins/multi-owner/plugin.ts b/account-kit/smart-contracts/src/msca/plugins/multi-owner/plugin.ts similarity index 74% rename from packages/accounts/src/msca/plugins/multi-owner/plugin.ts rename to account-kit/smart-contracts/src/msca/plugins/multi-owner/plugin.ts index a830d46fa3..e9452a1c59 100644 --- a/packages/accounts/src/msca/plugins/multi-owner/plugin.ts +++ b/account-kit/smart-contracts/src/msca/plugins/multi-owner/plugin.ts @@ -25,13 +25,11 @@ import { type UserOperationContext, type GetContextParameter, } from "@alchemy/aa-core"; -import { type Plugin } from "../types.js"; -import { installPlugin as installPlugin_ } from "../../plugin-manager/installPlugin.js"; -import { type FunctionReference } from "../../account-loupe/types.js"; - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// ERC6900PluginGen: This file is auto-generated by plugingen -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +import { + installPlugin as installPlugin_, + type Plugin, + type FunctionReference, +} from "@account-kit/smart-contracts"; type ExecutionActions< TAccount extends SmartContractAccount | undefined = @@ -69,7 +67,7 @@ type ManagementActions< | SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = - | UserOperationContext + | Record | undefined, TEntryPointVersion extends GetEntryPointFromAccount = GetEntryPointFromAccount > = { @@ -335,191 +333,190 @@ export const multiOwnerPluginActions: < export const MultiOwnerPluginExecutionFunctionAbi = [ { - stateMutability: "nonpayable", type: "function", + name: "updateOwners", inputs: [ - { name: "ownersToAdd", internalType: "address[]", type: "address[]" }, - { name: "ownersToRemove", internalType: "address[]", type: "address[]" }, + { name: "ownersToAdd", type: "address[]", internalType: "address[]" }, + { name: "ownersToRemove", type: "address[]", internalType: "address[]" }, ], - name: "updateOwners", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "view", type: "function", - inputs: [], name: "eip712Domain", + inputs: [], outputs: [ - { name: "fields", internalType: "bytes1", type: "bytes1" }, - { name: "name", internalType: "string", type: "string" }, - { name: "version", internalType: "string", type: "string" }, - { name: "chainId", internalType: "uint256", type: "uint256" }, - { name: "verifyingContract", internalType: "address", type: "address" }, - { name: "salt", internalType: "bytes32", type: "bytes32" }, - { name: "extensions", internalType: "uint256[]", type: "uint256[]" }, + { name: "fields", type: "bytes1", internalType: "bytes1" }, + { name: "name", type: "string", internalType: "string" }, + { name: "version", type: "string", internalType: "string" }, + { name: "chainId", type: "uint256", internalType: "uint256" }, + { name: "verifyingContract", type: "address", internalType: "address" }, + { name: "salt", type: "bytes32", internalType: "bytes32" }, + { name: "extensions", type: "uint256[]", internalType: "uint256[]" }, ], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "isValidSignature", inputs: [ - { name: "digest", internalType: "bytes32", type: "bytes32" }, - { name: "signature", internalType: "bytes", type: "bytes" }, + { name: "digest", type: "bytes32", internalType: "bytes32" }, + { name: "signature", type: "bytes", internalType: "bytes" }, ], - name: "isValidSignature", - outputs: [{ name: "", internalType: "bytes4", type: "bytes4" }], + outputs: [{ name: "", type: "bytes4", internalType: "bytes4" }], + stateMutability: "view", }, ] as const; export const MultiOwnerPluginAbi = [ { - stateMutability: "view", type: "function", - inputs: [], name: "eip712Domain", + inputs: [], outputs: [ - { name: "fields", internalType: "bytes1", type: "bytes1" }, - { name: "name", internalType: "string", type: "string" }, - { name: "version", internalType: "string", type: "string" }, - { name: "chainId", internalType: "uint256", type: "uint256" }, - { name: "verifyingContract", internalType: "address", type: "address" }, - { name: "salt", internalType: "bytes32", type: "bytes32" }, - { name: "extensions", internalType: "uint256[]", type: "uint256[]" }, + { name: "fields", type: "bytes1", internalType: "bytes1" }, + { name: "name", type: "string", internalType: "string" }, + { name: "version", type: "string", internalType: "string" }, + { name: "chainId", type: "uint256", internalType: "uint256" }, + { name: "verifyingContract", type: "address", internalType: "address" }, + { name: "salt", type: "bytes32", internalType: "bytes32" }, + { name: "extensions", type: "uint256[]", internalType: "uint256[]" }, ], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "encodeMessageData", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "message", internalType: "bytes", type: "bytes" }, + { name: "account", type: "address", internalType: "address" }, + { name: "message", type: "bytes", internalType: "bytes" }, ], - name: "encodeMessageData", - outputs: [{ name: "", internalType: "bytes", type: "bytes" }], + outputs: [{ name: "", type: "bytes", internalType: "bytes" }], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "getMessageHash", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "message", internalType: "bytes", type: "bytes" }, + { name: "account", type: "address", internalType: "address" }, + { name: "message", type: "bytes", internalType: "bytes" }, ], - name: "getMessageHash", - outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }], + outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "isOwnerOf", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "ownerToCheck", internalType: "address", type: "address" }, + { name: "account", type: "address", internalType: "address" }, + { name: "ownerToCheck", type: "address", internalType: "address" }, ], - name: "isOwnerOf", - outputs: [{ name: "", internalType: "bool", type: "bool" }], + outputs: [{ name: "", type: "bool", internalType: "bool" }], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "isValidSignature", inputs: [ - { name: "digest", internalType: "bytes32", type: "bytes32" }, - { name: "signature", internalType: "bytes", type: "bytes" }, + { name: "digest", type: "bytes32", internalType: "bytes32" }, + { name: "signature", type: "bytes", internalType: "bytes" }, ], - name: "isValidSignature", - outputs: [{ name: "", internalType: "bytes4", type: "bytes4" }], + outputs: [{ name: "", type: "bytes4", internalType: "bytes4" }], + stateMutability: "view", }, { - stateMutability: "nonpayable", type: "function", - inputs: [{ name: "data", internalType: "bytes", type: "bytes" }], name: "onInstall", + inputs: [{ name: "data", type: "bytes", internalType: "bytes" }], outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", - inputs: [{ name: "", internalType: "bytes", type: "bytes" }], name: "onUninstall", + inputs: [{ name: "", type: "bytes", internalType: "bytes" }], outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "view", type: "function", - inputs: [{ name: "account", internalType: "address", type: "address" }], name: "ownersOf", - outputs: [{ name: "", internalType: "address[]", type: "address[]" }], + inputs: [{ name: "account", type: "address", internalType: "address" }], + outputs: [{ name: "", type: "address[]", internalType: "address[]" }], + stateMutability: "view", }, { - stateMutability: "pure", type: "function", - inputs: [], name: "pluginManifest", + inputs: [], outputs: [ { name: "", - internalType: "struct PluginManifest", type: "tuple", + internalType: "struct PluginManifest", components: [ - { name: "interfaceIds", internalType: "bytes4[]", type: "bytes4[]" }, + { name: "interfaceIds", type: "bytes4[]", internalType: "bytes4[]" }, { name: "dependencyInterfaceIds", - internalType: "bytes4[]", type: "bytes4[]", + internalType: "bytes4[]", }, { name: "executionFunctions", - internalType: "bytes4[]", type: "bytes4[]", + internalType: "bytes4[]", }, { name: "permittedExecutionSelectors", - internalType: "bytes4[]", type: "bytes4[]", + internalType: "bytes4[]", }, { name: "permitAnyExternalAddress", - internalType: "bool", type: "bool", + internalType: "bool", }, - { name: "canSpendNativeToken", internalType: "bool", type: "bool" }, + { name: "canSpendNativeToken", type: "bool", internalType: "bool" }, { name: "permittedExternalCalls", - internalType: "struct ManifestExternalCallPermission[]", type: "tuple[]", + internalType: "struct ManifestExternalCallPermission[]", components: [ { name: "externalAddress", - internalType: "address", type: "address", + internalType: "address", }, - { name: "permitAnySelector", internalType: "bool", type: "bool" }, - { name: "selectors", internalType: "bytes4[]", type: "bytes4[]" }, + { name: "permitAnySelector", type: "bool", internalType: "bool" }, + { name: "selectors", type: "bytes4[]", internalType: "bytes4[]" }, ], }, { name: "userOpValidationFunctions", - internalType: "struct ManifestAssociatedFunction[]", type: "tuple[]", + internalType: "struct ManifestAssociatedFunction[]", components: [ { name: "executionSelector", - internalType: "bytes4", type: "bytes4", + internalType: "bytes4", }, { name: "associatedFunction", - internalType: "struct ManifestFunction", type: "tuple", + internalType: "struct ManifestFunction", components: [ { name: "functionType", - internalType: "enum ManifestAssociatedFunctionType", type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "dependencyIndex", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, ], }, @@ -527,29 +524,29 @@ export const MultiOwnerPluginAbi = [ }, { name: "runtimeValidationFunctions", - internalType: "struct ManifestAssociatedFunction[]", type: "tuple[]", + internalType: "struct ManifestAssociatedFunction[]", components: [ { name: "executionSelector", - internalType: "bytes4", type: "bytes4", + internalType: "bytes4", }, { name: "associatedFunction", - internalType: "struct ManifestFunction", type: "tuple", + internalType: "struct ManifestFunction", components: [ { name: "functionType", - internalType: "enum ManifestAssociatedFunctionType", type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "dependencyIndex", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, ], }, @@ -557,29 +554,29 @@ export const MultiOwnerPluginAbi = [ }, { name: "preUserOpValidationHooks", - internalType: "struct ManifestAssociatedFunction[]", type: "tuple[]", + internalType: "struct ManifestAssociatedFunction[]", components: [ { name: "executionSelector", - internalType: "bytes4", type: "bytes4", + internalType: "bytes4", }, { name: "associatedFunction", - internalType: "struct ManifestFunction", type: "tuple", + internalType: "struct ManifestFunction", components: [ { name: "functionType", - internalType: "enum ManifestAssociatedFunctionType", type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "dependencyIndex", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, ], }, @@ -587,29 +584,29 @@ export const MultiOwnerPluginAbi = [ }, { name: "preRuntimeValidationHooks", - internalType: "struct ManifestAssociatedFunction[]", type: "tuple[]", + internalType: "struct ManifestAssociatedFunction[]", components: [ { name: "executionSelector", - internalType: "bytes4", type: "bytes4", + internalType: "bytes4", }, { name: "associatedFunction", - internalType: "struct ManifestFunction", type: "tuple", + internalType: "struct ManifestFunction", components: [ { name: "functionType", - internalType: "enum ManifestAssociatedFunctionType", type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "dependencyIndex", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, ], }, @@ -617,47 +614,47 @@ export const MultiOwnerPluginAbi = [ }, { name: "executionHooks", - internalType: "struct ManifestExecutionHook[]", type: "tuple[]", + internalType: "struct ManifestExecutionHook[]", components: [ { name: "executionSelector", - internalType: "bytes4", type: "bytes4", + internalType: "bytes4", }, { name: "preExecHook", - internalType: "struct ManifestFunction", type: "tuple", + internalType: "struct ManifestFunction", components: [ { name: "functionType", - internalType: "enum ManifestAssociatedFunctionType", type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "dependencyIndex", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, ], }, { name: "postExecHook", - internalType: "struct ManifestFunction", type: "tuple", + internalType: "struct ManifestFunction", components: [ { name: "functionType", - internalType: "enum ManifestAssociatedFunctionType", type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "dependencyIndex", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, ], }, @@ -666,236 +663,237 @@ export const MultiOwnerPluginAbi = [ ], }, ], + stateMutability: "pure", }, { - stateMutability: "pure", type: "function", - inputs: [], name: "pluginMetadata", + inputs: [], outputs: [ { name: "", - internalType: "struct PluginMetadata", type: "tuple", + internalType: "struct PluginMetadata", components: [ - { name: "name", internalType: "string", type: "string" }, - { name: "version", internalType: "string", type: "string" }, - { name: "author", internalType: "string", type: "string" }, + { name: "name", type: "string", internalType: "string" }, + { name: "version", type: "string", internalType: "string" }, + { name: "author", type: "string", internalType: "string" }, { name: "permissionDescriptors", - internalType: "struct SelectorPermission[]", type: "tuple[]", + internalType: "struct SelectorPermission[]", components: [ { name: "functionSelector", - internalType: "bytes4", type: "bytes4", + internalType: "bytes4", }, { name: "permissionDescription", - internalType: "string", type: "string", + internalType: "string", }, ], }, ], }, ], + stateMutability: "pure", }, { - stateMutability: "nonpayable", type: "function", + name: "postExecutionHook", inputs: [ - { name: "functionId", internalType: "uint8", type: "uint8" }, - { name: "preExecHookData", internalType: "bytes", type: "bytes" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, + { name: "preExecHookData", type: "bytes", internalType: "bytes" }, ], - name: "postExecutionHook", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "preExecutionHook", inputs: [ - { name: "functionId", internalType: "uint8", type: "uint8" }, - { name: "sender", internalType: "address", type: "address" }, - { name: "value", internalType: "uint256", type: "uint256" }, - { name: "data", internalType: "bytes", type: "bytes" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, + { name: "sender", type: "address", internalType: "address" }, + { name: "value", type: "uint256", internalType: "uint256" }, + { name: "data", type: "bytes", internalType: "bytes" }, ], - name: "preExecutionHook", - outputs: [{ name: "", internalType: "bytes", type: "bytes" }], + outputs: [{ name: "", type: "bytes", internalType: "bytes" }], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "preRuntimeValidationHook", inputs: [ - { name: "functionId", internalType: "uint8", type: "uint8" }, - { name: "sender", internalType: "address", type: "address" }, - { name: "value", internalType: "uint256", type: "uint256" }, - { name: "data", internalType: "bytes", type: "bytes" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, + { name: "sender", type: "address", internalType: "address" }, + { name: "value", type: "uint256", internalType: "uint256" }, + { name: "data", type: "bytes", internalType: "bytes" }, ], - name: "preRuntimeValidationHook", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "preUserOpValidationHook", inputs: [ - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "userOp", - internalType: "struct UserOperation", type: "tuple", + internalType: "struct UserOperation", components: [ - { name: "sender", internalType: "address", type: "address" }, - { name: "nonce", internalType: "uint256", type: "uint256" }, - { name: "initCode", internalType: "bytes", type: "bytes" }, - { name: "callData", internalType: "bytes", type: "bytes" }, - { name: "callGasLimit", internalType: "uint256", type: "uint256" }, + { name: "sender", type: "address", internalType: "address" }, + { name: "nonce", type: "uint256", internalType: "uint256" }, + { name: "initCode", type: "bytes", internalType: "bytes" }, + { name: "callData", type: "bytes", internalType: "bytes" }, + { name: "callGasLimit", type: "uint256", internalType: "uint256" }, { name: "verificationGasLimit", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, { name: "preVerificationGas", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, - { name: "maxFeePerGas", internalType: "uint256", type: "uint256" }, + { name: "maxFeePerGas", type: "uint256", internalType: "uint256" }, { name: "maxPriorityFeePerGas", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, - { name: "paymasterAndData", internalType: "bytes", type: "bytes" }, - { name: "signature", internalType: "bytes", type: "bytes" }, + { name: "paymasterAndData", type: "bytes", internalType: "bytes" }, + { name: "signature", type: "bytes", internalType: "bytes" }, ], }, - { name: "userOpHash", internalType: "bytes32", type: "bytes32" }, + { name: "userOpHash", type: "bytes32", internalType: "bytes32" }, ], - name: "preUserOpValidationHook", - outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + outputs: [{ name: "", type: "uint256", internalType: "uint256" }], + stateMutability: "nonpayable", }, { - stateMutability: "view", type: "function", + name: "runtimeValidationFunction", inputs: [ - { name: "functionId", internalType: "uint8", type: "uint8" }, - { name: "sender", internalType: "address", type: "address" }, - { name: "", internalType: "uint256", type: "uint256" }, - { name: "", internalType: "bytes", type: "bytes" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, + { name: "sender", type: "address", internalType: "address" }, + { name: "", type: "uint256", internalType: "uint256" }, + { name: "", type: "bytes", internalType: "bytes" }, ], - name: "runtimeValidationFunction", outputs: [], + stateMutability: "view", }, { - stateMutability: "view", type: "function", - inputs: [{ name: "interfaceId", internalType: "bytes4", type: "bytes4" }], name: "supportsInterface", - outputs: [{ name: "", internalType: "bool", type: "bool" }], + inputs: [{ name: "interfaceId", type: "bytes4", internalType: "bytes4" }], + outputs: [{ name: "", type: "bool", internalType: "bool" }], + stateMutability: "view", }, { - stateMutability: "nonpayable", type: "function", + name: "updateOwners", inputs: [ - { name: "ownersToAdd", internalType: "address[]", type: "address[]" }, - { name: "ownersToRemove", internalType: "address[]", type: "address[]" }, + { name: "ownersToAdd", type: "address[]", internalType: "address[]" }, + { name: "ownersToRemove", type: "address[]", internalType: "address[]" }, ], - name: "updateOwners", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "view", type: "function", + name: "userOpValidationFunction", inputs: [ - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "userOp", - internalType: "struct UserOperation", type: "tuple", + internalType: "struct UserOperation", components: [ - { name: "sender", internalType: "address", type: "address" }, - { name: "nonce", internalType: "uint256", type: "uint256" }, - { name: "initCode", internalType: "bytes", type: "bytes" }, - { name: "callData", internalType: "bytes", type: "bytes" }, - { name: "callGasLimit", internalType: "uint256", type: "uint256" }, + { name: "sender", type: "address", internalType: "address" }, + { name: "nonce", type: "uint256", internalType: "uint256" }, + { name: "initCode", type: "bytes", internalType: "bytes" }, + { name: "callData", type: "bytes", internalType: "bytes" }, + { name: "callGasLimit", type: "uint256", internalType: "uint256" }, { name: "verificationGasLimit", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, { name: "preVerificationGas", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, - { name: "maxFeePerGas", internalType: "uint256", type: "uint256" }, + { name: "maxFeePerGas", type: "uint256", internalType: "uint256" }, { name: "maxPriorityFeePerGas", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, - { name: "paymasterAndData", internalType: "bytes", type: "bytes" }, - { name: "signature", internalType: "bytes", type: "bytes" }, + { name: "paymasterAndData", type: "bytes", internalType: "bytes" }, + { name: "signature", type: "bytes", internalType: "bytes" }, ], }, - { name: "userOpHash", internalType: "bytes32", type: "bytes32" }, + { name: "userOpHash", type: "bytes32", internalType: "bytes32" }, ], - name: "userOpValidationFunction", - outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + outputs: [{ name: "", type: "uint256", internalType: "uint256" }], + stateMutability: "view", }, { type: "event", - anonymous: false, + name: "OwnerUpdated", inputs: [ { name: "account", - internalType: "address", type: "address", indexed: true, + internalType: "address", }, { name: "addedOwners", - internalType: "address[]", type: "address[]", indexed: false, + internalType: "address[]", }, { name: "removedOwners", - internalType: "address[]", type: "address[]", indexed: false, + internalType: "address[]", }, ], - name: "OwnerUpdated", + anonymous: false, }, - { type: "error", inputs: [], name: "AlreadyInitialized" }, - { type: "error", inputs: [], name: "EmptyOwnersNotAllowed" }, - { type: "error", inputs: [], name: "InvalidAction" }, + { type: "error", name: "AlreadyInitialized", inputs: [] }, + { type: "error", name: "EmptyOwnersNotAllowed", inputs: [] }, + { type: "error", name: "InvalidAction", inputs: [] }, { type: "error", - inputs: [{ name: "owner", internalType: "address", type: "address" }], name: "InvalidOwner", + inputs: [{ name: "owner", type: "address", internalType: "address" }], }, - { type: "error", inputs: [], name: "NotAuthorized" }, + { type: "error", name: "NotAuthorized", inputs: [] }, { type: "error", - inputs: [{ name: "caller", internalType: "address", type: "address" }], name: "NotContractCaller", + inputs: [{ name: "caller", type: "address", internalType: "address" }], }, { type: "error", + name: "NotImplemented", inputs: [ - { name: "selector", internalType: "bytes4", type: "bytes4" }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "selector", type: "bytes4", internalType: "bytes4" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, ], - name: "NotImplemented", }, - { type: "error", inputs: [], name: "NotInitialized" }, + { type: "error", name: "NotInitialized", inputs: [] }, { type: "error", - inputs: [{ name: "owner", internalType: "address", type: "address" }], name: "OwnerDoesNotExist", + inputs: [{ name: "owner", type: "address", internalType: "address" }], }, ] as const; diff --git a/packages/accounts/src/msca/plugins/multi-owner/signer.ts b/account-kit/smart-contracts/src/msca/plugins/multi-owner/signer.ts similarity index 100% rename from packages/accounts/src/msca/plugins/multi-owner/signer.ts rename to account-kit/smart-contracts/src/msca/plugins/multi-owner/signer.ts diff --git a/packages/accounts/src/msca/plugins/multisig/actions/getThreshold.ts b/account-kit/smart-contracts/src/msca/plugins/multisig/actions/getThreshold.ts similarity index 100% rename from packages/accounts/src/msca/plugins/multisig/actions/getThreshold.ts rename to account-kit/smart-contracts/src/msca/plugins/multisig/actions/getThreshold.ts diff --git a/packages/accounts/src/msca/plugins/multisig/actions/isOwnerOf.ts b/account-kit/smart-contracts/src/msca/plugins/multisig/actions/isOwnerOf.ts similarity index 100% rename from packages/accounts/src/msca/plugins/multisig/actions/isOwnerOf.ts rename to account-kit/smart-contracts/src/msca/plugins/multisig/actions/isOwnerOf.ts diff --git a/packages/accounts/src/msca/plugins/multisig/actions/proposeUserOperation.ts b/account-kit/smart-contracts/src/msca/plugins/multisig/actions/proposeUserOperation.ts similarity index 100% rename from packages/accounts/src/msca/plugins/multisig/actions/proposeUserOperation.ts rename to account-kit/smart-contracts/src/msca/plugins/multisig/actions/proposeUserOperation.ts diff --git a/packages/accounts/src/msca/plugins/multisig/actions/readOwners.ts b/account-kit/smart-contracts/src/msca/plugins/multisig/actions/readOwners.ts similarity index 100% rename from packages/accounts/src/msca/plugins/multisig/actions/readOwners.ts rename to account-kit/smart-contracts/src/msca/plugins/multisig/actions/readOwners.ts diff --git a/packages/accounts/src/msca/plugins/multisig/actions/signMultisigUserOperation.ts b/account-kit/smart-contracts/src/msca/plugins/multisig/actions/signMultisigUserOperation.ts similarity index 100% rename from packages/accounts/src/msca/plugins/multisig/actions/signMultisigUserOperation.ts rename to account-kit/smart-contracts/src/msca/plugins/multisig/actions/signMultisigUserOperation.ts diff --git a/packages/accounts/src/msca/plugins/multisig/extension.ts b/account-kit/smart-contracts/src/msca/plugins/multisig/extension.ts similarity index 100% rename from packages/accounts/src/msca/plugins/multisig/extension.ts rename to account-kit/smart-contracts/src/msca/plugins/multisig/extension.ts diff --git a/packages/accounts/src/msca/plugins/multisig/index.ts b/account-kit/smart-contracts/src/msca/plugins/multisig/index.ts similarity index 100% rename from packages/accounts/src/msca/plugins/multisig/index.ts rename to account-kit/smart-contracts/src/msca/plugins/multisig/index.ts diff --git a/packages/accounts/src/msca/plugins/multisig/middleware.ts b/account-kit/smart-contracts/src/msca/plugins/multisig/middleware.ts similarity index 100% rename from packages/accounts/src/msca/plugins/multisig/middleware.ts rename to account-kit/smart-contracts/src/msca/plugins/multisig/middleware.ts diff --git a/packages/accounts/src/msca/plugins/multisig/plugin.ts b/account-kit/smart-contracts/src/msca/plugins/multisig/plugin.ts similarity index 72% rename from packages/accounts/src/msca/plugins/multisig/plugin.ts rename to account-kit/smart-contracts/src/msca/plugins/multisig/plugin.ts index 2aafc9e56c..add0ea7ee8 100644 --- a/packages/accounts/src/msca/plugins/multisig/plugin.ts +++ b/account-kit/smart-contracts/src/msca/plugins/multisig/plugin.ts @@ -25,13 +25,11 @@ import { type UserOperationContext, type GetContextParameter, } from "@alchemy/aa-core"; -import { type Plugin } from "../types.js"; -import { installPlugin as installPlugin_ } from "../../plugin-manager/installPlugin.js"; -import { type FunctionReference } from "../../account-loupe/types.js"; - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// ERC6900PluginGen: This file is auto-generated by plugingen -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +import { + installPlugin as installPlugin_, + type Plugin, + type FunctionReference, +} from "@account-kit/smart-contracts"; type ExecutionActions< TAccount extends SmartContractAccount | undefined = @@ -69,7 +67,7 @@ type ManagementActions< | SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = - | UserOperationContext + | Record | undefined, TEntryPointVersion extends GetEntryPointFromAccount = GetEntryPointFromAccount > = { @@ -331,222 +329,221 @@ export const multisigPluginActions: < export const MultisigPluginExecutionFunctionAbi = [ { - stateMutability: "nonpayable", type: "function", + name: "updateOwnership", inputs: [ - { name: "ownersToAdd", internalType: "address[]", type: "address[]" }, - { name: "ownersToRemove", internalType: "address[]", type: "address[]" }, - { name: "newThreshold", internalType: "uint128", type: "uint128" }, + { name: "ownersToAdd", type: "address[]", internalType: "address[]" }, + { name: "ownersToRemove", type: "address[]", internalType: "address[]" }, + { name: "newThreshold", type: "uint128", internalType: "uint128" }, ], - name: "updateOwnership", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "view", type: "function", - inputs: [], name: "eip712Domain", + inputs: [], outputs: [ - { name: "fields", internalType: "bytes1", type: "bytes1" }, - { name: "name", internalType: "string", type: "string" }, - { name: "version", internalType: "string", type: "string" }, - { name: "chainId", internalType: "uint256", type: "uint256" }, - { name: "verifyingContract", internalType: "address", type: "address" }, - { name: "salt", internalType: "bytes32", type: "bytes32" }, - { name: "extensions", internalType: "uint256[]", type: "uint256[]" }, + { name: "fields", type: "bytes1", internalType: "bytes1" }, + { name: "name", type: "string", internalType: "string" }, + { name: "version", type: "string", internalType: "string" }, + { name: "chainId", type: "uint256", internalType: "uint256" }, + { name: "verifyingContract", type: "address", internalType: "address" }, + { name: "salt", type: "bytes32", internalType: "bytes32" }, + { name: "extensions", type: "uint256[]", internalType: "uint256[]" }, ], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "isValidSignature", inputs: [ - { name: "digest", internalType: "bytes32", type: "bytes32" }, - { name: "signature", internalType: "bytes", type: "bytes" }, + { name: "digest", type: "bytes32", internalType: "bytes32" }, + { name: "signature", type: "bytes", internalType: "bytes" }, ], - name: "isValidSignature", - outputs: [{ name: "", internalType: "bytes4", type: "bytes4" }], + outputs: [{ name: "", type: "bytes4", internalType: "bytes4" }], + stateMutability: "view", }, ] as const; export const MultisigPluginAbi = [ { - stateMutability: "nonpayable", type: "constructor", - inputs: [{ name: "entryPoint", internalType: "address", type: "address" }], + inputs: [{ name: "entryPoint", type: "address", internalType: "address" }], + stateMutability: "nonpayable", }, { - stateMutability: "view", type: "function", - inputs: [], name: "ENTRYPOINT", - outputs: [{ name: "", internalType: "address", type: "address" }], + inputs: [], + outputs: [{ name: "", type: "address", internalType: "address" }], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "checkNSignatures", inputs: [ - { name: "actualDigest", internalType: "bytes32", type: "bytes32" }, - { name: "upperLimitGasDigest", internalType: "bytes32", type: "bytes32" }, - { name: "account", internalType: "address", type: "address" }, - { name: "signatures", internalType: "bytes", type: "bytes" }, + { name: "actualDigest", type: "bytes32", internalType: "bytes32" }, + { name: "upperLimitGasDigest", type: "bytes32", internalType: "bytes32" }, + { name: "account", type: "address", internalType: "address" }, + { name: "signatures", type: "bytes", internalType: "bytes" }, ], - name: "checkNSignatures", outputs: [ - { name: "success", internalType: "bool", type: "bool" }, - { name: "firstFailure", internalType: "uint256", type: "uint256" }, + { name: "success", type: "bool", internalType: "bool" }, + { name: "firstFailure", type: "uint256", internalType: "uint256" }, ], + stateMutability: "view", }, { - stateMutability: "view", type: "function", - inputs: [], name: "eip712Domain", + inputs: [], outputs: [ - { name: "fields", internalType: "bytes1", type: "bytes1" }, - { name: "name", internalType: "string", type: "string" }, - { name: "version", internalType: "string", type: "string" }, - { name: "chainId", internalType: "uint256", type: "uint256" }, - { name: "verifyingContract", internalType: "address", type: "address" }, - { name: "salt", internalType: "bytes32", type: "bytes32" }, - { name: "extensions", internalType: "uint256[]", type: "uint256[]" }, + { name: "fields", type: "bytes1", internalType: "bytes1" }, + { name: "name", type: "string", internalType: "string" }, + { name: "version", type: "string", internalType: "string" }, + { name: "chainId", type: "uint256", internalType: "uint256" }, + { name: "verifyingContract", type: "address", internalType: "address" }, + { name: "salt", type: "bytes32", internalType: "bytes32" }, + { name: "extensions", type: "uint256[]", internalType: "uint256[]" }, ], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "encodeMessageData", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "message", internalType: "bytes", type: "bytes" }, + { name: "account", type: "address", internalType: "address" }, + { name: "message", type: "bytes", internalType: "bytes" }, ], - name: "encodeMessageData", - outputs: [{ name: "", internalType: "bytes", type: "bytes" }], + outputs: [{ name: "", type: "bytes", internalType: "bytes" }], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "getMessageHash", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "message", internalType: "bytes", type: "bytes" }, + { name: "account", type: "address", internalType: "address" }, + { name: "message", type: "bytes", internalType: "bytes" }, ], - name: "getMessageHash", - outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }], + outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "isOwnerOf", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "ownerToCheck", internalType: "address", type: "address" }, + { name: "account", type: "address", internalType: "address" }, + { name: "ownerToCheck", type: "address", internalType: "address" }, ], - name: "isOwnerOf", - outputs: [{ name: "", internalType: "bool", type: "bool" }], + outputs: [{ name: "", type: "bool", internalType: "bool" }], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "isValidSignature", inputs: [ - { name: "digest", internalType: "bytes32", type: "bytes32" }, - { name: "signature", internalType: "bytes", type: "bytes" }, + { name: "digest", type: "bytes32", internalType: "bytes32" }, + { name: "signature", type: "bytes", internalType: "bytes" }, ], - name: "isValidSignature", - outputs: [{ name: "", internalType: "bytes4", type: "bytes4" }], + outputs: [{ name: "", type: "bytes4", internalType: "bytes4" }], + stateMutability: "view", }, { - stateMutability: "nonpayable", type: "function", - inputs: [{ name: "data", internalType: "bytes", type: "bytes" }], name: "onInstall", + inputs: [{ name: "data", type: "bytes", internalType: "bytes" }], outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", - inputs: [{ name: "", internalType: "bytes", type: "bytes" }], name: "onUninstall", + inputs: [{ name: "", type: "bytes", internalType: "bytes" }], outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "view", type: "function", - inputs: [{ name: "account", internalType: "address", type: "address" }], name: "ownershipInfoOf", + inputs: [{ name: "account", type: "address", internalType: "address" }], outputs: [ - { name: "", internalType: "address[]", type: "address[]" }, - { name: "", internalType: "uint256", type: "uint256" }, + { name: "", type: "address[]", internalType: "address[]" }, + { name: "", type: "uint256", internalType: "uint256" }, ], + stateMutability: "view", }, { - stateMutability: "pure", type: "function", - inputs: [], name: "pluginManifest", + inputs: [], outputs: [ { name: "", - internalType: "struct PluginManifest", type: "tuple", + internalType: "struct PluginManifest", components: [ - { name: "interfaceIds", internalType: "bytes4[]", type: "bytes4[]" }, + { name: "interfaceIds", type: "bytes4[]", internalType: "bytes4[]" }, { name: "dependencyInterfaceIds", - internalType: "bytes4[]", type: "bytes4[]", + internalType: "bytes4[]", }, { name: "executionFunctions", - internalType: "bytes4[]", type: "bytes4[]", + internalType: "bytes4[]", }, { name: "permittedExecutionSelectors", - internalType: "bytes4[]", type: "bytes4[]", + internalType: "bytes4[]", }, { name: "permitAnyExternalAddress", - internalType: "bool", type: "bool", + internalType: "bool", }, - { name: "canSpendNativeToken", internalType: "bool", type: "bool" }, + { name: "canSpendNativeToken", type: "bool", internalType: "bool" }, { name: "permittedExternalCalls", - internalType: "struct ManifestExternalCallPermission[]", type: "tuple[]", + internalType: "struct ManifestExternalCallPermission[]", components: [ { name: "externalAddress", - internalType: "address", type: "address", + internalType: "address", }, - { name: "permitAnySelector", internalType: "bool", type: "bool" }, - { name: "selectors", internalType: "bytes4[]", type: "bytes4[]" }, + { name: "permitAnySelector", type: "bool", internalType: "bool" }, + { name: "selectors", type: "bytes4[]", internalType: "bytes4[]" }, ], }, { name: "userOpValidationFunctions", - internalType: "struct ManifestAssociatedFunction[]", type: "tuple[]", + internalType: "struct ManifestAssociatedFunction[]", components: [ { name: "executionSelector", - internalType: "bytes4", type: "bytes4", + internalType: "bytes4", }, { name: "associatedFunction", - internalType: "struct ManifestFunction", type: "tuple", + internalType: "struct ManifestFunction", components: [ { name: "functionType", - internalType: "enum ManifestAssociatedFunctionType", type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "dependencyIndex", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, ], }, @@ -554,29 +551,29 @@ export const MultisigPluginAbi = [ }, { name: "runtimeValidationFunctions", - internalType: "struct ManifestAssociatedFunction[]", type: "tuple[]", + internalType: "struct ManifestAssociatedFunction[]", components: [ { name: "executionSelector", - internalType: "bytes4", type: "bytes4", + internalType: "bytes4", }, { name: "associatedFunction", - internalType: "struct ManifestFunction", type: "tuple", + internalType: "struct ManifestFunction", components: [ { name: "functionType", - internalType: "enum ManifestAssociatedFunctionType", type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "dependencyIndex", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, ], }, @@ -584,29 +581,29 @@ export const MultisigPluginAbi = [ }, { name: "preUserOpValidationHooks", - internalType: "struct ManifestAssociatedFunction[]", type: "tuple[]", + internalType: "struct ManifestAssociatedFunction[]", components: [ { name: "executionSelector", - internalType: "bytes4", type: "bytes4", + internalType: "bytes4", }, { name: "associatedFunction", - internalType: "struct ManifestFunction", type: "tuple", + internalType: "struct ManifestFunction", components: [ { name: "functionType", - internalType: "enum ManifestAssociatedFunctionType", type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "dependencyIndex", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, ], }, @@ -614,29 +611,29 @@ export const MultisigPluginAbi = [ }, { name: "preRuntimeValidationHooks", - internalType: "struct ManifestAssociatedFunction[]", type: "tuple[]", + internalType: "struct ManifestAssociatedFunction[]", components: [ { name: "executionSelector", - internalType: "bytes4", type: "bytes4", + internalType: "bytes4", }, { name: "associatedFunction", - internalType: "struct ManifestFunction", type: "tuple", + internalType: "struct ManifestFunction", components: [ { name: "functionType", - internalType: "enum ManifestAssociatedFunctionType", type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "dependencyIndex", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, ], }, @@ -644,47 +641,47 @@ export const MultisigPluginAbi = [ }, { name: "executionHooks", - internalType: "struct ManifestExecutionHook[]", type: "tuple[]", + internalType: "struct ManifestExecutionHook[]", components: [ { name: "executionSelector", - internalType: "bytes4", type: "bytes4", + internalType: "bytes4", }, { name: "preExecHook", - internalType: "struct ManifestFunction", type: "tuple", + internalType: "struct ManifestFunction", components: [ { name: "functionType", - internalType: "enum ManifestAssociatedFunctionType", type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "dependencyIndex", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, ], }, { name: "postExecHook", - internalType: "struct ManifestFunction", type: "tuple", + internalType: "struct ManifestFunction", components: [ { name: "functionType", - internalType: "enum ManifestAssociatedFunctionType", type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "dependencyIndex", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, ], }, @@ -693,251 +690,252 @@ export const MultisigPluginAbi = [ ], }, ], + stateMutability: "pure", }, { - stateMutability: "pure", type: "function", - inputs: [], name: "pluginMetadata", + inputs: [], outputs: [ { name: "", - internalType: "struct PluginMetadata", type: "tuple", + internalType: "struct PluginMetadata", components: [ - { name: "name", internalType: "string", type: "string" }, - { name: "version", internalType: "string", type: "string" }, - { name: "author", internalType: "string", type: "string" }, + { name: "name", type: "string", internalType: "string" }, + { name: "version", type: "string", internalType: "string" }, + { name: "author", type: "string", internalType: "string" }, { name: "permissionDescriptors", - internalType: "struct SelectorPermission[]", type: "tuple[]", + internalType: "struct SelectorPermission[]", components: [ { name: "functionSelector", - internalType: "bytes4", type: "bytes4", + internalType: "bytes4", }, { name: "permissionDescription", - internalType: "string", type: "string", + internalType: "string", }, ], }, ], }, ], + stateMutability: "pure", }, { - stateMutability: "nonpayable", type: "function", + name: "postExecutionHook", inputs: [ - { name: "functionId", internalType: "uint8", type: "uint8" }, - { name: "preExecHookData", internalType: "bytes", type: "bytes" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, + { name: "preExecHookData", type: "bytes", internalType: "bytes" }, ], - name: "postExecutionHook", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "preExecutionHook", inputs: [ - { name: "functionId", internalType: "uint8", type: "uint8" }, - { name: "sender", internalType: "address", type: "address" }, - { name: "value", internalType: "uint256", type: "uint256" }, - { name: "data", internalType: "bytes", type: "bytes" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, + { name: "sender", type: "address", internalType: "address" }, + { name: "value", type: "uint256", internalType: "uint256" }, + { name: "data", type: "bytes", internalType: "bytes" }, ], - name: "preExecutionHook", - outputs: [{ name: "", internalType: "bytes", type: "bytes" }], + outputs: [{ name: "", type: "bytes", internalType: "bytes" }], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "preRuntimeValidationHook", inputs: [ - { name: "functionId", internalType: "uint8", type: "uint8" }, - { name: "sender", internalType: "address", type: "address" }, - { name: "value", internalType: "uint256", type: "uint256" }, - { name: "data", internalType: "bytes", type: "bytes" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, + { name: "sender", type: "address", internalType: "address" }, + { name: "value", type: "uint256", internalType: "uint256" }, + { name: "data", type: "bytes", internalType: "bytes" }, ], - name: "preRuntimeValidationHook", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "preUserOpValidationHook", inputs: [ - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "userOp", - internalType: "struct UserOperation", type: "tuple", + internalType: "struct UserOperation", components: [ - { name: "sender", internalType: "address", type: "address" }, - { name: "nonce", internalType: "uint256", type: "uint256" }, - { name: "initCode", internalType: "bytes", type: "bytes" }, - { name: "callData", internalType: "bytes", type: "bytes" }, - { name: "callGasLimit", internalType: "uint256", type: "uint256" }, + { name: "sender", type: "address", internalType: "address" }, + { name: "nonce", type: "uint256", internalType: "uint256" }, + { name: "initCode", type: "bytes", internalType: "bytes" }, + { name: "callData", type: "bytes", internalType: "bytes" }, + { name: "callGasLimit", type: "uint256", internalType: "uint256" }, { name: "verificationGasLimit", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, { name: "preVerificationGas", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, - { name: "maxFeePerGas", internalType: "uint256", type: "uint256" }, + { name: "maxFeePerGas", type: "uint256", internalType: "uint256" }, { name: "maxPriorityFeePerGas", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, - { name: "paymasterAndData", internalType: "bytes", type: "bytes" }, - { name: "signature", internalType: "bytes", type: "bytes" }, + { name: "paymasterAndData", type: "bytes", internalType: "bytes" }, + { name: "signature", type: "bytes", internalType: "bytes" }, ], }, - { name: "userOpHash", internalType: "bytes32", type: "bytes32" }, + { name: "userOpHash", type: "bytes32", internalType: "bytes32" }, ], - name: "preUserOpValidationHook", - outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + outputs: [{ name: "", type: "uint256", internalType: "uint256" }], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "runtimeValidationFunction", inputs: [ - { name: "functionId", internalType: "uint8", type: "uint8" }, - { name: "sender", internalType: "address", type: "address" }, - { name: "value", internalType: "uint256", type: "uint256" }, - { name: "data", internalType: "bytes", type: "bytes" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, + { name: "sender", type: "address", internalType: "address" }, + { name: "value", type: "uint256", internalType: "uint256" }, + { name: "data", type: "bytes", internalType: "bytes" }, ], - name: "runtimeValidationFunction", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "view", type: "function", - inputs: [{ name: "interfaceId", internalType: "bytes4", type: "bytes4" }], name: "supportsInterface", - outputs: [{ name: "", internalType: "bool", type: "bool" }], + inputs: [{ name: "interfaceId", type: "bytes4", internalType: "bytes4" }], + outputs: [{ name: "", type: "bool", internalType: "bool" }], + stateMutability: "view", }, { - stateMutability: "nonpayable", type: "function", + name: "updateOwnership", inputs: [ - { name: "ownersToAdd", internalType: "address[]", type: "address[]" }, - { name: "ownersToRemove", internalType: "address[]", type: "address[]" }, - { name: "newThreshold", internalType: "uint128", type: "uint128" }, + { name: "ownersToAdd", type: "address[]", internalType: "address[]" }, + { name: "ownersToRemove", type: "address[]", internalType: "address[]" }, + { name: "newThreshold", type: "uint128", internalType: "uint128" }, ], - name: "updateOwnership", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "view", type: "function", + name: "userOpValidationFunction", inputs: [ - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "userOp", - internalType: "struct UserOperation", type: "tuple", + internalType: "struct UserOperation", components: [ - { name: "sender", internalType: "address", type: "address" }, - { name: "nonce", internalType: "uint256", type: "uint256" }, - { name: "initCode", internalType: "bytes", type: "bytes" }, - { name: "callData", internalType: "bytes", type: "bytes" }, - { name: "callGasLimit", internalType: "uint256", type: "uint256" }, + { name: "sender", type: "address", internalType: "address" }, + { name: "nonce", type: "uint256", internalType: "uint256" }, + { name: "initCode", type: "bytes", internalType: "bytes" }, + { name: "callData", type: "bytes", internalType: "bytes" }, + { name: "callGasLimit", type: "uint256", internalType: "uint256" }, { name: "verificationGasLimit", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, { name: "preVerificationGas", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, - { name: "maxFeePerGas", internalType: "uint256", type: "uint256" }, + { name: "maxFeePerGas", type: "uint256", internalType: "uint256" }, { name: "maxPriorityFeePerGas", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, - { name: "paymasterAndData", internalType: "bytes", type: "bytes" }, - { name: "signature", internalType: "bytes", type: "bytes" }, + { name: "paymasterAndData", type: "bytes", internalType: "bytes" }, + { name: "signature", type: "bytes", internalType: "bytes" }, ], }, - { name: "userOpHash", internalType: "bytes32", type: "bytes32" }, + { name: "userOpHash", type: "bytes32", internalType: "bytes32" }, ], - name: "userOpValidationFunction", - outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + outputs: [{ name: "", type: "uint256", internalType: "uint256" }], + stateMutability: "view", }, { type: "event", - anonymous: false, + name: "OwnerUpdated", inputs: [ { name: "account", - internalType: "address", type: "address", indexed: true, + internalType: "address", }, { name: "addedOwners", - internalType: "address[]", type: "address[]", indexed: false, + internalType: "address[]", }, { name: "removedOwners", - internalType: "address[]", type: "address[]", indexed: false, + internalType: "address[]", }, { name: "threshold", - internalType: "uint256", type: "uint256", indexed: false, + internalType: "uint256", }, ], - name: "OwnerUpdated", + anonymous: false, }, - { type: "error", inputs: [], name: "AlreadyInitialized" }, - { type: "error", inputs: [], name: "ECDSARecoverFailure" }, - { type: "error", inputs: [], name: "EmptyOwnersNotAllowed" }, - { type: "error", inputs: [], name: "InvalidAction" }, - { type: "error", inputs: [], name: "InvalidAddress" }, - { type: "error", inputs: [], name: "InvalidMaxFeePerGas" }, - { type: "error", inputs: [], name: "InvalidMaxPriorityFeePerGas" }, - { type: "error", inputs: [], name: "InvalidNumSigsOnActualGas" }, + { type: "error", name: "AlreadyInitialized", inputs: [] }, + { type: "error", name: "ECDSARecoverFailure", inputs: [] }, + { type: "error", name: "EmptyOwnersNotAllowed", inputs: [] }, + { type: "error", name: "InvalidAction", inputs: [] }, + { type: "error", name: "InvalidAddress", inputs: [] }, + { type: "error", name: "InvalidMaxFeePerGas", inputs: [] }, + { type: "error", name: "InvalidMaxPriorityFeePerGas", inputs: [] }, + { type: "error", name: "InvalidNumSigsOnActualGas", inputs: [] }, { type: "error", - inputs: [{ name: "owner", internalType: "address", type: "address" }], name: "InvalidOwner", + inputs: [{ name: "owner", type: "address", internalType: "address" }], }, - { type: "error", inputs: [], name: "InvalidPreVerificationGas" }, - { type: "error", inputs: [], name: "InvalidSigLength" }, - { type: "error", inputs: [], name: "InvalidSigOffset" }, - { type: "error", inputs: [], name: "InvalidThreshold" }, + { type: "error", name: "InvalidPreVerificationGas", inputs: [] }, + { type: "error", name: "InvalidSigLength", inputs: [] }, + { type: "error", name: "InvalidSigOffset", inputs: [] }, + { type: "error", name: "InvalidThreshold", inputs: [] }, { type: "error", - inputs: [{ name: "caller", internalType: "address", type: "address" }], name: "NotContractCaller", + inputs: [{ name: "caller", type: "address", internalType: "address" }], }, { type: "error", + name: "NotImplemented", inputs: [ - { name: "selector", internalType: "bytes4", type: "bytes4" }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "selector", type: "bytes4", internalType: "bytes4" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, ], - name: "NotImplemented", }, - { type: "error", inputs: [], name: "NotInitialized" }, + { type: "error", name: "NotInitialized", inputs: [] }, { type: "error", - inputs: [{ name: "owner", internalType: "address", type: "address" }], name: "OwnerDoesNotExist", + inputs: [{ name: "owner", type: "address", internalType: "address" }], }, ] as const; diff --git a/packages/accounts/src/msca/plugins/multisig/signer.ts b/account-kit/smart-contracts/src/msca/plugins/multisig/signer.ts similarity index 100% rename from packages/accounts/src/msca/plugins/multisig/signer.ts rename to account-kit/smart-contracts/src/msca/plugins/multisig/signer.ts diff --git a/packages/accounts/src/msca/plugins/multisig/types.ts b/account-kit/smart-contracts/src/msca/plugins/multisig/types.ts similarity index 100% rename from packages/accounts/src/msca/plugins/multisig/types.ts rename to account-kit/smart-contracts/src/msca/plugins/multisig/types.ts diff --git a/packages/accounts/src/msca/plugins/multisig/utils/combineSignatures.ts b/account-kit/smart-contracts/src/msca/plugins/multisig/utils/combineSignatures.ts similarity index 100% rename from packages/accounts/src/msca/plugins/multisig/utils/combineSignatures.ts rename to account-kit/smart-contracts/src/msca/plugins/multisig/utils/combineSignatures.ts diff --git a/packages/accounts/src/msca/plugins/multisig/utils/formatSignatures.ts b/account-kit/smart-contracts/src/msca/plugins/multisig/utils/formatSignatures.ts similarity index 100% rename from packages/accounts/src/msca/plugins/multisig/utils/formatSignatures.ts rename to account-kit/smart-contracts/src/msca/plugins/multisig/utils/formatSignatures.ts diff --git a/packages/accounts/src/msca/plugins/multisig/utils/getSignerType.ts b/account-kit/smart-contracts/src/msca/plugins/multisig/utils/getSignerType.ts similarity index 100% rename from packages/accounts/src/msca/plugins/multisig/utils/getSignerType.ts rename to account-kit/smart-contracts/src/msca/plugins/multisig/utils/getSignerType.ts diff --git a/packages/accounts/src/msca/plugins/multisig/utils/index.ts b/account-kit/smart-contracts/src/msca/plugins/multisig/utils/index.ts similarity index 100% rename from packages/accounts/src/msca/plugins/multisig/utils/index.ts rename to account-kit/smart-contracts/src/msca/plugins/multisig/utils/index.ts diff --git a/packages/accounts/src/msca/plugins/multisig/utils/splitAggregatedSignature.ts b/account-kit/smart-contracts/src/msca/plugins/multisig/utils/splitAggregatedSignature.ts similarity index 98% rename from packages/accounts/src/msca/plugins/multisig/utils/splitAggregatedSignature.ts rename to account-kit/smart-contracts/src/msca/plugins/multisig/utils/splitAggregatedSignature.ts index 535a774212..95d8541d38 100644 --- a/packages/accounts/src/msca/plugins/multisig/utils/splitAggregatedSignature.ts +++ b/account-kit/smart-contracts/src/msca/plugins/multisig/utils/splitAggregatedSignature.ts @@ -6,7 +6,7 @@ import { } from "@alchemy/aa-core"; import { fromHex, hashMessage, recoverAddress, type Hex } from "viem"; import { InvalidAggregatedSignatureError } from "../../../errors.js"; -import type { Signature } from "../types"; +import type { Signature } from "../types.js"; export type SplitAggregateSignatureParams< TAccount extends SmartContractAccount | undefined = diff --git a/packages/accounts/src/msca/plugins/session-key/SessionKeyPermissionsUpdatesAbi.ts b/account-kit/smart-contracts/src/msca/plugins/session-key/SessionKeyPermissionsUpdatesAbi.ts similarity index 100% rename from packages/accounts/src/msca/plugins/session-key/SessionKeyPermissionsUpdatesAbi.ts rename to account-kit/smart-contracts/src/msca/plugins/session-key/SessionKeyPermissionsUpdatesAbi.ts diff --git a/packages/accounts/src/msca/plugins/session-key/extension.ts b/account-kit/smart-contracts/src/msca/plugins/session-key/extension.ts similarity index 100% rename from packages/accounts/src/msca/plugins/session-key/extension.ts rename to account-kit/smart-contracts/src/msca/plugins/session-key/extension.ts diff --git a/packages/accounts/src/msca/plugins/session-key/index.ts b/account-kit/smart-contracts/src/msca/plugins/session-key/index.ts similarity index 100% rename from packages/accounts/src/msca/plugins/session-key/index.ts rename to account-kit/smart-contracts/src/msca/plugins/session-key/index.ts diff --git a/packages/accounts/src/msca/plugins/session-key/permissions.ts b/account-kit/smart-contracts/src/msca/plugins/session-key/permissions.ts similarity index 100% rename from packages/accounts/src/msca/plugins/session-key/permissions.ts rename to account-kit/smart-contracts/src/msca/plugins/session-key/permissions.ts diff --git a/packages/accounts/src/msca/plugins/session-key/plugin.ts b/account-kit/smart-contracts/src/msca/plugins/session-key/plugin.ts similarity index 73% rename from packages/accounts/src/msca/plugins/session-key/plugin.ts rename to account-kit/smart-contracts/src/msca/plugins/session-key/plugin.ts index 55cfbdc0d0..46b85b6e6c 100644 --- a/packages/accounts/src/msca/plugins/session-key/plugin.ts +++ b/account-kit/smart-contracts/src/msca/plugins/session-key/plugin.ts @@ -25,14 +25,12 @@ import { type UserOperationContext, type GetContextParameter, } from "@alchemy/aa-core"; -import { type Plugin } from "../types.js"; +import { + installPlugin as installPlugin_, + type Plugin, + type FunctionReference, +} from "@account-kit/smart-contracts"; import { MultiOwnerPlugin } from "../multi-owner/plugin.js"; -import { installPlugin as installPlugin_ } from "../../plugin-manager/installPlugin.js"; -import { type FunctionReference } from "../../account-loupe/types.js"; - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// ERC6900PluginGen: This file is auto-generated by plugingen -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// type ExecutionActions< TAccount extends SmartContractAccount | undefined = @@ -126,7 +124,7 @@ type ManagementActions< | SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = - | UserOperationContext + | Record | undefined, TEntryPointVersion extends GetEntryPointFromAccount = GetEntryPointFromAccount > = { @@ -471,341 +469,340 @@ export const sessionKeyPluginActions: < export const SessionKeyPluginExecutionFunctionAbi = [ { - stateMutability: "nonpayable", type: "function", + name: "executeWithSessionKey", inputs: [ { name: "calls", - internalType: "struct Call[]", type: "tuple[]", + internalType: "struct Call[]", components: [ - { name: "target", internalType: "address", type: "address" }, - { name: "value", internalType: "uint256", type: "uint256" }, - { name: "data", internalType: "bytes", type: "bytes" }, + { name: "target", type: "address", internalType: "address" }, + { name: "value", type: "uint256", internalType: "uint256" }, + { name: "data", type: "bytes", internalType: "bytes" }, ], }, - { name: "sessionKey", internalType: "address", type: "address" }, + { name: "sessionKey", type: "address", internalType: "address" }, ], - name: "executeWithSessionKey", - outputs: [{ name: "", internalType: "bytes[]", type: "bytes[]" }], + outputs: [{ name: "", type: "bytes[]", internalType: "bytes[]" }], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "addSessionKey", inputs: [ - { name: "sessionKey", internalType: "address", type: "address" }, - { name: "tag", internalType: "bytes32", type: "bytes32" }, - { name: "permissionUpdates", internalType: "bytes[]", type: "bytes[]" }, + { name: "sessionKey", type: "address", internalType: "address" }, + { name: "tag", type: "bytes32", internalType: "bytes32" }, + { name: "permissionUpdates", type: "bytes[]", internalType: "bytes[]" }, ], - name: "addSessionKey", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "removeSessionKey", inputs: [ - { name: "sessionKey", internalType: "address", type: "address" }, - { name: "predecessor", internalType: "bytes32", type: "bytes32" }, + { name: "sessionKey", type: "address", internalType: "address" }, + { name: "predecessor", type: "bytes32", internalType: "bytes32" }, ], - name: "removeSessionKey", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "rotateSessionKey", inputs: [ - { name: "oldSessionKey", internalType: "address", type: "address" }, - { name: "predecessor", internalType: "bytes32", type: "bytes32" }, - { name: "newSessionKey", internalType: "address", type: "address" }, + { name: "oldSessionKey", type: "address", internalType: "address" }, + { name: "predecessor", type: "bytes32", internalType: "bytes32" }, + { name: "newSessionKey", type: "address", internalType: "address" }, ], - name: "rotateSessionKey", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "updateKeyPermissions", inputs: [ - { name: "sessionKey", internalType: "address", type: "address" }, - { name: "updates", internalType: "bytes[]", type: "bytes[]" }, + { name: "sessionKey", type: "address", internalType: "address" }, + { name: "updates", type: "bytes[]", internalType: "bytes[]" }, ], - name: "updateKeyPermissions", outputs: [], + stateMutability: "nonpayable", }, ] as const; export const SessionKeyPluginAbi = [ { - stateMutability: "nonpayable", type: "function", + name: "addSessionKey", inputs: [ - { name: "sessionKey", internalType: "address", type: "address" }, - { name: "tag", internalType: "bytes32", type: "bytes32" }, - { name: "permissionUpdates", internalType: "bytes[]", type: "bytes[]" }, + { name: "sessionKey", type: "address", internalType: "address" }, + { name: "tag", type: "bytes32", internalType: "bytes32" }, + { name: "permissionUpdates", type: "bytes[]", internalType: "bytes[]" }, ], - name: "addSessionKey", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "executeWithSessionKey", inputs: [ { name: "calls", - internalType: "struct Call[]", type: "tuple[]", + internalType: "struct Call[]", components: [ - { name: "target", internalType: "address", type: "address" }, - { name: "value", internalType: "uint256", type: "uint256" }, - { name: "data", internalType: "bytes", type: "bytes" }, + { name: "target", type: "address", internalType: "address" }, + { name: "value", type: "uint256", internalType: "uint256" }, + { name: "data", type: "bytes", internalType: "bytes" }, ], }, - { name: "sessionKey", internalType: "address", type: "address" }, + { name: "sessionKey", type: "address", internalType: "address" }, ], - name: "executeWithSessionKey", - outputs: [{ name: "", internalType: "bytes[]", type: "bytes[]" }], + outputs: [{ name: "", type: "bytes[]", internalType: "bytes[]" }], + stateMutability: "nonpayable", }, { - stateMutability: "view", type: "function", + name: "findPredecessor", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "sessionKey", internalType: "address", type: "address" }, + { name: "account", type: "address", internalType: "address" }, + { name: "sessionKey", type: "address", internalType: "address" }, ], - name: "findPredecessor", - outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }], + outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "getAccessControlEntry", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "sessionKey", internalType: "address", type: "address" }, - { name: "contractAddress", internalType: "address", type: "address" }, + { name: "account", type: "address", internalType: "address" }, + { name: "sessionKey", type: "address", internalType: "address" }, + { name: "contractAddress", type: "address", internalType: "address" }, ], - name: "getAccessControlEntry", outputs: [ - { name: "isOnList", internalType: "bool", type: "bool" }, - { name: "checkSelectors", internalType: "bool", type: "bool" }, + { name: "isOnList", type: "bool", internalType: "bool" }, + { name: "checkSelectors", type: "bool", internalType: "bool" }, ], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "getAccessControlType", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "sessionKey", internalType: "address", type: "address" }, + { name: "account", type: "address", internalType: "address" }, + { name: "sessionKey", type: "address", internalType: "address" }, ], - name: "getAccessControlType", outputs: [ { name: "", - internalType: "enum ISessionKeyPlugin.ContractAccessControlType", type: "uint8", + internalType: "enum ISessionKeyPlugin.ContractAccessControlType", }, ], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "getERC20SpendLimitInfo", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "sessionKey", internalType: "address", type: "address" }, - { name: "token", internalType: "address", type: "address" }, + { name: "account", type: "address", internalType: "address" }, + { name: "sessionKey", type: "address", internalType: "address" }, + { name: "token", type: "address", internalType: "address" }, ], - name: "getERC20SpendLimitInfo", outputs: [ { name: "", - internalType: "struct ISessionKeyPlugin.SpendLimitInfo", type: "tuple", + internalType: "struct ISessionKeyPlugin.SpendLimitInfo", components: [ - { name: "hasLimit", internalType: "bool", type: "bool" }, - { name: "limit", internalType: "uint256", type: "uint256" }, - { name: "limitUsed", internalType: "uint256", type: "uint256" }, - { name: "refreshInterval", internalType: "uint48", type: "uint48" }, - { name: "lastUsedTime", internalType: "uint48", type: "uint48" }, + { name: "hasLimit", type: "bool", internalType: "bool" }, + { name: "limit", type: "uint256", internalType: "uint256" }, + { name: "limitUsed", type: "uint256", internalType: "uint256" }, + { name: "refreshInterval", type: "uint48", internalType: "uint48" }, + { name: "lastUsedTime", type: "uint48", internalType: "uint48" }, ], }, ], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "getGasSpendLimit", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "sessionKey", internalType: "address", type: "address" }, + { name: "account", type: "address", internalType: "address" }, + { name: "sessionKey", type: "address", internalType: "address" }, ], - name: "getGasSpendLimit", outputs: [ { name: "info", - internalType: "struct ISessionKeyPlugin.SpendLimitInfo", type: "tuple", + internalType: "struct ISessionKeyPlugin.SpendLimitInfo", components: [ - { name: "hasLimit", internalType: "bool", type: "bool" }, - { name: "limit", internalType: "uint256", type: "uint256" }, - { name: "limitUsed", internalType: "uint256", type: "uint256" }, - { name: "refreshInterval", internalType: "uint48", type: "uint48" }, - { name: "lastUsedTime", internalType: "uint48", type: "uint48" }, + { name: "hasLimit", type: "bool", internalType: "bool" }, + { name: "limit", type: "uint256", internalType: "uint256" }, + { name: "limitUsed", type: "uint256", internalType: "uint256" }, + { name: "refreshInterval", type: "uint48", internalType: "uint48" }, + { name: "lastUsedTime", type: "uint48", internalType: "uint48" }, ], }, - { name: "shouldReset", internalType: "bool", type: "bool" }, + { name: "shouldReset", type: "bool", internalType: "bool" }, ], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "getKeyTimeRange", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "sessionKey", internalType: "address", type: "address" }, + { name: "account", type: "address", internalType: "address" }, + { name: "sessionKey", type: "address", internalType: "address" }, ], - name: "getKeyTimeRange", outputs: [ - { name: "validAfter", internalType: "uint48", type: "uint48" }, - { name: "validUntil", internalType: "uint48", type: "uint48" }, + { name: "validAfter", type: "uint48", internalType: "uint48" }, + { name: "validUntil", type: "uint48", internalType: "uint48" }, ], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "getNativeTokenSpendLimitInfo", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "sessionKey", internalType: "address", type: "address" }, + { name: "account", type: "address", internalType: "address" }, + { name: "sessionKey", type: "address", internalType: "address" }, ], - name: "getNativeTokenSpendLimitInfo", outputs: [ { name: "info", - internalType: "struct ISessionKeyPlugin.SpendLimitInfo", type: "tuple", + internalType: "struct ISessionKeyPlugin.SpendLimitInfo", components: [ - { name: "hasLimit", internalType: "bool", type: "bool" }, - { name: "limit", internalType: "uint256", type: "uint256" }, - { name: "limitUsed", internalType: "uint256", type: "uint256" }, - { name: "refreshInterval", internalType: "uint48", type: "uint48" }, - { name: "lastUsedTime", internalType: "uint48", type: "uint48" }, + { name: "hasLimit", type: "bool", internalType: "bool" }, + { name: "limit", type: "uint256", internalType: "uint256" }, + { name: "limitUsed", type: "uint256", internalType: "uint256" }, + { name: "refreshInterval", type: "uint48", internalType: "uint48" }, + { name: "lastUsedTime", type: "uint48", internalType: "uint48" }, ], }, ], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "getRequiredPaymaster", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "sessionKey", internalType: "address", type: "address" }, + { name: "account", type: "address", internalType: "address" }, + { name: "sessionKey", type: "address", internalType: "address" }, ], - name: "getRequiredPaymaster", - outputs: [{ name: "", internalType: "address", type: "address" }], + outputs: [{ name: "", type: "address", internalType: "address" }], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "isSelectorOnAccessControlList", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "sessionKey", internalType: "address", type: "address" }, - { name: "contractAddress", internalType: "address", type: "address" }, - { name: "selector", internalType: "bytes4", type: "bytes4" }, + { name: "account", type: "address", internalType: "address" }, + { name: "sessionKey", type: "address", internalType: "address" }, + { name: "contractAddress", type: "address", internalType: "address" }, + { name: "selector", type: "bytes4", internalType: "bytes4" }, ], - name: "isSelectorOnAccessControlList", - outputs: [{ name: "isOnList", internalType: "bool", type: "bool" }], + outputs: [{ name: "isOnList", type: "bool", internalType: "bool" }], + stateMutability: "view", }, { - stateMutability: "view", type: "function", + name: "isSessionKeyOf", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "sessionKey", internalType: "address", type: "address" }, + { name: "account", type: "address", internalType: "address" }, + { name: "sessionKey", type: "address", internalType: "address" }, ], - name: "isSessionKeyOf", - outputs: [{ name: "", internalType: "bool", type: "bool" }], + outputs: [{ name: "", type: "bool", internalType: "bool" }], + stateMutability: "view", }, { - stateMutability: "nonpayable", type: "function", - inputs: [{ name: "data", internalType: "bytes", type: "bytes" }], name: "onInstall", + inputs: [{ name: "data", type: "bytes", internalType: "bytes" }], outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", - inputs: [{ name: "", internalType: "bytes", type: "bytes" }], name: "onUninstall", + inputs: [{ name: "", type: "bytes", internalType: "bytes" }], outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "pure", type: "function", - inputs: [], name: "pluginManifest", + inputs: [], outputs: [ { name: "", - internalType: "struct PluginManifest", type: "tuple", + internalType: "struct PluginManifest", components: [ - { name: "interfaceIds", internalType: "bytes4[]", type: "bytes4[]" }, + { name: "interfaceIds", type: "bytes4[]", internalType: "bytes4[]" }, { name: "dependencyInterfaceIds", - internalType: "bytes4[]", type: "bytes4[]", + internalType: "bytes4[]", }, { name: "executionFunctions", - internalType: "bytes4[]", type: "bytes4[]", + internalType: "bytes4[]", }, { name: "permittedExecutionSelectors", - internalType: "bytes4[]", type: "bytes4[]", + internalType: "bytes4[]", }, { name: "permitAnyExternalAddress", - internalType: "bool", type: "bool", + internalType: "bool", }, - { name: "canSpendNativeToken", internalType: "bool", type: "bool" }, + { name: "canSpendNativeToken", type: "bool", internalType: "bool" }, { name: "permittedExternalCalls", - internalType: "struct ManifestExternalCallPermission[]", type: "tuple[]", + internalType: "struct ManifestExternalCallPermission[]", components: [ { name: "externalAddress", - internalType: "address", type: "address", + internalType: "address", }, - { name: "permitAnySelector", internalType: "bool", type: "bool" }, - { name: "selectors", internalType: "bytes4[]", type: "bytes4[]" }, + { name: "permitAnySelector", type: "bool", internalType: "bool" }, + { name: "selectors", type: "bytes4[]", internalType: "bytes4[]" }, ], }, { name: "userOpValidationFunctions", - internalType: "struct ManifestAssociatedFunction[]", type: "tuple[]", + internalType: "struct ManifestAssociatedFunction[]", components: [ { name: "executionSelector", - internalType: "bytes4", type: "bytes4", + internalType: "bytes4", }, { name: "associatedFunction", - internalType: "struct ManifestFunction", type: "tuple", + internalType: "struct ManifestFunction", components: [ { name: "functionType", - internalType: "enum ManifestAssociatedFunctionType", type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "dependencyIndex", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, ], }, @@ -813,29 +810,29 @@ export const SessionKeyPluginAbi = [ }, { name: "runtimeValidationFunctions", - internalType: "struct ManifestAssociatedFunction[]", type: "tuple[]", + internalType: "struct ManifestAssociatedFunction[]", components: [ { name: "executionSelector", - internalType: "bytes4", type: "bytes4", + internalType: "bytes4", }, { name: "associatedFunction", - internalType: "struct ManifestFunction", type: "tuple", + internalType: "struct ManifestFunction", components: [ { name: "functionType", - internalType: "enum ManifestAssociatedFunctionType", type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "dependencyIndex", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, ], }, @@ -843,29 +840,29 @@ export const SessionKeyPluginAbi = [ }, { name: "preUserOpValidationHooks", - internalType: "struct ManifestAssociatedFunction[]", type: "tuple[]", + internalType: "struct ManifestAssociatedFunction[]", components: [ { name: "executionSelector", - internalType: "bytes4", type: "bytes4", + internalType: "bytes4", }, { name: "associatedFunction", - internalType: "struct ManifestFunction", type: "tuple", + internalType: "struct ManifestFunction", components: [ { name: "functionType", - internalType: "enum ManifestAssociatedFunctionType", type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "dependencyIndex", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, ], }, @@ -873,29 +870,29 @@ export const SessionKeyPluginAbi = [ }, { name: "preRuntimeValidationHooks", - internalType: "struct ManifestAssociatedFunction[]", type: "tuple[]", + internalType: "struct ManifestAssociatedFunction[]", components: [ { name: "executionSelector", - internalType: "bytes4", type: "bytes4", + internalType: "bytes4", }, { name: "associatedFunction", - internalType: "struct ManifestFunction", type: "tuple", + internalType: "struct ManifestFunction", components: [ { name: "functionType", - internalType: "enum ManifestAssociatedFunctionType", type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "dependencyIndex", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, ], }, @@ -903,47 +900,47 @@ export const SessionKeyPluginAbi = [ }, { name: "executionHooks", - internalType: "struct ManifestExecutionHook[]", type: "tuple[]", + internalType: "struct ManifestExecutionHook[]", components: [ { name: "executionSelector", - internalType: "bytes4", type: "bytes4", + internalType: "bytes4", }, { name: "preExecHook", - internalType: "struct ManifestFunction", type: "tuple", + internalType: "struct ManifestFunction", components: [ { name: "functionType", - internalType: "enum ManifestAssociatedFunctionType", type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "dependencyIndex", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, ], }, { name: "postExecHook", - internalType: "struct ManifestFunction", type: "tuple", + internalType: "struct ManifestFunction", components: [ { name: "functionType", - internalType: "enum ManifestAssociatedFunctionType", type: "uint8", + internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "dependencyIndex", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, ], }, @@ -952,371 +949,372 @@ export const SessionKeyPluginAbi = [ ], }, ], + stateMutability: "pure", }, { - stateMutability: "pure", type: "function", - inputs: [], name: "pluginMetadata", + inputs: [], outputs: [ { name: "", - internalType: "struct PluginMetadata", type: "tuple", + internalType: "struct PluginMetadata", components: [ - { name: "name", internalType: "string", type: "string" }, - { name: "version", internalType: "string", type: "string" }, - { name: "author", internalType: "string", type: "string" }, + { name: "name", type: "string", internalType: "string" }, + { name: "version", type: "string", internalType: "string" }, + { name: "author", type: "string", internalType: "string" }, { name: "permissionDescriptors", - internalType: "struct SelectorPermission[]", type: "tuple[]", + internalType: "struct SelectorPermission[]", components: [ { name: "functionSelector", - internalType: "bytes4", type: "bytes4", + internalType: "bytes4", }, { name: "permissionDescription", - internalType: "string", type: "string", + internalType: "string", }, ], }, ], }, ], + stateMutability: "pure", }, { - stateMutability: "nonpayable", type: "function", + name: "postExecutionHook", inputs: [ - { name: "functionId", internalType: "uint8", type: "uint8" }, - { name: "preExecHookData", internalType: "bytes", type: "bytes" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, + { name: "preExecHookData", type: "bytes", internalType: "bytes" }, ], - name: "postExecutionHook", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "preExecutionHook", inputs: [ - { name: "functionId", internalType: "uint8", type: "uint8" }, - { name: "sender", internalType: "address", type: "address" }, - { name: "value", internalType: "uint256", type: "uint256" }, - { name: "data", internalType: "bytes", type: "bytes" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, + { name: "sender", type: "address", internalType: "address" }, + { name: "value", type: "uint256", internalType: "uint256" }, + { name: "data", type: "bytes", internalType: "bytes" }, ], - name: "preExecutionHook", - outputs: [{ name: "", internalType: "bytes", type: "bytes" }], + outputs: [{ name: "", type: "bytes", internalType: "bytes" }], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "preRuntimeValidationHook", inputs: [ - { name: "functionId", internalType: "uint8", type: "uint8" }, - { name: "sender", internalType: "address", type: "address" }, - { name: "value", internalType: "uint256", type: "uint256" }, - { name: "data", internalType: "bytes", type: "bytes" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, + { name: "sender", type: "address", internalType: "address" }, + { name: "value", type: "uint256", internalType: "uint256" }, + { name: "data", type: "bytes", internalType: "bytes" }, ], - name: "preRuntimeValidationHook", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "preUserOpValidationHook", inputs: [ - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "userOp", - internalType: "struct UserOperation", type: "tuple", + internalType: "struct UserOperation", components: [ - { name: "sender", internalType: "address", type: "address" }, - { name: "nonce", internalType: "uint256", type: "uint256" }, - { name: "initCode", internalType: "bytes", type: "bytes" }, - { name: "callData", internalType: "bytes", type: "bytes" }, - { name: "callGasLimit", internalType: "uint256", type: "uint256" }, + { name: "sender", type: "address", internalType: "address" }, + { name: "nonce", type: "uint256", internalType: "uint256" }, + { name: "initCode", type: "bytes", internalType: "bytes" }, + { name: "callData", type: "bytes", internalType: "bytes" }, + { name: "callGasLimit", type: "uint256", internalType: "uint256" }, { name: "verificationGasLimit", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, { name: "preVerificationGas", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, - { name: "maxFeePerGas", internalType: "uint256", type: "uint256" }, + { name: "maxFeePerGas", type: "uint256", internalType: "uint256" }, { name: "maxPriorityFeePerGas", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, - { name: "paymasterAndData", internalType: "bytes", type: "bytes" }, - { name: "signature", internalType: "bytes", type: "bytes" }, + { name: "paymasterAndData", type: "bytes", internalType: "bytes" }, + { name: "signature", type: "bytes", internalType: "bytes" }, ], }, - { name: "userOpHash", internalType: "bytes32", type: "bytes32" }, + { name: "userOpHash", type: "bytes32", internalType: "bytes32" }, ], - name: "preUserOpValidationHook", - outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + outputs: [{ name: "", type: "uint256", internalType: "uint256" }], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "removeSessionKey", inputs: [ - { name: "sessionKey", internalType: "address", type: "address" }, - { name: "predecessor", internalType: "bytes32", type: "bytes32" }, + { name: "sessionKey", type: "address", internalType: "address" }, + { name: "predecessor", type: "bytes32", internalType: "bytes32" }, ], - name: "removeSessionKey", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "resetSessionKeyGasLimitTimestamp", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "sessionKey", internalType: "address", type: "address" }, + { name: "account", type: "address", internalType: "address" }, + { name: "sessionKey", type: "address", internalType: "address" }, ], - name: "resetSessionKeyGasLimitTimestamp", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "rotateSessionKey", inputs: [ - { name: "oldSessionKey", internalType: "address", type: "address" }, - { name: "predecessor", internalType: "bytes32", type: "bytes32" }, - { name: "newSessionKey", internalType: "address", type: "address" }, + { name: "oldSessionKey", type: "address", internalType: "address" }, + { name: "predecessor", type: "bytes32", internalType: "bytes32" }, + { name: "newSessionKey", type: "address", internalType: "address" }, ], - name: "rotateSessionKey", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "runtimeValidationFunction", inputs: [ - { name: "functionId", internalType: "uint8", type: "uint8" }, - { name: "sender", internalType: "address", type: "address" }, - { name: "value", internalType: "uint256", type: "uint256" }, - { name: "data", internalType: "bytes", type: "bytes" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, + { name: "sender", type: "address", internalType: "address" }, + { name: "value", type: "uint256", internalType: "uint256" }, + { name: "data", type: "bytes", internalType: "bytes" }, ], - name: "runtimeValidationFunction", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "view", type: "function", - inputs: [{ name: "account", internalType: "address", type: "address" }], name: "sessionKeysOf", - outputs: [{ name: "", internalType: "address[]", type: "address[]" }], + inputs: [{ name: "account", type: "address", internalType: "address" }], + outputs: [{ name: "", type: "address[]", internalType: "address[]" }], + stateMutability: "view", }, { - stateMutability: "view", type: "function", - inputs: [{ name: "interfaceId", internalType: "bytes4", type: "bytes4" }], name: "supportsInterface", - outputs: [{ name: "", internalType: "bool", type: "bool" }], + inputs: [{ name: "interfaceId", type: "bytes4", internalType: "bytes4" }], + outputs: [{ name: "", type: "bool", internalType: "bool" }], + stateMutability: "view", }, { - stateMutability: "nonpayable", type: "function", + name: "updateKeyPermissions", inputs: [ - { name: "sessionKey", internalType: "address", type: "address" }, - { name: "updates", internalType: "bytes[]", type: "bytes[]" }, + { name: "sessionKey", type: "address", internalType: "address" }, + { name: "updates", type: "bytes[]", internalType: "bytes[]" }, ], - name: "updateKeyPermissions", outputs: [], + stateMutability: "nonpayable", }, { - stateMutability: "nonpayable", type: "function", + name: "userOpValidationFunction", inputs: [ - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, { name: "userOp", - internalType: "struct UserOperation", type: "tuple", + internalType: "struct UserOperation", components: [ - { name: "sender", internalType: "address", type: "address" }, - { name: "nonce", internalType: "uint256", type: "uint256" }, - { name: "initCode", internalType: "bytes", type: "bytes" }, - { name: "callData", internalType: "bytes", type: "bytes" }, - { name: "callGasLimit", internalType: "uint256", type: "uint256" }, + { name: "sender", type: "address", internalType: "address" }, + { name: "nonce", type: "uint256", internalType: "uint256" }, + { name: "initCode", type: "bytes", internalType: "bytes" }, + { name: "callData", type: "bytes", internalType: "bytes" }, + { name: "callGasLimit", type: "uint256", internalType: "uint256" }, { name: "verificationGasLimit", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, { name: "preVerificationGas", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, - { name: "maxFeePerGas", internalType: "uint256", type: "uint256" }, + { name: "maxFeePerGas", type: "uint256", internalType: "uint256" }, { name: "maxPriorityFeePerGas", - internalType: "uint256", type: "uint256", + internalType: "uint256", }, - { name: "paymasterAndData", internalType: "bytes", type: "bytes" }, - { name: "signature", internalType: "bytes", type: "bytes" }, + { name: "paymasterAndData", type: "bytes", internalType: "bytes" }, + { name: "signature", type: "bytes", internalType: "bytes" }, ], }, - { name: "userOpHash", internalType: "bytes32", type: "bytes32" }, + { name: "userOpHash", type: "bytes32", internalType: "bytes32" }, ], - name: "userOpValidationFunction", - outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + outputs: [{ name: "", type: "uint256", internalType: "uint256" }], + stateMutability: "nonpayable", }, { type: "event", - anonymous: false, + name: "PermissionsUpdated", inputs: [ { name: "account", - internalType: "address", type: "address", indexed: true, + internalType: "address", }, { name: "sessionKey", - internalType: "address", type: "address", indexed: true, + internalType: "address", }, { name: "updates", - internalType: "bytes[]", type: "bytes[]", indexed: false, + internalType: "bytes[]", }, ], - name: "PermissionsUpdated", + anonymous: false, }, { type: "event", - anonymous: false, + name: "SessionKeyAdded", inputs: [ { name: "account", - internalType: "address", type: "address", indexed: true, + internalType: "address", }, { name: "sessionKey", - internalType: "address", type: "address", indexed: true, + internalType: "address", }, - { name: "tag", internalType: "bytes32", type: "bytes32", indexed: true }, + { name: "tag", type: "bytes32", indexed: true, internalType: "bytes32" }, ], - name: "SessionKeyAdded", + anonymous: false, }, { type: "event", - anonymous: false, + name: "SessionKeyRemoved", inputs: [ { name: "account", - internalType: "address", type: "address", indexed: true, + internalType: "address", }, { name: "sessionKey", - internalType: "address", type: "address", indexed: true, + internalType: "address", }, ], - name: "SessionKeyRemoved", + anonymous: false, }, { type: "event", - anonymous: false, + name: "SessionKeyRotated", inputs: [ { name: "account", - internalType: "address", type: "address", indexed: true, + internalType: "address", }, { name: "oldSessionKey", - internalType: "address", type: "address", indexed: true, + internalType: "address", }, { name: "newSessionKey", - internalType: "address", type: "address", indexed: true, + internalType: "address", }, ], - name: "SessionKeyRotated", + anonymous: false, }, - { type: "error", inputs: [], name: "AlreadyInitialized" }, + { type: "error", name: "AlreadyInitialized", inputs: [] }, { type: "error", + name: "ERC20SpendLimitExceeded", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "sessionKey", internalType: "address", type: "address" }, - { name: "token", internalType: "address", type: "address" }, + { name: "account", type: "address", internalType: "address" }, + { name: "sessionKey", type: "address", internalType: "address" }, + { name: "token", type: "address", internalType: "address" }, ], - name: "ERC20SpendLimitExceeded", }, - { type: "error", inputs: [], name: "InvalidAction" }, + { type: "error", name: "InvalidAction", inputs: [] }, { type: "error", + name: "InvalidPermissionsUpdate", inputs: [ - { name: "updateSelector", internalType: "bytes4", type: "bytes4" }, + { name: "updateSelector", type: "bytes4", internalType: "bytes4" }, ], - name: "InvalidPermissionsUpdate", }, { type: "error", - inputs: [{ name: "sessionKey", internalType: "address", type: "address" }], name: "InvalidSessionKey", + inputs: [{ name: "sessionKey", type: "address", internalType: "address" }], }, { type: "error", - inputs: [{ name: "sessionKey", internalType: "address", type: "address" }], name: "InvalidSignature", + inputs: [{ name: "sessionKey", type: "address", internalType: "address" }], }, { type: "error", - inputs: [{ name: "token", internalType: "address", type: "address" }], name: "InvalidToken", + inputs: [{ name: "token", type: "address", internalType: "address" }], }, - { type: "error", inputs: [], name: "LengthMismatch" }, + { type: "error", name: "LengthMismatch", inputs: [] }, { type: "error", + name: "NativeTokenSpendLimitExceeded", inputs: [ - { name: "account", internalType: "address", type: "address" }, - { name: "sessionKey", internalType: "address", type: "address" }, + { name: "account", type: "address", internalType: "address" }, + { name: "sessionKey", type: "address", internalType: "address" }, ], - name: "NativeTokenSpendLimitExceeded", }, { type: "error", - inputs: [{ name: "caller", internalType: "address", type: "address" }], name: "NotContractCaller", + inputs: [{ name: "caller", type: "address", internalType: "address" }], }, { type: "error", + name: "NotImplemented", inputs: [ - { name: "selector", internalType: "bytes4", type: "bytes4" }, - { name: "functionId", internalType: "uint8", type: "uint8" }, + { name: "selector", type: "bytes4", internalType: "bytes4" }, + { name: "functionId", type: "uint8", internalType: "uint8" }, ], - name: "NotImplemented", }, - { type: "error", inputs: [], name: "NotInitialized" }, + { type: "error", name: "NotInitialized", inputs: [] }, { type: "error", - inputs: [{ name: "sessionKey", internalType: "address", type: "address" }], name: "SessionKeyNotFound", + inputs: [{ name: "sessionKey", type: "address", internalType: "address" }], }, ] as const; diff --git a/packages/accounts/src/msca/plugins/session-key/signer.ts b/account-kit/smart-contracts/src/msca/plugins/session-key/signer.ts similarity index 100% rename from packages/accounts/src/msca/plugins/session-key/signer.ts rename to account-kit/smart-contracts/src/msca/plugins/session-key/signer.ts diff --git a/packages/accounts/src/msca/plugins/session-key/utils.ts b/account-kit/smart-contracts/src/msca/plugins/session-key/utils.ts similarity index 100% rename from packages/accounts/src/msca/plugins/session-key/utils.ts rename to account-kit/smart-contracts/src/msca/plugins/session-key/utils.ts diff --git a/packages/accounts/src/msca/plugins/types.ts b/account-kit/smart-contracts/src/msca/plugins/types.ts similarity index 100% rename from packages/accounts/src/msca/plugins/types.ts rename to account-kit/smart-contracts/src/msca/plugins/types.ts diff --git a/packages/accounts/src/msca/utils.ts b/account-kit/smart-contracts/src/msca/utils.ts similarity index 100% rename from packages/accounts/src/msca/utils.ts rename to account-kit/smart-contracts/src/msca/utils.ts diff --git a/account-kit/smart-contracts/tsconfig.build.json b/account-kit/smart-contracts/tsconfig.build.json new file mode 100644 index 0000000000..0af5103820 --- /dev/null +++ b/account-kit/smart-contracts/tsconfig.build.json @@ -0,0 +1,18 @@ +{ + "extends": "typescript-template/build.json", + "exclude": [ + "node_modules", + "**/*/__tests__", + "**/*/*.test.ts", + "**/*/*.e2e.test.ts", + "vitest.config.ts", + "vitest.config.e2e.ts" + ], + "include": ["src", "plugindefs"], + "compilerOptions": { + "sourceMap": true, + "paths": { + "@account-kit/smart-contracts": ["./src/index.ts"] + } + } +} diff --git a/account-kit/smart-contracts/tsconfig.json b/account-kit/smart-contracts/tsconfig.json new file mode 100644 index 0000000000..b150964409 --- /dev/null +++ b/account-kit/smart-contracts/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "typescript-template/base.json", + "compilerOptions": { + "paths": { + "@account-kit/smart-contracts": ["./src/index.ts"] + } + } +} diff --git a/account-kit/smart-contracts/vitest.config.e2e.ts b/account-kit/smart-contracts/vitest.config.e2e.ts new file mode 100644 index 0000000000..421e61da85 --- /dev/null +++ b/account-kit/smart-contracts/vitest.config.e2e.ts @@ -0,0 +1,11 @@ +import { defineProject } from "vitest/config"; + +export default defineProject({ + test: { + singleThread: true, + globals: true, + setupFiles: ["../../.vitest/setupTests.ts"], + include: ["**/*/*.e2e.test.ts"], + name: "account-kit/accounts", + }, +}); diff --git a/account-kit/smart-contracts/vitest.config.ts b/account-kit/smart-contracts/vitest.config.ts new file mode 100644 index 0000000000..b09bc1eb7c --- /dev/null +++ b/account-kit/smart-contracts/vitest.config.ts @@ -0,0 +1,11 @@ +import { configDefaults, defineProject } from "vitest/config"; + +export default defineProject({ + test: { + singleThread: true, + globals: true, + setupFiles: ["../../.vitest/setupTests.ts"], + exclude: [...configDefaults.exclude, "**/e2e-tests/**/*.test.ts"], + name: "account-kit/accounts", + }, +}); diff --git a/examples/ui-demo/package.json b/examples/ui-demo/package.json index dba5f4ada0..97685b43fb 100644 --- a/examples/ui-demo/package.json +++ b/examples/ui-demo/package.json @@ -9,7 +9,8 @@ "lint": "next lint" }, "dependencies": { - "@alchemy/aa-alchemy": "^3.9.0", + "@account-kit/core": "^3.18.2", + "@account-kit/react": "^3.18.2", "next": "14.2.3", "react": "^18", "react-dom": "^18", diff --git a/package.json b/package.json index 858480930a..b1a5c13513 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "node": ">=18.16" }, "workspaces": [ - "packages/*", + "aa-sdk/*", + "account-kit/*", "templates/*", "examples/*", "site" diff --git a/packages/accounts/README.md b/packages/accounts/README.md deleted file mode 100644 index acd49692ff..0000000000 --- a/packages/accounts/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# `@alchemy/aa-accounts` - -This package contains various implementations of the [`BaseSmartContractAccount`](https://accountkit.alchemy.com/packages/aa-core/accounts/introduction.html#basesmartcontractaccount) class defined in `aa-core`. This repo is community maintained and we welcome contributions! - -## Getting started - -If you are already using the `@alchemy/aa-core` package, you can simply install this package and start using the accounts. If you are not using `@alchemy/aa-core`, you can install it and follow the instructions in the [Getting started](https://accountkit.alchemy.com/packages/aa-accounts/) docs to get started. - -via `yarn` - -```bash -yarn add @alchemy/aa-accounts -``` - -via `npm` - -```bash -npm i -s @alchemy/aa-accounts -``` - -via `pnpm` - -```bash -pnpm i @alchemy/aa-accounts -``` - -## Contributing - -If you are looking to add a new account type, please follow the following structure. - -1. Create a new folder in `src` with the name of your account type in `kebab-case` (we are following kebab casing for files throughout the project). -2. Create a new file in the folder you just created called `account.ts` and add your implementation for `BaseSmartContractAccount` -3. If needed, create a sub-folder in your account folder called `abis` and add your abis as `.ts` files. eg: - -```ts -export const MyContractAbi = [] as const; // the as const is important so we can get correct typing from viem -``` - -4. If you need to extend the [`SmartAccountProvider`](https://accountkit.alchemy.com/packages/aa-core/smart-account-client/introduction.html) class, add a file called `provider.ts` and add your implementation for `SmartAccountProvider`. - -- Ideally, your `Account` impl should _just_ work with the base provider provided by `aa-core`. -- If not, consider generalizing the use case and updating SmartAccountProvider - -5. Add some tests for your account and provider (if created) by creating a subfolder in your `account/my-account` called `__tests__` and make sure your files end with the `.test.ts` suffix -6. export the classes and types you have defined in `src/index.ts` -7. Open a PR and we will review it as soon as possible! diff --git a/packages/accounts/plugingen/index.ts b/packages/accounts/plugingen/index.ts deleted file mode 100644 index 641093db8a..0000000000 --- a/packages/accounts/plugingen/index.ts +++ /dev/null @@ -1,165 +0,0 @@ -import { - asyncPipe, - type ConnectionConfig, - type RequiredBy, -} from "@alchemy/aa-core"; -import { type Plugin } from "@wagmi/cli"; -import dedent from "dedent"; -import { createPublicClient, getContract, http, type Chain } from "viem"; -import type { PluginGenConfig } from "../plugindefs/types.js"; -import { IPluginAbi } from "../src/msca/abis/IPlugin.js"; -import { ContractAbiGenPhase } from "./phases/contract-abi-gen.js"; -import { ContractAddressesGenPhase } from "./phases/contract-addresses-gen.js"; -import { ExecutionAbiGenPhase } from "./phases/execution-abi-gen.js"; -import { PluginActionsGenPhase } from "./phases/plugin-actions/index.js"; -import { PluginGeneratorPhase } from "./phases/plugin-generator/index.js"; -import type { Phase, PhaseInput } from "./types.js"; - -// Add more phases here if needed -const phases: Phase[] = [ - ContractAddressesGenPhase, - PluginGeneratorPhase, - PluginActionsGenPhase, - ExecutionAbiGenPhase, - ContractAbiGenPhase, -]; - -export function plugingen({ - chain, - connectionConfig, - config, -}: { - chain: Chain; - connectionConfig: ConnectionConfig; - config: PluginGenConfig; -}): RequiredBy { - return { - name: "ERC6900PluginGen: This file is auto-generated by plugingen", - run: async ({ contracts }) => { - // Setup plugin generator - const imports: Map< - string, - { - types: Set; - members: Set; - } - > = new Map(); - const addImport: PhaseInput["addImport"] = (moduleName, member) => { - if (!imports.has(moduleName)) { - imports.set(moduleName, { - types: new Set(), - members: new Set(), - }); - } - - const module = imports.get(moduleName)!; - if (member.isType) { - module.types.add(member.name); - } else { - module.members.add(member.name); - } - }; - const content: string[] = []; - const types: Map = - new Map(); - const addType: PhaseInput["addType"] = (typeName, typeDef, isPublic) => { - if (types.has(typeName)) { - throw new Error(`Type ${typeName} already exists`); - } - - types.set(typeName, { - definition: typeDef.replace(";", ""), - isPublic: isPublic ?? false, - }); - }; - - if (contracts.length !== 1) { - throw new Error( - "plugingen should be used with only one Contract per plugin invocation" - ); - } - - const rpcUrl = - connectionConfig.rpcUrl == null - ? `${chain.rpcUrls.alchemy.http[0]}/${ - connectionConfig.apiKey ?? process.env.API_KEY - }` - : connectionConfig.rpcUrl; - - const client = createPublicClient({ - chain, - transport: http(rpcUrl, { - fetchOptions: { - headers: { - Authorization: `Bearer ${connectionConfig.jwt}`, - }, - }, - }), - }); - - const contract = contracts[0]; - // This is done to clear out the ABI generated by wagmi - contract.content = ""; - if (contract.address == null) { - throw new Error("contract must have at least one address"); - } - - const address = - typeof contract.address === "string" - ? { [chain.id]: contract.address } - : contract.address; - - if (!(chain.id in address)) { - throw new Error( - `contract address missing for the reference chain ${chain.id}` - ); - } - - const plugin = getContract({ - address: address[chain.id], - abi: IPluginAbi, - client, - }); - - const result = await asyncPipe(...phases)({ - addImport, - addType, - content, - config, - contract, - plugin, - }); - - // Aggregate Result of phase - const finalContent = dedent` - ${Array.from(types.entries()) - .map( - ([name, type]) => - `${type.isPublic ? "export" : ""} type ${name} = ${ - type.definition - };` - ) - .join("\n\n")} - - ${result.content.join("\n\n")} - `; - - const finalImports = Array.from(imports.entries()) - .map(([moduleName, { members, types }]) => { - return dedent` - import { ${Array.from(members.values()).join(",")} ${ - members.size > 0 ? "," : "" - } ${Array.from(types.values()) - .map((x) => `type ${x}`) - .join(",")} } from "${moduleName}"; - `; - }) - .join("\n"); - - return { - imports: finalImports, - content: finalContent, - }; - }, - }; -} diff --git a/packages/accounts/plugingen/phases/contract-abi-gen.ts b/packages/accounts/plugingen/phases/contract-abi-gen.ts deleted file mode 100644 index 6dc075fc92..0000000000 --- a/packages/accounts/plugingen/phases/contract-abi-gen.ts +++ /dev/null @@ -1,10 +0,0 @@ -import dedent from "dedent"; -import type { Phase } from "../types"; - -export const ContractAbiGenPhase: Phase = async (input) => { - const { contract, content } = input; - content.push(dedent` - export const ${contract.name}Abi = ${JSON.stringify(contract.abi)} as const; - `); - return input; -}; diff --git a/packages/accounts/plugingen/phases/contract-addresses-gen.ts b/packages/accounts/plugingen/phases/contract-addresses-gen.ts deleted file mode 100644 index cd9df0aa70..0000000000 --- a/packages/accounts/plugingen/phases/contract-addresses-gen.ts +++ /dev/null @@ -1,18 +0,0 @@ -import dedent from "dedent"; -import type { Address } from "viem"; -import type { Phase } from "../types"; - -export const ContractAddressesGenPhase: Phase = async (input) => { - const { contract, content, addImport } = input; - - addImport("viem", { name: "Address", isType: true }); - content.push(dedent` - const addresses = {${Object.entries( - contract.address as Record - ).reduce( - (prev, [chainId, addr]) => (prev += `${chainId}: "${addr}" as Address, `), - "" - )}} as Record; - `); - return input; -}; diff --git a/packages/accounts/plugingen/phases/execution-abi-gen.ts b/packages/accounts/plugingen/phases/execution-abi-gen.ts deleted file mode 100644 index 2ee7759953..0000000000 --- a/packages/accounts/plugingen/phases/execution-abi-gen.ts +++ /dev/null @@ -1,17 +0,0 @@ -import dedent from "dedent"; -import type { Phase } from "../types"; -import { executionAbiConst, extractExecutionAbi } from "../utils.js"; - -export const ExecutionAbiGenPhase: Phase = async (input) => { - const { contract, content, plugin } = input; - - const { executionFunctions } = await plugin.read.pluginManifest(); - const executionAbi = extractExecutionAbi(executionFunctions, contract.abi); - - content.push(dedent` - export const ${executionAbiConst(contract.name)} = ${JSON.stringify( - executionAbi - )} as const; - `); - return input; -}; diff --git a/packages/accounts/plugingen/phases/plugin-actions/index.ts b/packages/accounts/plugingen/phases/plugin-actions/index.ts deleted file mode 100644 index dff70c58bc..0000000000 --- a/packages/accounts/plugingen/phases/plugin-actions/index.ts +++ /dev/null @@ -1,152 +0,0 @@ -import { asyncPipe } from "@alchemy/aa-core"; -import { camelCase } from "change-case"; -import dedent from "dedent"; -import type { Phase } from "../../types"; -import { extractExecutionAbi } from "../../utils.js"; -import { ManagementActionsGenPhase } from "./management-actions.js"; -import { AccountReadActionsGenPhase } from "./read-actions.js"; - -export const PluginActionsGenPhase: Phase = async (input) => { - const { plugin, contract, addImport, addType } = input; - const { executionFunctions } = await plugin.read.pluginManifest(); - const executionAbiConst = `${contract.name}ExecutionFunctionAbi`; - const executionAbi = extractExecutionAbi(executionFunctions, contract.abi); - - addImport("viem", { name: "EncodeFunctionDataParameters", isType: true }); - addImport("viem", { name: "Transport", isType: true }); - addImport("viem", { name: "Chain", isType: true }); - addImport("viem", { name: "Client", isType: true }); - addImport("@alchemy/aa-core", { - name: "SmartContractAccount", - isType: true, - }); - addImport("@alchemy/aa-core", { - name: "GetAccountParameter", - isType: true, - }); - addImport("@alchemy/aa-core", { - name: "SendUserOperationResult", - isType: true, - }); - addImport("@alchemy/aa-core", { - name: "GetEntryPointFromAccount", - isType: true, - }); - addImport("@alchemy/aa-core", { - name: "UserOperationOverridesParameter", - isType: true, - }); - addImport("@alchemy/aa-core", { - name: "UserOperationContext", - isType: true, - }); - addImport("@alchemy/aa-core", { name: "AccountNotFoundError" }); - addImport("@alchemy/aa-core", { name: "isSmartAccountClient" }); - addImport("@alchemy/aa-core", { name: "IncompatibleClientError" }); - addImport("@alchemy/aa-core", { name: "GetContextParameter", isType: true }); - - const providerFunctionDefs: string[] = []; - const providerFunctions = executionAbi - .filter((n) => n.stateMutability !== "view") - .map((n) => { - const argsParamString = - n.inputs.length > 0 - ? dedent`{ - args, - overrides, - context, - account = client.account - }` - : dedent`{ - overrides, - context, - account = client.account - }`; - const argsEncodeString = n.inputs.length > 0 ? "args," : ""; - - providerFunctionDefs.push(dedent` - ${camelCase( - n.name - )}: (args: Pick, "args"> & UserOperationOverridesParameter & - GetAccountParameter & GetContextParameter) => - Promise> - `); - const methodName = camelCase(n.name); - return dedent` - ${methodName}(${argsParamString}) { - if (!account) { - throw new AccountNotFoundError(); - } - if (!isSmartAccountClient(client)) { - throw new IncompatibleClientError("SmartAccountClient", "${methodName}", client); - } - - const uo = encodeFunctionData({ - abi: ${executionAbiConst}, - functionName: "${n.name}", - ${argsEncodeString} - }); - - return client.sendUserOperation({ uo, overrides, account, context }); - } - `; - }); - - addType( - `ExecutionActions< - TAccount extends SmartContractAccount | undefined = - SmartContractAccount | undefined, - TContext extends UserOperationContext | undefined = UserOperationContext | undefined, - TEntryPointVersion extends GetEntryPointFromAccount = GetEntryPointFromAccount - >`, - dedent`{ - ${providerFunctionDefs.join(";\n\n")} - }` - ); - - const { hasReadMethods } = await asyncPipe( - ManagementActionsGenPhase, - AccountReadActionsGenPhase - )({ - ...input, - content: providerFunctions, - }); - - addType( - `${contract.name}Actions< - TAccount extends SmartContractAccount | undefined = - | SmartContractAccount - | undefined, - TContext extends UserOperationContext | undefined = - | UserOperationContext - | undefined - >`, - dedent` - ExecutionActions & ManagementActions & ReadAndEncodeActions${ - hasReadMethods ? "" : "" - } - `, - true - ); - - input.content.push(dedent` - export const ${camelCase(contract.name)}Actions: < - TTransport extends Transport = Transport, - TChain extends Chain | undefined = Chain | undefined, - TAccount extends SmartContractAccount | undefined = - | SmartContractAccount - | undefined, - TContext extends UserOperationContext | undefined = UserOperationContext | undefined - >( - client: Client - ) => ${ - contract.name - }Actions = (client) => ({ ${providerFunctions.join( - ",\n" - )} }); - `); - - return input; -}; diff --git a/packages/accounts/plugingen/phases/plugin-actions/management-actions.ts b/packages/accounts/plugingen/phases/plugin-actions/management-actions.ts deleted file mode 100644 index c0ff586350..0000000000 --- a/packages/accounts/plugingen/phases/plugin-actions/management-actions.ts +++ /dev/null @@ -1,146 +0,0 @@ -import { kebabCase } from "change-case"; -import dedent from "dedent"; -import type { PluginGenConfig } from "../../../plugindefs/types"; -import type { Phase, PhaseInput } from "../../types"; - -export const ManagementActionsGenPhase: Phase = async (input) => { - const { addImport, config, contract, addType } = input; - if (config.installConfig != null) { - addImports( - addImport, - config.installConfig.dependencies?.map((x) => x.plugin) ?? [] - ); - - const initArgs = config.installConfig.initAbiParams ?? []; - - addType("InstallArgs", JSON.stringify(initArgs)); - addType( - `Install${contract.name}Params`, - dedent`{ - args: Parameters>[1]; - pluginAddress?: Address; - dependencyOverrides?: FunctionReference[]; - }`, - true - ); - addType( - `ManagementActions< - TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined, - TContext extends UserOperationContext | undefined = UserOperationContext | undefined, - TEntryPointVersion extends GetEntryPointFromAccount = GetEntryPointFromAccount - >`, - dedent`{ - install${contract.name}: (args: UserOperationOverridesParameter & - Install${contract.name}Params & GetAccountParameter & GetContextParameter) => - Promise> - }` - ); - - const dependencies = (config.installConfig.dependencies ?? []).map( - (x) => dedent` - (() => { - const pluginAddress = ${x.plugin.name}.meta.addresses[chain.id]; - if (!pluginAddress) { - throw new Error("missing ${x.plugin.name} address for chain " + chain.name); - } - - return encodePacked( - ["address", "uint8"], - [pluginAddress, ${x.functionId}] - ); - })() - ` - ); - - const installMethodName = `install${contract.name}`; - - input.content.push(dedent` - ${installMethodName}({account = client.account, overrides, context, ...params}) { - if (!account) { - throw new AccountNotFoundError(); - } - - if (!isSmartAccountClient(client)) { - throw new IncompatibleClientError("SmartAccountClient", "${installMethodName}", client); - } - - const chain = client.chain; - if (!chain) { - throw new ChainNotFoundError(); - } - - const dependencies = params.dependencyOverrides ?? [${dependencies.join( - ",\n\n" - )}]; - const pluginAddress = params.pluginAddress ?? ${ - contract.name - }.meta.addresses[chain.id] as Address | undefined; - - if (!pluginAddress) { - throw new Error("missing ${ - contract.name - } address for chain " + chain.name); - } - - return installPlugin_(client, { - pluginAddress, - pluginInitData: encodeAbiParameters(${JSON.stringify( - initArgs - )}, params.args), - dependencies, - overrides, - account, - context, - }); - } - `); - } - - return input; -}; - -const addImports = ( - addImport: PhaseInput["addImport"], - deps?: PluginGenConfig[] -) => { - if (deps != null && deps.length > 0) { - addImport("viem", { name: "encodePacked" }); - deps.forEach((x) => { - // TODO: after plugingen becomes its own cli tool package, this should be changed to - // `addImport("@alchemy/aa-accounts", { name: x.name });` - addImport( - `../${kebabCase(x.name.replaceAll(/[pP]lugin/g, ""))}/plugin.js`, - { - name: x.name, - } - ); - }); - } - - addImport("@alchemy/aa-core", { name: "ChainNotFoundError" }); - addImport("viem", { name: "encodeAbiParameters" }); - // TODO: after plugingen becomes its own cli tool package, this should be changed to - // `addImport("@alchemy/aa-accounts", { name: "installPlugin as installPlugin_" });` - addImport("../../plugin-manager/installPlugin.js", { - name: "installPlugin as installPlugin_", - }); - addImport("@alchemy/aa-core", { - name: "GetAccountParameter", - isType: true, - }); - addImport("@alchemy/aa-core", { - name: "GetEntryPointFromAccount", - isType: true, - }); - addImport("@alchemy/aa-core", { - name: "UserOperationContext", - isType: true, - }); - // TODO: after plugingen becomes its own cli tool package, this should be changed to - // `addImport("@alchemy/aa-accounts", { name: "FunctionReference", isType: true });` - addImport("../../account-loupe/types.js", { - name: "FunctionReference", - isType: true, - }); - addImport("@alchemy/aa-core", { name: "GetContextParameter", isType: true }); -}; diff --git a/packages/accounts/plugingen/phases/plugin-actions/read-actions.ts b/packages/accounts/plugingen/phases/plugin-actions/read-actions.ts deleted file mode 100644 index adf25b66be..0000000000 --- a/packages/accounts/plugingen/phases/plugin-actions/read-actions.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { pascalCase } from "change-case"; -import dedent from "dedent"; -import type { Phase } from "../../types"; -import { extractExecutionAbi } from "../../utils.js"; - -export const AccountReadActionsGenPhase: Phase = async (input) => { - const { plugin, contract, addImport, addType } = input; - const { executionFunctions } = await plugin.read.pluginManifest(); - const executionAbiConst = `${contract.name}ExecutionFunctionAbi`; - const executionAbi = extractExecutionAbi(executionFunctions, contract.abi); - - addImport("viem", { name: "EncodeFunctionDataParameters", isType: true }); - addImport("viem", { name: "encodeFunctionData" }); - addImport("viem", { name: "Hex", isType: true }); - - const accountFunctionActionDefs: string[] = []; - - const accountFunctions = executionAbi.map((n) => { - const methodContent = []; - const argsParamString = n.inputs.length > 0 ? `{ args }` : ""; - const argsEncodeString = n.inputs.length > 0 ? "args," : ""; - const isViewFunction = n.stateMutability === "view"; - - const encodeMethodName = `encode${pascalCase(n.name)}`; - accountFunctionActionDefs.push( - dedent`${encodeMethodName}: (args: Pick, "args">) => Hex` - ); - methodContent.push(dedent` - ${encodeMethodName}(${argsParamString}) { - return encodeFunctionData({ - abi: ${executionAbiConst}, - functionName: "${n.name}", - ${argsEncodeString} - }); - } - `); - - const readArgsParamString = - n.inputs.length > 0 - ? `{ args, account = client.account }` - : "{ account = client.account }"; - if (isViewFunction) { - addImport("viem", { name: "ReadContractReturnType", isType: true }); - input.hasReadMethods = true; - const readMethodName = `read${pascalCase(n.name)}`; - accountFunctionActionDefs.push( - n.inputs.length > 0 - ? dedent`${readMethodName}: (args: Pick, "args"> & GetAccountParameter) => Promise>` - : dedent`${readMethodName}: (args: GetAccountParameter) => Promise>` - ); - - methodContent.push(dedent` - async ${readMethodName} (${readArgsParamString}) { - if (!account) { - throw new AccountNotFoundError(); - } - - if (!isSmartAccountClient(client)) { - throw new IncompatibleClientError("SmartAccountClient", "${readMethodName}", client); - } - - return client.readContract({ - address: account.address, - abi: ${executionAbiConst}, - functionName: "${n.name}", - ${argsEncodeString} - }); - } - `); - } - - return methodContent.join(",\n\n"); - }); - - const typeName = input.hasReadMethods - ? `ReadAndEncodeActions< - TAccount extends SmartContractAccount | undefined = - SmartContractAccount | undefined, - >` - : "ReadAndEncodeActions"; - - addType( - typeName, - dedent`{ - ${accountFunctionActionDefs.join(";\n\n")} - }` - ); - input.content.push(...accountFunctions); - - return input; -}; diff --git a/packages/accounts/plugingen/phases/plugin-generator/get-contract-gen.ts b/packages/accounts/plugingen/phases/plugin-generator/get-contract-gen.ts deleted file mode 100644 index 2ccbbcb1fb..0000000000 --- a/packages/accounts/plugingen/phases/plugin-generator/get-contract-gen.ts +++ /dev/null @@ -1,30 +0,0 @@ -import dedent from "dedent"; -import type { Phase } from "../../types"; - -export const GetContractGenPhase: Phase = async (input) => { - const { content, contract, addImport } = input; - - addImport("viem", { name: "getContract", isType: false }); - addImport("viem", { name: "GetContractReturnType", isType: true }); - addImport("viem", { name: "Address", isType: true }); - addImport("viem", { name: "Transport", isType: true }); - addImport("viem", { name: "PublicClient", isType: true }); - addImport("viem", { name: "Client", isType: true }); - addImport("@alchemy/aa-core", { name: "ChainNotFoundError" }); - - content.push(dedent` - getContract: ( - client: C, - address?: Address - ): GetContractReturnType => { - if (!client.chain) throw new ChainNotFoundError(); - - return getContract({ - address: address || addresses[client.chain.id], - abi: ${contract.name}Abi, - client: client, - }); - }`); - - return input; -}; diff --git a/packages/accounts/plugingen/phases/plugin-generator/index.ts b/packages/accounts/plugingen/phases/plugin-generator/index.ts deleted file mode 100644 index 2b47e22262..0000000000 --- a/packages/accounts/plugingen/phases/plugin-generator/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { asyncPipe } from "@alchemy/aa-core"; -import dedent from "dedent"; -import type { Phase } from "../../types"; -import { GetContractGenPhase } from "./get-contract-gen.js"; -import { MetaGenPhase } from "./meta-gen.js"; - -export const PluginGeneratorPhase: Phase = async (input) => { - const pluginPhases: Phase[] = [MetaGenPhase, GetContractGenPhase]; - const { contract, addImport } = input; - - const result = await asyncPipe(...pluginPhases)({ - ...input, - content: [], - }); - - addImport("../types.js", { name: "Plugin", isType: true }); - - input.content.push(dedent` - export const ${contract.name}: Plugin = { - ${result.content.join(",\n")} - }; - `); - - return input; -}; diff --git a/packages/accounts/plugingen/phases/plugin-generator/meta-gen.ts b/packages/accounts/plugingen/phases/plugin-generator/meta-gen.ts deleted file mode 100644 index 8beaead974..0000000000 --- a/packages/accounts/plugingen/phases/plugin-generator/meta-gen.ts +++ /dev/null @@ -1,17 +0,0 @@ -import dedent from "dedent"; -import type { Phase } from "../../types"; - -export const MetaGenPhase: Phase = async (input) => { - const { plugin, content } = input; - const { name, version } = await plugin.read.pluginMetadata(); - - content.push(dedent` - meta: { - name: "${name}", - version: "${version}", - addresses, - } - `); - - return input; -}; diff --git a/packages/accounts/plugingen/types.ts b/packages/accounts/plugingen/types.ts deleted file mode 100644 index ef77143288..0000000000 --- a/packages/accounts/plugingen/types.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { NoUndefined } from "@alchemy/aa-core"; -import type { Plugin } from "@wagmi/cli"; -import type { GetContractReturnType, PublicClient } from "viem"; -import type { PluginGenConfig } from "../plugindefs/types"; -import type { IPluginAbi } from "../src/msca/abis/IPlugin"; - -export type PhaseInput = { - content: string[]; - addImport: ( - moduleName: string, - member: { name: string; isType?: boolean } - ) => void; - addType: (typeName: string, typeDef: string, isPublic?: boolean) => void; - config: PluginGenConfig; - contract: Parameters>[0]["contracts"][number]; - plugin: GetContractReturnType; - hasReadMethods?: boolean; -}; - -export type Phase = (input: PhaseInput) => Promise; diff --git a/packages/accounts/src/nani-account/__tests__/account.test.ts b/packages/accounts/src/nani-account/__tests__/account.test.ts deleted file mode 100644 index 21235ba719..0000000000 --- a/packages/accounts/src/nani-account/__tests__/account.test.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { - LocalAccountSigner, - polygonMumbai, - type Address, - type Hex, - type SmartAccountSigner, -} from "@alchemy/aa-core"; -import { http } from "viem"; -import { createNaniAccount } from "../account.js"; -import { getDefaultNaniAccountFactoryAddress } from "../utils.js"; - -const chain = polygonMumbai; - -describe("Nani Account Tests", () => { - const dummyMnemonic = - "test test test test test test test test test test test test"; - const signer: SmartAccountSigner = - LocalAccountSigner.mnemonicToAccountSigner(dummyMnemonic); - - it("should correctly sign the message", async () => { - const account = await givenAccount(); - - expect( - await account.signMessage({ - message: { - raw: "0xa70d0af2ebb03a44dcd0714a8724f622e3ab876d0aa312f0ee04823285d6fb1b", - }, - }) - ).toBe( - "0x33b1b0d34ba3252cd8abac8147dc08a6e14a6319462456a34468dd5713e38dda3a43988460011af94b30fa3efefcf9d0da7d7522e06b7bd8bff3b65be4aee5b31c" - ); - }); - - it("should correctly sign typed data", async () => { - const account = await givenAccount(); - expect( - await account.signTypedData({ - types: { - Request: [{ name: "hello", type: "string" }], - }, - primaryType: "Request", - message: { - hello: "world", - }, - }) - ).toBe( - "0xda1aeed13916d5723579f26cb9116155945d3581d642c38d8e2bce9fc969014f3eb599fa375df3d6e8181c8f04db64819186ac44cf5fd2bdd90e9f8543c579461b" - ); - }); - - it("should correctly encode transferOwnership data", async () => { - const account = await givenAccount(); - expect( - account.encodeTransferOwnership( - "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef" - ) - ).toBe( - "0xf2fde38b000000000000000000000000deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" - ); - }); - - it("should correctly encode batch transaction data", async () => { - const account = await givenAccount(); - const calls = [ - { - target: "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef" as Address, - value: BigInt(0), - data: "0xdeadbeef" as Hex, - }, - { - target: "0x8ba1f109551bd432803012645ac136ddd64dba72" as Address, - value: BigInt(0), - data: "0xcafebabe" as Hex, - }, - ]; - - expect(await account.encodeBatchExecute(calls)).toMatchInlineSnapshot( - '"0x34fcd5be00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000deadbeefdeadbeefdeadbeefdeadbeefdeadbeef000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000004deadbeef000000000000000000000000000000000000000000000000000000000000000000000000000000008ba1f109551bd432803012645ac136ddd64dba72000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000004cafebabe00000000000000000000000000000000000000000000000000000000"' - ); - }); - - it("should correctly encode delegate execute data", async () => { - const account = await givenAccount(); - expect( - account.encodeExecuteDelegate( - "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef" as Address, - "0xdeadbeef" as Hex - ) - ).toMatchInlineSnapshot( - '"0xb10cc728000000000000000000000000deadbeefdeadbeefdeadbeefdeadbeefdeadbeef00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004deadbeef00000000000000000000000000000000000000000000000000000000"' - ); - }); - - it("should return the correct sender", async () => { - const account = await givenAccount(); - expect(account.address).toBe("0x903072d2112412406597eb5DCAA8CeDD71ea141c"); - }); - - const givenAccount = async () => { - return createNaniAccount({ - signer, - chain, - accountAddress: "0x903072d2112412406597eb5DCAA8CeDD71ea141c", - transport: http(`${chain.rpcUrls.alchemy.http[0]}/test`), - factoryAddress: getDefaultNaniAccountFactoryAddress(chain), - }); - }; -}); diff --git a/packages/accounts/src/nani-account/abis/NaniAccountAbi.ts b/packages/accounts/src/nani-account/abis/NaniAccountAbi.ts deleted file mode 100644 index 963307e7ac..0000000000 --- a/packages/accounts/src/nani-account/abis/NaniAccountAbi.ts +++ /dev/null @@ -1,307 +0,0 @@ -export const NaniAccountAbi = [ - { inputs: [], stateMutability: "payable", type: "constructor" }, - { inputs: [], name: "AlreadyInitialized", type: "error" }, - { inputs: [], name: "NewOwnerIsZeroAddress", type: "error" }, - { inputs: [], name: "NoHandoverRequest", type: "error" }, - { inputs: [], name: "Unauthorized", type: "error" }, - { inputs: [], name: "UnauthorizedCallContext", type: "error" }, - { inputs: [], name: "UpgradeFailed", type: "error" }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "pendingOwner", - type: "address", - }, - ], - name: "OwnershipHandoverCanceled", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "pendingOwner", - type: "address", - }, - ], - name: "OwnershipHandoverRequested", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "oldOwner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "OwnershipTransferred", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "implementation", - type: "address", - }, - ], - name: "Upgraded", - type: "event", - }, - { stateMutability: "payable", type: "fallback" }, - { - inputs: [], - name: "addDeposit", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [], - name: "cancelOwnershipHandover", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "pendingOwner", type: "address" }, - ], - name: "completeOwnershipHandover", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "delegate", type: "address" }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - name: "delegateExecute", - outputs: [{ internalType: "bytes", name: "result", type: "bytes" }], - stateMutability: "payable", - type: "function", - }, - { - inputs: [], - name: "eip712Domain", - outputs: [ - { internalType: "bytes1", name: "fields", type: "bytes1" }, - { internalType: "string", name: "name", type: "string" }, - { internalType: "string", name: "version", type: "string" }, - { internalType: "uint256", name: "chainId", type: "uint256" }, - { internalType: "address", name: "verifyingContract", type: "address" }, - { internalType: "bytes32", name: "salt", type: "bytes32" }, - { internalType: "uint256[]", name: "extensions", type: "uint256[]" }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "entryPoint", - outputs: [{ internalType: "address", name: "", type: "address" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "target", type: "address" }, - { internalType: "uint256", name: "value", type: "uint256" }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - name: "execute", - outputs: [{ internalType: "bytes", name: "result", type: "bytes" }], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { internalType: "address", name: "target", type: "address" }, - { internalType: "uint256", name: "value", type: "uint256" }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - internalType: "struct ERC4337.Call[]", - name: "calls", - type: "tuple[]", - }, - ], - name: "executeBatch", - outputs: [{ internalType: "bytes[]", name: "results", type: "bytes[]" }], - stateMutability: "payable", - type: "function", - }, - { - inputs: [], - name: "getDeposit", - outputs: [{ internalType: "uint256", name: "result", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "address", name: "newOwner", type: "address" }], - name: "initialize", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { internalType: "bytes32", name: "hash", type: "bytes32" }, - { internalType: "bytes", name: "signature", type: "bytes" }, - ], - name: "isValidSignature", - outputs: [{ internalType: "bytes4", name: "result", type: "bytes4" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "owner", - outputs: [{ internalType: "address", name: "result", type: "address" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "pendingOwner", type: "address" }, - ], - name: "ownershipHandoverExpiresAt", - outputs: [{ internalType: "uint256", name: "result", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "proxiableUUID", - outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "renounceOwnership", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [], - name: "requestOwnershipHandover", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [{ internalType: "bytes32", name: "storageSlot", type: "bytes32" }], - name: "storageLoad", - outputs: [{ internalType: "bytes32", name: "result", type: "bytes32" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "bytes32", name: "storageSlot", type: "bytes32" }, - { internalType: "bytes32", name: "storageValue", type: "bytes32" }, - ], - name: "storageStore", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [{ internalType: "address", name: "newOwner", type: "address" }], - name: "transferOwnership", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "newImplementation", type: "address" }, - ], - name: "upgradeTo", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "newImplementation", type: "address" }, - { internalType: "bytes", name: "data", type: "bytes" }, - ], - name: "upgradeToAndCall", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { internalType: "address", name: "sender", type: "address" }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { internalType: "bytes", name: "initCode", type: "bytes" }, - { internalType: "bytes", name: "callData", type: "bytes" }, - { internalType: "uint256", name: "callGasLimit", type: "uint256" }, - { - internalType: "uint256", - name: "verificationGasLimit", - type: "uint256", - }, - { - internalType: "uint256", - name: "preVerificationGas", - type: "uint256", - }, - { internalType: "uint256", name: "maxFeePerGas", type: "uint256" }, - { - internalType: "uint256", - name: "maxPriorityFeePerGas", - type: "uint256", - }, - { internalType: "bytes", name: "paymasterAndData", type: "bytes" }, - { internalType: "bytes", name: "signature", type: "bytes" }, - ], - internalType: "struct ERC4337.UserOperation", - name: "userOp", - type: "tuple", - }, - { internalType: "bytes32", name: "userOpHash", type: "bytes32" }, - { internalType: "uint256", name: "missingAccountFunds", type: "uint256" }, - ], - name: "validateUserOp", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "to", type: "address" }, - { internalType: "uint256", name: "amount", type: "uint256" }, - ], - name: "withdrawDepositTo", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { stateMutability: "payable", type: "receive" }, -] as const; diff --git a/packages/accounts/src/nani-account/abis/NaniAccountFactoryAbi.ts b/packages/accounts/src/nani-account/abis/NaniAccountFactoryAbi.ts deleted file mode 100644 index 1118ee116f..0000000000 --- a/packages/accounts/src/nani-account/abis/NaniAccountFactoryAbi.ts +++ /dev/null @@ -1,56 +0,0 @@ -export const NaniAccountFactoryAbi = [ - { - inputs: [{ internalType: "address", name: "erc4337", type: "address" }], - stateMutability: "payable", - type: "constructor", - }, - { stateMutability: "payable", type: "fallback" }, - { - inputs: [ - { internalType: "address", name: "owner", type: "address" }, - { internalType: "bytes32", name: "salt", type: "bytes32" }, - ], - name: "createAccount", - outputs: [{ internalType: "address", name: "", type: "address" }], - stateMutability: "payable", - type: "function", - }, - { - inputs: [{ internalType: "bytes4", name: "selector", type: "bytes4" }], - name: "get", - outputs: [{ internalType: "address", name: "executor", type: "address" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [{ internalType: "bytes32", name: "salt", type: "bytes32" }], - name: "getAddress", - outputs: [{ internalType: "address", name: "", type: "address" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "implementation", - outputs: [{ internalType: "address", name: "", type: "address" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "initCodeHash", - outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "bytes4", name: "selector", type: "bytes4" }, - { internalType: "address", name: "executor", type: "address" }, - ], - name: "set", - outputs: [], - stateMutability: "payable", - type: "function", - }, -] as const; diff --git a/packages/accounts/src/nani-account/account.ts b/packages/accounts/src/nani-account/account.ts deleted file mode 100644 index 421f9394aa..0000000000 --- a/packages/accounts/src/nani-account/account.ts +++ /dev/null @@ -1,270 +0,0 @@ -import { - BaseSmartContractAccount, - createBundlerClient, - getEntryPoint, - toSmartContractAccount, - type BaseSmartAccountParams, - type BatchUserOperationCallData, - type DefaultEntryPointVersion, - type SignTypedDataParams, - type SmartAccountSigner, - type SmartContractAccountWithSigner, - type ToSmartContractAccountParams, - type UserOperationCallData, -} from "@alchemy/aa-core"; -import { - concatHex, - decodeFunctionResult, - encodeFunctionData, - isHex, - numberToHex, - type Address, - type Chain, - type FallbackTransport, - type Hash, - type Hex, - type Transport, -} from "viem"; -import { NaniAccountAbi } from "./abis/NaniAccountAbi.js"; -import { NaniAccountFactoryAbi } from "./abis/NaniAccountFactoryAbi.js"; - -export type NaniSmartAccountParams< - TTransport extends Transport | FallbackTransport = Transport -> = Omit, "rpcClient"> & { - signer: SmartAccountSigner; - index?: bigint; - salt?: Hex; - transport: TTransport; - chain: Chain; -}; - -export type NaniAccount = SmartContractAccountWithSigner< - "NaniAccount", - SmartAccountSigner, - "0.6.0" -> & { - encodeExecuteDelegate: (delegate: Address, data: Hex) => Hex; - encodeTransferOwnership: (newOwner: Address) => Hex; -}; - -class NaniAccount_< - TTransport extends Transport | FallbackTransport = Transport -> extends BaseSmartContractAccount { - protected signer: SmartAccountSigner; - private readonly index: bigint; - protected salt?: Hex; - - constructor(params: NaniSmartAccountParams) { - // This is a hack for now, we should kill the SimpleSmart Account when we kill Base Account - const client = createBundlerClient({ - transport: params.transport as TTransport, - chain: params.chain, - }); - super({ ...params, rpcClient: client }); - - this.index = params.index ?? 0n; - this.signer = params.signer; - this.salt = params.salt; - } - - override async signTypedData(params: SignTypedDataParams): Promise { - return this.signer.signTypedData(params); - } - - /** - * Returns the on-chain owner address of the account. - * - * @returns the on-chain owner of the account - */ - async getOwnerAddress(): Promise
{ - const callResult = await this.rpcProvider.call({ - to: await this.getAddress(), - data: encodeFunctionData({ - abi: NaniAccountAbi, - functionName: "owner", - }), - }); - - if (callResult.data == null) { - throw new Error("could not get on-chain owner"); - } - - const decodedCallResult = decodeFunctionResult({ - abi: NaniAccountAbi, - functionName: "owner", - data: callResult.data, - }); - - if (decodedCallResult !== (await this.signer.getAddress())) { - throw new Error( - "current account signer does not match the on-chain owner" - ); - } - - return decodedCallResult; - } - - async getAddress(): Promise
{ - const callResult = await this.rpcProvider.call({ - to: this.factoryAddress, - data: encodeFunctionData({ - abi: NaniAccountFactoryAbi, - functionName: "getAddress", - args: [await this.getSalt()], - }), - }); - - if (callResult.data == null) { - throw new Error("could not get deterministic address"); - } - - const decodedCallResult = decodeFunctionResult({ - abi: NaniAccountFactoryAbi, - functionName: "getAddress", - data: callResult.data, - }); - - return decodedCallResult; - } - - getDummySignature(): Hex { - return "0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"; - } - - signMessage(msg: Uint8Array | string): Promise { - return this.signer.signMessage( - typeof msg === "string" && !isHex(msg) ? msg : { raw: msg } - ); - } - - async encodeExecute(target: Hex, value: bigint, data: Hex): Promise { - return encodeFunctionData({ - abi: NaniAccountAbi, - functionName: "execute", - args: [target, value, data], - }); - } - - override async encodeBatchExecute( - calls: BatchUserOperationCallData - ): Promise { - return encodeFunctionData({ - abi: NaniAccountAbi, - functionName: "executeBatch", - args: [ - calls.map((call: Exclude) => ({ - ...call, - value: call.value ?? 0n, - })), - ], - }); - } - - /** - * Encodes the delegateExecute function call using Nani Account ABI. - * - * @param delegate - the delegate to execute the function call - * @param data - the data to be passed to the function call - * @returns the encoded function call - */ - static encodeExecuteDelegate(delegate: Address, data: Hex): Hex { - return encodeFunctionData({ - abi: NaniAccountAbi, - functionName: "delegateExecute", - args: [delegate, data], - }); - } - - /** - * Encodes the transferOwnership function call using Nani Account ABI. - * - * @param newOwner - the new owner of the account - * @returns the encoded function call - */ - static encodeTransferOwnership(newOwner: Address): Hex { - return encodeFunctionData({ - abi: NaniAccountAbi, - functionName: "transferOwnership", - args: [newOwner], - }); - } - - override async getAccountInitCode(): Promise<`0x${string}`> { - const result = concatHex([ - this.factoryAddress, - await this.getFactoryInitCode(), - ]); - - return result; - } - - protected async getSalt(): Promise { - if (this.salt) { - if (this.salt.slice(0, 42) !== (await this.signer.getAddress())) { - throw new Error("Salt does not match the current signer address"); - } else { - return this.salt; - } - } - - return concatHex([ - await this.signer.getAddress(), - numberToHex(this.index, { size: 12 }), - ]); - } - - protected async getFactoryInitCode(): Promise { - try { - return encodeFunctionData({ - abi: NaniAccountFactoryAbi, - functionName: "createAccount", - args: [await this.signer.getAddress(), await this.getSalt()], - }); - } catch (err: any) { - throw new Error("Factory Code generation failed"); - } - } -} - -export const createNaniAccount = async ( - params: Omit, "rpcClient" | "chain"> & - Pick< - ToSmartContractAccountParams, - "chain" | "transport" - > -): Promise => { - if (!params.signer) throw new Error("Owner must be provided."); - - const naniAccount = new NaniAccount_(params); - - const base = await toSmartContractAccount({ - source: "NaniAccount", - transport: params.transport, - chain: params.chain, - accountAddress: params.accountAddress as Address | undefined, - entryPoint: getEntryPoint(params.chain, { - addressOverride: naniAccount.getEntryPointAddress(), - }), - encodeBatchExecute: naniAccount.encodeBatchExecute.bind(naniAccount), - encodeExecute: (tx) => - naniAccount.encodeExecute(tx.target, tx.value ?? 0n, tx.data), - getAccountInitCode: async () => { - if (params.initCode) return params.initCode as Hex; - return naniAccount.getAccountInitCode(); - }, - getDummySignature: naniAccount.getDummySignature.bind(naniAccount), - signMessage: ({ message }) => - naniAccount.signMessage( - typeof message === "string" ? message : message.raw - ), - // @ts-expect-error these types still represent the same thing, but they are just a little off in there definitions - signTypedData: (params) => naniAccount.signTypedData(params), - }); - - return { - ...base, - getSigner: () => naniAccount.getSigner() as SmartAccountSigner, - encodeExecuteDelegate: NaniAccount_.encodeExecuteDelegate, - encodeTransferOwnership: NaniAccount_.encodeTransferOwnership, - }; -}; diff --git a/packages/accounts/src/nani-account/schema.ts b/packages/accounts/src/nani-account/schema.ts deleted file mode 100644 index ed1f457228..0000000000 --- a/packages/accounts/src/nani-account/schema.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { SignerSchema } from "@alchemy/aa-core"; -import { Address } from "abitype/zod"; -import { isHex } from "viem"; -import { z } from "zod"; - -export const NaniAccountFactoryConfigSchema = z.object({ - signer: SignerSchema, - accountAddress: Address.optional().describe( - "Optional override for the account address." - ), - initCode: z - .string() - .refine(isHex, "initCode must be a valid hex.") - .optional() - .describe("Optional override for the account init code."), - factoryAddress: Address.optional().describe( - "Optional override for the factory address which deploys the smart account." - ), - salt: z - .string() - .refine(isHex, "salt must be a valid hex") - .refine((s) => s.length === 66, "salt must be 32 bytes") - .optional() - .describe("Optional override for the account salt."), - index: z - .bigint() - .optional() - .describe("Optional override for the account index."), -}); diff --git a/packages/accounts/src/nani-account/transferNaniAccountOwnership.ts b/packages/accounts/src/nani-account/transferNaniAccountOwnership.ts deleted file mode 100644 index ce0d2a32bd..0000000000 --- a/packages/accounts/src/nani-account/transferNaniAccountOwnership.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { - AccountNotFoundError, - IncompatibleClientError, - isSmartAccountClient, - type GetAccountParameter, - type SmartAccountSigner, -} from "@alchemy/aa-core"; -import type { Chain, Client, Hex, Transport } from "viem"; -import type { NaniAccount } from "./account"; - -/** - * Transfers ownership of the account to the newOwner on-chain and also updates the owner of the account. - * Optionally waits for the transaction to be mined. - * - * @param client - the client to use to send the transaction - * @param args - the arguments for the transfer - * @returns the userOperation hash, or transaction hash if `waitForTxn` is true - */ -export const transferOwnership: < - TTransport extends Transport = Transport, - TChain extends Chain | undefined = Chain | undefined, - TSigner extends SmartAccountSigner = SmartAccountSigner, - TAccount extends NaniAccount | undefined = NaniAccount | undefined ->( - client: Client, - args: { - newOwner: TSigner; - waitForTxn?: boolean; - } & GetAccountParameter -) => Promise = async (client, args): Promise => { - const { - newOwner, - waitForTxn = false, - account: account_ = client.account, - } = args; - if (!account_) { - throw new AccountNotFoundError(); - } - - if (!isSmartAccountClient(client)) { - throw new IncompatibleClientError( - "SmartAccountClient", - "transferOwnership", - client - ); - } - - const account = account_ as NaniAccount; - - const data = account.encodeTransferOwnership(await newOwner.getAddress()); - const result = await client.sendUserOperation({ - uo: { - target: account.address, - data, - }, - account, - }); - - if (waitForTxn) { - return client.waitForUserOperationTransaction(result); - } - - return result.hash; -}; diff --git a/packages/accounts/src/nani-account/utils.ts b/packages/accounts/src/nani-account/utils.ts deleted file mode 100644 index a361f004f6..0000000000 --- a/packages/accounts/src/nani-account/utils.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { - arbitrum, - arbitrumGoerli, - arbitrumSepolia, - base, - baseGoerli, - baseSepolia, - mainnet, - optimism, - optimismGoerli, - optimismSepolia, - polygon, - polygonAmoy, - polygonMumbai, - sepolia, -} from "@alchemy/aa-core"; -import type { Address, Chain } from "viem"; - -/** - * Utility method returning the default nani account factory address given a {@link Chain} object - * - * @param chain - a {@link Chain} object - * @returns a {@link Address} for the given chain - * @throws if the chain doesn't have an address currently deployed - */ -export const getDefaultNaniAccountFactoryAddress = (chain: Chain): Address => { - switch (chain.id) { - case mainnet.id: - case sepolia.id: - case base.id: - case baseGoerli.id: - case baseSepolia.id: - case polygon.id: - case polygonAmoy.id: - case polygonMumbai.id: - case arbitrum.id: - case arbitrumGoerli.id: - case arbitrumSepolia.id: - case optimism.id: - case optimismGoerli.id: - case optimismSepolia.id: - return "0x000000000000dD366cc2E4432bB998e41DFD47C7"; - } - throw new Error( - `no default nani account factory contract exists for ${chain.name}` - ); -}; diff --git a/packages/accounts/wagmi.config.ts b/packages/accounts/wagmi.config.ts deleted file mode 100644 index 37f3cfd780..0000000000 --- a/packages/accounts/wagmi.config.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { defineConfig } from "@wagmi/cli"; -import { kebabCase } from "change-case"; -import dotenv from "dotenv"; -import * as configs from "./plugindefs/index.js"; -import { plugingen } from "./plugingen/index.js"; -dotenv.config(); - -const pluginConfigs = Object.values(configs); -const pluginRegEx: RegExp = /[pP]lugin/g; - -export default defineConfig( - pluginConfigs.map((config) => ({ - out: `./src/msca/plugins/${kebabCase( - config.name.replaceAll(pluginRegEx, "") - )}/plugin.ts`, - contracts: [ - { - name: config.name, - abi: config.abi, - address: config.addresses, - }, - ], - plugins: [ - plugingen({ - chain: config.chain, - connectionConfig: { - rpcUrl: - config.rpcUrl || - (config.chain.rpcUrls?.default?.http.length > 0 - ? config.chain.rpcUrls.default.http[0] - : `https://${config.chain.name - .toLowerCase() - .replace("-testnet", "")}-rpc.publicnode.com`), - }, - config, - }), - ], - })) -); diff --git a/packages/alchemy/CHANGELOG.md b/packages/alchemy/CHANGELOG.md deleted file mode 100644 index eff933471b..0000000000 --- a/packages/alchemy/CHANGELOG.md +++ /dev/null @@ -1,741 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -# [3.19.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.18.2...v3.19.0) (2024-08-02) - -### Features - -- adaptive icons for light and dark UI ([#713](https://github.com/alchemyplatform/aa-sdk/issues/713)) ([61a2960](https://github.com/alchemyplatform/aa-sdk/commit/61a2960cc4209b305e9d76189b5aba26b2f67c97)) -- add passkey success state ([#711](https://github.com/alchemyplatform/aa-sdk/issues/711)) ([a99460d](https://github.com/alchemyplatform/aa-sdk/commit/a99460d65c8258dc4a32082e1f3a18b64cde36af)) -- add showBack prop and auto determine navigation ([#712](https://github.com/alchemyplatform/aa-sdk/issues/712)) ([7b1e68c](https://github.com/alchemyplatform/aa-sdk/commit/7b1e68cc464fb9dcaa07e0043ef03bec31a8b60f)) -- add updated error UI + custom error rendering ([#705](https://github.com/alchemyplatform/aa-sdk/issues/705)) ([0b23625](https://github.com/alchemyplatform/aa-sdk/commit/0b23625f33a14daacd3317d753aebb07c702740d)) -- bring the rest of the auth flow inline with the designs ([#708](https://github.com/alchemyplatform/aa-sdk/issues/708)) ([993f6e2](https://github.com/alchemyplatform/aa-sdk/commit/993f6e2c5d78ba0a8ccc3c7ca30bedc921d5a258)) -- change email validation rule ([#710](https://github.com/alchemyplatform/aa-sdk/issues/710)) ([f869f5e](https://github.com/alchemyplatform/aa-sdk/commit/f869f5efda54225177760a881ce5c3277dbec69f)) -- pull strings out to their own file for future localization ([#715](https://github.com/alchemyplatform/aa-sdk/issues/715)) ([5c0d516](https://github.com/alchemyplatform/aa-sdk/commit/5c0d5163be4cabbfe3b4479fb03345212538ff16)) -- start to bring auth modal styles inline with designs ([#702](https://github.com/alchemyplatform/aa-sdk/issues/702)) ([6e3502b](https://github.com/alchemyplatform/aa-sdk/commit/6e3502b9e73c4c4add4215927d263db8ee5000ce)) - -## [3.18.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.18.1...v3.18.2) (2024-06-05) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -## [3.18.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.18.0...v3.18.1) (2024-06-04) - -### Bug Fixes - -- fix paymaster override for multisig plugin ([#676](https://github.com/alchemyplatform/aa-sdk/issues/676)) ([6db5bfc](https://github.com/alchemyplatform/aa-sdk/commit/6db5bfc7d9003417354df36728323752542d7723)) -- update the version of the store so that we don't have clashes ([#703](https://github.com/alchemyplatform/aa-sdk/issues/703)) ([dc87b2f](https://github.com/alchemyplatform/aa-sdk/commit/dc87b2f313dc8bec806b7301acce4dd07e260903)) - -# [3.18.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.17.2...v3.18.0) (2024-06-04) - -### Bug Fixes - -- account hydration was missing state ([#693](https://github.com/alchemyplatform/aa-sdk/issues/693)) ([9576eab](https://github.com/alchemyplatform/aa-sdk/commit/9576eabd0ec4d9b9e75a249b295f5f2791c90555)) - -### Features - -- run store hydration on window focus ([#695](https://github.com/alchemyplatform/aa-sdk/issues/695)) ([79abf2f](https://github.com/alchemyplatform/aa-sdk/commit/79abf2fc09cc1ac28aa85b0e90295e1a37cbf15f)) -- update button colors ([#696](https://github.com/alchemyplatform/aa-sdk/issues/696)) ([f07adbc](https://github.com/alchemyplatform/aa-sdk/commit/f07adbc92eb1c1f6a6d0f4f22ea483f1b978a326)) - -## [3.17.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.17.1...v3.17.2) (2024-05-31) - -### Reverts - -- undo vocs deploy ([#690](https://github.com/alchemyplatform/aa-sdk/issues/690)) ([c7cb350](https://github.com/alchemyplatform/aa-sdk/commit/c7cb350f9786fe10d03c62d61a8d2c9f21d4cdc0)) - -## [3.17.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.17.0...v3.17.1) (2024-05-31) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [3.17.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.16.2...v3.17.0) (2024-05-29) - -### Bug Fixes - -- **createAccount:** possible uncaught undefined ([e275f5f](https://github.com/alchemyplatform/aa-sdk/commit/e275f5f5edc313ff88aa46a2336fc8cfaab6ca65)) -- export the \*web client and signer in aa-alchemy ([0777b97](https://github.com/alchemyplatform/aa-sdk/commit/0777b97b9a2620be02fffe92e3e46fe6162bae49)) - -## [3.16.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.16.1...v3.16.2) (2024-05-26) - -### Bug Fixes - -- **hydrate:** unhandled undefined case in hydrating account state ([175eaee](https://github.com/alchemyplatform/aa-sdk/commit/175eaee8575b1a0c23c5499f03f883ded64efed6)) - -## [3.16.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.16.0...v3.16.1) (2024-05-23) - -### Bug Fixes - -- **alchemy-signer:** fix the sign tx method to return the full tx ([#678](https://github.com/alchemyplatform/aa-sdk/issues/678)) ([86e3c99](https://github.com/alchemyplatform/aa-sdk/commit/86e3c99260a21cd5339d586643be60e3dafefabe)) - -# [3.16.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.15.0...v3.16.0) (2024-05-22) - -### Features - -- add EOA support ([#667](https://github.com/alchemyplatform/aa-sdk/issues/667)) ([bc1582a](https://github.com/alchemyplatform/aa-sdk/commit/bc1582afc4aa3cd411573a73ef2a9be6ee0ff247)) - -# [3.15.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.14.1...v3.15.0) (2024-05-20) - -### Bug Fixes - -- account state was not syncing across chain changes ([#672](https://github.com/alchemyplatform/aa-sdk/issues/672)) ([c4e47d5](https://github.com/alchemyplatform/aa-sdk/commit/c4e47d5d97d26c4bfb5922a45181f4138eb9dc9c)) - -### Features - -- allow setting gas manager config in the config ([#670](https://github.com/alchemyplatform/aa-sdk/issues/670)) ([38dfa25](https://github.com/alchemyplatform/aa-sdk/commit/38dfa2578e1dccdedca5295b2c2871bafa1aef7c)) - -## [3.14.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.14.0...v3.14.1) (2024-05-17) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [3.14.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.13.1...v3.14.0) (2024-05-17) - -### Bug Fixes - -- **aa-alchemy/config:** export missing actions ([175dc20](https://github.com/alchemyplatform/aa-sdk/commit/175dc200404373686f1654ff72404edd04c31cbd)) - -### Features - -- add multi-chain support to account configs ([#666](https://github.com/alchemyplatform/aa-sdk/issues/666)) ([60994e9](https://github.com/alchemyplatform/aa-sdk/commit/60994e983a93bff97400a565dd755a2e8dab2655)) - -## [3.13.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.13.0...v3.13.1) (2024-05-14) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [3.13.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.12.4...v3.13.0) (2024-05-10) - -### Features - -- add email loading state to the modal ([8d0d244](https://github.com/alchemyplatform/aa-sdk/commit/8d0d24408652cbc48ea4cd44ed0c98c1cb68d2f8)) -- add passkey loading state ([b56fe8d](https://github.com/alchemyplatform/aa-sdk/commit/b56fe8d240e58392b15f6a58d79fe580f8118772)) -- add support for adding a passkey on signup ([ab6bad3](https://github.com/alchemyplatform/aa-sdk/commit/ab6bad3a24bd8736e1fbe15881f4b156492b2dae)) -- **ui:** start adding use authenticate calls to the modal ([c2ef8eb](https://github.com/alchemyplatform/aa-sdk/commit/c2ef8ebf437226c41e05bc310b9a7b39459c94c1)) - -## [3.12.4](https://github.com/alchemyplatform/aa-sdk/compare/v3.12.3...v3.12.4) (2024-05-10) - -### Bug Fixes - -- alchemy paymaster 0x override was not awaiting gas estimates ([#660](https://github.com/alchemyplatform/aa-sdk/issues/660)) ([51d31ff](https://github.com/alchemyplatform/aa-sdk/commit/51d31fff352472ea3f2564f87620d217f9bb2b85)) - -## [3.12.3](https://github.com/alchemyplatform/aa-sdk/compare/v3.12.2...v3.12.3) (2024-05-10) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -## [3.12.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.12.1...v3.12.2) (2024-05-09) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -## [3.12.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.12.0...v3.12.1) (2024-05-07) - -### Bug Fixes - -- **alchemy:** remove typescript-cookie because its not cjs compatible ([#652](https://github.com/alchemyplatform/aa-sdk/issues/652)) ([21eeb63](https://github.com/alchemyplatform/aa-sdk/commit/21eeb6373bd11b7bf149ae12dce3c045abefd8e3)) -- replace fraxTestnet with fraxSepolia ([#642](https://github.com/alchemyplatform/aa-sdk/issues/642)) ([320a15d](https://github.com/alchemyplatform/aa-sdk/commit/320a15d049e9ad6125e9e4102a3fc1ebe8f0dd55)) - -# [3.12.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.11.1...v3.12.0) (2024-05-02) - -### Features - -- add form input stylings ([76e961a](https://github.com/alchemyplatform/aa-sdk/commit/76e961af5f90db2c3c502d244ab16b007d4e0542)) -- prototype the auth modal hook ([#638](https://github.com/alchemyplatform/aa-sdk/issues/638)) ([ebed224](https://github.com/alchemyplatform/aa-sdk/commit/ebed22421c352e0be20f9c28e6aa77abb6ee1e98)) -- start adding the ui component engine ([7368385](https://github.com/alchemyplatform/aa-sdk/commit/736838540b9cd6b5a05c1ee3934e08dc5f7f6fb7)) - -## [3.11.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.11.0...v3.11.1) (2024-04-30) - -### Bug Fixes - -- make multisig e2e tests pass ([#615](https://github.com/alchemyplatform/aa-sdk/issues/615)) ([08cf8d8](https://github.com/alchemyplatform/aa-sdk/commit/08cf8d81b3afd7b06c51a3b9fe6a0ee5a0a91d44)) - -# [3.11.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.10.0...v3.11.0) (2024-04-30) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [3.10.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.9.0...v3.10.0) (2024-04-29) - -### Features - -- add frax and zora defaults ([#613](https://github.com/alchemyplatform/aa-sdk/issues/613)) ([4950a1d](https://github.com/alchemyplatform/aa-sdk/commit/4950a1df170abcae5a3cc5a32acdb972890d7810)) -- estimate user operation gas smart account client action and how to guide ([#603](https://github.com/alchemyplatform/aa-sdk/issues/603)) ([522a038](https://github.com/alchemyplatform/aa-sdk/commit/522a03864ea0e3f8f1e34b6900c3ca0241b534e8)) -- handle one off bypassing paymaster and data middleware case ([#606](https://github.com/alchemyplatform/aa-sdk/issues/606)) ([b5d8110](https://github.com/alchemyplatform/aa-sdk/commit/b5d8110f629937068d27e059ec89dfaa31ce9dd5)) -- make create light account and multi owner light account to be strong type inferred ([#608](https://github.com/alchemyplatform/aa-sdk/issues/608)) ([f2dd460](https://github.com/alchemyplatform/aa-sdk/commit/f2dd460ca937065dac05fd7d64e8f31c1f8d1a74)) -- remove generic entry point version specification requirement for better devex ([#607](https://github.com/alchemyplatform/aa-sdk/issues/607)) ([f3fb619](https://github.com/alchemyplatform/aa-sdk/commit/f3fb619e3cfb2c3a957a259788ae6ab1c530f3d5)) - -# [3.9.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.9.0-alpha.4...v3.9.0) (2024-04-24) - -### Features - -- add a useClientActions hook ([#571](https://github.com/alchemyplatform/aa-sdk/issues/571)) ([42692e4](https://github.com/alchemyplatform/aa-sdk/commit/42692e4b7c7b5486f8c230157fdb0fc98370a389)) - -# [3.9.0-alpha.4](https://github.com/alchemyplatform/aa-sdk/compare/v3.9.0-alpha.3...v3.9.0-alpha.4) (2024-04-19) - -### Features - -- add js docs to account provider ([#602](https://github.com/alchemyplatform/aa-sdk/issues/602)) ([2853f5e](https://github.com/alchemyplatform/aa-sdk/commit/2853f5e34eb5d4dab7525b452ddb5af8e020cd46)) - -# [3.9.0-alpha.3](https://github.com/alchemyplatform/aa-sdk/compare/v3.9.0-alpha.2...v3.9.0-alpha.3) (2024-04-19) - -### Features - -- add js docs to account provider undefined error ([#601](https://github.com/alchemyplatform/aa-sdk/issues/601)) ([3eb191e](https://github.com/alchemyplatform/aa-sdk/commit/3eb191e7634632b641804afb6e264361c3f664cb)) - -# [3.9.0-alpha.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.9.0-alpha.1...v3.9.0-alpha.2) (2024-04-19) - -### Features - -- add js docs to client undefined error ([#600](https://github.com/alchemyplatform/aa-sdk/issues/600)) ([7eabe78](https://github.com/alchemyplatform/aa-sdk/commit/7eabe7843acfa3e10d20bb362082a6d159df9747)) - -# [3.9.0-alpha.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.9.0-alpha.0...v3.9.0-alpha.1) (2024-04-19) - -### Features - -- add js docs to types ([#599](https://github.com/alchemyplatform/aa-sdk/issues/599)) ([c781e81](https://github.com/alchemyplatform/aa-sdk/commit/c781e811e5d0347953ca0a2d7511fc46747e473b)) - -# [3.9.0-alpha.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.8.2-alpha.1...v3.9.0-alpha.0) (2024-04-19) - -### Features - -- add sendTransaction and sendTransactions hooks ([#589](https://github.com/alchemyplatform/aa-sdk/issues/589)) ([184bfa0](https://github.com/alchemyplatform/aa-sdk/commit/184bfa0b8efb20ae95fe751694f35ca88b899cdd)) -- add useExportAccount hook ([#567](https://github.com/alchemyplatform/aa-sdk/issues/567)) ([50770d8](https://github.com/alchemyplatform/aa-sdk/commit/50770d89e88f58709c0de0e4cbd5854482b19359)) -- add useLogout hook ([#566](https://github.com/alchemyplatform/aa-sdk/issues/566)) ([a64cf7f](https://github.com/alchemyplatform/aa-sdk/commit/a64cf7f5fa603f0c55792f61af9ef4f992200a54)) -- add useSendUserOperation and useDropAndReplaceUserOperation hooks ([#581](https://github.com/alchemyplatform/aa-sdk/issues/581)) ([877785d](https://github.com/alchemyplatform/aa-sdk/commit/877785d0bebe5a383045ffab84a498c116d9fbcd)) -- add useSignMessage and useSignTypedData hooks ([#568](https://github.com/alchemyplatform/aa-sdk/issues/568)) ([de5262c](https://github.com/alchemyplatform/aa-sdk/commit/de5262c585260925adfa08e21d008fa8011284a9)) -- add useWaitForUserOperationTransaction hook ([#582](https://github.com/alchemyplatform/aa-sdk/issues/582)) ([176548f](https://github.com/alchemyplatform/aa-sdk/commit/176548f4ae712c7e6d0173c12fc436994ffedb95)) -- update useAuthenticate and useAccount to include mutation args ([#592](https://github.com/alchemyplatform/aa-sdk/issues/592)) ([1508d7d](https://github.com/alchemyplatform/aa-sdk/commit/1508d7dc184600cbd6683fff0d48cd4abdb13839)) - -## [3.8.2-alpha.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.8.1...v3.8.2-alpha.1) (2024-04-18) - -### Features - -- add useAddPasskey hook ([#565](https://github.com/alchemyplatform/aa-sdk/issues/565)) ([27b3bde](https://github.com/alchemyplatform/aa-sdk/commit/27b3bde8b9593055f213f15fbefe07e3a010bd60)) -- **entrypoint-0.7:** base - all changes in regards to the EntryPoint v6 & v7 support ([#514](https://github.com/alchemyplatform/aa-sdk/issues/514)) ([6cc692e](https://github.com/alchemyplatform/aa-sdk/commit/6cc692edf2ac20adf310b7a0efd99879b6e6f485)), closes [#549](https://github.com/alchemyplatform/aa-sdk/issues/549) -- light account v2 entrypoint v7 and multi owner update ([#548](https://github.com/alchemyplatform/aa-sdk/issues/548)) ([5f2f5c9](https://github.com/alchemyplatform/aa-sdk/commit/5f2f5c963ecdeb8c7efadb6eda2f2e9e6187f636)) -- paymaster middleware update per entrypoint v7 user operation ([#580](https://github.com/alchemyplatform/aa-sdk/issues/580)) ([399479a](https://github.com/alchemyplatform/aa-sdk/commit/399479a38d6eaf0ab6d4d46b38f9d0f5a773cbed)) - -## [3.8.2-alpha.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.8.1...v3.8.2-alpha.0) (2024-04-17) - -### Features - -- **entrypoint-0.7:** base - all changes in regards to the EntryPoint v6 & v7 support ([#514](https://github.com/alchemyplatform/aa-sdk/issues/514)) ([6cc692e](https://github.com/alchemyplatform/aa-sdk/commit/6cc692edf2ac20adf310b7a0efd99879b6e6f485)), closes [#549](https://github.com/alchemyplatform/aa-sdk/issues/549) -- light account v2 entrypoint v7 and multi owner update ([#548](https://github.com/alchemyplatform/aa-sdk/issues/548)) ([5f2f5c9](https://github.com/alchemyplatform/aa-sdk/commit/5f2f5c963ecdeb8c7efadb6eda2f2e9e6187f636)) -- paymaster middleware update per entrypoint v7 user operation ([1709533](https://github.com/alchemyplatform/aa-sdk/commit/1709533ba9cd227e2c3c7c9cb848f921bde353f4)) - -## [3.8.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.8.0...v3.8.1) (2024-04-11) - -### Bug Fixes - -- add the signer header when using aa-alchemy ([#563](https://github.com/alchemyplatform/aa-sdk/issues/563)) ([7cfeaa6](https://github.com/alchemyplatform/aa-sdk/commit/7cfeaa6f093f929f59f1055fc16e07840bf487a0)) -- **alchemy:** fix the gas manager middleware to leave fees and gas unset ([#572](https://github.com/alchemyplatform/aa-sdk/issues/572)) ([463e481](https://github.com/alchemyplatform/aa-sdk/commit/463e48140d385962b2ba0795795600cd657da62c)) - -# [3.8.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.7.3...v3.8.0) (2024-04-10) - -### Features - -- add alchemy accounts context ([#539](https://github.com/alchemyplatform/aa-sdk/issues/539)) ([f92469e](https://github.com/alchemyplatform/aa-sdk/commit/f92469ee3f1a5bc3e9f8fe72d6067de1f28e24dd)), closes [#561](https://github.com/alchemyplatform/aa-sdk/issues/561) -- **alchemy-signer:** emit events from the alchemy signer on state changes ([#523](https://github.com/alchemyplatform/aa-sdk/issues/523)) ([8880e6d](https://github.com/alchemyplatform/aa-sdk/commit/8880e6d5bb9c98524c726a841fab5019bd6f0049)) -- **multi-sig:** add multisig plugin ([#519](https://github.com/alchemyplatform/aa-sdk/issues/519)) ([0139ef6](https://github.com/alchemyplatform/aa-sdk/commit/0139ef6de9b593dbe239675485a531122da254c4)), closes [#536](https://github.com/alchemyplatform/aa-sdk/issues/536) - -## [3.7.3](https://github.com/alchemyplatform/aa-sdk/compare/v3.7.2...v3.7.3) (2024-03-28) - -### Bug Fixes - -- **alchemy-signer:** fix the passkey creation flow ([#534](https://github.com/alchemyplatform/aa-sdk/issues/534)) ([ef50ac4](https://github.com/alchemyplatform/aa-sdk/commit/ef50ac4def125270a99d73402d6f8903dbbf97d6)) - -## [3.7.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.7.1...v3.7.2) (2024-03-27) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -## [3.7.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.7.0...v3.7.1) (2024-03-27) - -### Bug Fixes - -- dummy paymaster and data addresses updates ([#532](https://github.com/alchemyplatform/aa-sdk/issues/532)) ([baab7bd](https://github.com/alchemyplatform/aa-sdk/commit/baab7bd7500157af744fe1c581ac12cbe2e0d8b2)) - -# [3.7.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.6.1...v3.7.0) (2024-03-27) - -### Features - -- update dummy paymaster and data ([#531](https://github.com/alchemyplatform/aa-sdk/issues/531)) ([956873b](https://github.com/alchemyplatform/aa-sdk/commit/956873b768afa63747aacfb6252e5ac3b4655f65)) - -## [3.6.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.6.0...v3.6.1) (2024-03-18) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [3.6.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.5.1...v3.6.0) (2024-03-18) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -## [3.5.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.5.0...v3.5.1) (2024-03-14) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [3.5.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.4.4...v3.5.0) (2024-03-14) - -### Bug Fixes - -- **alchemy-signer:** check if process is defined before reading env vars ([#508](https://github.com/alchemyplatform/aa-sdk/issues/508)) ([bce8123](https://github.com/alchemyplatform/aa-sdk/commit/bce81239457c05bf1ee3560513bf6c140167ad04)) - -### Features - -- **plugins:** make plugingen a cli tool ([#507](https://github.com/alchemyplatform/aa-sdk/issues/507)) ([53ba81d](https://github.com/alchemyplatform/aa-sdk/commit/53ba81d33422bb3f18134c1dd75e68d64f5cc3f0)) - -## [3.4.4](https://github.com/alchemyplatform/aa-sdk/compare/v3.4.3...v3.4.4) (2024-03-12) - -### Bug Fixes - -- **alchemy-signer:** set the user during passkey account creation ([#503](https://github.com/alchemyplatform/aa-sdk/issues/503)) ([a6669c6](https://github.com/alchemyplatform/aa-sdk/commit/a6669c6f35ba04fa1d2d33b79f74ab24af74804c)) - -## [3.4.3](https://github.com/alchemyplatform/aa-sdk/compare/v3.4.2...v3.4.3) (2024-03-11) - -### Bug Fixes - -- **alchemy-signer:** allow for org id to be passed with bundle ([#501](https://github.com/alchemyplatform/aa-sdk/issues/501)) ([8c06f4f](https://github.com/alchemyplatform/aa-sdk/commit/8c06f4f42c312e2e14d9854f536b1badf787abe2)) - -## [3.4.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.4.1...v3.4.2) (2024-03-08) - -### Bug Fixes - -- **alchemy-signer:** persist temporary session state to localstorage always ([#500](https://github.com/alchemyplatform/aa-sdk/issues/500)) ([fe84685](https://github.com/alchemyplatform/aa-sdk/commit/fe846858da955fa2c316283aabff31aa0d2c2525)) - -## [3.4.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.4.0...v3.4.1) (2024-03-02) - -### Bug Fixes - -- allow rpid override in signer ([9dd7818](https://github.com/alchemyplatform/aa-sdk/commit/9dd781887f814a318f4ddabceedefd1298648918)) - -# [3.4.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.3.0...v3.4.0) (2024-02-29) - -### Bug Fixes - -- **alchemy-signer:** undo a whoami change ([#495](https://github.com/alchemyplatform/aa-sdk/issues/495)) ([c88a965](https://github.com/alchemyplatform/aa-sdk/commit/c88a965e4a21816450b5baaa5820fa2389ed9199)) - -# [3.3.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.2.1...v3.3.0) (2024-02-29) - -### Features - -- **alchemy-signer:** migrate the alchemy signer to use bundle from QP ([#492](https://github.com/alchemyplatform/aa-sdk/issues/492)) ([cd6f491](https://github.com/alchemyplatform/aa-sdk/commit/cd6f491ffb66de3924024420e76e5350f831497c)) - -## [3.2.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.2.0...v3.2.1) (2024-02-27) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [3.2.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.1.2...v3.2.0) (2024-02-26) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -## [3.1.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.1.1...v3.1.2) (2024-02-26) - -### Bug Fixes - -- **alchemy-signer:** missing transports on iOS during passkey creation ([#488](https://github.com/alchemyplatform/aa-sdk/issues/488)) ([740946f](https://github.com/alchemyplatform/aa-sdk/commit/740946f14f5a67b986e136269c564f79811f5d23)) - -## [3.1.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.1.0...v3.1.1) (2024-02-23) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [3.1.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.1...v3.1.0) (2024-02-23) - -### Bug Fixes - -- tx signing needs to happen over hash of RLP ([#481](https://github.com/alchemyplatform/aa-sdk/issues/481)) ([e3d7371](https://github.com/alchemyplatform/aa-sdk/commit/e3d737175abab6f4ccb16e4e22e0ec4f58c4e736)) - -### Features - -- support using AlchemySigner as EOA ([#467](https://github.com/alchemyplatform/aa-sdk/issues/467)) ([b620671](https://github.com/alchemyplatform/aa-sdk/commit/b6206717afb51267a406a6d2fd48af5593888fdf)) - -## [3.0.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0...v3.0.1) (2024-02-21) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [3.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.13...v3.0.0) (2024-02-21) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [3.0.0-alpha.13](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.12...v3.0.0-alpha.13) (2024-02-16) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [3.0.0-alpha.10](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.9...v3.0.0-alpha.10) (2024-02-14) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [3.0.0-alpha.9](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.8...v3.0.0-alpha.9) (2024-02-13) - -### Features - -- **amoy:** add amoy from viem update ([#448](https://github.com/alchemyplatform/aa-sdk/issues/448)) ([adae84a](https://github.com/alchemyplatform/aa-sdk/commit/adae84add30536676725dbc8805f3436c8ad395e)) - -# [3.0.0-alpha.8](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.7...v3.0.0-alpha.8) (2024-02-11) - -### Features - -- add alchemy signer to aa-alchemy ([#441](https://github.com/alchemyplatform/aa-sdk/issues/441)) ([d8b17a7](https://github.com/alchemyplatform/aa-sdk/commit/d8b17a7df54b93c5e79c2034afa99e0bb9c6b637)) - -# [3.0.0-alpha.6](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.5...v3.0.0-alpha.6) (2024-02-08) - -### Bug Fixes - -- gasmanager config was being ignored when creating alchemy clients ([25c770f](https://github.com/alchemyplatform/aa-sdk/commit/25c770f5e3d45e9986235d7d7dcc43d8e3610580)) -- incorrect entrypoint call ([6e14338](https://github.com/alchemyplatform/aa-sdk/commit/6e143388f68019d5806065fb410927e256bb0259)) - -### Features - -- export the create alchemy client from existing method ([d1c82f8](https://github.com/alchemyplatform/aa-sdk/commit/d1c82f8a1f529f3d098b00fa8b894164eddb665e)) - -# [3.0.0-alpha.5](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.4...v3.0.0-alpha.5) (2024-02-07) - -### Bug Fixes - -- **aa-core:** add back eip-1193 method handling to the client ([#425](https://github.com/alchemyplatform/aa-sdk/issues/425)) ([48b5943](https://github.com/alchemyplatform/aa-sdk/commit/48b594375d64fe832cfb06f1fb3a539da3c7b965)) - -# [3.0.0-alpha.4](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.3...v3.0.0-alpha.4) (2024-02-02) - -### Bug Fixes - -- **aa-alchemy:** fix a test that was dependent on the current version ([d4e4a8f](https://github.com/alchemyplatform/aa-sdk/commit/d4e4a8f339f44c552913d4a64a29af85de7da430)) -- alchemy package.json was incorrectly pointing to files ([#423](https://github.com/alchemyplatform/aa-sdk/issues/423)) ([5678def](https://github.com/alchemyplatform/aa-sdk/commit/5678defe4885f1b15724e0208a5813deea07ffa4)) - -# [3.0.0-alpha.3](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.2...v3.0.0-alpha.3) (2024-02-02) - -### Features - -- **aa-alchemy:** add a modular account client function ([323f49e](https://github.com/alchemyplatform/aa-sdk/commit/323f49ecad4fb33991748f168f4ec8da2746ebce)) - -# [3.0.0-alpha.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.1...v3.0.0-alpha.2) (2024-02-01) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [3.0.0-alpha.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.0...v3.0.0-alpha.1) (2024-01-31) - -### Bug Fixes - -- decorators should now correctly respect account hoisting ([86d884e](https://github.com/alchemyplatform/aa-sdk/commit/86d884ed6209d89c688dc4281400f7304b210caa)) - -# [3.0.0-alpha.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.3.1...v3.0.0-alpha.0) (2024-01-30) - -### Bug Fixes - -- add back the alchemy enhanced api actions to alchemy client ([75d1741](https://github.com/alchemyplatform/aa-sdk/commit/75d17411702a0bd8dbae17395af30f19875affb8)) - -### Code Refactoring - -- **aa-alchemy:** migrate aa-alchemy to new viem interfaces ([bf7b49d](https://github.com/alchemyplatform/aa-sdk/commit/bf7b49d631c4d8aaf19a61e98794abd89d87b8e9)) -- **aa-ethers:** refactor aa-ethers to use the viem client and accounts ([6cc2051](https://github.com/alchemyplatform/aa-sdk/commit/6cc20518bf90788f83ac3c9e579b0f4f4de518b1)) - -- refactor(aa-accounts)!: migrate aa-accounts to viem approach ([37a5b48](https://github.com/alchemyplatform/aa-sdk/commit/37a5b489bdd2527dca311787d5585f1dc3a5f05b)) - -### Features - -- hoist account signing methods ([5bcfac8](https://github.com/alchemyplatform/aa-sdk/commit/5bcfac8ddaca6b712d473cbad2cbbd0228827af5)) - -### BREAKING CHANGES - -- **aa-ethers:** aa-ethers has had some functionality removed and apis changed - -* inputs to the ProviderAdapter now require a SmartAccountClient -* with\* methods have been removed, middleware config now exists - on the SmartAccountClient -* the Account Signer has been updated to take a SmartContractAccount - as input - -- all interfaces now use the new smart account - client and smart account models that match viem more closely -- **aa-alchemy:** all of aa-alchemy now uses viem interfaces in aa-core - -# [2.4.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.3.1...v2.4.0) (2024-01-26) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -## [2.3.1](https://github.com/alchemyplatform/aa-sdk/compare/v2.3.0...v2.3.1) (2024-01-25) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [2.3.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.2.1...v2.3.0) (2024-01-24) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -## [2.2.1](https://github.com/alchemyplatform/aa-sdk/compare/v2.2.0...v2.2.1) (2024-01-23) - -### Bug Fixes - -- fix a couple of the package.jsons ([#374](https://github.com/alchemyplatform/aa-sdk/issues/374)) ([7abbd93](https://github.com/alchemyplatform/aa-sdk/commit/7abbd9366b9ba12377349e475025aa5edfd73255)) - -# [2.2.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.1.0...v2.2.0) (2024-01-22) - -### Features - -- add usePluginHook to demo app ([#357](https://github.com/alchemyplatform/aa-sdk/issues/357)) ([036b13b](https://github.com/alchemyplatform/aa-sdk/commit/036b13b250b1b3465dee000a6d5036ca060c2bb4)) - -# [2.1.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.0.1...v2.1.0) (2024-01-12) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -## [2.0.1](https://github.com/alchemyplatform/aa-sdk/compare/v2.0.0...v2.0.1) (2024-01-12) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [2.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v1.2.4...v2.0.0) (2024-01-12) - -- feat!: update the LightAccount logic for 1271 signatures to match the on-chain impl ([bbe5060](https://github.com/alchemyplatform/aa-sdk/commit/bbe5060c01828e07d7f788485b14c04dacc6cb6f)) - -### Features - -- add upgrade functionality for light account to msca ([#298](https://github.com/alchemyplatform/aa-sdk/issues/298)) ([18f51d9](https://github.com/alchemyplatform/aa-sdk/commit/18f51d9f626b48390a54d88b7ac28c1f162e04f8)) -- update zod to allow custom viem chains in core ([#348](https://github.com/alchemyplatform/aa-sdk/issues/348)) ([291f73f](https://github.com/alchemyplatform/aa-sdk/commit/291f73f50e2e6fa382d269b8568b6255bcad4b0c)) - -### BREAKING CHANGES - -- default LightAccountFactory address has changed - -## 1.2.4 (2024-01-08) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -## 1.2.3 (2023-12-22) - -### Features - -- add stringToIndex util function for SmartAccount salt ([#329](https://github.com/alchemyplatform/aa-sdk/issues/329)) ([b34ef9a](https://github.com/alchemyplatform/aa-sdk/commit/b34ef9aa6727986e89a1461dec45955cac9d4365)) -- add prefix for aa-signers signer type ([#325](https://github.com/alchemyplatform/aa-sdk/issues/325)) ([f3b8cc1](https://github.com/alchemyplatform/aa-sdk/commit/f3b8cc1f0553bad51e4f95c3fd80f6aa0199cff2)) -- add terms page to glossary ([#336](https://github.com/alchemyplatform/aa-sdk/issues/336)) ([63b24ec](https://github.com/alchemyplatform/aa-sdk/commit/63b24ecdb3e5e656c173a1523a3e09478d4c074d)) -- add faq page to docs ([#335](https://github.com/alchemyplatform/aa-sdk/issues/335)) ([63092ce](https://github.com/alchemyplatform/aa-sdk/commit/63092ceb45341d422bd3f8c13ebcc539d9cc5001)) -- add aa-signer implementation for lit protocol ([#312](https://github.com/alchemyplatform/aa-sdk/issues/312)) ([b0f8dd5](https://github.com/alchemyplatform/aa-sdk/commit/b0f8dd538728f8a7dd4447da8c88a50179d61f95)) -- add aa-signer implementation for arcana auth ([#319](https://github.com/alchemyplatform/aa-sdk/issues/319)) ([c82dbf7](https://github.com/alchemyplatform/aa-sdk/commit/c82dbf7ad76791e81525740dfe8820bd234c2863)) -- add types to glossary ([#338](https://github.com/alchemyplatform/aa-sdk/issues/338)) ([28ad2b0](https://github.com/alchemyplatform/aa-sdk/commit/28ad2b015e5d0191f77cbdeeb3c071b7ec813fde)) - -## 1.2.2 (2023-12-13) - -### Bug Fixes - -- fix the named export for web3auth ([#330](https://github.com/alchemyplatform/aa-sdk/issues/330)) ([b340f11](https://github.com/alchemyplatform/aa-sdk/commit/b340f115e96ab068f70f8b5ff8316f4724b3ab6d)) - -## 1.2.1 (2023-12-12) - -### Features - -- allow passing raw call data to sendUserOperation ([#272](https://github.com/alchemyplatform/aa-sdk/issues/272) ([26b90b6](https://github.com/alchemyplatform/aa-sdk/commit/26b90b63a998b106130f3c671bb77f977becb45d))) -- add aa-signers package ([#228](https://github.com/alchemyplatform/aa-sdk/issues/228)) ([5fcd322](https://github.com/alchemyplatform/aa-sdk/commit/5fcd3222133205e5b3f86b456309584d848b1fb5)) -- add aa-signer implementation for magic ([#229](https://github.com/alchemyplatform/aa-sdk/issues/229)) ([860d177](https://github.com/alchemyplatform/aa-sdk/commit/860d17778f6ffc6140d07f2fce147eb8993ee985)) -- add aa-signer implementation for web3auth ([#247](https://github.com/alchemyplatform/aa-sdk/issues/247)) ([7d0492b](https://github.com/alchemyplatform/aa-sdk/commit/7d0492b3829b07d18c1488b7d7e0b129e40f7b4c)) -- add aa-signer implementation for turnkey ([#307](https://github.com/alchemyplatform/aa-sdk/issues/307)) ([4fa05e4](https://github.com/alchemyplatform/aa-sdk/commit/4fa05e4ada8c6558e3ce0bd35b157110baba47c9)) -- add aa-signer implementation for fireblocks ([#301](https://github.com/alchemyplatform/aa-sdk/issues/301)) ([40289e6](https://github.com/alchemyplatform/aa-sdk/commit/40289e6c656344ab0cd6c60e6dbc7c11d392d27e)) -- add aa-signer implementation for particle ([#304](https://github.com/alchemyplatform/aa-sdk/issues/304)) ([e049c2c](https://github.com/alchemyplatform/aa-sdk/commit/e049c2caa562089f62614549ac4e7b2c741f93fd)) -- add aa-signer implementation for portal ([#303](https://github.com/alchemyplatform/aa-sdk/issues/303)) ([eb8a0c3](https://github.com/alchemyplatform/aa-sdk/commit/eb8a0c356ba89701d9cc34921cf7812c23791655)) -- add aa-signer implementation for capsule ([#305](https://github.com/alchemyplatform/aa-sdk/issues/305)) ([9d89e99](https://github.com/alchemyplatform/aa-sdk/commit/9d89e99aea12fc4c13f5b4a680167d5687829bfe)) -- add improvements on provider for override user operation fee and gas ([#277](https://github.com/alchemyplatform/aa-sdk/issues/277)) ([258d80e](https://github.com/alchemyplatform/aa-sdk/commit/258d80e64d7aaa7de26f72375b9d58221c95311e)) -- support one-off percentage overrides for user operations ([#289](https://github.com/alchemyplatform/aa-sdk/issues/289)) ([dc979ff](https://github.com/alchemyplatform/aa-sdk/commit/dc979ff111f0a490b08adce9a913466706399afb)) -- add a convenience method to make creating an alchemy provider easier ([#206](https://github.com/alchemyplatform/aa-sdk/issues/206)) ([211b7e0](https://github.com/alchemyplatform/aa-sdk/commit/211b7e0e715b961520dc5baaa4f0d49b647fbd79)) -- add nani smart account implementation ([#306](https://github.com/alchemyplatform/aa-sdk/issues/306)) ([bf7566f](https://github.com/alchemyplatform/aa-sdk/commit/bf7566f2d62ab7ca4ee7fcb4a9df68308fbe5622)) -- improve zod validation parsing ([#299](https://github.com/alchemyplatform/aa-sdk/issues/299)) ([0763a82](https://github.com/alchemyplatform/aa-sdk/commit/0763a82d47f491513bdcf75716c83043f3dbd2be)) -- docs site re-formatting ([#300](https://github.com/alchemyplatform/aa-sdk/issues/300)) ([a1376c4](https://github.com/alchemyplatform/aa-sdk/commit/a1376c4ad38a62517092ebdd8c87557712c4aecc)) -- docs for Dfns Signer ([#313](https://github.com/alchemyplatform/aa-sdk/issues/313)) ([33141b0](https://github.com/alchemyplatform/aa-sdk/commit/33141b08759b89e2c10f56d95a1316098f67fb9c)) -- docs for Arcana Signer ([#318](https://github.com/alchemyplatform/aa-sdk/issues/318)) ([81711d6](https://github.com/alchemyplatform/aa-sdk/commit/81711d6565a089a15eba95bc54c55972b13457e8)) - -# 1.2.0 (2023-11-17) - -### Features - -- make alchemy-sdk an optional dependency on aa-alchemy ([#265](https://github.com/alchemyplatform/aa-sdk/issues/265)) ([a0088b3](https://github.com/alchemyplatform/aa-sdk/commit/a0088b3ecce191ece21f4082a73c4fcae0e2286c)) - -# 1.1.0 (2023-11-14) - -### Features - -- merge development into main for new minor release ([#251](https://github.com/alchemyplatform/aa-sdk/issues/251)) ([ab098ee](https://github.com/alchemyplatform/aa-sdk/commit/ab098ee9ec35e4b1b3c788046168874fb51e4783)) - -# [1.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v0.2.0...v1.0.0) (2023-11-10) - -### Features - -- remove AA_SDK_TESTS_SIGNER_TYPE constant exported from aa-core ([#232](https://github.com/alchemyplatform/aa-sdk/issues/232)) ([883c489](https://github.com/alchemyplatform/aa-sdk/commit/883c489b077d587b6c5b50c44d92b2a00f10e5ac)) -- support enhanced apis in alchemy provider ([#221](https://github.com/alchemyplatform/aa-sdk/issues/221)) ([83ea17f](https://github.com/alchemyplatform/aa-sdk/commit/83ea17f9c69123d9282871b6f3bb02ff64750625)) -- use alchemy provider, light account for e2e tests ([#209](https://github.com/alchemyplatform/aa-sdk/issues/209)) ([124be68](https://github.com/alchemyplatform/aa-sdk/commit/124be68c5137a3511ec612e814265739e6909e75)) - -# 0.2.0 (2023-11-03) - -### Features - -- merge development into main for new version release ([#207](https://github.com/alchemyplatform/aa-sdk/issues/207)) ([f06fd2a](https://github.com/alchemyplatform/aa-sdk/commit/f06fd2adf5e4aaf90214435d32f9d566d8502099)) - -## 0.1.1 (2023-10-20) - -### Bug Fixes - -- bad deploy script again ([2da8de2](https://github.com/alchemyplatform/aa-sdk/commit/2da8de2f4feb4c82fd454050e66f6203b61bcc2c)) - -# [0.1.0](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.32...v0.1.0) (2023-10-10) - -### Features - -- merge in all of the staged changes to the aa-sdk ([#120](https://github.com/alchemyplatform/aa-sdk/issues/120)) ([7a9effa](https://github.com/alchemyplatform/aa-sdk/commit/7a9effaa07c03a6a50c9cf856b5935e735adae3a)), closes [#1](https://github.com/alchemyplatform/aa-sdk/issues/1) [#2](https://github.com/alchemyplatform/aa-sdk/issues/2) [#3](https://github.com/alchemyplatform/aa-sdk/issues/3) [#7](https://github.com/alchemyplatform/aa-sdk/issues/7) [#8](https://github.com/alchemyplatform/aa-sdk/issues/8) [#9](https://github.com/alchemyplatform/aa-sdk/issues/9) - -# 0.1.0-alpha.32 (2023-09-18) - -### Bug Fixes - -- `baseGoerli` chainId in `chains.ts` ([#104](https://github.com/alchemyplatform/aa-sdk/issues/104)) ([2dda5dd](https://github.com/alchemyplatform/aa-sdk/commit/2dda5dd729124338ddf529c11bbf24afaea05dd4)) - -# 0.1.0-alpha.31 (2023-09-13) - -### Bug Fixes - -- remove all references to `SimpleSmartAccountOwner` ([#101](https://github.com/alchemyplatform/aa-sdk/issues/101)) ([a8f101d](https://github.com/alchemyplatform/aa-sdk/commit/a8f101dff7fbbd10598467ddaaa1c3c55f707e6d)) - -# 0.1.0-alpha.30 (2023-09-11) - -### Features - -- add base support to alchemy provider ([#100](https://github.com/alchemyplatform/aa-sdk/issues/100)) ([a5dc65c](https://github.com/alchemyplatform/aa-sdk/commit/a5dc65c4208614b935943ebdd8eececf3de03d29)) - -# 0.1.0-alpha.29 (2023-08-29) - -### Bug Fixes - -- **core:** add missing `null` return type of `eth_getUserOperation*` ([#93](https://github.com/alchemyplatform/aa-sdk/issues/93)) ([cba9a0c](https://github.com/alchemyplatform/aa-sdk/commit/cba9a0c79807612b37c9d8c300b494312c9bd752)) - -# 0.1.0-alpha.28 (2023-08-25) - -### Bug Fixes - -- pass overrides from tx to user op ([#88](https://github.com/alchemyplatform/aa-sdk/issues/88)) ([985cb99](https://github.com/alchemyplatform/aa-sdk/commit/985cb997691f5b251337ea0fbe6bd23e6b3fb455)) - -# 0.1.0-alpha.27 (2023-08-24) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# 0.1.0-alpha.26 (2023-08-23) - -### Features - -- add utils for getting the intermediary UO struct ([#86](https://github.com/alchemyplatform/aa-sdk/issues/86)) ([0e1a701](https://github.com/alchemyplatform/aa-sdk/commit/0e1a70174c0eeff2eedce4379914cad75f0629b2)) - -# 0.1.0-alpha.25 (2023-08-17) - -### Features - -- add jwt support for Alchemy providers ([#81](https://github.com/alchemyplatform/aa-sdk/issues/81)) ([af85aa4](https://github.com/alchemyplatform/aa-sdk/commit/af85aa41441825ca6545e850cbc7e834879cf236)) - -# 0.1.0-alpha.24 (2023-08-16) - -### Features - -- add utils for verifying 6492 sigs and ensip-11 utils ([#80](https://github.com/alchemyplatform/aa-sdk/issues/80)) ([52231b6](https://github.com/alchemyplatform/aa-sdk/commit/52231b6b4a521ee0713c4d3d3126ac4e5d66f14c)) - -# 0.1.0-alpha.23 (2023-08-14) - -### Features - -- **alchemy:** modify fee defaults ([0a0a65c](https://github.com/alchemyplatform/aa-sdk/commit/0a0a65c03a6991a1c57473ae9e65c4b727d937e2)) - -# 0.1.0-alpha.22 (2023-08-11) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# 0.1.0-alpha.21 (2023-08-08) - -### Features - -- allow overriding alchemy provider rpc url ([#70](https://github.com/alchemyplatform/aa-sdk/issues/70)) ([6b7c4b9](https://github.com/alchemyplatform/aa-sdk/commit/6b7c4b911b97dfcd1cfb00b2892548644fbe2fc6)) - -# 0.1.0-alpha.20 (2023-08-05) - -### Features - -- add signTypedData to providers ([#66](https://github.com/alchemyplatform/aa-sdk/issues/66)) ([e0a99f6](https://github.com/alchemyplatform/aa-sdk/commit/e0a99f694a6ed6e88b15d6cc73f99e74fd985667)) - -# 0.1.0-alpha.19 (2023-08-03) - -### Features - -- add event emitter to the provider so that we can listen to connected events in dapps ([#65](https://github.com/alchemyplatform/aa-sdk/issues/65)) ([35ee990](https://github.com/alchemyplatform/aa-sdk/commit/35ee990afa1c8be7c4685631af6654ac51b094cd)) - -# 0.1.0-alpha.18 (2023-07-28) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# 0.1.0-alpha.17 (2023-07-19) - -### Features - -- add support for fetch options when creating public clients ([#59](https://github.com/alchemyplatform/aa-sdk/issues/59)) ([5028e7b](https://github.com/alchemyplatform/aa-sdk/commit/5028e7b21a208ad8f88e81d455c2c8e24d57d953)) - -# 0.1.0-alpha.16 (2023-07-06) - -### Bug Fixes - -- always import with file extension ([#48](https://github.com/alchemyplatform/aa-sdk/issues/48)) ([4776d74](https://github.com/alchemyplatform/aa-sdk/commit/4776d7476f8cb622416c8846afa9bc17d16b97a6)) - -# 0.1.0-alpha.15 (2023-07-05) - -### Features - -- kernel batch transactions and gas estimation fixes ([#39](https://github.com/alchemyplatform/aa-sdk/issues/39)) ([f2a3d3d](https://github.com/alchemyplatform/aa-sdk/commit/f2a3d3d093ddbe1b564c0242c28b67487554f1ba)) - -# 0.1.0-alpha.14 (2023-06-29) - -### Bug Fixes - -- npm 404 error ([f34f581](https://github.com/alchemyplatform/aa-sdk/commit/f34f581a0399a2e30f33161d8b4cc1d778122b1f)) - -# 0.1.0-alpha.13 (2023-06-29) - -### Bug Fixes - -- add github user details to publish script ([2b812d3](https://github.com/alchemyplatform/aa-sdk/commit/2b812d34c041e11ba7d4c11a72c26da8f8e7af21)) - -# [0.1.0-alpha.12](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.11...v0.1.0-alpha.12) (2023-06-27) - -### Bug Fixes - -- set opt/arb goerli base fee percentage to 0 ([#37](https://github.com/alchemyplatform/aa-sdk/issues/37)) ([db750f0](https://github.com/alchemyplatform/aa-sdk/commit/db750f09bc88cc7fd3a1d8e3ea0ff874ac656a7c)) - -# [0.1.0-alpha.11](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.10...v0.1.0-alpha.11) (2023-06-26) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [0.1.0-alpha.10](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.8...v0.1.0-alpha.10) (2023-06-26) - -### Bug Fixes - -- types changed when updating to latest viem ([0aec96d](https://github.com/alchemyplatform/aa-sdk/commit/0aec96d184b5bcc3787ce9123260cf287f27f037)) - -# [0.1.0-alpha.9](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.8...v0.1.0-alpha.9) (2023-06-26) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [0.1.0-alpha.8](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.7...v0.1.0-alpha.8) (2023-06-23) - -### Bug Fixes - -- **alchemy:** add opt mainnet to dummy gen ([#34](https://github.com/alchemyplatform/aa-sdk/issues/34)) ([ef21ad5](https://github.com/alchemyplatform/aa-sdk/commit/ef21ad514f9c1dfdfb49dedfd39586f58c2976c1)) - -# [0.1.0-alpha.7](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.6...v0.1.0-alpha.7) (2023-06-20) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [0.1.0-alpha.6](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.5...v0.1.0-alpha.6) (2023-06-19) - -### Bug Fixes - -- return scaled prio fee as max fee per gas ([#27](https://github.com/alchemyplatform/aa-sdk/issues/27)) ([56bc34b](https://github.com/alchemyplatform/aa-sdk/commit/56bc34be3a50a2709ca546ed90a980f3c489cbbe)) - -# [0.1.0-alpha.5](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.4...v0.1.0-alpha.5) (2023-06-16) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [0.1.0-alpha.4](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.3...v0.1.0-alpha.4) (2023-06-14) - -### Features - -- add aa-accounts subpackage ([#23](https://github.com/alchemyplatform/aa-sdk/issues/23)) ([a7fd5da](https://github.com/alchemyplatform/aa-sdk/commit/a7fd5da8600b0a346627df3a4b5cc338210aa256)) -- expose more user op methods on the provider ([#25](https://github.com/alchemyplatform/aa-sdk/issues/25)) ([2f39460](https://github.com/alchemyplatform/aa-sdk/commit/2f3946063d78a4fe1a99078f8fd315d87b24a901)) - -# [0.1.0-alpha.3](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.2...v0.1.0-alpha.3) (2023-06-13) - -### Bug Fixes - -- imports are broken because missing .js extension ([98f4a54](https://github.com/alchemyplatform/aa-sdk/commit/98f4a5469b0ac01a833ede08c6c077373255ed22)) - -# [0.1.0-alpha.2](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.1...v0.1.0-alpha.2) (2023-06-12) - -### Features - -- add alchemy sub-package ([#22](https://github.com/alchemyplatform/aa-sdk/issues/22)) ([e7fc1aa](https://github.com/alchemyplatform/aa-sdk/commit/e7fc1aa93ebd57237009d3aa688d8c167f240aad)) diff --git a/packages/alchemy/README.md b/packages/alchemy/README.md deleted file mode 100644 index eb55ab7e1d..0000000000 --- a/packages/alchemy/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# `@alchemy/aa-alchemy` - -This package contains `AlchemySmartAccountClient`, an implementation of `SmartAccountClient` interface defined in `aa-core`. It also contains middleware for accessing the Alchemy Gas Manager (an [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) Paymaster) for doing Fee Estimates according to the expectations of the Alchemy [Rundler](https://github.com/alchemyplatform/rundler/tree/main) (an ERC-4337 Bundler). You may also find the util methods helpful. This repo is community-maintained and we welcome contributions! - -## Getting started - -If you are already using the `@alchemy/aa-core` package, you can simply install this package and start using the `AlchemySmartAccountClient`. If you are not using `@alchemy/aa-core` yet, you can install it and follow the instructions in the ["Getting started"](https://accountkit.alchemy.com/packages/aa-alchemy/) docs to get started. - -```bash [yarn] -yarn add @alchemy/aa-alchemy -``` - -```bash [npm] -npm i -s @alchemy/aa-alchemy -``` - -```bash [pnpm] -pnpm i @alchemy/aa-alchemy -``` - -## Usage - -You can create `AlchemySmartAccountClient` like so: - -```typescript -import { - LightSmartContractAccount, - getDefaultLightAccountFactoryAddress, -} from "@alchemy/aa-accounts"; -import { AlchemyProvider } from "@alchemy/aa-alchemy"; -import { LocalAccountSigner, type SmartAccountSigner } from "@alchemy/aa-core"; -import { sepolia } from "@alchemy/aa-core"; - -const chain = sepolia; -const PRIVATE_KEY = "0xYourEOAPrivateKey"; -const eoaSigner: SmartAccountSigner = - LocalAccountSigner.privateKeyToAccountSigner(`0x${PRIVATE_KEY}`); - -export const provider = new AlchemyProvider({ - apiKey: "ALCHEMY_API_KEY", // replace with your alchemy api key of the Alchemy app associated with the Gas Manager, get yours at https://dashboard.alchemy.com/ - chain, -}).connect( - (rpcClient) => - new LightSmartContractAccount({ - chain, - signer: eoaSigner, - factoryAddress: getDefaultLightAccountFactoryAddress(chain), - rpcClient, - }) -); -``` diff --git a/packages/alchemy/src/config/index.ts b/packages/alchemy/src/config/index.ts deleted file mode 100644 index 6d9a8fc2c6..0000000000 --- a/packages/alchemy/src/config/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -export { createAccount } from "./actions/createAccount.js"; -export { getAccount } from "./actions/getAccount.js"; -export { getBundlerClient } from "./actions/getBundlerClient.js"; -export { getSigner } from "./actions/getSigner.js"; -export { getSignerStatus } from "./actions/getSignerStatus.js"; -export { getUser } from "./actions/getUser.js"; -export { reconnect } from "./actions/reconnect.js"; -export { watchAccount } from "./actions/watchAccount.js"; -export { watchBundlerClient } from "./actions/watchBundlerClient.js"; -export { watchSigner } from "./actions/watchSigner.js"; -export { watchSignerStatus } from "./actions/watchSignerStatus.js"; -export { watchUser } from "./actions/watchUser.js"; -export { DEFAULT_IFRAME_CONTAINER_ID, createConfig } from "./createConfig.js"; -export { ClientOnlyPropertyError } from "./errors.js"; -export { hydrate } from "./hydrate.js"; -export { defaultAccountState } from "./store/client.js"; -export type * from "./types.js"; -export { cookieStorage, cookieToInitialState } from "./utils/cookies.js"; diff --git a/packages/alchemy/src/signer/index.ts b/packages/alchemy/src/signer/index.ts deleted file mode 100644 index 44580839f5..0000000000 --- a/packages/alchemy/src/signer/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -export type * from "./signer.js"; -export { - /** @deprecated use AlchemyWebSigner instead */ - AlchemySigner, - AlchemySigner as AlchemyWebSigner, -} from "./signer.js"; - -export type * from "./types.js"; -export { AlchemySignerStatus } from "./types.js"; - -export { cookieStorage } from "../config/utils/cookies.js"; -export { BaseSignerClient } from "./client/base.js"; -export { - /** @deprecated use AlchemySignerWebClient */ - AlchemySignerWebClient as AlchemySignerClient, - AlchemySignerWebClient, -} from "./client/index.js"; -export type * from "./client/types.js"; diff --git a/packages/plugingen/src/commands/generate/utils.ts b/packages/plugingen/src/commands/generate/utils.ts deleted file mode 100644 index 52f06adffe..0000000000 --- a/packages/plugingen/src/commands/generate/utils.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { type AbiFunction } from "abitype"; -import { getAbiItem, type Abi, type AbiItem, type Address } from "viem"; - -export const executionAbiConst = (name: string) => - `${name}ExecutionFunctionAbi`; - -export const extractExecutionAbi = ( - executionFunctions: readonly Address[], - abi: Abi -): AbiFunction[] => { - return executionFunctions.map((f) => { - const item = getAbiItem({ - abi: abi, - name: f, - }) as AbiItem; - - if (item.type !== "function") { - throw new Error( - "execution function not mapping to a function in the ABI", - { cause: JSON.stringify(item, null, 2) } - ); - } - - return item; - }); -}; diff --git a/packages/plugingen/tsconfig.json b/packages/plugingen/tsconfig.json deleted file mode 100644 index 748018d6a6..0000000000 --- a/packages/plugingen/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "typescript-template/base.json" -} diff --git a/packages/signers/CHANGELOG.md b/packages/signers/CHANGELOG.md deleted file mode 100644 index 3a446a6af2..0000000000 --- a/packages/signers/CHANGELOG.md +++ /dev/null @@ -1,453 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -# [3.19.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.18.2...v3.19.0) (2024-08-02) - -**Note:** Version bump only for package @alchemy/aa-signers - -## [3.18.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.18.1...v3.18.2) (2024-06-05) - -**Note:** Version bump only for package @alchemy/aa-signers - -## [3.18.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.18.0...v3.18.1) (2024-06-04) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.18.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.17.2...v3.18.0) (2024-06-04) - -**Note:** Version bump only for package @alchemy/aa-signers - -## [3.17.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.17.1...v3.17.2) (2024-05-31) - -**Note:** Version bump only for package @alchemy/aa-signers - -## [3.17.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.17.0...v3.17.1) (2024-05-31) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.16.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.15.0...v3.16.0) (2024-05-22) - -### Features - -- add fordefi signer to aa-signers ([#665](https://github.com/alchemyplatform/aa-sdk/issues/665)) ([7673fc5](https://github.com/alchemyplatform/aa-sdk/commit/7673fc5a8b6e50f81a6f9ef1d649e3cc0e1d9e97)) - -## [3.12.3](https://github.com/alchemyplatform/aa-sdk/compare/v3.12.2...v3.12.3) (2024-05-10) - -**Note:** Version bump only for package @alchemy/aa-signers - -## [3.12.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.12.1...v3.12.2) (2024-05-09) - -**Note:** Version bump only for package @alchemy/aa-signers - -## [3.12.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.12.0...v3.12.1) (2024-05-07) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.12.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.11.1...v3.12.0) (2024-05-02) - -**Note:** Version bump only for package @alchemy/aa-signers - -## [3.11.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.11.0...v3.11.1) (2024-04-30) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.11.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.10.0...v3.11.0) (2024-04-30) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.10.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.9.0...v3.10.0) (2024-04-29) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.9.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.9.0-alpha.4...v3.9.0) (2024-04-24) - -**Note:** Version bump only for package @alchemy/aa-signers - -## [3.8.2-alpha.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.8.1...v3.8.2-alpha.1) (2024-04-18) - -### Features - -- paymaster middleware update per entrypoint v7 user operation ([#580](https://github.com/alchemyplatform/aa-sdk/issues/580)) ([399479a](https://github.com/alchemyplatform/aa-sdk/commit/399479a38d6eaf0ab6d4d46b38f9d0f5a773cbed)) - -## [3.8.2-alpha.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.8.1...v3.8.2-alpha.0) (2024-04-17) - -**Note:** Version bump only for package @alchemy/aa-signers - -## [3.8.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.8.0...v3.8.1) (2024-04-11) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.8.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.7.3...v3.8.0) (2024-04-10) - -### Features - -- add passport signer to aa-signers ([#550](https://github.com/alchemyplatform/aa-sdk/issues/550)) ([c7857ce](https://github.com/alchemyplatform/aa-sdk/commit/c7857cec047056d56e4b964b7a463fcb7171862d)) -- **alchemy-signer:** emit events from the alchemy signer on state changes ([#523](https://github.com/alchemyplatform/aa-sdk/issues/523)) ([8880e6d](https://github.com/alchemyplatform/aa-sdk/commit/8880e6d5bb9c98524c726a841fab5019bd6f0049)) - -## [3.6.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.6.0...v3.6.1) (2024-03-18) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.6.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.5.1...v3.6.0) (2024-03-18) - -**Note:** Version bump only for package @alchemy/aa-signers - -## [3.5.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.5.0...v3.5.1) (2024-03-14) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.5.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.4.4...v3.5.0) (2024-03-14) - -### Features - -- **plugins:** make plugingen a cli tool ([#507](https://github.com/alchemyplatform/aa-sdk/issues/507)) ([53ba81d](https://github.com/alchemyplatform/aa-sdk/commit/53ba81d33422bb3f18134c1dd75e68d64f5cc3f0)) - -## [3.4.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.4.1...v3.4.2) (2024-03-08) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.4.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.3.0...v3.4.0) (2024-02-29) - -**Note:** Version bump only for package @alchemy/aa-signers - -## [3.2.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.2.0...v3.2.1) (2024-02-27) - -**Note:** Version bump only for package @alchemy/aa-signers - -## [3.1.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.1.0...v3.1.1) (2024-02-23) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.1.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.1...v3.1.0) (2024-02-23) - -**Note:** Version bump only for package @alchemy/aa-signers - -## [3.0.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0...v3.0.1) (2024-02-21) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.13...v3.0.0) (2024-02-21) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.0.0-alpha.13](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.12...v3.0.0-alpha.13) (2024-02-16) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.0.0-alpha.10](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.9...v3.0.0-alpha.10) (2024-02-14) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.0.0-alpha.9](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.8...v3.0.0-alpha.9) (2024-02-13) - -### Features - -- **amoy:** add amoy from viem update ([#448](https://github.com/alchemyplatform/aa-sdk/issues/448)) ([adae84a](https://github.com/alchemyplatform/aa-sdk/commit/adae84add30536676725dbc8805f3436c8ad395e)) - -# [3.0.0-alpha.5](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.4...v3.0.0-alpha.5) (2024-02-07) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.0.0-alpha.4](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.3...v3.0.0-alpha.4) (2024-02-02) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.0.0-alpha.3](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.2...v3.0.0-alpha.3) (2024-02-02) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.0.0-alpha.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.0...v3.0.0-alpha.1) (2024-01-31) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [3.0.0-alpha.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.3.1...v3.0.0-alpha.0) (2024-01-30) - -- refactor(aa-accounts)!: migrate aa-accounts to viem approach ([37a5b48](https://github.com/alchemyplatform/aa-sdk/commit/37a5b489bdd2527dca311787d5585f1dc3a5f05b)) - -### Features - -- hoist account signing methods ([5bcfac8](https://github.com/alchemyplatform/aa-sdk/commit/5bcfac8ddaca6b712d473cbad2cbbd0228827af5)) - -### BREAKING CHANGES - -- all interfaces now use the new smart account - client and smart account models that match viem more closely - -## [2.3.1](https://github.com/alchemyplatform/aa-sdk/compare/v2.3.0...v2.3.1) (2024-01-25) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [2.3.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.2.1...v2.3.0) (2024-01-24) - -**Note:** Version bump only for package @alchemy/aa-signers - -## [2.2.1](https://github.com/alchemyplatform/aa-sdk/compare/v2.2.0...v2.2.1) (2024-01-23) - -**Note:** Version bump only for package @alchemy/aa-signers - -# [2.2.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.1.0...v2.2.0) (2024-01-22) - -### Features - -- implement persistent account state capabilities ([#346](https://github.com/alchemyplatform/aa-sdk/issues/346)) ([710f532](https://github.com/alchemyplatform/aa-sdk/commit/710f532fe6e1b230f4b9e695bb70304e97281d47)) - -# [2.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v1.2.4...v2.0.0) (2024-01-12) - -**Note:** Version bump only for package @alchemy/aa-signers - -## 1.2.4 (2024-01-08) - -**Note:** Version bump only for package @alchemy/aa-signers - -## 1.2.3 (2023-12-22) - -### Features - -- add stringToIndex util function for SmartAccount salt ([#329](https://github.com/alchemyplatform/aa-sdk/issues/329)) ([b34ef9a](https://github.com/alchemyplatform/aa-sdk/commit/b34ef9aa6727986e89a1461dec45955cac9d4365)) -- add prefix for aa-signers signer type ([#325](https://github.com/alchemyplatform/aa-sdk/issues/325)) ([f3b8cc1](https://github.com/alchemyplatform/aa-sdk/commit/f3b8cc1f0553bad51e4f95c3fd80f6aa0199cff2)) -- add terms page to glossary ([#336](https://github.com/alchemyplatform/aa-sdk/issues/336)) ([63b24ec](https://github.com/alchemyplatform/aa-sdk/commit/63b24ecdb3e5e656c173a1523a3e09478d4c074d)) -- add faq page to docs ([#335](https://github.com/alchemyplatform/aa-sdk/issues/335)) ([63092ce](https://github.com/alchemyplatform/aa-sdk/commit/63092ceb45341d422bd3f8c13ebcc539d9cc5001)) -- add aa-signer implementation for lit protocol ([#312](https://github.com/alchemyplatform/aa-sdk/issues/312)) ([b0f8dd5](https://github.com/alchemyplatform/aa-sdk/commit/b0f8dd538728f8a7dd4447da8c88a50179d61f95)) -- add aa-signer implementation for arcana auth ([#319](https://github.com/alchemyplatform/aa-sdk/issues/319)) ([c82dbf7](https://github.com/alchemyplatform/aa-sdk/commit/c82dbf7ad76791e81525740dfe8820bd234c2863)) -- add types to glossary ([#338](https://github.com/alchemyplatform/aa-sdk/issues/338)) ([28ad2b0](https://github.com/alchemyplatform/aa-sdk/commit/28ad2b015e5d0191f77cbdeeb3c071b7ec813fde)) - -## 1.2.2 (2023-12-13) - -### Bug Fixes - -- fix the named export for web3auth ([#330](https://github.com/alchemyplatform/aa-sdk/issues/330)) ([b340f11](https://github.com/alchemyplatform/aa-sdk/commit/b340f115e96ab068f70f8b5ff8316f4724b3ab6d)) - -## 1.2.1 (2023-12-12) - -### Features - -- allow passing raw call data to sendUserOperation ([#272](https://github.com/alchemyplatform/aa-sdk/issues/272) ([26b90b6](https://github.com/alchemyplatform/aa-sdk/commit/26b90b63a998b106130f3c671bb77f977becb45d))) -- add aa-signers package ([#228](https://github.com/alchemyplatform/aa-sdk/issues/228)) ([5fcd322](https://github.com/alchemyplatform/aa-sdk/commit/5fcd3222133205e5b3f86b456309584d848b1fb5)) -- add aa-signer implementation for magic ([#229](https://github.com/alchemyplatform/aa-sdk/issues/229)) ([860d177](https://github.com/alchemyplatform/aa-sdk/commit/860d17778f6ffc6140d07f2fce147eb8993ee985)) -- add aa-signer implementation for web3auth ([#247](https://github.com/alchemyplatform/aa-sdk/issues/247)) ([7d0492b](https://github.com/alchemyplatform/aa-sdk/commit/7d0492b3829b07d18c1488b7d7e0b129e40f7b4c)) -- add aa-signer implementation for turnkey ([#307](https://github.com/alchemyplatform/aa-sdk/issues/307)) ([4fa05e4](https://github.com/alchemyplatform/aa-sdk/commit/4fa05e4ada8c6558e3ce0bd35b157110baba47c9)) -- add aa-signer implementation for fireblocks ([#301](https://github.com/alchemyplatform/aa-sdk/issues/301)) ([40289e6](https://github.com/alchemyplatform/aa-sdk/commit/40289e6c656344ab0cd6c60e6dbc7c11d392d27e)) -- add aa-signer implementation for particle ([#304](https://github.com/alchemyplatform/aa-sdk/issues/304)) ([e049c2c](https://github.com/alchemyplatform/aa-sdk/commit/e049c2caa562089f62614549ac4e7b2c741f93fd)) -- add aa-signer implementation for portal ([#303](https://github.com/alchemyplatform/aa-sdk/issues/303)) ([eb8a0c3](https://github.com/alchemyplatform/aa-sdk/commit/eb8a0c356ba89701d9cc34921cf7812c23791655)) -- add aa-signer implementation for capsule ([#305](https://github.com/alchemyplatform/aa-sdk/issues/305)) ([9d89e99](https://github.com/alchemyplatform/aa-sdk/commit/9d89e99aea12fc4c13f5b4a680167d5687829bfe)) -- add improvements on provider for override user operation fee and gas ([#277](https://github.com/alchemyplatform/aa-sdk/issues/277)) ([258d80e](https://github.com/alchemyplatform/aa-sdk/commit/258d80e64d7aaa7de26f72375b9d58221c95311e)) -- support one-off percentage overrides for user operations ([#289](https://github.com/alchemyplatform/aa-sdk/issues/289)) ([dc979ff](https://github.com/alchemyplatform/aa-sdk/commit/dc979ff111f0a490b08adce9a913466706399afb)) -- add a convenience method to make creating an alchemy provider easier ([#206](https://github.com/alchemyplatform/aa-sdk/issues/206)) ([211b7e0](https://github.com/alchemyplatform/aa-sdk/commit/211b7e0e715b961520dc5baaa4f0d49b647fbd79)) -- add nani smart account implementation ([#306](https://github.com/alchemyplatform/aa-sdk/issues/306)) ([bf7566f](https://github.com/alchemyplatform/aa-sdk/commit/bf7566f2d62ab7ca4ee7fcb4a9df68308fbe5622)) -- improve zod validation parsing ([#299](https://github.com/alchemyplatform/aa-sdk/issues/299)) ([0763a82](https://github.com/alchemyplatform/aa-sdk/commit/0763a82d47f491513bdcf75716c83043f3dbd2be)) -- docs site re-formatting ([#300](https://github.com/alchemyplatform/aa-sdk/issues/300)) ([a1376c4](https://github.com/alchemyplatform/aa-sdk/commit/a1376c4ad38a62517092ebdd8c87557712c4aecc)) -- docs for Dfns Signer ([#313](https://github.com/alchemyplatform/aa-sdk/issues/313)) ([33141b0](https://github.com/alchemyplatform/aa-sdk/commit/33141b08759b89e2c10f56d95a1316098f67fb9c)) -- docs for Arcana Signer ([#318](https://github.com/alchemyplatform/aa-sdk/issues/318)) ([81711d6](https://github.com/alchemyplatform/aa-sdk/commit/81711d6565a089a15eba95bc54c55972b13457e8)) - -# 1.2.0 (2023-11-17) - -### Features - -- make alchemy-sdk an optional dependency on aa-alchemy ([#265](https://github.com/alchemyplatform/aa-sdk/issues/265)) ([a0088b3](https://github.com/alchemyplatform/aa-sdk/commit/a0088b3ecce191ece21f4082a73c4fcae0e2286c)) - -# 1.1.0 (2023-11-14) - -### Features - -- merge development into main for new minor release ([#251](https://github.com/alchemyplatform/aa-sdk/issues/251)) ([ab098ee](https://github.com/alchemyplatform/aa-sdk/commit/ab098ee9ec35e4b1b3c788046168874fb51e4783)) - -# [1.0.0](https://github.com/alchemyplatform/aa-sdk/compare/v0.2.0...v1.0.0) (2023-11-10) - -### Features - -- remove AA_SDK_TESTS_SIGNER_TYPE constant exported from aa-core ([#232](https://github.com/alchemyplatform/aa-sdk/issues/232)) ([883c489](https://github.com/alchemyplatform/aa-sdk/commit/883c489b077d587b6c5b50c44d92b2a00f10e5ac)) -- support enhanced apis in alchemy provider ([#221](https://github.com/alchemyplatform/aa-sdk/issues/221)) ([83ea17f](https://github.com/alchemyplatform/aa-sdk/commit/83ea17f9c69123d9282871b6f3bb02ff64750625)) -- use alchemy provider, light account for e2e tests ([#209](https://github.com/alchemyplatform/aa-sdk/issues/209)) ([124be68](https://github.com/alchemyplatform/aa-sdk/commit/124be68c5137a3511ec612e814265739e6909e75)) - -# 0.2.0 (2023-11-03) - -### Features - -- merge development into main for new version release ([#207](https://github.com/alchemyplatform/aa-sdk/issues/207)) ([f06fd2a](https://github.com/alchemyplatform/aa-sdk/commit/f06fd2adf5e4aaf90214435d32f9d566d8502099)) - -## 0.1.1 (2023-10-20) - -### Bug Fixes - -- bad deploy script again ([2da8de2](https://github.com/alchemyplatform/aa-sdk/commit/2da8de2f4feb4c82fd454050e66f6203b61bcc2c)) - -# [0.1.0](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.32...v0.1.0) (2023-10-10) - -### Features - -- merge in all of the staged changes to the aa-sdk ([#120](https://github.com/alchemyplatform/aa-sdk/issues/120)) ([7a9effa](https://github.com/alchemyplatform/aa-sdk/commit/7a9effaa07c03a6a50c9cf856b5935e735adae3a)), closes [#1](https://github.com/alchemyplatform/aa-sdk/issues/1) [#2](https://github.com/alchemyplatform/aa-sdk/issues/2) [#3](https://github.com/alchemyplatform/aa-sdk/issues/3) [#7](https://github.com/alchemyplatform/aa-sdk/issues/7) [#8](https://github.com/alchemyplatform/aa-sdk/issues/8) [#9](https://github.com/alchemyplatform/aa-sdk/issues/9) - -# 0.1.0-alpha.32 (2023-09-18) - -### Bug Fixes - -- `baseGoerli` chainId in `chains.ts` ([#104](https://github.com/alchemyplatform/aa-sdk/issues/104)) ([2dda5dd](https://github.com/alchemyplatform/aa-sdk/commit/2dda5dd729124338ddf529c11bbf24afaea05dd4)) - -# 0.1.0-alpha.31 (2023-09-13) - -### Bug Fixes - -- remove all references to `SimpleSmartAccountOwner` ([#101](https://github.com/alchemyplatform/aa-sdk/issues/101)) ([a8f101d](https://github.com/alchemyplatform/aa-sdk/commit/a8f101dff7fbbd10598467ddaaa1c3c55f707e6d)) - -# 0.1.0-alpha.30 (2023-09-11) - -### Features - -- add base support to alchemy provider ([#100](https://github.com/alchemyplatform/aa-sdk/issues/100)) ([a5dc65c](https://github.com/alchemyplatform/aa-sdk/commit/a5dc65c4208614b935943ebdd8eececf3de03d29)) - -# 0.1.0-alpha.29 (2023-08-29) - -### Bug Fixes - -- **core:** add missing `null` return type of `eth_getUserOperation*` ([#93](https://github.com/alchemyplatform/aa-sdk/issues/93)) ([cba9a0c](https://github.com/alchemyplatform/aa-sdk/commit/cba9a0c79807612b37c9d8c300b494312c9bd752)) - -# 0.1.0-alpha.28 (2023-08-25) - -### Bug Fixes - -- pass overrides from tx to user op ([#88](https://github.com/alchemyplatform/aa-sdk/issues/88)) ([985cb99](https://github.com/alchemyplatform/aa-sdk/commit/985cb997691f5b251337ea0fbe6bd23e6b3fb455)) - -# 0.1.0-alpha.27 (2023-08-24) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# 0.1.0-alpha.26 (2023-08-23) - -### Features - -- add utils for getting the intermediary UO struct ([#86](https://github.com/alchemyplatform/aa-sdk/issues/86)) ([0e1a701](https://github.com/alchemyplatform/aa-sdk/commit/0e1a70174c0eeff2eedce4379914cad75f0629b2)) - -# 0.1.0-alpha.25 (2023-08-17) - -### Features - -- add jwt support for Alchemy providers ([#81](https://github.com/alchemyplatform/aa-sdk/issues/81)) ([af85aa4](https://github.com/alchemyplatform/aa-sdk/commit/af85aa41441825ca6545e850cbc7e834879cf236)) - -# 0.1.0-alpha.24 (2023-08-16) - -### Features - -- add utils for verifying 6492 sigs and ensip-11 utils ([#80](https://github.com/alchemyplatform/aa-sdk/issues/80)) ([52231b6](https://github.com/alchemyplatform/aa-sdk/commit/52231b6b4a521ee0713c4d3d3126ac4e5d66f14c)) - -# 0.1.0-alpha.23 (2023-08-14) - -### Features - -- **alchemy:** modify fee defaults ([0a0a65c](https://github.com/alchemyplatform/aa-sdk/commit/0a0a65c03a6991a1c57473ae9e65c4b727d937e2)) - -# 0.1.0-alpha.22 (2023-08-11) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# 0.1.0-alpha.21 (2023-08-08) - -### Features - -- allow overriding alchemy provider rpc url ([#70](https://github.com/alchemyplatform/aa-sdk/issues/70)) ([6b7c4b9](https://github.com/alchemyplatform/aa-sdk/commit/6b7c4b911b97dfcd1cfb00b2892548644fbe2fc6)) - -# 0.1.0-alpha.20 (2023-08-05) - -### Features - -- add signTypedData to providers ([#66](https://github.com/alchemyplatform/aa-sdk/issues/66)) ([e0a99f6](https://github.com/alchemyplatform/aa-sdk/commit/e0a99f694a6ed6e88b15d6cc73f99e74fd985667)) - -# 0.1.0-alpha.19 (2023-08-03) - -### Features - -- add event emitter to the provider so that we can listen to connected events in dapps ([#65](https://github.com/alchemyplatform/aa-sdk/issues/65)) ([35ee990](https://github.com/alchemyplatform/aa-sdk/commit/35ee990afa1c8be7c4685631af6654ac51b094cd)) - -# 0.1.0-alpha.18 (2023-07-28) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# 0.1.0-alpha.17 (2023-07-19) - -### Features - -- add support for fetch options when creating public clients ([#59](https://github.com/alchemyplatform/aa-sdk/issues/59)) ([5028e7b](https://github.com/alchemyplatform/aa-sdk/commit/5028e7b21a208ad8f88e81d455c2c8e24d57d953)) - -# 0.1.0-alpha.16 (2023-07-06) - -### Bug Fixes - -- always import with file extension ([#48](https://github.com/alchemyplatform/aa-sdk/issues/48)) ([4776d74](https://github.com/alchemyplatform/aa-sdk/commit/4776d7476f8cb622416c8846afa9bc17d16b97a6)) - -# 0.1.0-alpha.15 (2023-07-05) - -### Features - -- kernel batch transactions and gas estimation fixes ([#39](https://github.com/alchemyplatform/aa-sdk/issues/39)) ([f2a3d3d](https://github.com/alchemyplatform/aa-sdk/commit/f2a3d3d093ddbe1b564c0242c28b67487554f1ba)) - -# 0.1.0-alpha.14 (2023-06-29) - -### Bug Fixes - -- npm 404 error ([f34f581](https://github.com/alchemyplatform/aa-sdk/commit/f34f581a0399a2e30f33161d8b4cc1d778122b1f)) - -# 0.1.0-alpha.13 (2023-06-29) - -### Bug Fixes - -- add github user details to publish script ([2b812d3](https://github.com/alchemyplatform/aa-sdk/commit/2b812d34c041e11ba7d4c11a72c26da8f8e7af21)) - -# [0.1.0-alpha.12](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.11...v0.1.0-alpha.12) (2023-06-27) - -### Bug Fixes - -- set opt/arb goerli base fee percentage to 0 ([#37](https://github.com/alchemyplatform/aa-sdk/issues/37)) ([db750f0](https://github.com/alchemyplatform/aa-sdk/commit/db750f09bc88cc7fd3a1d8e3ea0ff874ac656a7c)) - -# [0.1.0-alpha.11](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.10...v0.1.0-alpha.11) (2023-06-26) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [0.1.0-alpha.10](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.8...v0.1.0-alpha.10) (2023-06-26) - -### Bug Fixes - -- types changed when updating to latest viem ([0aec96d](https://github.com/alchemyplatform/aa-sdk/commit/0aec96d184b5bcc3787ce9123260cf287f27f037)) - -# [0.1.0-alpha.9](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.8...v0.1.0-alpha.9) (2023-06-26) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [0.1.0-alpha.8](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.7...v0.1.0-alpha.8) (2023-06-23) - -### Bug Fixes - -- **alchemy:** add opt mainnet to dummy gen ([#34](https://github.com/alchemyplatform/aa-sdk/issues/34)) ([ef21ad5](https://github.com/alchemyplatform/aa-sdk/commit/ef21ad514f9c1dfdfb49dedfd39586f58c2976c1)) - -# [0.1.0-alpha.7](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.6...v0.1.0-alpha.7) (2023-06-20) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [0.1.0-alpha.6](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.5...v0.1.0-alpha.6) (2023-06-19) - -### Bug Fixes - -- return scaled prio fee as max fee per gas ([#27](https://github.com/alchemyplatform/aa-sdk/issues/27)) ([56bc34b](https://github.com/alchemyplatform/aa-sdk/commit/56bc34be3a50a2709ca546ed90a980f3c489cbbe)) - -# [0.1.0-alpha.5](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.4...v0.1.0-alpha.5) (2023-06-16) - -**Note:** Version bump only for package @alchemy/aa-alchemy - -# [0.1.0-alpha.4](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.3...v0.1.0-alpha.4) (2023-06-14) - -### Features - -- add aa-accounts subpackage ([#23](https://github.com/alchemyplatform/aa-sdk/issues/23)) ([a7fd5da](https://github.com/alchemyplatform/aa-sdk/commit/a7fd5da8600b0a346627df3a4b5cc338210aa256)) -- expose more user op methods on the provider ([#25](https://github.com/alchemyplatform/aa-sdk/issues/25)) ([2f39460](https://github.com/alchemyplatform/aa-sdk/commit/2f3946063d78a4fe1a99078f8fd315d87b24a901)) - -# [0.1.0-alpha.3](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.2...v0.1.0-alpha.3) (2023-06-13) - -### Bug Fixes - -- imports are broken because missing .js extension ([98f4a54](https://github.com/alchemyplatform/aa-sdk/commit/98f4a5469b0ac01a833ede08c6c077373255ed22)) - -# [0.1.0-alpha.2](https://github.com/alchemyplatform/aa-sdk/compare/v0.1.0-alpha.1...v0.1.0-alpha.2) (2023-06-12) - -### Features - -- add alchemy sub-package ([#22](https://github.com/alchemyplatform/aa-sdk/issues/22)) ([e7fc1aa](https://github.com/alchemyplatform/aa-sdk/commit/e7fc1aa93ebd57237009d3aa688d8c167f240aad)) diff --git a/packages/signers/README.md b/packages/signers/README.md deleted file mode 100644 index cf76dc6f43..0000000000 --- a/packages/signers/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# `@alchemy/aa-signers` - -This package contains various implementations of the [`SmartAccountSigner`](../core/src/signer/types.ts) and [`AuthSmartAccountSigner`](../core/src/signer/types.ts) classes defined in `aa-core`. This repo is community maintained and we welcome contributions! - -## Getting started - -If you are already using the `@alchemy/aa-core` package, you can simply install this package and start using the accounts. If you are not using `@alchemy/aa-core`, you can install it and follow the instructions in the [README](../../README.md) to get started. - -via `yarn` - -```bash -yarn add @alchemy/aa-signers -``` - -via `npm` - -```bash -npm i -s @alchemy/aa-signers -``` - -## Contributing - -If you are looking to add a new account type, please follow the following structure. - -1. Create a new folder in `src` with the name of your account type in `kebab-case` (we are following kebab casing for files throughout the project). -2. Create a new file in the folder you just created called `signer.ts` and add your implementation for `SmartAccountSigner`, along with any additional types or utils files. -3. If you need to extend the [`SmartAccountSigner`](../core/src/provider/base.ts) or [`AuthSmartAccountSigner`](../core/src/signer/types.ts) class, add a file called `signer.ts` in a new sub-folder under this package and add your implementation for. - -- Ideally, your `SmartAccountSigner` impl should _just_ work with the base provider provided by `aa-core` and whatever peer dependencies you install. -- If not, consider generalizing the use case and updating SmartAccountSigner - -5. Add some tests for your account and provider (if created) by creating a subfolder in your `signer/my-signer` called `__tests__` and make sure your files end with the `.test.ts` suffix -6. export the classes and types you have defined in `src/index.ts` -7. Open a PR and we will review it as soon as possible! diff --git a/packages/signers/package.json b/packages/signers/package.json deleted file mode 100644 index cd4f21c360..0000000000 --- a/packages/signers/package.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "name": "@alchemy/aa-signers", - "version": "3.19.0", - "description": "A collection of signers used to create ERC-4337 smart accounts", - "author": "Alchemy", - "license": "MIT", - "private": false, - "type": "module", - "main": "./dist/cjs/index.js", - "module": "./dist/esm/index.js", - "types": "./dist/types/index.d.ts", - "typings": "./dist/types/index.d.ts", - "sideEffects": false, - "files": [ - "dist", - "src/**/*.ts", - "!dist/**/*.tsbuildinfo", - "!vitest.config.ts", - "!.env", - "!src/**/*.test.ts", - "!src/__tests__/**/*" - ], - "exports": { - "./magic": { - "types": "./dist/types/magic/index.d.ts", - "import": "./dist/esm/magic/index.js", - "default": "./dist/cjs/magic/index.js" - }, - "./web3auth": { - "types": "./dist/types/web3auth/index.d.ts", - "import": "./dist/esm/web3auth/index.js", - "default": "./dist/cjs/web3auth/index.js" - }, - "./fireblocks": { - "types": "./dist/types/fireblocks/index.d.ts", - "import": "./dist/esm/fireblocks/index.js", - "default": "./dist/cjs/fireblocks/index.js" - }, - "./turnkey": { - "types": "./dist/types/turnkey/index.d.ts", - "import": "./dist/esm/turnkey/index.js", - "default": "./dist/cjs/turnkey/index.js" - }, - "./particle": { - "types": "./dist/types/particle/index.d.ts", - "import": "./dist/esm/particle/index.js", - "default": "./dist/cjs/particle/index.js" - }, - "./portal": { - "types": "./dist/types/portal/index.d.ts", - "import": "./dist/esm/portal/index.js", - "default": "./dist/cjs/portal/index.js" - }, - "./capsule": { - "types": "./dist/types/capsule/index.d.ts", - "import": "./dist/esm/capsule/index.js", - "default": "./dist/cjs/capsule/index.js" - }, - "./lit-protocol": { - "types": "./dist/types/lit-protocol/index.d.ts", - "import": "./dist/esm/lit-protocol/index.js", - "default": "./dist/cjs/lit-protocol/index.js" - }, - "./arcana-auth": { - "types": "./dist/types/arcana-auth/index.d.ts", - "import": "./dist/esm/arcana-auth/index.js", - "default": "./dist/cjs/arcana-auth/index.js" - }, - "./passport": { - "types": "./dist/types/passport/index.d.ts", - "import": "./dist/esm/passport/index.js", - "default": "./dist/cjs/passport/index.js" - }, - "./fordefi": { - "types": "./dist/types/fordefi/index.d.ts", - "import": "./dist/esm/fordefi/index.js", - "default": "./dist/cjs/fordefi/index.js" - }, - "./package.json": "./package.json" - }, - "scripts": { - "build": "yarn clean && yarn build:cjs && yarn build:esm && yarn build:types", - "build:cjs": "tsc --project tsconfig.build.json --module commonjs --outDir ./dist/cjs --removeComments --verbatimModuleSyntax false && echo > ./dist/cjs/package.json '{\"type\":\"commonjs\"}'", - "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir ./dist/esm --removeComments && echo > ./dist/esm/package.json '{\"type\":\"module\"}'", - "build:types": "tsc --project tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap", - "clean": "rm -rf ./dist", - "test": "vitest", - "test:run": "vitest run", - "test:run-e2e": "vitest run --config vitest.config.e2e.ts" - }, - "devDependencies": { - "@0xpass/models": "^1.0.0", - "@0xpass/passport": "^1.0.0", - "@0xpass/passport-viem-alchemy": "0.0.1", - "@0xpass/webauthn-signer": "^1.0.0", - "@arcana/auth": "^1.0.8", - "@fireblocks/fireblocks-web3-provider": "^1.2.6", - "@fordefi/web3-provider": "^0.2.0", - "@lit-protocol/crypto": "3.0.24", - "@lit-protocol/lit-node-client": "3.0.24", - "@lit-protocol/pkp-ethers": "3.0.24", - "@lit-protocol/types": "3.0.24", - "@particle-network/auth": "^1.2.2", - "@particle-network/provider": "^1.2.1", - "@portal-hq/web": "^0.0.8", - "@turnkey/http": "^2.4.2", - "@turnkey/viem": "^0.4.2", - "@turnkey/webauthn-stamper": "^0.4.2", - "@usecapsule/web-sdk": "^0.29.4", - "@web3auth/base": "^7.1.0", - "@web3auth/modal": "^7.1.1", - "jsdom": "^22.1.0", - "magic-sdk": "^21.3.0", - "typescript": "^5.0.4", - "typescript-template": "*", - "vitest": "^0.31.0" - }, - "publishConfig": { - "access": "public", - "registry": "https://registry.npmjs.org/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/alchemyplatform/aa-sdk.git" - }, - "bugs": { - "url": "https://github.com/alchemyplatform/aa-sdk/issues" - }, - "homepage": "https://github.com/alchemyplatform/aa-sdk#readme", - "gitHead": "ee46e8bb857de3b631044fa70714ea706d9e317d", - "dependencies": { - "@alchemy/aa-core": "^3.19.0", - "viem": "2.8.6" - }, - "peerDependencies": { - "viem": "2.8.6" - }, - "optionalDependencies": { - "@arcana/auth": "^1.0.8", - "@fireblocks/fireblocks-web3-provider": "^1.2.6", - "@fordefi/web3-provider": "^0.2.0", - "@lit-protocol/crypto": "3.0.24", - "@lit-protocol/lit-node-client": "3.0.24", - "@lit-protocol/pkp-ethers": "3.0.24", - "@lit-protocol/types": "3.0.24", - "@particle-network/auth": "^1.2.2", - "@particle-network/provider": "^1.2.1", - "@portal-hq/web": "^0.0.8", - "@turnkey/http": "^2.4.2", - "@turnkey/viem": "^0.4.2", - "@usecapsule/web-sdk": "^0.29.4", - "@web3auth/base": "^7.1.0", - "@web3auth/modal": "^7.1.1", - "magic-sdk": "^21.3.0" - } -} diff --git a/packages/signers/src/arcana-auth/__tests__/signer.test.ts b/packages/signers/src/arcana-auth/__tests__/signer.test.ts deleted file mode 100644 index 6ce301e013..0000000000 --- a/packages/signers/src/arcana-auth/__tests__/signer.test.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { AuthProvider } from "@arcana/auth"; -import { ArcanaAuthSigner } from "../signer.js"; - -describe("ArcanaAuth Signer Tests", () => { - it("should correctly get address if authenticated", async () => { - const signer = await givenSigner(); - - const address = await signer.getAddress(); - expect(address).toMatchInlineSnapshot( - '"0x1234567890123456789012345678901234567890"' - ); - }); - - it("should correctly fail to get address if unauthenticated", async () => { - const signer = await givenSigner(false); - - const address = signer.getAddress(); - await expect(address).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly get auth details if authenticated", async () => { - const signer = await givenSigner(); - - const details = await signer.getAuthDetails(); - expect(details).toMatchInlineSnapshot(` - { - "email": "test", - "isMfaEnabled": false, - "issuer": null, - "phoneNumber": "1234567890", - "publicAddress": "0x1234567890123456789012345678901234567890", - "recoveryFactors": [], - } - `); - }); - - it("should correctly fail to get auth details if unauthenticated", async () => { - const signer = await givenSigner(false); - - const details = signer.getAuthDetails(); - await expect(details).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly sign message if authenticated", async () => { - const signer = await givenSigner(); - - const signMessage = await signer.signMessage("test"); - expect(signMessage).toMatchInlineSnapshot('"0xtest"'); - }); - - it("should correctly fail to sign message if unauthenticated", async () => { - const signer = await givenSigner(false); - - const signMessage = signer.signMessage("test"); - await expect(signMessage).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly sign typed data if authenticated", async () => { - const signer = await givenSigner(); - - const typedData = { - types: { - Request: [{ name: "hello", type: "string" }], - }, - primaryType: "Request", - message: { - hello: "world", - }, - }; - const signTypedData = await signer.signTypedData(typedData); - expect(signTypedData).toMatchInlineSnapshot('"0xtest"'); - }); -}); - -const givenSigner = async (auth = true) => { - const inner = new AuthProvider("EeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"); - - inner.getUser = vi.fn().mockResolvedValue({ - publicAddress: "0x1234567890123456789012345678901234567890", - issuer: null, - email: "test", - phoneNumber: "1234567890", - isMfaEnabled: false, - recoveryFactors: [], - }); - - vi.spyOn(inner, "provider", "get").mockReturnValue({ - request: ({ method }: { method: string; params: any[] }) => { - switch (method) { - case "eth_accounts": - return Promise.resolve([ - "0x1234567890123456789012345678901234567890", - ]); - case "personal_sign": - return Promise.resolve("0xtest"); - case "eth_signTypedData_v4": - return Promise.resolve("0xtest"); - default: - return Promise.reject(new Error("Method not found")); - } - }, - } as any); - - const signer = new ArcanaAuthSigner({ inner }); - - if (auth) { - await signer.authenticate({ - init: () => Promise.resolve(), - connect: () => Promise.resolve(), - }); - } - - return signer; -}; diff --git a/packages/signers/src/arcana-auth/index.ts b/packages/signers/src/arcana-auth/index.ts deleted file mode 100644 index 953a520590..0000000000 --- a/packages/signers/src/arcana-auth/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { ArcanaAuthSigner } from "./signer.js"; -export type * from "./types"; diff --git a/packages/signers/src/arcana-auth/signer.ts b/packages/signers/src/arcana-auth/signer.ts deleted file mode 100644 index 552af2f98f..0000000000 --- a/packages/signers/src/arcana-auth/signer.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { - WalletClientSigner, - type SmartAccountAuthenticator, -} from "@alchemy/aa-core"; -import { - AuthProvider, - type ConstructorParams, - type UserInfo, -} from "@arcana/auth"; -import { - createWalletClient, - custom, - type Hash, - type SignableMessage, - type TypedData, - type TypedDataDefinition, -} from "viem"; -import type { ArcanaAuthAuthenticationParams } from "./types"; - -/** - * This class requires the `@arcana/auth` package as a dependency. - * `@alchemy/aa-signers` lists it as optional dependencies. - * - * @see https://github.com/arcana-network/auth - */ -export class ArcanaAuthSigner - implements - SmartAccountAuthenticator< - ArcanaAuthAuthenticationParams, - UserInfo, - AuthProvider - > -{ - inner: AuthProvider; - private signer: WalletClientSigner | undefined; - - constructor( - params: - | { clientId: string; params: Partial } - | { inner: AuthProvider } - ) { - if ("inner" in params) { - this.inner = params.inner; - return; - } - - this.inner = new AuthProvider(params.clientId, params.params); - } - - readonly signerType = "arcana-auth"; - - getAddress = async () => { - if (!this.signer) throw new Error("Not authenticated"); - - const address = await this.signer.getAddress(); - if (address == null) throw new Error("No address found"); - - return address as Hash; - }; - - signMessage = async (msg: SignableMessage) => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.signMessage(msg); - }; - - signTypedData = async < - const TTypedData extends TypedData | { [key: string]: unknown }, - TPrimaryType extends string = string - >( - params: TypedDataDefinition - ) => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.signTypedData(params); - }; - - authenticate = async ( - params: ArcanaAuthAuthenticationParams = { - init: async () => { - await this.inner.init(); - }, - connect: async () => { - await this.inner.connect(); - }, - } - ) => { - await params.init(); - await params.connect(); - - if (this.inner.provider == null) throw new Error("No provider found"); - - this.signer = new WalletClientSigner( - createWalletClient({ - transport: custom(this.inner.provider), - }), - this.signerType - ); - - return this.inner.getUser(); - }; - - getAuthDetails = async () => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.inner.getUser(); - }; -} diff --git a/packages/signers/src/arcana-auth/types.ts b/packages/signers/src/arcana-auth/types.ts deleted file mode 100644 index 133daec586..0000000000 --- a/packages/signers/src/arcana-auth/types.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface ArcanaAuthAuthenticationParams { - init: () => Promise; - connect: () => Promise; -} diff --git a/packages/signers/src/capsule/__tests__/signer.test.ts b/packages/signers/src/capsule/__tests__/signer.test.ts deleted file mode 100644 index 84be261999..0000000000 --- a/packages/signers/src/capsule/__tests__/signer.test.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { sepolia } from "@alchemy/aa-core"; -import Capsule, { - Environment, - createCapsuleViemClient, -} from "@usecapsule/web-sdk"; -import { - http, - type EIP1193RequestFn, - type EIP1474Methods, - type WalletClient, -} from "viem"; -import { CapsuleSigner } from "../signer.js"; - -describe("Capsule Signer Tests", () => { - it("should correctly get address", async () => { - const signer = await givenSigner(); - - const address = await signer.getAddress(); - expect(address).toMatchInlineSnapshot( - '"0x1234567890123456789012345678901234567890"' - ); - }); - - it("should correctly fail to get address if unauthenticated", async () => { - const signer = await givenSigner(false); - - const address = signer.getAddress(); - await expect(address).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly get auth details", async () => { - const signer = await givenSigner(); - - const details = await signer.getAuthDetails(); - expect(details).toMatchInlineSnapshot(` - { - "wallet_0": { - "address": "0x1234567890123456789012345678901234567890", - "id": "test", - "publicKey": "test", - "scheme": "CGGMP", - "signer": "test", - }, - } - `); - }); - - it("should correctly fail to get auth details if unauthenticated", async () => { - const signer = await givenSigner(false); - - const details = signer.getAuthDetails(); - await expect(details).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly sign message if authenticated", async () => { - const signer = await givenSigner(); - - const signMessage = await signer.signMessage("test"); - expect(signMessage).toMatchInlineSnapshot('"0xtest"'); - }); - - it("should correctly fail to sign message if unauthenticated", async () => { - const signer = await givenSigner(false); - - const signMessage = signer.signMessage("test"); - await expect(signMessage).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly sign typed data if authenticated", async () => { - const signer = await givenSigner(); - - const typedData = { - types: { - Request: [{ name: "hello", type: "string" }], - }, - primaryType: "Request", - message: { - hello: "world", - }, - }; - const signTypedData = await signer.signTypedData(typedData); - expect(signTypedData).toMatchInlineSnapshot('"0xtest"'); - }); -}); - -const givenSigner = async (auth = true) => { - const inner = new Capsule(Environment.DEVELOPMENT, "test"); - - inner.getWallets = vi.fn().mockReturnValue({ - wallet_0: { - id: "test", - signer: "test", - address: "0x1234567890123456789012345678901234567890", - publicKey: "test", - scheme: "CGGMP", - }, - }); - - const client = createCapsuleViemClient(inner, { - chain: sepolia, - transport: http(`${sepolia.rpcUrls.alchemy.http[0]}/test`) as any, - }) as unknown as WalletClient; // TODO: Capsule team to address lint error - - client.request = vi.fn(async (args) => { - switch (args.method) { - case "eth_accounts": - return Promise.resolve(["0x1234567890123456789012345678901234567890"]); - case "personal_sign": - return Promise.resolve("0xtest"); - case "eth_signTypedData_v4": - return Promise.resolve("0xtest"); - default: - return Promise.reject(new Error("Method not found")); - } - }) as EIP1193RequestFn; - - const signer = new CapsuleSigner({ inner, client }); - - if (auth) { - await signer.authenticate(); - } - - return signer; -}; diff --git a/packages/signers/src/capsule/index.ts b/packages/signers/src/capsule/index.ts deleted file mode 100644 index 415a7a5b34..0000000000 --- a/packages/signers/src/capsule/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { CapsuleSigner } from "./signer.js"; -export type * from "./types.js"; diff --git a/packages/signers/src/capsule/signer.ts b/packages/signers/src/capsule/signer.ts deleted file mode 100644 index 21583b243a..0000000000 --- a/packages/signers/src/capsule/signer.ts +++ /dev/null @@ -1,103 +0,0 @@ -import { - WalletClientSigner, - type SmartAccountAuthenticator, -} from "@alchemy/aa-core"; -import Capsule, { createCapsuleViemClient } from "@usecapsule/web-sdk"; -import { - createWalletClient, - custom, - type Hash, - type SignableMessage, - type TypedData, - type TypedDataDefinition, - type WalletClient, -} from "viem"; -import { signerTypePrefix } from "../constants.js"; -import type { - CapsuleAuthenticationParams, - CapsuleConfig, - CapsuleUserInfo, -} from "./types.js"; - -/** - * This class requires the `@usecapsule/web-sdk` dependency. - * `@alchemy/aa-signers` lists it as an optional dependency. - * - * @see https://docs.usecapsule.com/getting-started/initial-setup - */ -export class CapsuleSigner - implements - SmartAccountAuthenticator< - CapsuleAuthenticationParams, - CapsuleUserInfo, - Capsule - > -{ - inner: Capsule; - private client: WalletClient; - private signer: WalletClientSigner | undefined; - - constructor( - params: CapsuleConfig | { inner: Capsule; client: WalletClient } - ) { - if ("inner" in params) { - this.inner = params.inner; - this.client = params.client; - return; - } - - this.inner = new Capsule(params.env, params.apiKey, params.opts); - this.client = createCapsuleViemClient( - this.inner, - params.walletConfig as any, // TODO: Capsule team to address lint error - params.viemClientOpts - ) as unknown as WalletClient; // TODO: Capsule team to address lint error - } - - readonly signerType = `${signerTypePrefix}capsule`; - - getAddress = async () => { - if (!this.signer) throw new Error("Not authenticated"); - - const address = await this.signer.getAddress(); - if (address == null) throw new Error("No address found"); - - return address as Hash; - }; - - signMessage = async (msg: SignableMessage) => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.signMessage(msg); - }; - - signTypedData = async < - const TTypedData extends TypedData | { [key: string]: unknown }, - TPrimaryType extends string = string - >( - params: TypedDataDefinition - ) => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.signTypedData(params); - }; - - authenticate = async () => { - if (this.inner == null) throw new Error("No provider found"); - - this.signer = new WalletClientSigner( - createWalletClient({ - transport: custom(this.client), - }), - this.signerType - ); - - return this.inner.getWallets(); - }; - - getAuthDetails = async () => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.inner.getWallets(); - }; -} diff --git a/packages/signers/src/capsule/types.ts b/packages/signers/src/capsule/types.ts deleted file mode 100644 index 2577aa7b56..0000000000 --- a/packages/signers/src/capsule/types.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { Environment } from "@usecapsule/web-sdk"; -import type { WalletClientConfig } from "viem"; - -// copied since Capsule doesn't export this type -interface ConstructorOpts { - useStorageOverrides?: boolean; - disableWorkers?: boolean; - offloadMPCComputationURL?: string; - useLocalFiles?: boolean; - localStorageGetItemOverride?: (key: string) => Promise; - localStorageSetItemOverride?: (key: string, value: string) => Promise; - sessionStorageGetItemOverride?: (key: string) => Promise; - sessionStorageSetItemOverride?: (key: string, value: string) => Promise; - sessionStorageRemoveItemOverride?: (key: string) => Promise; - clearStorageOverride?: () => Promise; - portalBackgroundColor?: string; - portalPrimaryButtonColor?: string; - portalTextColor?: string; - portalPrimaryButtonTextColor?: string; - useDKLSForCreation?: boolean; -} - -// copied since Capsule doesn't export this type -enum WalletScheme { - CGGMP = "CGGMP", - DKLS = "DKLS", -} - -// copied since Capsule doesn't export this type -interface Wallet { - id: string; - signer: string; - address?: string; - publicKey?: string; - scheme?: WalletScheme; -} - -// copied since Capsule doesn't export this type -interface ViemClientOpts { - noAccount?: boolean; -} - -export interface CapsuleConfig { - env: Environment; - walletConfig: WalletClientConfig; - apiKey?: string | undefined; - opts?: ConstructorOpts | undefined; - viemClientOpts?: ViemClientOpts; -} - -export interface CapsuleAuthenticationParams {} - -export type CapsuleUserInfo = Record; diff --git a/packages/signers/src/constants.ts b/packages/signers/src/constants.ts deleted file mode 100644 index e25a4c8f6c..0000000000 --- a/packages/signers/src/constants.ts +++ /dev/null @@ -1 +0,0 @@ -export const signerTypePrefix = "aa-signers:"; diff --git a/packages/signers/src/fireblocks/__tests__/mock-private-key.txt b/packages/signers/src/fireblocks/__tests__/mock-private-key.txt deleted file mode 100644 index 30d74d2584..0000000000 --- a/packages/signers/src/fireblocks/__tests__/mock-private-key.txt +++ /dev/null @@ -1 +0,0 @@ -test \ No newline at end of file diff --git a/packages/signers/src/fireblocks/__tests__/signer.test.ts b/packages/signers/src/fireblocks/__tests__/signer.test.ts deleted file mode 100644 index 458aea0ac2..0000000000 --- a/packages/signers/src/fireblocks/__tests__/signer.test.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { - ChainId, - FireblocksWeb3Provider, - type RequestArguments, -} from "@fireblocks/fireblocks-web3-provider"; -import { FireblocksSigner } from "../signer.js"; - -describe("Fireblocks Signer Tests", () => { - it("should correctly get address", async () => { - const signer = await givenSigner(); - - const address = await signer.getAddress(); - expect(address).toMatchInlineSnapshot( - '"0x1234567890123456789012345678901234567890"' - ); - }); - - it("should correctly fail to get address if unauthenticated", async () => { - const signer = await givenSigner(false); - - const address = signer.getAddress(); - await expect(address).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly get auth details", async () => { - const signer = await givenSigner(); - - const details = await signer.getAuthDetails(); - expect(details).toMatchInlineSnapshot(` - { - "addresses": [ - "0x1234567890123456789012345678901234567890", - "0x0987654321098765432109876543210987654321", - ], - } - `); - }); - - it("should correctly fail to get auth details if unauthenticated", async () => { - const signer = await givenSigner(false); - - const details = signer.getAuthDetails(); - await expect(details).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly sign message if authenticated", async () => { - const signer = await givenSigner(); - - const signMessage = await signer.signMessage("test"); - expect(signMessage).toMatchInlineSnapshot('"0xtest"'); - }); - - it("should correctly fail to sign message if unauthenticated", async () => { - const signer = await givenSigner(false); - - const signMessage = signer.signMessage("test"); - await expect(signMessage).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly sign typed data if authenticated", async () => { - const signer = await givenSigner(); - - const typedData = { - types: { - Request: [{ name: "hello", type: "string" }], - }, - primaryType: "Request", - message: { - hello: "world", - }, - }; - const signTypedData = await signer.signTypedData(typedData); - expect(signTypedData).toMatchInlineSnapshot('"0xtest"'); - }); -}); - -const givenSigner = async (auth = true) => { - const inner = new FireblocksWeb3Provider({ - privateKey: "src/fireblocks/__tests__/mock-private-key.txt", - apiKey: "test", - chainId: ChainId.SEPOLIA, - }); - - inner.request = vi.fn(async (args: RequestArguments) => { - switch (args.method) { - case "eth_accounts": - return Promise.resolve([ - "0x1234567890123456789012345678901234567890", - "0x0987654321098765432109876543210987654321", - ]) as R; - case "personal_sign": - return Promise.resolve("0xtest") as R; - case "eth_signTypedData_v4": - return Promise.resolve("0xtest") as R; - default: - return Promise.reject(new Error("Method not found")); - } - }); - - const signer = new FireblocksSigner({ inner }); - - if (auth) { - await signer.authenticate(); - } - - return signer; -}; diff --git a/packages/signers/src/fireblocks/index.ts b/packages/signers/src/fireblocks/index.ts deleted file mode 100644 index cc13dc04f6..0000000000 --- a/packages/signers/src/fireblocks/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { FireblocksSigner } from "./signer.js"; -export type * from "./types.js"; diff --git a/packages/signers/src/fireblocks/signer.ts b/packages/signers/src/fireblocks/signer.ts deleted file mode 100644 index 00b462a769..0000000000 --- a/packages/signers/src/fireblocks/signer.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { - WalletClientSigner, - type SmartAccountAuthenticator, -} from "@alchemy/aa-core"; -import { - FireblocksWeb3Provider, - type FireblocksProviderConfig, -} from "@fireblocks/fireblocks-web3-provider"; -import { - createWalletClient, - custom, - type Hash, - type SignableMessage, - type TypedData, - type TypedDataDefinition, -} from "viem"; -import { signerTypePrefix } from "../constants.js"; -import type { - FireblocksAuthenticationParams, - FireblocksUserInfo, -} from "./types.js"; - -/** - * This class requires the `@fireblocks/fireblocks-web3-provider` dependency. - * `@alchemy/aa-signers` lists it as an optional dependency. - * - * @see https://github.com/fireblocks/fireblocks-web3-provider - */ -export class FireblocksSigner - implements - SmartAccountAuthenticator< - FireblocksAuthenticationParams, - FireblocksUserInfo, - FireblocksWeb3Provider - > -{ - inner: FireblocksWeb3Provider; - private signer: WalletClientSigner | undefined; - - constructor( - params: FireblocksProviderConfig | { inner: FireblocksWeb3Provider } - ) { - if ("inner" in params) { - this.inner = params.inner; - return; - } - - this.inner = new FireblocksWeb3Provider(params); - } - - readonly signerType = `${signerTypePrefix}fireblocks`; - - getAddress = async () => { - if (!this.signer) throw new Error("Not authenticated"); - - const address = await this.signer.getAddress(); - if (address == null) throw new Error("No address found"); - - return address as Hash; - }; - - signMessage = async (msg: SignableMessage) => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.signMessage(msg); - }; - - signTypedData = async < - const TTypedData extends TypedData | { [key: string]: unknown }, - TPrimaryType extends string = string - >( - params: TypedDataDefinition - ) => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.signTypedData(params); - }; - - authenticate = async () => { - if (this.inner == null) throw new Error("No provider found"); - - this.signer = new WalletClientSigner( - createWalletClient({ - transport: custom(this.inner), - }), - this.signerType - ); - - return { addresses: await this.inner.request({ method: "eth_accounts" }) }; - }; - - getAuthDetails = async () => { - if (!this.signer) throw new Error("Not authenticated"); - - return { addresses: await this.inner.request({ method: "eth_accounts" }) }; - }; -} diff --git a/packages/signers/src/fireblocks/types.ts b/packages/signers/src/fireblocks/types.ts deleted file mode 100644 index ea42e3c8af..0000000000 --- a/packages/signers/src/fireblocks/types.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Address } from "viem"; - -export interface FireblocksAuthenticationParams {} - -export type FireblocksUserInfo = { addresses: Address[] }; diff --git a/packages/signers/src/fordefi/__tests__/signer.test.ts b/packages/signers/src/fordefi/__tests__/signer.test.ts deleted file mode 100644 index ce4c467c57..0000000000 --- a/packages/signers/src/fordefi/__tests__/signer.test.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { - type FordefiMethodName, - type FordefiRpcSchema, - FordefiWeb3Provider, - type MethodReturnType, - type RequestArgs, -} from "@fordefi/web3-provider"; -import { numberToHex } from "viem"; -import { FordefiSigner } from "../signer.js"; - -const fixtures = { - address: "0x1234567890123456789012345678901234567890", - chainId: 11155111, - message: "test", - signedMessage: "0xtest", - apiUserToken: "123-456", -} as const; - -describe("Fordefi Signer Tests", () => { - it("should correctly get address", async () => { - const signer = await givenSigner(); - - const address = await signer.getAddress(); - expect(address).toMatchInlineSnapshot(`"${fixtures.address}"`); - }); - - it("should correctly fail to get address if unauthenticated", async () => { - const signer = await givenSigner(false); - - const address = signer.getAddress(); - await expect(address).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly get auth details", async () => { - const signer = await givenSigner(); - - const details = await signer.getAuthDetails(); - expect(details).toBeUndefined(); - }); - - it("should correctly fail to get auth details if unauthenticated", async () => { - const signer = await givenSigner(false); - - const details = signer.getAuthDetails(); - await expect(details).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly sign message if authenticated", async () => { - const signer = await givenSigner(); - - const signMessage = await signer.signMessage(fixtures.message); - expect(signMessage).toMatchInlineSnapshot(`"${fixtures.signedMessage}"`); - }); - - it("should correctly fail to sign message if unauthenticated", async () => { - const signer = await givenSigner(false); - - const signMessage = signer.signMessage(fixtures.message); - await expect(signMessage).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly sign typed data if authenticated", async () => { - const signer = await givenSigner(); - - const typedData = { - types: { - Request: [{ name: "hello", type: "string" }], - }, - primaryType: "Request", - message: { - hello: "world", - }, - }; - const signTypedData = await signer.signTypedData(typedData); - expect(signTypedData).toMatchInlineSnapshot(`"${fixtures.signedMessage}"`); - }); -}); - -const givenSigner = async (auth = true) => { - FordefiWeb3Provider.prototype.request = vi.fn((async < - M extends FordefiMethodName - >( - args: RequestArgs - ) => { - switch (args.method) { - case "eth_accounts": - return Promise.resolve([fixtures.address]) as Promise< - MethodReturnType - >; - case "eth_chainId": - return Promise.resolve(numberToHex(fixtures.chainId)) as Promise< - MethodReturnType - >; - case "personal_sign": - return Promise.resolve(fixtures.signedMessage) as Promise< - MethodReturnType - >; - case "eth_signTypedData_v4": - return Promise.resolve(fixtures.signedMessage) as Promise< - MethodReturnType - >; - default: - return Promise.reject(new Error("Method not found")); - } - }) as FordefiWeb3Provider["request"]); - - const inner = new FordefiWeb3Provider({ - chainId: fixtures.chainId, - address: fixtures.address, - apiUserToken: fixtures.apiUserToken, - apiPayloadSignKey: "fakeApiKey", - }); - - const signer = new FordefiSigner({ inner }); - - if (auth) { - await signer.authenticate(); - } - - return signer; -}; diff --git a/packages/signers/src/fordefi/index.ts b/packages/signers/src/fordefi/index.ts deleted file mode 100644 index 240ef27037..0000000000 --- a/packages/signers/src/fordefi/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { FordefiSigner } from "./signer.js"; diff --git a/packages/signers/src/fordefi/signer.ts b/packages/signers/src/fordefi/signer.ts deleted file mode 100644 index 4156f211fc..0000000000 --- a/packages/signers/src/fordefi/signer.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { - WalletClientSigner, - type SmartAccountAuthenticator, -} from "@alchemy/aa-core"; -import { - type FordefiProviderConfig, - FordefiWeb3Provider, -} from "@fordefi/web3-provider"; -import { - createWalletClient, - custom, - type Hash, - type SignableMessage, - type TypedData, - type TypedDataDefinition, -} from "viem"; -import { signerTypePrefix } from "../constants.js"; - -/** - * This class requires the `@fordefi/web3-provider` dependency. - * `@alchemy/aa-signers` lists it as optional dependency. - * - * @see https://github.com/FordefiHQ/web3-provider - */ -export class FordefiSigner - implements SmartAccountAuthenticator -{ - inner: FordefiWeb3Provider; - private signer: WalletClientSigner | undefined; - - constructor(params: FordefiProviderConfig | { inner: FordefiWeb3Provider }) { - if ("inner" in params) { - this.inner = params.inner; - return; - } - - this.inner = new FordefiWeb3Provider(params); - } - - readonly signerType = `${signerTypePrefix}fordefi`; - - /** - * Returns the address managed by this signer. - * - * @returns the address managed by this signer - * @throws if the provider is not authenticated, or if the address was not found - */ - getAddress = async () => { - if (!this.signer) throw new Error("Not authenticated"); - - const address = await this.signer.getAddress(); - if (address == null) throw new Error("No address found"); - - return address satisfies Hash; - }; - - /** - * Signs a message with the authenticated account. - * - * @param msg the message to sign - * @returns the address of the authenticated account - * @throws if the provider is not authenticated - */ - signMessage = async (msg: SignableMessage) => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.signMessage(msg); - }; - - /** - * Signs a typed data object with the authenticated account. - * - * @param params the data object to sign - * @returns the signed data as a hex string - * @throws if the provider is not authenticated - */ - signTypedData = async < - const TTypedData extends TypedData | { [key: string]: unknown }, - TPrimaryType extends string = string - >( - params: TypedDataDefinition - ) => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.signTypedData(params); - }; - - /** - * Authenticates with the Fordefi platform and verifies that this client - * is authorized to manage the account. - * This step is required before any signing operations can be performed. - * - * @returns void - * @throws if no provider was found, or if authentication failed - */ - authenticate = async (): Promise => { - if (this.inner == null) throw new Error("No provider found"); - - await this.inner.connect(); - - this.signer = new WalletClientSigner( - createWalletClient({ - transport: custom(this.inner), - }), - this.signerType - ); - - return this.getAuthDetails(); - }; - - /** - * Verifies that this signer is authenticated, and throws an error otherwise. - * Authentication details are not available. - * - * @returns void - * @throws Error if this signer is not authenticated - */ - getAuthDetails = async (): Promise => { - if (!this.signer) throw new Error("Not authenticated"); - }; -} diff --git a/packages/signers/src/index.ts b/packages/signers/src/index.ts deleted file mode 100644 index 7cb8563c6a..0000000000 --- a/packages/signers/src/index.ts +++ /dev/null @@ -1,36 +0,0 @@ -export { - CapsuleSigner, - type CapsuleAuthenticationParams, -} from "./capsule/index.js"; -export { - FireblocksSigner, - type FireblocksAuthenticationParams, -} from "./fireblocks/index.js"; -export { MagicSigner, type MagicAuthParams } from "./magic/index.js"; -export { - ParticleSigner, - type ParticleAuthenticationParams, -} from "./particle/index.js"; -export { - PortalSigner, - type PortalAuthenticationParams, -} from "./portal/index.js"; -export { - TurnkeySigner, - TurnkeySubOrganization, - type TurnkeyAuthParams, -} from "./turnkey/index.js"; -export { - Web3AuthSigner, - type Web3AuthAuthenticationParams, -} from "./web3auth/index.js"; -export { - LitSigner, - type LitConfig, - type LitAuthenticateProps, -} from "./lit-protocol/index.js"; -export { - ArcanaAuthSigner, - type ArcanaAuthAuthenticationParams, -} from "./arcana-auth/index.js"; -export { FordefiSigner } from "./fordefi/index.js"; diff --git a/packages/signers/src/lit-protocol/__tests__/data.ts b/packages/signers/src/lit-protocol/__tests__/data.ts deleted file mode 100644 index be47cbc9c2..0000000000 --- a/packages/signers/src/lit-protocol/__tests__/data.ts +++ /dev/null @@ -1,69 +0,0 @@ -import type { LitSessionSigsMap } from "../types.js"; - -export const MOCK_SESSION: LitSessionSigsMap = { - "https://cayenne.litgateway.com:7370": { - sig: "4602ce38b1d7838d62cac0027cf2cbf19f29eab5d0526fd4c41cbb44f2a8e174230cb00c32973f99d02b7e762a6113e0c1ca876edec832f055c487f18db66c0c", - derivedVia: "litSessionSignViaNacl", - signedMessage: - '{"sessionKey":"9130d115e4b02bf53367392d343f0ee9804880ebac0648be17178f5dfc92ea9b","resourceAbilityRequests":[{"resource":{"resource":"*","resourcePrefix":"lit-litaction"},"ability":"pkp-signing"}],"capabilities":[{"sig":"0xef364dda26a85b128a812efc0ab2fb63065b78f9594aaa908688c2dd3b7876e041c256a5d2359079beab55df6842bf3aab9e16ca34c7333bebc4a00809b515b71b","derivedVia":"web3.eth.personal.sign via Lit PKP","signedMessage":"localhost:3000 wants you to sign in with your Ethereum account:\\n0xfB3b886A3579d2D82F6333E8D84A19F550891E13\\n\\nLit Protocol PKP session signature I further authorize the stated URI to perform the following actions on my behalf: (1) \'*\': \'*\' for \'lit-litaction://*\'.\\n\\nURI: lit:session:9130d115e4b02bf53367392d343f0ee9804880ebac0648be17178f5dfc92ea9b\\nVersion: 1\\nChain ID: 1\\nNonce: WZsOAM0hBBUrY7QlG\\nIssued At: 2023-12-10T17:24:26.910Z\\nExpiration Time: 2023-12-17T17:24:25.843Z\\nResources:\\n- urn:recap:eyJhdHQiOnsibGl0LWxpdGFjdGlvbjovLyoiOnsiKi8qIjpbe31dfX0sInByZiI6W119","address":"0xfB3b886A3579d2D82F6333E8D84A19F550891E13"}],"issuedAt":"2023-12-10T17:24:28.230Z","expiration":"2023-12-10T17:29:28.230Z","nodeAddress":"https://cayenne.litgateway.com:7370"}', - address: "9130d115e4b02bf53367392d343f0ee9804880ebac0648be17178f5dfc92ea9b", - algo: "ed25519", - }, - "https://cayenne.litgateway.com:7371": { - sig: "b069d358773b8f6926e832d04f4f454c457bef99ce498f108cab5fa086cc3739983bc6fa848a3389cc29d20987fd9637ac0053af1dcb43c9f19e2c23648e5c08", - derivedVia: "litSessionSignViaNacl", - signedMessage: - '{"sessionKey":"9130d115e4b02bf53367392d343f0ee9804880ebac0648be17178f5dfc92ea9b","resourceAbilityRequests":[{"resource":{"resource":"*","resourcePrefix":"lit-litaction"},"ability":"pkp-signing"}],"capabilities":[{"sig":"0xef364dda26a85b128a812efc0ab2fb63065b78f9594aaa908688c2dd3b7876e041c256a5d2359079beab55df6842bf3aab9e16ca34c7333bebc4a00809b515b71b","derivedVia":"web3.eth.personal.sign via Lit PKP","signedMessage":"localhost:3000 wants you to sign in with your Ethereum account:\\n0xfB3b886A3579d2D82F6333E8D84A19F550891E13\\n\\nLit Protocol PKP session signature I further authorize the stated URI to perform the following actions on my behalf: (1) \'*\': \'*\' for \'lit-litaction://*\'.\\n\\nURI: lit:session:9130d115e4b02bf53367392d343f0ee9804880ebac0648be17178f5dfc92ea9b\\nVersion: 1\\nChain ID: 1\\nNonce: WZsOAM0hBBUrY7QlG\\nIssued At: 2023-12-10T17:24:26.910Z\\nExpiration Time: 2023-12-17T17:24:25.843Z\\nResources:\\n- urn:recap:eyJhdHQiOnsibGl0LWxpdGFjdGlvbjovLyoiOnsiKi8qIjpbe31dfX0sInByZiI6W119","address":"0xfB3b886A3579d2D82F6333E8D84A19F550891E13"}],"issuedAt":"2023-12-10T17:24:28.230Z","expiration":"2023-12-10T17:29:28.230Z","nodeAddress":"https://cayenne.litgateway.com:7371"}', - address: "9130d115e4b02bf53367392d343f0ee9804880ebac0648be17178f5dfc92ea9b", - algo: "ed25519", - }, - "https://cayenne.litgateway.com:7372": { - sig: "88e471cd53b41daba9904c0454dbcd3e050c200885b792f9b4213d52ef43fb77074ab38b74f6bbe6d72342a979e85996617bad03d6b26deeaf3946a102b93308", - derivedVia: "litSessionSignViaNacl", - signedMessage: - '{"sessionKey":"9130d115e4b02bf53367392d343f0ee9804880ebac0648be17178f5dfc92ea9b","resourceAbilityRequests":[{"resource":{"resource":"*","resourcePrefix":"lit-litaction"},"ability":"pkp-signing"}],"capabilities":[{"sig":"0xef364dda26a85b128a812efc0ab2fb63065b78f9594aaa908688c2dd3b7876e041c256a5d2359079beab55df6842bf3aab9e16ca34c7333bebc4a00809b515b71b","derivedVia":"web3.eth.personal.sign via Lit PKP","signedMessage":"localhost:3000 wants you to sign in with your Ethereum account:\\n0xfB3b886A3579d2D82F6333E8D84A19F550891E13\\n\\nLit Protocol PKP session signature I further authorize the stated URI to perform the following actions on my behalf: (1) \'*\': \'*\' for \'lit-litaction://*\'.\\n\\nURI: lit:session:9130d115e4b02bf53367392d343f0ee9804880ebac0648be17178f5dfc92ea9b\\nVersion: 1\\nChain ID: 1\\nNonce: WZsOAM0hBBUrY7QlG\\nIssued At: 2023-12-10T17:24:26.910Z\\nExpiration Time: 2023-12-17T17:24:25.843Z\\nResources:\\n- urn:recap:eyJhdHQiOnsibGl0LWxpdGFjdGlvbjovLyoiOnsiKi8qIjpbe31dfX0sInByZiI6W119","address":"0xfB3b886A3579d2D82F6333E8D84A19F550891E13"}],"issuedAt":"2023-12-10T17:24:28.230Z","expiration":"2023-12-10T17:29:28.230Z","nodeAddress":"https://cayenne.litgateway.com:7372"}', - address: "9130d115e4b02bf53367392d343f0ee9804880ebac0648be17178f5dfc92ea9b", - algo: "ed25519", - }, -}; - -export const TEST_CONTEXT = { - CONTROLLER_AUTHSIG: { - sig: "0x3c1908bcc0ae121c72c6088eac009ba2054796100eeb4aabfe20478b5f2bd6d7060b4513df2f3a15d5d6f41c54d55dfa952d8dc808fb19aa8f7137ce998199c71b", - derivedVia: "web3.eth.personal.sign", - signedMessage: - "localhost wants you to sign in with your Ethereum account:\n" + - "0xeF71c2604f17Ec6Fc13409DF24EfdC440D240d37\n" + - "\n" + - "This is a test statement. You can put anything you want here.\n" + - "\n" + - "URI: https://localhost/login\n" + - "Version: 1\n" + - "Chain ID: 1\n" + - "Nonce: qmpK6b1c2t0Dt3ZU9\n" + - "Issued At: 2023-12-10T16:08:16.725Z\n" + - "Expiration Time: 2024-06-05T02:28:16.723Z", - address: "0xeF71c2604f17Ec6Fc13409DF24EfdC440D240d37", - }, - PKP_INFO: { - publicKey: - "04f4cd980d2e41d80872b7465cdbfb7ef6dbe5a7354f583ebaf6333194dd2e31d257933cad9bf317ffd7519bab03ada9ede80987732bc889de5066033d57dc5399", - ethAddress: "0xfB3b886A3579d2D82F6333E8D84A19F550891E13", - authMethod: { - authMethodId: - "0x170d13600caea2933912f39a0334eca3d22e472be203f937c4bad0213d92ed71", - authMethodType: 1, - }, - }, - AUTH_NEEDED_CB_RES: { - authSig: { - sig: "0x07069c9d252a1fecdc56ab38bb2cda62d79b966f57a11c9136cd9c221e8563735199b53948fd8df61884d856919561b4b48beeabd2baad11bde2490f3b60e50d1b", - derivedVia: "web3.eth.personal.sign via Lit PKP", - signedMessage: - "localhost:3000 wants you to sign in with your Ethereum account:\n0xfB3b886A3579d2D82F6333E8D84A19F550891E13\n\nLit Protocol PKP session signature I further authorize the stated URI to perform the following actions on my behalf: (1) '*': '*' for 'lit-litaction://*'.\n\nURI: lit:session:ccad2c92e8d52c6221d4e15194a4d57bd442a75a8be27f9b09d4ef5f26d67c4f\nVersion: 1\nChain ID: 1\nNonce: pK9FZb51gdRUGGEyr\nIssued At: 2023-12-12T20:43:05.224Z\nExpiration Time: 2023-12-19T20:43:05.222Z\nResources:\n- urn:recap:eyJhdHQiOnsibGl0LWxpdGFjdGlvbjovLyoiOnsiKi8qIjpbe31dfX0sInByZiI6W119", - address: "0xfB3b886A3579d2D82F6333E8D84A19F550891E13", - }, - pkpPublicKey: - "04f4cd980d2e41d80872b7465cdbfb7ef6dbe5a7354f583ebaf6333194dd2e31d257933cad9bf317ffd7519bab03ada9ede80987732bc889de5066033d57dc5399", - }, -}; diff --git a/packages/signers/src/lit-protocol/__tests__/signer.test.ts b/packages/signers/src/lit-protocol/__tests__/signer.test.ts deleted file mode 100644 index 885d472d37..0000000000 --- a/packages/signers/src/lit-protocol/__tests__/signer.test.ts +++ /dev/null @@ -1,95 +0,0 @@ -import type { PKPEthersWallet } from "@lit-protocol/pkp-ethers"; -import { LitSigner } from "../signer.js"; -import type { LitAuthMethod } from "../index.js"; -import { MOCK_SESSION, TEST_CONTEXT } from "./data.js"; -import type { LitNodeClient } from "@lit-protocol/lit-node-client"; - -describe("Lit Protocol Signer Tests", () => { - let signer: LitSigner | undefined; - beforeAll(async () => { - signer = await setup(); - await signer?.authenticate({ - context: { - authMethodType: 1, - accessToken: JSON.stringify(TEST_CONTEXT.CONTROLLER_AUTHSIG), - }, - }); - }); - - it("should correctly get address if authenticated", async () => { - let sessionSignatures = await signer?.getAuthDetails(); - expect(sessionSignatures).toBeDefined(); - expect((await signer?.getAddress())?.toLowerCase()).toEqual( - TEST_CONTEXT.PKP_INFO.ethAddress.toLowerCase() - ); - }); - - it("should return auth details if authenticated", async () => { - let sessionSignatures = await signer?.getAuthDetails(); - expect(sessionSignatures).toBeDefined(); - }); - - it("should sign typed data if authenticated", async () => { - const typedData = { - types: { - Request: [{ name: "hello", type: "string" }], - }, - primaryType: "Request", - message: { - hello: "world", - }, - }; - const signTypedData = await signer?.signTypedData(typedData); - expect(signTypedData).toMatchInlineSnapshot('"0xtest"'); - }); - - it("should sign message if authenticated", async () => { - const signTypedData = await signer?.signMessage("Hello Alchemy AA SDK"); - expect(signTypedData).toMatchInlineSnapshot('"0xtest"'); - }); - - it("should throw expection if not authenticated", async () => { - const signer = new LitSigner({ - rpcUrl: "foo.bar", - pkpPublicKey: "041234534abcd", - }); - - expect(signer.getAddress()).rejects.toThrowError(); - }); -}); - -const setup = async () => { - const signer = new LitSigner({ - rpcUrl: "https://endpoints.omniatech.io/v1/matic/mumbai/public", - pkpPublicKey: TEST_CONTEXT.PKP_INFO.publicKey, - }); - signer.inner.connect = vi.fn().mockImplementation(() => { - return new Promise((res, _) => res()); - }); - signer.inner.signSessionKey = vi.fn().mockImplementation(() => { - return TEST_CONTEXT.AUTH_NEEDED_CB_RES; - }); - signer.inner.ready = true; - await signer?.authenticate({ - context: { - authMethodType: 1, - accessToken: JSON.stringify(TEST_CONTEXT.CONTROLLER_AUTHSIG), - }, - }); - (signer.signer as PKPEthersWallet).getAddress = vi - .fn() - .mockResolvedValue(TEST_CONTEXT.PKP_INFO.ethAddress); - - (signer.inner as LitNodeClient).getSessionSigs = vi - .fn() - .mockResolvedValue(MOCK_SESSION); - - (signer.signer as PKPEthersWallet)._signTypedData = vi - .fn() - .mockResolvedValue("0xtest"); - - (signer.signer as PKPEthersWallet).signMessage = vi - .fn() - .mockResolvedValue("0xtest"); - return signer; -}; diff --git a/packages/signers/src/lit-protocol/index.ts b/packages/signers/src/lit-protocol/index.ts deleted file mode 100644 index 928f779105..0000000000 --- a/packages/signers/src/lit-protocol/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./signer.js"; -export type * from "./types.js"; diff --git a/packages/signers/src/lit-protocol/signer.ts b/packages/signers/src/lit-protocol/signer.ts deleted file mode 100644 index 6b6ed84bd9..0000000000 --- a/packages/signers/src/lit-protocol/signer.ts +++ /dev/null @@ -1,232 +0,0 @@ -import { LitAbility, LitPKPResource } from "@lit-protocol/auth-helpers"; -import { ALL_LIT_CHAINS } from "@lit-protocol/constants"; -import { generateSessionKeyPair } from "@lit-protocol/crypto"; -import { LitNodeClient } from "@lit-protocol/lit-node-client"; -import { PKPEthersWallet } from "@lit-protocol/pkp-ethers"; -import { - type AuthCallbackParams, - type AuthSig, - type LITEVMChain, - type SessionSigsMap, -} from "@lit-protocol/types"; -import { - type Address, - type Hex, - type SignableMessage, - type TypedData, - type TypedDataDefinition, - type TypedDataDomain, -} from "viem"; -import { signerTypePrefix } from "../constants.js"; -import { - type LitAuthMethod, - type LitAuthenticateProps, - type LitConfig, - type LitSessionSigsMap, - type LitSmartAccountAuthenticator, - type LitUserMetadata, -} from "./types.js"; - -const SIGNER_TYPE: string = `${signerTypePrefix}lit`; - -/** - * Implementation of `SmartAccountAuthenticator` for lit protocol - * This class requies: - * `@lit-protocol/lit-node-client@cayenne` - * `@lit-protocol/pkp-ethers@cayenne` - * `@lit-protocol/crypto@cayenne` - * `@lit-protocol/auth-helpers@cayenne` - * `@lit-protocol/types@cayenne` - */ -export class LitSigner - implements LitSmartAccountAuthenticator -{ - inner: LitNodeClient; - public signer: PKPEthersWallet | undefined; - private _pkpPublicKey: string; - private _rpcUrl: string; - private _authContext: C | undefined; - public session: SessionSigsMap | undefined; - - constructor(params: LitConfig) { - this._pkpPublicKey = params.pkpPublicKey; - this.inner = - params.inner ?? - new LitNodeClient({ - litNetwork: params.network ?? "cayenne", - debug: params.debug ?? false, - }); - this._rpcUrl = params.rpcUrl; - } - signerType: string = SIGNER_TYPE; - - /** - * if generic type is `LitAuthMethod`, authenticates the supplied authentication material. - * if type `SessionSigsMap`, this implementation will respect the existing auth and use the session material. - * - * @param props {LitAuthenticateProps} Authentication params, only `context` is required - * @returns Authenticated session material - * @throws if authentication operations fail this error is thrown - */ - authenticate = async ( - props: LitAuthenticateProps - ): Promise => { - if (!this.session) { - // runs authentication logic - await this._doAuthentication(props); - } - - // check on internal state for authentication status - if (!this.session) { - throw new Error("Not Authenticated"); - } - - return this.session; - }; - - getAuthDetails = async (): Promise => { - this._checkInternals(); - return this._authContext as LitSessionSigsMap; - }; - - getAddress = async () => { - this._checkInternals(); - return this.signer?.getAddress() as Promise
; - }; - - signMessage = async (msg: SignableMessage) => { - this._checkInternals(); - - return this.signer?.signMessage( - typeof msg === "string" ? msg : msg.raw - ) as Promise; - }; - - signTypedData = async < - const TTypedData extends TypedData | { [key: string]: unknown }, - TPrimaryType extends string = string - >( - params: TypedDataDefinition - ) => { - this._checkInternals(); - - return this.signer?._signTypedData( - params.domain as TypedDataDomain, - params.types as any, - params.message as Record - ) as Promise; - }; - - private _checkInternals() { - if (!this._authContext) { - throw new Error("Not Authenticated"); - } - - if (!this.signer) { - throw new Error("Signer is not initialized, did you call authenticate?"); - } - } - - /** - * Runs the Lit Protocol authentication operations for a given piece of authentication material - * - * AuthMethod -> authenticates the auth material and signs a session. - * - * SessionSigsMap -> uses the session to create a signer instance. - * - * For more information on Lit Authentication see below: - * - * https://developer.litprotocol.com/v3/sdk/authentication/overview - * - * @param props {LitAuthenticationProps} properties for configuring authentication operations - */ - private async _doAuthentication(props: LitAuthenticateProps) { - /** - * Check if the object is structured as an auth method - * if so, we sign the session key with the auth method - * as the auth material. Otherwise, if a session signature - * is provided, then we skip this step. - */ - if (Object.keys(props.context).indexOf("accessToken") > 0) { - const resourceAbilities = [ - { - resource: new LitPKPResource("*"), - ability: LitAbility.PKPSigning, - }, - ]; - const sessionKeypair = props.sessionKeypair || generateSessionKeyPair(); - const chain = props.chain || "ethereum"; - const chainInfo = ALL_LIT_CHAINS[chain]; - - const chainId = (chainInfo as LITEVMChain).chainId ?? 1; - let authNeededCallback: any; - if (props.context?.authMethodType === 1) { - authNeededCallback = async (params: AuthCallbackParams) => { - const response = await this.inner.signSessionKey({ - statement: params.statement, - authMethods: [props.context as LitAuthMethod], - authSig: JSON.parse(props.context.accessToken as string) as AuthSig, - pkpPublicKey: `0x${this._pkpPublicKey}`, - expiration: params.expiration, - resources: params.resources, - chainId: chainId, - }); - return response.authSig; - }; - } else { - authNeededCallback = async (params: AuthCallbackParams) => { - const response = await this.inner.signSessionKey({ - statement: params.statement, - sessionKey: sessionKeypair, - authMethods: [props.context as LitAuthMethod], - pkpPublicKey: `0x${this._pkpPublicKey}`, - expiration: params.expiration, - resources: params.resources, - chainId: chainId, - }); - return response.authSig; - }; - } - - if (!this.inner.ready) { - await this.inner.connect(); - } - - const sessionSigs = await this.inner - .getSessionSigs({ - chain, - expiration: - props.expiration ?? - // set default exp to 1 week if not provided - new Date(Date.now() + 60 * 60 * 24 * 7).toISOString(), - resourceAbilityRequests: resourceAbilities, - authNeededCallback, - }) - .catch((err) => { - throw err; - }); - - this._authContext = props.context; - this.session = sessionSigs; - - this.signer = new PKPEthersWallet({ - pkpPubKey: this._pkpPublicKey, - rpc: this._rpcUrl, - controllerSessionSigs: sessionSigs as LitSessionSigsMap, - }); - - await this.signer.init(); - } else { - this._authContext = props.context; - this.session = props.context as SessionSigsMap; - - this.signer = new PKPEthersWallet({ - pkpPubKey: this._pkpPublicKey, - rpc: this._rpcUrl, - controllerSessionSigs: this._authContext as LitSessionSigsMap, - }); - - await this.signer.init(); - } - } -} diff --git a/packages/signers/src/lit-protocol/types.ts b/packages/signers/src/lit-protocol/types.ts deleted file mode 100644 index 0f9edbfd64..0000000000 --- a/packages/signers/src/lit-protocol/types.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { SmartAccountAuthenticator } from "@alchemy/aa-core"; -import type { LitNodeClient } from "@lit-protocol/lit-node-client"; -import { - type AuthMethod, - type SessionSigsMap, - type SessionKeyPair, -} from "@lit-protocol/types"; - -export type LitAuthMethod = AuthMethod; -export type LitSessionSigsMap = SessionSigsMap; -export type LitUserMetadata = LitSessionSigsMap; -export interface LitConfig { - pkpPublicKey: string; - rpcUrl: string; - inner?: LitNodeClient; - network?: string; - debug?: boolean; -} - -/** - * Properties for configuring authentication operations - * see here for chain identifiers if none is passed `ethereum` will be used as the default. - * https://developer.litprotocol.com/v3/resources/supported-chains/ - */ -export interface LitAuthenticateProps< - C extends LitAuthMethod | LitSessionSigsMap -> { - context: C; - expiration?: string; - sessionKeypair?: SessionKeyPair; - chain?: string; -} - -export type LitSmartAccountAuthenticator< - C extends LitAuthMethod | LitSessionSigsMap -> = SmartAccountAuthenticator< - LitAuthenticateProps, - LitUserMetadata, - LitNodeClient | undefined ->; diff --git a/packages/signers/src/magic/__tests__/signer.test.ts b/packages/signers/src/magic/__tests__/signer.test.ts deleted file mode 100644 index 79294e017b..0000000000 --- a/packages/signers/src/magic/__tests__/signer.test.ts +++ /dev/null @@ -1,119 +0,0 @@ -import { Magic } from "magic-sdk"; -import { MagicSigner } from "../signer.js"; - -describe("Magic Signer Tests", () => { - it("should correctly get address if authenticated", async () => { - const signer = await givenSigner(); - - const address = await signer.getAddress(); - expect(address).toMatchInlineSnapshot( - '"0x1234567890123456789012345678901234567890"' - ); - }); - - it("should correctly fail to get address if unauthenticated", async () => { - const signer = await givenSigner(false); - - const address = signer.getAddress(); - await expect(address).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly get auth details if authenticated", async () => { - const signer = await givenSigner(); - - const details = await signer.getAuthDetails(); - expect(details).toMatchInlineSnapshot(` - { - "email": "test", - "isMfaEnabled": false, - "issuer": null, - "phoneNumber": "1234567890", - "publicAddress": "0x1234567890123456789012345678901234567890", - "recoveryFactors": [], - } - `); - }); - - it("should correctly fail to get auth details if unauthenticated", async () => { - const signer = await givenSigner(false); - - const details = signer.getAuthDetails(); - await expect(details).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly sign message if authenticated", async () => { - const signer = await givenSigner(); - - const signMessage = await signer.signMessage("test"); - expect(signMessage).toMatchInlineSnapshot('"0xtest"'); - }); - - it("should correctly fail to sign message if unauthenticated", async () => { - const signer = await givenSigner(false); - - const signMessage = signer.signMessage("test"); - await expect(signMessage).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly sign typed data if authenticated", async () => { - const signer = await givenSigner(); - - const typedData = { - types: { - Request: [{ name: "hello", type: "string" }], - }, - primaryType: "Request", - message: { - hello: "world", - }, - }; - const signTypedData = await signer.signTypedData(typedData); - expect(signTypedData).toMatchInlineSnapshot('"0xtest"'); - }); -}); - -const givenSigner = async (auth = true) => { - const inner = new Magic("test"); - - inner.user.getInfo = vi.fn().mockResolvedValue({ - publicAddress: "0x1234567890123456789012345678901234567890", - issuer: null, - email: "test", - phoneNumber: "1234567890", - isMfaEnabled: false, - recoveryFactors: [], - }); - - inner.wallet.getProvider = vi.fn().mockResolvedValue({ - request: ({ method }: { method: string; params: any[] }) => { - switch (method) { - case "eth_accounts": - return Promise.resolve([ - "0x1234567890123456789012345678901234567890", - ]); - case "personal_sign": - return Promise.resolve("0xtest"); - case "eth_signTypedData_v4": - return Promise.resolve("0xtest"); - default: - return Promise.reject(new Error("Method not found")); - } - }, - }); - - const signer = new MagicSigner({ inner }); - - if (auth) { - await signer.authenticate({ - authenticate: () => Promise.resolve(), - }); - } - - return signer; -}; diff --git a/packages/signers/src/magic/index.ts b/packages/signers/src/magic/index.ts deleted file mode 100644 index 74393239dc..0000000000 --- a/packages/signers/src/magic/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { MagicSigner } from "./signer.js"; -export type * from "./types.js"; diff --git a/packages/signers/src/magic/signer.ts b/packages/signers/src/magic/signer.ts deleted file mode 100644 index 2b0b756280..0000000000 --- a/packages/signers/src/magic/signer.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { - WalletClientSigner, - type SmartAccountAuthenticator, -} from "@alchemy/aa-core"; -import { Magic, type MagicUserMetadata } from "magic-sdk"; -import { - createWalletClient, - custom, - type Hash, - type SignableMessage, - type TypedData, - type TypedDataDefinition, -} from "viem"; -import { signerTypePrefix } from "../constants.js"; -import type { MagicAuthParams, MagicSDKParams } from "./types.js"; - -/** - * This class requires the `magic-sdk` dependency. - * `@alchemy/aa-signers` lists it as an optional dependency. - * - * @see https://github.com/magiclabs/magic-js) - */ -export class MagicSigner - implements - SmartAccountAuthenticator -{ - inner: Magic; - private signer: WalletClientSigner | undefined; - - constructor(params: MagicSDKParams | { inner: Magic }) { - if ("inner" in params) { - this.inner = params.inner; - return; - } - - this.inner = new Magic(params.apiKey, params.options); - } - - readonly signerType = `${signerTypePrefix}magic`; - - getAddress = async () => { - if (!this.signer) throw new Error("Not authenticated"); - - const address = (await this.inner.user.getInfo()).publicAddress; - if (address == null) throw new Error("No address found"); - - return address as Hash; - }; - - signMessage = async (msg: SignableMessage) => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.signMessage(msg); - }; - - signTypedData = async < - const TTypedData extends TypedData | { [key: string]: unknown }, - TPrimaryType extends string = string - >( - params: TypedDataDefinition - ) => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.signTypedData(params); - }; - - authenticate = async (params: MagicAuthParams) => { - await params.authenticate(); - - this.signer = new WalletClientSigner( - createWalletClient({ - transport: custom(await this.inner.wallet.getProvider()), - }), - this.signerType - ); - - return this.inner.user.getInfo(); - }; - - getAuthDetails = async () => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.inner.user.getInfo(); - }; -} diff --git a/packages/signers/src/magic/types.ts b/packages/signers/src/magic/types.ts deleted file mode 100644 index 8b945c4153..0000000000 --- a/packages/signers/src/magic/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { - MagicSDKAdditionalConfiguration, - MagicSDKExtensionsOption, -} from "magic-sdk"; - -export interface MagicAuthParams { - authenticate: () => Promise; -} - -export type MagicSDKParams = { - apiKey: string; - options?: MagicSDKAdditionalConfiguration< - string, - MagicSDKExtensionsOption - >; -}; diff --git a/packages/signers/src/particle/__tests__/signer.test.ts b/packages/signers/src/particle/__tests__/signer.test.ts deleted file mode 100644 index 45e2180120..0000000000 --- a/packages/signers/src/particle/__tests__/signer.test.ts +++ /dev/null @@ -1,149 +0,0 @@ -import { ParticleNetwork, type JsonRpcRequest } from "@particle-network/auth"; -import { ParticleProvider } from "@particle-network/provider"; -import { ParticleSigner } from "../signer.js"; - -describe("Particle Signer Tests", () => { - it("should correctly get address", async () => { - const signer = await givenSigner(); - - const address = await signer.getAddress(); - expect(address).toMatchInlineSnapshot( - '"0x1234567890123456789012345678901234567890"' - ); - }); - - it("should correctly fail to get address if unauthenticated", async () => { - const signer = await givenSigner(false); - - const address = signer.getAddress(); - await expect(address).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly get auth details", async () => { - const signer = await givenSigner(); - - const details = await signer.getAuthDetails(); - expect(details).toMatchInlineSnapshot(` - { - "avatar": "test.png", - "email": "test@gmail.com", - "name": "test", - "phone": "1234567890", - "token": "test", - "uuid": "test", - "wallets": [], - } - `); - }); - - it("should correctly get auth details if unauthenticated but has active account state", async () => { - const signer = await givenSigner(false, true); - - const details = await signer.getAuthDetails(); - expect(details).toMatchInlineSnapshot(` - { - "avatar": "test.png", - "email": "test@gmail.com", - "name": "test", - "phone": "1234567890", - "token": "test", - "uuid": "test", - "wallets": [], - } - `); - }); - - it("should correctly fail to get auth details if unauthenticated", async () => { - const signer = await givenSigner(false); - - const details = signer.getAuthDetails(); - await expect(details).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly sign message if authenticated", async () => { - const signer = await givenSigner(); - - const signMessage = await signer.signMessage("test"); - expect(signMessage).toMatchInlineSnapshot('"0xtest"'); - }); - - it("should correctly fail to sign message if unauthenticated", async () => { - const signer = await givenSigner(false); - - const signMessage = signer.signMessage("test"); - await expect(signMessage).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly sign typed data if authenticated", async () => { - const signer = await givenSigner(); - - const typedData = { - types: { - Request: [{ name: "hello", type: "string" }], - }, - primaryType: "Request", - message: { - hello: "world", - }, - }; - const signTypedData = await signer.signTypedData(typedData); - expect(signTypedData).toMatchInlineSnapshot('"0xtest"'); - }); -}); - -const givenSigner = async (auth = true, isLogin = false) => { - const inner = new ParticleNetwork({ - projectId: "test", - clientKey: "test", - appId: "test", - chainName: "polygon", - chainId: 80001, - }); - - inner.auth.isLogin = () => isLogin; - - inner.auth.getUserInfo = vi.fn().mockResolvedValue({ - uuid: "test", - token: "test", - wallets: [], - name: "test", - avatar: "test.png", - phone: "1234567890", - email: "test@gmail.com", - }); - - const provider = new ParticleProvider(inner.auth); - - provider.request = vi.fn(async (args: Partial) => { - switch (args.method) { - case "eth_accounts": - return Promise.resolve([ - "0x1234567890123456789012345678901234567890", - "0x0987654321098765432109876543210987654321", - ]) as R; - case "personal_sign": - return Promise.resolve("0xtest") as R; - case "eth_signTypedData_v4": - return Promise.resolve("0xtest") as R; - default: - return Promise.reject(new Error("Method not found")); - } - }); - - const signer = new ParticleSigner({ inner, provider }); - - if (auth) { - await signer.authenticate({ - loginOptions: {}, - login: () => Promise.resolve(), - }); - } - - return signer; -}; diff --git a/packages/signers/src/particle/index.ts b/packages/signers/src/particle/index.ts deleted file mode 100644 index 327e5b08af..0000000000 --- a/packages/signers/src/particle/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { ParticleSigner } from "./signer.js"; -export type * from "./types.js"; diff --git a/packages/signers/src/particle/signer.ts b/packages/signers/src/particle/signer.ts deleted file mode 100644 index a0822648ca..0000000000 --- a/packages/signers/src/particle/signer.ts +++ /dev/null @@ -1,141 +0,0 @@ -import { - WalletClientSigner, - type SmartAccountAuthenticator, -} from "@alchemy/aa-core"; -import { - ParticleNetwork, - type Config, - type LoginOptions, -} from "@particle-network/auth"; -import { ParticleProvider } from "@particle-network/provider"; -import { - createWalletClient, - custom, - type Hash, - type SignableMessage, - type TypedData, - type TypedDataDefinition, -} from "viem"; -import { signerTypePrefix } from "../constants.js"; -import type { - ParticleAuthenticationParams, - ParticleUserInfo, -} from "./types.js"; - -/** - * This class requires the `@particle-network/auth` and `@particle-network/provider` dependencies. - * `@alchemy/aa-signers` lists thems as an optional dependencies. - * - * @see https://docs.particle.network/developers/auth-service/sdks/web - */ -export class ParticleSigner - implements - SmartAccountAuthenticator< - ParticleAuthenticationParams, - ParticleUserInfo, - ParticleNetwork - > -{ - inner: ParticleNetwork; - private provider: ParticleProvider; - private signer: WalletClientSigner | undefined; - - constructor( - params: Config | { inner: ParticleNetwork; provider?: ParticleProvider } - ) { - if ("inner" in params) { - this.inner = params.inner; - this.provider = - params.provider != null - ? params.provider - : new ParticleProvider(this.inner.auth); - - if (this.inner.auth.isLogin()) { - this.signer = new WalletClientSigner( - createWalletClient({ - transport: custom(this.provider), - }), - this.signerType - ); - } - - return; - } - - this.inner = new ParticleNetwork(params); - this.provider = new ParticleProvider(this.inner.auth); - - if (this.inner.auth.isLogin()) { - this.signer = new WalletClientSigner( - createWalletClient({ - transport: custom(this.provider), - }), - this.signerType - ); - } - } - - readonly signerType = `${signerTypePrefix}particle`; - - getAddress = async () => { - if (!this.signer) throw new Error("Not authenticated"); - - const address = await this.signer.getAddress(); - if (address == null) throw new Error("No address found"); - - return address as Hash; - }; - - signMessage = async (msg: SignableMessage) => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.signMessage(msg); - }; - - signTypedData = async < - const TTypedData extends TypedData | { [key: string]: unknown }, - TPrimaryType extends string = string - >( - params: TypedDataDefinition - ) => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.signTypedData(params); - }; - - authenticate = async ( - params: ParticleAuthenticationParams = { - loginOptions: {}, - login: async (loginOptions: LoginOptions) => { - this.inner.auth.login(loginOptions); - }, - } - ) => { - if (this.inner == null) throw new Error("No provider found"); - - await params.login(params.loginOptions); - - this.signer = new WalletClientSigner( - createWalletClient({ - transport: custom(this.provider), - }), - this.signerType - ); - - const userInfo = this.inner.auth.getUserInfo(); - - if (userInfo == null) throw new Error("No user info found"); - - return userInfo; - }; - - getAuthDetails = async () => { - if (!this.signer) throw new Error("Not authenticated"); - - const userInfo = this.inner.auth.getUserInfo(); - - if (userInfo == null) throw new Error("No user info found"); - - return userInfo; - }; -} diff --git a/packages/signers/src/particle/types.ts b/packages/signers/src/particle/types.ts deleted file mode 100644 index e4cec00d59..0000000000 --- a/packages/signers/src/particle/types.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { type LoginOptions, type UserInfo } from "@particle-network/auth"; - -export interface ParticleAuthenticationParams { - loginOptions: LoginOptions; - login: (loginOptions: LoginOptions) => Promise; -} - -export type ParticleUserInfo = UserInfo; diff --git a/packages/signers/src/passport/__tests__/signer.test.ts b/packages/signers/src/passport/__tests__/signer.test.ts deleted file mode 100644 index 8f09b114b8..0000000000 --- a/packages/signers/src/passport/__tests__/signer.test.ts +++ /dev/null @@ -1,159 +0,0 @@ -import { Passport, type PassportConstructorParams } from "@0xpass/passport"; -import { WebauthnSigner } from "@0xpass/webauthn-signer"; -import { PassportSigner } from "../signer.js"; -import { mainnet } from "viem/chains"; - -describe("Passport Signer Tests", () => { - it("should correctly get address if authenticated", async () => { - const signer = await givenSigner(true); - - const address = await signer.getAddress(); - expect(address).toMatchInlineSnapshot( - '"0x1234567890123456789012345678901234567890"' - ); - }); -}); - -it("should correctly fail to get address if unauthenticated", async () => { - const signer = await givenSigner(false); - - const address = signer.getAddress(); - await expect(address).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); -}); - -it("should correctly get auth details if authenticated", async () => { - const signer = await givenSigner(); - - const details = await signer.getAuthDetails(); - expect(details).toMatchInlineSnapshot(` - { - "addresses": [ - "0x1234567890123456789012345678901234567890", - ], - "authenticatedHeaders": { - "x-encrypted-key": "encrypted_aes_key", - "x-session": "encrypted_jwt", - }, - } -`); -}); - -it("should correctly fail to get auth details if unauthenticated", async () => { - const signer = await givenSigner(false); - - const details = signer.getAuthDetails(); - await expect(details).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); -}); - -it("should correctly sign message if authenticated", async () => { - const signer = await givenSigner(); - - const signMessage = await signer.signMessage("test"); - expect(signMessage).toMatchInlineSnapshot('"0xtest"'); -}); - -it("should correctly fail to sign message if unauthenticated", async () => { - const signer = await givenSigner(false); - - const signMessage = signer.signMessage("test"); - await expect(signMessage).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); -}); - -it("should correctly sign typed data if authenticated", async () => { - const signer = await givenSigner(); - - const typedData = { - domain: { - name: "Ether Mail", - version: "1", - chainId: 1, - verifyingContract: "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC", - }, - types: { - Person: [ - { name: "name", type: "string" }, - { name: "wallet", type: "address" }, - ], - Mail: [ - { name: "from", type: "Person" }, - { name: "to", type: "Person" }, - { name: "contents", type: "string" }, - ], - }, - primaryType: "Mail", - message: { - from: { - name: "Cow", - wallet: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", - }, - to: { - name: "Bob", - wallet: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB", - }, - contents: "Hello, Bob!", - }, - }; - - const signTypedData = await signer.signTypedData(typedData); - expect(signTypedData).toMatchInlineSnapshot('"0xtest"'); -}); - -class TestPassport extends Passport { - constructor(config: PassportConstructorParams) { - super(config); - - const ENCRYPTED_AES_KEY = - "jCQUpLs717SowbGoH7gdeeRmNE1le0Qg2wORqSIGEWDxuQn7ijOmEQI6gZpdXHgYOKCnLbCl2D1PeG/c3FL3VjquxDiC0/LfrBT4S2JZp0LGSRkT8+l7yR0hhltDUYXjfTj3p1Zdyn13git8WK5mijDZ5jI6r+8t3+IC/VkgIAq6z7eyfh6XQGprgwCcVh7tEcUGpKtHWkwMWExOjUgtIZfn1NFGAb9LwsC/6tGri0jIY3X0fU4XEBzMntA2Pep1/bxGuxgY2QGStiI9gKnXyuB2QyQtQ0SX92oVsjeHHXVIYhRuzV21Udln2QkxURquOhcIuPS+9nI674X2qLC60A=="; - - const AES_KEY_ARRAY = [ - 63, 126, 199, 191, 143, 250, 69, 51, 5, 155, 5, 208, 241, 216, 170, 132, - 244, 43, 103, 155, 145, 171, 155, 160, 202, 110, 173, 134, 179, 13, 145, - 34, - ]; - - this.aesKey = new Uint8Array(AES_KEY_ARRAY).buffer; - this.encryptedAesKey = ENCRYPTED_AES_KEY; - } -} - -const givenSigner = async (auth = true) => { - const inner = new TestPassport({ - signer: new WebauthnSigner({ - rpId: "rpId", - rpName: "rpName", - }), - }); - - inner.authenticate = vi.fn().mockResolvedValue([ - { - "x-encrypted-key": "encrypted_aes_key", - "x-session": "encrypted_jwt", - }, - "0x1234567890123456789012345678901234567890", - ]); - - const signer = new PassportSigner({ inner }); - - if (auth) { - await signer.authenticate({ - username: "test", - userDisplayName: "test", - chain: mainnet, - fallbackProvider: "fallbackProvider", - }); - - vi.spyOn(signer, "getAddress").mockResolvedValue( - "0x1234567890123456789012345678901234567890" - ); - vi.spyOn(signer, "signMessage").mockResolvedValue("0xtest"); - vi.spyOn(signer, "signTypedData").mockResolvedValue("0xtest"); - } - - return signer; -}; diff --git a/packages/signers/src/passport/index.ts b/packages/signers/src/passport/index.ts deleted file mode 100644 index e4c6f3325e..0000000000 --- a/packages/signers/src/passport/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { PassportSigner } from "./signer.js"; -export type * from "./types.js"; diff --git a/packages/signers/src/passport/signer.ts b/packages/signers/src/passport/signer.ts deleted file mode 100644 index 275a29591f..0000000000 --- a/packages/signers/src/passport/signer.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { - WalletClientSigner, - type SmartAccountAuthenticator, -} from "@alchemy/aa-core"; -import { signerTypePrefix } from "../constants.js"; -import type { - PassportAuthenticationParams, - PassportClientParams, - PassportUserInfo, -} from "./types"; -import { Passport } from "@0xpass/passport"; -import { createPassportClient } from "@0xpass/passport-viem-alchemy"; -import { http } from "viem"; -import type { TypedDataDefinition, WalletClient, SignableMessage } from "viem"; - -export class PassportSigner - implements - SmartAccountAuthenticator< - PassportAuthenticationParams, - PassportUserInfo, - Passport - > -{ - inner: Passport; - private signer: WalletClientSigner | undefined; - private authDetails: PassportUserInfo | undefined; - - constructor(params: PassportClientParams | { inner: Passport }) { - if ("inner" in params) { - this.inner = params.inner; - } else { - this.inner = new Passport(params); - } - } - - readonly signerType = `${signerTypePrefix}passport`; - - getAddress = async () => { - if (!this.inner || !this.signer) { - throw new Error("Not authenticated"); - } - - return this.signer.getAddress(); - }; - - signMessage = async (msg: SignableMessage) => { - if (!this.inner || !this.signer) { - throw new Error("Not authenticated"); - } - return this.signer.signMessage(msg); - }; - - signTypedData = async < - const TTypedData extends Record, - TPrimaryType extends string = string - >( - params: TypedDataDefinition - ) => { - if (!this.inner || !this.signer) { - throw new Error("Not authenticated"); - } - - return this.signer.signTypedData(params); - }; - - authenticate = async (params: PassportAuthenticationParams) => { - if (this.inner == null) throw new Error("No provider found"); - - await this.inner.setupEncryption(); - const [authenticatedHeaders, address] = await this.inner.authenticate({ - username: params.username, - userDisplayName: params.userDisplayName, - }); - - const fallbackProvider = http(params.fallbackProvider); - - const client: WalletClient = params.endpoint - ? createPassportClient( - authenticatedHeaders, - fallbackProvider, - params.chain, - params.endpoint - ) - : createPassportClient( - authenticatedHeaders, - fallbackProvider, - params.chain - ); - - this.signer = new WalletClientSigner(client, this.signerType); - this.authDetails = { - authenticatedHeaders: authenticatedHeaders, - addresses: [address as `0x${string}`], - }; - - return this.authDetails; - }; - - getAuthDetails = async () => { - if (!this.inner || !this.signer || !this.authDetails) { - throw new Error("Not authenticated"); - } - - return this.authDetails; - }; -} diff --git a/packages/signers/src/passport/types.ts b/packages/signers/src/passport/types.ts deleted file mode 100644 index b93e922897..0000000000 --- a/packages/signers/src/passport/types.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { Address, Chain } from "viem"; -import type { - CredentialSigner, - CredentialCreator, - CredentialAssertion, - CredentialAttestation, -} from "@0xpass/models"; - -export interface PassportAuthenticationParams { - username: string; - userDisplayName: string; - chain: Chain; - fallbackProvider: string; - endpoint?: string; -} - -export type PassportAuthenticatedHeaders = { - "x-encrypted-key": string; - "x-session": string; -}; - -export type PassportUserInfo = { - authenticatedHeaders: PassportAuthenticatedHeaders; - addresses: Address[]; -}; - -export type SignerWithOptionalCreator = CredentialSigner< - CredentialAssertion, - any -> & - Partial>; - -export type PassportClientParams = { - scope_id: string; - signer: SignerWithOptionalCreator; - endpoint?: string; - enclave_public_key?: string; - fallbackProvider: string; -}; diff --git a/packages/signers/src/portal/__tests__/signer.test.ts b/packages/signers/src/portal/__tests__/signer.test.ts deleted file mode 100644 index cb17c45a6a..0000000000 --- a/packages/signers/src/portal/__tests__/signer.test.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { sepolia } from "@alchemy/aa-core"; -import Portal from "@portal-hq/web"; -import { PortalSigner } from "../signer.js"; - -// taken from Portal SDK since not exported -interface RequestArguments { - method: string; - params?: unknown[]; -} - -describe("Portal Signer Tests", () => { - it("should correctly get address", async () => { - const signer = await givenSigner(); - - const address = await signer.getAddress(); - expect(address).toMatchInlineSnapshot( - '"0x1234567890123456789012345678901234567890"' - ); - }); - - it("should correctly fail to get address if unauthenticated", async () => { - const signer = await givenSigner(false); - - const address = signer.getAddress(); - await expect(address).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly get auth details", async () => { - const signer = await givenSigner(); - - const details = await signer.getAuthDetails(); - expect(details).toMatchInlineSnapshot(` - { - "address": "0x1234567890123456789012345678901234567890", - "backupStatus": null, - "custodian": { - "id": "1", - "name": "test", - }, - "id": "0", - "signingStatus": null, - } - `); - }); - - it("should correctly fail to get auth details if unauthenticated", async () => { - const signer = await givenSigner(false); - - const details = signer.getAuthDetails(); - await expect(details).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly sign message if authenticated", async () => { - const signer = await givenSigner(); - - const signMessage = await signer.signMessage("test"); - expect(signMessage).toMatchInlineSnapshot('"0xtest"'); - }); - - it("should correctly fail to sign message if unauthenticated", async () => { - const signer = await givenSigner(false); - - const signMessage = signer.signMessage("test"); - await expect(signMessage).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly sign typed data if authenticated", async () => { - const signer = await givenSigner(); - - const typedData = { - types: { - Request: [{ name: "hello", type: "string" }], - }, - primaryType: "Request", - message: { - hello: "world", - }, - }; - const signTypedData = await signer.signTypedData(typedData); - expect(signTypedData).toMatchInlineSnapshot('"0xtest"'); - }); -}); - -const givenSigner = async (auth = true) => { - const inner = new Portal({ - autoApprove: true, - gatewayConfig: `${sepolia.rpcUrls.alchemy.http}/${process.env.ALCHEMY_API_KEY}`, - chainId: sepolia.id, - }); - - inner.getClient = vi.fn().mockResolvedValue({ - id: "0", - address: "0x1234567890123456789012345678901234567890", - backupStatus: null, - custodian: { - id: "1", - name: "test", - }, - signingStatus: null, - }); - - inner.provider.request = vi.fn(async (args: RequestArguments) => { - switch (args.method) { - case "eth_accounts": - return Promise.resolve([ - "0x1234567890123456789012345678901234567890", - ]) as R; - case "personal_sign": - return Promise.resolve("0xtest") as R; - case "eth_signTypedData_v4": - return Promise.resolve("0xtest") as R; - default: - return Promise.reject(new Error("Method not found")); - } - }); - - const signer = new PortalSigner({ inner }); - - if (auth) { - await signer.authenticate(); - } - - return signer; -}; diff --git a/packages/signers/src/portal/index.ts b/packages/signers/src/portal/index.ts deleted file mode 100644 index 6f3e061b71..0000000000 --- a/packages/signers/src/portal/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { PortalSigner } from "./signer.js"; -export type * from "./types.js"; diff --git a/packages/signers/src/portal/signer.ts b/packages/signers/src/portal/signer.ts deleted file mode 100644 index 0dd5da7422..0000000000 --- a/packages/signers/src/portal/signer.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { - WalletClientSigner, - type SmartAccountAuthenticator, -} from "@alchemy/aa-core"; -import Portal, { type PortalOptions } from "@portal-hq/web"; -import { - createWalletClient, - custom, - type Hash, - type SignableMessage, - type TypedData, - type TypedDataDefinition, -} from "viem"; -import { signerTypePrefix } from "../constants.js"; -import type { PortalAuthenticationParams, PortalUserInfo } from "./types.js"; - -/** - * This class requires the `@portal-hq/web` dependency. - * `@alchemy/aa-signers` lists it as an optional dependency. - * - * @see https://docs.portalhq.io/sdk/web-beta - */ -export class PortalSigner - implements - SmartAccountAuthenticator< - PortalAuthenticationParams, - PortalUserInfo, - Portal - > -{ - inner: Portal; - private signer: WalletClientSigner | undefined; - - constructor(params: PortalOptions | { inner: Portal }) { - if ("inner" in params) { - this.inner = params.inner; - return; - } - - this.inner = new Portal(params); - } - - readonly signerType = `${signerTypePrefix}portal`; - - getAddress = async () => { - if (!this.signer) throw new Error("Not authenticated"); - - const address = await this.signer.getAddress(); - if (address == null) throw new Error("No address found"); - - return address as Hash; - }; - - signMessage = async (msg: SignableMessage) => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.signMessage(msg); - }; - - signTypedData = async < - const TTypedData extends TypedData | { [key: string]: unknown }, - TPrimaryType extends string = string - >( - params: TypedDataDefinition - ) => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.signTypedData(params); - }; - - authenticate = async () => { - this.signer = new WalletClientSigner( - createWalletClient({ - transport: custom(this.inner.provider), - }), - this.signerType - ); - - return this.inner.getClient() as Promise; - }; - - getAuthDetails = async () => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.inner.getClient() as Promise; - }; -} diff --git a/packages/signers/src/portal/types.ts b/packages/signers/src/portal/types.ts deleted file mode 100644 index bac368e4e9..0000000000 --- a/packages/signers/src/portal/types.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Address } from "viem"; - -export interface PortalAuthenticationParams {} - -// taken from Portal SDK since not exported -export type PortalUserInfo = { - id: string; - address: Address; - backupStatus?: string | null; - custodian: { - id: string; - name: string; - }; - signingStatus?: string | null; -}; diff --git a/packages/signers/src/turnkey/__tests__/signer.test.ts b/packages/signers/src/turnkey/__tests__/signer.test.ts deleted file mode 100644 index 61077e5d20..0000000000 --- a/packages/signers/src/turnkey/__tests__/signer.test.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { TurnkeyClient } from "@turnkey/http"; -import { WebauthnStamper } from "@turnkey/webauthn-stamper"; -import { custom } from "viem"; -import { TurnkeySigner } from "../signer.js"; -import { TurnkeySubOrganization } from "../types.js"; - -describe("Turnkey Signer Tests", () => { - it("should correctly get address if authenticated", async () => { - const signer = await givenSigner(); - - const address = await signer.getAddress(); - expect(address).toMatchInlineSnapshot( - '"0x1234567890123456789012345678901234567890"' - ); - }); - - it("should correctly fail to get address if unauthenticated", async () => { - const signer = await givenSigner(false); - - const address = signer.getAddress(); - await expect(address).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly get auth details if authenticated", async () => { - const signer = await givenSigner(); - - const details = await signer.getAuthDetails(); - expect(details).toMatchInlineSnapshot(` - { - "organizationId": "12345678-1234-1234-1234-1234567890ab", - "organizationName": "test", - "userId": "12345678-1234-1234-1234-1234567890ab", - "username": "test", - } - `); - }); - - it("should correctly fail to get auth details if unauthenticated", async () => { - const signer = await givenSigner(false); - - const details = signer.getAuthDetails(); - await expect(details).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly sign message if authenticated", async () => { - const signer = await givenSigner(); - - const signMessage = await signer.signMessage("test"); - expect(signMessage).toMatchInlineSnapshot( - '"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000021b"' - ); - }); - - it("should correctly fail to sign message if unauthenticated", async () => { - const signer = await givenSigner(false); - - const signMessage = signer.signMessage("test"); - await expect(signMessage).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly sign typed data if authenticated", async () => { - const signer = await givenSigner(); - - const typedData = { - types: { - Request: [{ name: "hello", type: "string" }], - }, - primaryType: "Request", - message: { - hello: "world", - }, - }; - const signTypedData = await signer.signTypedData(typedData); - expect(signTypedData).toMatchInlineSnapshot( - '"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000021b"' - ); - }); -}); - -const givenSigner = async (auth = true) => { - const inner = new TurnkeyClient( - { - baseUrl: "test", - }, - new WebauthnStamper({ - rpId: "your.app.xyz", - }) - ); - - inner.signRawPayload = vi.fn().mockResolvedValue({ - activity: { - status: "ACTIVITY_STATUS_COMPLETED", - result: { - signRawPayloadResult: { - r: "1", - s: "2", - v: "00", - }, - }, - }, - }); - - inner.getWhoami = vi.fn().mockResolvedValue({ - organizationId: "12345678-1234-1234-1234-1234567890ab", - organizationName: "test", - userId: "12345678-1234-1234-1234-1234567890ab", - username: "test", - }); - - const transport = custom({ - request: ({ method }: { method: string; params: any[] }) => { - switch (method) { - case "eth_accounts": - return Promise.resolve([ - "0x1234567890123456789012345678901234567890", - ]); - default: - return Promise.reject(new Error("Method not found")); - } - }, - }); - - const signer = new TurnkeySigner({ inner }); - - if (auth) { - await signer.authenticate({ - transport: transport, - resolveSubOrganization: async () => { - return new TurnkeySubOrganization({ - subOrganizationId: "12345678-1234-1234-1234-123456789abc", - signWith: "0x1234567890123456789012345678901234567890", - }); - }, - }); - } - - return signer; -}; diff --git a/packages/signers/src/turnkey/index.ts b/packages/signers/src/turnkey/index.ts deleted file mode 100644 index c6d5dc4a1d..0000000000 --- a/packages/signers/src/turnkey/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { TurnkeySigner } from "./signer.js"; -export { TurnkeySubOrganization } from "./types.js"; -export type * from "./types.js"; diff --git a/packages/signers/src/turnkey/signer.ts b/packages/signers/src/turnkey/signer.ts deleted file mode 100644 index 1bd1706de4..0000000000 --- a/packages/signers/src/turnkey/signer.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { - WalletClientSigner, - type SmartAccountAuthenticator, -} from "@alchemy/aa-core"; -import { TurnkeyClient } from "@turnkey/http"; -import { createAccount } from "@turnkey/viem"; -import { - createWalletClient, - type LocalAccount, - type SignableMessage, - type TypedData, - type TypedDataDefinition, -} from "viem"; -import { signerTypePrefix } from "../constants.js"; -import type { - TurnkeyAuthParams, - TurnkeyClientParams, - TurnkeySubOrganization, - TurnkeyUserMetadata, -} from "./types.js"; - -/** - * This class requires the `@turnkey/http` and `@turnkey/viem` dependencies. - * `@alchemy/aa-signers` lists them as optional dependencies. - * - * @see https://github.com/tkhq/sdk/tree/main/packages/http - * @see https://github.com/tkhq/sdk/tree/main/packages/viem - */ -export class TurnkeySigner - implements - SmartAccountAuthenticator< - TurnkeyAuthParams, - TurnkeyUserMetadata, - TurnkeyClient - > -{ - inner: TurnkeyClient; - private signer: WalletClientSigner | undefined; - private subOrganization: TurnkeySubOrganization | undefined; - - constructor(params: TurnkeyClientParams | { inner: TurnkeyClient }) { - if ("inner" in params) { - this.inner = params.inner; - return; - } - - this.inner = new TurnkeyClient({ baseUrl: params.apiUrl }, params.stamper); - } - - readonly signerType = `${signerTypePrefix}turnkey`; - - getAddress = async () => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.getAddress(); - }; - - signMessage = async (msg: SignableMessage) => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.signMessage(msg); - }; - - signTypedData = async < - const TTypedData extends TypedData | { [key: string]: unknown }, - TPrimaryType extends string = string - >( - params: TypedDataDefinition - ) => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.signTypedData(params); - }; - - authenticate = async (params: TurnkeyAuthParams) => { - this.subOrganization = await params.resolveSubOrganization(); - this.signer = new WalletClientSigner( - createWalletClient({ - account: (await createAccount({ - client: this.inner, - organizationId: this.subOrganization.subOrganizationId, - signWith: this.subOrganization.signWith, - })) as LocalAccount, - transport: params.transport, - }), - this.signerType - ); - - return this.inner.getWhoami({ - organizationId: this.subOrganization.subOrganizationId, - }); - }; - - getAuthDetails = async () => { - if (!this.signer || !this.subOrganization) - throw new Error("Not authenticated"); - - return this.inner.getWhoami({ - organizationId: this.subOrganization.subOrganizationId, - }); - }; -} diff --git a/packages/signers/src/turnkey/types.ts b/packages/signers/src/turnkey/types.ts deleted file mode 100644 index 3fd7d22892..0000000000 --- a/packages/signers/src/turnkey/types.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { TStamper } from "@turnkey/http/dist/base"; -import type { Transport } from "viem"; - -export interface TurnkeyAuthParams { - transport: Transport; - resolveSubOrganization: () => Promise; -} - -export class TurnkeySubOrganization { - subOrganizationId: string; - signWith: string; - constructor(params: { subOrganizationId: string; signWith: string }) { - this.subOrganizationId = params.subOrganizationId; - this.signWith = params.signWith; - } -} - -export interface TurnkeyUserMetadata { - organizationId: string; - organizationName: string; - userId: string; - username: string; -} - -export type TurnkeyClientParams = { - apiUrl: string; - stamper: TStamper; -}; diff --git a/packages/signers/src/web3auth/__tests__/signer.test.ts b/packages/signers/src/web3auth/__tests__/signer.test.ts deleted file mode 100644 index d5d82de037..0000000000 --- a/packages/signers/src/web3auth/__tests__/signer.test.ts +++ /dev/null @@ -1,136 +0,0 @@ -import type { RequestArguments } from "@web3auth/base"; -import { Web3Auth } from "@web3auth/modal"; -import { Web3AuthSigner } from "../signer.js"; - -describe("Web3Auth Signer Tests", () => { - it("should correctly get address", async () => { - const signer = await givenSigner(); - - const address = await signer.getAddress(); - expect(address).toMatchInlineSnapshot( - '"0x1234567890123456789012345678901234567890"' - ); - }); - - it("should correctly fail to get address if unauthenticated", async () => { - const signer = await givenSigner(false); - - const address = signer.getAddress(); - await expect(address).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly get auth details", async () => { - const signer = await givenSigner(); - - const details = await signer.getAuthDetails(); - expect(details).toMatchInlineSnapshot(` - { - "aggregateVerifier": "aggregateVerifier", - "dappShare": "dappShare", - "email": "email", - "idToken": "idToken", - "name": "name", - "oAuthAccessToken": "oAuthAccessToken", - "oAuthIdToken": "oAuthIdToken", - "profileImage": "profileImage", - "typeOfLogin": "typeOfLogin", - "verifier": "verifier", - "verifierId": "verifierId", - } - `); - }); - - it("should correctly fail to get auth details if unauthenticated", async () => { - const signer = await givenSigner(false); - - const details = signer.getAuthDetails(); - await expect(details).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly sign message if authenticated", async () => { - const signer = await givenSigner(); - - const signMessage = await signer.signMessage("test"); - expect(signMessage).toMatchInlineSnapshot('"0xtest"'); - }); - - it("should correctly fail to sign message if unauthenticated", async () => { - const signer = await givenSigner(false); - - const signMessage = signer.signMessage("test"); - await expect(signMessage).rejects.toThrowErrorMatchingInlineSnapshot( - '"Not authenticated"' - ); - }); - - it("should correctly sign typed data if authenticated", async () => { - const signer = await givenSigner(); - - const typedData = { - types: { - Request: [{ name: "hello", type: "string" }], - }, - primaryType: "Request", - message: { - hello: "world", - }, - }; - const signTypedData = await signer.signTypedData(typedData); - expect(signTypedData).toMatchInlineSnapshot('"0xtest"'); - }); -}); - -const givenSigner = async (auth = true) => { - const inner = new Web3Auth({ - clientId: "test", - chainConfig: { - chainNamespace: "eip155", - }, - }); - - inner.getUserInfo = vi.fn().mockResolvedValue({ - email: "email", - name: "name", - profileImage: "profileImage", - aggregateVerifier: "aggregateVerifier", - verifier: "verifier", - verifierId: "verifierId", - typeOfLogin: "typeOfLogin", - dappShare: "dappShare", - idToken: "idToken", - oAuthIdToken: "oAuthIdToken", - oAuthAccessToken: "oAuthAccessToken", - }); - - vi.spyOn(inner, "provider", "get").mockReturnValue({ - request: (args: RequestArguments) => { - switch (args.method) { - case "eth_accounts": - return Promise.resolve([ - "0x1234567890123456789012345678901234567890", - ]) as R; - case "personal_sign": - return Promise.resolve("0xtest") as R; - case "eth_signTypedData_v4": - return Promise.resolve("0xtest") as R; - default: - return Promise.reject(new Error("Method not found")); - } - }, - } as any); - - const signer = new Web3AuthSigner({ inner }); - - if (auth) { - await signer.authenticate({ - init: () => Promise.resolve(), - connect: () => Promise.resolve(), - }); - } - - return signer; -}; diff --git a/packages/signers/src/web3auth/index.ts b/packages/signers/src/web3auth/index.ts deleted file mode 100644 index 6a6cc462fe..0000000000 --- a/packages/signers/src/web3auth/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { Web3AuthSigner } from "./signer.js"; -export type * from "./types.js"; diff --git a/packages/signers/src/web3auth/signer.ts b/packages/signers/src/web3auth/signer.ts deleted file mode 100644 index 83d9884477..0000000000 --- a/packages/signers/src/web3auth/signer.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { - WalletClientSigner, - type SmartAccountAuthenticator, -} from "@alchemy/aa-core"; -import { Web3Auth, type Web3AuthOptions } from "@web3auth/modal"; -import { - createWalletClient, - custom, - type Hash, - type SignableMessage, - type TypedData, - type TypedDataDefinition, -} from "viem"; -import { signerTypePrefix } from "../constants.js"; -import type { - Web3AuthAuthenticationParams, - Web3AuthUserInfo, -} from "./types.js"; - -/** - * This class requires the `@web3auth/modal` and `@web3auth/base dependencies. - * `@alchemy/aa-signers` lists them as optional dependencies. - * - * @see https://github.com/Web3Auth/web3auth-web/tree/master/packages/modal - * @see https://github.com/Web3Auth/web3auth-web/tree/master/packages/base - */ -export class Web3AuthSigner - implements - SmartAccountAuthenticator< - Web3AuthAuthenticationParams, - Web3AuthUserInfo, - Web3Auth - > -{ - inner: Web3Auth; - private signer: WalletClientSigner | undefined; - - constructor(params: Web3AuthOptions | { inner: Web3Auth }) { - if ("inner" in params) { - this.inner = params.inner; - return; - } - - this.inner = new Web3Auth(params); - } - - readonly signerType = `${signerTypePrefix}web3auth`; - - getAddress = async () => { - if (!this.signer) throw new Error("Not authenticated"); - - const address = await this.signer.getAddress(); - if (address == null) throw new Error("No address found"); - - return address as Hash; - }; - - signMessage = async (msg: SignableMessage) => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.signMessage(msg); - }; - - signTypedData = async < - const TTypedData extends TypedData | { [key: string]: unknown }, - TPrimaryType extends string = string - >( - params: TypedDataDefinition - ) => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.signer.signTypedData(params); - }; - - authenticate = async ( - params: Web3AuthAuthenticationParams = { - init: async () => { - await this.inner.initModal(); - }, - connect: async () => { - await this.inner.connect(); - }, - } - ) => { - await params.init(); - await params.connect(); - - if (this.inner.provider == null) throw new Error("No provider found"); - - this.signer = new WalletClientSigner( - createWalletClient({ - transport: custom(this.inner.provider), - }), - this.signerType - ); - - return this.inner.getUserInfo(); - }; - - getAuthDetails = async () => { - if (!this.signer) throw new Error("Not authenticated"); - - return this.inner.getUserInfo(); - }; -} diff --git a/packages/signers/src/web3auth/types.ts b/packages/signers/src/web3auth/types.ts deleted file mode 100644 index 0b60140761..0000000000 --- a/packages/signers/src/web3auth/types.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { UserInfo } from "@web3auth/base"; - -export interface Web3AuthAuthenticationParams { - init: () => Promise; - connect: () => Promise; -} - -export type Web3AuthUserInfo = Partial; diff --git a/packages/signers/tsconfig.json b/packages/signers/tsconfig.json deleted file mode 100644 index 748018d6a6..0000000000 --- a/packages/signers/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "typescript-template/base.json" -} diff --git a/site/package.json b/site/package.json index 2d04ef7fb5..5096bbe37c 100644 --- a/site/package.json +++ b/site/package.json @@ -9,11 +9,12 @@ "preview": "vocs preview" }, "devDependencies": { - "@alchemy/aa-accounts": "*", - "@alchemy/aa-alchemy": "*", + "@account-kit/core": "*", + "@account-kit/react": "*", + "@account-kit/infra": "*", + "@account-kit/smart-contracts": "*", "@alchemy/aa-core": "*", "@alchemy/aa-ethers": "*", - "@alchemy/aa-signers": "*", "autoprefixer": "^10.4.16", "execa": "^8.0.1", "tailwindcss": "^3.3.3", diff --git a/site/pages/extending-smart-accounts/get-installed-plugins.md b/site/pages/extending-smart-accounts/get-installed-plugins.md index 613483bcfa..e99462d743 100644 --- a/site/pages/extending-smart-accounts/get-installed-plugins.md +++ b/site/pages/extending-smart-accounts/get-installed-plugins.md @@ -15,7 +15,7 @@ description: Follow this guide to get installed plugins of a Modular Account function getInstalledPlugins() external view returns (address[] memory); ``` -Account Kit provides a streamlined experience of interacting with Modular Account AccoutLoupe interface easily by providing `accountLoupeActions` defined in `@alchemy/aa-accounts` package. When you connect your Modular Account to `SmartAccountClient` you can extend the client with `accountLoupeActions`, which exposes a set of methods available to call the account `AccountLoupe` with the client connected to the account. +Account Kit provides a streamlined experience of interacting with Modular Account AccoutLoupe interface easily by providing `accountLoupeActions` defined in `@account-kit/smart-contracts` package. When you connect your Modular Account to `SmartAccountClient` you can extend the client with `accountLoupeActions`, which exposes a set of methods available to call the account `AccountLoupe` with the client connected to the account. ## Get installed plugins of a Modular Account @@ -32,7 +32,7 @@ When using `createModularAccountAlchemyClient` in `@alchemy/aa-alchemy`, the `Sm ```ts [example.ts] import { smartAccountClient as modularAccountClient } from "./smartAccountClient"; import { type Address } from "viem"; -import { IPluginAbi, accountLoupeActions } from "@alchemy/aa-accounts"; +import { IPluginAbi, accountLoupeActions } from "@account-kit/smart-contracts"; // [!code focus:99] // extend smart account client with accountLoupeActions to call AccountLoupe methods diff --git a/site/pages/extending-smart-accounts/install-plugins.md b/site/pages/extending-smart-accounts/install-plugins.md index 926c0e437a..af7e899774 100644 --- a/site/pages/extending-smart-accounts/install-plugins.md +++ b/site/pages/extending-smart-accounts/install-plugins.md @@ -10,11 +10,11 @@ description: Follow this guide to install and uninstall plugins on a Modular [ERC-6900](https://eips.ethereum.org/EIPS/eip-6900) Modular Accounts implements Plugin manager interface [`IPluginManager.sol`](https://eips.ethereum.org/EIPS/eip-6900#ipluginmanagersol) to support installing and uninstalling plugins on a Modular Account. This contract interface defines the method `installPlugin()` and `uninstallPlugin()` that clients can use to install or uninstall plugins on a Modular Account. -Account Kit provides a streamlined experience of interacting with the Modular Account AccoutLoupe interface easily by providing `pluginManagerActions` defined in `@alchemy/aa-accounts` package. When you connect your Modular Account to `SmartAccountClient` you can extend the client with `pluginManagerActions`, which exposes a set of methods available to call the account `AccountLoupe` with the client connected to the account. +Account Kit provides a streamlined experience of interacting with the Modular Account AccoutLoupe interface easily by providing `pluginManagerActions` defined in `@account-kit/smart-contracts` package. When you connect your Modular Account to `SmartAccountClient` you can extend the client with `pluginManagerActions`, which exposes a set of methods available to call the account `AccountLoupe` with the client connected to the account. There are two ways to install plugins. The first method is to use the `pluginManagerActions`'s generic `installPlugin` method, but this method requires the [`PluginGenConfig`](https://github.com/alchemyplatform/aa-sdk/blob/a9a11ec23b1084fa43edaa3cb933ff36318ca573/packages/accounts/plugindefs/types.ts) configure the correct plugin dependencies and function references for the plugin. -Account Kit provides a more robust, easier way to install plugins with `pluginActions`. Each plugin comes with the its own `pluginActions` that includes already configured install method, named `install`, for installing any plugin of interest. For example, `MultiOwnerPlugin` has `multiOwnerPluginActions` that includes `installMultiOwnerPlugin()` method, and `SessionKeyPlugin` has `sessionKeyPluginActions` that includes `installSessionKeyPlugin()` method, all exported from the `@alchemy/aa-accounts` package. +Account Kit provides a more robust, easier way to install plugins with `pluginActions`. Each plugin comes with the its own `pluginActions` that includes already configured install method, named `install`, for installing any plugin of interest. For example, `MultiOwnerPlugin` has `multiOwnerPluginActions` that includes `installMultiOwnerPlugin()` method, and `SessionKeyPlugin` has `sessionKeyPluginActions` that includes `installSessionKeyPlugin()` method, all exported from the `@account-kit/smart-contracts` package. This guide will use the `SessionKeyPlugin` as an example to show how you can install `SessionKeyPlugin` easily using the `SmartAccountClient` extended with `sessionKeyPluginActions`. @@ -40,7 +40,7 @@ When using `createModularAccountAlchemyClient` in `@alchemy/aa-alchemy`, the `Sm ```ts [example.ts] import { smartAccountClient as modularAccountClient } from "./smartAccountClient"; -import { sessionKeyPluginActions } from "@alchemy/aa-accounts"; +import { sessionKeyPluginActions } from "@account-kit/smart-contracts"; // [!code focus:99] // extend smart account client with sessionKeyPluginActions to call SessionKeyPlugin methods @@ -88,7 +88,10 @@ import { chain, smartAccountClient as modularAccountClient, } from "./smartAccountClient"; -import { pluginManagerActions, SessionKeyPlugin } from "@alchemy/aa-accounts"; +import { + pluginManagerActions, + SessionKeyPlugin, +} from "@account-kit/smart-contracts"; // [!code focus:99] // extend smart account client with pluginManagerActions to call PluginManager action methods diff --git a/site/pages/getting-started/overview.mdx b/site/pages/getting-started/overview.mdx index c7182a2e62..c67d3dc214 100644 --- a/site/pages/getting-started/overview.mdx +++ b/site/pages/getting-started/overview.mdx @@ -54,7 +54,7 @@ Every smart account is controlled by an owner private key. A signer or WaaS prov Embedded Accounts are powered by the non-custodial Alchemy Signer API which uses Turnkey to securely store key material in a [Secure Enclave](https://docs.turnkey.com/security/our-approach) so that only the user can access it. -Account Kit also makes it easy to [bring your own signer](/signers/choosing-a-signer) with over a dozen integration guides for popular signers including [Magic](/signers/guides/magic), [Privy](/signers/guides/privy), [Web3auth](/signers/guides/web3auth), and more. +Account Kit also makes it easy to [bring your own signer](/signers/choosing-a-signer). ## Smart Contract Accounts diff --git a/site/pages/getting-started/setup-app.md b/site/pages/getting-started/setup-app.md index 8b5cd64e4b..a930dde672 100644 --- a/site/pages/getting-started/setup-app.md +++ b/site/pages/getting-started/setup-app.md @@ -79,15 +79,15 @@ In this newly created directory for your app, add the following dependencies: :::code-group ```bash [npm] -npm i @alchemy/aa-alchemy @alchemy/aa-accounts @alchemy/aa-core viem@2.8.6 @tanstack/react-query@5.28.9 +npm i @alchemy/aa-alchemy @account-kit/smart-contracts @alchemy/aa-core viem@2.8.6 @tanstack/react-query@5.28.9 ``` ```bash [yarn] -yarn add @alchemy/aa-alchemy @alchemy/aa-accounts @alchemy/aa-core viem@2.8.6 @tanstack/react-query@5.28.9 +yarn add @alchemy/aa-alchemy @account-kit/smart-contracts @alchemy/aa-core viem@2.8.6 @tanstack/react-query@5.28.9 ``` ```bash [pnpm] -pnpm i @alchemy/aa-alchemy @alchemy/aa-accounts @alchemy/aa-core viem@2.8.6 @tanstack/react-query@5.28.9 +pnpm i @alchemy/aa-alchemy @account-kit/smart-contracts @alchemy/aa-core viem@2.8.6 @tanstack/react-query@5.28.9 ``` ::: @@ -96,7 +96,7 @@ pnpm i @alchemy/aa-alchemy @alchemy/aa-accounts @alchemy/aa-core viem@2.8.6 @tan The versions of `viem` and `@tanstack/react-query` that's required to be installed is listed as a `peerDependency` of the various `@alchemy/*` packages (`2.8.6` and `5.28.9`, respectively, at the time of writing). Due to some breaking changes between patch and minor versions of `viem` and `@tanstack/react-query`, it's recommended to pin your version of `viem` to the listed `peerDependency` in the `package.json`. ::: -The three Alchemy packages - `@alchemy/aa-alchemy`, `@alchemy/aa-accounts`, and `@alchemy/aa-core` - come from the [Alchemy Account Kit](https://accountkit.alchemy.com/), and will provide the key building blocks for created Embedded Accounts. +The three Alchemy packages - `@alchemy/aa-alchemy`, `@account-kit/smart-contracts`, and `@alchemy/aa-core` - come from the [Alchemy Account Kit](https://accountkit.alchemy.com/), and will provide the key building blocks for created Embedded Accounts. [`viem`](https://viem.sh/) is a useful Web3 Utils library and a key dependency of Account Kit. diff --git a/site/pages/index.mdx b/site/pages/index.mdx index ec5428833b..500ead02da 100644 --- a/site/pages/index.mdx +++ b/site/pages/index.mdx @@ -54,7 +54,7 @@ import { Button } from "vocs/components";
```ts [gettingStarted.ts] -import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; +import { createModularAccountAlchemyClient } from "@account-kit/infra"; import { sepolia } from "@alchemy/aa-core"; export const smartAccountClient = await createModularAccountAlchemyClient({ diff --git a/site/pages/migration-guides/migrating-to-v3.md b/site/pages/migration-guides/migrating-to-v3.md index 32531ca894..c22827be1a 100644 --- a/site/pages/migration-guides/migrating-to-v3.md +++ b/site/pages/migration-guides/migrating-to-v3.md @@ -90,7 +90,7 @@ import { LightSmartContractAccount, // [!code --] createLightAccount, // [!code ++] getDefaultLightAccountFactoryAddress, // [!code --] -} from "@alchemy/aa-accounts"; +} from "@account-kit/smart-contracts"; import { LocalAccountSigner, type Hex, @@ -117,7 +117,7 @@ so that you don't have to pass the account to every method. #### Option 1: Passing the Account to the Client Methods ```ts -import { createLightAccount } from "@alchemy/aa-accounts"; +import { createLightAccount } from "@account-kit/smart-contracts"; import { createBundlerClient, createSmartAccountClientFromExisting @@ -162,7 +162,7 @@ const { hash } = await smartAccountClient.sendUserOperation({ Hoisting the account is similar to using `.connect` in previous versions. You simply create your client with an account passed in to it. ```ts -import { createLightAccount } from "@alchemy/aa-accounts"; +import { createLightAccount } from "@account-kit/smart-contracts"; import { createBundlerClient, createSmartAccountClientFromExisting diff --git a/site/pages/packages/aa-accounts/index.md b/site/pages/packages/aa-accounts/index.md index 307a53a011..52157d3b3d 100644 --- a/site/pages/packages/aa-accounts/index.md +++ b/site/pages/packages/aa-accounts/index.md @@ -3,7 +3,7 @@ title: aa-accounts description: aa-accounts landing page and getting started guide --- -# `@alchemy/aa-accounts` +# `@account-kit/smart-contracts` This package contains various implementations of the `BaseSmartContractAccount` class defined in `aa-core`. This repo is community maintained and we welcome contributions! @@ -14,15 +14,15 @@ If you are already using the `@alchemy/aa-core` package, you can simply install :::code-group ```bash [yarn] -yarn add @alchemy/aa-accounts +yarn add @account-kit/smart-contracts ``` ```bash [npm] -npm i -s @alchemy/aa-accounts +npm i -s @account-kit/smart-contracts ``` ```bash [pnpm] -pnpm i @alchemy/aa-accounts +pnpm i @account-kit/smart-contracts ``` ::: diff --git a/site/pages/packages/aa-accounts/light-account/actions/transferOwnership.md b/site/pages/packages/aa-accounts/light-account/actions/transferOwnership.md index c7798800e7..ea373c15b1 100644 --- a/site/pages/packages/aa-accounts/light-account/actions/transferOwnership.md +++ b/site/pages/packages/aa-accounts/light-account/actions/transferOwnership.md @@ -5,7 +5,7 @@ description: Overview of the transferOwnership method on LightSmartContractAccou # transferOwnership -`transferOwnership` is an action exported by `@alchemy/aa-accounts` which sends a UO that transfers ownership of the account to a new owner, and returns either the UO hash or transaction hash. +`transferOwnership` is an action exported by `@account-kit/smart-contracts` which sends a UO that transfers ownership of the account to a new owner, and returns either the UO hash or transaction hash. ## Usage diff --git a/site/pages/packages/aa-accounts/utils/getDefaultLightAccountFactoryAddress.md b/site/pages/packages/aa-accounts/utils/getDefaultLightAccountFactoryAddress.md index 6670aee15a..3bdbbcfb83 100644 --- a/site/pages/packages/aa-accounts/utils/getDefaultLightAccountFactoryAddress.md +++ b/site/pages/packages/aa-accounts/utils/getDefaultLightAccountFactoryAddress.md @@ -12,7 +12,7 @@ Utility method that returns the default Light Account Factory contract address f ```ts import { sepolia } from "@alchemy/aa-core"; -import { getDefaultLightAccountFactoryAddress } from "@alchemy/aa-accounts"; +import { getDefaultLightAccountFactoryAddress } from "@account-kit/smart-contracts"; const chain = sepolia; const factoryAddress = getDefaultLightAccountFactoryAddress(chain); diff --git a/site/pages/packages/aa-alchemy/light-account-client/index.md b/site/pages/packages/aa-alchemy/light-account-client/index.md index eae9723935..50b31a84eb 100644 --- a/site/pages/packages/aa-alchemy/light-account-client/index.md +++ b/site/pages/packages/aa-alchemy/light-account-client/index.md @@ -5,7 +5,7 @@ description: Overview of the createLightAccountAlchemyClient factory in aa-alche # createLightAccountAlchemyClient -`createLightAccountAlchemyClient` is a factory that improves the developer experience of connecting a Light Account to an `AlchemySmartAccountClient` via an optional dependency on the [`@alchemy/aa-accounts`](https://github.com/alchemyplatform/aa-sdk/tree/development/packages/accounts) package. You can use this to directly instantiate an `AlchemySmartAccountClient` already connected to a Light Account in one line of code. +`createLightAccountAlchemyClient` is a factory that improves the developer experience of connecting a Light Account to an `AlchemySmartAccountClient` via an optional dependency on the [`@account-kit/smart-contracts`](https://github.com/alchemyplatform/aa-sdk/tree/development/packages/accounts) package. You can use this to directly instantiate an `AlchemySmartAccountClient` already connected to a Light Account in one line of code. ## Usage diff --git a/site/pages/packages/aa-alchemy/middleware/alchemyFeeEstimator.md b/site/pages/packages/aa-alchemy/middleware/alchemyFeeEstimator.md index aa56a14632..183e65066e 100644 --- a/site/pages/packages/aa-alchemy/middleware/alchemyFeeEstimator.md +++ b/site/pages/packages/aa-alchemy/middleware/alchemyFeeEstimator.md @@ -13,7 +13,7 @@ description: Overview of the alchemyFeeEstimator method in aa-alchemy import { alchemyFeeEstimator, createAlchemyRpcClient, -} from "@alchemy/aa-alchemy"; +} from "@account-kit/infra"; import { createSmartAccountClient } from "@alchemy/aa-core"; import { http } from "viem"; import { sepolia } from "viem/chains"; diff --git a/site/pages/packages/aa-alchemy/middleware/alchemyGasManagerMiddleware.md b/site/pages/packages/aa-alchemy/middleware/alchemyGasManagerMiddleware.md index 6e150db696..cd680299c4 100644 --- a/site/pages/packages/aa-alchemy/middleware/alchemyGasManagerMiddleware.md +++ b/site/pages/packages/aa-alchemy/middleware/alchemyGasManagerMiddleware.md @@ -13,7 +13,7 @@ description: Overview of the alchemyGasManagerMiddleware method in aa-alchemy import { alchemyGasManagerMiddleware, createAlchemyPublicRpcClient, -} from "@alchemy/aa-alchemy"; +} from "@account-kit/infra"; import { createSmartAccountClient } from "@alchemy/aa-core"; import { http } from "viem"; import { sepolia } from "viem/chains"; diff --git a/site/pages/packages/aa-alchemy/middleware/alchemyUserOperationSimulator.md b/site/pages/packages/aa-alchemy/middleware/alchemyUserOperationSimulator.md index a76e3a832f..322f1d03de 100644 --- a/site/pages/packages/aa-alchemy/middleware/alchemyUserOperationSimulator.md +++ b/site/pages/packages/aa-alchemy/middleware/alchemyUserOperationSimulator.md @@ -13,7 +13,7 @@ description: Overview of the alchemyUserOperationSimulator method in aa-alchemy import { alchemyUserOperationSimulator, createAlchemyRpcClient, -} from "@alchemy/aa-alchemy"; +} from "@account-kit/infra"; import { createSmartAccountClient } from "@alchemy/aa-core"; import { http } from "viem"; import { sepolia } from "viem/chains"; diff --git a/site/pages/packages/aa-alchemy/modular-account-client/multisig-account-client.md b/site/pages/packages/aa-alchemy/modular-account-client/multisig-account-client.md index f69ff2ce33..a65a9d7624 100644 --- a/site/pages/packages/aa-alchemy/modular-account-client/multisig-account-client.md +++ b/site/pages/packages/aa-alchemy/modular-account-client/multisig-account-client.md @@ -5,13 +5,13 @@ description: Overview of the createMultisigAccountAlchemyClient factory in aa-al # createMultisigAccountAlchemyClient -`createMultisigAccountAlchemyClient` is a factory that improves the developer experience of connecting a Modular Account with the multisig plugin to an `AlchemySmartAccountClient` via an optional dependency on the [`@alchemy/aa-accounts`](https://github.com/alchemyplatform/aa-sdk/tree/development/packages/accounts) package. You can use this to directly instantiate an `AlchemySmartAccountClient` already connected to a Modular Account with the multisig plugin in one line of code. +`createMultisigAccountAlchemyClient` is a factory that improves the developer experience of connecting a Modular Account with the multisig plugin to an `AlchemySmartAccountClient` via an optional dependency on the [`@account-kit/smart-contracts`](https://github.com/alchemyplatform/aa-sdk/tree/development/packages/accounts) package. You can use this to directly instantiate an `AlchemySmartAccountClient` already connected to a Modular Account with the multisig plugin in one line of code. ## Usage ```ts import { LocalAccountSigner } from "@alchemy/aa-core"; -import { createMultisigAccountAlchemyClient } from "@alchemy/aa-alchemy"; +import { createMultisigAccountAlchemyClient } from "@account-kit/infra"; // Creating a 3/3 multisig account const signers = [LocalAccountSigner.mnemonicToAccountSigner( diff --git a/site/pages/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md b/site/pages/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md index 8824430461..91ef99738a 100644 --- a/site/pages/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md +++ b/site/pages/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md @@ -22,7 +22,7 @@ Additionally, since the Alchemy SDK client does not yet support JWT authenticati ```ts [example.ts] import { smartAccountClient } from "./base-client.ts"; -import { alchemyEnhancedApiActions } from "@alchemy/aa-alchemy"; +import { alchemyEnhancedApiActions } from "@account-kit/infra"; // [!code focus:99] const alchemy = new Alchemy(); diff --git a/site/pages/packages/aa-alchemy/smart-account-client/index.md b/site/pages/packages/aa-alchemy/smart-account-client/index.md index ee8f8c647c..2146114cf4 100644 --- a/site/pages/packages/aa-alchemy/smart-account-client/index.md +++ b/site/pages/packages/aa-alchemy/smart-account-client/index.md @@ -10,7 +10,7 @@ To create an `AlchemySmartAccountClient`, you must provide a set of parameters d ## Usage ```ts [example.ts] -import { createAlchemySmartAccountClient } from "@alchemy/aa-alchemy"; +import { createAlchemySmartAccountClient } from "@account-kit/infra"; import { getDefaultEntryPointAddress } from "@alchemy/aa-core"; import { sepolia } from "@alchemy/aa-core"; diff --git a/site/pages/packages/aa-alchemy/utils/defineAlchemyChain.md b/site/pages/packages/aa-alchemy/utils/defineAlchemyChain.md index 0315f9076e..d0e120cd88 100644 --- a/site/pages/packages/aa-alchemy/utils/defineAlchemyChain.md +++ b/site/pages/packages/aa-alchemy/utils/defineAlchemyChain.md @@ -10,7 +10,7 @@ description: Overview of the SupportedChains util method in aa-alchemy ## Usage ```ts [example.ts] -import { defineAlchemyChain } from "@alchemy/aa-alchemy"; +import { defineAlchemyChain } from "@account-kit/infra"; import { mainnet } from "viem"; // eth mainnet diff --git a/site/pages/packages/aa-core/smart-account-client/actions/buildUserOperationFromTxs.mdx b/site/pages/packages/aa-core/smart-account-client/actions/buildUserOperationFromTxs.mdx index 7be142a478..d408865936 100644 --- a/site/pages/packages/aa-core/smart-account-client/actions/buildUserOperationFromTxs.mdx +++ b/site/pages/packages/aa-core/smart-account-client/actions/buildUserOperationFromTxs.mdx @@ -73,7 +73,7 @@ const uoHash = await smartAccountClient.sendRawUserOperation({ :::details[BuildUserOperationFromTransactionsResult] ```ts -// [!include ~/../packages/core/src/actions/smartAccount/types.ts:BuildUserOperationFromTransactionsResult] +// [!include ~/../aa-sdk/core/src/actions/smartAccount/types.ts:BuildUserOperationFromTransactionsResult] ``` ::: @@ -101,7 +101,7 @@ The batch array of `UserOperationCallData` corresponding to the user operation c :::details[SendTransactionsParameters] ```ts -// [!include ~/../packages/core/src/actions/smartAccount/types.ts:SendTransactionsParameters] +// [!include ~/../aa-sdk/core/src/actions/smartAccount/types.ts:SendTransactionsParameters] ``` ::: diff --git a/site/pages/packages/aa-core/smart-account-client/actions/sendTransactions.mdx b/site/pages/packages/aa-core/smart-account-client/actions/sendTransactions.mdx index dbcb9f5496..a46d4f5f2c 100644 --- a/site/pages/packages/aa-core/smart-account-client/actions/sendTransactions.mdx +++ b/site/pages/packages/aa-core/smart-account-client/actions/sendTransactions.mdx @@ -70,7 +70,7 @@ A `Promise` containing the transaction hash of the batched user operation of the :::details[SendTransactionsParameters] ```ts -// [!include ~/../packages/core/src/actions/smartAccount/types.ts:SendTransactionsParameters] +// [!include ~/../aa-sdk/core/src/actions/smartAccount/types.ts:SendTransactionsParameters] ``` ::: diff --git a/site/pages/packages/aa-core/smart-account-client/actions/signUserOperation.mdx b/site/pages/packages/aa-core/smart-account-client/actions/signUserOperation.mdx index 0eca0886c4..9e2d59ebd5 100644 --- a/site/pages/packages/aa-core/smart-account-client/actions/signUserOperation.mdx +++ b/site/pages/packages/aa-core/smart-account-client/actions/signUserOperation.mdx @@ -26,7 +26,7 @@ A `Promise` containing the signed result of the input `UserOperationStruct` usin :::details[SignUserOperationParameters] ```ts -// [!include ~/../packages/core/src/actions/smartAccount/types.ts:SignUserOperationParameters] +// [!include ~/../aa-sdk/core/src/actions/smartAccount/types.ts:SignUserOperationParameters] ``` ::: diff --git a/site/pages/packages/aa-core/smart-account-client/actions/upgradeAccount.mdx b/site/pages/packages/aa-core/smart-account-client/actions/upgradeAccount.mdx index 6dc392b16d..d8e1a40de2 100644 --- a/site/pages/packages/aa-core/smart-account-client/actions/upgradeAccount.mdx +++ b/site/pages/packages/aa-core/smart-account-client/actions/upgradeAccount.mdx @@ -13,7 +13,7 @@ Upgrades smart accounts to a new implementation if the smart contract account su ```ts [example.ts] import { smartAccountClient as lightAccountClient } from "./lightAccountClient"; -import { getMSCAUpgradeToData } from "@alchemy/aa-accounts"; +import { getMSCAUpgradeToData } from "@account-kit/smart-contracts"; const { createMAAccount, ...upgradeToData } = await getMSCAUpgradeToData( lightAccountClient, diff --git a/site/pages/packages/aa-core/smart-account-client/index.md b/site/pages/packages/aa-core/smart-account-client/index.md index f173d1df9a..d79fa339cf 100644 --- a/site/pages/packages/aa-core/smart-account-client/index.md +++ b/site/pages/packages/aa-core/smart-account-client/index.md @@ -24,7 +24,7 @@ Initialize a `SmartAccountClient` with your desired Chain and Transport using `c ```ts [createSmartAccountClient.ts] import { createSmartAccountClient } from "@alchemy/aa-core"; -import { createLightAccount } from "@alchemy/aa-accounts"; +import { createLightAccount } from "@account-kit/smart-contracts"; import { http } from "viem"; import { sepolia } from "@alchemy/aa-core"; diff --git a/site/pages/packages/aa-core/smart-account-client/middleware/index.md b/site/pages/packages/aa-core/smart-account-client/middleware/index.md index 583af84a72..d684dede15 100644 --- a/site/pages/packages/aa-core/smart-account-client/middleware/index.md +++ b/site/pages/packages/aa-core/smart-account-client/middleware/index.md @@ -12,7 +12,7 @@ Each middleware is a function that takes in a user operation object, performs it :::details[ClientMiddlewareFn] ```ts -// [!include ~/../packages/core/src/middleware/types.ts:ClientMiddlewareFn] +// [!include ~/../aa-sdk/core/src/middleware/types.ts:ClientMiddlewareFn] ``` ::: @@ -20,7 +20,7 @@ Each middleware is a function that takes in a user operation object, performs it :::details[ClientMiddleware] ```ts -// [!include ~/../packages/core/src/middleware/types.ts:ClientMiddleware] +// [!include ~/../aa-sdk/core/src/middleware/types.ts:ClientMiddleware] ``` ::: diff --git a/site/pages/packages/aa-ethers/provider-adapter/constructor.md b/site/pages/packages/aa-ethers/provider-adapter/constructor.md index 70341017b4..73205577ba 100644 --- a/site/pages/packages/aa-ethers/provider-adapter/constructor.md +++ b/site/pages/packages/aa-ethers/provider-adapter/constructor.md @@ -12,7 +12,7 @@ Or you can also input a `SmartAccountClient` instance already initialized (`Alch ## Usage ```ts [example.ts] -import { AlchemyProvider } from "@alchemy/aa-alchemy"; +import { createAlchemySmartAccountClient } from "@account-kit/infra"; import { getDefaultEntryPointAddress } from "@alchemy/aa-core"; import { EthersProviderAdapter } from "@alchemy/aa-ethers"; import { sepolia } from "@alchemy/aa-core"; diff --git a/site/pages/packages/aa-ethers/provider-adapter/introduction.md b/site/pages/packages/aa-ethers/provider-adapter/introduction.md index 84059c445d..b14e510c8f 100644 --- a/site/pages/packages/aa-ethers/provider-adapter/introduction.md +++ b/site/pages/packages/aa-ethers/provider-adapter/introduction.md @@ -23,7 +23,7 @@ import { provider } from "./ethers-provider"; import { LightSmartContractAccount, getDefaultLightAccountFactoryAddress, -} from "@alchemy/aa-accounts"; +} from "@account-kit/smart-contracts"; import { LocalAccountSigner, type SmartAccountSigner } from "@alchemy/aa-core"; import { polygonMumbai } from "@alchemy/aa-core"; import { http } from "viem"; diff --git a/site/pages/packages/aa-signers/arcana-auth/authenticate.md b/site/pages/packages/aa-signers/arcana-auth/authenticate.md deleted file mode 100644 index 3c15369957..0000000000 --- a/site/pages/packages/aa-signers/arcana-auth/authenticate.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: ArcanaAuthSigner • authenticate -description: Overview of the authenticate method on ArcanaAuthSigner ---- - -# authenticate - -`authenticate` is a method on the `ArcanaAuthSigner` that leverages the `Arcana` Auth Web SDK to authenticate a user. - -This method must be called before accessing the other methods available on the `ArcanaAuthSigner`, such as signing messages or typed data or accessing user details. - -## Usage - -```ts [example.ts] -// [!code focus:99] -import { ArcanaAuthSigner } from "@alchemy/aa-signers"; -// Register app through Arcana Developer Dashboard to get clientId -// ARCANA_AUTH_CLIENTID = "xar_live_nnnnnnnnnn" -const newArcanaAuthSigner = new ArcanaAuthSigner({ - clientId: ARCANA_AUTH_CLIENTID, -}); -// or -// import { AuthProvider } from "@arcana/auth"; -// const inner = new AuthProvider ("xar_live_nnnn"); -// const newArcanaAuthSigner = new ArcanaAuthSigner({inner}); -const getUserInfo = await newArcanaAuthSigner.authenticate(); -``` - -## Returns - -### `Promise` - -A `Promise` containing the `UserInfo`, an object with the following fields: - -- `address: string | null` -- the EoA account address associated with the authenticated user's wallet. -- `email: string | null` -- email address of the authenticated user. -- `id: string | null` -- the decentralized user identifier. -- `loginToken: string` -- JWT token returned after the user authenticates. -- `loginType: Logins | passwordless` -- login provider type or passwordless used for authentication (ex. `[{ Logins: "google" | "github" | "discord" | "twitch" | "twitter" | "aws" | "firebase" | "steam" }]`). -- `name: string` -- user name associated with the email id -- `picture: string` -- url pointing to the user profile image -- `publicKey: string` -- public key associated with the user account - -See [Arcana Auth SDK Reference Guide](https://authsdk-ref-guide.netlify.app/interfaces/userinfo) for details. - -## Parameters - -### `clientId`: Unique app identifier assigned after app registration via the Arcana Developer Dashboard - -or - -### `inner`: An AuthProvider object. For field details, see [AuthProvider constructor](https://authsdk-ref-guide.netlify.app/classes/authprovider#constructor). diff --git a/site/pages/packages/aa-signers/arcana-auth/constructor.md b/site/pages/packages/aa-signers/arcana-auth/constructor.md deleted file mode 100644 index f7e6068061..0000000000 --- a/site/pages/packages/aa-signers/arcana-auth/constructor.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: ArcanaAuthSigner • constructor -description: Overview of the constructor method on ArcanaAuthSigner in aa-signers ---- - -# constructor - -To initialize `ArcanaAuthSigner`, you must provide a set of parameters detailed below. - -## Usage - -```ts [example.ts] -import { ArcanaAuthSigner } from "@alchemy/aa-signers"; - -// instantiates using every possible parameter, as a reference -const newArcanaAuthSigner = new ArcanaAuthSigner({ - clientId: "ARCANA_AUTH_CLIENT_ID", //Register app through dashboard and get clientId - params: { //See `AuthProvider` constructor params - network: 'testnet' | 'mainnet' | `NetworkConfig` - alwaysVisible: boolean // Wallet displayed always in the app or only when a transaction needs review - chainConfig: `ChainConfigInput` - redirectUrl: string // After authentication, window where the control returns - theme: 'light' | 'dark' - position: 'left' | 'right' // Wallet displayed on LHS or RHS in the app context - setWindowProvider: `boolean` // default is false - connectOptions: ConnectOptions - }, -}); -``` - -For details, see [`AuthProvider ConstructorParams`](https://authsdk-ref-guide.netlify.app/interfaces/constructorparams). - -## Returns - -### `ArcanaAuthSigner` - -A new instance of an `ArcanaAuthSigner`. - -## Parameters - -### `params: { clientId: string, params: ConstructorParams } | { inner: AuthProvider }` - -You can either pass in a constructed `AuthProvider` object, or directly pass into the `ArcanaAuthSigner` the `clientId` and the `AuthProvider` [`ConstructorParams`](https://authsdk-ref-guide.netlify.app/interfaces/constructorparams) used to construct an `AuthProvider` object. These parameters are listed on the [Arcana Auth SDK Reference Guide](https://authsdk-ref-guide.netlify.app/interfaces/constructorparams). You can refer to tutorials and the sample code for usage details in the [Arcana Docs](https://docs.arcana.network/tutorials/code-samples/web/) as well. - -`ArcanaAuthSigner` takes in the following parameters: - -- `inner`: an `AuthProvider` object - or -- `clientId: string` -- a unique app id assigned after app registration via the [Arcana Developer Dashboard](https://dashboard.arcana.network/). - -- `params: ConstructorParams` -- [optional] these are used to customize the Arcana Auth SDK usage. - -See [`ConstructorParams`](https://authsdk-ref-guide.netlify.app/interfaces/constructorparams) for details. diff --git a/site/pages/packages/aa-signers/arcana-auth/getAddress.md b/site/pages/packages/aa-signers/arcana-auth/getAddress.md deleted file mode 100644 index 3475d6b826..0000000000 --- a/site/pages/packages/aa-signers/arcana-auth/getAddress.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: ArcanaAuthSigner • getAddress -description: Overview of the getAddress method on ArcanaAuthSigner ---- - -# getAddress - -`getAddress` returns the EOA address of the `ArcanaAuthSigner`. - -This method must be called after [`authenticate`](/packages/aa-signers/arcana-auth/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createArcanaAuthSigner } from "./arcana-auth"; -// [!code focus:99] -const newArcanaAuthSigner = await createArcanaAuthSigner(); - -const address = await newArcanaAuthSigner.getAddress(); -``` - -```ts [arcana-auth.ts] -// [!include ~/snippets/signers/arcana-auth.ts] -``` - -::: - -## Returns - -### `Promise
` - -A `Promise` containing the address of the `ArcanaAuthSigner`. diff --git a/site/pages/packages/aa-signers/arcana-auth/getAuthDetails.md b/site/pages/packages/aa-signers/arcana-auth/getAuthDetails.md deleted file mode 100644 index c6366697af..0000000000 --- a/site/pages/packages/aa-signers/arcana-auth/getAuthDetails.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: ArcanaAuthSigner • getAuthDetails -description: Overview of the getAuthDetails method on ArcanaAuthSigner ---- - -# getAuthDetails - -`getAuthDetails` returns the details about the authenticated user, per the `Arcana Auth` SDK's `getUser` [UserInfo specifications](https://authsdk-ref-guide.netlify.app/interfaces/userinfo. - -This method must be called after [`authenticate`](/packages/aa-signers/arcana-auth/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createArcanaAuthSigner } from "./arcana-auth"; -// [!code focus:99] -const newArcanaAuthSigner = await createArcanaAuthSigner(); - -const details = await newArcanaAuthSigner.getAuthDetails(); -``` - -```ts [arcana-auth.ts] -// [!include ~/snippets/signers/arcana-auth.ts] -``` - -::: - -## Returns - -### `Promise` - -A `Promise` containing the `UserInfo`, an object with the following fields: - -- `address: string | null` -- the EOA account address associated with the authenticated user's wallet. -- `email: string | null` -- email address of the authenticated user. -- `id: string | null` -- the decentralized user identifier. -- `loginToken: string` -- JWT token returned after the user authenticates. -- `loginType: Logins | passwordless` -- login provider type or passwordless used for authentication (ex. `[{ Logins: "google" | "github" | "discord" | "twitch" | "twitter" | "aws" | "firebase" | "steam" }]`). -- `name: string` -- user name associated with the email id -- `picture: string` -- url pointing to the user profile image -- `publicKey: string` -- public key associated with the user account - -See [Arcana Auth SDK Reference Guide](https://authsdk-ref-guide.netlify.app/interfaces/userinfo) for details. diff --git a/site/pages/packages/aa-signers/arcana-auth/introduction.md b/site/pages/packages/aa-signers/arcana-auth/introduction.md deleted file mode 100644 index 26b41c06e6..0000000000 --- a/site/pages/packages/aa-signers/arcana-auth/introduction.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: ArcanaAuthSigner -description: Overview of the ArcanaAuthSigner class in aa-signers ---- - -# Arcana Auth Signer - -`ArcanaAuthSigner` is a signer implementation that extends `SmartAccountAuthenticator` to leverage the [Arcana Auth SDK](https://docs.arcana.network). It supports features such as authentication, message and typed data signing, and authentication details retrieval. - -`ArcanaAuthSigner` provides implementations for all methods on `SmartAccountAuthenticator`: - -1. [`authenticate`](/packages/aa-signers/arcana-auth/authenticate) -- supports user authentication. -2. [`getAddress`](/packages/aa-signers/arcana-auth/getAddress) -- gets the address of the smart contract account's connected signer. -3. [`signMessage`](/packages/aa-signers/arcana-auth/signMessage) -- supports message signatures. -4. [`signTypedData`](/packages/aa-signers/arcana-auth/signTypedData) -- supports typed data signatures. -5. [`getAuthDetails`](/packages/aa-signers/arcana-auth/getAuthDetails) -- supports authentication details retrieval. - -## Install Dependencies - -`ArcanaAuthSigner` requires the installation of the [`Arcana Auth`](https://www.npmjs.com/package/@arcana/auth) SDK. `aa-signers` lists it as an optional dependency. - -:::code-group - -```bash [npm] -npm i -s @arcana/auth -``` - -```bash [yarn] -yarn add @arcana/auth -``` - -## Usage - -:::code-group - -```ts [example.ts] -import { ArcanaAuthSigner } from "@alchemy/aa-signers/arcana-auth"; - -const newArcanaAuthSigner = new ArcanaAuthSigner({ - clientId: "ARCANA_AUTH_CLIENT_ID", -}); -// or by using inner - -import { AuthProvider } from "@arcana/auth"; - -const authParams = { - theme: "light", - network: "testnet", - position: "left", -}; - -const inner = new AuthProvider("ARCANA_AUTH_CLIENT_ID", authParams); -const newArcanaAuthSigner2 = new ArcanaAuthSigner({ inner }); - -const getUserInfo = await newArcanaAuthSigner.authenticate(); - -const address = await newArcanaAuthSigner.getAddress(); - -const details = await newArcanaAuthSigner.getAuthDetails(); - -const signedMessage = await newArcanaAuthSigner.signMessage("test"); - -const typedData = { - types: { - Request: [{ name: "hello", type: "string" }], - }, - primaryType: "Request", - message: { - hello: "world", - }, -}; -const signTypedData = await newArcanaAuthSigner.signTypedData(typedData); -``` - -```ts [arcana-auth.ts] -// [!include ~/snippets/signers/arcana-auth.ts] -``` - -::: - -## Developer Links - -- [authParams](https://authsdk-ref-guide.netlify.app/interfaces/constructorparams) -- [Arcana Auth SDK Reference Guide](https://authsdk-ref-guide.netlify.app/) -- [Arcana Auth Documentation](https://docs.arcana.network) -- [GitHub: Arcana Auth](https://github.com/arcana-network/auth) diff --git a/site/pages/packages/aa-signers/arcana-auth/signMessage.md b/site/pages/packages/aa-signers/arcana-auth/signMessage.md deleted file mode 100644 index 0a30dc1381..0000000000 --- a/site/pages/packages/aa-signers/arcana-auth/signMessage.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: ArcanaAuthSigner • signMessage -description: Overview of the signMessage method on ArcanaAuthSigner ---- - -# signMessage - -`signMessage` supports signing messages from the `ArcanaAuthSigner`. - -This method must be called after [`authenticate`](/packages/aa-signers/arcana-auth/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createArcanaAuthSigner } from "./arcana-auth"; -// [!code focus:99] -const newArcanaAuthSigner = await createArcanaAuthSigner(); - -const signedMessage = await newArcanaAuthSigner.signMessage( - "testMessage signing with ArcanaAuthSigner" -); -``` - -```ts [arcana-auth.ts] -// [!include ~/snippets/signers/arcana-auth.ts] -``` - -::: - -## Returns - -### `Promise` - -A `Promise` containing the signature of the message. - -## Parameters - -### `msg: string | Uint8Array)` -- the message to sign diff --git a/site/pages/packages/aa-signers/arcana-auth/signTypedData.md b/site/pages/packages/aa-signers/arcana-auth/signTypedData.md deleted file mode 100644 index 223fe361ea..0000000000 --- a/site/pages/packages/aa-signers/arcana-auth/signTypedData.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: ArcanaAuthSigner • signTypedData -description: Overview of the signTypedData method on ArcanaAuthSigner ---- - -# signTypedData - -`signTypedData` supports signing typed data from the `ArcanaAuthSigner`. - -This method must be called after [`authenticate`](/packages/aa-signers/arcana-auth/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createArcanaAuthSigner } from "./arcana-auth"; -// [!code focus:99] -const newArcanaAuthSigner = await createArcanaAuthSigner(); - -const signedTypedData = await newArcanaAuthSigner.signTypedData({ - domain: { - name: "Ether Mail", - version: "1", - chainId: 1, - verifyingContract: "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC", - }, - types: { - Person: [ - { name: "name", type: "string" }, - { name: "wallet", type: "address" }, - ], - Mail: [ - { name: "from", type: "Person" }, - { name: "to", type: "Person" }, - { name: "contents", type: "string" }, - ], - }, - primaryType: "Mail", - message: { - from: { - name: "Cow", - wallet: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", - }, - to: { - name: "Bob", - wallet: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB", - }, - contents: "Hello, Bob!", - }, -}); -``` - -```ts [arcana-auth.ts] -// [!include ~/snippets/signers/arcana-auth.ts] -``` - -::: - -## Returns - -### `Promise` - -A `Promise` containing the signature of the typed data. - -## Parameters - -### `params: SignTypedDataParams` -- the typed data to sign - -- `domain: TypedDataDomain` -- The typed data domain -- `types: Object` -- the type definitions for the typed data -- `primaryType: inferred String` -- the primary type to extract from types and use in value -- `message: inferred from types & primaryType` -- the message, inferred from diff --git a/site/pages/packages/aa-signers/capsule/authenticate.md b/site/pages/packages/aa-signers/capsule/authenticate.md deleted file mode 100644 index 151405bb3f..0000000000 --- a/site/pages/packages/aa-signers/capsule/authenticate.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: CapsuleSigner • authenticate -description: Overview of the authenticate method on CapsuleSigner ---- - -# authenticate - -`authenticate` is a method on the `CapsuleSigner` which leverages the `Capsule` SDK to authenticate a user. - -You must call this method before accessing the other methods available on the `CapsuleSigner`, such as signing messages or typed data or accessing user details. - -## Usage - -```ts [example.ts] -// [!code focus:99] -import { CapsuleSigner } from "@alchemy/aa-signers/capsule"; - -const capsuleSigner = new CapsuleSigner({ - env: Environment.DEVELOPMENT, - apiKey: "CAPSULE_API_KEY", - walletConfig: { - chain: sepolia, - // get your own Alchemy API key at: https://dashboard.alchemy.com/ - transport: http(`${sepolia.rpcUrls.alchemy.http[0]}/ALCHEMY_API_KEY`), - }, -}); - -await capsuleSigner.authenticate(); - -// after calling `authenticate`, a user must either be created or logged in to perform any signing operations using `capsuleSigner` -// follow the documentation at https://docs.usecapsule.com/integration-guide/user-and-wallet-creation using `capsuleSigner.inner` to create or login a user -``` - -## Returns - -### `Promise` - -A `Promise` containing the `CapsuleUserInfo`, an `Record` where Wallet is an object with the following properties: - -- `id: string` -- ID of the Capsule Signer. - -- `signer: string` -- Capsule Signer information. - -- `address: string` -- [optional] EOA address of the Capsule Signer. - -- `publicKey: string` -- [optional] Public Key of the Capsule Signer. - -- `scheme: WalletScheme` -- [optional] either `CGGMP` or `DKLS`. diff --git a/site/pages/packages/aa-signers/capsule/constructor.md b/site/pages/packages/aa-signers/capsule/constructor.md deleted file mode 100644 index 648772d580..0000000000 --- a/site/pages/packages/aa-signers/capsule/constructor.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: CapsuleSigner • constructor -description: Overview of the constructor method on CapsuleSigner in aa-signers ---- - -# constructor - -To initialize a `CapsuleSigner`, you must provide a set of parameters detailed below. - -## Usage - -```ts [example.ts] -import { CapsuleSigner } from "@alchemy/aa-signers/capsule"; -import { ChainId } from "@capsule/capsule-web3-provider"; - -// instantiates using every possible parameter, as a reference -const capsuleSigner = new CapsuleSigner({ - env: Environment.DEVELOPMENT, - apiKey: "CAPSULE_API_KEY", - walletConfig: { - chain: sepolia, - // get your own Alchemy API key at: https://dashboard.alchemy.com/ - transport: http(`${sepolia.rpcUrls.alchemy.http[0]}/ALCHEMY_API_KEY`), - }, -}); -``` - -## Returns - -### `CapsuleSigner` - -A new instance of a `CapsuleSigner`. - -## Parameters - -### `params: CapsuleProviderConfig | { inner: CapsuleWeb3Provider }` - -You can either pass in a constructed `CapsuleWeb3Provider` object, or directly pass into the `CapsuleSigner` the `CapsuleProviderConfig` used to construct a `CapsuleWeb3Provider` object. These parameters are listed on the [Capsule docs](https://capsule-org.github.io/web-sdk/modules) as well. - -`CapsuleProviderConfig` takes in the following parameters: - -- `env: Environment` -- a Capsule API Key. You can get one at the [Capsule Developer Dashboard](https://developers.capsule.com/docs/quickstart#api-user-creation). - -- `walletConfig: WalletClientConfig`-- Config for Viem Wallet. See type [here](https://viem.sh/docs/clients/wallet#parameters). - -- `apiKey: string`-- Capsule API key for signing requests. - -- `opts: ConstructorOpts | undefined`-- [optional] Object with the following properties. See type [here](https://capsule-org.github.io/web-sdk/functions/createCapsuleViemClient). - - - `useStorageOverrides: boolean` -- [optional] Flag to override storage. - - - `disableWorkers: boolean` -- [optional] Flag to disable workers. - - - `offloadMPCComputationURL: string` -- [optional] Override URL to offload MPC computation. - - - `useLocalFiles: boolean` -- [optional] Flag to use local files. - - - `localStorageGetItemOverride: (key: string) => Promise` -- [optional] Override method for getting items from local storage. - - - `localStorageSetItemOverride: (key: string, value: string) => Promise` -- [optional] Override method for setting items on local storage. - - - `sessionStorageGetItemOverride: (key: string) => Promise` -- [optional] Override method for getting items from session storage. - - - `sessionStorageSetItemOverride: (key: string, value: string) => Promise` -- [optional] Override method for setting items on session storage. - - - `sessionStorageRemoveItemOverride: (key: string) => Promise` -- [optional] Override method for removing items on session storage. - - - `clearStorageOverride: () => Promise` -- [optional] Override method for clearing storage. - - - `portalBackgroundColor: string` -- [optional] Color of background portal. - - - `portalPrimaryButtonColor: string` -- [optional] Color of portal primary button color. - - - `portalTextColor: string` -- [optional] Color of portal text. - - - `portalPrimaryButtonTextColor: string` -- [optional] Color of portal primary button text. - - - `useDKLSForCreation: boolean` -- [optional] Flag to use DKLS for creation. - -- `viemClientOpts: ViemClientOpts` -- [optional] Object with the following properties: - - - `noAccount: boolean` -- [optional] Flag to skip creating a viem `Account` on Capsule's WalletClient, and instead have the `Account` be created and passed in separately when calling other methods on the client. Default false and recommended not to use. diff --git a/site/pages/packages/aa-signers/capsule/getAddress.md b/site/pages/packages/aa-signers/capsule/getAddress.md deleted file mode 100644 index 60fd8545fd..0000000000 --- a/site/pages/packages/aa-signers/capsule/getAddress.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: CapsuleSigner • getAddress -description: Overview of the getAddress method on CapsuleSigner ---- - -# getAddress - -`getAddress` returns the EOA address of the Signer. - -This method must be called after [`authenticate`](/packages/aa-signers/capsule/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createCapsuleSigner } from "./capsule"; -// [!code focus:99] -const capsuleSigner = await createCapsuleSigner(); - -const address = await capsuleSigner.getAddress(); -``` - -```ts [capsule.ts] -// [!include ~/snippets/signers/capsule.ts] -``` - -::: - -## Returns - -### `Promise
` - -A `Promise` containing the address of the Signer. diff --git a/site/pages/packages/aa-signers/capsule/getAuthDetails.md b/site/pages/packages/aa-signers/capsule/getAuthDetails.md deleted file mode 100644 index 4f0476f0de..0000000000 --- a/site/pages/packages/aa-signers/capsule/getAuthDetails.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: CapsuleSigner • getAuthDetails -description: Overview of the getAuthDetails method on CapsuleSigner ---- - -# getAuthDetails - -`getAuthDetails` returns the details about the authenticated user, specifically all EOA addresses tied to the user's Capsule account. - -This method must be called after [`authenticate`](/packages/aa-signers/capsule/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createCapsuleSigner } from "./capsule"; -// [!code focus:99] -const capsuleSigner = await createCapsuleSigner(); - -const details = await capsuleSigner.getAuthDetails(); -``` - -```ts [capsule.ts] -// [!include ~/snippets/signers/capsule.ts] -``` - -::: - -## Returns - -### `Promise` - -A `Promise` containing the `CapsuleUserInfo`, an `Record` where Wallet is an object with the following properties: - -- `id: string` -- ID of the Capsule Signer. - -- `signer: string` -- Capsule Signer information. - -- `address: string` -- [optional] EOA address of the Capsule Signer. - -- `publicKey: string` -- [optional] Public Key of the Capsule Signer. - -- `scheme: WalletScheme` -- [optional] either `CGGMP` or `DKLS`. diff --git a/site/pages/packages/aa-signers/capsule/introduction.md b/site/pages/packages/aa-signers/capsule/introduction.md deleted file mode 100644 index 4b9db3f01d..0000000000 --- a/site/pages/packages/aa-signers/capsule/introduction.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: CapsuleSigner -description: Overview of the CapsuleSigner class in aa-signers ---- - -# Capsule Signer - -`CapsuleSigner` is a signer implementation which extends `SmartAccountAuthenticator` to leverage the [Capsule SDK](https://docs.usecapsule.com/getting-started/initial-setup). It supports features such as authentication, message and typed data signing, and authentication details retrieval. - -`CapsuleSigner` provides implementations for all methods on `SmartAccountAuthenticator`: - -1. [`authenticate`](/packages/aa-signers/capsule/authenticate) -- supports user authentication. -2. [`getAddress`](/packages/aa-signers/capsule/getAddress) -- gets the address of the smart contract account's connected EOA signer account. -3. [`signMessage`](/packages/aa-signers/capsule/signMessage) -- supports message signatures. -4. [`signTypedData`](/packages/aa-signers/capsule/signTypedData) -- supports typed data signatures. -5. [`getAuthDetails`](/packages/aa-signers/capsule/getAuthDetails) -- supports authentication details retrieval. - -## Install Dependencies - -`CapsuleSigner` requires installation of the [`@usecapsule/web-sdk`](https://capsule-org.github.io/web-sdk/) SDK. `aa-signers` lists it as an optional dependency. - -:::code-group - -```bash [npm] -npm i -s @usecapsule/web-sdk -``` - -```bash [yarn] -yarn add @usecapsule/web-sdk -``` - -## Usage - -:::code-group - -```ts [example.ts] -import { createCapsuleSigner } from "./capsule"; - -const capsuleSigner = await createCapsuleSigner(); - -const address = await capsuleSigner.getAddress(); - -const details = await capsuleSigner.getAuthDetails(); - -const signedMessage = await capsuleSigner.signMessage("test"); - -const typedData = { - types: { - Request: [{ name: "hello", type: "string" }], - }, - primaryType: "Request", - message: { - hello: "world", - }, -}; -const signTypedData = await capsuleSigner.signTypedData(typedData); -``` - -```ts [capsule.ts] -// [!include ~/snippets/signers/capsule.ts] -``` - -::: - -## Developer Links - -- [Capsule SDK](https://capsule-org.github.io/web-sdk/) -- [CapsuleSigner Tests](https://github.com/alchemyplatform/aa-sdk/blob/main/packages/signers/src/capsule/__tests__/signer.test.ts) diff --git a/site/pages/packages/aa-signers/capsule/signMessage.md b/site/pages/packages/aa-signers/capsule/signMessage.md deleted file mode 100644 index 2f2549d93d..0000000000 --- a/site/pages/packages/aa-signers/capsule/signMessage.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: CapsuleSigner • signMessage -description: Overview of the signMessage method on CapsuleSigner ---- - -# signMessage - -`signMessage` supports signing messages from the `CapsuleSigner`. - -This method must be called after [`authenticate`](/packages/aa-signers/capsule/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createCapsuleSigner } from "./capsule"; -// [!code focus:99] -const capsuleSigner = await createCapsuleSigner(); - -const signedMessage = await capsuleSigner.signMessage("test"); -``` - -```ts [capsule.ts] -// [!include ~/snippets/signers/capsule.ts] -``` - -::: - -## Returns - -### `Promise` - -A `Promise` containing the signature of the message. - -## Parameters - -### `msg: string | Uint8Array)` -- the message to sign diff --git a/site/pages/packages/aa-signers/capsule/signTypedData.md b/site/pages/packages/aa-signers/capsule/signTypedData.md deleted file mode 100644 index 301b7a303b..0000000000 --- a/site/pages/packages/aa-signers/capsule/signTypedData.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: CapsuleSigner • signTypedData -description: Overview of the signTypedData method on CapsuleSigner ---- - -# signTypedData - -`signTypedData` supports signing typed data from the `CapsuleSigner`. - -This method must be called after [`authenticate`](/packages/aa-signers/capsule/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createCapsuleSigner } from "./capsule"; -// [!code focus:99] -const capsuleSigner = await createCapsuleSigner(); - -const signedTypedData = await capsuleSigner.signTypedData({ - domain: { - name: "Ether Mail", - version: "1", - chainId: 1, - verifyingContract: "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC", - }, - types: { - Person: [ - { name: "name", type: "string" }, - { name: "wallet", type: "address" }, - ], - Mail: [ - { name: "from", type: "Person" }, - { name: "to", type: "Person" }, - { name: "contents", type: "string" }, - ], - }, - primaryType: "Mail", - message: { - from: { - name: "Cow", - wallet: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", - }, - to: { - name: "Bob", - wallet: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB", - }, - contents: "Hello, Bob!", - }, -}); -``` - -```ts [capsule.ts] -// [!include ~/snippets/signers/capsule.ts] -``` - -::: - -## Returns - -### `Promise` - -A `Promise` containing the signature of the typed data. - -## Parameters - -### `params: SignTypedDataParams` -- the typed data to sign - -- `domain: TypedDataDomain` -- The typed data domain -- `types: Object` -- the type definitions for the typed data -- `primaryType: inferred String` -- the primary type to extract from types and use in value -- `message: inferred from types & primaryType` -- the message, inferred from diff --git a/site/pages/packages/aa-signers/contributing.md b/site/pages/packages/aa-signers/contributing.md deleted file mode 100644 index 12b1fa9a99..0000000000 --- a/site/pages/packages/aa-signers/contributing.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: Contributing to aa-signers -description: How to add your own Signer Implementation to aa-signers ---- - -# Contributing to `aa-signers` - -If you are looking to add a new Signer type, please follow the following structure. - -1. Create a new folder in `src` with the name of your Signer type in `kebab-case` (we are following kebab casing for files throughout the project). -2. If you require importing an external library for your implementation, add it as an `optionalDependency` -3. Create a new file in the folder you just created called `signer.ts` and add your implementation for `SmartAccountSigner` or `SmartAccountAuthenticator`. -4. If needed, create a file in your folder called `types.ts` and add any necessary types required for authentication, details, or the inner SDK. -5. Add some tests for your Signer by creating a subfolder in your `signer/my-signer` called `__tests__` and make sure your files end with the `.test.ts` suffix. -6. Export the classes and types you have defined in `src/index.ts`. -7. Open a PR and we will review it as soon as possible! diff --git a/site/pages/packages/aa-signers/fireblocks/authenticate.md b/site/pages/packages/aa-signers/fireblocks/authenticate.md deleted file mode 100644 index fe9ad742fd..0000000000 --- a/site/pages/packages/aa-signers/fireblocks/authenticate.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: FireblocksSigner • authenticate -description: Overview of the authenticate method on FireblocksSigner ---- - -# authenticate - -`authenticate` is a method on the `FireblocksSigner` which leverages the `Fireblocks` SDK to authenticate a user. - -You must call this method before accessing the other methods available on the `FireblocksSigner`, such as signing messages or typed data or accessing user details. - -## Usage - -```ts [example.ts] -// [!code focus:99] -import { FireblocksSigner } from "@alchemy/aa-signers/fireblocks"; -import { ChainId } from "@fireblocks/fireblocks-web3-provider"; - -const fireblocksSigner = new FireblocksSigner({ - privateKey: process.env.FIREBLOCKS_API_PRIVATE_KEY_PATH, - apiKey: process.env.FIREBLOCKS_API_KEY, - chainId: ChainId.SEPOLIA, -}); - -await fireblocksSigner.authenticate(); -``` - -## Returns - -### `Promise` - -A `Promise` containing the `FireblocksUserInfo`, an object with the following fields: - -- `addresses: Address[]` -- all EOA addresses accessible via the Signer. diff --git a/site/pages/packages/aa-signers/fireblocks/constructor.md b/site/pages/packages/aa-signers/fireblocks/constructor.md deleted file mode 100644 index 3bc987d140..0000000000 --- a/site/pages/packages/aa-signers/fireblocks/constructor.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -title: FireblocksSigner • constructor -description: Overview of the constructor method on FireblocksSigner in aa-signers ---- - -# constructor - -To initialize a `FireblocksSigner`, you must provide a set of parameters detailed below. - -## Usage - -```ts [example.ts] -import { FireblocksSigner } from "@alchemy/aa-signers/fireblocks"; -import { ChainId } from "@fireblocks/fireblocks-web3-provider"; - -// instantiates using every possible parameter, as a reference -const fireblocksSigner = new FireblocksSigner({ - apiKey: "API_KEY", - privateKey: "PATH_TO_FILE_WITH_PRIVATE_KEY", - chainId: ChainId.SEPOLIA, - rpcUrl: "ALCHEMY_RPC_URL", - vaultAccountIds: ["VAULT_ID"], - apiBaseUrl: "FIREBLOCKS_API_URL", - note: "note", - pollingInterval: 1000, - oneTimeAddressesEnabled: true, - externalTxId: "1", - userAgent: "test-header", - assetId: "1", - logTransactionStatusChanges: true, - logRequestsAndResponses: true, - enhancedErrorHandling: true, - gaslessGasTankVaultId: 1, -}); -``` - -## Returns - -### `FireblocksSigner` - -A new instance of a `FireblocksSigner`. - -## Parameters - -### `params: FireblocksProviderConfig | { inner: FireblocksWeb3Provider }` - -You can either pass in a constructed `FireblocksWeb3Provider` object, or directly pass into the `FireblocksSigner` the `FireblocksProviderConfig` used to construct a `FireblocksWeb3Provider` object. These parameters are listed on the [Fireblocks repo](https://github.com/fireblocks/fireblocks-web3-provider/blob/main/src/types.ts#L48) as well. - -`FireblocksProviderConfig` takes in the following parameters: - -- `apiKey: string` -- a Fireblocks API Key. You can get one at the [Fireblocks Developer Dashboard](https://developers.fireblocks.com/docs/quickstart#api-user-creation). - -- `privateKey: string`-- Fireblocks API private key for signing requests. - -- `chainId: ChainId`-- Fireblocks API private key for signing requests. Required if `rpcUrl` is not provided. - -- `rpcUrl: ChainId`-- Url to which to transport JSON-RPC requests. Required if `chainId` is not provided. - -- `vaultAccountIds: number | number[] | string | string[]` -- [optional] list of Fireblocks vaults to provide for the Signer. By default, the first 20 vault accounts are dynamically loaded from the Fireblocks API. - -- `apiBaseUrl` -- [optional] base Url for querying the Fireblocks API. By default, it uses the Fireblocks API production endpoint. - -- `fallbackFeeLevel: FeeLevel = "LOW" | "MEDIUM" | "HIGH"` -- [optional] fallback fee for requests. Default Medium. - -- `note: string` -- [optional] By default, the note is set to "Created by Fireblocks Web3 Provider." - -- `pollingInterval: number` -- [optional] The interval in which the Fireblocks API is queried to check the status of transactions. Default is 1 second. - -- `oneTimeAddressesEnabled: boolean` -- [optional] Flag to determine if one time addresses are enabled in your Fireblocks workspace. Default true. - -- `externalTxId: (() => string) | string` -- [optional] External ID you can use to associate with transactions. - -- `userAgent: string` -- [optional] Additional appended product string to the `User-Agent` header on requests. - -- `assetId: string` -- [optional] custom ID for a Fireblocks asset, used with custom or private EVM chains. - -- `logTransactionStatusChanges: boolean` -- [optional] Flag to determine if every transaction status change will be logged to the console. Default false. - -- `logRequestsAndResponses: boolean` -- [optional] Flag to determine if every request and response processed by the provider will be logged to the console. Default false. - -- `enhancedErrorHandling: boolean` -- [optional] Flag to determine verbosity of failed transaction information. Default true. - -- `gaslessGasTankVaultId: number` -- [optional] If set, all transactions sent gaslessly, relayed via the provided vault ID. Default true. diff --git a/site/pages/packages/aa-signers/fireblocks/getAddress.md b/site/pages/packages/aa-signers/fireblocks/getAddress.md deleted file mode 100644 index 901f995ef2..0000000000 --- a/site/pages/packages/aa-signers/fireblocks/getAddress.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: FireblocksSigner • getAddress -description: Overview of the getAddress method on FireblocksSigner ---- - -# getAddress - -`getAddress` returns the EOA address of the Signer. - -This method must be called after [`authenticate`](/packages/aa-signers/fireblocks/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createFireblocksSigner } from "./fireblocks"; -// [!code focus:99] -const fireblocksSigner = await createFireblocksSigner(); - -const address = await fireblocksSigner.getAddress(); -``` - -```ts [fireblocks.ts] -// [!include ~/snippets/signers/fireblocks.ts] -``` - -::: - -## Returns - -### `Promise
` - -A `Promise` containing the address of the Signer. diff --git a/site/pages/packages/aa-signers/fireblocks/getAuthDetails.md b/site/pages/packages/aa-signers/fireblocks/getAuthDetails.md deleted file mode 100644 index 11fbe6b7ce..0000000000 --- a/site/pages/packages/aa-signers/fireblocks/getAuthDetails.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: FireblocksSigner • getAuthDetails -description: Overview of the getAuthDetails method on FireblocksSigner ---- - -# getAuthDetails - -`getAuthDetails` returns the details about the authenticated user, specifically all EOA addresses tied to the user's Fireblocks vault. - -This method must be called after [`authenticate`](/packages/aa-signers/fireblocks/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createFireblocksSigner } from "./fireblocks"; -// [!code focus:99] -const fireblocksSigner = await createFireblocksSigner(); - -const details = await fireblocksSigner.getAuthDetails(); -``` - -```ts [fireblocks.ts] -// [!include ~/snippets/signers/fireblocks.ts] -``` - -::: - -## Returns - -### `Promise` - -A `Promise` containing the `FireblocksUserInfo`, an object with the following fields: - -- `addresses: Address[]` -- all EOA addresses accessible via the user's Fireblocks vault. diff --git a/site/pages/packages/aa-signers/fireblocks/introduction.md b/site/pages/packages/aa-signers/fireblocks/introduction.md deleted file mode 100644 index be8765502e..0000000000 --- a/site/pages/packages/aa-signers/fireblocks/introduction.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: FireblocksSigner -description: Overview of the FireblocksSigner class in aa-signers ---- - -# Fireblocks Signer - -`FireblocksSigner` is a signer implementation which extends `SmartAccountAuthenticator` to leverage the [Fireblocks SDK](https://github.com/fireblocks/fireblocks-web3-provider). It supports features such as authentication, message and typed data signing, and authentication details retrieval. - -`FireblocksSigner` provides implementations for all methods on `SmartAccountAuthenticator`: - -1. [`authenticate`](/packages/aa-signers/fireblocks/authenticate) -- supports user authentication. -2. [`getAddress`](/packages/aa-signers/fireblocks/getAddress) -- gets the address of the smart contract account's connected EOA signer account. -3. [`signMessage`](/packages/aa-signers/fireblocks/signMessage) -- supports message signatures. -4. [`signTypedData`](/packages/aa-signers/fireblocks/signTypedData) -- supports typed data signatures. -5. [`getAuthDetails`](/packages/aa-signers/fireblocks/getAuthDetails) -- supports authentication details retrieval. - -## Install Dependencies - -`FireblocksSigner` requires installation of the [`@fireblocks/fireblocks-web3-provider`](https://github.com/fireblocks/fireblocks-web3-provider) SDK. `aa-signers` lists it as an optional dependency. - -:::code-group - -```bash [npm] -npm i -s @fireblocks/fireblocks-web3-provider -``` - -```bash [yarn] -yarn add @fireblocks/fireblocks-web3-provider -``` - -## Usage - -:::code-group - -```ts [example.ts] -import { createFireblocksSigner } from "./fireblocks"; - -const fireblocksSigner = await createFireblocksSigner(); - -const address = await fireblocksSigner.getAddress(); - -const details = await fireblocksSigner.getAuthDetails(); - -const signedMessage = await fireblocksSigner.signMessage("test"); - -const typedData = { - types: { - Request: [{ name: "hello", type: "string" }], - }, - primaryType: "Request", - message: { - hello: "world", - }, -}; -const signTypedData = await fireblocksSigner.signTypedData(typedData); -``` - -```ts [fireblocks.ts] -// [!include ~/snippets/signers/fireblocks.ts] -``` - -::: - -## Developer Links - -- [Fireblocks SDK](https://github.com/fireblocks/fireblocks-web3-provider) -- [FireblocksSigner Tests](https://github.com/alchemyplatform/aa-sdk/blob/main/packages/signers/src/fireblocks/__tests__/signer.test.ts) diff --git a/site/pages/packages/aa-signers/fireblocks/signMessage.md b/site/pages/packages/aa-signers/fireblocks/signMessage.md deleted file mode 100644 index b72aa691fa..0000000000 --- a/site/pages/packages/aa-signers/fireblocks/signMessage.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: FireblocksSigner • signMessage -description: Overview of the signMessage method on FireblocksSigner ---- - -# signMessage - -`signMessage` supports signing messages from the `FireblocksSigner`. - -This method must be called after [`authenticate`](/packages/aa-signers/fireblocks/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createFireblocksSigner } from "./fireblocks"; -// [!code focus:99] -const fireblocksSigner = await createFireblocksSigner(); - -const signedMessage = await fireblocksSigner.signMessage("test"); -``` - -```ts [fireblocks.ts] -// [!include ~/snippets/signers/fireblocks.ts] -``` - -::: - -## Returns - -### `Promise` - -A `Promise` containing the signature of the message. - -## Parameters - -### `msg: string | Uint8Array)` -- the message to sign diff --git a/site/pages/packages/aa-signers/fireblocks/signTypedData.md b/site/pages/packages/aa-signers/fireblocks/signTypedData.md deleted file mode 100644 index 052207172a..0000000000 --- a/site/pages/packages/aa-signers/fireblocks/signTypedData.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: FireblocksSigner • signTypedData -description: Overview of the signTypedData method on FireblocksSigner ---- - -# signTypedData - -`signTypedData` supports signing typed data from the `FireblocksSigner`. - -This method must be called after [`authenticate`](/packages/aa-signers/fireblocks/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createFireblocksSigner } from "./fireblocks"; -// [!code focus:99] -const fireblocksSigner = await createFireblocksSigner(); - -const signedTypedData = await fireblocksSigner.signTypedData({ - domain: { - name: "Ether Mail", - version: "1", - chainId: 1, - verifyingContract: "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC", - }, - types: { - Person: [ - { name: "name", type: "string" }, - { name: "wallet", type: "address" }, - ], - Mail: [ - { name: "from", type: "Person" }, - { name: "to", type: "Person" }, - { name: "contents", type: "string" }, - ], - }, - primaryType: "Mail", - message: { - from: { - name: "Cow", - wallet: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", - }, - to: { - name: "Bob", - wallet: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB", - }, - contents: "Hello, Bob!", - }, -}); -``` - -```ts [fireblocks.ts] -// [!include ~/snippets/signers/fireblocks.ts] -``` - -::: - -## Returns - -### `Promise` - -A `Promise` containing the signature of the typed data. - -## Parameters - -### `params: SignTypedDataParams` -- the typed data to sign - -- `domain: TypedDataDomain` -- The typed data domain -- `types: Object` -- the type definitions for the typed data -- `primaryType: inferred String` -- the primary type to extract from types and use in value -- `message: inferred from types & primaryType` -- the message, inferred from diff --git a/site/pages/packages/aa-signers/fordefi/authenticate.md b/site/pages/packages/aa-signers/fordefi/authenticate.md deleted file mode 100644 index 8db8c41d87..0000000000 --- a/site/pages/packages/aa-signers/fordefi/authenticate.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: FordefiSigner • authenticate -description: Overview of the authenticate method on FordefiSigner ---- - -# authenticate - -`authenticate` is a method on the `FordefiSigner` which leverages the `Fordefi` provider to authenticate a user. - -You must call this method before accessing the other methods available on the `FordefiSigner`, such as signing messages or typed data or accessing user details. - -## Usage - -```ts [example.ts] -// [!code focus:99] -import { FordefiSigner } from "@alchemy/aa-signers/fordefi"; - -const fordefiSigner = new FordefiSigner({ - chainId: 11155111, - address: "0x1234567890123456789012345678901234567890", - apiUserToken: process.env.FORDEFI_API_USER_TOKEN!, - apiPayloadSignKey: process.env.FORDEFI_API_PAYLOAD_SIGNING_KEY!, -}); - -await fordefiSigner.authenticate(); -``` diff --git a/site/pages/packages/aa-signers/fordefi/constructor.md b/site/pages/packages/aa-signers/fordefi/constructor.md deleted file mode 100644 index 0f0c85fc0c..0000000000 --- a/site/pages/packages/aa-signers/fordefi/constructor.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: FordefiSigner • constructor -description: Overview of the constructor method on FordefiSigner in aa-signers ---- - -# constructor - -To initialize a `FordefiSigner`, you must provide a set of parameters detailed below. - -## Usage - -```ts [example.ts] -import { FordefiSigner } from "@alchemy/aa-signers/fordefi"; - -// instantiates using every possible parameter, as a reference -const fordefiSigner = new FordefiSigner({ - chainId: 11155111, - address: "0x1234567890123456789012345678901234567890", - apiUserToken: process.env.FORDEFI_API_USER_TOKEN!, - apiPayloadSignKey: process.env.FORDEFI_API_PAYLOAD_SIGNING_KEY!, -}); -``` - -## Returns - -### `FordefiSigner` - -A new instance of a `FordefiSigner`. - -## Parameters - -### `params: FordefiProviderConfig | { inner: FordefiWeb3Provider }` - -You can either pass in a constructed `FordefiWeb3Provider` object, or directly pass into the `FordefiSigner` the `FordefiProviderConfig` used to construct a `FordefiWeb3Provider` object. These parameters are listed on the [Fordefi repo](https://github.com/FordefiHQ/web3-provider/blob/main/src/types/config.ts) as well. - -`FordefiProviderConfig` takes in the following parameters: - -- `chainId: EvmChainId | EvmChainUniqueId` -- Chain on which the signer acts for the given address. - -- `address: Address` -- EVM address. - -- `apiUserToken: string` -- Fordefi API User token issued via the [Fordefi Web Console](https://app.fordefi.com). - -- `apiPayloadSignKey: string` -- Private key in PEM format used to sign the body of requests sent to the Fordefi API - the content of the private key `.pem`, see [Create a public/private signature key pair for the API client](https://docs.fordefi.com/reference/pair-an-api-client-with-the-api-signer). diff --git a/site/pages/packages/aa-signers/fordefi/getAddress.md b/site/pages/packages/aa-signers/fordefi/getAddress.md deleted file mode 100644 index f358dc0305..0000000000 --- a/site/pages/packages/aa-signers/fordefi/getAddress.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: FordefiSigner • getAddress -description: Overview of the getAddress method on FordefiSigner ---- - -# getAddress - -`getAddress` returns the EOA address of the Signer. - -This method must be called after [`authenticate`](/packages/aa-signers/fordefi/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createFordefiSigner } from "./fordefi"; -// [!code focus:99] -const fordefiSigner = await createFordefiSigner(); - -const address = await fordefiSigner.getAddress(); -``` - -```ts [fordefi.ts] -// [!include ~/snippets/signers/fordefi.ts] -``` - -::: - -## Returns - -### `Promise
` - -A Promise containing the EOA address accessible via the Signer. diff --git a/site/pages/packages/aa-signers/fordefi/getAuthDetails.md b/site/pages/packages/aa-signers/fordefi/getAuthDetails.md deleted file mode 100644 index 1e24222965..0000000000 --- a/site/pages/packages/aa-signers/fordefi/getAuthDetails.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: FordefiSigner • getAuthDetails -description: Overview of the getAuthDetails method on FordefiSigner ---- - -# getAuthDetails - -`getAuthDetails` currently does not have a return value. - -This method must be called after [`authenticate`](/packages/aa-signers/fordefi/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createFordefiSigner } from "./fordefi"; -// [!code focus:99] -const fordefiSigner = await createFordefiSigner(); - -const details = await fordefiSigner.getAuthDetails(); -``` - -```ts [fordefi.ts] -// [!include ~/snippets/signers/fordefi.ts] -``` - -::: - -## Returns - -### `Promise` - -Verifies that this signer is authenticated, and throws an error otherwise. -Authentication details are not available. diff --git a/site/pages/packages/aa-signers/fordefi/introduction.md b/site/pages/packages/aa-signers/fordefi/introduction.md deleted file mode 100644 index 011d1ecde0..0000000000 --- a/site/pages/packages/aa-signers/fordefi/introduction.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: FordefiSigner -description: Overview of the FordefiSigner class in aa-signers ---- - -# Fordefi Signer - -`FordefiSigner` is a signer implementation which extends `SmartAccountAuthenticator` to leverage the [Fordefi Web3 Provider](https://github.com/FordefiHQ/web3-provider). It supports features such as authentication, message and typed data signing, and authentication details retrieval. - -`FordefiSigner` provides implementations for all methods on `SmartAccountAuthenticator`: - -1. [`authenticate`](/packages/aa-signers/fordefi/authenticate) -- supports user authentication. -2. [`getAddress`](/packages/aa-signers/fordefi/getAddress) -- gets the address of the smart contract account's connected EOA signer account. -3. [`signMessage`](/packages/aa-signers/fordefi/signMessage) -- supports message signatures. -4. [`signTypedData`](/packages/aa-signers/fordefi/signTypedData) -- supports typed data signatures. -5. [`getAuthDetails`](/packages/aa-signers/fordefi/getAuthDetails) -- verifies that this signer is authenticated, it does not return any details. - -## Install Dependencies - -`FordefiSigner` requires installation of the [`@fordefi/web3-provider`](https://github.com/FordefiHQ/web3-provider) SDK. `aa-signers` lists it as an optional dependency. - -:::code-group - -```bash [npm] -npm i -s @fordefi/web3-provider -``` - -```bash [yarn] -yarn add @fordefi/web3-provider -``` - -::: - -## Usage - -:::code-group - -```ts [example.ts] -import { createFordefiSigner } from "./fordefi"; - -const fordefiSigner = await createFordefiSigner(); - -const address = await fordefiSigner.getAddress(); - -const details = await fordefiSigner.getAuthDetails(); - -const signedMessage = await fordefiSigner.signMessage("test"); - -const typedData = { - types: { - Request: [{ name: "hello", type: "string" }], - }, - primaryType: "Request", - message: { - hello: "world", - }, -}; -const signTypedData = await fordefiSigner.signTypedData(typedData); -``` - -```ts [fordefi.ts] -// [!include ~/snippets/signers/fordefi.ts] -``` - -::: - -## Developer Links - -- [Fordefi Web3 Provider](https://github.com/FordefiHQ/web3-provider) -- [Fordefi Web3 Provider Docs](https://web3provider-docs.fordefi.com/) -- [FordefiSigner Tests](https://github.com/alchemyplatform/aa-sdk/blob/main/packages/signers/src/fordefi/__tests__/signer.test.ts) diff --git a/site/pages/packages/aa-signers/fordefi/signMessage.md b/site/pages/packages/aa-signers/fordefi/signMessage.md deleted file mode 100644 index a0463856ce..0000000000 --- a/site/pages/packages/aa-signers/fordefi/signMessage.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: FordefiSigner • signMessage -description: Overview of the signMessage method on FordefiSigner ---- - -# signMessage - -`signMessage` supports signing messages from the `FordefiSigner`. - -This method must be called after [`authenticate`](/packages/aa-signers/fordefi/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createFordefiSigner } from "./fordefi"; -// [!code focus:99] -const fordefiSigner = await createFordefiSigner(); - -const signedMessage = await fordefiSigner.signMessage("test"); -``` - -```ts [fordefi.ts] -// [!include ~/snippets/signers/fordefi.ts] -``` - -::: - -## Returns - -### `Promise` - -A Promise containing the signature of the message. - -## Parameters - -### `msg: string | Uint8Array` -- the message to sign diff --git a/site/pages/packages/aa-signers/fordefi/signTypedData.md b/site/pages/packages/aa-signers/fordefi/signTypedData.md deleted file mode 100644 index e1596d91d9..0000000000 --- a/site/pages/packages/aa-signers/fordefi/signTypedData.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: FordefiSigner • signTypedData -description: Overview of the signTypedData method on FordefiSigner ---- - -# signTypedData - -`signTypedData` supports signing typed data from the `FordefiSigner`. - -This method must be called after [`authenticate`](/packages/aa-signers/fordefi/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createFordefiSigner } from "./fordefi"; -// [!code focus:99] -const fordefiSigner = await createFordefiSigner(); - -const signedTypedData = await fordefiSigner.signTypedData({ - domain: { - name: "Ether Mail", - version: "1", - chainId: 1, - verifyingContract: "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC", - }, - types: { - Person: [ - { name: "name", type: "string" }, - { name: "wallet", type: "address" }, - ], - Mail: [ - { name: "from", type: "Person" }, - { name: "to", type: "Person" }, - { name: "contents", type: "string" }, - ], - }, - primaryType: "Mail", - message: { - from: { - name: "Cow", - wallet: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", - }, - to: { - name: "Bob", - wallet: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB", - }, - contents: "Hello, Bob!", - }, -}); -``` - -```ts [fordefi.ts] -// [!include ~/snippets/signers/fordefi.ts] -``` - -::: - -## Returns - -### `Promise` - -A Promise containing the signature of the typed data. - -## Parameters - -### `params: SignTypedDataParams` -- the typed data to sign - -- `domain: TypedDataDomain` -- The typed data domain -- `types: Object` -- the type definitions for the typed data -- `primaryType: inferred String` -- the primary type to extract from types and use in value -- `message: inferred from types & primaryType` -- the message, inferred from diff --git a/site/pages/packages/aa-signers/index.md b/site/pages/packages/aa-signers/index.md deleted file mode 100644 index 095578f466..0000000000 --- a/site/pages/packages/aa-signers/index.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: aa-signers -description: aa-signers landing page and getting started guide ---- - -# `@alchemy/aa-signers` - -This package contains various implementations of the `SmartAccountSigner` and `SmartAccountAuthenticator` classes defined in `aa-signer`. This repo is community-maintained and we welcome contributions! - -## Getting started - -If you are already using the `@alchemy/aa-core` package, you can simply install this package and start using the signers. If you are not using `@alchemy/aa-core`, you can install it and follow the instructions in the ["Getting started"](/getting-started/introduction) docs to get started. - -:::code-group - -```bash [yarn] -yarn add @alchemy/aa-signers -``` - -```bash [npm] -npm i -s @alchemy/aa-signers -``` - -```bash [pnpm] -pnpm i @alchemy/aa-signers -``` - -::: diff --git a/site/pages/packages/aa-signers/lit-protocol/authenticate.md b/site/pages/packages/aa-signers/lit-protocol/authenticate.md deleted file mode 100644 index 8e886d9117..0000000000 --- a/site/pages/packages/aa-signers/lit-protocol/authenticate.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: LitSigner • authenticate -description: Overview of the authenticate method on LitSigner ---- - -# authenticate - -`authenticate` is a method on the `LitSigner` which leverages the Lit Protocol SDK to authenticate a user. Before accessing other methods on the class, such as signing messages or typed data or accessing user details, this method **MUST** be called. - -## Usage - -`LitSigner` allows for either an `AuthMethod` or `SessionSig` as context to authenticate, based on the LightSigner you create: `LitAuthMethod` or `LitSessionSigsMap` respectively. - -If using an `AuthMethod`, then the implementation will handle signing a session signature which will be used as authentication material. If using a `SessionSig`, then the implementation will use that as authentication material for the signer. - -For the `LitSigner` a generic type `C` is defined on the type to be either `AuthMethod` or `SessionSig`. - -Where an `AuthMethod` or a `Session Signatures` maybe be provided as `context` for the `authentication`. - -If a `Session Signature` is given then the session will be respected as long as it is valid for the given `pkpPublicKey` that was used to initialize the `LitSigner`. - -### Auth Method - -```ts [example.ts] -import { - LitSigner, - type LitAuthMethod, -} from "@alchemy/aa-signers/lit-protocol"; -// [!code focus:99] - -const API_KEY = ""; -const POLYGON_MUMBAI_RPC_URL = `${polygonMumbai.rpcUrls.alchemy.http[0]}/${API_KEY}`; -const PKP_PUBLIC_KEY = ""; - -const AUTH_METHOD = ""; - -// for info on obtaining an auth method and minting pkp's -// see here: -const litSigner = new LitSigner({ - pkpPublicKey: PKP_PUBLIC_KEY, - rpcUrl: RPC_URL, -}); - -// returns a `LitSessionSigsMap` instance if the authentication was successful -const authDetails = await litSigner.authenticate({ - context: AUTH_METHOD, -}); -``` - -### Session Signatures - -```ts [example.ts] -import { - LitSigner, - type LitSessionSigsMap, -} from "@alchemy/aa-signers/lit-protocol"; -// [!code focus:99] - -const PKP_PUBLIC_KEY = ""; -const SESSION_SIGS = ""; -const RPC_URL = ""; - -// for info on obtaining an auth method and minting pkp's -// see here: -const litSigner = new LitSigner({ - pkpPublicKey: PKP_PUBLIC_KEY, - rpcUrl: RPC_URL, -}); - -// returns a `SessionSigMap` regardless of using an auth sig or session signature -const authDetails = await litSigner.authenticate({ - context: SESSION_SIGS, -}); -``` - -## Returns - -### `Promise` - -A `Promise` containing the `LitUserMetadata`, a map of `string -> object` containing the following fields: - -- `sig: string` -- Signed authentication message of the given network node. -- `derivedVia: string` -- How the signature was generated. -- `address: string` -- Ethereum address of the key. -- `algo: string` -- Signing algorithm used. -- `signedMessage: string` -- `SIWE ReCap` Authentication message in the format of `SIWE ReCap`. diff --git a/site/pages/packages/aa-signers/lit-protocol/constructor.md b/site/pages/packages/aa-signers/lit-protocol/constructor.md deleted file mode 100644 index 2de155c0ca..0000000000 --- a/site/pages/packages/aa-signers/lit-protocol/constructor.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: LitSigner • constructor -description: Overview of the constructor method on LitSigner in aa-signers ---- - -# constructor - -## Usage - -When initializing a new instance of `LitSigner` you can choose to use an `AuthMethod (LitAuthMethod)` or `Session Signature (LitSessionSigsMap)`. -If providing an `LitAuthMethod`, the auth method will be authenticated, creating a `Session Signature`. - -A `Session Signature` can be provided and will be used as the active session, and will be returned from `Authenticate` and `AuthDetails`. - -```ts [example.ts] -import { LitSigner, LitAuthMethod } from "@alchemy/aa-signers"; -// [!code focus:99] - -new LitSigner({ - pkpPublicKey: "PKP_PUBLIC_KEY", - rpcUrl: "RPC_URL", - network: "cayenne", - debug: false, -}); -``` - -or - -```ts [example.ts] -import { LitSigner, LitSessionSigsMap } from "@alchemy/aa-signers"; - -new LitSigner({ - pkpPublicKey: "PKP_PUBLIC_KEY", - rpcUrl: "RPC_URL", - network: "cayenne", - debug: false, -}); -``` - -## Returns - -A new instance of `LitSigner` - -## Parameters - -`LitConfig` takes the following arguments: - -- `pkpPublicKey: string` -- PKP public key -- `rpcUrl: string` -- RPC URL for the chain you wish to connect to -- `network: string` -- [optional] The desired Lit Protocol network to connect to. Defaults to `cayenne` (pkps must be on the network specified) -- `debug: boolean` -- [optional] Enable / disable debug logging. Defaults to `false` diff --git a/site/pages/packages/aa-signers/lit-protocol/getAddress.md b/site/pages/packages/aa-signers/lit-protocol/getAddress.md deleted file mode 100644 index e69d2e75e3..0000000000 --- a/site/pages/packages/aa-signers/lit-protocol/getAddress.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: LitSigner • getAddress -description: Overview of the getAddress method on LitSigner ---- - -# getAddress - -`getAddress` returns the EOA address of the Signer. - -This method must be called after [`authenticate`](/packages/aa-signers/lit-protocol/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createLitSignerWithAuthMethod } from "./lit"; -// [!code focus:99] - -const litSigner = new createLitSignerWithAuthMethod(); - -const address = await litSigner.getAddress(); -``` - -```ts [lit.ts] -// [!include ~/snippets/signers/lit.ts] -``` - -::: - -## Returns - -### `Promise
` - -A `Promise` containing the address of the Signer. diff --git a/site/pages/packages/aa-signers/lit-protocol/getAuthDetails.md b/site/pages/packages/aa-signers/lit-protocol/getAuthDetails.md deleted file mode 100644 index d472480f5a..0000000000 --- a/site/pages/packages/aa-signers/lit-protocol/getAuthDetails.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: LitSigner • getAuthDetails -description: Overview of the getAuthDetails method on LitSigner ---- - -# getAuthDetails - -`getAuthDetails` returns the details about the authenticated user as `LitUserMetadata`, which is a `SessionSigsMap`: the authentication result when successful. - -This method must be called after [`authenticate`](/packages/aa-signers/lit-protocol/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createLitSignerWithAuthMethod } from "./lit"; -// [!code focus:99] - -const litSigner = new createLitSignerWithAuthMethod(); - -await litSigner.authenticate({ - context: AUTH_METHOD, -}); - -// returns a `SessionSigMap` regardless of using an auth sig or session signature -let authDetails = await litSigner.getAuthDetails(); -``` - -```ts [lit.ts] -// [!include ~/snippets/signers/lit.ts] -``` - -::: - -## Returns - -### `Promise` - -A `Promise` containing the `LitUserMetadata`, a map of `string -> object` containing the following fields: - -- `sig: string` -- Signed authentication message of the given network node. -- `deriviedVia: string` -- How the signature was generated. -- `address: string` -- Ethereum address of the key. -- `algo: string` -- Signing algorithm used. -- `signedMessage: string` -- `SIWE ReCap` Authentication message in the format of `SIWE ReCap`. diff --git a/site/pages/packages/aa-signers/lit-protocol/introduction.md b/site/pages/packages/aa-signers/lit-protocol/introduction.md deleted file mode 100644 index ae2efd7d59..0000000000 --- a/site/pages/packages/aa-signers/lit-protocol/introduction.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: LitSigner -description: Overview of the LitSigner class in aa-signers ---- - -# Lit Signer - -`LitSigner` provides implementations for all methods on `SmartAccountAuthenticator` to leverage Lit-Protocol's `PkpEthersWallet` and `LitNodeClient` together for provisioning new `Wallet` Signer instances with the authentication steps scoped to `authenticate`. - -For more information on Lit's supported authentication, see: [here](https://developer.litprotocol.com/v3/sdk/authentication/session-sigs/intro) - -['authenticate'][/packages/aa-signers/lit-protocol/authenticate] -['getAddress'][/packages/aa-signers/lit-protocol/getAddress] -['signTypedData'][/packages/aa-signers/lit-protocol/signTypedData] -['signMessage'][/packages/aa-signers/lit-protocol/signMessage] -['getAuthDetails'][/packages/aa-signers/lit-protocol/getAuthDetails] - -## Install Dependencies - -:::code-group - -```bash [npm] -npm i -s @lit-protocol/lit-node-client@cayenne -npm i -s @lit-protocol/pkp-ethers@cayenne -npm i -s @lit-protocol/crypto@cayenne -npm i -s @lit-protocol/auth-helpers@cayenne -``` - -```bash [yarn] -yarn add @lit-protocol/lit-node-client@cayenne -yarn add @lit-protocol/pkp-ethers@cayenne -yarn add @lit-protocol/crypto@cayenne -yarn add @lit-protocol/auth-helpers@cayenne -``` diff --git a/site/pages/packages/aa-signers/lit-protocol/signMessage.md b/site/pages/packages/aa-signers/lit-protocol/signMessage.md deleted file mode 100644 index b14e273169..0000000000 --- a/site/pages/packages/aa-signers/lit-protocol/signMessage.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: LitSigner • signMessage -description: Overview of the signMessage method on LitSigner ---- - -# signMessage - -`signMessage` supports signing messages from the `LitSigner`. - -This method must be called after [`authenticate`](/packages/aa-signers/lit-protocol/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createLitSignerWithAuthMethod } from "./lit"; -// [!code focus:99] - -const litSigner = new createLitSignerWithAuthMethod(); - -const signedMessage = await litSigner.signMessage("Hello World!"); -``` - -```ts [lit.ts] -// [!include ~/snippets/signers/lit.ts] -``` - -::: - -## Returns - -### `Promise` - -A `Promise` containing the signature of the message. - -## Parameters - -### `msg: string | Uint8Array)` -- the message to sign diff --git a/site/pages/packages/aa-signers/lit-protocol/signTypedData.md b/site/pages/packages/aa-signers/lit-protocol/signTypedData.md deleted file mode 100644 index d3db5370d4..0000000000 --- a/site/pages/packages/aa-signers/lit-protocol/signTypedData.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: LitSigner • signTypedData -description: Overview of the signTypedData method on LitSigner ---- - -# signTypedData - -`signTypedData` supports signing typed data from the `LitSigner`. - -This method must be called after [`authenticate`](/packages/aa-signers/lit-protocol/authenticate). Otherwise, this method will throw an error with the message `Not Authenticated`. - -## Usage - -:::code-group - -```ts [example.ts] -import { createLitSignerWithAuthMethod } from "./lit"; -// [!code focus:99] - -const litSigner = new createLitSignerWithAuthMethod(); - -const signedTypedData = await litSigner.signTypedData({ - domain: { - name: "Ether Mail", - version: "1", - chainId: 1, - verifyingContract: "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC", - }, - types: { - Person: [ - { name: "name", type: "string" }, - { name: "wallet", type: "address" }, - ], - Mail: [ - { name: "from", type: "Person" }, - { name: "to", type: "Person" }, - { name: "contents", type: "string" }, - ], - }, - primaryType: "Mail", - message: { - from: { - name: "Cow", - wallet: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", - }, - to: { - name: "Bob", - wallet: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB", - }, - contents: "Hello, Bob!", - }, -}); -``` - -```ts [lit.ts] -// [!include ~/snippets/signers/lit.ts] -``` - -::: - -## Returns - -### `Promise` - -A `Promise` containing the signature of the typed data. - -## Parameters - -### `params: SignTypedDataParams` -- the typed data to sign - -- `domain: TypedDataDomain` -- The typed data domain -- `types: Object` -- the type definitions for the typed data -- `primaryType: inferred String` -- the primary type to extract from types and use in value -- `message: inferred from types & primaryType` -- the message, inferred from type diff --git a/site/pages/packages/aa-signers/magic/authenticate.md b/site/pages/packages/aa-signers/magic/authenticate.md deleted file mode 100644 index 56f3aa89e8..0000000000 --- a/site/pages/packages/aa-signers/magic/authenticate.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: MagicSigner • authenticate -description: Overview of the authenticate method on MagicSigner ---- - -# authenticate - -`authenticate` is a method on the `MagicSigner` which leverages the `Magic` web SDK to authenticate a user. - -This method must be called before accessing the other methods available on the `MagicSigner`, such as signing messages or typed data or accessing user details. - -## Usage - -```ts [example.ts] -// [!code focus:99] -import { MagicSigner } from "@alchemy/aa-signers/magic"; - -const magicSigner = new MagicSigner({ apiKey: MAGIC_API_KEY }); -const authParams = { - authenticate: async () => { - await magicSigner.inner.wallet.connectWithUI(); - }, -}; - -await magicSigner.authenticate(authParams); -``` - -## Returns - -### `Promise` - -A `Promise` containing the `MagicUserMetadata`, and object with the following fields: - -- `issuer: string | null` -- the Decentralized ID of the user. -- `publicAddress: string | null` -- the authenticated user's public address (EOA public key). -- `email: string | null` -- email address of the authenticated user. -- `phoneNumber: string | null` -- phone number of the authenticated user. -- `isMfaEnabled: boolean` -- whether or not multi-factor authentication is enabled for the user. -- `recoveryFactors: RecoveryFactor[]` -- any recovery methods that have been enabled (ex. `[{ type: 'phone_number', value: '+99999999' }]`). - -## Parameters - -### `authParams: ` - -An object with the following fields: - -- `authenticate: () => Promise` -- a method you can define as necessary to leverage the `Magic` SDK for authentication. For instance, in the example above, `authenticate` uses the [`connectWithUI`](https://magic.link/docs/api/client-side-sdks/web#connectwithui) method. diff --git a/site/pages/packages/aa-signers/magic/constructor.md b/site/pages/packages/aa-signers/magic/constructor.md deleted file mode 100644 index 24cca473e7..0000000000 --- a/site/pages/packages/aa-signers/magic/constructor.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: MagicSigner • constructor -description: Overview of the constructor method on MagicSigner in aa-signers ---- - -# constructor - -To initialize a `MagicSigner`, you must provide a set of parameters detailed below. - -## Usage - -```ts [example.ts] -import { MagicSigner } from "@alchemy/aa-signers/magic"; - -// instantiates using every possible parameter, as a reference -const magicSigner = new MagicSigner({ - apiKey: "MAGIC_API_KEY", - options: { - endpoint: "MAGIC_IFRAME_URL", - locale: "en_US", - network: "sepolia", - testMode: false, - }, -}); -``` - -## Returns - -### `MagicSigner` - -A new instance of a `MagicSigner`. - -## Parameters - -### `params: MagicSDKParams | { inner: Magic }` - -You can either pass in a constructed `Magic` object, or directly pass into the `MagicSigner` the `MagicSDKParams` used to construct a `Magic` object. These parameters are listed on the [Magic Docs](https://magic.link/docs/api/client-side-sdks/web#constructor-NaN) as well. - -`MagicSDKParams` takes in the following parameters: - -- `apiKey: string` -- a Magic API Key. You can get one at [Magic Dashboard](https://dashboard.magic.link/). - -- `options: MagicSDKAdditionalConfiguration` -- [optional] - - - `endpoint: string` -- [optional] a URL pointing to the Magic `