@sentio/sdk-bundle 4.0.1-rc.2 → 4.0.1-rc.5

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.
Files changed (73) hide show
  1. package/assets/chainlink-oracles-sepolia.json +21 -0
  2. package/assets/chainlink-oracles.json +219 -0
  3. package/dist/{0x1-B_N1Dd6d.js → 0x1-BoDxh-YB.js} +30 -22
  4. package/dist/0x1-BoDxh-YB.js.map +1 -0
  5. package/dist/{AbstractKeylessAccount-dvYSW9Go.js → AbstractKeylessAccount-DE1e2Glg.js} +3 -2
  6. package/dist/{AbstractKeylessAccount-dvYSW9Go.js.map → AbstractKeylessAccount-DE1e2Glg.js.map} +1 -1
  7. package/dist/_md-CZAi2AzY.js +644 -0
  8. package/dist/_md-CZAi2AzY.js.map +1 -0
  9. package/dist/aptos/builtin/0x1.js +2 -2
  10. package/dist/aptos/builtin/0x3.js +3 -3
  11. package/dist/aptos/builtin/0x3.js.map +1 -1
  12. package/dist/aptos/builtin/0x4.js +3 -3
  13. package/dist/aptos/builtin/0x4.js.map +1 -1
  14. package/dist/aptos/builtin/index.js +1 -1
  15. package/dist/aptos/ext/index.js +2 -2
  16. package/dist/aptos/index.js +2 -2
  17. package/dist/{aptos-DPeebJ9j.js → aptos-C3JyHHc4.js} +257 -47
  18. package/dist/{aptos-DPeebJ9j.js.map → aptos-C3JyHHc4.js.map} +1 -1
  19. package/dist/{coin-CWRVUEBa.js → coin-CpgkWpcD.js} +803 -4
  20. package/dist/coin-CpgkWpcD.js.map +1 -0
  21. package/dist/{coin-DREiK-Br.js → coin-D4FF2o2d.js} +1514 -105
  22. package/dist/coin-D4FF2o2d.js.map +1 -0
  23. package/dist/{decode-worker-7st2rUPr.js → decode-worker-C83IoThX.js} +1375 -1456
  24. package/dist/decode-worker-C83IoThX.js.map +1 -0
  25. package/dist/eth/abi-decoder/decode-worker.js +1 -1
  26. package/dist/eth/builtin/eacaggregatorproxy.js +1 -1
  27. package/dist/eth/builtin/erc1155.js +2 -2
  28. package/dist/eth/builtin/erc20.js +1 -1
  29. package/dist/eth/builtin/erc721.js +1 -1
  30. package/dist/eth/builtin/index.js +1 -1
  31. package/dist/eth/builtin/weth9.js +2 -2
  32. package/dist/eth/index.js +3 -3
  33. package/dist/iota/builtin/0x1.js +3 -3
  34. package/dist/iota/builtin/0x2.js +168 -5
  35. package/dist/iota/builtin/0x2.js.map +1 -1
  36. package/dist/iota/builtin/0x3.js +3 -3
  37. package/dist/iota/ext/index.js +1 -1
  38. package/dist/iota/index.js +3 -3
  39. package/dist/{keyless-B3QnUmtL.js → keyless-nGiRkJjM.js} +1278 -976
  40. package/dist/keyless-nGiRkJjM.js.map +1 -0
  41. package/dist/move/index.js +1 -1
  42. package/dist/{move-Dr-DL5zT.js → move-BVvdKH2Q.js} +7 -7
  43. package/dist/{move-Dr-DL5zT.js.map → move-BVvdKH2Q.js.map} +1 -1
  44. package/dist/solana/builtin/index.js +1 -1
  45. package/dist/solana/index.js +1 -1
  46. package/dist/{solana-Cns7Irpe.js → solana-DNjOwr5Y.js} +313 -90
  47. package/dist/solana-DNjOwr5Y.js.map +1 -0
  48. package/dist/sui/builtin/0x1.js +1 -1
  49. package/dist/sui/builtin/0x2.js +4 -4
  50. package/dist/sui/builtin/0x3.js +4 -4
  51. package/dist/sui/builtin/index.js +1 -1
  52. package/dist/sui/ext/index.js +1 -1
  53. package/dist/sui/index.js +3 -3
  54. package/dist/{sui-BbKeYXM3.js → sui-Hqx2uWI-.js} +17 -17
  55. package/dist/{sui-BbKeYXM3.js.map → sui-Hqx2uWI-.js.map} +1 -1
  56. package/dist/testing/index.js +6 -6
  57. package/dist/utils/index.js +1 -1
  58. package/dist/{utils-Jndk-n_F.js → utils-Dloybvj_.js} +3270 -3431
  59. package/dist/utils-Dloybvj_.js.map +1 -0
  60. package/package.json +2 -2
  61. package/assets/chainlink-oracles-sepolia.csv +0 -19
  62. package/assets/chainlink-oracles.csv +0 -217
  63. package/dist/0x1-B_N1Dd6d.js.map +0 -1
  64. package/dist/base-BvfRCgEy.js +0 -959
  65. package/dist/base-BvfRCgEy.js.map +0 -1
  66. package/dist/coin-CWRVUEBa.js.map +0 -1
  67. package/dist/coin-DREiK-Br.js.map +0 -1
  68. package/dist/decode-worker-7st2rUPr.js.map +0 -1
  69. package/dist/dist-CA96PSzE.js +0 -824
  70. package/dist/dist-CA96PSzE.js.map +0 -1
  71. package/dist/keyless-B3QnUmtL.js.map +0 -1
  72. package/dist/solana-Cns7Irpe.js.map +0 -1
  73. package/dist/utils-Jndk-n_F.js.map +0 -1
@@ -9964,16 +9964,21 @@ var require_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9964
9964
  }));
9965
9965
 
9966
9966
  //#endregion
9967
- //#region ../../node_modules/.pnpm/ws@8.17.1_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/constants.js
9967
+ //#region ../../node_modules/.pnpm/ws@8.21.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/constants.js
9968
9968
  var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9969
+ const BINARY_TYPES = [
9970
+ "nodebuffer",
9971
+ "arraybuffer",
9972
+ "fragments"
9973
+ ];
9974
+ const hasBlob = typeof Blob !== "undefined";
9975
+ if (hasBlob) BINARY_TYPES.push("blob");
9969
9976
  module.exports = {
9970
- BINARY_TYPES: [
9971
- "nodebuffer",
9972
- "arraybuffer",
9973
- "fragments"
9974
- ],
9977
+ BINARY_TYPES,
9978
+ CLOSE_TIMEOUT: 3e4,
9975
9979
  EMPTY_BUFFER: Buffer.alloc(0),
9976
9980
  GUID: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11",
9981
+ hasBlob,
9977
9982
  kForOnEventAttribute: Symbol("kIsForOnEventAttribute"),
9978
9983
  kListener: Symbol("kListener"),
9979
9984
  kStatusCode: Symbol("status-code"),
@@ -10191,7 +10196,7 @@ var require_bufferutil = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10191
10196
  }));
10192
10197
 
10193
10198
  //#endregion
10194
- //#region ../../node_modules/.pnpm/ws@8.17.1_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/buffer-util.js
10199
+ //#region ../../node_modules/.pnpm/ws@8.21.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/buffer-util.js
10195
10200
  var require_buffer_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10196
10201
  const { EMPTY_BUFFER } = require_constants$1();
10197
10202
  const FastBuffer = Buffer[Symbol.species];
@@ -10292,7 +10297,7 @@ var require_buffer_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10292
10297
  }));
10293
10298
 
10294
10299
  //#endregion
10295
- //#region ../../node_modules/.pnpm/ws@8.17.1_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/limiter.js
10300
+ //#region ../../node_modules/.pnpm/ws@8.21.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/limiter.js
10296
10301
  var require_limiter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10297
10302
  const kDone = Symbol("kDone");
10298
10303
  const kRun = Symbol("kRun");
@@ -10344,7 +10349,7 @@ var require_limiter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10344
10349
  }));
10345
10350
 
10346
10351
  //#endregion
10347
- //#region ../../node_modules/.pnpm/ws@8.17.1_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/permessage-deflate.js
10352
+ //#region ../../node_modules/.pnpm/ws@8.21.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/permessage-deflate.js
10348
10353
  var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10349
10354
  const zlib = __require("zlib");
10350
10355
  const bufferUtil = require_buffer_util();
@@ -10377,6 +10382,9 @@ var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module
10377
10382
  * acknowledge disabling of client context takeover
10378
10383
  * @param {Number} [options.concurrencyLimit=10] The number of concurrent
10379
10384
  * calls to zlib
10385
+ * @param {Boolean} [options.isServer=false] Create the instance in either
10386
+ * server or client mode
10387
+ * @param {Number} [options.maxPayload=0] The maximum allowed message length
10380
10388
  * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the
10381
10389
  * use of a custom server window size
10382
10390
  * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept
@@ -10387,15 +10395,12 @@ var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module
10387
10395
  * deflate
10388
10396
  * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on
10389
10397
  * inflate
10390
- * @param {Boolean} [isServer=false] Create the instance in either server or
10391
- * client mode
10392
- * @param {Number} [maxPayload=0] The maximum allowed message length
10393
10398
  */
10394
- constructor(options, isServer, maxPayload) {
10395
- this._maxPayload = maxPayload | 0;
10399
+ constructor(options) {
10396
10400
  this._options = options || {};
10397
10401
  this._threshold = this._options.threshold !== void 0 ? this._options.threshold : 1024;
10398
- this._isServer = !!isServer;
10402
+ this._maxPayload = this._options.maxPayload | 0;
10403
+ this._isServer = !!this._options.isServer;
10399
10404
  this._deflate = null;
10400
10405
  this._inflate = null;
10401
10406
  this.params = null;
@@ -10668,6 +10673,10 @@ var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module
10668
10673
  */
10669
10674
  function inflateOnError(err) {
10670
10675
  this[kPerMessageDeflate]._inflate = null;
10676
+ if (this[kError]) {
10677
+ this[kCallback](this[kError]);
10678
+ return;
10679
+ }
10671
10680
  err[kStatusCode] = 1007;
10672
10681
  this[kCallback](err);
10673
10682
  }
@@ -10715,9 +10724,10 @@ var require_utf_8_validate = /* @__PURE__ */ __commonJSMin(((exports, module) =>
10715
10724
  }));
10716
10725
 
10717
10726
  //#endregion
10718
- //#region ../../node_modules/.pnpm/ws@8.17.1_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/validation.js
10727
+ //#region ../../node_modules/.pnpm/ws@8.21.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/validation.js
10719
10728
  var require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10720
10729
  const { isUtf8 } = __require("buffer");
10730
+ const { hasBlob } = require_constants$1();
10721
10731
  const tokenChars = [
10722
10732
  0,
10723
10733
  0,
@@ -10883,7 +10893,18 @@ var require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10883
10893
  } else return false;
10884
10894
  return true;
10885
10895
  }
10896
+ /**
10897
+ * Determines whether a value is a `Blob`.
10898
+ *
10899
+ * @param {*} value The value to be tested
10900
+ * @return {Boolean} `true` if `value` is a `Blob`, else `false`
10901
+ * @private
10902
+ */
10903
+ function isBlob(value) {
10904
+ return hasBlob && typeof value === "object" && typeof value.arrayBuffer === "function" && typeof value.type === "string" && typeof value.stream === "function" && (value[Symbol.toStringTag] === "Blob" || value[Symbol.toStringTag] === "File");
10905
+ }
10886
10906
  module.exports = {
10907
+ isBlob,
10887
10908
  isValidStatusCode,
10888
10909
  isValidUTF8: _isValidUTF8,
10889
10910
  tokenChars
@@ -10900,7 +10921,7 @@ var require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10900
10921
  }));
10901
10922
 
10902
10923
  //#endregion
10903
- //#region ../../node_modules/.pnpm/ws@8.17.1_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/receiver.js
10924
+ //#region ../../node_modules/.pnpm/ws@8.21.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/receiver.js
10904
10925
  var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10905
10926
  const { Writable } = __require("stream");
10906
10927
  const PerMessageDeflate = require_permessage_deflate();
@@ -10933,6 +10954,10 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10933
10954
  * extensions
10934
10955
  * @param {Boolean} [options.isServer=false] Specifies whether to operate in
10935
10956
  * client or server mode
10957
+ * @param {Number} [options.maxBufferedChunks=0] The maximum number of
10958
+ * buffered data chunks
10959
+ * @param {Number} [options.maxFragments=0] The maximum number of message
10960
+ * fragments
10936
10961
  * @param {Number} [options.maxPayload=0] The maximum allowed message length
10937
10962
  * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
10938
10963
  * not to skip UTF-8 validation for text and close messages
@@ -10943,6 +10968,8 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10943
10968
  this._binaryType = options.binaryType || BINARY_TYPES[0];
10944
10969
  this._extensions = options.extensions || {};
10945
10970
  this._isServer = !!options.isServer;
10971
+ this._maxBufferedChunks = options.maxBufferedChunks | 0;
10972
+ this._maxFragments = options.maxFragments | 0;
10946
10973
  this._maxPayload = options.maxPayload | 0;
10947
10974
  this._skipUTF8Validation = !!options.skipUTF8Validation;
10948
10975
  this[kWebSocket] = void 0;
@@ -10972,6 +10999,10 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10972
10999
  */
10973
11000
  _write(chunk, encoding, cb) {
10974
11001
  if (this._opcode === 8 && this._state == GET_INFO) return cb();
11002
+ if (this._maxBufferedChunks > 0 && this._buffers.length >= this._maxBufferedChunks) {
11003
+ cb(this.createError(RangeError, "Too many buffered chunks", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS"));
11004
+ return;
11005
+ }
10975
11006
  this._bufferedBytes += chunk.length;
10976
11007
  this._buffers.push(chunk);
10977
11008
  this.startLoop(cb);
@@ -11199,6 +11230,10 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11199
11230
  return;
11200
11231
  }
11201
11232
  if (data.length) {
11233
+ if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) {
11234
+ cb(this.createError(RangeError, "Too many message fragments", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS"));
11235
+ return;
11236
+ }
11202
11237
  this._messageLength = this._totalPayloadLength;
11203
11238
  this._fragments.push(data);
11204
11239
  }
@@ -11220,6 +11255,10 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11220
11255
  cb(this.createError(RangeError, "Max payload size exceeded", false, 1009, "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));
11221
11256
  return;
11222
11257
  }
11258
+ if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) {
11259
+ cb(this.createError(RangeError, "Too many message fragments", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS"));
11260
+ return;
11261
+ }
11223
11262
  this._fragments.push(buf);
11224
11263
  }
11225
11264
  this.dataMessage(cb);
@@ -11247,6 +11286,7 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11247
11286
  let data;
11248
11287
  if (this._binaryType === "nodebuffer") data = concat(fragments, messageLength);
11249
11288
  else if (this._binaryType === "arraybuffer") data = toArrayBuffer(concat(fragments, messageLength));
11289
+ else if (this._binaryType === "blob") data = new Blob(fragments);
11250
11290
  else data = fragments;
11251
11291
  if (this._allowSynchronousEvents) {
11252
11292
  this.emit("message", data, true);
@@ -11347,19 +11387,23 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11347
11387
  }));
11348
11388
 
11349
11389
  //#endregion
11350
- //#region ../../node_modules/.pnpm/ws@8.17.1_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/sender.js
11390
+ //#region ../../node_modules/.pnpm/ws@8.21.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/sender.js
11351
11391
  var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11352
11392
  const { Duplex: Duplex$3 } = __require("stream");
11353
11393
  const { randomFillSync } = __require("crypto");
11394
+ const { types: { isUint8Array } } = __require("util");
11354
11395
  const PerMessageDeflate = require_permessage_deflate();
11355
- const { EMPTY_BUFFER } = require_constants$1();
11356
- const { isValidStatusCode } = require_validation();
11396
+ const { EMPTY_BUFFER, kWebSocket, NOOP } = require_constants$1();
11397
+ const { isBlob, isValidStatusCode } = require_validation();
11357
11398
  const { mask: applyMask, toBuffer } = require_buffer_util();
11358
11399
  const kByteLength = Symbol("kByteLength");
11359
11400
  const maskBuffer = Buffer.alloc(4);
11360
11401
  const RANDOM_POOL_SIZE = 8 * 1024;
11361
11402
  let randomPool;
11362
11403
  let randomPoolPointer = RANDOM_POOL_SIZE;
11404
+ const DEFAULT = 0;
11405
+ const DEFLATING = 1;
11406
+ const GET_BLOB_DATA = 2;
11363
11407
  /**
11364
11408
  * HyBi Sender implementation.
11365
11409
  */
@@ -11382,8 +11426,10 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11382
11426
  this._firstFragment = true;
11383
11427
  this._compress = false;
11384
11428
  this._bufferedBytes = 0;
11385
- this._deflating = false;
11386
11429
  this._queue = [];
11430
+ this._state = DEFAULT;
11431
+ this.onerror = NOOP;
11432
+ this[kWebSocket] = void 0;
11387
11433
  }
11388
11434
  /**
11389
11435
  * Frames a piece of data according to the HyBi WebSocket protocol.
@@ -11492,7 +11538,8 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11492
11538
  buf = Buffer.allocUnsafe(2 + length);
11493
11539
  buf.writeUInt16BE(code, 0);
11494
11540
  if (typeof data === "string") buf.write(data, 2);
11495
- else buf.set(data, 2);
11541
+ else if (isUint8Array(data)) buf.set(data, 2);
11542
+ else throw new TypeError("Second argument must be a string or a Uint8Array");
11496
11543
  }
11497
11544
  const options = {
11498
11545
  [kByteLength]: buf.length,
@@ -11504,7 +11551,7 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11504
11551
  readOnly: false,
11505
11552
  rsv1: false
11506
11553
  };
11507
- if (this._deflating) this.enqueue([
11554
+ if (this._state !== DEFAULT) this.enqueue([
11508
11555
  this.dispatch,
11509
11556
  buf,
11510
11557
  false,
@@ -11527,6 +11574,9 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11527
11574
  if (typeof data === "string") {
11528
11575
  byteLength = Buffer.byteLength(data);
11529
11576
  readOnly = false;
11577
+ } else if (isBlob(data)) {
11578
+ byteLength = data.size;
11579
+ readOnly = false;
11530
11580
  } else {
11531
11581
  data = toBuffer(data);
11532
11582
  byteLength = data.length;
@@ -11543,7 +11593,15 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11543
11593
  readOnly,
11544
11594
  rsv1: false
11545
11595
  };
11546
- if (this._deflating) this.enqueue([
11596
+ if (isBlob(data)) if (this._state !== DEFAULT) this.enqueue([
11597
+ this.getBlobData,
11598
+ data,
11599
+ false,
11600
+ options,
11601
+ cb
11602
+ ]);
11603
+ else this.getBlobData(data, false, options, cb);
11604
+ else if (this._state !== DEFAULT) this.enqueue([
11547
11605
  this.dispatch,
11548
11606
  data,
11549
11607
  false,
@@ -11566,6 +11624,9 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11566
11624
  if (typeof data === "string") {
11567
11625
  byteLength = Buffer.byteLength(data);
11568
11626
  readOnly = false;
11627
+ } else if (isBlob(data)) {
11628
+ byteLength = data.size;
11629
+ readOnly = false;
11569
11630
  } else {
11570
11631
  data = toBuffer(data);
11571
11632
  byteLength = data.length;
@@ -11582,7 +11643,15 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11582
11643
  readOnly,
11583
11644
  rsv1: false
11584
11645
  };
11585
- if (this._deflating) this.enqueue([
11646
+ if (isBlob(data)) if (this._state !== DEFAULT) this.enqueue([
11647
+ this.getBlobData,
11648
+ data,
11649
+ false,
11650
+ options,
11651
+ cb
11652
+ ]);
11653
+ else this.getBlobData(data, false, options, cb);
11654
+ else if (this._state !== DEFAULT) this.enqueue([
11586
11655
  this.dispatch,
11587
11656
  data,
11588
11657
  false,
@@ -11616,6 +11685,9 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11616
11685
  if (typeof data === "string") {
11617
11686
  byteLength = Buffer.byteLength(data);
11618
11687
  readOnly = false;
11688
+ } else if (isBlob(data)) {
11689
+ byteLength = data.size;
11690
+ readOnly = false;
11619
11691
  } else {
11620
11692
  data = toBuffer(data);
11621
11693
  byteLength = data.length;
@@ -11630,26 +11702,7 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11630
11702
  opcode = 0;
11631
11703
  }
11632
11704
  if (options.fin) this._firstFragment = true;
11633
- if (perMessageDeflate) {
11634
- const opts = {
11635
- [kByteLength]: byteLength,
11636
- fin: options.fin,
11637
- generateMask: this._generateMask,
11638
- mask: options.mask,
11639
- maskBuffer: this._maskBuffer,
11640
- opcode,
11641
- readOnly,
11642
- rsv1
11643
- };
11644
- if (this._deflating) this.enqueue([
11645
- this.dispatch,
11646
- data,
11647
- this._compress,
11648
- opts,
11649
- cb
11650
- ]);
11651
- else this.dispatch(data, this._compress, opts, cb);
11652
- } else this.sendFrame(Sender.frame(data, {
11705
+ const opts = {
11653
11706
  [kByteLength]: byteLength,
11654
11707
  fin: options.fin,
11655
11708
  generateMask: this._generateMask,
@@ -11657,8 +11710,67 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11657
11710
  maskBuffer: this._maskBuffer,
11658
11711
  opcode,
11659
11712
  readOnly,
11660
- rsv1: false
11661
- }), cb);
11713
+ rsv1
11714
+ };
11715
+ if (isBlob(data)) if (this._state !== DEFAULT) this.enqueue([
11716
+ this.getBlobData,
11717
+ data,
11718
+ this._compress,
11719
+ opts,
11720
+ cb
11721
+ ]);
11722
+ else this.getBlobData(data, this._compress, opts, cb);
11723
+ else if (this._state !== DEFAULT) this.enqueue([
11724
+ this.dispatch,
11725
+ data,
11726
+ this._compress,
11727
+ opts,
11728
+ cb
11729
+ ]);
11730
+ else this.dispatch(data, this._compress, opts, cb);
11731
+ }
11732
+ /**
11733
+ * Gets the contents of a blob as binary data.
11734
+ *
11735
+ * @param {Blob} blob The blob
11736
+ * @param {Boolean} [compress=false] Specifies whether or not to compress
11737
+ * the data
11738
+ * @param {Object} options Options object
11739
+ * @param {Boolean} [options.fin=false] Specifies whether or not to set the
11740
+ * FIN bit
11741
+ * @param {Function} [options.generateMask] The function used to generate the
11742
+ * masking key
11743
+ * @param {Boolean} [options.mask=false] Specifies whether or not to mask
11744
+ * `data`
11745
+ * @param {Buffer} [options.maskBuffer] The buffer used to store the masking
11746
+ * key
11747
+ * @param {Number} options.opcode The opcode
11748
+ * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be
11749
+ * modified
11750
+ * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the
11751
+ * RSV1 bit
11752
+ * @param {Function} [cb] Callback
11753
+ * @private
11754
+ */
11755
+ getBlobData(blob, compress, options, cb) {
11756
+ this._bufferedBytes += options[kByteLength];
11757
+ this._state = GET_BLOB_DATA;
11758
+ blob.arrayBuffer().then((arrayBuffer) => {
11759
+ if (this._socket.destroyed) {
11760
+ const err = /* @__PURE__ */ new Error("The socket was closed while the blob was being read");
11761
+ process.nextTick(callCallbacks, this, err, cb);
11762
+ return;
11763
+ }
11764
+ this._bufferedBytes -= options[kByteLength];
11765
+ const data = toBuffer(arrayBuffer);
11766
+ if (!compress) {
11767
+ this._state = DEFAULT;
11768
+ this.sendFrame(Sender.frame(data, options), cb);
11769
+ this.dequeue();
11770
+ } else this.dispatch(data, compress, options, cb);
11771
+ }).catch((err) => {
11772
+ process.nextTick(onError, this, err, cb);
11773
+ });
11662
11774
  }
11663
11775
  /**
11664
11776
  * Dispatches a message.
@@ -11690,20 +11802,15 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11690
11802
  }
11691
11803
  const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
11692
11804
  this._bufferedBytes += options[kByteLength];
11693
- this._deflating = true;
11805
+ this._state = DEFLATING;
11694
11806
  perMessageDeflate.compress(data, options.fin, (_, buf) => {
11695
11807
  if (this._socket.destroyed) {
11696
11808
  const err = /* @__PURE__ */ new Error("The socket was closed while data was being compressed");
11697
- if (typeof cb === "function") cb(err);
11698
- for (let i = 0; i < this._queue.length; i++) {
11699
- const params = this._queue[i];
11700
- const callback = params[params.length - 1];
11701
- if (typeof callback === "function") callback(err);
11702
- }
11809
+ callCallbacks(this, err, cb);
11703
11810
  return;
11704
11811
  }
11705
11812
  this._bufferedBytes -= options[kByteLength];
11706
- this._deflating = false;
11813
+ this._state = DEFAULT;
11707
11814
  options.readOnly = false;
11708
11815
  this.sendFrame(Sender.frame(buf, options), cb);
11709
11816
  this.dequeue();
@@ -11715,7 +11822,7 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11715
11822
  * @private
11716
11823
  */
11717
11824
  dequeue() {
11718
- while (!this._deflating && this._queue.length) {
11825
+ while (this._state === DEFAULT && this._queue.length) {
11719
11826
  const params = this._queue.shift();
11720
11827
  this._bufferedBytes -= params[3][kByteLength];
11721
11828
  Reflect.apply(params[0], this, params.slice(1));
@@ -11734,7 +11841,7 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11734
11841
  /**
11735
11842
  * Sends a frame.
11736
11843
  *
11737
- * @param {Buffer[]} list The frame to send
11844
+ * @param {(Buffer | String)[]} list The frame to send
11738
11845
  * @param {Function} [cb] Callback
11739
11846
  * @private
11740
11847
  */
@@ -11748,10 +11855,38 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11748
11855
  }
11749
11856
  };
11750
11857
  module.exports = Sender;
11858
+ /**
11859
+ * Calls queued callbacks with an error.
11860
+ *
11861
+ * @param {Sender} sender The `Sender` instance
11862
+ * @param {Error} err The error to call the callbacks with
11863
+ * @param {Function} [cb] The first callback
11864
+ * @private
11865
+ */
11866
+ function callCallbacks(sender, err, cb) {
11867
+ if (typeof cb === "function") cb(err);
11868
+ for (let i = 0; i < sender._queue.length; i++) {
11869
+ const params = sender._queue[i];
11870
+ const callback = params[params.length - 1];
11871
+ if (typeof callback === "function") callback(err);
11872
+ }
11873
+ }
11874
+ /**
11875
+ * Handles a `Sender` error.
11876
+ *
11877
+ * @param {Sender} sender The `Sender` instance
11878
+ * @param {Error} err The error
11879
+ * @param {Function} [cb] The first pending callback
11880
+ * @private
11881
+ */
11882
+ function onError(sender, err, cb) {
11883
+ callCallbacks(sender, err, cb);
11884
+ sender.onerror(err);
11885
+ }
11751
11886
  }));
11752
11887
 
11753
11888
  //#endregion
11754
- //#region ../../node_modules/.pnpm/ws@8.17.1_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/event-target.js
11889
+ //#region ../../node_modules/.pnpm/ws@8.21.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/event-target.js
11755
11890
  var require_event_target = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11756
11891
  const { kForOnEventAttribute, kListener } = require_constants$1();
11757
11892
  const kCode = Symbol("kCode");
@@ -11990,7 +12125,7 @@ var require_event_target = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11990
12125
  }));
11991
12126
 
11992
12127
  //#endregion
11993
- //#region ../../node_modules/.pnpm/ws@8.17.1_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/extension.js
12128
+ //#region ../../node_modules/.pnpm/ws@8.21.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/extension.js
11994
12129
  var require_extension = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11995
12130
  const { tokenChars } = require_validation();
11996
12131
  /**
@@ -12134,7 +12269,7 @@ var require_extension = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12134
12269
  }));
12135
12270
 
12136
12271
  //#endregion
12137
- //#region ../../node_modules/.pnpm/ws@8.17.1_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/websocket.js
12272
+ //#region ../../node_modules/.pnpm/ws@8.21.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/websocket.js
12138
12273
  var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12139
12274
  const EventEmitter$1 = __require("events");
12140
12275
  const https = __require("https");
@@ -12147,11 +12282,11 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12147
12282
  const PerMessageDeflate = require_permessage_deflate();
12148
12283
  const Receiver = require_receiver();
12149
12284
  const Sender = require_sender();
12150
- const { BINARY_TYPES, EMPTY_BUFFER, GUID, kForOnEventAttribute, kListener, kStatusCode, kWebSocket, NOOP } = require_constants$1();
12285
+ const { isBlob } = require_validation();
12286
+ const { BINARY_TYPES, CLOSE_TIMEOUT, EMPTY_BUFFER, GUID, kForOnEventAttribute, kListener, kStatusCode, kWebSocket, NOOP } = require_constants$1();
12151
12287
  const { EventTarget: { addEventListener, removeEventListener } } = require_event_target();
12152
12288
  const { format, parse } = require_extension();
12153
12289
  const { toBuffer } = require_buffer_util();
12154
- const closeTimeout = 30 * 1e3;
12155
12290
  const kAborted = Symbol("kAborted");
12156
12291
  const protocolVersions = [8, 13];
12157
12292
  const readyStates = [
@@ -12182,6 +12317,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12182
12317
  this._closeFrameSent = false;
12183
12318
  this._closeMessage = EMPTY_BUFFER;
12184
12319
  this._closeTimer = null;
12320
+ this._errorEmitted = false;
12185
12321
  this._extensions = {};
12186
12322
  this._paused = false;
12187
12323
  this._protocol = "";
@@ -12201,13 +12337,13 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12201
12337
  initAsClient(this, address, protocols, options);
12202
12338
  } else {
12203
12339
  this._autoPong = options.autoPong;
12340
+ this._closeTimeout = options.closeTimeout;
12204
12341
  this._isServer = true;
12205
12342
  }
12206
12343
  }
12207
12344
  /**
12208
- * This deviates from the WHATWG interface since ws doesn't support the
12209
- * required default "blob" type (instead we define a custom "nodebuffer"
12210
- * type).
12345
+ * For historical reasons, the custom "nodebuffer" type is used by the default
12346
+ * instead of "blob".
12211
12347
  *
12212
12348
  * @type {String}
12213
12349
  */
@@ -12295,6 +12431,10 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12295
12431
  * multiple times in the same tick
12296
12432
  * @param {Function} [options.generateMask] The function used to generate the
12297
12433
  * masking key
12434
+ * @param {Number} [options.maxBufferedChunks=0] The maximum number of
12435
+ * buffered data chunks
12436
+ * @param {Number} [options.maxFragments=0] The maximum number of message
12437
+ * fragments
12298
12438
  * @param {Number} [options.maxPayload=0] The maximum allowed message size
12299
12439
  * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
12300
12440
  * not to skip UTF-8 validation for text and close messages
@@ -12306,13 +12446,17 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12306
12446
  binaryType: this.binaryType,
12307
12447
  extensions: this._extensions,
12308
12448
  isServer: this._isServer,
12449
+ maxBufferedChunks: options.maxBufferedChunks,
12450
+ maxFragments: options.maxFragments,
12309
12451
  maxPayload: options.maxPayload,
12310
12452
  skipUTF8Validation: options.skipUTF8Validation
12311
12453
  });
12312
- this._sender = new Sender(socket, this._extensions, options.generateMask);
12454
+ const sender = new Sender(socket, this._extensions, options.generateMask);
12313
12455
  this._receiver = receiver;
12456
+ this._sender = sender;
12314
12457
  this._socket = socket;
12315
12458
  receiver[kWebSocket] = this;
12459
+ sender[kWebSocket] = this;
12316
12460
  socket[kWebSocket] = this;
12317
12461
  receiver.on("conclude", receiverOnConclude);
12318
12462
  receiver.on("drain", receiverOnDrain);
@@ -12320,6 +12464,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12320
12464
  receiver.on("message", receiverOnMessage);
12321
12465
  receiver.on("ping", receiverOnPing);
12322
12466
  receiver.on("pong", receiverOnPong);
12467
+ sender.onerror = senderOnError;
12323
12468
  if (socket.setTimeout) socket.setTimeout(0);
12324
12469
  if (socket.setNoDelay) socket.setNoDelay();
12325
12470
  if (head.length > 0) socket.unshift(head);
@@ -12382,7 +12527,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12382
12527
  this._closeFrameSent = true;
12383
12528
  if (this._closeFrameReceived || this._receiver._writableState.errorEmitted) this._socket.end();
12384
12529
  });
12385
- this._closeTimer = setTimeout(this._socket.destroy.bind(this._socket), closeTimeout);
12530
+ setCloseTimer(this);
12386
12531
  }
12387
12532
  /**
12388
12533
  * Pause the socket.
@@ -12619,6 +12764,8 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12619
12764
  * times in the same tick
12620
12765
  * @param {Boolean} [options.autoPong=true] Specifies whether or not to
12621
12766
  * automatically send a pong in response to a ping
12767
+ * @param {Number} [options.closeTimeout=30000] Duration in milliseconds to wait
12768
+ * for the closing handshake to finish after `websocket.close()` is called
12622
12769
  * @param {Function} [options.finishRequest] A function which can be used to
12623
12770
  * customize the headers of each http request before it is sent
12624
12771
  * @param {Boolean} [options.followRedirects=false] Whether or not to follow
@@ -12627,6 +12774,10 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12627
12774
  * masking key
12628
12775
  * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the
12629
12776
  * handshake request
12777
+ * @param {Number} [options.maxBufferedChunks=1048576] The maximum number of
12778
+ * buffered data chunks
12779
+ * @param {Number} [options.maxFragments=131072] The maximum number of message
12780
+ * fragments
12630
12781
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
12631
12782
  * size
12632
12783
  * @param {Number} [options.maxRedirects=10] The maximum number of redirects
@@ -12645,7 +12796,10 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12645
12796
  const opts = {
12646
12797
  allowSynchronousEvents: true,
12647
12798
  autoPong: true,
12799
+ closeTimeout: CLOSE_TIMEOUT,
12648
12800
  protocolVersion: protocolVersions[1],
12801
+ maxBufferedChunks: 1024 * 1024,
12802
+ maxFragments: 128 * 1024,
12649
12803
  maxPayload: 100 * 1024 * 1024,
12650
12804
  skipUTF8Validation: false,
12651
12805
  perMessageDeflate: true,
@@ -12662,12 +12816,13 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12662
12816
  port: void 0
12663
12817
  };
12664
12818
  websocket._autoPong = opts.autoPong;
12819
+ websocket._closeTimeout = opts.closeTimeout;
12665
12820
  if (!protocolVersions.includes(opts.protocolVersion)) throw new RangeError(`Unsupported protocol version: ${opts.protocolVersion} (supported versions: ${protocolVersions.join(", ")})`);
12666
12821
  let parsedUrl;
12667
12822
  if (address instanceof URL) parsedUrl = address;
12668
12823
  else try {
12669
12824
  parsedUrl = new URL(address);
12670
- } catch (e) {
12825
+ } catch {
12671
12826
  throw new SyntaxError(`Invalid URL: ${address}`);
12672
12827
  }
12673
12828
  if (parsedUrl.protocol === "http:") parsedUrl.protocol = "ws:";
@@ -12676,7 +12831,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12676
12831
  const isSecure = parsedUrl.protocol === "wss:";
12677
12832
  const isIpcUrl = parsedUrl.protocol === "ws+unix:";
12678
12833
  let invalidUrlMessage;
12679
- if (parsedUrl.protocol !== "ws:" && !isSecure && !isIpcUrl) invalidUrlMessage = "The URL's protocol must be one of \"ws:\", \"wss:\", \"http:\", \"https\", or \"ws+unix:\"";
12834
+ if (parsedUrl.protocol !== "ws:" && !isSecure && !isIpcUrl) invalidUrlMessage = "The URL's protocol must be one of \"ws:\", \"wss:\", \"http:\", \"https:\", or \"ws+unix:\"";
12680
12835
  else if (isIpcUrl && !parsedUrl.pathname) invalidUrlMessage = "The URL's pathname is empty";
12681
12836
  else if (parsedUrl.hash) invalidUrlMessage = "The URL contains a fragment identifier";
12682
12837
  if (invalidUrlMessage) {
@@ -12706,7 +12861,11 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12706
12861
  opts.path = parsedUrl.pathname + parsedUrl.search;
12707
12862
  opts.timeout = opts.handshakeTimeout;
12708
12863
  if (opts.perMessageDeflate) {
12709
- perMessageDeflate = new PerMessageDeflate(opts.perMessageDeflate !== true ? opts.perMessageDeflate : {}, false, opts.maxPayload);
12864
+ perMessageDeflate = new PerMessageDeflate({
12865
+ ...opts.perMessageDeflate,
12866
+ isServer: false,
12867
+ maxPayload: opts.maxPayload
12868
+ });
12710
12869
  opts.headers["Sec-WebSocket-Extensions"] = format({ [PerMessageDeflate.extensionName]: perMessageDeflate.offer() });
12711
12870
  }
12712
12871
  if (protocols.length) {
@@ -12830,6 +12989,8 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12830
12989
  websocket.setSocket(socket, head, {
12831
12990
  allowSynchronousEvents: opts.allowSynchronousEvents,
12832
12991
  generateMask: opts.generateMask,
12992
+ maxBufferedChunks: opts.maxBufferedChunks,
12993
+ maxFragments: opts.maxFragments,
12833
12994
  maxPayload: opts.maxPayload,
12834
12995
  skipUTF8Validation: opts.skipUTF8Validation
12835
12996
  });
@@ -12846,6 +13007,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12846
13007
  */
12847
13008
  function emitErrorAndClose(websocket, err) {
12848
13009
  websocket._readyState = WebSocket.CLOSING;
13010
+ websocket._errorEmitted = true;
12849
13011
  websocket.emit("error", err);
12850
13012
  websocket.emitClose();
12851
13013
  }
@@ -12907,7 +13069,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12907
13069
  */
12908
13070
  function sendAfterClose(websocket, data, cb) {
12909
13071
  if (data) {
12910
- const length = toBuffer(data).length;
13072
+ const length = isBlob(data) ? data.size : toBuffer(data).length;
12911
13073
  if (websocket._socket) websocket._sender._bufferedBytes += length;
12912
13074
  else websocket._bufferedAmount += length;
12913
13075
  }
@@ -12956,7 +13118,10 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12956
13118
  process.nextTick(resume, websocket._socket);
12957
13119
  websocket.close(err[kStatusCode]);
12958
13120
  }
12959
- websocket.emit("error", err);
13121
+ if (!websocket._errorEmitted) {
13122
+ websocket._errorEmitted = true;
13123
+ websocket.emit("error", err);
13124
+ }
12960
13125
  }
12961
13126
  /**
12962
13127
  * The listener of the `Receiver` `'finish'` event.
@@ -13006,6 +13171,34 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13006
13171
  stream.resume();
13007
13172
  }
13008
13173
  /**
13174
+ * The `Sender` error event handler.
13175
+ *
13176
+ * @param {Error} The error
13177
+ * @private
13178
+ */
13179
+ function senderOnError(err) {
13180
+ const websocket = this[kWebSocket];
13181
+ if (websocket.readyState === WebSocket.CLOSED) return;
13182
+ if (websocket.readyState === WebSocket.OPEN) {
13183
+ websocket._readyState = WebSocket.CLOSING;
13184
+ setCloseTimer(websocket);
13185
+ }
13186
+ this._socket.end();
13187
+ if (!websocket._errorEmitted) {
13188
+ websocket._errorEmitted = true;
13189
+ websocket.emit("error", err);
13190
+ }
13191
+ }
13192
+ /**
13193
+ * Set a timer to destroy the underlying raw socket of a WebSocket.
13194
+ *
13195
+ * @param {WebSocket} websocket The WebSocket instance
13196
+ * @private
13197
+ */
13198
+ function setCloseTimer(websocket) {
13199
+ websocket._closeTimer = setTimeout(websocket._socket.destroy.bind(websocket._socket), websocket._closeTimeout);
13200
+ }
13201
+ /**
13009
13202
  * The listener of the socket `'close'` event.
13010
13203
  *
13011
13204
  * @private
@@ -13016,8 +13209,10 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13016
13209
  this.removeListener("data", socketOnData);
13017
13210
  this.removeListener("end", socketOnEnd);
13018
13211
  websocket._readyState = WebSocket.CLOSING;
13019
- let chunk;
13020
- if (!this._readableState.endEmitted && !websocket._closeFrameReceived && !websocket._receiver._writableState.errorEmitted && (chunk = websocket._socket.read()) !== null) websocket._receiver.write(chunk);
13212
+ if (!this._readableState.endEmitted && !websocket._closeFrameReceived && !websocket._receiver._writableState.errorEmitted && this._readableState.length !== 0) {
13213
+ const chunk = this.read(this._readableState.length);
13214
+ websocket._receiver.write(chunk);
13215
+ }
13021
13216
  websocket._receiver.end();
13022
13217
  this[kWebSocket] = void 0;
13023
13218
  clearTimeout(websocket._closeTimer);
@@ -13064,8 +13259,9 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13064
13259
  }));
13065
13260
 
13066
13261
  //#endregion
13067
- //#region ../../node_modules/.pnpm/ws@8.17.1_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/stream.js
13262
+ //#region ../../node_modules/.pnpm/ws@8.21.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/stream.js
13068
13263
  var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13264
+ require_websocket();
13069
13265
  const { Duplex: Duplex$1 } = __require("stream");
13070
13266
  /**
13071
13267
  * Emits the `'close'` event on a stream.
@@ -13180,7 +13376,7 @@ var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13180
13376
  }));
13181
13377
 
13182
13378
  //#endregion
13183
- //#region ../../node_modules/.pnpm/ws@8.17.1_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/subprotocol.js
13379
+ //#region ../../node_modules/.pnpm/ws@8.21.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/subprotocol.js
13184
13380
  var require_subprotocol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13185
13381
  const { tokenChars } = require_validation();
13186
13382
  /**
@@ -13220,7 +13416,7 @@ var require_subprotocol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13220
13416
  }));
13221
13417
 
13222
13418
  //#endregion
13223
- //#region ../../node_modules/.pnpm/ws@8.17.1_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/websocket-server.js
13419
+ //#region ../../node_modules/.pnpm/ws@8.21.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/lib/websocket-server.js
13224
13420
  var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13225
13421
  const EventEmitter = __require("events");
13226
13422
  const http = __require("http");
@@ -13230,7 +13426,7 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
13230
13426
  const PerMessageDeflate = require_permessage_deflate();
13231
13427
  const subprotocol = require_subprotocol();
13232
13428
  const WebSocket = require_websocket();
13233
- const { GUID, kWebSocket } = require_constants$1();
13429
+ const { CLOSE_TIMEOUT, GUID, kWebSocket } = require_constants$1();
13234
13430
  const keyRegex = /^[+/0-9A-Za-z]{22}==$/;
13235
13431
  const RUNNING = 0;
13236
13432
  const CLOSING = 1;
@@ -13254,8 +13450,15 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
13254
13450
  * pending connections
13255
13451
  * @param {Boolean} [options.clientTracking=true] Specifies whether or not to
13256
13452
  * track clients
13453
+ * @param {Number} [options.closeTimeout=30000] Duration in milliseconds to
13454
+ * wait for the closing handshake to finish after `websocket.close()` is
13455
+ * called
13257
13456
  * @param {Function} [options.handleProtocols] A hook to handle protocols
13258
13457
  * @param {String} [options.host] The hostname where to bind the server
13458
+ * @param {Number} [options.maxBufferedChunks=1048576] The maximum number of
13459
+ * buffered data chunks
13460
+ * @param {Number} [options.maxFragments=131072] The maximum number of message
13461
+ * fragments
13259
13462
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
13260
13463
  * size
13261
13464
  * @param {Boolean} [options.noServer=false] Enable no server mode
@@ -13277,11 +13480,14 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
13277
13480
  options = {
13278
13481
  allowSynchronousEvents: true,
13279
13482
  autoPong: true,
13483
+ maxBufferedChunks: 1024 * 1024,
13484
+ maxFragments: 128 * 1024,
13280
13485
  maxPayload: 100 * 1024 * 1024,
13281
13486
  skipUTF8Validation: false,
13282
13487
  perMessageDeflate: false,
13283
13488
  handleProtocols: null,
13284
13489
  clientTracking: true,
13490
+ closeTimeout: CLOSE_TIMEOUT,
13285
13491
  verifyClient: null,
13286
13492
  noServer: false,
13287
13493
  backlog: null,
@@ -13411,8 +13617,8 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
13411
13617
  abortHandshakeOrEmitwsClientError(this, req, socket, 400, "Missing or invalid Sec-WebSocket-Key header");
13412
13618
  return;
13413
13619
  }
13414
- if (version !== 8 && version !== 13) {
13415
- abortHandshakeOrEmitwsClientError(this, req, socket, 400, "Missing or invalid Sec-WebSocket-Version header");
13620
+ if (version !== 13 && version !== 8) {
13621
+ abortHandshakeOrEmitwsClientError(this, req, socket, 400, "Missing or invalid Sec-WebSocket-Version header", { "Sec-WebSocket-Version": "13, 8" });
13416
13622
  return;
13417
13623
  }
13418
13624
  if (!this.shouldHandle(req)) {
@@ -13430,7 +13636,11 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
13430
13636
  const secWebSocketExtensions = req.headers["sec-websocket-extensions"];
13431
13637
  const extensions = {};
13432
13638
  if (this.options.perMessageDeflate && secWebSocketExtensions !== void 0) {
13433
- const perMessageDeflate = new PerMessageDeflate(this.options.perMessageDeflate, true, this.options.maxPayload);
13639
+ const perMessageDeflate = new PerMessageDeflate({
13640
+ ...this.options.perMessageDeflate,
13641
+ isServer: true,
13642
+ maxPayload: this.options.maxPayload
13643
+ });
13434
13644
  try {
13435
13645
  const offers = extension.parse(secWebSocketExtensions);
13436
13646
  if (offers[PerMessageDeflate.extensionName]) {
@@ -13501,6 +13711,8 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
13501
13711
  socket.removeListener("error", socketOnError);
13502
13712
  ws.setSocket(socket, head, {
13503
13713
  allowSynchronousEvents: this.options.allowSynchronousEvents,
13714
+ maxBufferedChunks: this.options.maxBufferedChunks,
13715
+ maxFragments: this.options.maxFragments,
13504
13716
  maxPayload: this.options.maxPayload,
13505
13717
  skipUTF8Validation: this.options.skipUTF8Validation
13506
13718
  });
@@ -13578,27 +13790,38 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
13578
13790
  * @param {Duplex} socket The socket of the upgrade request
13579
13791
  * @param {Number} code The HTTP response status code
13580
13792
  * @param {String} message The HTTP response body
13793
+ * @param {Object} [headers] The HTTP response headers
13581
13794
  * @private
13582
13795
  */
13583
- function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) {
13796
+ function abortHandshakeOrEmitwsClientError(server, req, socket, code, message, headers) {
13584
13797
  if (server.listenerCount("wsClientError")) {
13585
13798
  const err = new Error(message);
13586
13799
  Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError);
13587
13800
  server.emit("wsClientError", err, socket, req);
13588
- } else abortHandshake(socket, code, message);
13801
+ } else abortHandshake(socket, code, message, headers);
13589
13802
  }
13590
13803
  }));
13591
13804
 
13592
13805
  //#endregion
13593
- //#region ../../node_modules/.pnpm/ws@8.17.1_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/index.js
13806
+ //#region ../../node_modules/.pnpm/ws@8.21.0_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ws/index.js
13594
13807
  var require_ws = /* @__PURE__ */ __commonJSMin(((exports, module) => {
13808
+ const createWebSocketStream = require_stream();
13809
+ const extension = require_extension();
13810
+ const PerMessageDeflate = require_permessage_deflate();
13811
+ const Receiver = require_receiver();
13812
+ const Sender = require_sender();
13813
+ const subprotocol = require_subprotocol();
13595
13814
  const WebSocket = require_websocket();
13596
- WebSocket.createWebSocketStream = require_stream();
13597
- WebSocket.Server = require_websocket_server();
13598
- WebSocket.Receiver = require_receiver();
13599
- WebSocket.Sender = require_sender();
13815
+ const WebSocketServer = require_websocket_server();
13816
+ WebSocket.createWebSocketStream = createWebSocketStream;
13817
+ WebSocket.extension = extension;
13818
+ WebSocket.PerMessageDeflate = PerMessageDeflate;
13819
+ WebSocket.Receiver = Receiver;
13820
+ WebSocket.Sender = Sender;
13821
+ WebSocket.Server = WebSocketServer;
13822
+ WebSocket.subprotocol = subprotocol;
13600
13823
  WebSocket.WebSocket = WebSocket;
13601
- WebSocket.WebSocketServer = WebSocket.Server;
13824
+ WebSocket.WebSocketServer = WebSocketServer;
13602
13825
  module.exports = WebSocket;
13603
13826
  }));
13604
13827
 
@@ -41891,4 +42114,4 @@ var import_cjs = require_cjs();
41891
42114
 
41892
42115
  //#endregion
41893
42116
  export { SolanaBaseProcessor as a, SolanaContext as c, SolanaPlugin as i, SolanaBindOptions as n, SolanaGlobalProcessor as o, SolanaFetchConfig as r, SolanaProcessorState as s, import_cjs as t };
41894
- //# sourceMappingURL=solana-Cns7Irpe.js.map
42117
+ //# sourceMappingURL=solana-DNjOwr5Y.js.map