@@ -97,7 +97,7 @@ export async function waitForEOSE(ws: WebSocket, subscription: string): Promise<
9797 ws . once ( 'error' , onError )
9898
9999 function onMessage ( raw : RawData ) {
100- const message = JSON . parse ( raw . toString ( 'utf-8 ' ) )
100+ const message = JSON . parse ( raw . toString ( 'utf8 ' ) )
101101 if ( message [ 0 ] === MessageType . EOSE && message [ 1 ] === subscription ) {
102102 resolve ( )
103103 cleanup ( )
@@ -139,7 +139,7 @@ export async function waitForNextEvent(ws: WebSocket, subscription: string): Pro
139139 }
140140
141141 function onMessage ( raw : RawData ) {
142- const message = JSON . parse ( raw . toString ( 'utf-8 ' ) )
142+ const message = JSON . parse ( raw . toString ( 'utf8 ' ) )
143143 if ( message [ 0 ] === MessageType . EVENT && message [ 1 ] === subscription ) {
144144 resolve ( message [ 2 ] )
145145 cleanup ( )
@@ -172,7 +172,7 @@ export async function waitForEventCount(
172172 cleanup ( )
173173 }
174174 function onMessage ( raw : RawData ) {
175- const message = JSON . parse ( raw . toString ( 'utf-8 ' ) )
175+ const message = JSON . parse ( raw . toString ( 'utf8 ' ) )
176176 if ( message [ 0 ] === MessageType . EVENT && message [ 1 ] === subscription ) {
177177 events . push ( message [ 2 ] )
178178 if ( ! eose && events . length === count ) {
@@ -213,7 +213,7 @@ export async function waitForNotice(ws: WebSocket): Promise<void> {
213213 ws . once ( 'error' , onError )
214214
215215 function onMessage ( raw : RawData ) {
216- const message = JSON . parse ( raw . toString ( 'utf-8 ' ) )
216+ const message = JSON . parse ( raw . toString ( 'utf8 ' ) )
217217 if ( message [ 0 ] === MessageType . NOTICE ) {
218218 resolve ( message [ 1 ] )
219219 cleanup ( )
0 commit comments