You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/tutorials/use-erc20-paymaster.md
+24-13Lines changed: 24 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,17 +19,22 @@ This removes the need for users to hold native tokens, allowing them to perform
19
19
20
20
## Prerequisites
21
21
22
-
-[Install and set up the Delegation Toolkit](/delegation-toolkit/get-started/install) in your project.
23
-
-[Configure the Delegation Toolkit](/delegation-toolkit/development/guides/configure).
24
-
-[Create a Hybrid smart account](/delegation-toolkit/development/guides/smart-accounts/create-smart-account), and fund it with some Sepolia USDC to pay gas fees.
25
-
:::note
26
-
You can use [Circle's faucet](https://faucet.circle.com/) to get Sepolia USDC.
27
-
:::
22
+
- Install [Node.js](https://nodejs.org/en/blog/release/v18.18.0) v18 or later.
23
+
- Install [Yarn](https://yarnpkg.com/),
24
+
[npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm), or another package manager.
28
25
-[Create a Pimlico API key](https://docs.pimlico.io/guides/create-api-key#create-api-key).
29
26
30
27
## Steps
31
28
32
-
### 1. Create a Public Client
29
+
### 1. Install the toolkit
30
+
31
+
Install the [MetaMask Delegation Toolkit](https://www.npmjs.com/package/@metamask/delegation-toolkit) in your project:
32
+
33
+
```bash npm2yarn
34
+
npm install @metamask/delegation-toolkit
35
+
```
36
+
37
+
### 2. Create a Public Client
33
38
34
39
Create a [Viem Public Client](https://viem.sh/docs/clients/public) using Viem's `createPublicClient` function.
35
40
You will configure a smart account and Bundler Client with the Public Client, which you can use to query the signer's account state and interact with the blockchain network.
Create a [Viem Bundler Client](https://viem.sh/account-abstraction/clients/bundler) using Viem's `createBundlerClient` function. You can use the bundler service to estimate gas for user operations and submit transactions to the network.
Configure the same [Hybrid smart account](/delegation-toolkit/development/guides/smart-accounts/create-smart-account/#create-a-hybrid-smart-account) that you created and funded as a [prerequisite](#prerequisites).
91
+
Create a [Hybrid smart account](/delegation-toolkit/development/guides/smart-accounts/create-smart-account/#create-a-hybrid-smart-account).
87
92
A Hybrid smart account is a flexible smart account implementation that supports both an externally owned account (EOA) owner and any number of passkey (WebAuthn) signers.
-[Configure the Delegation Toolkit](/delegation-toolkit/development/guides/configure).
29
-
-[Create and deploy a Hybrid smart account,](/delegation-toolkit/development/guides/smart-accounts/create-smart-account) with a signatory from a private key.
26
+
- Install [Node.js](https://nodejs.org/en/blog/release/v18.18.0) v18 or later.
27
+
- Install [Yarn](https://yarnpkg.com/),
28
+
[npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm), or another package manager.
30
29
31
30
## Steps
32
31
33
-
### 1. Create a Public Client
32
+
### 1. Install dependencies
33
+
34
+
Install the [MetaMask Delegation Toolkit](https://www.npmjs.com/package/@metamask/delegation-toolkit) and [Ox SDK](https://oxlib.sh/#installation) in your project:
35
+
36
+
```bash npm2yarn
37
+
npm install @metamask/delegation-toolkit ox
38
+
```
39
+
40
+
### 2. Create a Public Client
34
41
35
42
Create a [Viem Public Client](https://viem.sh/docs/clients/public) using Viem's `createPublicClient` function.
36
43
You will configure a smart account and Bundler Client with the Public Client, which you can use to query the signer's account state and interact with the blockchain network.
Configure the same [Hybrid smart account](/delegation-toolkit/development/guides/smart-accounts/create-smart-account/#create-a-hybrid-smart-account) that you created and deployed as a [prerequisite](#prerequisites).
71
+
Create and deploy a [Hybrid smart account](/delegation-toolkit/development/guides/smart-accounts/create-smart-account), with a private key signer.
65
72
The Hybrid implementation supports adding additional passkey signers.
To add a passkey signer, use Viem's [`createWebAuthnCredential`](https://viem.sh/account-abstraction/accounts/webauthn/createWebAuthnCredential) function to securely register the passkey (WebAuthn credential).
You can now use the passkey signer to access your smart account and sign transactions.
139
160
If you ever lose your primary signer (private key) used in [Step 3](#3-create-a-hybrid-smart-account), you can use the passkey as a secure backup method to retain access to your smart account.
0 commit comments