@orderly.network/core 2.8.10-alpha.0 → 2.8.11-alpha.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 +120 -235
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +117 -232
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -33,10 +33,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
mod
|
|
34
34
|
));
|
|
35
35
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
|
-
var __publicField = (obj, key, value) =>
|
|
37
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
38
|
-
return value;
|
|
39
|
-
};
|
|
36
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
40
37
|
|
|
41
38
|
// ../../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js
|
|
42
39
|
var require_base64_js = __commonJS({
|
|
@@ -64,8 +61,7 @@ var require_base64_js = __commonJS({
|
|
|
64
61
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
65
62
|
}
|
|
66
63
|
var validLen = b64.indexOf("=");
|
|
67
|
-
if (validLen === -1)
|
|
68
|
-
validLen = len2;
|
|
64
|
+
if (validLen === -1) validLen = len2;
|
|
69
65
|
var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4;
|
|
70
66
|
return [validLen, placeHoldersLen];
|
|
71
67
|
}
|
|
@@ -261,16 +257,14 @@ var require_buffer = __commonJS({
|
|
|
261
257
|
Object.defineProperty(Buffer4.prototype, "parent", {
|
|
262
258
|
enumerable: true,
|
|
263
259
|
get: function() {
|
|
264
|
-
if (!Buffer4.isBuffer(this))
|
|
265
|
-
return void 0;
|
|
260
|
+
if (!Buffer4.isBuffer(this)) return void 0;
|
|
266
261
|
return this.buffer;
|
|
267
262
|
}
|
|
268
263
|
});
|
|
269
264
|
Object.defineProperty(Buffer4.prototype, "offset", {
|
|
270
265
|
enumerable: true,
|
|
271
266
|
get: function() {
|
|
272
|
-
if (!Buffer4.isBuffer(this))
|
|
273
|
-
return void 0;
|
|
267
|
+
if (!Buffer4.isBuffer(this)) return void 0;
|
|
274
268
|
return this.byteOffset;
|
|
275
269
|
}
|
|
276
270
|
});
|
|
@@ -322,8 +316,7 @@ var require_buffer = __commonJS({
|
|
|
322
316
|
return Buffer4.from(valueOf, encodingOrOffset, length);
|
|
323
317
|
}
|
|
324
318
|
var b = fromObject(value);
|
|
325
|
-
if (b)
|
|
326
|
-
return b;
|
|
319
|
+
if (b) return b;
|
|
327
320
|
if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") {
|
|
328
321
|
return Buffer4.from(
|
|
329
322
|
value[Symbol.toPrimitive]("string"),
|
|
@@ -454,17 +447,14 @@ var require_buffer = __commonJS({
|
|
|
454
447
|
return b != null && b._isBuffer === true && b !== Buffer4.prototype;
|
|
455
448
|
};
|
|
456
449
|
Buffer4.compare = function compare(a, b) {
|
|
457
|
-
if (isInstance(a, Uint8Array))
|
|
458
|
-
|
|
459
|
-
if (isInstance(b, Uint8Array))
|
|
460
|
-
b = Buffer4.from(b, b.offset, b.byteLength);
|
|
450
|
+
if (isInstance(a, Uint8Array)) a = Buffer4.from(a, a.offset, a.byteLength);
|
|
451
|
+
if (isInstance(b, Uint8Array)) b = Buffer4.from(b, b.offset, b.byteLength);
|
|
461
452
|
if (!Buffer4.isBuffer(a) || !Buffer4.isBuffer(b)) {
|
|
462
453
|
throw new TypeError(
|
|
463
454
|
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
|
|
464
455
|
);
|
|
465
456
|
}
|
|
466
|
-
if (a === b)
|
|
467
|
-
return 0;
|
|
457
|
+
if (a === b) return 0;
|
|
468
458
|
var x = a.length;
|
|
469
459
|
var y = b.length;
|
|
470
460
|
for (var i = 0, len = Math.min(x, y); i < len; ++i) {
|
|
@@ -474,10 +464,8 @@ var require_buffer = __commonJS({
|
|
|
474
464
|
break;
|
|
475
465
|
}
|
|
476
466
|
}
|
|
477
|
-
if (x < y)
|
|
478
|
-
|
|
479
|
-
if (y < x)
|
|
480
|
-
return 1;
|
|
467
|
+
if (x < y) return -1;
|
|
468
|
+
if (y < x) return 1;
|
|
481
469
|
return 0;
|
|
482
470
|
};
|
|
483
471
|
Buffer4.isEncoding = function isEncoding(encoding) {
|
|
@@ -549,8 +537,7 @@ var require_buffer = __commonJS({
|
|
|
549
537
|
}
|
|
550
538
|
var len = string.length;
|
|
551
539
|
var mustMatch = arguments.length > 2 && arguments[2] === true;
|
|
552
|
-
if (!mustMatch && len === 0)
|
|
553
|
-
return 0;
|
|
540
|
+
if (!mustMatch && len === 0) return 0;
|
|
554
541
|
var loweredCase = false;
|
|
555
542
|
for (; ; ) {
|
|
556
543
|
switch (encoding) {
|
|
@@ -599,8 +586,7 @@ var require_buffer = __commonJS({
|
|
|
599
586
|
if (end <= start) {
|
|
600
587
|
return "";
|
|
601
588
|
}
|
|
602
|
-
if (!encoding)
|
|
603
|
-
encoding = "utf8";
|
|
589
|
+
if (!encoding) encoding = "utf8";
|
|
604
590
|
while (true) {
|
|
605
591
|
switch (encoding) {
|
|
606
592
|
case "hex":
|
|
@@ -621,8 +607,7 @@ var require_buffer = __commonJS({
|
|
|
621
607
|
case "utf-16le":
|
|
622
608
|
return utf16leSlice(this, start, end);
|
|
623
609
|
default:
|
|
624
|
-
if (loweredCase)
|
|
625
|
-
throw new TypeError("Unknown encoding: " + encoding);
|
|
610
|
+
if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
|
|
626
611
|
encoding = (encoding + "").toLowerCase();
|
|
627
612
|
loweredCase = true;
|
|
628
613
|
}
|
|
@@ -670,26 +655,21 @@ var require_buffer = __commonJS({
|
|
|
670
655
|
};
|
|
671
656
|
Buffer4.prototype.toString = function toString() {
|
|
672
657
|
var length = this.length;
|
|
673
|
-
if (length === 0)
|
|
674
|
-
|
|
675
|
-
if (arguments.length === 0)
|
|
676
|
-
return utf8Slice(this, 0, length);
|
|
658
|
+
if (length === 0) return "";
|
|
659
|
+
if (arguments.length === 0) return utf8Slice(this, 0, length);
|
|
677
660
|
return slowToString.apply(this, arguments);
|
|
678
661
|
};
|
|
679
662
|
Buffer4.prototype.toLocaleString = Buffer4.prototype.toString;
|
|
680
663
|
Buffer4.prototype.equals = function equals(b) {
|
|
681
|
-
if (!Buffer4.isBuffer(b))
|
|
682
|
-
|
|
683
|
-
if (this === b)
|
|
684
|
-
return true;
|
|
664
|
+
if (!Buffer4.isBuffer(b)) throw new TypeError("Argument must be a Buffer");
|
|
665
|
+
if (this === b) return true;
|
|
685
666
|
return Buffer4.compare(this, b) === 0;
|
|
686
667
|
};
|
|
687
668
|
Buffer4.prototype.inspect = function inspect() {
|
|
688
669
|
var str = "";
|
|
689
670
|
var max = exports2.INSPECT_MAX_BYTES;
|
|
690
671
|
str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim();
|
|
691
|
-
if (this.length > max)
|
|
692
|
-
str += " ... ";
|
|
672
|
+
if (this.length > max) str += " ... ";
|
|
693
673
|
return "<Buffer " + str + ">";
|
|
694
674
|
};
|
|
695
675
|
if (customInspectSymbol) {
|
|
@@ -732,8 +712,7 @@ var require_buffer = __commonJS({
|
|
|
732
712
|
end >>>= 0;
|
|
733
713
|
thisStart >>>= 0;
|
|
734
714
|
thisEnd >>>= 0;
|
|
735
|
-
if (this === target)
|
|
736
|
-
return 0;
|
|
715
|
+
if (this === target) return 0;
|
|
737
716
|
var x = thisEnd - thisStart;
|
|
738
717
|
var y = end - start;
|
|
739
718
|
var len = Math.min(x, y);
|
|
@@ -746,15 +725,12 @@ var require_buffer = __commonJS({
|
|
|
746
725
|
break;
|
|
747
726
|
}
|
|
748
727
|
}
|
|
749
|
-
if (x < y)
|
|
750
|
-
|
|
751
|
-
if (y < x)
|
|
752
|
-
return 1;
|
|
728
|
+
if (x < y) return -1;
|
|
729
|
+
if (y < x) return 1;
|
|
753
730
|
return 0;
|
|
754
731
|
};
|
|
755
732
|
function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
|
|
756
|
-
if (buffer.length === 0)
|
|
757
|
-
return -1;
|
|
733
|
+
if (buffer.length === 0) return -1;
|
|
758
734
|
if (typeof byteOffset === "string") {
|
|
759
735
|
encoding = byteOffset;
|
|
760
736
|
byteOffset = 0;
|
|
@@ -767,18 +743,13 @@ var require_buffer = __commonJS({
|
|
|
767
743
|
if (numberIsNaN(byteOffset)) {
|
|
768
744
|
byteOffset = dir ? 0 : buffer.length - 1;
|
|
769
745
|
}
|
|
770
|
-
if (byteOffset < 0)
|
|
771
|
-
byteOffset = buffer.length + byteOffset;
|
|
746
|
+
if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
|
|
772
747
|
if (byteOffset >= buffer.length) {
|
|
773
|
-
if (dir)
|
|
774
|
-
|
|
775
|
-
else
|
|
776
|
-
byteOffset = buffer.length - 1;
|
|
748
|
+
if (dir) return -1;
|
|
749
|
+
else byteOffset = buffer.length - 1;
|
|
777
750
|
} else if (byteOffset < 0) {
|
|
778
|
-
if (dir)
|
|
779
|
-
|
|
780
|
-
else
|
|
781
|
-
return -1;
|
|
751
|
+
if (dir) byteOffset = 0;
|
|
752
|
+
else return -1;
|
|
782
753
|
}
|
|
783
754
|
if (typeof val === "string") {
|
|
784
755
|
val = Buffer4.from(val, encoding);
|
|
@@ -829,19 +800,15 @@ var require_buffer = __commonJS({
|
|
|
829
800
|
var foundIndex = -1;
|
|
830
801
|
for (i = byteOffset; i < arrLength; i++) {
|
|
831
802
|
if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
|
|
832
|
-
if (foundIndex === -1)
|
|
833
|
-
|
|
834
|
-
if (i - foundIndex + 1 === valLength)
|
|
835
|
-
return foundIndex * indexSize;
|
|
803
|
+
if (foundIndex === -1) foundIndex = i;
|
|
804
|
+
if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;
|
|
836
805
|
} else {
|
|
837
|
-
if (foundIndex !== -1)
|
|
838
|
-
i -= i - foundIndex;
|
|
806
|
+
if (foundIndex !== -1) i -= i - foundIndex;
|
|
839
807
|
foundIndex = -1;
|
|
840
808
|
}
|
|
841
809
|
}
|
|
842
810
|
} else {
|
|
843
|
-
if (byteOffset + valLength > arrLength)
|
|
844
|
-
byteOffset = arrLength - valLength;
|
|
811
|
+
if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
|
|
845
812
|
for (i = byteOffset; i >= 0; i--) {
|
|
846
813
|
var found = true;
|
|
847
814
|
for (var j = 0; j < valLength; j++) {
|
|
@@ -850,8 +817,7 @@ var require_buffer = __commonJS({
|
|
|
850
817
|
break;
|
|
851
818
|
}
|
|
852
819
|
}
|
|
853
|
-
if (found)
|
|
854
|
-
return i;
|
|
820
|
+
if (found) return i;
|
|
855
821
|
}
|
|
856
822
|
}
|
|
857
823
|
return -1;
|
|
@@ -882,8 +848,7 @@ var require_buffer = __commonJS({
|
|
|
882
848
|
}
|
|
883
849
|
for (var i = 0; i < length; ++i) {
|
|
884
850
|
var parsed = parseInt(string.substr(i * 2, 2), 16);
|
|
885
|
-
if (numberIsNaN(parsed))
|
|
886
|
-
return i;
|
|
851
|
+
if (numberIsNaN(parsed)) return i;
|
|
887
852
|
buf[offset + i] = parsed;
|
|
888
853
|
}
|
|
889
854
|
return i;
|
|
@@ -913,8 +878,7 @@ var require_buffer = __commonJS({
|
|
|
913
878
|
offset = offset >>> 0;
|
|
914
879
|
if (isFinite(length)) {
|
|
915
880
|
length = length >>> 0;
|
|
916
|
-
if (encoding === void 0)
|
|
917
|
-
encoding = "utf8";
|
|
881
|
+
if (encoding === void 0) encoding = "utf8";
|
|
918
882
|
} else {
|
|
919
883
|
encoding = length;
|
|
920
884
|
length = void 0;
|
|
@@ -925,13 +889,11 @@ var require_buffer = __commonJS({
|
|
|
925
889
|
);
|
|
926
890
|
}
|
|
927
891
|
var remaining = this.length - offset;
|
|
928
|
-
if (length === void 0 || length > remaining)
|
|
929
|
-
length = remaining;
|
|
892
|
+
if (length === void 0 || length > remaining) length = remaining;
|
|
930
893
|
if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {
|
|
931
894
|
throw new RangeError("Attempt to write outside buffer bounds");
|
|
932
895
|
}
|
|
933
|
-
if (!encoding)
|
|
934
|
-
encoding = "utf8";
|
|
896
|
+
if (!encoding) encoding = "utf8";
|
|
935
897
|
var loweredCase = false;
|
|
936
898
|
for (; ; ) {
|
|
937
899
|
switch (encoding) {
|
|
@@ -952,8 +914,7 @@ var require_buffer = __commonJS({
|
|
|
952
914
|
case "utf-16le":
|
|
953
915
|
return ucs2Write(this, string, offset, length);
|
|
954
916
|
default:
|
|
955
|
-
if (loweredCase)
|
|
956
|
-
throw new TypeError("Unknown encoding: " + encoding);
|
|
917
|
+
if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
|
|
957
918
|
encoding = ("" + encoding).toLowerCase();
|
|
958
919
|
loweredCase = true;
|
|
959
920
|
}
|
|
@@ -1066,10 +1027,8 @@ var require_buffer = __commonJS({
|
|
|
1066
1027
|
}
|
|
1067
1028
|
function hexSlice(buf, start, end) {
|
|
1068
1029
|
var len = buf.length;
|
|
1069
|
-
if (!start || start < 0)
|
|
1070
|
-
|
|
1071
|
-
if (!end || end < 0 || end > len)
|
|
1072
|
-
end = len;
|
|
1030
|
+
if (!start || start < 0) start = 0;
|
|
1031
|
+
if (!end || end < 0 || end > len) end = len;
|
|
1073
1032
|
var out = "";
|
|
1074
1033
|
for (var i = start; i < end; ++i) {
|
|
1075
1034
|
out += hexSliceLookupTable[buf[i]];
|
|
@@ -1090,35 +1049,29 @@ var require_buffer = __commonJS({
|
|
|
1090
1049
|
end = end === void 0 ? len : ~~end;
|
|
1091
1050
|
if (start < 0) {
|
|
1092
1051
|
start += len;
|
|
1093
|
-
if (start < 0)
|
|
1094
|
-
start = 0;
|
|
1052
|
+
if (start < 0) start = 0;
|
|
1095
1053
|
} else if (start > len) {
|
|
1096
1054
|
start = len;
|
|
1097
1055
|
}
|
|
1098
1056
|
if (end < 0) {
|
|
1099
1057
|
end += len;
|
|
1100
|
-
if (end < 0)
|
|
1101
|
-
end = 0;
|
|
1058
|
+
if (end < 0) end = 0;
|
|
1102
1059
|
} else if (end > len) {
|
|
1103
1060
|
end = len;
|
|
1104
1061
|
}
|
|
1105
|
-
if (end < start)
|
|
1106
|
-
end = start;
|
|
1062
|
+
if (end < start) end = start;
|
|
1107
1063
|
var newBuf = this.subarray(start, end);
|
|
1108
1064
|
Object.setPrototypeOf(newBuf, Buffer4.prototype);
|
|
1109
1065
|
return newBuf;
|
|
1110
1066
|
};
|
|
1111
1067
|
function checkOffset(offset, ext, length) {
|
|
1112
|
-
if (offset % 1 !== 0 || offset < 0)
|
|
1113
|
-
|
|
1114
|
-
if (offset + ext > length)
|
|
1115
|
-
throw new RangeError("Trying to access beyond buffer length");
|
|
1068
|
+
if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint");
|
|
1069
|
+
if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length");
|
|
1116
1070
|
}
|
|
1117
1071
|
Buffer4.prototype.readUintLE = Buffer4.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) {
|
|
1118
1072
|
offset = offset >>> 0;
|
|
1119
1073
|
byteLength2 = byteLength2 >>> 0;
|
|
1120
|
-
if (!noAssert)
|
|
1121
|
-
checkOffset(offset, byteLength2, this.length);
|
|
1074
|
+
if (!noAssert) checkOffset(offset, byteLength2, this.length);
|
|
1122
1075
|
var val = this[offset];
|
|
1123
1076
|
var mul = 1;
|
|
1124
1077
|
var i = 0;
|
|
@@ -1142,39 +1095,33 @@ var require_buffer = __commonJS({
|
|
|
1142
1095
|
};
|
|
1143
1096
|
Buffer4.prototype.readUint8 = Buffer4.prototype.readUInt8 = function readUInt8(offset, noAssert) {
|
|
1144
1097
|
offset = offset >>> 0;
|
|
1145
|
-
if (!noAssert)
|
|
1146
|
-
checkOffset(offset, 1, this.length);
|
|
1098
|
+
if (!noAssert) checkOffset(offset, 1, this.length);
|
|
1147
1099
|
return this[offset];
|
|
1148
1100
|
};
|
|
1149
1101
|
Buffer4.prototype.readUint16LE = Buffer4.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
|
|
1150
1102
|
offset = offset >>> 0;
|
|
1151
|
-
if (!noAssert)
|
|
1152
|
-
checkOffset(offset, 2, this.length);
|
|
1103
|
+
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
1153
1104
|
return this[offset] | this[offset + 1] << 8;
|
|
1154
1105
|
};
|
|
1155
1106
|
Buffer4.prototype.readUint16BE = Buffer4.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
|
|
1156
1107
|
offset = offset >>> 0;
|
|
1157
|
-
if (!noAssert)
|
|
1158
|
-
checkOffset(offset, 2, this.length);
|
|
1108
|
+
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
1159
1109
|
return this[offset] << 8 | this[offset + 1];
|
|
1160
1110
|
};
|
|
1161
1111
|
Buffer4.prototype.readUint32LE = Buffer4.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
|
|
1162
1112
|
offset = offset >>> 0;
|
|
1163
|
-
if (!noAssert)
|
|
1164
|
-
checkOffset(offset, 4, this.length);
|
|
1113
|
+
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
1165
1114
|
return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;
|
|
1166
1115
|
};
|
|
1167
1116
|
Buffer4.prototype.readUint32BE = Buffer4.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
|
|
1168
1117
|
offset = offset >>> 0;
|
|
1169
|
-
if (!noAssert)
|
|
1170
|
-
checkOffset(offset, 4, this.length);
|
|
1118
|
+
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
1171
1119
|
return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
|
|
1172
1120
|
};
|
|
1173
1121
|
Buffer4.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) {
|
|
1174
1122
|
offset = offset >>> 0;
|
|
1175
1123
|
byteLength2 = byteLength2 >>> 0;
|
|
1176
|
-
if (!noAssert)
|
|
1177
|
-
checkOffset(offset, byteLength2, this.length);
|
|
1124
|
+
if (!noAssert) checkOffset(offset, byteLength2, this.length);
|
|
1178
1125
|
var val = this[offset];
|
|
1179
1126
|
var mul = 1;
|
|
1180
1127
|
var i = 0;
|
|
@@ -1182,15 +1129,13 @@ var require_buffer = __commonJS({
|
|
|
1182
1129
|
val += this[offset + i] * mul;
|
|
1183
1130
|
}
|
|
1184
1131
|
mul *= 128;
|
|
1185
|
-
if (val >= mul)
|
|
1186
|
-
val -= Math.pow(2, 8 * byteLength2);
|
|
1132
|
+
if (val >= mul) val -= Math.pow(2, 8 * byteLength2);
|
|
1187
1133
|
return val;
|
|
1188
1134
|
};
|
|
1189
1135
|
Buffer4.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) {
|
|
1190
1136
|
offset = offset >>> 0;
|
|
1191
1137
|
byteLength2 = byteLength2 >>> 0;
|
|
1192
|
-
if (!noAssert)
|
|
1193
|
-
checkOffset(offset, byteLength2, this.length);
|
|
1138
|
+
if (!noAssert) checkOffset(offset, byteLength2, this.length);
|
|
1194
1139
|
var i = byteLength2;
|
|
1195
1140
|
var mul = 1;
|
|
1196
1141
|
var val = this[offset + --i];
|
|
@@ -1198,75 +1143,61 @@ var require_buffer = __commonJS({
|
|
|
1198
1143
|
val += this[offset + --i] * mul;
|
|
1199
1144
|
}
|
|
1200
1145
|
mul *= 128;
|
|
1201
|
-
if (val >= mul)
|
|
1202
|
-
val -= Math.pow(2, 8 * byteLength2);
|
|
1146
|
+
if (val >= mul) val -= Math.pow(2, 8 * byteLength2);
|
|
1203
1147
|
return val;
|
|
1204
1148
|
};
|
|
1205
1149
|
Buffer4.prototype.readInt8 = function readInt8(offset, noAssert) {
|
|
1206
1150
|
offset = offset >>> 0;
|
|
1207
|
-
if (!noAssert)
|
|
1208
|
-
|
|
1209
|
-
if (!(this[offset] & 128))
|
|
1210
|
-
return this[offset];
|
|
1151
|
+
if (!noAssert) checkOffset(offset, 1, this.length);
|
|
1152
|
+
if (!(this[offset] & 128)) return this[offset];
|
|
1211
1153
|
return (255 - this[offset] + 1) * -1;
|
|
1212
1154
|
};
|
|
1213
1155
|
Buffer4.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
|
|
1214
1156
|
offset = offset >>> 0;
|
|
1215
|
-
if (!noAssert)
|
|
1216
|
-
checkOffset(offset, 2, this.length);
|
|
1157
|
+
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
1217
1158
|
var val = this[offset] | this[offset + 1] << 8;
|
|
1218
1159
|
return val & 32768 ? val | 4294901760 : val;
|
|
1219
1160
|
};
|
|
1220
1161
|
Buffer4.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
|
|
1221
1162
|
offset = offset >>> 0;
|
|
1222
|
-
if (!noAssert)
|
|
1223
|
-
checkOffset(offset, 2, this.length);
|
|
1163
|
+
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
1224
1164
|
var val = this[offset + 1] | this[offset] << 8;
|
|
1225
1165
|
return val & 32768 ? val | 4294901760 : val;
|
|
1226
1166
|
};
|
|
1227
1167
|
Buffer4.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
|
|
1228
1168
|
offset = offset >>> 0;
|
|
1229
|
-
if (!noAssert)
|
|
1230
|
-
checkOffset(offset, 4, this.length);
|
|
1169
|
+
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
1231
1170
|
return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
|
|
1232
1171
|
};
|
|
1233
1172
|
Buffer4.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
|
|
1234
1173
|
offset = offset >>> 0;
|
|
1235
|
-
if (!noAssert)
|
|
1236
|
-
checkOffset(offset, 4, this.length);
|
|
1174
|
+
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
1237
1175
|
return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
|
|
1238
1176
|
};
|
|
1239
1177
|
Buffer4.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
|
|
1240
1178
|
offset = offset >>> 0;
|
|
1241
|
-
if (!noAssert)
|
|
1242
|
-
checkOffset(offset, 4, this.length);
|
|
1179
|
+
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
1243
1180
|
return ieee754.read(this, offset, true, 23, 4);
|
|
1244
1181
|
};
|
|
1245
1182
|
Buffer4.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
|
|
1246
1183
|
offset = offset >>> 0;
|
|
1247
|
-
if (!noAssert)
|
|
1248
|
-
checkOffset(offset, 4, this.length);
|
|
1184
|
+
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
1249
1185
|
return ieee754.read(this, offset, false, 23, 4);
|
|
1250
1186
|
};
|
|
1251
1187
|
Buffer4.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
|
|
1252
1188
|
offset = offset >>> 0;
|
|
1253
|
-
if (!noAssert)
|
|
1254
|
-
checkOffset(offset, 8, this.length);
|
|
1189
|
+
if (!noAssert) checkOffset(offset, 8, this.length);
|
|
1255
1190
|
return ieee754.read(this, offset, true, 52, 8);
|
|
1256
1191
|
};
|
|
1257
1192
|
Buffer4.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
|
|
1258
1193
|
offset = offset >>> 0;
|
|
1259
|
-
if (!noAssert)
|
|
1260
|
-
checkOffset(offset, 8, this.length);
|
|
1194
|
+
if (!noAssert) checkOffset(offset, 8, this.length);
|
|
1261
1195
|
return ieee754.read(this, offset, false, 52, 8);
|
|
1262
1196
|
};
|
|
1263
1197
|
function checkInt(buf, value, offset, ext, max, min) {
|
|
1264
|
-
if (!Buffer4.isBuffer(buf))
|
|
1265
|
-
|
|
1266
|
-
if (
|
|
1267
|
-
throw new RangeError('"value" argument is out of bounds');
|
|
1268
|
-
if (offset + ext > buf.length)
|
|
1269
|
-
throw new RangeError("Index out of range");
|
|
1198
|
+
if (!Buffer4.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
1199
|
+
if (value > max || value < min) throw new RangeError('"value" argument is out of bounds');
|
|
1200
|
+
if (offset + ext > buf.length) throw new RangeError("Index out of range");
|
|
1270
1201
|
}
|
|
1271
1202
|
Buffer4.prototype.writeUintLE = Buffer4.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) {
|
|
1272
1203
|
value = +value;
|
|
@@ -1303,16 +1234,14 @@ var require_buffer = __commonJS({
|
|
|
1303
1234
|
Buffer4.prototype.writeUint8 = Buffer4.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
|
|
1304
1235
|
value = +value;
|
|
1305
1236
|
offset = offset >>> 0;
|
|
1306
|
-
if (!noAssert)
|
|
1307
|
-
checkInt(this, value, offset, 1, 255, 0);
|
|
1237
|
+
if (!noAssert) checkInt(this, value, offset, 1, 255, 0);
|
|
1308
1238
|
this[offset] = value & 255;
|
|
1309
1239
|
return offset + 1;
|
|
1310
1240
|
};
|
|
1311
1241
|
Buffer4.prototype.writeUint16LE = Buffer4.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
|
|
1312
1242
|
value = +value;
|
|
1313
1243
|
offset = offset >>> 0;
|
|
1314
|
-
if (!noAssert)
|
|
1315
|
-
checkInt(this, value, offset, 2, 65535, 0);
|
|
1244
|
+
if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
|
|
1316
1245
|
this[offset] = value & 255;
|
|
1317
1246
|
this[offset + 1] = value >>> 8;
|
|
1318
1247
|
return offset + 2;
|
|
@@ -1320,8 +1249,7 @@ var require_buffer = __commonJS({
|
|
|
1320
1249
|
Buffer4.prototype.writeUint16BE = Buffer4.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
|
|
1321
1250
|
value = +value;
|
|
1322
1251
|
offset = offset >>> 0;
|
|
1323
|
-
if (!noAssert)
|
|
1324
|
-
checkInt(this, value, offset, 2, 65535, 0);
|
|
1252
|
+
if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
|
|
1325
1253
|
this[offset] = value >>> 8;
|
|
1326
1254
|
this[offset + 1] = value & 255;
|
|
1327
1255
|
return offset + 2;
|
|
@@ -1329,8 +1257,7 @@ var require_buffer = __commonJS({
|
|
|
1329
1257
|
Buffer4.prototype.writeUint32LE = Buffer4.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
|
|
1330
1258
|
value = +value;
|
|
1331
1259
|
offset = offset >>> 0;
|
|
1332
|
-
if (!noAssert)
|
|
1333
|
-
checkInt(this, value, offset, 4, 4294967295, 0);
|
|
1260
|
+
if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
|
|
1334
1261
|
this[offset + 3] = value >>> 24;
|
|
1335
1262
|
this[offset + 2] = value >>> 16;
|
|
1336
1263
|
this[offset + 1] = value >>> 8;
|
|
@@ -1340,8 +1267,7 @@ var require_buffer = __commonJS({
|
|
|
1340
1267
|
Buffer4.prototype.writeUint32BE = Buffer4.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
|
|
1341
1268
|
value = +value;
|
|
1342
1269
|
offset = offset >>> 0;
|
|
1343
|
-
if (!noAssert)
|
|
1344
|
-
checkInt(this, value, offset, 4, 4294967295, 0);
|
|
1270
|
+
if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
|
|
1345
1271
|
this[offset] = value >>> 24;
|
|
1346
1272
|
this[offset + 1] = value >>> 16;
|
|
1347
1273
|
this[offset + 2] = value >>> 8;
|
|
@@ -1389,18 +1315,15 @@ var require_buffer = __commonJS({
|
|
|
1389
1315
|
Buffer4.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
|
|
1390
1316
|
value = +value;
|
|
1391
1317
|
offset = offset >>> 0;
|
|
1392
|
-
if (!noAssert)
|
|
1393
|
-
|
|
1394
|
-
if (value < 0)
|
|
1395
|
-
value = 255 + value + 1;
|
|
1318
|
+
if (!noAssert) checkInt(this, value, offset, 1, 127, -128);
|
|
1319
|
+
if (value < 0) value = 255 + value + 1;
|
|
1396
1320
|
this[offset] = value & 255;
|
|
1397
1321
|
return offset + 1;
|
|
1398
1322
|
};
|
|
1399
1323
|
Buffer4.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
|
|
1400
1324
|
value = +value;
|
|
1401
1325
|
offset = offset >>> 0;
|
|
1402
|
-
if (!noAssert)
|
|
1403
|
-
checkInt(this, value, offset, 2, 32767, -32768);
|
|
1326
|
+
if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
|
|
1404
1327
|
this[offset] = value & 255;
|
|
1405
1328
|
this[offset + 1] = value >>> 8;
|
|
1406
1329
|
return offset + 2;
|
|
@@ -1408,8 +1331,7 @@ var require_buffer = __commonJS({
|
|
|
1408
1331
|
Buffer4.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
|
|
1409
1332
|
value = +value;
|
|
1410
1333
|
offset = offset >>> 0;
|
|
1411
|
-
if (!noAssert)
|
|
1412
|
-
checkInt(this, value, offset, 2, 32767, -32768);
|
|
1334
|
+
if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
|
|
1413
1335
|
this[offset] = value >>> 8;
|
|
1414
1336
|
this[offset + 1] = value & 255;
|
|
1415
1337
|
return offset + 2;
|
|
@@ -1417,8 +1339,7 @@ var require_buffer = __commonJS({
|
|
|
1417
1339
|
Buffer4.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
|
|
1418
1340
|
value = +value;
|
|
1419
1341
|
offset = offset >>> 0;
|
|
1420
|
-
if (!noAssert)
|
|
1421
|
-
checkInt(this, value, offset, 4, 2147483647, -2147483648);
|
|
1342
|
+
if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
|
|
1422
1343
|
this[offset] = value & 255;
|
|
1423
1344
|
this[offset + 1] = value >>> 8;
|
|
1424
1345
|
this[offset + 2] = value >>> 16;
|
|
@@ -1428,10 +1349,8 @@ var require_buffer = __commonJS({
|
|
|
1428
1349
|
Buffer4.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
|
|
1429
1350
|
value = +value;
|
|
1430
1351
|
offset = offset >>> 0;
|
|
1431
|
-
if (!noAssert)
|
|
1432
|
-
|
|
1433
|
-
if (value < 0)
|
|
1434
|
-
value = 4294967295 + value + 1;
|
|
1352
|
+
if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
|
|
1353
|
+
if (value < 0) value = 4294967295 + value + 1;
|
|
1435
1354
|
this[offset] = value >>> 24;
|
|
1436
1355
|
this[offset + 1] = value >>> 16;
|
|
1437
1356
|
this[offset + 2] = value >>> 8;
|
|
@@ -1439,10 +1358,8 @@ var require_buffer = __commonJS({
|
|
|
1439
1358
|
return offset + 4;
|
|
1440
1359
|
};
|
|
1441
1360
|
function checkIEEE754(buf, value, offset, ext, max, min) {
|
|
1442
|
-
if (offset + ext > buf.length)
|
|
1443
|
-
|
|
1444
|
-
if (offset < 0)
|
|
1445
|
-
throw new RangeError("Index out of range");
|
|
1361
|
+
if (offset + ext > buf.length) throw new RangeError("Index out of range");
|
|
1362
|
+
if (offset < 0) throw new RangeError("Index out of range");
|
|
1446
1363
|
}
|
|
1447
1364
|
function writeFloat(buf, value, offset, littleEndian, noAssert) {
|
|
1448
1365
|
value = +value;
|
|
@@ -1475,31 +1392,20 @@ var require_buffer = __commonJS({
|
|
|
1475
1392
|
return writeDouble(this, value, offset, false, noAssert);
|
|
1476
1393
|
};
|
|
1477
1394
|
Buffer4.prototype.copy = function copy(target, targetStart, start, end) {
|
|
1478
|
-
if (!Buffer4.isBuffer(target))
|
|
1479
|
-
|
|
1480
|
-
if (!
|
|
1481
|
-
|
|
1482
|
-
if (!
|
|
1483
|
-
|
|
1484
|
-
if (
|
|
1485
|
-
|
|
1486
|
-
if (!targetStart)
|
|
1487
|
-
targetStart = 0;
|
|
1488
|
-
if (end > 0 && end < start)
|
|
1489
|
-
end = start;
|
|
1490
|
-
if (end === start)
|
|
1491
|
-
return 0;
|
|
1492
|
-
if (target.length === 0 || this.length === 0)
|
|
1493
|
-
return 0;
|
|
1395
|
+
if (!Buffer4.isBuffer(target)) throw new TypeError("argument should be a Buffer");
|
|
1396
|
+
if (!start) start = 0;
|
|
1397
|
+
if (!end && end !== 0) end = this.length;
|
|
1398
|
+
if (targetStart >= target.length) targetStart = target.length;
|
|
1399
|
+
if (!targetStart) targetStart = 0;
|
|
1400
|
+
if (end > 0 && end < start) end = start;
|
|
1401
|
+
if (end === start) return 0;
|
|
1402
|
+
if (target.length === 0 || this.length === 0) return 0;
|
|
1494
1403
|
if (targetStart < 0) {
|
|
1495
1404
|
throw new RangeError("targetStart out of bounds");
|
|
1496
1405
|
}
|
|
1497
|
-
if (start < 0 || start >= this.length)
|
|
1498
|
-
|
|
1499
|
-
if (end
|
|
1500
|
-
throw new RangeError("sourceEnd out of bounds");
|
|
1501
|
-
if (end > this.length)
|
|
1502
|
-
end = this.length;
|
|
1406
|
+
if (start < 0 || start >= this.length) throw new RangeError("Index out of range");
|
|
1407
|
+
if (end < 0) throw new RangeError("sourceEnd out of bounds");
|
|
1408
|
+
if (end > this.length) end = this.length;
|
|
1503
1409
|
if (target.length - targetStart < end - start) {
|
|
1504
1410
|
end = target.length - targetStart + start;
|
|
1505
1411
|
}
|
|
@@ -1550,8 +1456,7 @@ var require_buffer = __commonJS({
|
|
|
1550
1456
|
}
|
|
1551
1457
|
start = start >>> 0;
|
|
1552
1458
|
end = end === void 0 ? this.length : end >>> 0;
|
|
1553
|
-
if (!val)
|
|
1554
|
-
val = 0;
|
|
1459
|
+
if (!val) val = 0;
|
|
1555
1460
|
var i;
|
|
1556
1461
|
if (typeof val === "number") {
|
|
1557
1462
|
for (i = start; i < end; ++i) {
|
|
@@ -1573,8 +1478,7 @@ var require_buffer = __commonJS({
|
|
|
1573
1478
|
function base64clean(str) {
|
|
1574
1479
|
str = str.split("=")[0];
|
|
1575
1480
|
str = str.trim().replace(INVALID_BASE64_RE, "");
|
|
1576
|
-
if (str.length < 2)
|
|
1577
|
-
return "";
|
|
1481
|
+
if (str.length < 2) return "";
|
|
1578
1482
|
while (str.length % 4 !== 0) {
|
|
1579
1483
|
str = str + "=";
|
|
1580
1484
|
}
|
|
@@ -1591,51 +1495,43 @@ var require_buffer = __commonJS({
|
|
|
1591
1495
|
if (codePoint > 55295 && codePoint < 57344) {
|
|
1592
1496
|
if (!leadSurrogate) {
|
|
1593
1497
|
if (codePoint > 56319) {
|
|
1594
|
-
if ((units -= 3) > -1)
|
|
1595
|
-
bytes.push(239, 191, 189);
|
|
1498
|
+
if ((units -= 3) > -1) bytes.push(239, 191, 189);
|
|
1596
1499
|
continue;
|
|
1597
1500
|
} else if (i + 1 === length) {
|
|
1598
|
-
if ((units -= 3) > -1)
|
|
1599
|
-
bytes.push(239, 191, 189);
|
|
1501
|
+
if ((units -= 3) > -1) bytes.push(239, 191, 189);
|
|
1600
1502
|
continue;
|
|
1601
1503
|
}
|
|
1602
1504
|
leadSurrogate = codePoint;
|
|
1603
1505
|
continue;
|
|
1604
1506
|
}
|
|
1605
1507
|
if (codePoint < 56320) {
|
|
1606
|
-
if ((units -= 3) > -1)
|
|
1607
|
-
bytes.push(239, 191, 189);
|
|
1508
|
+
if ((units -= 3) > -1) bytes.push(239, 191, 189);
|
|
1608
1509
|
leadSurrogate = codePoint;
|
|
1609
1510
|
continue;
|
|
1610
1511
|
}
|
|
1611
1512
|
codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;
|
|
1612
1513
|
} else if (leadSurrogate) {
|
|
1613
|
-
if ((units -= 3) > -1)
|
|
1614
|
-
bytes.push(239, 191, 189);
|
|
1514
|
+
if ((units -= 3) > -1) bytes.push(239, 191, 189);
|
|
1615
1515
|
}
|
|
1616
1516
|
leadSurrogate = null;
|
|
1617
1517
|
if (codePoint < 128) {
|
|
1618
|
-
if ((units -= 1) < 0)
|
|
1619
|
-
break;
|
|
1518
|
+
if ((units -= 1) < 0) break;
|
|
1620
1519
|
bytes.push(codePoint);
|
|
1621
1520
|
} else if (codePoint < 2048) {
|
|
1622
|
-
if ((units -= 2) < 0)
|
|
1623
|
-
break;
|
|
1521
|
+
if ((units -= 2) < 0) break;
|
|
1624
1522
|
bytes.push(
|
|
1625
1523
|
codePoint >> 6 | 192,
|
|
1626
1524
|
codePoint & 63 | 128
|
|
1627
1525
|
);
|
|
1628
1526
|
} else if (codePoint < 65536) {
|
|
1629
|
-
if ((units -= 3) < 0)
|
|
1630
|
-
break;
|
|
1527
|
+
if ((units -= 3) < 0) break;
|
|
1631
1528
|
bytes.push(
|
|
1632
1529
|
codePoint >> 12 | 224,
|
|
1633
1530
|
codePoint >> 6 & 63 | 128,
|
|
1634
1531
|
codePoint & 63 | 128
|
|
1635
1532
|
);
|
|
1636
1533
|
} else if (codePoint < 1114112) {
|
|
1637
|
-
if ((units -= 4) < 0)
|
|
1638
|
-
break;
|
|
1534
|
+
if ((units -= 4) < 0) break;
|
|
1639
1535
|
bytes.push(
|
|
1640
1536
|
codePoint >> 18 | 240,
|
|
1641
1537
|
codePoint >> 12 & 63 | 128,
|
|
@@ -1659,8 +1555,7 @@ var require_buffer = __commonJS({
|
|
|
1659
1555
|
var c, hi, lo;
|
|
1660
1556
|
var byteArray = [];
|
|
1661
1557
|
for (var i = 0; i < str.length; ++i) {
|
|
1662
|
-
if ((units -= 2) < 0)
|
|
1663
|
-
break;
|
|
1558
|
+
if ((units -= 2) < 0) break;
|
|
1664
1559
|
c = str.charCodeAt(i);
|
|
1665
1560
|
hi = c >> 8;
|
|
1666
1561
|
lo = c % 256;
|
|
@@ -1674,8 +1569,7 @@ var require_buffer = __commonJS({
|
|
|
1674
1569
|
}
|
|
1675
1570
|
function blitBuffer(src, dst, offset, length) {
|
|
1676
1571
|
for (var i = 0; i < length; ++i) {
|
|
1677
|
-
if (i + offset >= dst.length || i >= src.length)
|
|
1678
|
-
break;
|
|
1572
|
+
if (i + offset >= dst.length || i >= src.length) break;
|
|
1679
1573
|
dst[i + offset] = src[i];
|
|
1680
1574
|
}
|
|
1681
1575
|
return i;
|
|
@@ -1686,7 +1580,7 @@ var require_buffer = __commonJS({
|
|
|
1686
1580
|
function numberIsNaN(obj) {
|
|
1687
1581
|
return obj !== obj;
|
|
1688
1582
|
}
|
|
1689
|
-
var hexSliceLookupTable = function() {
|
|
1583
|
+
var hexSliceLookupTable = (function() {
|
|
1690
1584
|
var alphabet = "0123456789abcdef";
|
|
1691
1585
|
var table = new Array(256);
|
|
1692
1586
|
for (var i = 0; i < 16; ++i) {
|
|
@@ -1696,7 +1590,7 @@ var require_buffer = __commonJS({
|
|
|
1696
1590
|
}
|
|
1697
1591
|
}
|
|
1698
1592
|
return table;
|
|
1699
|
-
}();
|
|
1593
|
+
})();
|
|
1700
1594
|
}
|
|
1701
1595
|
});
|
|
1702
1596
|
|
|
@@ -1971,7 +1865,7 @@ var init_shim = __esm({
|
|
|
1971
1865
|
"use strict";
|
|
1972
1866
|
import_buffer = __toESM(require_buffer());
|
|
1973
1867
|
import_process = __toESM(require_process());
|
|
1974
|
-
_globalThis = function(Object2) {
|
|
1868
|
+
_globalThis = (function(Object2) {
|
|
1975
1869
|
function get() {
|
|
1976
1870
|
var _global3 = this || self;
|
|
1977
1871
|
delete Object2.prototype.__magic__;
|
|
@@ -1990,7 +1884,7 @@ var init_shim = __esm({
|
|
|
1990
1884
|
var _global2 = __magic__;
|
|
1991
1885
|
return _global2;
|
|
1992
1886
|
}
|
|
1993
|
-
}(Object);
|
|
1887
|
+
})(Object);
|
|
1994
1888
|
_global = _globalThis;
|
|
1995
1889
|
}
|
|
1996
1890
|
});
|
|
@@ -2144,8 +2038,8 @@ var require_bs58 = __commonJS({
|
|
|
2144
2038
|
});
|
|
2145
2039
|
|
|
2146
2040
|
// src/index.ts
|
|
2147
|
-
var
|
|
2148
|
-
__export(
|
|
2041
|
+
var index_exports = {};
|
|
2042
|
+
__export(index_exports, {
|
|
2149
2043
|
API_URLS: () => API_URLS,
|
|
2150
2044
|
Account: () => Account,
|
|
2151
2045
|
BaseContractManager: () => BaseContract,
|
|
@@ -2168,7 +2062,7 @@ __export(src_exports, {
|
|
|
2168
2062
|
getMockSigner: () => getMockSigner,
|
|
2169
2063
|
utils: () => utils_exports
|
|
2170
2064
|
});
|
|
2171
|
-
module.exports = __toCommonJS(
|
|
2065
|
+
module.exports = __toCommonJS(index_exports);
|
|
2172
2066
|
init_shim();
|
|
2173
2067
|
|
|
2174
2068
|
// src/keyStore.ts
|
|
@@ -2671,8 +2565,7 @@ var LocalStorageStore = class extends BaseKeyStore {
|
|
|
2671
2565
|
orderlyKey = this.getItem(address, "orderlyKey");
|
|
2672
2566
|
} else {
|
|
2673
2567
|
const address2 = this.getAddress();
|
|
2674
|
-
if (!address2)
|
|
2675
|
-
return null;
|
|
2568
|
+
if (!address2) return null;
|
|
2676
2569
|
orderlyKey = this.getItem(address2, "orderlyKey");
|
|
2677
2570
|
}
|
|
2678
2571
|
if (!orderlyKey) {
|
|
@@ -5845,8 +5738,7 @@ var Assets = class {
|
|
|
5845
5738
|
throw new Error("decimals is required");
|
|
5846
5739
|
}
|
|
5847
5740
|
const brokerId = this.configStore.get("brokerId");
|
|
5848
|
-
if (!brokerId)
|
|
5849
|
-
throw new Error("[Assets]:brokerId is required");
|
|
5741
|
+
if (!brokerId) throw new Error("[Assets]:brokerId is required");
|
|
5850
5742
|
const depositData = {
|
|
5851
5743
|
accountId: this.account.accountIdHashStr,
|
|
5852
5744
|
brokerHash: parseBrokerHash(brokerId),
|
|
@@ -5915,8 +5807,7 @@ var Assets = class {
|
|
|
5915
5807
|
throw new Error("decimals is required");
|
|
5916
5808
|
}
|
|
5917
5809
|
const brokerId = this.configStore.get("brokerId");
|
|
5918
|
-
if (!brokerId)
|
|
5919
|
-
throw new Error("[Assets]:brokerId is required");
|
|
5810
|
+
if (!brokerId) throw new Error("[Assets]:brokerId is required");
|
|
5920
5811
|
const contractInfo = this.contractManger.getContractInfoByEnv();
|
|
5921
5812
|
const contractAddress = getContractInfoByChainId(
|
|
5922
5813
|
this.account.walletAdapter.chainId,
|
|
@@ -6213,12 +6104,9 @@ var _Account = class _Account {
|
|
|
6213
6104
|
logout() {
|
|
6214
6105
|
}
|
|
6215
6106
|
async setAddress(address, wallet, options) {
|
|
6216
|
-
if (!address)
|
|
6217
|
-
|
|
6218
|
-
if (!wallet)
|
|
6219
|
-
throw new import_types4.SDKError("Wallet is required");
|
|
6220
|
-
if (!wallet?.chain?.id)
|
|
6221
|
-
throw new import_types4.SDKError("Chain id is required");
|
|
6107
|
+
if (!address) throw new import_types4.SDKError("Address is required");
|
|
6108
|
+
if (!wallet) throw new import_types4.SDKError("Wallet is required");
|
|
6109
|
+
if (!wallet?.chain?.id) throw new import_types4.SDKError("Chain id is required");
|
|
6222
6110
|
if (this.stateValue.address === address) {
|
|
6223
6111
|
console.warn(
|
|
6224
6112
|
"address parameter is the same as the current address, if you want to change chain, please use `switchChain` method."
|
|
@@ -6765,12 +6653,10 @@ var _Account = class _Account {
|
|
|
6765
6653
|
}
|
|
6766
6654
|
async importOrderlyKey(options) {
|
|
6767
6655
|
const { address, secretKey, chainNamespace } = options;
|
|
6768
|
-
if (!address || !secretKey || !chainNamespace)
|
|
6769
|
-
return;
|
|
6656
|
+
if (!address || !secretKey || !chainNamespace) return;
|
|
6770
6657
|
const accountInfo = await this._checkAccountExist(address, chainNamespace);
|
|
6771
6658
|
const accountId = accountInfo?.account_id;
|
|
6772
|
-
if (!accountId)
|
|
6773
|
-
return;
|
|
6659
|
+
if (!accountId) return;
|
|
6774
6660
|
const orderlyKey = new BaseOrderlyKeyPair(secretKey);
|
|
6775
6661
|
const res = await this.checkOrderlyKey(address, orderlyKey, accountId);
|
|
6776
6662
|
if (res) {
|
|
@@ -6779,8 +6665,7 @@ var _Account = class _Account {
|
|
|
6779
6665
|
return res;
|
|
6780
6666
|
}
|
|
6781
6667
|
async checkOrderlyKey(address, orderlyKey, accountId) {
|
|
6782
|
-
if (!address || !orderlyKey || !accountId)
|
|
6783
|
-
return;
|
|
6668
|
+
if (!address || !orderlyKey || !accountId) return;
|
|
6784
6669
|
const publicKey = await orderlyKey.getPublicKey();
|
|
6785
6670
|
const orderlyKeyStatus = await this._checkOrderlyKeyState(
|
|
6786
6671
|
accountId,
|