wapi-client 0.6.16 → 0.6.21
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/api/index.d.ts
CHANGED
|
@@ -1732,7 +1732,12 @@ var require_event_target = __commonJS({
|
|
|
1732
1732
|
};
|
|
1733
1733
|
Object.defineProperty(MessageEvent3.prototype, "data", { enumerable: true });
|
|
1734
1734
|
var EventTarget = {
|
|
1735
|
-
addEventListener(type,
|
|
1735
|
+
addEventListener(type, handler, options = {}) {
|
|
1736
|
+
for (const listener of this.listeners(type)) {
|
|
1737
|
+
if (!options[kForOnEventAttribute] && listener[kListener] === handler && !listener[kForOnEventAttribute]) {
|
|
1738
|
+
return;
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1736
1741
|
let wrapper;
|
|
1737
1742
|
if (type === "message") {
|
|
1738
1743
|
wrapper = function onMessage(data, isBinary) {
|
|
@@ -1740,7 +1745,7 @@ var require_event_target = __commonJS({
|
|
|
1740
1745
|
data: isBinary ? data : data.toString()
|
|
1741
1746
|
});
|
|
1742
1747
|
event[kTarget] = this;
|
|
1743
|
-
|
|
1748
|
+
callListener(handler, this, event);
|
|
1744
1749
|
};
|
|
1745
1750
|
} else if (type === "close") {
|
|
1746
1751
|
wrapper = function onClose(code, message) {
|
|
@@ -1750,7 +1755,7 @@ var require_event_target = __commonJS({
|
|
|
1750
1755
|
wasClean: this._closeFrameReceived && this._closeFrameSent
|
|
1751
1756
|
});
|
|
1752
1757
|
event[kTarget] = this;
|
|
1753
|
-
|
|
1758
|
+
callListener(handler, this, event);
|
|
1754
1759
|
};
|
|
1755
1760
|
} else if (type === "error") {
|
|
1756
1761
|
wrapper = function onError(error) {
|
|
@@ -1759,19 +1764,19 @@ var require_event_target = __commonJS({
|
|
|
1759
1764
|
message: error.message
|
|
1760
1765
|
});
|
|
1761
1766
|
event[kTarget] = this;
|
|
1762
|
-
|
|
1767
|
+
callListener(handler, this, event);
|
|
1763
1768
|
};
|
|
1764
1769
|
} else if (type === "open") {
|
|
1765
1770
|
wrapper = function onOpen() {
|
|
1766
1771
|
const event = new Event("open");
|
|
1767
1772
|
event[kTarget] = this;
|
|
1768
|
-
|
|
1773
|
+
callListener(handler, this, event);
|
|
1769
1774
|
};
|
|
1770
1775
|
} else {
|
|
1771
1776
|
return;
|
|
1772
1777
|
}
|
|
1773
1778
|
wrapper[kForOnEventAttribute] = !!options[kForOnEventAttribute];
|
|
1774
|
-
wrapper[kListener] =
|
|
1779
|
+
wrapper[kListener] = handler;
|
|
1775
1780
|
if (options.once) {
|
|
1776
1781
|
this.once(type, wrapper);
|
|
1777
1782
|
} else {
|
|
@@ -1794,6 +1799,13 @@ var require_event_target = __commonJS({
|
|
|
1794
1799
|
EventTarget,
|
|
1795
1800
|
MessageEvent: MessageEvent3
|
|
1796
1801
|
};
|
|
1802
|
+
function callListener(listener, thisArg, event) {
|
|
1803
|
+
if (typeof listener === "object" && listener.handleEvent) {
|
|
1804
|
+
listener.handleEvent.call(listener, event);
|
|
1805
|
+
} else {
|
|
1806
|
+
listener.call(thisArg, event);
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1797
1809
|
}
|
|
1798
1810
|
});
|
|
1799
1811
|
|
|
@@ -2352,17 +2364,17 @@ var require_websocket = __commonJS({
|
|
|
2352
2364
|
websocket._url = address;
|
|
2353
2365
|
}
|
|
2354
2366
|
const isSecure = parsedUrl.protocol === "wss:";
|
|
2355
|
-
const
|
|
2356
|
-
let
|
|
2357
|
-
if (parsedUrl.protocol !== "ws:" && !isSecure && !
|
|
2358
|
-
|
|
2359
|
-
} else if (
|
|
2360
|
-
|
|
2367
|
+
const isIpcUrl = parsedUrl.protocol === "ws+unix:";
|
|
2368
|
+
let invalidUrlMessage;
|
|
2369
|
+
if (parsedUrl.protocol !== "ws:" && !isSecure && !isIpcUrl) {
|
|
2370
|
+
invalidUrlMessage = `The URL's protocol must be one of "ws:", "wss:", or "ws+unix:"`;
|
|
2371
|
+
} else if (isIpcUrl && !parsedUrl.pathname) {
|
|
2372
|
+
invalidUrlMessage = "The URL's pathname is empty";
|
|
2361
2373
|
} else if (parsedUrl.hash) {
|
|
2362
|
-
|
|
2374
|
+
invalidUrlMessage = "The URL contains a fragment identifier";
|
|
2363
2375
|
}
|
|
2364
|
-
if (
|
|
2365
|
-
const err = new SyntaxError(
|
|
2376
|
+
if (invalidUrlMessage) {
|
|
2377
|
+
const err = new SyntaxError(invalidUrlMessage);
|
|
2366
2378
|
if (websocket._redirects === 0) {
|
|
2367
2379
|
throw err;
|
|
2368
2380
|
} else {
|
|
@@ -2418,7 +2430,7 @@ var require_websocket = __commonJS({
|
|
|
2418
2430
|
if (parsedUrl.username || parsedUrl.password) {
|
|
2419
2431
|
opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;
|
|
2420
2432
|
}
|
|
2421
|
-
if (
|
|
2433
|
+
if (isIpcUrl) {
|
|
2422
2434
|
const parts = opts.path.split(":");
|
|
2423
2435
|
opts.socketPath = parts[0];
|
|
2424
2436
|
opts.path = parts[1];
|
|
@@ -2426,9 +2438,9 @@ var require_websocket = __commonJS({
|
|
|
2426
2438
|
let req;
|
|
2427
2439
|
if (opts.followRedirects) {
|
|
2428
2440
|
if (websocket._redirects === 0) {
|
|
2429
|
-
websocket.
|
|
2441
|
+
websocket._originalIpc = isIpcUrl;
|
|
2430
2442
|
websocket._originalSecure = isSecure;
|
|
2431
|
-
websocket._originalHostOrSocketPath =
|
|
2443
|
+
websocket._originalHostOrSocketPath = isIpcUrl ? opts.socketPath : parsedUrl.host;
|
|
2432
2444
|
const headers = options && options.headers;
|
|
2433
2445
|
options = __spreadProps(__spreadValues({}, options), { headers: {} });
|
|
2434
2446
|
if (headers) {
|
|
@@ -2437,7 +2449,7 @@ var require_websocket = __commonJS({
|
|
|
2437
2449
|
}
|
|
2438
2450
|
}
|
|
2439
2451
|
} else if (websocket.listenerCount("redirect") === 0) {
|
|
2440
|
-
const isSameHost =
|
|
2452
|
+
const isSameHost = isIpcUrl ? websocket._originalIpc ? opts.socketPath === websocket._originalHostOrSocketPath : false : websocket._originalIpc ? false : parsedUrl.host === websocket._originalHostOrSocketPath;
|
|
2441
2453
|
if (!isSameHost || websocket._originalSecure && !isSecure) {
|
|
2442
2454
|
delete opts.headers.authorization;
|
|
2443
2455
|
delete opts.headers.cookie;
|
|
@@ -6162,7 +6174,7 @@ var require_validate2 = __commonJS({
|
|
|
6162
6174
|
strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`);
|
|
6163
6175
|
}
|
|
6164
6176
|
});
|
|
6165
|
-
it
|
|
6177
|
+
narrowSchemaTypes(it, types);
|
|
6166
6178
|
}
|
|
6167
6179
|
function checkMultipleTypes(it, ts) {
|
|
6168
6180
|
if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) {
|
|
@@ -6187,6 +6199,16 @@ var require_validate2 = __commonJS({
|
|
|
6187
6199
|
function includesType(ts, t) {
|
|
6188
6200
|
return ts.includes(t) || t === "integer" && ts.includes("number");
|
|
6189
6201
|
}
|
|
6202
|
+
function narrowSchemaTypes(it, withTypes) {
|
|
6203
|
+
const ts = [];
|
|
6204
|
+
for (const t of it.dataTypes) {
|
|
6205
|
+
if (includesType(withTypes, t))
|
|
6206
|
+
ts.push(t);
|
|
6207
|
+
else if (withTypes.includes("integer") && t === "number")
|
|
6208
|
+
ts.push("integer");
|
|
6209
|
+
}
|
|
6210
|
+
it.dataTypes = ts;
|
|
6211
|
+
}
|
|
6190
6212
|
function strictTypesError(it, msg) {
|
|
6191
6213
|
const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
|
|
6192
6214
|
msg += ` at "${schemaPath}" (strictTypes)`;
|
|
@@ -10272,7 +10294,7 @@ var require_ajv = __commonJS({
|
|
|
10272
10294
|
"node_modules/ajv/dist/ajv.js"(exports, module2) {
|
|
10273
10295
|
"use strict";
|
|
10274
10296
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10275
|
-
exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
|
|
10297
|
+
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
|
|
10276
10298
|
var core_1 = require_core();
|
|
10277
10299
|
var draft7_1 = require_draft7();
|
|
10278
10300
|
var discriminator_1 = require_discriminator();
|
|
@@ -10324,6 +10346,14 @@ var require_ajv = __commonJS({
|
|
|
10324
10346
|
Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function() {
|
|
10325
10347
|
return codegen_1.CodeGen;
|
|
10326
10348
|
} });
|
|
10349
|
+
var validation_error_1 = require_validation_error();
|
|
10350
|
+
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function() {
|
|
10351
|
+
return validation_error_1.default;
|
|
10352
|
+
} });
|
|
10353
|
+
var ref_error_1 = require_ref_error();
|
|
10354
|
+
Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function() {
|
|
10355
|
+
return ref_error_1.default;
|
|
10356
|
+
} });
|
|
10327
10357
|
}
|
|
10328
10358
|
});
|
|
10329
10359
|
|
|
@@ -29994,7 +30024,7 @@ var BaseClient = class {
|
|
|
29994
30024
|
};
|
|
29995
30025
|
|
|
29996
30026
|
// package.json
|
|
29997
|
-
var version = "0.6.
|
|
30027
|
+
var version = "0.6.21";
|
|
29998
30028
|
|
|
29999
30029
|
// src/api/ws-client.ts
|
|
30000
30030
|
function createClient(opts) {
|
|
@@ -31454,9 +31484,7 @@ function findTransfers(options, input, fnOptions) {
|
|
|
31454
31484
|
);
|
|
31455
31485
|
}
|
|
31456
31486
|
if (returnRunningBalance) {
|
|
31457
|
-
findOptions.return_running_balance_for_wallet = getForeign(
|
|
31458
|
-
returnRunningBalance
|
|
31459
|
-
);
|
|
31487
|
+
findOptions.return_running_balance_for_wallet = getForeign(returnRunningBalance);
|
|
31460
31488
|
}
|
|
31461
31489
|
if (returnSigned) {
|
|
31462
31490
|
findOptions.return_signed_amount_for_wallet = getForeign(returnSigned);
|