Skip to content

Commit

Permalink
Update ERC-7677: chain id update
Browse files Browse the repository at this point in the history
Merged by EIP-Bot.
  • Loading branch information
lukasrosario committed Aug 2, 2024
1 parent 802224e commit a6f10b4
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions ERCS/erc-7677.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>;
}
type PaymasterCapabilityParams = Record<
`0x${string}`, // Chain ID
{
url: string; // Paymaster service URL for provided chain ID
context: Record<string, any>; // Additional data defined by paymaster service providers
}
>;
```

###### `wallet_sendCalls` Example Parameters
Expand All @@ -259,33 +262,42 @@ 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"
}
}
}
}
}
]
```

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

Expand Down

0 comments on commit a6f10b4

Please sign in to comment.