Skip to content

Commit

Permalink
feat: add user operation related rpc methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tomiir committed Feb 15, 2024
1 parent 937edb0 commit 2ad3559
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 12 additions & 0 deletions packages/wallet/src/W3mFrameSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ export const RpcEthGetTransactionByHash = z.object({
params: z.array(z.any())
})

export const RpcEthSendUserOperation = z.object({
method: z.literal('eth_sendUserOperation'),
params: z.array(z.any())
})

export const RpcEthEstimateUserOperationGas = z.object({
method: z.literal('eth_estimateUserOperationGas'),
params: z.array(z.any())
})

export const RpcEthBlockNumber = z.object({
method: z.literal('eth_blockNumber')
})
Expand Down Expand Up @@ -144,6 +154,8 @@ export const W3mFrameSchema = {
.or(RpcEthBlockNumber)
.or(RpcEthChainId)
.or(RpcEthGetTransactionByHash)
.or(RpcEthSendUserOperation)
.or(RpcEthEstimateUserOperationGas)
})
)

Expand Down
6 changes: 5 additions & 1 deletion packages/wallet/src/W3mFrameTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ import {
RpcEthChainId,
FrameSwitchNetworkResponse,
AppSyncDappDataRequest,
RpcEthGetTransactionByHash
RpcEthGetTransactionByHash,
RpcEthSendUserOperation,
RpcEthEstimateUserOperationGas
} from './W3mFrameSchema.js'

export namespace W3mFrameTypes {
Expand Down Expand Up @@ -72,6 +74,8 @@ export namespace W3mFrameTypes {
| z.infer<typeof RpcEthBlockNumber>
| z.infer<typeof RpcEthChainId>
| z.infer<typeof RpcEthGetTransactionByHash>
| z.infer<typeof RpcEthSendUserOperation>
| z.infer<typeof RpcEthEstimateUserOperationGas>

export type RPCResponse = z.infer<typeof RpcResponse>

Expand Down

0 comments on commit 2ad3559

Please sign in to comment.