Skip to content

[Delegation Toolkit] Add MetaMask Smart Accounts quickstart #2132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AyushBherwani1998
Copy link
Member

Description

Adds quickstart for MetaMask Smart Accounts

Issue(s) fixed

Fixes #

Preview

Checklist

Complete this checklist before merging your PR:

  • If this PR contains a major change to the documentation content, I have added an entry to the top of the "What's new?" page.
  • The proposed changes have been reviewed and approved by a member of the documentation team.

@AyushBherwani1998 AyushBherwani1998 requested review from a team as code owners July 1, 2025 06:09
Copy link

vercel bot commented Jul 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
metamask-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 2, 2025 3:23am

Copy link
Contributor

@alexandratran alexandratran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added minor suggestions. If we are introducing "MetaMask Smart Account" branding here, I think we should keep it consistent throughout the page and also make consistent changes across the rest of the DTK docs. I will work on a PR for the latter today.

sidebar_position: 2
sidebar_label: Quickstart
---

# Delegation Toolkit quickstart
# MetaMask Smart Accounts quickstart
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# MetaMask Smart Accounts quickstart
# MetaMask Smart Account quickstart


This page demonstrates how to get started quickly with the MetaMask Delegation Toolkit,
by creating a delegator account and completing the delegation lifecycle (creating, signing, and redeeming a delegation).
This page demonstrates how to get started quickly with the MetaMask Smart Accounts, and send the first user operation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This page demonstrates how to get started quickly with the MetaMask Smart Accounts, and send the first user operation.
This page demonstrates how to get started quickly with MetaMask Smart Accounts, and send the first user operation.

@@ -17,157 +16,77 @@ by creating a delegator account and completing the delegation lifecycle (creatin

### 1. Set up a Public Client

Set up a [Viem Public Client](https://viem.sh/docs/clients/public) using Viem's `createPublicClient` function.
This client will let the delegator account query the signer's account state and interact with smart contracts.
Set up a [Viem Public Client](https://viem.sh/docs/clients/public) using Viem's `createPublicClient` function. This client will let the smart account query the signer's account state and interact with blockchain network.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Set up a [Viem Public Client](https://viem.sh/docs/clients/public) using Viem's `createPublicClient` function. This client will let the smart account query the signer's account state and interact with blockchain network.
Set up a [Viem Public Client](https://viem.sh/docs/clients/public) using Viem's `createPublicClient` function. This client will let the Smart Account query the signer's account state and interact with blockchain network.

```

### 3. Create a delegator account
### 3. Create a MetaMask smart account
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### 3. Create a MetaMask smart account
### 3. Create a MetaMask Smart Account


[Create a delegator smart account](../how-to/create-smart-account/index.md) to set up a delegation.
[Create a MetaMask smart account](../how-to/create-smart-account/index.md) to send first user operation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[Create a MetaMask smart account](../how-to/create-smart-account/index.md) to send first user operation.
[Create a MetaMask Smart Account](../how-to/create-smart-account/index.md) to send the first user operation.


This example configures a [Hybrid](../how-to/create-smart-account/configure-accounts-signers.md#configure-a-hybrid-smart-account) delegator account:
This example configures a [Hybrid](../how-to/create-smart-account/configure-accounts-signers.md#configure-a-hybrid-smart-account) smart account:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This example configures a [Hybrid](../how-to/create-smart-account/configure-accounts-signers.md#configure-a-hybrid-smart-account) smart account:
This example configures a [Hybrid](../how-to/create-smart-account/configure-accounts-signers.md#configure-a-hybrid-smart-account) Smart Account:

import { createPublicClient, http } from "viem";
import { sepolia as chain } from "viem/chains";

import { createPublicClient, http } from 'viem'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { createPublicClient, http } from 'viem'
import { createPublicClient, http } from "viem"

We try to use double quotes consistently throughout the doc site. This applies to the rest of the code samples on this page.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's my habit of saving files frequently, and since Prettier is configured to use single quotes, it keeps formatting them that way. Maybe we should consider changing the config?

Prettier configuration: https://github.com/MetaMask/metamask-docs/blob/main/.prettierrc


### 5. Create a delegation
The smart account will remain counterfactual until the first user operation. If the smart account is not
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The smart account will remain counterfactual until the first user operation. If the smart account is not
The Smart Account will remain counterfactual until the first user operation. If the Smart Account is not

@alexandratran
Copy link
Contributor

@AyushBherwani1998 Here's a follow up PR: #2134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants