@pioneer-platform/pioneer-react 0.2.46 → 0.2.47
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 +163952 -215421
- package/dist/{index_7b095b99.js → index_003befba.js} +1312 -1122
- package/dist/{index_9a2fa5ba.js → index_0364269a.js} +3 -3
- package/dist/{index_0233ab6e.js → index_0e37f5ff.js} +1 -1
- package/dist/{index_e21338b4.js → index_167c5f7a.js} +3 -3
- package/dist/{index_f1c394c8.js → index_1990afbf.js} +4 -4
- package/dist/{index_343f9468.js → index_29e62962.js} +4 -4
- package/dist/{index_cd7b7000.js → index_2cbf1530.js} +6 -6
- package/dist/{index_3d7082d3.js → index_310b7772.js} +9 -9
- package/dist/{index_fd3a5ec6.js → index_354cce52.js} +3 -3
- package/dist/{index_a2c6091a.js → index_37894947.js} +3 -3
- package/dist/{index_66933ca6.js → index_3891b298.js} +1 -1
- package/dist/{index_bfe24110.js → index_3a6b0cd3.js} +3 -3
- package/dist/{index_0e190af0.js → index_4a548214.js} +8 -8
- package/dist/{index_8f7f1311.js → index_542dbb9a.js} +4 -4
- package/dist/{index_dce9b56f.js → index_547d2868.js} +4 -4
- package/dist/{index_8ef2dd82.js → index_61a33920.js} +6 -6
- package/dist/{index_be8c55cd.js → index_674ffbfa.js} +9 -9
- package/dist/{index_192f4d2e.js → index_6d2a3e5c.js} +2 -6
- package/dist/{index_a47b2b71.js → index_7382dec1.js} +5 -5
- package/dist/{index_d0632736.js → index_7a1bb0b1.js} +8 -8
- package/dist/{index_5eb2fe9f.js → index_7c12bb44.js} +1 -1
- package/dist/{index_52e88303.js → index_85b01410.js} +6 -6
- package/dist/{index_c964d4f9.js → index_8b9255eb.js} +10 -10
- package/dist/{index_8c886fbb.js → index_a4f5a15a.js} +19 -19
- package/dist/{index_d910f98e.js → index_a682c1a8.js} +1 -3
- package/dist/{index_b9f8fd38.js → index_a6b45215.js} +3 -7
- package/dist/{index_af178090.js → index_ae6c3b10.js} +3 -3
- package/dist/{index_50faa3fa.js → index_b21f58b7.js} +4 -4
- package/dist/{index_66728978.js → index_b3022c1a.js} +5 -5
- package/dist/{index_41dc30a7.js → index_bd7e0d56.js} +2 -2
- package/dist/{index_394e6e8f.js → index_c8ebd6e3.js} +11 -11
- package/dist/{index_a46ee29a.js → index_ca633a1c.js} +7 -7
- package/dist/{index_1af9af9e.js → index_d8e757ba.js} +3 -3
- package/dist/{index_ada459da.js → index_e168f4c0.js} +7 -7
- package/dist/{index_8edb57a9.js → index_e233a036.js} +1 -1
- package/dist/{index_98d1dfc6.js → index_e57ba5a5.js} +3 -3
- package/dist/{index_05b89cc8.js → index_f19b5fe5.js} +3 -3
- package/dist/{index_d7d50cc6.js → index_f3922fc1.js} +3 -3
- package/dist/{index_92a17a5e.js → index_f80541a0.js} +25 -38
- package/dist/{index_2c508270.js → index_f9d1a3bf.js} +1 -3
- package/dist/{index_df76109e.js → index_f9d461d1.js} +3 -3
- package/package.json +1 -2
- package/src/lib/context/Pioneer/sdk/connect.ts +11 -11
- package/dist/index_0a85a2ce.js +0 -25
- package/dist/index_10812439.js +0 -25
- package/dist/index_1098f328.js +0 -12913
- package/dist/index_180735b4.js +0 -22872
- package/dist/index_24fdd0ba.js +0 -130
- package/dist/index_36ed5d98.js +0 -2856
- package/dist/index_3d5897c4.js +0 -1115
- package/dist/index_a591ed33.js +0 -446
- package/dist/index_ab332746.js +0 -121
- package/dist/index_b19211e4.js +0 -112
- package/dist/index_b2e7cbe3.js +0 -11003
- package/dist/index_ccf11e2f.js +0 -65
- package/dist/index_d8a5e2ef.js +0 -116
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { A } from "./index_0e37f5ff.js";
|
|
2
|
+
import { f as buffer, l as getAugmentedNamespace, m as events, g as global, p as process, c as commonjsGlobal, d as bech32$3 } from "./index_f80541a0.js";
|
|
3
|
+
import { i as inherits_browserExports, e as elliptic, b as bnExports } from "./index_a682c1a8.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "@chakra-ui/react";
|
|
6
|
+
import "react-dom";
|
|
7
|
+
var src$2 = {};
|
|
8
|
+
var src$1 = {};
|
|
9
|
+
var bip32$1 = {};
|
|
10
|
+
var crypto$4 = {};
|
|
3
11
|
var safeBuffer = { exports: {} };
|
|
4
12
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
5
13
|
(function(module, exports2) {
|
|
@@ -59,7 +67,15 @@ var safeBuffer = { exports: {} };
|
|
|
59
67
|
var safeBufferExports = safeBuffer.exports;
|
|
60
68
|
var readableBrowser = { exports: {} };
|
|
61
69
|
const require$$0 = /* @__PURE__ */ getAugmentedNamespace(events);
|
|
62
|
-
var streamBrowser
|
|
70
|
+
var streamBrowser;
|
|
71
|
+
var hasRequiredStreamBrowser;
|
|
72
|
+
function requireStreamBrowser() {
|
|
73
|
+
if (hasRequiredStreamBrowser)
|
|
74
|
+
return streamBrowser;
|
|
75
|
+
hasRequiredStreamBrowser = 1;
|
|
76
|
+
streamBrowser = require$$0.EventEmitter;
|
|
77
|
+
return streamBrowser;
|
|
78
|
+
}
|
|
63
79
|
var inherits$e;
|
|
64
80
|
if (typeof Object.create === "function") {
|
|
65
81
|
inherits$e = function inherits2(ctor, superCtor) {
|
|
@@ -125,10 +141,10 @@ function format(f) {
|
|
|
125
141
|
}
|
|
126
142
|
return str;
|
|
127
143
|
}
|
|
128
|
-
function deprecate
|
|
144
|
+
function deprecate(fn, msg) {
|
|
129
145
|
if (isUndefined(global.process)) {
|
|
130
146
|
return function() {
|
|
131
|
-
return deprecate
|
|
147
|
+
return deprecate(fn, msg).apply(this, arguments);
|
|
132
148
|
};
|
|
133
149
|
}
|
|
134
150
|
if (process.noDeprecation === true) {
|
|
@@ -475,8 +491,8 @@ function isPrimitive(arg) {
|
|
|
475
491
|
function isBuffer(maybeBuf) {
|
|
476
492
|
return buffer.Buffer.isBuffer(maybeBuf);
|
|
477
493
|
}
|
|
478
|
-
function objectToString(
|
|
479
|
-
return Object.prototype.toString.call(
|
|
494
|
+
function objectToString(o2) {
|
|
495
|
+
return Object.prototype.toString.call(o2);
|
|
480
496
|
}
|
|
481
497
|
function pad(n2) {
|
|
482
498
|
return n2 < 10 ? "0" + n2.toString(10) : n2.toString(10);
|
|
@@ -540,7 +556,7 @@ const util = {
|
|
|
540
556
|
isBoolean,
|
|
541
557
|
isArray,
|
|
542
558
|
inspect,
|
|
543
|
-
deprecate
|
|
559
|
+
deprecate,
|
|
544
560
|
format,
|
|
545
561
|
debuglog
|
|
546
562
|
};
|
|
@@ -549,7 +565,7 @@ const util$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
|
|
|
549
565
|
_extend,
|
|
550
566
|
debuglog,
|
|
551
567
|
default: util,
|
|
552
|
-
deprecate
|
|
568
|
+
deprecate,
|
|
553
569
|
format,
|
|
554
570
|
inherits: inherits$f,
|
|
555
571
|
inspect,
|
|
@@ -709,10 +725,10 @@ function requireBuffer_list() {
|
|
|
709
725
|
value: function join(s) {
|
|
710
726
|
if (this.length === 0)
|
|
711
727
|
return "";
|
|
712
|
-
var
|
|
713
|
-
var ret = "" +
|
|
714
|
-
while (
|
|
715
|
-
ret += s +
|
|
728
|
+
var p2 = this.head;
|
|
729
|
+
var ret = "" + p2.data;
|
|
730
|
+
while (p2 = p2.next)
|
|
731
|
+
ret += s + p2.data;
|
|
716
732
|
return ret;
|
|
717
733
|
}
|
|
718
734
|
}, {
|
|
@@ -721,12 +737,12 @@ function requireBuffer_list() {
|
|
|
721
737
|
if (this.length === 0)
|
|
722
738
|
return Buffer2.alloc(0);
|
|
723
739
|
var ret = Buffer2.allocUnsafe(n2 >>> 0);
|
|
724
|
-
var
|
|
740
|
+
var p2 = this.head;
|
|
725
741
|
var i = 0;
|
|
726
|
-
while (
|
|
727
|
-
copyBuffer(
|
|
728
|
-
i +=
|
|
729
|
-
|
|
742
|
+
while (p2) {
|
|
743
|
+
copyBuffer(p2.data, ret, i);
|
|
744
|
+
i += p2.data.length;
|
|
745
|
+
p2 = p2.next;
|
|
730
746
|
}
|
|
731
747
|
return ret;
|
|
732
748
|
}
|
|
@@ -754,12 +770,12 @@ function requireBuffer_list() {
|
|
|
754
770
|
}, {
|
|
755
771
|
key: "_getString",
|
|
756
772
|
value: function _getString(n2) {
|
|
757
|
-
var
|
|
758
|
-
var
|
|
759
|
-
var ret =
|
|
773
|
+
var p2 = this.head;
|
|
774
|
+
var c2 = 1;
|
|
775
|
+
var ret = p2.data;
|
|
760
776
|
n2 -= ret.length;
|
|
761
|
-
while (
|
|
762
|
-
var str =
|
|
777
|
+
while (p2 = p2.next) {
|
|
778
|
+
var str = p2.data;
|
|
763
779
|
var nb = n2 > str.length ? str.length : n2;
|
|
764
780
|
if (nb === str.length)
|
|
765
781
|
ret += str;
|
|
@@ -768,20 +784,20 @@ function requireBuffer_list() {
|
|
|
768
784
|
n2 -= nb;
|
|
769
785
|
if (n2 === 0) {
|
|
770
786
|
if (nb === str.length) {
|
|
771
|
-
++
|
|
772
|
-
if (
|
|
773
|
-
this.head =
|
|
787
|
+
++c2;
|
|
788
|
+
if (p2.next)
|
|
789
|
+
this.head = p2.next;
|
|
774
790
|
else
|
|
775
791
|
this.head = this.tail = null;
|
|
776
792
|
} else {
|
|
777
|
-
this.head =
|
|
778
|
-
|
|
793
|
+
this.head = p2;
|
|
794
|
+
p2.data = str.slice(nb);
|
|
779
795
|
}
|
|
780
796
|
break;
|
|
781
797
|
}
|
|
782
|
-
++
|
|
798
|
+
++c2;
|
|
783
799
|
}
|
|
784
|
-
this.length -=
|
|
800
|
+
this.length -= c2;
|
|
785
801
|
return ret;
|
|
786
802
|
}
|
|
787
803
|
// Consumes a specified amount of bytes from the buffered data.
|
|
@@ -789,31 +805,31 @@ function requireBuffer_list() {
|
|
|
789
805
|
key: "_getBuffer",
|
|
790
806
|
value: function _getBuffer(n2) {
|
|
791
807
|
var ret = Buffer2.allocUnsafe(n2);
|
|
792
|
-
var
|
|
793
|
-
var
|
|
794
|
-
|
|
795
|
-
n2 -=
|
|
796
|
-
while (
|
|
797
|
-
var buf =
|
|
808
|
+
var p2 = this.head;
|
|
809
|
+
var c2 = 1;
|
|
810
|
+
p2.data.copy(ret);
|
|
811
|
+
n2 -= p2.data.length;
|
|
812
|
+
while (p2 = p2.next) {
|
|
813
|
+
var buf = p2.data;
|
|
798
814
|
var nb = n2 > buf.length ? buf.length : n2;
|
|
799
815
|
buf.copy(ret, ret.length - n2, 0, nb);
|
|
800
816
|
n2 -= nb;
|
|
801
817
|
if (n2 === 0) {
|
|
802
818
|
if (nb === buf.length) {
|
|
803
|
-
++
|
|
804
|
-
if (
|
|
805
|
-
this.head =
|
|
819
|
+
++c2;
|
|
820
|
+
if (p2.next)
|
|
821
|
+
this.head = p2.next;
|
|
806
822
|
else
|
|
807
823
|
this.head = this.tail = null;
|
|
808
824
|
} else {
|
|
809
|
-
this.head =
|
|
810
|
-
|
|
825
|
+
this.head = p2;
|
|
826
|
+
p2.data = buf.slice(nb);
|
|
811
827
|
}
|
|
812
828
|
break;
|
|
813
829
|
}
|
|
814
|
-
++
|
|
830
|
+
++c2;
|
|
815
831
|
}
|
|
816
|
-
this.length -=
|
|
832
|
+
this.length -= c2;
|
|
817
833
|
return ret;
|
|
818
834
|
}
|
|
819
835
|
// Make sure the linked list only shows the minimal necessary information.
|
|
@@ -832,245 +848,276 @@ function requireBuffer_list() {
|
|
|
832
848
|
}();
|
|
833
849
|
return buffer_list;
|
|
834
850
|
}
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
851
|
+
var destroy_1;
|
|
852
|
+
var hasRequiredDestroy;
|
|
853
|
+
function requireDestroy() {
|
|
854
|
+
if (hasRequiredDestroy)
|
|
855
|
+
return destroy_1;
|
|
856
|
+
hasRequiredDestroy = 1;
|
|
857
|
+
function destroy(err, cb) {
|
|
858
|
+
var _this = this;
|
|
859
|
+
var readableDestroyed = this._readableState && this._readableState.destroyed;
|
|
860
|
+
var writableDestroyed = this._writableState && this._writableState.destroyed;
|
|
861
|
+
if (readableDestroyed || writableDestroyed) {
|
|
862
|
+
if (cb) {
|
|
863
|
+
cb(err);
|
|
864
|
+
} else if (err) {
|
|
865
|
+
if (!this._writableState) {
|
|
866
|
+
process.nextTick(emitErrorNT, this, err);
|
|
867
|
+
} else if (!this._writableState.errorEmitted) {
|
|
868
|
+
this._writableState.errorEmitted = true;
|
|
869
|
+
process.nextTick(emitErrorNT, this, err);
|
|
870
|
+
}
|
|
848
871
|
}
|
|
872
|
+
return this;
|
|
873
|
+
}
|
|
874
|
+
if (this._readableState) {
|
|
875
|
+
this._readableState.destroyed = true;
|
|
876
|
+
}
|
|
877
|
+
if (this._writableState) {
|
|
878
|
+
this._writableState.destroyed = true;
|
|
849
879
|
}
|
|
880
|
+
this._destroy(err || null, function(err2) {
|
|
881
|
+
if (!cb && err2) {
|
|
882
|
+
if (!_this._writableState) {
|
|
883
|
+
process.nextTick(emitErrorAndCloseNT, _this, err2);
|
|
884
|
+
} else if (!_this._writableState.errorEmitted) {
|
|
885
|
+
_this._writableState.errorEmitted = true;
|
|
886
|
+
process.nextTick(emitErrorAndCloseNT, _this, err2);
|
|
887
|
+
} else {
|
|
888
|
+
process.nextTick(emitCloseNT, _this);
|
|
889
|
+
}
|
|
890
|
+
} else if (cb) {
|
|
891
|
+
process.nextTick(emitCloseNT, _this);
|
|
892
|
+
cb(err2);
|
|
893
|
+
} else {
|
|
894
|
+
process.nextTick(emitCloseNT, _this);
|
|
895
|
+
}
|
|
896
|
+
});
|
|
850
897
|
return this;
|
|
851
898
|
}
|
|
852
|
-
|
|
853
|
-
|
|
899
|
+
function emitErrorAndCloseNT(self2, err) {
|
|
900
|
+
emitErrorNT(self2, err);
|
|
901
|
+
emitCloseNT(self2);
|
|
854
902
|
}
|
|
855
|
-
|
|
856
|
-
|
|
903
|
+
function emitCloseNT(self2) {
|
|
904
|
+
if (self2._writableState && !self2._writableState.emitClose)
|
|
905
|
+
return;
|
|
906
|
+
if (self2._readableState && !self2._readableState.emitClose)
|
|
907
|
+
return;
|
|
908
|
+
self2.emit("close");
|
|
909
|
+
}
|
|
910
|
+
function undestroy() {
|
|
911
|
+
if (this._readableState) {
|
|
912
|
+
this._readableState.destroyed = false;
|
|
913
|
+
this._readableState.reading = false;
|
|
914
|
+
this._readableState.ended = false;
|
|
915
|
+
this._readableState.endEmitted = false;
|
|
916
|
+
}
|
|
917
|
+
if (this._writableState) {
|
|
918
|
+
this._writableState.destroyed = false;
|
|
919
|
+
this._writableState.ended = false;
|
|
920
|
+
this._writableState.ending = false;
|
|
921
|
+
this._writableState.finalCalled = false;
|
|
922
|
+
this._writableState.prefinished = false;
|
|
923
|
+
this._writableState.finished = false;
|
|
924
|
+
this._writableState.errorEmitted = false;
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
function emitErrorNT(self2, err) {
|
|
928
|
+
self2.emit("error", err);
|
|
929
|
+
}
|
|
930
|
+
function errorOrDestroy(stream, err) {
|
|
931
|
+
var rState = stream._readableState;
|
|
932
|
+
var wState = stream._writableState;
|
|
933
|
+
if (rState && rState.autoDestroy || wState && wState.autoDestroy)
|
|
934
|
+
stream.destroy(err);
|
|
935
|
+
else
|
|
936
|
+
stream.emit("error", err);
|
|
857
937
|
}
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
938
|
+
destroy_1 = {
|
|
939
|
+
destroy,
|
|
940
|
+
undestroy,
|
|
941
|
+
errorOrDestroy
|
|
942
|
+
};
|
|
943
|
+
return destroy_1;
|
|
944
|
+
}
|
|
945
|
+
var errorsBrowser = {};
|
|
946
|
+
var hasRequiredErrorsBrowser;
|
|
947
|
+
function requireErrorsBrowser() {
|
|
948
|
+
if (hasRequiredErrorsBrowser)
|
|
949
|
+
return errorsBrowser;
|
|
950
|
+
hasRequiredErrorsBrowser = 1;
|
|
951
|
+
function _inheritsLoose(subClass, superClass) {
|
|
952
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
953
|
+
subClass.prototype.constructor = subClass;
|
|
954
|
+
subClass.__proto__ = superClass;
|
|
955
|
+
}
|
|
956
|
+
var codes = {};
|
|
957
|
+
function createErrorType(code, message, Base2) {
|
|
958
|
+
if (!Base2) {
|
|
959
|
+
Base2 = Error;
|
|
960
|
+
}
|
|
961
|
+
function getMessage(arg1, arg2, arg3) {
|
|
962
|
+
if (typeof message === "string") {
|
|
963
|
+
return message;
|
|
865
964
|
} else {
|
|
866
|
-
|
|
965
|
+
return message(arg1, arg2, arg3);
|
|
867
966
|
}
|
|
868
|
-
} else if (cb) {
|
|
869
|
-
process.nextTick(emitCloseNT, _this);
|
|
870
|
-
cb(err2);
|
|
871
|
-
} else {
|
|
872
|
-
process.nextTick(emitCloseNT, _this);
|
|
873
967
|
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
this._writableState.ending = false;
|
|
899
|
-
this._writableState.finalCalled = false;
|
|
900
|
-
this._writableState.prefinished = false;
|
|
901
|
-
this._writableState.finished = false;
|
|
902
|
-
this._writableState.errorEmitted = false;
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
function emitErrorNT(self2, err) {
|
|
906
|
-
self2.emit("error", err);
|
|
907
|
-
}
|
|
908
|
-
function errorOrDestroy(stream, err) {
|
|
909
|
-
var rState = stream._readableState;
|
|
910
|
-
var wState = stream._writableState;
|
|
911
|
-
if (rState && rState.autoDestroy || wState && wState.autoDestroy)
|
|
912
|
-
stream.destroy(err);
|
|
913
|
-
else
|
|
914
|
-
stream.emit("error", err);
|
|
915
|
-
}
|
|
916
|
-
var destroy_1 = {
|
|
917
|
-
destroy,
|
|
918
|
-
undestroy,
|
|
919
|
-
errorOrDestroy
|
|
920
|
-
};
|
|
921
|
-
var errorsBrowser = {};
|
|
922
|
-
function _inheritsLoose(subClass, superClass) {
|
|
923
|
-
subClass.prototype = Object.create(superClass.prototype);
|
|
924
|
-
subClass.prototype.constructor = subClass;
|
|
925
|
-
subClass.__proto__ = superClass;
|
|
926
|
-
}
|
|
927
|
-
var codes = {};
|
|
928
|
-
function createErrorType(code, message, Base2) {
|
|
929
|
-
if (!Base2) {
|
|
930
|
-
Base2 = Error;
|
|
931
|
-
}
|
|
932
|
-
function getMessage(arg1, arg2, arg3) {
|
|
933
|
-
if (typeof message === "string") {
|
|
934
|
-
return message;
|
|
968
|
+
var NodeError = /* @__PURE__ */ function(_Base) {
|
|
969
|
+
_inheritsLoose(NodeError2, _Base);
|
|
970
|
+
function NodeError2(arg1, arg2, arg3) {
|
|
971
|
+
return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
|
|
972
|
+
}
|
|
973
|
+
return NodeError2;
|
|
974
|
+
}(Base2);
|
|
975
|
+
NodeError.prototype.name = Base2.name;
|
|
976
|
+
NodeError.prototype.code = code;
|
|
977
|
+
codes[code] = NodeError;
|
|
978
|
+
}
|
|
979
|
+
function oneOf(expected, thing) {
|
|
980
|
+
if (Array.isArray(expected)) {
|
|
981
|
+
var len = expected.length;
|
|
982
|
+
expected = expected.map(function(i) {
|
|
983
|
+
return String(i);
|
|
984
|
+
});
|
|
985
|
+
if (len > 2) {
|
|
986
|
+
return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(", "), ", or ") + expected[len - 1];
|
|
987
|
+
} else if (len === 2) {
|
|
988
|
+
return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
|
|
989
|
+
} else {
|
|
990
|
+
return "of ".concat(thing, " ").concat(expected[0]);
|
|
991
|
+
}
|
|
935
992
|
} else {
|
|
936
|
-
return
|
|
993
|
+
return "of ".concat(thing, " ").concat(String(expected));
|
|
937
994
|
}
|
|
938
995
|
}
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
996
|
+
function startsWith(str, search, pos) {
|
|
997
|
+
return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
|
|
998
|
+
}
|
|
999
|
+
function endsWith(str, search, this_len) {
|
|
1000
|
+
if (this_len === void 0 || this_len > str.length) {
|
|
1001
|
+
this_len = str.length;
|
|
943
1002
|
}
|
|
944
|
-
return
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
var len = expected.length;
|
|
953
|
-
expected = expected.map(function(i) {
|
|
954
|
-
return String(i);
|
|
955
|
-
});
|
|
956
|
-
if (len > 2) {
|
|
957
|
-
return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(", "), ", or ") + expected[len - 1];
|
|
958
|
-
} else if (len === 2) {
|
|
959
|
-
return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
|
|
1003
|
+
return str.substring(this_len - search.length, this_len) === search;
|
|
1004
|
+
}
|
|
1005
|
+
function includes(str, search, start) {
|
|
1006
|
+
if (typeof start !== "number") {
|
|
1007
|
+
start = 0;
|
|
1008
|
+
}
|
|
1009
|
+
if (start + search.length > str.length) {
|
|
1010
|
+
return false;
|
|
960
1011
|
} else {
|
|
961
|
-
return
|
|
1012
|
+
return str.indexOf(search, start) !== -1;
|
|
962
1013
|
}
|
|
963
|
-
} else {
|
|
964
|
-
return "of ".concat(thing, " ").concat(String(expected));
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
function startsWith(str, search, pos) {
|
|
968
|
-
return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
|
|
969
|
-
}
|
|
970
|
-
function endsWith(str, search, this_len) {
|
|
971
|
-
if (this_len === void 0 || this_len > str.length) {
|
|
972
|
-
this_len = str.length;
|
|
973
1014
|
}
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
createErrorType("
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
}
|
|
1035
|
-
return Math.floor(hwm);
|
|
1036
|
-
}
|
|
1037
|
-
return state2.objectMode ? 16 : 16 * 1024;
|
|
1038
|
-
}
|
|
1039
|
-
var state = {
|
|
1040
|
-
getHighWaterMark
|
|
1041
|
-
};
|
|
1042
|
-
var browser$3 = deprecate;
|
|
1043
|
-
function deprecate(fn, msg) {
|
|
1044
|
-
if (config("noDeprecation")) {
|
|
1045
|
-
return fn;
|
|
1015
|
+
createErrorType("ERR_INVALID_OPT_VALUE", function(name, value3) {
|
|
1016
|
+
return 'The value "' + value3 + '" is invalid for option "' + name + '"';
|
|
1017
|
+
}, TypeError);
|
|
1018
|
+
createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) {
|
|
1019
|
+
var determiner;
|
|
1020
|
+
if (typeof expected === "string" && startsWith(expected, "not ")) {
|
|
1021
|
+
determiner = "must not be";
|
|
1022
|
+
expected = expected.replace(/^not /, "");
|
|
1023
|
+
} else {
|
|
1024
|
+
determiner = "must be";
|
|
1025
|
+
}
|
|
1026
|
+
var msg;
|
|
1027
|
+
if (endsWith(name, " argument")) {
|
|
1028
|
+
msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
1029
|
+
} else {
|
|
1030
|
+
var type = includes(name, ".") ? "property" : "argument";
|
|
1031
|
+
msg = 'The "'.concat(name, '" ').concat(type, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
1032
|
+
}
|
|
1033
|
+
msg += ". Received type ".concat(typeof actual);
|
|
1034
|
+
return msg;
|
|
1035
|
+
}, TypeError);
|
|
1036
|
+
createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
|
|
1037
|
+
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name) {
|
|
1038
|
+
return "The " + name + " method is not implemented";
|
|
1039
|
+
});
|
|
1040
|
+
createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
|
|
1041
|
+
createErrorType("ERR_STREAM_DESTROYED", function(name) {
|
|
1042
|
+
return "Cannot call " + name + " after a stream was destroyed";
|
|
1043
|
+
});
|
|
1044
|
+
createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
|
|
1045
|
+
createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
|
|
1046
|
+
createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end");
|
|
1047
|
+
createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError);
|
|
1048
|
+
createErrorType("ERR_UNKNOWN_ENCODING", function(arg) {
|
|
1049
|
+
return "Unknown encoding: " + arg;
|
|
1050
|
+
}, TypeError);
|
|
1051
|
+
createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event");
|
|
1052
|
+
errorsBrowser.codes = codes;
|
|
1053
|
+
return errorsBrowser;
|
|
1054
|
+
}
|
|
1055
|
+
var state;
|
|
1056
|
+
var hasRequiredState;
|
|
1057
|
+
function requireState() {
|
|
1058
|
+
if (hasRequiredState)
|
|
1059
|
+
return state;
|
|
1060
|
+
hasRequiredState = 1;
|
|
1061
|
+
var ERR_INVALID_OPT_VALUE = requireErrorsBrowser().codes.ERR_INVALID_OPT_VALUE;
|
|
1062
|
+
function highWaterMarkFrom(options, isDuplex, duplexKey) {
|
|
1063
|
+
return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
|
|
1064
|
+
}
|
|
1065
|
+
function getHighWaterMark(state2, options, duplexKey, isDuplex) {
|
|
1066
|
+
var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
|
|
1067
|
+
if (hwm != null) {
|
|
1068
|
+
if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
|
|
1069
|
+
var name = isDuplex ? duplexKey : "highWaterMark";
|
|
1070
|
+
throw new ERR_INVALID_OPT_VALUE(name, hwm);
|
|
1071
|
+
}
|
|
1072
|
+
return Math.floor(hwm);
|
|
1073
|
+
}
|
|
1074
|
+
return state2.objectMode ? 16 : 16 * 1024;
|
|
1046
1075
|
}
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1076
|
+
state = {
|
|
1077
|
+
getHighWaterMark
|
|
1078
|
+
};
|
|
1079
|
+
return state;
|
|
1080
|
+
}
|
|
1081
|
+
var browser$3;
|
|
1082
|
+
var hasRequiredBrowser;
|
|
1083
|
+
function requireBrowser() {
|
|
1084
|
+
if (hasRequiredBrowser)
|
|
1085
|
+
return browser$3;
|
|
1086
|
+
hasRequiredBrowser = 1;
|
|
1087
|
+
browser$3 = deprecate2;
|
|
1088
|
+
function deprecate2(fn, msg) {
|
|
1089
|
+
if (config("noDeprecation")) {
|
|
1090
|
+
return fn;
|
|
1091
|
+
}
|
|
1092
|
+
var warned = false;
|
|
1093
|
+
function deprecated() {
|
|
1094
|
+
if (!warned) {
|
|
1095
|
+
if (config("throwDeprecation")) {
|
|
1096
|
+
throw new Error(msg);
|
|
1097
|
+
} else if (config("traceDeprecation")) {
|
|
1098
|
+
console.trace(msg);
|
|
1099
|
+
} else {
|
|
1100
|
+
console.warn(msg);
|
|
1101
|
+
}
|
|
1102
|
+
warned = true;
|
|
1056
1103
|
}
|
|
1057
|
-
|
|
1104
|
+
return fn.apply(this, arguments);
|
|
1058
1105
|
}
|
|
1059
|
-
return
|
|
1106
|
+
return deprecated;
|
|
1060
1107
|
}
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1108
|
+
function config(name) {
|
|
1109
|
+
try {
|
|
1110
|
+
if (!commonjsGlobal.localStorage)
|
|
1111
|
+
return false;
|
|
1112
|
+
} catch (_) {
|
|
1066
1113
|
return false;
|
|
1067
|
-
|
|
1068
|
-
|
|
1114
|
+
}
|
|
1115
|
+
var val = commonjsGlobal.localStorage[name];
|
|
1116
|
+
if (null == val)
|
|
1117
|
+
return false;
|
|
1118
|
+
return String(val).toLowerCase() === "true";
|
|
1069
1119
|
}
|
|
1070
|
-
|
|
1071
|
-
if (null == val)
|
|
1072
|
-
return false;
|
|
1073
|
-
return String(val).toLowerCase() === "true";
|
|
1120
|
+
return browser$3;
|
|
1074
1121
|
}
|
|
1075
1122
|
var _stream_writable;
|
|
1076
1123
|
var hasRequired_stream_writable;
|
|
@@ -1087,12 +1134,12 @@ function require_stream_writable() {
|
|
|
1087
1134
|
onCorkedFinish(_this, state2);
|
|
1088
1135
|
};
|
|
1089
1136
|
}
|
|
1090
|
-
var
|
|
1137
|
+
var Duplex;
|
|
1091
1138
|
Writable.WritableState = WritableState;
|
|
1092
1139
|
var internalUtil = {
|
|
1093
|
-
deprecate:
|
|
1140
|
+
deprecate: requireBrowser()
|
|
1094
1141
|
};
|
|
1095
|
-
var Stream2 =
|
|
1142
|
+
var Stream2 = requireStreamBrowser();
|
|
1096
1143
|
var Buffer2 = buffer.Buffer;
|
|
1097
1144
|
var OurUint8Array = (typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
1098
1145
|
};
|
|
@@ -1102,22 +1149,22 @@ function require_stream_writable() {
|
|
|
1102
1149
|
function _isUint8Array(obj) {
|
|
1103
1150
|
return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
1104
1151
|
}
|
|
1105
|
-
var destroyImpl =
|
|
1106
|
-
var _require =
|
|
1107
|
-
var _require$
|
|
1108
|
-
var
|
|
1152
|
+
var destroyImpl = requireDestroy();
|
|
1153
|
+
var _require = requireState(), getHighWaterMark = _require.getHighWaterMark;
|
|
1154
|
+
var _require$codes = requireErrorsBrowser().codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
|
|
1155
|
+
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
|
1109
1156
|
inherits_browserExports(Writable, Stream2);
|
|
1110
1157
|
function nop() {
|
|
1111
1158
|
}
|
|
1112
1159
|
function WritableState(options, stream, isDuplex) {
|
|
1113
|
-
|
|
1160
|
+
Duplex = Duplex || require_stream_duplex();
|
|
1114
1161
|
options = options || {};
|
|
1115
1162
|
if (typeof isDuplex !== "boolean")
|
|
1116
|
-
isDuplex = stream instanceof
|
|
1163
|
+
isDuplex = stream instanceof Duplex;
|
|
1117
1164
|
this.objectMode = !!options.objectMode;
|
|
1118
1165
|
if (isDuplex)
|
|
1119
1166
|
this.objectMode = this.objectMode || !!options.writableObjectMode;
|
|
1120
|
-
this.highWaterMark =
|
|
1167
|
+
this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex);
|
|
1121
1168
|
this.finalCalled = false;
|
|
1122
1169
|
this.needDrain = false;
|
|
1123
1170
|
this.ending = false;
|
|
@@ -1184,8 +1231,8 @@ function require_stream_writable() {
|
|
|
1184
1231
|
};
|
|
1185
1232
|
}
|
|
1186
1233
|
function Writable(options) {
|
|
1187
|
-
|
|
1188
|
-
var isDuplex = this instanceof
|
|
1234
|
+
Duplex = Duplex || require_stream_duplex();
|
|
1235
|
+
var isDuplex = this instanceof Duplex;
|
|
1189
1236
|
if (!isDuplex && !realHasInstance.call(Writable, this))
|
|
1190
1237
|
return new Writable(options);
|
|
1191
1238
|
this._writableState = new WritableState(options, this, isDuplex);
|
|
@@ -1203,11 +1250,11 @@ function require_stream_writable() {
|
|
|
1203
1250
|
Stream2.call(this);
|
|
1204
1251
|
}
|
|
1205
1252
|
Writable.prototype.pipe = function() {
|
|
1206
|
-
|
|
1253
|
+
errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
|
|
1207
1254
|
};
|
|
1208
1255
|
function writeAfterEnd(stream, cb) {
|
|
1209
1256
|
var er = new ERR_STREAM_WRITE_AFTER_END();
|
|
1210
|
-
|
|
1257
|
+
errorOrDestroy(stream, er);
|
|
1211
1258
|
process.nextTick(cb, er);
|
|
1212
1259
|
}
|
|
1213
1260
|
function validChunk(stream, state2, chunk, cb) {
|
|
@@ -1218,7 +1265,7 @@ function require_stream_writable() {
|
|
|
1218
1265
|
er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk);
|
|
1219
1266
|
}
|
|
1220
1267
|
if (er) {
|
|
1221
|
-
|
|
1268
|
+
errorOrDestroy(stream, er);
|
|
1222
1269
|
process.nextTick(cb, er);
|
|
1223
1270
|
return false;
|
|
1224
1271
|
}
|
|
@@ -1332,7 +1379,7 @@ function require_stream_writable() {
|
|
|
1332
1379
|
state2.writing = true;
|
|
1333
1380
|
state2.sync = true;
|
|
1334
1381
|
if (state2.destroyed)
|
|
1335
|
-
state2.onwrite(new
|
|
1382
|
+
state2.onwrite(new ERR_STREAM_DESTROYED("write"));
|
|
1336
1383
|
else if (writev)
|
|
1337
1384
|
stream._writev(chunk, state2.onwrite);
|
|
1338
1385
|
else
|
|
@@ -1345,11 +1392,11 @@ function require_stream_writable() {
|
|
|
1345
1392
|
process.nextTick(cb, er);
|
|
1346
1393
|
process.nextTick(finishMaybe, stream, state2);
|
|
1347
1394
|
stream._writableState.errorEmitted = true;
|
|
1348
|
-
|
|
1395
|
+
errorOrDestroy(stream, er);
|
|
1349
1396
|
} else {
|
|
1350
1397
|
cb(er);
|
|
1351
1398
|
stream._writableState.errorEmitted = true;
|
|
1352
|
-
|
|
1399
|
+
errorOrDestroy(stream, er);
|
|
1353
1400
|
finishMaybe(stream, state2);
|
|
1354
1401
|
}
|
|
1355
1402
|
}
|
|
@@ -1364,7 +1411,7 @@ function require_stream_writable() {
|
|
|
1364
1411
|
var sync = state2.sync;
|
|
1365
1412
|
var cb = state2.writecb;
|
|
1366
1413
|
if (typeof cb !== "function")
|
|
1367
|
-
throw new
|
|
1414
|
+
throw new ERR_MULTIPLE_CALLBACK();
|
|
1368
1415
|
onwriteStateUpdate(state2);
|
|
1369
1416
|
if (er)
|
|
1370
1417
|
onwriteError(stream, state2, sync, er, cb);
|
|
@@ -1441,7 +1488,7 @@ function require_stream_writable() {
|
|
|
1441
1488
|
state2.bufferProcessing = false;
|
|
1442
1489
|
}
|
|
1443
1490
|
Writable.prototype._write = function(chunk, encoding, cb) {
|
|
1444
|
-
cb(new
|
|
1491
|
+
cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()"));
|
|
1445
1492
|
};
|
|
1446
1493
|
Writable.prototype._writev = null;
|
|
1447
1494
|
Writable.prototype.end = function(chunk, encoding, cb) {
|
|
@@ -1480,14 +1527,14 @@ function require_stream_writable() {
|
|
|
1480
1527
|
stream._final(function(err) {
|
|
1481
1528
|
state2.pendingcb--;
|
|
1482
1529
|
if (err) {
|
|
1483
|
-
|
|
1530
|
+
errorOrDestroy(stream, err);
|
|
1484
1531
|
}
|
|
1485
1532
|
state2.prefinished = true;
|
|
1486
1533
|
stream.emit("prefinish");
|
|
1487
1534
|
finishMaybe(stream, state2);
|
|
1488
1535
|
});
|
|
1489
1536
|
}
|
|
1490
|
-
function
|
|
1537
|
+
function prefinish(stream, state2) {
|
|
1491
1538
|
if (!state2.prefinished && !state2.finalCalled) {
|
|
1492
1539
|
if (typeof stream._final === "function" && !state2.destroyed) {
|
|
1493
1540
|
state2.pendingcb++;
|
|
@@ -1502,7 +1549,7 @@ function require_stream_writable() {
|
|
|
1502
1549
|
function finishMaybe(stream, state2) {
|
|
1503
1550
|
var need = needFinish(state2);
|
|
1504
1551
|
if (need) {
|
|
1505
|
-
|
|
1552
|
+
prefinish(stream, state2);
|
|
1506
1553
|
if (state2.pendingcb === 0) {
|
|
1507
1554
|
state2.finished = true;
|
|
1508
1555
|
stream.emit("finish");
|
|
@@ -1576,21 +1623,21 @@ function require_stream_duplex() {
|
|
|
1576
1623
|
keys2.push(key);
|
|
1577
1624
|
return keys2;
|
|
1578
1625
|
};
|
|
1579
|
-
_stream_duplex =
|
|
1626
|
+
_stream_duplex = Duplex;
|
|
1580
1627
|
var Readable = require_stream_readable();
|
|
1581
1628
|
var Writable = require_stream_writable();
|
|
1582
|
-
inherits_browserExports(
|
|
1629
|
+
inherits_browserExports(Duplex, Readable);
|
|
1583
1630
|
{
|
|
1584
1631
|
var keys = objectKeys(Writable.prototype);
|
|
1585
1632
|
for (var v = 0; v < keys.length; v++) {
|
|
1586
1633
|
var method = keys[v];
|
|
1587
|
-
if (!
|
|
1588
|
-
|
|
1634
|
+
if (!Duplex.prototype[method])
|
|
1635
|
+
Duplex.prototype[method] = Writable.prototype[method];
|
|
1589
1636
|
}
|
|
1590
1637
|
}
|
|
1591
|
-
function
|
|
1592
|
-
if (!(this instanceof
|
|
1593
|
-
return new
|
|
1638
|
+
function Duplex(options) {
|
|
1639
|
+
if (!(this instanceof Duplex))
|
|
1640
|
+
return new Duplex(options);
|
|
1594
1641
|
Readable.call(this, options);
|
|
1595
1642
|
Writable.call(this, options);
|
|
1596
1643
|
this.allowHalfOpen = true;
|
|
@@ -1605,7 +1652,7 @@ function require_stream_duplex() {
|
|
|
1605
1652
|
}
|
|
1606
1653
|
}
|
|
1607
1654
|
}
|
|
1608
|
-
Object.defineProperty(
|
|
1655
|
+
Object.defineProperty(Duplex.prototype, "writableHighWaterMark", {
|
|
1609
1656
|
// making it explicit this property is not enumerable
|
|
1610
1657
|
// because otherwise some prototype manipulation in
|
|
1611
1658
|
// userland will fail
|
|
@@ -1614,7 +1661,7 @@ function require_stream_duplex() {
|
|
|
1614
1661
|
return this._writableState.highWaterMark;
|
|
1615
1662
|
}
|
|
1616
1663
|
});
|
|
1617
|
-
Object.defineProperty(
|
|
1664
|
+
Object.defineProperty(Duplex.prototype, "writableBuffer", {
|
|
1618
1665
|
// making it explicit this property is not enumerable
|
|
1619
1666
|
// because otherwise some prototype manipulation in
|
|
1620
1667
|
// userland will fail
|
|
@@ -1623,7 +1670,7 @@ function require_stream_duplex() {
|
|
|
1623
1670
|
return this._writableState && this._writableState.getBuffer();
|
|
1624
1671
|
}
|
|
1625
1672
|
});
|
|
1626
|
-
Object.defineProperty(
|
|
1673
|
+
Object.defineProperty(Duplex.prototype, "writableLength", {
|
|
1627
1674
|
// making it explicit this property is not enumerable
|
|
1628
1675
|
// because otherwise some prototype manipulation in
|
|
1629
1676
|
// userland will fail
|
|
@@ -1640,7 +1687,7 @@ function require_stream_duplex() {
|
|
|
1640
1687
|
function onEndNT(self2) {
|
|
1641
1688
|
self2.end();
|
|
1642
1689
|
}
|
|
1643
|
-
Object.defineProperty(
|
|
1690
|
+
Object.defineProperty(Duplex.prototype, "destroyed", {
|
|
1644
1691
|
// making it explicit this property is not enumerable
|
|
1645
1692
|
// because otherwise some prototype manipulation in
|
|
1646
1693
|
// userland will fail
|
|
@@ -1816,7 +1863,7 @@ function utf8CheckIncomplete(self2, buf, i) {
|
|
|
1816
1863
|
}
|
|
1817
1864
|
return 0;
|
|
1818
1865
|
}
|
|
1819
|
-
function utf8CheckExtraBytes(self2, buf,
|
|
1866
|
+
function utf8CheckExtraBytes(self2, buf, p2) {
|
|
1820
1867
|
if ((buf[0] & 192) !== 128) {
|
|
1821
1868
|
self2.lastNeed = 0;
|
|
1822
1869
|
return "�";
|
|
@@ -1835,15 +1882,15 @@ function utf8CheckExtraBytes(self2, buf, p) {
|
|
|
1835
1882
|
}
|
|
1836
1883
|
}
|
|
1837
1884
|
function utf8FillLast(buf) {
|
|
1838
|
-
var
|
|
1885
|
+
var p2 = this.lastTotal - this.lastNeed;
|
|
1839
1886
|
var r = utf8CheckExtraBytes(this, buf);
|
|
1840
1887
|
if (r !== void 0)
|
|
1841
1888
|
return r;
|
|
1842
1889
|
if (this.lastNeed <= buf.length) {
|
|
1843
|
-
buf.copy(this.lastChar,
|
|
1890
|
+
buf.copy(this.lastChar, p2, 0, this.lastNeed);
|
|
1844
1891
|
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
1845
1892
|
}
|
|
1846
|
-
buf.copy(this.lastChar,
|
|
1893
|
+
buf.copy(this.lastChar, p2, 0, buf.length);
|
|
1847
1894
|
this.lastNeed -= buf.length;
|
|
1848
1895
|
}
|
|
1849
1896
|
function utf8Text(buf, i) {
|
|
@@ -1865,8 +1912,8 @@ function utf16Text(buf, i) {
|
|
|
1865
1912
|
if ((buf.length - i) % 2 === 0) {
|
|
1866
1913
|
var r = buf.toString("utf16le", i);
|
|
1867
1914
|
if (r) {
|
|
1868
|
-
var
|
|
1869
|
-
if (
|
|
1915
|
+
var c2 = r.charCodeAt(r.length - 1);
|
|
1916
|
+
if (c2 >= 55296 && c2 <= 56319) {
|
|
1870
1917
|
this.lastNeed = 2;
|
|
1871
1918
|
this.lastTotal = 4;
|
|
1872
1919
|
this.lastChar[0] = buf[buf.length - 2];
|
|
@@ -1915,100 +1962,108 @@ function simpleWrite(buf) {
|
|
|
1915
1962
|
function simpleEnd(buf) {
|
|
1916
1963
|
return buf && buf.length ? this.write(buf) : "";
|
|
1917
1964
|
}
|
|
1918
|
-
var
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
}
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
if (!
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
if (
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
stream.
|
|
1999
|
-
stream.
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
1965
|
+
var endOfStream;
|
|
1966
|
+
var hasRequiredEndOfStream;
|
|
1967
|
+
function requireEndOfStream() {
|
|
1968
|
+
if (hasRequiredEndOfStream)
|
|
1969
|
+
return endOfStream;
|
|
1970
|
+
hasRequiredEndOfStream = 1;
|
|
1971
|
+
var ERR_STREAM_PREMATURE_CLOSE = requireErrorsBrowser().codes.ERR_STREAM_PREMATURE_CLOSE;
|
|
1972
|
+
function once(callback) {
|
|
1973
|
+
var called = false;
|
|
1974
|
+
return function() {
|
|
1975
|
+
if (called)
|
|
1976
|
+
return;
|
|
1977
|
+
called = true;
|
|
1978
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1979
|
+
args[_key] = arguments[_key];
|
|
1980
|
+
}
|
|
1981
|
+
callback.apply(this, args);
|
|
1982
|
+
};
|
|
1983
|
+
}
|
|
1984
|
+
function noop() {
|
|
1985
|
+
}
|
|
1986
|
+
function isRequest(stream) {
|
|
1987
|
+
return stream.setHeader && typeof stream.abort === "function";
|
|
1988
|
+
}
|
|
1989
|
+
function eos(stream, opts, callback) {
|
|
1990
|
+
if (typeof opts === "function")
|
|
1991
|
+
return eos(stream, null, opts);
|
|
1992
|
+
if (!opts)
|
|
1993
|
+
opts = {};
|
|
1994
|
+
callback = once(callback || noop);
|
|
1995
|
+
var readable = opts.readable || opts.readable !== false && stream.readable;
|
|
1996
|
+
var writable = opts.writable || opts.writable !== false && stream.writable;
|
|
1997
|
+
var onlegacyfinish = function onlegacyfinish2() {
|
|
1998
|
+
if (!stream.writable)
|
|
1999
|
+
onfinish();
|
|
2000
|
+
};
|
|
2001
|
+
var writableEnded = stream._writableState && stream._writableState.finished;
|
|
2002
|
+
var onfinish = function onfinish2() {
|
|
2003
|
+
writable = false;
|
|
2004
|
+
writableEnded = true;
|
|
2005
|
+
if (!readable)
|
|
2006
|
+
callback.call(stream);
|
|
2007
|
+
};
|
|
2008
|
+
var readableEnded = stream._readableState && stream._readableState.endEmitted;
|
|
2009
|
+
var onend = function onend2() {
|
|
2010
|
+
readable = false;
|
|
2011
|
+
readableEnded = true;
|
|
2012
|
+
if (!writable)
|
|
2013
|
+
callback.call(stream);
|
|
2014
|
+
};
|
|
2015
|
+
var onerror = function onerror2(err) {
|
|
2016
|
+
callback.call(stream, err);
|
|
2017
|
+
};
|
|
2018
|
+
var onclose = function onclose2() {
|
|
2019
|
+
var err;
|
|
2020
|
+
if (readable && !readableEnded) {
|
|
2021
|
+
if (!stream._readableState || !stream._readableState.ended)
|
|
2022
|
+
err = new ERR_STREAM_PREMATURE_CLOSE();
|
|
2023
|
+
return callback.call(stream, err);
|
|
2024
|
+
}
|
|
2025
|
+
if (writable && !writableEnded) {
|
|
2026
|
+
if (!stream._writableState || !stream._writableState.ended)
|
|
2027
|
+
err = new ERR_STREAM_PREMATURE_CLOSE();
|
|
2028
|
+
return callback.call(stream, err);
|
|
2029
|
+
}
|
|
2030
|
+
};
|
|
2031
|
+
var onrequest = function onrequest2() {
|
|
2032
|
+
stream.req.on("finish", onfinish);
|
|
2033
|
+
};
|
|
2034
|
+
if (isRequest(stream)) {
|
|
2035
|
+
stream.on("complete", onfinish);
|
|
2036
|
+
stream.on("abort", onclose);
|
|
2037
|
+
if (stream.req)
|
|
2038
|
+
onrequest();
|
|
2039
|
+
else
|
|
2040
|
+
stream.on("request", onrequest);
|
|
2041
|
+
} else if (writable && !stream._writableState) {
|
|
2042
|
+
stream.on("end", onlegacyfinish);
|
|
2043
|
+
stream.on("close", onlegacyfinish);
|
|
2044
|
+
}
|
|
2045
|
+
stream.on("end", onend);
|
|
2046
|
+
stream.on("finish", onfinish);
|
|
2047
|
+
if (opts.error !== false)
|
|
2048
|
+
stream.on("error", onerror);
|
|
2049
|
+
stream.on("close", onclose);
|
|
2050
|
+
return function() {
|
|
2051
|
+
stream.removeListener("complete", onfinish);
|
|
2052
|
+
stream.removeListener("abort", onclose);
|
|
2053
|
+
stream.removeListener("request", onrequest);
|
|
2054
|
+
if (stream.req)
|
|
2055
|
+
stream.req.removeListener("finish", onfinish);
|
|
2056
|
+
stream.removeListener("end", onlegacyfinish);
|
|
2057
|
+
stream.removeListener("close", onlegacyfinish);
|
|
2058
|
+
stream.removeListener("finish", onfinish);
|
|
2059
|
+
stream.removeListener("end", onend);
|
|
2060
|
+
stream.removeListener("error", onerror);
|
|
2061
|
+
stream.removeListener("close", onclose);
|
|
2062
|
+
};
|
|
2063
|
+
}
|
|
2064
|
+
endOfStream = eos;
|
|
2065
|
+
return endOfStream;
|
|
2010
2066
|
}
|
|
2011
|
-
var endOfStream = eos$1;
|
|
2012
2067
|
var async_iterator;
|
|
2013
2068
|
var hasRequiredAsync_iterator;
|
|
2014
2069
|
function requireAsync_iterator() {
|
|
@@ -2041,7 +2096,7 @@ function requireAsync_iterator() {
|
|
|
2041
2096
|
}
|
|
2042
2097
|
return (hint === "string" ? String : Number)(input2);
|
|
2043
2098
|
}
|
|
2044
|
-
var finished =
|
|
2099
|
+
var finished = requireEndOfStream();
|
|
2045
2100
|
var kLastResolve = Symbol("lastResolve");
|
|
2046
2101
|
var kLastReject = Symbol("lastReject");
|
|
2047
2102
|
var kError = Symbol("error");
|
|
@@ -2049,10 +2104,10 @@ function requireAsync_iterator() {
|
|
|
2049
2104
|
var kLastPromise = Symbol("lastPromise");
|
|
2050
2105
|
var kHandlePromise = Symbol("handlePromise");
|
|
2051
2106
|
var kStream = Symbol("stream");
|
|
2052
|
-
function createIterResult(value3,
|
|
2107
|
+
function createIterResult(value3, done) {
|
|
2053
2108
|
return {
|
|
2054
2109
|
value: value3,
|
|
2055
|
-
done
|
|
2110
|
+
done
|
|
2056
2111
|
};
|
|
2057
2112
|
}
|
|
2058
2113
|
function readAndResolve(iter) {
|
|
@@ -2213,13 +2268,13 @@ function require_stream_readable() {
|
|
|
2213
2268
|
return _stream_readable;
|
|
2214
2269
|
hasRequired_stream_readable = 1;
|
|
2215
2270
|
_stream_readable = Readable;
|
|
2216
|
-
var
|
|
2271
|
+
var Duplex;
|
|
2217
2272
|
Readable.ReadableState = ReadableState;
|
|
2218
2273
|
require$$0.EventEmitter;
|
|
2219
2274
|
var EElistenerCount = function EElistenerCount2(emitter, type) {
|
|
2220
2275
|
return emitter.listeners(type).length;
|
|
2221
2276
|
};
|
|
2222
|
-
var Stream2 =
|
|
2277
|
+
var Stream2 = requireStreamBrowser();
|
|
2223
2278
|
var Buffer2 = buffer.Buffer;
|
|
2224
2279
|
var OurUint8Array = (typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
2225
2280
|
};
|
|
@@ -2238,14 +2293,14 @@ function require_stream_readable() {
|
|
|
2238
2293
|
};
|
|
2239
2294
|
}
|
|
2240
2295
|
var BufferList = requireBuffer_list();
|
|
2241
|
-
var destroyImpl =
|
|
2242
|
-
var _require =
|
|
2243
|
-
var _require$
|
|
2296
|
+
var destroyImpl = requireDestroy();
|
|
2297
|
+
var _require = requireState(), getHighWaterMark = _require.getHighWaterMark;
|
|
2298
|
+
var _require$codes = requireErrorsBrowser().codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
|
|
2244
2299
|
var StringDecoder2;
|
|
2245
2300
|
var createReadableStreamAsyncIterator;
|
|
2246
2301
|
var from;
|
|
2247
2302
|
inherits_browserExports(Readable, Stream2);
|
|
2248
|
-
var
|
|
2303
|
+
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
|
2249
2304
|
var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
|
|
2250
2305
|
function prependListener(emitter, event, fn) {
|
|
2251
2306
|
if (typeof emitter.prependListener === "function")
|
|
@@ -2258,14 +2313,14 @@ function require_stream_readable() {
|
|
|
2258
2313
|
emitter._events[event] = [fn, emitter._events[event]];
|
|
2259
2314
|
}
|
|
2260
2315
|
function ReadableState(options, stream, isDuplex) {
|
|
2261
|
-
|
|
2316
|
+
Duplex = Duplex || require_stream_duplex();
|
|
2262
2317
|
options = options || {};
|
|
2263
2318
|
if (typeof isDuplex !== "boolean")
|
|
2264
|
-
isDuplex = stream instanceof
|
|
2319
|
+
isDuplex = stream instanceof Duplex;
|
|
2265
2320
|
this.objectMode = !!options.objectMode;
|
|
2266
2321
|
if (isDuplex)
|
|
2267
2322
|
this.objectMode = this.objectMode || !!options.readableObjectMode;
|
|
2268
|
-
this.highWaterMark =
|
|
2323
|
+
this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex);
|
|
2269
2324
|
this.buffer = new BufferList();
|
|
2270
2325
|
this.length = 0;
|
|
2271
2326
|
this.pipes = null;
|
|
@@ -2296,10 +2351,10 @@ function require_stream_readable() {
|
|
|
2296
2351
|
}
|
|
2297
2352
|
}
|
|
2298
2353
|
function Readable(options) {
|
|
2299
|
-
|
|
2354
|
+
Duplex = Duplex || require_stream_duplex();
|
|
2300
2355
|
if (!(this instanceof Readable))
|
|
2301
2356
|
return new Readable(options);
|
|
2302
|
-
var isDuplex = this instanceof
|
|
2357
|
+
var isDuplex = this instanceof Duplex;
|
|
2303
2358
|
this._readableState = new ReadableState(options, this, isDuplex);
|
|
2304
2359
|
this.readable = true;
|
|
2305
2360
|
if (options) {
|
|
@@ -2364,18 +2419,18 @@ function require_stream_readable() {
|
|
|
2364
2419
|
if (!skipChunkCheck)
|
|
2365
2420
|
er = chunkInvalid(state2, chunk);
|
|
2366
2421
|
if (er) {
|
|
2367
|
-
|
|
2422
|
+
errorOrDestroy(stream, er);
|
|
2368
2423
|
} else if (state2.objectMode || chunk && chunk.length > 0) {
|
|
2369
2424
|
if (typeof chunk !== "string" && !state2.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) {
|
|
2370
2425
|
chunk = _uint8ArrayToBuffer(chunk);
|
|
2371
2426
|
}
|
|
2372
2427
|
if (addToFront) {
|
|
2373
2428
|
if (state2.endEmitted)
|
|
2374
|
-
|
|
2429
|
+
errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());
|
|
2375
2430
|
else
|
|
2376
2431
|
addChunk(stream, state2, chunk, true);
|
|
2377
2432
|
} else if (state2.ended) {
|
|
2378
|
-
|
|
2433
|
+
errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());
|
|
2379
2434
|
} else if (state2.destroyed) {
|
|
2380
2435
|
return false;
|
|
2381
2436
|
} else {
|
|
@@ -2428,11 +2483,11 @@ function require_stream_readable() {
|
|
|
2428
2483
|
var decoder = new StringDecoder2(enc);
|
|
2429
2484
|
this._readableState.decoder = decoder;
|
|
2430
2485
|
this._readableState.encoding = this._readableState.decoder.encoding;
|
|
2431
|
-
var
|
|
2486
|
+
var p2 = this._readableState.buffer.head;
|
|
2432
2487
|
var content = "";
|
|
2433
|
-
while (
|
|
2434
|
-
content += decoder.write(
|
|
2435
|
-
|
|
2488
|
+
while (p2 !== null) {
|
|
2489
|
+
content += decoder.write(p2.data);
|
|
2490
|
+
p2 = p2.next;
|
|
2436
2491
|
}
|
|
2437
2492
|
this._readableState.buffer.clear();
|
|
2438
2493
|
if (content !== "")
|
|
@@ -2598,7 +2653,7 @@ function require_stream_readable() {
|
|
|
2598
2653
|
state2.readingMore = false;
|
|
2599
2654
|
}
|
|
2600
2655
|
Readable.prototype._read = function(n2) {
|
|
2601
|
-
|
|
2656
|
+
errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()"));
|
|
2602
2657
|
};
|
|
2603
2658
|
Readable.prototype.pipe = function(dest, pipeOpts) {
|
|
2604
2659
|
var src2 = this;
|
|
@@ -2671,7 +2726,7 @@ function require_stream_readable() {
|
|
|
2671
2726
|
unpipe();
|
|
2672
2727
|
dest.removeListener("error", onerror);
|
|
2673
2728
|
if (EElistenerCount(dest, "error") === 0)
|
|
2674
|
-
|
|
2729
|
+
errorOrDestroy(dest, er);
|
|
2675
2730
|
}
|
|
2676
2731
|
prependListener(dest, "error", onerror);
|
|
2677
2732
|
function onclose() {
|
|
@@ -2998,214 +3053,238 @@ function require_stream_readable() {
|
|
|
2998
3053
|
}
|
|
2999
3054
|
return _stream_readable;
|
|
3000
3055
|
}
|
|
3001
|
-
var _stream_transform
|
|
3002
|
-
var
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
var
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
function Transform$3(options) {
|
|
3024
|
-
if (!(this instanceof Transform$3))
|
|
3025
|
-
return new Transform$3(options);
|
|
3026
|
-
Duplex.call(this, options);
|
|
3027
|
-
this._transformState = {
|
|
3028
|
-
afterTransform: afterTransform.bind(this),
|
|
3029
|
-
needTransform: false,
|
|
3030
|
-
transforming: false,
|
|
3031
|
-
writecb: null,
|
|
3032
|
-
writechunk: null,
|
|
3033
|
-
writeencoding: null
|
|
3034
|
-
};
|
|
3035
|
-
this._readableState.needReadable = true;
|
|
3036
|
-
this._readableState.sync = false;
|
|
3037
|
-
if (options) {
|
|
3038
|
-
if (typeof options.transform === "function")
|
|
3039
|
-
this._transform = options.transform;
|
|
3040
|
-
if (typeof options.flush === "function")
|
|
3041
|
-
this._flush = options.flush;
|
|
3042
|
-
}
|
|
3043
|
-
this.on("prefinish", prefinish);
|
|
3044
|
-
}
|
|
3045
|
-
function prefinish() {
|
|
3046
|
-
var _this = this;
|
|
3047
|
-
if (typeof this._flush === "function" && !this._readableState.destroyed) {
|
|
3048
|
-
this._flush(function(er, data) {
|
|
3049
|
-
done(_this, er, data);
|
|
3050
|
-
});
|
|
3051
|
-
} else {
|
|
3052
|
-
done(this, null, null);
|
|
3053
|
-
}
|
|
3054
|
-
}
|
|
3055
|
-
Transform$3.prototype.push = function(chunk, encoding) {
|
|
3056
|
-
this._transformState.needTransform = false;
|
|
3057
|
-
return Duplex.prototype.push.call(this, chunk, encoding);
|
|
3058
|
-
};
|
|
3059
|
-
Transform$3.prototype._transform = function(chunk, encoding, cb) {
|
|
3060
|
-
cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"));
|
|
3061
|
-
};
|
|
3062
|
-
Transform$3.prototype._write = function(chunk, encoding, cb) {
|
|
3063
|
-
var ts = this._transformState;
|
|
3064
|
-
ts.writecb = cb;
|
|
3065
|
-
ts.writechunk = chunk;
|
|
3066
|
-
ts.writeencoding = encoding;
|
|
3067
|
-
if (!ts.transforming) {
|
|
3056
|
+
var _stream_transform;
|
|
3057
|
+
var hasRequired_stream_transform;
|
|
3058
|
+
function require_stream_transform() {
|
|
3059
|
+
if (hasRequired_stream_transform)
|
|
3060
|
+
return _stream_transform;
|
|
3061
|
+
hasRequired_stream_transform = 1;
|
|
3062
|
+
_stream_transform = Transform2;
|
|
3063
|
+
var _require$codes = requireErrorsBrowser().codes, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
|
|
3064
|
+
var Duplex = require_stream_duplex();
|
|
3065
|
+
inherits_browserExports(Transform2, Duplex);
|
|
3066
|
+
function afterTransform(er, data) {
|
|
3067
|
+
var ts = this._transformState;
|
|
3068
|
+
ts.transforming = false;
|
|
3069
|
+
var cb = ts.writecb;
|
|
3070
|
+
if (cb === null) {
|
|
3071
|
+
return this.emit("error", new ERR_MULTIPLE_CALLBACK());
|
|
3072
|
+
}
|
|
3073
|
+
ts.writechunk = null;
|
|
3074
|
+
ts.writecb = null;
|
|
3075
|
+
if (data != null)
|
|
3076
|
+
this.push(data);
|
|
3077
|
+
cb(er);
|
|
3068
3078
|
var rs = this._readableState;
|
|
3069
|
-
|
|
3079
|
+
rs.reading = false;
|
|
3080
|
+
if (rs.needReadable || rs.length < rs.highWaterMark) {
|
|
3070
3081
|
this._read(rs.highWaterMark);
|
|
3082
|
+
}
|
|
3071
3083
|
}
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3084
|
+
function Transform2(options) {
|
|
3085
|
+
if (!(this instanceof Transform2))
|
|
3086
|
+
return new Transform2(options);
|
|
3087
|
+
Duplex.call(this, options);
|
|
3088
|
+
this._transformState = {
|
|
3089
|
+
afterTransform: afterTransform.bind(this),
|
|
3090
|
+
needTransform: false,
|
|
3091
|
+
transforming: false,
|
|
3092
|
+
writecb: null,
|
|
3093
|
+
writechunk: null,
|
|
3094
|
+
writeencoding: null
|
|
3095
|
+
};
|
|
3096
|
+
this._readableState.needReadable = true;
|
|
3097
|
+
this._readableState.sync = false;
|
|
3098
|
+
if (options) {
|
|
3099
|
+
if (typeof options.transform === "function")
|
|
3100
|
+
this._transform = options.transform;
|
|
3101
|
+
if (typeof options.flush === "function")
|
|
3102
|
+
this._flush = options.flush;
|
|
3103
|
+
}
|
|
3104
|
+
this.on("prefinish", prefinish);
|
|
3080
3105
|
}
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
};
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
if (stream._transformState.transforming)
|
|
3095
|
-
throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
|
|
3096
|
-
return stream.push(null);
|
|
3097
|
-
}
|
|
3098
|
-
var _stream_passthrough = PassThrough;
|
|
3099
|
-
var Transform$2 = _stream_transform;
|
|
3100
|
-
inherits_browserExports(PassThrough, Transform$2);
|
|
3101
|
-
function PassThrough(options) {
|
|
3102
|
-
if (!(this instanceof PassThrough))
|
|
3103
|
-
return new PassThrough(options);
|
|
3104
|
-
Transform$2.call(this, options);
|
|
3105
|
-
}
|
|
3106
|
-
PassThrough.prototype._transform = function(chunk, encoding, cb) {
|
|
3107
|
-
cb(null, chunk);
|
|
3108
|
-
};
|
|
3109
|
-
var eos;
|
|
3110
|
-
function once(callback) {
|
|
3111
|
-
var called = false;
|
|
3112
|
-
return function() {
|
|
3113
|
-
if (called)
|
|
3114
|
-
return;
|
|
3115
|
-
called = true;
|
|
3116
|
-
callback.apply(void 0, arguments);
|
|
3106
|
+
function prefinish() {
|
|
3107
|
+
var _this = this;
|
|
3108
|
+
if (typeof this._flush === "function" && !this._readableState.destroyed) {
|
|
3109
|
+
this._flush(function(er, data) {
|
|
3110
|
+
done(_this, er, data);
|
|
3111
|
+
});
|
|
3112
|
+
} else {
|
|
3113
|
+
done(this, null, null);
|
|
3114
|
+
}
|
|
3115
|
+
}
|
|
3116
|
+
Transform2.prototype.push = function(chunk, encoding) {
|
|
3117
|
+
this._transformState.needTransform = false;
|
|
3118
|
+
return Duplex.prototype.push.call(this, chunk, encoding);
|
|
3117
3119
|
};
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
function noop(err) {
|
|
3121
|
-
if (err)
|
|
3122
|
-
throw err;
|
|
3123
|
-
}
|
|
3124
|
-
function isRequest(stream) {
|
|
3125
|
-
return stream.setHeader && typeof stream.abort === "function";
|
|
3126
|
-
}
|
|
3127
|
-
function destroyer(stream, reading, writing, callback) {
|
|
3128
|
-
callback = once(callback);
|
|
3129
|
-
var closed = false;
|
|
3130
|
-
stream.on("close", function() {
|
|
3131
|
-
closed = true;
|
|
3132
|
-
});
|
|
3133
|
-
if (eos === void 0)
|
|
3134
|
-
eos = endOfStream;
|
|
3135
|
-
eos(stream, {
|
|
3136
|
-
readable: reading,
|
|
3137
|
-
writable: writing
|
|
3138
|
-
}, function(err) {
|
|
3139
|
-
if (err)
|
|
3140
|
-
return callback(err);
|
|
3141
|
-
closed = true;
|
|
3142
|
-
callback();
|
|
3143
|
-
});
|
|
3144
|
-
var destroyed = false;
|
|
3145
|
-
return function(err) {
|
|
3146
|
-
if (closed)
|
|
3147
|
-
return;
|
|
3148
|
-
if (destroyed)
|
|
3149
|
-
return;
|
|
3150
|
-
destroyed = true;
|
|
3151
|
-
if (isRequest(stream))
|
|
3152
|
-
return stream.abort();
|
|
3153
|
-
if (typeof stream.destroy === "function")
|
|
3154
|
-
return stream.destroy();
|
|
3155
|
-
callback(err || new ERR_STREAM_DESTROYED("pipe"));
|
|
3120
|
+
Transform2.prototype._transform = function(chunk, encoding, cb) {
|
|
3121
|
+
cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"));
|
|
3156
3122
|
};
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3123
|
+
Transform2.prototype._write = function(chunk, encoding, cb) {
|
|
3124
|
+
var ts = this._transformState;
|
|
3125
|
+
ts.writecb = cb;
|
|
3126
|
+
ts.writechunk = chunk;
|
|
3127
|
+
ts.writeencoding = encoding;
|
|
3128
|
+
if (!ts.transforming) {
|
|
3129
|
+
var rs = this._readableState;
|
|
3130
|
+
if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark)
|
|
3131
|
+
this._read(rs.highWaterMark);
|
|
3132
|
+
}
|
|
3133
|
+
};
|
|
3134
|
+
Transform2.prototype._read = function(n2) {
|
|
3135
|
+
var ts = this._transformState;
|
|
3136
|
+
if (ts.writechunk !== null && !ts.transforming) {
|
|
3137
|
+
ts.transforming = true;
|
|
3138
|
+
this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
|
|
3139
|
+
} else {
|
|
3140
|
+
ts.needTransform = true;
|
|
3141
|
+
}
|
|
3142
|
+
};
|
|
3143
|
+
Transform2.prototype._destroy = function(err, cb) {
|
|
3144
|
+
Duplex.prototype._destroy.call(this, err, function(err2) {
|
|
3145
|
+
cb(err2);
|
|
3146
|
+
});
|
|
3147
|
+
};
|
|
3148
|
+
function done(stream, er, data) {
|
|
3149
|
+
if (er)
|
|
3150
|
+
return stream.emit("error", er);
|
|
3151
|
+
if (data != null)
|
|
3152
|
+
stream.push(data);
|
|
3153
|
+
if (stream._writableState.length)
|
|
3154
|
+
throw new ERR_TRANSFORM_WITH_LENGTH_0();
|
|
3155
|
+
if (stream._transformState.transforming)
|
|
3156
|
+
throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
|
|
3157
|
+
return stream.push(null);
|
|
3158
|
+
}
|
|
3159
|
+
return _stream_transform;
|
|
3160
|
+
}
|
|
3161
|
+
var _stream_passthrough;
|
|
3162
|
+
var hasRequired_stream_passthrough;
|
|
3163
|
+
function require_stream_passthrough() {
|
|
3164
|
+
if (hasRequired_stream_passthrough)
|
|
3165
|
+
return _stream_passthrough;
|
|
3166
|
+
hasRequired_stream_passthrough = 1;
|
|
3167
|
+
_stream_passthrough = PassThrough;
|
|
3168
|
+
var Transform2 = require_stream_transform();
|
|
3169
|
+
inherits_browserExports(PassThrough, Transform2);
|
|
3170
|
+
function PassThrough(options) {
|
|
3171
|
+
if (!(this instanceof PassThrough))
|
|
3172
|
+
return new PassThrough(options);
|
|
3173
|
+
Transform2.call(this, options);
|
|
3174
|
+
}
|
|
3175
|
+
PassThrough.prototype._transform = function(chunk, encoding, cb) {
|
|
3176
|
+
cb(null, chunk);
|
|
3177
|
+
};
|
|
3178
|
+
return _stream_passthrough;
|
|
3179
|
+
}
|
|
3180
|
+
var pipeline_1;
|
|
3181
|
+
var hasRequiredPipeline;
|
|
3182
|
+
function requirePipeline() {
|
|
3183
|
+
if (hasRequiredPipeline)
|
|
3184
|
+
return pipeline_1;
|
|
3185
|
+
hasRequiredPipeline = 1;
|
|
3186
|
+
var eos;
|
|
3187
|
+
function once(callback) {
|
|
3188
|
+
var called = false;
|
|
3189
|
+
return function() {
|
|
3190
|
+
if (called)
|
|
3191
|
+
return;
|
|
3192
|
+
called = true;
|
|
3193
|
+
callback.apply(void 0, arguments);
|
|
3194
|
+
};
|
|
3195
|
+
}
|
|
3196
|
+
var _require$codes = requireErrorsBrowser().codes, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
|
|
3197
|
+
function noop(err) {
|
|
3198
|
+
if (err)
|
|
3199
|
+
throw err;
|
|
3200
|
+
}
|
|
3201
|
+
function isRequest(stream) {
|
|
3202
|
+
return stream.setHeader && typeof stream.abort === "function";
|
|
3203
|
+
}
|
|
3204
|
+
function destroyer(stream, reading, writing, callback) {
|
|
3205
|
+
callback = once(callback);
|
|
3206
|
+
var closed = false;
|
|
3207
|
+
stream.on("close", function() {
|
|
3208
|
+
closed = true;
|
|
3209
|
+
});
|
|
3210
|
+
if (eos === void 0)
|
|
3211
|
+
eos = requireEndOfStream();
|
|
3212
|
+
eos(stream, {
|
|
3213
|
+
readable: reading,
|
|
3214
|
+
writable: writing
|
|
3215
|
+
}, function(err) {
|
|
3188
3216
|
if (err)
|
|
3189
|
-
|
|
3190
|
-
|
|
3217
|
+
return callback(err);
|
|
3218
|
+
closed = true;
|
|
3219
|
+
callback();
|
|
3220
|
+
});
|
|
3221
|
+
var destroyed = false;
|
|
3222
|
+
return function(err) {
|
|
3223
|
+
if (closed)
|
|
3224
|
+
return;
|
|
3225
|
+
if (destroyed)
|
|
3191
3226
|
return;
|
|
3192
|
-
|
|
3193
|
-
|
|
3227
|
+
destroyed = true;
|
|
3228
|
+
if (isRequest(stream))
|
|
3229
|
+
return stream.abort();
|
|
3230
|
+
if (typeof stream.destroy === "function")
|
|
3231
|
+
return stream.destroy();
|
|
3232
|
+
callback(err || new ERR_STREAM_DESTROYED("pipe"));
|
|
3233
|
+
};
|
|
3234
|
+
}
|
|
3235
|
+
function call(fn) {
|
|
3236
|
+
fn();
|
|
3237
|
+
}
|
|
3238
|
+
function pipe(from, to) {
|
|
3239
|
+
return from.pipe(to);
|
|
3240
|
+
}
|
|
3241
|
+
function popCallback(streams) {
|
|
3242
|
+
if (!streams.length)
|
|
3243
|
+
return noop;
|
|
3244
|
+
if (typeof streams[streams.length - 1] !== "function")
|
|
3245
|
+
return noop;
|
|
3246
|
+
return streams.pop();
|
|
3247
|
+
}
|
|
3248
|
+
function pipeline() {
|
|
3249
|
+
for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3250
|
+
streams[_key] = arguments[_key];
|
|
3251
|
+
}
|
|
3252
|
+
var callback = popCallback(streams);
|
|
3253
|
+
if (Array.isArray(streams[0]))
|
|
3254
|
+
streams = streams[0];
|
|
3255
|
+
if (streams.length < 2) {
|
|
3256
|
+
throw new ERR_MISSING_ARGS("streams");
|
|
3257
|
+
}
|
|
3258
|
+
var error;
|
|
3259
|
+
var destroys = streams.map(function(stream, i) {
|
|
3260
|
+
var reading = i < streams.length - 1;
|
|
3261
|
+
var writing = i > 0;
|
|
3262
|
+
return destroyer(stream, reading, writing, function(err) {
|
|
3263
|
+
if (!error)
|
|
3264
|
+
error = err;
|
|
3265
|
+
if (err)
|
|
3266
|
+
destroys.forEach(call);
|
|
3267
|
+
if (reading)
|
|
3268
|
+
return;
|
|
3269
|
+
destroys.forEach(call);
|
|
3270
|
+
callback(error);
|
|
3271
|
+
});
|
|
3194
3272
|
});
|
|
3195
|
-
|
|
3196
|
-
|
|
3273
|
+
return streams.reduce(pipe);
|
|
3274
|
+
}
|
|
3275
|
+
pipeline_1 = pipeline;
|
|
3276
|
+
return pipeline_1;
|
|
3197
3277
|
}
|
|
3198
|
-
var pipeline_1 = pipeline;
|
|
3199
3278
|
(function(module, exports2) {
|
|
3200
3279
|
exports2 = module.exports = require_stream_readable();
|
|
3201
3280
|
exports2.Stream = exports2;
|
|
3202
3281
|
exports2.Readable = exports2;
|
|
3203
3282
|
exports2.Writable = require_stream_writable();
|
|
3204
3283
|
exports2.Duplex = require_stream_duplex();
|
|
3205
|
-
exports2.Transform =
|
|
3206
|
-
exports2.PassThrough =
|
|
3207
|
-
exports2.finished =
|
|
3208
|
-
exports2.pipeline =
|
|
3284
|
+
exports2.Transform = require_stream_transform();
|
|
3285
|
+
exports2.PassThrough = require_stream_passthrough();
|
|
3286
|
+
exports2.finished = requireEndOfStream();
|
|
3287
|
+
exports2.pipeline = requirePipeline();
|
|
3209
3288
|
})(readableBrowser, readableBrowser.exports);
|
|
3210
3289
|
var readableBrowserExports = readableBrowser.exports;
|
|
3211
3290
|
var Buffer$g = safeBufferExports.Buffer;
|
|
@@ -3305,75 +3384,75 @@ MD5$2.prototype._update = function() {
|
|
|
3305
3384
|
M[i] = this._block.readInt32LE(i * 4);
|
|
3306
3385
|
var a = this._a;
|
|
3307
3386
|
var b = this._b;
|
|
3308
|
-
var
|
|
3387
|
+
var c2 = this._c;
|
|
3309
3388
|
var d = this._d;
|
|
3310
|
-
a = fnF(a, b,
|
|
3311
|
-
d = fnF(d, a, b,
|
|
3312
|
-
|
|
3313
|
-
b = fnF(b,
|
|
3314
|
-
a = fnF(a, b,
|
|
3315
|
-
d = fnF(d, a, b,
|
|
3316
|
-
|
|
3317
|
-
b = fnF(b,
|
|
3318
|
-
a = fnF(a, b,
|
|
3319
|
-
d = fnF(d, a, b,
|
|
3320
|
-
|
|
3321
|
-
b = fnF(b,
|
|
3322
|
-
a = fnF(a, b,
|
|
3323
|
-
d = fnF(d, a, b,
|
|
3324
|
-
|
|
3325
|
-
b = fnF(b,
|
|
3326
|
-
a = fnG(a, b,
|
|
3327
|
-
d = fnG(d, a, b,
|
|
3328
|
-
|
|
3329
|
-
b = fnG(b,
|
|
3330
|
-
a = fnG(a, b,
|
|
3331
|
-
d = fnG(d, a, b,
|
|
3332
|
-
|
|
3333
|
-
b = fnG(b,
|
|
3334
|
-
a = fnG(a, b,
|
|
3335
|
-
d = fnG(d, a, b,
|
|
3336
|
-
|
|
3337
|
-
b = fnG(b,
|
|
3338
|
-
a = fnG(a, b,
|
|
3339
|
-
d = fnG(d, a, b,
|
|
3340
|
-
|
|
3341
|
-
b = fnG(b,
|
|
3342
|
-
a = fnH(a, b,
|
|
3343
|
-
d = fnH(d, a, b,
|
|
3344
|
-
|
|
3345
|
-
b = fnH(b,
|
|
3346
|
-
a = fnH(a, b,
|
|
3347
|
-
d = fnH(d, a, b,
|
|
3348
|
-
|
|
3349
|
-
b = fnH(b,
|
|
3350
|
-
a = fnH(a, b,
|
|
3351
|
-
d = fnH(d, a, b,
|
|
3352
|
-
|
|
3353
|
-
b = fnH(b,
|
|
3354
|
-
a = fnH(a, b,
|
|
3355
|
-
d = fnH(d, a, b,
|
|
3356
|
-
|
|
3357
|
-
b = fnH(b,
|
|
3358
|
-
a = fnI(a, b,
|
|
3359
|
-
d = fnI(d, a, b,
|
|
3360
|
-
|
|
3361
|
-
b = fnI(b,
|
|
3362
|
-
a = fnI(a, b,
|
|
3363
|
-
d = fnI(d, a, b,
|
|
3364
|
-
|
|
3365
|
-
b = fnI(b,
|
|
3366
|
-
a = fnI(a, b,
|
|
3367
|
-
d = fnI(d, a, b,
|
|
3368
|
-
|
|
3369
|
-
b = fnI(b,
|
|
3370
|
-
a = fnI(a, b,
|
|
3371
|
-
d = fnI(d, a, b,
|
|
3372
|
-
|
|
3373
|
-
b = fnI(b,
|
|
3389
|
+
a = fnF(a, b, c2, d, M[0], 3614090360, 7);
|
|
3390
|
+
d = fnF(d, a, b, c2, M[1], 3905402710, 12);
|
|
3391
|
+
c2 = fnF(c2, d, a, b, M[2], 606105819, 17);
|
|
3392
|
+
b = fnF(b, c2, d, a, M[3], 3250441966, 22);
|
|
3393
|
+
a = fnF(a, b, c2, d, M[4], 4118548399, 7);
|
|
3394
|
+
d = fnF(d, a, b, c2, M[5], 1200080426, 12);
|
|
3395
|
+
c2 = fnF(c2, d, a, b, M[6], 2821735955, 17);
|
|
3396
|
+
b = fnF(b, c2, d, a, M[7], 4249261313, 22);
|
|
3397
|
+
a = fnF(a, b, c2, d, M[8], 1770035416, 7);
|
|
3398
|
+
d = fnF(d, a, b, c2, M[9], 2336552879, 12);
|
|
3399
|
+
c2 = fnF(c2, d, a, b, M[10], 4294925233, 17);
|
|
3400
|
+
b = fnF(b, c2, d, a, M[11], 2304563134, 22);
|
|
3401
|
+
a = fnF(a, b, c2, d, M[12], 1804603682, 7);
|
|
3402
|
+
d = fnF(d, a, b, c2, M[13], 4254626195, 12);
|
|
3403
|
+
c2 = fnF(c2, d, a, b, M[14], 2792965006, 17);
|
|
3404
|
+
b = fnF(b, c2, d, a, M[15], 1236535329, 22);
|
|
3405
|
+
a = fnG(a, b, c2, d, M[1], 4129170786, 5);
|
|
3406
|
+
d = fnG(d, a, b, c2, M[6], 3225465664, 9);
|
|
3407
|
+
c2 = fnG(c2, d, a, b, M[11], 643717713, 14);
|
|
3408
|
+
b = fnG(b, c2, d, a, M[0], 3921069994, 20);
|
|
3409
|
+
a = fnG(a, b, c2, d, M[5], 3593408605, 5);
|
|
3410
|
+
d = fnG(d, a, b, c2, M[10], 38016083, 9);
|
|
3411
|
+
c2 = fnG(c2, d, a, b, M[15], 3634488961, 14);
|
|
3412
|
+
b = fnG(b, c2, d, a, M[4], 3889429448, 20);
|
|
3413
|
+
a = fnG(a, b, c2, d, M[9], 568446438, 5);
|
|
3414
|
+
d = fnG(d, a, b, c2, M[14], 3275163606, 9);
|
|
3415
|
+
c2 = fnG(c2, d, a, b, M[3], 4107603335, 14);
|
|
3416
|
+
b = fnG(b, c2, d, a, M[8], 1163531501, 20);
|
|
3417
|
+
a = fnG(a, b, c2, d, M[13], 2850285829, 5);
|
|
3418
|
+
d = fnG(d, a, b, c2, M[2], 4243563512, 9);
|
|
3419
|
+
c2 = fnG(c2, d, a, b, M[7], 1735328473, 14);
|
|
3420
|
+
b = fnG(b, c2, d, a, M[12], 2368359562, 20);
|
|
3421
|
+
a = fnH(a, b, c2, d, M[5], 4294588738, 4);
|
|
3422
|
+
d = fnH(d, a, b, c2, M[8], 2272392833, 11);
|
|
3423
|
+
c2 = fnH(c2, d, a, b, M[11], 1839030562, 16);
|
|
3424
|
+
b = fnH(b, c2, d, a, M[14], 4259657740, 23);
|
|
3425
|
+
a = fnH(a, b, c2, d, M[1], 2763975236, 4);
|
|
3426
|
+
d = fnH(d, a, b, c2, M[4], 1272893353, 11);
|
|
3427
|
+
c2 = fnH(c2, d, a, b, M[7], 4139469664, 16);
|
|
3428
|
+
b = fnH(b, c2, d, a, M[10], 3200236656, 23);
|
|
3429
|
+
a = fnH(a, b, c2, d, M[13], 681279174, 4);
|
|
3430
|
+
d = fnH(d, a, b, c2, M[0], 3936430074, 11);
|
|
3431
|
+
c2 = fnH(c2, d, a, b, M[3], 3572445317, 16);
|
|
3432
|
+
b = fnH(b, c2, d, a, M[6], 76029189, 23);
|
|
3433
|
+
a = fnH(a, b, c2, d, M[9], 3654602809, 4);
|
|
3434
|
+
d = fnH(d, a, b, c2, M[12], 3873151461, 11);
|
|
3435
|
+
c2 = fnH(c2, d, a, b, M[15], 530742520, 16);
|
|
3436
|
+
b = fnH(b, c2, d, a, M[2], 3299628645, 23);
|
|
3437
|
+
a = fnI(a, b, c2, d, M[0], 4096336452, 6);
|
|
3438
|
+
d = fnI(d, a, b, c2, M[7], 1126891415, 10);
|
|
3439
|
+
c2 = fnI(c2, d, a, b, M[14], 2878612391, 15);
|
|
3440
|
+
b = fnI(b, c2, d, a, M[5], 4237533241, 21);
|
|
3441
|
+
a = fnI(a, b, c2, d, M[12], 1700485571, 6);
|
|
3442
|
+
d = fnI(d, a, b, c2, M[3], 2399980690, 10);
|
|
3443
|
+
c2 = fnI(c2, d, a, b, M[10], 4293915773, 15);
|
|
3444
|
+
b = fnI(b, c2, d, a, M[1], 2240044497, 21);
|
|
3445
|
+
a = fnI(a, b, c2, d, M[8], 1873313359, 6);
|
|
3446
|
+
d = fnI(d, a, b, c2, M[15], 4264355552, 10);
|
|
3447
|
+
c2 = fnI(c2, d, a, b, M[6], 2734768916, 15);
|
|
3448
|
+
b = fnI(b, c2, d, a, M[13], 1309151649, 21);
|
|
3449
|
+
a = fnI(a, b, c2, d, M[4], 4149444226, 6);
|
|
3450
|
+
d = fnI(d, a, b, c2, M[11], 3174756917, 10);
|
|
3451
|
+
c2 = fnI(c2, d, a, b, M[2], 718787259, 15);
|
|
3452
|
+
b = fnI(b, c2, d, a, M[9], 3951481745, 21);
|
|
3374
3453
|
this._a = this._a + a | 0;
|
|
3375
3454
|
this._b = this._b + b | 0;
|
|
3376
|
-
this._c = this._c +
|
|
3455
|
+
this._c = this._c + c2 | 0;
|
|
3377
3456
|
this._d = this._d + d | 0;
|
|
3378
3457
|
};
|
|
3379
3458
|
MD5$2.prototype._digest = function() {
|
|
@@ -3397,17 +3476,17 @@ MD5$2.prototype._digest = function() {
|
|
|
3397
3476
|
function rotl$1(x, n2) {
|
|
3398
3477
|
return x << n2 | x >>> 32 - n2;
|
|
3399
3478
|
}
|
|
3400
|
-
function fnF(a, b,
|
|
3401
|
-
return rotl$1(a + (b &
|
|
3479
|
+
function fnF(a, b, c2, d, m2, k, s) {
|
|
3480
|
+
return rotl$1(a + (b & c2 | ~b & d) + m2 + k | 0, s) + b | 0;
|
|
3402
3481
|
}
|
|
3403
|
-
function fnG(a, b,
|
|
3404
|
-
return rotl$1(a + (b & d |
|
|
3482
|
+
function fnG(a, b, c2, d, m2, k, s) {
|
|
3483
|
+
return rotl$1(a + (b & d | c2 & ~d) + m2 + k | 0, s) + b | 0;
|
|
3405
3484
|
}
|
|
3406
|
-
function fnH(a, b,
|
|
3407
|
-
return rotl$1(a + (b ^
|
|
3485
|
+
function fnH(a, b, c2, d, m2, k, s) {
|
|
3486
|
+
return rotl$1(a + (b ^ c2 ^ d) + m2 + k | 0, s) + b | 0;
|
|
3408
3487
|
}
|
|
3409
|
-
function fnI(a, b,
|
|
3410
|
-
return rotl$1(a + (
|
|
3488
|
+
function fnI(a, b, c2, d, m2, k, s) {
|
|
3489
|
+
return rotl$1(a + (c2 ^ (b | ~d)) + m2 + k | 0, s) + b | 0;
|
|
3411
3490
|
}
|
|
3412
3491
|
var md5_js = MD5$2;
|
|
3413
3492
|
var Buffer$e = buffer.Buffer;
|
|
@@ -3826,20 +3905,20 @@ RIPEMD160$2.prototype._digest = function() {
|
|
|
3826
3905
|
function rotl(x, n2) {
|
|
3827
3906
|
return x << n2 | x >>> 32 - n2;
|
|
3828
3907
|
}
|
|
3829
|
-
function fn1(a, b,
|
|
3830
|
-
return rotl(a + (b ^
|
|
3908
|
+
function fn1(a, b, c2, d, e, m2, k, s) {
|
|
3909
|
+
return rotl(a + (b ^ c2 ^ d) + m2 + k | 0, s) + e | 0;
|
|
3831
3910
|
}
|
|
3832
|
-
function fn2(a, b,
|
|
3833
|
-
return rotl(a + (b &
|
|
3911
|
+
function fn2(a, b, c2, d, e, m2, k, s) {
|
|
3912
|
+
return rotl(a + (b & c2 | ~b & d) + m2 + k | 0, s) + e | 0;
|
|
3834
3913
|
}
|
|
3835
|
-
function fn3(a, b,
|
|
3836
|
-
return rotl(a + ((b | ~
|
|
3914
|
+
function fn3(a, b, c2, d, e, m2, k, s) {
|
|
3915
|
+
return rotl(a + ((b | ~c2) ^ d) + m2 + k | 0, s) + e | 0;
|
|
3837
3916
|
}
|
|
3838
|
-
function fn4(a, b,
|
|
3839
|
-
return rotl(a + (b & d |
|
|
3917
|
+
function fn4(a, b, c2, d, e, m2, k, s) {
|
|
3918
|
+
return rotl(a + (b & d | c2 & ~d) + m2 + k | 0, s) + e | 0;
|
|
3840
3919
|
}
|
|
3841
|
-
function fn5(a, b,
|
|
3842
|
-
return rotl(a + (b ^ (
|
|
3920
|
+
function fn5(a, b, c2, d, e, m2, k, s) {
|
|
3921
|
+
return rotl(a + (b ^ (c2 | ~d)) + m2 + k | 0, s) + e | 0;
|
|
3843
3922
|
}
|
|
3844
3923
|
var ripemd160$1 = RIPEMD160$2;
|
|
3845
3924
|
var sha_js = { exports: {} };
|
|
@@ -3929,18 +4008,18 @@ function rotl5$1(num) {
|
|
|
3929
4008
|
function rotl30$1(num) {
|
|
3930
4009
|
return num << 30 | num >>> 2;
|
|
3931
4010
|
}
|
|
3932
|
-
function ft$1(s, b,
|
|
4011
|
+
function ft$1(s, b, c2, d) {
|
|
3933
4012
|
if (s === 0)
|
|
3934
|
-
return b &
|
|
4013
|
+
return b & c2 | ~b & d;
|
|
3935
4014
|
if (s === 2)
|
|
3936
|
-
return b &
|
|
3937
|
-
return b ^
|
|
4015
|
+
return b & c2 | b & d | c2 & d;
|
|
4016
|
+
return b ^ c2 ^ d;
|
|
3938
4017
|
}
|
|
3939
4018
|
Sha.prototype._update = function(M) {
|
|
3940
4019
|
var W2 = this._w;
|
|
3941
4020
|
var a = this._a | 0;
|
|
3942
4021
|
var b = this._b | 0;
|
|
3943
|
-
var
|
|
4022
|
+
var c2 = this._c | 0;
|
|
3944
4023
|
var d = this._d | 0;
|
|
3945
4024
|
var e = this._e | 0;
|
|
3946
4025
|
for (var i = 0; i < 16; ++i)
|
|
@@ -3949,16 +4028,16 @@ Sha.prototype._update = function(M) {
|
|
|
3949
4028
|
W2[i] = W2[i - 3] ^ W2[i - 8] ^ W2[i - 14] ^ W2[i - 16];
|
|
3950
4029
|
for (var j = 0; j < 80; ++j) {
|
|
3951
4030
|
var s = ~~(j / 20);
|
|
3952
|
-
var t = rotl5$1(a) + ft$1(s, b,
|
|
4031
|
+
var t = rotl5$1(a) + ft$1(s, b, c2, d) + e + W2[j] + K$3[s] | 0;
|
|
3953
4032
|
e = d;
|
|
3954
|
-
d =
|
|
3955
|
-
|
|
4033
|
+
d = c2;
|
|
4034
|
+
c2 = rotl30$1(b);
|
|
3956
4035
|
b = a;
|
|
3957
4036
|
a = t;
|
|
3958
4037
|
}
|
|
3959
4038
|
this._a = a + this._a | 0;
|
|
3960
4039
|
this._b = b + this._b | 0;
|
|
3961
|
-
this._c =
|
|
4040
|
+
this._c = c2 + this._c | 0;
|
|
3962
4041
|
this._d = d + this._d | 0;
|
|
3963
4042
|
this._e = e + this._e | 0;
|
|
3964
4043
|
};
|
|
@@ -4005,18 +4084,18 @@ function rotl5(num) {
|
|
|
4005
4084
|
function rotl30(num) {
|
|
4006
4085
|
return num << 30 | num >>> 2;
|
|
4007
4086
|
}
|
|
4008
|
-
function ft(s, b,
|
|
4087
|
+
function ft(s, b, c2, d) {
|
|
4009
4088
|
if (s === 0)
|
|
4010
|
-
return b &
|
|
4089
|
+
return b & c2 | ~b & d;
|
|
4011
4090
|
if (s === 2)
|
|
4012
|
-
return b &
|
|
4013
|
-
return b ^
|
|
4091
|
+
return b & c2 | b & d | c2 & d;
|
|
4092
|
+
return b ^ c2 ^ d;
|
|
4014
4093
|
}
|
|
4015
4094
|
Sha1.prototype._update = function(M) {
|
|
4016
4095
|
var W2 = this._w;
|
|
4017
4096
|
var a = this._a | 0;
|
|
4018
4097
|
var b = this._b | 0;
|
|
4019
|
-
var
|
|
4098
|
+
var c2 = this._c | 0;
|
|
4020
4099
|
var d = this._d | 0;
|
|
4021
4100
|
var e = this._e | 0;
|
|
4022
4101
|
for (var i = 0; i < 16; ++i)
|
|
@@ -4025,16 +4104,16 @@ Sha1.prototype._update = function(M) {
|
|
|
4025
4104
|
W2[i] = rotl1(W2[i - 3] ^ W2[i - 8] ^ W2[i - 14] ^ W2[i - 16]);
|
|
4026
4105
|
for (var j = 0; j < 80; ++j) {
|
|
4027
4106
|
var s = ~~(j / 20);
|
|
4028
|
-
var t = rotl5(a) + ft(s, b,
|
|
4107
|
+
var t = rotl5(a) + ft(s, b, c2, d) + e + W2[j] + K$2[s] | 0;
|
|
4029
4108
|
e = d;
|
|
4030
|
-
d =
|
|
4031
|
-
|
|
4109
|
+
d = c2;
|
|
4110
|
+
c2 = rotl30(b);
|
|
4032
4111
|
b = a;
|
|
4033
4112
|
a = t;
|
|
4034
4113
|
}
|
|
4035
4114
|
this._a = a + this._a | 0;
|
|
4036
4115
|
this._b = b + this._b | 0;
|
|
4037
|
-
this._c =
|
|
4116
|
+
this._c = c2 + this._c | 0;
|
|
4038
4117
|
this._d = d + this._d | 0;
|
|
4039
4118
|
this._e = e + this._e | 0;
|
|
4040
4119
|
};
|
|
@@ -4157,36 +4236,36 @@ Sha256$1.prototype._update = function(M) {
|
|
|
4157
4236
|
var W2 = this._w;
|
|
4158
4237
|
var a = this._a | 0;
|
|
4159
4238
|
var b = this._b | 0;
|
|
4160
|
-
var
|
|
4239
|
+
var c2 = this._c | 0;
|
|
4161
4240
|
var d = this._d | 0;
|
|
4162
4241
|
var e = this._e | 0;
|
|
4163
4242
|
var f = this._f | 0;
|
|
4164
|
-
var
|
|
4165
|
-
var
|
|
4243
|
+
var g2 = this._g | 0;
|
|
4244
|
+
var h2 = this._h | 0;
|
|
4166
4245
|
for (var i = 0; i < 16; ++i)
|
|
4167
4246
|
W2[i] = M.readInt32BE(i * 4);
|
|
4168
4247
|
for (; i < 64; ++i)
|
|
4169
4248
|
W2[i] = gamma1(W2[i - 2]) + W2[i - 7] + gamma0(W2[i - 15]) + W2[i - 16] | 0;
|
|
4170
4249
|
for (var j = 0; j < 64; ++j) {
|
|
4171
|
-
var T1 =
|
|
4172
|
-
var T2 = sigma0$1(a) + maj$1(a, b,
|
|
4173
|
-
|
|
4174
|
-
|
|
4250
|
+
var T1 = h2 + sigma1$1(e) + ch(e, f, g2) + K$1[j] + W2[j] | 0;
|
|
4251
|
+
var T2 = sigma0$1(a) + maj$1(a, b, c2) | 0;
|
|
4252
|
+
h2 = g2;
|
|
4253
|
+
g2 = f;
|
|
4175
4254
|
f = e;
|
|
4176
4255
|
e = d + T1 | 0;
|
|
4177
|
-
d =
|
|
4178
|
-
|
|
4256
|
+
d = c2;
|
|
4257
|
+
c2 = b;
|
|
4179
4258
|
b = a;
|
|
4180
4259
|
a = T1 + T2 | 0;
|
|
4181
4260
|
}
|
|
4182
4261
|
this._a = a + this._a | 0;
|
|
4183
4262
|
this._b = b + this._b | 0;
|
|
4184
|
-
this._c =
|
|
4263
|
+
this._c = c2 + this._c | 0;
|
|
4185
4264
|
this._d = d + this._d | 0;
|
|
4186
4265
|
this._e = e + this._e | 0;
|
|
4187
4266
|
this._f = f + this._f | 0;
|
|
4188
|
-
this._g =
|
|
4189
|
-
this._h =
|
|
4267
|
+
this._g = g2 + this._g | 0;
|
|
4268
|
+
this._h = h2 + this._h | 0;
|
|
4190
4269
|
};
|
|
4191
4270
|
Sha256$1.prototype._hash = function() {
|
|
4192
4271
|
var H = Buffer$a.allocUnsafe(32);
|
|
@@ -4556,8 +4635,8 @@ Sha512.prototype._update = function(M) {
|
|
|
4556
4635
|
};
|
|
4557
4636
|
Sha512.prototype._hash = function() {
|
|
4558
4637
|
var H = Buffer$8.allocUnsafe(64);
|
|
4559
|
-
function writeInt64BE(
|
|
4560
|
-
H.writeInt32BE(
|
|
4638
|
+
function writeInt64BE(h2, l, offset) {
|
|
4639
|
+
H.writeInt32BE(h2, offset);
|
|
4561
4640
|
H.writeInt32BE(l, offset + 4);
|
|
4562
4641
|
}
|
|
4563
4642
|
writeInt64BE(this._ah, this._al, 0);
|
|
@@ -4603,8 +4682,8 @@ Sha384.prototype.init = function() {
|
|
|
4603
4682
|
};
|
|
4604
4683
|
Sha384.prototype._hash = function() {
|
|
4605
4684
|
var H = Buffer$7.allocUnsafe(48);
|
|
4606
|
-
function writeInt64BE(
|
|
4607
|
-
H.writeInt32BE(
|
|
4685
|
+
function writeInt64BE(h2, l, offset) {
|
|
4686
|
+
H.writeInt32BE(h2, offset);
|
|
4608
4687
|
H.writeInt32BE(l, offset + 4);
|
|
4609
4688
|
}
|
|
4610
4689
|
writeInt64BE(this._ah, this._al, 0);
|
|
@@ -4637,10 +4716,10 @@ inherits$4(Stream, EE);
|
|
|
4637
4716
|
Stream.Readable = require_stream_readable();
|
|
4638
4717
|
Stream.Writable = require_stream_writable();
|
|
4639
4718
|
Stream.Duplex = require_stream_duplex();
|
|
4640
|
-
Stream.Transform =
|
|
4641
|
-
Stream.PassThrough =
|
|
4642
|
-
Stream.finished =
|
|
4643
|
-
Stream.pipeline =
|
|
4719
|
+
Stream.Transform = require_stream_transform();
|
|
4720
|
+
Stream.PassThrough = require_stream_passthrough();
|
|
4721
|
+
Stream.finished = requireEndOfStream();
|
|
4722
|
+
Stream.pipeline = requirePipeline();
|
|
4644
4723
|
Stream.Stream = Stream;
|
|
4645
4724
|
function Stream() {
|
|
4646
4725
|
EE.call(this);
|
|
@@ -4761,14 +4840,14 @@ CipherBase.prototype._transform = function(data, _, next) {
|
|
|
4761
4840
|
next(err);
|
|
4762
4841
|
}
|
|
4763
4842
|
};
|
|
4764
|
-
CipherBase.prototype._flush = function(
|
|
4843
|
+
CipherBase.prototype._flush = function(done) {
|
|
4765
4844
|
var err;
|
|
4766
4845
|
try {
|
|
4767
4846
|
this.push(this.__final());
|
|
4768
4847
|
} catch (e) {
|
|
4769
4848
|
err = e;
|
|
4770
4849
|
}
|
|
4771
|
-
|
|
4850
|
+
done(err);
|
|
4772
4851
|
};
|
|
4773
4852
|
CipherBase.prototype._finalOrDigest = function(outputEnc) {
|
|
4774
4853
|
var outData = this.__final() || Buffer$6.alloc(0);
|
|
@@ -4815,6 +4894,110 @@ var browser$2 = function createHash(alg) {
|
|
|
4815
4894
|
return new RIPEMD160$1();
|
|
4816
4895
|
return new Hash(sha$1(alg));
|
|
4817
4896
|
};
|
|
4897
|
+
var inherits$1 = inherits_browserExports;
|
|
4898
|
+
var Buffer$5 = safeBufferExports.Buffer;
|
|
4899
|
+
var Base$1 = cipherBase;
|
|
4900
|
+
var ZEROS$1 = Buffer$5.alloc(128);
|
|
4901
|
+
var blocksize = 64;
|
|
4902
|
+
function Hmac$1(alg, key) {
|
|
4903
|
+
Base$1.call(this, "digest");
|
|
4904
|
+
if (typeof key === "string") {
|
|
4905
|
+
key = Buffer$5.from(key);
|
|
4906
|
+
}
|
|
4907
|
+
this._alg = alg;
|
|
4908
|
+
this._key = key;
|
|
4909
|
+
if (key.length > blocksize) {
|
|
4910
|
+
key = alg(key);
|
|
4911
|
+
} else if (key.length < blocksize) {
|
|
4912
|
+
key = Buffer$5.concat([key, ZEROS$1], blocksize);
|
|
4913
|
+
}
|
|
4914
|
+
var ipad = this._ipad = Buffer$5.allocUnsafe(blocksize);
|
|
4915
|
+
var opad = this._opad = Buffer$5.allocUnsafe(blocksize);
|
|
4916
|
+
for (var i = 0; i < blocksize; i++) {
|
|
4917
|
+
ipad[i] = key[i] ^ 54;
|
|
4918
|
+
opad[i] = key[i] ^ 92;
|
|
4919
|
+
}
|
|
4920
|
+
this._hash = [ipad];
|
|
4921
|
+
}
|
|
4922
|
+
inherits$1(Hmac$1, Base$1);
|
|
4923
|
+
Hmac$1.prototype._update = function(data) {
|
|
4924
|
+
this._hash.push(data);
|
|
4925
|
+
};
|
|
4926
|
+
Hmac$1.prototype._final = function() {
|
|
4927
|
+
var h2 = this._alg(Buffer$5.concat(this._hash));
|
|
4928
|
+
return this._alg(Buffer$5.concat([this._opad, h2]));
|
|
4929
|
+
};
|
|
4930
|
+
var legacy = Hmac$1;
|
|
4931
|
+
var MD5 = md5_js;
|
|
4932
|
+
var md5$1 = function(buffer2) {
|
|
4933
|
+
return new MD5().update(buffer2).digest();
|
|
4934
|
+
};
|
|
4935
|
+
var inherits = inherits_browserExports;
|
|
4936
|
+
var Legacy = legacy;
|
|
4937
|
+
var Base = cipherBase;
|
|
4938
|
+
var Buffer$4 = safeBufferExports.Buffer;
|
|
4939
|
+
var md5 = md5$1;
|
|
4940
|
+
var RIPEMD160 = ripemd160$1;
|
|
4941
|
+
var sha = sha_jsExports;
|
|
4942
|
+
var ZEROS = Buffer$4.alloc(128);
|
|
4943
|
+
function Hmac(alg, key) {
|
|
4944
|
+
Base.call(this, "digest");
|
|
4945
|
+
if (typeof key === "string") {
|
|
4946
|
+
key = Buffer$4.from(key);
|
|
4947
|
+
}
|
|
4948
|
+
var blocksize2 = alg === "sha512" || alg === "sha384" ? 128 : 64;
|
|
4949
|
+
this._alg = alg;
|
|
4950
|
+
this._key = key;
|
|
4951
|
+
if (key.length > blocksize2) {
|
|
4952
|
+
var hash2 = alg === "rmd160" ? new RIPEMD160() : sha(alg);
|
|
4953
|
+
key = hash2.update(key).digest();
|
|
4954
|
+
} else if (key.length < blocksize2) {
|
|
4955
|
+
key = Buffer$4.concat([key, ZEROS], blocksize2);
|
|
4956
|
+
}
|
|
4957
|
+
var ipad = this._ipad = Buffer$4.allocUnsafe(blocksize2);
|
|
4958
|
+
var opad = this._opad = Buffer$4.allocUnsafe(blocksize2);
|
|
4959
|
+
for (var i = 0; i < blocksize2; i++) {
|
|
4960
|
+
ipad[i] = key[i] ^ 54;
|
|
4961
|
+
opad[i] = key[i] ^ 92;
|
|
4962
|
+
}
|
|
4963
|
+
this._hash = alg === "rmd160" ? new RIPEMD160() : sha(alg);
|
|
4964
|
+
this._hash.update(ipad);
|
|
4965
|
+
}
|
|
4966
|
+
inherits(Hmac, Base);
|
|
4967
|
+
Hmac.prototype._update = function(data) {
|
|
4968
|
+
this._hash.update(data);
|
|
4969
|
+
};
|
|
4970
|
+
Hmac.prototype._final = function() {
|
|
4971
|
+
var h2 = this._hash.digest();
|
|
4972
|
+
var hash2 = this._alg === "rmd160" ? new RIPEMD160() : sha(this._alg);
|
|
4973
|
+
return hash2.update(this._opad).update(h2).digest();
|
|
4974
|
+
};
|
|
4975
|
+
var browser$1 = function createHmac(alg, key) {
|
|
4976
|
+
alg = alg.toLowerCase();
|
|
4977
|
+
if (alg === "rmd160" || alg === "ripemd160") {
|
|
4978
|
+
return new Hmac("rmd160", key);
|
|
4979
|
+
}
|
|
4980
|
+
if (alg === "md5") {
|
|
4981
|
+
return new Legacy(md5, key);
|
|
4982
|
+
}
|
|
4983
|
+
return new Hmac(alg, key);
|
|
4984
|
+
};
|
|
4985
|
+
Object.defineProperty(crypto$4, "__esModule", { value: true });
|
|
4986
|
+
const createHash$2 = browser$2;
|
|
4987
|
+
const createHmac$1 = browser$1;
|
|
4988
|
+
function hash160$1(buffer2) {
|
|
4989
|
+
const sha256Hash = createHash$2("sha256").update(buffer2).digest();
|
|
4990
|
+
try {
|
|
4991
|
+
return createHash$2("rmd160").update(sha256Hash).digest();
|
|
4992
|
+
} catch (err) {
|
|
4993
|
+
return createHash$2("ripemd160").update(sha256Hash).digest();
|
|
4994
|
+
}
|
|
4995
|
+
}
|
|
4996
|
+
crypto$4.hash160 = hash160$1;
|
|
4997
|
+
function hmacSHA512(key, data) {
|
|
4998
|
+
return createHmac$1("sha512", key).update(data).digest();
|
|
4999
|
+
}
|
|
5000
|
+
crypto$4.hmacSHA512 = hmacSHA512;
|
|
4818
5001
|
var _Buffer = safeBufferExports.Buffer;
|
|
4819
5002
|
function base$1(ALPHABET2) {
|
|
4820
5003
|
if (ALPHABET2.length >= 255) {
|
|
@@ -4938,16 +5121,16 @@ function base$1(ALPHABET2) {
|
|
|
4938
5121
|
decode: decode2
|
|
4939
5122
|
};
|
|
4940
5123
|
}
|
|
4941
|
-
var src
|
|
4942
|
-
var basex = src
|
|
5124
|
+
var src = base$1;
|
|
5125
|
+
var basex = src;
|
|
4943
5126
|
var ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
4944
5127
|
var bs58 = basex(ALPHABET);
|
|
4945
5128
|
var base58 = bs58;
|
|
4946
|
-
var Buffer$
|
|
5129
|
+
var Buffer$3 = safeBufferExports.Buffer;
|
|
4947
5130
|
var base = function(checksumFn) {
|
|
4948
5131
|
function encode2(payload) {
|
|
4949
5132
|
var checksum = checksumFn(payload);
|
|
4950
|
-
return base58.encode(Buffer$
|
|
5133
|
+
return base58.encode(Buffer$3.concat([
|
|
4951
5134
|
payload,
|
|
4952
5135
|
checksum
|
|
4953
5136
|
], payload.length + 4));
|
|
@@ -4979,121 +5162,13 @@ var base = function(checksumFn) {
|
|
|
4979
5162
|
decodeUnsafe
|
|
4980
5163
|
};
|
|
4981
5164
|
};
|
|
4982
|
-
var createHash$
|
|
5165
|
+
var createHash$1 = browser$2;
|
|
4983
5166
|
var bs58checkBase = base;
|
|
4984
5167
|
function sha256x2(buffer2) {
|
|
4985
|
-
var tmp = createHash$
|
|
4986
|
-
return createHash$
|
|
5168
|
+
var tmp = createHash$1("sha256").update(buffer2).digest();
|
|
5169
|
+
return createHash$1("sha256").update(tmp).digest();
|
|
4987
5170
|
}
|
|
4988
5171
|
var bs58check$5 = bs58checkBase(sha256x2);
|
|
4989
|
-
var src$1 = {};
|
|
4990
|
-
var src = {};
|
|
4991
|
-
var bip32$1 = {};
|
|
4992
|
-
var crypto$4 = {};
|
|
4993
|
-
var inherits$1 = inherits_browserExports;
|
|
4994
|
-
var Buffer$4 = safeBufferExports.Buffer;
|
|
4995
|
-
var Base$1 = cipherBase;
|
|
4996
|
-
var ZEROS$1 = Buffer$4.alloc(128);
|
|
4997
|
-
var blocksize = 64;
|
|
4998
|
-
function Hmac$1(alg, key) {
|
|
4999
|
-
Base$1.call(this, "digest");
|
|
5000
|
-
if (typeof key === "string") {
|
|
5001
|
-
key = Buffer$4.from(key);
|
|
5002
|
-
}
|
|
5003
|
-
this._alg = alg;
|
|
5004
|
-
this._key = key;
|
|
5005
|
-
if (key.length > blocksize) {
|
|
5006
|
-
key = alg(key);
|
|
5007
|
-
} else if (key.length < blocksize) {
|
|
5008
|
-
key = Buffer$4.concat([key, ZEROS$1], blocksize);
|
|
5009
|
-
}
|
|
5010
|
-
var ipad = this._ipad = Buffer$4.allocUnsafe(blocksize);
|
|
5011
|
-
var opad = this._opad = Buffer$4.allocUnsafe(blocksize);
|
|
5012
|
-
for (var i = 0; i < blocksize; i++) {
|
|
5013
|
-
ipad[i] = key[i] ^ 54;
|
|
5014
|
-
opad[i] = key[i] ^ 92;
|
|
5015
|
-
}
|
|
5016
|
-
this._hash = [ipad];
|
|
5017
|
-
}
|
|
5018
|
-
inherits$1(Hmac$1, Base$1);
|
|
5019
|
-
Hmac$1.prototype._update = function(data) {
|
|
5020
|
-
this._hash.push(data);
|
|
5021
|
-
};
|
|
5022
|
-
Hmac$1.prototype._final = function() {
|
|
5023
|
-
var h = this._alg(Buffer$4.concat(this._hash));
|
|
5024
|
-
return this._alg(Buffer$4.concat([this._opad, h]));
|
|
5025
|
-
};
|
|
5026
|
-
var legacy = Hmac$1;
|
|
5027
|
-
var MD5 = md5_js;
|
|
5028
|
-
var md5$1 = function(buffer2) {
|
|
5029
|
-
return new MD5().update(buffer2).digest();
|
|
5030
|
-
};
|
|
5031
|
-
var inherits = inherits_browserExports;
|
|
5032
|
-
var Legacy = legacy;
|
|
5033
|
-
var Base = cipherBase;
|
|
5034
|
-
var Buffer$3 = safeBufferExports.Buffer;
|
|
5035
|
-
var md5 = md5$1;
|
|
5036
|
-
var RIPEMD160 = ripemd160$1;
|
|
5037
|
-
var sha = sha_jsExports;
|
|
5038
|
-
var ZEROS = Buffer$3.alloc(128);
|
|
5039
|
-
function Hmac(alg, key) {
|
|
5040
|
-
Base.call(this, "digest");
|
|
5041
|
-
if (typeof key === "string") {
|
|
5042
|
-
key = Buffer$3.from(key);
|
|
5043
|
-
}
|
|
5044
|
-
var blocksize2 = alg === "sha512" || alg === "sha384" ? 128 : 64;
|
|
5045
|
-
this._alg = alg;
|
|
5046
|
-
this._key = key;
|
|
5047
|
-
if (key.length > blocksize2) {
|
|
5048
|
-
var hash2 = alg === "rmd160" ? new RIPEMD160() : sha(alg);
|
|
5049
|
-
key = hash2.update(key).digest();
|
|
5050
|
-
} else if (key.length < blocksize2) {
|
|
5051
|
-
key = Buffer$3.concat([key, ZEROS], blocksize2);
|
|
5052
|
-
}
|
|
5053
|
-
var ipad = this._ipad = Buffer$3.allocUnsafe(blocksize2);
|
|
5054
|
-
var opad = this._opad = Buffer$3.allocUnsafe(blocksize2);
|
|
5055
|
-
for (var i = 0; i < blocksize2; i++) {
|
|
5056
|
-
ipad[i] = key[i] ^ 54;
|
|
5057
|
-
opad[i] = key[i] ^ 92;
|
|
5058
|
-
}
|
|
5059
|
-
this._hash = alg === "rmd160" ? new RIPEMD160() : sha(alg);
|
|
5060
|
-
this._hash.update(ipad);
|
|
5061
|
-
}
|
|
5062
|
-
inherits(Hmac, Base);
|
|
5063
|
-
Hmac.prototype._update = function(data) {
|
|
5064
|
-
this._hash.update(data);
|
|
5065
|
-
};
|
|
5066
|
-
Hmac.prototype._final = function() {
|
|
5067
|
-
var h = this._hash.digest();
|
|
5068
|
-
var hash2 = this._alg === "rmd160" ? new RIPEMD160() : sha(this._alg);
|
|
5069
|
-
return hash2.update(this._opad).update(h).digest();
|
|
5070
|
-
};
|
|
5071
|
-
var browser$1 = function createHmac(alg, key) {
|
|
5072
|
-
alg = alg.toLowerCase();
|
|
5073
|
-
if (alg === "rmd160" || alg === "ripemd160") {
|
|
5074
|
-
return new Hmac("rmd160", key);
|
|
5075
|
-
}
|
|
5076
|
-
if (alg === "md5") {
|
|
5077
|
-
return new Legacy(md5, key);
|
|
5078
|
-
}
|
|
5079
|
-
return new Hmac(alg, key);
|
|
5080
|
-
};
|
|
5081
|
-
Object.defineProperty(crypto$4, "__esModule", { value: true });
|
|
5082
|
-
const createHash$1 = browser$2;
|
|
5083
|
-
const createHmac$1 = browser$1;
|
|
5084
|
-
function hash160$1(buffer2) {
|
|
5085
|
-
const sha256Hash = createHash$1("sha256").update(buffer2).digest();
|
|
5086
|
-
try {
|
|
5087
|
-
return createHash$1("rmd160").update(sha256Hash).digest();
|
|
5088
|
-
} catch (err) {
|
|
5089
|
-
return createHash$1("ripemd160").update(sha256Hash).digest();
|
|
5090
|
-
}
|
|
5091
|
-
}
|
|
5092
|
-
crypto$4.hash160 = hash160$1;
|
|
5093
|
-
function hmacSHA512(key, data) {
|
|
5094
|
-
return createHmac$1("sha512", key).update(data).digest();
|
|
5095
|
-
}
|
|
5096
|
-
crypto$4.hmacSHA512 = hmacSHA512;
|
|
5097
5172
|
const createHmac2 = browser$1;
|
|
5098
5173
|
const ONE1 = buffer.Buffer.alloc(1, 1);
|
|
5099
5174
|
const ZERO1 = buffer.Buffer.alloc(1, 0);
|
|
@@ -5122,8 +5197,8 @@ const deterministicGenerateK = rfc6979;
|
|
|
5122
5197
|
const ZERO32 = buffer.Buffer.alloc(32, 0);
|
|
5123
5198
|
const EC_GROUP_ORDER = buffer.Buffer.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", "hex");
|
|
5124
5199
|
const EC_P = buffer.Buffer.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", "hex");
|
|
5125
|
-
const n = secp256k1.curve.n;
|
|
5126
|
-
const nDiv2 = n.shrn(1);
|
|
5200
|
+
const n$1 = secp256k1.curve.n;
|
|
5201
|
+
const nDiv2 = n$1.shrn(1);
|
|
5127
5202
|
const G = secp256k1.curve.g;
|
|
5128
5203
|
const THROW_BAD_PRIVATE = "Expected Private";
|
|
5129
5204
|
const THROW_BAD_POINT = "Expected Point";
|
|
@@ -5139,41 +5214,41 @@ function isOrderScalar(x) {
|
|
|
5139
5214
|
return false;
|
|
5140
5215
|
return x.compare(EC_GROUP_ORDER) < 0;
|
|
5141
5216
|
}
|
|
5142
|
-
function isPoint(
|
|
5143
|
-
if (!buffer.Buffer.isBuffer(
|
|
5217
|
+
function isPoint(p2) {
|
|
5218
|
+
if (!buffer.Buffer.isBuffer(p2))
|
|
5144
5219
|
return false;
|
|
5145
|
-
if (
|
|
5220
|
+
if (p2.length < 33)
|
|
5146
5221
|
return false;
|
|
5147
|
-
const t =
|
|
5148
|
-
const x =
|
|
5222
|
+
const t = p2[0];
|
|
5223
|
+
const x = p2.slice(1, 33);
|
|
5149
5224
|
if (x.compare(ZERO32) === 0)
|
|
5150
5225
|
return false;
|
|
5151
5226
|
if (x.compare(EC_P) >= 0)
|
|
5152
5227
|
return false;
|
|
5153
|
-
if ((t === 2 || t === 3) &&
|
|
5228
|
+
if ((t === 2 || t === 3) && p2.length === 33) {
|
|
5154
5229
|
try {
|
|
5155
|
-
decodeFrom(
|
|
5230
|
+
decodeFrom(p2);
|
|
5156
5231
|
} catch (e) {
|
|
5157
5232
|
return false;
|
|
5158
5233
|
}
|
|
5159
5234
|
return true;
|
|
5160
5235
|
}
|
|
5161
|
-
const y =
|
|
5236
|
+
const y = p2.slice(33);
|
|
5162
5237
|
if (y.compare(ZERO32) === 0)
|
|
5163
5238
|
return false;
|
|
5164
5239
|
if (y.compare(EC_P) >= 0)
|
|
5165
5240
|
return false;
|
|
5166
|
-
if (t === 4 &&
|
|
5241
|
+
if (t === 4 && p2.length === 65)
|
|
5167
5242
|
return true;
|
|
5168
5243
|
return false;
|
|
5169
5244
|
}
|
|
5170
|
-
function __isPointCompressed(
|
|
5171
|
-
return
|
|
5245
|
+
function __isPointCompressed(p2) {
|
|
5246
|
+
return p2[0] !== 4;
|
|
5172
5247
|
}
|
|
5173
|
-
function isPointCompressed(
|
|
5174
|
-
if (!isPoint(
|
|
5248
|
+
function isPointCompressed(p2) {
|
|
5249
|
+
if (!isPoint(p2))
|
|
5175
5250
|
return false;
|
|
5176
|
-
return __isPointCompressed(
|
|
5251
|
+
return __isPointCompressed(p2);
|
|
5177
5252
|
}
|
|
5178
5253
|
function isPrivate(x) {
|
|
5179
5254
|
if (!isScalar(x))
|
|
@@ -5218,13 +5293,13 @@ function pointAdd(pA, pB, __compressed) {
|
|
|
5218
5293
|
const compressed = assumeCompression(__compressed, pA);
|
|
5219
5294
|
return getEncoded(pp, compressed);
|
|
5220
5295
|
}
|
|
5221
|
-
function pointAddScalar(
|
|
5222
|
-
if (!isPoint(
|
|
5296
|
+
function pointAddScalar(p2, tweak, __compressed) {
|
|
5297
|
+
if (!isPoint(p2))
|
|
5223
5298
|
throw new TypeError(THROW_BAD_POINT);
|
|
5224
5299
|
if (!isOrderScalar(tweak))
|
|
5225
5300
|
throw new TypeError(THROW_BAD_TWEAK);
|
|
5226
|
-
const compressed = assumeCompression(__compressed,
|
|
5227
|
-
const pp = decodeFrom(
|
|
5301
|
+
const compressed = assumeCompression(__compressed, p2);
|
|
5302
|
+
const pp = decodeFrom(p2);
|
|
5228
5303
|
if (tweak.compare(ZERO32) === 0)
|
|
5229
5304
|
return getEncoded(pp, compressed);
|
|
5230
5305
|
const tt = fromBuffer$1(tweak);
|
|
@@ -5234,13 +5309,13 @@ function pointAddScalar(p, tweak, __compressed) {
|
|
|
5234
5309
|
return null;
|
|
5235
5310
|
return getEncoded(uu, compressed);
|
|
5236
5311
|
}
|
|
5237
|
-
function pointCompress(
|
|
5238
|
-
if (!isPoint(
|
|
5312
|
+
function pointCompress(p2, __compressed) {
|
|
5313
|
+
if (!isPoint(p2))
|
|
5239
5314
|
throw new TypeError(THROW_BAD_POINT);
|
|
5240
|
-
const pp = decodeFrom(
|
|
5315
|
+
const pp = decodeFrom(p2);
|
|
5241
5316
|
if (pp.isInfinity())
|
|
5242
5317
|
throw new TypeError(THROW_BAD_POINT);
|
|
5243
|
-
const compressed = assumeCompression(__compressed,
|
|
5318
|
+
const compressed = assumeCompression(__compressed, p2);
|
|
5244
5319
|
return getEncoded(pp, compressed);
|
|
5245
5320
|
}
|
|
5246
5321
|
function pointFromScalar(d, __compressed) {
|
|
@@ -5253,13 +5328,13 @@ function pointFromScalar(d, __compressed) {
|
|
|
5253
5328
|
const compressed = assumeCompression(__compressed);
|
|
5254
5329
|
return getEncoded(pp, compressed);
|
|
5255
5330
|
}
|
|
5256
|
-
function pointMultiply(
|
|
5257
|
-
if (!isPoint(
|
|
5331
|
+
function pointMultiply(p2, tweak, __compressed) {
|
|
5332
|
+
if (!isPoint(p2))
|
|
5258
5333
|
throw new TypeError(THROW_BAD_POINT);
|
|
5259
5334
|
if (!isOrderScalar(tweak))
|
|
5260
5335
|
throw new TypeError(THROW_BAD_TWEAK);
|
|
5261
|
-
const compressed = assumeCompression(__compressed,
|
|
5262
|
-
const pp = decodeFrom(
|
|
5336
|
+
const compressed = assumeCompression(__compressed, p2);
|
|
5337
|
+
const pp = decodeFrom(p2);
|
|
5263
5338
|
const tt = fromBuffer$1(tweak);
|
|
5264
5339
|
const qq = pp.mul(tt);
|
|
5265
5340
|
if (qq.isInfinity())
|
|
@@ -5273,7 +5348,7 @@ function privateAdd(d, tweak) {
|
|
|
5273
5348
|
throw new TypeError(THROW_BAD_TWEAK);
|
|
5274
5349
|
const dd = fromBuffer$1(d);
|
|
5275
5350
|
const tt = fromBuffer$1(tweak);
|
|
5276
|
-
const dt = toBuffer$1(dd.add(tt).umod(n));
|
|
5351
|
+
const dt = toBuffer$1(dd.add(tt).umod(n$1));
|
|
5277
5352
|
if (!isPrivate(dt))
|
|
5278
5353
|
return null;
|
|
5279
5354
|
return dt;
|
|
@@ -5285,7 +5360,7 @@ function privateSub(d, tweak) {
|
|
|
5285
5360
|
throw new TypeError(THROW_BAD_TWEAK);
|
|
5286
5361
|
const dd = fromBuffer$1(d);
|
|
5287
5362
|
const tt = fromBuffer$1(tweak);
|
|
5288
|
-
const dt = toBuffer$1(dd.sub(tt).umod(n));
|
|
5363
|
+
const dt = toBuffer$1(dd.sub(tt).umod(n$1));
|
|
5289
5364
|
if (!isPrivate(dt))
|
|
5290
5365
|
return null;
|
|
5291
5366
|
return dt;
|
|
@@ -5311,17 +5386,17 @@ function __sign(hash2, x, addData) {
|
|
|
5311
5386
|
const Q = G.mul(kI);
|
|
5312
5387
|
if (Q.isInfinity())
|
|
5313
5388
|
return false;
|
|
5314
|
-
r = Q.x.umod(n);
|
|
5389
|
+
r = Q.x.umod(n$1);
|
|
5315
5390
|
if (r.isZero() === 0)
|
|
5316
5391
|
return false;
|
|
5317
|
-
s = kI.invm(n).mul(e.add(d.mul(r))).umod(n);
|
|
5392
|
+
s = kI.invm(n$1).mul(e.add(d.mul(r))).umod(n$1);
|
|
5318
5393
|
if (s.isZero() === 0)
|
|
5319
5394
|
return false;
|
|
5320
5395
|
return true;
|
|
5321
5396
|
};
|
|
5322
5397
|
deterministicGenerateK(hash2, x, checkSig, isPrivate, addData);
|
|
5323
5398
|
if (s.cmp(nDiv2) > 0) {
|
|
5324
|
-
s = n.sub(s);
|
|
5399
|
+
s = n$1.sub(s);
|
|
5325
5400
|
}
|
|
5326
5401
|
const buffer$1 = buffer.Buffer.allocUnsafe(64);
|
|
5327
5402
|
toBuffer$1(r).copy(buffer$1, 0);
|
|
@@ -5346,14 +5421,14 @@ function verify(hash2, q, signature, strict) {
|
|
|
5346
5421
|
if (s.gtn(0) <= 0)
|
|
5347
5422
|
return false;
|
|
5348
5423
|
const e = fromBuffer$1(hash2);
|
|
5349
|
-
const sInv = s.invm(n);
|
|
5350
|
-
const u1 = e.mul(sInv).umod(n);
|
|
5351
|
-
const u2 = r.mul(sInv).umod(n);
|
|
5352
|
-
const
|
|
5353
|
-
if (
|
|
5424
|
+
const sInv = s.invm(n$1);
|
|
5425
|
+
const u1 = e.mul(sInv).umod(n$1);
|
|
5426
|
+
const u2 = r.mul(sInv).umod(n$1);
|
|
5427
|
+
const R2 = G.mulAdd(u1, Q, u2);
|
|
5428
|
+
if (R2.isInfinity())
|
|
5354
5429
|
return false;
|
|
5355
|
-
const xR =
|
|
5356
|
-
const v = xR.umod(n);
|
|
5430
|
+
const xR = R2.x;
|
|
5431
|
+
const v = xR.umod(n$1);
|
|
5357
5432
|
return v.eq(r);
|
|
5358
5433
|
}
|
|
5359
5434
|
var js = {
|
|
@@ -6137,12 +6212,12 @@ function fromSeed(seed, network) {
|
|
|
6137
6212
|
return fromPrivateKey$1(IL, IR, network);
|
|
6138
6213
|
}
|
|
6139
6214
|
bip32$1.fromSeed = fromSeed;
|
|
6140
|
-
Object.defineProperty(src, "__esModule", { value: true });
|
|
6215
|
+
Object.defineProperty(src$1, "__esModule", { value: true });
|
|
6141
6216
|
var bip32_1 = bip32$1;
|
|
6142
|
-
src.fromSeed = bip32_1.fromSeed;
|
|
6143
|
-
src.fromBase58 = bip32_1.fromBase58;
|
|
6144
|
-
src.fromPublicKey = bip32_1.fromPublicKey;
|
|
6145
|
-
src.fromPrivateKey = bip32_1.fromPrivateKey;
|
|
6217
|
+
src$1.fromSeed = bip32_1.fromSeed;
|
|
6218
|
+
src$1.fromBase58 = bip32_1.fromBase58;
|
|
6219
|
+
src$1.fromPublicKey = bip32_1.fromPublicKey;
|
|
6220
|
+
src$1.fromPrivateKey = bip32_1.fromPrivateKey;
|
|
6146
6221
|
var address$1 = {};
|
|
6147
6222
|
var networks$3 = {};
|
|
6148
6223
|
Object.defineProperty(networks$3, "__esModule", { value: true });
|
|
@@ -6946,7 +7021,7 @@ function value2(f) {
|
|
|
6946
7021
|
}
|
|
6947
7022
|
lazy$7.value = value2;
|
|
6948
7023
|
Object.defineProperty(embed, "__esModule", { value: true });
|
|
6949
|
-
const networks_1$
|
|
7024
|
+
const networks_1$7 = networks$3;
|
|
6950
7025
|
const bscript$o = script$1;
|
|
6951
7026
|
const lazy$6 = lazy$7;
|
|
6952
7027
|
const typef$6 = typeforce_1;
|
|
@@ -6970,14 +7045,14 @@ function p2data(a, opts) {
|
|
|
6970
7045
|
},
|
|
6971
7046
|
a
|
|
6972
7047
|
);
|
|
6973
|
-
const network = a.network || networks_1$
|
|
6974
|
-
const
|
|
6975
|
-
lazy$6.prop(
|
|
7048
|
+
const network = a.network || networks_1$7.bitcoin;
|
|
7049
|
+
const o2 = { name: "embed", network };
|
|
7050
|
+
lazy$6.prop(o2, "output", () => {
|
|
6976
7051
|
if (!a.data)
|
|
6977
7052
|
return;
|
|
6978
7053
|
return bscript$o.compile([OPS$7.OP_RETURN].concat(a.data));
|
|
6979
7054
|
});
|
|
6980
|
-
lazy$6.prop(
|
|
7055
|
+
lazy$6.prop(o2, "data", () => {
|
|
6981
7056
|
if (!a.output)
|
|
6982
7057
|
return;
|
|
6983
7058
|
return bscript$o.decompile(a.output).slice(1);
|
|
@@ -6989,16 +7064,16 @@ function p2data(a, opts) {
|
|
|
6989
7064
|
throw new TypeError("Output is invalid");
|
|
6990
7065
|
if (!chunks.slice(1).every(typef$6.Buffer))
|
|
6991
7066
|
throw new TypeError("Output is invalid");
|
|
6992
|
-
if (a.data && !stacksEqual$3(a.data,
|
|
7067
|
+
if (a.data && !stacksEqual$3(a.data, o2.data))
|
|
6993
7068
|
throw new TypeError("Data mismatch");
|
|
6994
7069
|
}
|
|
6995
7070
|
}
|
|
6996
|
-
return Object.assign(
|
|
7071
|
+
return Object.assign(o2, a);
|
|
6997
7072
|
}
|
|
6998
7073
|
embed.p2data = p2data;
|
|
6999
7074
|
var p2ms$3 = {};
|
|
7000
7075
|
Object.defineProperty(p2ms$3, "__esModule", { value: true });
|
|
7001
|
-
const networks_1$
|
|
7076
|
+
const networks_1$6 = networks$3;
|
|
7002
7077
|
const bscript$n = script$1;
|
|
7003
7078
|
const lazy$5 = lazy$7;
|
|
7004
7079
|
const OPS$6 = bscript$n.OPS;
|
|
@@ -7031,8 +7106,8 @@ function p2ms$2(a, opts) {
|
|
|
7031
7106
|
},
|
|
7032
7107
|
a
|
|
7033
7108
|
);
|
|
7034
|
-
const network = a.network || networks_1$
|
|
7035
|
-
const
|
|
7109
|
+
const network = a.network || networks_1$6.bitcoin;
|
|
7110
|
+
const o2 = { network };
|
|
7036
7111
|
let chunks = [];
|
|
7037
7112
|
let decoded = false;
|
|
7038
7113
|
function decode2(output2) {
|
|
@@ -7040,14 +7115,14 @@ function p2ms$2(a, opts) {
|
|
|
7040
7115
|
return;
|
|
7041
7116
|
decoded = true;
|
|
7042
7117
|
chunks = bscript$n.decompile(output2);
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7118
|
+
o2.m = chunks[0] - OP_INT_BASE$1;
|
|
7119
|
+
o2.n = chunks[chunks.length - 2] - OP_INT_BASE$1;
|
|
7120
|
+
o2.pubkeys = chunks.slice(1, -2);
|
|
7046
7121
|
}
|
|
7047
|
-
lazy$5.prop(
|
|
7122
|
+
lazy$5.prop(o2, "output", () => {
|
|
7048
7123
|
if (!a.m)
|
|
7049
7124
|
return;
|
|
7050
|
-
if (!
|
|
7125
|
+
if (!o2.n)
|
|
7051
7126
|
return;
|
|
7052
7127
|
if (!a.pubkeys)
|
|
7053
7128
|
return;
|
|
@@ -7055,47 +7130,47 @@ function p2ms$2(a, opts) {
|
|
|
7055
7130
|
[].concat(
|
|
7056
7131
|
OP_INT_BASE$1 + a.m,
|
|
7057
7132
|
a.pubkeys,
|
|
7058
|
-
OP_INT_BASE$1 +
|
|
7133
|
+
OP_INT_BASE$1 + o2.n,
|
|
7059
7134
|
OPS$6.OP_CHECKMULTISIG
|
|
7060
7135
|
)
|
|
7061
7136
|
);
|
|
7062
7137
|
});
|
|
7063
|
-
lazy$5.prop(
|
|
7064
|
-
if (!
|
|
7138
|
+
lazy$5.prop(o2, "m", () => {
|
|
7139
|
+
if (!o2.output)
|
|
7065
7140
|
return;
|
|
7066
|
-
decode2(
|
|
7067
|
-
return
|
|
7141
|
+
decode2(o2.output);
|
|
7142
|
+
return o2.m;
|
|
7068
7143
|
});
|
|
7069
|
-
lazy$5.prop(
|
|
7070
|
-
if (!
|
|
7144
|
+
lazy$5.prop(o2, "n", () => {
|
|
7145
|
+
if (!o2.pubkeys)
|
|
7071
7146
|
return;
|
|
7072
|
-
return
|
|
7147
|
+
return o2.pubkeys.length;
|
|
7073
7148
|
});
|
|
7074
|
-
lazy$5.prop(
|
|
7149
|
+
lazy$5.prop(o2, "pubkeys", () => {
|
|
7075
7150
|
if (!a.output)
|
|
7076
7151
|
return;
|
|
7077
7152
|
decode2(a.output);
|
|
7078
|
-
return
|
|
7153
|
+
return o2.pubkeys;
|
|
7079
7154
|
});
|
|
7080
|
-
lazy$5.prop(
|
|
7155
|
+
lazy$5.prop(o2, "signatures", () => {
|
|
7081
7156
|
if (!a.input)
|
|
7082
7157
|
return;
|
|
7083
7158
|
return bscript$n.decompile(a.input).slice(1);
|
|
7084
7159
|
});
|
|
7085
|
-
lazy$5.prop(
|
|
7160
|
+
lazy$5.prop(o2, "input", () => {
|
|
7086
7161
|
if (!a.signatures)
|
|
7087
7162
|
return;
|
|
7088
7163
|
return bscript$n.compile([OPS$6.OP_0].concat(a.signatures));
|
|
7089
7164
|
});
|
|
7090
|
-
lazy$5.prop(
|
|
7091
|
-
if (!
|
|
7165
|
+
lazy$5.prop(o2, "witness", () => {
|
|
7166
|
+
if (!o2.input)
|
|
7092
7167
|
return;
|
|
7093
7168
|
return [];
|
|
7094
7169
|
});
|
|
7095
|
-
lazy$5.prop(
|
|
7096
|
-
if (!
|
|
7170
|
+
lazy$5.prop(o2, "name", () => {
|
|
7171
|
+
if (!o2.m || !o2.n)
|
|
7097
7172
|
return;
|
|
7098
|
-
return `p2ms(${
|
|
7173
|
+
return `p2ms(${o2.m} of ${o2.n})`;
|
|
7099
7174
|
});
|
|
7100
7175
|
if (opts.validate) {
|
|
7101
7176
|
if (a.output) {
|
|
@@ -7106,47 +7181,47 @@ function p2ms$2(a, opts) {
|
|
|
7106
7181
|
throw new TypeError("Output is invalid");
|
|
7107
7182
|
if (chunks[chunks.length - 1] !== OPS$6.OP_CHECKMULTISIG)
|
|
7108
7183
|
throw new TypeError("Output is invalid");
|
|
7109
|
-
if (
|
|
7184
|
+
if (o2.m <= 0 || o2.n > 16 || o2.m > o2.n || o2.n !== chunks.length - 3)
|
|
7110
7185
|
throw new TypeError("Output is invalid");
|
|
7111
|
-
if (!
|
|
7186
|
+
if (!o2.pubkeys.every((x) => ecc$5.isPoint(x)))
|
|
7112
7187
|
throw new TypeError("Output is invalid");
|
|
7113
|
-
if (a.m !== void 0 && a.m !==
|
|
7188
|
+
if (a.m !== void 0 && a.m !== o2.m)
|
|
7114
7189
|
throw new TypeError("m mismatch");
|
|
7115
|
-
if (a.n !== void 0 && a.n !==
|
|
7190
|
+
if (a.n !== void 0 && a.n !== o2.n)
|
|
7116
7191
|
throw new TypeError("n mismatch");
|
|
7117
|
-
if (a.pubkeys && !stacksEqual$2(a.pubkeys,
|
|
7192
|
+
if (a.pubkeys && !stacksEqual$2(a.pubkeys, o2.pubkeys))
|
|
7118
7193
|
throw new TypeError("Pubkeys mismatch");
|
|
7119
7194
|
}
|
|
7120
7195
|
if (a.pubkeys) {
|
|
7121
7196
|
if (a.n !== void 0 && a.n !== a.pubkeys.length)
|
|
7122
7197
|
throw new TypeError("Pubkey count mismatch");
|
|
7123
|
-
|
|
7124
|
-
if (
|
|
7198
|
+
o2.n = a.pubkeys.length;
|
|
7199
|
+
if (o2.n < o2.m)
|
|
7125
7200
|
throw new TypeError("Pubkey count cannot be less than m");
|
|
7126
7201
|
}
|
|
7127
7202
|
if (a.signatures) {
|
|
7128
|
-
if (a.signatures.length <
|
|
7203
|
+
if (a.signatures.length < o2.m)
|
|
7129
7204
|
throw new TypeError("Not enough signatures provided");
|
|
7130
|
-
if (a.signatures.length >
|
|
7205
|
+
if (a.signatures.length > o2.m)
|
|
7131
7206
|
throw new TypeError("Too many signatures provided");
|
|
7132
7207
|
}
|
|
7133
7208
|
if (a.input) {
|
|
7134
7209
|
if (a.input[0] !== OPS$6.OP_0)
|
|
7135
7210
|
throw new TypeError("Input is invalid");
|
|
7136
|
-
if (
|
|
7211
|
+
if (o2.signatures.length === 0 || !o2.signatures.every(isAcceptableSignature))
|
|
7137
7212
|
throw new TypeError("Input has invalid signature(s)");
|
|
7138
|
-
if (a.signatures && !stacksEqual$2(a.signatures,
|
|
7213
|
+
if (a.signatures && !stacksEqual$2(a.signatures, o2.signatures))
|
|
7139
7214
|
throw new TypeError("Signature mismatch");
|
|
7140
7215
|
if (a.m !== void 0 && a.m !== a.signatures.length)
|
|
7141
7216
|
throw new TypeError("Signature count mismatch");
|
|
7142
7217
|
}
|
|
7143
7218
|
}
|
|
7144
|
-
return Object.assign(
|
|
7219
|
+
return Object.assign(o2, a);
|
|
7145
7220
|
}
|
|
7146
7221
|
p2ms$3.p2ms = p2ms$2;
|
|
7147
7222
|
var p2pk$3 = {};
|
|
7148
7223
|
Object.defineProperty(p2pk$3, "__esModule", { value: true });
|
|
7149
|
-
const networks_1$
|
|
7224
|
+
const networks_1$5 = networks$3;
|
|
7150
7225
|
const bscript$m = script$1;
|
|
7151
7226
|
const lazy$4 = lazy$7;
|
|
7152
7227
|
const typef$4 = typeforce_1;
|
|
@@ -7169,30 +7244,30 @@ function p2pk$2(a, opts) {
|
|
|
7169
7244
|
const _chunks = lazy$4.value(() => {
|
|
7170
7245
|
return bscript$m.decompile(a.input);
|
|
7171
7246
|
});
|
|
7172
|
-
const network = a.network || networks_1$
|
|
7173
|
-
const
|
|
7174
|
-
lazy$4.prop(
|
|
7247
|
+
const network = a.network || networks_1$5.bitcoin;
|
|
7248
|
+
const o2 = { name: "p2pk", network };
|
|
7249
|
+
lazy$4.prop(o2, "output", () => {
|
|
7175
7250
|
if (!a.pubkey)
|
|
7176
7251
|
return;
|
|
7177
7252
|
return bscript$m.compile([a.pubkey, OPS$5.OP_CHECKSIG]);
|
|
7178
7253
|
});
|
|
7179
|
-
lazy$4.prop(
|
|
7254
|
+
lazy$4.prop(o2, "pubkey", () => {
|
|
7180
7255
|
if (!a.output)
|
|
7181
7256
|
return;
|
|
7182
7257
|
return a.output.slice(1, -1);
|
|
7183
7258
|
});
|
|
7184
|
-
lazy$4.prop(
|
|
7259
|
+
lazy$4.prop(o2, "signature", () => {
|
|
7185
7260
|
if (!a.input)
|
|
7186
7261
|
return;
|
|
7187
7262
|
return _chunks()[0];
|
|
7188
7263
|
});
|
|
7189
|
-
lazy$4.prop(
|
|
7264
|
+
lazy$4.prop(o2, "input", () => {
|
|
7190
7265
|
if (!a.signature)
|
|
7191
7266
|
return;
|
|
7192
7267
|
return bscript$m.compile([a.signature]);
|
|
7193
7268
|
});
|
|
7194
|
-
lazy$4.prop(
|
|
7195
|
-
if (!
|
|
7269
|
+
lazy$4.prop(o2, "witness", () => {
|
|
7270
|
+
if (!o2.input)
|
|
7196
7271
|
return;
|
|
7197
7272
|
return [];
|
|
7198
7273
|
});
|
|
@@ -7200,23 +7275,23 @@ function p2pk$2(a, opts) {
|
|
|
7200
7275
|
if (a.output) {
|
|
7201
7276
|
if (a.output[a.output.length - 1] !== OPS$5.OP_CHECKSIG)
|
|
7202
7277
|
throw new TypeError("Output is invalid");
|
|
7203
|
-
if (!ecc$4.isPoint(
|
|
7278
|
+
if (!ecc$4.isPoint(o2.pubkey))
|
|
7204
7279
|
throw new TypeError("Output pubkey is invalid");
|
|
7205
|
-
if (a.pubkey && !a.pubkey.equals(
|
|
7280
|
+
if (a.pubkey && !a.pubkey.equals(o2.pubkey))
|
|
7206
7281
|
throw new TypeError("Pubkey mismatch");
|
|
7207
7282
|
}
|
|
7208
7283
|
if (a.signature) {
|
|
7209
|
-
if (a.input && !a.input.equals(
|
|
7284
|
+
if (a.input && !a.input.equals(o2.input))
|
|
7210
7285
|
throw new TypeError("Signature mismatch");
|
|
7211
7286
|
}
|
|
7212
7287
|
if (a.input) {
|
|
7213
7288
|
if (_chunks().length !== 1)
|
|
7214
7289
|
throw new TypeError("Input is invalid");
|
|
7215
|
-
if (!bscript$m.isCanonicalScriptSignature(
|
|
7290
|
+
if (!bscript$m.isCanonicalScriptSignature(o2.signature))
|
|
7216
7291
|
throw new TypeError("Input has invalid signature");
|
|
7217
7292
|
}
|
|
7218
7293
|
}
|
|
7219
|
-
return Object.assign(
|
|
7294
|
+
return Object.assign(o2, a);
|
|
7220
7295
|
}
|
|
7221
7296
|
p2pk$3.p2pk = p2pk$2;
|
|
7222
7297
|
var p2pkh$3 = {};
|
|
@@ -7249,7 +7324,7 @@ function hash256(buffer2) {
|
|
|
7249
7324
|
crypto$2.hash256 = hash256;
|
|
7250
7325
|
Object.defineProperty(p2pkh$3, "__esModule", { value: true });
|
|
7251
7326
|
const bcrypto$6 = crypto$2;
|
|
7252
|
-
const networks_1$
|
|
7327
|
+
const networks_1$4 = networks$3;
|
|
7253
7328
|
const bscript$l = script$1;
|
|
7254
7329
|
const lazy$3 = lazy$7;
|
|
7255
7330
|
const typef$3 = typeforce_1;
|
|
@@ -7281,54 +7356,54 @@ function p2pkh$2(a, opts) {
|
|
|
7281
7356
|
const _chunks = lazy$3.value(() => {
|
|
7282
7357
|
return bscript$l.decompile(a.input);
|
|
7283
7358
|
});
|
|
7284
|
-
const network = a.network || networks_1$
|
|
7285
|
-
const
|
|
7286
|
-
lazy$3.prop(
|
|
7287
|
-
if (!
|
|
7359
|
+
const network = a.network || networks_1$4.bitcoin;
|
|
7360
|
+
const o2 = { name: "p2pkh", network };
|
|
7361
|
+
lazy$3.prop(o2, "address", () => {
|
|
7362
|
+
if (!o2.hash)
|
|
7288
7363
|
return;
|
|
7289
7364
|
const payload = buffer.Buffer.allocUnsafe(21);
|
|
7290
7365
|
payload.writeUInt8(network.pubKeyHash, 0);
|
|
7291
|
-
|
|
7366
|
+
o2.hash.copy(payload, 1);
|
|
7292
7367
|
return bs58check$2.encode(payload);
|
|
7293
7368
|
});
|
|
7294
|
-
lazy$3.prop(
|
|
7369
|
+
lazy$3.prop(o2, "hash", () => {
|
|
7295
7370
|
if (a.output)
|
|
7296
7371
|
return a.output.slice(3, 23);
|
|
7297
7372
|
if (a.address)
|
|
7298
7373
|
return _address().hash;
|
|
7299
|
-
if (a.pubkey ||
|
|
7300
|
-
return bcrypto$6.hash160(a.pubkey ||
|
|
7374
|
+
if (a.pubkey || o2.pubkey)
|
|
7375
|
+
return bcrypto$6.hash160(a.pubkey || o2.pubkey);
|
|
7301
7376
|
});
|
|
7302
|
-
lazy$3.prop(
|
|
7303
|
-
if (!
|
|
7377
|
+
lazy$3.prop(o2, "output", () => {
|
|
7378
|
+
if (!o2.hash)
|
|
7304
7379
|
return;
|
|
7305
7380
|
return bscript$l.compile([
|
|
7306
7381
|
OPS$4.OP_DUP,
|
|
7307
7382
|
OPS$4.OP_HASH160,
|
|
7308
|
-
|
|
7383
|
+
o2.hash,
|
|
7309
7384
|
OPS$4.OP_EQUALVERIFY,
|
|
7310
7385
|
OPS$4.OP_CHECKSIG
|
|
7311
7386
|
]);
|
|
7312
7387
|
});
|
|
7313
|
-
lazy$3.prop(
|
|
7388
|
+
lazy$3.prop(o2, "pubkey", () => {
|
|
7314
7389
|
if (!a.input)
|
|
7315
7390
|
return;
|
|
7316
7391
|
return _chunks()[1];
|
|
7317
7392
|
});
|
|
7318
|
-
lazy$3.prop(
|
|
7393
|
+
lazy$3.prop(o2, "signature", () => {
|
|
7319
7394
|
if (!a.input)
|
|
7320
7395
|
return;
|
|
7321
7396
|
return _chunks()[0];
|
|
7322
7397
|
});
|
|
7323
|
-
lazy$3.prop(
|
|
7398
|
+
lazy$3.prop(o2, "input", () => {
|
|
7324
7399
|
if (!a.pubkey)
|
|
7325
7400
|
return;
|
|
7326
7401
|
if (!a.signature)
|
|
7327
7402
|
return;
|
|
7328
7403
|
return bscript$l.compile([a.signature, a.pubkey]);
|
|
7329
7404
|
});
|
|
7330
|
-
lazy$3.prop(
|
|
7331
|
-
if (!
|
|
7405
|
+
lazy$3.prop(o2, "witness", () => {
|
|
7406
|
+
if (!o2.input)
|
|
7332
7407
|
return;
|
|
7333
7408
|
return [];
|
|
7334
7409
|
});
|
|
@@ -7380,13 +7455,13 @@ function p2pkh$2(a, opts) {
|
|
|
7380
7455
|
throw new TypeError("Hash mismatch");
|
|
7381
7456
|
}
|
|
7382
7457
|
}
|
|
7383
|
-
return Object.assign(
|
|
7458
|
+
return Object.assign(o2, a);
|
|
7384
7459
|
}
|
|
7385
7460
|
p2pkh$3.p2pkh = p2pkh$2;
|
|
7386
7461
|
var p2sh$1 = {};
|
|
7387
7462
|
Object.defineProperty(p2sh$1, "__esModule", { value: true });
|
|
7388
7463
|
const bcrypto$5 = crypto$2;
|
|
7389
|
-
const networks_1$
|
|
7464
|
+
const networks_1$3 = networks$3;
|
|
7390
7465
|
const bscript$k = script$1;
|
|
7391
7466
|
const lazy$2 = lazy$7;
|
|
7392
7467
|
const typef$2 = typeforce_1;
|
|
@@ -7422,9 +7497,9 @@ function p2sh(a, opts) {
|
|
|
7422
7497
|
);
|
|
7423
7498
|
let network = a.network;
|
|
7424
7499
|
if (!network) {
|
|
7425
|
-
network = a.redeem && a.redeem.network || networks_1$
|
|
7500
|
+
network = a.redeem && a.redeem.network || networks_1$3.bitcoin;
|
|
7426
7501
|
}
|
|
7427
|
-
const
|
|
7502
|
+
const o2 = { network };
|
|
7428
7503
|
const _address = lazy$2.value(() => {
|
|
7429
7504
|
const payload = bs58check$1.decode(a.address);
|
|
7430
7505
|
const version = payload.readUInt8(0);
|
|
@@ -7443,49 +7518,49 @@ function p2sh(a, opts) {
|
|
|
7443
7518
|
witness: a.witness || []
|
|
7444
7519
|
};
|
|
7445
7520
|
});
|
|
7446
|
-
lazy$2.prop(
|
|
7447
|
-
if (!
|
|
7521
|
+
lazy$2.prop(o2, "address", () => {
|
|
7522
|
+
if (!o2.hash)
|
|
7448
7523
|
return;
|
|
7449
7524
|
const payload = buffer.Buffer.allocUnsafe(21);
|
|
7450
|
-
payload.writeUInt8(
|
|
7451
|
-
|
|
7525
|
+
payload.writeUInt8(o2.network.scriptHash, 0);
|
|
7526
|
+
o2.hash.copy(payload, 1);
|
|
7452
7527
|
return bs58check$1.encode(payload);
|
|
7453
7528
|
});
|
|
7454
|
-
lazy$2.prop(
|
|
7529
|
+
lazy$2.prop(o2, "hash", () => {
|
|
7455
7530
|
if (a.output)
|
|
7456
7531
|
return a.output.slice(2, 22);
|
|
7457
7532
|
if (a.address)
|
|
7458
7533
|
return _address().hash;
|
|
7459
|
-
if (
|
|
7460
|
-
return bcrypto$5.hash160(
|
|
7534
|
+
if (o2.redeem && o2.redeem.output)
|
|
7535
|
+
return bcrypto$5.hash160(o2.redeem.output);
|
|
7461
7536
|
});
|
|
7462
|
-
lazy$2.prop(
|
|
7463
|
-
if (!
|
|
7537
|
+
lazy$2.prop(o2, "output", () => {
|
|
7538
|
+
if (!o2.hash)
|
|
7464
7539
|
return;
|
|
7465
|
-
return bscript$k.compile([OPS$3.OP_HASH160,
|
|
7540
|
+
return bscript$k.compile([OPS$3.OP_HASH160, o2.hash, OPS$3.OP_EQUAL]);
|
|
7466
7541
|
});
|
|
7467
|
-
lazy$2.prop(
|
|
7542
|
+
lazy$2.prop(o2, "redeem", () => {
|
|
7468
7543
|
if (!a.input)
|
|
7469
7544
|
return;
|
|
7470
7545
|
return _redeem();
|
|
7471
7546
|
});
|
|
7472
|
-
lazy$2.prop(
|
|
7547
|
+
lazy$2.prop(o2, "input", () => {
|
|
7473
7548
|
if (!a.redeem || !a.redeem.input || !a.redeem.output)
|
|
7474
7549
|
return;
|
|
7475
7550
|
return bscript$k.compile(
|
|
7476
7551
|
[].concat(bscript$k.decompile(a.redeem.input), a.redeem.output)
|
|
7477
7552
|
);
|
|
7478
7553
|
});
|
|
7479
|
-
lazy$2.prop(
|
|
7480
|
-
if (
|
|
7481
|
-
return
|
|
7482
|
-
if (
|
|
7554
|
+
lazy$2.prop(o2, "witness", () => {
|
|
7555
|
+
if (o2.redeem && o2.redeem.witness)
|
|
7556
|
+
return o2.redeem.witness;
|
|
7557
|
+
if (o2.input)
|
|
7483
7558
|
return [];
|
|
7484
7559
|
});
|
|
7485
|
-
lazy$2.prop(
|
|
7560
|
+
lazy$2.prop(o2, "name", () => {
|
|
7486
7561
|
const nameParts = ["p2sh"];
|
|
7487
|
-
if (
|
|
7488
|
-
nameParts.push(
|
|
7562
|
+
if (o2.redeem !== void 0)
|
|
7563
|
+
nameParts.push(o2.redeem.name);
|
|
7489
7564
|
return nameParts.join("-");
|
|
7490
7565
|
});
|
|
7491
7566
|
if (opts.validate) {
|
|
@@ -7562,13 +7637,13 @@ function p2sh(a, opts) {
|
|
|
7562
7637
|
throw new TypeError("Witness and redeem.witness mismatch");
|
|
7563
7638
|
}
|
|
7564
7639
|
}
|
|
7565
|
-
return Object.assign(
|
|
7640
|
+
return Object.assign(o2, a);
|
|
7566
7641
|
}
|
|
7567
7642
|
p2sh$1.p2sh = p2sh;
|
|
7568
7643
|
var p2wpkh$1 = {};
|
|
7569
7644
|
Object.defineProperty(p2wpkh$1, "__esModule", { value: true });
|
|
7570
7645
|
const bcrypto$4 = crypto$2;
|
|
7571
|
-
const networks_1$
|
|
7646
|
+
const networks_1$2 = networks$3;
|
|
7572
7647
|
const bscript$j = script$1;
|
|
7573
7648
|
const lazy$1 = lazy$7;
|
|
7574
7649
|
const typef$1 = typeforce_1;
|
|
@@ -7603,46 +7678,46 @@ function p2wpkh(a, opts) {
|
|
|
7603
7678
|
data: buffer.Buffer.from(data)
|
|
7604
7679
|
};
|
|
7605
7680
|
});
|
|
7606
|
-
const network = a.network || networks_1$
|
|
7607
|
-
const
|
|
7608
|
-
lazy$1.prop(
|
|
7609
|
-
if (!
|
|
7681
|
+
const network = a.network || networks_1$2.bitcoin;
|
|
7682
|
+
const o2 = { name: "p2wpkh", network };
|
|
7683
|
+
lazy$1.prop(o2, "address", () => {
|
|
7684
|
+
if (!o2.hash)
|
|
7610
7685
|
return;
|
|
7611
|
-
const words = bech32$2.toWords(
|
|
7686
|
+
const words = bech32$2.toWords(o2.hash);
|
|
7612
7687
|
words.unshift(0);
|
|
7613
7688
|
return bech32$2.encode(network.bech32, words);
|
|
7614
7689
|
});
|
|
7615
|
-
lazy$1.prop(
|
|
7690
|
+
lazy$1.prop(o2, "hash", () => {
|
|
7616
7691
|
if (a.output)
|
|
7617
7692
|
return a.output.slice(2, 22);
|
|
7618
7693
|
if (a.address)
|
|
7619
7694
|
return _address().data;
|
|
7620
|
-
if (a.pubkey ||
|
|
7621
|
-
return bcrypto$4.hash160(a.pubkey ||
|
|
7695
|
+
if (a.pubkey || o2.pubkey)
|
|
7696
|
+
return bcrypto$4.hash160(a.pubkey || o2.pubkey);
|
|
7622
7697
|
});
|
|
7623
|
-
lazy$1.prop(
|
|
7624
|
-
if (!
|
|
7698
|
+
lazy$1.prop(o2, "output", () => {
|
|
7699
|
+
if (!o2.hash)
|
|
7625
7700
|
return;
|
|
7626
|
-
return bscript$j.compile([OPS$2.OP_0,
|
|
7701
|
+
return bscript$j.compile([OPS$2.OP_0, o2.hash]);
|
|
7627
7702
|
});
|
|
7628
|
-
lazy$1.prop(
|
|
7703
|
+
lazy$1.prop(o2, "pubkey", () => {
|
|
7629
7704
|
if (a.pubkey)
|
|
7630
7705
|
return a.pubkey;
|
|
7631
7706
|
if (!a.witness)
|
|
7632
7707
|
return;
|
|
7633
7708
|
return a.witness[1];
|
|
7634
7709
|
});
|
|
7635
|
-
lazy$1.prop(
|
|
7710
|
+
lazy$1.prop(o2, "signature", () => {
|
|
7636
7711
|
if (!a.witness)
|
|
7637
7712
|
return;
|
|
7638
7713
|
return a.witness[0];
|
|
7639
7714
|
});
|
|
7640
|
-
lazy$1.prop(
|
|
7641
|
-
if (!
|
|
7715
|
+
lazy$1.prop(o2, "input", () => {
|
|
7716
|
+
if (!o2.witness)
|
|
7642
7717
|
return;
|
|
7643
7718
|
return EMPTY_BUFFER$1;
|
|
7644
7719
|
});
|
|
7645
|
-
lazy$1.prop(
|
|
7720
|
+
lazy$1.prop(o2, "witness", () => {
|
|
7646
7721
|
if (!a.pubkey)
|
|
7647
7722
|
return;
|
|
7648
7723
|
if (!a.signature)
|
|
@@ -7699,13 +7774,13 @@ function p2wpkh(a, opts) {
|
|
|
7699
7774
|
throw new TypeError("Hash mismatch");
|
|
7700
7775
|
}
|
|
7701
7776
|
}
|
|
7702
|
-
return Object.assign(
|
|
7777
|
+
return Object.assign(o2, a);
|
|
7703
7778
|
}
|
|
7704
7779
|
p2wpkh$1.p2wpkh = p2wpkh;
|
|
7705
7780
|
var p2wsh$1 = {};
|
|
7706
7781
|
Object.defineProperty(p2wsh$1, "__esModule", { value: true });
|
|
7707
7782
|
const bcrypto$3 = crypto$2;
|
|
7708
|
-
const networks_1$
|
|
7783
|
+
const networks_1$1 = networks$3;
|
|
7709
7784
|
const bscript$i = script$1;
|
|
7710
7785
|
const lazy = lazy$7;
|
|
7711
7786
|
const typef = typeforce_1;
|
|
@@ -7763,30 +7838,30 @@ function p2wsh(a, opts) {
|
|
|
7763
7838
|
});
|
|
7764
7839
|
let network = a.network;
|
|
7765
7840
|
if (!network) {
|
|
7766
|
-
network = a.redeem && a.redeem.network || networks_1$
|
|
7841
|
+
network = a.redeem && a.redeem.network || networks_1$1.bitcoin;
|
|
7767
7842
|
}
|
|
7768
|
-
const
|
|
7769
|
-
lazy.prop(
|
|
7770
|
-
if (!
|
|
7843
|
+
const o2 = { network };
|
|
7844
|
+
lazy.prop(o2, "address", () => {
|
|
7845
|
+
if (!o2.hash)
|
|
7771
7846
|
return;
|
|
7772
|
-
const words = bech32$1.toWords(
|
|
7847
|
+
const words = bech32$1.toWords(o2.hash);
|
|
7773
7848
|
words.unshift(0);
|
|
7774
7849
|
return bech32$1.encode(network.bech32, words);
|
|
7775
7850
|
});
|
|
7776
|
-
lazy.prop(
|
|
7851
|
+
lazy.prop(o2, "hash", () => {
|
|
7777
7852
|
if (a.output)
|
|
7778
7853
|
return a.output.slice(2);
|
|
7779
7854
|
if (a.address)
|
|
7780
7855
|
return _address().data;
|
|
7781
|
-
if (
|
|
7782
|
-
return bcrypto$3.sha256(
|
|
7856
|
+
if (o2.redeem && o2.redeem.output)
|
|
7857
|
+
return bcrypto$3.sha256(o2.redeem.output);
|
|
7783
7858
|
});
|
|
7784
|
-
lazy.prop(
|
|
7785
|
-
if (!
|
|
7859
|
+
lazy.prop(o2, "output", () => {
|
|
7860
|
+
if (!o2.hash)
|
|
7786
7861
|
return;
|
|
7787
|
-
return bscript$i.compile([OPS$1.OP_0,
|
|
7862
|
+
return bscript$i.compile([OPS$1.OP_0, o2.hash]);
|
|
7788
7863
|
});
|
|
7789
|
-
lazy.prop(
|
|
7864
|
+
lazy.prop(o2, "redeem", () => {
|
|
7790
7865
|
if (!a.witness)
|
|
7791
7866
|
return;
|
|
7792
7867
|
return {
|
|
@@ -7795,16 +7870,16 @@ function p2wsh(a, opts) {
|
|
|
7795
7870
|
witness: a.witness.slice(0, -1)
|
|
7796
7871
|
};
|
|
7797
7872
|
});
|
|
7798
|
-
lazy.prop(
|
|
7799
|
-
if (!
|
|
7873
|
+
lazy.prop(o2, "input", () => {
|
|
7874
|
+
if (!o2.witness)
|
|
7800
7875
|
return;
|
|
7801
7876
|
return EMPTY_BUFFER;
|
|
7802
7877
|
});
|
|
7803
|
-
lazy.prop(
|
|
7878
|
+
lazy.prop(o2, "witness", () => {
|
|
7804
7879
|
if (a.redeem && a.redeem.input && a.redeem.input.length > 0 && a.redeem.output && a.redeem.output.length > 0) {
|
|
7805
7880
|
const stack = bscript$i.toStack(_rchunks());
|
|
7806
|
-
|
|
7807
|
-
|
|
7881
|
+
o2.redeem = Object.assign({ witness: stack }, a.redeem);
|
|
7882
|
+
o2.redeem.input = EMPTY_BUFFER;
|
|
7808
7883
|
return [].concat(stack, a.redeem.output);
|
|
7809
7884
|
}
|
|
7810
7885
|
if (!a.redeem)
|
|
@@ -7815,10 +7890,10 @@ function p2wsh(a, opts) {
|
|
|
7815
7890
|
return;
|
|
7816
7891
|
return [].concat(a.redeem.witness, a.redeem.output);
|
|
7817
7892
|
});
|
|
7818
|
-
lazy.prop(
|
|
7893
|
+
lazy.prop(o2, "name", () => {
|
|
7819
7894
|
const nameParts = ["p2wsh"];
|
|
7820
|
-
if (
|
|
7821
|
-
nameParts.push(
|
|
7895
|
+
if (o2.redeem !== void 0)
|
|
7896
|
+
nameParts.push(o2.redeem.name);
|
|
7822
7897
|
return nameParts.join("-");
|
|
7823
7898
|
});
|
|
7824
7899
|
if (opts.validate) {
|
|
@@ -7881,7 +7956,7 @@ function p2wsh(a, opts) {
|
|
|
7881
7956
|
throw new TypeError("Witness contains uncompressed pubkey");
|
|
7882
7957
|
}
|
|
7883
7958
|
}
|
|
7884
|
-
return Object.assign(
|
|
7959
|
+
return Object.assign(o2, a);
|
|
7885
7960
|
}
|
|
7886
7961
|
p2wsh$1.p2wsh = p2wsh;
|
|
7887
7962
|
Object.defineProperty(payments$4, "__esModule", { value: true });
|
|
@@ -8377,7 +8452,7 @@ const BLANK_OUTPUT = {
|
|
|
8377
8452
|
function isOutput(out) {
|
|
8378
8453
|
return out.value !== void 0;
|
|
8379
8454
|
}
|
|
8380
|
-
|
|
8455
|
+
class Transaction {
|
|
8381
8456
|
constructor() {
|
|
8382
8457
|
this.version = 1;
|
|
8383
8458
|
this.locktime = 0;
|
|
@@ -8696,15 +8771,15 @@ let Transaction$1 = class Transaction {
|
|
|
8696
8771
|
return buffer$1.slice(initialOffset, bufferWriter.offset);
|
|
8697
8772
|
return buffer$1;
|
|
8698
8773
|
}
|
|
8699
|
-
}
|
|
8700
|
-
Transaction
|
|
8701
|
-
Transaction
|
|
8702
|
-
Transaction
|
|
8703
|
-
Transaction
|
|
8704
|
-
Transaction
|
|
8705
|
-
Transaction
|
|
8706
|
-
Transaction
|
|
8707
|
-
transaction.Transaction = Transaction
|
|
8774
|
+
}
|
|
8775
|
+
Transaction.DEFAULT_SEQUENCE = 4294967295;
|
|
8776
|
+
Transaction.SIGHASH_ALL = 1;
|
|
8777
|
+
Transaction.SIGHASH_NONE = 2;
|
|
8778
|
+
Transaction.SIGHASH_SINGLE = 3;
|
|
8779
|
+
Transaction.SIGHASH_ANYONECANPAY = 128;
|
|
8780
|
+
Transaction.ADVANCED_TRANSACTION_MARKER = 0;
|
|
8781
|
+
Transaction.ADVANCED_TRANSACTION_FLAG = 1;
|
|
8782
|
+
transaction.Transaction = Transaction;
|
|
8708
8783
|
var fastRoot = function fastRoot2(values, digestFn) {
|
|
8709
8784
|
if (!Array.isArray(values))
|
|
8710
8785
|
throw TypeError("Expected values Array");
|
|
@@ -9040,8 +9115,8 @@ globalXpub$1.expected = "{ masterFingerprint: Buffer; extendedPubkey: Buffer; pa
|
|
|
9040
9115
|
function check$q(data) {
|
|
9041
9116
|
const epk = data.extendedPubkey;
|
|
9042
9117
|
const mfp = data.masterFingerprint;
|
|
9043
|
-
const
|
|
9044
|
-
return buffer.Buffer.isBuffer(epk) && epk.length === 78 && [2, 3].indexOf(epk[45]) > -1 && buffer.Buffer.isBuffer(mfp) && mfp.length === 4 && typeof
|
|
9118
|
+
const p2 = data.path;
|
|
9119
|
+
return buffer.Buffer.isBuffer(epk) && epk.length === 78 && [2, 3].indexOf(epk[45]) > -1 && buffer.Buffer.isBuffer(mfp) && mfp.length === 4 && typeof p2 === "string" && !!p2.match(/^m(\/\d+'?)*$/);
|
|
9045
9120
|
}
|
|
9046
9121
|
globalXpub$1.check = check$q;
|
|
9047
9122
|
function canAddToArray$3(array, item, dupeSet) {
|
|
@@ -10412,15 +10487,15 @@ function psbtToKeyVals({ globalMap, inputs: inputs2, outputs: outputs2 }) {
|
|
|
10412
10487
|
return {
|
|
10413
10488
|
globalKeyVals: keyValsFromMap(globalMap, convert.globals),
|
|
10414
10489
|
inputKeyVals: inputs2.map((i) => keyValsFromMap(i, convert.inputs)),
|
|
10415
|
-
outputKeyVals: outputs2.map((
|
|
10490
|
+
outputKeyVals: outputs2.map((o2) => keyValsFromMap(o2, convert.outputs))
|
|
10416
10491
|
};
|
|
10417
10492
|
}
|
|
10418
10493
|
toBuffer.psbtToKeyVals = psbtToKeyVals;
|
|
10419
10494
|
(function(exports2) {
|
|
10420
|
-
function __export(
|
|
10421
|
-
for (var
|
|
10422
|
-
if (!exports2.hasOwnProperty(
|
|
10423
|
-
exports2[
|
|
10495
|
+
function __export(m2) {
|
|
10496
|
+
for (var p2 in m2)
|
|
10497
|
+
if (!exports2.hasOwnProperty(p2))
|
|
10498
|
+
exports2[p2] = m2[p2];
|
|
10424
10499
|
}
|
|
10425
10500
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10426
10501
|
__export(fromBuffer);
|
|
@@ -10788,9 +10863,9 @@ const varuint = varint;
|
|
|
10788
10863
|
const utils_1 = utils;
|
|
10789
10864
|
const address_1 = address$1;
|
|
10790
10865
|
const bufferutils_1$1 = bufferutils;
|
|
10791
|
-
const crypto_1
|
|
10866
|
+
const crypto_1 = crypto$2;
|
|
10792
10867
|
const ecpair_1 = ecpair;
|
|
10793
|
-
const networks_1
|
|
10868
|
+
const networks_1 = networks$3;
|
|
10794
10869
|
const payments$2 = payments$4;
|
|
10795
10870
|
const bscript$f = script$1;
|
|
10796
10871
|
const transaction_1$2 = transaction;
|
|
@@ -10799,7 +10874,7 @@ const DEFAULT_OPTS = {
|
|
|
10799
10874
|
* A bitcoinjs Network object. This is only used if you pass an `address`
|
|
10800
10875
|
* parameter to addOutput. Otherwise it is not needed and can be left default.
|
|
10801
10876
|
*/
|
|
10802
|
-
network: networks_1
|
|
10877
|
+
network: networks_1.bitcoin,
|
|
10803
10878
|
/**
|
|
10804
10879
|
* When extractTransaction is called, the fee rate is checked.
|
|
10805
10880
|
* THIS IS NOT TO BE RELIED ON.
|
|
@@ -10885,7 +10960,7 @@ let Psbt$1 = class Psbt2 {
|
|
|
10885
10960
|
});
|
|
10886
10961
|
}
|
|
10887
10962
|
combine(...those) {
|
|
10888
|
-
this.data.combine(...those.map((
|
|
10963
|
+
this.data.combine(...those.map((o2) => o2.data));
|
|
10889
10964
|
return this;
|
|
10890
10965
|
}
|
|
10891
10966
|
clone() {
|
|
@@ -10900,28 +10975,28 @@ let Psbt$1 = class Psbt2 {
|
|
|
10900
10975
|
setVersion(version) {
|
|
10901
10976
|
check32Bit(version);
|
|
10902
10977
|
checkInputsForPartialSig(this.data.inputs, "setVersion");
|
|
10903
|
-
const
|
|
10904
|
-
|
|
10905
|
-
|
|
10978
|
+
const c2 = this.__CACHE;
|
|
10979
|
+
c2.__TX.version = version;
|
|
10980
|
+
c2.__EXTRACTED_TX = void 0;
|
|
10906
10981
|
return this;
|
|
10907
10982
|
}
|
|
10908
10983
|
setLocktime(locktime) {
|
|
10909
10984
|
check32Bit(locktime);
|
|
10910
10985
|
checkInputsForPartialSig(this.data.inputs, "setLocktime");
|
|
10911
|
-
const
|
|
10912
|
-
|
|
10913
|
-
|
|
10986
|
+
const c2 = this.__CACHE;
|
|
10987
|
+
c2.__TX.locktime = locktime;
|
|
10988
|
+
c2.__EXTRACTED_TX = void 0;
|
|
10914
10989
|
return this;
|
|
10915
10990
|
}
|
|
10916
10991
|
setInputSequence(inputIndex, sequence) {
|
|
10917
10992
|
check32Bit(sequence);
|
|
10918
10993
|
checkInputsForPartialSig(this.data.inputs, "setInputSequence");
|
|
10919
|
-
const
|
|
10920
|
-
if (
|
|
10994
|
+
const c2 = this.__CACHE;
|
|
10995
|
+
if (c2.__TX.ins.length <= inputIndex) {
|
|
10921
10996
|
throw new Error("Input index too high");
|
|
10922
10997
|
}
|
|
10923
|
-
|
|
10924
|
-
|
|
10998
|
+
c2.__TX.ins[inputIndex].sequence = sequence;
|
|
10999
|
+
c2.__EXTRACTED_TX = void 0;
|
|
10925
11000
|
return this;
|
|
10926
11001
|
}
|
|
10927
11002
|
addInputs(inputDatas) {
|
|
@@ -10937,18 +11012,18 @@ let Psbt$1 = class Psbt2 {
|
|
|
10937
11012
|
checkInputsForPartialSig(this.data.inputs, "addInput");
|
|
10938
11013
|
if (inputData.witnessScript)
|
|
10939
11014
|
checkInvalidP2WSH(inputData.witnessScript);
|
|
10940
|
-
const
|
|
11015
|
+
const c2 = this.__CACHE;
|
|
10941
11016
|
this.data.addInput(inputData);
|
|
10942
|
-
const txIn =
|
|
10943
|
-
checkTxInputCache(
|
|
11017
|
+
const txIn = c2.__TX.ins[c2.__TX.ins.length - 1];
|
|
11018
|
+
checkTxInputCache(c2, txIn);
|
|
10944
11019
|
const inputIndex = this.data.inputs.length - 1;
|
|
10945
11020
|
const input2 = this.data.inputs[inputIndex];
|
|
10946
11021
|
if (input2.nonWitnessUtxo) {
|
|
10947
11022
|
addNonWitnessTxCache(this.__CACHE, input2, inputIndex);
|
|
10948
11023
|
}
|
|
10949
|
-
|
|
10950
|
-
|
|
10951
|
-
|
|
11024
|
+
c2.__FEE = void 0;
|
|
11025
|
+
c2.__FEE_RATE = void 0;
|
|
11026
|
+
c2.__EXTRACTED_TX = void 0;
|
|
10952
11027
|
return this;
|
|
10953
11028
|
}
|
|
10954
11029
|
addOutputs(outputDatas) {
|
|
@@ -10968,24 +11043,24 @@ let Psbt$1 = class Psbt2 {
|
|
|
10968
11043
|
const script2 = address_1.toOutputScript(address2, network);
|
|
10969
11044
|
outputData = Object.assign(outputData, { script: script2 });
|
|
10970
11045
|
}
|
|
10971
|
-
const
|
|
11046
|
+
const c2 = this.__CACHE;
|
|
10972
11047
|
this.data.addOutput(outputData);
|
|
10973
|
-
|
|
10974
|
-
|
|
10975
|
-
|
|
11048
|
+
c2.__FEE = void 0;
|
|
11049
|
+
c2.__FEE_RATE = void 0;
|
|
11050
|
+
c2.__EXTRACTED_TX = void 0;
|
|
10976
11051
|
return this;
|
|
10977
11052
|
}
|
|
10978
11053
|
extractTransaction(disableFeeCheck) {
|
|
10979
11054
|
if (!this.data.inputs.every(isFinalized))
|
|
10980
11055
|
throw new Error("Not finalized");
|
|
10981
|
-
const
|
|
11056
|
+
const c2 = this.__CACHE;
|
|
10982
11057
|
if (!disableFeeCheck) {
|
|
10983
|
-
checkFees(this,
|
|
11058
|
+
checkFees(this, c2, this.opts);
|
|
10984
11059
|
}
|
|
10985
|
-
if (
|
|
10986
|
-
return
|
|
10987
|
-
const tx =
|
|
10988
|
-
inputFinalizeGetAmts(this.data.inputs, tx,
|
|
11060
|
+
if (c2.__EXTRACTED_TX)
|
|
11061
|
+
return c2.__EXTRACTED_TX;
|
|
11062
|
+
const tx = c2.__TX.clone();
|
|
11063
|
+
inputFinalizeGetAmts(this.data.inputs, tx, c2, true);
|
|
10989
11064
|
return tx;
|
|
10990
11065
|
}
|
|
10991
11066
|
getFeeRate() {
|
|
@@ -11501,26 +11576,26 @@ const checkWitnessScript = scriptCheckerFactory(
|
|
|
11501
11576
|
payments$2.p2wsh,
|
|
11502
11577
|
"Witness script"
|
|
11503
11578
|
);
|
|
11504
|
-
function getTxCacheValue(key, name, inputs2,
|
|
11579
|
+
function getTxCacheValue(key, name, inputs2, c2) {
|
|
11505
11580
|
if (!inputs2.every(isFinalized))
|
|
11506
11581
|
throw new Error(`PSBT must be finalized to calculate ${name}`);
|
|
11507
|
-
if (key === "__FEE_RATE" &&
|
|
11508
|
-
return
|
|
11509
|
-
if (key === "__FEE" &&
|
|
11510
|
-
return
|
|
11582
|
+
if (key === "__FEE_RATE" && c2.__FEE_RATE)
|
|
11583
|
+
return c2.__FEE_RATE;
|
|
11584
|
+
if (key === "__FEE" && c2.__FEE)
|
|
11585
|
+
return c2.__FEE;
|
|
11511
11586
|
let tx;
|
|
11512
11587
|
let mustFinalize = true;
|
|
11513
|
-
if (
|
|
11514
|
-
tx =
|
|
11588
|
+
if (c2.__EXTRACTED_TX) {
|
|
11589
|
+
tx = c2.__EXTRACTED_TX;
|
|
11515
11590
|
mustFinalize = false;
|
|
11516
11591
|
} else {
|
|
11517
|
-
tx =
|
|
11592
|
+
tx = c2.__TX.clone();
|
|
11518
11593
|
}
|
|
11519
|
-
inputFinalizeGetAmts(inputs2, tx,
|
|
11594
|
+
inputFinalizeGetAmts(inputs2, tx, c2, mustFinalize);
|
|
11520
11595
|
if (key === "__FEE_RATE")
|
|
11521
|
-
return
|
|
11596
|
+
return c2.__FEE_RATE;
|
|
11522
11597
|
else if (key === "__FEE")
|
|
11523
|
-
return
|
|
11598
|
+
return c2.__FEE;
|
|
11524
11599
|
}
|
|
11525
11600
|
function getFinalScripts(inputIndex, input2, script2, isSegwit, isP2SH, isP2WSH) {
|
|
11526
11601
|
const scriptType = classifyScript(script2);
|
|
@@ -11862,7 +11937,7 @@ function inputFinalizeGetAmts(inputs2, tx, cache, mustFinalize) {
|
|
|
11862
11937
|
inputAmount += out.value;
|
|
11863
11938
|
}
|
|
11864
11939
|
});
|
|
11865
|
-
const outputAmount = tx.outs.reduce((total,
|
|
11940
|
+
const outputAmount = tx.outs.reduce((total, o2) => total + o2.value, 0);
|
|
11866
11941
|
const fee = inputAmount - outputAmount;
|
|
11867
11942
|
if (fee < 0) {
|
|
11868
11943
|
throw new Error("Outputs are spending more than Inputs");
|
|
@@ -11873,11 +11948,11 @@ function inputFinalizeGetAmts(inputs2, tx, cache, mustFinalize) {
|
|
|
11873
11948
|
cache.__FEE_RATE = Math.floor(fee / bytes);
|
|
11874
11949
|
}
|
|
11875
11950
|
function nonWitnessUtxoTxFromCache(cache, input2, inputIndex) {
|
|
11876
|
-
const
|
|
11877
|
-
if (!
|
|
11951
|
+
const c2 = cache.__NON_WITNESS_UTXO_TX_CACHE;
|
|
11952
|
+
if (!c2[inputIndex]) {
|
|
11878
11953
|
addNonWitnessTxCache(cache, input2, inputIndex);
|
|
11879
11954
|
}
|
|
11880
|
-
return
|
|
11955
|
+
return c2[inputIndex];
|
|
11881
11956
|
}
|
|
11882
11957
|
function getScriptFromUtxo(inputIndex, input2, cache) {
|
|
11883
11958
|
if (input2.witnessUtxo !== void 0) {
|
|
@@ -11984,7 +12059,7 @@ function checkInvalidP2WSH(script2) {
|
|
|
11984
12059
|
}
|
|
11985
12060
|
}
|
|
11986
12061
|
function pubkeyInScript(pubkey2, script2) {
|
|
11987
|
-
const pubkeyHash = crypto_1
|
|
12062
|
+
const pubkeyHash = crypto_1.hash160(pubkey2);
|
|
11988
12063
|
const decompiled = bscript$f.decompile(script2);
|
|
11989
12064
|
if (decompiled === null)
|
|
11990
12065
|
throw new Error("Unknown script error");
|
|
@@ -12049,13 +12124,13 @@ function check$c(script2, allowIncomplete) {
|
|
|
12049
12124
|
return false;
|
|
12050
12125
|
if (!types$3.Number(chunks[chunks.length - 2]))
|
|
12051
12126
|
return false;
|
|
12052
|
-
const
|
|
12127
|
+
const m2 = chunks[0] - OP_INT_BASE;
|
|
12053
12128
|
const n2 = chunks[chunks.length - 2] - OP_INT_BASE;
|
|
12054
|
-
if (
|
|
12129
|
+
if (m2 <= 0)
|
|
12055
12130
|
return false;
|
|
12056
12131
|
if (n2 > 16)
|
|
12057
12132
|
return false;
|
|
12058
|
-
if (
|
|
12133
|
+
if (m2 > n2)
|
|
12059
12134
|
return false;
|
|
12060
12135
|
if (n2 !== chunks.length - 3)
|
|
12061
12136
|
return false;
|
|
@@ -12707,7 +12782,7 @@ function expandInput(scriptSig, witnessStack, type, scriptPubKey) {
|
|
|
12707
12782
|
};
|
|
12708
12783
|
}
|
|
12709
12784
|
case SCRIPT_TYPES.P2MS: {
|
|
12710
|
-
const { m, pubkeys, signatures } = payments$1.p2ms(
|
|
12785
|
+
const { m: m2, pubkeys, signatures } = payments$1.p2ms(
|
|
12711
12786
|
{
|
|
12712
12787
|
input: scriptSig,
|
|
12713
12788
|
output: scriptPubKey
|
|
@@ -12718,7 +12793,7 @@ function expandInput(scriptSig, witnessStack, type, scriptPubKey) {
|
|
|
12718
12793
|
prevOutType: SCRIPT_TYPES.P2MS,
|
|
12719
12794
|
pubkeys,
|
|
12720
12795
|
signatures,
|
|
12721
|
-
maxSignatures:
|
|
12796
|
+
maxSignatures: m2
|
|
12722
12797
|
};
|
|
12723
12798
|
}
|
|
12724
12799
|
}
|
|
@@ -13034,15 +13109,15 @@ function build(type, input2, allowIncomplete) {
|
|
|
13034
13109
|
return payments$1.p2pk({ signature: signatures[0] });
|
|
13035
13110
|
}
|
|
13036
13111
|
case SCRIPT_TYPES.P2MS: {
|
|
13037
|
-
const
|
|
13112
|
+
const m2 = input2.maxSignatures;
|
|
13038
13113
|
if (allowIncomplete) {
|
|
13039
13114
|
signatures = signatures.map((x) => x || script_1$1.OPS.OP_0);
|
|
13040
13115
|
} else {
|
|
13041
13116
|
signatures = signatures.filter((x) => x);
|
|
13042
13117
|
}
|
|
13043
|
-
const validate = !allowIncomplete ||
|
|
13118
|
+
const validate = !allowIncomplete || m2 === signatures.length;
|
|
13044
13119
|
return payments$1.p2ms(
|
|
13045
|
-
{ m, pubkeys, signatures },
|
|
13120
|
+
{ m: m2, pubkeys, signatures },
|
|
13046
13121
|
{ allowIncomplete, validate }
|
|
13047
13122
|
);
|
|
13048
13123
|
}
|
|
@@ -13388,36 +13463,151 @@ function getSigningData(network, inputs2, needsOutputs, tx, signParams, keyPair,
|
|
|
13388
13463
|
useLowR: !!useLowR
|
|
13389
13464
|
};
|
|
13390
13465
|
}
|
|
13391
|
-
Object.defineProperty(src$
|
|
13392
|
-
const bip32 = src;
|
|
13393
|
-
src$
|
|
13466
|
+
Object.defineProperty(src$2, "__esModule", { value: true });
|
|
13467
|
+
const bip32 = src$1;
|
|
13468
|
+
src$2.bip32 = bip32;
|
|
13394
13469
|
const address = address$1;
|
|
13395
|
-
src$
|
|
13470
|
+
src$2.address = address;
|
|
13396
13471
|
const crypto = crypto$2;
|
|
13397
|
-
|
|
13472
|
+
src$2.crypto = crypto;
|
|
13398
13473
|
const ECPair2 = ecpair;
|
|
13399
|
-
src$
|
|
13474
|
+
src$2.ECPair = ECPair2;
|
|
13400
13475
|
const networks = networks$3;
|
|
13401
|
-
|
|
13476
|
+
src$2.networks = networks;
|
|
13402
13477
|
const payments = payments$4;
|
|
13403
|
-
src$
|
|
13478
|
+
src$2.payments = payments;
|
|
13404
13479
|
const script = script$1;
|
|
13405
|
-
src$
|
|
13480
|
+
src$2.script = script;
|
|
13406
13481
|
var block_1 = block;
|
|
13407
|
-
src$
|
|
13482
|
+
src$2.Block = block_1.Block;
|
|
13408
13483
|
var psbt_1 = psbt$1;
|
|
13409
|
-
var Psbt3 = src$
|
|
13484
|
+
var Psbt3 = src$2.Psbt = psbt_1.Psbt;
|
|
13410
13485
|
var script_1 = script$1;
|
|
13411
|
-
src$
|
|
13486
|
+
src$2.opcodes = script_1.OPS;
|
|
13412
13487
|
var transaction_1 = transaction;
|
|
13413
|
-
|
|
13488
|
+
src$2.Transaction = transaction_1.Transaction;
|
|
13414
13489
|
var transaction_builder_1 = transaction_builder;
|
|
13415
|
-
src$
|
|
13490
|
+
src$2.TransactionBuilder = transaction_builder_1.TransactionBuilder;
|
|
13491
|
+
var n = /* @__PURE__ */ ((t) => (t.INVALID_INPUT_PARAMETERS = "1000", t.UNKNOWN_PROVIDERS = "1001", t.CANNOT_FIND_INBOUND_ADDRESS = "1002", t.NO_INBOUND_ADDRESSES = "1003", t.CHAIN_HALTED_OR_UNSUPPORTED = "1004", t.MISSING_INPUT_PARAMETER = "1005", t.INVALID_TYPE_GENERIC = "1100", t.INVALID_NUMBER_STRING = "1101", t.INVALID_NUMBER = "1102", t.INVALID_BOOLEAN = "1103", t.INVALID_OBJECT = "1104", t.INVALID_ARRAY = "1105", t.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2000", t.SELL_BUY_ASSETS_ARE_THE_SAME = "2001", t.MISSING_SOURCE_ADDRESS_FOR_SYNTH = "2002", t.AFF_ADDRESS_AND_BPS_OR_NEITHER = "2003", t.AFF_ADDRESS_TOO_LONG = "2004", t.AFF_BPS_INTEGER_0_100 = "2005", t.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN = "2006", t.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN = "2007", t.PREFERRED_PROFVIDER_NOT_SUPPORTED = "2008", t.DESTINATION_ADDRESS_SMART_CONTRACT = "2009", t.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2010", t.SOURCE_ADDRESS_SMART_CONTRACT = "2011", t.INVALID_PROVIDER = "2100", t.MISSING_CROSS_CHAIN_PROVIDER = "2101", t.MISSING_AVAX_PROVIDER = "2102", t.MISSING_BSC_PROVIDER = "2103", t.MISSING_ETH_PROVIDER = "2104", t.INVALID_PROVIDER_FOR_SWAP_OUT = "2105", t.MISSING_ARB_PROVIDER = "2106", t.INVALID_CHAIN = "2200", t.INVALID_ASSET = "2201", t.INVALID_ASSET_IDENTIFIER = "2202", t.UNSUPPORTED_CHAIN = "2204", t.UNSUPPORTED_ASSET = "2203", t.UNSUPPORTED_ASSET_FOR_SWAPOUT = "2205", t.INVALID_SOURCE_ADDRESS = "2300", t.INVALID_DESTINATION_ADDRESS = "2301", t.THORNODE_QUOTE_GENERIC_ERROR = "3000", t.NOT_ENOUGH_SYNTH_BALANCE = "3001", t.SYNTH_MINTING_CAP_REACHED = "3002", t.INVALID_QUOTE_MODE = "4000", t.NO_QUOTES = "4001", t.SERVICE_UNAVAILABLE_GENERIC = "5000", t.MISSING_GAS_DATA_GENERIC = "5100", t.MISSING_TOKEN_INFO_GENERIC = "5200", t.CANT_FIND_TOKEN_LIST = "5201", t.NO_PRICE = "5202", t.PRICE_IS_STALE = "5203", t.ADDRESS_NOT_WHITELISTED = "6000", t.ADDRESS_ALREADY_CLAIMED = "6001", t.TEMPORARY_ERROR = "9999", t))(n || {});
|
|
13492
|
+
n.INVALID_INPUT_PARAMETERS + "", n.UNKNOWN_PROVIDERS + "", n.CANNOT_FIND_INBOUND_ADDRESS + "", n.NO_INBOUND_ADDRESSES + "", n.CHAIN_HALTED_OR_UNSUPPORTED + "", n.MISSING_INPUT_PARAMETER + "", n.INVALID_TYPE_GENERIC + "", n.INVALID_NUMBER_STRING + "", n.INVALID_NUMBER + "", n.INVALID_BOOLEAN + "", n.INVALID_OBJECT + "", n.INVALID_ARRAY + "", n.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER + "", n.SELL_BUY_ASSETS_ARE_THE_SAME + "", n.MISSING_SOURCE_ADDRESS_FOR_SYNTH + "", n.AFF_ADDRESS_AND_BPS_OR_NEITHER + "", n.AFF_ADDRESS_TOO_LONG + "", n.AFF_BPS_INTEGER_0_100 + "", n.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN + "", n.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN + "", n.PREFERRED_PROFVIDER_NOT_SUPPORTED + "", n.DESTINATION_ADDRESS_SMART_CONTRACT + "", n.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER + "", n.INVALID_PROVIDER + "", n.MISSING_CROSS_CHAIN_PROVIDER + "", n.MISSING_AVAX_PROVIDER + "", n.MISSING_BSC_PROVIDER + "", n.MISSING_ETH_PROVIDER + "", n.MISSING_ARB_PROVIDER + "", n.INVALID_PROVIDER_FOR_SWAP_OUT + "", n.INVALID_CHAIN + "", n.INVALID_ASSET + "", n.UNSUPPORTED_CHAIN + "", n.UNSUPPORTED_ASSET + "", n.UNSUPPORTED_ASSET_FOR_SWAPOUT + "", n.THORNODE_QUOTE_GENERIC_ERROR + "", n.INVALID_SOURCE_ADDRESS + "", n.INVALID_DESTINATION_ADDRESS + "", n.NOT_ENOUGH_SYNTH_BALANCE + "", n.SYNTH_MINTING_CAP_REACHED + "", n.INVALID_QUOTE_MODE + "", n.NO_QUOTES + "", n.SERVICE_UNAVAILABLE_GENERIC + "", n.MISSING_GAS_DATA_GENERIC + "", n.MISSING_TOKEN_INFO_GENERIC + "", n.CANT_FIND_TOKEN_LIST + "", n.NO_PRICE + "", n.PRICE_IS_STALE + "", n.ADDRESS_NOT_WHITELISTED + "", n.ADDRESS_ALREADY_CLAIMED + "";
|
|
13493
|
+
var o = /* @__PURE__ */ ((t) => (t.Arbitrum = "ARB", t.Avalanche = "AVAX", t.Binance = "BNB", t.BinanceSmartChain = "BSC", t.Bitcoin = "BTC", t.BitcoinCash = "BCH", t.Cosmos = "GAIA", t.Dogecoin = "DOGE", t.Ethereum = "ETH", t.Kujira = "KUJI", t.Litecoin = "LTC", t.Maya = "MAYA", t.Optimism = "OP", t.Polygon = "MATIC", t.THORChain = "THOR", t))(o || {}), C = /* @__PURE__ */ ((t) => (t[t.ARB = 18] = "ARB", t[t.AVAX = 18] = "AVAX", t[t.BCH = 8] = "BCH", t[t.BNB = 8] = "BNB", t[t.BSC = 18] = "BSC", t[t.BTC = 8] = "BTC", t[t.DASH = 8] = "DASH", t[t.DOGE = 8] = "DOGE", t[t.ETH = 18] = "ETH", t[t.GAIA = 6] = "GAIA", t[t.KUJI = 6] = "KUJI", t[t.LTC = 8] = "LTC", t[t.MATIC = 18] = "MATIC", t[t.MAYA = 10] = "MAYA", t[t.OP = 18] = "OP", t[t.THOR = 8] = "THOR", t))(C || {}), R = /* @__PURE__ */ ((t) => (t.Arbitrum = "42161", t.ArbitrumHex = "0xa4b1", t.Avalanche = "43114", t.AvalancheHex = "0xa86a", t.Binance = "Binance-Chain-Tigris", t.BinanceSmartChain = "56", t.BinanceSmartChainHex = "0x38", t.Bitcoin = "bitcoin", t.BitcoinCash = "bitcoincash", t.Cosmos = "cosmoshub-4", t.Dogecoin = "dogecoin", t.Kujira = "kaiyo-1", t.Ethereum = "1", t.EthereumHex = "0x1", t.Litecoin = "litecoin", t.Maya = "mayachain-mainnet-v1", t.MayaStagenet = "mayachain-stagenet-v1", t.Optimism = "10", t.OptimismHex = "0xa", t.Polygon = "137", t.PolygonHex = "0x89", t.THORChain = "thorchain-mainnet-v1", t.THORChainStagenet = "thorchain-stagenet-v2", t))(R || {}), m = /* @__PURE__ */ ((t) => (t.Arbitrum = "https://arb1.arbitrum.io/rpc", t.Avalanche = "https://node-router.thorswap.net/avalanche-c", t.Binance = "", t.BinanceSmartChain = "https://bsc-dataseed.binance.org", t.Bitcoin = "https://node-router.thorswap.net/bitcoin", t.BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash", t.Cosmos = "https://node-router.thorswap.net/cosmos/rpc", t.Kujira = "https://rpc-kujira.synergynodes.com/", t.Dogecoin = "https://node-router.thorswap.net/dogecoin", t.Ethereum = "https://node-router.thorswap.net/ethereum", t.Litecoin = "https://node-router.thorswap.net/litecoin", t.Maya = "https://tendermint.mayachain.info", t.MayaStagenet = "https://stagenet.tendermint.mayachain.info", t.Optimism = "https://mainnet.optimism.io", t.Polygon = "https://polygon-rpc.com", t.THORChain = "https://rpc.thorswap.net", t.THORChainStagenet = "https://stagenet-rpc.ninerealms.com", t))(m || {});
|
|
13494
|
+
const c = Object.values(o), p = Object.keys(o), D = c.reduce(
|
|
13495
|
+
(t, a) => {
|
|
13496
|
+
const i = p.find((_) => o[_] === a);
|
|
13497
|
+
return i && (t[a] = i), t;
|
|
13498
|
+
},
|
|
13499
|
+
{}
|
|
13500
|
+
);
|
|
13501
|
+
c.reduce(
|
|
13502
|
+
(t, a) => (t[a] = R[D[a]], t),
|
|
13503
|
+
{}
|
|
13504
|
+
);
|
|
13505
|
+
c.reduce(
|
|
13506
|
+
(t, a) => (t[a] = m[D[a]], t),
|
|
13507
|
+
{}
|
|
13508
|
+
);
|
|
13509
|
+
c.reduce(
|
|
13510
|
+
(t, a) => {
|
|
13511
|
+
const i = `${D[a]}Hex`;
|
|
13512
|
+
return t[a] = R[i], t;
|
|
13513
|
+
},
|
|
13514
|
+
{}
|
|
13515
|
+
);
|
|
13516
|
+
var h = /* @__PURE__ */ ((t) => (t.KEYSTORE = "KEYSTORE", t.KEEPKEY = "KEEPKEY", t.XDEFI = "XDEFI", t.METAMASK = "METAMASK", t.COINBASE_WEB = "COINBASE_WEB", t.TREZOR = "TREZOR", t.TRUSTWALLET_WEB = "TRUSTWALLET_WEB", t.LEDGER = "LEDGER", t.KEPLR = "KEPLR", t.OKX = "OKX", t.BRAVE = "BRAVE", t.WALLETCONNECT = "WALLETCONNECT", t))(h || {});
|
|
13517
|
+
const L = (t) => async ({ from: a, recipient: i, amount: _, asset: I, memo: T }) => {
|
|
13518
|
+
var E;
|
|
13519
|
+
const A2 = (E = window.okxwallet) == null ? void 0 : E.keplr, S = A2 == null ? void 0 : A2.getOfflineSignerOnlyAmino(R.Cosmos);
|
|
13520
|
+
if (!S)
|
|
13521
|
+
throw new Error("No cosmos okxwallet found");
|
|
13522
|
+
const { createCosmJS: N } = await import("./index_37894947.js"), s = await N({ offlineSigner: S, rpcUrl: t }), e = [
|
|
13523
|
+
{ denom: (I == null ? void 0 : I.symbol) === "MUON" ? "umuon" : "uatom", amount: _.amount().toString() }
|
|
13524
|
+
], { transactionHash: r } = await s.sendTokens(a, i, e, 1.6, T);
|
|
13525
|
+
return r;
|
|
13526
|
+
}, w = async ({
|
|
13527
|
+
chain: t,
|
|
13528
|
+
ethplorerApiKey: a,
|
|
13529
|
+
covalentApiKey: i,
|
|
13530
|
+
utxoApiKey: _,
|
|
13531
|
+
rpcUrl: I,
|
|
13532
|
+
api: T
|
|
13533
|
+
}) => {
|
|
13534
|
+
var A$1, S, N;
|
|
13535
|
+
switch (t) {
|
|
13536
|
+
case o.Ethereum:
|
|
13537
|
+
case o.Avalanche:
|
|
13538
|
+
case o.BinanceSmartChain: {
|
|
13539
|
+
if (!((A$1 = window.okxwallet) != null && A$1.send))
|
|
13540
|
+
throw new Error("No okxwallet found");
|
|
13541
|
+
const { getWeb3WalletMethods: s, getProvider: e } = await import("./index_3a6b0cd3.js"), r = await s({
|
|
13542
|
+
chain: t,
|
|
13543
|
+
ethplorerApiKey: a,
|
|
13544
|
+
covalentApiKey: i,
|
|
13545
|
+
ethereumWindowProvider: window.okxwallet
|
|
13546
|
+
}), E = await window.okxwallet.send("eth_requestAccounts", []);
|
|
13547
|
+
return { ...r, getAddress: () => E, getBalance: async () => {
|
|
13548
|
+
const l = await r.getBalance(E), O = await e(t).getBalance(E);
|
|
13549
|
+
return [
|
|
13550
|
+
new A({
|
|
13551
|
+
chain: t,
|
|
13552
|
+
symbol: t,
|
|
13553
|
+
value: O.toString(),
|
|
13554
|
+
decimal: C[t]
|
|
13555
|
+
}),
|
|
13556
|
+
...l.slice(1)
|
|
13557
|
+
];
|
|
13558
|
+
} };
|
|
13559
|
+
}
|
|
13560
|
+
case o.Bitcoin: {
|
|
13561
|
+
if (!((S = window.okxwallet) != null && S.bitcoin))
|
|
13562
|
+
throw new Error("No bitcoin okxwallet found");
|
|
13563
|
+
if (!_)
|
|
13564
|
+
throw new Error("No utxoApiKey provided");
|
|
13565
|
+
const { BTCToolbox: s } = await import("./index_167c5f7a.js"), e = window.okxwallet.bitcoin, r = (await e.connect()).address, E = s({ rpcUrl: I, apiKey: _, apiClient: T }), d = async (O) => {
|
|
13566
|
+
const u = await e.signPsbt(O.toHex(), { from: r, type: "list" });
|
|
13567
|
+
return Psbt3.fromHex(u);
|
|
13568
|
+
};
|
|
13569
|
+
return { ...E, transfer: (O) => E.transfer({
|
|
13570
|
+
...O,
|
|
13571
|
+
signTransaction: d
|
|
13572
|
+
}), getAddress: () => r };
|
|
13573
|
+
}
|
|
13574
|
+
case o.Cosmos: {
|
|
13575
|
+
if (!((N = window.okxwallet) != null && N.keplr))
|
|
13576
|
+
throw new Error("No cosmos okxwallet found");
|
|
13577
|
+
const s = window.okxwallet.keplr;
|
|
13578
|
+
await s.enable(R.Cosmos);
|
|
13579
|
+
const [{ address: e }] = await s.getOfflineSignerOnlyAmino(R.Cosmos).getAccounts(), { GaiaToolbox: r } = await import("./index_37894947.js");
|
|
13580
|
+
return {
|
|
13581
|
+
...r({ server: T }),
|
|
13582
|
+
transfer: L(I),
|
|
13583
|
+
getAddress: () => e
|
|
13584
|
+
};
|
|
13585
|
+
}
|
|
13586
|
+
default:
|
|
13587
|
+
throw new Error(`No wallet for chain ${t}`);
|
|
13588
|
+
}
|
|
13589
|
+
};
|
|
13590
|
+
o.Avalanche, o.BinanceSmartChain, o.Bitcoin, o.Ethereum, o.Cosmos;
|
|
13591
|
+
const U = ({
|
|
13592
|
+
addChain: t,
|
|
13593
|
+
config: { covalentApiKey: a, ethplorerApiKey: i, utxoApiKey: _ }
|
|
13594
|
+
}) => async (I) => (await I.reduce(async (A2, S) => {
|
|
13595
|
+
await A2;
|
|
13596
|
+
const N = await w({
|
|
13597
|
+
chain: S,
|
|
13598
|
+
covalentApiKey: a,
|
|
13599
|
+
ethplorerApiKey: i,
|
|
13600
|
+
utxoApiKey: _
|
|
13601
|
+
}), s = await N.getAddress();
|
|
13602
|
+
t({
|
|
13603
|
+
chain: S,
|
|
13604
|
+
walletMethods: { ...N, getAddress: () => s },
|
|
13605
|
+
wallet: { address: s, balance: [], walletType: h.OKX }
|
|
13606
|
+
});
|
|
13607
|
+
}, Promise.resolve()), true), g = {
|
|
13608
|
+
connectMethodName: "connectOkx",
|
|
13609
|
+
connect: U
|
|
13610
|
+
};
|
|
13416
13611
|
export {
|
|
13417
|
-
|
|
13418
|
-
Transaction2 as T,
|
|
13419
|
-
bs58check$5 as b,
|
|
13420
|
-
crypto_1 as c,
|
|
13421
|
-
networks_1 as n,
|
|
13422
|
-
safeBufferExports as s
|
|
13612
|
+
g as okxWallet
|
|
13423
13613
|
};
|