mirror of
https://github.com/luxfi/market.git
synced 2026-09-24 00:25:57 +00:00
Fix websocket type error
This commit is contained in:
@@ -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>>
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user