diff --git a/CHANGELOG.md b/CHANGELOG.md index 399e1e0608..3f0ed31602 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [3.0.0-alpha.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.1...v3.0.0-alpha.2) (2024-02-01) + +### Bug Fixes + +- session key permissions builder returning 0x ([7577d8c](https://github.com/alchemyplatform/aa-sdk/commit/7577d8ca570965a8857cc8d301c02f76660e453f)) + +# [3.0.0-alpha.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.0...v3.0.0-alpha.1) (2024-01-31) + +### Bug Fixes + +- decorators should now correctly respect account hoisting ([86d884e](https://github.com/alchemyplatform/aa-sdk/commit/86d884ed6209d89c688dc4281400f7304b210caa)) + # [3.0.0-alpha.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.3.1...v3.0.0-alpha.0) (2024-01-30) ### Bug Fixes diff --git a/lerna.json b/lerna.json index 7a8d5d2b5d..f791500413 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", - "version": "3.0.0-alpha.0", + "version": "3.0.0-alpha.2", "npmClient": "yarn", "conventionalCommits": true, "conventionalPrerelease": true, diff --git a/packages/accounts/CHANGELOG.md b/packages/accounts/CHANGELOG.md index 830e2d926a..6414e0e62e 100644 --- a/packages/accounts/CHANGELOG.md +++ b/packages/accounts/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [3.0.0-alpha.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.1...v3.0.0-alpha.2) (2024-02-01) + +### Bug Fixes + +- session key permissions builder returning 0x ([7577d8c](https://github.com/alchemyplatform/aa-sdk/commit/7577d8ca570965a8857cc8d301c02f76660e453f)) + +# [3.0.0-alpha.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.0...v3.0.0-alpha.1) (2024-01-31) + +### Bug Fixes + +- decorators should now correctly respect account hoisting ([86d884e](https://github.com/alchemyplatform/aa-sdk/commit/86d884ed6209d89c688dc4281400f7304b210caa)) + # [3.0.0-alpha.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.3.1...v3.0.0-alpha.0) (2024-01-30) ### Bug Fixes diff --git a/packages/accounts/package.json b/packages/accounts/package.json index 09f3d7826a..553306d0bc 100644 --- a/packages/accounts/package.json +++ b/packages/accounts/package.json @@ -1,6 +1,6 @@ { "name": "@alchemy/aa-accounts", - "version": "3.0.0-alpha.0", + "version": "3.0.0-alpha.2", "description": "A collection of ERC-4337 compliant smart contract account interfaces", "author": "Alchemy", "license": "MIT", @@ -74,7 +74,7 @@ "homepage": "https://github.com/alchemyplatform/aa-sdk#readme", "gitHead": "ee46e8bb857de3b631044fa70714ea706d9e317d", "dependencies": { - "@alchemy/aa-core": "^3.0.0-alpha.0", + "@alchemy/aa-core": "^3.0.0-alpha.1", "viem": "^2.5.0" } } diff --git a/packages/accounts/src/msca/plugins/session-key/permissions.ts b/packages/accounts/src/msca/plugins/session-key/permissions.ts index 7cdfaa6153..de0f285d35 100644 --- a/packages/accounts/src/msca/plugins/session-key/permissions.ts +++ b/packages/accounts/src/msca/plugins/session-key/permissions.ts @@ -175,7 +175,7 @@ export class SessionKeyPermissionsBuilder { }), this._requiredPaymaster ), - ].filter((x) => x === "0x"); + ].filter((x) => x !== "0x"); } private encodeIfDefined(encode: (param: T) => Hex, param?: T): Hex { diff --git a/packages/alchemy/CHANGELOG.md b/packages/alchemy/CHANGELOG.md index cf20d6efd8..d4855a505f 100644 --- a/packages/alchemy/CHANGELOG.md +++ b/packages/alchemy/CHANGELOG.md @@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [3.0.0-alpha.2](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.1...v3.0.0-alpha.2) (2024-02-01) + +**Note:** Version bump only for package @alchemy/aa-alchemy + +# [3.0.0-alpha.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.0...v3.0.0-alpha.1) (2024-01-31) + +### Bug Fixes + +- decorators should now correctly respect account hoisting ([86d884e](https://github.com/alchemyplatform/aa-sdk/commit/86d884ed6209d89c688dc4281400f7304b210caa)) + # [3.0.0-alpha.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.3.1...v3.0.0-alpha.0) (2024-01-30) ### Bug Fixes diff --git a/packages/alchemy/package.json b/packages/alchemy/package.json index b15c1d446c..dcbebbd9a1 100644 --- a/packages/alchemy/package.json +++ b/packages/alchemy/package.json @@ -1,6 +1,6 @@ { "name": "@alchemy/aa-alchemy", - "version": "3.0.0-alpha.0", + "version": "3.0.0-alpha.2", "description": "adapters for @alchemy/aa-core for interacting with alchemy services", "author": "Alchemy", "license": "MIT", @@ -57,7 +57,7 @@ "vitest": "^0.31.0" }, "dependencies": { - "@alchemy/aa-core": "^3.0.0-alpha.0", + "@alchemy/aa-core": "^3.0.0-alpha.1", "viem": "^2.5.0" }, "publishConfig": { diff --git a/packages/alchemy/src/client/lightAccountClient.test.ts b/packages/alchemy/src/client/lightAccountClient.test.ts index 1e18054e50..56e71b303d 100644 --- a/packages/alchemy/src/client/lightAccountClient.test.ts +++ b/packages/alchemy/src/client/lightAccountClient.test.ts @@ -24,7 +24,7 @@ describe("Light Account Client Tests", () => { { "fetchOptions": { "headers": { - "Alchemy-AA-Sdk-Version": "3.0.0-alpha.0", + "Alchemy-AA-Sdk-Version": "3.0.0-alpha.1", "Authorization": "Bearer test", }, }, diff --git a/packages/alchemy/src/client/modularAccountClient.ts b/packages/alchemy/src/client/modularAccountClient.ts new file mode 100644 index 0000000000..643467d9d2 --- /dev/null +++ b/packages/alchemy/src/client/modularAccountClient.ts @@ -0,0 +1,70 @@ +import { + accountLoupeActions, + createMultiOwnerModularAccount, + multiOwnerPluginActions, + pluginManagerActions, + type CreateMultiOwnerModularAccountParams, + type LightAccount, + type MultiOwnerModularAccount, +} from "@alchemy/aa-accounts"; +import type { SmartAccountSigner } from "@alchemy/aa-core"; +import { + custom, + type Chain, + type CustomTransport, + type HttpTransport, + type Transport, +} from "viem"; +import { AlchemyProviderConfigSchema } from "../schema.js"; +import { createAlchemySmartAccountClientFromRpcClient } from "./internal/smartAccountClientFromRpc.js"; +import { createAlchemyPublicRpcClient } from "./rpcClient.js"; +import type { + AlchemySmartAccountClient, + AlchemySmartAccountClientConfig, +} from "./smartAccountClient"; + +export type AlchemyModularAccountClientConfig< + TOwner extends SmartAccountSigner = SmartAccountSigner +> = Omit< + CreateMultiOwnerModularAccountParams, + "transport" | "chain" +> & + Omit< + AlchemySmartAccountClientConfig>, + "account" + >; + +export const createModularAccountAlchemyClient: < + TOwner extends SmartAccountSigner = SmartAccountSigner +>( + params: AlchemyModularAccountClientConfig +) => Promise< + AlchemySmartAccountClient< + CustomTransport, + Chain | undefined, + MultiOwnerModularAccount + > +> = async (config) => { + const { chain, opts, ...connectionConfig } = + AlchemyProviderConfigSchema.parse(config); + + const client = createAlchemyPublicRpcClient({ + chain, + connectionConfig, + }); + + const account = await createMultiOwnerModularAccount({ + transport: custom(client), + ...config, + }); + + return createAlchemySmartAccountClientFromRpcClient({ + ...config, + client, + account, + opts, + }) + .extend(multiOwnerPluginActions) + .extend(pluginManagerActions) + .extend(accountLoupeActions); +}; diff --git a/packages/alchemy/src/client/smartAccountClient.ts b/packages/alchemy/src/client/smartAccountClient.ts index 53b8ed6690..5c300f2bac 100644 --- a/packages/alchemy/src/client/smartAccountClient.ts +++ b/packages/alchemy/src/client/smartAccountClient.ts @@ -11,6 +11,7 @@ import { getDefaultUserOperationFeeOptions } from "../defaults.js"; import { type AlchemyGasManagerConfig } from "../middleware/gasManager.js"; import { AlchemyProviderConfigSchema } from "../schema.js"; import type { AlchemyProviderConfig } from "../type.js"; +import type { AlchemySmartAccountClientActions } from "./decorators/smartAccount.js"; import { createAlchemySmartAccountClientFromRpcClient } from "./internal/smartAccountClientFromRpc.js"; import { createAlchemyPublicRpcClient } from "./rpcClient.js"; import type { AlchemyRpcSchema } from "./types.js"; @@ -41,7 +42,8 @@ export type AlchemySmartAccountClient_Base< actions extends SmartAccountClientActions< chain, account - > = SmartAccountClientActions + > = SmartAccountClientActions & + AlchemySmartAccountClientActions > = Prettify< SmartAccountClient< transport, diff --git a/packages/alchemy/src/index.ts b/packages/alchemy/src/index.ts index 58308eceb4..40fafcc10d 100644 --- a/packages/alchemy/src/index.ts +++ b/packages/alchemy/src/index.ts @@ -9,6 +9,8 @@ export { alchemyActions } from "./client/decorators/smartAccount.js"; export { isAlchemySmartAccountClient } from "./client/isAlchemySmartAccountClient.js"; export type * from "./client/lightAccountClient.js"; export { createLightAccountAlchemyClient } from "./client/lightAccountClient.js"; +export type * from "./client/modularAccountClient.js"; +export { createModularAccountAlchemyClient } from "./client/modularAccountClient.js"; export type * from "./client/rpcClient.js"; export { createAlchemyPublicRpcClient } from "./client/rpcClient.js"; export type * from "./client/smartAccountClient.js"; diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 1644a4865c..7fd4db172c 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [3.0.0-alpha.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.0...v3.0.0-alpha.1) (2024-01-31) + +### Bug Fixes + +- decorators should now correctly respect account hoisting ([86d884e](https://github.com/alchemyplatform/aa-sdk/commit/86d884ed6209d89c688dc4281400f7304b210caa)) + # [3.0.0-alpha.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.3.1...v3.0.0-alpha.0) (2024-01-30) ### Bug Fixes diff --git a/packages/core/package.json b/packages/core/package.json index bb878cd4c1..03886d9d98 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@alchemy/aa-core", "license": "MIT", - "version": "3.0.0-alpha.0", + "version": "3.0.0-alpha.1", "description": "viem based SDK that enables interactions with ERC-4337 Smart Accounts. ABIs are based off the definitions generated in @account-abstraction/contracts", "author": "Alchemy", "type": "module", diff --git a/packages/core/src/version.ts b/packages/core/src/version.ts index 690f5131b5..131857a162 100644 --- a/packages/core/src/version.ts +++ b/packages/core/src/version.ts @@ -1,3 +1,3 @@ // This file is autogenerated by inject-version.ts. Any changes will be // overwritten on commit! -export const VERSION = "3.0.0-alpha.0"; +export const VERSION = "3.0.0-alpha.1"; diff --git a/packages/ethers/CHANGELOG.md b/packages/ethers/CHANGELOG.md index 81721a36c0..1c529718da 100644 --- a/packages/ethers/CHANGELOG.md +++ b/packages/ethers/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [3.0.0-alpha.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.0...v3.0.0-alpha.1) (2024-01-31) + +**Note:** Version bump only for package @alchemy/aa-ethers + # [3.0.0-alpha.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.3.1...v3.0.0-alpha.0) (2024-01-30) ### Code Refactoring diff --git a/packages/ethers/package.json b/packages/ethers/package.json index e2c2e13515..da5c64d3ee 100644 --- a/packages/ethers/package.json +++ b/packages/ethers/package.json @@ -1,7 +1,7 @@ { "name": "@alchemy/aa-ethers", "license": "MIT", - "version": "3.0.0-alpha.0", + "version": "3.0.0-alpha.1", "description": "Ethers.js wrapper for @alchemy/aa-core", "author": "Alchemy", "type": "module", @@ -49,7 +49,7 @@ "vitest": "^0.31.0" }, "dependencies": { - "@alchemy/aa-core": "^3.0.0-alpha.0", + "@alchemy/aa-core": "^3.0.0-alpha.1", "@ethersproject/abi": "^5.7.0", "@ethersproject/abstract-signer": "^5.7.0", "@ethersproject/bytes": "^5.7.0", diff --git a/packages/signers/CHANGELOG.md b/packages/signers/CHANGELOG.md index 7ec0b04cf1..0fb151ec4b 100644 --- a/packages/signers/CHANGELOG.md +++ b/packages/signers/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [3.0.0-alpha.1](https://github.com/alchemyplatform/aa-sdk/compare/v3.0.0-alpha.0...v3.0.0-alpha.1) (2024-01-31) + +**Note:** Version bump only for package @alchemy/aa-signers + # [3.0.0-alpha.0](https://github.com/alchemyplatform/aa-sdk/compare/v2.3.1...v3.0.0-alpha.0) (2024-01-30) - refactor(aa-accounts)!: migrate aa-accounts to viem approach ([37a5b48](https://github.com/alchemyplatform/aa-sdk/commit/37a5b489bdd2527dca311787d5585f1dc3a5f05b)) diff --git a/packages/signers/package.json b/packages/signers/package.json index 7de00bed61..4b06cfb0af 100644 --- a/packages/signers/package.json +++ b/packages/signers/package.json @@ -1,6 +1,6 @@ { "name": "@alchemy/aa-signers", - "version": "3.0.0-alpha.0", + "version": "3.0.0-alpha.1", "description": "A collection of signers used to create ERC-4337 smart accounts", "author": "Alchemy", "license": "MIT", @@ -114,7 +114,7 @@ "homepage": "https://github.com/alchemyplatform/aa-sdk#readme", "gitHead": "ee46e8bb857de3b631044fa70714ea706d9e317d", "dependencies": { - "@alchemy/aa-core": "^3.0.0-alpha.0", + "@alchemy/aa-core": "^3.0.0-alpha.1", "viem": "^2.5.0" }, "optionalDependencies": { diff --git a/site/.vitepress/config.ts b/site/.vitepress/config.ts index c55f48dede..bbd0ae4a8c 100644 --- a/site/.vitepress/config.ts +++ b/site/.vitepress/config.ts @@ -1,5 +1,5 @@ import { defineConfig } from "vitepress"; -import { packagesSidebar } from "./sidebar/packages"; +import { newSidebar } from "./sidebar/new"; const pkg = require("../../lerna.json"); @@ -45,145 +45,7 @@ export default defineConfig({ }, }, - sidebar: [ - { - text: "Overview", - base: "/overview", - items: [ - { text: "Why Account Kit", link: "/why-account-kit" }, - { text: "Introduction", link: "/introduction" }, - { text: "Getting Started", link: "/getting-started" }, - { - text: "Packages Overview", - link: "/package-overview", - }, - { - text: "Demos", - link: "/demos", - }, - { - text: "FAQs", - link: "/faqs", - }, - { - text: "Contact Us", - link: "/contact-us", - }, - ], - }, - { - text: "Smart Accounts", - base: "/smart-accounts", - items: [ - { text: "Overview", link: "/overview" }, - { - text: "Choosing a Smart Account", - base: "/smart-accounts/accounts", - items: [ - { text: "Introduction", link: "/choosing-a-smart-account" }, - { - text: "Smart Account Guides", - base: "/smart-accounts/accounts/guides", - collapsed: true, - items: [ - { text: "Light Account", link: "/light-account" }, - { text: "Modular Account", link: "/modular-account" }, - { text: "Using Your Own", link: "/using-your-own" }, - ], - }, - { text: "Deployments", link: "/deployment-addresses" }, - { text: "Contributing Your Account", link: "/contributing" }, - ], - }, - { - text: "Choosing a Signer", - base: "/smart-accounts/signers", - items: [ - { text: "Introduction", link: "/choosing-a-signer" }, - { - text: "Signer Guides", - base: "/smart-accounts/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: "Externally Owned Account (EOA)", link: "/eoa" }, - { text: "Using Your Own", link: "/custom-signer" }, - ], - }, - { text: "Contributing Your Signer", link: "/contributing" }, - ], - }, - ], - }, - { - text: "Tutorials", - base: "/tutorials", - items: [ - { - text: "How to Send a User Operation", - link: "/send-user-operation", - }, - { - text: "Gas Sponsorship", - base: "/tutorials/sponsoring-gas", - items: [ - { - text: "How to Sponsor Gas for User Operations", - link: "/sponsoring-gas", - }, - { - text: "How to Handle User Operations that are Not Eligible for Gas Sponsorship", - link: "/gas-sponsorship-eligibility", - }, - ], - }, - { text: "How to Batch Transactions", link: "/batching-transactions" }, - { - text: "How to Transfer Ownership of a Smart Account", - link: "/transferring-ownership", - }, - { - text: "How to Simulate a User Operation", - link: "/sim-user-operation", - }, - { - text: "Smart Account Data", - base: "/tutorials/enhanced-apis", - items: [ - { - text: "How to Fetch a Smart Account's NFTs", - link: "/nft", - }, - { - text: "How to Fetch a Smart Account's ERC-20 Tokens", - link: "/token", - }, - ], - }, - ], - }, - packagesSidebar, - { - text: "Glossary", - base: "/glossary", - collapsed: true, - items: [ - { text: "Terms", link: "/terms" }, - { text: "Types", link: "/types" }, - ], - }, - ], + sidebar: newSidebar, socialLinks: [ { icon: "github", link: "https://github.com/alchemyplatform/aa-sdk" }, diff --git a/site/.vitepress/sidebar/new.ts b/site/.vitepress/sidebar/new.ts new file mode 100644 index 0000000000..2d792daf36 --- /dev/null +++ b/site/.vitepress/sidebar/new.ts @@ -0,0 +1,125 @@ +import { DefaultTheme } from "vitepress"; +import { packagesSidebar } from "./packages"; + +export const newSidebar: DefaultTheme.Sidebar = [ + { + text: "Getting Started", + items: [ + { text: "Setup your project", link: "/overview/getting-started" }, + { text: "Deploy your first account", link: "/smart-accounts/overview" }, + ], + }, + { + text: "Choosing a Smart Account", + items: [ + { text: "Introduction", link: "/" }, + { + text: "Modular Account", + collapsed: false, + items: [ + { text: "Introduction", link: "/" }, + { text: "Getting started", link: "/" }, + { text: "Deployments", link: "/" }, + ], + }, + { + text: "Light Account", + collapsed: true, + items: [ + { text: "Introduction", link: "/" }, + { text: "Getting started", link: "/" }, + { text: "Deployments", link: "/" }, + ], + }, + { + text: "Custom Accounts", + collapsed: true, + items: [ + { text: "Use your own", link: "/" }, + { text: "Contribute your account", link: "/" }, + ], + }, + { text: "Gas Benchmarks", link: "/" }, + ], + }, + { + text: "Choosing a Signer", + base: "/smart-accounts/signers", + items: [ + { text: "Introduction", link: "/choosing-a-signer" }, + { + text: "Signer Guides", + base: "/smart-accounts/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: "Externally Owned Account (EOA)", link: "/eoa" }, + ], + }, + { + text: "Custom Signer", + collapsed: true, + items: [ + { + text: "Using Your Own", + link: "/guides/custom-signer", + }, + { + text: "Contributing Your Signer", + link: "/contributing", + }, + ], + }, + ], + }, + { + text: "Using Smart Accounts", + items: [ + { text: "Send User Operations", link: "/" }, + { text: "Batch User Operations", link: "/" }, + { text: "Simulate User Operations", link: "/" }, + { + text: "Transfer Ownership", + collapsed: false, + items: [{ text: "Modular Account" }, { text: "Light Account" }], + }, + { text: "Session Keys", link: "/" }, + { text: "Alchemy Enhanced Apis", link: "/" }, + ], + }, + { + text: "Extending Smart Accounts", + items: [ + { text: "Installing Plugins", link: "/" }, + { text: "Creating Plugins", link: "/" }, + ], + }, + { + text: "Third Party Integrations", + items: [ + { text: "Bundlers", link: "/" }, + { text: "Paymasters", link: "/" }, + ], + }, + packagesSidebar, + { + text: "Glossary", + base: "/glossary", + collapsed: true, + items: [ + { text: "Terms", link: "/terms" }, + { text: "Types", link: "/types" }, + ], + }, +]; diff --git a/site/.vitepress/sidebar/old.ts b/site/.vitepress/sidebar/old.ts new file mode 100644 index 0000000000..467ba1c5c8 --- /dev/null +++ b/site/.vitepress/sidebar/old.ts @@ -0,0 +1,143 @@ +import { DefaultTheme } from "vitepress"; +import { packagesSidebar } from "./packages"; + +// TODO: remove this once we're done refactoring, keeping here for tracking +export const oldSidebar: DefaultTheme.Sidebar = [ + { + text: "Overview", + base: "/overview", + items: [ + { text: "Why Account Kit", link: "/why-account-kit" }, + { text: "Introduction", link: "/introduction" }, + { text: "Getting Started", link: "/getting-started" }, + { + text: "Packages Overview", + link: "/package-overview", + }, + { + text: "Demos", + link: "/demos", + }, + { + text: "FAQs", + link: "/faqs", + }, + { + text: "Contact Us", + link: "/contact-us", + }, + ], + }, + { + text: "Smart Accounts", + base: "/smart-accounts", + items: [ + { text: "Overview", link: "/overview" }, + { + text: "Choosing a Smart Account", + base: "/smart-accounts/accounts", + items: [ + { text: "Introduction", link: "/choosing-a-smart-account" }, + { + text: "Smart Account Guides", + base: "/smart-accounts/accounts/guides", + collapsed: true, + items: [ + { text: "Light Account", link: "/light-account" }, + { text: "Modular Account", link: "/modular-account" }, + { text: "Using Your Own", link: "/using-your-own" }, + ], + }, + { text: "Deployments", link: "/deployment-addresses" }, + { text: "Contributing Your Account", link: "/contributing" }, + ], + }, + { + text: "Choosing a Signer", + base: "/smart-accounts/signers", + items: [ + { text: "Introduction", link: "/choosing-a-signer" }, + { + text: "Signer Guides", + base: "/smart-accounts/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: "Externally Owned Account (EOA)", link: "/eoa" }, + { text: "Using Your Own", link: "/custom-signer" }, + ], + }, + { text: "Contributing Your Signer", link: "/contributing" }, + ], + }, + ], + }, + { + text: "Tutorials", + base: "/tutorials", + items: [ + { + text: "How to Send a User Operation", + link: "/send-user-operation", + }, + { + text: "Gas Sponsorship", + base: "/tutorials/sponsoring-gas", + items: [ + { + text: "How to Sponsor Gas for User Operations", + link: "/sponsoring-gas", + }, + { + text: "How to Handle User Operations that are Not Eligible for Gas Sponsorship", + link: "/gas-sponsorship-eligibility", + }, + ], + }, + { text: "How to Batch Transactions", link: "/batching-transactions" }, + { + text: "How to Transfer Ownership of a Smart Account", + link: "/transferring-ownership", + }, + { + text: "How to Simulate a User Operation", + link: "/sim-user-operation", + }, + { + text: "Smart Account Data", + base: "/tutorials/enhanced-apis", + items: [ + { + text: "How to Fetch a Smart Account's NFTs", + link: "/nft", + }, + { + text: "How to Fetch a Smart Account's ERC-20 Tokens", + link: "/token", + }, + ], + }, + ], + }, + packagesSidebar, + { + text: "Glossary", + base: "/glossary", + collapsed: true, + items: [ + { text: "Terms", link: "/terms" }, + { text: "Types", link: "/types" }, + ], + }, +]; diff --git a/site/packages/aa-accounts/light-account/actions/transferOwnership.md b/site/packages/aa-accounts/light-account/actions/transferOwnership.md index 197463db9f..ece9ef14fe 100644 --- a/site/packages/aa-accounts/light-account/actions/transferOwnership.md +++ b/site/packages/aa-accounts/light-account/actions/transferOwnership.md @@ -34,7 +34,7 @@ const smartAccountClient = await transferLightAccountOwnership(provider, { }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: ## Returns diff --git a/site/packages/aa-accounts/light-account/client.md b/site/packages/aa-accounts/light-account/client.md index c40299da8f..98233c1471 100644 --- a/site/packages/aa-accounts/light-account/client.md +++ b/site/packages/aa-accounts/light-account/client.md @@ -20,7 +20,7 @@ head: ::: code-group -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: ## Returns diff --git a/site/packages/aa-accounts/light-account/encodeTransferOwnership.md b/site/packages/aa-accounts/light-account/encodeTransferOwnership.md index 4713c6febd..2c6bb5c1fb 100644 --- a/site/packages/aa-accounts/light-account/encodeTransferOwnership.md +++ b/site/packages/aa-accounts/light-account/encodeTransferOwnership.md @@ -29,7 +29,7 @@ const encodedTransferOwnershipData = smartAccountClient.account.encodeTransferOwnership({ newOwner }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: ## Returns diff --git a/site/packages/aa-accounts/light-account/getOwnerAddress.md b/site/packages/aa-accounts/light-account/getOwnerAddress.md index becb4eac31..2c515b2086 100644 --- a/site/packages/aa-accounts/light-account/getOwnerAddress.md +++ b/site/packages/aa-accounts/light-account/getOwnerAddress.md @@ -27,7 +27,7 @@ import { smartAccountClient } from "./smartAccountClient"; const owner = await smartAccountClient.account.getOwnerAddress(); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: ## Returns diff --git a/site/packages/aa-accounts/light-account/index.md b/site/packages/aa-accounts/light-account/index.md index 7dc44dab87..029b525abf 100644 --- a/site/packages/aa-accounts/light-account/index.md +++ b/site/packages/aa-accounts/light-account/index.md @@ -64,7 +64,7 @@ const result = await transferLightAccountOwnership(smartAccountClient, { }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: ## Developer Links diff --git a/site/packages/aa-accounts/light-account/signMessageWith6492.md b/site/packages/aa-accounts/light-account/signMessageWith6492.md index 2bad4ea66c..bfd747b9bc 100644 --- a/site/packages/aa-accounts/light-account/signMessageWith6492.md +++ b/site/packages/aa-accounts/light-account/signMessageWith6492.md @@ -29,7 +29,7 @@ const signedMessageWith6492 = smartAccountClient.signMessageWith6492({ }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: ## Returns diff --git a/site/packages/aa-accounts/light-account/signTypedData.md b/site/packages/aa-accounts/light-account/signTypedData.md index 36ce9a6b3b..618e20fa7a 100644 --- a/site/packages/aa-accounts/light-account/signTypedData.md +++ b/site/packages/aa-accounts/light-account/signTypedData.md @@ -57,7 +57,7 @@ const signedTypedData = smartAccountClient.signTypedData({ }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: ## Returns diff --git a/site/packages/aa-accounts/light-account/signTypedDataWith6492.md b/site/packages/aa-accounts/light-account/signTypedDataWith6492.md index b2fa5cbec7..18aed69b2d 100644 --- a/site/packages/aa-accounts/light-account/signTypedDataWith6492.md +++ b/site/packages/aa-accounts/light-account/signTypedDataWith6492.md @@ -57,7 +57,7 @@ const signedTypedDataWith6492 = smartAccountClient.signTypedDataWith6492({ }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: ## Returns diff --git a/site/packages/aa-alchemy/index.md b/site/packages/aa-alchemy/index.md index 7d480b7faf..b24d592832 100644 --- a/site/packages/aa-alchemy/index.md +++ b/site/packages/aa-alchemy/index.md @@ -44,6 +44,6 @@ pnpm i @alchemy/aa-alchemy Then, you can create a client like so: ::: code-group -<<< @/snippets/alchemy-smartAccountClient.ts +<<< @/snippets/aa-alchemy/base-client.ts ::: diff --git a/site/packages/aa-alchemy/light-account-client/index.md b/site/packages/aa-alchemy/light-account-client/index.md index b706609c86..8ac44d1e95 100644 --- a/site/packages/aa-alchemy/light-account-client/index.md +++ b/site/packages/aa-alchemy/light-account-client/index.md @@ -20,7 +20,7 @@ head: ::: code-group -<<< @/snippets/light-account-alchemy-client.ts +<<< @/snippets/aa-alchemy/light-account-client.ts ::: ## Returns diff --git a/site/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md b/site/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md index 7b21a0a59e..3d5ca322cc 100644 --- a/site/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md +++ b/site/packages/aa-alchemy/smart-account-client/actions/alchemyEnhancedApiActions.md @@ -31,7 +31,7 @@ Additionally, since the Alchemy SDK client does not yet support JWT authenticati ::: code-group ```ts [example.ts] -import { smartAccountClient } from "./alchemy-smartAccountClient"; +import { smartAccountClient } from "./base-client.ts"; import { alchemyEnhancedApiActions } from "@alchemy/aa-alchemy"; // [!code focus:99] @@ -43,7 +43,7 @@ const providerWithEnhancedApis = smartAccountClient.extend( ); ``` -<<< @/snippets/alchemy-smartAccountClient.ts +<<< @/snippets/aa-alchemy/base-client.ts ::: ## Returns diff --git a/site/packages/aa-alchemy/smart-account-client/actions/simulateUserOperation.md b/site/packages/aa-alchemy/smart-account-client/actions/simulateUserOperation.md index 26876dfe2e..63a8915a59 100644 --- a/site/packages/aa-alchemy/smart-account-client/actions/simulateUserOperation.md +++ b/site/packages/aa-alchemy/smart-account-client/actions/simulateUserOperation.md @@ -21,7 +21,7 @@ head: ::: code-group ```ts [example.ts] -import { smartAccountClient } from "./alchemy-smartAccountClient"; +import { smartAccountClient } from "./base-client.ts"; // [!code focus:99] const uoStruct: UserOperationCallData = { @@ -41,7 +41,7 @@ if (uoSimResult.error) { const uo = await smartAccountClient.sendUserOperation({ uo: uoStruct }); ``` -<<< @/snippets/light-account-alchemy-client.ts +<<< @/snippets/aa-alchemy/connected-client.ts ::: ## Returns diff --git a/site/packages/aa-alchemy/smart-account-client/index.md b/site/packages/aa-alchemy/smart-account-client/index.md index 49852f88ba..81e6de4c28 100644 --- a/site/packages/aa-alchemy/smart-account-client/index.md +++ b/site/packages/aa-alchemy/smart-account-client/index.md @@ -21,7 +21,7 @@ To create an `AlchemySmartAccountClient`, you must provide a set of parameters d ::: code-group ```ts [example.ts] -import { AlchemyProvider } from "@alchemy/aa-alchemy"; +import { createAlchemySmartAccountClient } from "@alchemy/aa-alchemy"; import { getDefaultEntryPointAddress } from "@alchemy/aa-core"; import { sepolia } from "@alchemy/aa-core"; diff --git a/site/packages/aa-core/bundler-client/actions/estimateUserOperationGas.md b/site/packages/aa-core/bundler-client/actions/estimateUserOperationGas.md index 2b466f4dcd..34d009a725 100644 --- a/site/packages/aa-core/bundler-client/actions/estimateUserOperationGas.md +++ b/site/packages/aa-core/bundler-client/actions/estimateUserOperationGas.md @@ -31,7 +31,7 @@ const estimates = await client.estimateUserOperationGas( ); ``` -<<< @/snippets/bundlerClient.ts +<<< @/snippets/aa-core/bundlerClient.ts ::: ## Returns diff --git a/site/packages/aa-core/bundler-client/actions/getSupportedEntryPoints.md b/site/packages/aa-core/bundler-client/actions/getSupportedEntryPoints.md index 5a1ca728c1..d22b824be2 100644 --- a/site/packages/aa-core/bundler-client/actions/getSupportedEntryPoints.md +++ b/site/packages/aa-core/bundler-client/actions/getSupportedEntryPoints.md @@ -26,7 +26,7 @@ import { client } from "./client"; const entryPoints = await client.getSupportedEntryPoints(); ``` -<<< @/snippets/bundlerClient.ts +<<< @/snippets/aa-core/bundlerClient.ts ::: ## Returns diff --git a/site/packages/aa-core/bundler-client/actions/getUserOperationByHash.md b/site/packages/aa-core/bundler-client/actions/getUserOperationByHash.md index a9483d22d3..5ee802ce3e 100644 --- a/site/packages/aa-core/bundler-client/actions/getUserOperationByHash.md +++ b/site/packages/aa-core/bundler-client/actions/getUserOperationByHash.md @@ -26,7 +26,7 @@ import { client } from "./client"; const uo = await client.getUserOperationByHash("0xUserOperationHash"); ``` -<<< @/snippets/bundlerClient.ts +<<< @/snippets/aa-core/bundlerClient.ts ::: ## Returns diff --git a/site/packages/aa-core/bundler-client/actions/getUserOperationReceipt.md b/site/packages/aa-core/bundler-client/actions/getUserOperationReceipt.md index 476bd71867..2d33cb8703 100644 --- a/site/packages/aa-core/bundler-client/actions/getUserOperationReceipt.md +++ b/site/packages/aa-core/bundler-client/actions/getUserOperationReceipt.md @@ -26,7 +26,7 @@ import { client } from "./client"; const receipt = await client.getUserOperationReceipt("0xUserOperationHash"); ``` -<<< @/snippets/bundlerClient.ts +<<< @/snippets/aa-core/bundlerClient.ts ::: ## Returns diff --git a/site/packages/aa-core/bundler-client/actions/sendRawUserOperation.md b/site/packages/aa-core/bundler-client/actions/sendRawUserOperation.md index 60d3e9cc3e..e2c8bd0f11 100644 --- a/site/packages/aa-core/bundler-client/actions/sendRawUserOperation.md +++ b/site/packages/aa-core/bundler-client/actions/sendRawUserOperation.md @@ -33,7 +33,7 @@ const hash = await client.sendRawUserOperation( ); ``` -<<< @/snippets/bundlerClient.ts +<<< @/snippets/aa-core/bundlerClient.ts ::: ## Returns diff --git a/site/packages/aa-core/index.md b/site/packages/aa-core/index.md index 91facf9ad2..77ae4f1072 100644 --- a/site/packages/aa-core/index.md +++ b/site/packages/aa-core/index.md @@ -44,5 +44,5 @@ pnpm i @alchemy/aa-core Then, you can create a client like so: ::: code-group -<<< @/snippets/core-provider.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: diff --git a/site/packages/aa-core/signers/wallet-client.md b/site/packages/aa-core/signers/wallet-client.md index 8f0d2d9ce1..e7171b0ea0 100644 --- a/site/packages/aa-core/signers/wallet-client.md +++ b/site/packages/aa-core/signers/wallet-client.md @@ -19,7 +19,7 @@ The `WalletClientSigner` is useful if you want to convert a `viem` `WalletClient ## Usage ::: code-group -<<< @/snippets/wallet-client-signer.ts +<<< @/snippets/signers/wallet-client-signer.ts ::: ## Methods diff --git a/site/packages/aa-core/smart-account-client/actions/buildUserOperation.md b/site/packages/aa-core/smart-account-client/actions/buildUserOperation.md index 4201ca0c24..b4e9b4be25 100644 --- a/site/packages/aa-core/smart-account-client/actions/buildUserOperation.md +++ b/site/packages/aa-core/smart-account-client/actions/buildUserOperation.md @@ -64,7 +64,7 @@ const { hash: batchedUoHash } = await smartAccountClient.sendUserOperation({ }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: ## Returns diff --git a/site/packages/aa-core/smart-account-client/actions/buildUserOperationFromTx.md b/site/packages/aa-core/smart-account-client/actions/buildUserOperationFromTx.md index f924638334..76c3cc2365 100644 --- a/site/packages/aa-core/smart-account-client/actions/buildUserOperationFromTx.md +++ b/site/packages/aa-core/smart-account-client/actions/buildUserOperationFromTx.md @@ -45,7 +45,7 @@ const uoStruct = await smartAccountClient.buildUserOperationFromTx({ const uoHash = await smartAccountClient.sendUserOperation(uoStruct); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: ## Returns diff --git a/site/packages/aa-core/smart-account-client/actions/checkGasSponsorshipEligibility.md b/site/packages/aa-core/smart-account-client/actions/checkGasSponsorshipEligibility.md index d93d7cccbf..b11a38b2d2 100644 --- a/site/packages/aa-core/smart-account-client/actions/checkGasSponsorshipEligibility.md +++ b/site/packages/aa-core/smart-account-client/actions/checkGasSponsorshipEligibility.md @@ -42,7 +42,7 @@ console.log( ); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: ## Returns diff --git a/site/packages/aa-core/smart-account-client/actions/dropAndReplaceUserOperation.md b/site/packages/aa-core/smart-account-client/actions/dropAndReplaceUserOperation.md index c62d2ac469..c782c62b00 100644 --- a/site/packages/aa-core/smart-account-client/actions/dropAndReplaceUserOperation.md +++ b/site/packages/aa-core/smart-account-client/actions/dropAndReplaceUserOperation.md @@ -35,7 +35,7 @@ const { hash: replacedHash } = await smartAccountClient.dropAndReplaceUserOperation(request); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: ## Returns diff --git a/site/packages/aa-core/smart-account-client/actions/getAddress.md b/site/packages/aa-core/smart-account-client/actions/getAddress.md index 0c6cc42cf5..e01fd7d807 100644 --- a/site/packages/aa-core/smart-account-client/actions/getAddress.md +++ b/site/packages/aa-core/smart-account-client/actions/getAddress.md @@ -26,7 +26,7 @@ import { smartAccountClient } from "./smartAccountClient"; const address = await smartAccountClient.getAddress(); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: diff --git a/site/packages/aa-core/smart-account-client/actions/getUserOperationByHash.md b/site/packages/aa-core/smart-account-client/actions/getUserOperationByHash.md index aae62a49a5..94ef75da5b 100644 --- a/site/packages/aa-core/smart-account-client/actions/getUserOperationByHash.md +++ b/site/packages/aa-core/smart-account-client/actions/getUserOperationByHash.md @@ -26,7 +26,7 @@ import { smartAccountClient } from "./smartAccountClient"; smartAccountClient.getUserOperationByHash({ hash: "0xUserOpResultHash" }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: diff --git a/site/packages/aa-core/smart-account-client/actions/getUserOperationReceipt.md b/site/packages/aa-core/smart-account-client/actions/getUserOperationReceipt.md index e9a92967eb..0a657301b9 100644 --- a/site/packages/aa-core/smart-account-client/actions/getUserOperationReceipt.md +++ b/site/packages/aa-core/smart-account-client/actions/getUserOperationReceipt.md @@ -26,7 +26,7 @@ import { smartAccountClient } from "./smartAccountClient"; smartAccountClient.getUserOperationReceipt({ hash: "0xUserOpResultHash" }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: diff --git a/site/packages/aa-core/smart-account-client/actions/request.md b/site/packages/aa-core/smart-account-client/actions/request.md index 25e34d65d0..038926e0b1 100644 --- a/site/packages/aa-core/smart-account-client/actions/request.md +++ b/site/packages/aa-core/smart-account-client/actions/request.md @@ -39,7 +39,7 @@ const result = await smartAccountClient.request({ }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: diff --git a/site/packages/aa-core/smart-account-client/actions/sendTransaction.md b/site/packages/aa-core/smart-account-client/actions/sendTransaction.md index 93eeb288cb..a8d79ea98c 100644 --- a/site/packages/aa-core/smart-account-client/actions/sendTransaction.md +++ b/site/packages/aa-core/smart-account-client/actions/sendTransaction.md @@ -38,7 +38,7 @@ const txHash = await smartAccountClient.sendTransaction({ }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: diff --git a/site/packages/aa-core/smart-account-client/actions/sendTransactions.md b/site/packages/aa-core/smart-account-client/actions/sendTransactions.md index 5fb9fce4db..323489e9e6 100644 --- a/site/packages/aa-core/smart-account-client/actions/sendTransactions.md +++ b/site/packages/aa-core/smart-account-client/actions/sendTransactions.md @@ -59,7 +59,7 @@ const txHash = await smartAccountClient.sendTransactions({requests: [ ]}); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: diff --git a/site/packages/aa-core/smart-account-client/actions/sendUserOperation.md b/site/packages/aa-core/smart-account-client/actions/sendUserOperation.md index 83b1873c9a..d687cb912c 100644 --- a/site/packages/aa-core/smart-account-client/actions/sendUserOperation.md +++ b/site/packages/aa-core/smart-account-client/actions/sendUserOperation.md @@ -56,7 +56,7 @@ smartAccountClient.sendUserOperation({ }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: ## Returns diff --git a/site/packages/aa-core/smart-account-client/actions/signMessage.md b/site/packages/aa-core/smart-account-client/actions/signMessage.md index 03b5cbd254..9835b481d8 100644 --- a/site/packages/aa-core/smart-account-client/actions/signMessage.md +++ b/site/packages/aa-core/smart-account-client/actions/signMessage.md @@ -26,7 +26,7 @@ import { smartAccountClient } from "./smartAccountClient"; const signedMessage = await smartAccountClient.signMessage({ message: "msg" }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: diff --git a/site/packages/aa-core/smart-account-client/actions/signMessageWith6492.md b/site/packages/aa-core/smart-account-client/actions/signMessageWith6492.md index 6566ac17e1..c71a100ae9 100644 --- a/site/packages/aa-core/smart-account-client/actions/signMessageWith6492.md +++ b/site/packages/aa-core/smart-account-client/actions/signMessageWith6492.md @@ -29,7 +29,7 @@ const signedMessageWith6492 = smartAccountClient.signMessageWith6492({ }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: diff --git a/site/packages/aa-core/smart-account-client/actions/signTypedData.md b/site/packages/aa-core/smart-account-client/actions/signTypedData.md index 0dea19254c..b7eca630d6 100644 --- a/site/packages/aa-core/smart-account-client/actions/signTypedData.md +++ b/site/packages/aa-core/smart-account-client/actions/signTypedData.md @@ -57,7 +57,7 @@ const signedTypedData = smartAccountClient.signTypedData({ }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: diff --git a/site/packages/aa-core/smart-account-client/actions/signTypedDataWith6492.md b/site/packages/aa-core/smart-account-client/actions/signTypedDataWith6492.md index 1c0f33dd56..a347f286ac 100644 --- a/site/packages/aa-core/smart-account-client/actions/signTypedDataWith6492.md +++ b/site/packages/aa-core/smart-account-client/actions/signTypedDataWith6492.md @@ -57,7 +57,7 @@ const signedTypedDataWith6492 = smartAccountClient.signTypedDataWith6492({ }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: diff --git a/site/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction.md b/site/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction.md index cfcc514b97..a925109526 100644 --- a/site/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction.md +++ b/site/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction.md @@ -39,7 +39,7 @@ const txHash = await smartAccountClient.waitForUserOperationTransaction({ }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: ## Returns diff --git a/site/packages/aa-core/smart-account-client/types/userOperationOverrides.md b/site/packages/aa-core/smart-account-client/types/userOperationOverrides.md index 8aa64a6cee..1678a7ce7e 100644 --- a/site/packages/aa-core/smart-account-client/types/userOperationOverrides.md +++ b/site/packages/aa-core/smart-account-client/types/userOperationOverrides.md @@ -86,6 +86,6 @@ const txHash = await provider.waitForUserOperationTransaction({ }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: diff --git a/site/packages/aa-ethers/account-signer/connect.md b/site/packages/aa-ethers/account-signer/connect.md index 9b2b855fc0..063cc28b7c 100644 --- a/site/packages/aa-ethers/account-signer/connect.md +++ b/site/packages/aa-ethers/account-signer/connect.md @@ -37,7 +37,7 @@ const newProvider = EthersProviderAdapter.fromEthersProvider(ethersProvider); const newSigner = signer.connect(newProvider); ``` -<<< @/snippets/ethers-signer.ts +<<< @/snippets/aa-ethers/ethers-signer.ts ::: ## Returns diff --git a/site/packages/aa-ethers/account-signer/getAddress.md b/site/packages/aa-ethers/account-signer/getAddress.md index 883e6917e8..bca69d2e41 100644 --- a/site/packages/aa-ethers/account-signer/getAddress.md +++ b/site/packages/aa-ethers/account-signer/getAddress.md @@ -27,7 +27,7 @@ import { signer } from "./ethers-signer"; const client = await signer.getAddress(); ``` -<<< @/snippets/ethers-signer.ts +<<< @/snippets/aa-ethers/ethers-signer.ts ::: ## Returns diff --git a/site/packages/aa-ethers/account-signer/getBundlerClient.md b/site/packages/aa-ethers/account-signer/getBundlerClient.md index 18b11c455e..417d2bba73 100644 --- a/site/packages/aa-ethers/account-signer/getBundlerClient.md +++ b/site/packages/aa-ethers/account-signer/getBundlerClient.md @@ -27,7 +27,7 @@ import { signer } from "./ethers-signer"; const client = signer.getBundlerClient(); ``` -<<< @/snippets/ethers-signer.ts +<<< @/snippets/aa-ethers/ethers-signer.ts ::: ## Returns diff --git a/site/packages/aa-ethers/account-signer/introduction.md b/site/packages/aa-ethers/account-signer/introduction.md index d257409303..31fb32b718 100644 --- a/site/packages/aa-ethers/account-signer/introduction.md +++ b/site/packages/aa-ethers/account-signer/introduction.md @@ -47,5 +47,5 @@ const txn = await signer.sendTransaction({ const client = signer.getBundlerClient(); ``` -<<< @/snippets/ethers-signer.ts +<<< @/snippets/aa-ethers/ethers-signer.ts ::: diff --git a/site/packages/aa-ethers/account-signer/sendTransaction.md b/site/packages/aa-ethers/account-signer/sendTransaction.md index 08162a6324..07262bbd98 100644 --- a/site/packages/aa-ethers/account-signer/sendTransaction.md +++ b/site/packages/aa-ethers/account-signer/sendTransaction.md @@ -36,7 +36,7 @@ const txHash = await signer.sendTransaction({ }); ``` -<<< @/snippets/ethers-signer.ts +<<< @/snippets/aa-ethers/ethers-signer.ts ::: ## Returns diff --git a/site/packages/aa-ethers/account-signer/signMessage.md b/site/packages/aa-ethers/account-signer/signMessage.md index 84d5be3818..33fca166e4 100644 --- a/site/packages/aa-ethers/account-signer/signMessage.md +++ b/site/packages/aa-ethers/account-signer/signMessage.md @@ -27,7 +27,7 @@ import { signer } from "./ethers-signer"; const signedMessage = await signer.signMessage("test"); ``` -<<< @/snippets/ethers-signer.ts +<<< @/snippets/aa-ethers/ethers-signer.ts ::: ## Returns diff --git a/site/packages/aa-ethers/index.md b/site/packages/aa-ethers/index.md index 317a430d06..3279635e5c 100644 --- a/site/packages/aa-ethers/index.md +++ b/site/packages/aa-ethers/index.md @@ -48,7 +48,7 @@ pnpm i @alchemy/aa-ethers You can create a provider and connect it to a Signer account like so: ::: code-group -<<< @/snippets/ethers-signer.ts -<<< @/snippets/ethers-provider.ts +<<< @/snippets/aa-ethers/ethers-signer.ts +<<< @/snippets/aa-ethers/ethers-provider.ts ::: diff --git a/site/packages/aa-ethers/provider-adapter/connectToAccount.md b/site/packages/aa-ethers/provider-adapter/connectToAccount.md index 415d78b61a..e856c32e88 100644 --- a/site/packages/aa-ethers/provider-adapter/connectToAccount.md +++ b/site/packages/aa-ethers/provider-adapter/connectToAccount.md @@ -20,8 +20,8 @@ head: ::: code-group -<<< @/snippets/ethers-signer.ts -<<< @/snippets/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/fromEthersProvider.md b/site/packages/aa-ethers/provider-adapter/fromEthersProvider.md index f4c5eb7d0c..30ad8953c5 100644 --- a/site/packages/aa-ethers/provider-adapter/fromEthersProvider.md +++ b/site/packages/aa-ethers/provider-adapter/fromEthersProvider.md @@ -22,7 +22,7 @@ next: ::: code-group -<<< @/snippets/ethers-provider.ts +<<< @/snippets/aa-ethers/ethers-provider.ts ::: ## Returns diff --git a/site/packages/aa-ethers/provider-adapter/getBundlerClient.md b/site/packages/aa-ethers/provider-adapter/getBundlerClient.md index aaccb59edc..93d0b1f8f2 100644 --- a/site/packages/aa-ethers/provider-adapter/getBundlerClient.md +++ b/site/packages/aa-ethers/provider-adapter/getBundlerClient.md @@ -27,7 +27,7 @@ import { provider } from "./ethers-provider"; const client = provider.getBundlerClient(); ``` -<<< @/snippets/ethers-provider.ts +<<< @/snippets/aa-ethers/ethers-provider.ts ::: ## Returns diff --git a/site/packages/aa-ethers/provider-adapter/introduction.md b/site/packages/aa-ethers/provider-adapter/introduction.md index 86e87f32c9..919995f40f 100644 --- a/site/packages/aa-ethers/provider-adapter/introduction.md +++ b/site/packages/aa-ethers/provider-adapter/introduction.md @@ -57,5 +57,5 @@ const signer = provider.connectToAccount( ); ``` -<<< @/snippets/ethers-provider.ts +<<< @/snippets/aa-ethers/ethers-provider.ts ::: diff --git a/site/packages/aa-ethers/provider-adapter/send.md b/site/packages/aa-ethers/provider-adapter/send.md index da695a6f62..193e3dfe0a 100644 --- a/site/packages/aa-ethers/provider-adapter/send.md +++ b/site/packages/aa-ethers/provider-adapter/send.md @@ -27,7 +27,7 @@ import { provider } from "./ethers-provider"; const chainId = await provider.send("eth_chainId", []); ``` -<<< @/snippets/ethers-provider.ts +<<< @/snippets/aa-ethers/ethers-provider.ts ::: ## Returns diff --git a/site/packages/aa-signers/arcana-auth/getAddress.md b/site/packages/aa-signers/arcana-auth/getAddress.md index 842a933aec..ea781f203d 100644 --- a/site/packages/aa-signers/arcana-auth/getAddress.md +++ b/site/packages/aa-signers/arcana-auth/getAddress.md @@ -30,7 +30,7 @@ const newArcanaAuthSigner = await createArcanaAuthSigner(); const address = await newArcanaAuthSigner.getAddress(); ``` -<<< @/snippets/arcana-auth.ts +<<< @/snippets/signers/arcana-auth.ts ::: ## Returns diff --git a/site/packages/aa-signers/arcana-auth/getAuthDetails.md b/site/packages/aa-signers/arcana-auth/getAuthDetails.md index 29bbc19e07..9a1888c1d8 100644 --- a/site/packages/aa-signers/arcana-auth/getAuthDetails.md +++ b/site/packages/aa-signers/arcana-auth/getAuthDetails.md @@ -30,7 +30,7 @@ const newArcanaAuthSigner = await createArcanaAuthSigner(); const details = await newArcanaAuthSigner.getAuthDetails(); ``` -<<< @/snippets/arcana-auth.ts +<<< @/snippets/signers/arcana-auth.ts ::: ## Returns diff --git a/site/packages/aa-signers/arcana-auth/introduction.md b/site/packages/aa-signers/arcana-auth/introduction.md index cb600f914f..3d43ae6199 100644 --- a/site/packages/aa-signers/arcana-auth/introduction.md +++ b/site/packages/aa-signers/arcana-auth/introduction.md @@ -81,7 +81,7 @@ const typedData = { const signTypedData = await newArcanaAuthSigner.signTypedData(typedData); ``` -<<< @/snippets/arcana-auth.ts +<<< @/snippets/signers/arcana-auth.ts ::: ## Developer Links diff --git a/site/packages/aa-signers/arcana-auth/signMessage.md b/site/packages/aa-signers/arcana-auth/signMessage.md index 932f2e638d..164e6f3d0f 100644 --- a/site/packages/aa-signers/arcana-auth/signMessage.md +++ b/site/packages/aa-signers/arcana-auth/signMessage.md @@ -32,7 +32,7 @@ const signedMessage = await newArcanaAuthSigner.signMessage( ); ``` -<<< @/snippets/arcana-auth.ts +<<< @/snippets/signers/arcana-auth.ts ::: ## Returns diff --git a/site/packages/aa-signers/arcana-auth/signTypedData.md b/site/packages/aa-signers/arcana-auth/signTypedData.md index 104790b96c..df1e588fb5 100644 --- a/site/packages/aa-signers/arcana-auth/signTypedData.md +++ b/site/packages/aa-signers/arcana-auth/signTypedData.md @@ -60,7 +60,7 @@ const signedTypedData = await newArcanaAuthSigner.signTypedData({ }); ``` -<<< @/snippets/arcana-auth.ts +<<< @/snippets/signers/arcana-auth.ts ::: ## Returns diff --git a/site/packages/aa-signers/capsule/getAddress.md b/site/packages/aa-signers/capsule/getAddress.md index d24af688d5..bb952374dc 100644 --- a/site/packages/aa-signers/capsule/getAddress.md +++ b/site/packages/aa-signers/capsule/getAddress.md @@ -30,7 +30,7 @@ const capsuleSigner = await createCapsuleSigner(); const address = await capsuleSigner.getAddress(); ``` -<<< @/snippets/capsule.ts +<<< @/snippets/signers/capsule.ts ::: ## Returns diff --git a/site/packages/aa-signers/capsule/getAuthDetails.md b/site/packages/aa-signers/capsule/getAuthDetails.md index 675de6bb07..066cd551ac 100644 --- a/site/packages/aa-signers/capsule/getAuthDetails.md +++ b/site/packages/aa-signers/capsule/getAuthDetails.md @@ -30,7 +30,7 @@ const capsuleSigner = await createCapsuleSigner(); const details = await capsuleSigner.getAuthDetails(); ``` -<<< @/snippets/capsule.ts +<<< @/snippets/signers/capsule.ts ::: ## Returns diff --git a/site/packages/aa-signers/capsule/introduction.md b/site/packages/aa-signers/capsule/introduction.md index 6f10717308..5e366bc656 100644 --- a/site/packages/aa-signers/capsule/introduction.md +++ b/site/packages/aa-signers/capsule/introduction.md @@ -65,7 +65,7 @@ const typedData = { const signTypedData = await capsuleSigner.signTypedData(typedData); ``` -<<< @/snippets/capsule.ts +<<< @/snippets/signers/capsule.ts ::: ## Developer Links diff --git a/site/packages/aa-signers/capsule/signMessage.md b/site/packages/aa-signers/capsule/signMessage.md index 201f9fa6e6..bf094a7bdd 100644 --- a/site/packages/aa-signers/capsule/signMessage.md +++ b/site/packages/aa-signers/capsule/signMessage.md @@ -30,7 +30,7 @@ const capsuleSigner = await createCapsuleSigner(); const signedMessage = await capsuleSigner.signMessage("test"); ``` -<<< @/snippets/capsule.ts +<<< @/snippets/signers/capsule.ts ::: ## Returns diff --git a/site/packages/aa-signers/capsule/signTypedData.md b/site/packages/aa-signers/capsule/signTypedData.md index 6bf02fdb1a..704e50b63a 100644 --- a/site/packages/aa-signers/capsule/signTypedData.md +++ b/site/packages/aa-signers/capsule/signTypedData.md @@ -60,7 +60,7 @@ const signedTypedData = await capsuleSigner.signTypedData({ }); ``` -<<< @/snippets/capsule.ts +<<< @/snippets/signers/capsule.ts ::: ## Returns diff --git a/site/packages/aa-signers/fireblocks/getAddress.md b/site/packages/aa-signers/fireblocks/getAddress.md index eadeaf58ca..04d466554f 100644 --- a/site/packages/aa-signers/fireblocks/getAddress.md +++ b/site/packages/aa-signers/fireblocks/getAddress.md @@ -30,7 +30,7 @@ const fireblocksSigner = await createFireblocksSigner(); const address = await fireblocksSigner.getAddress(); ``` -<<< @/snippets/fireblocks.ts +<<< @/snippets/signers/fireblocks.ts ::: ## Returns diff --git a/site/packages/aa-signers/fireblocks/getAuthDetails.md b/site/packages/aa-signers/fireblocks/getAuthDetails.md index 836baedef6..df089c5a11 100644 --- a/site/packages/aa-signers/fireblocks/getAuthDetails.md +++ b/site/packages/aa-signers/fireblocks/getAuthDetails.md @@ -30,7 +30,7 @@ const fireblocksSigner = await createFireblocksSigner(); const details = await fireblocksSigner.getAuthDetails(); ``` -<<< @/snippets/fireblocks.ts +<<< @/snippets/signers/fireblocks.ts ::: ## Returns diff --git a/site/packages/aa-signers/fireblocks/introduction.md b/site/packages/aa-signers/fireblocks/introduction.md index b31716d25b..9029718aa4 100644 --- a/site/packages/aa-signers/fireblocks/introduction.md +++ b/site/packages/aa-signers/fireblocks/introduction.md @@ -65,7 +65,7 @@ const typedData = { const signTypedData = await fireblocksSigner.signTypedData(typedData); ``` -<<< @/snippets/fireblocks.ts +<<< @/snippets/signers/fireblocks.ts ::: ## Developer Links diff --git a/site/packages/aa-signers/fireblocks/signMessage.md b/site/packages/aa-signers/fireblocks/signMessage.md index 546fb74912..ca2161b4eb 100644 --- a/site/packages/aa-signers/fireblocks/signMessage.md +++ b/site/packages/aa-signers/fireblocks/signMessage.md @@ -30,7 +30,7 @@ const fireblocksSigner = await createFireblocksSigner(); const signedMessage = await fireblocksSigner.signMessage("test"); ``` -<<< @/snippets/fireblocks.ts +<<< @/snippets/signers/fireblocks.ts ::: ## Returns diff --git a/site/packages/aa-signers/fireblocks/signTypedData.md b/site/packages/aa-signers/fireblocks/signTypedData.md index 23343a25f8..0fbb9eeba1 100644 --- a/site/packages/aa-signers/fireblocks/signTypedData.md +++ b/site/packages/aa-signers/fireblocks/signTypedData.md @@ -60,7 +60,7 @@ const signedTypedData = await fireblocksSigner.signTypedData({ }); ``` -<<< @/snippets/fireblocks.ts +<<< @/snippets/signers/fireblocks.ts ::: ## Returns diff --git a/site/packages/aa-signers/lit-protocol/getAddress.md b/site/packages/aa-signers/lit-protocol/getAddress.md index cbfe1e0545..649898ade8 100644 --- a/site/packages/aa-signers/lit-protocol/getAddress.md +++ b/site/packages/aa-signers/lit-protocol/getAddress.md @@ -31,7 +31,7 @@ const litSigner = new createLitSignerWithAuthMethod(); const address = await litSigner.getAddress(); ``` -<<< @/snippets/lit.ts +<<< @/snippets/signers/lit.ts ::: ## Returns diff --git a/site/packages/aa-signers/lit-protocol/getAuthDetails.md b/site/packages/aa-signers/lit-protocol/getAuthDetails.md index 637c20c18f..92e3fe511a 100644 --- a/site/packages/aa-signers/lit-protocol/getAuthDetails.md +++ b/site/packages/aa-signers/lit-protocol/getAuthDetails.md @@ -36,7 +36,7 @@ await litSigner.authenticate({ let authDetails = await litSigner.getAuthDetails(); ``` -<<< @/snippets/lit.ts +<<< @/snippets/signers/lit.ts ::: ## Returns diff --git a/site/packages/aa-signers/lit-protocol/signMessage.md b/site/packages/aa-signers/lit-protocol/signMessage.md index 3db11056d6..f448dbe235 100644 --- a/site/packages/aa-signers/lit-protocol/signMessage.md +++ b/site/packages/aa-signers/lit-protocol/signMessage.md @@ -31,7 +31,7 @@ const litSigner = new createLitSignerWithAuthMethod(); const signedMessage = await litSigner.signMessage("Hello World!"); ``` -<<< @/snippets/lit.ts +<<< @/snippets/signers/lit.ts ::: ## Returns diff --git a/site/packages/aa-signers/lit-protocol/signTypedData.md b/site/packages/aa-signers/lit-protocol/signTypedData.md index 89b279e661..c2b638b7dc 100644 --- a/site/packages/aa-signers/lit-protocol/signTypedData.md +++ b/site/packages/aa-signers/lit-protocol/signTypedData.md @@ -61,7 +61,7 @@ const signedTypedData = await litSigner.signTypedData({ }); ``` -<<< @/snippets/lit.ts +<<< @/snippets/signers/lit.ts ::: ## Returns diff --git a/site/packages/aa-signers/magic/getAddress.md b/site/packages/aa-signers/magic/getAddress.md index cbe2d1f984..3c3fdb4910 100644 --- a/site/packages/aa-signers/magic/getAddress.md +++ b/site/packages/aa-signers/magic/getAddress.md @@ -30,7 +30,7 @@ const magicSigner = await createMagicSigner(); const address = await magicSigner.getAddress(); ``` -<<< @/snippets/magic.ts +<<< @/snippets/signers/magic.ts ::: ## Returns diff --git a/site/packages/aa-signers/magic/getAuthDetails.md b/site/packages/aa-signers/magic/getAuthDetails.md index ccdeac94f3..658c007a30 100644 --- a/site/packages/aa-signers/magic/getAuthDetails.md +++ b/site/packages/aa-signers/magic/getAuthDetails.md @@ -32,7 +32,7 @@ const magicSigner = await createMagicSigner(); const details = await magicSigner.getAuthDetails(); ``` -<<< @/snippets/magic.ts +<<< @/snippets/signers/magic.ts ::: ## Returns diff --git a/site/packages/aa-signers/magic/introduction.md b/site/packages/aa-signers/magic/introduction.md index ac2381a63b..fd502656d4 100644 --- a/site/packages/aa-signers/magic/introduction.md +++ b/site/packages/aa-signers/magic/introduction.md @@ -72,7 +72,7 @@ const typedData = { const signTypedData = await signer.signTypedData(typedData); ``` -<<< @/snippets/magic.ts +<<< @/snippets/signers/magic.ts ::: ## Developer Links diff --git a/site/packages/aa-signers/magic/signMessage.md b/site/packages/aa-signers/magic/signMessage.md index 5da186a7ba..c37e2d21a1 100644 --- a/site/packages/aa-signers/magic/signMessage.md +++ b/site/packages/aa-signers/magic/signMessage.md @@ -30,7 +30,7 @@ const magicSigner = await createMagicSigner(); const signedMessage = await magicSigner.signMessage("test"); ``` -<<< @/snippets/magic.ts +<<< @/snippets/signers/magic.ts ::: ## Returns diff --git a/site/packages/aa-signers/magic/signTypedData.md b/site/packages/aa-signers/magic/signTypedData.md index 768ddaea0e..f478a709e4 100644 --- a/site/packages/aa-signers/magic/signTypedData.md +++ b/site/packages/aa-signers/magic/signTypedData.md @@ -60,7 +60,7 @@ const signedTypedData = await magicSigner.signTypedData({ }); ``` -<<< @/snippets/magic.ts +<<< @/snippets/signers/magic.ts ::: ## Returns diff --git a/site/packages/aa-signers/particle/getAddress.md b/site/packages/aa-signers/particle/getAddress.md index 77a295814a..a0301f293b 100644 --- a/site/packages/aa-signers/particle/getAddress.md +++ b/site/packages/aa-signers/particle/getAddress.md @@ -30,7 +30,7 @@ const particleSigner = await createParticleSigner(); const address = await particleSigner.getAddress(); ``` -<<< @/snippets/particle.ts +<<< @/snippets/signers/particle.ts ::: ## Returns diff --git a/site/packages/aa-signers/particle/getAuthDetails.md b/site/packages/aa-signers/particle/getAuthDetails.md index b3ea388949..b6faf7a9c1 100644 --- a/site/packages/aa-signers/particle/getAuthDetails.md +++ b/site/packages/aa-signers/particle/getAuthDetails.md @@ -30,7 +30,7 @@ const particleSigner = await createParticleSigner(); const details = await particleSigner.getAuthDetails(); ``` -<<< @/snippets/particle.ts +<<< @/snippets/signers/particle.ts ::: ## Returns diff --git a/site/packages/aa-signers/particle/introduction.md b/site/packages/aa-signers/particle/introduction.md index 7fe3b99298..a829551ebe 100644 --- a/site/packages/aa-signers/particle/introduction.md +++ b/site/packages/aa-signers/particle/introduction.md @@ -67,7 +67,7 @@ const typedData = { const signTypedData = await particleSigner.signTypedData(typedData); ``` -<<< @/snippets/particle.ts +<<< @/snippets/signers/particle.ts ::: ## Developer Links diff --git a/site/packages/aa-signers/particle/signMessage.md b/site/packages/aa-signers/particle/signMessage.md index a3447dd9cb..2c80113e6c 100644 --- a/site/packages/aa-signers/particle/signMessage.md +++ b/site/packages/aa-signers/particle/signMessage.md @@ -30,7 +30,7 @@ const particleSigner = await createParticleSigner(); const signedMessage = await particleSigner.signMessage("test"); ``` -<<< @/snippets/particle.ts +<<< @/snippets/signers/particle.ts ::: ## Returns diff --git a/site/packages/aa-signers/particle/signTypedData.md b/site/packages/aa-signers/particle/signTypedData.md index 6d5234358e..3e22d04c23 100644 --- a/site/packages/aa-signers/particle/signTypedData.md +++ b/site/packages/aa-signers/particle/signTypedData.md @@ -60,7 +60,7 @@ const signedTypedData = await particleSigner.signTypedData({ }); ``` -<<< @/snippets/particle.ts +<<< @/snippets/signers/particle.ts ::: ## Returns diff --git a/site/packages/aa-signers/portal/getAddress.md b/site/packages/aa-signers/portal/getAddress.md index 4d8766ab3c..13df1e8266 100644 --- a/site/packages/aa-signers/portal/getAddress.md +++ b/site/packages/aa-signers/portal/getAddress.md @@ -30,7 +30,7 @@ const portalSigner = await createPortalSigner(); const address = await portalSigner.getAddress(); ``` -<<< @/snippets/portal.ts +<<< @/snippets/signers/portal.ts ::: ## Returns diff --git a/site/packages/aa-signers/portal/getAuthDetails.md b/site/packages/aa-signers/portal/getAuthDetails.md index c665e16bc5..f29b69b98b 100644 --- a/site/packages/aa-signers/portal/getAuthDetails.md +++ b/site/packages/aa-signers/portal/getAuthDetails.md @@ -30,7 +30,7 @@ const portalSigner = await createPortalSigner(); const details = await portalSigner.getAuthDetails(); ``` -<<< @/snippets/portal.ts +<<< @/snippets/signers/portal.ts ::: ## Returns diff --git a/site/packages/aa-signers/portal/introduction.md b/site/packages/aa-signers/portal/introduction.md index 6cc8a7863b..3c923ba35a 100644 --- a/site/packages/aa-signers/portal/introduction.md +++ b/site/packages/aa-signers/portal/introduction.md @@ -65,7 +65,7 @@ const typedData = { const signTypedData = await portalSigner.signTypedData(typedData); ``` -<<< @/snippets/portal.ts +<<< @/snippets/signers/portal.ts ::: ## Developer Links diff --git a/site/packages/aa-signers/portal/signMessage.md b/site/packages/aa-signers/portal/signMessage.md index a5c9d05678..0b863c3e7c 100644 --- a/site/packages/aa-signers/portal/signMessage.md +++ b/site/packages/aa-signers/portal/signMessage.md @@ -30,7 +30,7 @@ const portalSigner = await createPortalSigner(); const signedMessage = await portalSigner.signMessage("test"); ``` -<<< @/snippets/portal.ts +<<< @/snippets/signers/portal.ts ::: ## Returns diff --git a/site/packages/aa-signers/portal/signTypedData.md b/site/packages/aa-signers/portal/signTypedData.md index 1a6aefea19..4cd8e3e19c 100644 --- a/site/packages/aa-signers/portal/signTypedData.md +++ b/site/packages/aa-signers/portal/signTypedData.md @@ -60,7 +60,7 @@ const signedTypedData = await portalSigner.signTypedData({ }); ``` -<<< @/snippets/portal.ts +<<< @/snippets/signers/portal.ts ::: ## Returns diff --git a/site/packages/aa-signers/turnkey/getAddress.md b/site/packages/aa-signers/turnkey/getAddress.md index 30aac8b9b4..011ed31fb0 100644 --- a/site/packages/aa-signers/turnkey/getAddress.md +++ b/site/packages/aa-signers/turnkey/getAddress.md @@ -30,7 +30,7 @@ const turnkeySigner = await createTurnkeySigner(); const address = await turnkeySigner.getAddress(); ``` -<<< @/snippets/turnkey.ts +<<< @/snippets/signers/turnkey.ts ::: ## Returns diff --git a/site/packages/aa-signers/turnkey/getAuthDetails.md b/site/packages/aa-signers/turnkey/getAuthDetails.md index 2b212fc971..a0ae463719 100644 --- a/site/packages/aa-signers/turnkey/getAuthDetails.md +++ b/site/packages/aa-signers/turnkey/getAuthDetails.md @@ -30,7 +30,7 @@ const turnkeySigner = await createTurnkeySigner(); const details = await turnkeySigner.getAuthDetails(); ``` -<<< @/snippets/turnkey.ts +<<< @/snippets/signers/turnkey.ts ::: ## Returns diff --git a/site/packages/aa-signers/turnkey/introduction.md b/site/packages/aa-signers/turnkey/introduction.md index aaf3c2b13e..0a9b5c3cb5 100644 --- a/site/packages/aa-signers/turnkey/introduction.md +++ b/site/packages/aa-signers/turnkey/introduction.md @@ -90,7 +90,7 @@ const typedData = { const signTypedData = await turnkeySigner.signTypedData(typedData); ``` -<<< @/snippets/turnkey.ts +<<< @/snippets/signers/turnkey.ts ::: ## Developer Links diff --git a/site/packages/aa-signers/turnkey/signMessage.md b/site/packages/aa-signers/turnkey/signMessage.md index edf87ef34b..6b969eecba 100644 --- a/site/packages/aa-signers/turnkey/signMessage.md +++ b/site/packages/aa-signers/turnkey/signMessage.md @@ -30,7 +30,7 @@ const turnkeySigner = await createTurnkeySigner(); const signedMessage = await turnkeySigner.signMessage("test"); ``` -<<< @/snippets/turnkey.ts +<<< @/snippets/signers/turnkey.ts ::: ## Returns diff --git a/site/packages/aa-signers/turnkey/signTypedData.md b/site/packages/aa-signers/turnkey/signTypedData.md index 422ba6e441..e0ffb4c84c 100644 --- a/site/packages/aa-signers/turnkey/signTypedData.md +++ b/site/packages/aa-signers/turnkey/signTypedData.md @@ -60,7 +60,7 @@ const signedTypedData = await turnkeySigner.signTypedData({ }); ``` -<<< @/snippets/turnkey.ts +<<< @/snippets/signers/turnkey.ts ::: ## Returns diff --git a/site/packages/aa-signers/web3auth/getAddress.md b/site/packages/aa-signers/web3auth/getAddress.md index af93226f97..c99601ddc8 100644 --- a/site/packages/aa-signers/web3auth/getAddress.md +++ b/site/packages/aa-signers/web3auth/getAddress.md @@ -30,7 +30,7 @@ const web3AuthSigner = await createWeb3AuthSigner(); const address = await web3AuthSigner.getAddress(); ``` -<<< @/snippets/web3auth.ts +<<< @/snippets/signers/web3auth.ts ::: ## Returns diff --git a/site/packages/aa-signers/web3auth/getAuthDetails.md b/site/packages/aa-signers/web3auth/getAuthDetails.md index 471057a1a8..5290e3b5f9 100644 --- a/site/packages/aa-signers/web3auth/getAuthDetails.md +++ b/site/packages/aa-signers/web3auth/getAuthDetails.md @@ -30,7 +30,7 @@ const web3AuthSigner = await createWeb3AuthSigner(); const details = await web3AuthSigner.getAuthDetails(); ``` -<<< @/snippets/web3auth.ts +<<< @/snippets/signers/web3auth.ts ::: ## Returns diff --git a/site/packages/aa-signers/web3auth/introduction.md b/site/packages/aa-signers/web3auth/introduction.md index cea4fe406f..8e6a6899e3 100644 --- a/site/packages/aa-signers/web3auth/introduction.md +++ b/site/packages/aa-signers/web3auth/introduction.md @@ -67,7 +67,7 @@ const typedData = { const signTypedData = await web3AuthSigner.signTypedData(typedData); ``` -<<< @/snippets/web3auth.ts +<<< @/snippets/signers/web3auth.ts ::: ## Developer Links diff --git a/site/packages/aa-signers/web3auth/signMessage.md b/site/packages/aa-signers/web3auth/signMessage.md index a5642d11f0..d8f3dd5a14 100644 --- a/site/packages/aa-signers/web3auth/signMessage.md +++ b/site/packages/aa-signers/web3auth/signMessage.md @@ -30,7 +30,7 @@ const web3AuthSigner = await createWeb3AuthSigner(); const signedMessage = await web3AuthSigner.signMessage("test"); ``` -<<< @/snippets/web3auth.ts +<<< @/snippets/signers/web3auth.ts ::: ## Returns diff --git a/site/packages/aa-signers/web3auth/signTypedData.md b/site/packages/aa-signers/web3auth/signTypedData.md index 5bc625f9e2..6429e92930 100644 --- a/site/packages/aa-signers/web3auth/signTypedData.md +++ b/site/packages/aa-signers/web3auth/signTypedData.md @@ -60,7 +60,7 @@ const signedTypedData = await web3AuthSigner.signTypedData({ }); ``` -<<< @/snippets/web3auth.ts +<<< @/snippets/signers/web3auth.ts ::: ## Returns diff --git a/site/smart-accounts/accounts/guides/light-account.md b/site/smart-accounts/accounts/guides/light-account.md index 2abe50b9cc..5f8655b79f 100644 --- a/site/smart-accounts/accounts/guides/light-account.md +++ b/site/smart-accounts/accounts/guides/light-account.md @@ -54,7 +54,7 @@ We're pioneering the future of modular smart accounts with [EIP-6900](https://ww The code snippet below demonstrates how to use Light Account with Account Kit. It creates a Light Account and sends a `UserOperation` from it: -<<< @/snippets/light-account.ts +<<< @/snippets/aa-alchemy/light-account.ts ## Developer Links diff --git a/site/smart-accounts/signers/guides/arcana-auth.md b/site/smart-accounts/signers/guides/arcana-auth.md index 010f916973..753b9a496a 100644 --- a/site/smart-accounts/signers/guides/arcana-auth.md +++ b/site/smart-accounts/signers/guides/arcana-auth.md @@ -48,7 +48,7 @@ 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/arcana-auth.ts +<<< @/snippets/signers/arcana-auth.ts ### Use it with LightAccount @@ -84,6 +84,6 @@ export async function getProvider() { } ``` -<<< @/snippets/arcana-auth.ts +<<< @/snippets/signers/arcana-auth.ts ::: diff --git a/site/smart-accounts/signers/guides/capsule.md b/site/smart-accounts/signers/guides/capsule.md index 0b34b3ae39..b9b6d1fcce 100644 --- a/site/smart-accounts/signers/guides/capsule.md +++ b/site/smart-accounts/signers/guides/capsule.md @@ -69,7 +69,7 @@ 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/capsule.ts +<<< @/snippets/signers/capsule.ts ### Use it with Light Account @@ -101,6 +101,6 @@ const provider = new AlchemyProvider({ ); ``` -<<< @/snippets/capsule.ts +<<< @/snippets/signers/capsule.ts ::: diff --git a/site/smart-accounts/signers/guides/custom-signer.md b/site/smart-accounts/signers/guides/custom-signer.md index 1fe3ff2dc2..c10bf55fa8 100644 --- a/site/smart-accounts/signers/guides/custom-signer.md +++ b/site/smart-accounts/signers/guides/custom-signer.md @@ -41,4 +41,4 @@ Viem allows you to create a `WalletClient`, which can be used to wrap local or J We support a `SmartAccountSigner` implementation called `WalletClientSigner` that makes it really easy to use a viem `WalletClient` as an owner on your Smart Contract Account. If your Signer is [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193) compliant, it's really easy to use with `WalletClient`. Let's take a look at a simple example: -<<< @/snippets/wallet-client-signer.ts +<<< @/snippets/signers/wallet-client-signer.ts diff --git a/site/smart-accounts/signers/guides/dfns.md b/site/smart-accounts/signers/guides/dfns.md index 3d89d27155..46f412e96f 100644 --- a/site/smart-accounts/signers/guides/dfns.md +++ b/site/smart-accounts/signers/guides/dfns.md @@ -38,7 +38,7 @@ yarn add @dfns/lib-viem @dfns/sdk @dfns/sdk-keysigner Setup the Dfns Web3 Provider and wrap it in an `AlchemyProvider`. -<<< @/snippets/dfns.ts +<<< @/snippets/signers/dfns.ts ### Use it with Light Account @@ -74,6 +74,6 @@ const createAlchemyProvider = async (): Promise => { }; ``` -<<< @/snippets/dfns.ts +<<< @/snippets/signers/dfns.ts ::: diff --git a/site/smart-accounts/signers/guides/dynamic.md b/site/smart-accounts/signers/guides/dynamic.md index 7d2eca3950..6e5ec49371 100644 --- a/site/smart-accounts/signers/guides/dynamic.md +++ b/site/smart-accounts/signers/guides/dynamic.md @@ -74,7 +74,7 @@ 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/dynamic.ts +<<< @/snippets/signers/dynamic.ts ### Use it with Light Account @@ -106,6 +106,6 @@ const provider = new AlchemyProvider({ ); ``` -<<< @/snippets/dynamic.ts +<<< @/snippets/signers/dynamic.ts ::: diff --git a/site/smart-accounts/signers/guides/fireblocks.md b/site/smart-accounts/signers/guides/fireblocks.md index 64afc63020..31bbcffa80 100644 --- a/site/smart-accounts/signers/guides/fireblocks.md +++ b/site/smart-accounts/signers/guides/fireblocks.md @@ -50,7 +50,7 @@ Due to how Fireblocks parses a private key [in their SDK](https://github.com/fir Next, setup the Fireblocks SDK and create an authenticated `FireblocksSigner` using the `aa-signers` package: -<<< @/snippets/fireblocks.ts +<<< @/snippets/signers/fireblocks.ts ### Use it with Light Account @@ -81,6 +81,6 @@ const provider = new AlchemyProvider({ ); ``` -<<< @/snippets/fireblocks.ts +<<< @/snippets/signers/fireblocks.ts ::: diff --git a/site/smart-accounts/signers/guides/lit.md b/site/smart-accounts/signers/guides/lit.md index 9fcd148413..292a6c2b38 100644 --- a/site/smart-accounts/signers/guides/lit.md +++ b/site/smart-accounts/signers/guides/lit.md @@ -71,7 +71,7 @@ See documentation [here](https://developer.litprotocol.com/v3/sdk/wallets/mintin ### Create A LitSigner -<<< @/snippets/lit.ts +<<< @/snippets/signers/lit.ts ### Use it with Light Account diff --git a/site/smart-accounts/signers/guides/magic.md b/site/smart-accounts/signers/guides/magic.md index 9c0dca7ee0..f24a5ef961 100644 --- a/site/smart-accounts/signers/guides/magic.md +++ b/site/smart-accounts/signers/guides/magic.md @@ -48,7 +48,7 @@ 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/magic.ts +<<< @/snippets/signers/magic.ts ### Use it with Light Account @@ -83,6 +83,6 @@ const provider = new AlchemyProvider({ ); ``` -<<< @/snippets/magic.ts +<<< @/snippets/signers/magic.ts ::: diff --git a/site/smart-accounts/signers/guides/particle-network.md b/site/smart-accounts/signers/guides/particle-network.md index 24012c6a12..c30f74653d 100644 --- a/site/smart-accounts/signers/guides/particle-network.md +++ b/site/smart-accounts/signers/guides/particle-network.md @@ -48,7 +48,7 @@ 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/particle.ts +<<< @/snippets/signers/particle.ts ### Use it with Light Account @@ -82,7 +82,7 @@ const provider = new AlchemyProvider({ ); ``` -<<< @/snippets/particle.ts +<<< @/snippets/signers/particle.ts ::: diff --git a/site/smart-accounts/signers/guides/portal.md b/site/smart-accounts/signers/guides/portal.md index 5bcf6d8e73..5bdcfcc562 100644 --- a/site/smart-accounts/signers/guides/portal.md +++ b/site/smart-accounts/signers/guides/portal.md @@ -48,7 +48,7 @@ yarn add @portal-hq/web Next, setup the Portal SDK and create an authenticated `PortalSigner` using the `aa-signers` package: -<<< @/snippets/portal.ts +<<< @/snippets/signers/portal.ts ### Use it with Light Account @@ -79,6 +79,6 @@ const provider = new AlchemyProvider({ ); ``` -<<< @/snippets/portal.ts +<<< @/snippets/signers/portal.ts ::: diff --git a/site/smart-accounts/signers/guides/privy.md b/site/smart-accounts/signers/guides/privy.md index ddefe58e58..b19a32bff2 100644 --- a/site/smart-accounts/signers/guides/privy.md +++ b/site/smart-accounts/signers/guides/privy.md @@ -62,4 +62,4 @@ First, set up your React app with Privy following the [Privy Quickstart](https:/ Then, when a user logs in to your app, Privy will create an embedded wallet for them. You can use this embedded wallet to create a `LightSmartContractAccount` from `aa-accounts`: -<<< @/snippets/privy.ts +<<< @/snippets/signers/privy.ts diff --git a/site/smart-accounts/signers/guides/turnkey.md b/site/smart-accounts/signers/guides/turnkey.md index 721ccfb5d7..e8ce9e9c86 100644 --- a/site/smart-accounts/signers/guides/turnkey.md +++ b/site/smart-accounts/signers/guides/turnkey.md @@ -54,7 +54,7 @@ yarn add @turnkey/viem Next, setup the Turnkey SDK and create an authenticated `TurnkeySigner` using the `aa-signers` package: -<<< @/snippets/turnkey.ts +<<< @/snippets/signers/turnkey.ts ### Use it with Light Account @@ -87,6 +87,6 @@ const provider = new AlchemyProvider({ ); ``` -<<< @/snippets/turnkey.ts +<<< @/snippets/signers/turnkey.ts ::: diff --git a/site/smart-accounts/signers/guides/web3auth.md b/site/smart-accounts/signers/guides/web3auth.md index 74ad36a864..34ae8e9b8f 100644 --- a/site/smart-accounts/signers/guides/web3auth.md +++ b/site/smart-accounts/signers/guides/web3auth.md @@ -48,7 +48,7 @@ yarn add @web3auth/base Next, setup the web3auth sdk and create a `SmartAccountSigner` using the `aa-signers` package: -<<< @/snippets/web3auth.ts +<<< @/snippets/signers/web3auth.ts ### Use it with Light Account @@ -80,6 +80,6 @@ const provider = new AlchemyProvider({ ); ``` -<<< @/snippets/web3auth.ts +<<< @/snippets/signers/web3auth.ts ::: diff --git a/site/snippets/alchemy-smartAccountClient.ts b/site/snippets/aa-alchemy/base-client.ts similarity index 72% rename from site/snippets/alchemy-smartAccountClient.ts rename to site/snippets/aa-alchemy/base-client.ts index 25846a1a97..f873b657d7 100644 --- a/site/snippets/alchemy-smartAccountClient.ts +++ b/site/snippets/aa-alchemy/base-client.ts @@ -3,7 +3,7 @@ import { polygonMumbai } from "@alchemy/aa-core"; const chain = polygonMumbai; -export const provider = createAlchemySmartAccountClient({ +export const smartAccountClient = createAlchemySmartAccountClient({ apiKey: "demo", chain, }); diff --git a/site/snippets/aa-alchemy/connected-client.ts b/site/snippets/aa-alchemy/connected-client.ts new file mode 100644 index 0000000000..6417742cc5 --- /dev/null +++ b/site/snippets/aa-alchemy/connected-client.ts @@ -0,0 +1,8 @@ +import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; +import { LocalAccountSigner, sepolia } from "@alchemy/aa-core"; + +export const smartAccountClient = await createModularAccountAlchemyClient({ + apiKey: "YOUR_API_KEY", + chain: sepolia, + owner: LocalAccountSigner.mnemonicToAccountSigner("OWNER_MNEMONIC"), +}); diff --git a/site/snippets/light-account-alchemy-client.ts b/site/snippets/aa-alchemy/light-account-client.ts similarity index 100% rename from site/snippets/light-account-alchemy-client.ts rename to site/snippets/aa-alchemy/light-account-client.ts diff --git a/site/snippets/light-account.ts b/site/snippets/aa-alchemy/light-account.ts similarity index 54% rename from site/snippets/light-account.ts rename to site/snippets/aa-alchemy/light-account.ts index f84e288074..d2bf602018 100644 --- a/site/snippets/light-account.ts +++ b/site/snippets/aa-alchemy/light-account.ts @@ -1,8 +1,4 @@ -import { - LightSmartContractAccount, - getDefaultLightAccountFactoryAddress, -} from "@alchemy/aa-accounts"; -import { AlchemyProvider } from "@alchemy/aa-alchemy"; +import { createLightAccountAlchemyClient } from "@alchemy/aa-alchemy"; import { LocalAccountSigner, sepolia, type Hex } from "@alchemy/aa-core"; const chain = sepolia; @@ -12,34 +8,29 @@ const PRIVATE_KEY = "0xYourEOAPrivateKey" as Hex; const owner = LocalAccountSigner.privateKeyToAccountSigner(PRIVATE_KEY); // Create a provider to send user operations from your smart account -const provider = new AlchemyProvider({ +const provider = await createLightAccountAlchemyClient({ // get your Alchemy API key at https://dashboard.alchemy.com apiKey: "ALCHEMY_API_KEY", chain, -}).connect( - (rpcClient) => - new LightSmartContractAccount({ - rpcClient, - owner, - chain, - factoryAddress: getDefaultLightAccountFactoryAddress(chain), - }) -); + owner, +}); // Fund your account address with ETH to send for the user operations // (e.g. Get Sepolia ETH at https://sepoliafaucet.com) -console.log(await provider.getAddress()); // Log the smart account address +console.log(provider.getAddress()); // Log the smart account address // Send a user operation from your smart account const { hash: uoHash } = await provider.sendUserOperation({ - target: "0xTargetAddress", // The desired target contract address - data: "0xCallData", // The desired call data - value: 0n, // (Optional) value to send the target contract address + uo: { + target: "0xTargetAddress", // The desired target contract address + data: "0xCallData", // The desired call data + value: 0n, // (Optional) value to send the target contract address + }, }); console.log(uoHash); // Log the user operation hash // Wait for the user operation to be mined -const txHash = await provider.waitForUserOperationTransaction(uoHash); +const txHash = await provider.waitForUserOperationTransaction({ hash: uoHash }); console.log(txHash); // Log the transaction hash diff --git a/site/snippets/bundlerClient.ts b/site/snippets/aa-core/bundlerClient.ts similarity index 100% rename from site/snippets/bundlerClient.ts rename to site/snippets/aa-core/bundlerClient.ts diff --git a/site/snippets/core-provider.ts b/site/snippets/aa-core/smartAccountClient.ts similarity index 100% rename from site/snippets/core-provider.ts rename to site/snippets/aa-core/smartAccountClient.ts diff --git a/site/snippets/ethers-provider.ts b/site/snippets/aa-ethers/ethers-provider.ts similarity index 100% rename from site/snippets/ethers-provider.ts rename to site/snippets/aa-ethers/ethers-provider.ts diff --git a/site/snippets/ethers-signer.ts b/site/snippets/aa-ethers/ethers-signer.ts similarity index 100% rename from site/snippets/ethers-signer.ts rename to site/snippets/aa-ethers/ethers-signer.ts diff --git a/site/snippets/account-alchemy.ts b/site/snippets/account-alchemy.ts deleted file mode 100644 index eac7c3b8a6..0000000000 --- a/site/snippets/account-alchemy.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* via `aa-alchemy` */ - -import { AlchemyProvider } from "@alchemy/aa-alchemy"; -import { - LocalAccountSigner, - SimpleSmartContractAccount, - getDefaultEntryPointAddress, - getDefaultSimpleAccountFactoryAddress, - polygonMumbai, - type SmartAccountSigner, -} from "@alchemy/aa-core"; - -const chain = polygonMumbai; - -// 1. define the EOA owner of the smart account -// this uses a utility method for creating an account signer using mnemonic -// we also have a utility for creating an account signer from a private key -const owner: SmartAccountSigner = - LocalAccountSigner.mnemonicToAccountSigner(MNEMONIC); - -// 2. initialize the provider and connect it to the account -let provider = new AlchemyProvider({ - apiKey: API_KEY, - chain, -}).connect( - (rpcClient) => - new SimpleSmartContractAccount({ - entryPointAddress: getDefaultEntryPointAddress(chain), - chain, // ether a viem Chain or chainId that supports account abstraction at Alchemy - owner, - factoryAddress: getDefaultSimpleAccountFactoryAddress(chain), - rpcClient, - }) -); - -// [OPTIONAL] Use Alchemy Gas Manager -provider.withAlchemyGasManager({ - policyId: PAYMASTER_POLICY_ID, -}); - -// 3. send a UserOperation -// eslint-disable-next-line @typescript-eslint/no-unused-vars -const { hash } = await provider.sendUserOperation({ - target: "0xTargetAddress", - data: "0xcallData", - value: 0n, // value: bigint or undefined -}); diff --git a/site/snippets/account-core.ts b/site/snippets/account-core.ts deleted file mode 100644 index deb604c833..0000000000 --- a/site/snippets/account-core.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* via `aa-core`*/ - -import { - LocalAccountSigner, - SimpleSmartContractAccount, - SmartAccountProvider, - getDefaultSimpleAccountFactoryAddress, - polygonMumbai, - type SmartAccountSigner, -} from "@alchemy/aa-core"; - -// 1. define the EOA owner of the smart account -// this uses a utility method for creating an account signer using mnemonic -// we also have a utility for creating an account signer from a private key -const owner: SmartAccountSigner = - LocalAccountSigner.mnemonicToAccountSigner(MNEMONIC); - -const chain = polygonMumbai; - -// 2. initialize the provider and connect it to the account -const provider = new SmartAccountProvider({ - // the demo key below is public and rate-limited, it's better to create a new one - // you can get started with a free account @ https://www.alchemy.com/ - rpcProvider: "https://polygon-mumbai.g.alchemy.com/v2/demo", - chain, -}).connect( - (rpcClient) => - new SimpleSmartContractAccount({ - chain, - factoryAddress: getDefaultSimpleAccountFactoryAddress(chain), - rpcClient, - owner, - // optionally if you already know the account's address - accountAddress: "0x000...000", - }) -); - -// 3. send a UserOperation -// eslint-disable-next-line @typescript-eslint/no-unused-vars -export const { hash } = await provider.sendUserOperation({ - target: "0xTargetAddress", - data: "0xcallData", - value: 0n, // value: bigint or undefined -}); diff --git a/site/snippets/account-ethers.ts b/site/snippets/account-ethers.ts deleted file mode 100644 index e679964bf9..0000000000 --- a/site/snippets/account-ethers.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* via `aa-ethers`*/ - -import { - getChain, - getDefaultEntryPointAddress, - getDefaultSimpleAccountFactoryAddress, - SimpleSmartContractAccount, -} from "@alchemy/aa-core"; -import { - convertWalletToAccountSigner, - EthersProviderAdapter, -} from "@alchemy/aa-ethers"; -import { Wallet } from "@ethersproject/wallet"; -import { Alchemy, Network } from "alchemy-sdk"; - -// 1. connect to an RPC Provider and a Wallet -const alchemy = new Alchemy({ - apiKey: API_KEY, - network: Network.MATIC_MUMBAI, -}); -const alchemyProvider = await alchemy.config.getProvider(); -const owner = Wallet.fromMnemonic(MNEMONIC); - -// 2. Create the SimpleAccount signer -// signer is an ethers.js Signer -const signer = EthersProviderAdapter.fromEthersProvider( - alchemyProvider -).connectToAccount( - (rpcClient) => - new SimpleSmartContractAccount({ - entryPointAddress: getDefaultEntryPointAddress( - getChain(alchemyProvider.network.chainId) - ), - chain: getChain(alchemyProvider.network.chainId), - owner: convertWalletToAccountSigner(owner), - factoryAddress: getDefaultSimpleAccountFactoryAddress( - getChain(alchemyProvider.network.chainId) - ), - rpcClient, - }) -); - -// 3. send a user op -// eslint-disable-next-line @typescript-eslint/no-unused-vars -const { hash } = await signer.sendUserOperation({ - target: "0xTargetAddress", - data: "0xcallData", - value: 0n, // value: bigint or undefined -}); diff --git a/site/snippets/enhanced-apis-example/nft.ts b/site/snippets/enhanced-apis-example/nft.ts index 2f4820d046..30cf059b5d 100644 --- a/site/snippets/enhanced-apis-example/nft.ts +++ b/site/snippets/enhanced-apis-example/nft.ts @@ -1,6 +1,6 @@ import { alchemyEnhancedApiActions, - createLightAccountAlchemyClient, + createModularAccountAlchemyClient, } from "@alchemy/aa-alchemy"; import { LocalAccountSigner, sepolia } from "@alchemy/aa-core"; import { Alchemy, Network } from "alchemy-sdk"; @@ -11,7 +11,7 @@ const alchemy = new Alchemy({ }); const provider = ( - await createLightAccountAlchemyClient({ + await createModularAccountAlchemyClient({ chain: sepolia, apiKey: "YOUR_API_KEY", owner: LocalAccountSigner.mnemonicToAccountSigner("OWNER_MNEMONIC"), diff --git a/site/snippets/enhanced-apis-example/token.ts b/site/snippets/enhanced-apis-example/token.ts index 0443bbfd32..6c2da2136e 100644 --- a/site/snippets/enhanced-apis-example/token.ts +++ b/site/snippets/enhanced-apis-example/token.ts @@ -1,6 +1,6 @@ import { alchemyEnhancedApiActions, - createLightAccountAlchemyClient, + createModularAccountAlchemyClient, } from "@alchemy/aa-alchemy"; import { LocalAccountSigner, sepolia } from "@alchemy/aa-core"; import { Alchemy, Network } from "alchemy-sdk"; @@ -11,7 +11,7 @@ const alchemy = new Alchemy({ }); const provider = ( - await createLightAccountAlchemyClient({ + await createModularAccountAlchemyClient({ chain: sepolia, apiKey: "YOUR_API_KEY", owner: LocalAccountSigner.mnemonicToAccountSigner("OWNER_MNEMONIC"), diff --git a/site/snippets/getting-started/provider.ts b/site/snippets/getting-started/provider.ts index b17e54a55e..f026f03fd1 100644 --- a/site/snippets/getting-started/provider.ts +++ b/site/snippets/getting-started/provider.ts @@ -1,8 +1,4 @@ -import { - LightSmartContractAccount, - getDefaultLightAccountFactoryAddress, -} from "@alchemy/aa-accounts"; -import { AlchemyProvider } from "@alchemy/aa-alchemy"; +import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; import { LocalAccountSigner, sepolia, type Hex } from "@alchemy/aa-core"; const chain = sepolia; @@ -13,22 +9,15 @@ const PRIVATE_KEY = "0xYourEOAPrivateKey" as Hex; const owner = LocalAccountSigner.privateKeyToAccountSigner(PRIVATE_KEY); // Create a provider to send user operations from your smart account -const provider = new AlchemyProvider({ +const provider = await createModularAccountAlchemyClient({ // get your Alchemy API key at https://dashboard.alchemy.com apiKey: "ALCHEMY_API_KEY", chain, -}).connect( - (rpcClient) => - new LightSmartContractAccount({ - rpcClient, - owner, - chain, - factoryAddress: getDefaultLightAccountFactoryAddress(chain), - }) -); + owner, +}); (async () => { // Fund your account address with ETH to send for the user operations // (e.g. Get Sepolia ETH at https://sepoliafaucet.com) - console.log("Smart Account Address: ", await provider.getAddress()); // Log the smart account address + console.log("Smart Account Address: ", provider.getAddress()); // Log the smart account address })(); diff --git a/site/snippets/getting-started/send-user-operation.ts b/site/snippets/getting-started/send-user-operation.ts index 46a894f67f..9f9b73a16f 100644 --- a/site/snippets/getting-started/send-user-operation.ts +++ b/site/snippets/getting-started/send-user-operation.ts @@ -1,8 +1,4 @@ -import { - LightSmartContractAccount, - getDefaultLightAccountFactoryAddress, -} from "@alchemy/aa-accounts"; -import { AlchemyProvider } from "@alchemy/aa-alchemy"; +import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; import { Address, LocalAccountSigner, @@ -17,39 +13,36 @@ const PRIVATE_KEY = "0xYourEOAPrivateKey" as Hex; const owner = LocalAccountSigner.privateKeyToAccountSigner(PRIVATE_KEY); // Create a provider to send user operations from your smart account -const provider = new AlchemyProvider({ +const provider = await createModularAccountAlchemyClient({ // get your Alchemy API key at https://dashboard.alchemy.com apiKey: "ALCHEMY_API_KEY", chain, -}).connect( - (rpcClient) => - new LightSmartContractAccount({ - rpcClient, - owner, - chain, - factoryAddress: getDefaultLightAccountFactoryAddress(chain), - }) -); + owner, +}); // [!code focus:22] (async () => { // Fund your account address with ETH to send for the user operations // (e.g. Get Sepolia ETH at https://sepoliafaucet.com) - console.log("Smart Account Address: ", await provider.getAddress()); // Log the smart account address + console.log("Smart Account Address: ", provider.getAddress()); // Log the smart account address const vitalikAddress = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" as Address; // Send a user operation from your smart account to Vitalik that does nothing const { hash: uoHash } = await provider.sendUserOperation({ - target: vitalikAddress, // The desired target contract address - data: "0x", // The desired call data - value: 0n, // (Optional) value to send the target contract address + uo: { + target: vitalikAddress, // The desired target contract address + data: "0x", // The desired call data + value: 0n, // (Optional) value to send the target contract address + }, }); console.log("UserOperation Hash: ", uoHash); // Log the user operation hash // Wait for the user operation to be mined - const txHash = await provider.waitForUserOperationTransaction(uoHash); + const txHash = await provider.waitForUserOperationTransaction({ + hash: uoHash, + }); console.log("Transaction Hash: ", txHash); // Log the transaction hash })(); diff --git a/site/snippets/light-account-client.ts b/site/snippets/light-account-client.ts deleted file mode 100644 index 635f774040..0000000000 --- a/site/snippets/light-account-client.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { createLightAccountClient } from "@alchemy/aa-accounts"; -import { LocalAccountSigner, sepolia } from "@alchemy/aa-core"; -import { http } from "viem"; - -export const provider = createLightAccountClient({ - transport: http(`${sepolia.rpcUrls.alchemy.http[0]}/${"YOUR_API_KEY"}`), - chain: sepolia, - owner: LocalAccountSigner.mnemonicToAccountSigner("OWNER_MNEMONIC"), -}); diff --git a/site/snippets/send-uo-example/calldata.ts b/site/snippets/send-uo-example/calldata.ts index 1430ec8706..ca36c2024a 100644 --- a/site/snippets/send-uo-example/calldata.ts +++ b/site/snippets/send-uo-example/calldata.ts @@ -1,4 +1,4 @@ -import { smartAccountClient } from "snippets/light-account-alchemy-client"; +import { smartAccountClient } from "snippets/aa-alchemy/connected-client"; import { encodeFunctionData } from "viem"; // this is an example ABI for a contract with a "mint" function diff --git a/site/snippets/send-uo-example/send-uo.ts b/site/snippets/send-uo-example/send-uo.ts index 92e1245e20..85b89f0984 100644 --- a/site/snippets/send-uo-example/send-uo.ts +++ b/site/snippets/send-uo-example/send-uo.ts @@ -1,4 +1,4 @@ -import { smartAccountClient } from "../light-account-alchemy-client.js"; +import { smartAccountClient } from "../connected-client.js"; import { uoCallData } from "./calldata.js"; const uo = await smartAccountClient.sendUserOperation({ diff --git a/site/snippets/arcana-auth.ts b/site/snippets/signers/arcana-auth.ts similarity index 100% rename from site/snippets/arcana-auth.ts rename to site/snippets/signers/arcana-auth.ts diff --git a/site/snippets/capsule.ts b/site/snippets/signers/capsule.ts similarity index 100% rename from site/snippets/capsule.ts rename to site/snippets/signers/capsule.ts diff --git a/site/snippets/dfns.ts b/site/snippets/signers/dfns.ts similarity index 100% rename from site/snippets/dfns.ts rename to site/snippets/signers/dfns.ts diff --git a/site/snippets/dynamic.ts b/site/snippets/signers/dynamic.ts similarity index 100% rename from site/snippets/dynamic.ts rename to site/snippets/signers/dynamic.ts diff --git a/site/snippets/fireblocks.ts b/site/snippets/signers/fireblocks.ts similarity index 100% rename from site/snippets/fireblocks.ts rename to site/snippets/signers/fireblocks.ts diff --git a/site/snippets/lit.ts b/site/snippets/signers/lit.ts similarity index 100% rename from site/snippets/lit.ts rename to site/snippets/signers/lit.ts diff --git a/site/snippets/magic.ts b/site/snippets/signers/magic.ts similarity index 100% rename from site/snippets/magic.ts rename to site/snippets/signers/magic.ts diff --git a/site/snippets/particle.ts b/site/snippets/signers/particle.ts similarity index 100% rename from site/snippets/particle.ts rename to site/snippets/signers/particle.ts diff --git a/site/snippets/portal.ts b/site/snippets/signers/portal.ts similarity index 100% rename from site/snippets/portal.ts rename to site/snippets/signers/portal.ts diff --git a/site/snippets/privy.ts b/site/snippets/signers/privy.ts similarity index 100% rename from site/snippets/privy.ts rename to site/snippets/signers/privy.ts diff --git a/site/snippets/turnkey.ts b/site/snippets/signers/turnkey.ts similarity index 100% rename from site/snippets/turnkey.ts rename to site/snippets/signers/turnkey.ts diff --git a/site/snippets/wallet-client-signer.ts b/site/snippets/signers/wallet-client-signer.ts similarity index 100% rename from site/snippets/wallet-client-signer.ts rename to site/snippets/signers/wallet-client-signer.ts diff --git a/site/snippets/web3auth.ts b/site/snippets/signers/web3auth.ts similarity index 100% rename from site/snippets/web3auth.ts rename to site/snippets/signers/web3auth.ts diff --git a/site/snippets/sim-uo-example/sim-method.ts b/site/snippets/sim-uo-example/sim-method.ts index cf07f9cefc..99f5a0e39a 100644 --- a/site/snippets/sim-uo-example/sim-method.ts +++ b/site/snippets/sim-uo-example/sim-method.ts @@ -1,11 +1,11 @@ -import { createLightAccountAlchemyClient } from "@alchemy/aa-alchemy"; +import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; import { LocalAccountSigner, UserOperationCallData, sepolia, } from "@alchemy/aa-core"; -export const smartAccountClient = await createLightAccountAlchemyClient({ +export const smartAccountClient = await createModularAccountAlchemyClient({ apiKey: "YOUR_API_KEY", chain: sepolia, owner: LocalAccountSigner.mnemonicToAccountSigner("OWNER_MNEMONIC"), diff --git a/site/snippets/sim-uo-example/sim-middleware.ts b/site/snippets/sim-uo-example/sim-middleware.ts index 1543005127..588387f6e6 100644 --- a/site/snippets/sim-uo-example/sim-middleware.ts +++ b/site/snippets/sim-uo-example/sim-middleware.ts @@ -1,7 +1,7 @@ -import { createLightAccountAlchemyClient } from "@alchemy/aa-alchemy"; +import { createModularAccountAlchemyClient } from "@alchemy/aa-alchemy"; import { LocalAccountSigner, sepolia } from "@alchemy/aa-core"; -export const smartAccountClient = await createLightAccountAlchemyClient({ +export const smartAccountClient = await createModularAccountAlchemyClient({ apiKey: "YOUR_API_KEY", chain: sepolia, owner: LocalAccountSigner.mnemonicToAccountSigner("OWNER_MNEMONIC"), diff --git a/site/snippets/simple-account-abi.ts b/site/snippets/simple-account-abi.ts deleted file mode 100644 index 8585d2a471..0000000000 --- a/site/snippets/simple-account-abi.ts +++ /dev/null @@ -1,524 +0,0 @@ -export const SimpleAccountAbi = [ - { - inputs: [ - { - internalType: "contract IEntryPoint", - name: "anEntryPoint", - type: "address", - }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "previousAdmin", - type: "address", - }, - { - indexed: false, - internalType: "address", - name: "newAdmin", - type: "address", - }, - ], - name: "AdminChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "beacon", - type: "address", - }, - ], - name: "BeaconUpgraded", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "uint8", - name: "version", - type: "uint8", - }, - ], - name: "Initialized", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "contract IEntryPoint", - name: "entryPoint", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "SimpleAccountInitialized", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "implementation", - type: "address", - }, - ], - name: "Upgraded", - type: "event", - }, - { - inputs: [], - name: "addDeposit", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [], - name: "entryPoint", - outputs: [ - { - internalType: "contract IEntryPoint", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "dest", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "bytes", - name: "func", - type: "bytes", - }, - ], - name: "execute", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address[]", - name: "dest", - type: "address[]", - }, - { - internalType: "bytes[]", - name: "func", - type: "bytes[]", - }, - ], - name: "executeBatch", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "getDeposit", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getNonce", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "anOwner", - type: "address", - }, - ], - name: "initialize", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - { - internalType: "address", - name: "", - type: "address", - }, - { - internalType: "uint256[]", - name: "", - type: "uint256[]", - }, - { - internalType: "uint256[]", - name: "", - type: "uint256[]", - }, - { - internalType: "bytes", - name: "", - type: "bytes", - }, - ], - name: "onERC1155BatchReceived", - outputs: [ - { - internalType: "bytes4", - name: "", - type: "bytes4", - }, - ], - stateMutability: "pure", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - { - internalType: "address", - name: "", - type: "address", - }, - { - internalType: "uint256", - name: "", - type: "uint256", - }, - { - internalType: "uint256", - name: "", - type: "uint256", - }, - { - internalType: "bytes", - name: "", - type: "bytes", - }, - ], - name: "onERC1155Received", - outputs: [ - { - internalType: "bytes4", - name: "", - type: "bytes4", - }, - ], - stateMutability: "pure", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - { - internalType: "address", - name: "", - type: "address", - }, - { - internalType: "uint256", - name: "", - type: "uint256", - }, - { - internalType: "bytes", - name: "", - type: "bytes", - }, - ], - name: "onERC721Received", - outputs: [ - { - internalType: "bytes4", - name: "", - type: "bytes4", - }, - ], - stateMutability: "pure", - type: "function", - }, - { - inputs: [], - name: "owner", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "proxiableUUID", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes4", - name: "interfaceId", - type: "bytes4", - }, - ], - name: "supportsInterface", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - { - internalType: "address", - name: "", - type: "address", - }, - { - internalType: "address", - name: "", - type: "address", - }, - { - internalType: "uint256", - name: "", - type: "uint256", - }, - { - internalType: "bytes", - name: "", - type: "bytes", - }, - { - internalType: "bytes", - name: "", - type: "bytes", - }, - ], - name: "tokensReceived", - outputs: [], - stateMutability: "pure", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newImplementation", - type: "address", - }, - ], - name: "upgradeTo", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newImplementation", - type: "address", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "upgradeToAndCall", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "uint256", - name: "nonce", - type: "uint256", - }, - { - internalType: "bytes", - name: "initCode", - type: "bytes", - }, - { - internalType: "bytes", - name: "callData", - type: "bytes", - }, - { - internalType: "uint256", - name: "callGasLimit", - type: "uint256", - }, - { - internalType: "uint256", - name: "verificationGasLimit", - type: "uint256", - }, - { - internalType: "uint256", - name: "preVerificationGas", - type: "uint256", - }, - { - internalType: "uint256", - name: "maxFeePerGas", - type: "uint256", - }, - { - internalType: "uint256", - name: "maxPriorityFeePerGas", - type: "uint256", - }, - { - internalType: "bytes", - name: "paymasterAndData", - type: "bytes", - }, - { - internalType: "bytes", - name: "signature", - type: "bytes", - }, - ], - internalType: "struct UserOperation", - name: "userOp", - type: "tuple", - }, - { - internalType: "bytes32", - name: "userOpHash", - type: "bytes32", - }, - { - internalType: "uint256", - name: "missingAccountFunds", - type: "uint256", - }, - ], - name: "validateUserOp", - outputs: [ - { - internalType: "uint256", - name: "validationData", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address payable", - name: "withdrawAddress", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "withdrawDepositTo", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - stateMutability: "payable", - type: "receive", - }, -] as const; diff --git a/site/snippets/smartAccountClient.ts b/site/snippets/smartAccountClient.ts deleted file mode 100644 index cbea36e6eb..0000000000 --- a/site/snippets/smartAccountClient.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { createLightAccountClient } from "@alchemy/aa-accounts"; -import { LocalAccountSigner, sepolia, type Hex } from "@alchemy/aa-core"; -import { http } from "viem"; - -const chain = sepolia; -const PRIVATE_KEY = "0xYourEOAPrivateKey" as Hex; -const owner = LocalAccountSigner.privateKeyToAccountSigner(PRIVATE_KEY); - -export const smartAccountClient = await createLightAccountClient({ - transport: http("https://eth-sepolia.alchemyapi.io/v2/ALCHEMY_API_KEY"), - chain, - owner, -}); diff --git a/site/tutorials/batching-transactions.md b/site/tutorials/batching-transactions.md index 80bd8217f2..514d66f2ed 100644 --- a/site/tutorials/batching-transactions.md +++ b/site/tutorials/batching-transactions.md @@ -61,7 +61,7 @@ const { hash } = await provider.sendUserOperation([ ]); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: @@ -87,6 +87,6 @@ const hash = await provider.sendTransactions([ ]); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: diff --git a/site/tutorials/send-user-operation.md b/site/tutorials/send-user-operation.md index f838e4cbb9..67159c3f8f 100644 --- a/site/tutorials/send-user-operation.md +++ b/site/tutorials/send-user-operation.md @@ -31,7 +31,7 @@ Using the SDK, we'll create an Alchemy Smart Account Client. As it is, the provi See [Alchemy Smart Account Client](/packages/aa-alchemy/smart-account-client/) for more details. -<<< @/snippets/light-account-alchemy-client.ts +<<< @/snippets/aa-alchemy/connected-client.ts ## 2. Construct The CallData diff --git a/site/tutorials/sim-user-operation.md b/site/tutorials/sim-user-operation.md index 5559fa99bd..8df9841e53 100644 --- a/site/tutorials/sim-user-operation.md +++ b/site/tutorials/sim-user-operation.md @@ -32,6 +32,8 @@ This could lead to different outcomes than predicted. For instance, if a UO's ef Please be aware of this potential variance and consider it while using UO simulations. +::: + ## 1. Using [`alchemyUserOperationSimulator` middleware](/packages/aa-alchemy/middleware/alchemyUserOperationSimulator) To simulate User Operations, we must create an Alchemy Client and pass in the `useSimulation` flag to true. diff --git a/site/tutorials/sponsoring-gas/gas-sponsorship-eligibility.md b/site/tutorials/sponsoring-gas/gas-sponsorship-eligibility.md index 8d61333363..1b2631352b 100644 --- a/site/tutorials/sponsoring-gas/gas-sponsorship-eligibility.md +++ b/site/tutorials/sponsoring-gas/gas-sponsorship-eligibility.md @@ -46,7 +46,7 @@ provider.withAlchemyGasManager({ }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: diff --git a/site/tutorials/sponsoring-gas/sponsoring-gas.md b/site/tutorials/sponsoring-gas/sponsoring-gas.md index b381b8e8a9..5c33b8b525 100644 --- a/site/tutorials/sponsoring-gas/sponsoring-gas.md +++ b/site/tutorials/sponsoring-gas/sponsoring-gas.md @@ -30,7 +30,7 @@ After [installing `aa-sdk`](/overview/getting-started#install-the-packages) in y First, create an `AlchemyProvider`. You'll use this to send UOs and interact with the blockchain. -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts Remember to replace `ALCHEMY_API_KEY` with your Alchemy API key. If you don't have one yet, you can create an API key on the [Alchemy dashboard](https://dashboard.alchemy.com/signup/?a=aa-docs). @@ -78,7 +78,7 @@ const { hash } = await provider.sendUserOperation({ }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: @@ -111,7 +111,7 @@ const { hash } = await provider.sendUserOperation({ }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: diff --git a/site/tutorials/transferring-ownership.md b/site/tutorials/transferring-ownership.md index 6c978881bd..8fdf269263 100644 --- a/site/tutorials/transferring-ownership.md +++ b/site/tutorials/transferring-ownership.md @@ -49,7 +49,7 @@ const newOwner = "0x..."; // the address of the new owner const hash = LightSmartContractAccount.transferOwnership(provider, newOwner); // [!code focus:99] ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts ::: @@ -94,7 +94,7 @@ const { hash: userOperationHash } = provider.sendUserOperation({ }); ``` -<<< @/snippets/smartAccountClient.ts +<<< @/snippets/aa-core/smartAccountClient.ts :::