Skip to content

Commit

Permalink
Merge branch 'alchemyplatform:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
moldy530 authored Feb 6, 2024
2 parents 1dbe1b7 + 1e8ba40 commit 72acffb
Show file tree
Hide file tree
Showing 21 changed files with 54 additions and 54 deletions.
28 changes: 14 additions & 14 deletions site/.vitepress/sidebar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const sidebar: DefaultTheme.Sidebar = [
{
text: "Getting Started",
items: [
{ text: "Quick Start", link: "/getting-started/setup" },
{ text: "Quick start", link: "/getting-started/setup" },
// I'm leaving these here for now because I'm not sure if we still want them
// There's good content in here so we may want to keep it somewhere
{
Expand Down Expand Up @@ -45,7 +45,7 @@ export const sidebar: DefaultTheme.Sidebar = [
{ text: "Contribute your account", link: "/contributing" },
],
},
{ text: "Gas Benchmarks", link: "/smart-accounts/gas-benchmarks" },
{ text: "Gas benchmarks", link: "/smart-accounts/gas-benchmarks" },
],
},
{
Expand All @@ -54,7 +54,7 @@ export const sidebar: DefaultTheme.Sidebar = [
items: [
{ text: "Introduction", link: "/choosing-a-signer" },
{
text: "Signer Guides",
text: "Signer guides",
base: "/signers/guides",
collapsed: true,
items: [
Expand All @@ -78,11 +78,11 @@ export const sidebar: DefaultTheme.Sidebar = [
collapsed: true,
items: [
{
text: "Using Your Own",
text: "Use your own",
link: "/guides/custom-signer",
},
{
text: "Contributing Your Signer",
text: "Contribute your Signer",
link: "/contributing",
},
],
Expand All @@ -93,18 +93,18 @@ export const sidebar: DefaultTheme.Sidebar = [
text: "Using Smart Accounts",
base: "/using-smart-accounts",
items: [
{ text: "Send User Operations", link: "/send-user-operations" },
{ text: "Batch User Operations", link: "/batch-user-operations" },
{ text: "Send user operations", link: "/send-user-operations" },
{ text: "Batch user operations", link: "/batch-user-operations" },
{
text: "Sponsoring Gas",
text: "Sponsor gas",
collapsed: false,
base: "/using-smart-accounts/sponsoring-gas",
items: [
{ text: "Alchemy Gas Manager", link: "/gas-manager" },
{ text: "Check Eligibility", link: "/checking-eligibility" },
{ text: "Check eligibility", link: "/checking-eligibility" },
],
},
{ text: "Simulate User Operations", link: "/simulate-user-operations" },
{ text: "Simulate user operations", link: "/simulate-user-operations" },
{
text: "Session Keys",
base: "/smart-accounts/session-keys",
Expand All @@ -114,13 +114,13 @@ export const sidebar: DefaultTheme.Sidebar = [
link: "/",
},
{
text: "Getting Started",
text: "Getting started",
link: "/getting-started",
},
],
},
{
text: "Transfer Ownership",
text: "Transfer ownership",
base: "/using-smart-accounts/transfer-ownership",
collapsed: false,
items: [
Expand Down Expand Up @@ -151,7 +151,7 @@ export const sidebar: DefaultTheme.Sidebar = [
// ],
// },
{
text: "Third Party Integrations",
text: "Custom infra",
base: "/third-party",
items: [
{ text: "Bundlers", link: "/bundlers" },
Expand All @@ -166,7 +166,7 @@ export const sidebar: DefaultTheme.Sidebar = [
{ text: "FAQs", link: "/faqs" },
{ text: "Terms", link: "/terms" },
{ text: "Types", link: "/types" },
{ text: "Contact Us", link: "/contact-us" },
{ text: "Contact us", link: "/contact-us" },
],
},
];
14 changes: 7 additions & 7 deletions site/getting-started/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ head:
content: Learn how to get started with Alchemy's Account Kit, a vertically integrated stack for building apps that support ERC-4337.
---

# Getting Started
# Quick Start

This guide will help you get started with Account Kit by setting up your environment, creating a smart account, and sending a `UserOperation` (UO) on its behalf. By the end of this guide, you'll have a basic understanding of how to use the SDK and where to look for more advanced use cases.

## 1. Install the Packages
## 1. Install the packages

In your project directory, you'll need to run the following to install the required packages:

Expand Down Expand Up @@ -87,13 +87,13 @@ Lastly, create a file called `index.ts` in the project to write the code you'll

:::

## 2. Get Your Alchemy API Key
## 2. Get your Alchemy API Key

To read or write any data to a blockchain, you'll need an Alchemy API Key and RPC URL. Go to the [Alchemy Dashboard](https://dashboard.alchemy.com/signup/?a=aa-docs) and access your credentials from the button shown below.

<img src="/images/alchemy-dashboard.png" width="auto" height="auto" alt="Account Kit Overview" style="display: block; margin: auto;">

## 3. Query Your Smart Account Address
## 3. Query your Smart Account Address

Using the SDK in the following example, we'll use the Account Kit to generate the address of your smart account from which to eventually send a UO.

Expand All @@ -111,15 +111,15 @@ You'll get a response like this on your terminal:
Smart Account Address: 0xYOUR_SMART_ACCOUNT_ADDRESS
```

## 4. Fund Your Smart Account
## 4. Fund your Smart Account

To deploy the smart account and send UOs on its behalf, you'll need to add native token to your smart account.

At scale, you might consider using our Gas Manager to [sponsor UserOperations](/using-smart-accounts/sponsoring-gas/gas-manager) for smart accounts. But for the purpose of this example, and because we're using a testnet, let's fund the account using the [Alchemy Faucet](https://sepoliafaucet.com). Make sure to log in with Alchemy to receive your testnet tokens.

<img src="/images/alchemy-faucet.png" width="auto" height="auto" alt="Account Kit Overview" style="display: block; margin: auto;">

## 5. Send a User Operation Using Account Kit
## 5. Send a User Operation using Account Kit

Finally, let's deploy the newly funded smart account and send a UO on its behalf.

Expand Down Expand Up @@ -157,7 +157,7 @@ These are due to increase network activity at that time, and are fleeting issues

Since this "Getting Started" example is a simple script, you'll need to consider how Account Kit can work in various applications. Check out our [Demos](/overview/demos) to see how.

## 6. Dive Deeper
## 6. Dive deeper

In this guide, we initialized an `AlchemyProvider` with the `aa-alchemy` package to send a UO. However, you can do a lot more with Account Kit and its many packages.

Expand Down
2 changes: 1 addition & 1 deletion site/overview/contact-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ next:
text: Smart Accounts
---

# Contact Us
# Contact us

If there's anything we can do to improve your experience with Account Kit, please tell us!

Expand Down
4 changes: 2 additions & 2 deletions site/overview/demos.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ head:

# Demos

## Gasless Token Minting Demo
## Gasless token minting demo

This demo shows how to mint an ERC-20 token to a Light Account using our Gas Manager to provide a gasless minting experience.

Expand All @@ -24,7 +24,7 @@ This demo shows how to mint an ERC-20 token to a Light Account using our Gas Man

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/alchemyplatform/aa-sdk/tree/main/examples/aa-simple-dapp?file=README.md)

## Gasless NFT Minting Demo
## Gasless NFT minting demo

This demo shows how to mint an NFT (ERC-721 token) to a Light Account using our Gas Manager to provide a gasless minting experience.

Expand Down
2 changes: 1 addition & 1 deletion site/packages/aa-accounts/light-account/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const result = await transferLightAccountOwnership(smartAccountClient, {
<<< @/snippets/aa-core/lightAccountClient.ts
:::

## Developer Links
## Developer links

- [Light Account & Simple Account Deployment Addresses](/smart-accounts/accounts/deployment-addresses)
- [Light Account Github Repo](https://github.com/alchemyplatform/light-account)
Expand Down
4 changes: 2 additions & 2 deletions site/packages/aa-signers/magic/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ head:
4. [`signTypedData`](/packages/aa-signers/magic/signTypedData) -- supports typed data signatures.
5. [`getAuthDetails`](/packages/aa-signers/magic/getAuthDetails) -- supports authentication details retrieval.

## Install Dependencies
## Install dependencies

`MagicSigner` requires installation of the [`magic-sdk`](https://github.com/magiclabs/magic-js) SDK. `aa-signers` lists it as an optional dependency.

Expand Down Expand Up @@ -75,7 +75,7 @@ const signTypedData = await signer.signTypedData(typedData);
<<< @/snippets/signers/magic.ts
:::

## Developer Links
## Developer links

- [Magic web SDK](https://magic.link/docs/api/client-side-sdks/web)
- [MagicSigner Tests](https://github.com/alchemyplatform/aa-sdk/blob/main/packages/signers/src/magic/__tests__/signer.test.ts)
4 changes: 2 additions & 2 deletions site/packages/aa-signers/turnkey/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ head:
4. [`signTypedData`](/packages/aa-signers/turnkey/signTypedData) -- supports typed data signatures.
5. [`getAuthDetails`](/packages/aa-signers/turnkey/getAuthDetails) -- supports authentication details retrieval.

## Install Dependencies
## Install dependencies

`TurnkeySigner` requires installation of the [`@turnkey/http`](https://github.com/tkhq/sdk/tree/main/packages/http) and [`@turnkey/viem`](https://github.com/tkhq/sdk/tree/main/packages/viem) dependencies. `aa-signers` lists them as optional dependencies.

Expand Down Expand Up @@ -93,7 +93,7 @@ const signTypedData = await turnkeySigner.signTypedData(typedData);
<<< @/snippets/signers/turnkey.ts
:::

## Developer Links
## Developer links

- [Turnkey SDK](https://docs.turnkey.com/category/sdk)
- [Turnkey Tests](https://github.com/alchemyplatform/aa-sdk/blob/main/packages/signers/src/turnkey/__tests__/signer.test.ts)
2 changes: 1 addition & 1 deletion site/packages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ head:
content: Explore the benefits and tradeoffs of four different packages that can be used with Account Kit namely aa-core, aa-alchemy, aa-accounts, aa-signers, and aa-ethers.
---

# Package Overview
# Package overview

Account Kit consists of a number of SDK packages that you can leverage to interact with [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) infrastructure.

Expand Down
2 changes: 1 addition & 1 deletion site/resources/faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ head:
content: Frequently Asked Questions
---

# Frequently Asked Questions
# Frequently asked questions

## Smart Accounts - Light Account

Expand Down
10 changes: 5 additions & 5 deletions site/signers/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ head:
content: Follow this guide to contribute a new Signer to Account Kit documentation, and enable developers to sign ERC-4337 transactions with your Signer.
---

# Contributing Your Signer
# Contribute your Signer

If you'd like to add your Signer to Account Kit, we welcome PRs! You'll need to fork the [`aa-sdk` Github repo](https://github.com/alchemyplatform/aa-sdk) and then follow the below steps.

## 1. Add Your Signer to [`aa-signers`](https://github.com/alchemyplatform/aa-sdk/tree/main/packages/signers)
## 1. Add your Signer to [`aa-signers`](https://github.com/alchemyplatform/aa-sdk/tree/main/packages/signers)

To ensure the best developer experience for anyone using Account Kit, we ask that you add your Signer implementation to our [`aa-signers`](https://github.com/alchemyplatform/aa-sdk/tree/main/packages/signers) SDK package.

Expand All @@ -38,13 +38,13 @@ If you your Signer implementation requires adding SDKs as dependencies, you shou
If your SDK is based on a frontend Javascript framework, such as React.js or Vue.js, you will just have to follow step 2 onwards to submit documentation with an example snippet clarifying that your Signer must be used in said framework.
:::

## 2. Adding Documentation about Your Signer
## 2. Add documentation about your Signer

You'll want to add documentation about your Signers so that developers can easily use your implementation in Account Kit. Below, we recommend adding documentation about your Signer's APIs, as well.

To ensure these docs are visible on the Account Kit docs, you'll want to add links to them in the [`site/.vitepress/config.ts`](https://github.com/alchemyplatform/aa-sdk/blob/main/site/.vitepress/config.ts) file in the `aa-sdk` repo, where there is a `sidebar` property in the object.

### 2.1 Adding API Documentation
### 2.1 Add API documentation

If your Signer implements the `SmartAccountAuthenticator` interface, you'll have at least 5 methods to document: `getAddress`, `authenticate`, `signMessage`, `signTypedData`, and `getAuthDetails`. You can also add additional methods to your implementation. Just make sure to add documentation!

Expand Down Expand Up @@ -87,7 +87,7 @@ Find the `aa-signers` item in the `sidebar` and add a new entry in `items`. The

In that section, add documentation introducing the value prop of your Signer, how to initialize the Signer object, and how to call each method. The example above shows the items you'll need to include if you chose to have your Signer implement the `SmartAccountAuthenticator` interface.

### 2.2 Adding an integration guide
### 2.2 Add an integration guide

You'll want to add an integration guide that walks through step-by-step how to use your Signer implementation in `aa-signers` with the other building blocks, namely smart accounts and provider clients.

Expand Down
2 changes: 1 addition & 1 deletion site/signers/guides/custom-signer.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ head:
content: Follow this guide to use any Signer you want with Account Kit, a vertically integrated stack for building apps that support ERC-4337.
---

# How to Use Your Own Account Signer
# How to use your own Account Signer

Account Kit is designed to be flexible and allow you to use any Signer you want. If you don't want to use any Signer implementations in [`aa-signers`](/packages/aa-signers/index), you can either:

Expand Down
6 changes: 3 additions & 3 deletions site/smart-accounts/custom/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ head:
content: Follow this guide to contribute a new smart account to Account Kit documentation.
---

# Contributing Your Account
# Contribute your account

If you'd like to add your smart account to Account Kit, we welcome PRs! You'll need to fork the [`aa-sdk` Github repo](https://github.com/alchemyplatform/aa-sdk) and then follow the below steps.

## 1. Add Your Smart Account to [`aa-accounts`](https://github.com/alchemyplatform/aa-sdk/tree/main/packages/accounts)
## 1. Add your Smart Account to [`aa-accounts`](https://github.com/alchemyplatform/aa-sdk/tree/main/packages/accounts)

To ensure the best developer experience for anyone using Account Kit, we ask that you add your smart account implementation to our [`aa-accounts`](https://github.com/alchemyplatform/aa-sdk/tree/main/packages/accounts) SDK package.

There, you'll want to add an implemention of the [`SmartContractAccount`](https://github.com/alchemyplatform/aa-sdk/blob/main/packages/core/src/account/smartContractAccount.ts) interface from `aa-core`. Simply export a function `createMySmartContractAccount` which calls `toSmartContractAccount` and any custom setup you need for your account. Make sure to include unit tests along with your implementation!

## 2. Add Documentation about Your Smart Account
## 2. Add documentation about your Smart Account

You'll want to add documentation about your smart account so that developers can easily use your implementation in Account Kit. Below, we recommend adding documentation about your smart account's APIs, as well.

Expand Down
2 changes: 1 addition & 1 deletion site/smart-accounts/gas-benchmarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ head:
content: Gas Benchmarks for Alchemy Accounts
---

# Account Gas Benchmarks
# Account gas benchmarks

| Account | Native transfer | ERC20 transfer | Creation |
| ----------------------------------------------------------------------------------------------------------------------- | --------------- | -------------- | -------- |
Expand Down
2 changes: 1 addition & 1 deletion site/smart-accounts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ For most applications, we recommend using Light Account. It is [deployed](/smart

We are authoring a standard for modular smart accounts called [ERC-6900](https://eips.ethereum.org/EIPS/eip-6900). Soon we will release an ERC-6900 compatible [Modular Account](/smart-accounts/modular-account/). This will be an optional upgrade from Light Account to unlock an ecosystem of plugins for your smart account stack.

## Use Your Own Account
## Use your own Account

If Light Account doesn't fit your specific needs, you can always use your own smart account implementation with Account Kit. To learn how, see our guide in the [Using Your Own](/smart-accounts/custom/using-your-own) section.
2 changes: 1 addition & 1 deletion site/smart-accounts/session-keys/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ With the ability to delegate specific permissions to session keys, users can aut

By using session keys, the exposure of the main private key is minimized. Even if a session key is compromised, the attacker would not gain access to the user's main account and funds. This layered approach to security helps in mitigating risks associated with key management and exposure.

## Supported Permissions
## Supported permissions

The session key plugin supports the following types of permissions for each key:

Expand Down
2 changes: 1 addition & 1 deletion site/using-smart-accounts/enhanced-apis/nft.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ head:
content: Follow this guide to fetch a smart account's NFTs with Account Kit, a vertically integrated stack for building apps that support ERC-4337.
---

# How to Fetch a Smart Account's NFTs
# How to fetch a Smart Account's NFTs

We provide several [Enhanced APIs](https://www.alchemy.com/enhanced-apis/?a=ak-docs), which are especially useful for querying information about the smart accounts you create using Account Kit, such as the account's owned NFTs using the [NFT API](https://www.alchemy.com/nft-api/?a=ak-docs).

Expand Down
8 changes: 4 additions & 4 deletions site/using-smart-accounts/send-user-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ head:
content: Follow this guide to send a User Operation with Account Kit, a vertically integrated stack for building apps that support ERC-4337.
---

# How to Send a User Operation
# How to send a User Operation

This guide will show you how to send a User Operation with Account Kit by creating an Alchemy Smart Account Client, connecting it to a Light Account (a type of smart account implementation), and sending a User Operation from that provider. By the end of this guide, you'll have a basic understanding of how to use the SDK.

## 1. Create Your Client
## 1. Create your Client

Using the SDK, we'll create an Alchemy Smart Account Client. As it is, the providers gives you methods to query information related to user operations and smart accounts. To create a provider, you'll need an Alchemy API Key or RPC URL, which you can access from the [Alchemy Dashboard](https://dashboard.alchemy.com/signup/?a=aa-docs).

See [Alchemy Smart Account Client](/packages/aa-alchemy/smart-account-client/) for more details.

<<< @/snippets/aa-alchemy/connected-client.ts

## 2. Construct The CallData
## 2. Construct the call data

The best part of Account Kit is that it abstracts the differences between User Operation calldata and standard Transaction calldata, such that you can pass in typical calldata to [sendUserOperation](/packages/aa-core/smart-account-client/actions/waitForUserOperationTransaction.md) as if it was a transaction sent from your smart account, and we'll wrap it as necessary to generate calldata as it would be as a User Operation.

Expand All @@ -40,7 +40,7 @@ The second best part of Account Kit is it's build atop [viem](https://viem.sh/).

Some other helpful viem methods include: [encodeFunctionData](https://viem.sh/docs/contract/encodeFunctionData.html), [decodeFunctionData](https://viem.sh/docs/contract/decodeFunctionData.html), and [decodeFunctionResult](https://viem.sh/docs/contract/decodeFunctionResult.html).

## 3. Send The User Operation
## 3. Send the User Operation

Now we'll use the connected provider to send a user operation. We'll use the [sendUserOperation](/packages/aa-core/smart-account-client/actions/sendUserOperation.md) method on the provider.

Expand Down
2 changes: 1 addition & 1 deletion site/using-smart-accounts/simulate-user-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ head:
content: Follow this guide to simulate a User Operation with Alchemy's Account Kit, a vertically integrated stack for building apps that support ERC-4337.
---

# How to Simulate a User Operation
# How to simulate a User Operation

This guide will show you how to simulate a `UserOperation` (UO) with Account Kit by adding support for UO simulation on an `AlchemyProvider` and sending a User Operation from that provider only if simulation passes. By the end of this guide, you'll have a basic understanding of how to safely send UOs with the `aa-sdk`.

Expand Down
Loading

0 comments on commit 72acffb

Please sign in to comment.