Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix links, slight file restructure
  • Loading branch information
alexandratran committed Nov 27, 2025
commit b39a1a11ac9ca071e57ab543d087b7aee859d028
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const sessionAccount = privateKeyToAccount("0x...");
Currently, Advanced Permissions do not support automatically upgrading a MetaMask user's account to a [MetaMask smart account](../../concepts/smart-accounts.md). Therefore, you must
ensure that the user is upgraded to a smart account before requesting Advanced Permissions.

If the user has not yet been upgraded, you can handle the upgrade [programmatically](/sdk/evm/connect/guides/javascript/send-transactions/batch-transactions) or ask the
If the user has not yet been upgraded, you can handle the upgrade [programmatically](/sdk/evm/connect/guides/send-transactions/batch-transactions) or ask the
user to [switch to a smart account manually](https://support.metamask.io/configure/accounts/switch-to-or-revert-from-a-smart-account/#how-to-switch-to-a-metamask-smart-account).

:::info Why is a Smart Account upgrade is required?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const sessionAccount = privateKeyToAccount("0x...");
Currently, ERC-7715 does not support automatically upgrading a MetaMask user's account to a [MetaMask smart account](../../concepts/smart-accounts.md). Therefore, you must
ensure that the user is upgraded to a smart account before requesting ERC-7715 permissions.

If the user has not yet been upgraded, you can handle the upgrade [programmatically](/sdk/evm/connect/guides/javascript/send-transactions/batch-transactions) or ask the
If the user has not yet been upgraded, you can handle the upgrade [programmatically](/sdk/evm/connect/guides/send-transactions/batch-transactions) or ask the
user to [switch to a smart account manually](https://support.metamask.io/configure/accounts/switch-to-or-revert-from-a-smart-account/#how-to-switch-to-a-metamask-smart-account).

:::info Why is a Smart Account upgrade is required?
Expand Down
16 changes: 12 additions & 4 deletions sdk-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,21 @@ const sdkSidebar = {
'evm/connect/guides/interact-with-contracts',
{
type: 'category',
label: 'MetaMask Exclusive',
label: 'MetaMask exclusive',
collapsible: true,
collapsed: true,
items: [
'evm/connect/guides/metamask-exclusive/batch-requests',
'evm/connect/guides/metamask-exclusive/use-deeplinks',
'evm/connect/guides/metamask-exclusive/display-tokens',
],
},
{
type: 'category',
label: 'Best practices',
collapsible: true,
collapsed: true,
items: [
'evm/connect/guides/batch-requests',
'evm/connect/guides/use-deeplinks',
'evm/connect/guides/display-tokens',
'evm/connect/guides/best-practices/display',
'evm/connect/guides/best-practices/run-devnet',
'evm/connect/guides/best-practices/production-readiness',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ For example:

- **Clear feedback** - Display user friendly messages when wallet connection or transaction errors occur (for example, network switch failures or user rejections).

- **Event management** - If you're using Vanilla JavaScript, handle MetaMask events such as [`chainChanged`](../../../reference/provider-api.md#chainchanged)
and [`accountsChanged`](../../../reference/provider-api.md#accountschanged) to promptly update the UI and internal state.
- **Event management** - If you're using Vanilla JavaScript, handle MetaMask events such as [`chainChanged`](../../reference/provider-api.md#chainchanged)
and [`accountsChanged`](../../reference/provider-api.md#accountschanged) to promptly update the UI and internal state.
If you're using Wagmi, you generally don't need to handle MetaMask events, because the hooks will handle the events for you.
2 changes: 1 addition & 1 deletion sdk/evm/connect/guides/best-practices/run-devnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Follow these steps to connect MetaMask to Hardhat Network.

:::tip
Alternatively, you can add Hardhat Network to MetaMask using
[`wallet_addEthereumChain`](../../../reference/json-rpc-api/index.md).
[`wallet_addEthereumChain`](../../reference/json-rpc-api/index.md).
:::

## Reset your local nonce calculation
Expand Down
8 changes: 4 additions & 4 deletions sdk/evm/connect/guides/interact-with-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ async function updateMessageExample() {

You can implement smart contract interactions directly in JavaScript.

The following example reads contract data using the [`eth_call`](../../reference/json-rpc-api/index.md) RPC method:
The following example reads contract data using the [`eth_call`](../reference/json-rpc-api/index.md) RPC method:

```javascript
import { createEVMClient } from '@metamask/connect/evm'
Expand Down Expand Up @@ -463,9 +463,9 @@ async function displayBalance() {
}
```

The following example writes to contracts using the [`eth_requestAccounts`](../../reference/json-rpc-api/index.md),
[`eth_sendTransaction`](../../reference/json-rpc-api/index.md), and
[`eth_getTransactionReceipt`](../../reference/json-rpc-api/index.md)
The following example writes to contracts using the [`eth_requestAccounts`](../reference/json-rpc-api/index.md),
[`eth_sendTransaction`](../reference/json-rpc-api/index.md), and
[`eth_getTransactionReceipt`](../reference/json-rpc-api/index.md)
RPC methods:

```javascript
Expand Down
10 changes: 5 additions & 5 deletions sdk/evm/connect/guides/manage-networks.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ With MM Connect, you can:
You can implement network management directly in JavaScript.

The following example detects the current network using the
[`eth_chainId`](../../reference/json-rpc-api/index.md) RPC method and
[`chainChanged`](../../reference/provider-api.md#chainchanged) provider event:
[`eth_chainId`](../reference/json-rpc-api/index.md) RPC method and
[`chainChanged`](../reference/provider-api.md#chainchanged) provider event:

```javascript
import { createEVMClient } from '@metamask/connect/evm'
Expand Down Expand Up @@ -56,8 +56,8 @@ provider.on('chainChanged', chainId => {
```

The following example switches networks using the
[`wallet_switchEthereumChain`](../../reference/json-rpc-api/index.md)
and [`wallet_addEthereumChain`](../../reference/json-rpc-api/index.md)
[`wallet_switchEthereumChain`](../reference/json-rpc-api/index.md)
and [`wallet_addEthereumChain`](../reference/json-rpc-api/index.md)
RPC methods:

```javascript
Expand Down Expand Up @@ -148,7 +148,7 @@ The following table lists common network management errors and their codes:

| Error code | Description | Solution |
| ---------- | ----------------------- | ------------------------------------------------------------------------------------------------ |
| `4902` | Network not added | Use [`wallet_addEthereumChain`](../../reference/json-rpc-api/index.md) to add the network first. |
| `4902` | Network not added | Use [`wallet_addEthereumChain`](../reference/json-rpc-api/index.md) to add the network first. |
| `4001` | User rejected request | Show a message asking the user to approve the network switch. |
| `-32002` | Request already pending | Disable the switch network button while the request is pending. |

Expand Down
6 changes: 3 additions & 3 deletions sdk/evm/connect/guides/manage-user-accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ With MM Connect, you can:
## Connect wallet

You can implement user authentication directly in JavaScript, using the
[`eth_requestAccounts`](../../reference/json-rpc-api/index.md) RPC method
and [`accountsChanged`](../../reference/provider-api.md#accountschanged) provider event.
[`eth_requestAccounts`](../reference/json-rpc-api/index.md) RPC method
and [`accountsChanged`](../reference/provider-api.md#accountschanged) provider event.
For example:

```javascript
Expand Down Expand Up @@ -99,7 +99,7 @@ Display connect and disconnect buttons in HTML:

## Connect and sign

You can use MM Connect's [`connectAndSign`](../../reference/methods.md#connectandsign) method to request wallet access and sign a message in a single user interaction.
You can use MM Connect's [`connectAndSign`](../reference/methods.md#connectandsign) method to request wallet access and sign a message in a single user interaction.
For example:

```js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ These requests can be contract calls or other JSON-RPC methods (for example, sig
Despite being batched into one HTTP request, each call still requires individual user approval, and if any request is rejected, the entire batch fails.

:::info
"Batching" can also refer to [Wagmi contract read batching](./wagmi/interact-with-contracts.md#batch-contract-reads) or
[sending atomic batch transactions](send-transactions/batch-transactions.md) in MetaMask.
"Batching" can also refer to [Wagmi contract read batching](../wagmi/interact-with-contracts.md#batch-contract-reads) or
[sending atomic batch transactions](../send-transactions/batch-transactions.md) in MetaMask.
:::

## Batch JSON-RPC requests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ try {

:::note
If the chain ID of your token doesn't match the user's network, they can get unexpected results.
We recommend [detecting the user's network chain ID](manage-networks.md) and
We recommend [detecting the user's network chain ID](../manage-networks.md) and
prompting them to switch chains, if necessary.
:::

Expand All @@ -101,10 +101,10 @@ The add NFT interfaces look like the following:

<div class="imgRow">
<div class="imgCol">
<img src={require("../_assets/watchasset-nft.png").default} alt="NFT confirmation" class="appScreen" />
<img src={require("../../_assets/watchasset-nft.png").default} alt="NFT confirmation" class="appScreen" />
</div>
<div class="imgCol">
<img src={require("../_assets/watchasset-nft-2.png").default} alt="Multiple NFTs confirmation" class="appScreen" />
<img src={require("../../_assets/watchasset-nft-2.png").default} alt="Multiple NFTs confirmation" class="appScreen" />
</div>
</div>

Expand Down
18 changes: 9 additions & 9 deletions sdk/evm/connect/guides/send-transactions/batch-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ description: Send atomic batch transactions using `wallet_sendCalls`.
You can send and manage batch transactions in MetaMask, using the methods specified by
[EIP-5792](https://eips.ethereum.org/EIPS/eip-5792):

- [`wallet_getCapabilities`](../../../reference/json-rpc-api/index.md) - Query whether support for atomic batch transactions is available.
- [`wallet_sendCalls`](../../../reference/json-rpc-api/index.md) - Submit multiple transactions to be processed atomically by MetaMask.
- [`wallet_getCallsStatus`](../../../reference/json-rpc-api/index.md) - Track the status of your transaction batch.
- [`wallet_getCapabilities`](../../reference/json-rpc-api/index.md) - Query whether support for atomic batch transactions is available.
- [`wallet_sendCalls`](../../reference/json-rpc-api/index.md) - Submit multiple transactions to be processed atomically by MetaMask.
- [`wallet_getCallsStatus`](../../reference/json-rpc-api/index.md) - Track the status of your transaction batch.

## About atomic batch transactions

Expand Down Expand Up @@ -45,7 +45,7 @@ You can send batch transactions using the following third-party libraries that s

### 1. Query whether atomic batch is supported

Use [`wallet_getCapabilities`](../../../reference/json-rpc-api/index.md) to query
Use [`wallet_getCapabilities`](../../reference/json-rpc-api/index.md) to query
whether MetaMask supports atomic batch transactions for a specific address and specific chain IDs.
For example:

Expand Down Expand Up @@ -113,14 +113,14 @@ MetaMask will support this feature on more networks as they adopt EIP-7702.
:::note Atomic batch unsupported
- If the user has already upgraded their account to a third-party smart contract account, MetaMask does not currently support atomic batch transactions for that account.
- If atomic batch is not supported, fall back to [`eth_sendTransaction`](index.md) instead of
[`wallet_sendCalls`](../../../reference/json-rpc-api/index.md),
and [`eth_getTransactionReceipt`](../../../reference/json-rpc-api/index.md)
instead of [`wallet_getCallsStatus`](../../../reference/json-rpc-api/index.md).
[`wallet_sendCalls`](../../reference/json-rpc-api/index.md),
and [`eth_getTransactionReceipt`](../../reference/json-rpc-api/index.md)
instead of [`wallet_getCallsStatus`](../../reference/json-rpc-api/index.md).
:::

### 2. Submit a batch of transactions

Use [`wallet_sendCalls`](../../../reference/json-rpc-api/index.md) to submit a batch of transactions.
Use [`wallet_sendCalls`](../../reference/json-rpc-api/index.md) to submit a batch of transactions.
For example:

```js title="index.js"
Expand Down Expand Up @@ -164,7 +164,7 @@ For example:

### 3. Track the status of the batch of transactions

Use [`wallet_getCallsStatus`](../../../reference/json-rpc-api/index.md) to track
Use [`wallet_getCallsStatus`](../../reference/json-rpc-api/index.md) to track
the status of the submitted batch of transactions, using the batch ID returned by `wallet_sendCalls`.
For example:

Expand Down
2 changes: 1 addition & 1 deletion sdk/evm/connect/guides/send-transactions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ const receipt = await web3.eth.sendTransaction({

## Send an advanced transaction with gas estimation

To add gas estimation, use the [`eth_estimateGas`](../../../reference/json-rpc-api/index.md)
To add gas estimation, use the [`eth_estimateGas`](../../reference/json-rpc-api/index.md)
RPC method.

```javascript
Expand Down
4 changes: 2 additions & 2 deletions sdk/evm/connect/guides/sign-data/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ sign data using an unsupported method, in which case we recommend using your sta

## Use `eth_signTypedData_v4`

[`eth_signTypedData_v4`](../../../reference/json-rpc-api/index.md)
[`eth_signTypedData_v4`](../../reference/json-rpc-api/index.md)
provides the most human-readable signatures that are efficient to process onchain.
It follows the [EIP-712](https://eips.ethereum.org/EIPS/eip-712) specification to allow users to sign
typed structured data that can be verified onchain.
Expand Down Expand Up @@ -422,7 +422,7 @@ const signature = await web3.eth.sendAsync(method, params)

## Use `personal_sign`

[`personal_sign`](../../../reference/json-rpc-api/index.md) is the
[`personal_sign`](../../reference/json-rpc-api/index.md) is the
easiest way to request human-readable signatures that don't need to be efficiently processed onchain.
It's often used for signature challenges that are authenticated on a web server, such as
[Sign-In with Ethereum](siwe.md).
Expand Down
2 changes: 1 addition & 1 deletion sdk/evm/connect/guides/sign-data/siwe.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This is to not break existing dapps that may have use cases for mismatched domai
## Example

The following is an example of setting up SIWE with MetaMask using
[`personal_sign`](../../../reference/json-rpc-api/index.md):
[`personal_sign`](../../reference/json-rpc-api/index.md):

```javascript title="index.js"
import { createEVMClient } from '@metamask/connect/evm'
Expand Down
2 changes: 1 addition & 1 deletion sdk/evm/connect/guides/wagmi/interact-with-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ In this example, four contract read calls are batched together.
The results are returned as an array in the same order as the calls, allowing you to process each result accordingly.

:::info
"Batching" can also refer to [batching JSON-RPC requests](../batch-requests.md) using MM Connect's `metamask_batch` method, or [sending atomic batch transactions](../send-transactions/batch-transactions.md) in MetaMask.
"Batching" can also refer to [batching JSON-RPC requests](../metamask-exclusive/batch-requests.md) using MM Connect's `metamask_batch` method, or [sending atomic batch transactions](../send-transactions/batch-transactions.md) in MetaMask.
:::

## Write to contracts
Expand Down
4 changes: 2 additions & 2 deletions sdk/evm/connect/quickstart/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ console.log('eth_accounts result:', result)

`evmClient.connect()` handles cross-platform connection (desktop and mobile), including deeplinking.

Use `provider.request()` for arbitrary [JSON-RPC requests](../reference/json-rpc-api/index.md) like `eth_chainId` or `eth_getBalance`, or for [batching requests](../guides/batch-requests.md) via `metamask_batch`.
Use `provider.request()` for arbitrary [JSON-RPC requests](../reference/json-rpc-api/index.md) like `eth_chainId` or `eth_getBalance`, or for [batching requests](../guides/metamask-exclusive/batch-requests.md) via `metamask_batch`.

## Common MM Connect methods at a glance

Expand All @@ -169,7 +169,7 @@ Use `provider.request()` for arbitrary [JSON-RPC requests](../reference/json-rpc
| [`connectAndSign({ msg: "..." })`](../reference/methods.md#connectandsign) | Connects and prompts user to sign a message |
| [`getProvider()`](../reference/methods.md#getprovider) | Returns the provider object for RPC requests |
| [`provider.request({ method, params })`](../reference/provider-api.md#request) | Calls any Ethereum JSON‑RPC method |
| [Batched RPC](../guides/batch-requests.md) | Use `metamask_batch` to group multiple JSON-RPC requests |
| [Batched RPC](../guides/metamask-exclusive/batch-requests.md) | Use `metamask_batch` to group multiple JSON-RPC requests |

## Usage example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const sessionAccount = privateKeyToAccount("0x...");
Currently, Advanced Permissions do not support automatically upgrading a MetaMask user's account to a [MetaMask smart account](../../concepts/smart-accounts.md). Therefore, you must
ensure that the user is upgraded to a smart account before requesting Advanced Permissions.

If the user has not yet been upgraded, you can handle the upgrade [programmatically](/sdk/evm/connect/guides/javascript/send-transactions/batch-transactions) or ask the
If the user has not yet been upgraded, you can handle the upgrade [programmatically](/sdk/evm/connect/guides/send-transactions/batch-transactions) or ask the
user to [switch to a smart account manually](https://support.metamask.io/configure/accounts/switch-to-or-revert-from-a-smart-account/#how-to-switch-to-a-metamask-smart-account).

:::info Why is a Smart Account upgrade is required?
Expand Down
2 changes: 1 addition & 1 deletion src/pages/tutorials/upgrade-eoa-to-smart-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ When connected, the interface displays your connected wallet address:

### 4. Handle and send batch transactions

In `src/app/page.tsx`, use the [`useSendCalls`](https://wagmi.sh/react/api/hooks/useSendCalls) hook from Wagmi to handle and send [atomic batch transactions](/sdk/evm/connect/guides/javascript/send-transactions/batch-transactions).
In `src/app/page.tsx`, use the [`useSendCalls`](https://wagmi.sh/react/api/hooks/useSendCalls) hook from Wagmi to handle and send [atomic batch transactions](/sdk/evm/connect/guides/send-transactions/batch-transactions).
Also use React's `useState` hook to handle the transaction state.
The following example sends 0.001 and 0.0001 ETH in a batch transaction.
Replace `<YOUR-RECIPIENT-ADDRESS>` with recipient addresses of your choice:
Expand Down