{"eip":7867,"title":"Flow Control Wallet Call Capability","description":"An EIP-5792 capability providing atomicity and flow control configuration.","authors":["Sam Wilson (@SamWilsn) \u003csam@binarycake.ca\u003e"],"status":"Stagnant","type":"Standards Track","category":"Interface","created":"2025-01-17","requires":[5792],"discussionsTo":"https://ethereum-magicians.org/t/wallet-sendcalls-capability-flow-control/22624","repo":"EIPs","label":"EIP-7867","officialUrl":"https://eips.ethereum.org/EIPS/eip-7867","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7867.md","url":"https://eips.huatuo.xyz/eip-7867/","tldr":{"en":"A flowControl capability for wallet_sendCalls that lets dapps relax atomicity (strict, loose, none) and choose per call whether a failure rolls back, halts or continues the batch.","ja":"wallet_sendCalls 向けの flowControl ケイパビリティ。dapp がアトミック性を緩め（strict、loose、none）、呼び出しごとに、失敗時にバッチをロールバックするか、停止するか、続行するかを選べるようにする。","ko":"wallet_sendCalls를 위한 flowControl 기능. dapp이 원자성(strict, loose, none)을 완화하고, 호출마다 실패 시 배치를 롤백할지, 중단할지, 계속할지 선택할 수 있게 한다.","zh":"为 wallet_sendCalls 提供的 flowControl 能力：让 dapp 可以放宽原子性（strict、loose、none），并为每次调用选择失败时回滚、中止还是继续整个批次。"},"tags":["wallet","json-rpc","batching","eip5792","ux"],"explainers":{"en":{"lang":"en","tldr":"A flowControl capability for wallet_sendCalls that lets dapps relax atomicity (strict, loose, none) and choose per call whether a failure rolls back, halts or continues the batch.","tags":["wallet","json-rpc","batching","eip5792","ux"],"related":[5792,7702,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7867/","markdown":"## What problem does it solve?\n\n[EIP-5792](/eip-5792/) gives dapps `wallet_sendCalls`, a way to ask a wallet to run a batch of calls, such as \"approve, then swap\". Its default is all-or-nothing: the calls run atomically, and if any fails, the whole batch rolls back.\n\nThat is perfect for smart contract wallets, but too strict for many cases:\n\n- A dapp may batch unrelated calls just to save clicks or gas, and would rather keep the ones that succeed.\n- A plain EOA cannot execute several calls atomically on its own, but could send them one after another, or get near-atomic inclusion through a block builder.\n\nEIP-7867 adds a `flowControl` capability so a dapp can say exactly what it needs and a wallet can say exactly what it can offer.\n\n## How it works\n\n**Batch scope: `atomicity`**\n\n| Value | Guarantee |\n| --- | --- |\n| `strict` (default) | Calls are contiguous and atomic: today's EIP-5792 behaviour |\n| `loose` | Same as strict unless there is a reorg; after a reorg, some calls may land separately, with other transactions in between |\n| `none` | Only that calls land in order; others may be interleaved, and the wallet may split them over several transactions |\n\n**Call scope: `onFailure`**\n\n| Value | Meaning |\n| --- | --- |\n| `rollback` (default) | Critical call: if it fails, the whole batch rolls back |\n| `halt` | Stop here; earlier successful calls stay |\n| `continue` | Ignore the failure and carry on |\n\n`rollback` is not allowed in a `none` batch. If any call uses `flowControl`, the batch must declare it too, or the wallet rejects with `MISSING_CAP`.\n\nWallets advertise what they support through `wallet_getCapabilities`, as a map of atomicity level to supported `onFailure` modes. `wallet_getCallsStatus` gains two new status codes, `102` (partially executed) and `207` (partial success: only `continue` calls failed), and clarifies when existing codes such as `500` and `600` apply.\n\n## Sample code\n\nCheck capabilities, then send a loose batch where the second call may fail without undoing the first:\n\n```ts\nconst caps = await provider.request({ method: \"wallet_getCapabilities\", params: [account] });\n// e.g. { \"0x1\": { \"flowControl\": { \"loose\": [\"halt\", \"continue\"], \"strict\": [\"continue\"] } } }\n\nconst { id } = await provider.request({\n  method: \"wallet_sendCalls\",\n  params: [{\n    version: \"1.0\",\n    from: account,\n    chainId: \"0x1\",\n    capabilities: { flowControl: { atomicity: \"loose\" } },\n    calls: [\n      { to: token, data: approveData },\n      { to: router, data: swapData, capabilities: { flowControl: { onFailure: \"continue\" } } },\n    ],\n  }],\n});\n\nconst status = await provider.request({ method: \"wallet_getCallsStatus\", params: [id] });\n// status.status: 200 all ok, 207 partial success, 102 still in progress, ...\n```\n\nNote that `approve` above has no `onFailure`, so it is a critical (`rollback`) call: if it fails, nothing is kept.\n\n## Things to know\n\n- Status is **Stagnant**. Numeric values for the new error codes (`INVALID_SCHEMA`, `MISSING_CAP`, `UNSUPPORTED_LEVEL`, and others) are still TODO, so wallets cannot implement it interoperably yet.\n- Unless atomicity is `strict`, other people's transactions may land between your calls. Apps should put deadlines and slippage limits in the calls themselves, just as for separate transactions.\n- Even strict batches can flip between success and failure after a reorg, and with non-strict levels there is no time limit on when all calls land.\n- A wallet that only supports `strict` should quietly upgrade `loose` requests to strict, but must not advertise `loose`. An EOA upgraded via [EIP-7702](/eip-7702/) can offer strict atomicity natively.\n"},"ja":{"lang":"ja","tldr":"wallet_sendCalls 向けの flowControl ケイパビリティ。dapp がアトミック性を緩め（strict、loose、none）、呼び出しごとに、失敗時にバッチをロールバックするか、停止するか、続行するかを選べるようにする。","tags":["wallet","json-rpc","batching","eip5792","ux"],"related":[5792,7702,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7867/","markdown":"## 何を解決するのか\n\n[EIP-5792](/eip-5792/) は dapp に `wallet_sendCalls` を提供します。これは、「approve してから swap」のようなバッチの呼び出しをウォレットに実行してもらうための方法です。デフォルトは全か無かで、呼び出しはアトミックに実行され、どれか 1 つでも失敗するとバッチ全体がロールバックされます。\n\nこれはスマートコントラクトウォレットには最適ですが、多くのケースでは厳しすぎます。\n\n- dapp は、クリック数や gas を節約するためだけに無関係な呼び出しをまとめることがあり、成功したものは残したい場合があります。\n- 通常の EOA は、複数の呼び出しを単独ではアトミックに実行できませんが、順番に送ったり、ブロックビルダー経由でほぼアトミックなインクルージョンを得たりすることはできます。\n\nEIP-7867 は `flowControl` ケイパビリティを追加し、dapp が必要なことを正確に伝え、ウォレットが提供できることを正確に伝えられるようにします。\n\n## 仕組み\n\n**バッチのスコープ: `atomicity`**\n\n| 値 | 保証 |\n| --- | --- |\n| `strict`（デフォルト） | 呼び出しは連続していてアトミック。現在の EIP-5792 の動作 |\n| `loose` | リオーグがない限り strict と同じ。リオーグ後は、一部の呼び出しが別々に取り込まれ、間に他のトランザクションが挟まることがある |\n| `none` | 呼び出しが順番どおりに取り込まれることだけを保証する。他のトランザクションが挟まる可能性があり、ウォレットは複数のトランザクションに分割してよい |\n\n**呼び出しのスコープ: `onFailure`**\n\n| 値 | 意味 |\n| --- | --- |\n| `rollback`（デフォルト） | 重要な呼び出し。失敗するとバッチ全体がロールバックされる |\n| `halt` | ここで停止する。それまでに成功した呼び出しは残る |\n| `continue` | 失敗を無視して続行する |\n\n`none` のバッチでは `rollback` は使えません。いずれかの呼び出しが `flowControl` を使う場合は、バッチもそれを宣言する必要があり、そうでなければウォレットは `MISSING_CAP` で拒否します。\n\nウォレットは `wallet_getCapabilities` で、アトミック性のレベルと、サポートする `onFailure` モードの対応表として、対応内容を広告します。`wallet_getCallsStatus` には新たに 2 つのステータスコード、`102`（部分的に実行済み）と `207`（部分的な成功: `continue` の呼び出しだけが失敗）が加わり、`500` や `600` などの既存コードがいつ適用されるかが明確化されます。\n\n## サンプルコード\n\nケイパビリティを確認してから、2 つ目の呼び出しが失敗しても 1 つ目が取り消されない loose なバッチを送信します。\n\n```ts\nconst caps = await provider.request({ method: \"wallet_getCapabilities\", params: [account] });\n// e.g. { \"0x1\": { \"flowControl\": { \"loose\": [\"halt\", \"continue\"], \"strict\": [\"continue\"] } } }\n\nconst { id } = await provider.request({\n  method: \"wallet_sendCalls\",\n  params: [{\n    version: \"1.0\",\n    from: account,\n    chainId: \"0x1\",\n    capabilities: { flowControl: { atomicity: \"loose\" } },\n    calls: [\n      { to: token, data: approveData },\n      { to: router, data: swapData, capabilities: { flowControl: { onFailure: \"continue\" } } },\n    ],\n  }],\n});\n\nconst status = await provider.request({ method: \"wallet_getCallsStatus\", params: [id] });\n// status.status: 200 all ok, 207 partial success, 102 still in progress, ...\n```\n\n上の `approve` には `onFailure` がないため、重要な（`rollback` の）呼び出しになります。これが失敗すると、何も残りません。\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** です。新しいエラーコード（`INVALID_SCHEMA`、`MISSING_CAP`、`UNSUPPORTED_LEVEL` など）の数値はまだ TODO のため、ウォレットは相互運用可能な形ではまだ実装できません。\n- アトミック性が `strict` でない限り、他の人のトランザクションが呼び出しの間に入り込むことがあります。アプリは、別々のトランザクションの場合と同じように、デッドラインやスリッページの上限を呼び出し自体に含めるべきです。\n- strict なバッチでも、リオーグ後に成功と失敗が入れ替わることがあり、strict でないレベルでは、すべての呼び出しがいつまでに取り込まれるかに時間制限がありません。\n- `strict` のみをサポートするウォレットは、`loose` のリクエストを黙って strict に引き上げてよいですが、`loose` を広告してはいけません。[EIP-7702](/eip-7702/) でアップグレードされた EOA は、strict なアトミック性をネイティブに提供できます。\n"},"ko":{"lang":"ko","tldr":"wallet_sendCalls를 위한 flowControl 기능. dapp이 원자성(strict, loose, none)을 완화하고, 호출마다 실패 시 배치를 롤백할지, 중단할지, 계속할지 선택할 수 있게 한다.","tags":["wallet","json-rpc","batching","eip5792","ux"],"related":[5792,7702,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7867/","markdown":"## 어떤 문제를 해결하나요?\n\n[EIP-5792](/eip-5792/)는 dapp에 `wallet_sendCalls`를 제공합니다. \"approve한 다음 swap\"처럼 호출 묶음을 지갑에 실행해 달라고 요청하는 방법입니다. 기본값은 전부 아니면 전무입니다. 호출은 원자적으로 실행되고 하나라도 실패하면 배치 전체가 롤백됩니다.\n\n스마트 컨트랙트 지갑에는 완벽하지만, 많은 경우에는 지나치게 엄격합니다.\n\n- dapp은 클릭 수나 gas를 아끼려고 서로 무관한 호출을 묶을 수 있고, 성공한 것은 남기고 싶을 수 있습니다.\n- 일반 EOA는 여러 호출을 혼자서 원자적으로 실행할 수 없지만, 차례로 보내거나 블록 빌더를 통해 거의 원자적인 포함을 얻을 수는 있습니다.\n\nEIP-7867은 `flowControl` 기능을 추가해, dapp이 필요한 것을 정확히 말하고 지갑이 제공할 수 있는 것을 정확히 말할 수 있게 합니다.\n\n## 어떻게 동작하나요?\n\n**배치 범위: `atomicity`**\n\n| 값 | 보장 |\n| --- | --- |\n| `strict`(기본값) | 호출이 연속적이고 원자적: 현재 EIP-5792의 동작 |\n| `loose` | 리오르그가 없다면 strict와 같음. 리오르그 이후에는 일부 호출이 따로 포함되어 그 사이에 다른 트랜잭션이 끼어들 수 있음 |\n| `none` | 호출이 순서대로 포함된다는 것만 보장. 다른 트랜잭션이 끼어들 수 있고 지갑이 여러 트랜잭션으로 나눌 수 있음 |\n\n**호출 범위: `onFailure`**\n\n| 값 | 의미 |\n| --- | --- |\n| `rollback`(기본값) | 중요한 호출: 실패하면 배치 전체가 롤백됨 |\n| `halt` | 여기서 멈춤. 앞서 성공한 호출은 유지됨 |\n| `continue` | 실패를 무시하고 계속 진행 |\n\n`none` 배치에서는 `rollback`을 쓸 수 없습니다. 어떤 호출이든 `flowControl`을 사용한다면 배치도 이를 선언해야 하며, 그렇지 않으면 지갑이 `MISSING_CAP`으로 거부합니다.\n\n지갑은 `wallet_getCapabilities`를 통해 원자성 수준별로 지원하는 `onFailure` 모드의 맵으로 지원 범위를 알립니다. `wallet_getCallsStatus`에는 두 개의 새 상태 코드가 추가됩니다. `102`(부분 실행됨)와 `207`(부분 성공: `continue` 호출만 실패)이며, `500`과 `600` 같은 기존 코드가 언제 적용되는지도 명확해집니다.\n\n## 샘플 코드\n\n기능을 확인한 다음, 두 번째 호출이 실패해도 첫 번째 호출이 취소되지 않는 loose 배치를 보냅니다.\n\n```ts\nconst caps = await provider.request({ method: \"wallet_getCapabilities\", params: [account] });\n// e.g. { \"0x1\": { \"flowControl\": { \"loose\": [\"halt\", \"continue\"], \"strict\": [\"continue\"] } } }\n\nconst { id } = await provider.request({\n  method: \"wallet_sendCalls\",\n  params: [{\n    version: \"1.0\",\n    from: account,\n    chainId: \"0x1\",\n    capabilities: { flowControl: { atomicity: \"loose\" } },\n    calls: [\n      { to: token, data: approveData },\n      { to: router, data: swapData, capabilities: { flowControl: { onFailure: \"continue\" } } },\n    ],\n  }],\n});\n\nconst status = await provider.request({ method: \"wallet_getCallsStatus\", params: [id] });\n// status.status: 200 all ok, 207 partial success, 102 still in progress, ...\n```\n\n위의 `approve`에는 `onFailure`가 없으므로 중요한(`rollback`) 호출입니다. 이것이 실패하면 아무것도 유지되지 않습니다.\n\n## 알아둘 점\n\n- 상태는 **Stagnant**입니다. 새 오류 코드(`INVALID_SCHEMA`, `MISSING_CAP`, `UNSUPPORTED_LEVEL` 등)의 숫자 값은 아직 TODO이므로, 지갑이 호환 가능하게 구현하기는 아직 어렵습니다.\n- 원자성이 `strict`가 아니라면 다른 사람의 트랜잭션이 여러분의 호출 사이에 끼어들 수 있습니다. 앱은 별도의 트랜잭션일 때와 마찬가지로 데드라인과 슬리피지 한도를 호출 자체에 넣어야 합니다.\n- strict 배치도 리오르그 이후에는 성공과 실패가 뒤바뀔 수 있고, strict가 아닌 수준에서는 모든 호출이 언제까지 포함되어야 하는지에 시간 제한이 없습니다.\n- `strict`만 지원하는 지갑은 `loose` 요청을 조용히 strict로 올려도 되지만 `loose`를 광고해서는 안 됩니다. [EIP-7702](/eip-7702/)로 업그레이드된 EOA는 strict 원자성을 네이티브로 제공할 수 있습니다.\n"},"zh":{"lang":"zh","tldr":"为 wallet_sendCalls 提供的 flowControl 能力：让 dapp 可以放宽原子性（strict、loose、none），并为每次调用选择失败时回滚、中止还是继续整个批次。","tags":["wallet","json-rpc","batching","eip5792","ux"],"related":[5792,7702,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7867/","markdown":"## 它解决什么问题？\n\n[EIP-5792](/eip-5792/) 为 dapp 提供了 `wallet_sendCalls`，用来请求钱包执行一批调用，例如\"先 approve，再 swap\"。它的默认行为是要么全成要么全不成：这些调用以原子方式执行，只要有一个失败，整个批次就会回滚。\n\n这对智能合约钱包来说非常合适，但对许多情形过于严格：\n\n- dapp 可能只是为了节省点击或 gas 而把互不相关的调用打包，更希望保留那些成功的调用。\n- 普通 EOA 自己无法原子地执行多个调用，但可以逐个发送，或者通过区块构建者获得近似原子的打包。\n\nEIP-7867 增加了 `flowControl` 能力，让 dapp 能准确说明自己需要什么，钱包也能准确说明自己能提供什么。\n\n## 它如何运作\n\n**批次范围：`atomicity`**\n\n| 值 | 保证 |\n| --- | --- |\n| `strict`（默认） | 调用是连续且原子的：即现在 EIP-5792 的行为 |\n| `loose` | 除非发生重组，否则与 strict 相同；重组之后，某些调用可能被分开打包，中间夹杂着其他交易 |\n| `none` | 只保证调用按顺序落地；其他交易可能夹在其间，钱包也可以把它们拆分到多笔交易中 |\n\n**调用范围：`onFailure`**\n\n| 值 | 含义 |\n| --- | --- |\n| `rollback`（默认） | 关键调用：一旦失败，整个批次回滚 |\n| `halt` | 在此处停止；之前成功的调用保留 |\n| `continue` | 忽略失败并继续 |\n\n`none` 批次中不允许使用 `rollback`。如果任何调用使用了 `flowControl`，批次也必须声明它，否则钱包会以 `MISSING_CAP` 拒绝。\n\n钱包通过 `wallet_getCapabilities` 声明自己支持什么，格式是从原子性级别到所支持的 `onFailure` 模式的映射。`wallet_getCallsStatus` 新增了两个状态码：`102`（部分已执行）和 `207`（部分成功：只有 `continue` 的调用失败），并澄清了 `500` 和 `600` 等现有状态码适用的时机。\n\n## 示例代码\n\n先检查能力，然后发送一个 loose 批次，其中第二个调用失败也不会撤销第一个：\n\n```ts\nconst caps = await provider.request({ method: \"wallet_getCapabilities\", params: [account] });\n// e.g. { \"0x1\": { \"flowControl\": { \"loose\": [\"halt\", \"continue\"], \"strict\": [\"continue\"] } } }\n\nconst { id } = await provider.request({\n  method: \"wallet_sendCalls\",\n  params: [{\n    version: \"1.0\",\n    from: account,\n    chainId: \"0x1\",\n    capabilities: { flowControl: { atomicity: \"loose\" } },\n    calls: [\n      { to: token, data: approveData },\n      { to: router, data: swapData, capabilities: { flowControl: { onFailure: \"continue\" } } },\n    ],\n  }],\n});\n\nconst status = await provider.request({ method: \"wallet_getCallsStatus\", params: [id] });\n// status.status: 200 all ok, 207 partial success, 102 still in progress, ...\n```\n\n请注意，上面的 `approve` 没有 `onFailure`，所以它是关键（`rollback`）调用：如果它失败，什么都不会保留。\n\n## 需要注意\n\n- 状态为 **Stagnant**。新错误码（`INVALID_SCHEMA`、`MISSING_CAP`、`UNSUPPORTED_LEVEL` 等）的数值仍是 TODO，因此钱包还无法实现可互操作的版本。\n- 除非原子性为 `strict`，否则别人的交易可能夹在你的调用之间。应用应像处理分开的交易那样，把截止时间和滑点限制放进调用本身。\n- 即使是 strict 批次，在重组之后也可能在成功与失败之间翻转；而在非 strict 级别下，所有调用何时落地没有时间限制。\n- 只支持 `strict` 的钱包应当悄悄地把 `loose` 请求升级为 strict，但不得声明支持 `loose`。通过 [EIP-7702](/eip-7702/) 升级的 EOA 可以原生提供 strict 原子性。\n"}}}
