@0x/mesh-rpc-client
Advanced tools
Comparing version 9.3.0 to 9.4.0
@@ -391,4 +391,16 @@ "use strict"; | ||
}); }); | ||
return [4 /*yield*/, deployment.client._subscribeToHeartbeatAsync(callback)]; | ||
// NOTE(jalextowle): We use string literal access here to | ||
// avoid casting `deployment.client` to `any` (this method | ||
// preserves most types of type-checking) and to allow us to | ||
// access the private method `_subscribeToHeartbeatAsync`. | ||
// Source: https://stackoverflow.com/a/35991491 | ||
// tslint:disable-next-line:no-string-literal | ||
return [4 /*yield*/, deployment.client['_subscribeToHeartbeatAsync'](callback)]; | ||
case 1: | ||
// NOTE(jalextowle): We use string literal access here to | ||
// avoid casting `deployment.client` to `any` (this method | ||
// preserves most types of type-checking) and to allow us to | ||
// access the private method `_subscribeToHeartbeatAsync`. | ||
// Source: https://stackoverflow.com/a/35991491 | ||
// tslint:disable-next-line:no-string-literal | ||
_a.sent(); | ||
@@ -734,7 +746,8 @@ return [2 /*return*/]; | ||
hasReceivedUnsubscribeMessage = false; | ||
wsServer.on('connect', (function (connection) { | ||
connection.on('message', (function (message) { return __awaiter(_this, void 0, void 0, function () { | ||
var jsonRpcRequest, response; | ||
wsServer.on('connect', function (connection) { | ||
connection.on('message', function (message) { return __awaiter(_this, void 0, void 0, function () { | ||
var wsMessage, jsonRpcRequest, response; | ||
return __generator(this, function (_a) { | ||
jsonRpcRequest = JSON.parse(message.utf8Data); | ||
wsMessage = message; | ||
jsonRpcRequest = JSON.parse(wsMessage.utf8Data); | ||
if (jsonRpcRequest.method === 'mesh_subscribe') { | ||
@@ -749,4 +762,4 @@ response = "\n {\n \"id\": \"" + jsonRpcRequest.id + "\",\n \"jsonrpc\": \"2.0\",\n \"result\": \"0xab1a3e8af590364c09d0fa6a12103ada\"\n }\n "; | ||
}); | ||
}); })); | ||
})); | ||
}); }); | ||
}); | ||
client = new index_1.WSClient("ws://localhost:" + mock_ws_server_1.SERVER_PORT); | ||
@@ -753,0 +766,0 @@ client.onClose(function () { |
{ | ||
"name": "@0x/mesh-rpc-client", | ||
"version": "9.3.0", | ||
"version": "9.4.0", | ||
"engines": { | ||
@@ -21,3 +21,3 @@ "node": ">=6.12" | ||
"watch:ts": "tsc -b -w", | ||
"clean": "shx rm -rf lib", | ||
"clean": "shx rm -r ./lib && shx rm tsconfig.tsbuildinfo || exit 0", | ||
"lint": "tslint --format stylish --project .", | ||
@@ -74,3 +74,3 @@ "test": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --timeout 200000 --exit", | ||
"rimraf": "^3.0.0", | ||
"shx": "^0.2.2", | ||
"shx": "^0.3.2", | ||
"tslint": "5.11.0", | ||
@@ -77,0 +77,0 @@ "typedoc": "^0.15.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2257
168120
31