From a6f10b4bf9b7ef55c4ce6d58ee63bf0b7eebe9e9 Mon Sep 17 00:00:00 2001 From: Lukas <36800180+lukasrosario@users.noreply.github.com> Date: Fri, 2 Aug 2024 16:04:26 -0400 Subject: [PATCH] Update ERC-7677: chain id update Merged by EIP-Bot. --- ERCS/erc-7677.md | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/ERCS/erc-7677.md b/ERCS/erc-7677.md index 8c155c41f4..528f0e279d 100644 --- a/ERCS/erc-7677.md +++ b/ERCS/erc-7677.md @@ -242,15 +242,18 @@ The `paymasterService` capability is implemented by both apps and wallets. #### App Implementation -Apps need to give wallets a paymaster service URL they can make the above RPC calls to. They can do this using the `paymasterService` capability as part of an [EIP-5792](./eip-5792.md) `wallet_sendCalls` call. +Apps need to give wallets paymaster service URLs they can make the above RPC calls to. They can do this using the `paymasterService` capability as part of an [EIP-5792](./eip-5792.md) `wallet_sendCalls` call. ##### `wallet_sendCalls` Paymaster Capability Specification ```typescript -type PaymasterCapabilityParams = { - url: string; - context: Record; -} +type PaymasterCapabilityParams = Record< + `0x${string}`, // Chain ID + { + url: string; // Paymaster service URL for provided chain ID + context: Record; // Additional data defined by paymaster service providers + } +>; ``` ###### `wallet_sendCalls` Example Parameters @@ -259,25 +262,34 @@ type PaymasterCapabilityParams = { [ { "version": "1.0", - "chainId": "0x01", "from": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "calls": [ { "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "value": "0x9184e72a", - "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675" + "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675", + "chainId": "0x01" }, { "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "value": "0x182183", - "data": "0xfbadbaf01" + "data": "0xfbadbaf01", + "chainId": "0x2105" } ], "capabilities": { "paymasterService": { - "url": "https://...", - "context": { - "policyId": "962b252c-a726-4a37-8d86-333ce0a07299" + "0x01": { + "url": "https://...", + "context": { + "policyId": "962b252c-a726-4a37-8d86-333ce0a07299" + } + }, + "0x2105": { + "url": "https://...", + "context": { + "policyId": "0a268db9-3243-4178-b1bd-d9b67a47d37b" + } } } } @@ -285,7 +297,7 @@ type PaymasterCapabilityParams = { ] ``` -The wallet will then make the above paymaster RPC calls to the URL specified in the `paymasterService` capability field. +The wallet will then make the above paymaster RPC calls to the URLs specified in the `paymasterService` capability field. #### Wallet Implementation