Skip to content

Commit

Permalink
feat: up ERC-7715 interface
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Nov 18, 2024
1 parent ae3b8ae commit 103de69
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 31 deletions.
5 changes: 5 additions & 0 deletions .changeset/fresh-baboons-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"viem": patch
---

Updated ERC-7715 JSON-RPC interface to the latest spec changes.
61 changes: 30 additions & 31 deletions src/types/eip1193.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,45 +143,44 @@ export type WalletCallReceipt<quantity = Hex, status = Hex> = {
}

export type WalletGrantPermissionsParameters = {
address?: Address | undefined
chainId?: Hex | undefined
expiry: number
permissions?:
| readonly {
data: unknown
policies: readonly {
data: unknown
type: string
}[]
required?: boolean | undefined
type: string
}[]
| undefined
signer?:
| {
type: string
data?: unknown | undefined
}
| undefined
permissions: readonly {
data: unknown
policies: readonly {
data: unknown
type: string
}[]
required?: boolean | undefined
type: string
}[]
expiry: number
}

export type WalletGrantPermissionsReturnType = {
expiry: number
factory?: `0x${string}` | undefined
factoryData?: string | undefined
grantedPermissions: readonly {
data: unknown
policies: readonly {
data: unknown
type: string
}[]
required?: boolean | undefined
type: string
}[]
permissionsContext: string
signerData?:
| {
userOpBuilder?: `0x${string}` | undefined
submitToAddress?: `0x${string}` | undefined
}
| undefined
}
export type WalletGrantPermissionsReturnType =
WalletGrantPermissionsParameters & {
accountMeta?:
| {
factory?: `0x${string}` | undefined
factoryData?: string | undefined
}
| undefined
context: Hex
signerMeta?:
| {
userOpBuilder?: `0x${string}` | undefined
submitToAddress?: `0x${string}` | undefined
}
| undefined
}

export type WalletGetCallsStatusReturnType<quantity = Hex, status = Hex> = {
status: 'PENDING' | 'CONFIRMED'
Expand Down

0 comments on commit 103de69

Please sign in to comment.