From e10da9a82de200b876e4ad702b38d628b697558e Mon Sep 17 00:00:00 2001 From: Lukas Rosario <36800180+lukasrosario@users.noreply.github.com> Date: Wed, 8 Jan 2025 15:03:24 -0500 Subject: [PATCH 1/7] update status codes --- EIPS/eip-5792.md | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/EIPS/eip-5792.md b/EIPS/eip-5792.md index 292ca7a6e28932..a696631e5c84af 100644 --- a/EIPS/eip-5792.md +++ b/EIPS/eip-5792.md @@ -125,8 +125,8 @@ Note that the `receipts` objects of this method's response is a strict subset of The `capabilitiesResultsData` object allows the wallets to attach a capability-specific metadata to the response. -* The receipts in the `receipts` field MUST be in order they are included on-chain. -* The `receipts` field MUST contain receipts for all calls in a batch that were included on-chain, including reverted ones. +* The receipts in the `receipts` field MUST be in order they are included onchain. +* The `receipts` field MUST contain receipts for all calls in a batch that were included onchain, including reverted ones. * If a wallet executes multiple calls atomically (i.e. in a single transaction), `wallet_getCallsStatus` MUST return a single receipt, corresponding to the transaction in which the calls were included. * The `logs` in the receipt objects MUST only include logs relevant to the calls submitted using `wallet_sendCalls`. For example, in the case of a transaction submitted onchain by an [ERC-4337](./eip-4337.md) bundler, the logs must only include those relevant to the user operation constructed using the calls submitted via `wallet_sendCalls`. I.e. the logs should not include those from other unrelated user operations submitted in the same bundle. @@ -157,16 +157,20 @@ type GetCallsResult = { ##### Status Codes for `batchStatus` field -The purpose of the `batchStatus` field is to provide a short summary of the current status of the batch. -It provides some off-chain context to the array of inner transaction `receipts`. +| Code | Description | +|------|-------------| +| 100 | Batch has been received by the wallet but has not completed execution onchain (pending) | +| 200 | Batch has been included onchain without reverts, receipts array contains info of all calls (confirmed) | +| 400 | Batch reverted completely and only changes related to gas charge may have been included onchain (chain rules failure) | +| 500 | Batch has not been included onchain and wallet will not retry (offchain failure) | -| Name | Description | -|-----------|----------------------------------------------------------------------------------------------------------------------| -| PENDING | Batch has been received by the wallet but has not completed execution on-chain | -| SUCCESS | Batch has been included on-chain without reverts, receipts array contains info of all calls | -| PARTIAL | Batch has been included on-chain only partially, the rest is either reverted or invalid. Receipts array contains info of all on-chain included calls | -| FAILURE | Batch has been invalid or reverted completely and only changes related to gas charge may have been included on-chain | -| DISCARDED | Batch has not been included on-chain and wallet will not retry | +Status codes follow these categories: +- 1xx: Pending states +- 2xx: Confirmed states +- 4xx: Chain rules failures +- 5xx: Offchain failures + +More specific status codes within these categories should be proposed and agreed upon in separate ERCs. ##### `wallet_getCallsStatus` Example Parameters @@ -184,7 +188,7 @@ The `callsID` batch identifier is a unique 64 bytes represented as a hex encoded { "chainId": "0x01", "callsId": "0x00000000000000000000000000000000000000000000000000000000000000000e670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", - "batchStatus": "SUCCESS", + "batchStatus": "200", "receipts": [ { "logs": [ From 0a705ca62469a7228c1c1967e250ee90330ce50b Mon Sep 17 00:00:00 2001 From: Lukas Rosario <36800180+lukasrosario@users.noreply.github.com> Date: Wed, 8 Jan 2025 15:07:48 -0500 Subject: [PATCH 2/7] lint --- EIPS/eip-5792.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/EIPS/eip-5792.md b/EIPS/eip-5792.md index a696631e5c84af..8de952130c501b 100644 --- a/EIPS/eip-5792.md +++ b/EIPS/eip-5792.md @@ -165,10 +165,10 @@ type GetCallsResult = { | 500 | Batch has not been included onchain and wallet will not retry (offchain failure) | Status codes follow these categories: -- 1xx: Pending states -- 2xx: Confirmed states -- 4xx: Chain rules failures -- 5xx: Offchain failures +* 1xx: Pending states +* 2xx: Confirmed states +* 4xx: Chain rules failures +* 5xx: Offchain failures More specific status codes within these categories should be proposed and agreed upon in separate ERCs. From 41b1024d1298ddd0c895968b3aca1b49aee90986 Mon Sep 17 00:00:00 2001 From: Lukas Rosario <36800180+lukasrosario@users.noreply.github.com> Date: Wed, 8 Jan 2025 16:15:23 -0500 Subject: [PATCH 3/7] push From cfe2529e43d1d1b8ba690a3976e2f8009e24ca4a Mon Sep 17 00:00:00 2001 From: Lukas Rosario <36800180+lukasrosario@users.noreply.github.com> Date: Wed, 8 Jan 2025 16:22:06 -0500 Subject: [PATCH 4/7] add note --- EIPS/eip-5792.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/EIPS/eip-5792.md b/EIPS/eip-5792.md index 86dced95c12a1b..2bc0004d0ec9a0 100644 --- a/EIPS/eip-5792.md +++ b/EIPS/eip-5792.md @@ -162,6 +162,9 @@ type GetCallsResult = { ##### Status Codes for `batchStatus` field +The purpose of the `batchStatus` field is to provide a short summary of the current status of the batch. +It provides some off-chain context to the array of inner transaction `receipts`. + | Code | Description | |------|-------------| | 100 | Batch has been received by the wallet but has not completed execution onchain (pending) | From c6f270056185263e13a383c432cc8926d1ec4b05 Mon Sep 17 00:00:00 2001 From: Lukas Rosario <36800180+lukasrosario@users.noreply.github.com> Date: Wed, 8 Jan 2025 16:51:11 -0500 Subject: [PATCH 5/7] lint --- EIPS/eip-5792.md | 1 + 1 file changed, 1 insertion(+) diff --git a/EIPS/eip-5792.md b/EIPS/eip-5792.md index 2bc0004d0ec9a0..1239c5d2541634 100644 --- a/EIPS/eip-5792.md +++ b/EIPS/eip-5792.md @@ -173,6 +173,7 @@ It provides some off-chain context to the array of inner transaction `receipts`. | 500 | Batch has not been included onchain and wallet will not retry (offchain failure) | Status codes follow these categories: + * 1xx: Pending states * 2xx: Confirmed states * 4xx: Chain rules failures From ad36c642943e73029dfa145a460d56d1916d1273 Mon Sep 17 00:00:00 2001 From: Lukas Rosario <36800180+lukasrosario@users.noreply.github.com> Date: Fri, 10 Jan 2025 10:50:20 -0500 Subject: [PATCH 6/7] address comments --- EIPS/eip-5792.md | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/EIPS/eip-5792.md b/EIPS/eip-5792.md index 1239c5d2541634..c30f4343682594 100644 --- a/EIPS/eip-5792.md +++ b/EIPS/eip-5792.md @@ -41,8 +41,8 @@ The items in the `calls` field are simple `{to, data, value}` tuples. The capabilities field is how an app can communicate with a wallet about capabilities a wallet supports. For example, this is where an app can specify a paymaster service URL from which an [ERC-4337](./eip-4337.md) wallet can request a `paymasterAndData` input for a user operation. Each capability defined in the "capabilities" member can define global or call specific fields. -These fields are set inside this capability's entry in the `capabilitiesData` object. -Each entity in the `calls` field may contain an optional `capabilitiesData` object. +These fields are set inside this capability's entry in the `capabilities` object. +Each entity in the `calls` field may contain an optional `capabilities` object. This object allows the applications to attach a capability-specific metadata to individual calls. The wallet: @@ -72,7 +72,7 @@ type SendCallsParams = { to?: `0x${string}` | undefined; data?: `0x${string}` | undefined; value?: `0x${string}` | undefined; // Hex value - capabilitiesData?: Record | undefined; + capabilities?: Record | undefined; }[]; capabilities?: Record | undefined; }; @@ -128,7 +128,7 @@ Returns the status of a call batch that was sent via `wallet_sendCalls`. The identifier of the batch is the value returned from the `wallet_sendCalls` RPC. Note that the `receipts` objects of this method's response is a strict subset of the object returned by `eth_getTransactionReceipt`. -The `capabilitiesResultsData` object allows the wallets to attach a capability-specific metadata to the response. +The `capabilities` object allows the wallets to attach a capability-specific metadata to the response. * The receipts in the `receipts` field MUST be in order they are included onchain. * The `receipts` field MUST contain receipts for all calls in a batch that were included onchain, including reverted ones. @@ -141,9 +141,9 @@ The `capabilitiesResultsData` object allows the wallets to attach a capability-s type GetCallsParams = string; type GetCallsResult = { - callsId: `0x${string}`; + id: `0x${string}`; chainId?: `0x${string}`; - batchStatus: string; // See "Status Codes" + status: string; // See "Status Codes" receipts?: { logs: { address: `0x${string}`; @@ -156,13 +156,13 @@ type GetCallsResult = { gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[]; - capabilitiesResultsData?: Record | undefined; + capabilities?: Record | undefined; }; ``` -##### Status Codes for `batchStatus` field +##### Status Codes for `status` field -The purpose of the `batchStatus` field is to provide a short summary of the current status of the batch. +The purpose of the `status` field is to provide a short summary of the current status of the batch. It provides some off-chain context to the array of inner transaction `receipts`. | Code | Description | @@ -183,7 +183,7 @@ More specific status codes within these categories should be proposed and agreed ##### `wallet_getCallsStatus` Example Parameters -The `callsID` batch identifier is a unique 64 bytes represented as a hex encoded string returned from `wallet_sendCalls`. +The `id` batch identifier is a unique 64 bytes represented as a hex encoded string returned from `wallet_sendCalls`. ```json [ @@ -196,8 +196,8 @@ The `callsID` batch identifier is a unique 64 bytes represented as a hex encoded ```json { "chainId": "0x01", - "callsId": "0x00000000000000000000000000000000000000000000000000000000000000000e670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", - "batchStatus": "200", + "id": "0x00000000000000000000000000000000000000000000000000000000000000000e670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", + "status": "200", "receipts": [ { "logs": [ @@ -253,7 +253,6 @@ If any of these supplemental expressions of capabilities are contradicted by cap Capabilities are returned in key/value pairs, with the key naming a capability and a value conforming to a shape defined for that name, in an object keyed to the relevant [EIP-155](./eip-155.md) `chainId` expressed in hexadecimal notation. Capabilities are nested in per-chain objects because wallets may support different capabilities across multiple chains authorized in a given session. -All values for the "capability" fields MUST contain Semantic Version value `version`. ```typescript type GetCapabilitiesParams = [`0x${string}`, [`0x${string}`]]; // Wallet address, array of queried chain ids (optional) @@ -275,15 +274,15 @@ The capabilities below are for illustrative purposes. { "0x2105": { "paymasterService": { - "version": "1.0.0" + "supported": true }, "sessionKeys": { - "version": "1.0.0" + "supported": true } }, "0x14A34": { "paymasterService": { - "version": "1.0.0" + "supported": true } } } From 746cc8cdf0ef5a2a4fed8b9886ccd0f5244ff12c Mon Sep 17 00:00:00 2001 From: Lukas Rosario <36800180+lukasrosario@users.noreply.github.com> Date: Sat, 11 Jan 2025 17:52:18 -0500 Subject: [PATCH 7/7] add capabilities to response --- EIPS/eip-5792.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/EIPS/eip-5792.md b/EIPS/eip-5792.md index c30f4343682594..2e997354116001 100644 --- a/EIPS/eip-5792.md +++ b/EIPS/eip-5792.md @@ -77,7 +77,10 @@ type SendCallsParams = { capabilities?: Record | undefined; }; -type SendCallsResult = string; +type SendCallsResult = { + id: string; + capabilities?: Record | undefined; +}; ``` ##### `wallet_sendCalls` Example Parameters @@ -115,11 +118,14 @@ Note that since the `paymasterService` `capability` is marked as optional, walle ##### `wallet_sendCalls` Example Return Value The identifier MUST be unique 64 bytes represented as a hex encoded string. -For a given session, users should be able to call `wallet_getCallsStatus` with this value and expect a call-batch status -to be returned. +For a given session, users should be able to call `wallet_getCallsStatus` with this value and expect a call-batch status to be returned. + +The `capabilities` object allows the wallets to attach a capability-specific metadata to the response. ```json -"0x00000000000000000000000000000000000000000000000000000000000000000e670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" +{ + "id": "0x00000000000000000000000000000000000000000000000000000000000000000e670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", +} ``` ### `wallet_getCallsStatus`