@binance/common 1.2.6 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -128,6 +128,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
128
128
|
var import_crypto = __toESM(require("crypto"));
|
|
129
129
|
var import_fs = __toESM(require("fs"));
|
|
130
130
|
var import_https = __toESM(require("https"));
|
|
131
|
+
var import_json_with_bigint = require("json-with-bigint");
|
|
131
132
|
var import_os = require("os");
|
|
132
133
|
var import_axios = __toESM(require("axios"));
|
|
133
134
|
var signerCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -305,7 +306,7 @@ var httpRequestFunction = async function(axiosArgs, configuration) {
|
|
|
305
306
|
return {
|
|
306
307
|
data: async () => {
|
|
307
308
|
try {
|
|
308
|
-
return
|
|
309
|
+
return (0, import_json_with_bigint.JSONParse)(response.data);
|
|
309
310
|
} catch (err) {
|
|
310
311
|
throw new Error(`Failed to parse JSON response: ${err}`);
|
|
311
312
|
}
|
|
@@ -331,7 +332,7 @@ var httpRequestFunction = async function(axiosArgs, configuration) {
|
|
|
331
332
|
if (responseData && responseData !== null) {
|
|
332
333
|
if (typeof responseData === "string" && responseData !== "")
|
|
333
334
|
try {
|
|
334
|
-
data =
|
|
335
|
+
data = (0, import_json_with_bigint.JSONParse)(responseData);
|
|
335
336
|
} catch {
|
|
336
337
|
data = {};
|
|
337
338
|
}
|
|
@@ -789,6 +790,7 @@ var Logger = class _Logger {
|
|
|
789
790
|
// src/websocket.ts
|
|
790
791
|
var import_events = require("events");
|
|
791
792
|
var import_ws = __toESM(require("ws"));
|
|
793
|
+
var import_json_with_bigint2 = require("json-with-bigint");
|
|
792
794
|
var WebsocketEventEmitter = class {
|
|
793
795
|
constructor() {
|
|
794
796
|
this.eventEmitter = new import_events.EventEmitter();
|
|
@@ -1350,7 +1352,7 @@ var WebsocketAPIBase = class extends WebsocketCommon {
|
|
|
1350
1352
|
*/
|
|
1351
1353
|
onMessage(data, connection) {
|
|
1352
1354
|
try {
|
|
1353
|
-
const message =
|
|
1355
|
+
const message = (0, import_json_with_bigint2.JSONParse)(data);
|
|
1354
1356
|
const { id, status } = message;
|
|
1355
1357
|
if (id && connection.pendingRequests.has(id)) {
|
|
1356
1358
|
const request = connection.pendingRequests.get(id);
|
|
@@ -1538,7 +1540,7 @@ var WebsocketStreamsBase = class extends WebsocketCommon {
|
|
|
1538
1540
|
*/
|
|
1539
1541
|
onMessage(data, connection) {
|
|
1540
1542
|
try {
|
|
1541
|
-
const parsedData =
|
|
1543
|
+
const parsedData = (0, import_json_with_bigint2.JSONParse)(data);
|
|
1542
1544
|
const streamName = parsedData?.stream;
|
|
1543
1545
|
if (streamName && this.streamCallbackMap.has(streamName))
|
|
1544
1546
|
this.streamCallbackMap.get(streamName)?.forEach((callback) => callback(parsedData.data));
|