Minor updates to debugstream, related to v2

This commit is contained in:
Valtteri Karesto
2022-03-16 19:01:13 +02:00
parent 0add65dd1c
commit be39054a2f

View File

@@ -72,9 +72,7 @@ const DebugStream = () => {
if (account && (!socket || !socket.url.endsWith(account))) {
socket?.close();
streamState.socket = ref(
new WebSocket(
`wss://hooks-testnet-debugstream-v2.xrpl-labs.com/${account}`
)
new WebSocket(`${process.env.NEXT_PUBLIC_DEBUG_STREAM_URL}/${account}`)
);
} else if (!account && socket) {
socket.close();
@@ -109,6 +107,14 @@ const DebugStream = () => {
};
const onMessage = (event: any) => {
if (!event.data) return;
// Filter out account_info and account_objects requests
if (
event.data.includes("account_info") ||
event.data.includes("account_objects")
) {
return;
}
console.log(event);
streamState.logs.push(prepareLog(event.data));
};