diff --git a/delegation-toolkit/get-started/erc7715-quickstart.md b/delegation-toolkit/get-started/erc7715-quickstart.md index b7a7b4c172f..7ee8c0bbb9a 100644 --- a/delegation-toolkit/get-started/erc7715-quickstart.md +++ b/delegation-toolkit/get-started/erc7715-quickstart.md @@ -10,12 +10,22 @@ This quickstart demonstrates how to request and redeem ERC-7715 permissions. ## Prerequisites -- [Install and set up the Delegation Toolkit.](install.md) -- [Install MetaMask Flask 12.14.2 or later.](/snaps/get-started/install-flask) +- Install [Node.js](https://nodejs.org/en/blog/release/v18.18.0) v18 or later. +- Install [Yarn](https://yarnpkg.com/), + [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm), or another package manager. +- [Install MetaMask Flask 12.14.2 or later](/snaps/get-started/install-flask). ## Steps -### 1. Set up a Wallet Client +### 1. Install the toolkit + +Install the [MetaMask Delegation Toolkit](https://www.npmjs.com/package/@metamask/delegation-toolkit): + +```bash npm2yarn +npm install @metamask/delegation-toolkit +``` + +### 2. Set up a Wallet Client Set up a [Viem Wallet Client](https://viem.sh/docs/clients/wallet) using Viem's `createWalletClient` function. This client will help you interact with MetaMask Flask. @@ -32,7 +42,7 @@ const walletClient = createWalletClient({ }).extend(erc7715ProviderActions()); ``` -### 2. Set up a Public Client +### 3. 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 help you query the account state and interact with blockchain networks. @@ -47,7 +57,7 @@ const publicClient = createPublicClient({ }); ``` -### 3. Set up a session account +### 4. Set up a session account Set up a session account which can either be a smart account or an externally owned account (EOA) to request ERC-7715 permissions. This account is responsible @@ -74,7 +84,7 @@ const sessionAccount = await toMetaMaskSmartAccount({ }); ``` -### 4. Request ERC-7715 permissions +### 5. Request ERC-7715 permissions Request ERC-7715 permissions from the user. Currently, only the `native-token-stream` permission type is supported, which allows the dapp to stream @@ -106,7 +116,7 @@ const grantedPermissions = await walletClient.grantPermissions([{ }]); ``` -### 5. Set up a Bundler Client +### 6. Set up a Bundler Client Set up a [Viem Bundler Client](https://viem.sh/account-abstraction/clients/bundler) using Viem's `createBundlerClient` function. This lets you use the bundler service @@ -127,7 +137,7 @@ const bundlerClient = createBundlerClient({ }).extend(erc7710BundlerActions()); ``` -### 6. Redeem ERC-7715 permissions +### 7. Redeem ERC-7715 permissions The session account can now [redeem the delegation](../experimental/erc-7710-redeem-delegations.md). The redeem transaction is sent to the `DelegationManager` contract, which validates the delegation and executes actions on the user's behalf. diff --git a/delegation-toolkit/get-started/install.md b/delegation-toolkit/get-started/install.md index f737e2572af..b4bfe181b1d 100644 --- a/delegation-toolkit/get-started/install.md +++ b/delegation-toolkit/get-started/install.md @@ -23,7 +23,7 @@ This page provides instructions to install and set up the MetaMask Delegation To ### 1. Install the toolkit -Install the [MetaMask Delegation Toolkit](https://github.com/MetaMask/delegation-toolkit) dependencies: +Install the [MetaMask Delegation Toolkit](https://www.npmjs.com/package/@metamask/delegation-toolkit): ```bash npm2yarn npm install @metamask/delegation-toolkit diff --git a/delegation-toolkit/get-started/smart-account-quickstart/eip7702.md b/delegation-toolkit/get-started/smart-account-quickstart/eip7702.md index a67fdf38a41..b4a02a521aa 100644 --- a/delegation-toolkit/get-started/smart-account-quickstart/eip7702.md +++ b/delegation-toolkit/get-started/smart-account-quickstart/eip7702.md @@ -11,12 +11,22 @@ abstraction, such as batch transactions, gas sponsorship, and [delegation capabi ## Prerequisites -- [Install and set up the Delegation Toolkit.](../install.md) -- [Install Viem.](https://viem.sh/) +- Install [Node.js](https://nodejs.org/en/blog/release/v18.18.0) v18 or later. +- Install [Yarn](https://yarnpkg.com/), + [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm), or another package manager. +- [Install Viem](https://viem.sh/). ## Steps -### 1. Set up a Public Client +### 1. Install the toolkit + +Install the [MetaMask Delegation Toolkit](https://www.npmjs.com/package/@metamask/delegation-toolkit): + +```bash npm2yarn +npm install @metamask/delegation-toolkit +``` + +### 2. 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 EOA query the account state and interact with blockchain network. @@ -31,7 +41,7 @@ const publicClient = createPublicClient({ }); ``` -### 2. Set up a Bundler Client +### 3. Set up a Bundler Client Set up a [Viem Bundler Client](https://viem.sh/account-abstraction/clients/bundler) using Viem's `createBundlerClient` function. This lets you use the bundler service to estimate gas for user operations and submit transactions to the network. @@ -45,7 +55,7 @@ const bundlerClient = createBundlerClient({ }); ``` -### 3. Set up a Wallet Client +### 4. Set up a Wallet Client Set up [Viem Wallet Client](https://viem.sh/docs/clients/wallet) using Viem's `createWalletClient` function. This lets you sign and submit EIP-7702 authorization. @@ -64,7 +74,7 @@ export const walletClient = createWalletClient({ }); ``` -### 4. Authorize a 7702 delegation +### 5. Authorize a 7702 delegation Create an authorization to map the contract code to an EOA, and sign it using Viem's [`signAuthorization`](https://viem.sh/docs/eip7702/signAuthorization) action. The `signAuthorization` action @@ -92,7 +102,7 @@ const authorization = await walletClient.signAuthorization({ }); ``` -### 5. Submit the authorization +### 6. Submit the authorization Once you have signed an authorization, you can send an EIP-7702 transaction to set the EOA code. Since the authorization cannot be sent by itself, you can include it alongside a dummy transaction. @@ -107,7 +117,7 @@ const hash = await walletClient.sendTransaction({ }); ``` -### 6. Create a MetaMask smart account +### 7. Create a MetaMask smart account Create a smart account instance for the EOA and start leveraging the benefits of account abstraction. @@ -129,7 +139,7 @@ const smartAccount = await toMetaMaskSmartAccount({ }); ``` -### 7. Send a user operation +### 8. Send a user operation Send a user operation through the upgraded EOA, using Viem's [`sendUserOperation`](https://viem.sh/account-abstraction/actions/bundler/sendUserOperation) method. diff --git a/delegation-toolkit/get-started/smart-account-quickstart/index.md b/delegation-toolkit/get-started/smart-account-quickstart/index.md index 46b12562f8e..5a72c500f2f 100644 --- a/delegation-toolkit/get-started/smart-account-quickstart/index.md +++ b/delegation-toolkit/get-started/smart-account-quickstart/index.md @@ -9,11 +9,21 @@ You can get started quickly with [MetaMask Smart Accounts](../../concepts/smart- ## Prerequisites -[Install and set up the Delegation Toolkit.](../install.md) +- Install [Node.js](https://nodejs.org/en/blog/release/v18.18.0) v18 or later. +- Install [Yarn](https://yarnpkg.com/), + [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm), or another package manager. ## Steps -### 1. Set up a Public Client +### 1. Install the toolkit + +Install the [MetaMask Delegation Toolkit](https://www.npmjs.com/package/@metamask/delegation-toolkit): + +```bash npm2yarn +npm install @metamask/delegation-toolkit +``` + +### 2. 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 smart account query the signer's account state and interact with blockchain network. @@ -27,7 +37,7 @@ const publicClient = createPublicClient({ }); ``` -### 2. Set up a Bundler Client +### 3. Set up a Bundler Client Set up a [Viem Bundler Client](https://viem.sh/account-abstraction/clients/bundler) using Viem's `createBundlerClient` function. This lets you use the bundler service to estimate gas for user operations and submit transactions to the network. @@ -40,7 +50,7 @@ const bundlerClient = createBundlerClient({ }); ``` -### 3. Create a MetaMask smart account +### 4. Create a MetaMask smart account [Create a MetaMask smart account](../../guides/smart-accounts/create-smart-account.md) to send the first user operation. @@ -62,7 +72,7 @@ const smartAccount = await toMetaMaskSmartAccount({ }); ``` -### 4. Send a user operation +### 5. Send a user operation Send a user operation using Viem's [`sendUserOperation`](https://viem.sh/account-abstraction/actions/bundler/sendUserOperation) method. diff --git a/gator_versioned_docs/version-0.12.0/get-started/llm-context.md b/gator_versioned_docs/version-0.12.0/get-started/llm-context.md deleted file mode 100644 index 63ead6da5a5..00000000000 --- a/gator_versioned_docs/version-0.12.0/get-started/llm-context.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -sidebar_label: LLM context -description: Context about the MetaMask Delegation Toolkit that can be provided to an LLM. -sidebar_position: 4 -sidebar_class_name: hidden ---- - -# Delegation Toolkit LLM context - -This website contains an [`LLMs.txt`](/llms.txt) file that is intended for use by large language models (LLMs). -It provides information about the structure of the MetaMask developer documentation, -to facilitate better indexing, summarization, and understanding by LLMs. - -You can add this file to an LLM-based tool like [ChatGPT](https://chatgpt.com/) or [Cursor](https://docs.cursor.com/context/@-symbols/@-docs), -to provide detailed context about the MetaMask developer documentation. diff --git a/src/pages/tutorials/use-erc20-paymaster.md b/src/pages/tutorials/use-erc20-paymaster.md index df85028842a..cadec86debd 100644 --- a/src/pages/tutorials/use-erc20-paymaster.md +++ b/src/pages/tutorials/use-erc20-paymaster.md @@ -152,5 +152,5 @@ const userOperationHash = await bundlerClient.sendUserOperation({ ## Next steps -- See [Create a MetaMask smart account](/delegation-toolkit/development/guides/smart-accounts/create-smart-account) to learn more about smart account implementations. -- See [Send a gasless transaction](/delegation-toolkit/development/guides/smart-accounts/send-gasless-transaction) to learn how to use gasless paymaster. +- Learn more about [smart account implementations](/delegation-toolkit/development/guides/smart-accounts/create-smart-account). +- To sponsor gas for end users, see how to [send a gasless transaction](/delegation-toolkit/development/guides/smart-accounts/send-gasless-transaction). diff --git a/src/pages/tutorials/use-passkey-as-backup-signer.md b/src/pages/tutorials/use-passkey-as-backup-signer.md index 8cdc32ec01f..3c6359a195c 100644 --- a/src/pages/tutorials/use-passkey-as-backup-signer.md +++ b/src/pages/tutorials/use-passkey-as-backup-signer.md @@ -163,5 +163,5 @@ const smartAccount = await toMetaMaskSmartAccount({ ## Next steps -- See [Create a MetaMask smart account](/delegation-toolkit/guides/smart-accounts/create-smart-account) to learn more about smart account implementations. -- See [Send a gasless transaction](/delegation-toolkit/guides/smart-accounts/send-gasless-transaction) to learn how to sponsor gas fees when adding a passkey as a backup signer. +- Learn more about [smart account implementations](/delegation-toolkit/development/guides/smart-accounts/create-smart-account). +- To sponsor gas fees when adding a passkey as a backup signer, see how to [send a gasless transaction](/delegation-toolkit/development/guides/smart-accounts/send-gasless-transaction).