Skip to content

Commit

Permalink
Fix websocket type error
Browse files Browse the repository at this point in the history
  • Loading branch information
pedromcunha committed Jan 25, 2024
1 parent 9aa56fe commit 401d1b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions context/WebsocketContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import React, {
FC,
PropsWithChildren,
} from 'react'
import { JsonObject } from 'react-use-websocket/dist/lib/types'

type WebsocketStore = {
subscriptions: Record<number, Record<string, number>>
Expand All @@ -22,8 +21,8 @@ function websocketStore() {
(
chainId: number,
messages: ReservoirWebsocketMessage[],
onSubscribe: (message: JsonObject) => void,
onUnsubscribe: (message: JsonObject) => void
onSubscribe: (message: any) => void,
onUnsubscribe: (message: any) => void
) => {
messages.forEach((message) => {
let subscription = message.event as string
Expand Down
5 changes: 2 additions & 3 deletions hooks/useTokenUpdateStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { WebsocketContext } from 'context/WebsocketContextProvider'
import useChainWebsocket from 'hooks/useChainWebsocket'
import { useContext, useEffect } from 'react'
import { Options } from 'react-use-websocket'
import { JsonObject } from 'react-use-websocket/dist/lib/types'
import chains, { DefaultChain } from 'utils/chains'
import validateEvent from 'utils/validateEvent'
import { NORMALIZE_ROYALTIES } from 'pages/_app'
Expand Down Expand Up @@ -74,11 +73,11 @@ export default (contract: string, chainId?: number, options: Options = {}) => {
},
]

const sendSubscribeMessages = (message: JsonObject) => {
const sendSubscribeMessages = (message: any) => {
websocket.sendJsonMessage(message)
}

const sendUnsubscribeMessages = (message: JsonObject) => {
const sendUnsubscribeMessages = (message: any) => {
websocket.sendJsonMessage(message)
}

Expand Down

1 comment on commit 401d1b3

@vercel
Copy link

@vercel vercel bot commented on 401d1b3 Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.