From 6432d86df4d182d44d3a09774a266478a8904808 Mon Sep 17 00:00:00 2001 From: Michael Moldoveanu Date: Thu, 30 May 2024 16:29:14 -0400 Subject: [PATCH] moldy/vocs migration (#1) * docs: migrate to using vocs * docs: migrate the alchemy signer docs over * docs: update the signer guides to vocs * docs: migrate over the using smart accounts guides to vocs * docs: migrate react hook docs to vocs * docs: migrate choosing a smart account to vocs * docs: migrate 3rd party to vocs * docs: migrate extending smart accounts to vocs * docs: migrate resources to vocs * docs: add socials to vocs * docs: add aa-core vocs * docs: add aa-alchemy to vocs * docs: add aa-accounts to vocs * docs: add aa-signers to vocs * docs: migrate aa-ethers to vocs * docs: update core head options * docs: clean up the themes in vocs * docs: update the build pipeline for vocs * docs: update all of the header fields * docs: make the site build * docs: apply lint and fix github actions * chore: enable publishing site via workflow_dispatch --- .github/workflows/deploy-site.yml | 16 +- .github/workflows/on-pull-request.yml | 7 +- .github/workflows/publish-package.yml | 15 +- .../src/light-account/accounts/account.ts | 4 +- .../src/msca/account/multiOwnerAccount.ts | 4 +- packages/alchemy/src/config/types.ts | 4 +- packages/alchemy/src/signer/client/types.ts | 4 +- .../core/src/account/smartContractAccount.ts | 12 +- .../core/src/actions/smartAccount/types.ts | 44 +- packages/core/src/client/bundlerClient.ts | 4 +- .../src/client/decorators/bundlerClient.ts | 4 +- packages/core/src/client/schema.ts | 4 +- packages/core/src/client/types.ts | 12 +- packages/core/src/entrypoint/types.ts | 4 +- packages/core/src/middleware/types.ts | 8 +- packages/core/src/signer/types.ts | 8 +- packages/core/src/types.ts | 52 +- packages/core/src/utils/schema.ts | 12 +- site/.vitepress/config.ts | 100 - site/.vitepress/sidebar/index.ts | 279 -- .../.vitepress/sidebar/packages/aa-alchemy.ts | 113 - site/.vitepress/sidebar/packages/aa-core.ts | 220 -- .../.vitepress/sidebar/packages/aa-signers.ts | 168 - site/.vitepress/sidebar/packages/index.ts | 19 - .../theme/components/VideoEmbed.vue | 140 - site/.vitepress/theme/index.ts | 17 - site/.vitepress/theme/style.css | 178 - site/getting-started/[beginning].md | 37 - site/getting-started/[beginning].paths.ts | 10 - site/index.md | 208 - site/overview/demos.md | 31 - site/package.json | 14 +- site/packages/aa-alchemy/signer/addPasskey.md | 49 - site/packages/aa-alchemy/signer/disconnect.md | 37 - site/packages/aa-alchemy/signer/getAddress.md | 45 - .../aa-alchemy/signer/getAuthDetails.md | 45 - site/packages/aa-alchemy/signer/getUser.md | 41 - .../packages/aa-alchemy/signer/signMessage.md | 50 - .../aa-alchemy/signer/signTransaction.md | 50 - .../aa-alchemy/signer/signTypedData.md | 49 - .../aa-alchemy/signer/toViemAccount.md | 45 - site/packages/aa-core/accounts/index.md | 89 - .../types/userOperationFeeOptionsField.md | 45 - .../provider-adapter/fromEthersProvider.md | 38 - .../get-installed-plugins.md | 29 +- .../install-plugins.md | 38 +- site/pages/getting-started/introduction.mdx | 21 + .../getting-started/log-in-users.md | 48 +- site/{ => pages}/getting-started/overview.md | 18 +- .../getting-started/send-uos.mdx} | 36 +- site/{ => pages}/getting-started/setup-app.md | 64 +- site/pages/index.mdx | 170 + .../packages/aa-accounts/contributing.md | 15 +- .../{ => pages}/packages/aa-accounts/index.md | 20 +- .../actions/transferOwnership.md | 22 +- .../aa-accounts/light-account/client.md | 22 +- .../light-account/encodeTransferOwnership.md | 20 +- .../light-account/getOwnerAddress.md | 20 +- .../aa-accounts/light-account/index.md | 28 +- .../light-account/signMessageWith6492.md | 20 +- .../light-account/signTypedData.md | 20 +- .../light-account/signTypedDataWith6492.md | 20 +- .../getDefaultLightAccountFactoryAddress.md | 20 +- site/{ => pages}/packages/aa-alchemy/index.md | 24 +- .../aa-alchemy/light-account-client/index.md | 20 +- .../middleware/alchemyFeeEstimator.md | 17 +- .../middleware/alchemyGasManagerMiddleware.md | 17 +- .../alchemyUserOperationSimulator.md | 19 +- .../multisig-account-client.md | 15 +- .../packages/aa-alchemy/signer/addPasskey.md | 36 + .../aa-alchemy/signer/authenticate.md | 27 +- .../packages/aa-alchemy/signer/disconnect.md | 24 + .../aa-alchemy/signer/exportWallet.md | 29 +- .../packages/aa-alchemy/signer/getAddress.md | 32 + .../aa-alchemy/signer/getAuthDetails.md | 32 + .../packages/aa-alchemy/signer/getUser.md | 28 + .../packages/aa-alchemy/signer/overview.md | 43 +- .../packages/aa-alchemy/signer/signMessage.md | 37 + .../aa-alchemy/signer/signTransaction.md | 37 + .../aa-alchemy/signer/signTypedData.md | 36 + .../aa-alchemy/signer/toViemAccount.md | 32 + .../actions/alchemyEnhancedApiActions.md | 25 +- .../actions/simulateUserOperation.md | 21 +- .../aa-alchemy/smart-account-client/index.md | 17 +- .../aa-alchemy/utils/defineAlchemyChain.md | 17 +- site/pages/packages/aa-core/accounts/index.md | 47 + .../bundler-client/actions/bundlerActions.md | 17 +- .../actions/estimateUserOperationGas.md | 17 +- .../actions/getSupportedEntryPoints.md | 15 +- .../actions/getUserOperationByHash.md | 15 +- .../actions/getUserOperationReceipt.md | 15 +- .../actions/sendRawUserOperation.md | 17 +- .../packages/aa-core/bundler-client/index.md | 13 +- site/{ => pages}/packages/aa-core/index.md | 24 +- .../packages/aa-core/signers/local-account.md | 17 +- .../signers/utils/verifyEIP6492Signature.md | 17 +- .../signers/utils/wrapSignatureWith6492.md | 15 +- .../packages/aa-core/signers/wallet-client.md | 15 +- .../actions/buildUserOperation.mdx} | 26 +- .../actions/buildUserOperationFromTx.mdx} | 28 +- .../actions/buildUserOperationFromTxs.mdx} | 35 +- .../checkGasSponsorshipEligibility.mdx} | 28 +- .../actions/dropAndReplaceUserOperation.mdx} | 20 +- .../actions/estimateUserOperationGas.mdx} | 26 +- .../actions/getAddress.mdx} | 19 +- .../actions/getUserOperationByHash.mdx} | 19 +- .../actions/getUserOperationReceipt.mdx} | 19 +- .../smart-account-client/actions/request.mdx} | 19 +- .../actions/sendTransaction.mdx} | 23 +- .../actions/sendTransactions.mdx} | 27 +- .../actions/sendUserOperation.mdx} | 26 +- .../actions/signMessage.mdx} | 21 +- .../actions/signMessageWith6492.mdx} | 21 +- .../actions/signTypedData.mdx} | 19 +- .../actions/signTypedDataWith6492.mdx} | 19 +- .../actions/signUserOperation.mdx} | 25 +- .../actions/upgradeAccount.mdx} | 19 +- .../waitForUserOperationTransaction.mdx} | 22 +- .../aa-core/smart-account-client/index.md | 25 +- .../smart-account-client/middleware/index.md | 33 +- .../types/userOperationFeeOptions.md | 21 +- .../types/userOperationFeeOptionsField.md | 32 + .../types/userOperationOverrides.md | 25 +- .../packages/aa-core/split-transport.md | 20 +- .../packages/aa-core/utils/asyncPipe.md | 15 +- .../aa-core/utils/convertChainIdToCoinType.md | 17 +- .../aa-core/utils/convertCoinTypeToChain.md | 17 +- .../aa-core/utils/convertCoinTypeToChainId.md | 17 +- .../packages/aa-core/utils/deepHexlify.md | 15 +- .../packages/aa-core/utils/defineReadOnly.md | 15 +- .../packages/aa-core/utils/getChain.md | 15 +- .../utils/getDefaultEntryPointAddress.md | 15 +- .../getDefaultSimpleAccountFactoryAddress.md | 15 +- .../aa-core/utils/resolveProperties.md | 17 +- .../packages/aa-core/utils/stringToIndex.md | 16 +- .../aa-ethers/account-signer/connect.md | 22 +- .../aa-ethers/account-signer/getAddress.md | 20 +- .../account-signer/getBundlerClient.md | 20 +- .../aa-ethers/account-signer/introduction.md | 20 +- .../account-signer/sendTransaction.md | 22 +- .../aa-ethers/account-signer/signMessage.md | 20 +- site/{ => pages}/packages/aa-ethers/index.md | 33 +- .../provider-adapter/connectToAccount.md | 25 +- .../aa-ethers/provider-adapter/constructor.md | 21 +- .../provider-adapter/fromEthersProvider.md | 26 + .../provider-adapter/getBundlerClient.md | 20 +- .../provider-adapter/introduction.md | 20 +- .../aa-ethers/provider-adapter/send.md | 20 +- .../convertEthersSignerToAccountSigner.md | 19 +- .../utils/convertWalletToAccountSigner.md | 17 +- .../packages/aa-ethers/utils/introduction.md | 17 +- .../aa-signers/arcana-auth/authenticate.md | 17 +- .../aa-signers/arcana-auth/constructor.md | 17 +- .../aa-signers/arcana-auth/getAddress.md | 20 +- .../aa-signers/arcana-auth/getAuthDetails.md | 20 +- .../aa-signers/arcana-auth/introduction.md | 22 +- .../aa-signers/arcana-auth/signMessage.md | 20 +- .../aa-signers/arcana-auth/signTypedData.md | 20 +- .../aa-signers/capsule/authenticate.md | 17 +- .../aa-signers/capsule/constructor.md | 23 +- .../packages/aa-signers/capsule/getAddress.md | 20 +- .../aa-signers/capsule/getAuthDetails.md | 20 +- .../aa-signers/capsule/introduction.md | 22 +- .../aa-signers/capsule/signMessage.md | 20 +- .../aa-signers/capsule/signTypedData.md | 20 +- .../packages/aa-signers/contributing.md | 15 +- .../aa-signers/fireblocks/authenticate.md | 17 +- .../aa-signers/fireblocks/constructor.md | 17 +- .../aa-signers/fireblocks/getAddress.md | 20 +- .../aa-signers/fireblocks/getAuthDetails.md | 20 +- .../aa-signers/fireblocks/introduction.md | 22 +- .../aa-signers/fireblocks/signMessage.md | 20 +- .../aa-signers/fireblocks/signTypedData.md | 20 +- .../aa-signers/fordefi/authenticate.md | 17 +- .../aa-signers/fordefi/constructor.md | 17 +- .../packages/aa-signers/fordefi/getAddress.md | 20 +- .../aa-signers/fordefi/getAuthDetails.md | 20 +- .../aa-signers/fordefi/introduction.md | 22 +- .../aa-signers/fordefi/signMessage.md | 20 +- .../aa-signers/fordefi/signTypedData.md | 20 +- site/{ => pages}/packages/aa-signers/index.md | 20 +- .../aa-signers/lit-protocol/authenticate.md | 21 +- .../aa-signers/lit-protocol/constructor.md | 17 +- .../aa-signers/lit-protocol/getAddress.md | 20 +- .../aa-signers/lit-protocol/getAuthDetails.md | 20 +- .../aa-signers/lit-protocol/introduction.md | 15 +- .../aa-signers/lit-protocol/signMessage.md | 20 +- .../aa-signers/lit-protocol/signTypedData.md | 20 +- .../packages/aa-signers/magic/authenticate.md | 17 +- .../packages/aa-signers/magic/constructor.md | 17 +- .../packages/aa-signers/magic/getAddress.md | 20 +- .../aa-signers/magic/getAuthDetails.md | 22 +- .../packages/aa-signers/magic/introduction.md | 22 +- .../packages/aa-signers/magic/signMessage.md | 20 +- .../aa-signers/magic/signTypedData.md | 20 +- .../aa-signers/particle/authenticate.md | 17 +- .../aa-signers/particle/constructor.md | 17 +- .../aa-signers/particle/getAddress.md | 20 +- .../aa-signers/particle/getAuthDetails.md | 20 +- .../aa-signers/particle/introduction.md | 22 +- .../aa-signers/particle/signMessage.md | 20 +- .../aa-signers/particle/signTypedData.md | 20 +- .../aa-signers/passport/authenticate.md | 17 +- .../aa-signers/passport/constructor.md | 23 +- .../aa-signers/passport/getAddress.md | 20 +- .../aa-signers/passport/getAuthDetails.md | 20 +- .../aa-signers/passport/introduction.md | 22 +- .../aa-signers/passport/signMessage.md | 20 +- .../aa-signers/passport/signTypedData.md | 20 +- .../aa-signers/portal/authenticate.md | 17 +- .../packages/aa-signers/portal/constructor.md | 17 +- .../packages/aa-signers/portal/getAddress.md | 20 +- .../aa-signers/portal/getAuthDetails.md | 20 +- .../aa-signers/portal/introduction.md | 22 +- .../packages/aa-signers/portal/signMessage.md | 20 +- .../aa-signers/portal/signTypedData.md | 20 +- .../aa-signers/turnkey/authenticate.md | 19 +- .../aa-signers/turnkey/constructor.md | 17 +- .../packages/aa-signers/turnkey/getAddress.md | 20 +- .../aa-signers/turnkey/getAuthDetails.md | 20 +- .../aa-signers/turnkey/introduction.md | 22 +- .../aa-signers/turnkey/signMessage.md | 20 +- .../aa-signers/turnkey/signTypedData.md | 20 +- .../aa-signers/web3auth/authenticate.md | 17 +- .../aa-signers/web3auth/constructor.md | 17 +- .../aa-signers/web3auth/getAddress.md | 20 +- .../aa-signers/web3auth/getAuthDetails.md | 20 +- .../aa-signers/web3auth/introduction.md | 22 +- .../aa-signers/web3auth/signMessage.md | 20 +- .../aa-signers/web3auth/signTypedData.md | 20 +- site/{ => pages}/packages/index.md | 21 +- .../react/BaseHookMutationArgs.mdx} | 0 .../react/createConfig.mdx} | 48 +- .../overview.md => pages/react/overview.mdx} | 43 +- site/{react/ssr.md => pages/react/ssr.mdx} | 29 +- .../react/useAccount.mdx} | 43 +- .../react/useAddPasskey.mdx} | 31 +- .../react/useAuthenticate.mdx} | 27 +- site/pages/react/useBundlerClient.mdx | 28 + .../useChain.md => pages/react/useChain.mdx} | 23 +- .../react/useClientActions.mdx} | 27 +- .../react/useDropAndReplaceUserOperation.mdx} | 53 +- .../react/useExportAccount.mdx} | 29 +- .../react/useLogout.mdx} | 29 +- .../react/useSendTransaction.mdx} | 39 +- .../react/useSendTransactions.mdx} | 45 +- .../react/useSendUserOperation.mdx} | 49 +- .../react/useSignMessage.mdx} | 35 +- .../react/useSignTypedData.mdx} | 35 +- .../react/useSigner.mdx} | 23 +- .../react/useSignerStatus.mdx} | 23 +- .../react/useSmartAccountClient.mdx} | 51 +- site/pages/react/useUser.mdx | 28 + .../useWaitForUserOperationTransaction.mdx} | 37 +- .../bbp.md => pages/resources/bbp.mdx} | 2 +- site/{ => pages}/resources/contact-us.md | 15 +- site/{ => pages}/resources/faqs.md | 78 +- .../resources/react-native.mdx} | 31 +- .../terms.md => pages/resources/terms.mdx} | 29 +- .../types.md => pages/resources/types.mdx} | 215 +- .../alchemy-signer/export-private-key.md | 25 + .../signers/alchemy-signer/introduction.md} | 65 +- .../alchemy-signer/manage-user-sessions.md | 30 + .../signers/alchemy-signer/passkey-auth.md | 29 + .../signers/alchemy-signer/passkey-signup.md | 29 + site/{ => pages}/signers/choosing-a-signer.md | 22 +- site/{ => pages}/signers/contributing.md | 20 +- site/{ => pages}/signers/eoa.md | 18 +- .../{ => pages}/signers/guides/arcana-auth.md | 30 +- site/{ => pages}/signers/guides/capsule.md | 34 +- .../signers/guides/custom-signer.md | 32 +- site/{ => pages}/signers/guides/dfns.md | 28 +- site/{ => pages}/signers/guides/dynamic.md | 30 +- site/{ => pages}/signers/guides/fireblocks.md | 34 +- site/{ => pages}/signers/guides/lit.md | 34 +- site/{ => pages}/signers/guides/magic.md | 34 +- .../signers/guides/particle-network.md | 24 +- site/{ => pages}/signers/guides/passport.md | 32 +- site/{ => pages}/signers/guides/portal.md | 30 +- site/{ => pages}/signers/guides/privy.md | 26 +- site/{ => pages}/signers/guides/turnkey.md | 32 +- site/{ => pages}/signers/guides/walletkit.md | 22 +- site/{ => pages}/signers/guides/web3auth.md | 32 +- .../smart-accounts/accounts/nani-account.md | 21 +- .../smart-accounts/custom/contributing.md | 20 +- .../smart-accounts/custom/using-your-own.md | 43 +- .../smart-accounts/entrypoint-support.md | 13 +- .../smart-accounts/gas-benchmarks.md | 15 +- site/{ => pages}/smart-accounts/index.md | 25 +- .../light-account/deployments.md | 19 +- .../light-account/getting-started.md | 33 +- .../smart-accounts/light-account/index.md | 23 +- .../modular-account/deployments.md | 19 +- .../modular-account/getting-started.md | 44 +- .../smart-accounts/modular-account/index.mdx} | 27 +- .../multisig-plugin/getting-started.md | 25 +- .../modular-account/multisig-plugin/index.mdx | 26 + .../multisig-plugin/technical-details.md | 19 +- .../modular-account/upgrade-la-to-ma.md | 25 +- site/{ => pages}/third-party/bundlers.md | 29 +- site/{ => pages}/third-party/paymasters.md | 19 +- .../batch-user-operations.md | 84 + .../using-smart-accounts/enhanced-apis/nft.md | 33 +- .../enhanced-apis/token.md | 33 +- .../send-user-operations.md | 55 +- .../session-keys/getting-started.md | 48 +- .../session-keys/index.md | 19 +- .../session-keys/supported-permissions.md | 45 +- .../simulate-user-operations.md | 38 +- .../sponsoring-gas/checking-eligibility.md | 52 +- .../sponsoring-gas/gas-manager.md | 31 +- .../transfer-ownership/light-account.md | 33 +- .../transfer-ownership/modular-account.md | 43 +- .../multi-owner-light-account.md | 51 +- site/react/useBundlerClient.md | 41 - site/react/useUser.md | 41 - .../packages => sidebar}/aa-accounts.ts | 19 +- site/sidebar/aa-alchemy.ts | 113 + site/sidebar/aa-core.ts | 224 ++ .../sidebar/packages => sidebar}/aa-ethers.ts | 40 +- site/sidebar/aa-signers.ts | 366 ++ .../alchemy-signer/[introduction].paths.ts | 11 - .../alchemy-signer/export-private-key.md | 35 - .../alchemy-signer/manage-user-sessions.md | 41 - site/signers/alchemy-signer/passkey-auth.md | 37 - site/signers/alchemy-signer/passkey-signup.md | 37 - site/signers/guides/fordefi.md | 88 - .../modular-account/multisig-plugin/index.md | 37 - ...awUserOp.md => buildSignSendRawUserOp.mdx} | 6 +- site/snippets/aa-core/custom-account.ts | 33 + .../{send-tx-param.md => send-tx-param.mdx} | 0 .../{send-uo-param.md => send-uo-param.mdx} | 16 +- .../session-keys/supported-permissions.ts | 26 +- site/styles.css | 26 + site/tailwind.config.cjs | 3 +- site/tsconfig.json | 10 +- .../batch-user-operations.md | 96 - site/using-smart-accounts/entry-point-v7.md | 225 -- .../estimate-user-op-gas-state-overrides.md | 129 - .../estimate-gas/estimate-user-op-gas.md | 87 - site/vocs.config.tsx | 398 ++ ....timestamp-1717081954657-78a08d784fb3f.mjs | 0 yarn.lock | 3496 +++++++++++++---- 343 files changed, 7079 insertions(+), 7962 deletions(-) delete mode 100644 site/.vitepress/config.ts delete mode 100644 site/.vitepress/sidebar/index.ts delete mode 100644 site/.vitepress/sidebar/packages/aa-alchemy.ts delete mode 100644 site/.vitepress/sidebar/packages/aa-core.ts delete mode 100644 site/.vitepress/sidebar/packages/aa-signers.ts delete mode 100644 site/.vitepress/sidebar/packages/index.ts delete mode 100644 site/.vitepress/theme/components/VideoEmbed.vue delete mode 100644 site/.vitepress/theme/index.ts delete mode 100644 site/.vitepress/theme/style.css delete mode 100644 site/getting-started/[beginning].md delete mode 100644 site/getting-started/[beginning].paths.ts delete mode 100644 site/index.md delete mode 100644 site/overview/demos.md delete mode 100644 site/packages/aa-alchemy/signer/addPasskey.md delete mode 100644 site/packages/aa-alchemy/signer/disconnect.md delete mode 100644 site/packages/aa-alchemy/signer/getAddress.md delete mode 100644 site/packages/aa-alchemy/signer/getAuthDetails.md delete mode 100644 site/packages/aa-alchemy/signer/getUser.md delete mode 100644 site/packages/aa-alchemy/signer/signMessage.md delete mode 100644 site/packages/aa-alchemy/signer/signTransaction.md delete mode 100644 site/packages/aa-alchemy/signer/signTypedData.md delete mode 100644 site/packages/aa-alchemy/signer/toViemAccount.md delete mode 100644 site/packages/aa-core/accounts/index.md delete mode 100644 site/packages/aa-core/smart-account-client/types/userOperationFeeOptionsField.md delete mode 100644 site/packages/aa-ethers/provider-adapter/fromEthersProvider.md rename site/{ => pages}/extending-smart-accounts/get-installed-plugins.md (74%) rename site/{ => pages}/extending-smart-accounts/install-plugins.md (77%) create mode 100644 site/pages/getting-started/introduction.mdx rename site/{ => pages}/getting-started/log-in-users.md (60%) rename site/{ => pages}/getting-started/overview.md (91%) rename site/{getting-started/send-uos.md => pages/getting-started/send-uos.mdx} (60%) rename site/{ => pages}/getting-started/setup-app.md (73%) create mode 100644 site/pages/index.mdx rename site/{ => pages}/packages/aa-accounts/contributing.md (76%) rename site/{ => pages}/packages/aa-accounts/index.md (62%) rename site/{ => pages}/packages/aa-accounts/light-account/actions/transferOwnership.md (78%) rename site/{ => pages}/packages/aa-accounts/light-account/client.md (69%) rename site/{ => pages}/packages/aa-accounts/light-account/encodeTransferOwnership.md (65%) rename site/{ => pages}/packages/aa-accounts/light-account/getOwnerAddress.md (51%) rename site/{ => pages}/packages/aa-accounts/light-account/index.md (91%) rename site/{ => pages}/packages/aa-accounts/light-account/signMessageWith6492.md (62%) rename site/{ => pages}/packages/aa-accounts/light-account/signTypedData.md (77%) rename site/{ => pages}/packages/aa-accounts/light-account/signTypedDataWith6492.md (79%) rename site/{ => pages}/packages/aa-accounts/utils/getDefaultLightAccountFactoryAddress.md (58%) rename site/{ => pages}/packages/aa-alchemy/index.md (72%) rename site/{ => pages}/packages/aa-alchemy/light-account-client/index.md (83%) rename site/{ => pages}/packages/aa-alchemy/middleware/alchemyFeeEstimator.md (74%) rename site/{ => pages}/packages/aa-alchemy/middleware/alchemyGasManagerMiddleware.md (83%) rename site/{ => pages}/packages/aa-alchemy/middleware/alchemyUserOperationSimulator.md (76%) rename site/{ => pages}/packages/aa-alchemy/modular-account-client/multisig-account-client.md (90%) create mode 100644 site/pages/packages/aa-alchemy/signer/addPasskey.md rename site/{ => pages}/packages/aa-alchemy/signer/authenticate.md (69%) create mode 100644 site/pages/packages/aa-alchemy/signer/disconnect.md rename site/{ => pages}/packages/aa-alchemy/signer/exportWallet.md (57%) create mode 100644 site/pages/packages/aa-alchemy/signer/getAddress.md create mode 100644 site/pages/packages/aa-alchemy/signer/getAuthDetails.md create mode 100644 site/pages/packages/aa-alchemy/signer/getUser.md rename site/{ => pages}/packages/aa-alchemy/signer/overview.md (84%) create mode 100644 site/pages/packages/aa-alchemy/signer/signMessage.md create mode 100644 site/pages/packages/aa-alchemy/signer/signTransaction.md create mode 100644 site/pages/packages/aa-alchemy/signer/signTypedData.md create mode 100644 site/pages/packages/aa-alchemy/signer/toViemAccount.md rename site/{ => pages}/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md (75%) rename site/{ => pages}/packages/aa-alchemy/smart-account-client/actions/simulateUserOperation.md (80%) rename site/{ => pages}/packages/aa-alchemy/smart-account-client/index.md (89%) rename site/{ => pages}/packages/aa-alchemy/utils/defineAlchemyChain.md (67%) create mode 100644 site/pages/packages/aa-core/accounts/index.md rename site/{ => pages}/packages/aa-core/bundler-client/actions/bundlerActions.md (66%) rename site/{ => pages}/packages/aa-core/bundler-client/actions/estimateUserOperationGas.md (82%) rename site/{ => pages}/packages/aa-core/bundler-client/actions/getSupportedEntryPoints.md (51%) rename site/{ => pages}/packages/aa-core/bundler-client/actions/getUserOperationByHash.md (56%) rename site/{ => pages}/packages/aa-core/bundler-client/actions/getUserOperationReceipt.md (57%) rename site/{ => pages}/packages/aa-core/bundler-client/actions/sendRawUserOperation.md (59%) rename site/{ => pages}/packages/aa-core/bundler-client/index.md (90%) rename site/{ => pages}/packages/aa-core/index.md (77%) rename site/{ => pages}/packages/aa-core/signers/local-account.md (83%) rename site/{ => pages}/packages/aa-core/signers/utils/verifyEIP6492Signature.md (78%) rename site/{ => pages}/packages/aa-core/signers/utils/wrapSignatureWith6492.md (73%) rename site/{ => pages}/packages/aa-core/signers/wallet-client.md (74%) rename site/{packages/aa-core/smart-account-client/actions/buildUserOperation.md => pages/packages/aa-core/smart-account-client/actions/buildUserOperation.mdx} (79%) rename site/{packages/aa-core/smart-account-client/actions/buildUserOperationFromTx.md => pages/packages/aa-core/smart-account-client/actions/buildUserOperationFromTx.mdx} (74%) rename site/{packages/aa-core/smart-account-client/actions/buildUserOperationFromTxs.md => pages/packages/aa-core/smart-account-client/actions/buildUserOperationFromTxs.mdx} (78%) rename site/{packages/aa-core/smart-account-client/actions/checkGasSponsorshipEligibility.md => pages/packages/aa-core/smart-account-client/actions/checkGasSponsorshipEligibility.mdx} (60%) rename site/{packages/aa-core/smart-account-client/actions/dropAndReplaceUserOperation.md => pages/packages/aa-core/smart-account-client/actions/dropAndReplaceUserOperation.mdx} (84%) rename site/{packages/aa-core/smart-account-client/actions/estimateUserOperationGas.md => pages/packages/aa-core/smart-account-client/actions/estimateUserOperationGas.mdx} (57%) rename site/{packages/aa-core/smart-account-client/actions/getAddress.md => pages/packages/aa-core/smart-account-client/actions/getAddress.mdx} (60%) rename site/{packages/aa-core/smart-account-client/actions/getUserOperationByHash.md => pages/packages/aa-core/smart-account-client/actions/getUserOperationByHash.mdx} (57%) rename site/{packages/aa-core/smart-account-client/actions/getUserOperationReceipt.md => pages/packages/aa-core/smart-account-client/actions/getUserOperationReceipt.mdx} (56%) rename site/{packages/aa-core/smart-account-client/actions/request.md => pages/packages/aa-core/smart-account-client/actions/request.mdx} (74%) rename site/{packages/aa-core/smart-account-client/actions/sendTransaction.md => pages/packages/aa-core/smart-account-client/actions/sendTransaction.mdx} (67%) rename site/{packages/aa-core/smart-account-client/actions/sendTransactions.md => pages/packages/aa-core/smart-account-client/actions/sendTransactions.mdx} (85%) rename site/{packages/aa-core/smart-account-client/actions/sendUserOperation.md => pages/packages/aa-core/smart-account-client/actions/sendUserOperation.mdx} (67%) rename site/{packages/aa-core/smart-account-client/actions/signMessage.md => pages/packages/aa-core/smart-account-client/actions/signMessage.mdx} (59%) rename site/{packages/aa-core/smart-account-client/actions/signMessageWith6492.md => pages/packages/aa-core/smart-account-client/actions/signMessageWith6492.mdx} (66%) rename site/{packages/aa-core/smart-account-client/actions/signTypedData.md => pages/packages/aa-core/smart-account-client/actions/signTypedData.mdx} (80%) rename site/{packages/aa-core/smart-account-client/actions/signTypedDataWith6492.md => pages/packages/aa-core/smart-account-client/actions/signTypedDataWith6492.mdx} (81%) rename site/{packages/aa-core/smart-account-client/actions/signUserOperation.md => pages/packages/aa-core/smart-account-client/actions/signUserOperation.mdx} (74%) rename site/{packages/aa-core/smart-account-client/actions/upgradeAccount.md => pages/packages/aa-core/smart-account-client/actions/upgradeAccount.mdx} (81%) rename site/{packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction.md => pages/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction.mdx} (72%) rename site/{ => pages}/packages/aa-core/smart-account-client/index.md (89%) rename site/{ => pages}/packages/aa-core/smart-account-client/middleware/index.md (85%) rename site/{ => pages}/packages/aa-core/smart-account-client/types/userOperationFeeOptions.md (72%) create mode 100644 site/pages/packages/aa-core/smart-account-client/types/userOperationFeeOptionsField.md rename site/{ => pages}/packages/aa-core/smart-account-client/types/userOperationOverrides.md (85%) rename site/{ => pages}/packages/aa-core/split-transport.md (67%) rename site/{ => pages}/packages/aa-core/utils/asyncPipe.md (64%) rename site/{ => pages}/packages/aa-core/utils/convertChainIdToCoinType.md (66%) rename site/{ => pages}/packages/aa-core/utils/convertCoinTypeToChain.md (66%) rename site/{ => pages}/packages/aa-core/utils/convertCoinTypeToChainId.md (64%) rename site/{ => pages}/packages/aa-core/utils/deepHexlify.md (72%) rename site/{ => pages}/packages/aa-core/utils/defineReadOnly.md (66%) rename site/{ => pages}/packages/aa-core/utils/getChain.md (58%) rename site/{ => pages}/packages/aa-core/utils/getDefaultEntryPointAddress.md (60%) rename site/{ => pages}/packages/aa-core/utils/getDefaultSimpleAccountFactoryAddress.md (61%) rename site/{ => pages}/packages/aa-core/utils/resolveProperties.md (65%) rename site/{ => pages}/packages/aa-core/utils/stringToIndex.md (59%) rename site/{ => pages}/packages/aa-ethers/account-signer/connect.md (71%) rename site/{ => pages}/packages/aa-ethers/account-signer/getAddress.md (50%) rename site/{ => pages}/packages/aa-ethers/account-signer/getBundlerClient.md (54%) rename site/{ => pages}/packages/aa-ethers/account-signer/introduction.md (84%) rename site/{ => pages}/packages/aa-ethers/account-signer/sendTransaction.md (73%) rename site/{ => pages}/packages/aa-ethers/account-signer/signMessage.md (57%) rename site/{ => pages}/packages/aa-ethers/index.md (67%) rename site/{ => pages}/packages/aa-ethers/provider-adapter/connectToAccount.md (59%) rename site/{ => pages}/packages/aa-ethers/provider-adapter/constructor.md (77%) create mode 100644 site/pages/packages/aa-ethers/provider-adapter/fromEthersProvider.md rename site/{ => pages}/packages/aa-ethers/provider-adapter/getBundlerClient.md (52%) rename site/{ => pages}/packages/aa-ethers/provider-adapter/introduction.md (84%) rename site/{ => pages}/packages/aa-ethers/provider-adapter/send.md (55%) rename site/{ => pages}/packages/aa-ethers/utils/convertEthersSignerToAccountSigner.md (70%) rename site/{ => pages}/packages/aa-ethers/utils/convertWalletToAccountSigner.md (63%) rename site/{ => pages}/packages/aa-ethers/utils/introduction.md (78%) rename site/{ => pages}/packages/aa-signers/arcana-auth/authenticate.md (85%) rename site/{ => pages}/packages/aa-signers/arcana-auth/constructor.md (85%) rename site/{ => pages}/packages/aa-signers/arcana-auth/getAddress.md (61%) rename site/{ => pages}/packages/aa-signers/arcana-auth/getAuthDetails.md (80%) rename site/{ => pages}/packages/aa-signers/arcana-auth/introduction.md (87%) rename site/{ => pages}/packages/aa-signers/arcana-auth/signMessage.md (65%) rename site/{ => pages}/packages/aa-signers/arcana-auth/signTypedData.md (81%) rename site/{ => pages}/packages/aa-signers/capsule/authenticate.md (81%) rename site/{ => pages}/packages/aa-signers/capsule/constructor.md (86%) rename site/{ => pages}/packages/aa-signers/capsule/getAddress.md (60%) rename site/{ => pages}/packages/aa-signers/capsule/getAuthDetails.md (73%) rename site/{ => pages}/packages/aa-signers/capsule/introduction.md (84%) rename site/{ => pages}/packages/aa-signers/capsule/signMessage.md (64%) rename site/{ => pages}/packages/aa-signers/capsule/signTypedData.md (81%) rename site/{ => pages}/packages/aa-signers/contributing.md (73%) rename site/{ => pages}/packages/aa-signers/fireblocks/authenticate.md (72%) rename site/{ => pages}/packages/aa-signers/fireblocks/constructor.md (90%) rename site/{ => pages}/packages/aa-signers/fireblocks/getAddress.md (60%) rename site/{ => pages}/packages/aa-signers/fireblocks/getAuthDetails.md (67%) rename site/{ => pages}/packages/aa-signers/fireblocks/introduction.md (85%) rename site/{ => pages}/packages/aa-signers/fireblocks/signMessage.md (64%) rename site/{ => pages}/packages/aa-signers/fireblocks/signTypedData.md (81%) rename site/{ => pages}/packages/aa-signers/fordefi/authenticate.md (67%) rename site/{ => pages}/packages/aa-signers/fordefi/constructor.md (81%) rename site/{ => pages}/packages/aa-signers/fordefi/getAddress.md (61%) rename site/{ => pages}/packages/aa-signers/fordefi/getAuthDetails.md (62%) rename site/{ => pages}/packages/aa-signers/fordefi/introduction.md (85%) rename site/{ => pages}/packages/aa-signers/fordefi/signMessage.md (64%) rename site/{ => pages}/packages/aa-signers/fordefi/signTypedData.md (81%) rename site/{ => pages}/packages/aa-signers/index.md (64%) rename site/{ => pages}/packages/aa-signers/lit-protocol/authenticate.md (89%) rename site/{ => pages}/packages/aa-signers/lit-protocol/constructor.md (79%) rename site/{ => pages}/packages/aa-signers/lit-protocol/getAddress.md (62%) rename site/{ => pages}/packages/aa-signers/lit-protocol/getAuthDetails.md (77%) rename site/{ => pages}/packages/aa-signers/lit-protocol/introduction.md (79%) rename site/{ => pages}/packages/aa-signers/lit-protocol/signMessage.md (65%) rename site/{ => pages}/packages/aa-signers/lit-protocol/signTypedData.md (82%) rename site/{ => pages}/packages/aa-signers/magic/authenticate.md (83%) rename site/{ => pages}/packages/aa-signers/magic/constructor.md (80%) rename site/{ => pages}/packages/aa-signers/magic/getAddress.md (60%) rename site/{ => pages}/packages/aa-signers/magic/getAuthDetails.md (76%) rename site/{ => pages}/packages/aa-signers/magic/introduction.md (85%) rename site/{ => pages}/packages/aa-signers/magic/signMessage.md (64%) rename site/{ => pages}/packages/aa-signers/magic/signTypedData.md (81%) rename site/{ => pages}/packages/aa-signers/particle/authenticate.md (88%) rename site/{ => pages}/packages/aa-signers/particle/constructor.md (90%) rename site/{ => pages}/packages/aa-signers/particle/getAddress.md (60%) rename site/{ => pages}/packages/aa-signers/particle/getAuthDetails.md (68%) rename site/{ => pages}/packages/aa-signers/particle/introduction.md (86%) rename site/{ => pages}/packages/aa-signers/particle/signMessage.md (64%) rename site/{ => pages}/packages/aa-signers/particle/signTypedData.md (81%) rename site/{ => pages}/packages/aa-signers/passport/authenticate.md (87%) rename site/{ => pages}/packages/aa-signers/passport/constructor.md (82%) rename site/{ => pages}/packages/aa-signers/passport/getAddress.md (60%) rename site/{ => pages}/packages/aa-signers/passport/getAuthDetails.md (73%) rename site/{ => pages}/packages/aa-signers/passport/introduction.md (86%) rename site/{ => pages}/packages/aa-signers/passport/signMessage.md (64%) rename site/{ => pages}/packages/aa-signers/passport/signTypedData.md (81%) rename site/{ => pages}/packages/aa-signers/portal/authenticate.md (78%) rename site/{ => pages}/packages/aa-signers/portal/constructor.md (85%) rename site/{ => pages}/packages/aa-signers/portal/getAddress.md (60%) rename site/{ => pages}/packages/aa-signers/portal/getAuthDetails.md (76%) rename site/{ => pages}/packages/aa-signers/portal/introduction.md (84%) rename site/{ => pages}/packages/aa-signers/portal/signMessage.md (64%) rename site/{ => pages}/packages/aa-signers/portal/signTypedData.md (81%) rename site/{ => pages}/packages/aa-signers/turnkey/authenticate.md (90%) rename site/{ => pages}/packages/aa-signers/turnkey/constructor.md (80%) rename site/{ => pages}/packages/aa-signers/turnkey/getAddress.md (60%) rename site/{ => pages}/packages/aa-signers/turnkey/getAuthDetails.md (73%) rename site/{ => pages}/packages/aa-signers/turnkey/introduction.md (89%) rename site/{ => pages}/packages/aa-signers/turnkey/signMessage.md (64%) rename site/{ => pages}/packages/aa-signers/turnkey/signTypedData.md (81%) rename site/{ => pages}/packages/aa-signers/web3auth/authenticate.md (88%) rename site/{ => pages}/packages/aa-signers/web3auth/constructor.md (91%) rename site/{ => pages}/packages/aa-signers/web3auth/getAddress.md (60%) rename site/{ => pages}/packages/aa-signers/web3auth/getAuthDetails.md (84%) rename site/{ => pages}/packages/aa-signers/web3auth/introduction.md (85%) rename site/{ => pages}/packages/aa-signers/web3auth/signMessage.md (64%) rename site/{ => pages}/packages/aa-signers/web3auth/signTypedData.md (81%) rename site/{ => pages}/packages/index.md (85%) rename site/{react/BaseHookMutationArgs.md => pages/react/BaseHookMutationArgs.mdx} (100%) rename site/{react/createConfig.md => pages/react/createConfig.mdx} (57%) rename site/{react/overview.md => pages/react/overview.mdx} (67%) rename site/{react/ssr.md => pages/react/ssr.mdx} (76%) rename site/{react/useAccount.md => pages/react/useAccount.mdx} (67%) rename site/{react/useAddPasskey.md => pages/react/useAddPasskey.mdx} (62%) rename site/{react/useAuthenticate.md => pages/react/useAuthenticate.mdx} (57%) create mode 100644 site/pages/react/useBundlerClient.mdx rename site/{react/useChain.md => pages/react/useChain.mdx} (52%) rename site/{react/useClientActions.md => pages/react/useClientActions.mdx} (71%) rename site/{react/useDropAndReplaceUserOperation.md => pages/react/useDropAndReplaceUserOperation.mdx} (58%) rename site/{react/useExportAccount.md => pages/react/useExportAccount.mdx} (78%) rename site/{react/useLogout.md => pages/react/useLogout.mdx} (60%) rename site/{react/useSendTransaction.md => pages/react/useSendTransaction.mdx} (67%) rename site/{react/useSendTransactions.md => pages/react/useSendTransactions.mdx} (66%) rename site/{react/useSendUserOperation.md => pages/react/useSendUserOperation.mdx} (70%) rename site/{react/useSignMessage.md => pages/react/useSignMessage.mdx} (66%) rename site/{react/useSignTypedData.md => pages/react/useSignTypedData.mdx} (66%) rename site/{react/useSigner.md => pages/react/useSigner.mdx} (55%) rename site/{react/useSignerStatus.md => pages/react/useSignerStatus.mdx} (64%) rename site/{react/useSmartAccountClient.md => pages/react/useSmartAccountClient.mdx} (56%) create mode 100644 site/pages/react/useUser.mdx rename site/{react/useWaitForUserOperationTransaction.md => pages/react/useWaitForUserOperationTransaction.mdx} (64%) rename site/{resources/bbp.md => pages/resources/bbp.mdx} (97%) rename site/{ => pages}/resources/contact-us.md (72%) rename site/{ => pages}/resources/faqs.md (85%) rename site/{resources/react-native.md => pages/resources/react-native.mdx} (86%) rename site/{resources/terms.md => pages/resources/terms.mdx} (90%) rename site/{resources/types.md => pages/resources/types.mdx} (77%) create mode 100644 site/pages/signers/alchemy-signer/export-private-key.md rename site/{signers/alchemy-signer/[introduction].md => pages/signers/alchemy-signer/introduction.md} (79%) create mode 100644 site/pages/signers/alchemy-signer/manage-user-sessions.md create mode 100644 site/pages/signers/alchemy-signer/passkey-auth.md create mode 100644 site/pages/signers/alchemy-signer/passkey-signup.md rename site/{ => pages}/signers/choosing-a-signer.md (93%) rename site/{ => pages}/signers/contributing.md (88%) rename site/{ => pages}/signers/eoa.md (72%) rename site/{ => pages}/signers/guides/arcana-auth.md (62%) rename site/{ => pages}/signers/guides/capsule.md (70%) rename site/{ => pages}/signers/guides/custom-signer.md (64%) rename site/{ => pages}/signers/guides/dfns.md (78%) rename site/{ => pages}/signers/guides/dynamic.md (69%) rename site/{ => pages}/signers/guides/fireblocks.md (66%) rename site/{ => pages}/signers/guides/lit.md (67%) rename site/{ => pages}/signers/guides/magic.md (65%) rename site/{ => pages}/signers/guides/particle-network.md (89%) rename site/{ => pages}/signers/guides/passport.md (69%) rename site/{ => pages}/signers/guides/portal.md (64%) rename site/{ => pages}/signers/guides/privy.md (62%) rename site/{ => pages}/signers/guides/turnkey.md (72%) rename site/{ => pages}/signers/guides/walletkit.md (77%) rename site/{ => pages}/signers/guides/web3auth.md (60%) rename site/{ => pages}/smart-accounts/accounts/nani-account.md (81%) rename site/{ => pages}/smart-accounts/custom/contributing.md (76%) rename site/{ => pages}/smart-accounts/custom/using-your-own.md (50%) rename site/{ => pages}/smart-accounts/entrypoint-support.md (74%) rename site/{ => pages}/smart-accounts/gas-benchmarks.md (85%) rename site/{ => pages}/smart-accounts/index.md (77%) rename site/{ => pages}/smart-accounts/light-account/deployments.md (93%) rename site/{ => pages}/smart-accounts/light-account/getting-started.md (69%) rename site/{ => pages}/smart-accounts/light-account/index.md (76%) rename site/{ => pages}/smart-accounts/modular-account/deployments.md (91%) rename site/{ => pages}/smart-accounts/modular-account/getting-started.md (80%) rename site/{smart-accounts/modular-account/index.md => pages/smart-accounts/modular-account/index.mdx} (80%) rename site/{ => pages}/smart-accounts/modular-account/multisig-plugin/getting-started.md (87%) create mode 100644 site/pages/smart-accounts/modular-account/multisig-plugin/index.mdx rename site/{ => pages}/smart-accounts/modular-account/multisig-plugin/technical-details.md (80%) rename site/{ => pages}/smart-accounts/modular-account/upgrade-la-to-ma.md (71%) rename site/{ => pages}/third-party/bundlers.md (70%) rename site/{ => pages}/third-party/paymasters.md (68%) create mode 100644 site/pages/using-smart-accounts/batch-user-operations.md rename site/{ => pages}/using-smart-accounts/enhanced-apis/nft.md (71%) rename site/{ => pages}/using-smart-accounts/enhanced-apis/token.md (71%) rename site/{ => pages}/using-smart-accounts/send-user-operations.md (66%) rename site/{ => pages}/using-smart-accounts/session-keys/getting-started.md (85%) rename site/{ => pages}/using-smart-accounts/session-keys/index.md (82%) rename site/{ => pages}/using-smart-accounts/session-keys/supported-permissions.md (89%) rename site/{ => pages}/using-smart-accounts/simulate-user-operations.md (70%) rename site/{ => pages}/using-smart-accounts/sponsoring-gas/checking-eligibility.md (60%) rename site/{ => pages}/using-smart-accounts/sponsoring-gas/gas-manager.md (76%) rename site/{ => pages}/using-smart-accounts/transfer-ownership/light-account.md (71%) rename site/{ => pages}/using-smart-accounts/transfer-ownership/modular-account.md (79%) rename site/{ => pages}/using-smart-accounts/transfer-ownership/multi-owner-light-account.md (57%) delete mode 100644 site/react/useBundlerClient.md delete mode 100644 site/react/useUser.md rename site/{.vitepress/sidebar/packages => sidebar}/aa-accounts.ts (50%) create mode 100644 site/sidebar/aa-alchemy.ts create mode 100644 site/sidebar/aa-core.ts rename site/{.vitepress/sidebar/packages => sidebar}/aa-ethers.ts (51%) create mode 100644 site/sidebar/aa-signers.ts delete mode 100644 site/signers/alchemy-signer/[introduction].paths.ts delete mode 100644 site/signers/alchemy-signer/export-private-key.md delete mode 100644 site/signers/alchemy-signer/manage-user-sessions.md delete mode 100644 site/signers/alchemy-signer/passkey-auth.md delete mode 100644 site/signers/alchemy-signer/passkey-signup.md delete mode 100644 site/signers/guides/fordefi.md delete mode 100644 site/smart-accounts/modular-account/multisig-plugin/index.md rename site/snippets/aa-core/{buildSignSendRawUserOp.md => buildSignSendRawUserOp.mdx} (91%) create mode 100644 site/snippets/aa-core/custom-account.ts rename site/snippets/aa-core/{send-tx-param.md => send-tx-param.mdx} (100%) rename site/snippets/aa-core/{send-uo-param.md => send-uo-param.mdx} (84%) create mode 100644 site/styles.css delete mode 100644 site/using-smart-accounts/batch-user-operations.md delete mode 100644 site/using-smart-accounts/entry-point-v7.md delete mode 100644 site/using-smart-accounts/estimate-gas/estimate-user-op-gas-state-overrides.md delete mode 100644 site/using-smart-accounts/estimate-gas/estimate-user-op-gas.md create mode 100644 site/vocs.config.tsx create mode 100644 site/vocs.config.tsx.timestamp-1717081954657-78a08d784fb3f.mjs diff --git a/.github/workflows/deploy-site.yml b/.github/workflows/deploy-site.yml index d3fa70ebaf..a165ae542e 100644 --- a/.github/workflows/deploy-site.yml +++ b/.github/workflows/deploy-site.yml @@ -3,6 +3,7 @@ on: push: branches: - main + workflow_dispatch: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: @@ -68,16 +69,21 @@ jobs: - name: Install dependencies run: yarn - - name: Build with VitePress + - name: Build with Vocs working-directory: site - run: | - yarn build - touch .vitepress/dist/.nojekyll + uses: nick-fields/retry@v3 + with: + timeout_minutes: 5 + max_attempts: 2 + retry_on: error + command: | + yarn build + touch dist/.nojekyll - name: Upload artifact uses: actions/upload-pages-artifact@v2 with: - path: site/.vitepress/dist + path: site/dist # Deployment job deploy: diff --git a/.github/workflows/on-pull-request.yml b/.github/workflows/on-pull-request.yml index 9da2dfdab3..a7e3879283 100644 --- a/.github/workflows/on-pull-request.yml +++ b/.github/workflows/on-pull-request.yml @@ -74,9 +74,14 @@ jobs: run: yarn install --frozen-lockfile - name: Build + uses: nick-fields/retry@v3 env: API_KEY: ${{ secrets.API_KEY }} - run: yarn build + with: + timeout_minutes: 5 + max_attempts: 2 + retry_on: error + command: yarn build - name: Unit Test run: yarn test diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index b51730451e..934bb3c35c 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -86,16 +86,21 @@ jobs: API_KEY: ${{ secrets.API_KEY }} run: yarn lerna publish --conventional-commits --no-private --yes --no-verify-access - - name: Build with VitePress + - name: Build with Vocs working-directory: site - run: | - yarn build - touch .vitepress/dist/.nojekyll + uses: nick-fields/retry@v3 + with: + timeout_minutes: 5 + max_attempts: 2 + retry_on: error + command: | + yarn build + touch dist/.nojekyll - name: Upload artifact uses: actions/upload-pages-artifact@v2 with: - path: site/.vitepress/dist + path: site/dist publish_site: name: Publish Docs Site diff --git a/packages/accounts/src/light-account/accounts/account.ts b/packages/accounts/src/light-account/accounts/account.ts index 4a36c3c5e6..f1c0ef78e0 100644 --- a/packages/accounts/src/light-account/accounts/account.ts +++ b/packages/accounts/src/light-account/accounts/account.ts @@ -49,7 +49,7 @@ export type LightAccount< getOwnerAddress: () => Promise
; }; -//#region CreateLightAccountParams +// [!region CreateLightAccountParams] export type CreateLightAccountParams< TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, @@ -75,7 +75,7 @@ export type CreateLightAccountParams< version?: TLightAccountVersion; entryPoint?: EntryPointDef; }; -//#endregion CreateLightAccountParams +// [!endregion CreateLightAccountParams] export async function createLightAccount< TTransport extends Transport = Transport, diff --git a/packages/accounts/src/msca/account/multiOwnerAccount.ts b/packages/accounts/src/msca/account/multiOwnerAccount.ts index 05cdcd41a3..759dd8224a 100644 --- a/packages/accounts/src/msca/account/multiOwnerAccount.ts +++ b/packages/accounts/src/msca/account/multiOwnerAccount.ts @@ -32,7 +32,7 @@ export type MultiOwnerModularAccount< "0.6.0" >; -// #region CreateMultiOwnerModularAccountParams +// [!region CreateMultiOwnerModularAccountParams] export type CreateMultiOwnerModularAccountParams< TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, @@ -53,7 +53,7 @@ export type CreateMultiOwnerModularAccountParams< owners?: Address[]; accountAddress?: Address; } & EntryPointParameter; -// #endregion CreateMultiOwnerModularAccountParams +// [!endregion CreateMultiOwnerModularAccountParams] export async function createMultiOwnerModularAccount< TTransport extends Transport = Transport, diff --git a/packages/alchemy/src/config/types.ts b/packages/alchemy/src/config/types.ts index b6a3c7e82e..7ac2c9a193 100644 --- a/packages/alchemy/src/config/types.ts +++ b/packages/alchemy/src/config/types.ts @@ -39,7 +39,7 @@ export type AlchemyAccountsConfig = { }; }; -// #region CreateConfigProps +// [!region CreateConfigProps] export type Connection = ConnectionConfig & { chain: Chain; gasManagerConfig?: AlchemyGasManagerConfig; @@ -86,6 +86,6 @@ export type CreateConfigProps = RpcConnectionConfig & { >, "connection" >; -// #endregion CreateConfigProps +// [!endregion CreateConfigProps] export type AlchemyClientState = StoredState; diff --git a/packages/alchemy/src/signer/client/types.ts b/packages/alchemy/src/signer/client/types.ts index 1078dec993..8dbf8bbe0f 100644 --- a/packages/alchemy/src/signer/client/types.ts +++ b/packages/alchemy/src/signer/client/types.ts @@ -6,7 +6,7 @@ export type CredentialCreationOptionOverrides = { publicKey?: Partial; } & Pick; -//#region User +// [!region User] export type User = { email?: string; orgId: string; @@ -14,7 +14,7 @@ export type User = { address: Address; credentialId?: string; }; -//#endregion User +// [!endregion User] export type ExportWalletParams = { iframeContainerId: string; diff --git a/packages/core/src/account/smartContractAccount.ts b/packages/core/src/account/smartContractAccount.ts index e2680f3053..8312dea21a 100644 --- a/packages/core/src/account/smartContractAccount.ts +++ b/packages/core/src/account/smartContractAccount.ts @@ -80,7 +80,7 @@ export const isSmartAccountWithSigner = ( return "getSigner" in account; }; -//#region SmartContractAccount +// [!region SmartContractAccount] export type SmartContractAccount< Name extends string = string, TEntryPointVersion extends EntryPointVersion = EntryPointVersion @@ -106,7 +106,7 @@ export type SmartContractAccount< getEntryPoint: () => EntryPointDef; getImplementationAddress: () => Promise; }; -//#endregion SmartContractAccount +// [!endregion SmartContractAccount] export interface AccountEntryPointRegistry extends EntryPointRegistryBase< @@ -116,7 +116,7 @@ export interface AccountEntryPointRegistry "0.7.0": SmartContractAccount; } -//#region ToSmartContractAccountParams +// [!region ToSmartContractAccountParams] export type ToSmartContractAccountParams< Name extends string = string, TTransport extends Transport = Transport, @@ -136,7 +136,7 @@ export type ToSmartContractAccountParams< signUserOperationHash?: (uoHash: Hex) => Promise; encodeUpgradeToAndCall?: (params: UpgradeToAndCallParams) => Promise; } & Omit; -//#endregion ToSmartContractAccountParams +// [!endregion ToSmartContractAccountParams] export const parseFactoryAddressFromAccountInitCode = ( initCode: Hex @@ -192,7 +192,7 @@ export const getAccountAddress = async ({ throw new GetCounterFactualAddressError(); }; -//#region toSmartContractAccount +// [!region toSmartContractAccount] export async function toSmartContractAccount< Name extends string = string, TTransport extends Transport = Transport, @@ -218,7 +218,7 @@ export async function toSmartContractAccount< TChain, TEntryPointVersion >): Promise>; -//#endregion toSmartContractAccount +// [!endregion toSmartContractAccount] export async function toSmartContractAccount({ transport, diff --git a/packages/core/src/actions/smartAccount/types.ts b/packages/core/src/actions/smartAccount/types.ts index 48334940c0..24f148a7db 100644 --- a/packages/core/src/actions/smartAccount/types.ts +++ b/packages/core/src/actions/smartAccount/types.ts @@ -15,7 +15,7 @@ import type { } from "../../types"; import type { IsUndefined } from "../../utils"; -//#region UpgradeAccountParams +// [!region UpgradeAccountParams] export type UpgradeAccountParams< TAccount extends SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = @@ -28,9 +28,9 @@ export type UpgradeAccountParams< } & GetAccountParameter & GetContextParameter & UserOperationOverridesParameter; -//#endregion UpgradeAccountParams +// [!endregion UpgradeAccountParams] -//#region SendUserOperationParameters +// [!region SendUserOperationParameters] export type SendUserOperationParameters< TAccount extends SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = @@ -42,9 +42,9 @@ export type SendUserOperationParameters< } & GetAccountParameter & GetContextParameter & UserOperationOverridesParameter; -//#endregion SendUserOperationParameters +// [!endregion SendUserOperationParameters] -//#region BuildUserOperationParameters +// [!region BuildUserOperationParameters] export type BuildUserOperationParameters< TAccount extends SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = @@ -52,9 +52,9 @@ export type BuildUserOperationParameters< | undefined, TEntryPointVersion extends GetEntryPointFromAccount = GetEntryPointFromAccount > = SendUserOperationParameters; -//#endregion BuildUserOperationParameters +// [!endregion BuildUserOperationParameters] -//#region SignUserOperationParameters +// [!region SignUserOperationParameters] export type SignUserOperationParameters< TAccount extends SmartContractAccount | undefined = | SmartContractAccount @@ -67,9 +67,9 @@ export type SignUserOperationParameters< uoStruct: UserOperationStruct; } & GetAccountParameter & GetContextParameter; -//#endregion SignUserOperationParameters +// [!endregion SignUserOperationParameters] -//#region SendTransactionsParameters +// [!region SendTransactionsParameters] export type SendTransactionsParameters< TAccount extends SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = @@ -81,9 +81,9 @@ export type SendTransactionsParameters< } & GetAccountParameter & GetContextParameter & UserOperationOverridesParameter; -//#endregion SendTransactionsParameters +// [!endregion SendTransactionsParameters] -//#region BuildTransactionParameters +// [!region BuildTransactionParameters] export type BuildTransactionParameters< TAccount extends SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = @@ -91,9 +91,9 @@ export type BuildTransactionParameters< | undefined, TEntryPointVersion extends GetEntryPointFromAccount = GetEntryPointFromAccount > = SendTransactionsParameters; -//#endregion BuildTransactionParameters +// [!endregion BuildTransactionParameters] -//#region DropAndReplaceUserOperationParameters +// [!region DropAndReplaceUserOperationParameters] export type DropAndReplaceUserOperationParameters< TAccount extends SmartContractAccount | undefined, TContext extends UserOperationContext | undefined = @@ -105,9 +105,9 @@ export type DropAndReplaceUserOperationParameters< } & GetAccountParameter & GetContextParameter & UserOperationOverridesParameter; -//#endregion DropAndReplaceUserOperationParameters +// [!endregion DropAndReplaceUserOperationParameters] -//#region WaitForUserOperationTxParameters +// [!region WaitForUserOperationTxParameters] export type WaitForUserOperationTxParameters = { hash: Hex; /** @@ -130,22 +130,22 @@ export type WaitForUserOperationTxParameters = { maxRetries: number; }; }; -//#endregion WaitForUserOperationTxParameters +// [!endregion WaitForUserOperationTxParameters] -//#region BuildUserOperationFromTransactionsResult +// [!region BuildUserOperationFromTransactionsResult] export type BuildUserOperationFromTransactionsResult< TEntryPointVersion extends EntryPointVersion = EntryPointVersion > = { uoStruct: UserOperationStruct; batch: BatchUserOperationCallData; } & UserOperationOverridesParameter; -//#endregion BuildUserOperationFromTransactionsResult +// [!endregion BuildUserOperationFromTransactionsResult] -//#region UserOperationContext +// [!region UserOperationContext] export type UserOperationContext = Record; -//#endregion UserOperationContext +// [!endregion UserOperationContext] -//#region GetContextParameter +// [!region GetContextParameter] export type GetContextParameter< TContext extends UserOperationContext | undefined = | UserOperationContext @@ -155,4 +155,4 @@ export type GetContextParameter< context?: TContext; } : { context: TContext }; -//#endregion GetContextParameter +// [!endregion GetContextParameter] diff --git a/packages/core/src/client/bundlerClient.ts b/packages/core/src/client/bundlerClient.ts index 5b66abe201..2828a2b241 100644 --- a/packages/core/src/client/bundlerClient.ts +++ b/packages/core/src/client/bundlerClient.ts @@ -20,7 +20,7 @@ import { type BundlerRpcSchema, } from "./decorators/bundlerClient.js"; -//#region BundlerClient +// [!region BundlerClient] export type BundlerClient = Client< T, Chain, @@ -38,7 +38,7 @@ export const createBundlerClientFromExisting: < ): BundlerClient => { return client.extend(bundlerActions); }; -//#endregion BundlerClient +// [!endregion BundlerClient] /** * Creates a PublicClient with methods for calling Bundler RPC methods diff --git a/packages/core/src/client/decorators/bundlerClient.ts b/packages/core/src/client/decorators/bundlerClient.ts index 3f0b7402f6..27bf0bf464 100644 --- a/packages/core/src/client/decorators/bundlerClient.ts +++ b/packages/core/src/client/decorators/bundlerClient.ts @@ -49,7 +49,7 @@ export type BundlerRpcSchema = [ } ]; -//#region BundlerActions +// [!region BundlerActions] export type BundlerActions = { /** * calls `eth_estimateUserOperationGas` and returns the result @@ -104,7 +104,7 @@ export type BundlerActions = { */ getSupportedEntryPoints(): Promise; }; -//#endregion BundlerActions +// [!endregion BundlerActions] export const bundlerActions: < TClient extends Client< diff --git a/packages/core/src/client/schema.ts b/packages/core/src/client/schema.ts index a013366c5b..501a8561a1 100644 --- a/packages/core/src/client/schema.ts +++ b/packages/core/src/client/schema.ts @@ -18,7 +18,7 @@ export const createPublicErc4337ClientSchema = < ); }); -// #region ConnectionConfigSchema +// [!region ConnectionConfigSchema] export const ConnectionConfigSchema = z.union([ z.object({ rpcUrl: z.never().optional(), @@ -41,7 +41,7 @@ export const ConnectionConfigSchema = z.union([ jwt: z.string(), }), ]); -// #endregion ConnectionConfigSchema +// [!endregion ConnectionConfigSchema] export const UserOperationFeeOptionsFieldSchema = BigNumberishRangeSchema.merge(MultiplierSchema).partial(); diff --git a/packages/core/src/client/types.ts b/packages/core/src/client/types.ts index 2df5d26b3b..e245bd902d 100644 --- a/packages/core/src/client/types.ts +++ b/packages/core/src/client/types.ts @@ -16,23 +16,23 @@ export type ConnectorData = { export type ConnectionConfig = z.input; -//#region SendUserOperationResult +// [!region SendUserOperationResult] export type SendUserOperationResult< TEntryPointVersion extends EntryPointVersion = EntryPointVersion > = { hash: Hash; request: UserOperationRequest; }; -//#endregion SendUserOperationResult +// [!endregion SendUserOperationResult] -//#region UpgradeToData +// [!region UpgradeToData] export type UpgradeToData = { implAddress: Address; initializationData: Hex; }; -//#endregion UpgradeToData +// [!endregion UpgradeToData] -//#region ClientMiddlewareConfig +// [!region ClientMiddlewareConfig] export type ClientMiddlewareConfig< TContext extends UserOperationContext | undefined = | UserOperationContext @@ -48,4 +48,4 @@ export type ClientMiddlewareConfig< paymasterAndData: ClientMiddlewareFn; }; }; -//#endregion ClientMiddlewareConfig +// [!endregion ClientMiddlewareConfig] diff --git a/packages/core/src/entrypoint/types.ts b/packages/core/src/entrypoint/types.ts index db240bf629..0cd1237824 100644 --- a/packages/core/src/entrypoint/types.ts +++ b/packages/core/src/entrypoint/types.ts @@ -65,7 +65,7 @@ export interface EntryPointRegistry "0.7.0": SupportedEntryPoint<"0.7.0", TChain, typeof EntryPointAbi_v7>; } -//#region EntryPointDef +// [!region EntryPointDef] export type EntryPointDef< TEntryPointVersion extends EntryPointVersion = EntryPointVersion, TChain extends Chain = Chain, @@ -82,7 +82,7 @@ export type EntryPointDef< userOperation: UserOperationRequest ) => Hex; }; -//#endregion EntryPointDef +// [!endregion EntryPointDef] export interface EntryPointDefRegistry extends EntryPointRegistryBase< diff --git a/packages/core/src/middleware/types.ts b/packages/core/src/middleware/types.ts index 113430e906..5bcee48689 100644 --- a/packages/core/src/middleware/types.ts +++ b/packages/core/src/middleware/types.ts @@ -11,7 +11,7 @@ import type { import type { Deferrable } from "../utils"; import type { MiddlewareClient } from "./actions"; -//#region ClientMiddlewareFn +// [!region ClientMiddlewareFn] export type ClientMiddlewareFn< TContext extends UserOperationContext | undefined = | UserOperationContext @@ -30,9 +30,9 @@ export type ClientMiddlewareFn< client: C; } ) => Promise>>; -//#endregion ClientMiddlewareFn +// [!endregion ClientMiddlewareFn] -//#region ClientMiddleware +// [!region ClientMiddleware] export type ClientMiddleware< TContext extends UserOperationContext | undefined = | UserOperationContext @@ -46,4 +46,4 @@ export type ClientMiddleware< userOperationSimulator: ClientMiddlewareFn; signUserOperation: ClientMiddlewareFn; }; -//#endregion ClientMiddleware +// [!endregion ClientMiddleware] diff --git a/packages/core/src/signer/types.ts b/packages/core/src/signer/types.ts index b2418722cf..6e7a147166 100644 --- a/packages/core/src/signer/types.ts +++ b/packages/core/src/signer/types.ts @@ -6,7 +6,7 @@ import type { TypedDataDefinition, } from "viem"; -//#region SmartAccountAuthenticator +// [!region SmartAccountAuthenticator] /** * Extends the @interface SmartAccountSigner interface with authentication. * @@ -20,9 +20,9 @@ export interface SmartAccountAuthenticator getAuthDetails: () => Promise; } -//#endregion SmartAccountAuthenticator +// [!endregion SmartAccountAuthenticator] -//#region SmartAccountSigner +// [!region SmartAccountSigner] /** * A signer that can sign messages and typed data. * @@ -43,4 +43,4 @@ export interface SmartAccountSigner { params: TypedDataDefinition ) => Promise; } -//#endregion SmartAccountSigner +// [!endregion SmartAccountSigner] diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 7a374fe488..6aa0d713fc 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -31,7 +31,7 @@ export type Multiplier = z.input; export type BigNumberish = z.input; export type BigNumberishRange = z.input; -//#region UserOperationCallData +// [!region UserOperationCallData] export type UserOperationCallData = | { /* the target of the call */ @@ -42,11 +42,11 @@ export type UserOperationCallData = value?: bigint; } | Hex; -//#endregion UserOperationCallData +// [!endregion UserOperationCallData] -//#region BatchUserOperationCallData +// [!region BatchUserOperationCallData] export type BatchUserOperationCallData = Exclude[]; -//#endregion BatchUserOperationCallData +// [!endregion BatchUserOperationCallData] export type UserOperationFeeOptionsField = z.input< typeof UserOperationFeeOptionsFieldSchema @@ -67,7 +67,7 @@ export type UserOperationOverridesParameter< ? { overrides: UserOperationOverrides } : { overrides?: UserOperationOverrides }; -//#region UserOperationPaymasterOverrides +// [!region UserOperationPaymasterOverrides] export type UserOperationPaymasterOverrides< TEntryPointVersion extends EntryPointVersion = EntryPointVersion > = TEntryPointVersion extends "0.6.0" @@ -90,9 +90,9 @@ export type UserOperationPaymasterOverrides< | Multiplier; } : {}; -//#endregion UserOperationOverridesParameter +// [!endregion UserOperationOverridesParameter] -//#region UserOperationOverrides +// [!region UserOperationOverrides] export type UserOperationOverrides< TEntryPointVersion extends EntryPointVersion = EntryPointVersion > = Partial< @@ -132,9 +132,9 @@ export type UserOperationOverrides< stateOverride: StateOverride; } & UserOperationPaymasterOverrides >; -//#endregion UserOperationOverrides +// [!endregion UserOperationOverrides] -//#region UserOperationRequest_v6 +// [!region UserOperationRequest_v6] // represents the request as it needs to be formatted for v0.6 RPC requests // Reference: https://github.com/ethereum/ERCs/blob/8dd085d159cb123f545c272c0d871a5339550e79/ERCS/erc-4337.md#definitions export interface UserOperationRequest_v6 { @@ -161,9 +161,9 @@ export interface UserOperationRequest_v6 { /* Data passed into the account along with the nonce during the verification step */ signature: Hex; } -//#endregion UserOperationRequest_v6 +// [!endregion UserOperationRequest_v6] -//#region UserOperationRequest_v7 +// [!region UserOperationRequest_v7] // represents the request as it needs to be formatted for v0.7 RPC requests // Reference: https://eips.ethereum.org/EIPS/eip-4337#definitions export interface UserOperationRequest_v7 { @@ -198,9 +198,9 @@ export interface UserOperationRequest_v7 { /* data passed into the account to verify authorization */ signature: Hex; } -//#endregion UserOperationRequest_v7 +// [!endregion UserOperationRequest_v7] -//#region UserOperationRequest +// [!region UserOperationRequest] // Reference: https://eips.ethereum.org/EIPS/eip-4337#definitions export type UserOperationRequest< TEntryPointVersion extends EntryPointVersion = EntryPointVersion @@ -210,9 +210,9 @@ export type UserOperationRequest< ? UserOperationRequest_v7 : never; -//#endregion UserOperationRequest +// [!endregion UserOperationRequest] -//#region UserOperationEstimateGasResponse +// [!region UserOperationEstimateGasResponse] export interface UserOperationEstimateGasResponse< TEntryPointVersion extends EntryPointVersion = EntryPointVersion > { @@ -231,9 +231,9 @@ export interface UserOperationEstimateGasResponse< ? BigNumberish | undefined : never; } -//#endregion UserOperationEstimateGasResponse +// [!endregion UserOperationEstimateGasResponse] -//#region UserOperationResponse +// [!region UserOperationResponse] export interface UserOperationResponse< TEntryPointVersion extends EntryPointVersion = EntryPointVersion > { @@ -248,9 +248,9 @@ export interface UserOperationResponse< /* the hash of the transaction that included the user operation */ transactionHash: Hash; } -//#endregion UserOperationResponse +// [!endregion UserOperationResponse] -//#region UserOperationReceipt +// [!region UserOperationReceipt] export interface UserOperationReceipt { /* The request hash of the UserOperation. */ userOpHash: Hash; @@ -275,7 +275,7 @@ export interface UserOperationReceipt { /* The TransactionReceipt object for the entire bundle, not only for this UserOperation. */ receipt: TransactionReceipt; } -//#endregion UserOperationReceipt +// [!endregion UserOperationReceipt] /** @deprecated use viem type TransactionReceipt instead */ export interface UserOperationReceiptObject { @@ -333,7 +333,7 @@ export interface UserOperationReceiptLog { transactionHash: Hash; } -//#region UserOperationStruct_v6 +// [!region UserOperationStruct_v6] // https://github.com/eth-infinitism/account-abstraction/blob/releases/v0.6/test/UserOperation.ts // this is used for building requests for v0.6 entry point contract export interface UserOperationStruct_v6 { @@ -360,9 +360,9 @@ export interface UserOperationStruct_v6 { /* Data passed into the account along with the nonce during the verification step */ signature: BytesLike; } -//#endregion UserOperationStruct_v6 +// [!endregion UserOperationStruct_v6] -//#region UserOperationStruct_v7 +// [!region UserOperationStruct_v7] // based on https://github.com/eth-infinitism/account-abstraction/blob/releases/v0.7/test/UserOperation.ts // this is used for building requests for v0.7 entry point contract export interface UserOperationStruct_v7 { @@ -397,9 +397,9 @@ export interface UserOperationStruct_v7 { /* data passed into the account to verify authorization */ signature: BytesLike; } -//#endregion UserOperationStruct_v7 +// [!endregion UserOperationStruct_v7] -//#region UserOperationStruct +// [!region UserOperationStruct] export type UserOperationStruct< TEntryPointVersion extends EntryPointVersion = EntryPointVersion > = TEntryPointVersion extends "0.6.0" @@ -407,4 +407,4 @@ export type UserOperationStruct< : TEntryPointVersion extends "0.7.0" ? UserOperationStruct_v7 : never; -//#endregion UserOperationStruct +// [!endregion UserOperationStruct] diff --git a/packages/core/src/utils/schema.ts b/packages/core/src/utils/schema.ts index 1866244038..62d20c3281 100644 --- a/packages/core/src/utils/schema.ts +++ b/packages/core/src/utils/schema.ts @@ -14,20 +14,20 @@ export const HexSchema = z.custom<`0x${string}` | "0x">((val) => { return isHex(val, { strict: true }); }); -//#region BigNumberish +// [!region BigNumberish] export const BigNumberishSchema = z.union([HexSchema, z.number(), z.bigint()]); -//#endregion BigNumberish +// [!endregion BigNumberish] -//#region BigNumberishRange +// [!region BigNumberishRange] export const BigNumberishRangeSchema = z .object({ min: BigNumberishSchema.optional(), max: BigNumberishSchema.optional(), }) .strict(); -//#endregion BigNumberishRange +// [!endregion BigNumberishRange] -//#region Multiplier +// [!region Multiplier] export const MultiplierSchema = z .object({ /** @@ -41,7 +41,7 @@ export const MultiplierSchema = z ), }) .strict(); -//#endregion Multiplier +// [!endregion Multiplier] export function isBigNumberish(x: any): x is BigNumberish { return x != null && BigNumberishSchema.safeParse(x).success; diff --git a/site/.vitepress/config.ts b/site/.vitepress/config.ts deleted file mode 100644 index b00c6ad239..0000000000 --- a/site/.vitepress/config.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { defineConfig } from "vitepress"; -import { sidebar } from "./sidebar"; - -const pkg = require("../../lerna.json"); - -// https://vitepress.dev/reference/site-config -export default defineConfig({ - title: "Account Kit", - description: "Account Abstraction Legos", - themeConfig: { - logo: "/kit-logo.svg", - // https://vitepress.dev/reference/default-theme-config - nav: [ - { text: "Docs", link: "/getting-started/introduction" }, - { - text: "Examples", - link: "https://github.com/alchemyplatform/aa-sdk/tree/main/examples", - }, - { - text: pkg.version, - items: [ - { - text: "Migrating to 3.x.x", - link: "/migration-guides/migrating-to-v3", - }, - { - text: "Changelog", - link: "https://github.com/alchemyplatform/aa-sdk/blob/main/CHANGELOG.md", - }, - { - text: "Contributing", - link: "https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md", - }, - ], - }, - ], - - search: { - provider: "algolia", - options: { - appId: "P2YIRI1HM5", - apiKey: "2532e837d6c22886172745e30e650cda", - indexName: "accountkit-alchemy", - }, - }, - - sidebar: sidebar, - - socialLinks: [ - { icon: "github", link: "https://github.com/alchemyplatform/aa-sdk" }, - ], - }, - head: [ - [ - "script", - { - src: "https://static.alchemyapi.io/scripts/anayltics/alchemy-analytics.js", - defer: "defer", - }, - ], - ["link", { rel: "icon", href: "/favicon.ico" }], - - // Open Graph tags - ["meta", { property: "og:title", content: "Account Kit" }], - [ - "meta", - { - property: "og:description", - content: - "Account Kit is a framework to embed smart accounts in your web3 app, unlocking powerful features like email/social login, gas sponsorship, batched transactions, and more.", - }, - ], - ["meta", { property: "og:image", content: "/images/og-image.jpg" }], - ["meta", { property: "og:image:type", content: "image/jpeg" }], - ["meta", { property: "og:image:width", content: "2400" }], - ["meta", { property: "og:image:height", content: "1260" }], - - // Twitter Card tags - ["meta", { name: "twitter:card", content: "summary_large_image" }], - ["meta", { name: "twitter:title", content: "Account Kit" }], - [ - "meta", - { - name: "twitter:description", - content: - "Account Kit is a framework to embed smart accounts in your web3 app, unlocking powerful features like email/social login, gas sponsorship, batched transactions, and more.", - }, - ], - [ - "meta", - { - name: "twitter:image", - content: "/images/og-image.jpg", - }, - ], - ], - sitemap: { - hostname: "https://accountkit.alchemy.com", - }, -}); diff --git a/site/.vitepress/sidebar/index.ts b/site/.vitepress/sidebar/index.ts deleted file mode 100644 index 713bfb2aa6..0000000000 --- a/site/.vitepress/sidebar/index.ts +++ /dev/null @@ -1,279 +0,0 @@ -import { DefaultTheme } from "vitepress"; -import { packagesSidebar } from "./packages"; - -export const sidebar: DefaultTheme.Sidebar = [ - { - text: "Getting started", - items: [ - { - text: "Overview", - link: "/getting-started/overview", - }, - { - text: "Quick start", - base: "/getting-started", - items: [ - { text: "Introduction", link: "/introduction" }, - { - text: "Setup", - link: "/setup-app", - }, - { - text: "Log in users", - link: "/log-in-users", - }, - { text: "Send user operations", link: "/send-uos" }, - ], - }, - ], - }, - { - text: "Using Alchemy Signer", - base: "/signers/alchemy-signer", - items: [ - { - text: "Introduction", - link: "/introduction", - }, - { - text: "Passkey signup", - link: "/passkey-signup", - }, - { - text: "Passkey authentication", - link: "/passkey-auth", - }, - { - text: "User sessions", - link: "/manage-user-sessions", - }, - { - text: "Export private key", - link: "/export-private-key", - }, - ], - }, - { - text: "Using smart accounts", - base: "/using-smart-accounts", - items: [ - { text: "Send user operations", link: "/send-user-operations" }, - { text: "Batch user operations", link: "/batch-user-operations" }, - { - text: "Sponsor gas", - collapsed: false, - base: "/using-smart-accounts/sponsoring-gas", - items: [ - { text: "Use the Gas Manager", link: "/gas-manager" }, - { text: "Check eligibility", link: "/checking-eligibility" }, - ], - }, - { text: "Simulate user operations", link: "/simulate-user-operations" }, - { - text: "Session keys", - base: "/using-smart-accounts/session-keys", - collapsed: false, - items: [ - { - text: "Overview", - link: "/", - }, - { - text: "Getting started", - link: "/getting-started", - }, - { - text: "Supported permissions", - link: "/supported-permissions", - }, - ], - }, - { - text: "Transfer ownership", - base: "/using-smart-accounts/transfer-ownership", - collapsed: false, - items: [ - { text: "Modular Account", link: "/modular-account" }, - { text: "Light Account", link: "/light-account" }, - { - text: "Light Account (Multi-Owner)", - link: "/multi-owner-light-account", - }, - ], - }, - { - text: "Alchemy enhanced APIs", - base: "/using-smart-accounts/enhanced-apis", - collapsed: false, - items: [ - { - text: "Get account NFTs", - link: "/nft", - }, - { text: "Get account tokens", link: "/token" }, - ], - }, - { - text: "Update to EntryPoint v0.7", - link: "/entry-point-v7", - }, - ], - }, - { - text: "React Hooks", - base: "/react", - items: [ - { text: "Overview", link: "/overview" }, - { text: "SSR", link: "/ssr" }, - { text: "createConfig", link: "/createConfig" }, - { text: "useAuthenticate", link: "/useAuthenticate" }, - { text: "useSmartAccountClient", link: "/useSmartAccountClient" }, - { text: "useClientActions", link: "/useClientActions" }, - { text: "useAccount", link: "/useAccount" }, - { text: "useSigner", link: "/useSigner" }, - { text: "useSignerStatus", link: "/useSignerStatus" }, - { text: "useUser", link: "/useUser" }, - { text: "useBundlerClient", link: "/useBundlerClient" }, - { text: "useAddPasskey", link: "/useAddPasskey" }, - { text: "useLogout", link: "/useLogout" }, - { text: "useExportAccount", link: "/useExportAccount" }, - { text: "useSignMessage", link: "/useSignMessage" }, - { text: "useSignTypedData", link: "/useSignTypedData" }, - { text: "useSendUserOperation", link: "/useSendUserOperation" }, - { - text: "useDropAndReplaceUserOperation", - link: "/useDropAndReplaceUserOperation", - }, - { - text: "useWaitForUserOperationTransaction", - link: "/useWaitForUserOperationTransaction", - }, - { text: "useSendTransaction", link: "/useSendTransaction" }, - { text: "useSendTransactions", link: "/useSendTransactions" }, - { text: "useChain", link: "/useChain" }, - ], - }, - { - text: "Choosing a smart account", - items: [ - { text: "Introduction", link: "/smart-accounts/" }, - { - text: "Modular Account", - collapsed: false, - base: "/smart-accounts/modular-account", - items: [ - { text: "Overview", link: "/" }, - { text: "Getting started", link: "/getting-started" }, - { text: "Deployments", link: "/deployments" }, - { - text: "Upgrading to Modular Account", - link: "/upgrade-la-to-ma", - }, - { - text: "Multisig Plugin", - collapsed: true, - base: "/smart-accounts/modular-account/multisig-plugin", - items: [ - { text: "Overview", link: "/" }, - { text: "Getting started", link: "/getting-started" }, - { text: "Technical details", link: "/technical-details" }, - ], - }, - ], - }, - { - text: "Light Account", - collapsed: false, - base: "/smart-accounts/light-account", - items: [ - { text: "Overview", link: "/" }, - { text: "Getting started", link: "/getting-started" }, - { text: "Deployments", link: "/deployments" }, - ], - }, - { - text: "Custom accounts", - collapsed: true, - base: "/smart-accounts/custom", - items: [ - { text: "Use your own", link: "/using-your-own" }, - { text: "Contribute your account", link: "/contributing" }, - ], - }, - { text: "Gas benchmarks", link: "/smart-accounts/gas-benchmarks" }, - ], - }, - { - text: "Extending smart accounts", - base: "/extending-smart-accounts", - items: [ - { - text: "Install plugins", - link: "/install-plugins", - }, - { - text: "Get installed plugins", - link: "/get-installed-plugins", - }, - ], - }, - { - text: "Custom signers", - base: "/signers", - items: [ - { text: "Introduction", link: "/choosing-a-signer" }, - { - text: "Third-party signers", - base: "/signers/guides", - collapsed: true, - items: [ - { text: "Magic", link: "/magic" }, - { text: "Web3Auth", link: "/web3auth" }, - { text: "Turnkey", link: "/turnkey" }, - { text: "Privy", link: "/privy" }, - { text: "Dynamic", link: "/dynamic" }, - { text: "Fireblocks", link: "/fireblocks" }, - { text: "Portal", link: "/portal" }, - { text: "Capsule", link: "/capsule" }, - { text: "Lit Protocol", link: "/lit" }, - { text: "Particle Network", link: "/particle-network" }, - { text: "Arcana Auth", link: "/arcana-auth" }, - { text: "Dfns", link: "/dfns" }, - { text: "WalletKit", link: "/walletkit" }, - { text: "Passport", link: "/passport" }, - { text: "Fordefi", link: "/fordefi" }, - ], - }, - { text: "EOA signer", link: "/eoa" }, - { - text: "Build your own", - link: "/guides/custom-signer", - }, - { - text: "Contribute your signer", - link: "/contributing", - }, - ], - }, - - { - text: "Custom infra", - base: "/third-party", - items: [ - { text: "Use custom bundler", link: "/bundlers" }, - { text: "Use custom paymaster", link: "/paymasters" }, - ], - }, - packagesSidebar, - { - text: "Resources", - base: "/resources", - items: [ - { text: "FAQs", link: "/faqs" }, - { text: "React Native", link: "/react-native" }, - { text: "Terms", link: "/terms" }, - { text: "Types", link: "/types" }, - { text: "Contact us", link: "/contact-us" }, - ], - }, -]; diff --git a/site/.vitepress/sidebar/packages/aa-alchemy.ts b/site/.vitepress/sidebar/packages/aa-alchemy.ts deleted file mode 100644 index 6f379cca9a..0000000000 --- a/site/.vitepress/sidebar/packages/aa-alchemy.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { DefaultTheme } from "vitepress/types/default-theme"; - -export const aaAlchemySidebar: DefaultTheme.SidebarItem = { - text: "aa-alchemy", - base: "/packages/aa-alchemy", - collapsed: true, - items: [ - { - text: "Getting started", - link: "/", - }, - { - text: "Smart Account Client", - link: "/smart-account-client/", - }, - { - text: "Smart Account Actions", - base: "/packages/aa-alchemy/smart-account-client/actions", - collapsed: true, - items: [ - { - text: "simulateUserOperation", - link: "/simulateUserOperation", - }, - { - text: "alchemyEnhancedApiActions", - link: "/alchemyEnhancedApiActions", - }, - ], - }, - { - text: "Light Account Client", - link: "/light-account-client/", - }, - { - text: "Multisig Account Client", - link: "/modular-account-client/multisig-account-client", - }, - { - text: "Middleware", - base: "/packages/aa-alchemy/middleware", - collapsed: true, - items: [ - { - text: "alchemyFeeEstimator", - link: "/alchemyFeeEstimator", - }, - { - text: "alchemyGasManagerMiddleware", - link: "/alchemyGasManagerMiddleware", - }, - { - text: "alchemyUserOperationSimulator", - link: "/alchemyUserOperationSimulator", - }, - ], - }, - { - text: "Alchemy Signer", - base: "/packages/aa-alchemy/signer", - collapsed: true, - items: [ - { - text: "Overview", - link: "/overview", - }, - { - text: "authenticate", - link: "/authenticate", - }, - { - text: "disconnect", - link: "/disconnect", - }, - { - text: "getAuthDetails", - link: "/getAuthDetails", - }, - - { - text: "getAddress", - link: "/getAddress", - }, - { - text: "signMessage", - link: "/signMessage", - }, - { - text: "signTypedData", - link: "/signTypedData", - }, - { - text: "getUser", - link: "/getUser", - }, - { - text: "addPasskey", - link: "/addPasskey", - }, - { - text: "exportWallet", - link: "/exportWallet", - }, - ], - }, - { - text: "Utils", - collapsed: true, - base: "/packages/aa-alchemy/utils", - items: [{ text: "defineAlchemyChain", link: "/defineAlchemyChain" }], - }, - ], -}; diff --git a/site/.vitepress/sidebar/packages/aa-core.ts b/site/.vitepress/sidebar/packages/aa-core.ts deleted file mode 100644 index c89eca1163..0000000000 --- a/site/.vitepress/sidebar/packages/aa-core.ts +++ /dev/null @@ -1,220 +0,0 @@ -import { DefaultTheme } from "vitepress/types/default-theme"; - -export const aaCoreSidebar: DefaultTheme.SidebarItem = { - text: "aa-core", - base: "/packages/aa-core", - collapsed: true, - items: [ - { - text: "Getting started", - link: "/", - }, - { - text: "Smart Account Client", - base: "/packages/aa-core/smart-account-client", - link: "/index", - }, - { - text: "Client Middleware", - base: "/packages/aa-core/smart-account-client/middleware", - link: "/index", - }, - { - text: "Smart Account Actions", - collapsed: true, - base: "/packages/aa-core/smart-account-client/actions", - items: [ - { - text: "sendUserOperation", - link: "/sendUserOperation", - }, - { - text: "buildUserOperation", - link: "/buildUserOperation", - }, - { - text: "signUserOperation", - link: "/signUserOperation", - }, - { - text: "estimateUserOperationGas", - link: "/estimateUserOperationGas", - }, - { - text: "checkGasSponsorshipEligibility", - link: "/checkGasSponsorshipEligibility", - }, - { - text: "buildUserOperationFromTx", - link: "/buildUserOperationFromTx", - }, - { - text: "waitForUserOperationTransaction", - link: "/waitForUserOperationTransaction", - }, - { - text: "dropAndReplaceUserOperation", - link: "/dropAndReplaceUserOperation", - }, - { - text: "getUserOperationByHash", - link: "/getUserOperationByHash", - }, - { - text: "getUserOperationReceipt", - link: "/getUserOperationReceipt", - }, - { - text: "sendTransaction", - link: "/sendTransaction", - }, - { - text: "sendTransactions", - link: "/sendTransactions", - }, - { - text: "request", - link: "/request", - }, - { - text: "signMessage", - link: "/signMessage", - }, - { - text: "signTypedData", - link: "/signTypedData", - }, - { - text: "signMessageWith6492", - link: "/signMessageWith6492", - }, - { - text: "signTypedDataWith6492", - link: "/signTypedDataWith6492", - }, - { - text: "getAddress", - link: "/getAddress", - }, - { - text: "upgradeAccount", - link: "/upgradeAccount", - }, - { - text: "Types", - base: "/packages/aa-core/smart-account-client/types", - collapsed: true, - items: [ - { - text: "UserOperationFeeOptions", - link: "/userOperationFeeOptions", - }, - { - text: "UserOperationFeeOptionsField", - link: "/userOperationFeeOptionsField", - }, - { - text: "UserOperationOverrides", - link: "/userOperationOverrides", - }, - ], - }, - ], - }, - { - text: "Bundler Client", - base: "/packages/aa-core/bundler-client", - link: "/", - }, - { - text: "Bundler Actions", - collapsed: true, - base: "/packages/aa-core/bundler-client/actions", - items: [ - { - text: "sendRawUserOperation", - link: "/sendRawUserOperation", - }, - { - text: "estimateUserOperationGas", - link: "/estimateUserOperationGas", - }, - { - text: "getUserOperationByHash", - link: "/getUserOperationByHash", - }, - { - text: "getUserOperationReceipt", - link: "/getUserOperationReceipt", - }, - { - text: "getSupportedEntryPoints", - link: "/getSupportedEntryPoints", - }, - ], - }, - { - text: "Accounts", - base: "/packages/aa-core/accounts", - link: "/", - }, - { - text: "Signers", - base: "/packages/aa-core/signers", - collapsed: true, - items: [ - { text: "WalletClientSigner", link: "/wallet-client" }, - { text: "LocalAccountSigner", link: "/local-account" }, - { - text: "Utils", - collapsed: true, - base: "/packages/aa-core/signers/utils", - items: [ - { - text: "wrapSignatureWith6492", - link: "/wrapSignatureWith6492", - }, - { - text: "verifyEIP6492Signature", - link: "/verifyEIP6492Signature", - }, - ], - }, - ], - }, - { text: "Split Transport", link: "/split-transport" }, - { - text: "Utils", - base: "/packages/aa-core/utils", - collapsed: true, - items: [ - { text: "asyncPipe", link: "/asyncPipe" }, - { - text: "convertChainIdToCoinType", - link: "/convertChainIdToCoinType", - }, - { - text: "convertCoinTypeToChain", - link: "/convertCoinTypeToChain", - }, - { - text: "convertCoinTypeToChainId", - link: "/convertCoinTypeToChainId", - }, - { text: "deepHexlify", link: "/deepHexlify" }, - { text: "defineReadOnly", link: "/defineReadOnly" }, - { text: "getChain", link: "/getChain" }, - { - text: "getDefaultEntryPointAddress", - link: "/getDefaultEntryPointAddress", - }, - { - text: "getDefaultSimpleAccountFactoryAddress", - link: "/getDefaultSimpleAccountFactoryAddress", - }, - { text: "resolveProperties", link: "/resolveProperties" }, - { text: "stringToIndex", link: "/stringToIndex" }, - ], - }, - ], -}; diff --git a/site/.vitepress/sidebar/packages/aa-signers.ts b/site/.vitepress/sidebar/packages/aa-signers.ts deleted file mode 100644 index 05bb4e5cf3..0000000000 --- a/site/.vitepress/sidebar/packages/aa-signers.ts +++ /dev/null @@ -1,168 +0,0 @@ -import { DefaultTheme } from "vitepress/types/default-theme"; - -export const aaSignersSidebar: DefaultTheme.SidebarItem = { - text: "aa-signers", - collapsed: true, - base: "/packages/aa-signers", - items: [ - { - text: "Getting started", - link: "/", - }, - { - text: "Magic Signer", - collapsed: true, - base: "/packages/aa-signers/magic", - items: [ - { text: "Introduction", link: "/introduction" }, - { text: "constructor", link: "/constructor" }, - { text: "authenticate", link: "/authenticate" }, - { text: "getAddress", link: "/getAddress" }, - { text: "signMessage", link: "/signMessage" }, - { text: "signTypedData", link: "/signTypedData" }, - { text: "getAuthDetails", link: "/getAuthDetails" }, - ], - }, - { - text: "Web3Auth Signer", - collapsed: true, - base: "/packages/aa-signers/web3auth", - items: [ - { text: "Introduction", link: "/introduction" }, - { text: "constructor", link: "/constructor" }, - { text: "authenticate", link: "/authenticate" }, - { text: "getAddress", link: "/getAddress" }, - { text: "signMessage", link: "/signMessage" }, - { text: "signTypedData", link: "/signTypedData" }, - { text: "getAuthDetails", link: "/getAuthDetails" }, - ], - }, - { - text: "Turnkey Signer", - collapsed: true, - base: "/packages/aa-signers/turnkey", - items: [ - { text: "Introduction", link: "/introduction" }, - { text: "constructor", link: "/constructor" }, - { text: "authenticate", link: "/authenticate" }, - { text: "getAddress", link: "/getAddress" }, - { text: "signMessage", link: "/signMessage" }, - { text: "signTypedData", link: "/signTypedData" }, - { text: "getAuthDetails", link: "/getAuthDetails" }, - ], - }, - { - text: "Fireblocks Signer", - collapsed: true, - base: "/packages/aa-signers/fireblocks", - items: [ - { text: "Introduction", link: "/introduction" }, - { text: "constructor", link: "/constructor" }, - { text: "authenticate", link: "/authenticate" }, - { text: "getAddress", link: "/getAddress" }, - { text: "signMessage", link: "/signMessage" }, - { text: "signTypedData", link: "/signTypedData" }, - { text: "getAuthDetails", link: "/getAuthDetails" }, - ], - }, - { - text: "Capsule Signer", - collapsed: true, - base: "/packages/aa-signers/capsule", - items: [ - { text: "Introduction", link: "/introduction" }, - { text: "constructor", link: "/constructor" }, - { text: "authenticate", link: "/authenticate" }, - { text: "getAddress", link: "/getAddress" }, - { text: "signMessage", link: "/signMessage" }, - { text: "signTypedData", link: "/signTypedData" }, - { text: "getAuthDetails", link: "/getAuthDetails" }, - ], - }, - { - text: "Particle Signer", - collapsed: true, - base: "/packages/aa-signers/particle", - items: [ - { text: "Introduction", link: "/introduction" }, - { text: "constructor", link: "/constructor" }, - { text: "authenticate", link: "/authenticate" }, - { text: "getAddress", link: "/getAddress" }, - { text: "signMessage", link: "/signMessage" }, - { text: "signTypedData", link: "/signTypedData" }, - { text: "getAuthDetails", link: "/getAuthDetails" }, - ], - }, - { - text: "Portal Signer", - collapsed: true, - base: "/packages/aa-signers/portal", - items: [ - { text: "Introduction", link: "/introduction" }, - { text: "constructor", link: "/constructor" }, - { text: "authenticate", link: "/authenticate" }, - { text: "getAddress", link: "/getAddress" }, - { text: "signMessage", link: "/signMessage" }, - { text: "signTypedData", link: "/signTypedData" }, - { text: "getAuthDetails", link: "/getAuthDetails" }, - ], - }, - { - text: "Arcana Auth Signer", - collapsed: true, - base: "/packages/aa-signers/arcana-auth", - items: [ - { text: "Introduction", link: "/introduction" }, - { text: "constructor", link: "/constructor" }, - { text: "authenticate", link: "/authenticate" }, - { text: "getAddress", link: "/getAddress" }, - { text: "signMessage", link: "/signMessage" }, - { text: "signTypedData", link: "/signTypedData" }, - { text: "getAuthDetails", link: "/getAuthDetails" }, - ], - }, - { - text: "Lit Signer", - collapsed: true, - base: "/packages/aa-signers/lit-protocol", - items: [ - { text: "Introduction", link: "/introduction" }, - { text: "constructor", link: "/constructor" }, - { text: "authenticate", link: "/authenticate" }, - { text: "getAddress", link: "/getAddress" }, - { text: "signMessage", link: "/signMessage" }, - { text: "signTypedData", link: "/signTypedData" }, - { text: "getAuthDetails", link: "/getAuthDetails" }, - ], - }, - { - text: "Passport Signer", - collapsed: true, - base: "/packages/aa-signers/passport", - items: [ - { text: "Introduction", link: "/introduction" }, - { text: "constructor", link: "/constructor" }, - { text: "authenticate", link: "/authenticate" }, - { text: "getAddress", link: "/getAddress" }, - { text: "signMessage", link: "/signMessage" }, - { text: "signTypedData", link: "/signTypedData" }, - { text: "getAuthDetails", link: "/getAuthDetails" }, - ], - }, - { - text: "Fordefi Signer", - collapsed: true, - base: "/packages/aa-signers/fordefi", - items: [ - { text: "Introduction", link: "/introduction" }, - { text: "constructor", link: "/constructor" }, - { text: "authenticate", link: "/authenticate" }, - { text: "getAddress", link: "/getAddress" }, - { text: "signMessage", link: "/signMessage" }, - { text: "signTypedData", link: "/signTypedData" }, - { text: "getAuthDetails", link: "/getAuthDetails" }, - ], - }, - { text: "Contributing", link: "/contributing" }, - ], -}; diff --git a/site/.vitepress/sidebar/packages/index.ts b/site/.vitepress/sidebar/packages/index.ts deleted file mode 100644 index e08d2b480a..0000000000 --- a/site/.vitepress/sidebar/packages/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { DefaultTheme } from "vitepress/types/default-theme"; -import { aaAccountsSidebar } from "./aa-accounts"; -import { aaAlchemySidebar } from "./aa-alchemy"; -import { aaCoreSidebar } from "./aa-core"; -import { aaEthersSidebar } from "./aa-ethers"; -import { aaSignersSidebar } from "./aa-signers"; - -export const packagesSidebar: DefaultTheme.SidebarItem = { - text: "aa-sdk Packages", - base: "/packages", - items: [ - { text: "Overview", link: "/" }, - aaCoreSidebar, - aaAlchemySidebar, - aaAccountsSidebar, - aaSignersSidebar, - aaEthersSidebar, - ], -}; diff --git a/site/.vitepress/theme/components/VideoEmbed.vue b/site/.vitepress/theme/components/VideoEmbed.vue deleted file mode 100644 index 254451ac0c..0000000000 --- a/site/.vitepress/theme/components/VideoEmbed.vue +++ /dev/null @@ -1,140 +0,0 @@ - - - - - diff --git a/site/.vitepress/theme/index.ts b/site/.vitepress/theme/index.ts deleted file mode 100644 index f1608ca839..0000000000 --- a/site/.vitepress/theme/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { h } from "vue"; -import Theme from "vitepress/theme"; -import VideoEmbed from "./components/VideoEmbed.vue"; // Importing the component -import "./style.css"; - -export default { - extends: Theme, - Layout: () => { - return h(Theme.Layout, null, { - // https://vitepress.dev/guide/extending-default-theme#layout-slots - }); - }, - enhanceApp({ app, router, siteData }) { - app.component("VideoEmbed", VideoEmbed); // Registering the component globally - // ... - }, -}; diff --git a/site/.vitepress/theme/style.css b/site/.vitepress/theme/style.css deleted file mode 100644 index ae39437cf2..0000000000 --- a/site/.vitepress/theme/style.css +++ /dev/null @@ -1,178 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - -/** - * Customize default theme styling by overriding CSS variables: - * https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css - */ - -/** - * Colors - * - * Each colors have exact same color scale system with 3 levels of solid - * colors with different brightness, and 1 soft color. - * - * - `XXX-1`: The most solid color used mainly for colored text. It must - * satisfy the contrast ratio against when used on top of `XXX-soft`. - * - * - `XXX-2`: The color used mainly for hover state of the button. - * - * - `XXX-3`: The color for solid background, such as bg color of the button. - * It must satisfy the contrast ratio with pure white (#ffffff) text on - * top of it. - * - * - `XXX-soft`: The color used for subtle background such as custom container - * or badges. It must satisfy the contrast ratio when putting `XXX-1` colors - * on top of it. - * - * The soft color must be semi transparent alpha channel. This is crucial - * because it allows adding multiple "soft" colors on top of each other - * to create a accent, such as when having inline code block inside - * custom containers. - * - * - `default`: The color used purely for subtle indication without any - * special meanings attched to it such as bg color for menu hover state. - * - * - `brand`: Used for primary brand colors, such as link text, button with - * brand theme, etc. - * - * - `tip`: Used to indicate useful information. The default theme uses the - * brand color for this by default. - * - * - `warning`: Used to indicate warning to the users. Used in custom - * container, badges, etc. - * - * - `danger`: Used to show error, or dangerous message to the users. Used - * in custom container, badges, etc. - * -------------------------------------------------------------------------- */ - -:root { - --vp-c-white: #ffffff; - --vp-c-black: #020617; - - --vp-c-neutral: var(--vp-c-black); - --vp-c-neutral-inverse: var(--vp-c-white); -} - -.dark { - --vp-c-neutral: var(--vp-c-white); - --vp-c-neutral-inverse: var(--vp-c-black); -} - -:root { - --vp-c-brand-1: #ce26a2; - --vp-c-brand-2: #f16f46; -} - -:root { - --vp-c-default-1: var(--vp-c-gray-1); - --vp-c-default-2: var(--vp-c-gray-2); - --vp-c-default-3: var(--vp-c-gray-3); - --vp-c-default-soft: var(--vp-c-gray-soft); - - --vp-c-brand-3: var(--vp-c-brand-1); - - --vp-c-tip-1: var(--vp-c-brand-1); - --vp-c-tip-2: var(--vp-c-brand-2); - --vp-c-tip-3: var(--vp-c-brand-3); - --vp-c-tip-soft: var(--vp-c-brand-soft); - - --vp-c-warning-1: var(--vp-c-yellow-1); - --vp-c-warning-2: var(--vp-c-yellow-2); - --vp-c-warning-3: var(--vp-c-yellow-3); - --vp-c-warning-soft: var(--vp-c-yellow-soft); - - --vp-c-danger-1: var(--vp-c-red-1); - --vp-c-danger-2: var(--vp-c-red-2); - --vp-c-danger-3: var(--vp-c-red-3); - --vp-c-danger-soft: var(--vp-c-red-soft); -} - -/** - * Component: Button - * -------------------------------------------------------------------------- */ - -:root { - --vp-button-brand-border: transparent; - --vp-button-brand-text: var(--vp-c-white); - --vp-button-brand-bg: var(--vp-c-brand-3); - --vp-button-brand-hover-border: transparent; - --vp-button-brand-hover-text: var(--vp-c-white); - --vp-button-brand-hover-bg: var(--vp-c-brand-2); - --vp-button-brand-active-border: transparent; - --vp-button-brand-active-text: var(--vp-c-white); - --vp-button-brand-active-bg: var(--vp-c-brand-1); -} - -/** - * Component: Home - * -------------------------------------------------------------------------- */ - -:root { - --vp-home-hero-name-color: transparent; - --vp-home-hero-name-background: -webkit-linear-gradient( - 120deg, - #bd34fe 30%, - #41d1ff - ); - - --vp-home-hero-image-background-image: linear-gradient( - -45deg, - #bd34fe 50%, - #47caff 50% - ); - --vp-home-hero-image-filter: blur(40px); -} - -@media (min-width: 640px) { - :root { - --vp-home-hero-image-filter: blur(56px); - } -} - -@media (min-width: 960px) { - :root { - --vp-home-hero-image-filter: blur(72px); - } -} - -/** - * Component: Custom Block - * -------------------------------------------------------------------------- */ - -:root { - --vp-custom-block-tip-border: transparent; - --vp-custom-block-tip-text: var(--vp-c-text-1); - --vp-custom-block-tip-bg: var(--vp-c-brand-soft); - --vp-custom-block-tip-code-bg: var(--vp-c-brand-soft); -} - -/** - * Component: Algolia - * -------------------------------------------------------------------------- */ - -.DocSearch { - --docsearch-primary-color: var(--vp-c-brand-1) !important; -} - -.VPHome { - padding-bottom: 0px !important; -} - -.bg-clip-text { - background-clip: text; - -webkit-background-clip: text; -} - -.transparent-text-fill { - -webkit-text-fill-color: transparent; -} - -/** - * Component: Sidebar - * -------------------------------------------------------------------------- */ - -:root { - --vp-sidebar-width: 280px; -} diff --git a/site/getting-started/[beginning].md b/site/getting-started/[beginning].md deleted file mode 100644 index 54035fd58d..0000000000 --- a/site/getting-started/[beginning].md +++ /dev/null @@ -1,37 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: Getting started guide - - - meta - - name: description - content: Learn how to get started with Alchemy's Embedded Accounts using Account Kit and the Alchemy Signer, Modular Account, Rundler and Gas Manager. - - - meta - - property: og:description - content: Learn how to get started with Alchemy's Embedded Accounts using Account Kit and the Alchemy Signer, Modular Account, Rundler and Gas Manager. - - - meta - - name: twitter:title - content: Getting started guide - - - meta - - name: twitter:description - content: Learn how to get started with Alchemy's Embedded Accounts using Account Kit and the Alchemy Signer, Modular Account, Rundler and Gas Manager. ---- - -# Quick start - ---- - -Embedded Accounts Banner - -This guide will show you how to create Embedded Accounts using [Account Kit](https://accountkit.alchemy.com/resources/terms.html#account-kit), the Alchemy [Signer](https://accountkit.alchemy.com/resources/terms.html#signer), and the Alchemy [Modular Account](https://accountkit.alchemy.com/resources/terms.html#modular-account). - -::: tip Want to test it out right away? -Clone [this Github repo](https://github.com/alchemyplatform/embedded-accounts-quickstart) and follow the `README`. -::: - -By the end of this guide, you will have set up a basic web application where users sign up with email, silently deploy a Modular Account onchain, and send UserOperations (UOs) with zero gas using the Alchemy [Rundler](https://accountkit.alchemy.com/resources/terms.html#bundler) and Alchemy [Gas Manager](https://accountkit.alchemy.com/resources/terms.html#gas-manager). - -Here's a demo video below of the experience you'll be building! - - diff --git a/site/getting-started/[beginning].paths.ts b/site/getting-started/[beginning].paths.ts deleted file mode 100644 index 5672d189b3..0000000000 --- a/site/getting-started/[beginning].paths.ts +++ /dev/null @@ -1,10 +0,0 @@ -const configPaths = { - paths() { - return [ - { params: { beginning: "setup" } }, - { params: { beginning: "introduction" } }, - ]; - }, -}; - -export default configPaths; diff --git a/site/index.md b/site/index.md deleted file mode 100644 index c37a345f69..0000000000 --- a/site/index.md +++ /dev/null @@ -1,208 +0,0 @@ ---- -outline: deep -# https://vitepress.dev/reference/default-theme-home-page -layout: home -# HTML Metadata -head: - - - meta - - property: og:title - content: Account Kit Documentation - - - meta - - name: description - content: Account Kit is a vertically integrated stack for building apps that support ERC-4337 smart accounts, Signer integrations, sponsoring gas, bundlers, and an SDK. - - - meta - - property: og:description - content: Account Kit is a vertically integrated stack for building apps that support ERC-4337 smart accounts, Signer integrations, sponsoring gas, bundlers, and an SDK. - - - meta - - name: twitter:title - content: Account Kit Documentation - - - meta - - name: twitter:description - content: Account Kit is a vertically integrated stack for building apps that support ERC-4337 smart accounts, Signer integrations, sponsoring gas, bundlers, and an SDK. - - - meta - - name: google-site-verification - content: W4pmFb0Oe26_OndBLdy5uqNrsl_gfmKfTlHwlHPd4Co -titleTemplate: :title Documentation -# you can also add HTML or Markdown components below the --- line to add custom HTML or Markdown content (eg: https://github.com/wagmi-dev/viem/blob/main/site/index.md?plain=1) ---- - - -
-
-
-
-
-
-
-
- Account Kit Logo - Account Kit -
-
-
- Account Kit - Documentation - -
-
-
- Build zero friction onboarding to web3 with Embedded Accounts! Account Kit makes it simple to embed powerful smart accounts or lightweight EOAs in your app as an embedded wallet. -
- -
- - -
- -::: code-group - -```ts [gettingStarted.ts] -import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; -import { sepolia } from "@alchemy/aa-core"; - -export const smartAccountClient = await createModularAccountAlchemyClient({ - apiKey: "YOUR_API_KEY", - chain: sepolia, - signer, -}); -``` - -::: - -
-
-
- -
-
-
- -
diff --git a/site/overview/demos.md b/site/overview/demos.md deleted file mode 100644 index f580d6e0de..0000000000 --- a/site/overview/demos.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: Demos - - - meta - - name: description - content: Demos using Account Kit - - - meta - - property: og:description - content: Demos using Account Kit ---- - -# Demos - -## Gasless token minting demo - -This demo shows minting an ERC-20 token to a Light Account using our Gas Manager to provide a gasless minting experience. - -[Try it out!](https://aa-simple-dapp.vercel.app/) - -[View on Github!](https://github.com/alchemyplatform/aa-sdk/tree/development/examples/aa-simple-dapp) - -[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/alchemyplatform/aa-sdk/tree/main/examples/aa-simple-dapp?file=README.md) - -## Gasless NFT minting demo - -This demo shows how to mint an NFT (ERC-721 token) to a Light Account using our Gas Manager to provide a gasless minting experience. - -[Try it out!](https://gasless-nft-minter-v2.vercel.app/) diff --git a/site/package.json b/site/package.json index d7af2ae5b0..839759437c 100644 --- a/site/package.json +++ b/site/package.json @@ -4,9 +4,9 @@ "version": "3.8.2-alpha.1", "type": "module", "scripts": { - "dev": "vitepress dev", - "build": "vitepress build", - "preview": "vitepress preview" + "dev": "vocs dev", + "build": "vocs build", + "preview": "vocs preview" }, "devDependencies": { "@alchemy/aa-accounts": "*", @@ -17,9 +17,9 @@ "autoprefixer": "^10.4.16", "execa": "^8.0.1", "tailwindcss": "^3.3.3", - "viem": "2.8.6", - "vitepress": "^1.1.4", - "vue": "^3.2.45" + "viem": "2.8.6" }, - "dependencies": {} + "dependencies": { + "vocs": "^1.0.0-alpha.52" + } } diff --git a/site/packages/aa-alchemy/signer/addPasskey.md b/site/packages/aa-alchemy/signer/addPasskey.md deleted file mode 100644 index 34457a7140..0000000000 --- a/site/packages/aa-alchemy/signer/addPasskey.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: Alchemy Signer • addPasskey - - - meta - - name: description - content: Learn how to use the AlchemySigner.addPasskey method - - - meta - - property: og:description - content: Learn how to use the AlchemySigner.addPasskey method - - - meta - - name: twitter:title - content: Alchemy Signer • addPasskey - - - meta - - name: twitter:description - content: Learn how to use the AlchemySigner.addPasskey method ---- - -# addPasskey - -The `addPasskey` method is used to add a passkey as an auth method to an already logged in user. - -::: warning -This method throws if there is no authenticated user. -::: - -## Usage - -::: code-group - -```ts -import { signer } from "./signer"; - -await signer.addPasskey(); -``` - -<<< @/snippets/signers/alchemy/signer.ts - -::: - -## Returns - -`Promise` -- on success returns an array of credential ids - -## Parameters - -`params?: CredentialCreationOptions` -- overrides for the WebAuthn credential creation options. For more info on the `CredentialCreationOptions` interface, see [here](https://microsoft.github.io/PowerBI-JavaScript/interfaces/_node_modules_typedoc_node_modules_typescript_lib_lib_dom_d_.credentialcreationoptions.html). diff --git a/site/packages/aa-alchemy/signer/disconnect.md b/site/packages/aa-alchemy/signer/disconnect.md deleted file mode 100644 index d480b4d2de..0000000000 --- a/site/packages/aa-alchemy/signer/disconnect.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: Alchemy Signer • disconnect - - - meta - - name: description - content: Learn how to use the AlchemySigner.disconnect method - - - meta - - property: og:description - content: Learn how to use the AlchemySigner.disconnect method - - - meta - - name: twitter:title - content: Alchemy Signer • disconnect - - - meta - - name: twitter:description - content: Learn how to use the AlchemySigner.disconnect method ---- - -# disconnect - -The `disconnect` method is used to disconnect a user from the Alchemy Signer and clear the local session. - -## Usage - -::: code-group - -```ts -import { signer } from "./signer"; - -await signer.disconnect(); -``` - -<<< @/snippets/signers/alchemy/signer.ts - -::: diff --git a/site/packages/aa-alchemy/signer/getAddress.md b/site/packages/aa-alchemy/signer/getAddress.md deleted file mode 100644 index 0e59069f2c..0000000000 --- a/site/packages/aa-alchemy/signer/getAddress.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: Alchemy Signer • getAddress - - - meta - - name: description - content: Learn how to use the AlchemySigner.getAddress method - - - meta - - property: og:description - content: Learn how to use the AlchemySigner.getAddress method - - - meta - - name: twitter:title - content: Alchemy Signer • getAddress - - - meta - - name: twitter:description - content: Learn how to use the AlchemySigner.getAddress method ---- - -# getAddress - -Returns the signer's public address. - -::: warning -This method throws if there is no authenticated user. -::: - -## Usage - -::: code-group - -```ts -import { signer } from "./signer"; - -const address = await signer.getAddress(); -``` - -<<< @/snippets/signers/alchemy/signer.ts - -::: - -## Returns - -`Promise
` -- on success returns the signer's public address. diff --git a/site/packages/aa-alchemy/signer/getAuthDetails.md b/site/packages/aa-alchemy/signer/getAuthDetails.md deleted file mode 100644 index 041eb382c2..0000000000 --- a/site/packages/aa-alchemy/signer/getAuthDetails.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: Alchemy Signer • getAuthDetails - - - meta - - name: description - content: Learn how to use the AlchemySigner.getAuthDetails method - - - meta - - property: og:description - content: Learn how to use the AlchemySigner.getAuthDetails method - - - meta - - name: twitter:title - content: Alchemy Signer • getAuthDetails - - - meta - - name: twitter:description - content: Learn how to use the AlchemySigner.getAuthDetails method ---- - -# getAuthDetails - -The `getAuthDetails` method is used to get the details of the currently authenticated user. This method will also use session storage to get the user's details if they are already authenticated. - -::: warning -This method throws if there is no authenticated user. -::: - -## Usage - -::: code-group - -```ts -import { signer } from "./signer"; - -const user = await signer.getAuthDetails(); -``` - -<<< @/snippets/signers/alchemy/signer.ts - -::: - -## Returns - -`Promise` -- on success returns a `User` object representing the authenticated user. diff --git a/site/packages/aa-alchemy/signer/getUser.md b/site/packages/aa-alchemy/signer/getUser.md deleted file mode 100644 index b129a5b69c..0000000000 --- a/site/packages/aa-alchemy/signer/getUser.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: Alchemy Signer • getUser - - - meta - - name: description - content: Learn how to use the AlchemySigner.getUser method - - - meta - - property: og:description - content: Learn how to use the AlchemySigner.getUser method - - - meta - - name: twitter:title - content: Alchemy Signer • getUser - - - meta - - name: twitter:description - content: Learn how to use the AlchemySigner.getUser method ---- - -# getUser - -The `getUser` method is used to look up if a user already exists for a given email address - -## Usage - -::: code-group - -```ts -import { signer } from "./signer"; - -const result = await signer.getUser("moldy@email.com"); -``` - -<<< @/snippets/signers/alchemy/signer.ts - -::: - -## Returns - -`Promise<{orgId: string} | null>` -- if a user exists, this will return an object with the orgId of the user. If no user exists, this will return `null`. diff --git a/site/packages/aa-alchemy/signer/signMessage.md b/site/packages/aa-alchemy/signer/signMessage.md deleted file mode 100644 index f6cbf372a5..0000000000 --- a/site/packages/aa-alchemy/signer/signMessage.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: Alchemy Signer • signMessage - - - meta - - name: description - content: Learn how to use the AlchemySigner.signMessage method - - - meta - - property: og:description - content: Learn how to use the AlchemySigner.signMessage method - - - meta - - name: twitter:title - content: Alchemy Signer • signMessage - - - meta - - name: twitter:description - content: Learn how to use the AlchemySigner.signMessage method ---- - -# signMessage - -The `signMessage` method is used to sign a message with the Alchemy Signer. - -::: warning -This method throws if there is no authenticated user. -::: - -## Usage - -::: code-group - -```ts -import { signer } from "./signer"; - -const message = "Hello, world!"; -const signature = await signer.signMessage(message); -``` - -<<< @/snippets/signers/alchemy/signer.ts - -::: - -## Returns - -`Promise` -- on success returns the signature of the message. - -## Parameters - -`message: string | Uint8Array` -- the message to sign diff --git a/site/packages/aa-alchemy/signer/signTransaction.md b/site/packages/aa-alchemy/signer/signTransaction.md deleted file mode 100644 index 49c479e75d..0000000000 --- a/site/packages/aa-alchemy/signer/signTransaction.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: Alchemy Signer • signTransaction - - - meta - - name: description - content: Learn how to use the AlchemySigner.signTransaction method - - - meta - - property: og:description - content: Learn how to use the AlchemySigner.signTransaction method - - - meta - - name: twitter:title - content: Alchemy Signer • signTransaction - - - meta - - name: twitter:description - content: Learn how to use the AlchemySigner.signTransaction method ---- - -# signTransaction - -The `signTransaction` method is used to sign transactions with the Alchemy Signer when using the Signer as an EOA. - -::: warning -This method throws if there is no authenticated user. -::: - -## Usage - -::: code-group - -```ts -import { signer } from "./signer"; - -const tx = {...}; -const signature = await signer.signTransaction(tx); -``` - -<<< @/snippets/signers/alchemy/signer.ts - -::: - -## Returns - -`Promise` -- on success returns the signed Transaction. - -## Parameters - -`tx: TransactionSerializable` -- the transaction to sign diff --git a/site/packages/aa-alchemy/signer/signTypedData.md b/site/packages/aa-alchemy/signer/signTypedData.md deleted file mode 100644 index 8a45e8bdbb..0000000000 --- a/site/packages/aa-alchemy/signer/signTypedData.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: Alchemy Signer • signTypedData - - - meta - - name: description - content: Learn how to use the AlchemySigner.signTypedData method - - - meta - - property: og:description - content: Learn how to use the AlchemySigner.signTypedData method - - - meta - - name: twitter:title - content: Alchemy Signer • signTypedData - - - meta - - name: twitter:description - content: Learn how to use the AlchemySigner.signTypedData method ---- - -# signTypedData - -The `signTypedData` method is used to sign typed data with the Alchemy Signer. - -::: warning -This method throws if there is no authenticated user. -::: - -## Usage - -::: code-group - -```ts -import { signer } from "./signer"; - -const signature = await signer.signTypedData(typedDataParams); -``` - -<<< @/snippets/signers/alchemy/signer.ts - -::: - -## Returns - -`Promise` -- on success returns the signature of the message. - -## Parameters - -`params: TypedDataDefinition` -- the typed data definition of the message you want to sign diff --git a/site/packages/aa-alchemy/signer/toViemAccount.md b/site/packages/aa-alchemy/signer/toViemAccount.md deleted file mode 100644 index abbb71c4f9..0000000000 --- a/site/packages/aa-alchemy/signer/toViemAccount.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: Alchemy Signer • toViemAccount - - - meta - - name: description - content: Learn how to use the AlchemySigner.toViemAccount method - - - meta - - property: og:description - content: Learn how to use the AlchemySigner.toViemAccount method - - - meta - - name: twitter:title - content: Alchemy Signer • toViemAccount - - - meta - - name: twitter:description - content: Learn how to use the AlchemySigner.toViemAccount method ---- - -# toViemAccount - -The `toViemAccount` method is used to adapt the AlchemySigner into a viem [`WalletClient`](https://viem.sh/docs/clients/wallet#local-accounts-private-key-mnemonic-etc) compatible `LocalAccoun`. This is particularly useful if you are already using viem and want to use the signer as an EOA. - -::: warning -This method throws if there is no authenticated user. -::: - -## Usage - -::: code-group - -```ts -import { signer } from "./signer"; - -const account = signer.toViemAccount(); -``` - -<<< @/snippets/signers/alchemy/signer.ts - -::: - -## Returns - -`LocalAccount` -- on success returns a viem `LocalAccount`. diff --git a/site/packages/aa-core/accounts/index.md b/site/packages/aa-core/accounts/index.md deleted file mode 100644 index c72715618c..0000000000 --- a/site/packages/aa-core/accounts/index.md +++ /dev/null @@ -1,89 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: SmartContractAccount - - - meta - - name: description - content: Overview of SmartContractAccount exported by aa-core - - - meta - - property: og:description - content: Overview of SmartContractAccount exported by aa-core -prev: - text: SmartAccountClient ---- - -# SmartContractAccount - -The `SmartContractAccount` interface is an extension of viem's [`CustomAccount`](https://viem.sh/docs/accounts/custom) with additional methods used for Account Abstraction. It is meant to be used in conjunction with a [`SmartAccountClient`](/packages/aa-core/smart-account-client/). - -## Custom Smart Contract Accounts - -If you have your own smart contract that you would like to interact with, then you can use the `toSmartContractAccount` method to create a `SmartContractAccount` instance. - -### Usage - -```ts -import { - getVersion060EntryPoint, - toSmartContractAccount, -} from "@alchemy/aa-core"; -import { sepolia } from "viem/chains"; - -const myAccount = await toSmartContractAccount({ - /// REQUIRED PARAMS /// - source: "MyAccount", - transport: http("RPC_URL"), - chain: sepolia, - // The EntryPointDef that your account is compatible with - entryPoint: getVersion060EntryPoint(sepolia), - // This should return a concatenation of your `factoryAddress` and the `callData` for your factory's create account method - getAccountInitCode: () => "0x{factoryAddress}{callData}", - // an invalid signature that doesn't cause your account to revert during validation - getDummySignature: () => "0x1234...", - // given a UO in the form of {target, data, value} should output the calldata for calling your contract's execution method - encodeExecute: (uo)=> "...." - signMessage: ({message}: SignableMessage) => "0x...", - signTypedData: (typedData) => "0x000", - - /// OPTIONAL PARAMS /// - // if you already know your account's address, pass that in here to avoid generating a new counterfactual - accountAddress?: Address, - // if your account supports batching, this should take an array of UOs and return the calldata for calling your contract's batchExecute method - encodeBatchExecute: (uos) => "0x...", - // if your contract expects a different signing scheme than the default signMessage scheme, you can override that here - signUserOperationHash: (hash) => "0x...", - // allows you to define the calldata for upgrading your account - encodeUpgradeToAndCall: (params) => "0x...", -}); -``` - -### Returns - -#### `SmartContractAccount` - -```ts -export type SmartContractAccount = - LocalAccount & { - source: Name; - getDummySignature: () => Hex | Promise; - encodeExecute: (tx: Tx) => Promise; - encodeBatchExecute: (txs: Tx[]) => Promise; - signUserOperationHash: (uoHash: Hex) => Promise; - signMessageWith6492: (params: { message: SignableMessage }) => Promise; - signTypedDataWith6492: < - const typedData extends TypedData | Record, - primaryType extends keyof typedData | "EIP712Domain" = keyof typedData - >( - typedDataDefinition: TypedDataDefinition - ) => Promise; - encodeUpgradeToAndCall: (params: UpgradeToAndCallParams) => Promise; - getNonce(): Promise; - getInitCode: () => Promise; - isAccountDeployed: () => Promise; - getFactoryAddress: () => Address; - getEntryPoint: () => Address; - getImplementationAddress: () => Promise; - }; -``` diff --git a/site/packages/aa-core/smart-account-client/types/userOperationFeeOptionsField.md b/site/packages/aa-core/smart-account-client/types/userOperationFeeOptionsField.md deleted file mode 100644 index 7b9bb449c0..0000000000 --- a/site/packages/aa-core/smart-account-client/types/userOperationFeeOptionsField.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: UserOperationFeeOptionsField - - - meta - - name: description - content: Overview of the UserOperationFeeOptionsField type in aa-core types - - - meta - - property: og:description - content: Overview of the UserOperationFeeOptionsField type in aa-core types ---- - -# UserOperationFeeOptionsField - -Merged type of [`BigNumberishRange`](/resources/types.md#bignumberishrange) with [`Multiplier`](/resources/types.md#multiplier) type that can be used as [`UserOperationFeeOptions`](./userOperationFeeOptions.md) fields for the [`SmartAccountClient`](/packages/aa-core/smart-account-client/index.md) to use during the gas fee calculation middlewares when constructing the user operation to send. - -For example, if the below example `UserOperationFeeOptionsField` is set as the fee option for the `maxPriorityFeePerGas` field of [`UserOperationFeeOptions`](./userOperationFeeOptions.md), then the [`SmartAccountClient`](/packages/aa-core/smart-account-client/index.md) will apply 50% buffer to the estimated `maxPriorityFeePerGas`, then set the `maxPriorityFeePerGas` on the user operation as the larger value between the buffered `maxPriorityFeePerGas` fee and the min `maxPriorityFeePerGas` which is `100_000_000n` here. - -```ts -/* - * { - * min?: BigNumberish - * max?: BigNumberish - * multiplier?: number - * } - */ -type UserOperationFeeOptionsFieldSchema = BigNumberishRange & Multiplier; -``` - -## Usage - -::: code-group - -```ts [example.ts] -import { type UserOperationFeeOptionsField } from "@alchemy/aa-core"; - -const userOperationFeeOptionsField: UserOperationFeeOptionsField = { - min: 100_000_000n, - multiplier: 1.5, -}; -``` - -::: diff --git a/site/packages/aa-ethers/provider-adapter/fromEthersProvider.md b/site/packages/aa-ethers/provider-adapter/fromEthersProvider.md deleted file mode 100644 index 30ad8953c5..0000000000 --- a/site/packages/aa-ethers/provider-adapter/fromEthersProvider.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: EthersProviderAdapter • fromEthersProvider - - - meta - - name: description - content: Overview of the fromEthersProvider method on EthersProviderAdapter in aa-ethers - - - meta - - property: og:description - content: Overview of the fromEthersProvider class on EthersProviderAdapter in aa-ethers -next: - text: AccountSigner ---- - -# fromEthersProvider - -`fromEthersProvider` is a static method on `EthersProviderAdapter` that converts an ethers.js `JsonRpcProvider` to an `EthersProviderAdapter`. - -## Usage - -::: code-group - -<<< @/snippets/aa-ethers/ethers-provider.ts -::: - -## Returns - -### `EthersProviderAdapter` - -An instance of `EthersProviderAdapter` - -## Parameters - -### `provider: JsonRpcProvider` - -The ethers JSON RPC provider to convert diff --git a/site/extending-smart-accounts/get-installed-plugins.md b/site/pages/extending-smart-accounts/get-installed-plugins.md similarity index 74% rename from site/extending-smart-accounts/get-installed-plugins.md rename to site/pages/extending-smart-accounts/get-installed-plugins.md index c749bff1cb..a298079124 100644 --- a/site/extending-smart-accounts/get-installed-plugins.md +++ b/site/pages/extending-smart-accounts/get-installed-plugins.md @@ -1,21 +1,8 @@ --- -outline: deep -head: - - - meta - - property: og:title2 - content: Extending Smart Accounts • Get installed plugins of a Modular Account - - - meta - - name: description - content: Follow this guide to get installed plugins of a Modular Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this guide to get installed plugins of a Modular Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: Extending Smart Accounts • Get installed plugins of a Modular Account - - - meta - - name: twitter:description - content: Follow this guide to get installed plugins of a Modular Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: Extending Smart Accounts • Get installed plugins of a Modular Account +description: Follow this guide to get installed plugins of a Modular Account + with Account Kit, a vertically integrated stack for building apps that support + ERC-4337 and ERC-6900. --- # How to get the installed plugins of a Modular Account @@ -36,11 +23,11 @@ You should first extend the `SmartAcountClient` connected to a Modular Account, Then, you can use the `getInstalledPlugins` method of the `accountLoupeActions` extended smart account client to get the list of installed plugin addresses for the connected Modular Account. -::: tip Note +:::tip[Note] When using `createModularAccountAlchemyClient` in `@alchemy/aa-alchemy`, the `SmartAccountClient` comes automatically extended with `multiOwnerPluginActions`, `pluginManagerActions`, and `accountLoupeActions` decorators as defaults available for use. ::: -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient as modularAccountClient } from "./smartAccountClient"; @@ -76,7 +63,9 @@ console.log(JSON.stringify(metadata, null, 2)); // } ``` -<<< @/snippets/aa-alchemy/connected-client.ts [smartAccountClient.ts] +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/connected-client.ts] +``` ::: diff --git a/site/extending-smart-accounts/install-plugins.md b/site/pages/extending-smart-accounts/install-plugins.md similarity index 77% rename from site/extending-smart-accounts/install-plugins.md rename to site/pages/extending-smart-accounts/install-plugins.md index 93c2fc72a8..dd440fa876 100644 --- a/site/extending-smart-accounts/install-plugins.md +++ b/site/pages/extending-smart-accounts/install-plugins.md @@ -1,21 +1,9 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Extending Smart Accounts • Installing & uninstalling plugins on a Modular Account - - - meta - - name: description - content: Follow this guide to install and uninstall plugins on a Modular Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this guide to install and uninstall plugins on a Modular Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: Extending Smart Accounts • Installing & uninstalling plugins on a Modular Account - - - meta - - name: twitter:description - content: Follow this guide to install and uninstall plugins on a Modular Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: Extending Smart Accounts • Installing & uninstalling plugins on a Modular + Account +description: Follow this guide to install and uninstall plugins on a Modular + Account with Account Kit, a vertically integrated stack for building apps that + support ERC-4337 and ERC-6900. --- # How to install and uninstall plugins on a Modular Account @@ -36,11 +24,11 @@ You should first extend the `SmartAccountClient` connected to a Modular Account Then, you can use the `installSessionKeyPlugin()` method exposed on `sessionKeyPluginActions` extended smart account client to install the session key plugin for the connected account. -::: tip Note +:::tip[Note] When using `createModularAccountAlchemyClient` in `@alchemy/aa-alchemy`, the `SmartAccountClient` comes automatically extended with `multiOwnerPluginActions`, `pluginManagerActions`, and `accountLoupeActions` decorators as defaults available for use. ::: -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient as modularAccountClient } from "./smartAccountClient"; @@ -62,11 +50,13 @@ const { hash } = await sessionKeyExtendedClient.installSessionKeyPlugin({ await client.waitForUserOperationTransaction({ hash }); ``` -<<< @/snippets/aa-alchemy/connected-client.ts [smartAccountClient.ts] +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/connected-client.ts] +``` ::: -Refer to the [Session Key](/using-smart-accounts/session-keys/index.md) section to learn more about using the `SessionKeyPlugin`. +Refer to the [Session Key](/using-smart-accounts/session-keys/) section to learn more about using the `SessionKeyPlugin`. ### 2. Uninstalling the Session Key Plugin @@ -75,7 +65,7 @@ First, extend the `SmartAccountClient` connected to a Modular Account with `plug Then, you can use the `uninstallPlugin()` method exposed on `pluginManagerActions` extended smart account client to uninstall the session key plugin for the connected account. -::: code-group +:::code-group ```ts [example.ts] import { @@ -96,6 +86,8 @@ const { hash } = await pluginManagerExtendedClient.uninstallPlugin({ await client.waitForUserOperationTransaction({ hash }); ``` -<<< @/snippets/aa-alchemy/connected-client.ts [smartAccountClient.ts] +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/connected-client.ts] +``` ::: diff --git a/site/pages/getting-started/introduction.mdx b/site/pages/getting-started/introduction.mdx new file mode 100644 index 0000000000..1334547a8b --- /dev/null +++ b/site/pages/getting-started/introduction.mdx @@ -0,0 +1,21 @@ +--- +outline: deep +title: Getting started guide +description: Learn how to get started with Alchemy's Embedded Accounts using Account Kit and the Alchemy Signer, Modular Account, Rundler and Gas Manager. +--- + +# Quick start + +!["Embedded Accounts Banner"](/images/getting-started/embedded-accounts-banner.png) + +This guide will show you how to create Embedded Accounts using [Account Kit](https://accountkit.alchemy.com/resources/terms#account-kit), the Alchemy [Signer](https://accountkit.alchemy.com/resources/terms#signer), and the Alchemy [Modular Account](https://accountkit.alchemy.com/resources/terms#modular-account). + +:::tip[Want to test it out right away?] +Clone [this Github repo](https://github.com/alchemyplatform/embedded-accounts-quickstart) and follow the `README`. +::: + +By the end of this guide, you will have set up a basic web application where users sign up with email, silently deploy a Modular Account onchain, and send UserOperations (UOs) with zero gas using the Alchemy [Rundler](https://accountkit.alchemy.com/resources/terms#bundler) and Alchemy [Gas Manager](https://accountkit.alchemy.com/resources/terms#gas-manager). + +Here's a demo video below of the experience you'll be building! + + diff --git a/site/getting-started/log-in-users.md b/site/pages/getting-started/log-in-users.md similarity index 60% rename from site/getting-started/log-in-users.md rename to site/pages/getting-started/log-in-users.md index b2b0b8b6b1..3b16bf3ad5 100644 --- a/site/getting-started/log-in-users.md +++ b/site/pages/getting-started/log-in-users.md @@ -1,21 +1,7 @@ --- outline: deep -head: - - - meta - - property: og:title - content: Getting started guide - - - meta - - name: description - content: Learn how to get started with Alchemy's Embedded Accounts using Account Kit and the Alchemy Signer, Modular Account, Rundler and Gas Manager. - - - meta - - property: og:description - content: Learn how to get started with Alchemy's Embedded Accounts using Account Kit and the Alchemy Signer, Modular Account, Rundler and Gas Manager. - - - meta - - name: twitter:title - content: Getting started guide - - - meta - - name: twitter:description - content: Learn how to get started with Alchemy's Embedded Accounts using Account Kit and the Alchemy Signer, Modular Account, Rundler and Gas Manager. +title: Getting started guide +description: Learn how to get started with Alchemy's Embedded Accounts using Account Kit and the Alchemy Signer, Modular Account, Rundler and Gas Manager. --- # Log users into Embedded Accounts @@ -26,17 +12,21 @@ In this section of the Embedded Accounts Quickstart, you'll create your app's lo To create the user log in experience, add a `src/components` folder and create `src/components/LogInCard.tsx` with the following: -<<< @/snippets/getting-started/log-in-users/LogInCard-1.tsx [src/components/LogInCard.tsx] +```tsx [src/components/LogInCard.tsx] +// [!include ~/snippets/getting-started/log-in-users/LogInCard-1.tsx] +``` `src/components/LogInCard.tsx` creates the initial UI for your app. You'll configure the Alchemy Signer in the next step to send the user an email and authenticate them. Now, incorporate these components into your app by updating the `src/app/page.tsx` file as follows: -<<< @/snippets/getting-started/log-in-users/page-1.tsx [src/app/page.tsx] +```tsx [src/app/page.tsx] +// [!include ~/snippets/getting-started/log-in-users/page-1.tsx] +``` You've now added the UI for your app! At this point, run the application using: -::: code-group +:::code-group ```bash [npm] npm run dev @@ -54,7 +44,7 @@ pnpm run dev Your application should look like the below image! -Embedded Accounts UI +!["Embedded Accounts UI"](/images/getting-started/embedded-accounts-ui.png) In the next step, you'll add functionality to the “Log In” button to send an email to the user to authenticate them. @@ -68,17 +58,25 @@ To support email authentication using the Alchemy Signer to created Embedded Acc Your app should now contain these code files: -::: code-group +:::code-group + +```tsx [src/components/LogInCard.tsx] +// [!include ~/snippets/getting-started/log-in-users/LogInCard-2.tsx] +``` -<<< @/snippets/getting-started/log-in-users/LogInCard-2.tsx [src/components/LogInCard.tsx] -<<< @/snippets/getting-started/log-in-users/ProfileCard.tsx [src/app/components/ProfileCard.tsx] -<<< @/snippets/getting-started/log-in-users/page-2.tsx [src/app/page.tsx] +```tsx [src/components/ProfileCard.tsx] +// [!include ~/snippets/getting-started/log-in-users/ProfileCard.tsx] +``` + +```tsx [src/app/page.tsx] +// [!include ~/snippets/getting-started/log-in-users/page-2.tsx] +``` ::: You've now added the full authentication flow for users to create Embedded Accounts. At this point, run the application using: -::: code-group +:::code-group ```bash [npm] npm run dev diff --git a/site/getting-started/overview.md b/site/pages/getting-started/overview.md similarity index 91% rename from site/getting-started/overview.md rename to site/pages/getting-started/overview.md index 4d662d6a1e..038ba79d9a 100644 --- a/site/getting-started/overview.md +++ b/site/pages/getting-started/overview.md @@ -1,21 +1,7 @@ --- outline: deep -head: - - - meta - - property: og:title - content: Overview - - - meta - - name: description - content: Build Embedded Accounts with Account Kit. Build smart accounts powered by Account Abstraction (ERC-4337). - - - meta - - property: og:description - content: Learn how to build Embedded Accounts with Account Kit. Build smart accounts powered by Account Abstraction (ERC-4337). - - - meta - - name: twitter:title - content: Overview - - - meta - - name: twitter:description - content: Learn how to build Embedded Accounts with Account Kit. Build smart accounts powered by Account Abstraction (ERC-4337). +title: Overview +description: Build Embedded Accounts with Account Kit. Build smart accounts powered by Account Abstraction (ERC-4337). --- # Why Embedded Accounts? diff --git a/site/getting-started/send-uos.md b/site/pages/getting-started/send-uos.mdx similarity index 60% rename from site/getting-started/send-uos.md rename to site/pages/getting-started/send-uos.mdx index 1fd055c4a4..3282b0599a 100644 --- a/site/getting-started/send-uos.md +++ b/site/pages/getting-started/send-uos.mdx @@ -1,21 +1,7 @@ --- outline: deep -head: - - - meta - - property: og:title - content: Getting started guide - - - meta - - name: description - content: Learn how to get started with Alchemy's Embedded Accounts using Account Kit and the Alchemy Signer, Modular Account, Rundler and Gas Manager. - - - meta - - property: og:description - content: Learn how to get started with Alchemy's Embedded Accounts using Account Kit and the Alchemy Signer, Modular Account, Rundler and Gas Manager. - - - meta - - name: twitter:title - content: Getting started guide - - - meta - - name: twitter:description - content: Learn how to get started with Alchemy's Embedded Accounts using Account Kit and the Alchemy Signer, Modular Account, Rundler and Gas Manager. +title: Getting started guide +description: Learn how to get started with Alchemy's Embedded Accounts using Account Kit and the Alchemy Signer, Modular Account, Rundler and Gas Manager. --- # Send UserOperations @@ -26,17 +12,21 @@ In this last section, you will enable users to send UserOperations through their Add a new `src/components/SendUOButton.tsx` file and incorporate it onto the `src/components/ProfileCard.tsx` for authenticated users to send a UO. These files should now look as follows: -::: code-group +:::code-group -<<< @/snippets/getting-started/send-uos/ProfileCard.tsx [src/components/ProfileCard.tsx] +```tsx [src/components/ProfileCard.tsx] +// [!include ~/snippets/getting-started/send-uos/ProfileCard.tsx] +``` -<<< @/snippets/getting-started/send-uos/SendUOButton.tsx [src/components/SendUOButton.tsx] +```tsx [src/components/SendUOButton.tsx] +// [!include ~/snippets/getting-started/send-uos/SendUOButton.tsx] +``` ::: That's it! At this point, run the application using: -::: code-group +:::code-group ```bash [npm] npm run dev @@ -54,7 +44,7 @@ pnpm run dev You've now enabled users to sendUOs from their Embedded Account on your application, and the experience should look like the video below! - + Congratulations! Using Account Kit, the Alchemy Signer, and Alchemy Modular Account, you created an application that authenticates a user by email to create their Embedded Account, and then uses that account to send a UserOperation! @@ -62,6 +52,6 @@ Congratulations! Using Account Kit, the Alchemy Signer, and Alchemy Modular Acco You can do so much more with Embedded Accounts than this Quickstart guide could share! -1. To learn more about the Alchemy Signer and how to support passkey login (and eventually social login), check out the technical [docs](https://accountkit.alchemy.com/packages/aa-alchemy/signer/overview.html) for more details. +1. To learn more about the Alchemy Signer and how to support passkey login (and eventually social login), check out the technical [docs](https://accountkit.alchemy.com/packages/aa-alchemy/signer/overview) for more details. 2. To learn more about different smart account options available for your applications, check out the section **[Choosing a smart account](https://accountkit.alchemy.com/smart-accounts/)**. -3. To learn more about how to use your smart accounts and what Account Kit offers to enhance users' web3 experiences, check out a number of guides we have in the **[Using smart accounts](https://accountkit.alchemy.com/using-smart-accounts/send-user-operations.html)** section, covering from basic to advanced usages. +3. To learn more about how to use your smart accounts and what Account Kit offers to enhance users' web3 experiences, check out a number of guides we have in the **[Using smart accounts](https://accountkit.alchemy.com/using-smart-accounts/send-user-operations)** section, covering from basic to advanced usages. diff --git a/site/getting-started/setup-app.md b/site/pages/getting-started/setup-app.md similarity index 73% rename from site/getting-started/setup-app.md rename to site/pages/getting-started/setup-app.md index db20f57fb7..8b5cd64e4b 100644 --- a/site/getting-started/setup-app.md +++ b/site/pages/getting-started/setup-app.md @@ -1,21 +1,7 @@ --- outline: deep -head: - - - meta - - property: og:title - content: Getting started guide - - - meta - - name: description - content: Learn how to get started with Alchemy's Embedded Accounts using Account Kit and the Alchemy Signer, Modular Account, Rundler and Gas Manager. - - - meta - - property: og:description - content: Learn how to get started with Alchemy's Embedded Accounts using Account Kit and the Alchemy Signer, Modular Account, Rundler and Gas Manager. - - - meta - - name: twitter:title - content: Getting started guide - - - meta - - name: twitter:description - content: Learn how to get started with Alchemy's Embedded Accounts using Account Kit and the Alchemy Signer, Modular Account, Rundler and Gas Manager. +title: Getting started guide +description: Learn how to get started with Alchemy's Embedded Accounts using Account Kit and the Alchemy Signer, Modular Account, Rundler and Gas Manager. --- # Setup your application @@ -38,23 +24,23 @@ The Alchemy API Key will allow you to read and write to blockchains through Alch To create an API Key, go to https://dashboard.alchemy.com, sign up for an account, and go through the onboarding. Then on the [apps](https://dashboard.alchemy.com/apps/?a=embedded-accounts-get-started) page, click "Create new app" button. -API Key Create +![API Key Create](/images/getting-started/api-key-create.png) When configuring the Alchemy app, select Arbitrum Sepolia for the network. -API Key Configure +![API Key Configure](/images/getting-started/api-key-configure.png) Click the API Key button in the top right corner and copy-paste it into the `.env` file of your application as an environment variable called `ALCHEMY_API_KEY`. -API Key View +![API Key View](/images/getting-started/api-key-view.png) ### Alchemy Embedded Accounts Config -The Embedded Accounts Config enables [magic link authentication](https://accountkit.alchemy.com/resources/terms.html#magic-link-authentication) on your app's domain by configuring the Alchemy Signer, which securely stores the user's private key in a non-custodial [secure enclave](https://docs.turnkey.com/security/our-approach). It is responsible for authenticating a user via email or passkey using this config, managing a user's session, and signing messages to send UserOperations. Check out the [AlchemySigner docs](https://accountkit.alchemy.com/packages/aa-alchemy/signer/overview.html) for more details. +The Embedded Accounts Config enables [magic link authentication](https://accountkit.alchemy.com/resources/terms#magic-link-authentication) on your app's domain by configuring the Alchemy Signer, which securely stores the user's private key in a non-custodial [secure enclave](https://docs.turnkey.com/security/our-approach). It is responsible for authenticating a user via email or passkey using this config, managing a user's session, and signing messages to send UserOperations. Check out the [AlchemySigner docs](https://accountkit.alchemy.com/packages/aa-alchemy/signer/overview) for more details. To create an Embedded Accounts Config, go to the [embedded accounts page](https://dashboard.alchemy.com/accounts/?a=embedded-accounts-get-started) of the Alchemy dashboard and click the “New account config” button. -Accounts Config Create +![Accounts Config Create](/images/getting-started/accounts-config-create.png) Then: @@ -62,11 +48,11 @@ Then: 2. Set `http://localhost:3000` as the redirect URL. NextJS apps by default are hosted locally at port 3000, and you will want to direct the user back to the URL where your application is hosted to authenticate them. 3. [optional] Customize the logo, “Sign In” button color, and support URL of the email. -Accounts Config Configure 1 +![Accounts Config Configure 1](/images/getting-started/accounts-config-configure-1.png) Next, apply this config to the Alchemy App you created in the previous step. Doing this will allow you send requests to Alchemy Signer via the Account Kit SDKs you will install in the next step. -Accounts Config Configure 2 +![Accounts Config Configure 2](/images/getting-started/accounts-config-configure-2.png) ### Alchemy Gas Manager Policy @@ -74,7 +60,7 @@ The Gas Manager Policy defines a config for Alchemy's ERC-4337 Paymaster impleme To create a Gas Manager Policy, go to the [gas manager](https://dashboard.alchemy.com/gas-manager?a=embedded-accounts-get-started) page of the Alchemy dashboard and click the “Create new policy” button. -Gas Manager Create +![Gas Manager Create](/images/getting-started/gas-manager-create.png) Then: @@ -82,7 +68,7 @@ Then: 2. Associate the policy with the Alchemy App you created in the last step by selecting it in the “Policy details” section. 3. Select the default configurations for the remaining sections. -Gas Manager Configure +![Gas Manager Configure](/images/getting-started/gas-manager-configure.png) Once you create the policy, copy the Policy ID below the policy's header and copy-paste it into the .env file of your application as an environment variable called `NEXT_PUBLIC_ALCHEMY_GAS_MANAGER_POLICY_ID`. @@ -90,7 +76,7 @@ Once you create the policy, copy the Policy ID below the policy's header and cop In this newly created directory for your app, add the following dependencies: -::: code-group +:::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 @@ -106,7 +92,7 @@ pnpm i @alchemy/aa-alchemy @alchemy/aa-accounts @alchemy/aa-core viem@2.8.6 @tan ::: -::: warning +:::warning 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`. ::: @@ -122,11 +108,15 @@ Using your code editor, open your newly created application directory to add the From the root of NextJS project's directory, using the NextJS concept of [route handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), create new directory `src/app/api/rpc` and add two files: `src/app/api/rpc/[...routes]/route.ts` to handle calls to the Alchemy Signer, and `src/app/api/rpc/route.ts` to handle requests to Alchemy's infrastructure. Copy the following into those files. -::: code-group +:::code-group -<<< @/snippets/getting-started/setup-app/route.ts [src/app/api/rpc/route.ts] +```ts [src/app/api/rpc/route.ts] +// [!include ~/snippets/getting-started/setup-app/route.ts] +``` -<<< @/snippets/getting-started/setup-app/routes.ts [src/app/api/rpc/[...routes]/route.ts] +```ts [src/app/api/rpc/[...routes]/route.ts] +// [!include ~/snippets/getting-started/setup-app/routes.ts] +``` ::: @@ -140,13 +130,19 @@ Then, in the `src/app/layout.tsx` file that came with the NextJS boilerplate, wr These two files should look as follows: -::: code-group +:::code-group -<<< @/snippets/getting-started/setup-app/layout.tsx [src/app/layout.tsx] +```tsx [src/app/layout.tsx] +// [!include ~/snippets/getting-started/setup-app/layout.tsx] +``` -<<< @/snippets/getting-started/setup-app/providers.tsx [src/app/providers.tsx] +```tsx [src/app/providers.tsx] +// [!include ~/snippets/getting-started/setup-app/providers.tsx] +``` -<<< @/snippets/getting-started/setup-app/config.ts [src/app/config.ts] +```ts [src/app/config.ts] +// [!include ~/snippets/getting-started/setup-app/config.ts] +``` ::: diff --git a/site/pages/index.mdx b/site/pages/index.mdx new file mode 100644 index 0000000000..7e84ee8612 --- /dev/null +++ b/site/pages/index.mdx @@ -0,0 +1,170 @@ +--- +layout: landing +content: + horizontalPadding: 0px + width: 100% + verticalPadding: 0px +title: Account Kit Documentation +description: Account Kit is a vertically integrated stack for building apps that support ERC-4337 smart accounts, Signer integrations, sponsoring gas, bundlers, and an SDK. +# you can also add HTML or Markdown components below the --- line to add custom HTML or Markdown content (eg: https://github.com/wagmi-dev/viem/blob/main/site/index.md?plain=1) +--- + +
+
+
+
+
+
+
+
+ Account Kit Logo + Account Kit +
+
+
+ Account Kit + Documentation + Docs +
+
+
+ Build zero friction onboarding to web3 with Embedded Accounts! Account Kit makes it simple to embed powerful smart accounts or lightweight EOAs in your app as an embedded wallet. +
+ +
+ +```ts [gettingStarted.ts] +import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; +import { sepolia } from "@alchemy/aa-core"; + +export const smartAccountClient = await createModularAccountAlchemyClient({ + apiKey: "YOUR_API_KEY", + chain: sepolia, + signer, +}); +``` + +
+
+ +
+
+ +
+ +
diff --git a/site/packages/aa-accounts/contributing.md b/site/pages/packages/aa-accounts/contributing.md similarity index 76% rename from site/packages/aa-accounts/contributing.md rename to site/pages/packages/aa-accounts/contributing.md index 1ff19df638..80391d7766 100644 --- a/site/packages/aa-accounts/contributing.md +++ b/site/pages/packages/aa-accounts/contributing.md @@ -1,17 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Contributing to aa-accounts - - - meta - - name: description - content: How to add your own Account implementation to aa-accounts - - - meta - - property: og:description - content: How to add your own Account implementation to aa-accounts -next: - text: aa-signers +title: Contributing to aa-accounts +description: How to add your own Account implementation to aa-accounts --- # Contributing to `aa-accounts` diff --git a/site/packages/aa-accounts/index.md b/site/pages/packages/aa-accounts/index.md similarity index 62% rename from site/packages/aa-accounts/index.md rename to site/pages/packages/aa-accounts/index.md index 37523cfeea..307a53a011 100644 --- a/site/packages/aa-accounts/index.md +++ b/site/pages/packages/aa-accounts/index.md @@ -1,20 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: aa-accounts - - - meta - - name: description - content: aa-accounts landing page and getting started guide - - - meta - - property: og:description - content: aa-accounts landing page and getting started guide -prev: - text: aa-alchemy - link: /packages/aa-alchemy/index -next: - text: Light Account +title: aa-accounts +description: aa-accounts landing page and getting started guide --- # `@alchemy/aa-accounts` @@ -25,7 +11,7 @@ This package contains various implementations of the `BaseSmartContractAccount` 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"](/getting-started/introduction) docs to get started. -::: code-group +:::code-group ```bash [yarn] yarn add @alchemy/aa-accounts diff --git a/site/packages/aa-accounts/light-account/actions/transferOwnership.md b/site/pages/packages/aa-accounts/light-account/actions/transferOwnership.md similarity index 78% rename from site/packages/aa-accounts/light-account/actions/transferOwnership.md rename to site/pages/packages/aa-accounts/light-account/actions/transferOwnership.md index 6d99e575a1..c7798800e7 100644 --- a/site/packages/aa-accounts/light-account/actions/transferOwnership.md +++ b/site/pages/packages/aa-accounts/light-account/actions/transferOwnership.md @@ -1,17 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: LightSmartContractAccount • transferOwnership - - - meta - - name: description - content: Overview of the transferOwnership method on LightSmartContractAccount - - - meta - - property: og:description - content: Overview of the transferOwnership method on LightSmartContractAccount -next: - text: Utils +title: LightSmartContractAccount • transferOwnership +description: Overview of the transferOwnership method on LightSmartContractAccount --- # transferOwnership @@ -20,7 +9,7 @@ next: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./lightAccountClient"; @@ -43,7 +32,10 @@ const transferredClient = await createLightAccountClient({ }); ``` -<<< @/snippets/aa-core/lightAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-accounts/lightAccountClient.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-accounts/light-account/client.md b/site/pages/packages/aa-accounts/light-account/client.md similarity index 69% rename from site/packages/aa-accounts/light-account/client.md rename to site/pages/packages/aa-accounts/light-account/client.md index 46649a61b3..fb7e2dc5cc 100644 --- a/site/packages/aa-accounts/light-account/client.md +++ b/site/pages/packages/aa-accounts/light-account/client.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: aa-accounts • LightAccountClient - - - meta - - name: description - content: Overview of the LightAccountClient in aa-accounts - - - meta - - property: og:description - content: Overview of the LightAccountClient in aa-accounts +title: aa-accounts • LightAccountClient +description: Overview of the LightAccountClient in aa-accounts --- # createLightAccountClient @@ -18,10 +9,9 @@ head: ## Usage -::: code-group - -<<< @/snippets/aa-accounts/lightAccountClient.ts -::: +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-accounts/lightAccountClient.ts] +``` ## Returns @@ -37,6 +27,6 @@ A `Promise` containing a new `SmartAccountClient` connected to a Light Account. - `chain: Chain` -- the chain on which to create the client. -- `account`: CreateLightAccountParams -- additional parameters to pass to the [`createLightAccount`](/packages/aa-accounts/light-account/#createlightaccount). Notably, a `signer` field of type [`SmartAccountSigner`](/resources/types.html#smartaccountsigner)is required. +- `account`: CreateLightAccountParams -- additional parameters to pass to the [`createLightAccount`](/packages/aa-accounts/light-account/#createlightaccount). Notably, a `signer` field of type [`SmartAccountSigner`](/resources/types#smartaccountsigner)is required. - `...clientParams` -- [optional] additional parameters to pass to the [`SmartAccountClient`](/packages/aa-core/smart-account-client/) constructor. diff --git a/site/packages/aa-accounts/light-account/encodeTransferOwnership.md b/site/pages/packages/aa-accounts/light-account/encodeTransferOwnership.md similarity index 65% rename from site/packages/aa-accounts/light-account/encodeTransferOwnership.md rename to site/pages/packages/aa-accounts/light-account/encodeTransferOwnership.md index 72e81b50ef..3adbd99158 100644 --- a/site/packages/aa-accounts/light-account/encodeTransferOwnership.md +++ b/site/pages/packages/aa-accounts/light-account/encodeTransferOwnership.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: LightSmartContractAccount • encodeTransferOwnership - - - meta - - name: description - content: Overview of the encodeTransferOwnership method on LightSmartContractAccount - - - meta - - property: og:description - content: Overview of the encodeTransferOwnership method on LightSmartContractAccount +title: LightSmartContractAccount • encodeTransferOwnership +description: Overview of the encodeTransferOwnership method on LightSmartContractAccount --- # encodeTransferOwnership @@ -18,7 +9,7 @@ head: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -29,7 +20,10 @@ const encodedTransferOwnershipData = smartAccountClient.account.encodeTransferOwnership({ newOwner }); ``` -<<< @/snippets/aa-core/lightAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-accounts/lightAccountClient.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-accounts/light-account/getOwnerAddress.md b/site/pages/packages/aa-accounts/light-account/getOwnerAddress.md similarity index 51% rename from site/packages/aa-accounts/light-account/getOwnerAddress.md rename to site/pages/packages/aa-accounts/light-account/getOwnerAddress.md index a275fc9577..151e8ecae4 100644 --- a/site/packages/aa-accounts/light-account/getOwnerAddress.md +++ b/site/pages/packages/aa-accounts/light-account/getOwnerAddress.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: LightSmartContractAccount • getOwnerAddress - - - meta - - name: description - content: Overview of the getOwnerAddress method on LightSmartContractAccount - - - meta - - property: og:description - content: Overview of the getOwnerAddress method on LightSmartContractAccount +title: LightSmartContractAccount • getOwnerAddress +description: Overview of the getOwnerAddress method on LightSmartContractAccount --- # getOwnerAddress @@ -18,7 +9,7 @@ head: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -27,7 +18,10 @@ import { smartAccountClient } from "./smartAccountClient"; const ownerAddress = await smartAccountClient.account.getOwnerAddress(); ``` -<<< @/snippets/aa-core/lightAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-accounts/lightAccountClient.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-accounts/light-account/index.md b/site/pages/packages/aa-accounts/light-account/index.md similarity index 91% rename from site/packages/aa-accounts/light-account/index.md rename to site/pages/packages/aa-accounts/light-account/index.md index e2ae90f8f4..dbe83ef78c 100644 --- a/site/packages/aa-accounts/light-account/index.md +++ b/site/pages/packages/aa-accounts/light-account/index.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: LightAccount - - - meta - - name: description - content: Overview of the LightAccount class in aa-accounts - - - meta - - property: og:description - content: Overview of the LightAccount class in aa-accounts +title: LightAccount +description: Overview of the LightAccount class in aa-accounts --- # Light Account @@ -27,7 +18,7 @@ The additional methods supported by `LightAccount` are: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -73,7 +64,10 @@ const transferredClient = await createLightAccountClient({ }); ``` -<<< @/snippets/aa-core/lightAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-accounts/lightAccountClient.ts] +``` + ::: # createLightAccount @@ -82,7 +76,9 @@ const transferredClient = await createLightAccountClient({ ## Usage -<<< @/snippets/aa-core/lightAccountClient.ts +```ts +// [!include ~/snippets/aa-accounts/lightAccountClient.ts] +``` ## Returns @@ -100,9 +96,9 @@ A `Promise` containing a new `LightAccount`. - `signer: SmartAccountSigner` -- the signer to connect to the account with for signing user operations on behalf of the smart account. -- `entryPoint: EntryPointDef` -- [optional] the entry point contract address. If not provided, the entry point contract address for the client is the connected account's entry point contract, or if not connected, falls back to the default entry point contract for the chain. See [getDefaultEntryPointAddress](/packages/aa-core/utils/getDefaultEntryPointAddress.html#getdefaultentrypointaddress). +- `entryPoint: EntryPointDef` -- [optional] the entry point contract address. If not provided, the entry point contract address for the client is the connected account's entry point contract, or if not connected, falls back to the default entry point contract for the chain. See [getDefaultEntryPointAddress](/packages/aa-core/utils/getDefaultEntryPointAddress#getdefaultentrypointaddress). -- `factoryAddress: Address` -- [optional] the factory address for the smart account implementation, which is required for creating the account if not already deployed. Defaults to the [getDefaultLightAccountFactoryAddress](/packages/aa-accounts/utils/getDefaultLightAccountFactoryAddress.md) +- `factoryAddress: Address` -- [optional] the factory address for the smart account implementation, which is required for creating the account if not already deployed. Defaults to the [getDefaultLightAccountFactoryAddress](/packages/aa-accounts/utils/getDefaultLightAccountFactoryAddress) - `initCode: Hex` -- [optional] the initCode for deploying the smart account with which the client will connect. diff --git a/site/packages/aa-accounts/light-account/signMessageWith6492.md b/site/pages/packages/aa-accounts/light-account/signMessageWith6492.md similarity index 62% rename from site/packages/aa-accounts/light-account/signMessageWith6492.md rename to site/pages/packages/aa-accounts/light-account/signMessageWith6492.md index 9d04a8f124..595709ef1d 100644 --- a/site/packages/aa-accounts/light-account/signMessageWith6492.md +++ b/site/pages/packages/aa-accounts/light-account/signMessageWith6492.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: LightSmartContractAccount • signMessageWith6492 - - - meta - - name: description - content: Overview of the signMessageWith6492 method on LightSmartContractAccount - - - meta - - property: og:description - content: Overview of the signMessageWith6492 method on LightSmartContractAccount +title: LightSmartContractAccount • signMessageWith6492 +description: Overview of the signMessageWith6492 method on LightSmartContractAccount --- # signMessageWith6492 @@ -18,7 +9,7 @@ head: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -29,7 +20,10 @@ const signedMessageWith6492 = smartAccountClient.signMessageWith6492({ }); ``` -<<< @/snippets/aa-core/lightAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-accounts/lightAccountClient.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-accounts/light-account/signTypedData.md b/site/pages/packages/aa-accounts/light-account/signTypedData.md similarity index 77% rename from site/packages/aa-accounts/light-account/signTypedData.md rename to site/pages/packages/aa-accounts/light-account/signTypedData.md index 074686051d..2dc79d3a29 100644 --- a/site/packages/aa-accounts/light-account/signTypedData.md +++ b/site/pages/packages/aa-accounts/light-account/signTypedData.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: LightSmartContractAccount • signTypedData - - - meta - - name: description - content: Overview of the signTypedData method on LightSmartContractAccount - - - meta - - property: og:description - content: Overview of the signTypedData method on LightSmartContractAccount +title: LightSmartContractAccount • signTypedData +description: Overview of the signTypedData method on LightSmartContractAccount --- # signTypedData @@ -18,7 +9,7 @@ head: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -57,7 +48,10 @@ const signedTypedData = smartAccountClient.signTypedData({ }); ``` -<<< @/snippets/aa-core/lightAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-accounts/lightAccountClient.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-accounts/light-account/signTypedDataWith6492.md b/site/pages/packages/aa-accounts/light-account/signTypedDataWith6492.md similarity index 79% rename from site/packages/aa-accounts/light-account/signTypedDataWith6492.md rename to site/pages/packages/aa-accounts/light-account/signTypedDataWith6492.md index 19d161b5cc..74b0afdc6c 100644 --- a/site/packages/aa-accounts/light-account/signTypedDataWith6492.md +++ b/site/pages/packages/aa-accounts/light-account/signTypedDataWith6492.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: LightSmartContractAccount • signTypedDataWith6492 - - - meta - - name: description - content: Overview of the signTypedDataWith6492 method on LightSmartContractAccount - - - meta - - property: og:description - content: Overview of the signTypedDataWith6492 method on LightSmartContractAccount +title: LightSmartContractAccount • signTypedDataWith6492 +description: Overview of the signTypedDataWith6492 method on LightSmartContractAccount --- # signTypedDataWith6492 @@ -18,7 +9,7 @@ head: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -57,7 +48,10 @@ const signedTypedDataWith6492 = smartAccountClient.signTypedDataWith6492({ }); ``` -<<< @/snippets/aa-core/lightAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-accounts/lightAccountClient.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-accounts/utils/getDefaultLightAccountFactoryAddress.md b/site/pages/packages/aa-accounts/utils/getDefaultLightAccountFactoryAddress.md similarity index 58% rename from site/packages/aa-accounts/utils/getDefaultLightAccountFactoryAddress.md rename to site/pages/packages/aa-accounts/utils/getDefaultLightAccountFactoryAddress.md index 874162f526..6670aee15a 100644 --- a/site/packages/aa-accounts/utils/getDefaultLightAccountFactoryAddress.md +++ b/site/pages/packages/aa-accounts/utils/getDefaultLightAccountFactoryAddress.md @@ -1,15 +1,7 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: getDefaultLightAccountFactoryAddress - - - meta - - name: description - content: Overview of the getDefaultLightAccountFactoryAddress method in aa-accounts utils - - - meta - - property: og:description - content: Overview of the getDefaultLightAccountFactoryAddress method in aa-accounts utils +title: getDefaultLightAccountFactoryAddress +description: Overview of the getDefaultLightAccountFactoryAddress method in + aa-accounts utils --- # getDefaultLightAccountFactoryAddress @@ -18,9 +10,7 @@ Utility method that returns the default Light Account Factory contract address f ## Usage -::: code-group - -```ts [example.ts] +```ts import { sepolia } from "@alchemy/aa-core"; import { getDefaultLightAccountFactoryAddress } from "@alchemy/aa-accounts"; @@ -28,8 +18,6 @@ const chain = sepolia; const factoryAddress = getDefaultLightAccountFactoryAddress(chain); ``` -::: - ## Returns ### `Address` diff --git a/site/packages/aa-alchemy/index.md b/site/pages/packages/aa-alchemy/index.md similarity index 72% rename from site/packages/aa-alchemy/index.md rename to site/pages/packages/aa-alchemy/index.md index 0e3bad4429..bff531c779 100644 --- a/site/packages/aa-alchemy/index.md +++ b/site/pages/packages/aa-alchemy/index.md @@ -1,18 +1,7 @@ --- outline: deep -head: - - - meta - - property: og:title - content: aa-alchemy - - - meta - - name: description - content: aa-alchemy landing page and getting started guide - - - meta - - property: og:description - content: aa-alchemy landing page and getting started guide -prev: - text: aa-core - link: /packages/aa-core/index +title: aa-alchemy +description: aa-alchemy landing page and getting started guide --- # `@alchemy/aa-alchemy` @@ -23,7 +12,7 @@ This package contains the `AlchemySmartAccountClient`, an extension of the `Smar 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`, you can install it and follow the instructions in the ["Getting started"](/getting-started/introduction) docs to get started. -::: code-group +:::code-group ```bash [yarn] yarn add @alchemy/aa-alchemy @@ -40,8 +29,7 @@ pnpm i @alchemy/aa-alchemy ::: Then, you can create a client like so: -::: code-group -<<< @/snippets/aa-alchemy/base-client.ts - -::: +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/base-client.ts] +``` diff --git a/site/packages/aa-alchemy/light-account-client/index.md b/site/pages/packages/aa-alchemy/light-account-client/index.md similarity index 83% rename from site/packages/aa-alchemy/light-account-client/index.md rename to site/pages/packages/aa-alchemy/light-account-client/index.md index 0e2823b3dd..eae9723935 100644 --- a/site/packages/aa-alchemy/light-account-client/index.md +++ b/site/pages/packages/aa-alchemy/light-account-client/index.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: createLightAccountAlchemyClient - - - meta - - name: description - content: Overview of the createLightAccountAlchemyClient factory in aa-alchemy - - - meta - - property: og:description - content: Overview of the createLightAccountAlchemyClient factory in aa-alchemy +title: createLightAccountAlchemyClient +description: Overview of the createLightAccountAlchemyClient factory in aa-alchemy --- # createLightAccountAlchemyClient @@ -18,10 +9,9 @@ head: ## Usage -::: code-group - -<<< @/snippets/aa-alchemy/light-account-client.ts -::: +```ts [lightAccountClient.ts] +// [!include ~/snippets/aa-alchemy/light-account-client.ts] +``` ## Returns diff --git a/site/packages/aa-alchemy/middleware/alchemyFeeEstimator.md b/site/pages/packages/aa-alchemy/middleware/alchemyFeeEstimator.md similarity index 74% rename from site/packages/aa-alchemy/middleware/alchemyFeeEstimator.md rename to site/pages/packages/aa-alchemy/middleware/alchemyFeeEstimator.md index e072005bd3..aa56a14632 100644 --- a/site/packages/aa-alchemy/middleware/alchemyFeeEstimator.md +++ b/site/pages/packages/aa-alchemy/middleware/alchemyFeeEstimator.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Middleware • alchemyFeeEstimator - - - meta - - name: description - content: Overview of the alchemyFeeEstimator method in aa-alchemy - - - meta - - property: og:description - content: Overview of the alchemyFeeEstimator method in aa-alchemy +title: Middleware • alchemyFeeEstimator +description: Overview of the alchemyFeeEstimator method in aa-alchemy --- # alchemyFeeEstimator @@ -18,8 +9,6 @@ head: ## Usage -::: code-group - ```ts [example.ts] import { alchemyFeeEstimator, @@ -41,8 +30,6 @@ const clientWithGasFeeEstimator = createSmartAccountClient({ }); ``` -::: - ## Returns ### `ClientMiddlewareFn` diff --git a/site/packages/aa-alchemy/middleware/alchemyGasManagerMiddleware.md b/site/pages/packages/aa-alchemy/middleware/alchemyGasManagerMiddleware.md similarity index 83% rename from site/packages/aa-alchemy/middleware/alchemyGasManagerMiddleware.md rename to site/pages/packages/aa-alchemy/middleware/alchemyGasManagerMiddleware.md index e06b71f292..6e150db696 100644 --- a/site/packages/aa-alchemy/middleware/alchemyGasManagerMiddleware.md +++ b/site/pages/packages/aa-alchemy/middleware/alchemyGasManagerMiddleware.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Middleware • alchemyGasManagerMiddleware - - - meta - - name: description - content: Overview of the alchemyGasManagerMiddleware method in aa-alchemy - - - meta - - property: og:description - content: Overview of the alchemyGasManagerMiddleware method in aa-alchemy +title: Middleware • alchemyGasManagerMiddleware +description: Overview of the alchemyGasManagerMiddleware method in aa-alchemy --- # alchemyGasManagerMiddleware @@ -18,8 +9,6 @@ head: ## Usage -::: code-group - ```ts [example.ts] import { alchemyGasManagerMiddleware, @@ -43,8 +32,6 @@ const clientAlchemyGasManager = createSmartAccountClient({ }); ``` -::: - ## Returns ### `Pick` diff --git a/site/packages/aa-alchemy/middleware/alchemyUserOperationSimulator.md b/site/pages/packages/aa-alchemy/middleware/alchemyUserOperationSimulator.md similarity index 76% rename from site/packages/aa-alchemy/middleware/alchemyUserOperationSimulator.md rename to site/pages/packages/aa-alchemy/middleware/alchemyUserOperationSimulator.md index bb21be09d1..a76e3a832f 100644 --- a/site/packages/aa-alchemy/middleware/alchemyUserOperationSimulator.md +++ b/site/pages/packages/aa-alchemy/middleware/alchemyUserOperationSimulator.md @@ -1,17 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Middleware • alchemyUserOperationSimulator - - - meta - - name: description - content: Overview of the alchemyUserOperationSimulator method in aa-alchemy - - - meta - - property: og:description - content: Overview of the alchemyUserOperationSimulator method in aa-alchemy -next: - text: Utils +title: Middleware • alchemyUserOperationSimulator +description: Overview of the alchemyUserOperationSimulator method in aa-alchemy --- # alchemyUserOperationSimulator @@ -20,8 +9,6 @@ next: ## Usage -::: code-group - ```ts [example.ts] import { alchemyUserOperationSimulator, @@ -43,8 +30,6 @@ const clientWithUserOpSimulator = createSmartAccountClient({ }); ``` -::: - ## Returns ### `ClientMiddlewareFn` diff --git a/site/packages/aa-alchemy/modular-account-client/multisig-account-client.md b/site/pages/packages/aa-alchemy/modular-account-client/multisig-account-client.md similarity index 90% rename from site/packages/aa-alchemy/modular-account-client/multisig-account-client.md rename to site/pages/packages/aa-alchemy/modular-account-client/multisig-account-client.md index 9d135e5e02..f69ff2ce33 100644 --- a/site/packages/aa-alchemy/modular-account-client/multisig-account-client.md +++ b/site/pages/packages/aa-alchemy/modular-account-client/multisig-account-client.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: createMultisigAccountAlchemyClient - - - meta - - name: description - content: Overview of the createMultisigAccountAlchemyClient factory in aa-alchemy - - - meta - - property: og:description - content: Overview of the createMultisigAccountAlchemyClient factory in aa-alchemy +title: createMultisigAccountAlchemyClient +description: Overview of the createMultisigAccountAlchemyClient factory in aa-alchemy --- # createMultisigAccountAlchemyClient @@ -81,7 +72,7 @@ A `Promise` containing a new `AlchemySmartAccountClient` connected to a Modular - `owners: Address[]` -- [optional] the addresses of the owners of the multisig account. - `accountAddress: Address` -- [optional] a smart account address override that this object will manage instead of generating its own. - `initCode: Hex` -- [optional] the initCode for deploying the smart account with which the client will connect. - - `entryPoint: EntryPointDef` -- [optional] the entry point contract address. If not provided, the entry point contract address for the client is the connected account's entry point contract, or if not connected, falls back to the default entry point contract for the chain. See [getDefaultEntryPointAddress](/packages/aa-core/utils/getDefaultEntryPointAddress.html#getdefaultentrypointaddress). + - `entryPoint: EntryPointDef` -- [optional] the entry point contract address. If not provided, the entry point contract address for the client is the connected account's entry point contract, or if not connected, falls back to the default entry point contract for the chain. See [getDefaultEntryPointAddress](/packages/aa-core/utils/getDefaultEntryPointAddress#getdefaultentrypointaddress). - `factoryAddress: Address` -- [optional] the factory address for the smart account implementation, which is required for creating the account if not already deployed. Defaults to the modular account multisig factory address. - `salt: bigint` -- [optional] a value that is added to the address calculation to allow for multiple accounts for the same signer (owner). The default value supplied is `0n`. diff --git a/site/pages/packages/aa-alchemy/signer/addPasskey.md b/site/pages/packages/aa-alchemy/signer/addPasskey.md new file mode 100644 index 0000000000..717c03428e --- /dev/null +++ b/site/pages/packages/aa-alchemy/signer/addPasskey.md @@ -0,0 +1,36 @@ +--- +title: Alchemy Signer • addPasskey +description: Learn how to use the AlchemySigner.addPasskey method +--- + +# addPasskey + +The `addPasskey` method is used to add a passkey as an auth method to an already logged in user. + +:::warning +This method throws if there is no authenticated user. +::: + +## Usage + +:::code-group + +```ts [example.ts] +import { signer } from "./signer"; + +await signer.addPasskey(); +``` + +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` + +::: + +## Returns + +`Promise` -- on success returns an array of credential ids + +## Parameters + +`params?: CredentialCreationOptions` -- overrides for the WebAuthn credential creation options. For more info on the `CredentialCreationOptions` interface, see [here](https://microsoft.github.io/PowerBI-JavaScript/interfaces/_node_modules_typedoc_node_modules_typescript_lib_lib_dom_d_.credentialcreationoptions). diff --git a/site/packages/aa-alchemy/signer/authenticate.md b/site/pages/packages/aa-alchemy/signer/authenticate.md similarity index 69% rename from site/packages/aa-alchemy/signer/authenticate.md rename to site/pages/packages/aa-alchemy/signer/authenticate.md index 7c58179e47..5f12990a60 100644 --- a/site/packages/aa-alchemy/signer/authenticate.md +++ b/site/pages/packages/aa-alchemy/signer/authenticate.md @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Alchemy Signer • authenticate - - - meta - - name: description - content: Learn how to use the AlchemySigner.authenticate method - - - meta - - property: og:description - content: Learn how to use the AlchemySigner.authenticate method - - - meta - - name: twitter:title - content: Alchemy Signer • authenticate - - - meta - - name: twitter:description - content: Learn how to use the AlchemySigner.authenticate method +title: Alchemy Signer • authenticate +description: Learn how to use the AlchemySigner.authenticate method --- # authenticate @@ -24,9 +9,9 @@ The `authenticate` method is used to authenticate a user with the Alchemy Signer ## Usage -::: code-group +:::code-group -```ts +```ts [example.ts] import { signer } from "./signer"; // init the email auth flow @@ -47,7 +32,9 @@ const user = await signer.authenticate({ }); ``` -<<< @/snippets/signers/alchemy/signer.ts +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` ::: diff --git a/site/pages/packages/aa-alchemy/signer/disconnect.md b/site/pages/packages/aa-alchemy/signer/disconnect.md new file mode 100644 index 0000000000..2808278731 --- /dev/null +++ b/site/pages/packages/aa-alchemy/signer/disconnect.md @@ -0,0 +1,24 @@ +--- +title: Alchemy Signer • disconnect +description: Learn how to use the AlchemySigner.disconnect method +--- + +# disconnect + +The `disconnect` method is used to disconnect a user from the Alchemy Signer and clear the local session. + +## Usage + +:::code-group + +```ts [example.ts] +import { signer } from "./signer"; + +await signer.disconnect(); +``` + +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` + +::: diff --git a/site/packages/aa-alchemy/signer/exportWallet.md b/site/pages/packages/aa-alchemy/signer/exportWallet.md similarity index 57% rename from site/packages/aa-alchemy/signer/exportWallet.md rename to site/pages/packages/aa-alchemy/signer/exportWallet.md index 9aa8ad2feb..44e5152451 100644 --- a/site/packages/aa-alchemy/signer/exportWallet.md +++ b/site/pages/packages/aa-alchemy/signer/exportWallet.md @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Alchemy Signer • exportWallet - - - meta - - name: description - content: Learn how to use the AlchemySigner.exportWallet method - - - meta - - property: og:description - content: Learn how to use the AlchemySigner.exportWallet method - - - meta - - name: twitter:title - content: Alchemy Signer • exportWallet - - - meta - - name: twitter:description - content: Learn how to use the AlchemySigner.exportWallet method +title: Alchemy Signer • exportWallet +description: Learn how to use the AlchemySigner.exportWallet method --- # exportWallet @@ -25,15 +10,15 @@ The `exportWallet` method is used to export the user's private key or seed phras If the user is authenticated with an Email, this will return a seed phrase If the user is authenticated with a Passkey, this will return a private key -::: warning +:::warning This method throws if there is no authenticated user. ::: ## Usage -::: code-group +:::code-group -```ts +```ts [example.ts] import { signer } from "./signer"; await signer.exportWallet({ @@ -41,7 +26,9 @@ await signer.exportWallet({ }); ``` -<<< @/snippets/signers/alchemy/signer.ts +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` ::: diff --git a/site/pages/packages/aa-alchemy/signer/getAddress.md b/site/pages/packages/aa-alchemy/signer/getAddress.md new file mode 100644 index 0000000000..98030ad8ef --- /dev/null +++ b/site/pages/packages/aa-alchemy/signer/getAddress.md @@ -0,0 +1,32 @@ +--- +title: Alchemy Signer • getAddress +description: Learn how to use the AlchemySigner.getAddress method +--- + +# getAddress + +Returns the signer's public address. + +:::warning +This method throws if there is no authenticated user. +::: + +## Usage + +:::code-group + +```ts [example.ts] +import { signer } from "./signer"; + +const address = await signer.getAddress(); +``` + +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` + +::: + +## Returns + +`Promise
` -- on success returns the signer's public address. diff --git a/site/pages/packages/aa-alchemy/signer/getAuthDetails.md b/site/pages/packages/aa-alchemy/signer/getAuthDetails.md new file mode 100644 index 0000000000..544c5ec0bc --- /dev/null +++ b/site/pages/packages/aa-alchemy/signer/getAuthDetails.md @@ -0,0 +1,32 @@ +--- +title: Alchemy Signer • getAuthDetails +description: Learn how to use the AlchemySigner.getAuthDetails method +--- + +# getAuthDetails + +The `getAuthDetails` method is used to get the details of the currently authenticated user. This method will also use session storage to get the user's details if they are already authenticated. + +:::warning +This method throws if there is no authenticated user. +::: + +## Usage + +:::code-group + +```ts [example.ts] +import { signer } from "./signer"; + +const user = await signer.getAuthDetails(); +``` + +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` + +::: + +## Returns + +`Promise` -- on success returns a `User` object representing the authenticated user. diff --git a/site/pages/packages/aa-alchemy/signer/getUser.md b/site/pages/packages/aa-alchemy/signer/getUser.md new file mode 100644 index 0000000000..2237f827f2 --- /dev/null +++ b/site/pages/packages/aa-alchemy/signer/getUser.md @@ -0,0 +1,28 @@ +--- +title: Alchemy Signer • getUser +description: Learn how to use the AlchemySigner.getUser method +--- + +# getUser + +The `getUser` method is used to look up if a user already exists for a given email address + +## Usage + +:::code-group + +```ts [example.ts] +import { signer } from "./signer"; + +const result = await signer.getUser("moldy@email.com"); +``` + +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` + +::: + +## Returns + +`Promise<{orgId: string} | null>` -- if a user exists, this will return an object with the orgId of the user. If no user exists, this will return `null`. diff --git a/site/packages/aa-alchemy/signer/overview.md b/site/pages/packages/aa-alchemy/signer/overview.md similarity index 84% rename from site/packages/aa-alchemy/signer/overview.md rename to site/pages/packages/aa-alchemy/signer/overview.md index d5d3b3e9b3..fad9018757 100644 --- a/site/packages/aa-alchemy/signer/overview.md +++ b/site/pages/packages/aa-alchemy/signer/overview.md @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Alchemy Signer • Overview - - - meta - - name: description - content: Learn how to get started with the Alchemy Signer - - - meta - - property: og:description - content: Learn how to get started with the Alchemy Signer - - - meta - - name: twitter:title - content: Alchemy Signer - - - meta - - name: twitter:description - content: Learn how to get started with the Alchemy Signer +title: Alchemy Signer • Overview +description: Learn how to get started with the Alchemy Signer --- # AlchemySigner @@ -26,15 +11,17 @@ The Alchemy Signer is a `SmartAccountSigner` that is powered by Alchemy's Signer Once you have enabled the Alchemy Signer in the [dashboard](https://dashboard.alchemy.com/accounts?a=account-kit-docs), getting started is really simple. Install the `@alchemy/aa-alchemy` package and initialize your signer: -<<< @/snippets/signers/alchemy/signer.ts +```ts +// [!include ~/snippets/signers/alchemy/signer.ts] +``` ### Using the Signer with Smart Contract Accounts Once your signer is authenticated with a user, you can use it to sign User Operations by creating a `SmartContractAccount` and passing the signer to it. For example: -::: code-group +:::code-group -```ts +```ts [example.ts] import { signer } from "./signer"; export const account = await createMultiOwnerModularAccount({ @@ -44,12 +31,15 @@ export const account = await createMultiOwnerModularAccount({ }); ``` -<<< @/snippets/signers/alchemy/signer.ts +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` + ::: ### Using the Signer as an EOA -::: warning +:::warning Note that EOA wallets will not have access to smart account features like gas sponsorship, batched transactions, multi-owner, or plugins. If you want to switch from EOA to smart accounts later, then each user will need to transfer their assets from the EOA account to a new smart account. It is not currently possible to "upgrade" an EOA to a smart contract account, although the community is discussing potential [EIPs](https://eips.ethereum.org/EIPS/eip-7377) to do that in the future. ::: @@ -57,9 +47,9 @@ Because the Alchemy Signer has its own `address` and supports signing messages a If you are using viem, then you can use the `toViemAccount` method which will allow you to use the signer with a [`WalletClient`](https://viem.sh/docs/clients/wallet#local-accounts-private-key-mnemonic-etc). -::: code-group +:::code-group -```ts +```ts [walletClient.ts] import { signer } from "./signer"; import { createWalletClient, http } from "viem"; import { sepolia } from "@alchemy/aa-core"; @@ -71,7 +61,10 @@ export const walletClient = createWalletClient({ }); ``` -<<< @/snippets/signers/alchemy/signer.ts +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` + ::: ## Returns diff --git a/site/pages/packages/aa-alchemy/signer/signMessage.md b/site/pages/packages/aa-alchemy/signer/signMessage.md new file mode 100644 index 0000000000..e4982e7081 --- /dev/null +++ b/site/pages/packages/aa-alchemy/signer/signMessage.md @@ -0,0 +1,37 @@ +--- +title: Alchemy Signer • signMessage +description: Learn how to use the AlchemySigner.signMessage method +--- + +# signMessage + +The `signMessage` method is used to sign a message with the Alchemy Signer. + +:::warning +This method throws if there is no authenticated user. +::: + +## Usage + +:::code-group + +```ts [example.ts] +import { signer } from "./signer"; + +const message = "Hello, world!"; +const signature = await signer.signMessage(message); +``` + +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` + +::: + +## Returns + +`Promise` -- on success returns the signature of the message. + +## Parameters + +`message: string | Uint8Array` -- the message to sign diff --git a/site/pages/packages/aa-alchemy/signer/signTransaction.md b/site/pages/packages/aa-alchemy/signer/signTransaction.md new file mode 100644 index 0000000000..232d82699c --- /dev/null +++ b/site/pages/packages/aa-alchemy/signer/signTransaction.md @@ -0,0 +1,37 @@ +--- +title: Alchemy Signer • signTransaction +description: Learn how to use the AlchemySigner.signTransaction method +--- + +# signTransaction + +The `signTransaction` method is used to sign transactions with the Alchemy Signer when using the Signer as an EOA. + +:::warning +This method throws if there is no authenticated user. +::: + +## Usage + +:::code-group + +```ts [example.ts] +import { signer } from "./signer"; + +const tx = {...}; +const signature = await signer.signTransaction(tx); +``` + +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` + +::: + +## Returns + +`Promise` -- on success returns the signed Transaction. + +## Parameters + +`tx: TransactionSerializable` -- the transaction to sign diff --git a/site/pages/packages/aa-alchemy/signer/signTypedData.md b/site/pages/packages/aa-alchemy/signer/signTypedData.md new file mode 100644 index 0000000000..cb0a494031 --- /dev/null +++ b/site/pages/packages/aa-alchemy/signer/signTypedData.md @@ -0,0 +1,36 @@ +--- +title: Alchemy Signer • signTypedData +description: Learn how to use the AlchemySigner.signTypedData method +--- + +# signTypedData + +The `signTypedData` method is used to sign typed data with the Alchemy Signer. + +:::warning +This method throws if there is no authenticated user. +::: + +## Usage + +:::code-group + +```ts [example.ts] +import { signer } from "./signer"; + +const signature = await signer.signTypedData(typedDataParams); +``` + +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` + +::: + +## Returns + +`Promise` -- on success returns the signature of the message. + +## Parameters + +`params: TypedDataDefinition` -- the typed data definition of the message you want to sign diff --git a/site/pages/packages/aa-alchemy/signer/toViemAccount.md b/site/pages/packages/aa-alchemy/signer/toViemAccount.md new file mode 100644 index 0000000000..c9b72f3ce9 --- /dev/null +++ b/site/pages/packages/aa-alchemy/signer/toViemAccount.md @@ -0,0 +1,32 @@ +--- +title: Alchemy Signer • toViemAccount +description: Learn how to use the AlchemySigner.toViemAccount method +--- + +# toViemAccount + +The `toViemAccount` method is used to adapt the AlchemySigner into a viem [`WalletClient`](https://viem.sh/docs/clients/wallet#local-accounts-private-key-mnemonic-etc) compatible `LocalAccoun`. This is particularly useful if you are already using viem and want to use the signer as an EOA. + +:::warning +This method throws if there is no authenticated user. +::: + +## Usage + +:::code-group + +```ts [example.ts] +import { signer } from "./signer"; + +const account = signer.toViemAccount(); +``` + +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` + +::: + +## Returns + +`LocalAccount` -- on success returns a viem `LocalAccount`. diff --git a/site/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md b/site/pages/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md similarity index 75% rename from site/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md rename to site/pages/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md index 5d10412a91..8824430461 100644 --- a/site/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md +++ b/site/pages/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md @@ -1,24 +1,14 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: alchemyEnhancedApiActions - - - meta - - name: description - content: Overview of the alchemyEnhancedApiActions method on Alchemy Smart Account Client in aa-alchemy - - - meta - - property: og:description - content: Overview of the alchemyEnhancedApiActions method on Alchemy Smart Account Client in aa-alchemy -next: - text: Middleware +title: alchemyEnhancedApiActions +description: Overview of the alchemyEnhancedApiActions method on Alchemy Smart + Account Client in aa-alchemy --- # alchemyEnhancedApiActions `alchemyEnhancedApiActions` is a decorator that can be used with a `AlchemySmartAccountClient` that will extend the client with methods that access the Alchemy [Enhanced APIs](https://www.alchemy.com/enhanced-apis/?a=ak-docs) via the [Alchemy SDK](https://github.com/alchemyplatform/alchemy-sdk-js). -:::tip Note +:::tip[Note] This method requires an optional dependency on the [`alchemy-sdk`](https://github.com/alchemyplatform/alchemy-sdk-js) package, as the input to this method is an Alchemy SDK client. The Alchemy SDK client must be configured with the same API key and network as the `AlchemySmartAccountClient`. This method validates such at runtime. @@ -28,7 +18,7 @@ Additionally, since the Alchemy SDK client does not yet support JWT authenticati ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./base-client.ts"; @@ -43,7 +33,10 @@ const clientWithEnhancedApis = smartAccountClient.extend( ); ``` -<<< @/snippets/aa-alchemy/base-client.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/base-client.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-alchemy/smart-account-client/actions/simulateUserOperation.md b/site/pages/packages/aa-alchemy/smart-account-client/actions/simulateUserOperation.md similarity index 80% rename from site/packages/aa-alchemy/smart-account-client/actions/simulateUserOperation.md rename to site/pages/packages/aa-alchemy/smart-account-client/actions/simulateUserOperation.md index f4068e6093..c57744711e 100644 --- a/site/packages/aa-alchemy/smart-account-client/actions/simulateUserOperation.md +++ b/site/pages/packages/aa-alchemy/smart-account-client/actions/simulateUserOperation.md @@ -1,15 +1,7 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: AlchemySmartAccountClient • simulateUserOperation - - - meta - - name: description - content: Overview of the simulateUserOperation method on Alchemy Smart Account Client in aa-alchemy - - - meta - - property: og:description - content: Overview of the simulateUserOperation method on Alchemy Smart Account Client in aa-alchemy +title: AlchemySmartAccountClient • simulateUserOperation +description: Overview of the simulateUserOperation method on Alchemy Smart + Account Client in aa-alchemy --- # simulateUserOperation @@ -18,7 +10,7 @@ head: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./base-client.ts"; @@ -41,7 +33,10 @@ if (uoSimResult.error) { const uo = await smartAccountClient.sendUserOperation({ uo: uoStruct }); ``` -<<< @/snippets/aa-alchemy/connected-client.ts +```ts [base-client.ts] +// [!include ~/snippets/aa-alchemy/connected-client.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-alchemy/smart-account-client/index.md b/site/pages/packages/aa-alchemy/smart-account-client/index.md similarity index 89% rename from site/packages/aa-alchemy/smart-account-client/index.md rename to site/pages/packages/aa-alchemy/smart-account-client/index.md index 7643269a2f..ee8f8c647c 100644 --- a/site/packages/aa-alchemy/smart-account-client/index.md +++ b/site/pages/packages/aa-alchemy/smart-account-client/index.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Alchemy Smart Account Client - - - meta - - name: description - content: Overview of the Alchemy Smart Account Client in aa-alchemy - - - meta - - property: og:description - content: Overview of the Alchemy Smart Account Client in aa-alchemy +title: Alchemy Smart Account Client +description: Overview of the Alchemy Smart Account Client in aa-alchemy --- # Alchemy Smart Account Client @@ -18,8 +9,6 @@ To create an `AlchemySmartAccountClient`, you must provide a set of parameters d ## Usage -::: code-group - ```ts [example.ts] import { createAlchemySmartAccountClient } from "@alchemy/aa-alchemy"; import { getDefaultEntryPointAddress } from "@alchemy/aa-core"; @@ -51,8 +40,6 @@ export const client = createAlchemySmartAccountClient({ }); ``` -::: - ## Returns ### `AlchemySmartAccountClient` diff --git a/site/packages/aa-alchemy/utils/defineAlchemyChain.md b/site/pages/packages/aa-alchemy/utils/defineAlchemyChain.md similarity index 67% rename from site/packages/aa-alchemy/utils/defineAlchemyChain.md rename to site/pages/packages/aa-alchemy/utils/defineAlchemyChain.md index f00c34596a..c61ef6d03f 100644 --- a/site/packages/aa-alchemy/utils/defineAlchemyChain.md +++ b/site/pages/packages/aa-alchemy/utils/defineAlchemyChain.md @@ -1,17 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Utils • SupportedChains - - - meta - - name: description - content: Overview of the SupportedChains util method in aa-alchemy - - - meta - - property: og:description - content: Overview of the SupportedChains util method in aa-alchemy -next: - text: aa-accounts +title: Utils • SupportedChains +description: Overview of the SupportedChains util method in aa-alchemy --- # defineAlchemyChain @@ -20,7 +9,7 @@ next: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { defineAlchemyChain } from "@alchemy/aa-alchemy"; diff --git a/site/pages/packages/aa-core/accounts/index.md b/site/pages/packages/aa-core/accounts/index.md new file mode 100644 index 0000000000..6bcabcf804 --- /dev/null +++ b/site/pages/packages/aa-core/accounts/index.md @@ -0,0 +1,47 @@ +--- +title: SmartContractAccount +description: Overview of SmartContractAccount exported by aa-core +--- + +# SmartContractAccount + +The `SmartContractAccount` interface is an extension of viem's [`CustomAccount`](https://viem.sh/docs/accounts/custom) with additional methods used for Account Abstraction. It is meant to be used in conjunction with a [`SmartAccountClient`](/packages/aa-core/smart-account-client/). + +## Custom Smart Contract Accounts + +If you have your own smart contract that you would like to interact with, then you can use the `toSmartContractAccount` method to create a `SmartContractAccount` instance. + +### Usage + +```ts [my-account.ts] +// [!include ~/snippets/aa-core/custom-account.ts] +``` + +### Returns + +#### `SmartContractAccount` + +```ts +export type SmartContractAccount = + LocalAccount & { + source: Name; + getDummySignature: () => Hex | Promise; + encodeExecute: (tx: Tx) => Promise; + encodeBatchExecute: (txs: Tx[]) => Promise; + signUserOperationHash: (uoHash: Hex) => Promise; + signMessageWith6492: (params: { message: SignableMessage }) => Promise; + signTypedDataWith6492: < + const typedData extends TypedData | Record, + primaryType extends keyof typedData | "EIP712Domain" = keyof typedData + >( + typedDataDefinition: TypedDataDefinition + ) => Promise; + encodeUpgradeToAndCall: (params: UpgradeToAndCallParams) => Promise; + getNonce(): Promise; + getInitCode: () => Promise; + isAccountDeployed: () => Promise; + getFactoryAddress: () => Address; + getEntryPoint: () => Address; + getImplementationAddress: () => Promise; + }; +``` diff --git a/site/packages/aa-core/bundler-client/actions/bundlerActions.md b/site/pages/packages/aa-core/bundler-client/actions/bundlerActions.md similarity index 66% rename from site/packages/aa-core/bundler-client/actions/bundlerActions.md rename to site/pages/packages/aa-core/bundler-client/actions/bundlerActions.md index 04744079b2..4b2d793080 100644 --- a/site/packages/aa-core/bundler-client/actions/bundlerActions.md +++ b/site/pages/packages/aa-core/bundler-client/actions/bundlerActions.md @@ -1,17 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: bundlerActions - - - meta - - name: description - content: Overview of the bundlerActions method in aa-core client - - - meta - - property: og:description - content: Overview of the bundlerActions method in aa-core client -next: - text: Utils +title: bundlerActions +description: Overview of the bundlerActions method in aa-core client --- # bundlerActions @@ -20,7 +9,7 @@ Allows you to extend a viem `Client` with the new 4337 methods. ## Usage -::: code-group +:::code-group ```ts [example.ts] import { bundlerActions } from "@alchemy/aa-core"; diff --git a/site/packages/aa-core/bundler-client/actions/estimateUserOperationGas.md b/site/pages/packages/aa-core/bundler-client/actions/estimateUserOperationGas.md similarity index 82% rename from site/packages/aa-core/bundler-client/actions/estimateUserOperationGas.md rename to site/pages/packages/aa-core/bundler-client/actions/estimateUserOperationGas.md index d70bd9df7a..608f6886ac 100644 --- a/site/packages/aa-core/bundler-client/actions/estimateUserOperationGas.md +++ b/site/pages/packages/aa-core/bundler-client/actions/estimateUserOperationGas.md @@ -1,28 +1,19 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: estimateUserOperationGas - - - meta - - name: description - content: Overview of the estimateUserOperationGas action available on the BundlerClient - - - meta - - property: og:description - content: Overview of the estimateUserOperationGas action available on the BundlerClient +title: estimateUserOperationGas +description: Overview of the estimateUserOperationGas action available on the BundlerClient --- # estimateUserOperationGas Calls `eth_estimateUserOperationGas` and returns the result. -::: tip Note +:::tip[Note] It is recommended to use [`estimateUserOperationGas`](/packages/aa-core/smart-account-client/actions/estimateUserOperationGas) `SmartAccountClientAction` for user operation gas estimation. The smart account client action provides much simpler interface than directly calling the raw bundler actions. ::: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { client } from "./client"; diff --git a/site/packages/aa-core/bundler-client/actions/getSupportedEntryPoints.md b/site/pages/packages/aa-core/bundler-client/actions/getSupportedEntryPoints.md similarity index 51% rename from site/packages/aa-core/bundler-client/actions/getSupportedEntryPoints.md rename to site/pages/packages/aa-core/bundler-client/actions/getSupportedEntryPoints.md index fe63f6feb5..7cd4c74838 100644 --- a/site/packages/aa-core/bundler-client/actions/getSupportedEntryPoints.md +++ b/site/pages/packages/aa-core/bundler-client/actions/getSupportedEntryPoints.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: getSupportedEntryPoints - - - meta - - name: description - content: Overview of the getSupportedEntryPoints action available on the BundlerClient - - - meta - - property: og:description - content: Overview of the getSupportedEntryPoints action available on the BundlerClient +title: getSupportedEntryPoints +description: Overview of the getSupportedEntryPoints action available on the BundlerClient --- # getSupportedEntryPoints @@ -18,7 +9,7 @@ calls `eth_supportedEntryPoints` and returns the entry points the RPC supports ## Usage -::: code-group +:::code-group ```ts [example.ts] import { client } from "./client"; diff --git a/site/packages/aa-core/bundler-client/actions/getUserOperationByHash.md b/site/pages/packages/aa-core/bundler-client/actions/getUserOperationByHash.md similarity index 56% rename from site/packages/aa-core/bundler-client/actions/getUserOperationByHash.md rename to site/pages/packages/aa-core/bundler-client/actions/getUserOperationByHash.md index 5ee802ce3e..a6faeb1263 100644 --- a/site/packages/aa-core/bundler-client/actions/getUserOperationByHash.md +++ b/site/pages/packages/aa-core/bundler-client/actions/getUserOperationByHash.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: getUserOperationByHash - - - meta - - name: description - content: Overview of the getUserOperationByHash action available on the BundlerClient - - - meta - - property: og:description - content: Overview of the getUserOperationByHash action available on the BundlerClient +title: getUserOperationByHash +description: Overview of the getUserOperationByHash action available on the BundlerClient --- # getUserOperationByHash @@ -18,7 +9,7 @@ calls `eth_getUserOperationByHash` and returns the `UserOperationResponse` if fo ## Usage -::: code-group +:::code-group ```ts [example.ts] import { client } from "./client"; diff --git a/site/packages/aa-core/bundler-client/actions/getUserOperationReceipt.md b/site/pages/packages/aa-core/bundler-client/actions/getUserOperationReceipt.md similarity index 57% rename from site/packages/aa-core/bundler-client/actions/getUserOperationReceipt.md rename to site/pages/packages/aa-core/bundler-client/actions/getUserOperationReceipt.md index 2d33cb8703..56e93319de 100644 --- a/site/packages/aa-core/bundler-client/actions/getUserOperationReceipt.md +++ b/site/pages/packages/aa-core/bundler-client/actions/getUserOperationReceipt.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: getUserOperationReceipt - - - meta - - name: description - content: Overview of the getUserOperationReceipt action available on the BundlerClient - - - meta - - property: og:description - content: Overview of the getUserOperationReceipt action available on the BundlerClient +title: getUserOperationReceipt +description: Overview of the getUserOperationReceipt action available on the BundlerClient --- # getUserOperationReceipt @@ -18,7 +9,7 @@ calls `eth_getUserOperationReceipt` and returns `UserOperationReceipt` if found ## Usage -::: code-group +:::code-group ```ts [example.ts] import { client } from "./client"; diff --git a/site/packages/aa-core/bundler-client/actions/sendRawUserOperation.md b/site/pages/packages/aa-core/bundler-client/actions/sendRawUserOperation.md similarity index 59% rename from site/packages/aa-core/bundler-client/actions/sendRawUserOperation.md rename to site/pages/packages/aa-core/bundler-client/actions/sendRawUserOperation.md index a16e475597..c1d1d2eb82 100644 --- a/site/packages/aa-core/bundler-client/actions/sendRawUserOperation.md +++ b/site/pages/packages/aa-core/bundler-client/actions/sendRawUserOperation.md @@ -1,17 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: sendRawUserOperation - - - meta - - name: description - content: Overview of the sendRawUserOperation action available on the BundlerClient - - - meta - - property: og:description - content: Overview of the sendRawUserOperation action available on the BundlerClient -prev: - text: Public ERC-4337 Client +title: sendRawUserOperation +description: Overview of the sendRawUserOperation action available on the BundlerClient --- # sendRawUserOperation @@ -20,7 +9,7 @@ Calls `eth_sendUserOperation` and returns the hash of the sent `UserOperation` ( ## Usage -::: code-group +:::code-group ```ts [example.ts] import { client } from "./client"; diff --git a/site/packages/aa-core/bundler-client/index.md b/site/pages/packages/aa-core/bundler-client/index.md similarity index 90% rename from site/packages/aa-core/bundler-client/index.md rename to site/pages/packages/aa-core/bundler-client/index.md index 2c468a1586..d1cbb65712 100644 --- a/site/packages/aa-core/bundler-client/index.md +++ b/site/pages/packages/aa-core/bundler-client/index.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: BundlerClient - - - meta - - name: description - content: Introduction to BundlerClient exported by aa-core - - - meta - - property: og:description - content: Introduction to BundlerClient exported by aa-core +title: BundlerClient +description: Introduction to BundlerClient exported by aa-core --- # Bundler Client diff --git a/site/packages/aa-core/index.md b/site/pages/packages/aa-core/index.md similarity index 77% rename from site/packages/aa-core/index.md rename to site/pages/packages/aa-core/index.md index 34fb9e0858..a512ad539f 100644 --- a/site/packages/aa-core/index.md +++ b/site/pages/packages/aa-core/index.md @@ -1,17 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: aa-core - - - meta - - name: description - content: Introduction to the aa-core package - - - meta - - property: og:description - content: Introduction to the aa-core package -next: - text: SmartAccountClient +title: aa-core +description: Introduction to the aa-core package --- # `@alchemy/aa-core` @@ -26,7 +15,7 @@ The `SmartContractAccount` interface defines how you would interact with your Sm To get started, first install the package: -::: code-group +:::code-group ```bash [yarn] yarn add @alchemy/aa-core @@ -43,6 +32,7 @@ pnpm i @alchemy/aa-core ::: Then, you can create a client like so: -::: code-group -<<< @/snippets/aa-core/smartAccountClient.ts -::: + +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` diff --git a/site/packages/aa-core/signers/local-account.md b/site/pages/packages/aa-core/signers/local-account.md similarity index 83% rename from site/packages/aa-core/signers/local-account.md rename to site/pages/packages/aa-core/signers/local-account.md index 7151038f71..2395a6eb6e 100644 --- a/site/packages/aa-core/signers/local-account.md +++ b/site/pages/packages/aa-core/signers/local-account.md @@ -1,17 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: LocalAccountSigner - - - meta - - name: description - content: Overview of the LocalAccountSigner - - - meta - - property: og:description - content: Overview of the LocalAccountSigner -next: - text: Utils +title: LocalAccountSigner +description: Overview of the LocalAccountSigner --- # LocalAccountSigner @@ -20,7 +9,7 @@ The `LocalAccountSigner` allows you to use accounts for which you already have t ## Usage -::: code-group +:::code-group ```ts [private-key.ts] import { LocalAccountSigner } from "@alchemy/aa-core"; diff --git a/site/packages/aa-core/signers/utils/verifyEIP6492Signature.md b/site/pages/packages/aa-core/signers/utils/verifyEIP6492Signature.md similarity index 78% rename from site/packages/aa-core/signers/utils/verifyEIP6492Signature.md rename to site/pages/packages/aa-core/signers/utils/verifyEIP6492Signature.md index cad45dc8b3..3dfe3b0a52 100644 --- a/site/packages/aa-core/signers/utils/verifyEIP6492Signature.md +++ b/site/pages/packages/aa-core/signers/utils/verifyEIP6492Signature.md @@ -1,17 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: verifyEIP6492Signature - - - meta - - name: description - content: Description of the verifyEIP6492Signature utility method - - - meta - - property: og:description - content: Description of the verifyEIP6492Signature utility method -next: - text: Public ERC-4337 Client +title: verifyEIP6492Signature +description: Description of the verifyEIP6492Signature utility method --- # verifyEIP6492Signature @@ -20,7 +9,7 @@ Uses a the universal validator defined [here](https://github.com/AmbireTech/sign ## Usage -::: code-group +:::code-group ```ts [example.ts] import { verifyEIP6492Signature } from "@alchemy/aa-core"; diff --git a/site/packages/aa-core/signers/utils/wrapSignatureWith6492.md b/site/pages/packages/aa-core/signers/utils/wrapSignatureWith6492.md similarity index 73% rename from site/packages/aa-core/signers/utils/wrapSignatureWith6492.md rename to site/pages/packages/aa-core/signers/utils/wrapSignatureWith6492.md index 91fc8ef8c5..275f807c1b 100644 --- a/site/packages/aa-core/signers/utils/wrapSignatureWith6492.md +++ b/site/pages/packages/aa-core/signers/utils/wrapSignatureWith6492.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: wrapSignatureWith6492 - - - meta - - name: description - content: Description of the wrapSignatureWith6492 utility method - - - meta - - property: og:description - content: Description of the wrapSignatureWith6492 utility method +title: wrapSignatureWith6492 +description: Description of the wrapSignatureWith6492 utility method --- # wrapSignatureWith6492 @@ -18,7 +9,7 @@ Allows you to generate a signature in [ERC-6492](https://eips.ethereum.org/EIPS/ ## Usage -::: code-group +:::code-group ```ts [example.ts] import { wrapSignatureWith6492 } from "@alchemy/aa-core"; diff --git a/site/packages/aa-core/signers/wallet-client.md b/site/pages/packages/aa-core/signers/wallet-client.md similarity index 74% rename from site/packages/aa-core/signers/wallet-client.md rename to site/pages/packages/aa-core/signers/wallet-client.md index 8c2b0d98ca..124a65b6b1 100644 --- a/site/packages/aa-core/signers/wallet-client.md +++ b/site/pages/packages/aa-core/signers/wallet-client.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: WalletClientSigner - - - meta - - name: description - content: Overview of the WalletClientSigner - - - meta - - property: og:description - content: Overview of the WalletClientSigner +title: WalletClientSigner +description: Overview of the WalletClientSigner --- # WalletClientSigner @@ -18,7 +9,7 @@ The `WalletClientSigner` is useful if you want to convert a `viem` `WalletClient ## Usage -::: code-group +:::code-group <<< @/snippets/signers/wallet-client-signer.ts ::: diff --git a/site/packages/aa-core/smart-account-client/actions/buildUserOperation.md b/site/pages/packages/aa-core/smart-account-client/actions/buildUserOperation.mdx similarity index 79% rename from site/packages/aa-core/smart-account-client/actions/buildUserOperation.md rename to site/pages/packages/aa-core/smart-account-client/actions/buildUserOperation.mdx index 62e9deac97..e7bd8e9386 100644 --- a/site/packages/aa-core/smart-account-client/actions/buildUserOperation.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/buildUserOperation.mdx @@ -1,26 +1,17 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: buildUserOperation - - - meta - - name: description - content: Overview of the buildUserOperation method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the buildUserOperation method on SmartAccountClient +title: buildUserOperation +description: Overview of the buildUserOperation method on SmartAccountClient --- # buildUserOperation Builds an _unsigned_ `UserOperation` (UO) struct with all middleware of the `SmartAccountClient` run through the middleware pipeline. -Learn more about [`ClientMiddleware`](/packages/aa-core/smart-account-client/middleware/index) to learn more about the internals of `SmartAccountClient` middleware pipeline that builds the user operation request given the user transaction call data and the operating account data. +Learn more about [`ClientMiddleware`](/packages/aa-core/smart-account-client/middleware/) to learn more about the internals of `SmartAccountClient` middleware pipeline that builds the user operation request given the user transaction call data and the operating account data. ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -80,7 +71,10 @@ const uoHash = await smartAccountClient.sendRawUserOperation({ }); ``` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` + ::: ## Returns @@ -89,4 +83,6 @@ const uoHash = await smartAccountClient.sendRawUserOperation({ A `Promise` containing the _unsigned_ UO struct resulting from the middleware pipeline - +import SendUoParam from "../../../../../snippets/aa-core/send-uo-param.mdx"; + + diff --git a/site/packages/aa-core/smart-account-client/actions/buildUserOperationFromTx.md b/site/pages/packages/aa-core/smart-account-client/actions/buildUserOperationFromTx.mdx similarity index 74% rename from site/packages/aa-core/smart-account-client/actions/buildUserOperationFromTx.md rename to site/pages/packages/aa-core/smart-account-client/actions/buildUserOperationFromTx.mdx index 87400c8197..3a228b2106 100644 --- a/site/packages/aa-core/smart-account-client/actions/buildUserOperationFromTx.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/buildUserOperationFromTx.mdx @@ -1,30 +1,21 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: buildUserOperationFromTx - - - meta - - name: description - content: Overview of the buildUserOperationFromTx method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the buildUserOperationFromTx method on SmartAccountClient +title: buildUserOperationFromTx +description: Overview of the buildUserOperationFromTx method on SmartAccountClient --- # buildUserOperationFromTx Converts a traditional Ethereum transaction and builds an _unsigned_ `UserOperation` (UO) struct with all middleware of the `SmartAccountClient` run through the client middleware pipeline. -Learn more about [`ClientMiddleware`](/packages/aa-core/smart-account-client/middleware/index) to learn more about the internals of `SmartAccountClient` middleware pipeline that builds the user operation request given the user transaction call data and the operating account data. +Learn more about [`ClientMiddleware`](/packages/aa-core/smart-account-client/middleware/) to learn more about the internals of `SmartAccountClient` middleware pipeline that builds the user operation request given the user transaction call data and the operating account data. -::: tip Note +:::tip[Note] Note that `to`, `data`, `value`, `maxFeePerGas`, `maxPriorityFeePerGas` fields of the transaction request type are considered and used to build the user operation from the transaction, while other fields are not used. ::: ## Usage -::: code-group +:::code-group ```ts [example.ts] import type { RpcTransactionRequest } from "viem"; @@ -55,7 +46,10 @@ const entryPointAddress = client.account.getEntryPoint().address; const uoHash = await smartAccountClient.sendRawUserOperation({ request, entryPoint: entryPointAddress }); ``` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` + ::: ## Returns @@ -64,4 +58,6 @@ const uoHash = await smartAccountClient.sendRawUserOperation({ request, entryPoi A `Promise` containing the _unsigned_ UO struct converted from the input transaction with all the middleware run on the resulting UO - +import SendUoParam from "../../../../../snippets/aa-core/send-tx-param.mdx"; + + diff --git a/site/packages/aa-core/smart-account-client/actions/buildUserOperationFromTxs.md b/site/pages/packages/aa-core/smart-account-client/actions/buildUserOperationFromTxs.mdx similarity index 78% rename from site/packages/aa-core/smart-account-client/actions/buildUserOperationFromTxs.md rename to site/pages/packages/aa-core/smart-account-client/actions/buildUserOperationFromTxs.mdx index 4e5566055d..7be142a478 100644 --- a/site/packages/aa-core/smart-account-client/actions/buildUserOperationFromTxs.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/buildUserOperationFromTxs.mdx @@ -1,24 +1,15 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: buildUserOperationFromTxs - - - meta - - name: description - content: Overview of the buildUserOperationFromTxs method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the buildUserOperationFromTxs method on SmartAccountClient +title: buildUserOperationFromTxs +description: Overview of the buildUserOperationFromTxs method on SmartAccountClient --- # buildUserOperationFromTxs -Performs [`buildUserOperationFromTx`](./buildUserOperationFromTx.md) in batch and builds into a single, yet to be signed `UserOperation` (UO) struct. The output user operation struct will be filled with all gas fields (and paymaster data if a paymaster is used) based on the transactions data (`to`, `data`, `value`, `maxFeePerGas`, `maxPriorityFeePerGas`) computed using the configured [`ClientMiddlewares`](/packages/aa-core/smart-account-client/middleware/index) on the `SmartAccountClient` +Performs [`buildUserOperationFromTx`](./buildUserOperationFromTx) in batch and builds into a single, yet to be signed `UserOperation` (UO) struct. The output user operation struct will be filled with all gas fields (and paymaster data if a paymaster is used) based on the transactions data (`to`, `data`, `value`, `maxFeePerGas`, `maxPriorityFeePerGas`) computed using the configured [`ClientMiddlewares`](/packages/aa-core/smart-account-client/middleware/) on the `SmartAccountClient` ## Usage -::: code-group +:::code-group ```ts [example.ts] import type { RpcTransactionRequest } from "viem"; @@ -79,8 +70,12 @@ const uoHash = await smartAccountClient.sendRawUserOperation({ ### `Promise` -::: details BuildUserOperationFromTransactionsResult -<<< @/../packages/core/src/actions/smartAccount/types.ts#BuildUserOperationFromTransactionsResult +:::details[BuildUserOperationFromTransactionsResult] + +```ts +// [!include ~/../packages/core/src/actions/smartAccount/types.ts:BuildUserOperationFromTransactionsResult] +``` + ::: - `uoStruct: UserOperationStruct` @@ -95,7 +90,7 @@ The batch array of `UserOperationCallData` corresponding to the user operation c - `data: Hex` - can be either `0x` or a call data string - `value?: bigint` - optionally, set the value in wei you want to send to the target -- `overrides?:` [`UserOperationOverrides`](/packages/aa-core/smart-account-client/types/userOperationOverrides.md) +- `overrides?:` [`UserOperationOverrides`](/packages/aa-core/smart-account-client/types/userOperationOverrides) `UserOperationOverrides` used as an additional parameter to the `SmartAccountClient` middleware pipeline in addition to the passed user operation calldata for constructing the user operation struct (`uoStruct`) returned; generated to contain the `maxFeePerGas` and `maxPriorityFeePerGas` as the max values of the corresponding fields of input transactions, merged with the optional `overrides` parameter passed in as the user input to the function @@ -103,8 +98,12 @@ The batch array of `UserOperationCallData` corresponding to the user operation c ### `SendTransactionsParameters` -::: details SendTransactionsParameters -<<< @/../packages/core/src/actions/smartAccount/types.ts#SendTransactionsParameters +:::details[SendTransactionsParameters] + +```ts +// [!include ~/../packages/core/src/actions/smartAccount/types.ts:SendTransactionsParameters] +``` + ::: - `requests: RpcTransactionRequest[]` diff --git a/site/packages/aa-core/smart-account-client/actions/checkGasSponsorshipEligibility.md b/site/pages/packages/aa-core/smart-account-client/actions/checkGasSponsorshipEligibility.mdx similarity index 60% rename from site/packages/aa-core/smart-account-client/actions/checkGasSponsorshipEligibility.md rename to site/pages/packages/aa-core/smart-account-client/actions/checkGasSponsorshipEligibility.mdx index fbe17891c7..31fd0dc5ad 100644 --- a/site/packages/aa-core/smart-account-client/actions/checkGasSponsorshipEligibility.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/checkGasSponsorshipEligibility.mdx @@ -1,30 +1,21 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: checkGasSponsorshipEligibility - - - meta - - name: description - content: Overview of the checkGasSponsorshipEligibility method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the checkGasSponsorshipEligibility method on SmartAccountClient +title: checkGasSponsorshipEligibility +description: Overview of the checkGasSponsorshipEligibility method on SmartAccountClient --- # checkGasSponsorshipEligibility This function verifies the eligibility of the connected account for gas sponsorship concerning the upcoming `UserOperation` (UO) that is intended to be sent. -Internally, this method invokes [`buildUserOperation`](./buildUserOperation.md), which navigates through the middleware pipeline, including the `PaymasterMiddleware`. Its purpose is to construct the UO struct meant for transmission to the bundler. Following the construction of the UO struct, this function verifies if the resulting structure contains a non-empty `paymasterAndData` field. +Internally, this method invokes [`buildUserOperation`](./buildUserOperation), which navigates through the middleware pipeline, including the `PaymasterMiddleware`. Its purpose is to construct the UO struct meant for transmission to the bundler. Following the construction of the UO struct, this function verifies if the resulting structure contains a non-empty `paymasterAndData` field. You can utilize this method before sending the user operation to confirm its eligibility for gas sponsorship. Depending on the outcome, it allows you to tailor the user experience accordingly, based on eligibility. -For a deeper understanding of how to employ this method to provide varied user experiences contingent on gas sponsorship eligibility, please refer to the guide [How to handle User Operations not eligible for gas sponsorship](/using-smart-accounts/sponsoring-gas/checking-eligibility.md). +For a deeper understanding of how to employ this method to provide varied user experiences contingent on gas sponsorship eligibility, please refer to the guide [How to handle User Operations not eligible for gas sponsorship](/using-smart-accounts/sponsoring-gas/checking-eligibility). ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -44,7 +35,10 @@ console.log( ); ``` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` + ::: ## Returns @@ -53,4 +47,6 @@ console.log( A `Promise` containing the boolean value indicating whether the UO to be sent is eligible for gas sponsorship or not. - +import SendUoParam from "../../../../../snippets/aa-core/send-uo-param.mdx"; + + diff --git a/site/packages/aa-core/smart-account-client/actions/dropAndReplaceUserOperation.md b/site/pages/packages/aa-core/smart-account-client/actions/dropAndReplaceUserOperation.mdx similarity index 84% rename from site/packages/aa-core/smart-account-client/actions/dropAndReplaceUserOperation.md rename to site/pages/packages/aa-core/smart-account-client/actions/dropAndReplaceUserOperation.mdx index b0643f111b..3d2a8ce3fc 100644 --- a/site/packages/aa-core/smart-account-client/actions/dropAndReplaceUserOperation.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/dropAndReplaceUserOperation.mdx @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: dropAndReplaceUserOperation - - - meta - - name: description - content: Overview of the dropAndReplaceUserOperation method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the dropAndReplaceUserOperation method on SmartAccountClient +title: dropAndReplaceUserOperation +description: Overview of the dropAndReplaceUserOperation method on SmartAccountClient --- # dropAndReplaceUserOperation @@ -18,7 +9,7 @@ Attempts to drop and replace an existing user operation by increasing fees. The ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -35,7 +26,10 @@ const { hash: replacedHash } = await smartAccountClient.dropAndReplaceUserOperation(request); ``` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-core/smart-account-client/actions/estimateUserOperationGas.md b/site/pages/packages/aa-core/smart-account-client/actions/estimateUserOperationGas.mdx similarity index 57% rename from site/packages/aa-core/smart-account-client/actions/estimateUserOperationGas.md rename to site/pages/packages/aa-core/smart-account-client/actions/estimateUserOperationGas.mdx index 68a96ec1b9..229ccb1bc5 100644 --- a/site/packages/aa-core/smart-account-client/actions/estimateUserOperationGas.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/estimateUserOperationGas.mdx @@ -1,26 +1,15 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: estimateUserOperationGas - - - meta - - name: description - content: Overview of the estimateUserOperationGas method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the estimateUserOperationGas method on SmartAccountClient +title: estimateUserOperationGas +description: Overview of the estimateUserOperationGas method on SmartAccountClient --- # estimateUserOperationGas Estimate user operation gas for the user operation without building the full user operation request given the user operation calldata. -Please refer to the guide [How to estimate gas for a user operation](/using-smart-accounts/estimate-gas/estimate-user-op-gas) to learn more about estimating gas for a user operation using `SmartAccountClient`. - ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -45,7 +34,10 @@ console.log(gasEstimate); */ ``` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` + ::: ## Returns @@ -54,4 +46,6 @@ console.log(gasEstimate); The result of the estimate including the `callGasLimit`, `verificationGasLimit`, `preVerificationGas`, and additionally, `paymasterVerificationGasLimit` for EntryPointVersion `v0.7.0` user operations. - +import SendUoParam from "../../../../../snippets/aa-core/send-uo-param.mdx"; + + diff --git a/site/packages/aa-core/smart-account-client/actions/getAddress.md b/site/pages/packages/aa-core/smart-account-client/actions/getAddress.mdx similarity index 60% rename from site/packages/aa-core/smart-account-client/actions/getAddress.md rename to site/pages/packages/aa-core/smart-account-client/actions/getAddress.mdx index 87d9bf161a..caa16f8341 100644 --- a/site/packages/aa-core/smart-account-client/actions/getAddress.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/getAddress.mdx @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: getAddress - - - meta - - name: description - content: Overview of the getAddress method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the getAddress method on SmartAccountClient +title: getAddress +description: Overview of the getAddress method on SmartAccountClient --- # getAddress @@ -18,7 +9,7 @@ Returns the address of the connected account. Throws error if there is no connec ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -26,7 +17,9 @@ import { smartAccountClient } from "./smartAccountClient"; const address = smartAccountClient.getAddress(); ``` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` ::: diff --git a/site/packages/aa-core/smart-account-client/actions/getUserOperationByHash.md b/site/pages/packages/aa-core/smart-account-client/actions/getUserOperationByHash.mdx similarity index 57% rename from site/packages/aa-core/smart-account-client/actions/getUserOperationByHash.md rename to site/pages/packages/aa-core/smart-account-client/actions/getUserOperationByHash.mdx index d00fe305b2..673d5d8303 100644 --- a/site/packages/aa-core/smart-account-client/actions/getUserOperationByHash.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/getUserOperationByHash.mdx @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: getUserOperationByHash - - - meta - - name: description - content: Overview of the getUserOperationByHash method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the getUserOperationByHash method on SmartAccountClient +title: getUserOperationByHash +description: Overview of the getUserOperationByHash method on SmartAccountClient --- # getUserOperationByHash @@ -18,7 +9,7 @@ Return a `UserOperation` (UO) based on a hash (userOpHash). ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -26,7 +17,9 @@ import { smartAccountClient } from "./smartAccountClient"; smartAccountClient.getUserOperationByHash({ hash: "0xUserOpResultHash" }); ``` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` ::: diff --git a/site/packages/aa-core/smart-account-client/actions/getUserOperationReceipt.md b/site/pages/packages/aa-core/smart-account-client/actions/getUserOperationReceipt.mdx similarity index 56% rename from site/packages/aa-core/smart-account-client/actions/getUserOperationReceipt.md rename to site/pages/packages/aa-core/smart-account-client/actions/getUserOperationReceipt.mdx index 668dab49d7..e0f3dabbb3 100644 --- a/site/packages/aa-core/smart-account-client/actions/getUserOperationReceipt.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/getUserOperationReceipt.mdx @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: SmartAccountClient • getUserOperationReceipt - - - meta - - name: description - content: Overview of the getUserOperationReceipt method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the getUserOperationReceipt method on SmartAccountClient +title: SmartAccountClient • getUserOperationReceipt +description: Overview of the getUserOperationReceipt method on SmartAccountClient --- # getUserOperationReceipt @@ -18,7 +9,7 @@ Return a UserOperationReceipt based on a hash (userOpHash). ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -26,7 +17,9 @@ import { smartAccountClient } from "./smartAccountClient"; smartAccountClient.getUserOperationReceipt({ hash: "0xUserOpResultHash" }); ``` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` ::: diff --git a/site/packages/aa-core/smart-account-client/actions/request.md b/site/pages/packages/aa-core/smart-account-client/actions/request.mdx similarity index 74% rename from site/packages/aa-core/smart-account-client/actions/request.md rename to site/pages/packages/aa-core/smart-account-client/actions/request.mdx index ed1e5a535c..7afe75b306 100644 --- a/site/packages/aa-core/smart-account-client/actions/request.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/request.mdx @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: SmartAccountClient • request - - - meta - - name: description - content: Overview of the request method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the request method on SmartAccountClient +title: SmartAccountClient • request +description: Overview of the request method on SmartAccountClient --- # request @@ -18,7 +9,7 @@ head: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -39,7 +30,9 @@ const result = await smartAccountClient.request({ }); ``` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` ::: diff --git a/site/packages/aa-core/smart-account-client/actions/sendTransaction.md b/site/pages/packages/aa-core/smart-account-client/actions/sendTransaction.mdx similarity index 67% rename from site/packages/aa-core/smart-account-client/actions/sendTransaction.md rename to site/pages/packages/aa-core/smart-account-client/actions/sendTransaction.mdx index ccc8750380..30cbf9a4d2 100644 --- a/site/packages/aa-core/smart-account-client/actions/sendTransaction.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/sendTransaction.mdx @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: SmartAccountClient • sendTransaction - - - meta - - name: description - content: Overview of the sendTransaction method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the sendTransaction method on SmartAccountClient +title: SmartAccountClient • sendTransaction +description: Overview of the sendTransaction method on SmartAccountClient --- # sendTransaction @@ -22,7 +13,7 @@ Note that `to`, `data`, `value`, `maxFeePerGas`, `maxPriorityFeePerGas` fields o ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -39,7 +30,9 @@ const tx: RpcTransactionRequest = { const txHash = await smartAccountClient.sendTransaction(tx); ``` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` ::: @@ -49,4 +42,6 @@ const txHash = await smartAccountClient.sendTransaction(tx); A `Promise` containing the transaction hash - +import SendUoParam from "../../../../../snippets/aa-core/send-tx-param.mdx"; + + diff --git a/site/packages/aa-core/smart-account-client/actions/sendTransactions.md b/site/pages/packages/aa-core/smart-account-client/actions/sendTransactions.mdx similarity index 85% rename from site/packages/aa-core/smart-account-client/actions/sendTransactions.md rename to site/pages/packages/aa-core/smart-account-client/actions/sendTransactions.mdx index 80481a0a19..dbcb9f5496 100644 --- a/site/packages/aa-core/smart-account-client/actions/sendTransactions.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/sendTransactions.mdx @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: sendTransactions - - - meta - - name: description - content: Overview of the sendTransactions method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the sendTransactions method on SmartAccountClient +title: sendTransactions +description: Overview of the sendTransactions method on SmartAccountClient --- # sendTransactions @@ -22,7 +13,7 @@ Note that `to`, `data`, `value`, `maxFeePerGas`, `maxPriorityFeePerGas` fields o ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -60,7 +51,9 @@ const requests: RpcTransactionRequest[] = [ const txHash = await smartAccountClient.sendTransactions({ requests }); ``` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` ::: @@ -74,8 +67,12 @@ A `Promise` containing the transaction hash of the batched user operation of the ### `SendTransactionsParameters` -::: details SendTransactionsParameters -<<< @/../packages/core/src/actions/smartAccount/types.ts#SendTransactionsParameters +:::details[SendTransactionsParameters] + +```ts +// [!include ~/../packages/core/src/actions/smartAccount/types.ts:SendTransactionsParameters] +``` + ::: - `requests: RpcTransactionRequest[]` diff --git a/site/packages/aa-core/smart-account-client/actions/sendUserOperation.md b/site/pages/packages/aa-core/smart-account-client/actions/sendUserOperation.mdx similarity index 67% rename from site/packages/aa-core/smart-account-client/actions/sendUserOperation.md rename to site/pages/packages/aa-core/smart-account-client/actions/sendUserOperation.mdx index 82e57d4162..d1d8ac7829 100644 --- a/site/packages/aa-core/smart-account-client/actions/sendUserOperation.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/sendUserOperation.mdx @@ -1,26 +1,17 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: sendUserOperation - - - meta - - name: description - content: Overview of the sendUserOperation method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the sendUserOperation method on SmartAccountClient +title: sendUserOperation +description: Overview of the sendUserOperation method on SmartAccountClient --- # sendUserOperation Sends a user operation or batch of user operations using the connected account. Before executing, sendUserOperation will run the user operation through the middleware pipeline. -Learn more about [`ClientMiddleware`](/packages/aa-core/smart-account-client/middleware/index) to learn more about the internals of `SmartAccountClient` middleware pipeline that builds the user operation request given the user transaction call data and the operating account data. +Learn more about [`ClientMiddleware`](/packages/aa-core/smart-account-client/middleware/) to learn more about the internals of `SmartAccountClient` middleware pipeline that builds the user operation request given the user transaction call data and the operating account data. ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -54,7 +45,10 @@ smartAccountClient.sendUserOperation({ }); ``` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` + ::: ## Returns @@ -65,4 +59,6 @@ A `Promise` containing the hash of the user operation and the request that was s **Note**: The hash is not the User Operation Receipt. The user operation still needs to be bundled and included in a block. The user operation result is more of a proof of submission than a receipt. - +import SendUoParam from "../../../../../snippets/aa-core/send-uo-param.mdx"; + + diff --git a/site/packages/aa-core/smart-account-client/actions/signMessage.md b/site/pages/packages/aa-core/smart-account-client/actions/signMessage.mdx similarity index 59% rename from site/packages/aa-core/smart-account-client/actions/signMessage.md rename to site/pages/packages/aa-core/smart-account-client/actions/signMessage.mdx index bbfae55bf7..15f3b87ffb 100644 --- a/site/packages/aa-core/smart-account-client/actions/signMessage.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/signMessage.mdx @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: SmartAccountClient • signMessage - - - meta - - name: description - content: Overview of the signMessage method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the signMessage method on SmartAccountClient +title: SmartAccountClient • signMessage +description: Overview of the signMessage method on SmartAccountClient --- # signMessage @@ -18,7 +9,7 @@ This method signs messages using the connected account with [ERC-191](https://ei ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -26,7 +17,9 @@ import { smartAccountClient } from "./smartAccountClient"; const signedMessage = await smartAccountClient.signMessage({ message: "msg" }); ``` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` ::: @@ -40,7 +33,7 @@ The signed hash for the message passed ### `message: SignableMessage` -Message to be signed represented as a viem [`SignableMessage`](https://viem.sh/docs/actions/wallet/signMessage.html#signmessage) +Message to be signed represented as a viem [`SignableMessage`](https://viem.sh/docs/actions/wallet/signMessage#signmessage) ### `account?: SmartContractAccount` diff --git a/site/packages/aa-core/smart-account-client/actions/signMessageWith6492.md b/site/pages/packages/aa-core/smart-account-client/actions/signMessageWith6492.mdx similarity index 66% rename from site/packages/aa-core/smart-account-client/actions/signMessageWith6492.md rename to site/pages/packages/aa-core/smart-account-client/actions/signMessageWith6492.mdx index d6cbb5f972..b8b8f5adc3 100644 --- a/site/packages/aa-core/smart-account-client/actions/signMessageWith6492.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/signMessageWith6492.mdx @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: SmartAccountClient • signMessageWith6492 - - - meta - - name: description - content: Overview of the signMessageWith6492 method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the signMessageWith6492 method on SmartAccountClient +title: SmartAccountClient • signMessageWith6492 +description: Overview of the signMessageWith6492 method on SmartAccountClient --- # signMessageWith6492 @@ -18,7 +9,7 @@ This method supports signing messages for deployed smart accounts, as well as un ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -29,7 +20,9 @@ const signedMessageWith6492 = smartAccountClient.signMessageWith6492({ }); ``` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` ::: @@ -43,7 +36,7 @@ A `Promise` containing the signature of the message, additionally wrapped in EIP ### `message: SignableMessage` -The message to sign, of [this viem type](https://viem.sh/docs/actions/wallet/signMessage.html#message) +The message to sign, of [this viem type](https://viem.sh/docs/actions/wallet/signMessage#message) ### `account?: SmartContractAccount` diff --git a/site/packages/aa-core/smart-account-client/actions/signTypedData.md b/site/pages/packages/aa-core/smart-account-client/actions/signTypedData.mdx similarity index 80% rename from site/packages/aa-core/smart-account-client/actions/signTypedData.md rename to site/pages/packages/aa-core/smart-account-client/actions/signTypedData.mdx index 222da20949..ed722f908d 100644 --- a/site/packages/aa-core/smart-account-client/actions/signTypedData.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/signTypedData.mdx @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: SmartAccountClient • signTypedData - - - meta - - name: description - content: Overview of the signTypedData method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the signTypedData method on SmartAccountClient +title: SmartAccountClient • signTypedData +description: Overview of the signTypedData method on SmartAccountClient --- # signTypedData @@ -18,7 +9,7 @@ This method signs sign typed data using the connected account with [ERC-712](htt ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -57,7 +48,9 @@ const signedTypedData = smartAccountClient.signTypedData({ }); ``` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` ::: diff --git a/site/packages/aa-core/smart-account-client/actions/signTypedDataWith6492.md b/site/pages/packages/aa-core/smart-account-client/actions/signTypedDataWith6492.mdx similarity index 81% rename from site/packages/aa-core/smart-account-client/actions/signTypedDataWith6492.md rename to site/pages/packages/aa-core/smart-account-client/actions/signTypedDataWith6492.mdx index f3571a0ac8..08d13163bc 100644 --- a/site/packages/aa-core/smart-account-client/actions/signTypedDataWith6492.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/signTypedDataWith6492.mdx @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: SmartAccountClient • signTypedDataWith6492 - - - meta - - name: description - content: Overview of the signTypedDataWith6492 method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the signTypedDataWith6492 method on SmartAccountClient +title: SmartAccountClient • signTypedDataWith6492 +description: Overview of the signTypedDataWith6492 method on SmartAccountClient --- # signTypedDataWith6492 @@ -18,7 +9,7 @@ This method supports signing typed data for deployed smart accounts, as well as ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -57,7 +48,9 @@ const signedTypedDataWith6492 = smartAccountClient.signTypedDataWith6492({ }); ``` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` ::: diff --git a/site/packages/aa-core/smart-account-client/actions/signUserOperation.md b/site/pages/packages/aa-core/smart-account-client/actions/signUserOperation.mdx similarity index 74% rename from site/packages/aa-core/smart-account-client/actions/signUserOperation.md rename to site/pages/packages/aa-core/smart-account-client/actions/signUserOperation.mdx index 2181ea0c13..0eca0886c4 100644 --- a/site/packages/aa-core/smart-account-client/actions/signUserOperation.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/signUserOperation.mdx @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: signUserOperation - - - meta - - name: description - content: Overview of the signUserOperation method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the signUserOperation method on SmartAccountClient +title: signUserOperation +description: Overview of the signUserOperation method on SmartAccountClient --- # signUserOperation @@ -18,7 +9,9 @@ Signs the unsigned `UserOperationStruct` returned from `buildUserOperation`, `bu ## Usage - +import BuildSignSendRawUo from "../../../../../snippets/aa-core/buildSignSendRawUserOp.mdx"; + + ## Returns @@ -30,8 +23,12 @@ A `Promise` containing the signed result of the input `UserOperationStruct` usin ### `SignUserOperationParameters` -::: details SignUserOperationParameters -<<< @/../packages/core/src/actions/smartAccount/types.ts#SignUserOperationParameters +:::details[SignUserOperationParameters] + +```ts +// [!include ~/../packages/core/src/actions/smartAccount/types.ts:SignUserOperationParameters] +``` + ::: - `uoStruct: UserOperationStruct` diff --git a/site/packages/aa-core/smart-account-client/actions/upgradeAccount.md b/site/pages/packages/aa-core/smart-account-client/actions/upgradeAccount.mdx similarity index 81% rename from site/packages/aa-core/smart-account-client/actions/upgradeAccount.md rename to site/pages/packages/aa-core/smart-account-client/actions/upgradeAccount.mdx index 1dfe9b525f..6dc392b16d 100644 --- a/site/packages/aa-core/smart-account-client/actions/upgradeAccount.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/upgradeAccount.mdx @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: upgradeAccount - - - meta - - name: description - content: Overview of the upgradeAccount method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the upgradeAccount method on SmartAccountClient +title: upgradeAccount +description: Overview of the upgradeAccount method on SmartAccountClient --- # upgradeAccount @@ -18,7 +9,7 @@ Upgrades smart accounts to a new implementation if the smart contract account su ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient as lightAccountClient } from "./lightAccountClient"; @@ -38,7 +29,9 @@ const hash = await lightAccountClient.upgradeAccount({ const upgradedAccount = await createMAAccount(); ``` -<<< @/snippets/aa-alchemy/light-account-client.ts [lightAccountClient.ts] +```ts [lightAccountClient.ts] +// [!include ~/snippets/aa-alchemy/light-account-client.ts] +``` ::: diff --git a/site/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction.md b/site/pages/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction.mdx similarity index 72% rename from site/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction.md rename to site/pages/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction.mdx index 2316eb90f3..6e739cfd2d 100644 --- a/site/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction.md +++ b/site/pages/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction.mdx @@ -1,26 +1,17 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: waitForUserOperationTransaction - - - meta - - name: description - content: Overview of the waitForUserOperationTransaction method on SmartAccountClient - - - meta - - property: og:description - content: Overview of the waitForUserOperationTransaction method on SmartAccountClient +title: waitForUserOperationTransaction +description: Overview of the waitForUserOperationTransaction method on SmartAccountClient --- # waitForUserOperationTransaction Attempts to fetch for UserOperationReceipt `txMaxRetries` amount of times, at an interval of `txRetryIntervalMs` milliseconds (with a multiplier of `txRetryMultiplier`) using the connected account. -Note: For more details on how to modify the retry configurations for this method, see the [constructor](/packages/aa-core/smart-account-client/index.md) parameters. +Note: For more details on how to modify the retry configurations for this method, see the [constructor](/packages/aa-core/smart-account-client/) parameters. ## Usage -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; @@ -39,7 +30,10 @@ const txHash = await smartAccountClient.waitForUserOperationTransaction({ }); ``` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-core/smart-account-client/index.md b/site/pages/packages/aa-core/smart-account-client/index.md similarity index 89% rename from site/packages/aa-core/smart-account-client/index.md rename to site/pages/packages/aa-core/smart-account-client/index.md index 3184661c0e..f173d1df9a 100644 --- a/site/packages/aa-core/smart-account-client/index.md +++ b/site/pages/packages/aa-core/smart-account-client/index.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: SmartAccountClient - - - meta - - name: description - content: Introduction to SmartAccountClient exported by aa-core - - - meta - - property: og:description - content: Introduction to SmartAccountClient exported by aa-core +title: SmartAccountClient +description: Introduction to SmartAccountClient exported by aa-core --- # Smart Account Client @@ -28,8 +19,8 @@ import { createSmartAccountClientFromExisting } from "@alchemy/aa-core"; ## Usage -Initialize a `SmartAccountClient` with your desired Chain and Transport using `createSmartAccountClient`, or use `createSmartAccountClientFromExisting` if you already have a [`BundlerClient`](/packages/aa-core/bundler-client/index) available -::: code-group +Initialize a `SmartAccountClient` with your desired Chain and Transport using `createSmartAccountClient`, or use `createSmartAccountClientFromExisting` if you already have a [`BundlerClient`](/packages/aa-core/bundler-client/) available +:::code-group ```ts [createSmartAccountClient.ts] import { createSmartAccountClient } from "@alchemy/aa-core"; @@ -98,13 +89,13 @@ A new instance of a `SmartAccountClient`. #### If using `createSmartAccountClientFromExisting` -- `client: BundlerClient` -- a [bundler client](/packages/aa-core/bundler-client/index) instance that will be used to communicate with an RPC provider that supports Ethereum RPC methods. +- `client: BundlerClient` -- a [bundler client](/packages/aa-core/bundler-client/) instance that will be used to communicate with an RPC provider that supports Ethereum RPC methods. #### Common to both - `account?: SmartContractAccount` -- [optional] the smart account to use as context for all of your calls. If not provided, then the account can be provided to each individual call instead. -- `entryPoint: EntryPointDef` -- [optional] the entry point contract address. If not provided, the entry point contract address for the client is the connected account's entry point contract, or if not connected, falls back to the default entry point contract for the chain. See [getDefaultEntryPointAddress](/packages/aa-core/utils/getDefaultEntryPointAddress.html#getdefaultentrypointaddress). +- `entryPoint: EntryPointDef` -- [optional] the entry point contract address. If not provided, the entry point contract address for the client is the connected account's entry point contract, or if not connected, falls back to the default entry point contract for the chain. See [getDefaultEntryPointAddress](/packages/aa-core/utils/getDefaultEntryPointAddress#getdefaultentrypointaddress). - `feeEstimator?: ClientMiddlewareFn` -- [optional] an override for the fee estimator middleware. The `feeEstimator` middleware function calculates `maxFeePerGas` and `maxPriorityFeePerGas` for your User Operation. @@ -125,8 +116,8 @@ A new instance of a `SmartAccountClient`. - `txRetryMultiplier: string | undefined` -- [optional] the multiplier on interval length to wait between retries while waiting for transaction receipts (default: 1.5). - - `feeOptions:` [`UserOperationFeeOptions`](/packages/aa-core/smart-account-client/types/userOperationFeeOptions.md) `| undefined` --[optional] user operation fee options to be used for gas estimation, set at the global level on the client. - If not set, default fee options for the chain are used. Available fields in `feeOptions` include `maxFeePerGas`, `maxPriorityFeePerGas`, `callGasLimit`, `preVerificationGas`, `verificationGasLimit` where each field is of type [`UserOperationFeeOptionsField`](/packages/aa-core/smart-account-client/types/userOperationFeeOptionsField.md). + - `feeOptions:` [`UserOperationFeeOptions`](/packages/aa-core/smart-account-client/types/userOperationFeeOptions) `| undefined` --[optional] user operation fee options to be used for gas estimation, set at the global level on the client. + If not set, default fee options for the chain are used. Available fields in `feeOptions` include `maxFeePerGas`, `maxPriorityFeePerGas`, `callGasLimit`, `preVerificationGas`, `verificationGasLimit` where each field is of type [`UserOperationFeeOptionsField`](/packages/aa-core/smart-account-client/types/userOperationFeeOptionsField). - `maxFeePerGas`: `UserOperationFeeOptionsField` - `maxPriorityFeePerGas`: `UserOperationFeeOptionsField` diff --git a/site/packages/aa-core/smart-account-client/middleware/index.md b/site/pages/packages/aa-core/smart-account-client/middleware/index.md similarity index 85% rename from site/packages/aa-core/smart-account-client/middleware/index.md rename to site/pages/packages/aa-core/smart-account-client/middleware/index.md index a2d8cc4710..583af84a72 100644 --- a/site/packages/aa-core/smart-account-client/middleware/index.md +++ b/site/pages/packages/aa-core/smart-account-client/middleware/index.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: SmartAccountClient Middleware - - - meta - - name: description - content: Overview of ClientMiddleware exported by aa-core - - - meta - - property: og:description - content: Overview of ClientMiddleware exported by aa-core +title: SmartAccountClient Middleware +description: Overview of ClientMiddleware exported by aa-core --- # ClientMiddleware @@ -18,12 +9,20 @@ Middleware represents different operations involved in the [`SmartAccountClient` Each middleware is a function that takes in a user operation object, performs its job to retrieve or compute the data, and populate different fields of the user operation to pass onto the next middleware in the pipeline before being signed and sent to the network. -::: details ClientMiddlewareFn -<<< @/../packages/core/src/middleware/types.ts#ClientMiddlewareFn +:::details[ClientMiddlewareFn] + +```ts +// [!include ~/../packages/core/src/middleware/types.ts:ClientMiddlewareFn] +``` + ::: -::: details ClientMiddleware -<<< @/../packages/core/src/middleware/types.ts#ClientMiddleware +:::details[ClientMiddleware] + +```ts +// [!include ~/../packages/core/src/middleware/types.ts:ClientMiddleware] +``` + ::: ## Types of ClientMiddlewares @@ -46,7 +45,7 @@ This is a no-op middleware, but you can include any custom step during the user ### userOperationSimulator -If you are simulating a user operation using [`simulateUserOperation`](/packages/aa-alchemy/smart-account-client/actions/simulateUserOperation.md), `SmartAccountClient` will include `userOperationSimulator` middleware during the pipeline run to simulate the user operation instead of sending it to the network to be mined. +If you are simulating a user operation using [`simulateUserOperation`](/packages/aa-alchemy/smart-account-client/actions/simulateUserOperation), `SmartAccountClient` will include `userOperationSimulator` middleware during the pipeline run to simulate the user operation instead of sending it to the network to be mined. During the `SmartAccountClient` middleware pipeline run, each middleware is applied to compute certain fields of the [`UserOperationStruct`](/resources/types#useroperationstruct) in the following sequential order: @@ -60,7 +59,7 @@ During the `SmartAccountClient` middleware pipeline run, each middleware is appl ## Overriding default middlewares with your own -For each middleware, a default middleware is available for the `SmartAccountClient`, which computes user operation fields based on the user input of operation call data. If you are looking to customize certain behaviors of user operation struct construction for your client, you can flexibly override with your own middleware specifying in the [`ClientMiddlewareConfig`](/resources/types.md#clientmiddlewareconfig) during the `SmartAccountClient` instantiation. For example, the following illustrates how you can override the default gas estimation behavior by overriding the default gas estimator with your own. +For each middleware, a default middleware is available for the `SmartAccountClient`, which computes user operation fields based on the user input of operation call data. If you are looking to customize certain behaviors of user operation struct construction for your client, you can flexibly override with your own middleware specifying in the [`ClientMiddlewareConfig`](/resources/types#clientmiddlewareconfig) during the `SmartAccountClient` instantiation. For example, the following illustrates how you can override the default gas estimation behavior by overriding the default gas estimator with your own. ```ts export type ClientMiddlewareConfig = Omit< diff --git a/site/packages/aa-core/smart-account-client/types/userOperationFeeOptions.md b/site/pages/packages/aa-core/smart-account-client/types/userOperationFeeOptions.md similarity index 72% rename from site/packages/aa-core/smart-account-client/types/userOperationFeeOptions.md rename to site/pages/packages/aa-core/smart-account-client/types/userOperationFeeOptions.md index c68b9022f1..8652bd375a 100644 --- a/site/packages/aa-core/smart-account-client/types/userOperationFeeOptions.md +++ b/site/pages/packages/aa-core/smart-account-client/types/userOperationFeeOptions.md @@ -1,20 +1,11 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: UserOperationFeeOptions - - - meta - - name: description - content: Overview of the UserOperationFeeOptions type in aa-core types - - - meta - - property: og:description - content: Overview of the UserOperationFeeOptions type in aa-core types +title: UserOperationFeeOptions +description: Overview of the UserOperationFeeOptions type in aa-core types --- # UserOperationFeeOptions -Fee options object type used by the [`SmartAccountClient`](/packages/aa-core/smart-account-client/index.md) during the gas fee calculation middlewares when constructing the user operation to send. +Fee options object type used by the [`SmartAccountClient`](/packages/aa-core/smart-account-client/) during the gas fee calculation middlewares when constructing the user operation to send. For example, if the below example `UserOperationFeeOptions` is set on the client upon initialization, the `maxPriorityFeePerGas` field on the user operation will be set as the max value between the 50% buffered `maxPriorityFeePerGas` estimate and the min `maxPriorityFeePerGas` value specified here, `100_000_000n`. @@ -30,9 +21,7 @@ type UserOperationFeeOptions { ## Usage -::: code-group - -```ts [example.ts] +```ts const chain = polygonMumbai; const signer: SmartAccountSigner = LocalAccountSigner.mnemonicToAccountSigner( "YOUR_OWNER_MNEMONIC" @@ -59,5 +48,3 @@ export const smartAccountClient = createSmartAccountClient({ }, }); ``` - -::: diff --git a/site/pages/packages/aa-core/smart-account-client/types/userOperationFeeOptionsField.md b/site/pages/packages/aa-core/smart-account-client/types/userOperationFeeOptionsField.md new file mode 100644 index 0000000000..e4568ab02b --- /dev/null +++ b/site/pages/packages/aa-core/smart-account-client/types/userOperationFeeOptionsField.md @@ -0,0 +1,32 @@ +--- +title: UserOperationFeeOptionsField +description: Overview of the UserOperationFeeOptionsField type in aa-core types +--- + +# UserOperationFeeOptionsField + +Merged type of [`BigNumberishRange`](/resources/types#bignumberishrange) with [`Multiplier`](/resources/types#multiplier) type that can be used as [`UserOperationFeeOptions`](./userOperationFeeOptions) fields for the [`SmartAccountClient`](/packages/aa-core/smart-account-client/) to use during the gas fee calculation middlewares when constructing the user operation to send. + +For example, if the below example `UserOperationFeeOptionsField` is set as the fee option for the `maxPriorityFeePerGas` field of [`UserOperationFeeOptions`](./userOperationFeeOptions), then the [`SmartAccountClient`](/packages/aa-core/smart-account-client/) will apply 50% buffer to the estimated `maxPriorityFeePerGas`, then set the `maxPriorityFeePerGas` on the user operation as the larger value between the buffered `maxPriorityFeePerGas` fee and the min `maxPriorityFeePerGas` which is `100_000_000n` here. + +```ts +/* + * { + * min?: BigNumberish + * max?: BigNumberish + * multiplier?: number + * } + */ +type UserOperationFeeOptionsFieldSchema = BigNumberishRange & Multiplier; +``` + +## Usage + +```ts +import { type UserOperationFeeOptionsField } from "@alchemy/aa-core"; + +const userOperationFeeOptionsField: UserOperationFeeOptionsField = { + min: 100_000_000n, + multiplier: 1.5, +}; +``` diff --git a/site/packages/aa-core/smart-account-client/types/userOperationOverrides.md b/site/pages/packages/aa-core/smart-account-client/types/userOperationOverrides.md similarity index 85% rename from site/packages/aa-core/smart-account-client/types/userOperationOverrides.md rename to site/pages/packages/aa-core/smart-account-client/types/userOperationOverrides.md index 58d069a34e..11a7f69799 100644 --- a/site/packages/aa-core/smart-account-client/types/userOperationOverrides.md +++ b/site/pages/packages/aa-core/smart-account-client/types/userOperationOverrides.md @@ -1,17 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: UserOperationOverrides - - - meta - - name: description - content: Overview of the UserOperationOverrides type in aa-core types - - - meta - - property: og:description - content: Overview of the UserOperationOverrides type in aa-core types -next: - text: SmartContractAccount +title: UserOperationOverrides +description: Overview of the UserOperationOverrides type in aa-core types --- # UserOperationOverrides @@ -22,11 +11,11 @@ These override values are available from each middleware of the `SmartAccountCli Other than the `paymasterAndData` and the `nonceKey` fields, the override fields could be either the absolute or the multiplier. In default middlewares, if the override value is absolute, it simply overrides the estimated value. If the override value is a multiplier value, the estimated value is _bumped_ with the indicated multiplier value. For example, if the override value is `{ multiplier: 1.1 }` for the `maxPriorityFeePerGas` field, then a 1.1 multiplier, or a 10% increase, is applied to the estimated `maxPriorityFeePerGas` of the user operation. -The `paymasterAndData` only allows an absolute value override of value `0x` for bypassing the paymaster middleware entirely. This is useful when a user is not eligible for gas sponsorship, but is comfortable paying for the gas of the User Operation themselves. Refer to our guide [How to handle User Operations that are not eligible for gas sponsorship](/using-smart-accounts/sponsoring-gas/checking-eligibility.md) on the example of using the `paymasterAndData` override to bypass the paymaster middleware to fallback to the user paying the gas fee instead of the gas being subsidized by the paymaster. +The `paymasterAndData` only allows an absolute value override of value `0x` for bypassing the paymaster middleware entirely. This is useful when a user is not eligible for gas sponsorship, but is comfortable paying for the gas of the User Operation themselves. Refer to our guide [How to handle User Operations that are not eligible for gas sponsorship](/using-smart-accounts/sponsoring-gas/checking-eligibility) on the example of using the `paymasterAndData` override to bypass the paymaster middleware to fallback to the user paying the gas fee instead of the gas being subsidized by the paymaster. Lastly, `noneKey` can be used to override the key used when calling `entryPoint.getNonce`. It is useful when you want to use parallel nonces for user operations. This is useful when you want to send multiple user operations in parallel. Note that not all bundlers fully support this feature and it could be that your bundler will still only include one user operation for your account in a bundle. -:::tip Note +:::tip[Note] Note that if you are using your own middleware, for example if you supply your own custom `feeEstimator`, `gasEstimator`, or `paymasterMiddleware` when creating the smart account client, then their corresponding default middlewares are overridden. As you are opting out of using the default middlewares, you are also responsible for handling the `UserOperationOverrides` appropriately for each of the middleware that you opted out of the defaults. ::: @@ -50,7 +39,7 @@ export type UserOperationOverrides = Partial<{ ## Usage -::: code-group +:::code-group ```ts [user-operation-override.ts] import type { UserOperationOverrides } from "@alchemy/aa-core"; @@ -79,6 +68,8 @@ const txHash = await smartAccountClient.waitForUserOperationTransaction({ }); ``` -<<< @/snippets/aa-alchemy/gas-manager-client.ts [smartAccountClient.ts] +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/gas-manager-client.ts] +``` ::: diff --git a/site/packages/aa-core/split-transport.md b/site/pages/packages/aa-core/split-transport.md similarity index 67% rename from site/packages/aa-core/split-transport.md rename to site/pages/packages/aa-core/split-transport.md index f256d208e5..d58bdfbf85 100644 --- a/site/packages/aa-core/split-transport.md +++ b/site/pages/packages/aa-core/split-transport.md @@ -1,17 +1,7 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Split Transport - - - meta - - name: description - content: Learn how to use a different RPC provider for your bundler traffic and node traffic - - - meta - - property: og:description - content: Learn how to use a different RPC provider for your bundler traffic and node traffic -next: - text: SmartAccountClient +title: Split Transport +description: Learn how to use a different RPC provider for your bundler traffic + and node traffic --- # split @@ -26,7 +16,9 @@ import { split } from "@alchemy/aa-core"; ## Usage -<<< @/snippets/aa-core/splitTransport.ts +```ts [splitTransport.ts] +// [!include ~/snippets/aa-core/splitTransport.ts] +``` ## Parameters diff --git a/site/packages/aa-core/utils/asyncPipe.md b/site/pages/packages/aa-core/utils/asyncPipe.md similarity index 64% rename from site/packages/aa-core/utils/asyncPipe.md rename to site/pages/packages/aa-core/utils/asyncPipe.md index 2183fd673c..be0d921ab8 100644 --- a/site/packages/aa-core/utils/asyncPipe.md +++ b/site/pages/packages/aa-core/utils/asyncPipe.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: asyncPipe - - - meta - - name: description - content: Overview of the asyncPipe method in aa-core utils - - - meta - - property: og:description - content: Overview of the asyncPipe method in aa-core utils +title: asyncPipe +description: Overview of the asyncPipe method in aa-core utils --- # `asyncPipe` @@ -18,7 +9,7 @@ Utility function that allows for piping a series of async functions together tha ## Usage -::: code-group +:::code-group ```ts [example.ts] import { asyncPipe } from "@alchemy/aa-core"; diff --git a/site/packages/aa-core/utils/convertChainIdToCoinType.md b/site/pages/packages/aa-core/utils/convertChainIdToCoinType.md similarity index 66% rename from site/packages/aa-core/utils/convertChainIdToCoinType.md rename to site/pages/packages/aa-core/utils/convertChainIdToCoinType.md index a7679a2806..c2e868db33 100644 --- a/site/packages/aa-core/utils/convertChainIdToCoinType.md +++ b/site/pages/packages/aa-core/utils/convertChainIdToCoinType.md @@ -1,28 +1,19 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: convertChainIdToCoinType - - - meta - - name: description - content: Overview of the convertChainIdToCoinType method in aa-core utils - - - meta - - property: og:description - content: Overview of the convertChainIdToCoinType method in aa-core utils +title: convertChainIdToCoinType +description: Overview of the convertChainIdToCoinType method in aa-core utils --- # convertChainIdToCoinType Converts an ethereum chain ID to an ENS coin type as per [ENSIP-11](https://docs.ens.domains/ens-improvement-proposals/ensip-11-evmchain-address-resolution) and assumes this is how mappings are stored for non mainnet chains. -::: tip Note +:::tip[Note] For mainnet, this method will return `60` as the coin type. This comes from [ensip-9](https://docs.ens.domains/ens-improvement-proposals/ensip-9-multichain-address-resolution). ::: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { convertChainIdToCoinType } from "@alchemy/aa-core"; diff --git a/site/packages/aa-core/utils/convertCoinTypeToChain.md b/site/pages/packages/aa-core/utils/convertCoinTypeToChain.md similarity index 66% rename from site/packages/aa-core/utils/convertCoinTypeToChain.md rename to site/pages/packages/aa-core/utils/convertCoinTypeToChain.md index 1d072305a2..a45e200071 100644 --- a/site/packages/aa-core/utils/convertCoinTypeToChain.md +++ b/site/pages/packages/aa-core/utils/convertCoinTypeToChain.md @@ -1,28 +1,19 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: convertCoinTypeToChain - - - meta - - name: description - content: Overview of the convertCoinTypeToChain method in aa-core utils - - - meta - - property: og:description - content: Overview of the convertCoinTypeToChain method in aa-core utils +title: convertCoinTypeToChain +description: Overview of the convertCoinTypeToChain method in aa-core utils --- # convertCoinTypeToChain Converts a coinType into a viem Chain object. The conversion follows [ENSIP-11](https://docs.ens.domains/ens-improvement-proposals/ensip-11-evmchain-address-resolution). -::: tip Note +:::tip[Note] For mainnet, the conversion expects `coinType == 60`. This comes from [ENSIP-9](https://docs.ens.domains/ens-improvement-proposals/ensip-9-multichain-address-resolution). ::: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { convertCoinTypeToChain } from "@alchemy/aa-core"; diff --git a/site/packages/aa-core/utils/convertCoinTypeToChainId.md b/site/pages/packages/aa-core/utils/convertCoinTypeToChainId.md similarity index 64% rename from site/packages/aa-core/utils/convertCoinTypeToChainId.md rename to site/pages/packages/aa-core/utils/convertCoinTypeToChainId.md index 250579f59a..50b36400e5 100644 --- a/site/packages/aa-core/utils/convertCoinTypeToChainId.md +++ b/site/pages/packages/aa-core/utils/convertCoinTypeToChainId.md @@ -1,28 +1,19 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: convertCoinTypeToChainId - - - meta - - name: description - content: Overview of the convertCoinTypeToChainId method in aa-core utils - - - meta - - property: og:description - content: Overview of the convertCoinTypeToChainId method in aa-core utils +title: convertCoinTypeToChainId +description: Overview of the convertCoinTypeToChainId method in aa-core utils --- # convertCoinTypeToChainId Converts a coinType into a chain ID. The conversion follows [ENSIP-11](https://docs.ens.domains/ens-improvement-proposals/ensip-11-evmchain-address-resolution). -::: tip Note +:::tip[Note] For mainnet, the conversion expects `coinType == 60`. This comes from [ENSIP-9](https://docs.ens.domains/ens-improvement-proposals/ensip-9-multichain-address-resolution). ::: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { convertCoinTypeToChainId } from "@alchemy/aa-core"; diff --git a/site/packages/aa-core/utils/deepHexlify.md b/site/pages/packages/aa-core/utils/deepHexlify.md similarity index 72% rename from site/packages/aa-core/utils/deepHexlify.md rename to site/pages/packages/aa-core/utils/deepHexlify.md index 81faec2aec..f841e1f462 100644 --- a/site/packages/aa-core/utils/deepHexlify.md +++ b/site/pages/packages/aa-core/utils/deepHexlify.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: deepHexlify - - - meta - - name: description - content: Overview of the deepHexlify method in aa-core utils - - - meta - - property: og:description - content: Overview of the deepHexlify method in aa-core utils +title: deepHexlify +description: Overview of the deepHexlify method in aa-core utils --- # deepHexlify @@ -18,7 +9,7 @@ Utility function that recursively converts all values in an object to hex string ## Usage -::: code-group +:::code-group ```ts [example.ts] import { deepHexlify } from "@alchemy/aa-core"; diff --git a/site/packages/aa-core/utils/defineReadOnly.md b/site/pages/packages/aa-core/utils/defineReadOnly.md similarity index 66% rename from site/packages/aa-core/utils/defineReadOnly.md rename to site/pages/packages/aa-core/utils/defineReadOnly.md index 0256c0fdc2..a0491eeba7 100644 --- a/site/packages/aa-core/utils/defineReadOnly.md +++ b/site/pages/packages/aa-core/utils/defineReadOnly.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: defineReadOnly - - - meta - - name: description - content: Overview of the defineReadOnly method in aa-core utils - - - meta - - property: og:description - content: Overview of the defineReadOnly method in aa-core utils +title: defineReadOnly +description: Overview of the defineReadOnly method in aa-core utils --- # `defineReadOnly` @@ -20,7 +11,7 @@ Borrowed from [ethers](https://github.com/ethers-io/ethers.js/blob/v5.7/packages ## Usage -::: code-group +:::code-group ```ts [example.ts] import { defineReadOnly } from "@alchemy/aa-core"; diff --git a/site/packages/aa-core/utils/getChain.md b/site/pages/packages/aa-core/utils/getChain.md similarity index 58% rename from site/packages/aa-core/utils/getChain.md rename to site/pages/packages/aa-core/utils/getChain.md index a5e59ef6a1..f229d61f53 100644 --- a/site/packages/aa-core/utils/getChain.md +++ b/site/pages/packages/aa-core/utils/getChain.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: getChain - - - meta - - name: description - content: Overview of the getChain method in aa-core utils - - - meta - - property: og:description - content: Overview of the getChain method in aa-core utils +title: getChain +description: Overview of the getChain method in aa-core utils --- # getChain @@ -18,7 +9,7 @@ This is a utility method for converting a chainId to a `viem` `Chain` object ## Usage -::: code-group +:::code-group ```ts [example.ts] import { getChain } from "@alchemy/aa-core"; diff --git a/site/packages/aa-core/utils/getDefaultEntryPointAddress.md b/site/pages/packages/aa-core/utils/getDefaultEntryPointAddress.md similarity index 60% rename from site/packages/aa-core/utils/getDefaultEntryPointAddress.md rename to site/pages/packages/aa-core/utils/getDefaultEntryPointAddress.md index 2d9557e6e4..9e0ecb7dd6 100644 --- a/site/packages/aa-core/utils/getDefaultEntryPointAddress.md +++ b/site/pages/packages/aa-core/utils/getDefaultEntryPointAddress.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: getDefaultEntryPointAddress - - - meta - - name: description - content: Overview of the getDefaultEntryPointAddress method in aa-core utils - - - meta - - property: og:description - content: Overview of the getDefaultEntryPointAddress method in aa-core utils +title: getDefaultEntryPointAddress +description: Overview of the getDefaultEntryPointAddress method in aa-core utils --- # getDefaultEntryPointAddress @@ -18,7 +9,7 @@ Utility method that returns the default EntryPoint contract address for a given ## Usage -::: code-group +:::code-group ```ts [example.ts] import { sepolia } from "@alchemy/aa-core"; diff --git a/site/packages/aa-core/utils/getDefaultSimpleAccountFactoryAddress.md b/site/pages/packages/aa-core/utils/getDefaultSimpleAccountFactoryAddress.md similarity index 61% rename from site/packages/aa-core/utils/getDefaultSimpleAccountFactoryAddress.md rename to site/pages/packages/aa-core/utils/getDefaultSimpleAccountFactoryAddress.md index 6abf1e3a7c..48e63d0940 100644 --- a/site/packages/aa-core/utils/getDefaultSimpleAccountFactoryAddress.md +++ b/site/pages/packages/aa-core/utils/getDefaultSimpleAccountFactoryAddress.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: getDefaultSimpleAccountFactoryAddress - - - meta - - name: description - content: Overview of the getDefaultSimpleAccountFactoryAddress method in aa-core utils - - - meta - - property: og:description - content: Overview of the getDefaultSimpleAccountFactoryAddress method in aa-core utils +title: getDefaultSimpleAccountFactoryAddress +description: Overview of the getDefaultSimpleAccountFactoryAddress method in aa-core utils --- # getDefaultSimpleAccountFactoryAddress @@ -18,7 +9,7 @@ Utility method that returns the default Simple Account Factory contract address ## Usage -::: code-group +:::code-group ```ts [example.ts] import { sepolia } from "@alchemy/aa-core"; diff --git a/site/packages/aa-core/utils/resolveProperties.md b/site/pages/packages/aa-core/utils/resolveProperties.md similarity index 65% rename from site/packages/aa-core/utils/resolveProperties.md rename to site/pages/packages/aa-core/utils/resolveProperties.md index e9753c5054..6db2ecd23b 100644 --- a/site/packages/aa-core/utils/resolveProperties.md +++ b/site/pages/packages/aa-core/utils/resolveProperties.md @@ -1,17 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: resolveProperties - - - meta - - name: description - content: Overview of the resolveProperties method in aa-core utils - - - meta - - property: og:description - content: Overview of the resolveProperties method in aa-core utils -next: - text: aa-alchemy +title: resolveProperties +description: Overview of the resolveProperties method in aa-core utils --- # `resolveProperties` @@ -20,7 +9,7 @@ Await all of the properties of a Deferrable object. A Deferrable object is an ob ## Usage -::: code-group +:::code-group ```ts [example.ts] import { resolveProperties } from "@alchemy/aa-core"; diff --git a/site/packages/aa-core/utils/stringToIndex.md b/site/pages/packages/aa-core/utils/stringToIndex.md similarity index 59% rename from site/packages/aa-core/utils/stringToIndex.md rename to site/pages/packages/aa-core/utils/stringToIndex.md index 5e0cc47a41..be89e15410 100644 --- a/site/packages/aa-core/utils/stringToIndex.md +++ b/site/pages/packages/aa-core/utils/stringToIndex.md @@ -1,15 +1,7 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: stringToIndex - - - meta - - name: description - content: A utility function to convert a string, such as an email, to salt for SmartAccounts - - - meta - - property: og:description - content: Overview of the stringToIndex function in aa-core utils +title: stringToIndex +description: A utility function to convert a string, such as an email, to salt + for SmartAccounts --- # stringToIndex @@ -18,7 +10,7 @@ This function can be used to create a unique SmartAccount for a given uuid, emai ## Usage -::: code-group +:::code-group ```ts [example.ts] const salt = stringToIndex("alice@example.com"); diff --git a/site/packages/aa-ethers/account-signer/connect.md b/site/pages/packages/aa-ethers/account-signer/connect.md similarity index 71% rename from site/packages/aa-ethers/account-signer/connect.md rename to site/pages/packages/aa-ethers/account-signer/connect.md index 5efa73fd48..43ea2c51fc 100644 --- a/site/packages/aa-ethers/account-signer/connect.md +++ b/site/pages/packages/aa-ethers/account-signer/connect.md @@ -1,17 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: AccountSigner • connect - - - meta - - name: description - content: Overview of the connect method on AccountSigner in aa-ethers - - - meta - - property: og:description - content: Overview of the connect method on AccountSigner in aa-ethers -next: - text: Utils +title: AccountSigner • connect +description: Overview of the connect method on AccountSigner in aa-ethers --- # connect @@ -20,7 +9,7 @@ next: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { accountSigner } from "./ethers-signer"; @@ -37,7 +26,10 @@ const newProvider = EthersProviderAdapter.fromEthersProvider(ethersProvider); const newAccountSigner = accountSigner.connect(newProvider); ``` -<<< @/snippets/aa-ethers/ethers-signer.ts +```ts [ethers-signer.ts] +// [!include ~/snippets/aa-ethers/ethers-signer.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-ethers/account-signer/getAddress.md b/site/pages/packages/aa-ethers/account-signer/getAddress.md similarity index 50% rename from site/packages/aa-ethers/account-signer/getAddress.md rename to site/pages/packages/aa-ethers/account-signer/getAddress.md index e13b956fca..90bc8370a1 100644 --- a/site/packages/aa-ethers/account-signer/getAddress.md +++ b/site/pages/packages/aa-ethers/account-signer/getAddress.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: AccountSigner • getAddress - - - meta - - name: description - content: Overview of the getAddress method on AccountSigner in aa-ethers - - - meta - - property: og:description - content: Overview of the getAddress method on AccountSigner in aa-ethers +title: AccountSigner • getAddress +description: Overview of the getAddress method on AccountSigner in aa-ethers --- # getAddress @@ -18,7 +9,7 @@ head: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { accountSigner } from "./ethers-signer"; @@ -27,7 +18,10 @@ import { accountSigner } from "./ethers-signer"; const client = await accountSigner.getAddress(); ``` -<<< @/snippets/aa-ethers/ethers-signer.ts +```ts [ethers-signer.ts] +// [!include ~/snippets/aa-ethers/ethers-signer.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-ethers/account-signer/getBundlerClient.md b/site/pages/packages/aa-ethers/account-signer/getBundlerClient.md similarity index 54% rename from site/packages/aa-ethers/account-signer/getBundlerClient.md rename to site/pages/packages/aa-ethers/account-signer/getBundlerClient.md index 18f5391dd4..f346ae4db5 100644 --- a/site/packages/aa-ethers/account-signer/getBundlerClient.md +++ b/site/pages/packages/aa-ethers/account-signer/getBundlerClient.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: AccountSigner • getBundlerClient - - - meta - - name: description - content: Overview of the getBundlerClient method on AccountSigner in aa-ethers - - - meta - - property: og:description - content: Overview of the getBundlerClient method on AccountSigner in aa-ethers +title: AccountSigner • getBundlerClient +description: Overview of the getBundlerClient method on AccountSigner in aa-ethers --- # getBundlerClient @@ -18,7 +9,7 @@ head: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { accountSigner } from "./ethers-signer"; @@ -27,7 +18,10 @@ import { accountSigner } from "./ethers-signer"; const client = accountSigner.getBundlerClient(); ``` -<<< @/snippets/aa-ethers/ethers-signer.ts +```ts [ethers-signer.ts] +// [!include ~/snippets/aa-ethers/ethers-signer.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-ethers/account-signer/introduction.md b/site/pages/packages/aa-ethers/account-signer/introduction.md similarity index 84% rename from site/packages/aa-ethers/account-signer/introduction.md rename to site/pages/packages/aa-ethers/account-signer/introduction.md index 97a6cbfa0f..9aee8725a8 100644 --- a/site/packages/aa-ethers/account-signer/introduction.md +++ b/site/pages/packages/aa-ethers/account-signer/introduction.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: AccountSigner - - - meta - - name: description - content: Overview of the AccountSigner class in aa-ethers - - - meta - - property: og:description - content: Overview of the AccountSigner class in aa-ethers +title: AccountSigner +description: Overview of the AccountSigner class in aa-ethers --- # AccountSigner @@ -26,7 +17,7 @@ Notable differences between `EthersProviderAdapter` and `JsonRpcProvider` are im ## Usage -::: code-group +:::code-group ```ts [example.ts] import { accountSigner } from "./ethers-signer"; @@ -47,5 +38,8 @@ const txn = await accountSigner.sendTransaction({ const client = accountSigner.getBundlerClient(); ``` -<<< @/snippets/aa-ethers/ethers-signer.ts +```ts [ethers-signer.ts] +// [!include ~/snippets/aa-ethers/ethers-signer.ts] +``` + ::: diff --git a/site/packages/aa-ethers/account-signer/sendTransaction.md b/site/pages/packages/aa-ethers/account-signer/sendTransaction.md similarity index 73% rename from site/packages/aa-ethers/account-signer/sendTransaction.md rename to site/pages/packages/aa-ethers/account-signer/sendTransaction.md index 8b0b303f58..fe2b9639e6 100644 --- a/site/packages/aa-ethers/account-signer/sendTransaction.md +++ b/site/pages/packages/aa-ethers/account-signer/sendTransaction.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: AccountSigner • sendTransaction - - - meta - - name: description - content: Overview of the sendTransaction method on AccountSigner in aa-ethers - - - meta - - property: og:description - content: Overview of the sendTransaction method on AccountSigner in aa-ethers +title: AccountSigner • sendTransaction +description: Overview of the sendTransaction method on AccountSigner in aa-ethers --- # sendTransaction @@ -20,7 +11,7 @@ Note that `to` field of transaction is required, and among other fields of trans ## Usage -::: code-group +:::code-group ```ts [example.ts] import { accountSigner } from "./ethers-signer"; @@ -36,7 +27,10 @@ const txHash = await accountSigner.sendTransaction({ }); ``` -<<< @/snippets/aa-ethers/ethers-signer.ts +```ts [ethers-signer.ts] +// [!include ~/snippets/aa-ethers/ethers-signer.ts] +``` + ::: ## Returns @@ -51,6 +45,6 @@ A `Promise` containing the ethers.js `TransactionResponse` object The ethers.js `TransactionRequest` object, where each field may be a Promise or its value -### `overrides?:` [`UserOperationOverrides`](/packages/aa-core/smart-account-client/types/userOperationOverrides.md) +### `overrides?:` [`UserOperationOverrides`](/packages/aa-core/smart-account-client/types/userOperationOverrides) Optional parameter where you can specify override values for `maxFeePerGas`, `maxPriorityFeePerGas`, `callGasLimit`, `preVerificationGas`, `verificationGasLimit` or `paymasterAndData` on the user operation request diff --git a/site/packages/aa-ethers/account-signer/signMessage.md b/site/pages/packages/aa-ethers/account-signer/signMessage.md similarity index 57% rename from site/packages/aa-ethers/account-signer/signMessage.md rename to site/pages/packages/aa-ethers/account-signer/signMessage.md index ad89779d2d..6f0ec4e998 100644 --- a/site/packages/aa-ethers/account-signer/signMessage.md +++ b/site/pages/packages/aa-ethers/account-signer/signMessage.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: AccountSigner • signMessage - - - meta - - name: description - content: Overview of the signMessage method on AccountSigner in aa-ethers - - - meta - - property: og:description - content: Overview of the signMessage method on AccountSigner in aa-ethers +title: AccountSigner • signMessage +description: Overview of the signMessage method on AccountSigner in aa-ethers --- # signMessage @@ -18,7 +9,7 @@ head: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { accountSigner } from "./ethers-signer"; @@ -27,7 +18,10 @@ import { accountSigner } from "./ethers-signer"; const signedMessage = await accountSigner.signMessage("test"); ``` -<<< @/snippets/aa-ethers/ethers-signer.ts +```ts [ethers-signer.ts] +// [!include ~/snippets/aa-ethers/ethers-signer.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-ethers/index.md b/site/pages/packages/aa-ethers/index.md similarity index 67% rename from site/packages/aa-ethers/index.md rename to site/pages/packages/aa-ethers/index.md index fe561a30bd..23c991b357 100644 --- a/site/packages/aa-ethers/index.md +++ b/site/pages/packages/aa-ethers/index.md @@ -1,27 +1,13 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: aa-ethers - - - meta - - name: description - content: aa-ethers landing page and getting started guide - - - meta - - property: og:description - content: aa-ethers landing page and getting started guide -prev: - text: aa-signers - link: /packages/aa-signers/index -next: - text: EthersProviderAdapter +title: aa-ethers +description: aa-ethers landing page and getting started guide --- # `@alchemy/aa-ethers` This package contains `EthersProviderAdapter` and `AccountSigner`, respective extensions of the [`JsonRpcProvider`](https://docs.ethers.org/v5/api/providers/jsonrpc-provider/) and [`Signer`](https://docs.ethers.org/v5/api/signer/) classes defined in [`ethers.js`](https://docs.ethers.org/v5/) external library. -If you currently rely `ethers.js` for web3 development, you can use these `ethers.js`-compatible `JsonRpcProvider` and `Signer` to integrate Account Abstraction into your dApp. You may also find the [`util`](./utils/introduction.md) methods helpful. +If you currently rely `ethers.js` for web3 development, you can use these `ethers.js`-compatible `JsonRpcProvider` and `Signer` to integrate Account Abstraction into your dApp. You may also find the [`util`](./utils/introduction) methods helpful. This repo is community maintained and we welcome contributions! @@ -29,7 +15,7 @@ This repo is community maintained and we welcome contributions! If you are already using the `@alchemy/aa-core` package, you can simply install this package and start using the `EthersProviderAdapter` and `AccountSigner`. 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 +:::code-group ```bash [yarn] yarn add @alchemy/aa-ethers @@ -46,9 +32,14 @@ pnpm i @alchemy/aa-ethers ::: You can create a provider and connect it to a Signer account like so: -::: code-group +:::code-group -<<< @/snippets/aa-ethers/ethers-signer.ts -<<< @/snippets/aa-ethers/ethers-provider.ts +```ts [ethers-signer.ts] +// [!include ~/snippets/aa-ethers/ethers-signer.ts] +``` + +```ts [ethers-provider.ts] +// [!include ~/snippets/aa-ethers/ethers-provider.ts] +``` ::: diff --git a/site/packages/aa-ethers/provider-adapter/connectToAccount.md b/site/pages/packages/aa-ethers/provider-adapter/connectToAccount.md similarity index 59% rename from site/packages/aa-ethers/provider-adapter/connectToAccount.md rename to site/pages/packages/aa-ethers/provider-adapter/connectToAccount.md index 26db95e61b..460c235fae 100644 --- a/site/packages/aa-ethers/provider-adapter/connectToAccount.md +++ b/site/pages/packages/aa-ethers/provider-adapter/connectToAccount.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: EthersProviderAdapter • connectToAccount - - - meta - - name: description - content: Overview of the connectToAccount method on EthersProviderAdapter in aa-ethers - - - meta - - property: og:description - content: Overview of the connectToAccount method on EthersProviderAdapter in aa-ethers +title: EthersProviderAdapter • connectToAccount +description: Overview of the connectToAccount method on EthersProviderAdapter in aa-ethers --- # connectToAccount @@ -18,10 +9,16 @@ head: ## Usage -::: code-group +:::code-group + +```ts [ethers-signer.ts] +// [!include ~/snippets/aa-ethers/ethers-signer.ts] +``` + +```ts [ethers-provider.ts] +// [!include ~/snippets/aa-ethers/ethers-provider.ts] +``` -<<< @/snippets/aa-ethers/ethers-signer.ts -<<< @/snippets/aa-ethers/ethers-provider.ts ::: ## Returns diff --git a/site/packages/aa-ethers/provider-adapter/constructor.md b/site/pages/packages/aa-ethers/provider-adapter/constructor.md similarity index 77% rename from site/packages/aa-ethers/provider-adapter/constructor.md rename to site/pages/packages/aa-ethers/provider-adapter/constructor.md index 2fa0822d2b..70341017b4 100644 --- a/site/packages/aa-ethers/provider-adapter/constructor.md +++ b/site/pages/packages/aa-ethers/provider-adapter/constructor.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: EthersProviderAdapter • constructor - - - meta - - name: description - content: Overview of the constructor method on EthersProviderAdapter in aa-ethers - - - meta - - property: og:description - content: Overview of the constructor method on EthersProviderAdapter in aa-ethers +title: EthersProviderAdapter • constructor +description: Overview of the constructor method on EthersProviderAdapter in aa-ethers --- # constructor @@ -20,8 +11,6 @@ Or you can also input a `SmartAccountClient` instance already initialized (`Alch ## Usage -::: code-group - ```ts [example.ts] import { AlchemyProvider } from "@alchemy/aa-alchemy"; import { getDefaultEntryPointAddress } from "@alchemy/aa-core"; @@ -56,8 +45,6 @@ export const anotherProvider = new EthersProviderAdapter({ }); ``` -::: - ## Returns ### `EthersProviderAdapter` @@ -70,10 +57,10 @@ A new instance of an `EthersProviderAdapter`. Either: -- `rpcProvider: string | BundlerClient` -- a JSON-RPC URL, or a viem Client that supports ERC-4337 methods and Viem public actions. See [createBundlerClient](/packages/aa-core/bundler-client/index.md). +- `rpcProvider: string | BundlerClient` -- a JSON-RPC URL, or a viem Client that supports ERC-4337 methods and Viem public actions. See [createBundlerClient](/packages/aa-core/bundler-client/). - `chainId: number` -- the ID of the chain on which to create the provider. Or: -- `accountProvider: SmartAccountClient` -- See [SmartAccountClient](/packages/aa-core/smart-account-client/index.md). +- `accountProvider: SmartAccountClient` -- See [SmartAccountClient](/packages/aa-core/smart-account-client/). diff --git a/site/pages/packages/aa-ethers/provider-adapter/fromEthersProvider.md b/site/pages/packages/aa-ethers/provider-adapter/fromEthersProvider.md new file mode 100644 index 0000000000..e8150056c0 --- /dev/null +++ b/site/pages/packages/aa-ethers/provider-adapter/fromEthersProvider.md @@ -0,0 +1,26 @@ +--- +title: EthersProviderAdapter • fromEthersProvider +description: Overview of the fromEthersProvider method on EthersProviderAdapter in aa-ethers +--- + +# fromEthersProvider + +`fromEthersProvider` is a static method on `EthersProviderAdapter` that converts an ethers.js `JsonRpcProvider` to an `EthersProviderAdapter`. + +## Usage + +```ts [ethers-provider.ts] +// [!include ~/snippets/aa-ethers/ethers-provider.ts] +``` + +## Returns + +### `EthersProviderAdapter` + +An instance of `EthersProviderAdapter` + +## Parameters + +### `provider: JsonRpcProvider` + +The ethers JSON RPC provider to convert diff --git a/site/packages/aa-ethers/provider-adapter/getBundlerClient.md b/site/pages/packages/aa-ethers/provider-adapter/getBundlerClient.md similarity index 52% rename from site/packages/aa-ethers/provider-adapter/getBundlerClient.md rename to site/pages/packages/aa-ethers/provider-adapter/getBundlerClient.md index 16bac839df..c4d017162a 100644 --- a/site/packages/aa-ethers/provider-adapter/getBundlerClient.md +++ b/site/pages/packages/aa-ethers/provider-adapter/getBundlerClient.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: EthersProviderAdapter • getBundlerClient - - - meta - - name: description - content: Overview of the getBundlerClient method on EthersProviderAdapter in aa-ethers - - - meta - - property: og:description - content: Overview of the getBundlerClient method on EthersProviderAdapter in aa-ethers +title: EthersProviderAdapter • getBundlerClient +description: Overview of the getBundlerClient method on EthersProviderAdapter in aa-ethers --- # getBundlerClient @@ -18,7 +9,7 @@ head: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { provider } from "./ethers-provider"; @@ -27,7 +18,10 @@ import { provider } from "./ethers-provider"; const client = provider.getBundlerClient(); ``` -<<< @/snippets/aa-ethers/ethers-provider.ts +```ts [ethers-provider.ts] +// [!include ~/snippets/aa-ethers/ethers-provider.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-ethers/provider-adapter/introduction.md b/site/pages/packages/aa-ethers/provider-adapter/introduction.md similarity index 84% rename from site/packages/aa-ethers/provider-adapter/introduction.md rename to site/pages/packages/aa-ethers/provider-adapter/introduction.md index b7a92f7460..84059c445d 100644 --- a/site/packages/aa-ethers/provider-adapter/introduction.md +++ b/site/pages/packages/aa-ethers/provider-adapter/introduction.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: EthersProviderAdapter - - - meta - - name: description - content: Overview of the EthersProviderAdapter class in aa-ethers - - - meta - - property: og:description - content: Overview of the EthersProviderAdapter class in aa-ethers +title: EthersProviderAdapter +description: Overview of the EthersProviderAdapter class in aa-ethers --- # EthersProviderAdapter @@ -25,7 +16,7 @@ Notable differences between `EthersProviderAdapter` and `JsonRpcProvider` are im ## Usage -::: code-group +:::code-group ```ts [example.ts] import { provider } from "./ethers-provider"; @@ -57,5 +48,8 @@ const accountSigner = provider.connectToAccount( ); ``` -<<< @/snippets/aa-ethers/ethers-provider.ts +```ts [ethers-provider.ts] +// [!include ~/snippets/aa-ethers/ethers-provider.ts] +``` + ::: diff --git a/site/packages/aa-ethers/provider-adapter/send.md b/site/pages/packages/aa-ethers/provider-adapter/send.md similarity index 55% rename from site/packages/aa-ethers/provider-adapter/send.md rename to site/pages/packages/aa-ethers/provider-adapter/send.md index 25bfcb173b..4271af2c8f 100644 --- a/site/packages/aa-ethers/provider-adapter/send.md +++ b/site/pages/packages/aa-ethers/provider-adapter/send.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: EthersProviderAdapter • connectToAccount - - - meta - - name: description - content: Overview of the connectToAccount method on EthersProviderAdapter in aa-ethers - - - meta - - property: og:description - content: Overview of the connectToAccount method on EthersProviderAdapter in aa-ethers +title: EthersProviderAdapter • connectToAccount +description: Overview of the connectToAccount method on EthersProviderAdapter in aa-ethers --- # send @@ -18,7 +9,7 @@ head: ## Usage -::: code-group +:::code-group ```ts [example.ts] import { provider } from "./ethers-provider"; @@ -27,7 +18,10 @@ import { provider } from "./ethers-provider"; const chainId = await provider.send("eth_chainId", []); ``` -<<< @/snippets/aa-ethers/ethers-provider.ts +```ts [ethers-provider.ts] +// [!include ~/snippets/aa-ethers/ethers-provider.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-ethers/utils/convertEthersSignerToAccountSigner.md b/site/pages/packages/aa-ethers/utils/convertEthersSignerToAccountSigner.md similarity index 70% rename from site/packages/aa-ethers/utils/convertEthersSignerToAccountSigner.md rename to site/pages/packages/aa-ethers/utils/convertEthersSignerToAccountSigner.md index 6632c0d667..3f50ba02ae 100644 --- a/site/packages/aa-ethers/utils/convertEthersSignerToAccountSigner.md +++ b/site/pages/packages/aa-ethers/utils/convertEthersSignerToAccountSigner.md @@ -1,17 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Utils • convertEthersSignerToAccountSigner - - - meta - - name: description - content: Overview of the convertEthersSignerToAccountSigner method in aa-ethers - - - meta - - property: og:description - content: Overview of the convertEthersSignerToAccountSigner method in aa-ethers -next: - text: Glossary +title: Utils • convertEthersSignerToAccountSigner +description: Overview of the convertEthersSignerToAccountSigner method in aa-ethers --- # Utils @@ -22,15 +11,11 @@ Note that the `signTypedData` implementation is to throw an error since it is no ## Usage -::: code-group - ```ts [example.ts] // note that `signTypedData` is not supported by the Signer class, and so this util method cannot derive an implementation of said method for LocalAccountSigner const accountSigner = convertEthersSignerToAccountSigner(wallet); ``` -::: - ## Returns ### `SmartAccountSigner` diff --git a/site/packages/aa-ethers/utils/convertWalletToAccountSigner.md b/site/pages/packages/aa-ethers/utils/convertWalletToAccountSigner.md similarity index 63% rename from site/packages/aa-ethers/utils/convertWalletToAccountSigner.md rename to site/pages/packages/aa-ethers/utils/convertWalletToAccountSigner.md index ef5072473f..3f0e8a61e6 100644 --- a/site/packages/aa-ethers/utils/convertWalletToAccountSigner.md +++ b/site/pages/packages/aa-ethers/utils/convertWalletToAccountSigner.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Utils • convertWalletToAccountSigner - - - meta - - name: description - content: Overview of the convertWalletToAccountSigner method in aa-ethers - - - meta - - property: og:description - content: Overview of the convertWalletToAccountSigner method in aa-ethers +title: Utils • convertWalletToAccountSigner +description: Overview of the convertWalletToAccountSigner method in aa-ethers --- # Utils @@ -18,16 +9,12 @@ head: ## Usage -::: code-group - ```ts [example.ts] // Wallet is a subclass of Signer, and so can be used with either convertor method const wallet = new Wallet(process.env.PRIVATE_KEY!); const accountSigner = convertWalletToAccountSigner(wallet); ``` -::: - ## Returns ### `SmartAccountSigner` diff --git a/site/packages/aa-ethers/utils/introduction.md b/site/pages/packages/aa-ethers/utils/introduction.md similarity index 78% rename from site/packages/aa-ethers/utils/introduction.md rename to site/pages/packages/aa-ethers/utils/introduction.md index 96041114f1..04bd8e8bb5 100644 --- a/site/packages/aa-ethers/utils/introduction.md +++ b/site/pages/packages/aa-ethers/utils/introduction.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Utils - - - meta - - name: description - content: Overview of the Utils methods in aa-ethers - - - meta - - property: og:description - content: Overview of the Utils methods in aa-ethers +title: Utils +description: Overview of the Utils methods in aa-ethers --- # Utils @@ -23,8 +14,6 @@ Notable util methods include: ## Usage -::: code-group - ```ts [example.ts] // Wallet is a subclass of Signer, and so can be used with either convertor method const wallet = new Wallet(process.env.PRIVATE_KEY!); @@ -33,5 +22,3 @@ const accountSigner1 = convertWalletToAccountSigner(wallet); // note that `signTypedData` is not supported by the Signer class, and so this util method cannot derive an implementation of said method for LocalAccountSigner const accountSigner2 = convertEthersSignerToAccountSigner(wallet); ``` - -::: diff --git a/site/packages/aa-signers/arcana-auth/authenticate.md b/site/pages/packages/aa-signers/arcana-auth/authenticate.md similarity index 85% rename from site/packages/aa-signers/arcana-auth/authenticate.md rename to site/pages/packages/aa-signers/arcana-auth/authenticate.md index 4d13040cbe..3c15369957 100644 --- a/site/packages/aa-signers/arcana-auth/authenticate.md +++ b/site/pages/packages/aa-signers/arcana-auth/authenticate.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: ArcanaAuthSigner • authenticate - - - meta - - name: description - content: Overview of the authenticate method on ArcanaAuthSigner - - - meta - - property: og:description - content: Overview of the authenticate method on ArcanaAuthSigner +title: ArcanaAuthSigner • authenticate +description: Overview of the authenticate method on ArcanaAuthSigner --- # authenticate @@ -20,8 +11,6 @@ This method must be called before accessing the other methods available on the ` ## Usage -::: code-group - ```ts [example.ts] // [!code focus:99] import { ArcanaAuthSigner } from "@alchemy/aa-signers"; @@ -37,8 +26,6 @@ const newArcanaAuthSigner = new ArcanaAuthSigner({ const getUserInfo = await newArcanaAuthSigner.authenticate(); ``` -::: - ## Returns ### `Promise` diff --git a/site/packages/aa-signers/arcana-auth/constructor.md b/site/pages/packages/aa-signers/arcana-auth/constructor.md similarity index 85% rename from site/packages/aa-signers/arcana-auth/constructor.md rename to site/pages/packages/aa-signers/arcana-auth/constructor.md index 9d9e657613..f7e6068061 100644 --- a/site/packages/aa-signers/arcana-auth/constructor.md +++ b/site/pages/packages/aa-signers/arcana-auth/constructor.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: ArcanaAuthSigner • constructor - - - meta - - name: description - content: Overview of the constructor method on ArcanaAuthSigner in aa-signers - - - meta - - property: og:description - content: Overview of the constructor method on ArcanaAuthSigner in aa-signers +title: ArcanaAuthSigner • constructor +description: Overview of the constructor method on ArcanaAuthSigner in aa-signers --- # constructor @@ -18,8 +9,6 @@ To initialize `ArcanaAuthSigner`, you must provide a set of parameters detailed ## Usage -::: code-group - ```ts [example.ts] import { ArcanaAuthSigner } from "@alchemy/aa-signers"; @@ -41,8 +30,6 @@ const newArcanaAuthSigner = new ArcanaAuthSigner({ For details, see [`AuthProvider ConstructorParams`](https://authsdk-ref-guide.netlify.app/interfaces/constructorparams). -::: - ## Returns ### `ArcanaAuthSigner` diff --git a/site/packages/aa-signers/arcana-auth/getAddress.md b/site/pages/packages/aa-signers/arcana-auth/getAddress.md similarity index 61% rename from site/packages/aa-signers/arcana-auth/getAddress.md rename to site/pages/packages/aa-signers/arcana-auth/getAddress.md index 0e8186d8ca..3475d6b826 100644 --- a/site/packages/aa-signers/arcana-auth/getAddress.md +++ b/site/pages/packages/aa-signers/arcana-auth/getAddress.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: ArcanaAuthSigner • getAddress - - - meta - - name: description - content: Overview of the getAddress method on ArcanaAuthSigner - - - meta - - property: og:description - content: Overview of the getAddress method on ArcanaAuthSigner +title: ArcanaAuthSigner • getAddress +description: Overview of the getAddress method on ArcanaAuthSigner --- # getAddress @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/arcana-au ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createArcanaAuthSigner } from "./arcana-auth"; @@ -30,7 +21,10 @@ const newArcanaAuthSigner = await createArcanaAuthSigner(); const address = await newArcanaAuthSigner.getAddress(); ``` -<<< @/snippets/signers/arcana-auth.ts +```ts [arcana-auth.ts] +// [!include ~/snippets/signers/arcana-auth.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/arcana-auth/getAuthDetails.md b/site/pages/packages/aa-signers/arcana-auth/getAuthDetails.md similarity index 80% rename from site/packages/aa-signers/arcana-auth/getAuthDetails.md rename to site/pages/packages/aa-signers/arcana-auth/getAuthDetails.md index 5bf4628b03..c6366697af 100644 --- a/site/packages/aa-signers/arcana-auth/getAuthDetails.md +++ b/site/pages/packages/aa-signers/arcana-auth/getAuthDetails.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: ArcanaAuthSigner • getAuthDetails - - - meta - - name: description - content: Overview of the getAuthDetails method on ArcanaAuthSigner - - - meta - - property: og:description - content: Overview of the getAuthDetails method on ArcanaAuthSigner +title: ArcanaAuthSigner • getAuthDetails +description: Overview of the getAuthDetails method on ArcanaAuthSigner --- # getAuthDetails @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/arcana-au ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createArcanaAuthSigner } from "./arcana-auth"; @@ -30,7 +21,10 @@ const newArcanaAuthSigner = await createArcanaAuthSigner(); const details = await newArcanaAuthSigner.getAuthDetails(); ``` -<<< @/snippets/signers/arcana-auth.ts +```ts [arcana-auth.ts] +// [!include ~/snippets/signers/arcana-auth.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/arcana-auth/introduction.md b/site/pages/packages/aa-signers/arcana-auth/introduction.md similarity index 87% rename from site/packages/aa-signers/arcana-auth/introduction.md rename to site/pages/packages/aa-signers/arcana-auth/introduction.md index 28fc764d79..26b41c06e6 100644 --- a/site/packages/aa-signers/arcana-auth/introduction.md +++ b/site/pages/packages/aa-signers/arcana-auth/introduction.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: ArcanaAuthSigner - - - meta - - name: description - content: Overview of the ArcanaAuthSigner class in aa-signers - - - meta - - property: og:description - content: Overview of the ArcanaAuthSigner class in aa-signers +title: ArcanaAuthSigner +description: Overview of the ArcanaAuthSigner class in aa-signers --- # Arcana Auth Signer @@ -28,7 +19,7 @@ head: `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 +:::code-group ```bash [npm] npm i -s @arcana/auth @@ -40,7 +31,7 @@ yarn add @arcana/auth ## Usage -::: code-group +:::code-group ```ts [example.ts] import { ArcanaAuthSigner } from "@alchemy/aa-signers/arcana-auth"; @@ -81,7 +72,10 @@ const typedData = { const signTypedData = await newArcanaAuthSigner.signTypedData(typedData); ``` -<<< @/snippets/signers/arcana-auth.ts +```ts [arcana-auth.ts] +// [!include ~/snippets/signers/arcana-auth.ts] +``` + ::: ## Developer Links diff --git a/site/packages/aa-signers/arcana-auth/signMessage.md b/site/pages/packages/aa-signers/arcana-auth/signMessage.md similarity index 65% rename from site/packages/aa-signers/arcana-auth/signMessage.md rename to site/pages/packages/aa-signers/arcana-auth/signMessage.md index 135ed0a7bd..0a30dc1381 100644 --- a/site/packages/aa-signers/arcana-auth/signMessage.md +++ b/site/pages/packages/aa-signers/arcana-auth/signMessage.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: ArcanaAuthSigner • signMessage - - - meta - - name: description - content: Overview of the signMessage method on ArcanaAuthSigner - - - meta - - property: og:description - content: Overview of the signMessage method on ArcanaAuthSigner +title: ArcanaAuthSigner • signMessage +description: Overview of the signMessage method on ArcanaAuthSigner --- # signMessage @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/arcana-au ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createArcanaAuthSigner } from "./arcana-auth"; @@ -32,7 +23,10 @@ const signedMessage = await newArcanaAuthSigner.signMessage( ); ``` -<<< @/snippets/signers/arcana-auth.ts +```ts [arcana-auth.ts] +// [!include ~/snippets/signers/arcana-auth.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/arcana-auth/signTypedData.md b/site/pages/packages/aa-signers/arcana-auth/signTypedData.md similarity index 81% rename from site/packages/aa-signers/arcana-auth/signTypedData.md rename to site/pages/packages/aa-signers/arcana-auth/signTypedData.md index 6bf9a3de58..223fe361ea 100644 --- a/site/packages/aa-signers/arcana-auth/signTypedData.md +++ b/site/pages/packages/aa-signers/arcana-auth/signTypedData.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: ArcanaAuthSigner • signTypedData - - - meta - - name: description - content: Overview of the signTypedData method on ArcanaAuthSigner - - - meta - - property: og:description - content: Overview of the signTypedData method on ArcanaAuthSigner +title: ArcanaAuthSigner • signTypedData +description: Overview of the signTypedData method on ArcanaAuthSigner --- # signTypedData @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/arcana-au ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createArcanaAuthSigner } from "./arcana-auth"; @@ -60,7 +51,10 @@ const signedTypedData = await newArcanaAuthSigner.signTypedData({ }); ``` -<<< @/snippets/signers/arcana-auth.ts +```ts [arcana-auth.ts] +// [!include ~/snippets/signers/arcana-auth.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/capsule/authenticate.md b/site/pages/packages/aa-signers/capsule/authenticate.md similarity index 81% rename from site/packages/aa-signers/capsule/authenticate.md rename to site/pages/packages/aa-signers/capsule/authenticate.md index b4182cd4fa..151405bb3f 100644 --- a/site/packages/aa-signers/capsule/authenticate.md +++ b/site/pages/packages/aa-signers/capsule/authenticate.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: CapsuleSigner • authenticate - - - meta - - name: description - content: Overview of the authenticate method on CapsuleSigner - - - meta - - property: og:description - content: Overview of the authenticate method on CapsuleSigner +title: CapsuleSigner • authenticate +description: Overview of the authenticate method on CapsuleSigner --- # authenticate @@ -20,8 +11,6 @@ You must call this method before accessing the other methods available on the `C ## Usage -::: code-group - ```ts [example.ts] // [!code focus:99] import { CapsuleSigner } from "@alchemy/aa-signers/capsule"; @@ -42,8 +31,6 @@ await capsuleSigner.authenticate(); // 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` diff --git a/site/packages/aa-signers/capsule/constructor.md b/site/pages/packages/aa-signers/capsule/constructor.md similarity index 86% rename from site/packages/aa-signers/capsule/constructor.md rename to site/pages/packages/aa-signers/capsule/constructor.md index 299849dc1d..648772d580 100644 --- a/site/packages/aa-signers/capsule/constructor.md +++ b/site/pages/packages/aa-signers/capsule/constructor.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: CapsuleSigner • constructor - - - meta - - name: description - content: Overview of the constructor method on CapsuleSigner in aa-signers - - - meta - - property: og:description - content: Overview of the constructor method on CapsuleSigner in aa-signers +title: CapsuleSigner • constructor +description: Overview of the constructor method on CapsuleSigner in aa-signers --- # constructor @@ -18,8 +9,6 @@ To initialize a `CapsuleSigner`, you must provide a set of parameters detailed b ## Usage -::: code-group - ```ts [example.ts] import { CapsuleSigner } from "@alchemy/aa-signers/capsule"; import { ChainId } from "@capsule/capsule-web3-provider"; @@ -36,8 +25,6 @@ const capsuleSigner = new CapsuleSigner({ }); ``` -::: - ## Returns ### `CapsuleSigner` @@ -48,17 +35,17 @@ A new instance of a `CapsuleSigner`. ### `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.html) as well. +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.html#parameters). +- `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.html). +- `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. diff --git a/site/packages/aa-signers/capsule/getAddress.md b/site/pages/packages/aa-signers/capsule/getAddress.md similarity index 60% rename from site/packages/aa-signers/capsule/getAddress.md rename to site/pages/packages/aa-signers/capsule/getAddress.md index bd2c98cd23..60fd8545fd 100644 --- a/site/packages/aa-signers/capsule/getAddress.md +++ b/site/pages/packages/aa-signers/capsule/getAddress.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: CapsuleSigner • getAddress - - - meta - - name: description - content: Overview of the getAddress method on CapsuleSigner - - - meta - - property: og:description - content: Overview of the getAddress method on CapsuleSigner +title: CapsuleSigner • getAddress +description: Overview of the getAddress method on CapsuleSigner --- # getAddress @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/capsule/a ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createCapsuleSigner } from "./capsule"; @@ -30,7 +21,10 @@ const capsuleSigner = await createCapsuleSigner(); const address = await capsuleSigner.getAddress(); ``` -<<< @/snippets/signers/capsule.ts +```ts [capsule.ts] +// [!include ~/snippets/signers/capsule.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/capsule/getAuthDetails.md b/site/pages/packages/aa-signers/capsule/getAuthDetails.md similarity index 73% rename from site/packages/aa-signers/capsule/getAuthDetails.md rename to site/pages/packages/aa-signers/capsule/getAuthDetails.md index df650e8531..4f0476f0de 100644 --- a/site/packages/aa-signers/capsule/getAuthDetails.md +++ b/site/pages/packages/aa-signers/capsule/getAuthDetails.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: CapsuleSigner • getAuthDetails - - - meta - - name: description - content: Overview of the getAuthDetails method on CapsuleSigner - - - meta - - property: og:description - content: Overview of the getAuthDetails method on CapsuleSigner +title: CapsuleSigner • getAuthDetails +description: Overview of the getAuthDetails method on CapsuleSigner --- # getAuthDetails @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/capsule/a ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createCapsuleSigner } from "./capsule"; @@ -30,7 +21,10 @@ const capsuleSigner = await createCapsuleSigner(); const details = await capsuleSigner.getAuthDetails(); ``` -<<< @/snippets/signers/capsule.ts +```ts [capsule.ts] +// [!include ~/snippets/signers/capsule.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/capsule/introduction.md b/site/pages/packages/aa-signers/capsule/introduction.md similarity index 84% rename from site/packages/aa-signers/capsule/introduction.md rename to site/pages/packages/aa-signers/capsule/introduction.md index 5d23b7d212..4b9db3f01d 100644 --- a/site/packages/aa-signers/capsule/introduction.md +++ b/site/pages/packages/aa-signers/capsule/introduction.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: CapsuleSigner - - - meta - - name: description - content: Overview of the CapsuleSigner class in aa-signers - - - meta - - property: og:description - content: Overview of the CapsuleSigner class in aa-signers +title: CapsuleSigner +description: Overview of the CapsuleSigner class in aa-signers --- # Capsule Signer @@ -28,7 +19,7 @@ head: `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 +:::code-group ```bash [npm] npm i -s @usecapsule/web-sdk @@ -40,7 +31,7 @@ yarn add @usecapsule/web-sdk ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createCapsuleSigner } from "./capsule"; @@ -65,7 +56,10 @@ const typedData = { const signTypedData = await capsuleSigner.signTypedData(typedData); ``` -<<< @/snippets/signers/capsule.ts +```ts [capsule.ts] +// [!include ~/snippets/signers/capsule.ts] +``` + ::: ## Developer Links diff --git a/site/packages/aa-signers/capsule/signMessage.md b/site/pages/packages/aa-signers/capsule/signMessage.md similarity index 64% rename from site/packages/aa-signers/capsule/signMessage.md rename to site/pages/packages/aa-signers/capsule/signMessage.md index a60f789d6a..2f2549d93d 100644 --- a/site/packages/aa-signers/capsule/signMessage.md +++ b/site/pages/packages/aa-signers/capsule/signMessage.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: CapsuleSigner • signMessage - - - meta - - name: description - content: Overview of the signMessage method on CapsuleSigner - - - meta - - property: og:description - content: Overview of the signMessage method on CapsuleSigner +title: CapsuleSigner • signMessage +description: Overview of the signMessage method on CapsuleSigner --- # signMessage @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/capsule/a ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createCapsuleSigner } from "./capsule"; @@ -30,7 +21,10 @@ const capsuleSigner = await createCapsuleSigner(); const signedMessage = await capsuleSigner.signMessage("test"); ``` -<<< @/snippets/signers/capsule.ts +```ts [capsule.ts] +// [!include ~/snippets/signers/capsule.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/capsule/signTypedData.md b/site/pages/packages/aa-signers/capsule/signTypedData.md similarity index 81% rename from site/packages/aa-signers/capsule/signTypedData.md rename to site/pages/packages/aa-signers/capsule/signTypedData.md index 4a0116d66a..301b7a303b 100644 --- a/site/packages/aa-signers/capsule/signTypedData.md +++ b/site/pages/packages/aa-signers/capsule/signTypedData.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: CapsuleSigner • signTypedData - - - meta - - name: description - content: Overview of the signTypedData method on CapsuleSigner - - - meta - - property: og:description - content: Overview of the signTypedData method on CapsuleSigner +title: CapsuleSigner • signTypedData +description: Overview of the signTypedData method on CapsuleSigner --- # signTypedData @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/capsule/a ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createCapsuleSigner } from "./capsule"; @@ -60,7 +51,10 @@ const signedTypedData = await capsuleSigner.signTypedData({ }); ``` -<<< @/snippets/signers/capsule.ts +```ts [capsule.ts] +// [!include ~/snippets/signers/capsule.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/contributing.md b/site/pages/packages/aa-signers/contributing.md similarity index 73% rename from site/packages/aa-signers/contributing.md rename to site/pages/packages/aa-signers/contributing.md index e08bd8c415..12b1fa9a99 100644 --- a/site/packages/aa-signers/contributing.md +++ b/site/pages/packages/aa-signers/contributing.md @@ -1,17 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Contributing to aa-signers - - - meta - - name: description - content: How to add your own Signer Implementation to aa-signers - - - meta - - property: og:description - content: How to add your own Signer Implementation to aa-signers -next: - text: aa-ethers +title: Contributing to aa-signers +description: How to add your own Signer Implementation to aa-signers --- # Contributing to `aa-signers` diff --git a/site/packages/aa-signers/fireblocks/authenticate.md b/site/pages/packages/aa-signers/fireblocks/authenticate.md similarity index 72% rename from site/packages/aa-signers/fireblocks/authenticate.md rename to site/pages/packages/aa-signers/fireblocks/authenticate.md index 01724458d9..fe9ad742fd 100644 --- a/site/packages/aa-signers/fireblocks/authenticate.md +++ b/site/pages/packages/aa-signers/fireblocks/authenticate.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: FireblocksSigner • authenticate - - - meta - - name: description - content: Overview of the authenticate method on FireblocksSigner - - - meta - - property: og:description - content: Overview of the authenticate method on FireblocksSigner +title: FireblocksSigner • authenticate +description: Overview of the authenticate method on FireblocksSigner --- # authenticate @@ -20,8 +11,6 @@ You must call this method before accessing the other methods available on the `F ## Usage -::: code-group - ```ts [example.ts] // [!code focus:99] import { FireblocksSigner } from "@alchemy/aa-signers/fireblocks"; @@ -36,8 +25,6 @@ const fireblocksSigner = new FireblocksSigner({ await fireblocksSigner.authenticate(); ``` -::: - ## Returns ### `Promise` diff --git a/site/packages/aa-signers/fireblocks/constructor.md b/site/pages/packages/aa-signers/fireblocks/constructor.md similarity index 90% rename from site/packages/aa-signers/fireblocks/constructor.md rename to site/pages/packages/aa-signers/fireblocks/constructor.md index 1720732a68..3bc987d140 100644 --- a/site/packages/aa-signers/fireblocks/constructor.md +++ b/site/pages/packages/aa-signers/fireblocks/constructor.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: FireblocksSigner • constructor - - - meta - - name: description - content: Overview of the constructor method on FireblocksSigner in aa-signers - - - meta - - property: og:description - content: Overview of the constructor method on FireblocksSigner in aa-signers +title: FireblocksSigner • constructor +description: Overview of the constructor method on FireblocksSigner in aa-signers --- # constructor @@ -18,8 +9,6 @@ To initialize a `FireblocksSigner`, you must provide a set of parameters detaile ## Usage -::: code-group - ```ts [example.ts] import { FireblocksSigner } from "@alchemy/aa-signers/fireblocks"; import { ChainId } from "@fireblocks/fireblocks-web3-provider"; @@ -45,8 +34,6 @@ const fireblocksSigner = new FireblocksSigner({ }); ``` -::: - ## Returns ### `FireblocksSigner` diff --git a/site/packages/aa-signers/fireblocks/getAddress.md b/site/pages/packages/aa-signers/fireblocks/getAddress.md similarity index 60% rename from site/packages/aa-signers/fireblocks/getAddress.md rename to site/pages/packages/aa-signers/fireblocks/getAddress.md index 54ee6ddc87..901f995ef2 100644 --- a/site/packages/aa-signers/fireblocks/getAddress.md +++ b/site/pages/packages/aa-signers/fireblocks/getAddress.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: FireblocksSigner • getAddress - - - meta - - name: description - content: Overview of the getAddress method on FireblocksSigner - - - meta - - property: og:description - content: Overview of the getAddress method on FireblocksSigner +title: FireblocksSigner • getAddress +description: Overview of the getAddress method on FireblocksSigner --- # getAddress @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/fireblock ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createFireblocksSigner } from "./fireblocks"; @@ -30,7 +21,10 @@ const fireblocksSigner = await createFireblocksSigner(); const address = await fireblocksSigner.getAddress(); ``` -<<< @/snippets/signers/fireblocks.ts +```ts [fireblocks.ts] +// [!include ~/snippets/signers/fireblocks.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/fireblocks/getAuthDetails.md b/site/pages/packages/aa-signers/fireblocks/getAuthDetails.md similarity index 67% rename from site/packages/aa-signers/fireblocks/getAuthDetails.md rename to site/pages/packages/aa-signers/fireblocks/getAuthDetails.md index 83a9637144..11fbe6b7ce 100644 --- a/site/packages/aa-signers/fireblocks/getAuthDetails.md +++ b/site/pages/packages/aa-signers/fireblocks/getAuthDetails.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: FireblocksSigner • getAuthDetails - - - meta - - name: description - content: Overview of the getAuthDetails method on FireblocksSigner - - - meta - - property: og:description - content: Overview of the getAuthDetails method on FireblocksSigner +title: FireblocksSigner • getAuthDetails +description: Overview of the getAuthDetails method on FireblocksSigner --- # getAuthDetails @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/fireblock ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createFireblocksSigner } from "./fireblocks"; @@ -30,7 +21,10 @@ const fireblocksSigner = await createFireblocksSigner(); const details = await fireblocksSigner.getAuthDetails(); ``` -<<< @/snippets/signers/fireblocks.ts +```ts [fireblocks.ts] +// [!include ~/snippets/signers/fireblocks.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/fireblocks/introduction.md b/site/pages/packages/aa-signers/fireblocks/introduction.md similarity index 85% rename from site/packages/aa-signers/fireblocks/introduction.md rename to site/pages/packages/aa-signers/fireblocks/introduction.md index b442c795a4..be8765502e 100644 --- a/site/packages/aa-signers/fireblocks/introduction.md +++ b/site/pages/packages/aa-signers/fireblocks/introduction.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: FireblocksSigner - - - meta - - name: description - content: Overview of the FireblocksSigner class in aa-signers - - - meta - - property: og:description - content: Overview of the FireblocksSigner class in aa-signers +title: FireblocksSigner +description: Overview of the FireblocksSigner class in aa-signers --- # Fireblocks Signer @@ -28,7 +19,7 @@ head: `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 +:::code-group ```bash [npm] npm i -s @fireblocks/fireblocks-web3-provider @@ -40,7 +31,7 @@ yarn add @fireblocks/fireblocks-web3-provider ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createFireblocksSigner } from "./fireblocks"; @@ -65,7 +56,10 @@ const typedData = { const signTypedData = await fireblocksSigner.signTypedData(typedData); ``` -<<< @/snippets/signers/fireblocks.ts +```ts [fireblocks.ts] +// [!include ~/snippets/signers/fireblocks.ts] +``` + ::: ## Developer Links diff --git a/site/packages/aa-signers/fireblocks/signMessage.md b/site/pages/packages/aa-signers/fireblocks/signMessage.md similarity index 64% rename from site/packages/aa-signers/fireblocks/signMessage.md rename to site/pages/packages/aa-signers/fireblocks/signMessage.md index b335c1d099..b72aa691fa 100644 --- a/site/packages/aa-signers/fireblocks/signMessage.md +++ b/site/pages/packages/aa-signers/fireblocks/signMessage.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: FireblocksSigner • signMessage - - - meta - - name: description - content: Overview of the signMessage method on FireblocksSigner - - - meta - - property: og:description - content: Overview of the signMessage method on FireblocksSigner +title: FireblocksSigner • signMessage +description: Overview of the signMessage method on FireblocksSigner --- # signMessage @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/fireblock ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createFireblocksSigner } from "./fireblocks"; @@ -30,7 +21,10 @@ const fireblocksSigner = await createFireblocksSigner(); const signedMessage = await fireblocksSigner.signMessage("test"); ``` -<<< @/snippets/signers/fireblocks.ts +```ts [fireblocks.ts] +// [!include ~/snippets/signers/fireblocks.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/fireblocks/signTypedData.md b/site/pages/packages/aa-signers/fireblocks/signTypedData.md similarity index 81% rename from site/packages/aa-signers/fireblocks/signTypedData.md rename to site/pages/packages/aa-signers/fireblocks/signTypedData.md index 340ff9fc09..052207172a 100644 --- a/site/packages/aa-signers/fireblocks/signTypedData.md +++ b/site/pages/packages/aa-signers/fireblocks/signTypedData.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: FireblocksSigner • signTypedData - - - meta - - name: description - content: Overview of the signTypedData method on FireblocksSigner - - - meta - - property: og:description - content: Overview of the signTypedData method on FireblocksSigner +title: FireblocksSigner • signTypedData +description: Overview of the signTypedData method on FireblocksSigner --- # signTypedData @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/fireblock ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createFireblocksSigner } from "./fireblocks"; @@ -60,7 +51,10 @@ const signedTypedData = await fireblocksSigner.signTypedData({ }); ``` -<<< @/snippets/signers/fireblocks.ts +```ts [fireblocks.ts] +// [!include ~/snippets/signers/fireblocks.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/fordefi/authenticate.md b/site/pages/packages/aa-signers/fordefi/authenticate.md similarity index 67% rename from site/packages/aa-signers/fordefi/authenticate.md rename to site/pages/packages/aa-signers/fordefi/authenticate.md index fab100ad98..8db8c41d87 100644 --- a/site/packages/aa-signers/fordefi/authenticate.md +++ b/site/pages/packages/aa-signers/fordefi/authenticate.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: FordefiSigner • authenticate - - - meta - - name: description - content: Overview of the authenticate method on FordefiSigner - - - meta - - property: og:description - content: Overview of the authenticate method on FordefiSigner +title: FordefiSigner • authenticate +description: Overview of the authenticate method on FordefiSigner --- # authenticate @@ -20,8 +11,6 @@ You must call this method before accessing the other methods available on the `F ## Usage -::: code-group - ```ts [example.ts] // [!code focus:99] import { FordefiSigner } from "@alchemy/aa-signers/fordefi"; @@ -35,5 +24,3 @@ const fordefiSigner = new FordefiSigner({ await fordefiSigner.authenticate(); ``` - -::: diff --git a/site/packages/aa-signers/fordefi/constructor.md b/site/pages/packages/aa-signers/fordefi/constructor.md similarity index 81% rename from site/packages/aa-signers/fordefi/constructor.md rename to site/pages/packages/aa-signers/fordefi/constructor.md index c1199c50db..0f0c85fc0c 100644 --- a/site/packages/aa-signers/fordefi/constructor.md +++ b/site/pages/packages/aa-signers/fordefi/constructor.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: FordefiSigner • constructor - - - meta - - name: description - content: Overview of the constructor method on FordefiSigner in aa-signers - - - meta - - property: og:description - content: Overview of the constructor method on FordefiSigner in aa-signers +title: FordefiSigner • constructor +description: Overview of the constructor method on FordefiSigner in aa-signers --- # constructor @@ -18,8 +9,6 @@ To initialize a `FordefiSigner`, you must provide a set of parameters detailed b ## Usage -::: code-group - ```ts [example.ts] import { FordefiSigner } from "@alchemy/aa-signers/fordefi"; @@ -32,8 +21,6 @@ const fordefiSigner = new FordefiSigner({ }); ``` -::: - ## Returns ### `FordefiSigner` diff --git a/site/packages/aa-signers/fordefi/getAddress.md b/site/pages/packages/aa-signers/fordefi/getAddress.md similarity index 61% rename from site/packages/aa-signers/fordefi/getAddress.md rename to site/pages/packages/aa-signers/fordefi/getAddress.md index 60d9014f41..f358dc0305 100644 --- a/site/packages/aa-signers/fordefi/getAddress.md +++ b/site/pages/packages/aa-signers/fordefi/getAddress.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: FordefiSigner • getAddress - - - meta - - name: description - content: Overview of the getAddress method on FordefiSigner - - - meta - - property: og:description - content: Overview of the getAddress method on FordefiSigner +title: FordefiSigner • getAddress +description: Overview of the getAddress method on FordefiSigner --- # getAddress @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/fordefi/a ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createFordefiSigner } from "./fordefi"; @@ -30,7 +21,10 @@ const fordefiSigner = await createFordefiSigner(); const address = await fordefiSigner.getAddress(); ``` -<<< @/snippets/signers/fordefi.ts +```ts [fordefi.ts] +// [!include ~/snippets/signers/fordefi.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/fordefi/getAuthDetails.md b/site/pages/packages/aa-signers/fordefi/getAuthDetails.md similarity index 62% rename from site/packages/aa-signers/fordefi/getAuthDetails.md rename to site/pages/packages/aa-signers/fordefi/getAuthDetails.md index e174037d7e..1e24222965 100644 --- a/site/packages/aa-signers/fordefi/getAuthDetails.md +++ b/site/pages/packages/aa-signers/fordefi/getAuthDetails.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: FordefiSigner • getAuthDetails - - - meta - - name: description - content: Overview of the getAuthDetails method on FordefiSigner - - - meta - - property: og:description - content: Overview of the getAuthDetails method on FordefiSigner +title: FordefiSigner • getAuthDetails +description: Overview of the getAuthDetails method on FordefiSigner --- # getAuthDetails @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/fordefi/a ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createFordefiSigner } from "./fordefi"; @@ -30,7 +21,10 @@ const fordefiSigner = await createFordefiSigner(); const details = await fordefiSigner.getAuthDetails(); ``` -<<< @/snippets/signers/fordefi.ts +```ts [fordefi.ts] +// [!include ~/snippets/signers/fordefi.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/fordefi/introduction.md b/site/pages/packages/aa-signers/fordefi/introduction.md similarity index 85% rename from site/packages/aa-signers/fordefi/introduction.md rename to site/pages/packages/aa-signers/fordefi/introduction.md index 3d94b69351..011d1ecde0 100644 --- a/site/packages/aa-signers/fordefi/introduction.md +++ b/site/pages/packages/aa-signers/fordefi/introduction.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: FordefiSigner - - - meta - - name: description - content: Overview of the FordefiSigner class in aa-signers - - - meta - - property: og:description - content: Overview of the FordefiSigner class in aa-signers +title: FordefiSigner +description: Overview of the FordefiSigner class in aa-signers --- # Fordefi Signer @@ -28,7 +19,7 @@ head: `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 +:::code-group ```bash [npm] npm i -s @fordefi/web3-provider @@ -42,7 +33,7 @@ yarn add @fordefi/web3-provider ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createFordefiSigner } from "./fordefi"; @@ -67,7 +58,10 @@ const typedData = { const signTypedData = await fordefiSigner.signTypedData(typedData); ``` -<<< @/snippets/signers/fordefi.ts +```ts [fordefi.ts] +// [!include ~/snippets/signers/fordefi.ts] +``` + ::: ## Developer Links diff --git a/site/packages/aa-signers/fordefi/signMessage.md b/site/pages/packages/aa-signers/fordefi/signMessage.md similarity index 64% rename from site/packages/aa-signers/fordefi/signMessage.md rename to site/pages/packages/aa-signers/fordefi/signMessage.md index 87cbd82217..a0463856ce 100644 --- a/site/packages/aa-signers/fordefi/signMessage.md +++ b/site/pages/packages/aa-signers/fordefi/signMessage.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: FordefiSigner • signMessage - - - meta - - name: description - content: Overview of the signMessage method on FordefiSigner - - - meta - - property: og:description - content: Overview of the signMessage method on FordefiSigner +title: FordefiSigner • signMessage +description: Overview of the signMessage method on FordefiSigner --- # signMessage @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/fordefi/a ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createFordefiSigner } from "./fordefi"; @@ -30,7 +21,10 @@ const fordefiSigner = await createFordefiSigner(); const signedMessage = await fordefiSigner.signMessage("test"); ``` -<<< @/snippets/signers/fordefi.ts +```ts [fordefi.ts] +// [!include ~/snippets/signers/fordefi.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/fordefi/signTypedData.md b/site/pages/packages/aa-signers/fordefi/signTypedData.md similarity index 81% rename from site/packages/aa-signers/fordefi/signTypedData.md rename to site/pages/packages/aa-signers/fordefi/signTypedData.md index 6b17f96ba1..e1596d91d9 100644 --- a/site/packages/aa-signers/fordefi/signTypedData.md +++ b/site/pages/packages/aa-signers/fordefi/signTypedData.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: FordefiSigner • signTypedData - - - meta - - name: description - content: Overview of the signTypedData method on FordefiSigner - - - meta - - property: og:description - content: Overview of the signTypedData method on FordefiSigner +title: FordefiSigner • signTypedData +description: Overview of the signTypedData method on FordefiSigner --- # signTypedData @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/fordefi/a ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createFordefiSigner } from "./fordefi"; @@ -60,7 +51,10 @@ const signedTypedData = await fordefiSigner.signTypedData({ }); ``` -<<< @/snippets/signers/fordefi.ts +```ts [fordefi.ts] +// [!include ~/snippets/signers/fordefi.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/index.md b/site/pages/packages/aa-signers/index.md similarity index 64% rename from site/packages/aa-signers/index.md rename to site/pages/packages/aa-signers/index.md index f84d364845..095578f466 100644 --- a/site/packages/aa-signers/index.md +++ b/site/pages/packages/aa-signers/index.md @@ -1,20 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: aa-signers - - - meta - - name: description - content: aa-signers landing page and getting started guide - - - meta - - property: og:description - content: aa-signers landing page and getting started guide -prev: - text: aa-accounts - link: /packages/aa-accounts/index -next: - text: Magic +title: aa-signers +description: aa-signers landing page and getting started guide --- # `@alchemy/aa-signers` @@ -25,7 +11,7 @@ This package contains various implementations of the `SmartAccountSigner` and `S 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 +:::code-group ```bash [yarn] yarn add @alchemy/aa-signers diff --git a/site/packages/aa-signers/lit-protocol/authenticate.md b/site/pages/packages/aa-signers/lit-protocol/authenticate.md similarity index 89% rename from site/packages/aa-signers/lit-protocol/authenticate.md rename to site/pages/packages/aa-signers/lit-protocol/authenticate.md index a1246d1749..8e886d9117 100644 --- a/site/packages/aa-signers/lit-protocol/authenticate.md +++ b/site/pages/packages/aa-signers/lit-protocol/authenticate.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: LitSigner • authenticate - - - meta - - name: description - content: Overview of the authenticate method on LitSigner - - - meta - - property: og:description - content: Overview of the authenticate method on LitSigner +title: LitSigner • authenticate +description: Overview of the authenticate method on LitSigner --- # authenticate @@ -30,8 +21,6 @@ If a `Session Signature` is given then the session will be respected as long as ### Auth Method -::: code-group - ```ts [example.ts] import { LitSigner, @@ -58,12 +47,8 @@ const authDetails = await litSigner.authenticate({ }); ``` -::: - ### Session Signatures -::: code-group - ```ts [example.ts] import { LitSigner, @@ -88,8 +73,6 @@ const authDetails = await litSigner.authenticate({ }); ``` -::: - ## Returns ### `Promise` diff --git a/site/packages/aa-signers/lit-protocol/constructor.md b/site/pages/packages/aa-signers/lit-protocol/constructor.md similarity index 79% rename from site/packages/aa-signers/lit-protocol/constructor.md rename to site/pages/packages/aa-signers/lit-protocol/constructor.md index a33f208bfb..2de155c0ca 100644 --- a/site/packages/aa-signers/lit-protocol/constructor.md +++ b/site/pages/packages/aa-signers/lit-protocol/constructor.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: LitSigner • constructor - - - meta - - name: description - content: Overview of the constructor method on LitSigner in aa-signers - - - meta - - property: og:description - content: Overview of the constructor method on LitSigner in aa-signers +title: LitSigner • constructor +description: Overview of the constructor method on LitSigner in aa-signers --- # constructor @@ -21,8 +12,6 @@ If providing an `LitAuthMethod`, the auth method will be authenticated, creating A `Session Signature` can be provided and will be used as the active session, and will be returned from `Authenticate` and `AuthDetails`. -::: code-group - ```ts [example.ts] import { LitSigner, LitAuthMethod } from "@alchemy/aa-signers"; // [!code focus:99] @@ -48,8 +37,6 @@ new LitSigner({ }); ``` -::: - ## Returns A new instance of `LitSigner` diff --git a/site/packages/aa-signers/lit-protocol/getAddress.md b/site/pages/packages/aa-signers/lit-protocol/getAddress.md similarity index 62% rename from site/packages/aa-signers/lit-protocol/getAddress.md rename to site/pages/packages/aa-signers/lit-protocol/getAddress.md index 098af459a5..e69d2e75e3 100644 --- a/site/packages/aa-signers/lit-protocol/getAddress.md +++ b/site/pages/packages/aa-signers/lit-protocol/getAddress.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: LitSigner • getAddress - - - meta - - name: description - content: Overview of the getAddress method on LitSigner - - - meta - - property: og:description - content: Overview of the getAddress method on LitSigner +title: LitSigner • getAddress +description: Overview of the getAddress method on LitSigner --- # getAddress @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/lit-proto ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createLitSignerWithAuthMethod } from "./lit"; @@ -31,7 +22,10 @@ const litSigner = new createLitSignerWithAuthMethod(); const address = await litSigner.getAddress(); ``` -<<< @/snippets/signers/lit.ts +```ts [lit.ts] +// [!include ~/snippets/signers/lit.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/lit-protocol/getAuthDetails.md b/site/pages/packages/aa-signers/lit-protocol/getAuthDetails.md similarity index 77% rename from site/packages/aa-signers/lit-protocol/getAuthDetails.md rename to site/pages/packages/aa-signers/lit-protocol/getAuthDetails.md index 550b0b4e3e..d472480f5a 100644 --- a/site/packages/aa-signers/lit-protocol/getAuthDetails.md +++ b/site/pages/packages/aa-signers/lit-protocol/getAuthDetails.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: LitSigner • getAuthDetails - - - meta - - name: description - content: Overview of the getAuthDetails method on LitSigner - - - meta - - property: og:description - content: Overview of the getAuthDetails method on LitSigner +title: LitSigner • getAuthDetails +description: Overview of the getAuthDetails method on LitSigner --- # getAuthDetails @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/lit-proto ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createLitSignerWithAuthMethod } from "./lit"; @@ -36,7 +27,10 @@ await litSigner.authenticate({ let authDetails = await litSigner.getAuthDetails(); ``` -<<< @/snippets/signers/lit.ts +```ts [lit.ts] +// [!include ~/snippets/signers/lit.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/lit-protocol/introduction.md b/site/pages/packages/aa-signers/lit-protocol/introduction.md similarity index 79% rename from site/packages/aa-signers/lit-protocol/introduction.md rename to site/pages/packages/aa-signers/lit-protocol/introduction.md index c5370d9327..ae2efd7d59 100644 --- a/site/packages/aa-signers/lit-protocol/introduction.md +++ b/site/pages/packages/aa-signers/lit-protocol/introduction.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: LitSigner - - - meta - - name: description - content: Overview of the LitSigner class in aa-signers - - - meta - - property: og:description - content: Overview of the LitSigner class in aa-signers +title: LitSigner +description: Overview of the LitSigner class in aa-signers --- # Lit Signer @@ -26,7 +17,7 @@ For more information on Lit's supported authentication, see: [here](https://deve ## Install Dependencies -::: code-group +:::code-group ```bash [npm] npm i -s @lit-protocol/lit-node-client@cayenne diff --git a/site/packages/aa-signers/lit-protocol/signMessage.md b/site/pages/packages/aa-signers/lit-protocol/signMessage.md similarity index 65% rename from site/packages/aa-signers/lit-protocol/signMessage.md rename to site/pages/packages/aa-signers/lit-protocol/signMessage.md index bf319f2e0e..b14e273169 100644 --- a/site/packages/aa-signers/lit-protocol/signMessage.md +++ b/site/pages/packages/aa-signers/lit-protocol/signMessage.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: LitSigner • signMessage - - - meta - - name: description - content: Overview of the signMessage method on LitSigner - - - meta - - property: og:description - content: Overview of the signMessage method on LitSigner +title: LitSigner • signMessage +description: Overview of the signMessage method on LitSigner --- # signMessage @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/lit-proto ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createLitSignerWithAuthMethod } from "./lit"; @@ -31,7 +22,10 @@ const litSigner = new createLitSignerWithAuthMethod(); const signedMessage = await litSigner.signMessage("Hello World!"); ``` -<<< @/snippets/signers/lit.ts +```ts [lit.ts] +// [!include ~/snippets/signers/lit.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/lit-protocol/signTypedData.md b/site/pages/packages/aa-signers/lit-protocol/signTypedData.md similarity index 82% rename from site/packages/aa-signers/lit-protocol/signTypedData.md rename to site/pages/packages/aa-signers/lit-protocol/signTypedData.md index f0d1d3400f..d3db5370d4 100644 --- a/site/packages/aa-signers/lit-protocol/signTypedData.md +++ b/site/pages/packages/aa-signers/lit-protocol/signTypedData.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: LitSigner • signTypedData - - - meta - - name: description - content: Overview of the signTypedData method on LitSigner - - - meta - - property: og:description - content: Overview of the signTypedData method on LitSigner +title: LitSigner • signTypedData +description: Overview of the signTypedData method on LitSigner --- # signTypedData @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/lit-proto ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createLitSignerWithAuthMethod } from "./lit"; @@ -61,7 +52,10 @@ const signedTypedData = await litSigner.signTypedData({ }); ``` -<<< @/snippets/signers/lit.ts +```ts [lit.ts] +// [!include ~/snippets/signers/lit.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/magic/authenticate.md b/site/pages/packages/aa-signers/magic/authenticate.md similarity index 83% rename from site/packages/aa-signers/magic/authenticate.md rename to site/pages/packages/aa-signers/magic/authenticate.md index ee9e4de4f0..56f3aa89e8 100644 --- a/site/packages/aa-signers/magic/authenticate.md +++ b/site/pages/packages/aa-signers/magic/authenticate.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: MagicSigner • authenticate - - - meta - - name: description - content: Overview of the authenticate method on MagicSigner - - - meta - - property: og:description - content: Overview of the authenticate method on MagicSigner +title: MagicSigner • authenticate +description: Overview of the authenticate method on MagicSigner --- # authenticate @@ -20,8 +11,6 @@ This method must be called before accessing the other methods available on the ` ## Usage -::: code-group - ```ts [example.ts] // [!code focus:99] import { MagicSigner } from "@alchemy/aa-signers/magic"; @@ -36,8 +25,6 @@ const authParams = { await magicSigner.authenticate(authParams); ``` -::: - ## Returns ### `Promise` diff --git a/site/packages/aa-signers/magic/constructor.md b/site/pages/packages/aa-signers/magic/constructor.md similarity index 80% rename from site/packages/aa-signers/magic/constructor.md rename to site/pages/packages/aa-signers/magic/constructor.md index f2a026e6dd..24cca473e7 100644 --- a/site/packages/aa-signers/magic/constructor.md +++ b/site/pages/packages/aa-signers/magic/constructor.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: MagicSigner • constructor - - - meta - - name: description - content: Overview of the constructor method on MagicSigner in aa-signers - - - meta - - property: og:description - content: Overview of the constructor method on MagicSigner in aa-signers +title: MagicSigner • constructor +description: Overview of the constructor method on MagicSigner in aa-signers --- # constructor @@ -18,8 +9,6 @@ To initialize a `MagicSigner`, you must provide a set of parameters detailed bel ## Usage -::: code-group - ```ts [example.ts] import { MagicSigner } from "@alchemy/aa-signers/magic"; @@ -35,8 +24,6 @@ const magicSigner = new MagicSigner({ }); ``` -::: - ## Returns ### `MagicSigner` diff --git a/site/packages/aa-signers/magic/getAddress.md b/site/pages/packages/aa-signers/magic/getAddress.md similarity index 60% rename from site/packages/aa-signers/magic/getAddress.md rename to site/pages/packages/aa-signers/magic/getAddress.md index 7933e8b6f1..847bba5ef2 100644 --- a/site/packages/aa-signers/magic/getAddress.md +++ b/site/pages/packages/aa-signers/magic/getAddress.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: MagicSigner • getAddress - - - meta - - name: description - content: Overview of the getAddress method on MagicSigner - - - meta - - property: og:description - content: Overview of the getAddress method on MagicSigner +title: MagicSigner • getAddress +description: Overview of the getAddress method on MagicSigner --- # getAddress @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/magic/aut ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createMagicSigner } from "./magic"; @@ -30,7 +21,10 @@ const magicSigner = await createMagicSigner(); const address = await magicSigner.getAddress(); ``` -<<< @/snippets/signers/magic.ts +```ts [magic.ts] +// [!include ~/snippets/signers/magic.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/magic/getAuthDetails.md b/site/pages/packages/aa-signers/magic/getAuthDetails.md similarity index 76% rename from site/packages/aa-signers/magic/getAuthDetails.md rename to site/pages/packages/aa-signers/magic/getAuthDetails.md index dbe63e73bf..b5ca5c9c66 100644 --- a/site/packages/aa-signers/magic/getAuthDetails.md +++ b/site/pages/packages/aa-signers/magic/getAuthDetails.md @@ -1,17 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: MagicSigner • getAuthDetails - - - meta - - name: description - content: Overview of the getAuthDetails method on MagicSigner - - - meta - - property: og:description - content: Overview of the getAuthDetails method on MagicSigner -next: - text: Web3auth +title: MagicSigner • getAuthDetails +description: Overview of the getAuthDetails method on MagicSigner --- # getAuthDetails @@ -22,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/magic/aut ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createMagicSigner } from "./magic"; @@ -32,7 +21,10 @@ const magicSigner = await createMagicSigner(); const details = await magicSigner.getAuthDetails(); ``` -<<< @/snippets/signers/magic.ts +```ts [magic.ts] +// [!include ~/snippets/signers/magic.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/magic/introduction.md b/site/pages/packages/aa-signers/magic/introduction.md similarity index 85% rename from site/packages/aa-signers/magic/introduction.md rename to site/pages/packages/aa-signers/magic/introduction.md index a72d51e86a..3cd29ab51e 100644 --- a/site/packages/aa-signers/magic/introduction.md +++ b/site/pages/packages/aa-signers/magic/introduction.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: MagicSigner - - - meta - - name: description - content: Overview of the MagicSigner class in aa-signers - - - meta - - property: og:description - content: Overview of the MagicSigner class in aa-signers +title: MagicSigner +description: Overview of the MagicSigner class in aa-signers --- # Magic Signer @@ -28,7 +19,7 @@ head: `MagicSigner` requires installation of the [`magic-sdk`](https://github.com/magiclabs/magic-js) SDK. `aa-signers` lists it as an optional dependency. -::: code-group +:::code-group ```bash [npm] npm i -s magic-sdk @@ -40,7 +31,7 @@ yarn add magic-sdk ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createMagicSigner } from "./magic"; @@ -72,7 +63,10 @@ const typedData = { const signTypedData = await signer.signTypedData(typedData); ``` -<<< @/snippets/signers/magic.ts +```ts [magic.ts] +// [!include ~/snippets/signers/magic.ts] +``` + ::: ## Developer links diff --git a/site/packages/aa-signers/magic/signMessage.md b/site/pages/packages/aa-signers/magic/signMessage.md similarity index 64% rename from site/packages/aa-signers/magic/signMessage.md rename to site/pages/packages/aa-signers/magic/signMessage.md index f9200afcd6..5eaa23041e 100644 --- a/site/packages/aa-signers/magic/signMessage.md +++ b/site/pages/packages/aa-signers/magic/signMessage.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: MagicSigner • signMessage - - - meta - - name: description - content: Overview of the signMessage method on MagicSigner - - - meta - - property: og:description - content: Overview of the signMessage method on MagicSigner +title: MagicSigner • signMessage +description: Overview of the signMessage method on MagicSigner --- # signMessage @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/magic/aut ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createMagicSigner } from "./magic"; @@ -30,7 +21,10 @@ const magicSigner = await createMagicSigner(); const signedMessage = await magicSigner.signMessage("test"); ``` -<<< @/snippets/signers/magic.ts +```ts [magic.ts] +// [!include ~/snippets/signers/magic.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/magic/signTypedData.md b/site/pages/packages/aa-signers/magic/signTypedData.md similarity index 81% rename from site/packages/aa-signers/magic/signTypedData.md rename to site/pages/packages/aa-signers/magic/signTypedData.md index 7c2b5c4087..df6b37df29 100644 --- a/site/packages/aa-signers/magic/signTypedData.md +++ b/site/pages/packages/aa-signers/magic/signTypedData.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: MagicSigner • signTypedData - - - meta - - name: description - content: Overview of the signTypedData method on MagicSigner - - - meta - - property: og:description - content: Overview of the signTypedData method on MagicSigner +title: MagicSigner • signTypedData +description: Overview of the signTypedData method on MagicSigner --- # signTypedData @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/magic/aut ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createMagicSigner } from "./magic"; @@ -60,7 +51,10 @@ const signedTypedData = await magicSigner.signTypedData({ }); ``` -<<< @/snippets/signers/magic.ts +```ts [magic.ts] +// [!include ~/snippets/signers/magic.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/particle/authenticate.md b/site/pages/packages/aa-signers/particle/authenticate.md similarity index 88% rename from site/packages/aa-signers/particle/authenticate.md rename to site/pages/packages/aa-signers/particle/authenticate.md index 018c051a7c..7735b346c2 100644 --- a/site/packages/aa-signers/particle/authenticate.md +++ b/site/pages/packages/aa-signers/particle/authenticate.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: ParticleSigner • authenticate - - - meta - - name: description - content: Overview of the authenticate method on ParticleSigner - - - meta - - property: og:description - content: Overview of the authenticate method on ParticleSigner +title: ParticleSigner • authenticate +description: Overview of the authenticate method on ParticleSigner --- # authenticate @@ -20,8 +11,6 @@ You must call this method before accessing the other methods available on the `P ## Usage -::: code-group - ```ts [example.ts] // [!code focus:99] import { ParticleSigner } from "@alchemy/aa-signers/particle"; @@ -37,8 +26,6 @@ const particleSigner = new ParticleSigner({ await particleSigner.authenticate(); ``` -::: - ## Returns ### `Promise` diff --git a/site/packages/aa-signers/particle/constructor.md b/site/pages/packages/aa-signers/particle/constructor.md similarity index 90% rename from site/packages/aa-signers/particle/constructor.md rename to site/pages/packages/aa-signers/particle/constructor.md index e5b8ec6862..47fd7c13fa 100644 --- a/site/packages/aa-signers/particle/constructor.md +++ b/site/pages/packages/aa-signers/particle/constructor.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: ParticleSigner • constructor - - - meta - - name: description - content: Overview of the constructor method on ParticleSigner in aa-signers - - - meta - - property: og:description - content: Overview of the constructor method on ParticleSigner in aa-signers +title: ParticleSigner • constructor +description: Overview of the constructor method on ParticleSigner in aa-signers --- # constructor @@ -18,8 +9,6 @@ To initialize a `ParticleSigner`, you must provide a set of parameters detailed ## Usage -::: code-group - ```ts [example.ts] import { ParticleSigner } from "@alchemy/aa-signers/particle"; @@ -56,8 +45,6 @@ const particle = new ParticleNetwork({ }); ``` -::: - ## Returns ### `ParticleSigner` diff --git a/site/packages/aa-signers/particle/getAddress.md b/site/pages/packages/aa-signers/particle/getAddress.md similarity index 60% rename from site/packages/aa-signers/particle/getAddress.md rename to site/pages/packages/aa-signers/particle/getAddress.md index fba73a7f9d..27bd8c9291 100644 --- a/site/packages/aa-signers/particle/getAddress.md +++ b/site/pages/packages/aa-signers/particle/getAddress.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: ParticleSigner • getAddress - - - meta - - name: description - content: Overview of the getAddress method on ParticleSigner - - - meta - - property: og:description - content: Overview of the getAddress method on ParticleSigner +title: ParticleSigner • getAddress +description: Overview of the getAddress method on ParticleSigner --- # getAddress @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/particle/ ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createParticleSigner } from "./particle"; @@ -30,7 +21,10 @@ const particleSigner = await createParticleSigner(); const address = await particleSigner.getAddress(); ``` -<<< @/snippets/signers/particle.ts +```ts [particle.ts] +// [!include ~/snippets/signers/particle.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/particle/getAuthDetails.md b/site/pages/packages/aa-signers/particle/getAuthDetails.md similarity index 68% rename from site/packages/aa-signers/particle/getAuthDetails.md rename to site/pages/packages/aa-signers/particle/getAuthDetails.md index 3d7dda94f7..1f64a962b1 100644 --- a/site/packages/aa-signers/particle/getAuthDetails.md +++ b/site/pages/packages/aa-signers/particle/getAuthDetails.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: ParticleSigner • getAuthDetails - - - meta - - name: description - content: Overview of the getAuthDetails method on ParticleSigner - - - meta - - property: og:description - content: Overview of the getAuthDetails method on ParticleSigner +title: ParticleSigner • getAuthDetails +description: Overview of the getAuthDetails method on ParticleSigner --- # getAuthDetails @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/particle/ ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createParticleSigner } from "./particle"; @@ -30,7 +21,10 @@ const particleSigner = await createParticleSigner(); const details = await particleSigner.getAuthDetails(); ``` -<<< @/snippets/signers/particle.ts +```ts [particle.ts] +// [!include ~/snippets/signers/particle.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/particle/introduction.md b/site/pages/packages/aa-signers/particle/introduction.md similarity index 86% rename from site/packages/aa-signers/particle/introduction.md rename to site/pages/packages/aa-signers/particle/introduction.md index 20f42e05f6..6d6448bba4 100644 --- a/site/packages/aa-signers/particle/introduction.md +++ b/site/pages/packages/aa-signers/particle/introduction.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: ParticleSigner - - - meta - - name: description - content: Overview of the ParticleSigner class in aa-signers - - - meta - - property: og:description - content: Overview of the ParticleSigner class in aa-signers +title: ParticleSigner +description: Overview of the ParticleSigner class in aa-signers --- # Particle Signer @@ -28,7 +19,7 @@ head: `ParticleSigner` requires installation of the [`@particle-network/auth`](https://developers.particle.network/docs/building-with-particle-auth) and [`@particle-network/provider`](https://developers.particle.network/reference/auth-web). `aa-signers` lists them as optional dependencies. -::: code-group +:::code-group ```bash [npm] npm i -s @particle-network/auth @@ -42,7 +33,7 @@ yarn add @particle-network/provider ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createParticleSigner } from "./particle"; @@ -67,7 +58,10 @@ const typedData = { const signTypedData = await particleSigner.signTypedData(typedData); ``` -<<< @/snippets/signers/particle.ts +```ts [particle.ts] +// [!include ~/snippets/signers/particle.ts] +``` + ::: ## Developer Links diff --git a/site/packages/aa-signers/particle/signMessage.md b/site/pages/packages/aa-signers/particle/signMessage.md similarity index 64% rename from site/packages/aa-signers/particle/signMessage.md rename to site/pages/packages/aa-signers/particle/signMessage.md index 47dd69b65c..7df18ca8a5 100644 --- a/site/packages/aa-signers/particle/signMessage.md +++ b/site/pages/packages/aa-signers/particle/signMessage.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: ParticleSigner • signMessage - - - meta - - name: description - content: Overview of the signMessage method on ParticleSigner - - - meta - - property: og:description - content: Overview of the signMessage method on ParticleSigner +title: ParticleSigner • signMessage +description: Overview of the signMessage method on ParticleSigner --- # signMessage @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/particle/ ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createParticleSigner } from "./particle"; @@ -30,7 +21,10 @@ const particleSigner = await createParticleSigner(); const signedMessage = await particleSigner.signMessage("test"); ``` -<<< @/snippets/signers/particle.ts +```ts [particle.ts] +// [!include ~/snippets/signers/particle.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/particle/signTypedData.md b/site/pages/packages/aa-signers/particle/signTypedData.md similarity index 81% rename from site/packages/aa-signers/particle/signTypedData.md rename to site/pages/packages/aa-signers/particle/signTypedData.md index 42c225d8e9..b65e66a095 100644 --- a/site/packages/aa-signers/particle/signTypedData.md +++ b/site/pages/packages/aa-signers/particle/signTypedData.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: ParticleSigner • signTypedData - - - meta - - name: description - content: Overview of the signTypedData method on ParticleSigner - - - meta - - property: og:description - content: Overview of the signTypedData method on ParticleSigner +title: ParticleSigner • signTypedData +description: Overview of the signTypedData method on ParticleSigner --- # signTypedData @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/particle/ ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createParticleSigner } from "./particle"; @@ -60,7 +51,10 @@ const signedTypedData = await particleSigner.signTypedData({ }); ``` -<<< @/snippets/signers/particle.ts +```ts [particle.ts] +// [!include ~/snippets/signers/particle.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/passport/authenticate.md b/site/pages/packages/aa-signers/passport/authenticate.md similarity index 87% rename from site/packages/aa-signers/passport/authenticate.md rename to site/pages/packages/aa-signers/passport/authenticate.md index 3dc57c31cf..d1504d7344 100644 --- a/site/packages/aa-signers/passport/authenticate.md +++ b/site/pages/packages/aa-signers/passport/authenticate.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: PassportSigner • authenticate - - - meta - - name: description - content: Overview of the authenticate method on PassportSigner - - - meta - - property: og:description - content: Overview of the authenticate method on PassportSigner +title: PassportSigner • authenticate +description: Overview of the authenticate method on PassportSigner --- # authenticate @@ -20,8 +11,6 @@ This method must be called before accessing the other methods available on the ` ## Usage -::: code-group - ```ts [example.ts] // [!code focus:99] import { PassportSigner } from "@alchemy/aa-signers/passport"; @@ -39,8 +28,6 @@ const passportSigner = new PassportSigner({ await passportSigner.authenticate(); ``` -::: - ## Returns ### `Promise` diff --git a/site/packages/aa-signers/passport/constructor.md b/site/pages/packages/aa-signers/passport/constructor.md similarity index 82% rename from site/packages/aa-signers/passport/constructor.md rename to site/pages/packages/aa-signers/passport/constructor.md index d2a47e8f1a..0e97cdad0b 100644 --- a/site/packages/aa-signers/passport/constructor.md +++ b/site/pages/packages/aa-signers/passport/constructor.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: PassportSigner • constructor - - - meta - - name: description - content: Overview of the constructor method on PassportSigner in aa-signers - - - meta - - property: og:description - content: Overview of the constructor method on PassportSigner in aa-signers +title: PassportSigner • constructor +description: Overview of the constructor method on PassportSigner in aa-signers --- # constructor @@ -18,9 +9,9 @@ To initialize a `PassportSigner`, you must provide a set of parameters detailed ## Usage -::: code-group +:::code-group -```ts [example.ts] +```ts [example1.ts] import { PassportSigner } from "@alchemy/aa-signers/passport"; import { Passport } from "@0xpass/passport"; import { WebAuthnSigner } from "@0xpass/webauthn-signer"; @@ -35,11 +26,7 @@ const passportSigner = new PassportSigner({ }); ``` -::: - -::: code-group - -```ts [example.ts] +```ts [example2.ts] import { PassportSigner } from "@alchemy/aa-signers/passport"; import { Passport } from "@0xpass/passport"; import { WebAuthnSigner } from "@0xpass/webauthn-signer"; diff --git a/site/packages/aa-signers/passport/getAddress.md b/site/pages/packages/aa-signers/passport/getAddress.md similarity index 60% rename from site/packages/aa-signers/passport/getAddress.md rename to site/pages/packages/aa-signers/passport/getAddress.md index dddcda7363..23c3fa5bc8 100644 --- a/site/packages/aa-signers/passport/getAddress.md +++ b/site/pages/packages/aa-signers/passport/getAddress.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: PassportSigner • getAddress - - - meta - - name: description - content: Overview of the getAddress method on PassportSigner - - - meta - - property: og:description - content: Overview of the getAddress method on PassportSigner +title: PassportSigner • getAddress +description: Overview of the getAddress method on PassportSigner --- # getAddress @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/passport/ ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createPassportSigner } from "./passport"; @@ -30,7 +21,10 @@ const passportSigner = await createPassportSigner(); const address = await passportSigner.getAddress(); ``` -<<< @/snippets/signers/passport.ts +```ts [passport.ts] +// [!include ~/snippets/signers/passport.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/passport/getAuthDetails.md b/site/pages/packages/aa-signers/passport/getAuthDetails.md similarity index 73% rename from site/packages/aa-signers/passport/getAuthDetails.md rename to site/pages/packages/aa-signers/passport/getAuthDetails.md index affb35f5a6..665e1e91ec 100644 --- a/site/packages/aa-signers/passport/getAuthDetails.md +++ b/site/pages/packages/aa-signers/passport/getAuthDetails.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: PassportSigner • getAuthDetails - - - meta - - name: description - content: Overview of the getAuthDetails method on PassportSigner - - - meta - - property: og:description - content: Overview of the getAuthDetails method on PassportSigner +title: PassportSigner • getAuthDetails +description: Overview of the getAuthDetails method on PassportSigner --- # getAuthDetails @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/passport/ ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createPassportSigner } from "./passport"; @@ -30,7 +21,10 @@ const passportSigner = await createPassportSigner(); const details = await passportSigner.getAuthDetails(); ``` -<<< @/snippets/signers/passport.ts +```ts [passport.ts] +// [!include ~/snippets/signers/passport.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/passport/introduction.md b/site/pages/packages/aa-signers/passport/introduction.md similarity index 86% rename from site/packages/aa-signers/passport/introduction.md rename to site/pages/packages/aa-signers/passport/introduction.md index 391e917144..c43469814f 100644 --- a/site/packages/aa-signers/passport/introduction.md +++ b/site/pages/packages/aa-signers/passport/introduction.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: PassportSigner - - - meta - - name: description - content: Overview of the PassportSigner class in aa-signers - - - meta - - property: og:description - content: Overview of the PassportSigner class in aa-signers +title: PassportSigner +description: Overview of the PassportSigner class in aa-signers --- # Portal Signer @@ -28,7 +19,7 @@ head: `PassportSigner` requires installation of the package requires installation of the [`@0xpass/passport`](https://github.com/0xpass/passport-sdk/tree/main/packages/passport) and [`@0xpass/webauthn-signer`](https://github.com/0xpass/passport-sdk/tree/main/packages/webauthn-signer). -::: code-group +:::code-group ```bash [npm] npm i @0xpass/passport @@ -44,7 +35,7 @@ yarn add @0xpass/webauthn-signer ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createPassportSigner } from "./passport"; @@ -69,7 +60,10 @@ const typedData = { const signTypedData = await passportSigner.signTypedData(typedData); ``` -<<< @/snippets/signers/passport.ts +```ts [passport.ts] +// [!include ~/snippets/signers/passport.ts] +``` + ::: ## Developer Links diff --git a/site/packages/aa-signers/passport/signMessage.md b/site/pages/packages/aa-signers/passport/signMessage.md similarity index 64% rename from site/packages/aa-signers/passport/signMessage.md rename to site/pages/packages/aa-signers/passport/signMessage.md index 702ee9d522..031cf42007 100644 --- a/site/packages/aa-signers/passport/signMessage.md +++ b/site/pages/packages/aa-signers/passport/signMessage.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: PassportSigner • signMessage - - - meta - - name: description - content: Overview of the signMessage method on PassportSigner - - - meta - - property: og:description - content: Overview of the signMessage method on PassportSigner +title: PassportSigner • signMessage +description: Overview of the signMessage method on PassportSigner --- # signMessage @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/passport/ ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createPassportSigner } from "./passport"; @@ -30,7 +21,10 @@ const passportSigner = await createPassportSigner(); const signedMessage = await passportSigner.signMessage("test"); ``` -<<< @/snippets/signers/passport.ts +```ts [passport.ts] +// [!include ~/snippets/signers/passport.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/passport/signTypedData.md b/site/pages/packages/aa-signers/passport/signTypedData.md similarity index 81% rename from site/packages/aa-signers/passport/signTypedData.md rename to site/pages/packages/aa-signers/passport/signTypedData.md index ec11aa4c6c..b4fa2c5e84 100644 --- a/site/packages/aa-signers/passport/signTypedData.md +++ b/site/pages/packages/aa-signers/passport/signTypedData.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: PassportSigner • signTypedData - - - meta - - name: description - content: Overview of the signTypedData method on PassportSigner - - - meta - - property: og:description - content: Overview of the signTypedData method on PassportSigner +title: PassportSigner • signTypedData +description: Overview of the signTypedData method on PassportSigner --- # signTypedData @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/passport/ ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createPassportSigner } from "./passport"; @@ -60,7 +51,10 @@ const signedTypedData = await passportSigner.signTypedData({ }); ``` -<<< @/snippets/signers/passport.ts +```ts [passport.ts] +// [!include ~/snippets/signers/passport.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/portal/authenticate.md b/site/pages/packages/aa-signers/portal/authenticate.md similarity index 78% rename from site/packages/aa-signers/portal/authenticate.md rename to site/pages/packages/aa-signers/portal/authenticate.md index ec4907bf9a..84b62f75ad 100644 --- a/site/packages/aa-signers/portal/authenticate.md +++ b/site/pages/packages/aa-signers/portal/authenticate.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: PortalSigner • authenticate - - - meta - - name: description - content: Overview of the authenticate method on PortalSigner - - - meta - - property: og:description - content: Overview of the authenticate method on PortalSigner +title: PortalSigner • authenticate +description: Overview of the authenticate method on PortalSigner --- # authenticate @@ -20,8 +11,6 @@ You must call this method before accessing the other methods available on the `P ## Usage -::: code-group - ```ts [example.ts] // [!code focus:99] import { PortalSigner } from "@alchemy/aa-signers/portal"; @@ -35,8 +24,6 @@ const portalSigner = new PortalSigner({ await portalSigner.authenticate(); ``` -::: - ## Returns ### `Promise` diff --git a/site/packages/aa-signers/portal/constructor.md b/site/pages/packages/aa-signers/portal/constructor.md similarity index 85% rename from site/packages/aa-signers/portal/constructor.md rename to site/pages/packages/aa-signers/portal/constructor.md index 15e3aabeee..514990eaa1 100644 --- a/site/packages/aa-signers/portal/constructor.md +++ b/site/pages/packages/aa-signers/portal/constructor.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: PortalSigner • constructor - - - meta - - name: description - content: Overview of the constructor method on PortalSigner in aa-signers - - - meta - - property: og:description - content: Overview of the constructor method on PortalSigner in aa-signers +title: PortalSigner • constructor +description: Overview of the constructor method on PortalSigner in aa-signers --- # constructor @@ -18,8 +9,6 @@ To initialize a `PortalSigner`, you must provide a set of parameters detailed be ## Usage -::: code-group - ```ts [example.ts] import { PortalSigner } from "@alchemy/aa-signers/portal"; import { ChainId } from "@portal/portal-web3-provider"; @@ -43,8 +32,6 @@ const portalSigner = new PortalSigner({ }); ``` -::: - ## Returns ### `PortalSigner` diff --git a/site/packages/aa-signers/portal/getAddress.md b/site/pages/packages/aa-signers/portal/getAddress.md similarity index 60% rename from site/packages/aa-signers/portal/getAddress.md rename to site/pages/packages/aa-signers/portal/getAddress.md index e0ded85636..e2bc6cdbbe 100644 --- a/site/packages/aa-signers/portal/getAddress.md +++ b/site/pages/packages/aa-signers/portal/getAddress.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: PortalSigner • getAddress - - - meta - - name: description - content: Overview of the getAddress method on PortalSigner - - - meta - - property: og:description - content: Overview of the getAddress method on PortalSigner +title: PortalSigner • getAddress +description: Overview of the getAddress method on PortalSigner --- # getAddress @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/portal/au ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createPortalSigner } from "./portal"; @@ -30,7 +21,10 @@ const portalSigner = await createPortalSigner(); const address = await portalSigner.getAddress(); ``` -<<< @/snippets/signers/portal.ts +```ts [portal.ts] +// [!include ~/snippets/signers/portal.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/portal/getAuthDetails.md b/site/pages/packages/aa-signers/portal/getAuthDetails.md similarity index 76% rename from site/packages/aa-signers/portal/getAuthDetails.md rename to site/pages/packages/aa-signers/portal/getAuthDetails.md index 99779361ba..82e581723c 100644 --- a/site/packages/aa-signers/portal/getAuthDetails.md +++ b/site/pages/packages/aa-signers/portal/getAuthDetails.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: PortalSigner • getAuthDetails - - - meta - - name: description - content: Overview of the getAuthDetails method on PortalSigner - - - meta - - property: og:description - content: Overview of the getAuthDetails method on PortalSigner +title: PortalSigner • getAuthDetails +description: Overview of the getAuthDetails method on PortalSigner --- # getAuthDetails @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/portal/au ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createPortalSigner } from "./portal"; @@ -30,7 +21,10 @@ const portalSigner = await createPortalSigner(); const details = await portalSigner.getAuthDetails(); ``` -<<< @/snippets/signers/portal.ts +```ts [portal.ts] +// [!include ~/snippets/signers/portal.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/portal/introduction.md b/site/pages/packages/aa-signers/portal/introduction.md similarity index 84% rename from site/packages/aa-signers/portal/introduction.md rename to site/pages/packages/aa-signers/portal/introduction.md index 78c7608dec..7fb02fa40c 100644 --- a/site/packages/aa-signers/portal/introduction.md +++ b/site/pages/packages/aa-signers/portal/introduction.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: PortalSigner - - - meta - - name: description - content: Overview of the PortalSigner class in aa-signers - - - meta - - property: og:description - content: Overview of the PortalSigner class in aa-signers +title: PortalSigner +description: Overview of the PortalSigner class in aa-signers --- # Portal Signer @@ -28,7 +19,7 @@ head: `PortalSigner` requires installation of the [`@portal-hq/web`](https://docs.portalhq.io/sdk/web-beta) SDK. `aa-signers` lists it as an optional dependency. -::: code-group +:::code-group ```bash [npm] npm i -s @portal-hq/web @@ -40,7 +31,7 @@ yarn add @portal-hq/web ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createPortalSigner } from "./portal"; @@ -65,7 +56,10 @@ const typedData = { const signTypedData = await portalSigner.signTypedData(typedData); ``` -<<< @/snippets/signers/portal.ts +```ts [portal.ts] +// [!include ~/snippets/signers/portal.ts] +``` + ::: ## Developer Links diff --git a/site/packages/aa-signers/portal/signMessage.md b/site/pages/packages/aa-signers/portal/signMessage.md similarity index 64% rename from site/packages/aa-signers/portal/signMessage.md rename to site/pages/packages/aa-signers/portal/signMessage.md index 873b6597ac..3250454527 100644 --- a/site/packages/aa-signers/portal/signMessage.md +++ b/site/pages/packages/aa-signers/portal/signMessage.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: PortalSigner • signMessage - - - meta - - name: description - content: Overview of the signMessage method on PortalSigner - - - meta - - property: og:description - content: Overview of the signMessage method on PortalSigner +title: PortalSigner • signMessage +description: Overview of the signMessage method on PortalSigner --- # signMessage @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/portal/au ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createPortalSigner } from "./portal"; @@ -30,7 +21,10 @@ const portalSigner = await createPortalSigner(); const signedMessage = await portalSigner.signMessage("test"); ``` -<<< @/snippets/signers/portal.ts +```ts [portal.ts] +// [!include ~/snippets/signers/portal.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/portal/signTypedData.md b/site/pages/packages/aa-signers/portal/signTypedData.md similarity index 81% rename from site/packages/aa-signers/portal/signTypedData.md rename to site/pages/packages/aa-signers/portal/signTypedData.md index d26f3d98a3..3f87e826ba 100644 --- a/site/packages/aa-signers/portal/signTypedData.md +++ b/site/pages/packages/aa-signers/portal/signTypedData.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: PortalSigner • signTypedData - - - meta - - name: description - content: Overview of the signTypedData method on PortalSigner - - - meta - - property: og:description - content: Overview of the signTypedData method on PortalSigner +title: PortalSigner • signTypedData +description: Overview of the signTypedData method on PortalSigner --- # signTypedData @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/portal/au ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createPortalSigner } from "./portal"; @@ -60,7 +51,10 @@ const signedTypedData = await portalSigner.signTypedData({ }); ``` -<<< @/snippets/signers/portal.ts +```ts [portal.ts] +// [!include ~/snippets/signers/portal.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/turnkey/authenticate.md b/site/pages/packages/aa-signers/turnkey/authenticate.md similarity index 90% rename from site/packages/aa-signers/turnkey/authenticate.md rename to site/pages/packages/aa-signers/turnkey/authenticate.md index d71bab1ac6..5ebfe66039 100644 --- a/site/packages/aa-signers/turnkey/authenticate.md +++ b/site/pages/packages/aa-signers/turnkey/authenticate.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: TurnkeySigner • authenticate - - - meta - - name: description - content: Overview of the authenticate method on TurnkeySigner - - - meta - - property: og:description - content: Overview of the authenticate method on TurnkeySigner +title: TurnkeySigner • authenticate +description: Overview of the authenticate method on TurnkeySigner --- # authenticate @@ -20,8 +11,6 @@ This method must be called before accessing the other methods available on the ` ## Usage -::: code-group - ```ts [example.ts] // [!code focus:99] import { @@ -105,8 +94,6 @@ const authParams = { await turnkeySigner.authenticate(authParams); ``` -::: - ## Returns ### `Promise` @@ -124,5 +111,5 @@ A `Promise` containing the `TurnkeyUserMetadata`, and object with the following An object with the following fields: -- `transport` -- a `viem` [Transport](https://viem.sh/docs/clients/intro.html#transports) you can define to execute RPC requests. +- `transport` -- a `viem` [Transport](https://viem.sh/docs/clients/intro#transports) you can define to execute RPC requests. - `resolveSubOrganization: () => Promise` -- a method you can define as necessary to leverage the `Turnkey` SDK for authenticating a wallet as a [sub-organization](https://docs.turnkey.com/integration-guides/sub-organizations-as-wallets). For instance, in the example above, `authenticate` uses the [`createSubOrganization`](https://docs.turnkey.com/api#tag/Organizations/operation/CreateSubOrganization) method. diff --git a/site/packages/aa-signers/turnkey/constructor.md b/site/pages/packages/aa-signers/turnkey/constructor.md similarity index 80% rename from site/packages/aa-signers/turnkey/constructor.md rename to site/pages/packages/aa-signers/turnkey/constructor.md index 061dd9e5f8..8dea8d4c5c 100644 --- a/site/packages/aa-signers/turnkey/constructor.md +++ b/site/pages/packages/aa-signers/turnkey/constructor.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: TurnkeySigner • constructor - - - meta - - name: description - content: Overview of the constructor method on TurnkeySigner in aa-signers - - - meta - - property: og:description - content: Overview of the constructor method on TurnkeySigner in aa-signers +title: TurnkeySigner • constructor +description: Overview of the constructor method on TurnkeySigner in aa-signers --- # constructor @@ -18,8 +9,6 @@ To initialize a `TurnkeySigner`, you must provide a set of parameters detailed b ## Usage -::: code-group - ```ts [example.ts] import { TurnkeySigner } from "@alchemy/aa-signers/turnkey"; import { WebauthnStamper } from "@turnkey/webauthn-stamper"; @@ -33,8 +22,6 @@ const turnkeySigner = new TurnkeySigner({ }); ``` -::: - ## Returns ### `TurnkeySigner` diff --git a/site/packages/aa-signers/turnkey/getAddress.md b/site/pages/packages/aa-signers/turnkey/getAddress.md similarity index 60% rename from site/packages/aa-signers/turnkey/getAddress.md rename to site/pages/packages/aa-signers/turnkey/getAddress.md index 190fba1bdd..b0cb5f98dd 100644 --- a/site/packages/aa-signers/turnkey/getAddress.md +++ b/site/pages/packages/aa-signers/turnkey/getAddress.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: TurnkeySigner • getAddress - - - meta - - name: description - content: Overview of the getAddress method on TurnkeySigner - - - meta - - property: og:description - content: Overview of the getAddress method on TurnkeySigner +title: TurnkeySigner • getAddress +description: Overview of the getAddress method on TurnkeySigner --- # getAddress @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/turnkey/a ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createTurnkeySigner } from "./turnkey"; @@ -30,7 +21,10 @@ const turnkeySigner = await createTurnkeySigner(); const address = await turnkeySigner.getAddress(); ``` -<<< @/snippets/signers/turnkey.ts +```ts [turnkey.ts] +// [!include ~/snippets/signers/turnkey.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/turnkey/getAuthDetails.md b/site/pages/packages/aa-signers/turnkey/getAuthDetails.md similarity index 73% rename from site/packages/aa-signers/turnkey/getAuthDetails.md rename to site/pages/packages/aa-signers/turnkey/getAuthDetails.md index 85f3f89fd4..2f43c3abaf 100644 --- a/site/packages/aa-signers/turnkey/getAuthDetails.md +++ b/site/pages/packages/aa-signers/turnkey/getAuthDetails.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: TurnkeySigner • getAuthDetails - - - meta - - name: description - content: Overview of the getAuthDetails method on TurnkeySigner - - - meta - - property: og:description - content: Overview of the getAuthDetails method on TurnkeySigner +title: TurnkeySigner • getAuthDetails +description: Overview of the getAuthDetails method on TurnkeySigner --- # getAuthDetails @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/turnkey/a ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createTurnkeySigner } from "./turnkey"; @@ -30,7 +21,10 @@ const turnkeySigner = await createTurnkeySigner(); const details = await turnkeySigner.getAuthDetails(); ``` -<<< @/snippets/signers/turnkey.ts +```ts [turnkey.ts] +// [!include ~/snippets/signers/turnkey.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/turnkey/introduction.md b/site/pages/packages/aa-signers/turnkey/introduction.md similarity index 89% rename from site/packages/aa-signers/turnkey/introduction.md rename to site/pages/packages/aa-signers/turnkey/introduction.md index cf5d33f3cf..76b3999cf2 100644 --- a/site/packages/aa-signers/turnkey/introduction.md +++ b/site/pages/packages/aa-signers/turnkey/introduction.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: TurnkeySigner - - - meta - - name: description - content: Overview of the TurnkeySigner class in aa-signers - - - meta - - property: og:description - content: Overview of the TurnkeySigner class in aa-signers +title: TurnkeySigner +description: Overview of the TurnkeySigner class in aa-signers --- # Turnkey Signer @@ -30,7 +21,7 @@ head: Every request to Turnkey must be signed using a [stamper](https://docs.turnkey.com/category/api-design). In this example, we use the WebAuthn stamper from [`@turnkey/webauthn-stamper`](https://github.com/tkhq/sdk/tree/main/packages/webauthn-stamper). -::: code-group +:::code-group ```bash [npm] npm i -s @turnkey/http @@ -46,7 +37,7 @@ yarn add @turnkey/webauthn-stamper ## Usage -::: code-group +:::code-group ```ts [example.ts] import { TurnkeySigner, TurnkeySubOrganization } from "@alchemy/aa-signers/turnkey"; @@ -90,7 +81,10 @@ const typedData = { const signTypedData = await turnkeySigner.signTypedData(typedData); ``` -<<< @/snippets/signers/turnkey.ts +```ts [turnkey.ts] +// [!include ~/snippets/signers/turnkey.ts] +``` + ::: ## Developer links diff --git a/site/packages/aa-signers/turnkey/signMessage.md b/site/pages/packages/aa-signers/turnkey/signMessage.md similarity index 64% rename from site/packages/aa-signers/turnkey/signMessage.md rename to site/pages/packages/aa-signers/turnkey/signMessage.md index 5f274e9086..036fcad09d 100644 --- a/site/packages/aa-signers/turnkey/signMessage.md +++ b/site/pages/packages/aa-signers/turnkey/signMessage.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: TurnkeySigner • signMessage - - - meta - - name: description - content: Overview of the signMessage method on TurnkeySigner - - - meta - - property: og:description - content: Overview of the signMessage method on TurnkeySigner +title: TurnkeySigner • signMessage +description: Overview of the signMessage method on TurnkeySigner --- # signMessage @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/turnkey/a ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createTurnkeySigner } from "./turnkey"; @@ -30,7 +21,10 @@ const turnkeySigner = await createTurnkeySigner(); const signedMessage = await turnkeySigner.signMessage("test"); ``` -<<< @/snippets/signers/turnkey.ts +```ts [turnkey.ts] +// [!include ~/snippets/signers/turnkey.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/turnkey/signTypedData.md b/site/pages/packages/aa-signers/turnkey/signTypedData.md similarity index 81% rename from site/packages/aa-signers/turnkey/signTypedData.md rename to site/pages/packages/aa-signers/turnkey/signTypedData.md index f3d834fc7d..ef169c864b 100644 --- a/site/packages/aa-signers/turnkey/signTypedData.md +++ b/site/pages/packages/aa-signers/turnkey/signTypedData.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: TurnkeySigner • signTypedData - - - meta - - name: description - content: Overview of the signTypedData method on TurnkeySigner - - - meta - - property: og:description - content: Overview of the signTypedData method on TurnkeySigner +title: TurnkeySigner • signTypedData +description: Overview of the signTypedData method on TurnkeySigner --- # signTypedData @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/turnkey/a ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createTurnkeySigner } from "./turnkey"; @@ -60,7 +51,10 @@ const signedTypedData = await turnkeySigner.signTypedData({ }); ``` -<<< @/snippets/signers/turnkey.ts +```ts [turnkey.ts] +// [!include ~/snippets/signers/turnkey.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/web3auth/authenticate.md b/site/pages/packages/aa-signers/web3auth/authenticate.md similarity index 88% rename from site/packages/aa-signers/web3auth/authenticate.md rename to site/pages/packages/aa-signers/web3auth/authenticate.md index 8cba4faf75..be40054c44 100644 --- a/site/packages/aa-signers/web3auth/authenticate.md +++ b/site/pages/packages/aa-signers/web3auth/authenticate.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Web3AuthSigner • authenticate - - - meta - - name: description - content: Overview of the authenticate method on Web3AuthSigner - - - meta - - property: og:description - content: Overview of the authenticate method on Web3AuthSigner +title: Web3AuthSigner • authenticate +description: Overview of the authenticate method on Web3AuthSigner --- # authenticate @@ -20,8 +11,6 @@ You must call this method before accessing the other methods available on the `W ## Usage -::: code-group - ```ts [example.ts] // [!code focus:99] import { Web3AuthSigner } from "@alchemy/aa-signers/web3auth"; @@ -43,8 +32,6 @@ await web3AuthSigner.authenticate({ }); ``` -::: - ## Returns ### `Promise` diff --git a/site/packages/aa-signers/web3auth/constructor.md b/site/pages/packages/aa-signers/web3auth/constructor.md similarity index 91% rename from site/packages/aa-signers/web3auth/constructor.md rename to site/pages/packages/aa-signers/web3auth/constructor.md index 41cc93fa2b..d95ca9bc39 100644 --- a/site/packages/aa-signers/web3auth/constructor.md +++ b/site/pages/packages/aa-signers/web3auth/constructor.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Web3AuthSigner • constructor - - - meta - - name: description - content: Overview of the constructor method on Web3AuthSigner in aa-signers - - - meta - - property: og:description - content: Overview of the constructor method on Web3AuthSigner in aa-signers +title: Web3AuthSigner • constructor +description: Overview of the constructor method on Web3AuthSigner in aa-signers --- # constructor @@ -18,8 +9,6 @@ To initialize a `Web3AuthSigner`, you must provide a set of parameters detailed ## Usage -::: code-group - ```ts [example.ts] import { Web3AuthSigner } from "@alchemy/aa-signers/web3auth"; @@ -53,8 +42,6 @@ const web3AuthSigner = new Web3AuthSigner({ }); ``` -::: - ## Returns ### `Web3AuthSigner` diff --git a/site/packages/aa-signers/web3auth/getAddress.md b/site/pages/packages/aa-signers/web3auth/getAddress.md similarity index 60% rename from site/packages/aa-signers/web3auth/getAddress.md rename to site/pages/packages/aa-signers/web3auth/getAddress.md index 159200e947..cbf1971051 100644 --- a/site/packages/aa-signers/web3auth/getAddress.md +++ b/site/pages/packages/aa-signers/web3auth/getAddress.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Web3AuthSigner • getAddress - - - meta - - name: description - content: Overview of the getAddress method on Web3AuthSigner - - - meta - - property: og:description - content: Overview of the getAddress method on Web3AuthSigner +title: Web3AuthSigner • getAddress +description: Overview of the getAddress method on Web3AuthSigner --- # getAddress @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/web3auth/ ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createWeb3AuthSigner } from "./web3auth"; @@ -30,7 +21,10 @@ const web3AuthSigner = await createWeb3AuthSigner(); const address = await web3AuthSigner.getAddress(); ``` -<<< @/snippets/signers/web3auth.ts +```ts [web3auth.ts] +// [!include ~/snippets/signers/web3auth.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/web3auth/getAuthDetails.md b/site/pages/packages/aa-signers/web3auth/getAuthDetails.md similarity index 84% rename from site/packages/aa-signers/web3auth/getAuthDetails.md rename to site/pages/packages/aa-signers/web3auth/getAuthDetails.md index c5dc254cf9..a34f0c6719 100644 --- a/site/packages/aa-signers/web3auth/getAuthDetails.md +++ b/site/pages/packages/aa-signers/web3auth/getAuthDetails.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Web3AuthSigner • getAuthDetails - - - meta - - name: description - content: Overview of the getAuthDetails method on Web3AuthSigner - - - meta - - property: og:description - content: Overview of the getAuthDetails method on Web3AuthSigner +title: Web3AuthSigner • getAuthDetails +description: Overview of the getAuthDetails method on Web3AuthSigner --- # getAuthDetails @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/web3auth/ ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createWeb3AuthSigner } from "./web3auth"; @@ -30,7 +21,10 @@ const web3AuthSigner = await createWeb3AuthSigner(); const details = await web3AuthSigner.getAuthDetails(); ``` -<<< @/snippets/signers/web3auth.ts +```ts [web3auth.ts] +// [!include ~/snippets/signers/web3auth.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/web3auth/introduction.md b/site/pages/packages/aa-signers/web3auth/introduction.md similarity index 85% rename from site/packages/aa-signers/web3auth/introduction.md rename to site/pages/packages/aa-signers/web3auth/introduction.md index 14ddb99b57..ba5096b4d0 100644 --- a/site/packages/aa-signers/web3auth/introduction.md +++ b/site/pages/packages/aa-signers/web3auth/introduction.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Web3AuthSigner - - - meta - - name: description - content: Overview of the Web3AuthSigner class in aa-signers - - - meta - - property: og:description - content: Overview of the Web3AuthSigner class in aa-signers +title: Web3AuthSigner +description: Overview of the Web3AuthSigner class in aa-signers --- # Web3auth Signer @@ -28,7 +19,7 @@ head: `Web3AuthSigner` requires installation of the [`@web3auth/modal`](https://github.com/Web3Auth/web3auth-web/tree/master/packages/modal) and [`@web3auth/base`](https://github.com/Web3Auth/web3auth-web/tree/master/packages/base) SDKs. `aa-signers` lists them as optional dependencies. -::: code-group +:::code-group ```bash [npm] npm i -s @web3auth/modal @@ -42,7 +33,7 @@ yarn add @web3auth/base ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createWeb3AuthSigner } from "./web3auth"; @@ -67,7 +58,10 @@ const typedData = { const signTypedData = await web3AuthSigner.signTypedData(typedData); ``` -<<< @/snippets/signers/web3auth.ts +```ts [web3auth.ts] +// [!include ~/snippets/signers/web3auth.ts] +``` + ::: ## Developer Links diff --git a/site/packages/aa-signers/web3auth/signMessage.md b/site/pages/packages/aa-signers/web3auth/signMessage.md similarity index 64% rename from site/packages/aa-signers/web3auth/signMessage.md rename to site/pages/packages/aa-signers/web3auth/signMessage.md index d3865a2cec..f4794a1031 100644 --- a/site/packages/aa-signers/web3auth/signMessage.md +++ b/site/pages/packages/aa-signers/web3auth/signMessage.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Web3AuthSigner • signMessage - - - meta - - name: description - content: Overview of the signMessage method on Web3AuthSigner - - - meta - - property: og:description - content: Overview of the signMessage method on Web3AuthSigner +title: Web3AuthSigner • signMessage +description: Overview of the signMessage method on Web3AuthSigner --- # signMessage @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/web3auth/ ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createWeb3AuthSigner } from "./web3auth"; @@ -30,7 +21,10 @@ const web3AuthSigner = await createWeb3AuthSigner(); const signedMessage = await web3AuthSigner.signMessage("test"); ``` -<<< @/snippets/signers/web3auth.ts +```ts [web3auth.ts] +// [!include ~/snippets/signers/web3auth.ts] +``` + ::: ## Returns diff --git a/site/packages/aa-signers/web3auth/signTypedData.md b/site/pages/packages/aa-signers/web3auth/signTypedData.md similarity index 81% rename from site/packages/aa-signers/web3auth/signTypedData.md rename to site/pages/packages/aa-signers/web3auth/signTypedData.md index 2a94c65462..697787d09f 100644 --- a/site/packages/aa-signers/web3auth/signTypedData.md +++ b/site/pages/packages/aa-signers/web3auth/signTypedData.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Web3AuthSigner • signTypedData - - - meta - - name: description - content: Overview of the signTypedData method on Web3AuthSigner - - - meta - - property: og:description - content: Overview of the signTypedData method on Web3AuthSigner +title: Web3AuthSigner • signTypedData +description: Overview of the signTypedData method on Web3AuthSigner --- # signTypedData @@ -20,7 +11,7 @@ This method must be called after [`authenticate`](/packages/aa-signers/web3auth/ ## Usage -::: code-group +:::code-group ```ts [example.ts] import { createWeb3AuthSigner } from "./web3auth"; @@ -60,7 +51,10 @@ const signedTypedData = await web3AuthSigner.signTypedData({ }); ``` -<<< @/snippets/signers/web3auth.ts +```ts [web3auth.ts] +// [!include ~/snippets/signers/web3auth.ts] +``` + ::: ## Returns diff --git a/site/packages/index.md b/site/pages/packages/index.md similarity index 85% rename from site/packages/index.md rename to site/pages/packages/index.md index 40f1ccdb6c..1c8db8f83a 100644 --- a/site/packages/index.md +++ b/site/pages/packages/index.md @@ -1,21 +1,8 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Packages Overview - - - meta - - name: description - content: Explore the benefits and tradeoffs of four different packages that can be used with Account Kit namely aa-core, aa-alchemy, aa-accounts, aa-signers, and aa-ethers. - - - meta - - property: og:description - content: Explore the benefits and tradeoffs of four different packages that can be used with Account Kit namely aa-core, aa-alchemy, aa-accounts, aa-signers, and aa-ethers. - - - meta - - name: twitter:title - content: Packages Overview - - - meta - - name: twitter:description - content: Explore the benefits and tradeoffs of four different packages that can be used with Account Kit namely aa-core, aa-alchemy, aa-accounts, aa-signers, and aa-ethers. +title: Packages Overview +description: Explore the benefits and tradeoffs of four different packages that + can be used with Account Kit namely aa-core, aa-alchemy, aa-accounts, + aa-signers, and aa-ethers. --- # Package overview diff --git a/site/react/BaseHookMutationArgs.md b/site/pages/react/BaseHookMutationArgs.mdx similarity index 100% rename from site/react/BaseHookMutationArgs.md rename to site/pages/react/BaseHookMutationArgs.mdx diff --git a/site/react/createConfig.md b/site/pages/react/createConfig.mdx similarity index 57% rename from site/react/createConfig.md rename to site/pages/react/createConfig.mdx index 8b1d81db2f..bde7ac2dc8 100644 --- a/site/react/createConfig.md +++ b/site/pages/react/createConfig.mdx @@ -1,28 +1,13 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: createConfig - - - meta - - name: description - content: An overview of the createConfig function - - - meta - - property: og:description - content: An overview of the createConfig function - - - meta - - name: twitter:title - content: createConfig - - - meta - - name: twitter:description - content: An overview of the createConfig function +title: createConfig +description: An overview of the createConfig function --- # createConfig The `createConfig` method is used to create a configuration object that is used to initialize the `AlchemyAccountProvider`. The output of this function contains all of the state that will be used by the various hooks exported by `@alchemy/aa-alchemy/react`. -::: warning +:::warning It's not recommended to use the resulting config directly. However, if you are not using `React` it is possible to build your own custom hooks using the state contained in the config object. ::: @@ -34,10 +19,15 @@ import { createConfig } from "@alchemy/aa-alchemy/config"; ## Usage -::: code-group +:::code-group -<<< @/snippets/react/config.ts [single-chain.ts] -<<< @/snippets/react/multi-chain-config.ts [multi-chain.ts] +```ts [single-chain.ts] +// [!include ~/snippets/react/config.ts] +``` + +```ts [multi-chain.ts] +// [!include ~/snippets/react/multi-chain-config.ts] +``` ::: @@ -47,12 +37,20 @@ import { createConfig } from "@alchemy/aa-alchemy/config"; import { type CreateConfigProps } from "@alchemy/aa-alchemy/config"; ``` -::: details CreateConfigProps -<<< @/../packages/alchemy/src/config/types.ts#CreateConfigProps +:::details[CreateConfigProps] + +```ts [types.ts] +// [!include ~/../packages/alchemy/src/config/types.ts:CreateConfigProps] +``` + ::: -::: details ConnectionConfig -<<< @/../packages/core/src/client/schema.ts#ConnectionConfigSchema +:::details[ConnectionConfig] + +```ts [types.ts] +// [!include ~/../packages/core/src/client/schema.ts:ConnectionConfigSchema] +``` + ::: ## Return Type diff --git a/site/react/overview.md b/site/pages/react/overview.mdx similarity index 67% rename from site/react/overview.md rename to site/pages/react/overview.mdx index da02b0c333..051e37fcc2 100644 --- a/site/react/overview.md +++ b/site/pages/react/overview.mdx @@ -1,21 +1,7 @@ --- outline: deep -head: - - - meta - - property: og:title - content: React Hooks Overview - - - meta - - name: description - content: An overview of using React Hooks exported by Account Kit - - - meta - - property: og:description - content: An overview of using React Hooks exported by Account Kit - - - meta - - name: twitter:title - content: React Hooks Overview - - - meta - - name: twitter:description - content: An overview of using React Hooks exported by Account Kit +title: React Hooks Overview +description: An overview of using React Hooks exported by Account Kit --- # React Hooks Overview @@ -26,17 +12,17 @@ If you are using Smart Contract Accounts and building a React application, you c To use the React Hooks, you need to install the `@alchemy/aa-alchemy` and `@tanstack/react-query` packages. We use [`react-query`](https://tanstack.com/query/latest/docs/framework/react/overview) to manage async data fetching and mutations in our hooks. -::: code-group +:::code-group -```bash[npm] +```bash [npm] npm install @alchemy/aa-alchemy @tanstack/react-query ``` -```bash[yarn] +```bash [yarn] yarn add @alchemy/aa-alchemy @tanstack/react-query ``` -```bash[pnpm] +```bash [pnpm] pnpm add @alchemy/aa-alchemy @tanstack/react-query ``` @@ -46,19 +32,24 @@ pnpm add @alchemy/aa-alchemy @tanstack/react-query In order to get started, you'll first have to define a config object that can be used to create an `AlchemyAccountContext` that will be used by all of the hooks exported by the library. -::: code-group -<<< @/snippets/react/config.ts -::: +```ts [config.ts] +// [!include ~/snippets/react/config.ts] +``` ## Wrap app in Context Provider Next, you'll need to add the `AlchemyAccountProvider` to your application and pass in the config object and an instance of the `react-query` `QueryClient`. -::: code-group +:::code-group -<<< @/snippets/react/app.tsx +```tsx [app.tsx] +// [!include ~/snippets/react/app.tsx] +``` + +```ts [config.ts] +// [!include ~/snippets/react/config.ts] +``` -<<< @/snippets/react/config.ts ::: ## Use the hooks diff --git a/site/react/ssr.md b/site/pages/react/ssr.mdx similarity index 76% rename from site/react/ssr.md rename to site/pages/react/ssr.mdx index cac48f6595..83501acdd3 100644 --- a/site/react/ssr.md +++ b/site/pages/react/ssr.mdx @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Server Side Rendering - - - meta - - name: description - content: An overview on how to use React Hooks with Server Side Rendering - - - meta - - property: og:description - content: An overview on how to use React Hooks with Server Side Rendering - - - meta - - name: twitter:title - content: Server Side Rendering - - - meta - - name: twitter:description - content: An overview on how to use React Hooks with Server Side Rendering +title: Server Side Rendering +description: An overview on how to use React Hooks with Server Side Rendering --- # Server Side Rendering (SSR) @@ -66,11 +51,15 @@ Now, depending on your application, you can get the state from cookies and pass If you are using NextJS App Directory, you can read the cookie state and pass it to the providers like so: -::: code-group +:::code-group -<<< @/snippets/getting-started/setup-app/layout.tsx +```tsx [layout.tsx] +// [!include ~/snippets/getting-started/setup-app/layout.tsx] +``` -<<< @/snippets/getting-started/setup-app/providers.tsx +```tsx [providers.tsx] +// [!include ~/snippets/getting-started/setup-app/providers.tsx] +``` ::: diff --git a/site/react/useAccount.md b/site/pages/react/useAccount.mdx similarity index 67% rename from site/react/useAccount.md rename to site/pages/react/useAccount.mdx index 64ec2a40e8..6658bcde01 100644 --- a/site/react/useAccount.md +++ b/site/pages/react/useAccount.mdx @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: useAccount - - - meta - - name: description - content: An overview of the useAccount hook - - - meta - - property: og:description - content: An overview of the useAccount hook - - - meta - - name: twitter:title - content: useAccount - - - meta - - name: twitter:description - content: An overview of the useAccount hook +title: useAccount +description: An overview of the useAccount hook --- # useAccount @@ -30,7 +15,9 @@ import { useAccount } from "@alchemy/aa-alchemy/react"; ## Usage -<<< @/snippets/react/useAccount.tsx +```tsx [useAccount.tsx] +// [!include ~/snippets/react/useAccount.tsx] +``` ## Parameters @@ -54,12 +41,20 @@ The underlying account type you want to use An optional param object based on the `type` property passed in above. It allows for overriding the default account parameters. -::: details CreateLightAccountParams -<<< @/../packages/accounts/src/light-account/accounts/account.ts#CreateLightAccountParams +:::details[CreateLightAccountParams] + +```ts [types.ts] +// [!include ~/../packages/accounts/src/light-account/accounts/account.ts:createlightaccountparams] +``` + ::: -::: details CreateMultiOwnerModularAccountParams -<<< @/../packages/accounts/src/msca/account/multiOwnerAccount.ts#CreateMultiOwnerModularAccountParams +:::details[CreateMultiOwnerModularAccountParams] + +```ts [types.ts] +// [!include ~/../packages/accounts/src/msca/account/multiOwnerAccount.ts:CreateMultiOwnerModularAccountParams] +``` + ::: ### skipCreate @@ -68,7 +63,9 @@ An optional param that allows you to avoid creating a new instance of the accoun ### ...mutationArgs - +import BaseHookMutationArgs from "./BaseHookMutationArgs.mdx"; + + ## Return Type diff --git a/site/react/useAddPasskey.md b/site/pages/react/useAddPasskey.mdx similarity index 62% rename from site/react/useAddPasskey.md rename to site/pages/react/useAddPasskey.mdx index 638f259d6a..0238758b73 100644 --- a/site/react/useAddPasskey.md +++ b/site/pages/react/useAddPasskey.mdx @@ -1,28 +1,13 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: useAddPasskey - - - meta - - name: description - content: An overview of the useAddPasskey hook - - - meta - - property: og:description - content: An overview of the useAddPasskey hook - - - meta - - name: twitter:title - content: useAddPasskey - - - meta - - name: twitter:description - content: An overview of the useAddPasskey hook +title: useAddPasskey +description: An overview of the useAddPasskey hook --- # useAddPasskey The `useAddPasskey` hook adds a new passkey to a user's Embedded Account. -::: warning +:::warning This requires your user to be logged in. See [`useAuthenticate`](/react/useAuthenticate) for more details. ::: @@ -34,11 +19,15 @@ import { useAddPasskey } from "@alchemy/aa-alchemy/react"; ## Usage -<<< @/snippets/react/useAddPasskey.tsx +```tsx [useAddPasskey.tsx] +// [!include ~/snippets/react/useAddPasskey.tsx] +``` ## Params - +import BaseHookMutationArgs from "./BaseHookMutationArgs.mdx"; + + ## Return Type @@ -51,7 +40,7 @@ Returns an object containing the following state. ### addPasskey `UseMutateFunction` -A React query mutation function that returns a `string[]` list of all passkey authenticatorIds, including the newly added one. It takes in [`CredentialCreationOptions`](https://microsoft.github.io/PowerBI-JavaScript/interfaces/_node_modules_typedoc_node_modules_typescript_lib_lib_dom_d_.credentialcreationoptions.html). +A React query mutation function that returns a `string[]` list of all passkey authenticatorIds, including the newly added one. It takes in [`CredentialCreationOptions`](https://microsoft.github.io/PowerBI-JavaScript/interfaces/_node_modules_typedoc_node_modules_typescript_lib_lib_dom_d_.credentialcreationoptions). ### isAddingPasskey diff --git a/site/react/useAuthenticate.md b/site/pages/react/useAuthenticate.mdx similarity index 57% rename from site/react/useAuthenticate.md rename to site/pages/react/useAuthenticate.mdx index 9bb47a1173..22ff07d3c9 100644 --- a/site/react/useAuthenticate.md +++ b/site/pages/react/useAuthenticate.mdx @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: useAuthenticate - - - meta - - name: description - content: An overview of the useAuthenticate hook - - - meta - - property: og:description - content: An overview of the useAuthenticate hook - - - meta - - name: twitter:title - content: useAuthenticate - - - meta - - name: twitter:description - content: An overview of the useAuthenticate hook +title: useAuthenticate +description: An overview of the useAuthenticate hook --- # useAuthenticate @@ -30,11 +15,15 @@ import { useAuthenticate } from "@alchemy/aa-alchemy/react"; ## Usage -<<< @/snippets/react/login.tsx +```tsx [login.tsx] +// [!include ~/snippets/react/login.tsx] +``` ## Params - +import BaseHookMutationArgs from "./BaseHookMutationArgs.mdx"; + + ## Return Type diff --git a/site/pages/react/useBundlerClient.mdx b/site/pages/react/useBundlerClient.mdx new file mode 100644 index 0000000000..e1194ef5c6 --- /dev/null +++ b/site/pages/react/useBundlerClient.mdx @@ -0,0 +1,28 @@ +--- +title: useBundlerClient +description: An overview of the useBundlerClient hook +--- + +# useBundlerClient + +The `useBundlerClient` hook returns the underlying Bundler RPC client instance. + +## Import + +```ts +import { useBundlerClient } from "@alchemy/aa-alchemy/react"; +``` + +## Usage + +```tsx [useBundlerClient.tsx] +// [!include ~/snippets/react/useBundlerClient.tsx] +``` + +## Return Type + +```ts +import { type UseBundlerClientResult } from "@alchemy/aa-alchemy/react"; +``` + +Returns an instance of `ClientWithAlchemyMethods` which is the JSON RPC client connected to Alchemy services. diff --git a/site/react/useChain.md b/site/pages/react/useChain.mdx similarity index 52% rename from site/react/useChain.md rename to site/pages/react/useChain.mdx index 9b0b04fc3f..87f38291eb 100644 --- a/site/react/useChain.md +++ b/site/pages/react/useChain.mdx @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: useChain - - - meta - - name: description - content: An overview of the useChain hook - - - meta - - property: og:description - content: An overview of the useChain hook - - - meta - - name: twitter:title - content: useChain - - - meta - - name: twitter:description - content: An overview of the useChain hook +title: useChain +description: An overview of the useChain hook --- # useChain @@ -30,7 +15,9 @@ import { useChain } from "@alchemy/aa-alchemy/react"; ## Usage -<<< @/snippets/react/useChain.tsx +```tsx [useChain.tsx] +// [!include ~/snippets/react/useChain.tsx] +``` ## Return Type diff --git a/site/react/useClientActions.md b/site/pages/react/useClientActions.mdx similarity index 71% rename from site/react/useClientActions.md rename to site/pages/react/useClientActions.mdx index 97bdcc8587..f419d742e0 100644 --- a/site/react/useClientActions.md +++ b/site/pages/react/useClientActions.mdx @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: useClientActions - - - meta - - name: description - content: An overview of the useClientActions hook - - - meta - - property: og:description - content: An overview of the useClientActions hook - - - meta - - name: twitter:title - content: useClientActions - - - meta - - name: twitter:description - content: An overview of the useClientActions hook +title: useClientActions +description: An overview of the useClientActions hook --- # useClientActions @@ -28,7 +13,9 @@ import { useClientActions } from "@alchemy/aa-alchemy/react"; ## Usage -<<< @/snippets/react/useClientActions.tsx +```tsx [useClientActions.tsx] +// [!include ~/snippets/react/useClientActions.tsx] +``` ## Params @@ -44,7 +31,9 @@ The SmartAccountClient instance returned from `useSmartAccountClient` a function that accepts as input the above client and returns an object containing functions that you can call to execute actions on the client. - +import BaseHookMutationArgs from "./BaseHookMutationArgs.mdx"; + + ## Return Type diff --git a/site/react/useDropAndReplaceUserOperation.md b/site/pages/react/useDropAndReplaceUserOperation.mdx similarity index 58% rename from site/react/useDropAndReplaceUserOperation.md rename to site/pages/react/useDropAndReplaceUserOperation.mdx index 12c9a8d76e..b6127f69e7 100644 --- a/site/react/useDropAndReplaceUserOperation.md +++ b/site/pages/react/useDropAndReplaceUserOperation.mdx @@ -1,28 +1,13 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: useDropAndReplaceUserOperation - - - meta - - name: description - content: An overview of the useDropAndReplaceUserOperation hook - - - meta - - property: og:description - content: An overview of the useDropAndReplaceUserOperation hook - - - meta - - name: twitter:title - content: useDropAndReplaceUserOperation - - - meta - - name: twitter:description - content: An overview of the useDropAndReplaceUserOperation hook +title: useDropAndReplaceUserOperation +description: An overview of the useDropAndReplaceUserOperation hook --- # useDropAndReplaceUserOperation The `useDropAndReplaceUserOperation` hook enables dropping and replaicng a User Operation sent from a user's Embedded Account. -::: warning +:::warning This requires your user to be logged in. See [`useAuthenticate`](/react/useAuthenticate) for more details. ::: @@ -34,7 +19,9 @@ import { useDropAndReplaceUserOperation } from "@alchemy/aa-alchemy/react"; ## Usage -<<< @/snippets/react/useDropAndReplaceUserOperation.tsx +```tsx [useDropAndReplaceUserOperation.tsx] +// [!include ~/snippets/react/useDropAndReplaceUserOperation.tsx] +``` ## Params @@ -45,7 +32,9 @@ A `AlchemySmartAccountClient` with methods to interact with an Alchemy smart acc ### ...mutationArgs - +import BaseHookMutationArgs from "./BaseHookMutationArgs.mdx"; + + ## Return Type @@ -60,21 +49,33 @@ Returns an object containing the following state. `UseMutateFunction` A React query mutation function to sign a message. It returns a `SendUserOperationResult` object. -::: details SendUserOperationResult -<<< @/../packages/core/src/client/types.ts#SendUserOperationResult +:::details[SendUserOperationResult] + +```ts [types.ts] +// [!include ~/../packages/core/src/client/types.ts:SendUserOperationResult] +``` + ::: It takes in `DropAndReplaceUserOperationParameters` which has the following type: -::: details DropAndReplaceUserOperationParameters -<<< @/../packages/core/src/actions/smartAccount/types.ts#DropAndReplaceUserOperationParameters +:::details[DropAndReplaceUserOperationParameters] + +```ts [types.ts] +// [!include ~/../packages/core/src/actions/smartAccount/types.ts:DropAndReplaceUserOperationParameters] +``` + ::: ### dropAndReplaceUserOperationResult An object of the following `SendUserOperationResult` type if the mutation has run successfully, `undefined` otherwise: -::: details SendUserOperationResult -<<< @/../packages/core/src/client/types.ts#SendUserOperationResult +:::details[SendUserOperationResult] + +```ts [types.ts] +// [!include ~/../packages/core/src/client/types.ts:SendUserOperationResult] +``` + ::: ### isDroppingAndReplacingUserOperation diff --git a/site/react/useExportAccount.md b/site/pages/react/useExportAccount.mdx similarity index 78% rename from site/react/useExportAccount.md rename to site/pages/react/useExportAccount.mdx index 85f591f1bc..8a354abb0b 100644 --- a/site/react/useExportAccount.md +++ b/site/pages/react/useExportAccount.mdx @@ -1,28 +1,13 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: useExportAccount - - - meta - - name: description - content: An overview of the useExportAccount hook - - - meta - - property: og:description - content: An overview of the useExportAccount hook - - - meta - - name: twitter:title - content: useExportAccount - - - meta - - name: twitter:description - content: An overview of the useExportAccount hook +title: useExportAccount +description: An overview of the useExportAccount hook --- # useExportAccount The `useExportAccount` hook exports the user's Embedded Account's recovery details to be viewable on the application. -::: warning +:::warning This requires your user to be logged in. See [`useAuthenticate`](/react/useAuthenticate) for more details. ::: @@ -34,7 +19,9 @@ import { useExportAccount } from "@alchemy/aa-alchemy/react"; ## Usage -<<< @/snippets/react/useExportAccount.tsx +```tsx [useExportAccount.tsx] +// [!include ~/snippets/react/useExportAccount.tsx] +``` ## Params @@ -48,7 +35,9 @@ If `params` is not passed in, the default iframe config will just have an `ifram ### ...mutationArgs - +import BaseHookMutationArgs from "./BaseHookMutationArgs.mdx"; + + ## Return Type diff --git a/site/react/useLogout.md b/site/pages/react/useLogout.mdx similarity index 60% rename from site/react/useLogout.md rename to site/pages/react/useLogout.mdx index 2222c1decb..cf8f88c515 100644 --- a/site/react/useLogout.md +++ b/site/pages/react/useLogout.mdx @@ -1,28 +1,13 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: useLogout - - - meta - - name: description - content: An overview of the useLogout hook - - - meta - - property: og:description - content: An overview of the useLogout hook - - - meta - - name: twitter:title - content: useLogout - - - meta - - name: twitter:description - content: An overview of the useLogout hook +title: useLogout +description: An overview of the useLogout hook --- # useLogout The `useLogout` hook logs a user out of their Embedded Account on your application. -::: warning +:::warning This requires your user to be logged in. See [`useAuthenticate`](/react/useAuthenticate) for more details. ::: @@ -34,11 +19,15 @@ import { useLogout } from "@alchemy/aa-alchemy/react"; ## Usage -<<< @/snippets/react/useLogout.tsx +```tsx [useLogout.tsx] +// [!include ~/snippets/react/useLogout.tsx] +``` ## Params - +import BaseHookMutationArgs from "./BaseHookMutationArgs.mdx"; + + ## Return Type diff --git a/site/react/useSendTransaction.md b/site/pages/react/useSendTransaction.mdx similarity index 67% rename from site/react/useSendTransaction.md rename to site/pages/react/useSendTransaction.mdx index f8b6d239d2..90e24c82a8 100644 --- a/site/react/useSendTransaction.md +++ b/site/pages/react/useSendTransaction.mdx @@ -1,28 +1,13 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: useSendTransaction - - - meta - - name: description - content: An overview of the useSendTransaction hook - - - meta - - property: og:description - content: An overview of the useSendTransaction hook - - - meta - - name: twitter:title - content: useSendTransaction - - - meta - - name: twitter:description - content: An overview of the useSendTransaction hook +title: useSendTransaction +description: An overview of the useSendTransaction hook --- # useSendTransaction The `useSendTransaction` hook enables sending a transaction as a UserOperation on behalf of the user's Embedded Account. -::: warning +:::warning This hook is deprecated in favor of [`useSendUserOperation`](/react/useSendUserOperation). This requires your user to be logged in. See [`useAuthenticate`](/react/useAuthenticate) for more details. @@ -36,7 +21,9 @@ import { useSendTransaction } from "@alchemy/aa-alchemy/react"; ## Usage -<<< @/snippets/react/useSendTransaction.tsx +```tsx [useSendTransaction.tsx] +// [!include ~/snippets/react/useSendTransaction.tsx] +``` ## Params @@ -47,7 +34,9 @@ A `AlchemySmartAccountClient` with methods to interact with an Alchemy smart acc ### ...mutationArgs - +import BaseHookMutationArgs from "./BaseHookMutationArgs.mdx"; + + ## Return Type @@ -62,11 +51,15 @@ Returns an object containing the following state. `UseMutateFunction` A React query mutation function to send a transaction as a UserOperation. It returns a `SendTransactionResult` object. -::: details SendTransactionResult -<<< @/../packages/core/src/client/types.ts#SendTransactionResult +:::details[SendTransactionResult] + +```ts [types.ts] +// [!include ~/../packages/core/src/client/types.ts:SendTransactionResult] +``` + ::: -It takes in `SendTransactionParameters` which has [this type](https://viem.sh/docs/actions/wallet/sendTransaction.html#parameters) from `viem`. +It takes in `SendTransactionParameters` which has [this type](https://viem.sh/docs/actions/wallet/sendTransaction#parameters) from `viem`. ### sendTransactionAsync diff --git a/site/react/useSendTransactions.md b/site/pages/react/useSendTransactions.mdx similarity index 66% rename from site/react/useSendTransactions.md rename to site/pages/react/useSendTransactions.mdx index c374701691..acc9507af2 100644 --- a/site/react/useSendTransactions.md +++ b/site/pages/react/useSendTransactions.mdx @@ -1,28 +1,13 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: useSendTransactions - - - meta - - name: description - content: An overview of the useSendTransactions hook - - - meta - - property: og:description - content: An overview of the useSendTransactions hook - - - meta - - name: twitter:title - content: useSendTransactions - - - meta - - name: twitter:description - content: An overview of the useSendTransactions hook +title: useSendTransactions +description: An overview of the useSendTransactions hook --- # useSendTransactions The `useSendTransactions` hook enables sending a set of transactions as a UserOperation on behalf of the user's Embedded Account. -::: warning +:::warning This hook is deprecated in favor of [`useSendUserOperation`](/react/useSendUserOperation). This requires your user to be logged in. See [`useAuthenticate`](/react/useAuthenticate) for more details. @@ -36,7 +21,9 @@ import { useSendTransactions } from "@alchemy/aa-alchemy/react"; ## Usage -<<< @/snippets/react/useSendTransactions.tsx +```tsx [useSendTransactions.tsx] +// [!include ~/snippets/react/useSendTransactions.tsx] +``` ## Params @@ -47,7 +34,9 @@ A `AlchemySmartAccountClient` with methods to interact with an Alchemy smart acc ### ...mutationArgs - +import BaseHookMutationArgs from "./BaseHookMutationArgs.mdx"; + + ## Return Type @@ -62,14 +51,22 @@ Returns an object containing the following state. `UseMutateFunction` A React query mutation function to send a Transactions as a UserOperation. It returns a `SendTransactionsResult` object. -::: details SendTransactionsResult -<<< @/../packages/core/src/client/types.ts#SendTransactionsResult +:::details[SendTransactionsResult] + +```ts [types.ts] +// [!include ~/../packages/core/src/client/types.ts:SendTransactionsResult] +``` + ::: It takes in `SendTransactionsParameters` which has the following type: -::: details SendTransactionsParameters -<<< @/../packages/core/src/actions/smartAccount/types.ts#SendTransactionsParameters +:::details[SendTransactionsParameters] + +```ts [types.ts] +// [!include ~/../packages/core/src/actions/smartAccount/types.ts:SendTransactionsParameters] +``` + ::: ### sendTransactionsAsync diff --git a/site/react/useSendUserOperation.md b/site/pages/react/useSendUserOperation.mdx similarity index 70% rename from site/react/useSendUserOperation.md rename to site/pages/react/useSendUserOperation.mdx index b501e3b319..92b699c565 100644 --- a/site/react/useSendUserOperation.md +++ b/site/pages/react/useSendUserOperation.mdx @@ -1,28 +1,13 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: useSendUserOperation - - - meta - - name: description - content: An overview of the useSendUserOperation hook - - - meta - - property: og:description - content: An overview of the useSendUserOperation hook - - - meta - - name: twitter:title - content: useSendUserOperation - - - meta - - name: twitter:description - content: An overview of the useSendUserOperation hook +title: useSendUserOperation +description: An overview of the useSendUserOperation hook --- # useSendUserOperation The `useSendUserOperation` hook enables sending UserOperations on behalf of the user's Embedded Account. -::: warning +:::warning This requires your user to be logged in. See [`useAuthenticate`](/react/useAuthenticate) for more details. ::: @@ -36,13 +21,17 @@ import { useSendUserOperation } from "@alchemy/aa-alchemy/react"; ### Without awaiting the transaction hash -<<< @/snippets/react/useSendUserOperation.tsx +```tsx [useSendUserOperation.tsx] +// [!include ~/snippets/react/useSendUserOperation.tsx] +``` ### Await the tx to mine and retry failures The below example uses the useSendUserOperation with the `waitForTxn` flag set to `true` and makes one drop and replace call if the UserOperation fails to be mined. -<<< @/snippets/react/useSendUserOperationWithRetries.tsx +```tsx [useSendUserOperationWithRetries.tsx] +// [!include ~/snippets/react/useSendUserOperationWithRetries.tsx] +``` ## Params @@ -58,7 +47,9 @@ An optional flag to additionally wait for the transaction hash in which the send ### ...mutationArgs - +import BaseHookMutationArgs from "./BaseHookMutationArgs.mdx"; + + ## Return Type @@ -73,14 +64,22 @@ Returns an object containing the following state. `UseMutateFunction` A React query mutation function to send a UserOperation. It returns a `SendUserOperationResult` object. -::: details SendUserOperationResult -<<< @/../packages/core/src/client/types.ts#SendUserOperationResult +:::details[SendUserOperationResult] + +```ts [types.ts] +// [!include ~/../packages/core/src/client/types.ts:SendUserOperationResult] +``` + ::: It takes in `SendUserOperationParameters` which has the following type: -::: details SendUserOperationParameters -<<< @/../packages/core/src/actions/smartAccount/types.ts#SendUserOperationParameters +:::details[SendUserOperationParameters] + +```ts [types.ts] +// [!include ~/../packages/core/src/actions/smartAccount/types.ts:SendUserOperationParameters] +``` + ::: ### sendUserOperationAsync diff --git a/site/react/useSignMessage.md b/site/pages/react/useSignMessage.mdx similarity index 66% rename from site/react/useSignMessage.md rename to site/pages/react/useSignMessage.mdx index 7efde46a46..89b27b4bf4 100644 --- a/site/react/useSignMessage.md +++ b/site/pages/react/useSignMessage.mdx @@ -1,28 +1,13 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: useSignMessage - - - meta - - name: description - content: An overview of the useSignMessage hook - - - meta - - property: og:description - content: An overview of the useSignMessage hook - - - meta - - name: twitter:title - content: useSignMessage - - - meta - - name: twitter:description - content: An overview of the useSignMessage hook +title: useSignMessage +description: An overview of the useSignMessage hook --- # useSignMessage -The `useSignMessage` hook enables signing a message on behalf of the user's Embedded Account. If the account is not yet deployed onchain, this will use [ERC-6492](/resources/terms.html#erc-6492) to sign the message. +The `useSignMessage` hook enables signing a message on behalf of the user's Embedded Account. If the account is not yet deployed onchain, this will use [ERC-6492](/resources/terms#erc-6492) to sign the message. -::: warning +:::warning This requires your user to be logged in. See [`useAuthenticate`](/react/useAuthenticate) for more details. ::: @@ -34,7 +19,9 @@ import { useSignMessage } from "@alchemy/aa-alchemy/react"; ## Usage -<<< @/snippets/react/useSignMessage.tsx +```tsx [useSignMessage.tsx] +// [!include ~/snippets/react/useSignMessage.tsx] +``` ## Params @@ -45,7 +32,9 @@ A `AlchemySmartAccountClient` with methods to interact with an Alchemy smart acc ### ...mutationArgs - +import BaseHookMutationArgs from "./BaseHookMutationArgs.mdx"; + + ## Return Type @@ -58,12 +47,12 @@ Returns an object containing the following state. ### signMessage `UseMutateFunction` -A React query mutation function to sign a message. It returns a `Hex` representation of the signed message. It takes in an object with a [`SignableMessage`](https://viem.sh/docs/actions/wallet/signMessage.html#message) field called `message`. +A React query mutation function to sign a message. It returns a `Hex` representation of the signed message. It takes in an object with a [`SignableMessage`](https://viem.sh/docs/actions/wallet/signMessage#message) field called `message`. ### signMessageAsync `UseMutateAsyncFunction` -A React query async mutation function to sign a message. Via an awaitable promise, it returns a `Hex` representation of the signed message. It takes in an object with a [`SignableMessage`](https://viem.sh/docs/actions/wallet/signMessage.html#message) field called `message`. +A React query async mutation function to sign a message. Via an awaitable promise, it returns a `Hex` representation of the signed message. It takes in an object with a [`SignableMessage`](https://viem.sh/docs/actions/wallet/signMessage#message) field called `message`. ### signedMessage diff --git a/site/react/useSignTypedData.md b/site/pages/react/useSignTypedData.mdx similarity index 66% rename from site/react/useSignTypedData.md rename to site/pages/react/useSignTypedData.mdx index 3053ffd80e..46fbfdc06a 100644 --- a/site/react/useSignTypedData.md +++ b/site/pages/react/useSignTypedData.mdx @@ -1,28 +1,13 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: useSignTypedData - - - meta - - name: description - content: An overview of the useSignTypedData hook - - - meta - - property: og:description - content: An overview of the useSignTypedData hook - - - meta - - name: twitter:title - content: useSignTypedData - - - meta - - name: twitter:description - content: An overview of the useSignTypedData hook +title: useSignTypedData +description: An overview of the useSignTypedData hook --- # useSignTypedData -The `useSignTypedData` hook enables signing typed data on behalf of the user's Embedded Account. If the account is not yet deployed onchain, this will use [ERC-6492](/resources/terms.html#erc-6492) to sign the typed data. +The `useSignTypedData` hook enables signing typed data on behalf of the user's Embedded Account. If the account is not yet deployed onchain, this will use [ERC-6492](/resources/terms#erc-6492) to sign the typed data. -::: warning +:::warning This requires your user to be logged in. See [`useAuthenticate`](/react/useAuthenticate) for more details. ::: @@ -34,7 +19,9 @@ import { useSignTypedData } from "@alchemy/aa-alchemy/react"; ## Usage -<<< @/snippets/react/useSignTypedData.tsx +```tsx [useSignTypedData.tsx] +// [!include ~/snippets/react/useSignTypedData.tsx] +``` ## Params @@ -45,7 +32,9 @@ A `AlchemySmartAccountClient` with methods to interact with an Alchemy smart acc ### ...mutationArgs - +import BaseHookMutationArgs from "./BaseHookMutationArgs.mdx"; + + ## Return Type @@ -58,12 +47,12 @@ Returns an object containing the following state. ### signTypedData `UseMutateFunction` -A React query mutation function to sign typed data. It returns a `Hex` representation of the signed typed data. It takes in an object with a [`TypedDataDefinition`](https://viem.sh/docs/utilities/hashTypedData.html#parameters) field called `typedData`. +A React query mutation function to sign typed data. It returns a `Hex` representation of the signed typed data. It takes in an object with a [`TypedDataDefinition`](https://viem.sh/docs/utilities/hashTypedData#parameters) field called `typedData`. ### signTypedDataAsync `UseMutateAsyncFunction` -A React query async mutation function to sign typed data. Via an awaitable promise, it returns a `Hex` representation of the signed typed data. It takes in an object with a [`TypedDataDefinition`](https://viem.sh/docs/utilities/hashTypedData.html#parameters) field called `typedData`. +A React query async mutation function to sign typed data. Via an awaitable promise, it returns a `Hex` representation of the signed typed data. It takes in an object with a [`TypedDataDefinition`](https://viem.sh/docs/utilities/hashTypedData#parameters) field called `typedData`. ### signedTypedData diff --git a/site/react/useSigner.md b/site/pages/react/useSigner.mdx similarity index 55% rename from site/react/useSigner.md rename to site/pages/react/useSigner.mdx index 14dd7020ae..8312a4acf2 100644 --- a/site/react/useSigner.md +++ b/site/pages/react/useSigner.mdx @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: useSigner - - - meta - - name: description - content: An overview of the useSigner hook - - - meta - - property: og:description - content: An overview of the useSigner hook - - - meta - - name: twitter:title - content: useSigner - - - meta - - name: twitter:description - content: An overview of the useSigner hook +title: useSigner +description: An overview of the useSigner hook --- # useSigner @@ -30,7 +15,9 @@ import { useSigner } from "@alchemy/aa-alchemy/react"; ## Usage -<<< @/snippets/react/useSigner.tsx +```tsx [useSigner.tsx] +// [!include ~/snippets/react/useSigner.tsx] +``` ## Return Type diff --git a/site/react/useSignerStatus.md b/site/pages/react/useSignerStatus.mdx similarity index 64% rename from site/react/useSignerStatus.md rename to site/pages/react/useSignerStatus.mdx index 00a0ed7e23..41950c5348 100644 --- a/site/react/useSignerStatus.md +++ b/site/pages/react/useSignerStatus.mdx @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: useSignerStatus - - - meta - - name: description - content: An overview of the useSignerStatus hook - - - meta - - property: og:description - content: An overview of the useSignerStatus hook - - - meta - - name: twitter:title - content: useSignerStatus - - - meta - - name: twitter:description - content: An overview of the useSignerStatus hook +title: useSignerStatus +description: An overview of the useSignerStatus hook --- # useSignerStatus @@ -30,7 +15,9 @@ import { useSignerStatus } from "@alchemy/aa-alchemy/react"; ## Usage -<<< @/snippets/react/useSignerStatus.tsx +```tsx [useSignerStatus.tsx] +// [!include ~/snippets/react/useSignerStatus.tsx] +``` ## Return Type diff --git a/site/react/useSmartAccountClient.md b/site/pages/react/useSmartAccountClient.mdx similarity index 56% rename from site/react/useSmartAccountClient.md rename to site/pages/react/useSmartAccountClient.mdx index ffc8935aab..8ff62c0e57 100644 --- a/site/react/useSmartAccountClient.md +++ b/site/pages/react/useSmartAccountClient.mdx @@ -1,26 +1,11 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: useSmartAccountClient - - - meta - - name: description - content: An overview of the useSmartAccountClient hook - - - meta - - property: og:description - content: An overview of the useSmartAccountClient hook - - - meta - - name: twitter:title - content: useSmartAccountClient - - - meta - - name: twitter:description - content: An overview of the useSmartAccountClient hook +title: useSmartAccountClient +description: An overview of the useSmartAccountClient hook --- # useSmartAccountClient -The `useSmartAccountClient` hook is used to create a new [`AlchemySmartAccountClient`](/packages/aa-alchemy/smart-account-client/index) attached to either a `LightAccount` or `MultiOwnerModularAccount` contract using the `AlchemySigner`. +The `useSmartAccountClient` hook is used to create a new [`AlchemySmartAccountClient`](/packages/aa-alchemy/smart-account-client/) attached to either a `LightAccount` or `MultiOwnerModularAccount` contract using the `AlchemySigner`. ## Import @@ -30,7 +15,9 @@ import { useSmartAccountClient } from "@alchemy/aa-alchemy/react"; ## Usage -<<< @/snippets/react/useSmartAccountClient.tsx +```tsx [useSmartAccountClient.tsx] +// [!include ~/snippets/react/useSmartAccountClient.tsx] +``` ## Parameters @@ -54,12 +41,20 @@ The underlying account type you want to use An optional param object based on the `type` property passed in above. It allows for overriding the default account parameters. -::: details CreateLightAccountParams -<<< @/../packages/accounts/src/light-account/accounts/account.ts#CreateLightAccountParams +:::details[CreateLightAccountParams] + +```ts [types.ts] +// [!include ~/../packages/accounts/src/light-account/accounts/account.ts:CreateLightAccountParams] +``` + ::: -::: details CreateMultiOwnerModularAccountParams -<<< @/../packages/accounts/src/msca/account/multiOwnerAccount.ts#CreateMultiOwnerModularAccountParams +:::details[CreateMultiOwnerModularAccountParams] + +```ts [types.ts] +// [!include ~/../packages/accounts/src/msca/account/multiOwnerAccount.ts:CreateMultiOwnerModularAccountParams] +``` + ::: ### ...rest @@ -77,8 +72,12 @@ Omit< The remaining parameters that are accepted allow for overriding certain properties of the `AlchemySmartAccountClient` -::: details AlchemySmartAccountClientConfig -<<< @/../packages/alchemy/src/client/smartAccountClient.ts#AlchemySmartAccountClientConfig +:::details[AlchemySmartAccountClientConfig] + +```ts [types.ts] +// [!include ~/../packages/alchemy/src/client/smartAccountClient.ts:AlchemySmartAccountClientConfig] +``` + ::: ## Return Type @@ -90,7 +89,7 @@ import { type UseSmartAccountClientResult } from "@alchemy/aa-alchemy/react"; ### client `AlchemySmartAccountClient | undefined` -Once the underlying account is created, this will be an instance of an [`AlchemySmartAccountClient`](/packages/aa-alchemy/smart-account-client/index.html) connected to an instance of the account type specified. +Once the underlying account is created, this will be an instance of an [`AlchemySmartAccountClient`](/packages/aa-alchemy/smart-account-client/) connected to an instance of the account type specified. ### isLoadingClient diff --git a/site/pages/react/useUser.mdx b/site/pages/react/useUser.mdx new file mode 100644 index 0000000000..2731c68162 --- /dev/null +++ b/site/pages/react/useUser.mdx @@ -0,0 +1,28 @@ +--- +title: useUser +description: An overview of the useUser hook +--- + +# useUser + +The `useUser` hook returns the authenticated [`User`](/resources/types#user) if the signer is authenticated. + +## Import + +```ts +import { useUser } from "@alchemy/aa-alchemy/react"; +``` + +## Usage + +```tsx [useUser.tsx] +// [!include ~/snippets/react/useUser.tsx] +``` + +## Return Type + +```ts +import { type UseUserResult } from "@alchemy/aa-alchemy/react"; +``` + +Returns a `User` object if the user has been authenticated, othwerise `null`. diff --git a/site/react/useWaitForUserOperationTransaction.md b/site/pages/react/useWaitForUserOperationTransaction.mdx similarity index 64% rename from site/react/useWaitForUserOperationTransaction.md rename to site/pages/react/useWaitForUserOperationTransaction.mdx index cae876b324..b4b279ad50 100644 --- a/site/react/useWaitForUserOperationTransaction.md +++ b/site/pages/react/useWaitForUserOperationTransaction.mdx @@ -1,28 +1,13 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: useWaitForUserOperationTransaction - - - meta - - name: description - content: An overview of the useWaitForUserOperationTransaction hook - - - meta - - property: og:description - content: An overview of the useWaitForUserOperationTransaction hook - - - meta - - name: twitter:title - content: useWaitForUserOperationTransaction - - - meta - - name: twitter:description - content: An overview of the useWaitForUserOperationTransaction hook +title: useWaitForUserOperationTransaction +description: An overview of the useWaitForUserOperationTransaction hook --- # useWaitForUserOperationTransaction The `useWaitForUserOperationTransaction` hook enables waiting until a UserOperation that was sent on behalf of the user's Embedded Account eventually lands in a transaction. -::: warning +:::warning This requires your user to be logged in. See [`useAuthenticate`](/react/useAuthenticate) for more details. ::: @@ -34,7 +19,9 @@ import { useWaitForUserOperationTransaction } from "@alchemy/aa-alchemy/react"; ## Usage -<<< @/snippets/react/useWaitForUserOperationTransaction.tsx +```tsx [useWaitForUserOperationTransaction.tsx] +// [!include ~/snippets/react/useWaitForUserOperationTransaction.tsx] +``` ## Params @@ -45,7 +32,9 @@ A `AlchemySmartAccountClient` with methods to interact with an Alchemy smart acc ### ...mutationArgs - +import BaseHookMutationArgs from "./BaseHookMutationArgs.mdx"; + + ## Return Type @@ -62,8 +51,12 @@ A React query mutation function to wait for a UserOperation's Transaction. It re It takes in `WaitForUserOperationTxParameters` which has the following type: -::: details WaitForUserOperationTxParameters -<<< @/../packages/core/src/actions/smartAccount/types.ts#WaitForUserOperationTxParameters +:::details[WaitForUserOperationTxParameters] + +```ts [types.ts] +// [!include ~/../packages/core/src/actions/smartAccount/types.ts:WaitForUserOperationTxParameters] +``` + ::: ### waitForUserOperationTransactionResult diff --git a/site/resources/bbp.md b/site/pages/resources/bbp.mdx similarity index 97% rename from site/resources/bbp.md rename to site/pages/resources/bbp.mdx index 2bed9a1c8b..a8476445a0 100644 --- a/site/resources/bbp.md +++ b/site/pages/resources/bbp.mdx @@ -1,3 +1,3 @@ -::: info +:::info We believe that strong security requires strong collaboration with skilled security researchers to improve the resilience of our code and all of the things it can do. If you believe you have found a security issue in our source code or smart contracts, we encourage you to participate in the Alchemy [Bug Bounty](https://hackerone.com/alchemyplatform) program and notify us. ::: diff --git a/site/resources/contact-us.md b/site/pages/resources/contact-us.md similarity index 72% rename from site/resources/contact-us.md rename to site/pages/resources/contact-us.md index a155107626..ae73b680d1 100644 --- a/site/resources/contact-us.md +++ b/site/pages/resources/contact-us.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Contact Alchemy - - - meta - - name: description - content: Contact Alchemy about Account Kit - - - meta - - property: og:description - content: Contact Alchemy about Account Kit +title: Contact Alchemy +description: Contact Alchemy about Account Kit --- # Contact us @@ -24,6 +15,6 @@ If there's anything we can do to improve your experience with Account Kit, pleas ## Contributing -1. If you see a issue in our code or documentation, feel free to address it yourself! See this [README](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md) on contributing to Account Kit's codebase. +1. If you see a issue in our code or documentation, feel free to address it yourself! See this [README](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING) on contributing to Account Kit's codebase. 2. If you are interested in [ERC-6900](https://eips.ethereum.org/EIPS/eip-6900) or modular account development, join the [outreach waitlist](https://docs.google.com/forms/d/1Z3wFRiMoEKoo8FJFrymVEOzrbKQXjSnYhm_hKKDnooE/edit) or our [Telegram group](https://t.me/+KfB9WuhKDgk5YzIx). diff --git a/site/resources/faqs.md b/site/pages/resources/faqs.md similarity index 85% rename from site/resources/faqs.md rename to site/pages/resources/faqs.md index cae9d297ce..73272e130c 100644 --- a/site/resources/faqs.md +++ b/site/pages/resources/faqs.md @@ -1,21 +1,7 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Frequently Asked Questions - - - meta - - name: description - content: Learn how to get started with Alchemy's Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Frequently Asked Questions - - - meta - - name: twitter:title - content: FAQs - - - meta - - name: twitter:description - content: Frequently Asked Questions +title: Frequently Asked Questions +description: Learn how to get started with Alchemy's Account Kit, a vertically + integrated stack for building apps that support ERC-4337 and ERC-6900. --- # Frequently asked questions @@ -24,7 +10,7 @@ head: ### Do accounts have the same address across all chains? -::: details Answer +:::details[Answer] In almost all cases, yes, you will get the same address on all chains as long as the connecting signer address is the same! The deployment address is a function of the address of owner/signer address, the account implementation (e.g. latest version of Light Account), and the salt (you can optionally specify this). If all three of those remain the same, then you deploy the smart account at the same contract address. There are two scenarios where you would get a different contract address: @@ -35,25 +21,25 @@ There are two scenarios where you would get a different contract address: ### How does a smart account get deployed? -::: details Answer +:::details[Answer] Your smart account will be deployed when the first `UserOperation` (UO) is sent from the account. The first UO must be sent with a non-zero `initCode`. aa-sdk will handle generation of this `initCode` for you using [`getAccountInitCode`](/packages/aa-core/accounts/). ::: ### How can I upgrade a Light Account? -::: details Answer +:::details[Answer] It is unlikely you will need to frequently update the Light Account contract itself, however it is possible if needed. Light Account has [`UUPSUpgradeable`](https://github.com/alchemyplatform/light-account/blob/main/src/LightAccount.sol#L50) which adds upgrade methods on the account itself. To upgrade an account you will need to send a `UserOperation` using the method `upgradeTo` or `upgradeToAndCall`, depending on whether or not you need to initialize the new implementation. ::: ### Can I have multiple accounts for the same signer address? / How do I set the value of the salt for Light Account? -::: details Answer +:::details[Answer] Yes! The optional salt value on Light Account enables the ability to have multiple accounts under a single signer. This value defaults to 0. You can set it when you create [light account](/packages/aa-accounts/light-account/). ::: ### How can I upgrade from Simple Account to Light Account? -::: details Answer +:::details[Answer] [Simple Account's](https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/SimpleAccount.sol) support [`upgradeToAndCall`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/4e7e6e54daedf091d91f2f2df024cbb8f253e2ef/contracts/proxy/utils/UUPSUpgradeable.sol#L86) implemented by openzeppelin [UUPSUpgradeable](https://docs.openzeppelin.com/contracts/4.x/api/proxy#UUPSUpgradeable) contract. This allows you to upgrade from Simple Account to Light Account without changing the smart contract account address. Using `upgradeToAndCall` will update the underlying implementation contract on the account while the account address and assets will stay the same. You can call `upgradeToAndCall` on the Simple Account with these params: @@ -72,38 +58,38 @@ This can be called on the existing smart contract account by sending a user oper ### How does the speed of `UserOperation`s compare to normal transactions? -::: details Answer +:::details[Answer] If the `UserOperation` (meta-transaction for 4337 accounts) is correctly priced and submitted a few hundred milliseconds prior to a new block getting created, it will typically get placed in the next block. This is because the Bundler needs time to create/propagate its transaction. You can think of it as 1 extra block time worth of latency, but we are working towards improving this latency. ::: ### Why am I seeing a delay in landing `UserOperation`s on-chain? -::: details Answer +:::details[Answer] This can happen when `UserOperation`s (UOs) become underpriced, frequently due to fee market movement between when gas and fees are estimations and when the UO is actually submitted. -You may experience this when calling the [`waitForUserOperationTransaction`](/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction.html#waitForUserOperationTransaction) method. It may throw an error if it does not find the UO in a mined Transaction within its retry limits. +You may experience this when calling the [`waitForUserOperationTransaction`](/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction#waitForUserOperationTransaction) method. It may throw an error if it does not find the UO in a mined Transaction within its retry limits. -You can mitigate this by defining a more flexible retry period when constructing a [`Client`](/packages/aa-core/smart-account-client/index.html#usage) (i.e. `txMaxRetries`, `txRetryIntervalMs`, `txRetryMultiplier` in `opts`). If your UO continues to be delayed beyond a limit you are willing to wait, you can resubmit it using [`dropAndReplaceUserOperation`](/packages/aa-core/smart-account-client/actions/dropAndReplaceUserOperation.html#dropandreplaceuseroperation). +You can mitigate this by defining a more flexible retry period when constructing a [`Client`](/packages/aa-core/smart-account-client/index#usage) (i.e. `txMaxRetries`, `txRetryIntervalMs`, `txRetryMultiplier` in `opts`). If your UO continues to be delayed beyond a limit you are willing to wait, you can resubmit it using [`dropAndReplaceUserOperation`](/packages/aa-core/smart-account-client/actions/dropAndReplaceUserOperation#dropandreplaceuseroperation). ::: ### Are `UserOperation`s protected from MEV bots? -::: details Answer +:::details[Answer] Right now, `UserOperation`s are sent to a private mempool for all networks other than Polygon, where there is no way to do this. We are actively involved in proposals for a peer-to-peer mempool standard. ::: ### Can I simulate `UserOperation`s the same way I simulate transactions? -::: details Answer -Yes! Check out [this guide](/using-smart-accounts/simulate-user-operations.html). +:::details[Answer] +Yes! Check out [this guide](/using-smart-accounts/simulate-user-operations). ::: ## Gas Estimation ### How does gas estimation for 4337 smart contract accounts work? -::: details Answer -Our bundler estimates gas and submits `UserOperation`s (UOs) under the hood of the aa-sdk. Our gas estimations are just that, estimations that optimize for UOs landing on chain, and you may need to adjust gas limits based on your needs using [overrides](/packages/aa-core/smart-account-client/types/userOperationOverrides.html). +:::details[Answer] +Our bundler estimates gas and submits `UserOperation`s (UOs) under the hood of the aa-sdk. Our gas estimations are just that, estimations that optimize for UOs landing on chain, and you may need to adjust gas limits based on your needs using [overrides](/packages/aa-core/smart-account-client/types/userOperationOverrides). Learn more about gas estimation and how it is implemented in our [Bundler](https://www.alchemy.com/blog/erc-4337-gas-estimation). @@ -116,45 +102,45 @@ We recommend adding error handling when sending a UO to handle potential gas and ### What tiers support gas sponsorship? -::: details Answer +:::details[Answer] Gas sponsorship is available on testnet for all tiers. For support on mainnet, you must be on a paying tier (i.e. Growth tier and above). Learn more about our different pricing tiers [here](https://docs.alchemy.com/reference/gas-manager-coverage-api-pricing#fee-logic). ::: ### How is gas sponsored? Do I need to fund the Gas Manager? -::: details Answer -We front the gas for your application and put the USD equivalent on your bill at the end of the month. No need to worry about pre-funding the Gas Manager or conversions, we’ve got you covered! You can follow [this guide](/using-smart-accounts/sponsoring-gas/gas-manager.html) for more details on how to sponsor `UserOperation`s. +:::details[Answer] +We front the gas for your application and put the USD equivalent on your bill at the end of the month. No need to worry about pre-funding the Gas Manager or conversions, we’ve got you covered! You can follow [this guide](/using-smart-accounts/sponsoring-gas/gas-manager) for more details on how to sponsor `UserOperation`s. ::: ### What are my gas sponsorship limits? -::: details Answer +:::details[Answer] You can find details of Gas Manager limits depending on your tier [here](https://docs.alchemy.com/reference/gas-manager-coverage-api-pricing#fee-logic). ::: ### Do you support ERC-20 or stablecoin paymasters? -::: details Answer +:::details[Answer] Currently, we don’t support this, but we are actively exploring. Please [reach out](/resources/contact-us) if you are interested as we would love your input in our spec. ::: ### How is the Gas Manager protected from DDOS attacks? -::: details Answer -In your Gas Manager policy, you can configure spending rules per address, per app, and/or policy wide limits. See how to set up these policies [here](/using-smart-accounts/sponsoring-gas/gas-manager.html#_2-create-a-gas-manager-policy). +:::details[Answer] +In your Gas Manager policy, you can configure spending rules per address, per app, and/or policy wide limits. See how to set up these policies [here](/using-smart-accounts/sponsoring-gas/gas-manager#_2-create-a-gas-manager-policy). ::: ## Common Errors {#common-errors} ### Invalid policy ID: `{ code: -32602, message: 'Invalid Policy ID' }` -::: details Answer +:::details[Answer] Gas Manager policies can only be tied to one app. Make sure you are using the API Key that is associated with the app the Gas Manager policy is configured for, or create a new policy for the app you are using. ::: ### Precheck failed: `{ code: -3200, message: 'precheck failed: ...' }` -::: details Answer +:::details[Answer] Precheck failed errors are often related to gas and/or fees. Our Bundler follows standard [ERC 4337](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4337.md#client-behavior-upon-receiving-a-useroperation) implementation for gas and fee checks in order to 1) ensure your `UserOperation`s (UOs) land on chain and to 2) protect the Bundler from potential attacks in order to support scalability. These errors are often related to market movement between the time when gas and fees are estimated and the time when UOs are submitted to the bundler. This fluctuation in the market is especially variant on testnet. To ensure your UO is included in a block, we currently reject sending any UOs that are underpriced compared to the network rate . @@ -166,18 +152,18 @@ Our gas and fee estimations are just that, estimations, but we are always workin ### Total execution gas limit exceeded: `{ code: -3202, message: 'precheck failed: total execution gas is X but must be at most 10000000}` -::: details Answer +:::details[Answer] Currently our Bundler allows max 10M gas in aggregate between `preVerificationGas`, `verificationGasLimit`, and `callGasLimit`. To reduce the gas needed, try reducing the size of your call data and/or sending your call data in multiple `UserOperation`s rather than one. ::: ### `waitForUserOperationTransaction` timeout -::: details Answer +:::details[Answer] [`waitForUserOperationTransaction`](/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction) may throw this error if it does not find the mined User Operation within its retry limits. -You can mitigate this by defining a more flexible retry period when constructing a [`Client`](/packages/aa-core/smart-account-client/index.html#usage) (i.e. `txMaxRetries`, `txRetryIntervalMs`, `txRetryMultiplier` in `opts`). +You can mitigate this by defining a more flexible retry period when constructing a [`Client`](/packages/aa-core/smart-account-client/index#usage) (i.e. `txMaxRetries`, `txRetryIntervalMs`, `txRetryMultiplier` in `opts`). -If your `UserOperation` continues to be delayed beyond a limit you are willing to wait, you can resubmit the user operation using [`dropAndReplaceUserOperation`](/packages/aa-core/smart-account-client/actions/dropAndReplaceUserOperation.html#usage). +If your `UserOperation` continues to be delayed beyond a limit you are willing to wait, you can resubmit the user operation using [`dropAndReplaceUserOperation`](/packages/aa-core/smart-account-client/actions/dropAndReplaceUserOperation#usage). ::: ## Other Support @@ -186,6 +172,6 @@ If your `UserOperation` continues to be delayed beyond a limit you are willing t No, the `aa-sdk` repo does not offically support React Native. **It is on our radar!** -Currently we have a strong dependency on Viem, which requires several global features, such as `TextEncoder` and `crypto`, that are absent in React Native's environment. See more about [Viem's capability here](https://viem.sh/docs/compatibility.html). +Currently we have a strong dependency on Viem, which requires several global features, such as `TextEncoder` and `crypto`, that are absent in React Native's environment. See more about [Viem's capability here](https://viem.sh/docs/compatibility). -However, we have created a small PoC using Expo that you can find [here](https://github.com/alchemyplatform/aa-sdk-rn-expo/tree/main). For more information on how to use Account Kit within a React Native application see [the guide](/resources/react-native.html). +However, we have created a small PoC using Expo that you can find [here](https://github.com/alchemyplatform/aa-sdk-rn-expo/tree/main). For more information on how to use Account Kit within a React Native application see [the guide](/resources/react-native). diff --git a/site/resources/react-native.md b/site/pages/resources/react-native.mdx similarity index 86% rename from site/resources/react-native.md rename to site/pages/resources/react-native.mdx index 8bad0f9d62..f2e8271516 100644 --- a/site/resources/react-native.md +++ b/site/pages/resources/react-native.mdx @@ -1,22 +1,13 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Using within React Native applications - - - meta - - name: description - content: A guide on integrating Account Kit within a React Native application - - - meta - - property: og:description - content: A guide on integrating Account Kit within a React Native application +title: Using within React Native applications +description: A guide on integrating Account Kit within a React Native application --- # Using within React Native applications This hasn't been tested extensively, but it is possible to use Account Kit within a React Native application. We've built a simple example using expo [here](https://github.com/alchemyplatform/aa-sdk-rn-expo/tree/main). This guide assumes you're using Expo, but the same principles should apply to a bare React Native app as well. -::: warning +:::warning The Alchemy Signer is not yet supported in React Native applications. For 3rd party signer support in React Native, refer to your signer provider's documentation. ::: @@ -26,7 +17,7 @@ The Alchemy Signer is not yet supported in React Native applications. For 3rd pa We first need to get our environment setup. The first thing we need to do is make sure we're on the latest Beta version of Expo. The reason for this is that we need React Native version 0.74 or higher because it has `TextEncoder` natively supported. -::: code-group +:::code-group ```bash [npm] npx expo install expo@next --fix @@ -44,7 +35,7 @@ Once we've got that setup, we need to setup a few shims so we can use crypto lib #### Install shim dependencies -::: code-group +:::code-group ```bash [npm] npm install --save node-libs-react-native crypto-browserify stream-browserify react-native-get-random-values @@ -60,8 +51,6 @@ yarn add node-libs-react-native crypto-browserify stream-browserify react-native Create or edit your `metro.config.js` file in the root of your project so that it includes the following: -::: code-group - ```js [metro.config.js] // Learn more https://docs.expo.io/guides/customizing-metro const { getDefaultConfig } = require("expo/metro-config"); @@ -81,18 +70,14 @@ config.resolver.extraNodeModules = { module.exports = config; ``` -::: - #### Register global shims Import the following packages at the top of your `App.tsx` file so that libraries that depend on globals like `crypto` have access to them. -::: tip +:::tip If you're using bare React Native, you would add the above imports to your `index.js` file. ::: -::: code-group - ```tsx [App.tsx] import "node-libs-react-native/globals.js"; import "react-native-get-random-values"; @@ -100,13 +85,11 @@ import "react-native-get-random-values"; // rest of App.tsx ``` -::: - ### Install Account Kit and build! That's it! Now you can install the packages you want from Account Kit and start building your React Native Account Abstraction app. -::: code-group +:::code-group ```bash [npm] npm install -s @alchemy/aa-alchemy @alchemy/aa-accounts @alchemy/aa-core diff --git a/site/resources/terms.md b/site/pages/resources/terms.mdx similarity index 90% rename from site/resources/terms.md rename to site/pages/resources/terms.mdx index a4f15cdea7..e498143e04 100644 --- a/site/resources/terms.md +++ b/site/pages/resources/terms.mdx @@ -1,28 +1,13 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Terms - - - meta - - name: description - content: Glossary of terms related to Account Kit - - - meta - - property: og:description - content: Glossary of terms related to Account Kit - - - meta - - name: twitter:title - content: Terms - - - meta - - name: twitter:description - content: Glossary of terms related to Account Kit +title: Terms +description: Glossary of terms related to Account Kit --- # Terms ## Account Kit -Account Kit is a framework designed to embed smart accounts in web3 applications. It includes a set of tools such as [Signer integrations](/signers/choosing-a-signer.html), [Gas Manager](https://docs.alchemy.com/docs/gas-manager-services) and [Bundler](https://docs.alchemy.com/docs/bundler-services) utilities that unlock features such as [gas sponsorship](/using-smart-accounts/sponsoring-gas/gas-manager.html), [batched transactions](/using-smart-accounts/batch-user-operations.html) and email/social login. With its user-friendly suite of SDKs, known as [aa-sdk](https://github.com/alchemyplatform/aa-sdk), Account Kit makes it easy to deploy smart accounts, manage `UserOperation`s, and handle gas sponsorship, streamlining the entire process with minimal coding effort. +Account Kit is a framework designed to embed smart accounts in web3 applications. It includes a set of tools such as [Signer integrations](/signers/choosing-a-signer), [Gas Manager](https://docs.alchemy.com/docs/gas-manager-services) and [Bundler](https://docs.alchemy.com/docs/bundler-services) utilities that unlock features such as [gas sponsorship](/using-smart-accounts/sponsoring-gas/gas-manager), [batched transactions](/using-smart-accounts/batch-user-operations) and email/social login. With its user-friendly suite of SDKs, known as [aa-sdk](https://github.com/alchemyplatform/aa-sdk), Account Kit makes it easy to deploy smart accounts, manage `UserOperation`s, and handle gas sponsorship, streamlining the entire process with minimal coding effort. ## Bundler @@ -38,7 +23,7 @@ A standardized smart contract that acts as the primary gateway for processing `U ## ERC-4337 -A standard authored by the [Ethereum Foundation](https://ethereum.foundation/) for [account abstraction](https://docs.alchemy.com/docs/introduction-to-account-abstraction), establishing a uniform interface for all smart accounts. This standard also outlines the roles and functionalities of [Bundlers](https://docs.alchemy.com/docs/bundler-services), [Paymasters](https://www.alchemy.com/overviews/what-is-a-paymaster), and [`EntryPoint`](#entrypoint). Reference: +A standard authored by the [Ethereum Foundation](https://ethereum.foundation/) for [account abstraction](https://docs.alchemy.com/docs/introduction-to-account-abstraction), establishing a uniform interface for all smart accounts. This standard also outlines the roles and functionalities of [Bundlers](https://docs.alchemy.com/docs/bundler-services), [Paymasters](https://www.alchemy.com/overviews/what-is-a-paymaster), and [`EntryPoint`](#entrypoint). Reference: https://eips.ethereum.org/EIPS/eip-4337 ## ERC-6492 @@ -64,7 +49,9 @@ A magic link is a one-time use link sent to a user during the authentication pro A type of smart account enabled by the [ERC-6900](https://eips.ethereum.org/EIPS/eip-6900) standard and characterized by its [modular structure](/smart-accounts/modular-account/). This structure segments different functionalities of the account into distinct, independently upgradeable modules or plugins. Each plugin can have specific functions such as validation, execution, or hooks, enabling the smart account to extend its capabilities or modify its behavior without altering the core account logic. Modular Accounts enhance the flexibility, upgradeability, and interoperability of [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) smart accounts. Modular Account contracts have been audited by both [Spearbit](https://github.com/alchemyplatform/modular-account/blob/develop/audits/2024-01-31_spearbit_0e3fd1e.pdf) and [Quantstamp](https://github.com/alchemyplatform/modular-account/blob/develop/audits/2024-02-19_quantstamp_0e3fd1e.pdf). - +import Bbp from "./bbp.mdx"; + + ## Passkey @@ -89,7 +76,7 @@ A service or application that manages the private key and signs either arbitrary ## Smart Contract Account -A [Smart Contract Account (SCA)](/smart-accounts/#what-is-a-smart-account), or smart account in short, is an individual on-chain account located at a public address where an ERC-4337 compatible smart account [`contract`](https://ethereum.org/developers/docs/smart-contracts) is deployed to. This address is controlled by one or more owners of the smart contract account. The [aa-sdk](https://github.com/alchemyplatform/aa-sdk) supports different smart account implementations such as [Modular Account](/smart-accounts/modular-account/), [Light Account](/smart-accounts/light-account/), or [Simple Account](https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/SimpleAccount.sol). You can also [add your own account implementation in aa-sdk](/smart-accounts/custom/contributing.html). +A [Smart Contract Account (SCA)](/smart-accounts/#what-is-a-smart-account), or smart account in short, is an individual on-chain account located at a public address where an ERC-4337 compatible smart account [`contract`](https://ethereum.org/developers/docs/smart-contracts) is deployed to. This address is controlled by one or more owners of the smart contract account. The [aa-sdk](https://github.com/alchemyplatform/aa-sdk) supports different smart account implementations such as [Modular Account](/smart-accounts/modular-account/), [Light Account](/smart-accounts/light-account/), or [Simple Account](https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/SimpleAccount.sol). You can also [add your own account implementation in aa-sdk](/smart-accounts/custom/contributing). ## Transaction diff --git a/site/resources/types.md b/site/pages/resources/types.mdx similarity index 77% rename from site/resources/types.md rename to site/pages/resources/types.mdx index dc44fcc8ed..1a8bc1ab6e 100644 --- a/site/resources/types.md +++ b/site/pages/resources/types.mdx @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Types - - - meta - - name: description - content: Glossary of types in aa-sdk - - - meta - - property: og:description - content: Glossary of types in aa-sdk - - - meta - - name: twitter:title - content: Types - - - meta - - name: twitter:description - content: Glossary of types in aa-sdk +title: Types +description: Glossary of types in aa-sdk --- # Types @@ -24,120 +9,180 @@ head: An array of `UserOperationCallData`, representing a sequence of `UserOperations` to be executed in batch by calling the `executeBatch` function on the `SmartContractAccount` contract. Check out our guide on [How to submit batch transactions](/using-smart-accounts/batch-user-operations) to learn more about batching multiple transactions into a single `UserOperation`. -::: details BatchUserOperationCallData -<<< @/../packages/core/src/types.ts#BatchUserOperationCallData +:::details[BatchUserOperationCallData] + +```ts +// [!include ~/../packages/core/src/types.ts:BatchUserOperationCallData] +``` + ::: ## `BigNumberish` A type that can be a hexadecimal string prefixed with [`Hex`](https://viem.sh/docs/glossary/types#hex), a `bigint`, or a `number`. It is used to represent values that can be converted to or operate as big integers. -::: details BigNumberish -<<< @/../packages/core/src/utils/schema.ts#BigNumberish +:::details[BigNumberish] + +```ts +// [!include ~/../packages/core/src/utils/schema.ts:BigNumberish] +``` + ::: ## `BigNumberishRange` An object type that may contain optional `min` and `max` fields, each of which accepts a `BigNumberish` value. This type is used to specify a numerical range, including both the minimum and maximum bounds. -::: details BigNumberishRange -<<< @/../packages/core/src/utils/schema.ts#BigNumberishRange +:::details[BigNumberishRange] + +```ts +// [!include ~/../packages/core/src/utils/schema.ts:BigNumberishRange] +``` + ::: ## `BundlerAction` Bundler Actions are `viem` [`Actions`](https://viem.sh/docs/actions/public/introduction) that map one-to-one with "public" [`Bundler`](./terms#bundler) RPC methods (`eth_sendUserOperation`, `eth_getUserOperationByHash`, etc.) under the [EIP-4337](https://eips.ethereum.org/EIPS/eip-4337) and [EIP-6900](https://eips.ethereum.org/EIPS/eip-6900) standards. They are used with a [`BundlerClient`](#bundlerclient). `BundlerActions` do not require any special permissions, nor do they provide "signing" capabilities to the user. Examples of `BundlerActions` include retrieving the details of a specific user operation, estimating user operation gas, etc. -::: details BundlerAction -<<< @/../packages/core/src/client/decorators/bundlerClient.ts#BundlerActions +:::details[BundlerAction] + +```ts +// [!include ~/../packages/core/src/client/decorators/bundlerClient.ts:BundlerActions] +``` + ::: ## `BundlerClient` `BundlerClient` is a custom `viem` [`Client`](https://viem.sh/docs/clients/custom) we have built our own, where we extended viem's [`PublicClient`](https://viem.sh/docs/clients/public) with [`BundlerActions`](#bundleraction), which are `Actions` that provide custom functionalities of [EIP-4337](https://eips.ethereum.org/EIPS/eip-4337) and [EIP-6900](https://eips.ethereum.org/EIPS/eip-6900) standards. `BundlerClient` is an intermediary or connector that enables client applications to interact with the [`Bundler`](https://eips.ethereum.org/EIPS/eip-4337#definitions) that you are using. `BundlerClient`, because it extends `PublicClient`, supports [`Public Actions`](https://viem.sh/docs/actions/public/introduction) for client applications to connect, query, and interact with the blockchain (i.e., sending transactions, smart contract executions, data retrieval, etc.). -::: details BundlerClient -<<< @/../packages/core/src/client/bundlerClient.ts#BundlerClient +:::details[BundlerClient] + +```ts +// [!include ~/../packages/core/src/client/bundlerClient.ts:BundlerClient] +``` + ::: ## `ClientMiddleware` Middleware represents different operations involved in the [`SmartAccountClient`](/packages/aa-core/smart-account-client/) pipeline for constructing a user operation given the user inputs by populating the UO with other data, including gas fees, paymaster data, etc. -::: details ClientMiddleware -<<< @/../packages/core/src/middleware/types.ts#ClientMiddleware +:::details[ClientMiddleware] + +```ts +// [!include ~/../packages/core/src/middleware/types.ts:ClientMiddleware] +``` + ::: ## `ClientMiddlewareConfig` Configuration object to configure `ClientMiddleware` of the [`SmartAccountClient`](/packages/aa-core/smart-account-client/) during the client instantiation. You can configure using this object to configure the middleware of your interest selectively. -::: details ClientMiddlewareFn -<<< @/../packages/core/src/client/types.ts#ClientMiddlewareConfig +:::details[ClientMiddlewareFn] + +```ts +// [!include ~/../packages/core/src/client/types.ts:ClientMiddlewareConfig] +``` + ::: ## `ClientMiddlewareFn` Each middleware is a function that takes in a user operation object, `UserOperationStruct`, performs its job to retrieve or compute the data, and populate different fields of the user operation to pass onto the next middleware in the pipeline before being signed and sent to the network. `ClientMiddlewareFn` is the function type that represents each middleware. In optional [`UserOperationOverrides`](#useroperationoverrides), and [`UserOperationFeeOptions`](/packages/aa-core/smart-account-client/types/userOperationFeeOptions), and returns a promise that resolves to a modified `UserOperationStruct`. This function is what you specify as your overridden middleware value for applying custom logic during the `UserOperationStruct` object to be sent to the bundler for on-chain execution. -::: details ClientMiddlewareFn -<<< @/../packages/core/src/middleware/types.ts#ClientMiddlewareFn +:::details[ClientMiddlewareFn] + +```ts +// [!include ~/../packages/core/src/middleware/types.ts:ClientMiddlewareFn] +``` + ::: ## `EntryPointDef` An object type that defines the interface for `EntryPoint` functions for packing the user operation to the optimized data structure to enhance performance and reduce gas costs of transactions, and generating the hash of the user operation for the format compatible to the specified `Chain` and `EntryPointVersion`. -::: details EntryPointDef -<<< @/../packages/core/src/entrypoint/types.ts#EntryPointDef +:::details[EntryPointDef] + +```ts +// [!include ~/../packages/core/src/entrypoint/types.ts:EntryPointDef] +``` + ::: ## `Multiplier` An object type with a required `multipler` field, which is a `number` value with max precision of 4 decimal places. -::: details Multiplier -<<< @/../packages/core/src/utils/schema.ts#Multiplier +:::details[Multiplier] + +```ts +// [!include ~/../packages/core/src/utils/schema.ts:Multiplier +``` + ::: ## `SmartAccountAuthenticator` An extension of the [`SmartAccountSigner`](#smartaccountsigner) interface, this interface contains authentication-related functions in addition to the signing methods of the `SmartAccountSigner`. It provides methods to authenticate the signer (`authenticate`) as the "authorized" signer, often as the owner, of the `SmartContractAccount`. It also has methods to retrieve authentication details (`getAuthDetails`) about the signer instance that the user is using to authenticate to one's account. -::: details SmartAccountAuthenticator -<<< @/../packages/core/src/middleware/types.ts#SmartAccountAuthenticator +:::details[SmartAccountAuthenticator] + +```ts +// [!include ~/../packages/core/src/signer/types.ts:SmartAccountAuthenticator] +``` + ::: ## `SmartAccountClient` `SmartAccountClient` is a custom `viem` `Client`, like the [`BundlerClient`](#bundlerclient), which is an intermediary or connector that enables your client application to interact with the `SmartContractAccount`. `SmartAccountClient` is analogous to the [`WalletClient`](https://viem.sh/docs/clients/wallet). The difference is that while `WalletClient` has [`WalletActions`](https://viem.sh/docs/actions/wallet/introduction) that lets your client application interact with an [Externally-owned account (EOA)](https://ethereum.org/developers/docs/accounts) with a [wallet](./terms#wallet), `SmartAccountClient` provides [`SmartAccountClientActions`](#smartaccountclientaction) for client applications to interact with `SmartContractAccounts`. -::: details SmartAccountClient -<<< @/../packages/core/src/client/smartAccountClient.ts#SmartAccountClient +:::details[SmartAccountClient] + +```ts +// [!include ~/../packages/core/src/client/smartAccountClient.ts:SmartAccountClient] +``` + ::: ## `SmartAccountClientAction` `SmartAccountClientActions` are `viem` [`Actions`](https://viem.sh/docs/actions/wallet/introduction) that map one-to-one with smart contract account-related or "signable" actions, such as constructing user operation requests to be sent to the [`Bundler`](./terms#bundler), signing messages or user operation requests, sending user operations to the `Bundler`, upgrading accounts to different implementation address, etc. They are used with a `SmartAccountClient`. `SmartAccountClientActions` require special permissions and provide signing capabilities for `SmartContractAccounts`. -::: details SmartAccountClientAction -<<< @/../packages/core/src/client/smartAccountClient.ts#SmartAccountClientActions +:::details[SmartAccountClientAction] + +```ts +// [!include ~/../packages/core/src/client/smartAccountClient.ts:SmartAccountClientActions] +``` + ::: ## `SmartAccountSigner` An interface representing a signer capable of signing messages and typed data. It provides methods to retrieve the signer's address (`getAddress`), sign a message (`signMessage`), and sign typed data (`signTypedData`). `SmartAccountSigner` refers to the [`Signer`](./terms#signer) instance responsible for the signing activities using its private key for smart account activities. Often, the `Signer` is referred to as the `Owner` of the account as it has the authority to use the smart account on-chain with its signatures. -::: details SmartAccountSigner -<<< @/../packages/core/src/middleware/types.ts#SmartAccountSigner +:::details[SmartAccountSigner] + +```ts +// [!include ~/../packages/core/src/signer/types.ts:SmartAccountSigner] +``` + ::: ## `SmartContractAccount` As smart contract accounts are essentially the contract codes that operate on the blockchain, `SmartContractAccount` defines the interface with different functionalities for managing and interacting with the contract account. It includes different functionalities for creating, managing, and using your smart account. In addition to supporting all functionalities achieved with a basic [EOA](./terms#wallet) alone, `SmartContractAccount` can have custom capabilities such as automating processes or executing actions based on predefined conditions. Smart contract wallets allow users to customize how they manage their digital assets, offering a more tailored approach to handling funds securely. `SmartContractAccount` type extends `viem`'s [`Account`](https://viem.sh/docs/accounts/custom), and instantiation of an account is done using the [`toSmartContractAccount`](/packages/aa-core/accounts/) action. -::: details SmartContractAccount -<<< @/../packages/core/src/account/smartContractAccount.ts#SmartContractAccount +:::details[SmartContractAccount] + +```ts +// [!include ~/../packages/core/src/account/smartContractAccount.ts:SmartContractAccount] +``` + ::: ## `StateOverride` @@ -147,72 +192,108 @@ State overrides allow you to customize the network state for the purpose of the ## `ToSmartContractAccountParams` -This type defines the parameters to the `SmartContractAccount` instantiation action, [`toSmartContractAccount`](/packages/aa-core/accounts/). You can configure this parameter to specify the [`Transport`](https://viem.sh/docs/clients/intro.html#transports), [`Chain`](https://viem.sh/docs/glossary/types#chain), [`EntryPointDef`](#entrypointdef), and other base functionalities of the smart account that you are creating. +This type defines the parameters to the `SmartContractAccount` instantiation action, [`toSmartContractAccount`](/packages/aa-core/accounts/). You can configure this parameter to specify the [`Transport`](https://viem.sh/docs/clients/intro#transports), [`Chain`](https://viem.sh/docs/glossary/types#chain), [`EntryPointDef`](#entrypointdef), and other base functionalities of the smart account that you are creating. + +:::details[ToSmartContractAccountParams] + +```ts +// [!include ~/../packages/core/src/account/smartContractAccount.ts:ToSmartContractAccountParams] +``` -::: details ToSmartContractAccountParams -<<< @/../packages/core/src/account/smartContractAccount.ts#ToSmartContractAccountParams ::: ## `User` -`User` is a type that defines the model for the details of a user's Embedded Account via an Alchemy Signer. It includes the user's `email`, `orgId`, `userId`, `userId`, `address` (the EOA signer address corresponding to the user credentials), and `credentialId`. You can use the [`useUser`](../react/useUser.md) react hook to look up a user. +`User` is a type that defines the model for the details of a user's Embedded Account via an Alchemy Signer. It includes the user's `email`, `orgId`, `userId`, `userId`, `address` (the EOA signer address corresponding to the user credentials), and `credentialId`. You can use the [`useUser`](/react/useUser) react hook to look up a user. + +:::details[User] + +```ts +// [!include ~/../packages/alchemy/src/signer/client/types.ts:User] +``` -::: details User -<<< @/../packages/alchemy/src/signer/client/types.ts#User ::: ## `UserOperationCallData` `UserOperationCallData` is a type that represents the user's "intent" or the desired outcome representing a specific objective a user aims to accomplish. It includes `target` (the destination address), `data` (the [`Transaction calldata`](./terms#transaction-calldata)), and `value` (the amount value of ETH, or the native token to send). It acts as the input to the `sendUserOperation` method on [`SmartAccountClient`](#smartaccountclient). -::: details UserOperationCallData -<<< @/../packages/core/src/types.ts#UserOperationCallData +:::details[UserOperationCallData] + +```ts +// [!include ~/../packages/core/src/types.ts:UserOperationCallData] +``` + ::: ## `UserOperationEstimateGasResponse` An interface that defines the structure for the response received from the RPC method [`eth_estimateUserOperationGas`](https://docs.alchemy.com/reference/eth-estimateuseroperationgas). This response provides detailed information about the estimated gas usage for a `UserOperation`. -::: details UserOperationEstimateGasResponse -<<< @/../packages/core/src/types.ts#UserOperationEstimateGasResponse +:::details[UserOperationEstimateGasResponse] + +```ts +// [!include ~/../packages/core/src/types.ts:UserOperationEstimateGasResponse] +``` + ::: ## `UserOperationOverrides` Partial structure for overriding default values in a `UserOperationStruct`, such as gas limits and fees. Available fields include `maxFeePerGas`, `maxPriorityFeePerGas`, `callGasLimit`, `preVerificationGas`, `verificationGasLimit`, `paymasterAndData`, or `nonceKey`. You can also specify a `stateOverride` to be passed into `eth_estimateUserOperationGas` during gas estimation. These override values are available from each [`ClientMiddleware`](#clientmiddleware) of the `SmartAccountClient`. Check out [`UserOperationOverrides`](/packages/aa-core/smart-account-client/types/userOperationOverrides) page to learn more. -::: details UserOperationOverrides -<<< @/../packages/core/src/types.ts#UserOperationOverrides +:::details[UserOperationOverrides] + +```ts +// [!include ~/../packages/core/src/types.ts:UserOperationOverrides] +``` + ::: ## `UserOperationReceipt` An interface that defines the structure for the response received from the RPC method [`eth_getUserOperationReceipt`](https://docs.alchemy.com/reference/eth-getuseroperationreceipt). It includes details like sender, nonce, gas cost, and success status of the `UserOperation`. -::: details UserOperationReceipt -<<< @/../packages/core/src/types.ts#UserOperationReceipt +:::details[UserOperationReceipt] + +```ts +// [!include ~/../packages/core/src/types.ts#UserOperationReceipt +``` + ::: ## `UserOperationRequest` Interface for the request format required for a JSON-RPC request to `eth_sendUserOperation`. It includes sender, nonce, gas limits, fees, and more fields. -::: details UserOperationRequest -<<< @/../packages/core/src/types.ts#UserOperationRequest +:::details[UserOperationRequest] + +```ts +// [!include ~/../packages/core/src/types.ts#UserOperationRequest +``` + ::: ## `UserOperationResponse` An interface that defines the structure for the response received from the RPC method [`eth_getUserOperationByHash`](https://docs.alchemy.com/reference/eth-getuseroperationbyhash), detailing the result of executing a `UserOperation`. It includes the block number, block hash, transaction hash and more information associated with the UO. -::: details UserOperationResponse -<<< @/../packages/core/src/types.ts#UserOperationResponse +:::details[UserOperationResponse] + +```ts +// [!include ~/../packages/core/src/types.ts#UserOperationResponse +``` + ::: ## `UserOperationStruct` Interface for structuring a `UserOperation`, with fields similar to `UserOperationRequest` but used for building requests. -::: details UserOperationStruct -<<< @/../packages/core/src/types.ts#UserOperationStruct +:::details[UserOperationStruct] + +```ts +// [!include ~/../packages/core/src/types.ts#UserOperationStruct +``` + ::: diff --git a/site/pages/signers/alchemy-signer/export-private-key.md b/site/pages/signers/alchemy-signer/export-private-key.md new file mode 100644 index 0000000000..0269096ab4 --- /dev/null +++ b/site/pages/signers/alchemy-signer/export-private-key.md @@ -0,0 +1,25 @@ +--- +outline: deep +title: Alchemy Signer • Export Private Key +description: Learn how to enable a user to export their private key with the Alchemy Signer +--- + +# Export private key + +The Alchemy Signer allows you to export a user's private key, allowing them a right to exit at any time. It is considered a best practice to allow your users to export their private key, as it gives them full control over their account. The private key export method does not rely on Alchemy's infrastructure, so even if Alchemy is down, a user can still export their private key. + +## Usage + +To add export private key functionality to your app, you can use the `exportPrivateKey` method on the signer. + +:::code-group + +```tsx [ExportPrivateKey.tsx] +// [!include ~/snippets/signers/alchemy/components/ExportPrivateKey.tsx] +``` + +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` + +::: diff --git a/site/signers/alchemy-signer/[introduction].md b/site/pages/signers/alchemy-signer/introduction.md similarity index 79% rename from site/signers/alchemy-signer/[introduction].md rename to site/pages/signers/alchemy-signer/introduction.md index ef9cd9092f..82f2e7e181 100644 --- a/site/signers/alchemy-signer/[introduction].md +++ b/site/pages/signers/alchemy-signer/introduction.md @@ -1,21 +1,7 @@ --- outline: deep -head: - - - meta - - property: og:title - content: Alchemy Signer - - - meta - - name: description - content: Learn how to get started with the Alchemy Signer - - - meta - - property: og:description - content: Learn how to get started with the Alchemy Signer - - - meta - - name: twitter:title - content: Alchemy Signer - - - meta - - name: twitter:description - content: Learn how to get started with the Alchemy Signer +title: Alchemy Signer +description: Learn how to get started with the Alchemy Signer --- # Alchemy Signer @@ -24,7 +10,7 @@ The Alchemy Signer is a `SmartAccountSigner` that is powered by Alchemy's Signer Learn how to set up your account config, create an `AlchemySigner`, log users in with email auth, and create a embedded account with our signer to enable email, passkeys (i.e. biometrics), and soon social auth flows! -::: tip +:::tip The Alchemy Signer requires the use of an `iframe`, so must be used in the context of an application. You'll need to build your own custom frontend. See an example of a full Alchemy Embedded Account [here](https://github.com/alchemyplatform/embedded-accounts-demo.git)! @@ -34,17 +20,19 @@ See an example of a full Alchemy Embedded Account [here](https://github.com/alch To use the Alchemy Signer, you will need to create a new account config in your [Alchemy Accounts Manager Dashbord](https://dashboard.alchemy.com/accounts) and connect this to your apps. -Create new embedded account config +![Create new embedded account config](/images/alchemy-accounts-dashboard.png) The account config allows you to customize the signup and login authentication email that will be sent to users when logging in to your dapp. Apply the config to one or more apps. -Account Kit Overview +![Account Kit Overview](/images/create-account-config.png) ## Creating an Alchemy Signer Once you have been granted access to the Alchemy Signer, getting started is really simple. Install the `@alchemy/aa-alchemy` package and initialize your signer: -<<< @/snippets/signers/alchemy/signer.ts +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` For other configuration options, see the [Alchemy Signer API Reference](/packages/aa-alchemy/signer/overview). @@ -54,11 +42,9 @@ Ensure that the access key used corresponds to the apps connected to the account Once you have initialized your signer, you can now enable your users to create an account or login to their existing account. -::: code-group - -<<< @/snippets/signers/alchemy/SignupLoginComponent.tsx - -::: +```tsx [SignupLoginComponent.tsx] +// [!include ~/snippets/signers/alchemy/SignupLoginComponent.tsx] +``` Once your signer is authenticated with a user, you can use it to sign User Operations by creating a `SmartContractAccount` and passing the signer to it. @@ -67,9 +53,9 @@ Once your signer is authenticated with a user, you can use it to sign User Opera By default the `AlchemySigner` leverages `localStorage` to cache user sessions for 15 minutes. This can be configured by passing in a `sessionConfig` to your `AlchemySigner` constructor. You can check if a session exists by doing the following: -::: code-group +:::code-group -```ts +```ts [getAuthDetails.ts] import { signer } from "./signer"; // NOTE: this method throws if there is no authenticated user @@ -77,7 +63,10 @@ import { signer } from "./signer"; const user = await signer.getAuthDetails().catch(() => null); ``` -<<< @/snippets/signers/alchemy/signer.ts +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` + ::: If there is an existing session, then your signer is ready for use! If not, see the section above for logging users in. @@ -86,9 +75,9 @@ If there is an existing session, then your signer is ready for use! If not, see Once your signer is authenticated with a user, you can use it to sign User Operations by creating a `SmartContractAccount` and passing the signer to it. For example: -::: code-group +:::code-group -```ts +```ts [createAccount.ts] import { signer } from "./signer"; export const account = await createMultiOwnerModularAccount({ @@ -98,12 +87,15 @@ export const account = await createMultiOwnerModularAccount({ }); ``` -<<< @/snippets/signers/alchemy/signer.ts +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` + ::: ## Using the Signer as an EOA -::: warning +:::warning Note that EOA wallets will not have access to smart account features like gas sponsorship, batched transactions, multi-owner, or plugins. If you want to switch from EOA to smart accounts later, then each user will need to transfer their assets from the EOA account to a new smart account. It is not currently possible to "upgrade" and EOA to a smart contract account, although the community is discussing potential [EIPs](https://eips.ethereum.org/EIPS/eip-7377) to do that in the future. ::: @@ -111,9 +103,9 @@ Because the Alchemy Signer has its own `address` and supports signing messages a If you are using viem, then you can use the `toViemAccount` method which will allow you to use the signer with a [`WalletClient`](https://viem.sh/docs/clients/wallet#local-accounts-private-key-mnemonic-etc). -::: code-group +:::code-group -```ts +```ts [createWalletClient.ts] import { signer } from "./signer"; import { createWalletClient, http } from "viem"; import { sepolia } from "@alchemy/aa-core"; @@ -125,5 +117,8 @@ export const walletClient = createWalletClient({ }); ``` -<<< @/snippets/signers/alchemy/signer.ts +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` + ::: diff --git a/site/pages/signers/alchemy-signer/manage-user-sessions.md b/site/pages/signers/alchemy-signer/manage-user-sessions.md new file mode 100644 index 0000000000..a2abacb5de --- /dev/null +++ b/site/pages/signers/alchemy-signer/manage-user-sessions.md @@ -0,0 +1,30 @@ +--- +outline: deep +title: Alchemy Signer • Manage user sessions +description: Learn how to configure and leverage sessions for you users with the Alchemy Signer +--- + +# User sessions + +By default, `AlchemySigner` user sessions are cached in `localStorage` for 15 minutes. + +You can customize session length by passing a [`sessionConfig`](/packages/aa-alchemy/signer/overview#parameters) to your `AlchemySigner` constructor. + +You can check if the user has an active session with the following command: +:::code-group + +```ts [getAuthDetails.ts] +import { signer } from "./signer"; + +// NOTE: this method throws if there is no authenticated user +// so we return null in the case of an error +const user = await signer.getAuthDetails().catch(() => null); +``` + +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` + +::: + +If there is an existing session, then your signer is ready for use! If not, see the section above for logging users in. diff --git a/site/pages/signers/alchemy-signer/passkey-auth.md b/site/pages/signers/alchemy-signer/passkey-auth.md new file mode 100644 index 0000000000..566ece2147 --- /dev/null +++ b/site/pages/signers/alchemy-signer/passkey-auth.md @@ -0,0 +1,29 @@ +--- +outline: deep +title: Alchemy Signer • Passkey Auth +description: Learn how to authenticate users with their passkey using the Alchemy Signer +--- + +# Passkey Auth + +The Alchemy Signer allows you to authenticate and log in users with a [passkey](https://accountkit.alchemy.com/resources/terms#passkey) that they used previously to sign up to your application. + +To add passkey auth functionality to your app, you can use the [`authenticate`](/packages/aa-alchemy/signer/authenticate#parameters) method on the Alchemy Signer as follows. + +:::code-group + +```ts [passkey-auth.ts] +// [!include ~/snippets/signers/alchemy/passkey-auth.ts] +``` + +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` + +::: + +## Example + +```tsx [PasskeyAuth.tsx] +// [!include ~/snippets/signers/alchemy/components/PasskeyAuth.tsx] +``` diff --git a/site/pages/signers/alchemy-signer/passkey-signup.md b/site/pages/signers/alchemy-signer/passkey-signup.md new file mode 100644 index 0000000000..e16c19048c --- /dev/null +++ b/site/pages/signers/alchemy-signer/passkey-signup.md @@ -0,0 +1,29 @@ +--- +outline: deep +title: Alchemy Signer • Passkey Signup +description: Learn how to sign up users with a newly-created passkey using the Alchemy Signer +--- + +# Passkey Signup + +The Alchemy Signer allows you to sign up users to your application using a [passkey](https://accountkit.alchemy.com/resources/terms#passkey) on their device. + +To add passkey signup functionality to your app, you can use the [`authenticate`](/packages/aa-alchemy/signer/authenticate#parameters) method on the Alchemy Signer as follows. + +:::code-group + +```ts [passkey-signup.ts] +// [!include ~/snippets/signers/alchemy/passkey-signup.ts] +``` + +```ts [signer.ts] +// [!include ~/snippets/signers/alchemy/signer.ts] +``` + +::: + +## Example + +```tsx [PasskeySignup.tsx] +// [!include ~/snippets/signers/alchemy/components/PasskeySignup.tsx] +``` diff --git a/site/signers/choosing-a-signer.md b/site/pages/signers/choosing-a-signer.md similarity index 93% rename from site/signers/choosing-a-signer.md rename to site/pages/signers/choosing-a-signer.md index 616aab07b2..7f11cf840f 100644 --- a/site/signers/choosing-a-signer.md +++ b/site/pages/signers/choosing-a-signer.md @@ -1,21 +1,7 @@ --- outline: deep -head: - - - meta - - property: og:title - content: Choosing a Signer - - - meta - - name: description - content: Explore Account Kit integration guides for signers including Magic.Link, Privy, Web3Auth, EOAs, and many more! - - - meta - - property: og:description - content: Explore Account Kit integration guides for signers including Magic.Link, Privy, Web3Auth, EOAs, and many more! - - - meta - - name: twitter:title - content: Choosing a Signer - - - meta - - name: twitter:description - content: Explore Account Kit integration guides for signers including Magic.Link, Privy, Web3Auth, EOAs, and many more! +title: Choosing a Signer +description: Explore Account Kit integration guides for signers including Magic.Link, Privy, Web3Auth, EOAs, and many more! --- # What is a Signer? @@ -80,9 +66,9 @@ Valid signatures do not always require all shares to sign a transaction. MPC Sig Some MPC signers provide recovery services in which key share(s) are backed up in the service provider’s cloud, on the end user’s device, or in the end user’s cloud (e.g. iCloud or Google Drive). When evaluating an MPC provider, it’s important to under where each key share is stored. -**Example**: Privy, Fireblocks MPC, Portal, Capsule, WalletKit, Fordefi +**Example**: Privy, Fireblocks MPC, Portal, Capsule, WalletKit -::: details TSS vs SSSS +:::details[TSS vs SSSS] There are two common approaches to MPC. diff --git a/site/signers/contributing.md b/site/pages/signers/contributing.md similarity index 88% rename from site/signers/contributing.md rename to site/pages/signers/contributing.md index 15f1732d53..2222b25559 100644 --- a/site/signers/contributing.md +++ b/site/pages/signers/contributing.md @@ -1,21 +1,7 @@ --- outline: deep -head: - - - meta - - property: og:title - content: Contributing Your Signer - - - meta - - name: description - content: Follow this guide to contribute a new Signer to Account Kit documentation, and enable developers to sign ERC-4337 transactions with your Signer. - - - meta - - property: og:description - content: Follow this guide to contribute a new Signer to Account Kit documentation, and enable developers to sign ERC-4337 transactions with your Signer. - - - meta - - name: twitter:title - content: Contributing Your Signer - - - meta - - name: twitter:description - content: Follow this guide to contribute a new Signer to Account Kit documentation, and enable developers to sign ERC-4337 transactions with your Signer. +title: Contributing Your Signer +description: Follow this guide to contribute a new Signer to Account Kit documentation, and enable developers to sign ERC-4337 transactions with your Signer. --- # Contribute your Signer @@ -32,7 +18,7 @@ In either case, if your `Signer` or library exports an `EIP-1193` compliant prov Make sure to include unit tests along with your implementation! Take a look at these PRs from [Magic](https://github.com/alchemyplatform/aa-sdk/pull/229) and [Web3Auth](https://github.com/alchemyplatform/aa-sdk/pull/247) for reference. -:::tip Note +:::tip If you your Signer implementation requires adding SDKs as dependencies, you should list them as `optionalDependencies`. Additionaly, `aa-signers` expects those SDKs to be node.js Javascript SDKs to so that all developers can use Account Kit with your Signer. If your SDK is based on a frontend Javascript framework, such as React.js or Vue.js, you will just have to follow step 2 onwards to submit documentation with an example snippet clarifying that your Signer must be used in said framework. diff --git a/site/signers/eoa.md b/site/pages/signers/eoa.md similarity index 72% rename from site/signers/eoa.md rename to site/pages/signers/eoa.md index 8809912195..7220b84c73 100644 --- a/site/signers/eoa.md +++ b/site/pages/signers/eoa.md @@ -1,21 +1,7 @@ --- outline: deep -head: - - - meta - - property: og:title - content: EOA Integration Guide - - - meta - - name: description - content: Follow this integration guide to use an EOA as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this integration guide to use an EOA as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: EOA Integration Guide - - - meta - - name: twitter:description - content: Follow this integration guide to use an EOA as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: EOA Integration Guide +description: Follow this integration guide to use an EOA as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. --- # EOA Integration Guide diff --git a/site/signers/guides/arcana-auth.md b/site/pages/signers/guides/arcana-auth.md similarity index 62% rename from site/signers/guides/arcana-auth.md rename to site/pages/signers/guides/arcana-auth.md index 574c46fd94..c5353595fc 100644 --- a/site/signers/guides/arcana-auth.md +++ b/site/pages/signers/guides/arcana-auth.md @@ -1,21 +1,7 @@ --- outline: deep -head: - - - meta - - property: og:title - content: Arcana Auth Integration Guide - - - meta - - name: description - content: Follow this integration guide to use Arcana Auth Web3 Wallet Address as a signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this integration guide to use Arcana Auth Web3 Wallet Address as a signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: Arcana Auth Integration Guide - - - meta - - name: twitter:description - content: Follow this integration guide to use Arcana Auth Web3 Wallet Address as a signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: Arcana Auth Integration Guide +description: Follow this integration guide to use Arcana Auth Web3 Wallet Address as a signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. --- # Arcana Auth Integration Guide @@ -28,7 +14,7 @@ Apps using Account Kit can easily onboard users with [social login](https://docs ### Install the SDK -::: code-group +:::code-group ```bash [npm] npm i -s @arcana/auth @@ -48,13 +34,15 @@ Use [Arcana Developer Dashboard](https://dashboard.arcana.network) to register y Use the **clientId** assigned to your app via the dashboard and integrate with the Arcana Auth SDK by creating a `SmartAccountSigner`. -<<< @/snippets/signers/arcana-auth.ts +```ts [arcana-auth.ts] +// [!include ~/snippets/signers/arcana-auth.ts] +``` ### Use it with Modular Account Let's see it in action with `aa-alchemy`: -::: code-group +:::code-group ```ts [example.ts] import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; @@ -73,6 +61,8 @@ export async function getProvider() { } ``` -<<< @/snippets/signers/arcana-auth.ts +```ts [arcana-auth.ts] +// [!include ~/snippets/signers/arcana-auth.ts] +``` ::: diff --git a/site/signers/guides/capsule.md b/site/pages/signers/guides/capsule.md similarity index 70% rename from site/signers/guides/capsule.md rename to site/pages/signers/guides/capsule.md index f4e33c432f..88f0e456a5 100644 --- a/site/signers/guides/capsule.md +++ b/site/pages/signers/guides/capsule.md @@ -1,21 +1,7 @@ --- outline: deep -head: - - - meta - - property: og:title - content: Capsule Integration Guide - - - meta - - name: description - content: Follow this integration guide to use Capsule as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this integration guide to use Capsule as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: Capsule Integration Guide - - - meta - - name: twitter:description - content: Follow this integration guide to use Capsule as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: Capsule Integration Guide +description: Follow this integration guide to use Capsule as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. --- # Capsule Integration Guide @@ -36,7 +22,7 @@ Follow these steps to begin integrating Capsule: Using `CapsuleSigner` in the `aa-signers` package requires installation of the [`@usecapsule/web-sdk`](https://capsule-org.github.io/web-sdk/) SDK. `aa-signers` lists it as optional dependency. Web -::: code-group +:::code-group ```bash [npm] npm i -s @usecapsule/web-sdk @@ -49,7 +35,7 @@ yarn add @usecapsule/web-sdk ::: React Native -::: code-group +:::code-group ```bash [npm] npm i -s @usecapsule/react-native-sdk @@ -61,7 +47,7 @@ yarn add @usecapsule/react-native-sdk ::: -::: warning Note +:::warning Note To use `CapsuleSigner` in your app's client, you must ensure the `window` object is defined. ::: @@ -69,13 +55,15 @@ To use `CapsuleSigner` in your app's client, you must ensure the `window` object Next, setup the Capsule SDK and create an authenticated `CapsuleSigner` using the `aa-signers` package: -<<< @/snippets/signers/capsule.ts +```ts [capsule.ts] +// [!include ~/snippets/signers/capsule.ts] +``` ### Use it with Modular Account Let's see it in action with `aa-alchemy`: -::: code-group +:::code-group ```ts [alchemy.ts] import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; @@ -91,6 +79,8 @@ const provider = await createModularAccountAlchemyClient({ }); ``` -<<< @/snippets/signers/capsule.ts +```ts [capsule.ts] +// [!include ~/snippets/signers/capsule.ts] +``` ::: diff --git a/site/signers/guides/custom-signer.md b/site/pages/signers/guides/custom-signer.md similarity index 64% rename from site/signers/guides/custom-signer.md rename to site/pages/signers/guides/custom-signer.md index b0c8ce32da..8e77af883f 100644 --- a/site/signers/guides/custom-signer.md +++ b/site/pages/signers/guides/custom-signer.md @@ -1,31 +1,17 @@ --- outline: deep -head: - - - meta - - property: og:title - content: How to use your own Account Signer - - - meta - - name: description - content: Follow this guide to use any Signer you want with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this guide to use any Signer you want with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: How to use your own Account Signer - - - meta - - name: twitter:description - content: Follow this guide to use any Signer you want with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: How to use your own Account Signer +description: Follow this guide to use any Signer you want with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. --- # How to use your own Account Signer -Account Kit is designed to be flexible and allow you to use any Signer you want. If you don't want to use any Signer implementations in [`aa-signers`](/packages/aa-signers/index), you can either: +Account Kit is designed to be flexible and allow you to use any Signer you want. If you don't want to use any Signer implementations in [`aa-signers`](/packages/aa-signers/), you can either: 1. Implement [`SmartAccountSigner`](https://github.com/alchemyplatform/aa-sdk/blob/main/packages/core/src/signer/types.ts#L34) (exported in `aa-core`). 2. If your Signer is an [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193) compliant provider, you can leverage `viem`'s `WalletClient` and the [`WalletClientSigner`](/packages/aa-core/signers/wallet-client) (exported in `aa-core`). -:::tip Note +:::tip[Note] If you want to add your Signer implementation to Account Kit's codebase, take a look at the [contibuting](/signers/contributing) docs. We welcome Pull Requests onto the Github repo for [`aa-sdk`](https://github.com/alchemyplatform/aa-sdk)! ::: @@ -33,12 +19,16 @@ If you want to add your Signer implementation to Account Kit's codebase, take a Smart accounts in Account Kit expect an implementation of `SmartAccountSigner` to work in Account Kit. We also include a `SmartAccountAuthenticator` interface that extends `SmartAccountSigner` and wraps any SDKs you may wish to use as part of the implementation of your own Signer. -<<< @/../packages/core/src/signer/types.ts +```ts [types.ts] +// [!include ~/../packages/core/src/signer/types.ts] +``` ## 2. Using `WalletClientSigner` -Viem allows you to create a `WalletClient`, which can be used to wrap local or JSON RPC based wallets. You can see the complete docs for leveraging the `WalletClient` [here](https://viem.sh/docs/clients/wallet.html). +Viem allows you to create a `WalletClient`, which can be used to wrap local or JSON RPC based wallets. You can see the complete docs for leveraging the `WalletClient` [here](https://viem.sh/docs/clients/wallet). We support a `SmartAccountSigner` implementation called `WalletClientSigner` that makes it really easy to use a viem `WalletClient` as a signer on your Smart Contract Account. If your Signer is [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193) compliant, it is really easy to use with `WalletClient`. Let's take a look at a simple example: -<<< @/snippets/signers/wallet-client-signer.ts +```ts [wallet-client-signer.ts] +// [!include ~/snippets/signers/wallet-client-signer.ts] +``` diff --git a/site/signers/guides/dfns.md b/site/pages/signers/guides/dfns.md similarity index 78% rename from site/signers/guides/dfns.md rename to site/pages/signers/guides/dfns.md index 309e7ea482..b3d708c44d 100644 --- a/site/signers/guides/dfns.md +++ b/site/pages/signers/guides/dfns.md @@ -1,28 +1,20 @@ --- outline: deep -head: - - - meta - - property: og:title - content: Dfns - - - meta - - name: description - content: Guide for using Dfns as a Signer - - - meta - - property: og:description - content: Guide for using Dfns as a Signer +title: Dfns Integration Guide +description: Guide for using Dfns as a Signer --- # Dfns Integration Guide [Dfns](https://www.dfns.co) is an MPC/TSS Wallet-as-a-Service API/SDK provider. Dfns aims to optimize the balance of security and UX by deploying key shares into a decentralized network on the backend while enabling wallet access via biometric open standards on the frontend like Webauthn. Reach out [here](https://www.dfns.co/learn-more) to set up a sandbox environment to get started. -Dfns seamlessly integrates with Account Abstraction by signing `UserOperation`s. See the examples below for initializing a DFNS signer and creating a provider with that signer. You can follow [this](/using-smart-accounts/sponsoring-gas/gas-manager.html) guide to send and sponsor `UserOperation`s with the provider created. +Dfns seamlessly integrates with Account Abstraction by signing `UserOperation`s. See the examples below for initializing a DFNS signer and creating a provider with that signer. You can follow [this](/using-smart-accounts/sponsoring-gas/gas-manager) guide to send and sponsor `UserOperation`s with the provider created. -Dfns created a full example of a gas-less transaction via a paymaster [in our SDK](https://github.com/dfns/dfns-sdk-ts/tree/m/examples/libs/viem/alchemy-aa-gasless), adapted from our [gas sponsorship example](/using-smart-accounts/sponsoring-gas/gas-manager.html). +Dfns created a full example of a gas-less transaction via a paymaster [in our SDK](https://github.com/dfns/dfns-sdk-ts/tree/m/examples/libs/viem/alchemy-aa-gasless), adapted from our [gas sponsorship example](/using-smart-accounts/sponsoring-gas/gas-manager). ## Install Dfns SDK -::: code-group +:::code-group ```bash [npm] npm i @dfns/lib-viem @dfns/sdk @dfns/sdk-keysigner @@ -38,11 +30,13 @@ yarn add @dfns/lib-viem @dfns/sdk @dfns/sdk-keysigner Setup the Dfns Web3 Provider and wrap it in an `AlchemyProvider`. -<<< @/snippets/signers/dfns.ts +```ts [dfns.ts] +// [!include ~/snippets/signers/dfns.ts] +``` ### Use it with Light Account -::: code-group +:::code-group ```ts [example.ts] import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; @@ -62,6 +56,8 @@ const createAlchemyProvider = async () => { }; ``` -<<< @/snippets/signers/dfns.ts +```ts [dfns.ts] +// [!include ~/snippets/signers/dfns.ts] +``` ::: diff --git a/site/signers/guides/dynamic.md b/site/pages/signers/guides/dynamic.md similarity index 69% rename from site/signers/guides/dynamic.md rename to site/pages/signers/guides/dynamic.md index 6f7196976d..8dfe721517 100644 --- a/site/signers/guides/dynamic.md +++ b/site/pages/signers/guides/dynamic.md @@ -1,21 +1,7 @@ --- outline: deep -head: - - - meta - - property: og:title - content: Dynamic Integration Guide - - - meta - - name: description - content: Follow this integration guide to use Dynamic as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this integration guide to use Dynamic as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: Dynamic Integration Guide - - - meta - - name: twitter:description - content: Follow this integration guide to use Dynamic as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: Dynamic Integration Guide +description: Follow this integration guide to use Dynamic as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. --- # Dynamic @@ -28,7 +14,7 @@ By default, the latest version of the Dynamic SDK ships with Viem. If you need t In this example, we are installing only the Ethereum connectors in order to keep bundle size light. If you need any others, you can [find the references here](https://docs.dynamic.xyz/react-sdk/components/dynamiccontextprovider#walletconnectors) -::: code-group +:::code-group ```bash [npm] npm i -s @dynamic-labs/sdk-react-core @dynamic-labs/ethereum @@ -74,12 +60,14 @@ export default App; Next, inside any component which is wrapped by the above DynamicContextProvider, use the `useDynamicContext` hook to fetch your provider, and create a `SmartAccountSigner`: -<<< @/snippets/signers/dynamic.ts +```ts [dynamic.ts] +// [!include ~/snippets/signers/dynamic.ts] +``` ### Use it with Modular Account Let's see it in action with `aa-alchemy`: -::: code-group +:::code-group ```ts [example.ts] import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; @@ -95,6 +83,8 @@ const provider = await createModularAccountAlchemyClient({ }); ``` -<<< @/snippets/signers/dynamic.ts +```ts [dynamic.ts] +// [!include ~/snippets/signers/dynamic.ts] +``` ::: diff --git a/site/signers/guides/fireblocks.md b/site/pages/signers/guides/fireblocks.md similarity index 66% rename from site/signers/guides/fireblocks.md rename to site/pages/signers/guides/fireblocks.md index ee99faa633..6cbc1f8fb8 100644 --- a/site/signers/guides/fireblocks.md +++ b/site/pages/signers/guides/fireblocks.md @@ -1,21 +1,7 @@ --- outline: deep -head: - - - meta - - property: og:title - content: Fireblocks Integration Guide - - - meta - - name: description - content: Follow this integration guide to use Fireblocks as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this integration guide to use Fireblocks as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: Fireblocks Integration Guide - - - meta - - name: twitter:description - content: Follow this integration guide to use Fireblocks as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: Fireblocks Integration Guide +description: Follow this integration guide to use Fireblocks as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. --- # Fireblocks @@ -32,7 +18,7 @@ Fireblocks' MPC wallets are EOA accounts, which in any account abstraction enabl Using `FireblocksSigner` in the `aa-signers` package requires installation of the [`@fireblocks/fireblocks-web3-provider`](https://github.com/fireblocks/fireblocks-web3-provider) SDK. `aa-signers` lists it as optional dependency. -::: code-group +:::code-group ```bash [npm] npm i -s @fireblocks/fireblocks-web3-provider @@ -42,21 +28,23 @@ npm i -s @fireblocks/fireblocks-web3-provider yarn add @fireblocks/fireblocks-web3-provider ``` -::: warning Note -Due to how Fireblocks parses a private key [in their SDK](https://github.com/fireblocks/fireblocks-web3-provider/blob/main/src/provider.ts#L106-L116), you must specific the private key in [PEM Format](https://docs.progress.com/bundle/datadirect-hybrid-data-pipeline-installation-46/page/PEM-file-format.html#:~:text=A%20PEM%20encoded%20file%20includes,%2D%2D%2D%2D%2D%22.) if you chose to use `FireblocksSigner` in your app's client. Otherwise, if you choose `FireblocksSigner` in your app's server, you can also specify a path to a file containing your private key. +:::warning Note +Due to how Fireblocks parses a private key [in their SDK](https://github.com/fireblocks/fireblocks-web3-provider/blob/main/src/provider.ts#L106-L116), you must specific the private key in [PEM Format](https://docs.progress.com/bundle/datadirect-hybrid-data-pipeline-installation-46/page/PEM-file-format#:~:text=A%20PEM%20encoded%20file%20includes,%2D%2D%2D%2D%2D%22.) if you chose to use `FireblocksSigner` in your app's client. Otherwise, if you choose `FireblocksSigner` in your app's server, you can also specify a path to a file containing your private key. ::: ### Create a SmartAccountSigner Next, setup the Fireblocks SDK and create an authenticated `FireblocksSigner` using the `aa-signers` package: -<<< @/snippets/signers/fireblocks.ts +```ts [fireblocks.ts] +// [!include ~/snippets/signers/fireblocks.ts] +``` ### Use it with Modular Account Let's see it in action with `aa-alchemy`: -::: code-group +:::code-group ```ts [example.ts] import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; @@ -71,6 +59,8 @@ const provider = await createModularAccountAlchemyClient({ }); ``` -<<< @/snippets/signers/fireblocks.ts +```ts [fireblocks.ts] +// [!include ~/snippets/signers/fireblocks.ts] +``` ::: diff --git a/site/signers/guides/lit.md b/site/pages/signers/guides/lit.md similarity index 67% rename from site/signers/guides/lit.md rename to site/pages/signers/guides/lit.md index eb083c35be..20c741a1e3 100644 --- a/site/signers/guides/lit.md +++ b/site/pages/signers/guides/lit.md @@ -1,21 +1,7 @@ --- outline: deep -head: - - - meta - - property: og:title - content: Lit Protocol Integration Guide - - - meta - - name: description - content: Follow this integration guide to use PKP Wallet as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this integration guide to use PKP Wallet as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: Lit Protocol Integration Guide - - - meta - - name: twitter:description - content: Follow this integration guide to use PKP Wallet as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: Lit Protocol Integration Guide +description: Follow this integration guide to use PKP Wallet as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. --- # Lit Protocol Integration Guide @@ -24,7 +10,7 @@ head: Combining Lit Protocol's [pkp wallet](https://www.npmjs.com/package/@lit-protocol/pkp-ethers) with Account Kit allows you to use your Programmable Key Pairs (PKPs) as a smart account for your users. -::: warning +:::warning Lit Protocol's pkp network is still in testnet. Backwards compatibility, and data availability will not be guaranteed until mainnet. Do not use PKP wallets to store valuable assets. @@ -34,7 +20,7 @@ Lit Protocol's pkp network is still in testnet. Backwards compatibility, and dat ### Install the pkp ethers package -::: code-group +:::code-group ```bash [npm] npm i @lit-protocol/pkp-ethers@cayenne @@ -48,7 +34,7 @@ yarn add @lit-protocol/pkp-ethers@cayenne ### Install the LitNodeClient -::: code-group +:::code-group ```bash [npm] npm i @lit-protocol/lit-node-client@cayenne @@ -71,13 +57,15 @@ See documentation [here](https://developer.litprotocol.com/v3/sdk/wallets/mintin ### Create A LitSigner -<<< @/snippets/signers/lit.ts +```ts [lit.ts] +// [!include ~/snippets/signers/lit.ts] +``` ### Use it with Modular Account We can link our `SmartAccountSigner` to a Modular Account using `createModularAccountAlchemyClient` from `aa-alchemy`: -::: code-group +:::code-group ```ts [example.ts] import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; @@ -92,4 +80,8 @@ const provider = await createModularAccountAlchemyClient({ }); ``` +```ts [lit.ts] +// [!include ~/snippets/signers/lit.ts] +``` + ::: diff --git a/site/signers/guides/magic.md b/site/pages/signers/guides/magic.md similarity index 65% rename from site/signers/guides/magic.md rename to site/pages/signers/guides/magic.md index eb1a7f08d1..661d682485 100644 --- a/site/signers/guides/magic.md +++ b/site/pages/signers/guides/magic.md @@ -1,28 +1,14 @@ --- outline: deep -head: - - - meta - - property: og:title - content: Magic Link Integration Guide - - - meta - - name: description - content: Follow this integration guide to use Magic.Link as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this integration guide to use Magic.Link as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: Magic Link Integration Guide - - - meta - - name: twitter:description - content: Follow this integration guide to use Magic.Link as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: Magic Link Integration Guide +description: Follow this integration guide to use Magic.Link as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. --- # Magic Link Integration Guide [Magic](https://magic.link) is an embedded wallet provider that allows users to generate wallets scoped to your application via Social Logins, Email OTP, or Webauthn. This is great for enabling a better experience for your users. But ultimately these wallets are not much different from EOA's, so you don't have the benefit of Account Abstraction (gas sponsorship, batching, etc). -Combining Magic with Account Kit allows you to get the best of both worlds. You can use Magic via the [`aa-signers`](/packages/aa-signers/magic/introduction) package to generate a wallet scoped to your application, and then use [`aa-alchemy`](/packages/aa-alchemy/index) to create smart accounts for your users! +Combining Magic with Account Kit allows you to get the best of both worlds. You can use Magic via the [`aa-signers`](/packages/aa-signers/magic/introduction) package to generate a wallet scoped to your application, and then use [`aa-alchemy`](/packages/aa-alchemy/) to create smart accounts for your users! ## Integration @@ -30,7 +16,7 @@ Combining Magic with Account Kit allows you to get the best of both worlds. You Using `MagicSigner` in the `aa-signers` package requires installation of the [`magic-sdk`](https://github.com/magiclabs/magic-js) SDK. `aa-signers` lists it as optional dependency. -::: code-group +:::code-group ```bash [npm] npm i -s magic-sdk @@ -40,7 +26,7 @@ npm i -s magic-sdk yarn add magic-sdk ``` -::: warning Note +:::warning Note To use `MagicSigner` in your app's client, you must ensure the `window` object is defined. ::: @@ -48,13 +34,15 @@ To use `MagicSigner` in your app's client, you must ensure the `window` object i Next, setup the magic sdk and create an authenticated `MagicSigner` using the `aa-signers` package: -<<< @/snippets/signers/magic.ts +```ts [magic.ts] +// [!include ~/snippets/signers/magic.ts] +``` ### Use it with Modular Account Let's see it in action with `aa-alchemy`: -::: code-group +:::code-group ```ts [example.ts] import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; @@ -72,6 +60,8 @@ const provider = await createModularAccountAlchemyClient({ }); ``` -<<< @/snippets/signers/magic.ts +```ts [lit.ts] +// [!include ~/snippets/signers/lit.ts] +``` ::: diff --git a/site/signers/guides/particle-network.md b/site/pages/signers/guides/particle-network.md similarity index 89% rename from site/signers/guides/particle-network.md rename to site/pages/signers/guides/particle-network.md index e8f659c523..1b83389105 100644 --- a/site/signers/guides/particle-network.md +++ b/site/pages/signers/guides/particle-network.md @@ -1,15 +1,7 @@ --- outline: deep -head: - - - meta - - property: og:title - content: Particle Network - - - meta - - name: description - content: Guide to use Particle Network as a Signer - - - meta - - property: og:description - content: Guide to use Particle Network as a Signer +title: Particle Network +description: Guide to use Particle Network as a Signer --- # Particle Network @@ -28,7 +20,7 @@ To configure Particle, you'll need to start by quickly signing up for a Particle `ParticleSigner` requires installation of the [`@particle-network/auth`](https://developers.particle.network/docs/building-with-particle-auth) and [`@particle-network/provider`](https://developers.particle.network/reference/auth-web). `aa-signers` lists them as optional dependencies. -::: code-group +:::code-group ```bash [npm] npm i -s @particle-network/auth @@ -48,13 +40,15 @@ With `@particle-network/auth` and `@particle-network/provider` installed, you ca From here, setting up a `SmartAccountSigner` involves the initialization of `ParticleProvider` to be used in a viem wallet client, which then gets passed into our `SmartAccountSigner`. -<<< @/snippets/signers/particle.ts +```ts [particle.ts] +// [!include ~/snippets/signers/particle.ts] +``` ### Use it with Light Account Next, setup the Particle SDK and create an authenticated `ParticleSigner` using the `aa-signers` package: -::: code-group +:::code-group ```ts [example.ts] import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; @@ -69,7 +63,9 @@ const provider = await createModularAccountAlchemyClient({ }); ``` -<<< @/snippets/signers/particle.ts +```ts [particle.ts] +// [!include ~/snippets/signers/particle.ts] +``` ::: diff --git a/site/signers/guides/passport.md b/site/pages/signers/guides/passport.md similarity index 69% rename from site/signers/guides/passport.md rename to site/pages/signers/guides/passport.md index 48c5e87371..668f3331a3 100644 --- a/site/signers/guides/passport.md +++ b/site/pages/signers/guides/passport.md @@ -1,28 +1,14 @@ --- outline: deep -head: - - - meta - - property: og:title - content: Passport Protcol Integration Guide - - - meta - - name: description - content: Follow this integration guide to use Passport Protcol as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this integration guide to use Passport Protcol as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: Passport Protcol Integration Guide - - - meta - - name: twitter:description - content: Follow this integration guide to use Passport Protcol as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: Passport Protcol Integration Guide +description: Follow this integration guide to use Passport Protcol as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. --- # Passport Integration Guide [Passport](https://0xpass.io) is an MPC-based programmable, distributed, and non-custodial key management system, that allows users to generate wallets, scoped to their application, either via user Passkeys or any developer defined authentication method. Passport also allows users to sign messages, transactions, encrypt data, and more. Using secure multi-party computation (MPC) algorithms Passport splits private keys into shares that are solely distributed among nodes in the network. It also leverages secure enclaves and developer-defined policies, to ensure that the decryption of keys is confined to an enclave and that the signing process adheres to the policy framework established by your application. -Combining Passport with Account Kit allows you to create a seamless user experience for your users, with the security of Passport's MPC-based key management system and the flexibility of Account Abstraction. You can use Passport through the [`aa-signers`](/packages/aa-signers/passport/introduction.html) package to generate integrated wallets at scale, and then leverage [`aa-alchemy`](/packages/aa-alchemy/index.html) to create smart accounts for your users. +Combining Passport with Account Kit allows you to create a seamless user experience for your users, with the security of Passport's MPC-based key management system and the flexibility of Account Abstraction. You can use Passport through the [`aa-signers`](/packages/aa-signers/passport/introduction) package to generate integrated wallets at scale, and then leverage [`aa-alchemy`](/packages/aa-alchemy/) to create smart accounts for your users. ## Integration @@ -34,7 +20,7 @@ You can get started on Passport by configuring your scope and authentication rul Using `PassportSigner` in the `aa-signers` package requires installation of the [`@0xpass/passport`](https://github.com/0xpass/passport-sdk/tree/main/packages/passport) and [`@0xpass/webauthn-signer`](https://github.com/0xpass/passport-sdk/tree/main/packages/webauthn-signer). -::: code-group +:::code-group ```bash [npm] npm i @0xpass/passport @@ -52,12 +38,14 @@ yarn add @0xpass/webauthn-signer Next, setup the Passport SDK and create an authenticated `PassportSigner` using the `aa-signers` package to use an authenticated Passport Signer, you need to register a user account, which is attached to your application scope, following that you can authenticate the user, and and begin combining with Alchemy's Account Kit. -<<< @/snippets/signers/passport.ts +```ts [passport.ts] +// [!include ~/snippets/signers/passport.ts] +``` ### Use it with Light Account Let's see it in action with `aa-alchemy` and `ModularAccount` from `aa-accounts`: -::: code-group +:::code-group ```ts [example.ts] import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; @@ -75,6 +63,8 @@ const provider = await createModularAccountAlchemyClient({ }); ``` -<<< @/snippets/signers/passport.ts +```ts [passport.ts] +// [!include ~/snippets/signers/passport.ts] +``` ::: diff --git a/site/signers/guides/portal.md b/site/pages/signers/guides/portal.md similarity index 64% rename from site/signers/guides/portal.md rename to site/pages/signers/guides/portal.md index 8273501b81..01e9f1b3ec 100644 --- a/site/signers/guides/portal.md +++ b/site/pages/signers/guides/portal.md @@ -1,21 +1,7 @@ --- outline: deep -head: - - - meta - - property: og:title - content: Portal Integration Guide - - - meta - - name: description - content: Follow this integration guide to use Portal as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this integration guide to use Portal as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: Portal Integration Guide - - - meta - - name: twitter:description - content: Follow this integration guide to use Portal as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: Portal Integration Guide +description: Follow this integration guide to use Portal as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. --- # Portal Integration Guide @@ -32,7 +18,7 @@ Check out Portal's developer [docs](https://docs.portalhq.io/) to learn more abo Using `PortalSigner` in the `aa-signers` package requires installation of the [`@portal-hq/web`](https://docs.portalhq.io/sdk/web-beta) SDK. `aa-signers` lists it as optional dependency. -::: code-group +:::code-group ```bash [npm] npm install --save @portal-hq/web @@ -48,13 +34,15 @@ yarn add @portal-hq/web Next, setup the Portal SDK and create an authenticated `PortalSigner` using the `aa-signers` package: -<<< @/snippets/signers/portal.ts +```ts [portal.ts] +// [!include ~/snippets/signers/portal.ts] +``` ### Use it with Modular Account Let's see it in action with `aa-alchemy`: -::: code-group +:::code-group ```ts [example.ts] import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; @@ -70,6 +58,8 @@ const provider = await createModularAccountAlchemyClient({ }); ``` -<<< @/snippets/signers/portal.ts +```ts [portal.ts] +// [!include ~/snippets/signers/portal.ts] +``` ::: diff --git a/site/signers/guides/privy.md b/site/pages/signers/guides/privy.md similarity index 62% rename from site/signers/guides/privy.md rename to site/pages/signers/guides/privy.md index c91d44c24d..2f81e76795 100644 --- a/site/signers/guides/privy.md +++ b/site/pages/signers/guides/privy.md @@ -1,21 +1,7 @@ --- outline: deep -head: - - - meta - - property: og:title - content: Privy Integration Guide - - - meta - - name: description - content: Follow this integration guide to use Privy as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this integration guide to use Privy as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: Privy Integration Guide - - - meta - - name: twitter:description - content: Follow this integration guide to use Privy as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: Privy Integration Guide +description: Follow this integration guide to use Privy as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. --- # Privy Integration Guide @@ -30,7 +16,7 @@ Combining Privy with Account Kit allows you to seamlessly generate embedded wall ### Install the SDK -::: code-group +:::code-group ```bash [npm] npm i @privy-io/react-auth @@ -46,7 +32,7 @@ yarn add @privy-io/react-auth First, set up your React app with Privy following the [Privy Quickstart](https://docs.privy.io/guide/quickstart). You should also configure your `PrivyProvider` to create embedded wallets for your users when they login, like below: -```ts [PrivyProvider] +```tsx [PrivyProvider.tsx] +```ts [my-account.ts] +// [!include ~/snippets/aa-core/custom-account.ts] +``` To use your account, you will need to pass it into a `SmartAccountClient`. @@ -43,14 +32,22 @@ const client = createAlchemySmartAccountClient({ We have built an extension of the eth-infinitism `SimpleAccount` called [LightAccount.sol](https://github.com/alchemyplatform/light-account/blob/main/src/LightAccount.sol). You can learn more about Light Account in the [Light Account documentation](/smart-accounts/light-account/). We provide an implementation of `SmartContractAccount` that works with `LightAccount.sol`, which can be used as an example of how to implement your own Smart Contract Account: -::: details LightSmartContractAccount -<<< @/../packages/accounts/src/light-account/accounts/account.ts +:::details[LightSmartContractAccount] + +```ts +// [!include ~/../packages/accounts/src/light-account/accounts/account.ts] +``` + ::: ## The `toSmartContractAccount` Method For your reference, this is the definition of the `toSmartContractAccount` interface as pulled from the source code: -::: details SmartContractAccount -<<< @/../packages/core/src/account/smartContractAccount.ts +:::details SmartContractAccount + +```ts +// [!include ~/../packages/core/src/account/smartContractAccount.ts] +``` + ::: diff --git a/site/smart-accounts/entrypoint-support.md b/site/pages/smart-accounts/entrypoint-support.md similarity index 74% rename from site/smart-accounts/entrypoint-support.md rename to site/pages/smart-accounts/entrypoint-support.md index 0212fa0d59..425eed09a1 100644 --- a/site/smart-accounts/entrypoint-support.md +++ b/site/pages/smart-accounts/entrypoint-support.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: EntryPoint Support - - - meta - - name: description - content: EntryPoint Support for Alchemy Accounts - - - meta - - property: og:description - content: EntryPoint Support for Alchemy Accounts +title: EntryPoint Support +description: EntryPoint Support for Alchemy Accounts --- # EntryPoint Support diff --git a/site/smart-accounts/gas-benchmarks.md b/site/pages/smart-accounts/gas-benchmarks.md similarity index 85% rename from site/smart-accounts/gas-benchmarks.md rename to site/pages/smart-accounts/gas-benchmarks.md index dcaa5c097b..a206e98b82 100644 --- a/site/smart-accounts/gas-benchmarks.md +++ b/site/pages/smart-accounts/gas-benchmarks.md @@ -1,15 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Gas benchmarks - - - meta - - name: description - content: Gas benchmarks for Alchemy Accounts - - - meta - - property: og:description - content: Gas benchmarks for Alchemy Accounts +title: Gas benchmarks +description: Gas benchmarks for Alchemy Accounts --- # Gas benchmarks @@ -18,7 +9,7 @@ head: [Modular Account](/smart-accounts/modular-account/) is an enterprise-grade smart contract account designed for security and modularity, allowing for customization via ERC-6900 plugins. It is highly optimized for calldata costs, which has historically made up the majority of the fees on Ethereum rollups. As a durable user account, Modular Accounts contain guardrails for permissionless interoperable usage, extending beyond the per-app embedded account paradigm that is popular today to help drive forward an invisible and interoperable future. The account is heavily optimized for day-to-day usage, with certain security features adding some execution overhead at deployment time. -::: info +:::info With [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844), calldata costs have gone down significantly. Future versions of Modular Account will be optimized for this environment. ::: diff --git a/site/smart-accounts/index.md b/site/pages/smart-accounts/index.md similarity index 77% rename from site/smart-accounts/index.md rename to site/pages/smart-accounts/index.md index dbc8e752c0..701fcd3c7a 100644 --- a/site/smart-accounts/index.md +++ b/site/pages/smart-accounts/index.md @@ -1,21 +1,8 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Choosing a Smart Account - - - meta - - name: description - content: Learn about different smart account implementations to use with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Learn about different smart account implementations to use with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: Choosing a Smart Account - - - meta - - name: twitter:description - content: Learn about different smart account implementations to use with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: Choosing a Smart Account +description: Learn about different smart account implementations to use with + Account Kit, a vertically integrated stack for building apps that support + ERC-4337 and ERC-6900. --- # Choosing a Smart Account @@ -32,13 +19,13 @@ Modular Account is the first [ERC-6900](https://eips.ethereum.org/EIPS/eip-6900) For most applications, we recommend using **Modular Account**. Suppose you have already deployed Light Account in the past. In that case, you can follow [Upgrading to a Modular Account](/smart-accounts/modular-account/upgrade-la-to-ma) guide to easily upgrade your account from Light Account to Modular Account using Account Kit and unlock an ecosystem of plugins for your smart account stack. -Modular Account has been audited by both [Spearbit](https://github.com/alchemyplatform/modular-account/blob/develop/audits/2024-01-31_spearbit_0e3fd1e.pdf) and [Quantstamp](https://github.com/alchemyplatform/modular-account/blob/develop/audits/2024-02-19_quantstamp_0e3fd1e.pdf). It is fully [open source](https://github.com/alchemyplatform/modular-account) and supported by a [Bug Bounty](https://hackerone.com/alchemyplatform) program. It is [deployed](/smart-accounts/modular-account/deployments.html) on multiple networks and their respective testnets. +Modular Account has been audited by both [Spearbit](https://github.com/alchemyplatform/modular-account/blob/develop/audits/2024-01-31_spearbit_0e3fd1e.pdf) and [Quantstamp](https://github.com/alchemyplatform/modular-account/blob/develop/audits/2024-02-19_quantstamp_0e3fd1e.pdf). It is fully [open source](https://github.com/alchemyplatform/modular-account) and supported by a [Bug Bounty](https://hackerone.com/alchemyplatform) program. It is [deployed](/smart-accounts/modular-account/deployments) on multiple networks and their respective testnets. ## Light Account [Light Account](/smart-accounts/light-account/) is a collection of lightweight, production-ready [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) smart accounts. It builds on top of Ethereum Foundation's canonical [SimpleAccount](https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/SimpleAccount.sol) to add key improvements such as ownership transfers, multiple owners, ERC-1271 signature support, and gas optimizations. -It is fully [open source](https://github.com/alchemyplatform/light-account) and has been audited [multiple](https://github.com/alchemyplatform/light-account/blob/develop/audits/2024-01-09_quantstamp_aa8196b.pdf) [times](https://github.com/alchemyplatform/light-account/blob/develop/audits/2024-04-26_quantstamp_93f46a2.pdf) by Quantstamp. It is [deployed](/smart-accounts/light-account/deployments.html) on multiple networks and their respective testnets. +It is fully [open source](https://github.com/alchemyplatform/light-account) and has been audited [multiple](https://github.com/alchemyplatform/light-account/blob/develop/audits/2024-01-09_quantstamp_aa8196b.pdf) [times](https://github.com/alchemyplatform/light-account/blob/develop/audits/2024-04-26_quantstamp_93f46a2.pdf) by Quantstamp. It is [deployed](/smart-accounts/light-account/deployments) on multiple networks and their respective testnets. ## Use your own Account diff --git a/site/smart-accounts/light-account/deployments.md b/site/pages/smart-accounts/light-account/deployments.md similarity index 93% rename from site/smart-accounts/light-account/deployments.md rename to site/pages/smart-accounts/light-account/deployments.md index 0eca267d43..63cce45c3d 100644 --- a/site/smart-accounts/light-account/deployments.md +++ b/site/pages/smart-accounts/light-account/deployments.md @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Light Account • Deployments - - - meta - - name: description - content: Deployment addresses - - - meta - - property: og:description - content: Deployment addresses - - - meta - - name: twitter:title - content: Light Account • Deployments - - - meta - - name: twitter:description - content: Deployment addresses +title: Light Account • Deployments +description: Deployment addresses --- # Deployments diff --git a/site/smart-accounts/light-account/getting-started.md b/site/pages/smart-accounts/light-account/getting-started.md similarity index 69% rename from site/smart-accounts/light-account/getting-started.md rename to site/pages/smart-accounts/light-account/getting-started.md index 258153348e..6c5f2b672c 100644 --- a/site/smart-accounts/light-account/getting-started.md +++ b/site/pages/smart-accounts/light-account/getting-started.md @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Light Account • Getting started - - - meta - - name: description - content: Getting started with Light Account in Account Kit - - - meta - - property: og:description - content: Getting started with Light Account in Account Kit - - - meta - - name: twitter:title - content: Light Account • Getting started - - - meta - - name: twitter:description - content: Getting started with Light Account in Account Kit +title: Light Account • Getting started +description: Getting started with Light Account in Account Kit --- # Getting started with Light Account @@ -24,7 +9,7 @@ It is easy to get started with Light Account! We will show you how to create and ### Install packages -::: code-group +:::code-group ```bash [npm] npm i @alchemy/aa-alchemy @alchemy/aa-core @@ -40,15 +25,19 @@ yarn add @alchemy/aa-alchemy @alchemy/aa-core The code snippets below demonstrate how to use `LightAccount` and `MultiOwnerLightAccount` with Account Kit. They create the account and send a `UserOperation` from it. -::: code-group +:::code-group -<<< @/snippets/aa-alchemy/light-account.ts [LightAccount] +```ts [light-account.ts] +// [!include ~/snippets/aa-alchemy/light-account.ts] +``` -<<< @/snippets/aa-alchemy/multi-owner-light-account.ts [MultiOwnerLightAccount] +```ts [multi-owner-light-account.ts] +// [!include ~/snippets/aa-alchemy/multi-owner-light-account.ts] +``` ::: -::: tip Address calculation +:::tip[Address calculation] For `LightAccount`, the address of the smart account will be calculated as a combination of the version, [the owner, and the salt](https://github.com/alchemyplatform/light-account/blob/v2.0.0/src/LightAccountFactory.sol#L24-L33). You will get the same smart account address each time you supply the same `version` and `owner`. Alternatively, you can supply `salt` if you want a different address for the same `version` and `owner` params (the default salt is `0n`). For `MultiOwnerLightAccount`, the same pattern follows, except that it takes an array of owner addresses instead of a single owner address. If you want to use a signer to connect to an account whose address does not map to the contract-generated address, you can supply the `accountAddress` to connect with the account of interest. In that case, the `signer` address is not used for address calculation, but only used for signing the operation. diff --git a/site/smart-accounts/light-account/index.md b/site/pages/smart-accounts/light-account/index.md similarity index 76% rename from site/smart-accounts/light-account/index.md rename to site/pages/smart-accounts/light-account/index.md index 15b5d574c4..e3e699e450 100644 --- a/site/smart-accounts/light-account/index.md +++ b/site/pages/smart-accounts/light-account/index.md @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Light Account - - - meta - - name: description - content: What is Light Account? - - - meta - - property: og:description - content: What is Light Account? - - - meta - - name: twitter:title - content: Light Account - - - meta - - name: twitter:description - content: What is Light Account? +title: Light Account +description: What is Light Account? --- # Light Account @@ -32,7 +17,7 @@ Light Account has two variants catered to particular use cases. Both variants in This is the default variant of Light Account that supports a single ECDSA or SCA owner. It is slightly more gas efficient than `MultiOwnerLightAccount`, and can be useful when you want to maximally optimize for gas spend or ensure that only one signer has access to the account at any given time. -`LightAccount` comes in versions v1.1.0 and v2.0.0, which make use of the v0.6 and v0.7 entry points respectively. For more information about the differences between entry points, see the [EntryPoint v0.7 Upgrade Guide](/using-smart-accounts/entry-point-v7.html). +`LightAccount` comes in versions v1.1.0 and v2.0.0, which make use of the v0.6 and v0.7 entry points respectively. For backwards compatibility, `LightAccount` defaults to version v1.1.0, but we recommend v2.0.0 for new dapps because of the advantages that come with entry point v0.7. However, once a version is chosen and the Light Account is created, the version must remain consistent in order for the Light Account client to work with the existing Light Account. @@ -40,7 +25,7 @@ For backwards compatibility, `LightAccount` defaults to version v1.1.0, but we r Multi-Owner Light Account is a variant of Light Account that supports multiple ECDSA or SCA owners at once rather than a single one. Each owner has full control over the account, including the ability to add or remove other owners. This lets your account integrate with multiple signers at once, and supports recovering your account if one signer is lost. -Multi-Owner Light Account uses v0.7 of the entry point. For details about entry point versions, see the [EntryPoint v0.7 Upgrade Guide](/using-smart-accounts/entry-point-v7.html). +Multi-Owner Light Account uses v0.7 of the entry point. ## Developer links diff --git a/site/smart-accounts/modular-account/deployments.md b/site/pages/smart-accounts/modular-account/deployments.md similarity index 91% rename from site/smart-accounts/modular-account/deployments.md rename to site/pages/smart-accounts/modular-account/deployments.md index 2b6a901354..1fece42f50 100644 --- a/site/smart-accounts/modular-account/deployments.md +++ b/site/pages/smart-accounts/modular-account/deployments.md @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Modular Account • Deployments - - - meta - - name: description - content: Deployment addresses - - - meta - - property: og:description - content: Deployment addresses - - - meta - - name: twitter:title - content: Modular Account • Deployments - - - meta - - name: twitter:description - content: Deployment addresses +title: Modular Account • Deployments +description: Deployment addresses --- # Deployments diff --git a/site/smart-accounts/modular-account/getting-started.md b/site/pages/smart-accounts/modular-account/getting-started.md similarity index 80% rename from site/smart-accounts/modular-account/getting-started.md rename to site/pages/smart-accounts/modular-account/getting-started.md index 0b1e41b330..31b6087c1d 100644 --- a/site/smart-accounts/modular-account/getting-started.md +++ b/site/pages/smart-accounts/modular-account/getting-started.md @@ -1,28 +1,13 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Modular Account • Getting started - - - meta - - name: description - content: Getting started with Modular Account in Account Kit - - - meta - - property: og:description - content: Getting started with Modular Account in Account Kit - - - meta - - name: twitter:title - content: Modular Account • Getting started - - - meta - - name: twitter:description - content: Getting started with Modular Account in Account Kit +title: Modular Account • Getting started +description: Getting started with Modular Account in Account Kit --- # Getting started with Modular Account It is easy to get started with Modular Account! We will show you two different ways using `@alchemy/aa-alchemy` and `@alchemy/aa-core`. -::: tip Choosing your package +:::tip[Choosing your package] The [`aa-core`](/packages/aa-core/) package is not opinionated about your RPC provider. As a result, creating a client requires more configuration. As you will see below, [`aa-alchemy`](/packages/aa-alchemy/) is much easier to jump in with if you do not need this extra flexibility. ::: @@ -30,7 +15,7 @@ The [`aa-core`](/packages/aa-core/) package is not opinionated about your RPC pr ### Install packages -::: code-group +:::code-group ```bash [npm] npm i @alchemy/aa-alchemy @alchemy/aa-core @@ -46,9 +31,11 @@ yarn add @alchemy/aa-alchemy @alchemy/aa-core Then you can do the following: -<<< @/snippets/aa-alchemy/connected-client.ts +```ts [connected-client.ts] +// [!include ~/snippets/aa-alchemy/connected-client.ts] +``` -::: tip Address calculation +:::tip[Address calculation] For Modular Account, the address of the smart account will be calculated as a combination of [the owners and the salt](https://github.com/alchemyplatform/modular-account/blob/v1.0.x/src/factory/MultiOwnerModularAccountFactory.sol#L79-L82). You will get the same smart account address each time you supply the same `owners`, the signer(s) used to create the account for the first time. You can also optionally supply `salt` if you want a different address for the same `owners` param (the default salt is `0n`). If you want to use a signer to connect to an account whose address does not map to the contract-generated address, you can supply the `accountAddress` to connect with the account of interest. In that case, the `signer` address is not used for address calculation, but only for signing the operation. @@ -60,7 +47,7 @@ If you want to use a signer to connect to an account whose address does not map If you are using `@alchemy/aa-core`, you will also want to add `@alchemy/aa-accounts` to get the Smart Account factory for Modular Account. -::: code-group +:::code-group ```bash [npm] npm i @alchemy/aa-core @alchemy/aa-accounts viem @@ -76,9 +63,11 @@ yarn add @alchemy/aa-core @alchemy/aa-accounts viem Then, you will need to create a `SmartAccountClient` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` -::: tip Note +:::tip[Note] Above, we provide an account to our client directly. This allows us to set the account context for all calls to the `SmartAccountClient`. You can omit it to share one `SmartAccountClient` with multiple accounts. ::: @@ -86,7 +75,7 @@ Above, we provide an account to our client directly. This allows us to set the a The last step is optional but greatly improves the dev experience of interfacing with Modular Accounts. `@alchemy/aa-accounts` exports several Modular Account decorators that you can extend your client with. -::: code-group +:::code-group ```ts import { smartAccountClient } from "./smartAccountClient"; @@ -105,7 +94,10 @@ const decoratedClient = smartAccountClient .extend(accountLoupeActions); ``` -<<< @/snippets/aa-core/smartAccountClient.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` + ::: Next, if you want to use a different `signer` with a smart account signer, check out [choosing a signer](/signers/choosing-a-signer). Otherwise, if you are ready to get on-chain, go to [send user operations](/using-smart-accounts/send-user-operations). diff --git a/site/smart-accounts/modular-account/index.md b/site/pages/smart-accounts/modular-account/index.mdx similarity index 80% rename from site/smart-accounts/modular-account/index.md rename to site/pages/smart-accounts/modular-account/index.mdx index 9c01df89b9..ac9849c7d7 100644 --- a/site/smart-accounts/modular-account/index.md +++ b/site/pages/smart-accounts/modular-account/index.mdx @@ -1,21 +1,8 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Modular Account Smart Contract - - - meta - - name: description - content: Follow this guide to use Modular Accounts with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this guide to use Modular Accounts with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: Modular Account Smart Contract - - - meta - - name: twitter:description - content: Follow this guide to use Modular Accounts with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: Modular Account Smart Contract +description: Follow this guide to use Modular Accounts with Account Kit, a + vertically integrated stack for building apps that support ERC-4337 and + ERC-6900. --- # Modular Account @@ -53,7 +40,7 @@ Read more about installing and using the Session Key plugin [here](/using-smart- The Multisig plugin allows your account to have multiple ECDSA or SCA signers and require multiple signatures to perform actions on the account. This is commonly referred to as a k-of-n signature scheme and would create Modular Accounts that are similar to [Gnosis Safe](https://safe.global/) accounts. This plugin is recommended for accounts that require maximum security. -Read more about Multisig Plugin [here](/smart-accounts/modular-account/multisig-plugin/index.md)! +Read more about Multisig Plugin [here](/smart-accounts/modular-account/multisig-plugin/)! ### Full compatibility @@ -69,4 +56,6 @@ Check out the plugin development guide [here](https://www.notion.so/alchemotion/ Modular Account has been audited by Spearbit and Quanstamp. You can find the audit reports [here](https://github.com/alchemyplatform/modular-account/tree/develop/audits). Modular Account is fully open source, so you can validate the [source code](https://github.com/alchemyplatform/modular-account). - +import Bbp from "../../resources/bbp.mdx"; + + diff --git a/site/smart-accounts/modular-account/multisig-plugin/getting-started.md b/site/pages/smart-accounts/modular-account/multisig-plugin/getting-started.md similarity index 87% rename from site/smart-accounts/modular-account/multisig-plugin/getting-started.md rename to site/pages/smart-accounts/modular-account/multisig-plugin/getting-started.md index a19006711a..39351fa515 100644 --- a/site/smart-accounts/modular-account/multisig-plugin/getting-started.md +++ b/site/pages/smart-accounts/modular-account/multisig-plugin/getting-started.md @@ -1,28 +1,13 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Modular Account with Multisig Plugin • Getting started - - - meta - - name: description - content: Getting started with the Modular Account with Multisig Plugin in Account Kit - - - meta - - property: og:description - content: Getting started with the Modular Account with Multisig Plugin in Account Kit - - - meta - - name: twitter:title - content: Modular Account with Multisig Plugin • Getting started - - - meta - - name: twitter:description - content: Getting started with the Modular Account with Multisig Plugin in Account Kit +title: Modular Account with Multisig Plugin • Getting started +description: Getting started with the Modular Account with Multisig Plugin in Account Kit --- # Getting started with the Multisig Plugin ## 1. Set up the Modular Account -The Multisig Plugin can be installed on the Modular Account or any ERC-6900 compatible smart account. If you haven't already, please follow the guide to [set up Modular Account](../getting-started.md). +The Multisig Plugin can be installed on the Modular Account or any ERC-6900 compatible smart account. If you haven't already, please follow the guide to [set up Modular Account](../getting-started). ## 2. Create an Account Client @@ -85,7 +70,7 @@ const { request, aggregatedSignature, signatureObj: firstSig } = await multisigA }); ``` -::: warning +:::warning We are aware of a bug in aa-sdk that prevents multisigs from using a paymaster service. We are working on fixing this and this feature would be available shortly. @@ -162,4 +147,4 @@ const result = await multisigAccountClient.sendUserOperation({ That's it! You've initialized a modular account with three multisig members, proposed a user operation, collected the necessary signatures, and sent the user operation to the bundler. -For more info, check out the [technical details](./technical-details.md) of the multisig plugin. +For more info, check out the [technical details](./technical-details) of the multisig plugin. diff --git a/site/pages/smart-accounts/modular-account/multisig-plugin/index.mdx b/site/pages/smart-accounts/modular-account/multisig-plugin/index.mdx new file mode 100644 index 0000000000..5e20427d87 --- /dev/null +++ b/site/pages/smart-accounts/modular-account/multisig-plugin/index.mdx @@ -0,0 +1,26 @@ +--- +title: Multisig Plugin Smart Contract +description: Follow this guide to use the Multisig Plugin on Modular Account + with Account Kit, a vertically integrated stack for building apps that support + ERC-4337 and ERC-6900. +--- + +# Multisig Plugin + +## Overview + +The Multisig plugin adds `k of n` threshold signature scheme to your Modular Account, similar to [Gnosis Safe](https://safe.global/) accounts. This is a powerful security layer that is recommended for accounts that require additional security and redundancy beyond a single signer. + +The `n` signers can be any combination of ECDSA or SCA signers. A threshold of `k` signatures will be required to execute any user operation on the smart account. + +## Secure, audited, open source + +The Multisig Plugin has been audited by Quantstamp. You can find the audit reports [here](https://github.com/alchemyplatform/multisig-plugin/blob/develop/audits). + +It is also fully open source so you can validate the [source code](https://github.com/alchemyplatform/multisig-plugin). + +Now, let's [get started](./getting-started) with the multisig plugin! + +import Bbp from "../../../resources/bbp.mdx"; + + diff --git a/site/smart-accounts/modular-account/multisig-plugin/technical-details.md b/site/pages/smart-accounts/modular-account/multisig-plugin/technical-details.md similarity index 80% rename from site/smart-accounts/modular-account/multisig-plugin/technical-details.md rename to site/pages/smart-accounts/modular-account/multisig-plugin/technical-details.md index 328fc1853f..208338707f 100644 --- a/site/smart-accounts/modular-account/multisig-plugin/technical-details.md +++ b/site/pages/smart-accounts/modular-account/multisig-plugin/technical-details.md @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Multisig Plugin Smart Contract Technical Details - - - meta - - name: description - content: What are the technical details for the Multisig Plugin? - - - meta - - property: og:description - content: What are the technical details for the Multisig Plugin? - - - meta - - name: twitter:title - content: Multisig Plugin Smart Contract Technical Details - - - meta - - name: twitter:description - content: What are the technical details for the Multisig Plugin? +title: Multisig Plugin Smart Contract Technical Details +description: What are the technical details for the Multisig Plugin? --- # Multisig Plugin Technical Details diff --git a/site/smart-accounts/modular-account/upgrade-la-to-ma.md b/site/pages/smart-accounts/modular-account/upgrade-la-to-ma.md similarity index 71% rename from site/smart-accounts/modular-account/upgrade-la-to-ma.md rename to site/pages/smart-accounts/modular-account/upgrade-la-to-ma.md index 1dd33d09b5..fc1a44da7c 100644 --- a/site/smart-accounts/modular-account/upgrade-la-to-ma.md +++ b/site/pages/smart-accounts/modular-account/upgrade-la-to-ma.md @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Modular Account • Upgrading to a Modular Account using Account Kit - - - meta - - name: description - content: Upgrading to a Modular Account using Account Kit - - - meta - - property: og:description - content: Upgrading to a Modular Account using Account Kit - - - meta - - name: twitter:title - content: Modular Account • Upgrading to a Modular Account using Account Kit - - - meta - - name: twitter:description - content: Upgrading to a Modular Account using Account Kit +title: Modular Account • Upgrading to a Modular Account using Account Kit +description: Upgrading to a Modular Account using Account Kit --- # Upgrading to a Modular Account @@ -24,7 +9,7 @@ Upgrading a `SmartContractAccount` can be done easily using Account Kit. It just Using the Light Account as an example, here is an overview of how the upgrade can be executed using a Smart Account Client: -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient as lightAccountClient } from "./lightAccountClient"; @@ -43,7 +28,9 @@ const hash = await lightAccountClient.upgradeAccount({ const upgradedAccount = await createMAAccount(); ``` -<<< @/snippets/aa-alchemy/light-account-client.ts [lightAccountClient.ts] +```ts [lightAccountClient.ts] +// [!include ~/snippets/aa-alchemy/light-account-client.ts] +``` ::: diff --git a/site/third-party/bundlers.md b/site/pages/third-party/bundlers.md similarity index 70% rename from site/third-party/bundlers.md rename to site/pages/third-party/bundlers.md index b9cd01cf3d..f1d795c549 100644 --- a/site/third-party/bundlers.md +++ b/site/pages/third-party/bundlers.md @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: 3rd Party Bundlers - - - meta - - name: description - content: Learn how to use a different RPC provider with Account Kit - - - meta - - property: og:description - content: Learn how to use a different RPC provider with Account Kit - - - meta - - name: twitter:title - content: 3rd Party Bundlers - - - meta - - name: twitter:description - content: Learn how to use a different RPC provider with Account Kit +title: 3rd Party Bundlers +description: Learn how to use a different RPC provider with Account Kit --- # Using a different RPC Provider @@ -26,12 +11,14 @@ The `SmartAccountClient` within `@alchemy/aa-core` is unopinionated about which If we look at the example for creating a `SmartAccountClient`: -<<< @/snippets/aa-core/lightAccountClient.ts +```ts +// [!include ~/snippets/aa-core/lightAccountClient.ts] +``` You can see that we set the `transport` to `http("https://polygon-mumbai.g.alchemy.com/v2/demo")`. You can swap out that the url in the `http` function to any other provider's URL. -::: warning +:::warning Depending on your provider, you may have to pass in custom logic for the `gasEstimator` and `feeEstimator` properties when calling `createSmartAccountClient`. Consult with your provider on what the correct logic is. ::: @@ -40,7 +27,9 @@ with your provider on what the correct logic is. It might be the case that you want to use a different RPC provider for your bundler traffic and your node traffic. This is a common use case, and you can do this by leveraging the [`split`](/packages/aa-core/split-transport) transport and passing it to your `createSmartAccountClient` call. For example: -<<< @/snippets/aa-core/splitTransport.ts +```ts +// [!include ~/snippets/aa-core/splitTransport.ts] +``` ## Zora and Fraxtal diff --git a/site/third-party/paymasters.md b/site/pages/third-party/paymasters.md similarity index 68% rename from site/third-party/paymasters.md rename to site/pages/third-party/paymasters.md index 64e77349be..52a36642e6 100644 --- a/site/third-party/paymasters.md +++ b/site/pages/third-party/paymasters.md @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: 3rd Paymasters - - - meta - - name: description - content: Learn how to use a 3rd party Paymaster with Account Kit - - - meta - - property: og:description - content: Learn how to use a 3rd party Paymaster with Account Kit - - - meta - - name: twitter:title - content: 3rd Paymasters - - - meta - - name: twitter:description - content: Learn how to use a 3rd party Paymaster with Account Kit +title: 3rd Paymasters +description: Learn how to use a 3rd party Paymaster with Account Kit --- # Using a third-party paymaster diff --git a/site/pages/using-smart-accounts/batch-user-operations.md b/site/pages/using-smart-accounts/batch-user-operations.md new file mode 100644 index 0000000000..77643c4d40 --- /dev/null +++ b/site/pages/using-smart-accounts/batch-user-operations.md @@ -0,0 +1,84 @@ +--- +title: How to submit batch transactions +description: Follow this guide to submit transactions in batches with Account + Kit, a vertically integrated stack for building apps that support ERC-4337 and + ERC-6900. +--- + +# How to submit batch transactions + +One benefit of Smart Contract Accounts is that it is possible to batch transactions in one `UserOperation` (UO). Not all Smart Contract Accounts support batching. But, if the `SmartContractAccount` implementation you are using has the [`encodeBatchExecute`](/packages/aa-core/accounts/) method, then implementations of `SmartAccountClient` will allow you to make those calls. + +There are two ways you can batch transactions using `SmartAccountClient`: + +1. via `sendUserOperation` +2. via `sendTransactions` + +:::tip + +- Both `LightSmartContractAccount` and `MultiOwnerModularAccount` implement `encodeBatchExecute`, thus supports batching `UserOperations` out of the box. + +- When you batch transactions, the transaction actions (`target`s and `calldata`s) are batched into a single UO, where the sender is the account itself. + +- The batched UO gets executed by the account calling the `executeBatch` method on [`LightAccount`](https://github.com/alchemyplatform/light-account/blob/v1.1.0/src/LightAccount.sol) or [Modular Account](https://github.com/alchemyplatform/modular-account/blob/develop/src/account/UpgradeableModularAccount.sol) smart contracts. `executeBatch` processes the input array of transactions data linearly, guaranteeing the execution order of those transactions to be **sequential**. + ::: + +## Batching using [`sendUserOperation`](/packages/aa-core/smart-account-client/actions/sendUserOperation) + +The `SmartAccountClient` supports passing either a single UO or an array of UOs to `sendUserOperation`. If you pass an array, the client will batch the transactions into a single User Operation and submit it to the bundler. Let's see an example: + +:::code-group + +```ts [example.ts] +import { smartAccountClient } from "./smartAccountClient"; +// [!code focus:99] +// the hash returned here is the hash of the User Operation +const { hash } = await smartAccountClient.sendUserOperation({ + uo: [ + { + target: "0x...", + data: "0xcallDataTransacation1", + }, + { + target: "0x...", + data: "0xcallDataTransacation2", + }, + ], +}); +``` + +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/connected-client.ts] +``` + +::: + +## Batching using [`sendTransactions`](/packages/aa-core/smart-account-client/actions/sendTransactions) + +The `SmartAccountClient` supports sending UOs and waiting for them to be mined in a transaction via the `sendTransaction` and `sendTransactions` methods. The latter allows for batching in the same way `sendUserOperation`: + +:::code-group + +```ts [example.ts] +import { smartAccountClient } from "./smartAccountClient"; +// [!code focus:99] +// the hash returned here is the hash of the mined Tx that includes the UserOperation +const hash = await smartAccountClient.sendTransactions({ + requests: [ + { + to: "0x...", + data: "0xcallDataTransacation1", + }, + { + to: "0x...", + data: "0xcallDataTransacation2", + }, + ], +}); +``` + +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/connected-client.ts] +``` + +::: diff --git a/site/using-smart-accounts/enhanced-apis/nft.md b/site/pages/using-smart-accounts/enhanced-apis/nft.md similarity index 71% rename from site/using-smart-accounts/enhanced-apis/nft.md rename to site/pages/using-smart-accounts/enhanced-apis/nft.md index c8f1d266d4..e56529bd83 100644 --- a/site/using-smart-accounts/enhanced-apis/nft.md +++ b/site/pages/using-smart-accounts/enhanced-apis/nft.md @@ -1,38 +1,25 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: How to fetch a Smart Account's NFTs - - - meta - - name: description - content: Follow this guide to fetch a smart account's NFTs with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this guide to fetch a smart account's NFTs with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: How to fetch a Smart Account's NFTs - - - meta - - name: twitter:description - content: Follow this guide to fetch a smart account's NFTs with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: How to fetch a Smart Account's NFTs +description: Follow this guide to fetch a smart account's NFTs with Account Kit, + a vertically integrated stack for building apps that support ERC-4337 and + ERC-6900. --- # How to fetch a Smart Account's NFTs We provide several [Enhanced APIs](https://www.alchemy.com/enhanced-apis/?a=ak-docs), which are especially useful for querying information about the smart accounts you create using Account Kit, such as the account's owned NFTs using the [NFT API](https://www.alchemy.com/nft-api/?a=ak-docs). -For the purposes of our example, we will use the NFT API to query our smart account's data by extending the Alchemy Smart Account Client [with Enhanced APIs](/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md). +For the purposes of our example, we will use the NFT API to query our smart account's data by extending the Alchemy Smart Account Client [with Enhanced APIs](/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions). ## 1. Install the [`alchemy-sdk`](https://github.com/alchemyplatform/alchemy-sdk-js) We have developed a Typescript SDK to make development with the Enhanced APIs simple. The SDK includes ways to leverage Alchemy's Simulation API, Token API, Transact API, NFT API, Webhooks and Websockets, and more across our supported chains. Take a look at the code [here](https://github.com/alchemyplatform/alchemy-sdk-js). -We will use the Alchemy SDK Client to extend our Alchemy Smart Account Client using the client's [`alchemyEnhancedApiActions`](/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md) method. That way, our client will have direct access to the Enhanced APIs. +We will use the Alchemy SDK Client to extend our Alchemy Smart Account Client using the client's [`alchemyEnhancedApiActions`](/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions) method. That way, our client will have direct access to the Enhanced APIs. To use the Alchemy SDK in our project directory, we will need to install the required package: -::: code-group +:::code-group ```bash [npm] npm i alchemy-sdk @@ -48,9 +35,11 @@ yarn add alchemy-sdk Then, all we need to do is create an `alchemy` client from the Alchemy SDK, create an `AlchemySmartAccountClient` from Account Kit, and then extend the client with functionality from the SDK client using `alchemyEnhancedApiActions`. We can get the smart account's address from the `AlchemySmartAccountClient` in order to fetch the smart account's NFT in just 1 line of code! -<<< @/snippets/enhanced-apis-example/nft.ts +```ts [nft.ts] +// [!include ~/snippets/enhanced-apis-example/nft.ts] +``` -:::tip Note +:::tip[Note] Note that we must configure the Alchemy SDK client to have the same API Key and blockchain network as Alchemy Smart Account Client it is extending via `alchemyEnhancedApiActions`. This method explicitly checks this requirement and will throw an error at runtime if not satisfied. Additionally, since the Alchemy SDK client does not yet support JWT authentication, an `AlchemySmartAccountClient` initialized with JWTs cannot use this method. We must be initialize the client with an API key or RPC URL. diff --git a/site/using-smart-accounts/enhanced-apis/token.md b/site/pages/using-smart-accounts/enhanced-apis/token.md similarity index 71% rename from site/using-smart-accounts/enhanced-apis/token.md rename to site/pages/using-smart-accounts/enhanced-apis/token.md index 1d877ef88d..7f061f2569 100644 --- a/site/using-smart-accounts/enhanced-apis/token.md +++ b/site/pages/using-smart-accounts/enhanced-apis/token.md @@ -1,38 +1,25 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: How to fetch a Smart Account's ERC-20 tokens - - - meta - - name: description - content: Follow this guide to fetch a smart account's ERC-20 tokens with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this guide to fetch a smart account's ERC-20 tokens with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: How to fetch a Smart Account's ERC-20 tokens - - - meta - - name: twitter:description - content: Follow this guide to fetch a smart account's ERC-20 tokens with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: How to fetch a Smart Account's ERC-20 tokens +description: Follow this guide to fetch a smart account's ERC-20 tokens with + Account Kit, a vertically integrated stack for building apps that support + ERC-4337 and ERC-6900. --- # How to fetch a Smart Account's ERC-20 tokens Alchemy provides several [Enhanced APIs](https://www.alchemy.com/enhanced-apis/?a=ak-docs), which are especially useful for querying information about the smart accounts you create using Account Kit, such as the account's ERC-20 Token balances using the [Token API](https://www.alchemy.com/token-api/?a=ak-docs). -For the purposes of our example, we will use the Token API to query our smart account's data by extending the Alchemy Smart Account Client [with Enhanced APIs](/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md). +For the purposes of our example, we will use the Token API to query our smart account's data by extending the Alchemy Smart Account Client [with Enhanced APIs](/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions). ## 1. Install the [`alchemy-sdk`](https://github.com/alchemyplatform/alchemy-sdk-js) Alchemy has developed a Typescript SDK to make development with the Enhanced APIs simple. The SDK includes ways to leverage Alchemy's Simulation API, Token API, Transact API, NFT API, Webhooks and Websockets, and more across Alchemy's supported chains. Take a look at the code [here](https://github.com/alchemyplatform/alchemy-sdk-js). -We will use the Alchemy SDK Client to extend our Alchemy Smart Account Client using the client's [`alchemyEnhancedApiActions`](/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md) method. That way, our client will have direct access to the Enhanced APIs. +We will use the Alchemy SDK Client to extend our Alchemy Smart Account Client using the client's [`alchemyEnhancedApiActions`](/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions) method. That way, our client will have direct access to the Enhanced APIs. To use the Alchemy SDK in our project directory, we will need to install the required package: -::: code-group +:::code-group ```bash [npm] npm i alchemy-sdk @@ -48,9 +35,11 @@ yarn add alchemy-sdk Then, all we need to do is create an `alchemy` client from the Alchemy SDK, create an `AlchemySmartAccountClient` from Account Kit, and then extend the client with functionality from the SDK client using `withAlchemyEnhancedApis`. We can get the smart account's address from the `AlchemySmartAccountClient` in order to fetch the smart account's ERC-20 Tokens in just 1 line of code! -<<< @/snippets/enhanced-apis-example/token.ts +```ts [token.ts] +// [!include ~/snippets/enhanced-apis-example/token.ts] +``` -:::tip Note +:::tip[Note] Note that we must configure the Alchemy SDK client to have the same API Key and blockchain network as Alchemy Smart Account Client it is extending via `alchemyEnhancedApiActions`. This method explicitly checks this requirement and will throw an error at runtime if not satisfied. Additionally, since the Alchemy SDK client does not yet support JWT authentication, an `AlchemySmartAccountClient` initialized with JWTs cannot use this method. We must be initialize the client with an API key or RPC URL. diff --git a/site/using-smart-accounts/send-user-operations.md b/site/pages/using-smart-accounts/send-user-operations.md similarity index 66% rename from site/using-smart-accounts/send-user-operations.md rename to site/pages/using-smart-accounts/send-user-operations.md index 5cabbe48b7..e9bcfd3d2c 100644 --- a/site/using-smart-accounts/send-user-operations.md +++ b/site/pages/using-smart-accounts/send-user-operations.md @@ -1,21 +1,8 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: How to send a User Operation - - - meta - - name: description - content: Follow this guide to send a User Operation with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this guide to send a User Operation with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: How to send a User Operation - - - meta - - name: twitter:description - content: Follow this guide to send a User Operation with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: How to send a User Operation +description: Follow this guide to send a User Operation with Account Kit, a + vertically integrated stack for building apps that support ERC-4337 and + ERC-6900. --- # How to send a User Operation @@ -28,17 +15,19 @@ Using the SDK, we will create an Alchemy Smart Account Client. As it is, the cli See [Alchemy Smart Account Client](/packages/aa-alchemy/smart-account-client/) for more details. -<<< @/snippets/aa-alchemy/connected-client.ts +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/connected-client.ts] +``` ## 2. Construct the call data -The best part of Account Kit is that it abstracts the differences between User Operation calldata and standard Transaction calldata, such that you can pass in typical calldata to [sendUserOperation](/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction.md) as if it was a transaction sent from your smart account, and we will wrap it as necessary to generate calldata as it would be as a User Operation. +The best part of Account Kit is that it abstracts the differences between User Operation calldata and standard Transaction calldata, such that you can pass in typical calldata to [sendUserOperation](/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction) as if it was a transaction sent from your smart account, and we will wrap it as necessary to generate calldata as it would be as a User Operation. The second best part of Account Kit is that it is build atop [viem](https://viem.sh/). This means we can leverage utility methods to easily generate calldata, with type safety, using a smart contract's ABI. -::: code-group +:::code-group -```ts{5-18} [example.ts] +```ts [example.ts] import { encodeFunctionData } from "viem"; import { smartAccountClient } from "./smartAccountClient.ts"; // [!code focus:16] @@ -68,23 +57,25 @@ const txHash = await smartAccountClient.waitForUserOperationTransaction(uo); console.log(txHash); ``` -<<< @/snippets/aa-alchemy/connected-client.ts [smartAccountClient.ts] +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/connected-client.ts] +``` ::: -Some other helpful viem methods include: [encodeFunctionData](https://viem.sh/docs/contract/encodeFunctionData.html), [decodeFunctionData](https://viem.sh/docs/contract/decodeFunctionData.html), and [decodeFunctionResult](https://viem.sh/docs/contract/decodeFunctionResult.html). +Some other helpful viem methods include: [encodeFunctionData](https://viem.sh/docs/contract/encodeFunctionData), [decodeFunctionData](https://viem.sh/docs/contract/decodeFunctionData), and [decodeFunctionResult](https://viem.sh/docs/contract/decodeFunctionResult). ## 3. Send the User Operation -Now, we will use the connected client to send a user operation. We will use the [sendUserOperation](/packages/aa-core/smart-account-client/actions/sendUserOperation.md) method on the client. +Now, we will use the connected client to send a user operation. We will use the [sendUserOperation](/packages/aa-core/smart-account-client/actions/sendUserOperation) method on the client. -You can either send ETH to the smart account to pay for User Operation's gas, or you can connect your client to our Gas Manager using the [withAlchemyGasManager](/packages/aa-alchemy/middleware/alchemyGasManagerMiddleware.md) method to sponsor the UO's gas. We will use the latter approach below. You can go to the [Alchemy Dashboard](https://dashboard.alchemy.com/gas-manager/?a=ak-docs) to get a Gas Manager policy ID. +You can either send ETH to the smart account to pay for User Operation's gas, or you can connect your client to our Gas Manager using the [withAlchemyGasManager](/packages/aa-alchemy/middleware/alchemyGasManagerMiddleware) method to sponsor the UO's gas. We will use the latter approach below. You can go to the [Alchemy Dashboard](https://dashboard.alchemy.com/gas-manager/?a=ak-docs) to get a Gas Manager policy ID. -We will also want to wait for the transaction that contains the User Operation so that we know the User Operation is executed on-chain. We can use the [waitForUserOperationTransaction](/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction.md) method on the client, as seen below. +We will also want to wait for the transaction that contains the User Operation so that we know the User Operation is executed on-chain. We can use the [waitForUserOperationTransaction](/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction) method on the client, as seen below. -::: code-group +:::code-group -```ts{21-31} [example.ts] +```ts [example.ts] import { encodeFunctionData } from "viem"; import { smartAccountClient } from "./smartAccountClient.ts"; @@ -115,7 +106,9 @@ const txHash = await smartAccountClient.waitForUserOperationTransaction(uo); console.log(txHash); ``` -<<< @/snippets/aa-alchemy/connected-client.ts [smartAccountClient.ts] +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/connected-client.ts] +``` ::: @@ -123,4 +116,6 @@ console.log(txHash); And that's it! Let's put it all together. You can copy the following snippet to try it yourself! -<<< @/snippets/send-uo-example/full-example.ts +```ts [full-example.ts] +// [!include ~/snippets/send-uo-example/full-example.ts] +``` diff --git a/site/using-smart-accounts/session-keys/getting-started.md b/site/pages/using-smart-accounts/session-keys/getting-started.md similarity index 85% rename from site/using-smart-accounts/session-keys/getting-started.md rename to site/pages/using-smart-accounts/session-keys/getting-started.md index 5c45591134..e783f02664 100644 --- a/site/using-smart-accounts/session-keys/getting-started.md +++ b/site/pages/using-smart-accounts/session-keys/getting-started.md @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Getting started with Session Keys - - - meta - - name: description - content: Learn how to use Alchemy's Session Key Plugin. - - - meta - - property: og:description - content: Learn how to use Alchemy's Session Key Plugin. - - - meta - - name: twitter:title - content: Getting started with Session Keys - - - meta - - name: twitter:description - content: Learn how to use Alchemy's Session Key Plugin. +title: Getting started with Session Keys +description: Learn how to use Alchemy's Session Key Plugin. --- # Getting started with Session Keys @@ -27,7 +12,9 @@ We also export the necessary decorators which can be used to extend your `SmartA Let's take a look at a full example that demonstrates how to use session keys with a Modular Account. -<<< @/snippets/session-keys/full-example.ts +```ts [full-example.ts] +// [!include ~/snippets/session-keys/full-example.ts] +``` ## Breaking it down @@ -49,7 +36,7 @@ If you are using backend agent controlled session keys, then the agent should ge The base `SmartAccountClient` and `AlchemySmartAccountClient`, only include base functionality for sending user operations. If you are using a `ModularAccount`, then you will want to extend your client with the various decorators exported by `@alchemy/aa-accounts`. -::: code-group +:::code-group ```ts import { smartAccountClient } from "./smartAccountClient"; @@ -72,7 +59,10 @@ const extendedClient = smartAccountClient .extend(sessionKeyPluginActions); ``` -<<< @/snippets/aa-alchemy/base-client.ts [smartAccountClient.ts] +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/base-client.ts] +``` + ::: ### Check if the Session Key Plugin is installed @@ -120,7 +110,7 @@ if (!isPluginInstalled) { Session keys are powerful because of permissions that limit what actions they can take. When you add a session key, you should also specify the initial permissions that apply over the key. -See the [Supported Permissions](./supported-permissions.md#using-the-permissionsbuilder) page for more information on how to used the permissions builder. +See the [Supported Permissions](./supported-permissions#using-the-permissionsbuilder) page for more information on how to used the permissions builder. Let's use the permission builder to build a set of permissions that sets a spend limit: @@ -148,22 +138,30 @@ The Session Key Plugin allows you to: Session keys can be added either during installation, or using the `addSessionKey` function. -<<< @/snippets/session-keys/add-session-key.ts +```ts [add-session-key.ts] +// [!include ~/snippets/session-keys/add-session-key.ts] +``` ### Remove a Session Key Session keys can be removed using the `removeSessionKey` function. -<<< @/snippets/session-keys/remove-session-key.ts +```ts [remove-session-key.ts] +// [!include ~/snippets/session-keys/remove-session-key.ts] +``` ### Update a Key's permissions Session key permissions can be edited after creation using the `updateKeyPermissions` function. Note that you should configure initial permissions when the key is added, and not rely on a second user operation to set the permissions. -<<< @/snippets/session-keys/update-session-key.ts +```ts [update-session-key.ts] +// [!include ~/snippets/session-keys/update-session-key.ts] +``` ### Rotate a Session Key If the key is no longer available, but there exists a tag identifying a previous session key configured for your application, you may instead choose to rotate the previous key’s permissions. This can be performed using `rotateKey` . -<<< @/snippets/session-keys/rotate-session-key.ts +```ts [rotate-session-key.ts] +// [!include ~/snippets/session-keys/rotate-session-key.ts] +``` diff --git a/site/using-smart-accounts/session-keys/index.md b/site/pages/using-smart-accounts/session-keys/index.md similarity index 82% rename from site/using-smart-accounts/session-keys/index.md rename to site/pages/using-smart-accounts/session-keys/index.md index 52ece9027b..5c74531955 100644 --- a/site/using-smart-accounts/session-keys/index.md +++ b/site/pages/using-smart-accounts/session-keys/index.md @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Introduction to using Session Keys - - - meta - - name: description - content: Learn about Alchemy's ERC-6900 Compatible Session Key Plugin. - - - meta - - property: og:description - content: Learn about Alchemy's ERC-6900 Compatible Session Key Plugin. - - - meta - - name: twitter:title - content: Introduction to using Session Keys - - - meta - - name: twitter:description - content: Learn about Alchemy's ERC-6900 Compatible Session Key Plugin. +title: Introduction to using Session Keys +description: Learn about Alchemy's ERC-6900 Compatible Session Key Plugin. --- # Session Key Plugin overview diff --git a/site/using-smart-accounts/session-keys/supported-permissions.md b/site/pages/using-smart-accounts/session-keys/supported-permissions.md similarity index 89% rename from site/using-smart-accounts/session-keys/supported-permissions.md rename to site/pages/using-smart-accounts/session-keys/supported-permissions.md index a78e208371..91d9fb1f7a 100644 --- a/site/using-smart-accounts/session-keys/supported-permissions.md +++ b/site/pages/using-smart-accounts/session-keys/supported-permissions.md @@ -1,21 +1,6 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: Session Key Supported Permissions - - - meta - - name: description - content: All permissions the Alchemy Session Key Plugin supports. - - - meta - - property: og:description - content: - - - meta - - name: twitter:title - content: Session Key Supported Permissions - - - meta - - name: twitter:description - content: All permissions the Alchemy Session Key Plugin supports. +title: Session Key Supported Permissions +description: All permissions the Alchemy Session Key Plugin supports. --- # Supported Permissions @@ -72,27 +57,37 @@ The permissions data may be specified in 3 places: #### Generating the permissions -<<< @/snippets/session-keys/supported-permissions.ts#generate-permissions +```ts [generate-permissions.ts] +// [!include ~/snippets/session-keys/supported-permissions.ts:generatepermissions] +``` #### Example: Permissions in plugin install data -<<< @/snippets/session-keys/supported-permissions.ts#permissions-in-plugin-install +```ts [permissions-in-plugin-install.ts] +// [!include ~/snippets/session-keys/supported-permissions.ts:permissionsinplugininstall] +``` #### Example: Initial permissions for a new key -<<< @/snippets/session-keys/supported-permissions.ts#permissions-in-add +```ts [permissions-in-add.ts] +// [!include ~/snippets/session-keys/supported-permissions.ts:permissionsinadd] +``` #### Exmaple: Updating a session key's permissions This example updates a key's time range, but leaves other permissions to their current values. -<<< @/snippets/session-keys/supported-permissions.ts#permissions-in-update +```ts [permissions-in-update.ts] +// [!include ~/snippets/session-keys/supported-permissions.ts:permissionsinupdate] +``` ### Permissions Builder full reference -::: details View the full set of supported permissions here +:::details[View the full set of supported permissions here] -<<< @/../packages/accounts/src/msca/plugins/session-key/permissions.ts +```ts +// [!include ~/../packages/accounts/src/msca/plugins/session-key/permissions.ts] +``` ::: @@ -102,7 +97,9 @@ You may wish to view the current permissions of a given session key. This can be Here's an example of viewing all permissions in TypeScript: -<<< @/snippets/session-keys/supported-permissions.ts#view-permissions +```ts [view-permissions.ts] +// [!include ~/snippets/session-keys/supported-permissions.ts:viewpermissions] +``` ### Permission View Functions diff --git a/site/using-smart-accounts/simulate-user-operations.md b/site/pages/using-smart-accounts/simulate-user-operations.md similarity index 70% rename from site/using-smart-accounts/simulate-user-operations.md rename to site/pages/using-smart-accounts/simulate-user-operations.md index 5ed25662ca..6a6e946c41 100644 --- a/site/using-smart-accounts/simulate-user-operations.md +++ b/site/pages/using-smart-accounts/simulate-user-operations.md @@ -1,28 +1,14 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: How to simulate a User Operation - - - meta - - name: description - content: Follow this guide to simulate a User Operation with Alchemy's Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this guide to simulate a User Operation with Alchemy's Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: How to simulate a User Operation - - - meta - - name: twitter:description - content: Follow this guide to simulate a User Operation with Alchemy's Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: How to simulate a User Operation +description: Follow this guide to simulate a User Operation with Alchemy's Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. --- # How to simulate a User Operation This guide will show you how to simulate a `UserOperation` (UO) with Account Kit by adding support for UO simulation on an `AlchemySmartAccountClient` and sending a User Operation from that client only if simulation passes. By the end of this guide, you will have a basic understanding of how to safely send UOs with the `aa-sdk`. -::: warning NOTE +:::warning + Please note that the UO simulation results are based on the blockchain's state at the time of simulation. Changes in the blockchain state, such as updates to contract variables or balances, can occur between the time of simulation and when your UO actually gets executed. This could lead to different outcomes than predicted. For instance, if a UO's effect is conditional on the current state of a contract, and this state is altered before the UO is executed, the final result may not match the simulation. @@ -37,18 +23,14 @@ To simulate User Operations, we must create an Alchemy Client and pass in the `u Then, whenever you call a method on the client which generates the UO to send (e.g. [`sendUserOperation`](/packages/aa-core/smart-account-client/actions/sendUserOperation), [`sendTransaction`](/packages/aa-core/smart-account-client/actions/sendTransaction), [`sendTransactions`](/packages/aa-core/smart-account-client/actions/sendTransactions), [`buildUserOperation`](/packages/aa-core/smart-account-client/actions/buildUserOperation), or [`buildUserOperationFromTx`](/packages/aa-core/smart-account-client/actions/buildUserOperationFromTx)), the client will also simulate which assets change as a result of the UO, and if simulation fails, the client will not send the UO unnecessarily! -::: code-group - -<<< @/snippets/sim-uo-example/sim-middleware.ts - -::: +```ts [sim-middleware.ts] +// [!include ~/snippets/sim-uo-example/sim-middleware.ts] +``` ## 2. Using [`simulateUserOperation`](/packages/aa-alchemy/smart-account-client/actions/simulateUserOperation) You can also selectively simulate UOs by calling the [`simulateUserOperation`](/packages/aa-alchemy/smart-account-client/actions/simulateUserOperation) method before sending a UO. You would be responsible for catching any errors like how it is done below, but this is a nice alternative to always running simulation. -::: code-group - -<<< @/snippets/sim-uo-example/sim-method.ts - -::: +```ts [sim-method.ts] +// [!include ~/snippets/sim-uo-example/sim-method.ts] +``` diff --git a/site/using-smart-accounts/sponsoring-gas/checking-eligibility.md b/site/pages/using-smart-accounts/sponsoring-gas/checking-eligibility.md similarity index 60% rename from site/using-smart-accounts/sponsoring-gas/checking-eligibility.md rename to site/pages/using-smart-accounts/sponsoring-gas/checking-eligibility.md index 56a72f1d10..a838f12a06 100644 --- a/site/using-smart-accounts/sponsoring-gas/checking-eligibility.md +++ b/site/pages/using-smart-accounts/sponsoring-gas/checking-eligibility.md @@ -1,44 +1,33 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: How to handle User Operations that are not eligible for gas sponsorship - - - meta - - name: description - content: Follow this guide to handle User Operations that are not eligible for gas sponsorship. Account Kit is a vertically integrated stack for building apps that support ERC-4337. - - - meta - - property: og:description - content: Follow this guide to handle User Operations that are not eligible for gas sponsorship. Account Kit is a vertically integrated stack for building apps that support ERC-4337. - - - meta - - name: twitter:title - content: How to handle User Operations that are not eligible for gas sponsorship - - - meta - - name: twitter:description - content: Follow this guide to handle User Operations that are not eligible for gas sponsorship. Account Kit is a vertically integrated stack for building apps that support ERC-4337. +title: How to handle User Operations that are not eligible for gas sponsorship +description: Follow this guide to handle User Operations that are not eligible + for gas sponsorship. Account Kit is a vertically integrated stack for building + apps that support ERC-4337. --- # How to handle User Operations that are not eligible for gas sponsorship -As mentioned from the previous guide on [How to sponsor gas for a User Operation](./gas-manager.md), with Account Kit can sponsor gas fees for transactions via the [Gas Manager](https://docs.alchemy.com/docs/gas-manager-services/?a=ak-docs). -d +As mentioned from the previous guide on [How to sponsor gas for a User Operation](./gas-manager), with Account Kit can sponsor gas fees for transactions via the [Gas Manager](https://docs.alchemy.com/docs/gas-manager-services/?a=ak-docs). + But what happens when the user operation you are sending fails to satisfy the criteria set in the gas manager policy? How do you check if the user operation is eligible for gas sponsorship before sending the user operation? -If you do send the user operation that is not eligible for the gas sponsorship under your Gas Manager policy, [`sendUserOperation`](/packages/aa-core/smart-account-client/actions/sendUserOperation.md) or [`sendTransaction`](/packages/aa-core/smart-account-client/actions/sendTransaction.md) will fail due to the error thrown during the `PaymasterMiddleware` failure. You can follow the guide below to check for gas sponsorship eligibility in advance. +If you do send the user operation that is not eligible for the gas sponsorship under your Gas Manager policy, [`sendUserOperation`](/packages/aa-core/smart-account-client/actions/sendUserOperation) or [`sendTransaction`](/packages/aa-core/smart-account-client/actions/sendTransaction) will fail due to the error thrown during the `PaymasterMiddleware` failure. You can follow the guide below to check for gas sponsorship eligibility in advance. ## 1. How to check if a User Operation is eligible for gas sponsorship -First, you can follow the same instructions from the previous guide on [How to sponsorgas for a User Operation](./gas-manager.md) to set up your `AlchemySmartAccountClient` and link your gas policy. +First, you can follow the same instructions from the previous guide on [How to sponsorgas for a User Operation](./gas-manager) to set up your `AlchemySmartAccountClient` and link your gas policy. -<<< @/snippets/aa-alchemy/gas-manager-client.ts +```ts [gas-manager-client.ts] +// [!include ~/snippets/aa-alchemy/gas-manager-client.ts] +``` -Then, before you call `sendUserOperation` on the client, you can use [`checkGasSponsorshipEligibility`](/packages/aa-core/smart-account-client/actions/checkGasSponsorshipEligibility.md) to verify the eligibility of the connected account for gas sponsorship concerning the upcoming `UserOperation` (UO) that is intended to be sent. +Then, before you call `sendUserOperation` on the client, you can use [`checkGasSponsorshipEligibility`](/packages/aa-core/smart-account-client/actions/checkGasSponsorshipEligibility) to verify the eligibility of the connected account for gas sponsorship concerning the upcoming `UserOperation` (UO) that is intended to be sent. -Internally, this method invokes [`buildUserOperation`](/packages/aa-core/smart-account-client/actions/buildUserOperation.md), which navigates through the middleware pipeline, including the `PaymasterMiddleware`. Its purpose is to construct the UO struct meant for transmission to the bundler. Following the construction of the UO struct, this function verifies if the resulting structure contains a non-empty `paymasterAndData` field. +Internally, this method invokes [`buildUserOperation`](/packages/aa-core/smart-account-client/actions/buildUserOperation), which navigates through the middleware pipeline, including the `PaymasterMiddleware`. Its purpose is to construct the UO struct meant for transmission to the bundler. Following the construction of the UO struct, this function verifies if the resulting structure contains a non-empty `paymasterAndData` field. You can utilize this method before sending the user operation to confirm its eligibility for gas sponsorship. Depending on the outcome, it allows you to tailor the user experience accordingly, based on eligibility. -::: code-group +:::code-group ```ts [check-gas-sponsorship-eligibility.ts] import { smartAccountClient } from "./client"; @@ -56,7 +45,10 @@ console.log( ); ``` -<<< @/snippets/aa-alchemy/gas-manager-client.ts [client.ts] +```ts [gas-manager-client.ts] +// [!include ~/snippets/aa-alchemy/gas-manager-client.ts] +``` + ::: ## 2. How to bypass the Paymaster Middleware for User Operations not eligible for Gas Sponsorship @@ -65,9 +57,9 @@ If you attempt to execute the `sendUserOperation` method for user operations ine This section of the guide elucidates how you can circumvent the `PaymasterMiddleware`, enabling the sending of user operations without gas sponsorship. This functionality permits the sending of user operations where users pay the gas fee themselves via their smart account. -When employing various methods on `SmartAccountClient` to send user operations (e.g., [`sendUserOperation`](/packages/aa-core/smart-account-client/actions/sendUserOperation.md) or [`sendTransaction`](/packages/aa-core/smart-account-client/actions/sendTransaction.md)), apart from the `UserOperationCallData` or `BatchUserOperationCallData`, you have the option to include an additional parameter named `overrides`. This parameter allows the specification of override values for `maxFeePerGas`, `maxPriorityFeePerGas`, `callGasLimit`, `preVerificationGas`, `verificationGasLimit` or `paymasterAndData`. To bypass the `PaymasterMiddleware`, you can specifically set the `paymasterAndData` override. For example, assigning an empty hex string (`0x`) to the `paymasterAndData` field in the overrides would result in the user operation being sent without the paymaster covering the gas fee, but rather paid from the user's own smart account. +When employing various methods on `SmartAccountClient` to send user operations (e.g., [`sendUserOperation`](/packages/aa-core/smart-account-client/actions/sendUserOperation) or [`sendTransaction`](/packages/aa-core/smart-account-client/actions/sendTransaction)), apart from the `UserOperationCallData` or `BatchUserOperationCallData`, you have the option to include an additional parameter named `overrides`. This parameter allows the specification of override values for `maxFeePerGas`, `maxPriorityFeePerGas`, `callGasLimit`, `preVerificationGas`, `verificationGasLimit` or `paymasterAndData`. To bypass the `PaymasterMiddleware`, you can specifically set the `paymasterAndData` override. For example, assigning an empty hex string (`0x`) to the `paymasterAndData` field in the overrides would result in the user operation being sent without the paymaster covering the gas fee, but rather paid from the user's own smart account. -::: code-group +:::code-group ```ts [bypass-paymaster-middleware.ts] import { smartAccountClient } from "./client"; @@ -101,7 +93,9 @@ const txHash = await smartAccountClient.waitForUserOperationTransaction({ }); ``` -<<< @/snippets/aa-alchemy/gas-manager-client.ts [client.ts] +```ts [gas-manager-client.ts] +// [!include ~/snippets/aa-alchemy/gas-manager-client.ts] +``` ::: diff --git a/site/using-smart-accounts/sponsoring-gas/gas-manager.md b/site/pages/using-smart-accounts/sponsoring-gas/gas-manager.md similarity index 76% rename from site/using-smart-accounts/sponsoring-gas/gas-manager.md rename to site/pages/using-smart-accounts/sponsoring-gas/gas-manager.md index 83a18f9792..7f1ee50cec 100644 --- a/site/using-smart-accounts/sponsoring-gas/gas-manager.md +++ b/site/pages/using-smart-accounts/sponsoring-gas/gas-manager.md @@ -1,21 +1,8 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: How to sponsor gas for a UserOperation - - - meta - - name: description - content: Follow this guide to sponsor gas for UserOperations from any ERC-4337 smart account. Account Kit is a vertically integrated stack for building apps that support ERC-4337. - - - meta - - property: og:description - content: Follow this guide to sponsor gas for UserOperations from any ERC-4337 smart account. Account Kit is a vertically integrated stack for building apps that support ERC-4337. - - - meta - - name: twitter:title - content: How to sponsor gas for a UserOperation - - - meta - - name: twitter:description - content: Follow this guide to sponsor gas for UserOperations from any ERC-4337 smart account. Account Kit is a vertically integrated stack for building apps that support ERC-4337. +title: How to sponsor gas for a UserOperation +description: Follow this guide to sponsor gas for UserOperations from any + ERC-4337 smart account. Account Kit is a vertically integrated stack for + building apps that support ERC-4337. --- # How to sponsor gas for a UserOperation @@ -47,7 +34,9 @@ Remember to replace `ALCHEMY_API_KEY` with your Alchemy API key. If you don't ha Copy it and then replace the `GAS_MANAGER_POLICY_ID` in the snippet below. -<<< @/snippets/aa-alchemy/gas-manager-client.ts +```ts [gas-manager-client.ts] +// [!include ~/snippets/aa-alchemy/gas-manager-client.ts] +``` You have created a gas manager policy and linked it to the client. This guarantees that UOs sent with this client receive sponsorship if and only the UO satisfies the rules defined in your gas policy. @@ -55,7 +44,7 @@ You have created a gas manager policy and linked it to the client. This guarante Now you are ready to send sponsored UOs! You can send a UO by calling `sendUserOperation` on the client. The Gas Manager will check if this UO satisfies the policy rules defined above and sponsor the gas costs if the rules are met. If the UO does not meet the policy rules, an error will be thrown. -::: code-group +:::code-group ```ts [sponsor-gas.ts] import { smartAccountClient } from "./smartAccountClient.ts"; @@ -68,7 +57,9 @@ const { hash } = await smartAccountClient.sendUserOperation({ }); ``` -<<< @/snippets/aa-alchemy/gas-manager-client.ts +```ts [gas-manager-client.ts] +// [!include ~/snippets/aa-alchemy/gas-manager-client.ts] +``` ::: diff --git a/site/using-smart-accounts/transfer-ownership/light-account.md b/site/pages/using-smart-accounts/transfer-ownership/light-account.md similarity index 71% rename from site/using-smart-accounts/transfer-ownership/light-account.md rename to site/pages/using-smart-accounts/transfer-ownership/light-account.md index 67cb64ce89..c07314b911 100644 --- a/site/using-smart-accounts/transfer-ownership/light-account.md +++ b/site/pages/using-smart-accounts/transfer-ownership/light-account.md @@ -1,21 +1,8 @@ --- -outline: deep -head: - - - meta - - property: og:title - content: How to transfer ownership of a Light Account - - - meta - - name: description - content: Follow this guide to transfer ownership of a Light Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this guide to transfer ownership of a Light Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: How to transfer ownership of a Light Account - - - meta - - name: twitter:description - content: Follow this guide to transfer ownership of a Light Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. +title: How to transfer ownership of a Light Account +description: Follow this guide to transfer ownership of a Light Account with + Account Kit, a vertically integrated stack for building apps that support + ERC-4337 and ERC-6900. --- # How to transfer ownership of `LightAccount` @@ -34,7 +21,7 @@ There a number of ways you can call this method using Account Kit. ### 1. Using `transferOwnership` client action -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient as lightAccountClient } from "./smartAccountClient"; @@ -59,7 +46,9 @@ const transferredClient = await createLightAccountClient({ }); ``` -<<< @/snippets/aa-alchemy/light-account-client.ts [smartAccountClient.ts] +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/light-account-client.ts] +``` ::: @@ -67,7 +56,7 @@ Since `@alchemy/aa-accounts` exports a `LightAccount` ABI, the above approach ma ### 2. Using `sendUserOperation` -::: code-group +:::code-group ```ts [example.ts] import { encodeFunctionData } from "viem"; @@ -86,7 +75,9 @@ const result = await smartAccountClient.sendUserOperation({ await smartAccountClient.waitForUserOperationTransaction(result); ``` -<<< @/snippets/aa-alchemy/light-account-client.ts [smartAccountClient.ts] +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/light-account-client.ts] +``` ::: diff --git a/site/using-smart-accounts/transfer-ownership/modular-account.md b/site/pages/using-smart-accounts/transfer-ownership/modular-account.md similarity index 79% rename from site/using-smart-accounts/transfer-ownership/modular-account.md rename to site/pages/using-smart-accounts/transfer-ownership/modular-account.md index 5a17b71fde..69a1dcfe80 100644 --- a/site/using-smart-accounts/transfer-ownership/modular-account.md +++ b/site/pages/using-smart-accounts/transfer-ownership/modular-account.md @@ -1,23 +1,8 @@ --- -outline: deep -head: - - - meta - - property: og:title2 - content: How to manage ownership of a Modular Account - - - meta - - name: description - content: Follow this guide to manage ownership of a Modular Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this guide to manage ownership of a Modular Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: How to manage ownership of a Modular Account - - - meta - - name: twitter:description - content: Follow this guide to manage ownership of a Modular Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. -next: - text: How to manage ownership of a Modular Account +title: How to manage ownership of a Modular Account +description: Follow this guide to manage ownership of a Modular Account with + Account Kit, a vertically integrated stack for building apps that support + ERC-4337 and ERC-6900. --- # How to manage ownership of a Modular Account @@ -51,13 +36,13 @@ When you connect your Modular Account to `SmartAccountClient` you can extend the You should first extend the `SmartAccountClient` connected to a Modular Account, which already comes with `MultiOwnerPlugin` installed upon creation, with client to `multiOwnerPluginActions` for the client to include the `MultiOwnerPlugin` actions. -::: tip Note +:::tip[Note] When using `createModularAccountAlchemyClient` in `@alchemy/aa-alchemy`, the `SmartAccountClient` comes automatically extended with `multiOwnerPluginActions`, `pluginManagerActions`, and `accountLoupeActions` decorators as defaults available for use. ::: Then, you can use the `readOwners` method of the `multiOwnerPluginActions` extended smart account client to check if a given address is one of the current owners of a Modular Account. -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient as modularAccountClient } from "./smartAccountClient"; @@ -77,7 +62,9 @@ const isOwner = await pluginActionExtendedClient.isOwnerOf({ }); ``` -<<< @/snippets/aa-alchemy/connected-client.ts [smartAccountClient.ts] +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/connected-client.ts] +``` ::: @@ -85,7 +72,7 @@ const isOwner = await pluginActionExtendedClient.isOwnerOf({ You can use the `readOwners` method on the `multiOwnerPluginActions` extended smart account client to fetch all current owners of the connected Modular Account. -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient as modularAccountClient } from "./smartAccountClient"; @@ -101,7 +88,9 @@ const pluginActionExtendedClient = modularAccountClient.extend( const owners = await pluginActionExtendedClient.readOwners(); ``` -<<< @/snippets/aa-alchemy/connected-client.ts [smartAccountClient.ts] +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/connected-client.ts] +``` ::: @@ -109,7 +98,7 @@ const owners = await pluginActionExtendedClient.readOwners(); You can use the `updateOwners` method on the `multiOwnerPluginActions` extended smart account client to add or remove owners from the Modular Account. -::: code-group +:::code-group ```ts [example.ts] import { smartAccountClient as modularAccountClient } from "./smartAccountClient"; @@ -134,6 +123,8 @@ const txHash = await pluginActionExtendedClient.waitForUserOperationTransaction( ); ``` -<<< @/snippets/aa-alchemy/connected-client.ts [smartAccountClient.ts] +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/connected-client.ts] +``` ::: diff --git a/site/using-smart-accounts/transfer-ownership/multi-owner-light-account.md b/site/pages/using-smart-accounts/transfer-ownership/multi-owner-light-account.md similarity index 57% rename from site/using-smart-accounts/transfer-ownership/multi-owner-light-account.md rename to site/pages/using-smart-accounts/transfer-ownership/multi-owner-light-account.md index f4fa8c9cb9..f862d28ba2 100644 --- a/site/using-smart-accounts/transfer-ownership/multi-owner-light-account.md +++ b/site/pages/using-smart-accounts/transfer-ownership/multi-owner-light-account.md @@ -1,23 +1,8 @@ --- -outline: deep -head: - - - meta - - property: og:title2 - content: How to manage ownership of a Multi-Owner Light Account - - - meta - - name: description - content: Follow this guide to manage ownership of a Multi-Owner Light Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this guide to manage ownership of a Multi-Owner Light Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: How to manage ownership of a Multi-Owner Light Account - - - meta - - name: twitter:description - content: Follow this guide to manage ownership of a Multi-Owner Light Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. -next: - text: How to manage ownership of a Multi-Owner Light Account +title: How to manage ownership of a Multi-Owner Light Account +description: Follow this guide to manage ownership of a Multi-Owner Light + Account with Account Kit, a vertically integrated stack for building apps that + support ERC-4337 and ERC-6900. --- # How to manage ownership of `MultiOwnerLightAccount` @@ -32,7 +17,7 @@ The `MultiOwnerLightAccount` is able to: When you connect your `MultiOwnerLightAccount` to `SmartAccountClient` you can extend the client with `multiOwnerLightAccountClientActions`, which exposes a set of methods available to call the `MultiOwnerLightAccount` with the client connected to the account. -::: tip Note +:::tip[Note] When using `createMultiOwnerLightAccountAlchemyClient` in `@alchemy/aa-alchemy`, the `SmartAccountClient` comes automatically extended with `multiOwnerLightAccountClientActions` as defaults available for use. ::: @@ -40,26 +25,28 @@ When using `createMultiOwnerLightAccountAlchemyClient` in `@alchemy/aa-alchemy`, You can use the `getOwnerAddresses` method on the `MultiOwnerLightAccount` object, which can be accessed from a connected client. -::: code-group +:::code-group -````ts [example.ts] +```ts [example.ts] import { smartAccountClient } from "./smartAccountClient"; -const owners = await smartContractClient.account.getOwnerAddresses(); +const owners = await lightAccountClient.account.getOwnerAddresses(); +``` -<<< @/snippets/aa-alchemy/multi-owner-light-account-client.ts [smartAccountClient.ts] +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/multi-owner-light-account-client.ts] +``` ::: - ### 2. Add or remove owners for a `MultiOwnerLightAccount` You can use the `updateOwners` method on the `multiOwnerLightAccountClientActions` extended smart account client to add or remove owners from the `MultiOwnerLightAccount`. -::: code-group +:::code-group ```ts [example.ts] -import { lightAccountClient } from "./multiOwnerLIghtAcocuntClient"; +import { lightAccountClient } from "./smartAccountClient"; import { multiOwnerPluginActions } from "@alchemy/aa-accounts"; import { type Address } from "viem"; @@ -71,9 +58,13 @@ const opHash = await lightAccountClient.updateOwners({ ownersToRemove, }); -const txHash = await lightAccountClient.waitForUserOperationTransaction({ hash: opHash }); -```` +const txHash = await lightAccountClient.waitForUserOperationTransaction({ + hash: opHash, +}); +``` -<<< @/snippets/aa-alchemy/multi-owner-light-account-client.ts [multiOwnerLightAccountClient.ts] +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-alchemy/multi-owner-light-account-client.ts] +``` ::: diff --git a/site/react/useBundlerClient.md b/site/react/useBundlerClient.md deleted file mode 100644 index f50865a064..0000000000 --- a/site/react/useBundlerClient.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: useBundlerClient - - - meta - - name: description - content: An overview of the useBundlerClient hook - - - meta - - property: og:description - content: An overview of the useBundlerClient hook - - - meta - - name: twitter:title - content: useBundlerClient - - - meta - - name: twitter:description - content: An overview of the useBundlerClient hook ---- - -# useBundlerClient - -The `useBundlerClient` hook returns the underlying Bundler RPC client instance. - -## Import - -```ts -import { useBundlerClient } from "@alchemy/aa-alchemy/react"; -``` - -## Usage - -<<< @/snippets/react/useBundlerClient.tsx - -## Return Type - -```ts -import { type UseBundlerClientResult } from "@alchemy/aa-alchemy/react"; -``` - -Returns an instance of `ClientWithAlchemyMethods` which is the JSON RPC client connected to Alchemy services. diff --git a/site/react/useUser.md b/site/react/useUser.md deleted file mode 100644 index 346a230f0b..0000000000 --- a/site/react/useUser.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: useUser - - - meta - - name: description - content: An overview of the useUser hook - - - meta - - property: og:description - content: An overview of the useUser hook - - - meta - - name: twitter:title - content: useUser - - - meta - - name: twitter:description - content: An overview of the useUser hook ---- - -# useUser - -The `useUser` hook returns the authenticated [`User`](/resources/types.html#user) if the signer is authenticated. - -## Import - -```ts -import { useUser } from "@alchemy/aa-alchemy/react"; -``` - -## Usage - -<<< @/snippets/react/useUser.tsx - -## Return Type - -```ts -import { type UseUserResult } from "@alchemy/aa-alchemy/react"; -``` - -Returns a `User` object if the user has been authenticated, othwerise `null`. diff --git a/site/.vitepress/sidebar/packages/aa-accounts.ts b/site/sidebar/aa-accounts.ts similarity index 50% rename from site/.vitepress/sidebar/packages/aa-accounts.ts rename to site/sidebar/aa-accounts.ts index 7a8c9307fa..8da8d4496d 100644 --- a/site/.vitepress/sidebar/packages/aa-accounts.ts +++ b/site/sidebar/aa-accounts.ts @@ -1,44 +1,41 @@ -import { DefaultTheme } from "vitepress/types/default-theme"; +import { SidebarItem } from "vocs"; -export const aaAccountsSidebar: DefaultTheme.SidebarItem = { +export const aaAccountsSidebar: SidebarItem = { text: "aa-accounts", collapsed: true, - base: "/packages/aa-accounts", items: [ { text: "Getting started", - link: "/", + link: "/packages/aa-accounts/", }, { text: "Light Account", - link: "/light-account/", + link: "/packages/aa-accounts/light-account/", }, { text: "Light Account Actions", collapsed: true, - base: "/packages/aa-accounts/light-account/actions", items: [ { text: "transferOwnership", - link: "/transferOwnership", + link: "/packages/aa-accounts/light-account/actions/transferOwnership", }, ], }, { text: "Light Account Client", - link: "/light-account/client", + link: "/packages/aa-accounts/light-account/client", }, { text: "Utils", collapsed: true, - base: "/packages/aa-accounts/utils", items: [ { text: "getDefaultLightAccountFactoryAddress", - link: "/getDefaultLightAccountFactoryAddress", + link: "/packages/aa-accounts/utils/getDefaultLightAccountFactoryAddress", }, ], }, - { text: "Contributing", link: "/contributing" }, + { text: "Contributing", link: "/packages/aa-accounts/contributing" }, ], }; diff --git a/site/sidebar/aa-alchemy.ts b/site/sidebar/aa-alchemy.ts new file mode 100644 index 0000000000..a81df7b247 --- /dev/null +++ b/site/sidebar/aa-alchemy.ts @@ -0,0 +1,113 @@ +import { SidebarItem } from "vocs"; + +export const aaAlchemySidebar: SidebarItem = { + text: "aa-alchemy", + collapsed: true, + items: [ + { + text: "Getting started", + link: "/packages/aa-alchemy/", + }, + { + text: "Smart Account Client", + link: "/packages/aa-alchemy/smart-account-client/", + }, + { + text: "Smart Account Actions", + collapsed: true, + items: [ + { + text: "simulateUserOperation", + link: "/packages/aa-alchemy/smart-account-client/actions/simulateUserOperation", + }, + { + text: "alchemyEnhancedApiActions", + link: "/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions", + }, + ], + }, + { + text: "Light Account Client", + link: "/packages/aa-alchemy/light-account-client/", + }, + { + text: "Multisig Account Client", + link: "/packages/aa-alchemy/modular-account-client/multisig-account-client", + }, + { + text: "Middleware", + collapsed: true, + items: [ + { + text: "alchemyFeeEstimator", + link: "/packages/aa-alchemy/middleware/alchemyFeeEstimator", + }, + { + text: "alchemyGasManagerMiddleware", + link: "/packages/aa-alchemy/middleware/alchemyGasManagerMiddleware", + }, + { + text: "alchemyUserOperationSimulator", + link: "/packages/aa-alchemy/middleware/alchemyUserOperationSimulator", + }, + ], + }, + { + text: "Alchemy Signer", + collapsed: true, + items: [ + { + text: "Overview", + link: "/packages/aa-alchemy/signer/overview", + }, + { + text: "authenticate", + link: "/packages/aa-alchemy/signer/authenticate", + }, + { + text: "disconnect", + link: "/packages/aa-alchemy/signer/disconnect", + }, + { + text: "getAuthDetails", + link: "/packages/aa-alchemy/signer/getAuthDetails", + }, + + { + text: "getAddress", + link: "/packages/aa-alchemy/signer/getAddress", + }, + { + text: "signMessage", + link: "/packages/aa-alchemy/signer/signMessage", + }, + { + text: "signTypedData", + link: "/packages/aa-alchemy/signer/signTypedData", + }, + { + text: "getUser", + link: "/packages/aa-alchemy/signer/getUser", + }, + { + text: "addPasskey", + link: "/packages/aa-alchemy/signer/addPasskey", + }, + { + text: "exportWallet", + link: "/packages/aa-alchemy/signer/exportWallet", + }, + ], + }, + { + text: "Utils", + collapsed: true, + items: [ + { + text: "defineAlchemyChain", + link: "/packages/aa-alchemy/utils/defineAlchemyChain", + }, + ], + }, + ], +}; diff --git a/site/sidebar/aa-core.ts b/site/sidebar/aa-core.ts new file mode 100644 index 0000000000..8c7f60ba18 --- /dev/null +++ b/site/sidebar/aa-core.ts @@ -0,0 +1,224 @@ +import { SidebarItem } from "vocs"; + +export const aaCoreSideBar: SidebarItem = { + text: "aa-core", + collapsed: true, + items: [ + { + text: "Getting started", + link: "/packages/aa-core/", + }, + { + text: "Smart Account Client", + link: "/packages/aa-core/smart-account-client/", + }, + { + text: "Client Middleware", + link: "/packages/aa-core/smart-account-client/middleware/", + }, + { + text: "Smart Account Actions", + collapsed: true, + items: [ + { + text: "sendUserOperation", + link: "/packages/aa-core/smart-account-client/actions/sendUserOperation", + }, + { + text: "buildUserOperation", + link: "/packages/aa-core/smart-account-client/actions/buildUserOperation", + }, + { + text: "signUserOperation", + link: "/packages/aa-core/smart-account-client/actions/signUserOperation", + }, + { + text: "estimateUserOperationGas", + link: "/packages/aa-core/smart-account-client/actions/estimateUserOperationGas", + }, + { + text: "checkGasSponsorshipEligibility", + link: "/packages/aa-core/smart-account-client/actions/checkGasSponsorshipEligibility", + }, + { + text: "buildUserOperationFromTx", + link: "/packages/aa-core/smart-account-client/actions/buildUserOperationFromTx", + }, + { + text: "waitForUserOperationTransaction", + link: "/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction", + }, + { + text: "dropAndReplaceUserOperation", + link: "/packages/aa-core/smart-account-client/actions/dropAndReplaceUserOperation", + }, + { + text: "getUserOperationByHash", + link: "/packages/aa-core/smart-account-client/actions/getUserOperationByHash", + }, + { + text: "getUserOperationReceipt", + link: "/packages/aa-core/smart-account-client/actions/getUserOperationReceipt", + }, + { + text: "sendTransaction", + link: "/packages/aa-core/smart-account-client/actions/sendTransaction", + }, + { + text: "sendTransactions", + link: "/packages/aa-core/smart-account-client/actions/sendTransactions", + }, + { + text: "request", + link: "/packages/aa-core/smart-account-client/actions/request", + }, + { + text: "signMessage", + link: "/packages/aa-core/smart-account-client/actions/signMessage", + }, + { + text: "signTypedData", + link: "/packages/aa-core/smart-account-client/actions/signTypedData", + }, + { + text: "signMessageWith6492", + link: "/packages/aa-core/smart-account-client/actions/signMessageWith6492", + }, + { + text: "signTypedDataWith6492", + link: "/packages/aa-core/smart-account-client/actions/signTypedDataWith6492", + }, + { + text: "getAddress", + link: "/packages/aa-core/smart-account-client/actions/getAddress", + }, + { + text: "upgradeAccount", + link: "/packages/aa-core/smart-account-client/actions/upgradeAccount", + }, + { + text: "Types", + collapsed: true, + items: [ + { + text: "UserOperationFeeOptions", + link: "/packages/aa-core/smart-account-client/types/userOperationFeeOptions", + }, + { + text: "UserOperationFeeOptionsField", + link: "/packages/aa-core/smart-account-client/types/userOperationFeeOptionsField", + }, + { + text: "UserOperationOverrides", + link: "/packages/aa-core/smart-account-client/types/userOperationOverrides", + }, + ], + }, + ], + }, + { + text: "Bundler Client", + link: "/packages/aa-core/bundler-client/", + }, + { + text: "Bundler Actions", + collapsed: true, + items: [ + { + text: "sendRawUserOperation", + link: "/packages/aa-core/bundler-client/actions/sendRawUserOperation", + }, + { + text: "estimateUserOperationGas", + link: "/packages/aa-core/bundler-client/actions/estimateUserOperationGas", + }, + { + text: "getUserOperationByHash", + link: "/packages/aa-core/bundler-client/actions/getUserOperationByHash", + }, + { + text: "getUserOperationReceipt", + link: "/packages/aa-core/bundler-client/actions/getUserOperationReceipt", + }, + { + text: "getSupportedEntryPoints", + link: "/packages/aa-core/bundler-client/actions/getSupportedEntryPoints", + }, + ], + }, + { + text: "Accounts", + link: "/packages/aa-core/accounts/", + }, + { + text: "Signers", + collapsed: true, + items: [ + { + text: "WalletClientSigner", + link: "/packages/aa-core/signers/wallet-client", + }, + { + text: "LocalAccountSigner", + link: "/packages/aa-core/signers/local-account", + }, + { + text: "Utils", + collapsed: true, + items: [ + { + text: "wrapSignatureWith6492", + link: "/packages/aa-core/signers/utils/wrapSignatureWith6492", + }, + { + text: "verifyEIP6492Signature", + link: "/packages/aa-core/signers/utils/verifyEIP6492Signature", + }, + ], + }, + ], + }, + { text: "Split Transport", link: "/packages/aa-core/split-transport" }, + { + text: "Utils", + collapsed: true, + items: [ + { text: "asyncPipe", link: "/packages/aa-core/utils/asyncPipe" }, + { + text: "convertChainIdToCoinType", + link: "/packages/aa-core/utils/convertChainIdToCoinType", + }, + { + text: "convertCoinTypeToChain", + link: "/packages/aa-core/utils/convertCoinTypeToChain", + }, + { + text: "convertCoinTypeToChainId", + link: "/packages/aa-core/utils/convertCoinTypeToChainId", + }, + { text: "deepHexlify", link: "/packages/aa-core/utils/deepHexlify" }, + { + text: "defineReadOnly", + link: "/packages/aa-core/utils/defineReadOnly", + }, + { text: "getChain", link: "/packages/aa-core/utils/getChain" }, + { + text: "getDefaultEntryPointAddress", + link: "/packages/aa-core/utils/getDefaultEntryPointAddress", + }, + { + text: "getDefaultSimpleAccountFactoryAddress", + link: "/packages/aa-core/utils/getDefaultSimpleAccountFactoryAddress", + }, + { + text: "resolveProperties", + link: "/packages/aa-core/utils/resolveProperties", + }, + { + text: "stringToIndex", + link: "/packages/aa-core/utils/stringToIndex", + }, + ], + }, + ], +}; diff --git a/site/.vitepress/sidebar/packages/aa-ethers.ts b/site/sidebar/aa-ethers.ts similarity index 51% rename from site/.vitepress/sidebar/packages/aa-ethers.ts rename to site/sidebar/aa-ethers.ts index d61613dfab..20963109a0 100644 --- a/site/.vitepress/sidebar/packages/aa-ethers.ts +++ b/site/sidebar/aa-ethers.ts @@ -1,92 +1,88 @@ -import { DefaultTheme } from "vitepress/types/default-theme"; +import { SidebarItem } from "vocs"; -export const aaEthersSidebar: DefaultTheme.SidebarItem = { +export const aaEthersSidebar: SidebarItem = { text: "aa-ethers", - base: "/packages/aa-ethers", collapsed: true, items: [ { text: "Getting started", - link: "/", + link: "/packages/aa-ethers/", }, { text: "EthersProviderAdapter", collapsed: true, - base: "/packages/aa-ethers/provider-adapter", items: [ { text: "Introduction", - link: "/introduction", + link: "/packages/aa-ethers/provider-adapter/introduction", }, { text: "constructor", - link: "/constructor", + link: "/packages/aa-ethers/provider-adapter/constructor", }, { text: "send", - link: "/send", + link: "/packages/aa-ethers/provider-adapter/send", }, { text: "connectToAccount", - link: "/connectToAccount", + link: "/packages/aa-ethers/provider-adapter/connectToAccount", }, { text: "getBundlerClient", - link: "/getBundlerClient", + link: "/packages/aa-ethers/provider-adapter/getBundlerClient", }, { text: "fromEthersProvider", - link: "/fromEthersProvider", + link: "/packages/aa-ethers/provider-adapter/fromEthersProvider", }, ], }, { text: "AccountSigner", collapsed: true, - base: "/packages/aa-ethers/account-signer", items: [ { text: "Introduction", - link: "/introduction", + link: "/packages/aa-ethers/account-signer/introduction", }, { text: "getAddress", - link: "/getAddress", + link: "/packages/aa-ethers/account-signer/getAddress", }, { text: "signMessage", - link: "/signMessage", + link: "/packages/aa-ethers/account-signer/signMessage", }, { text: "sendTransaction", - link: "/sendTransaction", + link: "/packages/aa-ethers/account-signer/sendTransaction", }, { text: "getBundlerClient", - link: "/getBundlerClient", + link: "/packages/aa-ethers/account-signer/getBundlerClient", }, { text: "connect", - link: "/connect", + link: "/packages/aa-ethers/account-signer/connect", }, ], }, { text: "Utils", collapsed: true, - base: "/packages/aa-ethers/utils", items: [ { text: "Introduction", - link: "/introduction", + link: "/packages/aa-ethers/utils/introduction", }, { text: "convertWalletToAccountSigner", - link: "/convertWalletToAccountSigner", + link: "/packages/aa-ethers/utils/convertWalletToAccountSigner", }, { text: "convertEthersSignerToAccountSigner", - link: "/convertEthersSignerToAccountSigner", + link: "/packages/aa-ethers/utils/convertEthersSignerToAccountSigner", }, ], }, diff --git a/site/sidebar/aa-signers.ts b/site/sidebar/aa-signers.ts new file mode 100644 index 0000000000..cd75f2fd52 --- /dev/null +++ b/site/sidebar/aa-signers.ts @@ -0,0 +1,366 @@ +import { SidebarItem } from "vocs"; + +export const aaSignersSidebar: SidebarItem = { + text: "aa-signers", + collapsed: true, + items: [ + { + text: "Getting started", + link: "/packages/aa-signers/", + }, + { + text: "Magic Signer", + collapsed: true, + items: [ + { + text: "Introduction", + link: "/packages/aa-signers/magic/introduction", + }, + { text: "constructor", link: "/packages/aa-signers/magic/constructor" }, + { + text: "authenticate", + link: "/packages/aa-signers/magic/authenticate", + }, + { text: "getAddress", link: "/packages/aa-signers/magic/getAddress" }, + { text: "signMessage", link: "/packages/aa-signers/magic/signMessage" }, + { + text: "signTypedData", + link: "/packages/aa-signers/magic/signTypedData", + }, + { + text: "getAuthDetails", + link: "/packages/aa-signers/magic/getAuthDetails", + }, + ], + }, + { + text: "Web3Auth Signer", + collapsed: true, + items: [ + { + text: "Introduction", + link: "/packages/aa-signers/web3auth/introduction", + }, + { + text: "constructor", + link: "/packages/aa-signers/web3auth/constructor", + }, + { + text: "authenticate", + link: "/packages/aa-signers/web3auth/authenticate", + }, + { + text: "getAddress", + link: "/packages/aa-signers/web3auth/getAddress", + }, + { + text: "signMessage", + link: "/packages/aa-signers/web3auth/signMessage", + }, + { + text: "signTypedData", + link: "/packages/aa-signers/web3auth/signTypedData", + }, + { + text: "getAuthDetails", + link: "/packages/aa-signers/web3auth/getAuthDetails", + }, + ], + }, + { + text: "Turnkey Signer", + collapsed: true, + items: [ + { + text: "Introduction", + link: "/packages/aa-signers/turnkey/introduction", + }, + { + text: "constructor", + link: "/packages/aa-signers/turnkey/constructor", + }, + { + text: "authenticate", + link: "/packages/aa-signers/turnkey/authenticate", + }, + { text: "getAddress", link: "/packages/aa-signers/turnkey/getAddress" }, + { + text: "signMessage", + link: "/packages/aa-signers/turnkey/signMessage", + }, + { + text: "signTypedData", + link: "/packages/aa-signers/turnkey/signTypedData", + }, + { + text: "getAuthDetails", + link: "/packages/aa-signers/turnkey/getAuthDetails", + }, + ], + }, + { + text: "Fireblocks Signer", + collapsed: true, + items: [ + { + text: "Introduction", + link: "/packages/aa-signers/fireblocks/introduction", + }, + { + text: "constructor", + link: "/packages/aa-signers/fireblocks/constructor", + }, + { + text: "authenticate", + link: "/packages/aa-signers/fireblocks/authenticate", + }, + { + text: "getAddress", + link: "/packages/aa-signers/fireblocks/getAddress", + }, + { + text: "signMessage", + link: "/packages/aa-signers/fireblocks/signMessage", + }, + { + text: "signTypedData", + link: "/packages/aa-signers/fireblocks/signTypedData", + }, + { + text: "getAuthDetails", + link: "/packages/aa-signers/fireblocks/getAuthDetails", + }, + ], + }, + { + text: "Capsule Signer", + collapsed: true, + items: [ + { + text: "Introduction", + link: "/packages/aa-signers/capsule/introduction", + }, + { + text: "constructor", + link: "/packages/aa-signers/capsule/constructor", + }, + { + text: "authenticate", + link: "/packages/aa-signers/capsule/authenticate", + }, + { text: "getAddress", link: "/packages/aa-signers/capsule/getAddress" }, + { + text: "signMessage", + link: "/packages/aa-signers/capsule/signMessage", + }, + { + text: "signTypedData", + link: "/packages/aa-signers/capsule/signTypedData", + }, + { + text: "getAuthDetails", + link: "/packages/aa-signers/capsule/getAuthDetails", + }, + ], + }, + { + text: "Particle Signer", + collapsed: true, + items: [ + { + text: "Introduction", + link: "/packages/aa-signers/particle/introduction", + }, + { + text: "constructor", + link: "/packages/aa-signers/particle/constructor", + }, + { + text: "authenticate", + link: "/packages/aa-signers/particle/authenticate", + }, + { + text: "getAddress", + link: "/packages/aa-signers/particle/getAddress", + }, + { + text: "signMessage", + link: "/packages/aa-signers/particle/signMessage", + }, + { + text: "signTypedData", + link: "/packages/aa-signers/particle/signTypedData", + }, + { + text: "getAuthDetails", + link: "/packages/aa-signers/particle/getAuthDetails", + }, + ], + }, + { + text: "Portal Signer", + collapsed: true, + items: [ + { + text: "Introduction", + link: "/packages/aa-signers/portal/introduction", + }, + { + text: "constructor", + link: "/packages/aa-signers/portal/constructor", + }, + { + text: "authenticate", + link: "/packages/aa-signers/portal/authenticate", + }, + { text: "getAddress", link: "/packages/aa-signers/portal/getAddress" }, + { + text: "signMessage", + link: "/packages/aa-signers/portal/signMessage", + }, + { + text: "signTypedData", + link: "/packages/aa-signers/portal/signTypedData", + }, + { + text: "getAuthDetails", + link: "/packages/aa-signers/portal/getAuthDetails", + }, + ], + }, + { + text: "Arcana Auth Signer", + collapsed: true, + items: [ + { + text: "Introduction", + link: "/packages/aa-signers/arcana-auth/introduction", + }, + { + text: "constructor", + link: "/packages/aa-signers/arcana-auth/constructor", + }, + { + text: "authenticate", + link: "/packages/aa-signers/arcana-auth/authenticate", + }, + { + text: "getAddress", + link: "/packages/aa-signers/arcana-auth/getAddress", + }, + { + text: "signMessage", + link: "/packages/aa-signers/arcana-auth/signMessage", + }, + { + text: "signTypedData", + link: "/packages/aa-signers/arcana-auth/signTypedData", + }, + { + text: "getAuthDetails", + link: "/packages/aa-signers/arcana-auth/getAuthDetails", + }, + ], + }, + { + text: "Lit Signer", + collapsed: true, + items: [ + { + text: "Introduction", + link: "/packages/aa-signers/lit-protocol/introduction", + }, + { + text: "constructor", + link: "/packages/aa-signers/lit-protocol/constructor", + }, + { + text: "authenticate", + link: "/packages/aa-signers/lit-protocol/authenticate", + }, + { + text: "getAddress", + link: "/packages/aa-signers/lit-protocol/getAddress", + }, + { + text: "signMessage", + link: "/packages/aa-signers/lit-protocol/signMessage", + }, + { + text: "signTypedData", + link: "/packages/aa-signers/lit-protocol/signTypedData", + }, + { + text: "getAuthDetails", + link: "/packages/aa-signers/lit-protocol/getAuthDetails", + }, + ], + }, + { + text: "Passport Signer", + collapsed: true, + items: [ + { + text: "Introduction", + link: "/packages/aa-signers/passport/introduction", + }, + { + text: "constructor", + link: "/packages/aa-signers/passport/constructor", + }, + { + text: "authenticate", + link: "/packages/aa-signers/passport/authenticate", + }, + { + text: "getAddress", + link: "/packages/aa-signers/passport/getAddress", + }, + { + text: "signMessage", + link: "/packages/aa-signers/passport/signMessage", + }, + { + text: "signTypedData", + link: "/packages/aa-signers/passport/signTypedData", + }, + { + text: "getAuthDetails", + link: "/packages/aa-signers/passport/getAuthDetails", + }, + ], + }, + { + text: "Fordefi Signer", + collapsed: true, + items: [ + { + text: "Introduction", + link: "/packages/aa-signers/fordefi/introduction", + }, + { + text: "constructor", + link: "/packages/aa-signers/fordefi/constructor", + }, + { + text: "authenticate", + link: "/packages/aa-signers/fordefi/authenticate", + }, + { text: "getAddress", link: "/packages/aa-signers/fordefi/getAddress" }, + { + text: "signMessage", + link: "/packages/aa-signers/fordefi/signMessage", + }, + { + text: "signTypedData", + link: "/packages/aa-signers/fordefi/signTypedData", + }, + { + text: "getAuthDetails", + link: "/packages/aa-signers/fordefi/getAuthDetails", + }, + ], + }, + { text: "Contributing", link: "/packages/aa-signers/contributing" }, + ], +}; diff --git a/site/signers/alchemy-signer/[introduction].paths.ts b/site/signers/alchemy-signer/[introduction].paths.ts deleted file mode 100644 index a045e9e851..0000000000 --- a/site/signers/alchemy-signer/[introduction].paths.ts +++ /dev/null @@ -1,11 +0,0 @@ -const configPaths = { - paths() { - return [ - { params: { introduction: "index" } }, - { params: { introduction: "introduction" } }, - { params: { introduction: "introduction.md" } }, - ]; - }, -}; - -export default configPaths; diff --git a/site/signers/alchemy-signer/export-private-key.md b/site/signers/alchemy-signer/export-private-key.md deleted file mode 100644 index 2ab7455d39..0000000000 --- a/site/signers/alchemy-signer/export-private-key.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: Alchemy Signer • Export Private Key - - - meta - - name: description - content: Learn how to enable a user to export their private key with the Alchemy Signer - - - meta - - property: og:description - content: Learn how to enable a user to export their private key with the Alchemy Signer - - - meta - - name: twitter:title - content: Alchemy Signer • Export Private Key - - - meta - - name: twitter:description - content: Learn how to enable a user to export their private key with the Alchemy Signer ---- - -# Export private key - -The Alchemy Signer allows you to export a user's private key, allowing them a right to exit at any time. It is considered a best practice to allow your users to export their private key, as it gives them full control over their account. The private key export method does not rely on Alchemy's infrastructure, so even if Alchemy is down, a user can still export their private key. - -## Usage - -To add export private key functionality to your app, you can use the `exportPrivateKey` method on the signer. - -::: code-group - -<<< @/snippets/signers/alchemy/components/ExportPrivateKey.tsx - -<<< @/snippets/signers/alchemy/signer.ts - -::: diff --git a/site/signers/alchemy-signer/manage-user-sessions.md b/site/signers/alchemy-signer/manage-user-sessions.md deleted file mode 100644 index 544d109906..0000000000 --- a/site/signers/alchemy-signer/manage-user-sessions.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: Alchemy Signer • Manage user sessions - - - meta - - name: description - content: Learn how to configure and leverage sessions for you users with the Alchemy Signer - - - meta - - property: og:description - content: Learn how to configure and leverage sessions for you users with the Alchemy Signer - - - meta - - name: twitter:title - content: Alchemy Signer • Manage user sessions - - - meta - - name: twitter:description - content: Learn how to configure and leverage sessions for you users with the Alchemy Signer ---- - -# User sessions - -By default, `AlchemySigner` user sessions are cached in `localStorage` for 15 minutes. - -You can customize session length by passing a [`sessionConfig`](/packages/aa-alchemy/signer/overview.html#parameters) to your `AlchemySigner` constructor. - -You can check if the user has an active session with the following command: -::: code-group - -```ts -import { signer } from "./signer"; - -// NOTE: this method throws if there is no authenticated user -// so we return null in the case of an error -const user = await signer.getAuthDetails().catch(() => null); -``` - -<<< @/snippets/signers/alchemy/signer.ts -::: - -If there is an existing session, then your signer is ready for use! If not, see the section above for logging users in. diff --git a/site/signers/alchemy-signer/passkey-auth.md b/site/signers/alchemy-signer/passkey-auth.md deleted file mode 100644 index f2e728fcfc..0000000000 --- a/site/signers/alchemy-signer/passkey-auth.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: Alchemy Signer • Passkey Auth - - - meta - - name: description - content: Learn how to authenticate users with their passkey using the Alchemy Signer - - - meta - - property: og:description - content: Learn how to authenticate users with their passkey using the Alchemy Signer - - - meta - - name: twitter:title - content: Alchemy Signer • Passkey Auth - - - meta - - name: twitter:description - content: Learn how to authenticate users with their passkey using the Alchemy Signer ---- - -# Passkey Auth - -The Alchemy Signer allows you to authenticate and log in users with a [passkey](https://accountkit.alchemy.com/resources/terms.html#passkey) that they used previously to sign up to your application. - -To add passkey auth functionality to your app, you can use the [`authenticate`](/packages/aa-alchemy/signer/authenticate.html#parameters) method on the Alchemy Signer as follows. - -::: code-group - -<<< @/snippets/signers/alchemy/passkey-auth.ts - -<<< @/snippets/signers/alchemy/signer.ts - -::: - -## Example - -<<< @/snippets/signers/alchemy/components/PasskeyAuth.tsx diff --git a/site/signers/alchemy-signer/passkey-signup.md b/site/signers/alchemy-signer/passkey-signup.md deleted file mode 100644 index 60bab681af..0000000000 --- a/site/signers/alchemy-signer/passkey-signup.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: Alchemy Signer • Passkey Signup - - - meta - - name: description - content: Learn how to sign up users with a newly-created passkey using the Alchemy Signer - - - meta - - property: og:description - content: Learn how to sign up users with a newly-created passkey using the Alchemy Signer - - - meta - - name: twitter:title - content: Alchemy Signer • Passkey Signup - - - meta - - name: twitter:description - content: Learn how to sign up users with a newly-created passkey using the Alchemy Signer ---- - -# Passkey Signup - -The Alchemy Signer allows you to sign up users to your application using a [passkey](https://accountkit.alchemy.com/resources/terms.html#passkey) on their device. - -To add passkey signup functionality to your app, you can use the [`authenticate`](/packages/aa-alchemy/signer/authenticate.html#parameters) method on the Alchemy Signer as follows. - -::: code-group - -<<< @/snippets/signers/alchemy/passkey-signup.ts - -<<< @/snippets/signers/alchemy/signer.ts - -::: - -## Example - -<<< @/snippets/signers/alchemy/components/PasskeySignup.tsx diff --git a/site/signers/guides/fordefi.md b/site/signers/guides/fordefi.md deleted file mode 100644 index 2ab14fb424..0000000000 --- a/site/signers/guides/fordefi.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: Fordefi Integration Guide - - - meta - - name: description - content: Follow this integration guide to use Fordefi as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this integration guide to use Fordefi as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: Fordefi Integration Guide - - - meta - - name: twitter:description - content: Follow this integration guide to use Fordefi as a Signer with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. ---- - -# Fordefi Integration Guide - -[Fordefi](https://fordefi.com) is a blockchain security company that provides an **institutional-grade MPC (Multi-Party Computation) -non-custodial wallet** specifically built for decentralized finance (DeFi). - -Fordefi focuses on enhancing the security and efficiency of transactions in the DeFi space through the innovative use of MPC technology -for key management and transaction signing, -and by providing a secure and user-friendly interface through various clients: - -1. [Fordefi Browser Extension](https://chromewebstore.google.com/detail/fordefi/hcmehenccjdmfbojapcbcofkgdpbnlle) for interaction with dApps. -2. [Fordefi Web Console](https://app.fordefi.com) for securely performing administrative operations such as setting up transaction policy - rules and user management, which require approvals by a quorum of administrators. -3. [Fordefi API](https://docs.fordefi.com/reference/api-overview) for developers to interact with the Fordefi infrastructure. - -Read more about Fordefi on the [site](https://fordefi.com) and [docs](https://docs.fordefi.com). - -Combining Fordefi with Account Kit allows you to get the best of both worlds. -You can use Fordefi via the [`aa-signers`](/packages/aa-signers/index) package to generate a wallet scoped to your application, -and then use [`aa-alchemy`](/packages/aa-alchemy/index) to create smart accounts for your users. - -## Integration - -### Install the Fordefi Web3 Provider - -Using `FordefiSigner` in the `aa-signers` package requires installation of the [`@fordefi/web3-provider`](https://github.com/FordefiHQ/web3-provider) SDK. `aa-signers` lists it as optional dependency. - -::: code-group - -```bash [npm] -npm i -s @fordefi/web3-provider -``` - -```bash [yarn] -yarn add @fordefi/web3-provider -``` - -::: - -### Create a SmartAccountSigner - -Next, setup the Fordefi Web3 Provider and create a `SmartAccountSigner` using the `aa-signers` package: - -<<< @/snippets/signers/fordefi.ts - -### Use it with Modular Account - -Let's see it in action with `aa-alchemy`: - -::: code-group - -```ts [example.ts] -import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; -import { sepolia } from "@alchemy/aa-core"; -import { createFordefiSigner } from "./fordefi"; - -const chain = sepolia; - -const signer = await createFordefiSigner(); -const provider = await createModularAccountAlchemyClient({ - apiKey: "ALCHEMY_API_KEY", - chain, - signer, -}); -``` - -<<< @/snippets/signers/fordefi.ts - -::: diff --git a/site/smart-accounts/modular-account/multisig-plugin/index.md b/site/smart-accounts/modular-account/multisig-plugin/index.md deleted file mode 100644 index a142ad54c4..0000000000 --- a/site/smart-accounts/modular-account/multisig-plugin/index.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: Multisig Plugin Smart Contract - - - meta - - name: description - content: Follow this guide to use the Multisig Plugin on Modular Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this guide to use the Multisig Plugin on Modular Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: Multisig Plugin Smart Contract - - - meta - - name: twitter:description - content: Follow this guide to use the Multisig Plugin on Modular Account with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. ---- - -# Multisig Plugin - -## Overview - -The Multisig plugin adds `k of n` threshold signature scheme to your Modular Account, similar to [Gnosis Safe](https://safe.global/) accounts. This is a powerful security layer that is recommended for accounts that require additional security and redundancy beyond a single signer. - -The `n` signers can be any combination of ECDSA or SCA signers. A threshold of `k` signatures will be required to execute any user operation on the smart account. - -## Secure, audited, open source - -The Multisig Plugin has been audited by Quantstamp. You can find the audit reports [here](https://github.com/alchemyplatform/multisig-plugin/blob/develop/audits). - -It is also fully open source so you can validate the [source code](https://github.com/alchemyplatform/multisig-plugin). - -Now, let's [get started](./getting-started.md) with the multisig plugin! - - diff --git a/site/snippets/aa-core/buildSignSendRawUserOp.md b/site/snippets/aa-core/buildSignSendRawUserOp.mdx similarity index 91% rename from site/snippets/aa-core/buildSignSendRawUserOp.md rename to site/snippets/aa-core/buildSignSendRawUserOp.mdx index 12983c0438..1caec5f4a1 100644 --- a/site/snippets/aa-core/buildSignSendRawUserOp.md +++ b/site/snippets/aa-core/buildSignSendRawUserOp.mdx @@ -1,4 +1,4 @@ -::: code-group +:::code-group ```ts import { smartAccountClient } from "./smartAccountClient.ts"; @@ -34,6 +34,8 @@ const txHash = await smartAccountClient.waitForUserOperationTransaction({ console.log(txHash); ``` -<<< @/snippets/aa-core/smartAccountClient.ts [smartAccountClient.ts] +```ts [smartAccountClient.ts] +// [!include ~/snippets/aa-core/smartAccountClient.ts] +``` ::: diff --git a/site/snippets/aa-core/custom-account.ts b/site/snippets/aa-core/custom-account.ts new file mode 100644 index 0000000000..3175a1e36d --- /dev/null +++ b/site/snippets/aa-core/custom-account.ts @@ -0,0 +1,33 @@ +import { + getVersion060EntryPoint, + toSmartContractAccount, +} from "@alchemy/aa-core"; +import { http, type SignableMessage } from "viem"; +import { sepolia } from "viem/chains"; + +const myAccount = await toSmartContractAccount({ + /// REQUIRED PARAMS /// + source: "MyAccount", + transport: http("RPC_URL"), + chain: sepolia, + // The EntryPointDef that your account is compatible with + entryPoint: getVersion060EntryPoint(sepolia), + // This should return a concatenation of your `factoryAddress` and the `callData` for your factory's create account method + getAccountInitCode: () => "0x{factoryAddress}{callData}", + // an invalid signature that doesn't cause your account to revert during validation + getDummySignature: () => "0x1234...", + // given a UO in the form of {target, data, value} should output the calldata for calling your contract's execution method + encodeExecute: (uo) => "....", + signMessage: ({ message }: SignableMessage) => "0x...", + signTypedData: (typedData) => "0x000", + + /// OPTIONAL PARAMS /// + // if you already know your account's address, pass that in here to avoid generating a new counterfactual + accountAddress: Address, + // if your account supports batching, this should take an array of UOs and return the calldata for calling your contract's batchExecute method + encodeBatchExecute: (uos) => "0x...", + // if your contract expects a different signing scheme than the default signMessage scheme, you can override that here + signUserOperationHash: (hash) => "0x...", + // allows you to define the calldata for upgrading your account + encodeUpgradeToAndCall: (params) => "0x...", +}); diff --git a/site/snippets/aa-core/send-tx-param.md b/site/snippets/aa-core/send-tx-param.mdx similarity index 100% rename from site/snippets/aa-core/send-tx-param.md rename to site/snippets/aa-core/send-tx-param.mdx diff --git a/site/snippets/aa-core/send-uo-param.md b/site/snippets/aa-core/send-uo-param.mdx similarity index 84% rename from site/snippets/aa-core/send-uo-param.md rename to site/snippets/aa-core/send-uo-param.mdx index 6583bff6e8..554b2c2887 100644 --- a/site/snippets/aa-core/send-uo-param.md +++ b/site/snippets/aa-core/send-uo-param.mdx @@ -2,14 +2,22 @@ ### `SendUserOperationParameters` -::: details SendUserOperationParameters -<<< @/../packages/core/src/actions/smartAccount/types.ts#SendUserOperationParameters +:::details[SendUserOperationParameters] + +```ts +// [!include ~/../packages/core/src/actions/smartAccount/types.ts:SendUserOperationParameters] +``` + ::: - `uo:` [`UserOperationCallData`](/resources/types#UserOperationCallData) | [`BatchUserOperationCallData`](/resources/types#BatchUserOperationCallData) - ::: details UserOperationCallData - <<< @/../packages/core/src/types.ts#UserOperationCallData + :::details[UserOperationCallData] + + ```ts + // [!include ~/../packages/core/src/types.ts:UserOperationCallData] + ``` + ::: - `target: Address` - the target of the call (equivalent to `to` in a transaction) diff --git a/site/snippets/session-keys/supported-permissions.ts b/site/snippets/session-keys/supported-permissions.ts index f5ed9fa8a3..379f62b6c4 100644 --- a/site/snippets/session-keys/supported-permissions.ts +++ b/site/snippets/session-keys/supported-permissions.ts @@ -1,15 +1,15 @@ import { - SessionKeyPermissionsBuilder, SessionKeyAccessListType, - SessionKeySigner, + SessionKeyPermissionsBuilder, SessionKeyPlugin, + SessionKeySigner, } from "@alchemy/aa-accounts"; -import { zeroHash, keccak256 } from "viem"; +import { keccak256, zeroHash } from "viem"; import { client } from "./base-client.js"; const sessionKeySigner = new SessionKeySigner(); -// #region generate-permissions +// [!region generatepermissions] // Let's create an initial permission set for the session key giving it an eth spend limit const keyPermissions = new SessionKeyPermissionsBuilder() .setNativeTokenSpendLimit({ @@ -22,10 +22,10 @@ const keyPermissions = new SessionKeyPermissionsBuilder() // valid for 1 hour validUntil: Math.round(Date.now() / 1000 + 60 * 60), }); -// #endregion generate-permissions +// [!endregion generatepermissions] { - // #region permissions-in-plugin-install + // [!region permissionsinplugininstall] const result = await client.installSessionKeyPlugin({ // 1st arg is the initial set of session keys // 2nd arg is the tags for the session keys @@ -36,21 +36,21 @@ const keyPermissions = new SessionKeyPermissionsBuilder() [keyPermissions.encode()], ], }); - // #endregion permissions-in-plugin-install + // [!endregion permissionsinplugininstall] } { - // #region permissions-in-add + // [!region permissionsinadd] const result = await client.addSessionKey({ key: "0x1234123412341234123412341234123412341234", // Session key address tag: keccak256(new TextEncoder().encode("session-key-tag")), // Session key tag permissions: keyPermissions.encode(), // Initial permissions }); - // #endregion permissions-in-add + // [!endregion permissionsinadd] } { - // #region permissions-in-update + // [!region permissionsinupdate] const result = await client.updateSessionKeyPermissions({ key: "0x1234123412341234123412341234123412341234", // Session key address // add other permissions to the builder, if needed @@ -62,10 +62,10 @@ const keyPermissions = new SessionKeyPermissionsBuilder() }) .encode(), }); - // #endregion permissions-in-update + // [!endregion permissionsinupdate] } -// #region view-permissions +// [!region viewpermissions] const sessionKeyPluginView = SessionKeyPlugin.getContract(client).read; const accountAddress = client.getAddress(); const sessionKeyAddress = await sessionKeySigner.getAddress(); @@ -162,7 +162,7 @@ const requiredPaymaster = await sessionKeyPluginView.getRequiredPaymaster([ accountAddress, sessionKeyAddress, ]); -// #endregion view-permissions +// [!endregion viewpermissions] // To suppress typescript errors about unused variables from destructuring, "use" the variables here. // For some reason, this is an error, and not just a warning. (TS error 6198) diff --git a/site/styles.css b/site/styles.css new file mode 100644 index 0000000000..ffa7201626 --- /dev/null +++ b/site/styles.css @@ -0,0 +1,26 @@ +@layer vocs_preflight { + @tailwind base; +} +@tailwind components; +@tailwind utilities; + +footer.vocs_Footer { + @apply p-0 h-0; +} + +.vocs_DocsLayout_content { + @apply flex flex-col; +} + +.vocs_Content { + @apply flex flex-col grow; +} + +.bg-clip-text { + background-clip: text; + -webkit-background-clip: text; +} + +.transparent-text-fill { + -webkit-text-fill-color: transparent; +} diff --git a/site/tailwind.config.cjs b/site/tailwind.config.cjs index a5912e6bfe..786b6152ac 100644 --- a/site/tailwind.config.cjs +++ b/site/tailwind.config.cjs @@ -1,6 +1,5 @@ -/** @type {import('tailwindcss').Config} */ module.exports = { - content: ["./**/*.{js,ts,jsx,tsx,md}"], + content: ["./**/*.{js,ts,jsx,tsx,md,mdx}"], darkMode: "class", important: true, theme: { diff --git a/site/tsconfig.json b/site/tsconfig.json index e1e2b2ff59..92de2cc8c8 100644 --- a/site/tsconfig.json +++ b/site/tsconfig.json @@ -1,19 +1,19 @@ { "compilerOptions": { "baseUrl": ".", - "target": "es2021", - "lib": ["DOM", "ESNext"], "strict": true, - "jsx": "preserve", "esModuleInterop": true, "skipLibCheck": true, - "module": "esnext", - "moduleResolution": "node", "resolveJsonModule": true, "noUnusedLocals": true, "strictNullChecks": true, "forceConsistentCasingInFileNames": true, "types": ["vite/client", "vitepress"], + "moduleResolution": "NodeNext", + "module": "NodeNext", + "target": "ESNext", + "lib": ["ESNext", "DOM"], + "jsx": "react-jsx", "paths": { "~/*": ["src/*"] } diff --git a/site/using-smart-accounts/batch-user-operations.md b/site/using-smart-accounts/batch-user-operations.md deleted file mode 100644 index b4155d92a9..0000000000 --- a/site/using-smart-accounts/batch-user-operations.md +++ /dev/null @@ -1,96 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: How to submit batch transactions - - - meta - - name: description - content: Follow this guide to submit transactions in batches with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this guide to submit transactions in batches with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: How to submit batch transactions - - - meta - - name: twitter:description - content: Follow this guide to submit transactions in batches with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. ---- - -# How to submit batch transactions - -One benefit of Smart Contract Accounts is that it is possible to batch transactions in one `UserOperation` (UO). Not all Smart Contract Accounts support batching. But, if the `SmartContractAccount` implementation you are using has the [`encodeBatchExecute`](/packages/aa-core/accounts/) method, then implementations of `SmartAccountClient` will allow you to make those calls. - -There are two ways you can batch transactions using `SmartAccountClient`: - -1. via `sendUserOperation` -2. via `sendTransactions` - -:::tip Note 1: `LightSmartContractAccount`, and `MultiOwnerModularAccount` -Both `LightSmartContractAccount` and `MultiOwnerModularAccount` implement `encodeBatchExecute`, thus supports batching `UserOperations` out of the box. -::: - -:::tip Note 2: Transactions Batched as a Single User Operation -When you batch transactions, the transaction actions (`target`s and `calldata`s) are batched into a single UO, where the sender is the account itself. -::: - -:::tip Note 3: Batched Transactions Ordering -The batched UO gets executed by the account calling the `executeBatch` method on [`LightAccount`](https://github.com/alchemyplatform/light-account/blob/v1.1.0/src/LightAccount.sol) or [Modular Account](https://github.com/alchemyplatform/modular-account/blob/develop/src/account/UpgradeableModularAccount.sol) smart contracts. `executeBatch` processes the input array of transactions data linearly, guaranteeing the execution order of those transactions to be **sequential**. -::: - -## Batching using [`sendUserOperation`](/packages/aa-core/smart-account-client/actions/sendUserOperation.md) - -The `SmartAccountClient` supports passing either a single UO or an array of UOs to `sendUserOperation`. If you pass an array, the client will batch the transactions into a single User Operation and submit it to the bundler. Let's see an example: - -::: code-group - -```ts [example.ts] -import { smartAccountClient } from "./smartAccountClient"; -// [!code focus:99] -// the hash returned here is the hash of the User Operation -const { hash } = await smartAccountClient.sendUserOperation({ - uo: [ - { - target: "0x...", - data: "0xcallDataTransacation1", - }, - { - target: "0x...", - data: "0xcallDataTransacation2", - }, - ], -}); -``` - -<<< @/snippets/aa-alchemy/connected-client.ts [smartAccountClient.ts] - -::: - -## Batching using [`sendTransactions`](/packages/aa-core/smart-account-client/actions/sendTransactions.md) - -The `SmartAccountClient` supports sending UOs and waiting for them to be mined in a transaction via the `sendTransaction` and `sendTransactions` methods. The latter allows for batching in the same way `sendUserOperation`: - -::: code-group - -```ts [example.ts] -import { smartAccountClient } from "./smartAccountClient"; -// [!code focus:99] -// the hash returned here is the hash of the mined Tx that includes the UserOperation -const hash = await smartAccountClient.sendTransactions({ - requests: [ - { - to: "0x...", - data: "0xcallDataTransacation1", - }, - { - to: "0x...", - data: "0xcallDataTransacation2", - }, - ], -}); -``` - -<<< @/snippets/aa-alchemy/connected-client.ts [smartAccountClient.ts] - -::: diff --git a/site/using-smart-accounts/entry-point-v7.md b/site/using-smart-accounts/entry-point-v7.md deleted file mode 100644 index 442ea4fa76..0000000000 --- a/site/using-smart-accounts/entry-point-v7.md +++ /dev/null @@ -1,225 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: Migration Guide - - - meta - - name: description - content: How to update from EntryPoint v0.6 to v0.7 - - - meta - - property: og:description - content: How to update from EntryPoint v0.6 to v0.7 - - - meta - - name: twitter:title - content: Migration Guide - - - meta - - name: twitter:description - content: How to update from EntryPoint v0.6 to v0.7 ---- - -# EntryPoint v0.7 Update Guide - -## EntryPoint v0.7: A Milestone in Account Abstraction - -[Version 0.7](https://github.com/eth-infinitism/account-abstraction/releases/tag/v0.7.0), the latest advancement, brings significant updates and optimizations driven by community feedback and evolving needs: - -- Optimized Gas Management: Making transactions more cost-effective. -- Advanced Security: Introducing stringent security measures for better account and transaction protection. -- Enhanced Developer Tools: Offering improved resources for creating AA-enabled dApps. - -## What’s New in EntryPoint v0.7 - -EntryPoint v0.7 introduces several key features and improvements to streamline Account Abstraction further: - -- **Optimized Data Structures**: Refining transactional data structures for enhanced performance and reduced gas costs. -- **Simulation Functions and Deployment Overhaul**: Version 0.7 removes on-chain simulation functions, directing them off-chain for bundlers, optimizing contract efficiency. -- **`delegateAndRevert()` Helper**: This addition aids networks without state overrides, ensuring reliable validation and gas estimation. -- **`ERC-165` `supportsInterface`**: Enhancing interoperability. -- **Token Paymaster Template**: Illustrating how to implement paymasters that can sponsor transaction fees. -- **Penalty for Unused Gas**: Introducing a charge on unused gas limits to encourage efficient gas usage. -- **Streamlined Post-Operation Calls**: Simplifying the transaction process by removing redundant postOp calls. -- **Gas Limit Specifications**: Providing clearer guidelines for gas estimation and enhancing security. -- **Structural Adjustments**: Separating off-chain and on-chain UserOperation representations for better efficiency and clarity. - -With upgrade made for `aa-sdk` version `v3.8.4`, `aa-sdk` now supports both EntryPoint `v0.6.0` and the latest `v0.7.0` contract for compatible smart accounts. - -Below are the steps to update your project from using EntryPoint `v0.6.0` to `v0.7.0` of the `aa-sdk`. - -::: tip Note -This guide assumes you are already on `aa-sdk` version `^3.x.x`. If you are looking to upgrade from the older versions of `aa-sdk`, you can follow the [Migration Guide](/migration-guides/migrating-to-v3) to first upgrade `aa-sdk` version to `^3.x.x`. -::: - -Upgrading to the latest version `v3.8.4` of `aa-sdk` does **not** involve breaking changes if you continue to stay on using EntryPoint v0.6.0 for your smart accounts. If you are looking to update to using EntryPoint `v0.7.0`, you can simply do so by specifying in the optional entrypoint version parameter to the version `0.7.0` when instantiating your `SmartContractAccount`. For the initial launch of EntryPoint v0.7 support in `aa-sdk`, the default EntryPoint version will remain as `v0.6.0`, but note that this default version value will be changed to the latest version in the future versions of `aa-sdk`. - -### Account Support - -Because [EntryPoint](https://eips.ethereum.org/EIPS/eip-4337#definitions) is a singleton contract, where there is only one implementation and one instance exists on each chain, you first need to make sure the smart account and the bundler you are using is updated with a certain EntryPoint version. - -From version `^3.8.4`, `aa-sdk` lets you easily configure which EntryPoint version compatible Smart Account to use. `aa-sdk` supports 4 types of accounts natively, and the below table details which EntryPoints each account is valid for. - -| Account | EntryPoint v0.7 | EntryPoint v0.6 | -| :---------------------------- | :-------------- | :-------------- | -| SimpleAccount | ✅ | ✅ | -| LightAccount v1 (_< v.2.0.0_) | ❌ | ✅ | -| LightAccount v2 (_>= v2.0.0_) | ✅ | ❌ | -| MultiOwnerLightAccount | ✅ | ❌ | -| MultiOwnerModularAccount | ❌ | ✅ | -| MultisigModularAccount | ❌ | ✅ | - -### `SmartContractAccount`: optional `entryPoint` parameter for [`toSmartContractAccount`](/packages/aa-core/accounts/) - -The only change that needs to be made to update to using EntryPoint v.7 is to specify the optional `entryPoint` parameter of the [`ToSmartContractAccountParams`](/resources/types#ToSmartContractAccountParams) used for the [`toSmartContractAccount`](/packages/aa-core/accounts/) function when instantiating a `SmartContractAccount`. Based on the `entryPoint` parameter, which is of type [`EntryPointDef`](/resources/types#EntryPointDef) of the specific `EntryPointVersion`, the output `SmartContractAccount` will be strongly-typed with the structure compatible to perform the desired `EntryPointVersion` user operations. Using `SimpleAccount` as an example, you will have to make the following changes: - -```ts -import { createSimpleAccount } from "@alchemy/aa-core"; -import { getEntryPoint, LocalAccountSigner, type Hex } from "@alchemy/aa-core"; -import { sepolia } from "@alchemy/aa-core"; - -const chain = sepolia; - -const account = await createSimpleAccount({ - transport: http("RPC_URL"), - signer, - chain, - entryPoint: getEntryPoint(chain, { version: "0.7.0" }), // [!code ++] -}); -``` - -### [`BundlerClient`](/resources/types#BundlerClient) - -The `BundlerClient` will be compatible with both EntryPoint v0.6 and v0.7 operations, and the connected bundler is expected to determine the comaptible `EntryPoint` contract version based on the `entryPointAddress` parameter through the bundler RPC requests. - -### [`SmartAccountClient`](/resources/types#SmartAccountClient): `EntryPointVersion` inferred from the connected Smart Account - -As mentioned above, `Clients` support multiple `EntryPoint` contract versions depending on the `entryPointAddress` used when calling the RPC methods. As `SmartAccountClient` is an extension to `BundlerClient`, it is compatible with both `EntryPoint` version v0.6 and v0.7. When the `Account` is connected to the `Client` to perform [`SmartAccountClientActions`](/resources/types#smartaccountclientaction) on the connected `Account`, then the `SmartAccountClient` will be strongly-typed with the `EntryPointVersion` type inferred from the Account. - -#### Using EntryPoint v0.7 Smart Account with `SmartAccountClient` - -```ts -import { - createBundlerClient, - createSmartAccountClientFromExisting, - createSimpleAccount, - getEntryPoint, - LocalAccountSigner, - type Hex, -} from "@alchemy/aa-core"; -import { sepolia } from "@alchemy/aa-core"; -import { http, custom } from "viem"; - -const chain = sepolia; - -const client = createBundlerClient({ - chain, - transport: http("JSON_RPC_URL"), -}); - -// [!code focus:99] -const account_v7 = await createSimpleAccount({ - signer, - transport: custom(client), - chain, - entryPoint: getEntryPoint(chain, { version: "0.7.0" }), // required for EntryPoint v0.7 [!code ++] -}); - -const smartAccountClient = createSmartAccountClientFromExisting({ - client, -}); - -const uoStruct_v7: UserOperationStruct<"0.7.0"> = - await smartAccountClient.buildUserOperation({ - uo: { - target: "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef", - data: "0x", - value: 10n, - }, - account: account_v7, - }); - -// uoStruct_v7: UserOperationStruct<"0.7.0"> = { -// sender: string; -// nonce: BigNumberish; -// initCode: BytesLike | "0x"; [!code --] -// factory?: string; [!code ++] -// factoryData?: BytesLike; [!code ++] -// callData: BytesLike; -// callGasLimit?: BigNumberish; -// verificationGasLimit?: BigNumberish; -// preVerificationGas?: BigNumberish; -// maxFeePerGas?: BigNumberish; -// maxPriorityFeePerGas?: BigNumberish; -// paymasterAndData: BytesLike | "0x"; [!code --] -// paymaster?: string; [!code ++] -// paymasterVerificationGasLimit?: BigNumberish; [!code ++] -// paymasterPostOpGasLimit?: BigNumberish; [!code ++] -// paymasterData?: BytesLike; [!code ++] -// signature: BytesLike; -// } -``` - -### [`UserOperationOverrides`](/resources/types#useroperationoverrides) - -Similar to the updated `UserOperation` type from `EntryPoint` v0.6 to v0.7, `UserOperationOverrides` types are different from the two version operations. - -#### `paymasterAndData` field replaced with `paymaster` address and the `paymasterData` separated in addition to the 2 added `paymaster` operation gas limit fields - -```ts -export type UserOperationOverrides<'0.7.0'> = { - ... - paymasterAndData?: EmptyHex; // [!code --] - paymaster?: string; // [!code ++] - paymasterData?: EmptyHex; // [!code ++] - paymasterVerificationGasLimit?: BigNumberish | Multiplier; // [!code ++] - paymasterPostOpGasLimit?: BigNumberish | Multiplier; // [!code ++] -} -``` - -::: tip Note -Note that per [`ERC-4337`](https://eips.ethereum.org/EIPS/eip-4337#parameters), paymaster fields (`paymaster`, `paymasterData`, `paymasterValidationGasLimit`, `paymasterPostOpGasLimit`) either all exist, or none in the final `UserOperation` request sent to the connected Bundler. -::: - -#### `stateOverride` field added to `UserOperationOverrides` for validating and estimating gas for transactions - -The state overrides during transaction calls (e.g., [`eth_call`](https://docs.alchemy.com/reference/eth-call) and [`eth_estimateGas`](https://docs.alchemy.com/reference/eth-estimategas)) allow for more flexible testing and gas estimation. Specifically, `EntryPoint` v0.7 introduced the `delegateAndRevert()` helper in the `EntryPoint` contract to accommodate nodes without state overrides in `eth_call` and `eth_estimateGas` for validating and estimating gas for transactions in simulated conditions without permanently changing the on-chain state. - -Although some bundlers, such as Alchemy [`rundler`](https://github.com/alchemyplatform/rundler), do support the `stateOverride` feature for user operation gas estimation for both EntryPoint v0.6 and v0.7 user operations, until Entrypoint v0.6, the [`eth_estimateUserOperationGas`](https://eips.ethereum.org/EIPS/eip-4337#-eth_estimateuseroperationgas) RPC method did not include the optional `stateOverride` parameter per specification. From EntryPoint v0.7, `stateOverride` has been officially added as an optional parameter to the gas estimation method. - -To take advantage of such update, `aa-sdk` supports `stateOverride` value as part of the [`UserOperationOverrides`](/resources/types#useroperationoverrides) to be used during the gas estimation of simulated user operation transactions. - -```ts -export type UserOperationOverrides<'0.6.0' | '0.7.0'> = { - ... - stateOverride?: StateOverride; // [!code ++] - ... -}; -``` - -Learn how to use `stateOverrides` parameter in `UserOperationOverrides` to estimate gas for simulated `UserOperation` by referring to the guide [`How to estimate gas of a user operation involving state overrides`](/using-smart-accounts/estimate-gas/estimate-user-op-gas-state-overrides). - -### [`UserOperationEstimateGasResponse`](/resources/types#useroperationrstimategasresponse) - -Entrypoint v0.7 update includes the addition of `paymasterVerificationGasLimit`, the value used for paymaster verification, to the response of [`eth_estimateUserOperationGas`](https://eips.ethereum.org/EIPS/eip-4337#-eth_estimateuseroperationgas) RPC method. Accordingly, the `UserOperationEstimateGasResponse` for Entrypoint v0.7 user operation contains the added `paymasterVerificationGasLimit` value computed by the bundler if the user operation contains the `paymaster` field in the user operation request sent for gas estimation. - -Note that `paymasterPostOpGasLimit`, the value used for paymaster `postOp` execution, is not included in the response per Entrypoint v0.7 specification, and the value of this field depends on the specific paymaster that is being used for the user operation. - -```ts -export interface UserOperationEstimateGasResponse< - TEntryPointVersion extends EntryPointVersion -> { - /* Gas overhead of this UserOperation */ - preVerificationGas: BigNumberish; - /* Actual gas used by the validation of this UserOperation */ - verificationGasLimit: BigNumberish; - /* Value used by inner account execution */ - callGasLimit: BigNumberish; - /* - * EntryPoint v0.7.0 operations only. - * The amount of gas to allocate for the paymaster validation code. - * Note: `eth_estimateUserOperationGas` does not return paymasterPostOpGasLimit. - */ - paymasterVerificationGasLimit: TEntryPointVersion extends "0.7.0" - ? BigNumberish - : never; -} -``` diff --git a/site/using-smart-accounts/estimate-gas/estimate-user-op-gas-state-overrides.md b/site/using-smart-accounts/estimate-gas/estimate-user-op-gas-state-overrides.md deleted file mode 100644 index 168fb5d6aa..0000000000 --- a/site/using-smart-accounts/estimate-gas/estimate-user-op-gas-state-overrides.md +++ /dev/null @@ -1,129 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: How to estimate gas of a user operation involving state overrides - - - meta - - name: description - content: Follow this guide to learn how to estimate gas of a user operation involving state overrides using Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this guide to learn how to estimate gas of a user operation involving state overrides using Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: How to estimate gas of a user operation involving state overrides - - - meta - - name: twitter:description - content: Follow this guide to learn how to estimate gas of a user operation involving state overrides using Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. ---- - -# How to estimate gas of a user operation involving state overrides - -## [`StateOverride`](/resources/types#StateOverride) - -State overrides allow you to customize the network state for the purpose of your simulation. This feature is useful when you need to simulate or estimate gas for transaction scenarios under conditions that are not currently present on the live network. - -To illustrate how state overrides work, let’s use the DAI stablecoin contract. In the DAI system, certain actions, like minting new DAI tokens, can only be performed by addresses designated as "wards". If your address is not a ward, you cannot test minting operations. - -### Setting up as a ward through state overrides - -To estimate gas for the user operation transaction, you need to simulate a transaction where you mint DAI. This requires overriding the state to make our address appear as a ward. In other words, you need to pass in the state overrides value, along with the user operation transaction data, to adjust the wards map in the DAI contract to include your address with the necessary permissions. - -The state override is a mapping of specific storage locations in the smart contract as keys of the map, pointing to the override values for the simulation. - -```ts -{ - stateOverride: { - "0xDAI_CONTRACT_ADDRESS": { - storage: { - "0xSTORAGE_SLOT_OF_YOUR_ADDRESS": "0x0000000000000000000000000000000000000000000000000000000000000001" - } - } - } -} -``` - -::: tip Storage Slot Calculation -Calculating the storage location depends on the structure of the contract’s storage and the specific variable you want to override. For the DAI contract example, the storage location for the wards mapping for your address is calculated based on the [Solidity storage layout rules](https://docs.soliditylang.org/en/latest/internals/layout_in_storage.html#mappings-and-dynamic-arrays): - -```ts -const yourAddress = "0x..."; -const overrideStorageLocation = keccak256( - concatenate(hexZeroPad(yourAddress), hexZeroPad(0x0)) -); // 0xSTORAGE_SLOT_OF_YOUR_ADDRESS -``` - -::: - -## Simulated user operation gas estimation with state overrides using `SmartAccountClient` - -As described from [User operation gas estimation using `SmartAccountClient`](./estimate-user-op-gas#how-to-estimate-gas-for-a-user-operation), you can call the [`estimateUserOperationGas`](/packages/aa-core/smart-account-client/actions/estimateUserOperationGas) action on the `SmartAccountClient` to estimate gas for your user operation before sending the user operation to the network. - -Utilizing the `stateOverride` in the optional [`UserOperationOverrides`](/resources/types#useroperationoverrides) parameter to [`SmartAccountClientAction`](/resources/types#smartaccountclientaction) methods, you can estimate gas for user operation of simulated cases with the `estimateUserOperationGas` action. - -Refer to the below example for using the `estimateUserOperationGas` action with `stateOverride` to estimate gas with simulation. - -### [`UserOperationEstimateGasResponse`](/resources/types#useroperationrstimategasresponse) - -```ts -export interface UserOperationEstimateGasResponse< - TEntryPointVersion extends EntryPointVersion -> { - /* Gas overhead of this UserOperation */ - preVerificationGas: BigNumberish; - /* Actual gas used by the validation of this UserOperation */ - verificationGasLimit: BigNumberish; - /* Value used by inner account execution */ - callGasLimit: BigNumberish; - /* - * EntryPoint v0.7.0 operations only. - * The amount of gas to allocate for the paymaster validation code. - * Note: `eth_estimateUserOperationGas` does not return paymasterPostOpGasLimit. - */ - paymasterVerificationGasLimit: TEntryPointVersion extends "0.7.0" - ? BigNumberish - : never; -} -``` - -### Example - -::: code-group - -```ts [example.ts] -import { smartAccountClient } from "./smartAccountClient"; - -// state override that adjusts the wards map in the DAI contract -// to include your address with the necessary permissions. -const userOpOverrides: UserOperationOverrides = { - stateOverride: { - "0xDAI_CONTRACT_ADDRESS": { - storage: { - "0xSTORAGE_SLOT_OF_YOUR_ADDRESS": - "0x0000000000000000000000000000000000000000000000000000000000000001", - }, - }, - }, -}; - -// [!code focus:99] -const { preVerificationGas, verificationGasLimit, callGasLimit } = - await smartAccountClient.estimateUserOperationGas({ - uo: [ - { - target: "0x...", - data: "0xcallDataTransacation1", - }, - { - target: "0x...", - data: "0xcallDataTransacation2", - }, - ], - overrides: userOpOverrides, // UserOperationOverrides with state override for simulation - }); -``` - -<<< @/snippets/aa-alchemy/connected-client.ts [smartAccountClient.ts] - -::: diff --git a/site/using-smart-accounts/estimate-gas/estimate-user-op-gas.md b/site/using-smart-accounts/estimate-gas/estimate-user-op-gas.md deleted file mode 100644 index a1c45f3a3d..0000000000 --- a/site/using-smart-accounts/estimate-gas/estimate-user-op-gas.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -outline: deep -head: - - - meta - - property: og:title - content: How to estimate gas for a user operation - - - meta - - name: description - content: Follow this guide to learn how to estimate gas for a user operation with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - property: og:description - content: Follow this guide to learn how to estimate gas for a user operation with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. - - - meta - - name: twitter:title - content: How to estimate gas for a user operation - - - meta - - name: twitter:description - content: Follow this guide to learn how to estimate gas for a user operation with Account Kit, a vertically integrated stack for building apps that support ERC-4337 and ERC-6900. ---- - -# How to estimate gas for a user operation - -Providing accurate user operation gas estimations is important to the user experience of ERC-4337. If a gas estimate is too low, a user operation may revert during simulation, or worse, revert onchain during the execution phase, leaving the user to pay for gas of a reverted operation. If gas estimation is too high, a user may be dissuaded from, or unable to, send their operation due to costs. - -## User operation gas estimation using `SmartAccountClient` - -[`eth_estimateUserOperationGas`](https://docs.alchemy.com/reference/eth-estimateuseroperationgas) is an RPC method that bundlers support as per the [`ERC-4337`](https://eips.ethereum.org/EIPS/eip-4337#-eth_estimateuseroperationgas) specification. It estimate the gas values for a UserOperation. Given a UserOperation, optionally without gas limit or price fields, this method returns the needed gas limits. - -`SmartAccountClient` of `aa-sdk` provides a default [`gasEstimator`](/packages/aa-core/smart-account-client/middleware/index#gasEstimator) that internally includes calling `eth_estimateUserOperationGas` to the bundler in addition to applying user operation overrides or fee options for populating the user operation gas fields in a most desired manner. If you are looking to estimate gas of a user operation without building the entire user operation through the middleware pipeline, you can call the [`estimateUserOperationGas`](/packages/aa-core/smart-account-client/actions/estimateUserOperationGas) action on the `SmartAccountClient` to directly fetch network user operation gas estimates from the bundler. The action returns `UserOperationEstimateGasResponse` containing the estimated gas values. - -::: tip Note 1 -The actual gas estimation or fee estimation is performed by the bundler connected to the `SmartAccountClient`, so depending on the bundler you are using, the gas estimate value might be different. -::: - -::: tip Note 2 -Note that the `estimateUserOperationGas` action returns the bare result of gas estimates returned directly from the connected bundler without applying user operation gas overrides or client fee options that are applied from the default `gasEstimator` used when constructing the actual user operation request to send to the network. -::: - -### [`UserOperationEstimateGasResponse`](/resources/types#useroperationrstimategasresponse) - -```ts -export interface UserOperationEstimateGasResponse< - TEntryPointVersion extends EntryPointVersion -> { - /* Gas overhead of this UserOperation */ - preVerificationGas: BigNumberish; - /* Actual gas used by the validation of this UserOperation */ - verificationGasLimit: BigNumberish; - /* Value used by inner account execution */ - callGasLimit: BigNumberish; - /* - * EntryPoint v0.7.0 operations only. - * The amount of gas to allocate for the paymaster validation code. - * Note: `eth_estimateUserOperationGas` does not return paymasterPostOpGasLimit. - */ - paymasterVerificationGasLimit: TEntryPointVersion extends "0.7.0" - ? BigNumberish - : never; -} -``` - -### Example - -::: code-group - -```ts [example.ts] -import { smartAccountClient } from "./smartAccountClient"; - -// [!code focus:99] -const { preVerificationGas, verificationGasLimit, callGasLimit } = - await smartAccountClient.estimateUserOperationGas({ - uo: [ - { - target: "0x...", - data: "0xcallDataTransacation1", - }, - { - target: "0x...", - data: "0xcallDataTransacation2", - }, - ], - }); -``` - -<<< @/snippets/aa-alchemy/connected-client.ts [smartAccountClient.ts] - -::: diff --git a/site/vocs.config.tsx b/site/vocs.config.tsx new file mode 100644 index 0000000000..5240d1cc8a --- /dev/null +++ b/site/vocs.config.tsx @@ -0,0 +1,398 @@ +import { defineConfig } from "vocs"; +import { aaAccountsSidebar } from "./sidebar/aa-accounts.js"; +import { aaAlchemySidebar } from "./sidebar/aa-alchemy.js"; +import { aaCoreSideBar } from "./sidebar/aa-core.js"; +import { aaEthersSidebar } from "./sidebar/aa-ethers.js"; +import { aaSignersSidebar } from "./sidebar/aa-signers.js"; + +const pkg = require("../lerna.json"); + +export default defineConfig({ + title: "Account Kit", + description: "Account Abstraction Legos", + logoUrl: "/kit-logo.svg", + rootDir: "./", + head: ( + <> +