Fix WS Syncing. Remove requirement for connection. Clean ups. Fix blobs.
This commit is contained in:
+4
-8
@@ -1,17 +1,13 @@
|
||||
import { PrivateKey } from "@xo-cash/primitives";
|
||||
import { toExtendedJson } from "@xo-cash/utils";
|
||||
|
||||
import { SSEClient } from '../src/sse/client.js';
|
||||
|
||||
const testSSE = async () => {
|
||||
const privateKey = PrivateKey.fromString('c440ce6ac5b63ae7bc4af9891b80b7a88ccdeebba5e43246885e9ec56f912ac2');
|
||||
const client = new SSEClient('https://v2.sync.xo.harvmaster.com', privateKey, {
|
||||
onMessage: (message) => {
|
||||
console.log(toExtendedJson(message));
|
||||
},
|
||||
onError: (error) => {
|
||||
console.error(error);
|
||||
},
|
||||
const client = new SSEClient('https://v2.sync.xo.harvmaster.com', privateKey);
|
||||
|
||||
client.on('message', (message) => {
|
||||
console.log(message);
|
||||
});
|
||||
|
||||
// Connect to the sync server
|
||||
|
||||
+7
-4
@@ -1,19 +1,22 @@
|
||||
import { PrivateKey } from "@xo-cash/primitives";
|
||||
import { toExtendedJson } from "@xo-cash/utils";
|
||||
|
||||
import { WsClient } from '../src/ws/client.js';
|
||||
|
||||
const testWS = async () => {
|
||||
const privateKey = PrivateKey.fromString('c440ce6ac5b63ae7bc4af9891b80b7a88ccdeebba5e43246885e9ec56f912ac2');
|
||||
const client = new WsClient('https://v2.sync.xo.harvmaster.com', privateKey, {
|
||||
onMessage: (message) => {
|
||||
console.log(toExtendedJson(message));
|
||||
},
|
||||
// onMessage: (message) => {
|
||||
// console.log(toExtendedJson(message));
|
||||
// },
|
||||
onError: (error) => {
|
||||
console.error(error);
|
||||
},
|
||||
});
|
||||
|
||||
client.on('message', (message) => {
|
||||
console.log(message);
|
||||
});
|
||||
|
||||
// Connect to the sync server
|
||||
await client.connect();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user