diff --git a/centrifuge-app/package.json b/centrifuge-app/package.json index 85925dfbce..8a6eb6677d 100644 --- a/centrifuge-app/package.json +++ b/centrifuge-app/package.json @@ -34,6 +34,7 @@ "@styled-system/css": "^5.1.5", "bn.js": "^5.2.1", "formik": "^2.4.5", + "isomorphic-ws": "^5.0.0", "merkletreejs": "^0.3.11", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -47,7 +48,8 @@ "styled-components": "^5.3.5", "styled-system": "^5.1.5", "typescript": "~5.3.3", - "vitest": "^1.2.1" + "vitest": "^1.2.1", + "ws": "^8.18.0" }, "devDependencies": { "@synthetixio/synpress": "^3.7.3", @@ -61,6 +63,7 @@ "@types/styled-system": "^5", "@types/styled-system__css": "^5.0.16", "@types/styled-system__should-forward-prop": "^5", + "@types/ws": "^8", "@typescript-eslint/eslint-plugin": "5.30.5", "@typescript-eslint/parser": "5.30.5", "@vitejs/plugin-react": "^4.2.1", diff --git a/centrifuge-js/src/CentrifugeBase.ts b/centrifuge-js/src/CentrifugeBase.ts index 5314d2b02b..8481f8039c 100644 --- a/centrifuge-js/src/CentrifugeBase.ts +++ b/centrifuge-js/src/CentrifugeBase.ts @@ -6,6 +6,7 @@ import { hexToBn } from '@polkadot/util' import { sortAddresses } from '@polkadot/util-crypto' import type { JsonRpcSigner, TransactionRequest } from 'ethers' import 'isomorphic-fetch' +import WebSocket from 'isomorphic-ws' import { Observable, Subject, diff --git a/package.json b/package.json index b24b41f85a..e165e0481d 100644 --- a/package.json +++ b/package.json @@ -51,5 +51,6 @@ "@types/react": "^18.0.27", "@types/eslint": "7.28.0", "@babel/traverse": "^7.23.9" - } + }, + "packageManager": "yarn@3.6.4" } diff --git a/yarn.lock b/yarn.lock index ccd31ddb8c..129c93d1e8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1749,6 +1749,7 @@ __metadata: "@types/styled-system": ^5 "@types/styled-system__css": ^5.0.16 "@types/styled-system__should-forward-prop": ^5 + "@types/ws": ^8 "@typescript-eslint/eslint-plugin": 5.30.5 "@typescript-eslint/parser": 5.30.5 "@vitejs/plugin-react": ^4.2.1 @@ -1760,6 +1761,7 @@ __metadata: eslint-config-react-app: ^7.0.1 eslint-plugin-react: 7.30.1 formik: ^2.4.5 + isomorphic-ws: ^5.0.0 merkletreejs: ^0.3.11 nodemon: ^2.0.20 npm-run-all: ^4.1.5 @@ -1778,6 +1780,7 @@ __metadata: vite: ^5 vite-plugin-node-polyfills: ^0.19.0 vitest: ^1.2.1 + ws: ^8.18.0 languageName: unknown linkType: soft @@ -9544,6 +9547,15 @@ __metadata: languageName: node linkType: hard +"@types/ws@npm:^8": + version: 8.5.12 + resolution: "@types/ws@npm:8.5.12" + dependencies: + "@types/node": "*" + checksum: ddefb6ad1671f70ce73b38a5f47f471d4d493864fca7c51f002a86e5993d031294201c5dced6d5018fb8905ad46888d65c7f20dd54fc165910b69f42fba9a6d0 + languageName: node + linkType: hard + "@types/ws@npm:^8.5.5": version: 8.5.10 resolution: "@types/ws@npm:8.5.10" @@ -19166,6 +19178,15 @@ __metadata: languageName: node linkType: hard +"isomorphic-ws@npm:^5.0.0": + version: 5.0.0 + resolution: "isomorphic-ws@npm:5.0.0" + peerDependencies: + ws: "*" + checksum: e20eb2aee09ba96247465fda40c6d22c1153394c0144fa34fe6609f341af4c8c564f60ea3ba762335a7a9c306809349f9b863c8beedf2beea09b299834ad5398 + languageName: node + linkType: hard + "isows@npm:1.0.3": version: 1.0.3 resolution: "isows@npm:1.0.3" @@ -28262,6 +28283,21 @@ __metadata: languageName: node linkType: hard +"ws@npm:^8.18.0": + version: 8.18.0 + resolution: "ws@npm:8.18.0" + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ">=5.0.2" + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: 91d4d35bc99ff6df483bdf029b9ea4bfd7af1f16fc91231a96777a63d263e1eabf486e13a2353970efc534f9faa43bdbf9ee76525af22f4752cbc5ebda333975 + languageName: node + linkType: hard + "xml-name-validator@npm:^3.0.0": version: 3.0.0 resolution: "xml-name-validator@npm:3.0.0"