Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions docs/sdk/pnp/web/modal/account-abstraction.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
title: Account Abstraction
sidebar_label: Account Abstraction
description: "@web3auth/modal Native Account Abstraction | Documentation - Web3Auth"
---

import AccountAbstractionDescription from "@site/src/common/sdk/pnp/web/_account-abstraction-description.mdx";
import AccountAbstractionProviderInstallation from "@site/src/common/sdk/pnp/web/_aa-provider-installation.mdx";
import ConfigureSmartAccountProvider from "@site/src/common/sdk/pnp/web/_smart-account-provider-configuration.mdx";
import ConfigureBundler from "@site/src/common/sdk/pnp/web/_bundler-configuration.mdx";
import ConfigureSponsoredPaymaster from "@site/src/common/sdk/pnp/web/_sponsored-paymaster-configuration.mdx";
import ConfigureERC20Paymaster from "@site/src/common/sdk/pnp/web/_erc20-paymaster-configuration.mdx";
import AAModalSetup from "@site/src/common/sdk/pnp/web/_aa-modal-setup.mdx";
import ConfigureSigners from "@site/src/common/sdk/pnp/web/_configure-aa-signers.mdx";
import SmartAccountAddress from "@site/src/common/sdk/pnp/web/_aa-address.mdx";
import SmartAccountSendTransaction from "@site/src/common/sdk/pnp/web/_aa-send-transaction.mdx";

import GrowthPlanNote from "@site/src/common/docs/_growth_plan_note.mdx";

<AccountAbstractionDescription />
<GrowthPlanNote />

## Installation

<AccountAbstractionProviderInstallation />

## Configure

When instantiating the Account Abstraction Provider, you can pass configuration objects to the
constructor. These configuration options allow you to select the desired Account Abstraction (AA)
provider, as well as configure the bundler and paymaster, giving you flexibility and control over
the provider.

```tsx
import {
AccountAbstractionProvider,
SafeSmartAccount,
} from "@web3auth/account-abstraction-provider";

const chainConfig = {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: "0xaa36a7",
rpcTarget: "https://rpc.ankr.com/eth_sepolia",
displayName: "Ethereum Sepolia Testnet",
blockExplorerUrl: "https://sepolia.etherscan.io",
ticker: "ETH",
tickerName: "Ethereum",
logo: "https://cryptologos.cc/logos/ethereum-eth-logo.png",
};

// focus-start
const accountAbstractionProvider = new AccountAbstractionProvider({
config: {
chainConfig,
bundlerConfig: {
// Get the pimlico API Key from dashboard.pimlico.io
url: `https://api.pimlico.io/v2/11155111/rpc?apikey=${pimlicoAPIKey}`,
},
smartAccountInit: new SafeSmartAccount(),
},
});
// focus-end
```

Please note this is the important step for setting the Web3Auth account abstraction provider.

- [Configure Smart Account provider](#configure-smart-account-provider)
- [Configure Bundler](configure-bundler)
- [Configure Sponsored Paymaster](#sponsored-paymaster)
- [Configure ERC-20 Paymaster](#erc20-paymaster)

## Configure Smart Account Provider

<ConfigureSmartAccountProvider />

## Configure Bundler

<ConfigureBundler />

## Configure Paymaster

You can configure the paymaster of your choice to sponsor gas fees for your users, along with the
paymaster context. The paymaster context lets you set additional parameters, such as choosing the
token for ERC-20 paymasters, defining gas policies, and more.

### Sponsored Paymaster

<ConfigureSponsoredPaymaster />

### ERC-20 Paymaster

<ConfigureERC20Paymaster />

## Set up

Once you have configured your AccountAbstractionProvider, you can now plug it in your Web3Auth Modal
instance. If you are also using the external wallets, you can define whether you want to use the
AccountAbstractionProvider, or EthereumPrivateKeyProvider by setting the `useAAWithExternalWallet`
in `Web3AuthOptions`.

### Configure Web3Auth Instance

<AAModalSetup />

### Configure Signer

<ConfigureSigners />

## Smart Account Address

<SmartAccountAddress />

## Send Transaction

<SmartAccountSendTransaction />

## Advanced Smart Account Operations

To learn more about supported transaction methods, and how to perform batch transactions,
[checkout our detailed documentation of AccountAbstractionProvider](/docs/sdk/pnp/web/providers/aa-provider).
120 changes: 120 additions & 0 deletions docs/sdk/pnp/web/no-modal/account-abstraction.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
title: Account Abstraction
sidebar_label: Account Abstraction
description: "@web3auth/no-modal Native Account Abstraction | Documentation - Web3Auth"
---

import AccountAbstractionDescription from "@site/src/common/sdk/pnp/web/_account-abstraction-description.mdx";
import AccountAbstractionProviderInstallation from "@site/src/common/sdk/pnp/web/_aa-provider-installation.mdx";
import ConfigureSmartAccountProvider from "@site/src/common/sdk/pnp/web/_smart-account-provider-configuration.mdx";
import ConfigureBundler from "@site/src/common/sdk/pnp/web/_bundler-configuration.mdx";
import ConfigureSponsoredPaymaster from "@site/src/common/sdk/pnp/web/_sponsored-paymaster-configuration.mdx";
import ConfigureERC20Paymaster from "@site/src/common/sdk/pnp/web/_erc20-paymaster-configuration.mdx";
import AANoModalSetup from "@site/src/common/sdk/pnp/web/_aa-no-modal-setup.mdx";
import ConfigureSigners from "@site/src/common/sdk/pnp/web/_configure-aa-signers.mdx";
import SmartAccountAddress from "@site/src/common/sdk/pnp/web/_aa-address.mdx";
import SmartAccountSendTransaction from "@site/src/common/sdk/pnp/web/_aa-send-transaction.mdx";

import GrowthPlanNote from "@site/src/common/docs/_growth_plan_note.mdx";

<AccountAbstractionDescription />
<GrowthPlanNote />

## Installation

<AccountAbstractionProviderInstallation />

## Configure

When instantiating the Account Abstraction Provider, you can pass configuration objects to the
constructor. These configuration options allow you to select the desired Account Abstraction (AA)
provider, as well as configure the bundler and paymaster, giving you flexibility and control over
the provider.

```tsx
import {
AccountAbstractionProvider,
SafeSmartAccount,
} from "@web3auth/account-abstraction-provider";

const chainConfig = {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: "0xaa36a7",
rpcTarget: "https://rpc.ankr.com/eth_sepolia",
displayName: "Ethereum Sepolia Testnet",
blockExplorerUrl: "https://sepolia.etherscan.io",
ticker: "ETH",
tickerName: "Ethereum",
logo: "https://cryptologos.cc/logos/ethereum-eth-logo.png",
};

// focus-start
const accountAbstractionProvider = new AccountAbstractionProvider({
config: {
chainConfig,
bundlerConfig: {
// Get the pimlico API Key from dashboard.pimlico.io
url: `https://api.pimlico.io/v2/11155111/rpc?apikey=${pimlicoAPIKey}`,
},
smartAccountInit: new SafeSmartAccount(),
},
});
// focus-end
```

Please note this is the important step for setting the Web3Auth account abstraction provider.

- [Configure Smart Account provider](#configure-smart-account-provider)
- [Configure Bundler](configure-bundler)
- [Configure Sponsored Paymaster](#sponsored-paymaster)
- [Configure ERC-20 Paymaster](#erc20-paymaster)

## Configure Smart Account Provider

<ConfigureSmartAccountProvider />

## Configure Bundler

<ConfigureBundler />

## Configure Paymaster

You can configure the paymaster of your choice to sponsor gas fees for your users, along with the
paymaster context. The paymaster context lets you set additional parameters, such as choosing the
token for ERC-20 paymasters, defining gas policies, and more.

### Sponsored Paymaster

<ConfigureSponsoredPaymaster />

### ERC-20 Paymaster

<ConfigureERC20Paymaster />

## Set up

Once you have configured your AccountAbstractionProvider, you can now plug it in your Web3Auth No
Modal instance. If you are also using the external wallets, you can define whether you want to use
the AccountAbstractionProvider, or EthereumPrivateKeyProvider by setting the
`useAAWithExternalWallet` in `IWeb3AuthCoreOptions`.

### Configure Web3Auth Instance

<AANoModalSetup />

### Configure Signer

<ConfigureSigners />

## Smart Account Address

<SmartAccountAddress />

## Send Transaction

<SmartAccountSendTransaction />

## Advanced Smart Account Operations

To learn more about supported transaction methods, and how to perform batch transactions,
[checkout our detailed documentation of AccountAbstractionProvider](/docs/sdk/pnp/web/providers/aa-provider).
Loading
Loading