diff --git a/rpc/websockets.go b/rpc/websockets.go index 81b4948009..a52c609223 100644 --- a/rpc/websockets.go +++ b/rpc/websockets.go @@ -55,7 +55,7 @@ type WebsocketsServer interface { type SubscriptionResponseJSON struct { Jsonrpc string `json:"jsonrpc"` Result interface{} `json:"result"` - ID float64 `json:"id"` + ID interface{} `json:"id,omitempty"` } type SubscriptionNotification struct { @@ -225,11 +225,11 @@ func (s *websocketsServer) readLoop(wsConn *wsConn) { continue } - connID, ok := msg["id"].(float64) + connID, ok := msg["id"] if !ok { s.sendErrResponse( wsConn, - fmt.Errorf("invalid type for connection ID: %T", msg["id"]).Error(), + "missing required connection ID", ) continue }