Skip to content

Commit 1978d56

Browse files
committed
updates
1 parent 0dba363 commit 1978d56

File tree

1 file changed

+33
-20
lines changed

1 file changed

+33
-20
lines changed

wallet/how-to/send-transactions/send-batch-transactions.md

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -53,37 +53,44 @@ const capabilities = await provider // Or window.ethereum if you don't support E
5353
"method": "wallet_getCapabilities",
5454
"params": [
5555
"0xd46e8dd67c5d32be8058bb8eb970870f07244567", // The user's wallet address.
56-
["0x2105", "0x14A34"] // (Optional) A list of chain IDs to query for.
56+
["0x1", "0xaa36a7"] // (Optional) A list of chain IDs to query for.
5757
],
5858
});
5959
```
6060

61-
This method returns whether the `atomic` capability is supported for each chain ID:
61+
This method returns the status of the `atomic` capability for each chain ID.
62+
For example:
6263

6364
```json
6465
{
65-
"0x2105": {
66+
"0x1": {
6667
"atomic": {
67-
"status": "supported"
68+
"status": "ready"
6869
}
6970
},
70-
"0x14A34": {
71+
"0xaa36a7": {
7172
"atomic": {
72-
"status": "unsupported"
73+
"status": "supported"
7374
}
7475
}
7576
}
7677
```
7778

78-
The `atomic` capability can have a `status` of `supported`, `ready`, or `unsupported`:
79+
The `atomic` capability can have a `status` of `supported` or `ready`:
7980

8081
- `supported` means MetaMask supports atomic batch transactions for the account and chain ID.
8182
- `ready` means MetaMask will prompt the user to upgrade their account to a MetaMask delegator account.
8283
If the user approves, the `status` will upgrade to `supported`.
83-
- `unsupported` means MetaMask does not support atomic batch transactions for the account and chain ID, and will not
84-
suggest an upgrade to the user.
8584

86-
:::note
85+
If the `atomic` capability is not `supported` or `ready` for a specified chain ID, MetaMask will not return anything for that chain ID.
86+
If you don't specify any chain IDs in `wallet_getCapabilities`, MetaMask will return all chains in the wallet where the `atomic` capability is `supported` or `ready`.
87+
88+
:::info Supported networks
89+
MetaMask currently supports atomic batch transactions on Ethereum Mainnet, Ethereum Sepolia, and Gnosis Mainnet.
90+
MetaMask will support this feature on more networks as they adopt EIP-7702.
91+
:::
92+
93+
:::note Atomic batch unsupported
8794
- 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.
8895
- If atomic batch is not supported, fall back to [`eth_sendTransaction`](index.md) instead of `wallet_sendCalls`,
8996
and [`eth_getTransactionReceipt`](/wallet/reference/json-rpc-methods/eth_gettransactionreceipt)
@@ -93,8 +100,6 @@ instead of `wallet_getCallsStatus`.
93100
### 2. Submit a batch of transactions
94101

95102
Use `wallet_sendCalls` to submit a batch of transactions.
96-
Set `atomicRequired` to `true` to require MetaMask to execute the calls atomically.
97-
98103
For example:
99104

100105
```js title="index.js"
@@ -103,28 +108,33 @@ const result = await provider. // Or window.ethereum if you don't support EIP-69
103108
"method": "wallet_sendCalls",
104109
"params": [
105110
{
106-
version: "2.0.0",
111+
version: "2.0.0", // The version of the API format. This must be 2.0.0.
107112
from: "0xd46e8dd67c5d32be8058bb8eb970870f07244567", // The sender's address.
108-
chainId: "0x2105", // The chain ID, which must match the currently selected network.
113+
chainId: "0xaa36a7", // The chain ID, which must match the currently selected network.
109114
atomicRequired: true, // Whether or not atomicity is required.
110115
calls: [ // The list of calls to send as a batch.
111116
{
112117
to: "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
113-
value: "0x9184e72a",
114-
data: "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
118+
value: "0x0"
115119
},
116120
{
117121
to: "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
118-
value: "0x182183",
119-
data: "0xfbadbaf01"
122+
value: "0x0"
120123
}
121124
]
122125
}
123126
],
124127
});
125128
```
126129

127-
This method returns a batch ID that you can use to track the status of the batch:
130+
:::note Atomic required parameter
131+
MetaMask only supports using `wallet_sendCalls` to send atomic batch transactions (not sequential batch transactions),
132+
so `atomicRequired` can be set to either `true` or `false`.
133+
If the `atomic` capability is not supported, `wallet_sendCalls` will return an error.
134+
:::
135+
136+
This method returns a batch ID that you can use to track the status of the batch.
137+
For example:
128138

129139
```json
130140
{
@@ -152,12 +162,15 @@ This method returns status information about the batch of transactions, includin
152162

153163
- The status code of the batch.
154164
- Whether the batch was executed atomically.
165+
Currently, this will always be `true` if the execution was successful.
155166
- A list of transaction receipts.
156167

168+
For example:
169+
157170
```json
158171
{
159172
"version": "2.0.0",
160-
"chainId": "0x2105",
173+
"chainId": "0xaa36a7",
161174
"id": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331",
162175
"status": 200, // Status code. 200 means confirmed.
163176
"atomic": true, // Whether the calls were executed atomically.

0 commit comments

Comments
 (0)