@cetusprotocol/aggregator-sdk 0.1.2 → 0.2.1

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 CHANGED
@@ -87,8 +87,8 @@ var require_bn = __commonJS({
87
87
  ctor.prototype = new TempCtor();
88
88
  ctor.prototype.constructor = ctor;
89
89
  }
90
- function BN6(number, base, endian) {
91
- if (BN6.isBN(number)) {
90
+ function BN7(number, base, endian) {
91
+ if (BN7.isBN(number)) {
92
92
  return number;
93
93
  }
94
94
  this.negative = 0;
@@ -104,12 +104,12 @@ var require_bn = __commonJS({
104
104
  }
105
105
  }
106
106
  if (typeof module2 === "object") {
107
- module2.exports = BN6;
107
+ module2.exports = BN7;
108
108
  } else {
109
- exports2.BN = BN6;
109
+ exports2.BN = BN7;
110
110
  }
111
- BN6.BN = BN6;
112
- BN6.wordSize = 26;
111
+ BN7.BN = BN7;
112
+ BN7.wordSize = 26;
113
113
  var Buffer2;
114
114
  try {
115
115
  if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") {
@@ -119,21 +119,21 @@ var require_bn = __commonJS({
119
119
  }
120
120
  } catch (e) {
121
121
  }
122
- BN6.isBN = function isBN(num) {
123
- if (num instanceof BN6) {
122
+ BN7.isBN = function isBN(num) {
123
+ if (num instanceof BN7) {
124
124
  return true;
125
125
  }
126
- return num !== null && typeof num === "object" && num.constructor.wordSize === BN6.wordSize && Array.isArray(num.words);
126
+ return num !== null && typeof num === "object" && num.constructor.wordSize === BN7.wordSize && Array.isArray(num.words);
127
127
  };
128
- BN6.max = function max2(left, right) {
128
+ BN7.max = function max2(left, right) {
129
129
  if (left.cmp(right) > 0) return left;
130
130
  return right;
131
131
  };
132
- BN6.min = function min2(left, right) {
132
+ BN7.min = function min2(left, right) {
133
133
  if (left.cmp(right) < 0) return left;
134
134
  return right;
135
135
  };
136
- BN6.prototype._init = function init(number, base, endian) {
136
+ BN7.prototype._init = function init(number, base, endian) {
137
137
  if (typeof number === "number") {
138
138
  return this._initNumber(number, base, endian);
139
139
  }
@@ -161,7 +161,7 @@ var require_bn = __commonJS({
161
161
  }
162
162
  }
163
163
  };
164
- BN6.prototype._initNumber = function _initNumber(number, base, endian) {
164
+ BN7.prototype._initNumber = function _initNumber(number, base, endian) {
165
165
  if (number < 0) {
166
166
  this.negative = 1;
167
167
  number = -number;
@@ -187,7 +187,7 @@ var require_bn = __commonJS({
187
187
  if (endian !== "le") return;
188
188
  this._initArray(this.toArray(), base, endian);
189
189
  };
190
- BN6.prototype._initArray = function _initArray(number, base, endian) {
190
+ BN7.prototype._initArray = function _initArray(number, base, endian) {
191
191
  assert(typeof number.length === "number");
192
192
  if (number.length <= 0) {
193
193
  this.words = [0];
@@ -245,7 +245,7 @@ var require_bn = __commonJS({
245
245
  }
246
246
  return r;
247
247
  }
248
- BN6.prototype._parseHex = function _parseHex(number, start, endian) {
248
+ BN7.prototype._parseHex = function _parseHex(number, start, endian) {
249
249
  this.length = Math.ceil((number.length - start) / 6);
250
250
  this.words = new Array(this.length);
251
251
  for (var i = 0; i < this.length; i++) {
@@ -301,7 +301,7 @@ var require_bn = __commonJS({
301
301
  }
302
302
  return r;
303
303
  }
304
- BN6.prototype._parseBase = function _parseBase(number, base, start) {
304
+ BN7.prototype._parseBase = function _parseBase(number, base, start) {
305
305
  this.words = [0];
306
306
  this.length = 1;
307
307
  for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) {
@@ -337,7 +337,7 @@ var require_bn = __commonJS({
337
337
  }
338
338
  this._strip();
339
339
  };
340
- BN6.prototype.copy = function copy(dest) {
340
+ BN7.prototype.copy = function copy(dest) {
341
341
  dest.words = new Array(this.length);
342
342
  for (var i = 0; i < this.length; i++) {
343
343
  dest.words[i] = this.words[i];
@@ -352,27 +352,27 @@ var require_bn = __commonJS({
352
352
  dest.negative = src.negative;
353
353
  dest.red = src.red;
354
354
  }
355
- BN6.prototype._move = function _move(dest) {
355
+ BN7.prototype._move = function _move(dest) {
356
356
  move(dest, this);
357
357
  };
358
- BN6.prototype.clone = function clone2() {
359
- var r = new BN6(null);
358
+ BN7.prototype.clone = function clone2() {
359
+ var r = new BN7(null);
360
360
  this.copy(r);
361
361
  return r;
362
362
  };
363
- BN6.prototype._expand = function _expand(size) {
363
+ BN7.prototype._expand = function _expand(size) {
364
364
  while (this.length < size) {
365
365
  this.words[this.length++] = 0;
366
366
  }
367
367
  return this;
368
368
  };
369
- BN6.prototype._strip = function strip() {
369
+ BN7.prototype._strip = function strip() {
370
370
  while (this.length > 1 && this.words[this.length - 1] === 0) {
371
371
  this.length--;
372
372
  }
373
373
  return this._normSign();
374
374
  };
375
- BN6.prototype._normSign = function _normSign() {
375
+ BN7.prototype._normSign = function _normSign() {
376
376
  if (this.length === 1 && this.words[0] === 0) {
377
377
  this.negative = 0;
378
378
  }
@@ -380,12 +380,12 @@ var require_bn = __commonJS({
380
380
  };
381
381
  if (typeof Symbol !== "undefined" && typeof Symbol.for === "function") {
382
382
  try {
383
- BN6.prototype[Symbol.for("nodejs.util.inspect.custom")] = inspect;
383
+ BN7.prototype[Symbol.for("nodejs.util.inspect.custom")] = inspect;
384
384
  } catch (e) {
385
- BN6.prototype.inspect = inspect;
385
+ BN7.prototype.inspect = inspect;
386
386
  }
387
387
  } else {
388
- BN6.prototype.inspect = inspect;
388
+ BN7.prototype.inspect = inspect;
389
389
  }
390
390
  function inspect() {
391
391
  return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
@@ -496,7 +496,7 @@ var require_bn = __commonJS({
496
496
  52521875,
497
497
  60466176
498
498
  ];
499
- BN6.prototype.toString = function toString(base, padding) {
499
+ BN7.prototype.toString = function toString(base, padding) {
500
500
  base = base || 10;
501
501
  padding = padding | 0 || 1;
502
502
  var out;
@@ -558,7 +558,7 @@ var require_bn = __commonJS({
558
558
  }
559
559
  assert(false, "Base should be between 2 and 36");
560
560
  };
561
- BN6.prototype.toNumber = function toNumber() {
561
+ BN7.prototype.toNumber = function toNumber() {
562
562
  var ret = this.words[0];
563
563
  if (this.length === 2) {
564
564
  ret += this.words[1] * 67108864;
@@ -569,15 +569,15 @@ var require_bn = __commonJS({
569
569
  }
570
570
  return this.negative !== 0 ? -ret : ret;
571
571
  };
572
- BN6.prototype.toJSON = function toJSON() {
572
+ BN7.prototype.toJSON = function toJSON() {
573
573
  return this.toString(16, 2);
574
574
  };
575
575
  if (Buffer2) {
576
- BN6.prototype.toBuffer = function toBuffer(endian, length) {
576
+ BN7.prototype.toBuffer = function toBuffer(endian, length) {
577
577
  return this.toArrayLike(Buffer2, endian, length);
578
578
  };
579
579
  }
580
- BN6.prototype.toArray = function toArray(endian, length) {
580
+ BN7.prototype.toArray = function toArray(endian, length) {
581
581
  return this.toArrayLike(Array, endian, length);
582
582
  };
583
583
  var allocate = function allocate2(ArrayType, size) {
@@ -586,7 +586,7 @@ var require_bn = __commonJS({
586
586
  }
587
587
  return new ArrayType(size);
588
588
  };
589
- BN6.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) {
589
+ BN7.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) {
590
590
  this._strip();
591
591
  var byteLength = this.byteLength();
592
592
  var reqLength = length || Math.max(1, byteLength);
@@ -597,7 +597,7 @@ var require_bn = __commonJS({
597
597
  this["_toArrayLike" + postfix](res, byteLength);
598
598
  return res;
599
599
  };
600
- BN6.prototype._toArrayLikeLE = function _toArrayLikeLE(res, byteLength) {
600
+ BN7.prototype._toArrayLikeLE = function _toArrayLikeLE(res, byteLength) {
601
601
  var position = 0;
602
602
  var carry = 0;
603
603
  for (var i = 0, shift = 0; i < this.length; i++) {
@@ -627,7 +627,7 @@ var require_bn = __commonJS({
627
627
  }
628
628
  }
629
629
  };
630
- BN6.prototype._toArrayLikeBE = function _toArrayLikeBE(res, byteLength) {
630
+ BN7.prototype._toArrayLikeBE = function _toArrayLikeBE(res, byteLength) {
631
631
  var position = res.length - 1;
632
632
  var carry = 0;
633
633
  for (var i = 0, shift = 0; i < this.length; i++) {
@@ -658,11 +658,11 @@ var require_bn = __commonJS({
658
658
  }
659
659
  };
660
660
  if (Math.clz32) {
661
- BN6.prototype._countBits = function _countBits(w) {
661
+ BN7.prototype._countBits = function _countBits(w) {
662
662
  return 32 - Math.clz32(w);
663
663
  };
664
664
  } else {
665
- BN6.prototype._countBits = function _countBits(w) {
665
+ BN7.prototype._countBits = function _countBits(w) {
666
666
  var t = w;
667
667
  var r = 0;
668
668
  if (t >= 4096) {
@@ -684,7 +684,7 @@ var require_bn = __commonJS({
684
684
  return r + t;
685
685
  };
686
686
  }
687
- BN6.prototype._zeroBits = function _zeroBits(w) {
687
+ BN7.prototype._zeroBits = function _zeroBits(w) {
688
688
  if (w === 0) return 26;
689
689
  var t = w;
690
690
  var r = 0;
@@ -709,7 +709,7 @@ var require_bn = __commonJS({
709
709
  }
710
710
  return r;
711
711
  };
712
- BN6.prototype.bitLength = function bitLength() {
712
+ BN7.prototype.bitLength = function bitLength() {
713
713
  var w = this.words[this.length - 1];
714
714
  var hi = this._countBits(w);
715
715
  return (this.length - 1) * 26 + hi;
@@ -723,7 +723,7 @@ var require_bn = __commonJS({
723
723
  }
724
724
  return w;
725
725
  }
726
- BN6.prototype.zeroBits = function zeroBits() {
726
+ BN7.prototype.zeroBits = function zeroBits() {
727
727
  if (this.isZero()) return 0;
728
728
  var r = 0;
729
729
  for (var i = 0; i < this.length; i++) {
@@ -733,34 +733,34 @@ var require_bn = __commonJS({
733
733
  }
734
734
  return r;
735
735
  };
736
- BN6.prototype.byteLength = function byteLength() {
736
+ BN7.prototype.byteLength = function byteLength() {
737
737
  return Math.ceil(this.bitLength() / 8);
738
738
  };
739
- BN6.prototype.toTwos = function toTwos(width) {
739
+ BN7.prototype.toTwos = function toTwos(width) {
740
740
  if (this.negative !== 0) {
741
741
  return this.abs().inotn(width).iaddn(1);
742
742
  }
743
743
  return this.clone();
744
744
  };
745
- BN6.prototype.fromTwos = function fromTwos(width) {
745
+ BN7.prototype.fromTwos = function fromTwos(width) {
746
746
  if (this.testn(width - 1)) {
747
747
  return this.notn(width).iaddn(1).ineg();
748
748
  }
749
749
  return this.clone();
750
750
  };
751
- BN6.prototype.isNeg = function isNeg() {
751
+ BN7.prototype.isNeg = function isNeg() {
752
752
  return this.negative !== 0;
753
753
  };
754
- BN6.prototype.neg = function neg() {
754
+ BN7.prototype.neg = function neg() {
755
755
  return this.clone().ineg();
756
756
  };
757
- BN6.prototype.ineg = function ineg() {
757
+ BN7.prototype.ineg = function ineg() {
758
758
  if (!this.isZero()) {
759
759
  this.negative ^= 1;
760
760
  }
761
761
  return this;
762
762
  };
763
- BN6.prototype.iuor = function iuor(num) {
763
+ BN7.prototype.iuor = function iuor(num) {
764
764
  while (this.length < num.length) {
765
765
  this.words[this.length++] = 0;
766
766
  }
@@ -769,19 +769,19 @@ var require_bn = __commonJS({
769
769
  }
770
770
  return this._strip();
771
771
  };
772
- BN6.prototype.ior = function ior(num) {
772
+ BN7.prototype.ior = function ior(num) {
773
773
  assert((this.negative | num.negative) === 0);
774
774
  return this.iuor(num);
775
775
  };
776
- BN6.prototype.or = function or(num) {
776
+ BN7.prototype.or = function or(num) {
777
777
  if (this.length > num.length) return this.clone().ior(num);
778
778
  return num.clone().ior(this);
779
779
  };
780
- BN6.prototype.uor = function uor(num) {
780
+ BN7.prototype.uor = function uor(num) {
781
781
  if (this.length > num.length) return this.clone().iuor(num);
782
782
  return num.clone().iuor(this);
783
783
  };
784
- BN6.prototype.iuand = function iuand(num) {
784
+ BN7.prototype.iuand = function iuand(num) {
785
785
  var b;
786
786
  if (this.length > num.length) {
787
787
  b = num;
@@ -794,19 +794,19 @@ var require_bn = __commonJS({
794
794
  this.length = b.length;
795
795
  return this._strip();
796
796
  };
797
- BN6.prototype.iand = function iand(num) {
797
+ BN7.prototype.iand = function iand(num) {
798
798
  assert((this.negative | num.negative) === 0);
799
799
  return this.iuand(num);
800
800
  };
801
- BN6.prototype.and = function and(num) {
801
+ BN7.prototype.and = function and(num) {
802
802
  if (this.length > num.length) return this.clone().iand(num);
803
803
  return num.clone().iand(this);
804
804
  };
805
- BN6.prototype.uand = function uand(num) {
805
+ BN7.prototype.uand = function uand(num) {
806
806
  if (this.length > num.length) return this.clone().iuand(num);
807
807
  return num.clone().iuand(this);
808
808
  };
809
- BN6.prototype.iuxor = function iuxor(num) {
809
+ BN7.prototype.iuxor = function iuxor(num) {
810
810
  var a;
811
811
  var b;
812
812
  if (this.length > num.length) {
@@ -827,19 +827,19 @@ var require_bn = __commonJS({
827
827
  this.length = a.length;
828
828
  return this._strip();
829
829
  };
830
- BN6.prototype.ixor = function ixor(num) {
830
+ BN7.prototype.ixor = function ixor(num) {
831
831
  assert((this.negative | num.negative) === 0);
832
832
  return this.iuxor(num);
833
833
  };
834
- BN6.prototype.xor = function xor(num) {
834
+ BN7.prototype.xor = function xor(num) {
835
835
  if (this.length > num.length) return this.clone().ixor(num);
836
836
  return num.clone().ixor(this);
837
837
  };
838
- BN6.prototype.uxor = function uxor(num) {
838
+ BN7.prototype.uxor = function uxor(num) {
839
839
  if (this.length > num.length) return this.clone().iuxor(num);
840
840
  return num.clone().iuxor(this);
841
841
  };
842
- BN6.prototype.inotn = function inotn(width) {
842
+ BN7.prototype.inotn = function inotn(width) {
843
843
  assert(typeof width === "number" && width >= 0);
844
844
  var bytesNeeded = Math.ceil(width / 26) | 0;
845
845
  var bitsLeft = width % 26;
@@ -855,10 +855,10 @@ var require_bn = __commonJS({
855
855
  }
856
856
  return this._strip();
857
857
  };
858
- BN6.prototype.notn = function notn(width) {
858
+ BN7.prototype.notn = function notn(width) {
859
859
  return this.clone().inotn(width);
860
860
  };
861
- BN6.prototype.setn = function setn(bit, val) {
861
+ BN7.prototype.setn = function setn(bit, val) {
862
862
  assert(typeof bit === "number" && bit >= 0);
863
863
  var off = bit / 26 | 0;
864
864
  var wbit = bit % 26;
@@ -870,7 +870,7 @@ var require_bn = __commonJS({
870
870
  }
871
871
  return this._strip();
872
872
  };
873
- BN6.prototype.iadd = function iadd(num) {
873
+ BN7.prototype.iadd = function iadd(num) {
874
874
  var r;
875
875
  if (this.negative !== 0 && num.negative === 0) {
876
876
  this.negative = 0;
@@ -913,7 +913,7 @@ var require_bn = __commonJS({
913
913
  }
914
914
  return this;
915
915
  };
916
- BN6.prototype.add = function add2(num) {
916
+ BN7.prototype.add = function add2(num) {
917
917
  var res;
918
918
  if (num.negative !== 0 && this.negative === 0) {
919
919
  num.negative = 0;
@@ -929,7 +929,7 @@ var require_bn = __commonJS({
929
929
  if (this.length > num.length) return this.clone().iadd(num);
930
930
  return num.clone().iadd(this);
931
931
  };
932
- BN6.prototype.isub = function isub(num) {
932
+ BN7.prototype.isub = function isub(num) {
933
933
  if (num.negative !== 0) {
934
934
  num.negative = 0;
935
935
  var r = this.iadd(num);
@@ -978,7 +978,7 @@ var require_bn = __commonJS({
978
978
  }
979
979
  return this._strip();
980
980
  };
981
- BN6.prototype.sub = function sub2(num) {
981
+ BN7.prototype.sub = function sub2(num) {
982
982
  return this.clone().isub(num);
983
983
  };
984
984
  function smallMulTo(self, num, out) {
@@ -1606,7 +1606,7 @@ var require_bn = __commonJS({
1606
1606
  function jumboMulTo(self, num, out) {
1607
1607
  return bigMulTo(self, num, out);
1608
1608
  }
1609
- BN6.prototype.mulTo = function mulTo(num, out) {
1609
+ BN7.prototype.mulTo = function mulTo(num, out) {
1610
1610
  var res;
1611
1611
  var len = this.length + num.length;
1612
1612
  if (this.length === 10 && num.length === 10) {
@@ -1620,20 +1620,20 @@ var require_bn = __commonJS({
1620
1620
  }
1621
1621
  return res;
1622
1622
  };
1623
- BN6.prototype.mul = function mul2(num) {
1624
- var out = new BN6(null);
1623
+ BN7.prototype.mul = function mul2(num) {
1624
+ var out = new BN7(null);
1625
1625
  out.words = new Array(this.length + num.length);
1626
1626
  return this.mulTo(num, out);
1627
1627
  };
1628
- BN6.prototype.mulf = function mulf(num) {
1629
- var out = new BN6(null);
1628
+ BN7.prototype.mulf = function mulf(num) {
1629
+ var out = new BN7(null);
1630
1630
  out.words = new Array(this.length + num.length);
1631
1631
  return jumboMulTo(this, num, out);
1632
1632
  };
1633
- BN6.prototype.imul = function imul(num) {
1633
+ BN7.prototype.imul = function imul(num) {
1634
1634
  return this.clone().mulTo(num, this);
1635
1635
  };
1636
- BN6.prototype.imuln = function imuln(num) {
1636
+ BN7.prototype.imuln = function imuln(num) {
1637
1637
  var isNegNum = num < 0;
1638
1638
  if (isNegNum) num = -num;
1639
1639
  assert(typeof num === "number");
@@ -1653,18 +1653,18 @@ var require_bn = __commonJS({
1653
1653
  }
1654
1654
  return isNegNum ? this.ineg() : this;
1655
1655
  };
1656
- BN6.prototype.muln = function muln(num) {
1656
+ BN7.prototype.muln = function muln(num) {
1657
1657
  return this.clone().imuln(num);
1658
1658
  };
1659
- BN6.prototype.sqr = function sqr() {
1659
+ BN7.prototype.sqr = function sqr() {
1660
1660
  return this.mul(this);
1661
1661
  };
1662
- BN6.prototype.isqr = function isqr() {
1662
+ BN7.prototype.isqr = function isqr() {
1663
1663
  return this.imul(this.clone());
1664
1664
  };
1665
- BN6.prototype.pow = function pow2(num) {
1665
+ BN7.prototype.pow = function pow2(num) {
1666
1666
  var w = toBitArray(num);
1667
- if (w.length === 0) return new BN6(1);
1667
+ if (w.length === 0) return new BN7(1);
1668
1668
  var res = this;
1669
1669
  for (var i = 0; i < w.length; i++, res = res.sqr()) {
1670
1670
  if (w[i] !== 0) break;
@@ -1677,7 +1677,7 @@ var require_bn = __commonJS({
1677
1677
  }
1678
1678
  return res;
1679
1679
  };
1680
- BN6.prototype.iushln = function iushln(bits) {
1680
+ BN7.prototype.iushln = function iushln(bits) {
1681
1681
  assert(typeof bits === "number" && bits >= 0);
1682
1682
  var r = bits % 26;
1683
1683
  var s = (bits - r) / 26;
@@ -1707,11 +1707,11 @@ var require_bn = __commonJS({
1707
1707
  }
1708
1708
  return this._strip();
1709
1709
  };
1710
- BN6.prototype.ishln = function ishln(bits) {
1710
+ BN7.prototype.ishln = function ishln(bits) {
1711
1711
  assert(this.negative === 0);
1712
1712
  return this.iushln(bits);
1713
1713
  };
1714
- BN6.prototype.iushrn = function iushrn(bits, hint, extended) {
1714
+ BN7.prototype.iushrn = function iushrn(bits, hint, extended) {
1715
1715
  assert(typeof bits === "number" && bits >= 0);
1716
1716
  var h;
1717
1717
  if (hint) {
@@ -1755,23 +1755,23 @@ var require_bn = __commonJS({
1755
1755
  }
1756
1756
  return this._strip();
1757
1757
  };
1758
- BN6.prototype.ishrn = function ishrn(bits, hint, extended) {
1758
+ BN7.prototype.ishrn = function ishrn(bits, hint, extended) {
1759
1759
  assert(this.negative === 0);
1760
1760
  return this.iushrn(bits, hint, extended);
1761
1761
  };
1762
- BN6.prototype.shln = function shln(bits) {
1762
+ BN7.prototype.shln = function shln(bits) {
1763
1763
  return this.clone().ishln(bits);
1764
1764
  };
1765
- BN6.prototype.ushln = function ushln(bits) {
1765
+ BN7.prototype.ushln = function ushln(bits) {
1766
1766
  return this.clone().iushln(bits);
1767
1767
  };
1768
- BN6.prototype.shrn = function shrn(bits) {
1768
+ BN7.prototype.shrn = function shrn(bits) {
1769
1769
  return this.clone().ishrn(bits);
1770
1770
  };
1771
- BN6.prototype.ushrn = function ushrn(bits) {
1771
+ BN7.prototype.ushrn = function ushrn(bits) {
1772
1772
  return this.clone().iushrn(bits);
1773
1773
  };
1774
- BN6.prototype.testn = function testn(bit) {
1774
+ BN7.prototype.testn = function testn(bit) {
1775
1775
  assert(typeof bit === "number" && bit >= 0);
1776
1776
  var r = bit % 26;
1777
1777
  var s = (bit - r) / 26;
@@ -1780,7 +1780,7 @@ var require_bn = __commonJS({
1780
1780
  var w = this.words[s];
1781
1781
  return !!(w & q);
1782
1782
  };
1783
- BN6.prototype.imaskn = function imaskn(bits) {
1783
+ BN7.prototype.imaskn = function imaskn(bits) {
1784
1784
  assert(typeof bits === "number" && bits >= 0);
1785
1785
  var r = bits % 26;
1786
1786
  var s = (bits - r) / 26;
@@ -1798,10 +1798,10 @@ var require_bn = __commonJS({
1798
1798
  }
1799
1799
  return this._strip();
1800
1800
  };
1801
- BN6.prototype.maskn = function maskn(bits) {
1801
+ BN7.prototype.maskn = function maskn(bits) {
1802
1802
  return this.clone().imaskn(bits);
1803
1803
  };
1804
- BN6.prototype.iaddn = function iaddn(num) {
1804
+ BN7.prototype.iaddn = function iaddn(num) {
1805
1805
  assert(typeof num === "number");
1806
1806
  assert(num < 67108864);
1807
1807
  if (num < 0) return this.isubn(-num);
@@ -1818,7 +1818,7 @@ var require_bn = __commonJS({
1818
1818
  }
1819
1819
  return this._iaddn(num);
1820
1820
  };
1821
- BN6.prototype._iaddn = function _iaddn(num) {
1821
+ BN7.prototype._iaddn = function _iaddn(num) {
1822
1822
  this.words[0] += num;
1823
1823
  for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) {
1824
1824
  this.words[i] -= 67108864;
@@ -1831,7 +1831,7 @@ var require_bn = __commonJS({
1831
1831
  this.length = Math.max(this.length, i + 1);
1832
1832
  return this;
1833
1833
  };
1834
- BN6.prototype.isubn = function isubn(num) {
1834
+ BN7.prototype.isubn = function isubn(num) {
1835
1835
  assert(typeof num === "number");
1836
1836
  assert(num < 67108864);
1837
1837
  if (num < 0) return this.iaddn(-num);
@@ -1853,20 +1853,20 @@ var require_bn = __commonJS({
1853
1853
  }
1854
1854
  return this._strip();
1855
1855
  };
1856
- BN6.prototype.addn = function addn(num) {
1856
+ BN7.prototype.addn = function addn(num) {
1857
1857
  return this.clone().iaddn(num);
1858
1858
  };
1859
- BN6.prototype.subn = function subn(num) {
1859
+ BN7.prototype.subn = function subn(num) {
1860
1860
  return this.clone().isubn(num);
1861
1861
  };
1862
- BN6.prototype.iabs = function iabs() {
1862
+ BN7.prototype.iabs = function iabs() {
1863
1863
  this.negative = 0;
1864
1864
  return this;
1865
1865
  };
1866
- BN6.prototype.abs = function abs2() {
1866
+ BN7.prototype.abs = function abs2() {
1867
1867
  return this.clone().iabs();
1868
1868
  };
1869
- BN6.prototype._ishlnsubmul = function _ishlnsubmul(num, mul2, shift) {
1869
+ BN7.prototype._ishlnsubmul = function _ishlnsubmul(num, mul2, shift) {
1870
1870
  var len = num.length + shift;
1871
1871
  var i;
1872
1872
  this._expand(len);
@@ -1895,7 +1895,7 @@ var require_bn = __commonJS({
1895
1895
  this.negative = 1;
1896
1896
  return this._strip();
1897
1897
  };
1898
- BN6.prototype._wordDiv = function _wordDiv(num, mode) {
1898
+ BN7.prototype._wordDiv = function _wordDiv(num, mode) {
1899
1899
  var shift = this.length - num.length;
1900
1900
  var a = this.clone();
1901
1901
  var b = num;
@@ -1910,7 +1910,7 @@ var require_bn = __commonJS({
1910
1910
  var m = a.length - b.length;
1911
1911
  var q;
1912
1912
  if (mode !== "mod") {
1913
- q = new BN6(null);
1913
+ q = new BN7(null);
1914
1914
  q.length = m + 1;
1915
1915
  q.words = new Array(q.length);
1916
1916
  for (var i = 0; i < q.length; i++) {
@@ -1952,12 +1952,12 @@ var require_bn = __commonJS({
1952
1952
  mod: a
1953
1953
  };
1954
1954
  };
1955
- BN6.prototype.divmod = function divmod(num, mode, positive) {
1955
+ BN7.prototype.divmod = function divmod(num, mode, positive) {
1956
1956
  assert(!num.isZero());
1957
1957
  if (this.isZero()) {
1958
1958
  return {
1959
- div: new BN6(0),
1960
- mod: new BN6(0)
1959
+ div: new BN7(0),
1960
+ mod: new BN7(0)
1961
1961
  };
1962
1962
  }
1963
1963
  var div2, mod2, res;
@@ -2002,7 +2002,7 @@ var require_bn = __commonJS({
2002
2002
  }
2003
2003
  if (num.length > this.length || this.cmp(num) < 0) {
2004
2004
  return {
2005
- div: new BN6(0),
2005
+ div: new BN7(0),
2006
2006
  mod: this
2007
2007
  };
2008
2008
  }
@@ -2016,26 +2016,26 @@ var require_bn = __commonJS({
2016
2016
  if (mode === "mod") {
2017
2017
  return {
2018
2018
  div: null,
2019
- mod: new BN6(this.modrn(num.words[0]))
2019
+ mod: new BN7(this.modrn(num.words[0]))
2020
2020
  };
2021
2021
  }
2022
2022
  return {
2023
2023
  div: this.divn(num.words[0]),
2024
- mod: new BN6(this.modrn(num.words[0]))
2024
+ mod: new BN7(this.modrn(num.words[0]))
2025
2025
  };
2026
2026
  }
2027
2027
  return this._wordDiv(num, mode);
2028
2028
  };
2029
- BN6.prototype.div = function div2(num) {
2029
+ BN7.prototype.div = function div2(num) {
2030
2030
  return this.divmod(num, "div", false).div;
2031
2031
  };
2032
- BN6.prototype.mod = function mod2(num) {
2032
+ BN7.prototype.mod = function mod2(num) {
2033
2033
  return this.divmod(num, "mod", false).mod;
2034
2034
  };
2035
- BN6.prototype.umod = function umod(num) {
2035
+ BN7.prototype.umod = function umod(num) {
2036
2036
  return this.divmod(num, "mod", true).mod;
2037
2037
  };
2038
- BN6.prototype.divRound = function divRound(num) {
2038
+ BN7.prototype.divRound = function divRound(num) {
2039
2039
  var dm = this.divmod(num);
2040
2040
  if (dm.mod.isZero()) return dm.div;
2041
2041
  var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
@@ -2045,7 +2045,7 @@ var require_bn = __commonJS({
2045
2045
  if (cmp2 < 0 || r2 === 1 && cmp2 === 0) return dm.div;
2046
2046
  return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
2047
2047
  };
2048
- BN6.prototype.modrn = function modrn(num) {
2048
+ BN7.prototype.modrn = function modrn(num) {
2049
2049
  var isNegNum = num < 0;
2050
2050
  if (isNegNum) num = -num;
2051
2051
  assert(num <= 67108863);
@@ -2056,10 +2056,10 @@ var require_bn = __commonJS({
2056
2056
  }
2057
2057
  return isNegNum ? -acc : acc;
2058
2058
  };
2059
- BN6.prototype.modn = function modn(num) {
2059
+ BN7.prototype.modn = function modn(num) {
2060
2060
  return this.modrn(num);
2061
2061
  };
2062
- BN6.prototype.idivn = function idivn(num) {
2062
+ BN7.prototype.idivn = function idivn(num) {
2063
2063
  var isNegNum = num < 0;
2064
2064
  if (isNegNum) num = -num;
2065
2065
  assert(num <= 67108863);
@@ -2072,10 +2072,10 @@ var require_bn = __commonJS({
2072
2072
  this._strip();
2073
2073
  return isNegNum ? this.ineg() : this;
2074
2074
  };
2075
- BN6.prototype.divn = function divn(num) {
2075
+ BN7.prototype.divn = function divn(num) {
2076
2076
  return this.clone().idivn(num);
2077
2077
  };
2078
- BN6.prototype.egcd = function egcd(p) {
2078
+ BN7.prototype.egcd = function egcd(p) {
2079
2079
  assert(p.negative === 0);
2080
2080
  assert(!p.isZero());
2081
2081
  var x = this;
@@ -2085,10 +2085,10 @@ var require_bn = __commonJS({
2085
2085
  } else {
2086
2086
  x = x.clone();
2087
2087
  }
2088
- var A = new BN6(1);
2089
- var B = new BN6(0);
2090
- var C = new BN6(0);
2091
- var D = new BN6(1);
2088
+ var A = new BN7(1);
2089
+ var B = new BN7(0);
2090
+ var C = new BN7(0);
2091
+ var D = new BN7(1);
2092
2092
  var g = 0;
2093
2093
  while (x.isEven() && y.isEven()) {
2094
2094
  x.iushrn(1);
@@ -2138,7 +2138,7 @@ var require_bn = __commonJS({
2138
2138
  gcd: y.iushln(g)
2139
2139
  };
2140
2140
  };
2141
- BN6.prototype._invmp = function _invmp(p) {
2141
+ BN7.prototype._invmp = function _invmp(p) {
2142
2142
  assert(p.negative === 0);
2143
2143
  assert(!p.isZero());
2144
2144
  var a = this;
@@ -2148,8 +2148,8 @@ var require_bn = __commonJS({
2148
2148
  } else {
2149
2149
  a = a.clone();
2150
2150
  }
2151
- var x1 = new BN6(1);
2152
- var x2 = new BN6(0);
2151
+ var x1 = new BN7(1);
2152
+ var x2 = new BN7(0);
2153
2153
  var delta = b.clone();
2154
2154
  while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
2155
2155
  for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1) ;
@@ -2191,7 +2191,7 @@ var require_bn = __commonJS({
2191
2191
  }
2192
2192
  return res;
2193
2193
  };
2194
- BN6.prototype.gcd = function gcd(num) {
2194
+ BN7.prototype.gcd = function gcd(num) {
2195
2195
  if (this.isZero()) return num.abs();
2196
2196
  if (num.isZero()) return this.abs();
2197
2197
  var a = this.clone();
@@ -2221,19 +2221,19 @@ var require_bn = __commonJS({
2221
2221
  } while (true);
2222
2222
  return b.iushln(shift);
2223
2223
  };
2224
- BN6.prototype.invm = function invm(num) {
2224
+ BN7.prototype.invm = function invm(num) {
2225
2225
  return this.egcd(num).a.umod(num);
2226
2226
  };
2227
- BN6.prototype.isEven = function isEven() {
2227
+ BN7.prototype.isEven = function isEven() {
2228
2228
  return (this.words[0] & 1) === 0;
2229
2229
  };
2230
- BN6.prototype.isOdd = function isOdd2() {
2230
+ BN7.prototype.isOdd = function isOdd2() {
2231
2231
  return (this.words[0] & 1) === 1;
2232
2232
  };
2233
- BN6.prototype.andln = function andln(num) {
2233
+ BN7.prototype.andln = function andln(num) {
2234
2234
  return this.words[0] & num;
2235
2235
  };
2236
- BN6.prototype.bincn = function bincn(bit) {
2236
+ BN7.prototype.bincn = function bincn(bit) {
2237
2237
  assert(typeof bit === "number");
2238
2238
  var r = bit % 26;
2239
2239
  var s = (bit - r) / 26;
@@ -2257,10 +2257,10 @@ var require_bn = __commonJS({
2257
2257
  }
2258
2258
  return this;
2259
2259
  };
2260
- BN6.prototype.isZero = function isZero() {
2260
+ BN7.prototype.isZero = function isZero() {
2261
2261
  return this.length === 1 && this.words[0] === 0;
2262
2262
  };
2263
- BN6.prototype.cmpn = function cmpn(num) {
2263
+ BN7.prototype.cmpn = function cmpn(num) {
2264
2264
  var negative = num < 0;
2265
2265
  if (this.negative !== 0 && !negative) return -1;
2266
2266
  if (this.negative === 0 && negative) return 1;
@@ -2279,14 +2279,14 @@ var require_bn = __commonJS({
2279
2279
  if (this.negative !== 0) return -res | 0;
2280
2280
  return res;
2281
2281
  };
2282
- BN6.prototype.cmp = function cmp2(num) {
2282
+ BN7.prototype.cmp = function cmp2(num) {
2283
2283
  if (this.negative !== 0 && num.negative === 0) return -1;
2284
2284
  if (this.negative === 0 && num.negative !== 0) return 1;
2285
2285
  var res = this.ucmp(num);
2286
2286
  if (this.negative !== 0) return -res | 0;
2287
2287
  return res;
2288
2288
  };
2289
- BN6.prototype.ucmp = function ucmp(num) {
2289
+ BN7.prototype.ucmp = function ucmp(num) {
2290
2290
  if (this.length > num.length) return 1;
2291
2291
  if (this.length < num.length) return -1;
2292
2292
  var res = 0;
@@ -2303,112 +2303,112 @@ var require_bn = __commonJS({
2303
2303
  }
2304
2304
  return res;
2305
2305
  };
2306
- BN6.prototype.gtn = function gtn(num) {
2306
+ BN7.prototype.gtn = function gtn(num) {
2307
2307
  return this.cmpn(num) === 1;
2308
2308
  };
2309
- BN6.prototype.gt = function gt(num) {
2309
+ BN7.prototype.gt = function gt(num) {
2310
2310
  return this.cmp(num) === 1;
2311
2311
  };
2312
- BN6.prototype.gten = function gten(num) {
2312
+ BN7.prototype.gten = function gten(num) {
2313
2313
  return this.cmpn(num) >= 0;
2314
2314
  };
2315
- BN6.prototype.gte = function gte(num) {
2315
+ BN7.prototype.gte = function gte(num) {
2316
2316
  return this.cmp(num) >= 0;
2317
2317
  };
2318
- BN6.prototype.ltn = function ltn(num) {
2318
+ BN7.prototype.ltn = function ltn(num) {
2319
2319
  return this.cmpn(num) === -1;
2320
2320
  };
2321
- BN6.prototype.lt = function lt(num) {
2321
+ BN7.prototype.lt = function lt(num) {
2322
2322
  return this.cmp(num) === -1;
2323
2323
  };
2324
- BN6.prototype.lten = function lten(num) {
2324
+ BN7.prototype.lten = function lten(num) {
2325
2325
  return this.cmpn(num) <= 0;
2326
2326
  };
2327
- BN6.prototype.lte = function lte(num) {
2327
+ BN7.prototype.lte = function lte(num) {
2328
2328
  return this.cmp(num) <= 0;
2329
2329
  };
2330
- BN6.prototype.eqn = function eqn(num) {
2330
+ BN7.prototype.eqn = function eqn(num) {
2331
2331
  return this.cmpn(num) === 0;
2332
2332
  };
2333
- BN6.prototype.eq = function eq(num) {
2333
+ BN7.prototype.eq = function eq(num) {
2334
2334
  return this.cmp(num) === 0;
2335
2335
  };
2336
- BN6.red = function red(num) {
2336
+ BN7.red = function red(num) {
2337
2337
  return new Red(num);
2338
2338
  };
2339
- BN6.prototype.toRed = function toRed(ctx) {
2339
+ BN7.prototype.toRed = function toRed(ctx) {
2340
2340
  assert(!this.red, "Already a number in reduction context");
2341
2341
  assert(this.negative === 0, "red works only with positives");
2342
2342
  return ctx.convertTo(this)._forceRed(ctx);
2343
2343
  };
2344
- BN6.prototype.fromRed = function fromRed() {
2344
+ BN7.prototype.fromRed = function fromRed() {
2345
2345
  assert(this.red, "fromRed works only with numbers in reduction context");
2346
2346
  return this.red.convertFrom(this);
2347
2347
  };
2348
- BN6.prototype._forceRed = function _forceRed(ctx) {
2348
+ BN7.prototype._forceRed = function _forceRed(ctx) {
2349
2349
  this.red = ctx;
2350
2350
  return this;
2351
2351
  };
2352
- BN6.prototype.forceRed = function forceRed(ctx) {
2352
+ BN7.prototype.forceRed = function forceRed(ctx) {
2353
2353
  assert(!this.red, "Already a number in reduction context");
2354
2354
  return this._forceRed(ctx);
2355
2355
  };
2356
- BN6.prototype.redAdd = function redAdd(num) {
2356
+ BN7.prototype.redAdd = function redAdd(num) {
2357
2357
  assert(this.red, "redAdd works only with red numbers");
2358
2358
  return this.red.add(this, num);
2359
2359
  };
2360
- BN6.prototype.redIAdd = function redIAdd(num) {
2360
+ BN7.prototype.redIAdd = function redIAdd(num) {
2361
2361
  assert(this.red, "redIAdd works only with red numbers");
2362
2362
  return this.red.iadd(this, num);
2363
2363
  };
2364
- BN6.prototype.redSub = function redSub(num) {
2364
+ BN7.prototype.redSub = function redSub(num) {
2365
2365
  assert(this.red, "redSub works only with red numbers");
2366
2366
  return this.red.sub(this, num);
2367
2367
  };
2368
- BN6.prototype.redISub = function redISub(num) {
2368
+ BN7.prototype.redISub = function redISub(num) {
2369
2369
  assert(this.red, "redISub works only with red numbers");
2370
2370
  return this.red.isub(this, num);
2371
2371
  };
2372
- BN6.prototype.redShl = function redShl(num) {
2372
+ BN7.prototype.redShl = function redShl(num) {
2373
2373
  assert(this.red, "redShl works only with red numbers");
2374
2374
  return this.red.shl(this, num);
2375
2375
  };
2376
- BN6.prototype.redMul = function redMul(num) {
2376
+ BN7.prototype.redMul = function redMul(num) {
2377
2377
  assert(this.red, "redMul works only with red numbers");
2378
2378
  this.red._verify2(this, num);
2379
2379
  return this.red.mul(this, num);
2380
2380
  };
2381
- BN6.prototype.redIMul = function redIMul(num) {
2381
+ BN7.prototype.redIMul = function redIMul(num) {
2382
2382
  assert(this.red, "redMul works only with red numbers");
2383
2383
  this.red._verify2(this, num);
2384
2384
  return this.red.imul(this, num);
2385
2385
  };
2386
- BN6.prototype.redSqr = function redSqr() {
2386
+ BN7.prototype.redSqr = function redSqr() {
2387
2387
  assert(this.red, "redSqr works only with red numbers");
2388
2388
  this.red._verify1(this);
2389
2389
  return this.red.sqr(this);
2390
2390
  };
2391
- BN6.prototype.redISqr = function redISqr() {
2391
+ BN7.prototype.redISqr = function redISqr() {
2392
2392
  assert(this.red, "redISqr works only with red numbers");
2393
2393
  this.red._verify1(this);
2394
2394
  return this.red.isqr(this);
2395
2395
  };
2396
- BN6.prototype.redSqrt = function redSqrt() {
2396
+ BN7.prototype.redSqrt = function redSqrt() {
2397
2397
  assert(this.red, "redSqrt works only with red numbers");
2398
2398
  this.red._verify1(this);
2399
2399
  return this.red.sqrt(this);
2400
2400
  };
2401
- BN6.prototype.redInvm = function redInvm() {
2401
+ BN7.prototype.redInvm = function redInvm() {
2402
2402
  assert(this.red, "redInvm works only with red numbers");
2403
2403
  this.red._verify1(this);
2404
2404
  return this.red.invm(this);
2405
2405
  };
2406
- BN6.prototype.redNeg = function redNeg() {
2406
+ BN7.prototype.redNeg = function redNeg() {
2407
2407
  assert(this.red, "redNeg works only with red numbers");
2408
2408
  this.red._verify1(this);
2409
2409
  return this.red.neg(this);
2410
2410
  };
2411
- BN6.prototype.redPow = function redPow(num) {
2411
+ BN7.prototype.redPow = function redPow(num) {
2412
2412
  assert(this.red && !num.red, "redPow(normalNum)");
2413
2413
  this.red._verify1(this);
2414
2414
  return this.red.pow(this, num);
@@ -2421,13 +2421,13 @@ var require_bn = __commonJS({
2421
2421
  };
2422
2422
  function MPrime(name, p) {
2423
2423
  this.name = name;
2424
- this.p = new BN6(p, 16);
2424
+ this.p = new BN7(p, 16);
2425
2425
  this.n = this.p.bitLength();
2426
- this.k = new BN6(1).iushln(this.n).isub(this.p);
2426
+ this.k = new BN7(1).iushln(this.n).isub(this.p);
2427
2427
  this.tmp = this._tmp();
2428
2428
  }
2429
2429
  MPrime.prototype._tmp = function _tmp() {
2430
- var tmp = new BN6(null);
2430
+ var tmp = new BN7(null);
2431
2431
  tmp.words = new Array(Math.ceil(this.n / 13));
2432
2432
  return tmp;
2433
2433
  };
@@ -2553,7 +2553,7 @@ var require_bn = __commonJS({
2553
2553
  }
2554
2554
  return num;
2555
2555
  };
2556
- BN6._prime = function prime(name) {
2556
+ BN7._prime = function prime(name) {
2557
2557
  if (primes[name]) return primes[name];
2558
2558
  var prime2;
2559
2559
  if (name === "k256") {
@@ -2572,7 +2572,7 @@ var require_bn = __commonJS({
2572
2572
  };
2573
2573
  function Red(m) {
2574
2574
  if (typeof m === "string") {
2575
- var prime = BN6._prime(m);
2575
+ var prime = BN7._prime(m);
2576
2576
  this.m = prime.p;
2577
2577
  this.prime = prime;
2578
2578
  } else {
@@ -2658,7 +2658,7 @@ var require_bn = __commonJS({
2658
2658
  var mod3 = this.m.andln(3);
2659
2659
  assert(mod3 % 2 === 1);
2660
2660
  if (mod3 === 3) {
2661
- var pow2 = this.m.add(new BN6(1)).iushrn(2);
2661
+ var pow2 = this.m.add(new BN7(1)).iushrn(2);
2662
2662
  return this.pow(a, pow2);
2663
2663
  }
2664
2664
  var q = this.m.subn(1);
@@ -2668,11 +2668,11 @@ var require_bn = __commonJS({
2668
2668
  q.iushrn(1);
2669
2669
  }
2670
2670
  assert(!q.isZero());
2671
- var one = new BN6(1).toRed(this);
2671
+ var one = new BN7(1).toRed(this);
2672
2672
  var nOne = one.redNeg();
2673
2673
  var lpow = this.m.subn(1).iushrn(1);
2674
2674
  var z = this.m.bitLength();
2675
- z = new BN6(2 * z * z).toRed(this);
2675
+ z = new BN7(2 * z * z).toRed(this);
2676
2676
  while (this.pow(z, lpow).cmp(nOne) !== 0) {
2677
2677
  z.redIAdd(nOne);
2678
2678
  }
@@ -2686,7 +2686,7 @@ var require_bn = __commonJS({
2686
2686
  tmp = tmp.redSqr();
2687
2687
  }
2688
2688
  assert(i < m);
2689
- var b = this.pow(c, new BN6(1).iushln(m - i - 1));
2689
+ var b = this.pow(c, new BN7(1).iushln(m - i - 1));
2690
2690
  r = r.redMul(b);
2691
2691
  c = b.redSqr();
2692
2692
  t = t.redMul(c);
@@ -2704,11 +2704,11 @@ var require_bn = __commonJS({
2704
2704
  }
2705
2705
  };
2706
2706
  Red.prototype.pow = function pow2(a, num) {
2707
- if (num.isZero()) return new BN6(1).toRed(this);
2707
+ if (num.isZero()) return new BN7(1).toRed(this);
2708
2708
  if (num.cmpn(1) === 0) return a.clone();
2709
2709
  var windowSize = 4;
2710
2710
  var wnd = new Array(1 << windowSize);
2711
- wnd[0] = new BN6(1).toRed(this);
2711
+ wnd[0] = new BN7(1).toRed(this);
2712
2712
  wnd[1] = a;
2713
2713
  for (var i = 2; i < wnd.length; i++) {
2714
2714
  wnd[i] = this.mul(wnd[i - 1], a);
@@ -2752,7 +2752,7 @@ var require_bn = __commonJS({
2752
2752
  res.red = null;
2753
2753
  return res;
2754
2754
  };
2755
- BN6.mont = function mont(num) {
2755
+ BN7.mont = function mont(num) {
2756
2756
  return new Mont(num);
2757
2757
  };
2758
2758
  function Mont(m) {
@@ -2761,7 +2761,7 @@ var require_bn = __commonJS({
2761
2761
  if (this.shift % 26 !== 0) {
2762
2762
  this.shift += 26 - this.shift % 26;
2763
2763
  }
2764
- this.r = new BN6(1).iushln(this.shift);
2764
+ this.r = new BN7(1).iushln(this.shift);
2765
2765
  this.r2 = this.imod(this.r.sqr());
2766
2766
  this.rinv = this.r._invmp(this.m);
2767
2767
  this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
@@ -2795,7 +2795,7 @@ var require_bn = __commonJS({
2795
2795
  return res._forceRed(this);
2796
2796
  };
2797
2797
  Mont.prototype.mul = function mul2(a, b) {
2798
- if (a.isZero() || b.isZero()) return new BN6(0)._forceRed(this);
2798
+ if (a.isZero() || b.isZero()) return new BN7(0)._forceRed(this);
2799
2799
  var t = a.mul(b);
2800
2800
  var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
2801
2801
  var u = t.isub(c).iushrn(this.shift);
@@ -5857,7 +5857,6 @@ var Haedal = class {
5857
5857
  throw new Error("Haedal not support b2a swap");
5858
5858
  }
5859
5859
  const func = "swap_a2b";
5860
- console.log("haedal path id", path.id);
5861
5860
  const args = [txb.object(path.id), txb.object("0x5"), inputCoin];
5862
5861
  const res = txb.moveCall({
5863
5862
  target: `${client.publishedAt()}::haedal::${func}`,
@@ -5937,18 +5936,49 @@ var Volo = class {
5937
5936
  }
5938
5937
  };
5939
5938
 
5939
+ // src/transaction/flowx_v3.ts
5940
+ var FlowxV3 = class {
5941
+ constructor(env) {
5942
+ if (env !== 0 /* Mainnet */) {
5943
+ throw new Error("Flowx clmm only supported on mainnet");
5944
+ }
5945
+ this.versioned = "0x67624a1533b5aff5d0dfcf5e598684350efd38134d2d245f475524c03a64e656";
5946
+ this.poolRegistry = "0x27565d24a4cd51127ac90e4074a841bbe356cca7bf5759ddc14a975be1632abc";
5947
+ }
5948
+ swap(client, txb, path, inputCoin) {
5949
+ return __async(this, null, function* () {
5950
+ const { direction, from, target } = path;
5951
+ const [func, coinAType, coinBType] = direction ? ["swap_a2b", from, target] : ["swap_b2a", target, from];
5952
+ const args = [
5953
+ txb.object(this.poolRegistry),
5954
+ txb.pure.u64(path.feeRate * 1e6),
5955
+ inputCoin,
5956
+ txb.object(this.versioned),
5957
+ txb.object(CLOCK_ADDRESS)
5958
+ ];
5959
+ const res = txb.moveCall({
5960
+ target: `${client.publishedAt()}::flowx_clmm::${func}`,
5961
+ typeArguments: [coinAType, coinBType],
5962
+ arguments: args
5963
+ });
5964
+ return res;
5965
+ });
5966
+ }
5967
+ };
5968
+
5940
5969
  // src/client.ts
5941
5970
  var CETUS = "CETUS";
5942
5971
  var DEEPBOOKV2 = "DEEPBOOK";
5943
5972
  var KRIYA = "KRIYA";
5944
5973
  var FLOWXV2 = "FLOWX";
5974
+ var FLOWXV3 = "FLOWXV3";
5945
5975
  var KRIYAV3 = "KRIYAV3";
5946
5976
  var TURBOS = "TURBOS";
5947
5977
  var AFTERMATH = "AFTERMATH";
5948
5978
  var HAEDAL = "HAEDAL";
5949
5979
  var VOLO = "VOLO";
5950
5980
  var AFSUI = "AFSUI";
5951
- var AggregatorClient5 = class {
5981
+ var AggregatorClient6 = class {
5952
5982
  constructor(endpoint, signer, client, env) {
5953
5983
  this.endpoint = endpoint;
5954
5984
  this.client = client;
@@ -6227,6 +6257,8 @@ var AggregatorClient5 = class {
6227
6257
  return new KriyaV3(this.env);
6228
6258
  case FLOWXV2:
6229
6259
  return new FlowxV2(this.env);
6260
+ case FLOWXV3:
6261
+ return new FlowxV3(this.env);
6230
6262
  case TURBOS:
6231
6263
  return new Turbos(this.env);
6232
6264
  case AFTERMATH:
@@ -6319,6 +6351,31 @@ function parseRouterResponse(data) {
6319
6351
  // src/transaction/index.ts
6320
6352
  var CLOCK_ADDRESS = "0x0000000000000000000000000000000000000000000000000000000000000006";
6321
6353
 
6354
+ // src/utils/msafe.ts
6355
+ var import_bn6 = __toESM(require_bn());
6356
+ var dealWithFastRouterSwapParamsForMsafe = (data) => {
6357
+ const result = data.map((route) => {
6358
+ return __spreadProps(__spreadValues({}, route), {
6359
+ amountIn: route.amountIn.toString(),
6360
+ amountOut: route.amountOut.toString(),
6361
+ initialPrice: route.initialPrice.toString(),
6362
+ path: route.path
6363
+ });
6364
+ });
6365
+ return result;
6366
+ };
6367
+ var restituteMsafeFastRouterSwapParams = (data) => {
6368
+ const result = data.map((route) => {
6369
+ return __spreadProps(__spreadValues({}, route), {
6370
+ amountIn: new import_bn6.default(route.amountIn),
6371
+ amountOut: new import_bn6.default(route.amountOut),
6372
+ initialPrice: new decimal_default(route.initialPrice.toString()),
6373
+ path: route.path
6374
+ });
6375
+ });
6376
+ return result;
6377
+ };
6378
+
6322
6379
  // src/api.ts
6323
6380
  function getRouterResult(endpoint, params) {
6324
6381
  return __async(this, null, function* () {
@@ -6409,12 +6466,13 @@ decimal.js/decimal.mjs:
6409
6466
 
6410
6467
  exports.AFSUI = AFSUI;
6411
6468
  exports.AFTERMATH = AFTERMATH;
6412
- exports.AggregatorClient = AggregatorClient5;
6469
+ exports.AggregatorClient = AggregatorClient6;
6413
6470
  exports.CETUS = CETUS;
6414
6471
  exports.CLOCK_ADDRESS = CLOCK_ADDRESS;
6415
6472
  exports.DEEPBOOKV2 = DEEPBOOKV2;
6416
6473
  exports.Env = Env;
6417
6474
  exports.FLOWXV2 = FLOWXV2;
6475
+ exports.FLOWXV3 = FLOWXV3;
6418
6476
  exports.HAEDAL = HAEDAL;
6419
6477
  exports.KRIYA = KRIYA;
6420
6478
  exports.KRIYAV3 = KRIYAV3;
@@ -6429,6 +6487,7 @@ exports.VOLO = VOLO;
6429
6487
  exports.ZERO = ZERO;
6430
6488
  exports.composeType = composeType;
6431
6489
  exports.createTarget = createTarget;
6490
+ exports.dealWithFastRouterSwapParamsForMsafe = dealWithFastRouterSwapParamsForMsafe;
6432
6491
  exports.extractAddressFromType = extractAddressFromType;
6433
6492
  exports.extractStructTagFromType = extractStructTagFromType;
6434
6493
  exports.fixSuiObjectId = fixSuiObjectId;
@@ -6437,3 +6496,4 @@ exports.isSortedSymbols = isSortedSymbols;
6437
6496
  exports.normalizeCoinType = normalizeCoinType;
6438
6497
  exports.parseRouterResponse = parseRouterResponse;
6439
6498
  exports.patchFixSuiObjectId = patchFixSuiObjectId;
6499
+ exports.restituteMsafeFastRouterSwapParams = restituteMsafeFastRouterSwapParams;