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: wallet/how-to/send-transactions/send-batch-transactions.md
+33-20Lines changed: 33 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,37 +53,44 @@ const capabilities = await provider // Or window.ethereum if you don't support E
53
53
"method":"wallet_getCapabilities",
54
54
"params": [
55
55
"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.
57
57
],
58
58
});
59
59
```
60
60
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:
62
63
63
64
```json
64
65
{
65
-
"0x2105": {
66
+
"0x1": {
66
67
"atomic": {
67
-
"status": "supported"
68
+
"status": "ready"
68
69
}
69
70
},
70
-
"0x14A34": {
71
+
"0xaa36a7": {
71
72
"atomic": {
72
-
"status": "unsupported"
73
+
"status": "supported"
73
74
}
74
75
}
75
76
}
76
77
```
77
78
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`:
79
80
80
81
-`supported` means MetaMask supports atomic batch transactions for the account and chain ID.
81
82
-`ready` means MetaMask will prompt the user to upgrade their account to a MetaMask delegator account.
82
83
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.
85
84
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
87
94
- 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.
88
95
- If atomic batch is not supported, fall back to [`eth_sendTransaction`](index.md) instead of `wallet_sendCalls`,
89
96
and [`eth_getTransactionReceipt`](/wallet/reference/json-rpc-methods/eth_gettransactionreceipt)
@@ -93,8 +100,6 @@ instead of `wallet_getCallsStatus`.
93
100
### 2. Submit a batch of transactions
94
101
95
102
Use `wallet_sendCalls` to submit a batch of transactions.
96
-
Set `atomicRequired` to `true` to require MetaMask to execute the calls atomically.
97
-
98
103
For example:
99
104
100
105
```js title="index.js"
@@ -103,28 +108,33 @@ const result = await provider. // Or window.ethereum if you don't support EIP-69
103
108
"method":"wallet_sendCalls",
104
109
"params": [
105
110
{
106
-
version:"2.0.0",
111
+
version:"2.0.0",// The version of the API format. This must be 2.0.0.
107
112
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.
109
114
atomicRequired:true, // Whether or not atomicity is required.
0 commit comments