@superfluid-finance/sdk-core 0.5.6-dev.9e41aae.0 → 0.5.6-dev.ddbd8c9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/index.umd.js +1590 -1231
  2. package/dist/main/abi/IConstantFlowAgreementV1.json +70 -0
  3. package/dist/main/abi/IInstantDistributionAgreementV1.json +10 -0
  4. package/dist/main/abi/ISETH.json +25 -0
  5. package/dist/main/abi/SuperToken.json +91 -0
  6. package/dist/main/abi/Superfluid.json +150 -13
  7. package/dist/main/abi/SuperfluidGovernanceII.json +26 -0
  8. package/dist/main/typechain/Superfluid.d.ts +1 -9
  9. package/dist/main/typechain/Superfluid.d.ts.map +1 -1
  10. package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.d.ts +7 -0
  11. package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.d.ts.map +1 -1
  12. package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.js +70 -0
  13. package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.js.map +1 -1
  14. package/dist/main/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts +7 -0
  15. package/dist/main/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts.map +1 -1
  16. package/dist/main/typechain/factories/IInstantDistributionAgreementV1__factory.js +10 -0
  17. package/dist/main/typechain/factories/IInstantDistributionAgreementV1__factory.js.map +1 -1
  18. package/dist/main/typechain/factories/ISETH__factory.d.ts +7 -0
  19. package/dist/main/typechain/factories/ISETH__factory.d.ts.map +1 -1
  20. package/dist/main/typechain/factories/ISETH__factory.js +25 -0
  21. package/dist/main/typechain/factories/ISETH__factory.js.map +1 -1
  22. package/dist/main/typechain/factories/SuperToken__factory.d.ts +12 -1
  23. package/dist/main/typechain/factories/SuperToken__factory.d.ts.map +1 -1
  24. package/dist/main/typechain/factories/SuperToken__factory.js +91 -0
  25. package/dist/main/typechain/factories/SuperToken__factory.js.map +1 -1
  26. package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.d.ts +11 -0
  27. package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.d.ts.map +1 -1
  28. package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.js +26 -0
  29. package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.js.map +1 -1
  30. package/dist/main/typechain/factories/Superfluid__factory.d.ts +12 -1
  31. package/dist/main/typechain/factories/Superfluid__factory.d.ts.map +1 -1
  32. package/dist/main/typechain/factories/Superfluid__factory.js +150 -13
  33. package/dist/main/typechain/factories/Superfluid__factory.js.map +1 -1
  34. package/dist/module/abi/IConstantFlowAgreementV1.json +70 -0
  35. package/dist/module/abi/IInstantDistributionAgreementV1.json +10 -0
  36. package/dist/module/abi/ISETH.json +25 -0
  37. package/dist/module/abi/SuperToken.json +91 -0
  38. package/dist/module/abi/Superfluid.json +150 -13
  39. package/dist/module/abi/SuperfluidGovernanceII.json +26 -0
  40. package/dist/module/typechain/Superfluid.d.ts +1 -9
  41. package/dist/module/typechain/Superfluid.d.ts.map +1 -1
  42. package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.d.ts +7 -0
  43. package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.d.ts.map +1 -1
  44. package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.js +70 -0
  45. package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.js.map +1 -1
  46. package/dist/module/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts +7 -0
  47. package/dist/module/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts.map +1 -1
  48. package/dist/module/typechain/factories/IInstantDistributionAgreementV1__factory.js +10 -0
  49. package/dist/module/typechain/factories/IInstantDistributionAgreementV1__factory.js.map +1 -1
  50. package/dist/module/typechain/factories/ISETH__factory.d.ts +7 -0
  51. package/dist/module/typechain/factories/ISETH__factory.d.ts.map +1 -1
  52. package/dist/module/typechain/factories/ISETH__factory.js +25 -0
  53. package/dist/module/typechain/factories/ISETH__factory.js.map +1 -1
  54. package/dist/module/typechain/factories/SuperToken__factory.d.ts +12 -1
  55. package/dist/module/typechain/factories/SuperToken__factory.d.ts.map +1 -1
  56. package/dist/module/typechain/factories/SuperToken__factory.js +91 -0
  57. package/dist/module/typechain/factories/SuperToken__factory.js.map +1 -1
  58. package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.d.ts +11 -0
  59. package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.d.ts.map +1 -1
  60. package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.js +26 -0
  61. package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.js.map +1 -1
  62. package/dist/module/typechain/factories/Superfluid__factory.d.ts +12 -1
  63. package/dist/module/typechain/factories/Superfluid__factory.d.ts.map +1 -1
  64. package/dist/module/typechain/factories/Superfluid__factory.js +150 -13
  65. package/dist/module/typechain/factories/Superfluid__factory.js.map +1 -1
  66. package/package.json +2 -2
package/dist/index.umd.js CHANGED
@@ -18862,7 +18862,7 @@ var elliptic_1 = __importDefault(require("elliptic"));
18862
18862
  var EC = elliptic_1.default.ec;
18863
18863
  exports.EC = EC;
18864
18864
 
18865
- },{"elliptic":131}],94:[function(require,module,exports){
18865
+ },{"elliptic":132}],94:[function(require,module,exports){
18866
18866
  "use strict";
18867
18867
  Object.defineProperty(exports, "__esModule", { value: true });
18868
18868
  exports.computePublicKey = exports.recoverPublicKey = exports.SigningKey = void 0;
@@ -26469,593 +26469,1149 @@ if (typeof self === 'object') {
26469
26469
  },{"crypto":130}],130:[function(require,module,exports){
26470
26470
 
26471
26471
  },{}],131:[function(require,module,exports){
26472
- 'use strict';
26472
+ var global = typeof self !== 'undefined' ? self : this;
26473
+ var __self__ = (function () {
26474
+ function F() {
26475
+ this.fetch = false;
26476
+ this.DOMException = global.DOMException
26477
+ }
26478
+ F.prototype = global;
26479
+ return new F();
26480
+ })();
26481
+ (function(self) {
26473
26482
 
26474
- var elliptic = exports;
26483
+ var irrelevant = (function (exports) {
26475
26484
 
26476
- elliptic.version = require('../package.json').version;
26477
- elliptic.utils = require('./elliptic/utils');
26478
- elliptic.rand = require('brorand');
26479
- elliptic.curve = require('./elliptic/curve');
26480
- elliptic.curves = require('./elliptic/curves');
26485
+ var support = {
26486
+ searchParams: 'URLSearchParams' in self,
26487
+ iterable: 'Symbol' in self && 'iterator' in Symbol,
26488
+ blob:
26489
+ 'FileReader' in self &&
26490
+ 'Blob' in self &&
26491
+ (function() {
26492
+ try {
26493
+ new Blob();
26494
+ return true
26495
+ } catch (e) {
26496
+ return false
26497
+ }
26498
+ })(),
26499
+ formData: 'FormData' in self,
26500
+ arrayBuffer: 'ArrayBuffer' in self
26501
+ };
26481
26502
 
26482
- // Protocols
26483
- elliptic.ec = require('./elliptic/ec');
26484
- elliptic.eddsa = require('./elliptic/eddsa');
26503
+ function isDataView(obj) {
26504
+ return obj && DataView.prototype.isPrototypeOf(obj)
26505
+ }
26485
26506
 
26486
- },{"../package.json":146,"./elliptic/curve":134,"./elliptic/curves":137,"./elliptic/ec":138,"./elliptic/eddsa":141,"./elliptic/utils":145,"brorand":129}],132:[function(require,module,exports){
26487
- 'use strict';
26507
+ if (support.arrayBuffer) {
26508
+ var viewClasses = [
26509
+ '[object Int8Array]',
26510
+ '[object Uint8Array]',
26511
+ '[object Uint8ClampedArray]',
26512
+ '[object Int16Array]',
26513
+ '[object Uint16Array]',
26514
+ '[object Int32Array]',
26515
+ '[object Uint32Array]',
26516
+ '[object Float32Array]',
26517
+ '[object Float64Array]'
26518
+ ];
26488
26519
 
26489
- var BN = require('bn.js');
26490
- var utils = require('../utils');
26491
- var getNAF = utils.getNAF;
26492
- var getJSF = utils.getJSF;
26493
- var assert = utils.assert;
26520
+ var isArrayBufferView =
26521
+ ArrayBuffer.isView ||
26522
+ function(obj) {
26523
+ return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
26524
+ };
26525
+ }
26494
26526
 
26495
- function BaseCurve(type, conf) {
26496
- this.type = type;
26497
- this.p = new BN(conf.p, 16);
26527
+ function normalizeName(name) {
26528
+ if (typeof name !== 'string') {
26529
+ name = String(name);
26530
+ }
26531
+ if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) {
26532
+ throw new TypeError('Invalid character in header field name')
26533
+ }
26534
+ return name.toLowerCase()
26535
+ }
26498
26536
 
26499
- // Use Montgomery, when there is no fast reduction for the prime
26500
- this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);
26537
+ function normalizeValue(value) {
26538
+ if (typeof value !== 'string') {
26539
+ value = String(value);
26540
+ }
26541
+ return value
26542
+ }
26501
26543
 
26502
- // Useful for many curves
26503
- this.zero = new BN(0).toRed(this.red);
26504
- this.one = new BN(1).toRed(this.red);
26505
- this.two = new BN(2).toRed(this.red);
26544
+ // Build a destructive iterator for the value list
26545
+ function iteratorFor(items) {
26546
+ var iterator = {
26547
+ next: function() {
26548
+ var value = items.shift();
26549
+ return {done: value === undefined, value: value}
26550
+ }
26551
+ };
26506
26552
 
26507
- // Curve configuration, optional
26508
- this.n = conf.n && new BN(conf.n, 16);
26509
- this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);
26553
+ if (support.iterable) {
26554
+ iterator[Symbol.iterator] = function() {
26555
+ return iterator
26556
+ };
26557
+ }
26510
26558
 
26511
- // Temporary arrays
26512
- this._wnafT1 = new Array(4);
26513
- this._wnafT2 = new Array(4);
26514
- this._wnafT3 = new Array(4);
26515
- this._wnafT4 = new Array(4);
26559
+ return iterator
26560
+ }
26516
26561
 
26517
- this._bitLength = this.n ? this.n.bitLength() : 0;
26562
+ function Headers(headers) {
26563
+ this.map = {};
26518
26564
 
26519
- // Generalized Greg Maxwell's trick
26520
- var adjustCount = this.n && this.p.div(this.n);
26521
- if (!adjustCount || adjustCount.cmpn(100) > 0) {
26522
- this.redN = null;
26523
- } else {
26524
- this._maxwellTrick = true;
26525
- this.redN = this.n.toRed(this.red);
26565
+ if (headers instanceof Headers) {
26566
+ headers.forEach(function(value, name) {
26567
+ this.append(name, value);
26568
+ }, this);
26569
+ } else if (Array.isArray(headers)) {
26570
+ headers.forEach(function(header) {
26571
+ this.append(header[0], header[1]);
26572
+ }, this);
26573
+ } else if (headers) {
26574
+ Object.getOwnPropertyNames(headers).forEach(function(name) {
26575
+ this.append(name, headers[name]);
26576
+ }, this);
26577
+ }
26526
26578
  }
26527
- }
26528
- module.exports = BaseCurve;
26529
26579
 
26530
- BaseCurve.prototype.point = function point() {
26531
- throw new Error('Not implemented');
26532
- };
26580
+ Headers.prototype.append = function(name, value) {
26581
+ name = normalizeName(name);
26582
+ value = normalizeValue(value);
26583
+ var oldValue = this.map[name];
26584
+ this.map[name] = oldValue ? oldValue + ', ' + value : value;
26585
+ };
26533
26586
 
26534
- BaseCurve.prototype.validate = function validate() {
26535
- throw new Error('Not implemented');
26536
- };
26587
+ Headers.prototype['delete'] = function(name) {
26588
+ delete this.map[normalizeName(name)];
26589
+ };
26537
26590
 
26538
- BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {
26539
- assert(p.precomputed);
26540
- var doubles = p._getDoubles();
26591
+ Headers.prototype.get = function(name) {
26592
+ name = normalizeName(name);
26593
+ return this.has(name) ? this.map[name] : null
26594
+ };
26541
26595
 
26542
- var naf = getNAF(k, 1, this._bitLength);
26543
- var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);
26544
- I /= 3;
26596
+ Headers.prototype.has = function(name) {
26597
+ return this.map.hasOwnProperty(normalizeName(name))
26598
+ };
26545
26599
 
26546
- // Translate into more windowed form
26547
- var repr = [];
26548
- var j;
26549
- var nafW;
26550
- for (j = 0; j < naf.length; j += doubles.step) {
26551
- nafW = 0;
26552
- for (var l = j + doubles.step - 1; l >= j; l--)
26553
- nafW = (nafW << 1) + naf[l];
26554
- repr.push(nafW);
26555
- }
26600
+ Headers.prototype.set = function(name, value) {
26601
+ this.map[normalizeName(name)] = normalizeValue(value);
26602
+ };
26556
26603
 
26557
- var a = this.jpoint(null, null, null);
26558
- var b = this.jpoint(null, null, null);
26559
- for (var i = I; i > 0; i--) {
26560
- for (j = 0; j < repr.length; j++) {
26561
- nafW = repr[j];
26562
- if (nafW === i)
26563
- b = b.mixedAdd(doubles.points[j]);
26564
- else if (nafW === -i)
26565
- b = b.mixedAdd(doubles.points[j].neg());
26604
+ Headers.prototype.forEach = function(callback, thisArg) {
26605
+ for (var name in this.map) {
26606
+ if (this.map.hasOwnProperty(name)) {
26607
+ callback.call(thisArg, this.map[name], name, this);
26608
+ }
26566
26609
  }
26567
- a = a.add(b);
26568
- }
26569
- return a.toP();
26570
- };
26610
+ };
26571
26611
 
26572
- BaseCurve.prototype._wnafMul = function _wnafMul(p, k) {
26573
- var w = 4;
26612
+ Headers.prototype.keys = function() {
26613
+ var items = [];
26614
+ this.forEach(function(value, name) {
26615
+ items.push(name);
26616
+ });
26617
+ return iteratorFor(items)
26618
+ };
26574
26619
 
26575
- // Precompute window
26576
- var nafPoints = p._getNAFPoints(w);
26577
- w = nafPoints.wnd;
26578
- var wnd = nafPoints.points;
26620
+ Headers.prototype.values = function() {
26621
+ var items = [];
26622
+ this.forEach(function(value) {
26623
+ items.push(value);
26624
+ });
26625
+ return iteratorFor(items)
26626
+ };
26579
26627
 
26580
- // Get NAF form
26581
- var naf = getNAF(k, w, this._bitLength);
26628
+ Headers.prototype.entries = function() {
26629
+ var items = [];
26630
+ this.forEach(function(value, name) {
26631
+ items.push([name, value]);
26632
+ });
26633
+ return iteratorFor(items)
26634
+ };
26582
26635
 
26583
- // Add `this`*(N+1) for every w-NAF index
26584
- var acc = this.jpoint(null, null, null);
26585
- for (var i = naf.length - 1; i >= 0; i--) {
26586
- // Count zeroes
26587
- for (var l = 0; i >= 0 && naf[i] === 0; i--)
26588
- l++;
26589
- if (i >= 0)
26590
- l++;
26591
- acc = acc.dblp(l);
26636
+ if (support.iterable) {
26637
+ Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
26638
+ }
26592
26639
 
26593
- if (i < 0)
26594
- break;
26595
- var z = naf[i];
26596
- assert(z !== 0);
26597
- if (p.type === 'affine') {
26598
- // J +- P
26599
- if (z > 0)
26600
- acc = acc.mixedAdd(wnd[(z - 1) >> 1]);
26601
- else
26602
- acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());
26603
- } else {
26604
- // J +- J
26605
- if (z > 0)
26606
- acc = acc.add(wnd[(z - 1) >> 1]);
26607
- else
26608
- acc = acc.add(wnd[(-z - 1) >> 1].neg());
26640
+ function consumed(body) {
26641
+ if (body.bodyUsed) {
26642
+ return Promise.reject(new TypeError('Already read'))
26609
26643
  }
26644
+ body.bodyUsed = true;
26610
26645
  }
26611
- return p.type === 'affine' ? acc.toP() : acc;
26612
- };
26613
26646
 
26614
- BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,
26615
- points,
26616
- coeffs,
26617
- len,
26618
- jacobianResult) {
26619
- var wndWidth = this._wnafT1;
26620
- var wnd = this._wnafT2;
26621
- var naf = this._wnafT3;
26647
+ function fileReaderReady(reader) {
26648
+ return new Promise(function(resolve, reject) {
26649
+ reader.onload = function() {
26650
+ resolve(reader.result);
26651
+ };
26652
+ reader.onerror = function() {
26653
+ reject(reader.error);
26654
+ };
26655
+ })
26656
+ }
26622
26657
 
26623
- // Fill all arrays
26624
- var max = 0;
26625
- var i;
26626
- var j;
26627
- var p;
26628
- for (i = 0; i < len; i++) {
26629
- p = points[i];
26630
- var nafPoints = p._getNAFPoints(defW);
26631
- wndWidth[i] = nafPoints.wnd;
26632
- wnd[i] = nafPoints.points;
26658
+ function readBlobAsArrayBuffer(blob) {
26659
+ var reader = new FileReader();
26660
+ var promise = fileReaderReady(reader);
26661
+ reader.readAsArrayBuffer(blob);
26662
+ return promise
26633
26663
  }
26634
26664
 
26635
- // Comb small window NAFs
26636
- for (i = len - 1; i >= 1; i -= 2) {
26637
- var a = i - 1;
26638
- var b = i;
26639
- if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {
26640
- naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength);
26641
- naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength);
26642
- max = Math.max(naf[a].length, max);
26643
- max = Math.max(naf[b].length, max);
26644
- continue;
26645
- }
26665
+ function readBlobAsText(blob) {
26666
+ var reader = new FileReader();
26667
+ var promise = fileReaderReady(reader);
26668
+ reader.readAsText(blob);
26669
+ return promise
26670
+ }
26646
26671
 
26647
- var comb = [
26648
- points[a], /* 1 */
26649
- null, /* 3 */
26650
- null, /* 5 */
26651
- points[b], /* 7 */
26652
- ];
26672
+ function readArrayBufferAsText(buf) {
26673
+ var view = new Uint8Array(buf);
26674
+ var chars = new Array(view.length);
26653
26675
 
26654
- // Try to avoid Projective points, if possible
26655
- if (points[a].y.cmp(points[b].y) === 0) {
26656
- comb[1] = points[a].add(points[b]);
26657
- comb[2] = points[a].toJ().mixedAdd(points[b].neg());
26658
- } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {
26659
- comb[1] = points[a].toJ().mixedAdd(points[b]);
26660
- comb[2] = points[a].add(points[b].neg());
26661
- } else {
26662
- comb[1] = points[a].toJ().mixedAdd(points[b]);
26663
- comb[2] = points[a].toJ().mixedAdd(points[b].neg());
26676
+ for (var i = 0; i < view.length; i++) {
26677
+ chars[i] = String.fromCharCode(view[i]);
26664
26678
  }
26679
+ return chars.join('')
26680
+ }
26665
26681
 
26666
- var index = [
26667
- -3, /* -1 -1 */
26668
- -1, /* -1 0 */
26669
- -5, /* -1 1 */
26670
- -7, /* 0 -1 */
26671
- 0, /* 0 0 */
26672
- 7, /* 0 1 */
26673
- 5, /* 1 -1 */
26674
- 1, /* 1 0 */
26675
- 3, /* 1 1 */
26676
- ];
26677
-
26678
- var jsf = getJSF(coeffs[a], coeffs[b]);
26679
- max = Math.max(jsf[0].length, max);
26680
- naf[a] = new Array(max);
26681
- naf[b] = new Array(max);
26682
- for (j = 0; j < max; j++) {
26683
- var ja = jsf[0][j] | 0;
26684
- var jb = jsf[1][j] | 0;
26685
-
26686
- naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];
26687
- naf[b][j] = 0;
26688
- wnd[a] = comb;
26682
+ function bufferClone(buf) {
26683
+ if (buf.slice) {
26684
+ return buf.slice(0)
26685
+ } else {
26686
+ var view = new Uint8Array(buf.byteLength);
26687
+ view.set(new Uint8Array(buf));
26688
+ return view.buffer
26689
26689
  }
26690
26690
  }
26691
26691
 
26692
- var acc = this.jpoint(null, null, null);
26693
- var tmp = this._wnafT4;
26694
- for (i = max; i >= 0; i--) {
26695
- var k = 0;
26692
+ function Body() {
26693
+ this.bodyUsed = false;
26696
26694
 
26697
- while (i >= 0) {
26698
- var zero = true;
26699
- for (j = 0; j < len; j++) {
26700
- tmp[j] = naf[j][i] | 0;
26701
- if (tmp[j] !== 0)
26702
- zero = false;
26695
+ this._initBody = function(body) {
26696
+ this._bodyInit = body;
26697
+ if (!body) {
26698
+ this._bodyText = '';
26699
+ } else if (typeof body === 'string') {
26700
+ this._bodyText = body;
26701
+ } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
26702
+ this._bodyBlob = body;
26703
+ } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
26704
+ this._bodyFormData = body;
26705
+ } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
26706
+ this._bodyText = body.toString();
26707
+ } else if (support.arrayBuffer && support.blob && isDataView(body)) {
26708
+ this._bodyArrayBuffer = bufferClone(body.buffer);
26709
+ // IE 10-11 can't handle a DataView body.
26710
+ this._bodyInit = new Blob([this._bodyArrayBuffer]);
26711
+ } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
26712
+ this._bodyArrayBuffer = bufferClone(body);
26713
+ } else {
26714
+ this._bodyText = body = Object.prototype.toString.call(body);
26703
26715
  }
26704
- if (!zero)
26705
- break;
26706
- k++;
26707
- i--;
26708
- }
26709
- if (i >= 0)
26710
- k++;
26711
- acc = acc.dblp(k);
26712
- if (i < 0)
26713
- break;
26714
-
26715
- for (j = 0; j < len; j++) {
26716
- var z = tmp[j];
26717
- p;
26718
- if (z === 0)
26719
- continue;
26720
- else if (z > 0)
26721
- p = wnd[j][(z - 1) >> 1];
26722
- else if (z < 0)
26723
- p = wnd[j][(-z - 1) >> 1].neg();
26724
26716
 
26725
- if (p.type === 'affine')
26726
- acc = acc.mixedAdd(p);
26727
- else
26728
- acc = acc.add(p);
26729
- }
26730
- }
26731
- // Zeroify references
26732
- for (i = 0; i < len; i++)
26733
- wnd[i] = null;
26717
+ if (!this.headers.get('content-type')) {
26718
+ if (typeof body === 'string') {
26719
+ this.headers.set('content-type', 'text/plain;charset=UTF-8');
26720
+ } else if (this._bodyBlob && this._bodyBlob.type) {
26721
+ this.headers.set('content-type', this._bodyBlob.type);
26722
+ } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
26723
+ this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
26724
+ }
26725
+ }
26726
+ };
26734
26727
 
26735
- if (jacobianResult)
26736
- return acc;
26737
- else
26738
- return acc.toP();
26739
- };
26728
+ if (support.blob) {
26729
+ this.blob = function() {
26730
+ var rejected = consumed(this);
26731
+ if (rejected) {
26732
+ return rejected
26733
+ }
26740
26734
 
26741
- function BasePoint(curve, type) {
26742
- this.curve = curve;
26743
- this.type = type;
26744
- this.precomputed = null;
26745
- }
26746
- BaseCurve.BasePoint = BasePoint;
26735
+ if (this._bodyBlob) {
26736
+ return Promise.resolve(this._bodyBlob)
26737
+ } else if (this._bodyArrayBuffer) {
26738
+ return Promise.resolve(new Blob([this._bodyArrayBuffer]))
26739
+ } else if (this._bodyFormData) {
26740
+ throw new Error('could not read FormData body as blob')
26741
+ } else {
26742
+ return Promise.resolve(new Blob([this._bodyText]))
26743
+ }
26744
+ };
26747
26745
 
26748
- BasePoint.prototype.eq = function eq(/*other*/) {
26749
- throw new Error('Not implemented');
26750
- };
26746
+ this.arrayBuffer = function() {
26747
+ if (this._bodyArrayBuffer) {
26748
+ return consumed(this) || Promise.resolve(this._bodyArrayBuffer)
26749
+ } else {
26750
+ return this.blob().then(readBlobAsArrayBuffer)
26751
+ }
26752
+ };
26753
+ }
26751
26754
 
26752
- BasePoint.prototype.validate = function validate() {
26753
- return this.curve.validate(this);
26754
- };
26755
+ this.text = function() {
26756
+ var rejected = consumed(this);
26757
+ if (rejected) {
26758
+ return rejected
26759
+ }
26755
26760
 
26756
- BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
26757
- bytes = utils.toArray(bytes, enc);
26761
+ if (this._bodyBlob) {
26762
+ return readBlobAsText(this._bodyBlob)
26763
+ } else if (this._bodyArrayBuffer) {
26764
+ return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
26765
+ } else if (this._bodyFormData) {
26766
+ throw new Error('could not read FormData body as text')
26767
+ } else {
26768
+ return Promise.resolve(this._bodyText)
26769
+ }
26770
+ };
26758
26771
 
26759
- var len = this.p.byteLength();
26772
+ if (support.formData) {
26773
+ this.formData = function() {
26774
+ return this.text().then(decode)
26775
+ };
26776
+ }
26760
26777
 
26761
- // uncompressed, hybrid-odd, hybrid-even
26762
- if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&
26763
- bytes.length - 1 === 2 * len) {
26764
- if (bytes[0] === 0x06)
26765
- assert(bytes[bytes.length - 1] % 2 === 0);
26766
- else if (bytes[0] === 0x07)
26767
- assert(bytes[bytes.length - 1] % 2 === 1);
26778
+ this.json = function() {
26779
+ return this.text().then(JSON.parse)
26780
+ };
26768
26781
 
26769
- var res = this.point(bytes.slice(1, 1 + len),
26770
- bytes.slice(1 + len, 1 + 2 * len));
26782
+ return this
26783
+ }
26771
26784
 
26772
- return res;
26773
- } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&
26774
- bytes.length - 1 === len) {
26775
- return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);
26785
+ // HTTP methods whose capitalization should be normalized
26786
+ var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
26787
+
26788
+ function normalizeMethod(method) {
26789
+ var upcased = method.toUpperCase();
26790
+ return methods.indexOf(upcased) > -1 ? upcased : method
26776
26791
  }
26777
- throw new Error('Unknown point format');
26778
- };
26779
26792
 
26780
- BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {
26781
- return this.encode(enc, true);
26782
- };
26793
+ function Request(input, options) {
26794
+ options = options || {};
26795
+ var body = options.body;
26783
26796
 
26784
- BasePoint.prototype._encode = function _encode(compact) {
26785
- var len = this.curve.p.byteLength();
26786
- var x = this.getX().toArray('be', len);
26797
+ if (input instanceof Request) {
26798
+ if (input.bodyUsed) {
26799
+ throw new TypeError('Already read')
26800
+ }
26801
+ this.url = input.url;
26802
+ this.credentials = input.credentials;
26803
+ if (!options.headers) {
26804
+ this.headers = new Headers(input.headers);
26805
+ }
26806
+ this.method = input.method;
26807
+ this.mode = input.mode;
26808
+ this.signal = input.signal;
26809
+ if (!body && input._bodyInit != null) {
26810
+ body = input._bodyInit;
26811
+ input.bodyUsed = true;
26812
+ }
26813
+ } else {
26814
+ this.url = String(input);
26815
+ }
26787
26816
 
26788
- if (compact)
26789
- return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);
26817
+ this.credentials = options.credentials || this.credentials || 'same-origin';
26818
+ if (options.headers || !this.headers) {
26819
+ this.headers = new Headers(options.headers);
26820
+ }
26821
+ this.method = normalizeMethod(options.method || this.method || 'GET');
26822
+ this.mode = options.mode || this.mode || null;
26823
+ this.signal = options.signal || this.signal;
26824
+ this.referrer = null;
26790
26825
 
26791
- return [ 0x04 ].concat(x, this.getY().toArray('be', len));
26792
- };
26826
+ if ((this.method === 'GET' || this.method === 'HEAD') && body) {
26827
+ throw new TypeError('Body not allowed for GET or HEAD requests')
26828
+ }
26829
+ this._initBody(body);
26830
+ }
26793
26831
 
26794
- BasePoint.prototype.encode = function encode(enc, compact) {
26795
- return utils.encode(this._encode(compact), enc);
26796
- };
26832
+ Request.prototype.clone = function() {
26833
+ return new Request(this, {body: this._bodyInit})
26834
+ };
26797
26835
 
26798
- BasePoint.prototype.precompute = function precompute(power) {
26799
- if (this.precomputed)
26800
- return this;
26836
+ function decode(body) {
26837
+ var form = new FormData();
26838
+ body
26839
+ .trim()
26840
+ .split('&')
26841
+ .forEach(function(bytes) {
26842
+ if (bytes) {
26843
+ var split = bytes.split('=');
26844
+ var name = split.shift().replace(/\+/g, ' ');
26845
+ var value = split.join('=').replace(/\+/g, ' ');
26846
+ form.append(decodeURIComponent(name), decodeURIComponent(value));
26847
+ }
26848
+ });
26849
+ return form
26850
+ }
26801
26851
 
26802
- var precomputed = {
26803
- doubles: null,
26804
- naf: null,
26805
- beta: null,
26806
- };
26807
- precomputed.naf = this._getNAFPoints(8);
26808
- precomputed.doubles = this._getDoubles(4, power);
26809
- precomputed.beta = this._getBeta();
26810
- this.precomputed = precomputed;
26852
+ function parseHeaders(rawHeaders) {
26853
+ var headers = new Headers();
26854
+ // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
26855
+ // https://tools.ietf.org/html/rfc7230#section-3.2
26856
+ var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
26857
+ preProcessedHeaders.split(/\r?\n/).forEach(function(line) {
26858
+ var parts = line.split(':');
26859
+ var key = parts.shift().trim();
26860
+ if (key) {
26861
+ var value = parts.join(':').trim();
26862
+ headers.append(key, value);
26863
+ }
26864
+ });
26865
+ return headers
26866
+ }
26811
26867
 
26812
- return this;
26813
- };
26868
+ Body.call(Request.prototype);
26814
26869
 
26815
- BasePoint.prototype._hasDoubles = function _hasDoubles(k) {
26816
- if (!this.precomputed)
26817
- return false;
26870
+ function Response(bodyInit, options) {
26871
+ if (!options) {
26872
+ options = {};
26873
+ }
26818
26874
 
26819
- var doubles = this.precomputed.doubles;
26820
- if (!doubles)
26821
- return false;
26875
+ this.type = 'default';
26876
+ this.status = options.status === undefined ? 200 : options.status;
26877
+ this.ok = this.status >= 200 && this.status < 300;
26878
+ this.statusText = 'statusText' in options ? options.statusText : 'OK';
26879
+ this.headers = new Headers(options.headers);
26880
+ this.url = options.url || '';
26881
+ this._initBody(bodyInit);
26882
+ }
26822
26883
 
26823
- return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);
26824
- };
26884
+ Body.call(Response.prototype);
26825
26885
 
26826
- BasePoint.prototype._getDoubles = function _getDoubles(step, power) {
26827
- if (this.precomputed && this.precomputed.doubles)
26828
- return this.precomputed.doubles;
26886
+ Response.prototype.clone = function() {
26887
+ return new Response(this._bodyInit, {
26888
+ status: this.status,
26889
+ statusText: this.statusText,
26890
+ headers: new Headers(this.headers),
26891
+ url: this.url
26892
+ })
26893
+ };
26829
26894
 
26830
- var doubles = [ this ];
26831
- var acc = this;
26832
- for (var i = 0; i < power; i += step) {
26833
- for (var j = 0; j < step; j++)
26834
- acc = acc.dbl();
26835
- doubles.push(acc);
26836
- }
26837
- return {
26838
- step: step,
26839
- points: doubles,
26895
+ Response.error = function() {
26896
+ var response = new Response(null, {status: 0, statusText: ''});
26897
+ response.type = 'error';
26898
+ return response
26840
26899
  };
26841
- };
26842
26900
 
26843
- BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {
26844
- if (this.precomputed && this.precomputed.naf)
26845
- return this.precomputed.naf;
26901
+ var redirectStatuses = [301, 302, 303, 307, 308];
26846
26902
 
26847
- var res = [ this ];
26848
- var max = (1 << wnd) - 1;
26849
- var dbl = max === 1 ? null : this.dbl();
26850
- for (var i = 1; i < max; i++)
26851
- res[i] = res[i - 1].add(dbl);
26852
- return {
26853
- wnd: wnd,
26854
- points: res,
26903
+ Response.redirect = function(url, status) {
26904
+ if (redirectStatuses.indexOf(status) === -1) {
26905
+ throw new RangeError('Invalid status code')
26906
+ }
26907
+
26908
+ return new Response(null, {status: status, headers: {location: url}})
26855
26909
  };
26856
- };
26857
26910
 
26858
- BasePoint.prototype._getBeta = function _getBeta() {
26859
- return null;
26860
- };
26911
+ exports.DOMException = self.DOMException;
26912
+ try {
26913
+ new exports.DOMException();
26914
+ } catch (err) {
26915
+ exports.DOMException = function(message, name) {
26916
+ this.message = message;
26917
+ this.name = name;
26918
+ var error = Error(message);
26919
+ this.stack = error.stack;
26920
+ };
26921
+ exports.DOMException.prototype = Object.create(Error.prototype);
26922
+ exports.DOMException.prototype.constructor = exports.DOMException;
26923
+ }
26861
26924
 
26862
- BasePoint.prototype.dblp = function dblp(k) {
26863
- var r = this;
26864
- for (var i = 0; i < k; i++)
26865
- r = r.dbl();
26866
- return r;
26867
- };
26925
+ function fetch(input, init) {
26926
+ return new Promise(function(resolve, reject) {
26927
+ var request = new Request(input, init);
26868
26928
 
26869
- },{"../utils":145,"bn.js":128}],133:[function(require,module,exports){
26870
- 'use strict';
26929
+ if (request.signal && request.signal.aborted) {
26930
+ return reject(new exports.DOMException('Aborted', 'AbortError'))
26931
+ }
26871
26932
 
26872
- var utils = require('../utils');
26873
- var BN = require('bn.js');
26874
- var inherits = require('inherits');
26875
- var Base = require('./base');
26933
+ var xhr = new XMLHttpRequest();
26876
26934
 
26877
- var assert = utils.assert;
26935
+ function abortXhr() {
26936
+ xhr.abort();
26937
+ }
26878
26938
 
26879
- function EdwardsCurve(conf) {
26880
- // NOTE: Important as we are creating point in Base.call()
26881
- this.twisted = (conf.a | 0) !== 1;
26882
- this.mOneA = this.twisted && (conf.a | 0) === -1;
26883
- this.extended = this.mOneA;
26939
+ xhr.onload = function() {
26940
+ var options = {
26941
+ status: xhr.status,
26942
+ statusText: xhr.statusText,
26943
+ headers: parseHeaders(xhr.getAllResponseHeaders() || '')
26944
+ };
26945
+ options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
26946
+ var body = 'response' in xhr ? xhr.response : xhr.responseText;
26947
+ resolve(new Response(body, options));
26948
+ };
26884
26949
 
26885
- Base.call(this, 'edwards', conf);
26950
+ xhr.onerror = function() {
26951
+ reject(new TypeError('Network request failed'));
26952
+ };
26886
26953
 
26887
- this.a = new BN(conf.a, 16).umod(this.red.m);
26888
- this.a = this.a.toRed(this.red);
26889
- this.c = new BN(conf.c, 16).toRed(this.red);
26890
- this.c2 = this.c.redSqr();
26891
- this.d = new BN(conf.d, 16).toRed(this.red);
26892
- this.dd = this.d.redAdd(this.d);
26954
+ xhr.ontimeout = function() {
26955
+ reject(new TypeError('Network request failed'));
26956
+ };
26893
26957
 
26894
- assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);
26895
- this.oneC = (conf.c | 0) === 1;
26896
- }
26897
- inherits(EdwardsCurve, Base);
26898
- module.exports = EdwardsCurve;
26958
+ xhr.onabort = function() {
26959
+ reject(new exports.DOMException('Aborted', 'AbortError'));
26960
+ };
26899
26961
 
26900
- EdwardsCurve.prototype._mulA = function _mulA(num) {
26901
- if (this.mOneA)
26902
- return num.redNeg();
26903
- else
26904
- return this.a.redMul(num);
26905
- };
26962
+ xhr.open(request.method, request.url, true);
26906
26963
 
26907
- EdwardsCurve.prototype._mulC = function _mulC(num) {
26908
- if (this.oneC)
26909
- return num;
26910
- else
26911
- return this.c.redMul(num);
26912
- };
26964
+ if (request.credentials === 'include') {
26965
+ xhr.withCredentials = true;
26966
+ } else if (request.credentials === 'omit') {
26967
+ xhr.withCredentials = false;
26968
+ }
26913
26969
 
26914
- // Just for compatibility with Short curve
26915
- EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {
26916
- return this.point(x, y, z, t);
26917
- };
26970
+ if ('responseType' in xhr && support.blob) {
26971
+ xhr.responseType = 'blob';
26972
+ }
26918
26973
 
26919
- EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {
26920
- x = new BN(x, 16);
26921
- if (!x.red)
26922
- x = x.toRed(this.red);
26974
+ request.headers.forEach(function(value, name) {
26975
+ xhr.setRequestHeader(name, value);
26976
+ });
26923
26977
 
26924
- var x2 = x.redSqr();
26925
- var rhs = this.c2.redSub(this.a.redMul(x2));
26926
- var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));
26978
+ if (request.signal) {
26979
+ request.signal.addEventListener('abort', abortXhr);
26927
26980
 
26928
- var y2 = rhs.redMul(lhs.redInvm());
26929
- var y = y2.redSqrt();
26930
- if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
26931
- throw new Error('invalid point');
26981
+ xhr.onreadystatechange = function() {
26982
+ // DONE (success or failure)
26983
+ if (xhr.readyState === 4) {
26984
+ request.signal.removeEventListener('abort', abortXhr);
26985
+ }
26986
+ };
26987
+ }
26932
26988
 
26933
- var isOdd = y.fromRed().isOdd();
26934
- if (odd && !isOdd || !odd && isOdd)
26935
- y = y.redNeg();
26989
+ xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
26990
+ })
26991
+ }
26936
26992
 
26937
- return this.point(x, y);
26938
- };
26993
+ fetch.polyfill = true;
26939
26994
 
26940
- EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {
26941
- y = new BN(y, 16);
26942
- if (!y.red)
26943
- y = y.toRed(this.red);
26995
+ if (!self.fetch) {
26996
+ self.fetch = fetch;
26997
+ self.Headers = Headers;
26998
+ self.Request = Request;
26999
+ self.Response = Response;
27000
+ }
26944
27001
 
26945
- // x^2 = (y^2 - c^2) / (c^2 d y^2 - a)
26946
- var y2 = y.redSqr();
26947
- var lhs = y2.redSub(this.c2);
26948
- var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a);
26949
- var x2 = lhs.redMul(rhs.redInvm());
27002
+ exports.Headers = Headers;
27003
+ exports.Request = Request;
27004
+ exports.Response = Response;
27005
+ exports.fetch = fetch;
26950
27006
 
26951
- if (x2.cmp(this.zero) === 0) {
26952
- if (odd)
26953
- throw new Error('invalid point');
26954
- else
26955
- return this.point(this.zero, y);
26956
- }
27007
+ Object.defineProperty(exports, '__esModule', { value: true });
26957
27008
 
26958
- var x = x2.redSqrt();
26959
- if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)
26960
- throw new Error('invalid point');
27009
+ return exports;
26961
27010
 
26962
- if (x.fromRed().isOdd() !== odd)
26963
- x = x.redNeg();
27011
+ })({});
27012
+ })(__self__);
27013
+ __self__.fetch.ponyfill = true;
27014
+ // Remove "polyfill" property added by whatwg-fetch
27015
+ delete __self__.fetch.polyfill;
27016
+ // Choose between native implementation (global) or custom implementation (__self__)
27017
+ // var ctx = global.fetch ? global : __self__;
27018
+ var ctx = __self__; // this line disable service worker support temporarily
27019
+ exports = ctx.fetch // To enable: import fetch from 'cross-fetch'
27020
+ exports.default = ctx.fetch // For TypeScript consumers without esModuleInterop.
27021
+ exports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch'
27022
+ exports.Headers = ctx.Headers
27023
+ exports.Request = ctx.Request
27024
+ exports.Response = ctx.Response
27025
+ module.exports = exports
26964
27026
 
26965
- return this.point(x, y);
26966
- };
27027
+ },{}],132:[function(require,module,exports){
27028
+ 'use strict';
26967
27029
 
26968
- EdwardsCurve.prototype.validate = function validate(point) {
26969
- if (point.isInfinity())
26970
- return true;
27030
+ var elliptic = exports;
26971
27031
 
26972
- // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2)
26973
- point.normalize();
27032
+ elliptic.version = require('../package.json').version;
27033
+ elliptic.utils = require('./elliptic/utils');
27034
+ elliptic.rand = require('brorand');
27035
+ elliptic.curve = require('./elliptic/curve');
27036
+ elliptic.curves = require('./elliptic/curves');
26974
27037
 
26975
- var x2 = point.x.redSqr();
26976
- var y2 = point.y.redSqr();
26977
- var lhs = x2.redMul(this.a).redAdd(y2);
26978
- var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));
27038
+ // Protocols
27039
+ elliptic.ec = require('./elliptic/ec');
27040
+ elliptic.eddsa = require('./elliptic/eddsa');
26979
27041
 
26980
- return lhs.cmp(rhs) === 0;
26981
- };
27042
+ },{"../package.json":147,"./elliptic/curve":135,"./elliptic/curves":138,"./elliptic/ec":139,"./elliptic/eddsa":142,"./elliptic/utils":146,"brorand":129}],133:[function(require,module,exports){
27043
+ 'use strict';
26982
27044
 
26983
- function Point(curve, x, y, z, t) {
26984
- Base.BasePoint.call(this, curve, 'projective');
26985
- if (x === null && y === null && z === null) {
26986
- this.x = this.curve.zero;
26987
- this.y = this.curve.one;
26988
- this.z = this.curve.one;
26989
- this.t = this.curve.zero;
26990
- this.zOne = true;
26991
- } else {
26992
- this.x = new BN(x, 16);
26993
- this.y = new BN(y, 16);
26994
- this.z = z ? new BN(z, 16) : this.curve.one;
26995
- this.t = t && new BN(t, 16);
26996
- if (!this.x.red)
26997
- this.x = this.x.toRed(this.curve.red);
26998
- if (!this.y.red)
26999
- this.y = this.y.toRed(this.curve.red);
27000
- if (!this.z.red)
27001
- this.z = this.z.toRed(this.curve.red);
27002
- if (this.t && !this.t.red)
27003
- this.t = this.t.toRed(this.curve.red);
27004
- this.zOne = this.z === this.curve.one;
27045
+ var BN = require('bn.js');
27046
+ var utils = require('../utils');
27047
+ var getNAF = utils.getNAF;
27048
+ var getJSF = utils.getJSF;
27049
+ var assert = utils.assert;
27005
27050
 
27006
- // Use extended coordinates
27007
- if (this.curve.extended && !this.t) {
27008
- this.t = this.x.redMul(this.y);
27009
- if (!this.zOne)
27010
- this.t = this.t.redMul(this.z.redInvm());
27011
- }
27051
+ function BaseCurve(type, conf) {
27052
+ this.type = type;
27053
+ this.p = new BN(conf.p, 16);
27054
+
27055
+ // Use Montgomery, when there is no fast reduction for the prime
27056
+ this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);
27057
+
27058
+ // Useful for many curves
27059
+ this.zero = new BN(0).toRed(this.red);
27060
+ this.one = new BN(1).toRed(this.red);
27061
+ this.two = new BN(2).toRed(this.red);
27062
+
27063
+ // Curve configuration, optional
27064
+ this.n = conf.n && new BN(conf.n, 16);
27065
+ this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);
27066
+
27067
+ // Temporary arrays
27068
+ this._wnafT1 = new Array(4);
27069
+ this._wnafT2 = new Array(4);
27070
+ this._wnafT3 = new Array(4);
27071
+ this._wnafT4 = new Array(4);
27072
+
27073
+ this._bitLength = this.n ? this.n.bitLength() : 0;
27074
+
27075
+ // Generalized Greg Maxwell's trick
27076
+ var adjustCount = this.n && this.p.div(this.n);
27077
+ if (!adjustCount || adjustCount.cmpn(100) > 0) {
27078
+ this.redN = null;
27079
+ } else {
27080
+ this._maxwellTrick = true;
27081
+ this.redN = this.n.toRed(this.red);
27012
27082
  }
27013
27083
  }
27014
- inherits(Point, Base.BasePoint);
27084
+ module.exports = BaseCurve;
27015
27085
 
27016
- EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
27017
- return Point.fromJSON(this, obj);
27086
+ BaseCurve.prototype.point = function point() {
27087
+ throw new Error('Not implemented');
27018
27088
  };
27019
27089
 
27020
- EdwardsCurve.prototype.point = function point(x, y, z, t) {
27021
- return new Point(this, x, y, z, t);
27090
+ BaseCurve.prototype.validate = function validate() {
27091
+ throw new Error('Not implemented');
27022
27092
  };
27023
27093
 
27024
- Point.fromJSON = function fromJSON(curve, obj) {
27025
- return new Point(curve, obj[0], obj[1], obj[2]);
27026
- };
27094
+ BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {
27095
+ assert(p.precomputed);
27096
+ var doubles = p._getDoubles();
27027
27097
 
27028
- Point.prototype.inspect = function inspect() {
27029
- if (this.isInfinity())
27030
- return '<EC Point Infinity>';
27031
- return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
27032
- ' y: ' + this.y.fromRed().toString(16, 2) +
27033
- ' z: ' + this.z.fromRed().toString(16, 2) + '>';
27034
- };
27098
+ var naf = getNAF(k, 1, this._bitLength);
27099
+ var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);
27100
+ I /= 3;
27035
27101
 
27036
- Point.prototype.isInfinity = function isInfinity() {
27037
- // XXX This code assumes that zero is always zero in red
27038
- return this.x.cmpn(0) === 0 &&
27039
- (this.y.cmp(this.z) === 0 ||
27040
- (this.zOne && this.y.cmp(this.curve.c) === 0));
27102
+ // Translate into more windowed form
27103
+ var repr = [];
27104
+ var j;
27105
+ var nafW;
27106
+ for (j = 0; j < naf.length; j += doubles.step) {
27107
+ nafW = 0;
27108
+ for (var l = j + doubles.step - 1; l >= j; l--)
27109
+ nafW = (nafW << 1) + naf[l];
27110
+ repr.push(nafW);
27111
+ }
27112
+
27113
+ var a = this.jpoint(null, null, null);
27114
+ var b = this.jpoint(null, null, null);
27115
+ for (var i = I; i > 0; i--) {
27116
+ for (j = 0; j < repr.length; j++) {
27117
+ nafW = repr[j];
27118
+ if (nafW === i)
27119
+ b = b.mixedAdd(doubles.points[j]);
27120
+ else if (nafW === -i)
27121
+ b = b.mixedAdd(doubles.points[j].neg());
27122
+ }
27123
+ a = a.add(b);
27124
+ }
27125
+ return a.toP();
27041
27126
  };
27042
27127
 
27043
- Point.prototype._extDbl = function _extDbl() {
27044
- // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
27045
- // #doubling-dbl-2008-hwcd
27046
- // 4M + 4S
27128
+ BaseCurve.prototype._wnafMul = function _wnafMul(p, k) {
27129
+ var w = 4;
27047
27130
 
27048
- // A = X1^2
27049
- var a = this.x.redSqr();
27050
- // B = Y1^2
27051
- var b = this.y.redSqr();
27052
- // C = 2 * Z1^2
27053
- var c = this.z.redSqr();
27054
- c = c.redIAdd(c);
27055
- // D = a * A
27056
- var d = this.curve._mulA(a);
27057
- // E = (X1 + Y1)^2 - A - B
27058
- var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);
27131
+ // Precompute window
27132
+ var nafPoints = p._getNAFPoints(w);
27133
+ w = nafPoints.wnd;
27134
+ var wnd = nafPoints.points;
27135
+
27136
+ // Get NAF form
27137
+ var naf = getNAF(k, w, this._bitLength);
27138
+
27139
+ // Add `this`*(N+1) for every w-NAF index
27140
+ var acc = this.jpoint(null, null, null);
27141
+ for (var i = naf.length - 1; i >= 0; i--) {
27142
+ // Count zeroes
27143
+ for (var l = 0; i >= 0 && naf[i] === 0; i--)
27144
+ l++;
27145
+ if (i >= 0)
27146
+ l++;
27147
+ acc = acc.dblp(l);
27148
+
27149
+ if (i < 0)
27150
+ break;
27151
+ var z = naf[i];
27152
+ assert(z !== 0);
27153
+ if (p.type === 'affine') {
27154
+ // J +- P
27155
+ if (z > 0)
27156
+ acc = acc.mixedAdd(wnd[(z - 1) >> 1]);
27157
+ else
27158
+ acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());
27159
+ } else {
27160
+ // J +- J
27161
+ if (z > 0)
27162
+ acc = acc.add(wnd[(z - 1) >> 1]);
27163
+ else
27164
+ acc = acc.add(wnd[(-z - 1) >> 1].neg());
27165
+ }
27166
+ }
27167
+ return p.type === 'affine' ? acc.toP() : acc;
27168
+ };
27169
+
27170
+ BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,
27171
+ points,
27172
+ coeffs,
27173
+ len,
27174
+ jacobianResult) {
27175
+ var wndWidth = this._wnafT1;
27176
+ var wnd = this._wnafT2;
27177
+ var naf = this._wnafT3;
27178
+
27179
+ // Fill all arrays
27180
+ var max = 0;
27181
+ var i;
27182
+ var j;
27183
+ var p;
27184
+ for (i = 0; i < len; i++) {
27185
+ p = points[i];
27186
+ var nafPoints = p._getNAFPoints(defW);
27187
+ wndWidth[i] = nafPoints.wnd;
27188
+ wnd[i] = nafPoints.points;
27189
+ }
27190
+
27191
+ // Comb small window NAFs
27192
+ for (i = len - 1; i >= 1; i -= 2) {
27193
+ var a = i - 1;
27194
+ var b = i;
27195
+ if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {
27196
+ naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength);
27197
+ naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength);
27198
+ max = Math.max(naf[a].length, max);
27199
+ max = Math.max(naf[b].length, max);
27200
+ continue;
27201
+ }
27202
+
27203
+ var comb = [
27204
+ points[a], /* 1 */
27205
+ null, /* 3 */
27206
+ null, /* 5 */
27207
+ points[b], /* 7 */
27208
+ ];
27209
+
27210
+ // Try to avoid Projective points, if possible
27211
+ if (points[a].y.cmp(points[b].y) === 0) {
27212
+ comb[1] = points[a].add(points[b]);
27213
+ comb[2] = points[a].toJ().mixedAdd(points[b].neg());
27214
+ } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {
27215
+ comb[1] = points[a].toJ().mixedAdd(points[b]);
27216
+ comb[2] = points[a].add(points[b].neg());
27217
+ } else {
27218
+ comb[1] = points[a].toJ().mixedAdd(points[b]);
27219
+ comb[2] = points[a].toJ().mixedAdd(points[b].neg());
27220
+ }
27221
+
27222
+ var index = [
27223
+ -3, /* -1 -1 */
27224
+ -1, /* -1 0 */
27225
+ -5, /* -1 1 */
27226
+ -7, /* 0 -1 */
27227
+ 0, /* 0 0 */
27228
+ 7, /* 0 1 */
27229
+ 5, /* 1 -1 */
27230
+ 1, /* 1 0 */
27231
+ 3, /* 1 1 */
27232
+ ];
27233
+
27234
+ var jsf = getJSF(coeffs[a], coeffs[b]);
27235
+ max = Math.max(jsf[0].length, max);
27236
+ naf[a] = new Array(max);
27237
+ naf[b] = new Array(max);
27238
+ for (j = 0; j < max; j++) {
27239
+ var ja = jsf[0][j] | 0;
27240
+ var jb = jsf[1][j] | 0;
27241
+
27242
+ naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];
27243
+ naf[b][j] = 0;
27244
+ wnd[a] = comb;
27245
+ }
27246
+ }
27247
+
27248
+ var acc = this.jpoint(null, null, null);
27249
+ var tmp = this._wnafT4;
27250
+ for (i = max; i >= 0; i--) {
27251
+ var k = 0;
27252
+
27253
+ while (i >= 0) {
27254
+ var zero = true;
27255
+ for (j = 0; j < len; j++) {
27256
+ tmp[j] = naf[j][i] | 0;
27257
+ if (tmp[j] !== 0)
27258
+ zero = false;
27259
+ }
27260
+ if (!zero)
27261
+ break;
27262
+ k++;
27263
+ i--;
27264
+ }
27265
+ if (i >= 0)
27266
+ k++;
27267
+ acc = acc.dblp(k);
27268
+ if (i < 0)
27269
+ break;
27270
+
27271
+ for (j = 0; j < len; j++) {
27272
+ var z = tmp[j];
27273
+ p;
27274
+ if (z === 0)
27275
+ continue;
27276
+ else if (z > 0)
27277
+ p = wnd[j][(z - 1) >> 1];
27278
+ else if (z < 0)
27279
+ p = wnd[j][(-z - 1) >> 1].neg();
27280
+
27281
+ if (p.type === 'affine')
27282
+ acc = acc.mixedAdd(p);
27283
+ else
27284
+ acc = acc.add(p);
27285
+ }
27286
+ }
27287
+ // Zeroify references
27288
+ for (i = 0; i < len; i++)
27289
+ wnd[i] = null;
27290
+
27291
+ if (jacobianResult)
27292
+ return acc;
27293
+ else
27294
+ return acc.toP();
27295
+ };
27296
+
27297
+ function BasePoint(curve, type) {
27298
+ this.curve = curve;
27299
+ this.type = type;
27300
+ this.precomputed = null;
27301
+ }
27302
+ BaseCurve.BasePoint = BasePoint;
27303
+
27304
+ BasePoint.prototype.eq = function eq(/*other*/) {
27305
+ throw new Error('Not implemented');
27306
+ };
27307
+
27308
+ BasePoint.prototype.validate = function validate() {
27309
+ return this.curve.validate(this);
27310
+ };
27311
+
27312
+ BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
27313
+ bytes = utils.toArray(bytes, enc);
27314
+
27315
+ var len = this.p.byteLength();
27316
+
27317
+ // uncompressed, hybrid-odd, hybrid-even
27318
+ if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&
27319
+ bytes.length - 1 === 2 * len) {
27320
+ if (bytes[0] === 0x06)
27321
+ assert(bytes[bytes.length - 1] % 2 === 0);
27322
+ else if (bytes[0] === 0x07)
27323
+ assert(bytes[bytes.length - 1] % 2 === 1);
27324
+
27325
+ var res = this.point(bytes.slice(1, 1 + len),
27326
+ bytes.slice(1 + len, 1 + 2 * len));
27327
+
27328
+ return res;
27329
+ } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&
27330
+ bytes.length - 1 === len) {
27331
+ return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);
27332
+ }
27333
+ throw new Error('Unknown point format');
27334
+ };
27335
+
27336
+ BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {
27337
+ return this.encode(enc, true);
27338
+ };
27339
+
27340
+ BasePoint.prototype._encode = function _encode(compact) {
27341
+ var len = this.curve.p.byteLength();
27342
+ var x = this.getX().toArray('be', len);
27343
+
27344
+ if (compact)
27345
+ return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);
27346
+
27347
+ return [ 0x04 ].concat(x, this.getY().toArray('be', len));
27348
+ };
27349
+
27350
+ BasePoint.prototype.encode = function encode(enc, compact) {
27351
+ return utils.encode(this._encode(compact), enc);
27352
+ };
27353
+
27354
+ BasePoint.prototype.precompute = function precompute(power) {
27355
+ if (this.precomputed)
27356
+ return this;
27357
+
27358
+ var precomputed = {
27359
+ doubles: null,
27360
+ naf: null,
27361
+ beta: null,
27362
+ };
27363
+ precomputed.naf = this._getNAFPoints(8);
27364
+ precomputed.doubles = this._getDoubles(4, power);
27365
+ precomputed.beta = this._getBeta();
27366
+ this.precomputed = precomputed;
27367
+
27368
+ return this;
27369
+ };
27370
+
27371
+ BasePoint.prototype._hasDoubles = function _hasDoubles(k) {
27372
+ if (!this.precomputed)
27373
+ return false;
27374
+
27375
+ var doubles = this.precomputed.doubles;
27376
+ if (!doubles)
27377
+ return false;
27378
+
27379
+ return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);
27380
+ };
27381
+
27382
+ BasePoint.prototype._getDoubles = function _getDoubles(step, power) {
27383
+ if (this.precomputed && this.precomputed.doubles)
27384
+ return this.precomputed.doubles;
27385
+
27386
+ var doubles = [ this ];
27387
+ var acc = this;
27388
+ for (var i = 0; i < power; i += step) {
27389
+ for (var j = 0; j < step; j++)
27390
+ acc = acc.dbl();
27391
+ doubles.push(acc);
27392
+ }
27393
+ return {
27394
+ step: step,
27395
+ points: doubles,
27396
+ };
27397
+ };
27398
+
27399
+ BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {
27400
+ if (this.precomputed && this.precomputed.naf)
27401
+ return this.precomputed.naf;
27402
+
27403
+ var res = [ this ];
27404
+ var max = (1 << wnd) - 1;
27405
+ var dbl = max === 1 ? null : this.dbl();
27406
+ for (var i = 1; i < max; i++)
27407
+ res[i] = res[i - 1].add(dbl);
27408
+ return {
27409
+ wnd: wnd,
27410
+ points: res,
27411
+ };
27412
+ };
27413
+
27414
+ BasePoint.prototype._getBeta = function _getBeta() {
27415
+ return null;
27416
+ };
27417
+
27418
+ BasePoint.prototype.dblp = function dblp(k) {
27419
+ var r = this;
27420
+ for (var i = 0; i < k; i++)
27421
+ r = r.dbl();
27422
+ return r;
27423
+ };
27424
+
27425
+ },{"../utils":146,"bn.js":128}],134:[function(require,module,exports){
27426
+ 'use strict';
27427
+
27428
+ var utils = require('../utils');
27429
+ var BN = require('bn.js');
27430
+ var inherits = require('inherits');
27431
+ var Base = require('./base');
27432
+
27433
+ var assert = utils.assert;
27434
+
27435
+ function EdwardsCurve(conf) {
27436
+ // NOTE: Important as we are creating point in Base.call()
27437
+ this.twisted = (conf.a | 0) !== 1;
27438
+ this.mOneA = this.twisted && (conf.a | 0) === -1;
27439
+ this.extended = this.mOneA;
27440
+
27441
+ Base.call(this, 'edwards', conf);
27442
+
27443
+ this.a = new BN(conf.a, 16).umod(this.red.m);
27444
+ this.a = this.a.toRed(this.red);
27445
+ this.c = new BN(conf.c, 16).toRed(this.red);
27446
+ this.c2 = this.c.redSqr();
27447
+ this.d = new BN(conf.d, 16).toRed(this.red);
27448
+ this.dd = this.d.redAdd(this.d);
27449
+
27450
+ assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);
27451
+ this.oneC = (conf.c | 0) === 1;
27452
+ }
27453
+ inherits(EdwardsCurve, Base);
27454
+ module.exports = EdwardsCurve;
27455
+
27456
+ EdwardsCurve.prototype._mulA = function _mulA(num) {
27457
+ if (this.mOneA)
27458
+ return num.redNeg();
27459
+ else
27460
+ return this.a.redMul(num);
27461
+ };
27462
+
27463
+ EdwardsCurve.prototype._mulC = function _mulC(num) {
27464
+ if (this.oneC)
27465
+ return num;
27466
+ else
27467
+ return this.c.redMul(num);
27468
+ };
27469
+
27470
+ // Just for compatibility with Short curve
27471
+ EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {
27472
+ return this.point(x, y, z, t);
27473
+ };
27474
+
27475
+ EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {
27476
+ x = new BN(x, 16);
27477
+ if (!x.red)
27478
+ x = x.toRed(this.red);
27479
+
27480
+ var x2 = x.redSqr();
27481
+ var rhs = this.c2.redSub(this.a.redMul(x2));
27482
+ var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));
27483
+
27484
+ var y2 = rhs.redMul(lhs.redInvm());
27485
+ var y = y2.redSqrt();
27486
+ if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)
27487
+ throw new Error('invalid point');
27488
+
27489
+ var isOdd = y.fromRed().isOdd();
27490
+ if (odd && !isOdd || !odd && isOdd)
27491
+ y = y.redNeg();
27492
+
27493
+ return this.point(x, y);
27494
+ };
27495
+
27496
+ EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {
27497
+ y = new BN(y, 16);
27498
+ if (!y.red)
27499
+ y = y.toRed(this.red);
27500
+
27501
+ // x^2 = (y^2 - c^2) / (c^2 d y^2 - a)
27502
+ var y2 = y.redSqr();
27503
+ var lhs = y2.redSub(this.c2);
27504
+ var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a);
27505
+ var x2 = lhs.redMul(rhs.redInvm());
27506
+
27507
+ if (x2.cmp(this.zero) === 0) {
27508
+ if (odd)
27509
+ throw new Error('invalid point');
27510
+ else
27511
+ return this.point(this.zero, y);
27512
+ }
27513
+
27514
+ var x = x2.redSqrt();
27515
+ if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)
27516
+ throw new Error('invalid point');
27517
+
27518
+ if (x.fromRed().isOdd() !== odd)
27519
+ x = x.redNeg();
27520
+
27521
+ return this.point(x, y);
27522
+ };
27523
+
27524
+ EdwardsCurve.prototype.validate = function validate(point) {
27525
+ if (point.isInfinity())
27526
+ return true;
27527
+
27528
+ // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2)
27529
+ point.normalize();
27530
+
27531
+ var x2 = point.x.redSqr();
27532
+ var y2 = point.y.redSqr();
27533
+ var lhs = x2.redMul(this.a).redAdd(y2);
27534
+ var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));
27535
+
27536
+ return lhs.cmp(rhs) === 0;
27537
+ };
27538
+
27539
+ function Point(curve, x, y, z, t) {
27540
+ Base.BasePoint.call(this, curve, 'projective');
27541
+ if (x === null && y === null && z === null) {
27542
+ this.x = this.curve.zero;
27543
+ this.y = this.curve.one;
27544
+ this.z = this.curve.one;
27545
+ this.t = this.curve.zero;
27546
+ this.zOne = true;
27547
+ } else {
27548
+ this.x = new BN(x, 16);
27549
+ this.y = new BN(y, 16);
27550
+ this.z = z ? new BN(z, 16) : this.curve.one;
27551
+ this.t = t && new BN(t, 16);
27552
+ if (!this.x.red)
27553
+ this.x = this.x.toRed(this.curve.red);
27554
+ if (!this.y.red)
27555
+ this.y = this.y.toRed(this.curve.red);
27556
+ if (!this.z.red)
27557
+ this.z = this.z.toRed(this.curve.red);
27558
+ if (this.t && !this.t.red)
27559
+ this.t = this.t.toRed(this.curve.red);
27560
+ this.zOne = this.z === this.curve.one;
27561
+
27562
+ // Use extended coordinates
27563
+ if (this.curve.extended && !this.t) {
27564
+ this.t = this.x.redMul(this.y);
27565
+ if (!this.zOne)
27566
+ this.t = this.t.redMul(this.z.redInvm());
27567
+ }
27568
+ }
27569
+ }
27570
+ inherits(Point, Base.BasePoint);
27571
+
27572
+ EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
27573
+ return Point.fromJSON(this, obj);
27574
+ };
27575
+
27576
+ EdwardsCurve.prototype.point = function point(x, y, z, t) {
27577
+ return new Point(this, x, y, z, t);
27578
+ };
27579
+
27580
+ Point.fromJSON = function fromJSON(curve, obj) {
27581
+ return new Point(curve, obj[0], obj[1], obj[2]);
27582
+ };
27583
+
27584
+ Point.prototype.inspect = function inspect() {
27585
+ if (this.isInfinity())
27586
+ return '<EC Point Infinity>';
27587
+ return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +
27588
+ ' y: ' + this.y.fromRed().toString(16, 2) +
27589
+ ' z: ' + this.z.fromRed().toString(16, 2) + '>';
27590
+ };
27591
+
27592
+ Point.prototype.isInfinity = function isInfinity() {
27593
+ // XXX This code assumes that zero is always zero in red
27594
+ return this.x.cmpn(0) === 0 &&
27595
+ (this.y.cmp(this.z) === 0 ||
27596
+ (this.zOne && this.y.cmp(this.curve.c) === 0));
27597
+ };
27598
+
27599
+ Point.prototype._extDbl = function _extDbl() {
27600
+ // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
27601
+ // #doubling-dbl-2008-hwcd
27602
+ // 4M + 4S
27603
+
27604
+ // A = X1^2
27605
+ var a = this.x.redSqr();
27606
+ // B = Y1^2
27607
+ var b = this.y.redSqr();
27608
+ // C = 2 * Z1^2
27609
+ var c = this.z.redSqr();
27610
+ c = c.redIAdd(c);
27611
+ // D = a * A
27612
+ var d = this.curve._mulA(a);
27613
+ // E = (X1 + Y1)^2 - A - B
27614
+ var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);
27059
27615
  // G = D + B
27060
27616
  var g = d.redAdd(b);
27061
27617
  // F = G - C
@@ -27303,7 +27859,7 @@ Point.prototype.eqXToP = function eqXToP(x) {
27303
27859
  Point.prototype.toP = Point.prototype.normalize;
27304
27860
  Point.prototype.mixedAdd = Point.prototype.add;
27305
27861
 
27306
- },{"../utils":145,"./base":132,"bn.js":128,"inherits":303}],134:[function(require,module,exports){
27862
+ },{"../utils":146,"./base":133,"bn.js":128,"inherits":303}],135:[function(require,module,exports){
27307
27863
  'use strict';
27308
27864
 
27309
27865
  var curve = exports;
@@ -27313,7 +27869,7 @@ curve.short = require('./short');
27313
27869
  curve.mont = require('./mont');
27314
27870
  curve.edwards = require('./edwards');
27315
27871
 
27316
- },{"./base":132,"./edwards":133,"./mont":135,"./short":136}],135:[function(require,module,exports){
27872
+ },{"./base":133,"./edwards":134,"./mont":136,"./short":137}],136:[function(require,module,exports){
27317
27873
  'use strict';
27318
27874
 
27319
27875
  var BN = require('bn.js');
@@ -27493,7 +28049,7 @@ Point.prototype.getX = function getX() {
27493
28049
  return this.x.fromRed();
27494
28050
  };
27495
28051
 
27496
- },{"../utils":145,"./base":132,"bn.js":128,"inherits":303}],136:[function(require,module,exports){
28052
+ },{"../utils":146,"./base":133,"bn.js":128,"inherits":303}],137:[function(require,module,exports){
27497
28053
  'use strict';
27498
28054
 
27499
28055
  var utils = require('../utils');
@@ -28433,7 +28989,7 @@ JPoint.prototype.isInfinity = function isInfinity() {
28433
28989
  return this.z.cmpn(0) === 0;
28434
28990
  };
28435
28991
 
28436
- },{"../utils":145,"./base":132,"bn.js":128,"inherits":303}],137:[function(require,module,exports){
28992
+ },{"../utils":146,"./base":133,"bn.js":128,"inherits":303}],138:[function(require,module,exports){
28437
28993
  'use strict';
28438
28994
 
28439
28995
  var curves = exports;
@@ -28641,7 +29197,7 @@ defineCurve('secp256k1', {
28641
29197
  ],
28642
29198
  });
28643
29199
 
28644
- },{"./curve":134,"./precomputed/secp256k1":144,"./utils":145,"hash.js":290}],138:[function(require,module,exports){
29200
+ },{"./curve":135,"./precomputed/secp256k1":145,"./utils":146,"hash.js":290}],139:[function(require,module,exports){
28645
29201
  'use strict';
28646
29202
 
28647
29203
  var BN = require('bn.js');
@@ -28886,7 +29442,7 @@ EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {
28886
29442
  throw new Error('Unable to find valid recovery factor');
28887
29443
  };
28888
29444
 
28889
- },{"../curves":137,"../utils":145,"./key":139,"./signature":140,"bn.js":128,"brorand":129,"hmac-drbg":302}],139:[function(require,module,exports){
29445
+ },{"../curves":138,"../utils":146,"./key":140,"./signature":141,"bn.js":128,"brorand":129,"hmac-drbg":302}],140:[function(require,module,exports){
28890
29446
  'use strict';
28891
29447
 
28892
29448
  var BN = require('bn.js');
@@ -29009,7 +29565,7 @@ KeyPair.prototype.inspect = function inspect() {
29009
29565
  ' pub: ' + (this.pub && this.pub.inspect()) + ' >';
29010
29566
  };
29011
29567
 
29012
- },{"../utils":145,"bn.js":128}],140:[function(require,module,exports){
29568
+ },{"../utils":146,"bn.js":128}],141:[function(require,module,exports){
29013
29569
  'use strict';
29014
29570
 
29015
29571
  var BN = require('bn.js');
@@ -29177,7 +29733,7 @@ Signature.prototype.toDER = function toDER(enc) {
29177
29733
  return utils.encode(res, enc);
29178
29734
  };
29179
29735
 
29180
- },{"../utils":145,"bn.js":128}],141:[function(require,module,exports){
29736
+ },{"../utils":146,"bn.js":128}],142:[function(require,module,exports){
29181
29737
  'use strict';
29182
29738
 
29183
29739
  var hash = require('hash.js');
@@ -29297,7 +29853,7 @@ EDDSA.prototype.isPoint = function isPoint(val) {
29297
29853
  return val instanceof this.pointClass;
29298
29854
  };
29299
29855
 
29300
- },{"../curves":137,"../utils":145,"./key":142,"./signature":143,"hash.js":290}],142:[function(require,module,exports){
29856
+ },{"../curves":138,"../utils":146,"./key":143,"./signature":144,"hash.js":290}],143:[function(require,module,exports){
29301
29857
  'use strict';
29302
29858
 
29303
29859
  var utils = require('../utils');
@@ -29394,7 +29950,7 @@ KeyPair.prototype.getPublic = function getPublic(enc) {
29394
29950
 
29395
29951
  module.exports = KeyPair;
29396
29952
 
29397
- },{"../utils":145}],143:[function(require,module,exports){
29953
+ },{"../utils":146}],144:[function(require,module,exports){
29398
29954
  'use strict';
29399
29955
 
29400
29956
  var BN = require('bn.js');
@@ -29461,7 +30017,7 @@ Signature.prototype.toHex = function toHex() {
29461
30017
 
29462
30018
  module.exports = Signature;
29463
30019
 
29464
- },{"../utils":145,"bn.js":128}],144:[function(require,module,exports){
30020
+ },{"../utils":146,"bn.js":128}],145:[function(require,module,exports){
29465
30021
  module.exports = {
29466
30022
  doubles: {
29467
30023
  step: 4,
@@ -30243,7 +30799,7 @@ module.exports = {
30243
30799
  },
30244
30800
  };
30245
30801
 
30246
- },{}],145:[function(require,module,exports){
30802
+ },{}],146:[function(require,module,exports){
30247
30803
  'use strict';
30248
30804
 
30249
30805
  var utils = exports;
@@ -30364,7 +30920,7 @@ function intFromLE(bytes) {
30364
30920
  utils.intFromLE = intFromLE;
30365
30921
 
30366
30922
 
30367
- },{"bn.js":128,"minimalistic-assert":306,"minimalistic-crypto-utils":307}],146:[function(require,module,exports){
30923
+ },{"bn.js":128,"minimalistic-assert":306,"minimalistic-crypto-utils":307}],147:[function(require,module,exports){
30368
30924
  module.exports={
30369
30925
  "name": "elliptic",
30370
30926
  "version": "6.5.4",
@@ -30422,13 +30978,13 @@ module.exports={
30422
30978
  }
30423
30979
  }
30424
30980
 
30425
- },{}],147:[function(require,module,exports){
30981
+ },{}],148:[function(require,module,exports){
30426
30982
  "use strict";
30427
30983
  Object.defineProperty(exports, "__esModule", { value: true });
30428
30984
  exports.version = void 0;
30429
30985
  exports.version = "ethers/5.6.9";
30430
30986
 
30431
- },{}],148:[function(require,module,exports){
30987
+ },{}],149:[function(require,module,exports){
30432
30988
  "use strict";
30433
30989
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
30434
30990
  if (k2 === undefined) k2 = k;
@@ -30484,7 +31040,7 @@ Object.defineProperty(exports, "version", { enumerable: true, get: function () {
30484
31040
  var logger = new logger_1.Logger(_version_1.version);
30485
31041
  exports.logger = logger;
30486
31042
 
30487
- },{"./_version":147,"./utils":150,"@ethersproject/abstract-signer":20,"@ethersproject/bignumber":29,"@ethersproject/constants":36,"@ethersproject/contracts":39,"@ethersproject/logger":56,"@ethersproject/providers":73,"@ethersproject/wallet":107,"@ethersproject/wordlists":112}],149:[function(require,module,exports){
31043
+ },{"./_version":148,"./utils":151,"@ethersproject/abstract-signer":20,"@ethersproject/bignumber":29,"@ethersproject/constants":36,"@ethersproject/contracts":39,"@ethersproject/logger":56,"@ethersproject/providers":73,"@ethersproject/wallet":107,"@ethersproject/wordlists":112}],150:[function(require,module,exports){
30488
31044
  "use strict";
30489
31045
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
30490
31046
  if (k2 === undefined) k2 = k;
@@ -30538,7 +31094,7 @@ Object.defineProperty(exports, "wordlists", { enumerable: true, get: function ()
30538
31094
  Object.defineProperty(exports, "version", { enumerable: true, get: function () { return ethers_1.version; } });
30539
31095
  Object.defineProperty(exports, "Wordlist", { enumerable: true, get: function () { return ethers_1.Wordlist; } });
30540
31096
 
30541
- },{"./ethers":148}],150:[function(require,module,exports){
31097
+ },{"./ethers":149}],151:[function(require,module,exports){
30542
31098
  "use strict";
30543
31099
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
30544
31100
  if (k2 === undefined) k2 = k;
@@ -30687,7 +31243,7 @@ var strings_2 = require("@ethersproject/strings");
30687
31243
  Object.defineProperty(exports, "UnicodeNormalizationForm", { enumerable: true, get: function () { return strings_2.UnicodeNormalizationForm; } });
30688
31244
  Object.defineProperty(exports, "Utf8ErrorReason", { enumerable: true, get: function () { return strings_2.Utf8ErrorReason; } });
30689
31245
 
30690
- },{"@ethersproject/abi":15,"@ethersproject/address":22,"@ethersproject/base64":24,"@ethersproject/basex":25,"@ethersproject/bytes":32,"@ethersproject/hash":42,"@ethersproject/hdnode":47,"@ethersproject/json-wallets":50,"@ethersproject/keccak256":54,"@ethersproject/logger":56,"@ethersproject/properties":62,"@ethersproject/random":84,"@ethersproject/rlp":87,"@ethersproject/sha2":90,"@ethersproject/signing-key":94,"@ethersproject/solidity":96,"@ethersproject/strings":100,"@ethersproject/transactions":103,"@ethersproject/units":105,"@ethersproject/wallet":107,"@ethersproject/web":110}],151:[function(require,module,exports){
31246
+ },{"@ethersproject/abi":15,"@ethersproject/address":22,"@ethersproject/base64":24,"@ethersproject/basex":25,"@ethersproject/bytes":32,"@ethersproject/hash":42,"@ethersproject/hdnode":47,"@ethersproject/json-wallets":50,"@ethersproject/keccak256":54,"@ethersproject/logger":56,"@ethersproject/properties":62,"@ethersproject/random":84,"@ethersproject/rlp":87,"@ethersproject/sha2":90,"@ethersproject/signing-key":94,"@ethersproject/solidity":96,"@ethersproject/strings":100,"@ethersproject/transactions":103,"@ethersproject/units":105,"@ethersproject/wallet":107,"@ethersproject/web":110}],152:[function(require,module,exports){
30691
31247
  'use strict';
30692
31248
 
30693
31249
  module.exports = function ReactNativeFile(_ref) {
@@ -30699,7 +31255,7 @@ module.exports = function ReactNativeFile(_ref) {
30699
31255
  this.type = type;
30700
31256
  };
30701
31257
 
30702
- },{}],152:[function(require,module,exports){
31258
+ },{}],153:[function(require,module,exports){
30703
31259
  'use strict';
30704
31260
 
30705
31261
  var defaultIsExtractableFile = require('./isExtractableFile');
@@ -30755,14 +31311,14 @@ module.exports = function extractFiles(value, path, isExtractableFile) {
30755
31311
  };
30756
31312
  };
30757
31313
 
30758
- },{"./isExtractableFile":154}],153:[function(require,module,exports){
31314
+ },{"./isExtractableFile":155}],154:[function(require,module,exports){
30759
31315
  'use strict';
30760
31316
 
30761
31317
  exports.ReactNativeFile = require('./ReactNativeFile');
30762
31318
  exports.extractFiles = require('./extractFiles');
30763
31319
  exports.isExtractableFile = require('./isExtractableFile');
30764
31320
 
30765
- },{"./ReactNativeFile":151,"./extractFiles":152,"./isExtractableFile":154}],154:[function(require,module,exports){
31321
+ },{"./ReactNativeFile":152,"./extractFiles":153,"./isExtractableFile":155}],155:[function(require,module,exports){
30766
31322
  'use strict';
30767
31323
 
30768
31324
  var ReactNativeFile = require('./ReactNativeFile');
@@ -30775,11 +31331,11 @@ module.exports = function isExtractableFile(value) {
30775
31331
  );
30776
31332
  };
30777
31333
 
30778
- },{"./ReactNativeFile":151}],155:[function(require,module,exports){
31334
+ },{"./ReactNativeFile":152}],156:[function(require,module,exports){
30779
31335
  /* eslint-env browser */
30780
31336
  module.exports = typeof self == 'object' ? self.FormData : window.FormData;
30781
31337
 
30782
- },{}],156:[function(require,module,exports){
31338
+ },{}],157:[function(require,module,exports){
30783
31339
  "use strict";
30784
31340
  var __importDefault = (this && this.__importDefault) || function (mod) {
30785
31341
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -30835,7 +31391,7 @@ function createRequestBody(query, variables, operationName, jsonSerializer) {
30835
31391
  }
30836
31392
  exports.default = createRequestBody;
30837
31393
 
30838
- },{"./defaultJsonSerializer":157,"extract-files":153,"form-data":155}],157:[function(require,module,exports){
31394
+ },{"./defaultJsonSerializer":158,"extract-files":154,"form-data":156}],158:[function(require,module,exports){
30839
31395
  "use strict";
30840
31396
  Object.defineProperty(exports, "__esModule", { value: true });
30841
31397
  exports.defaultJsonSerializer = void 0;
@@ -30844,7 +31400,7 @@ exports.defaultJsonSerializer = {
30844
31400
  stringify: JSON.stringify
30845
31401
  };
30846
31402
 
30847
- },{}],158:[function(require,module,exports){
31403
+ },{}],159:[function(require,module,exports){
30848
31404
  "use strict";
30849
31405
  var __assign = (this && this.__assign) || function () {
30850
31406
  __assign = Object.assign || function(t) {
@@ -31119,7 +31675,7 @@ function Complete(id) {
31119
31675
  return new GraphQLWebSocketMessage(COMPLETE, undefined, id);
31120
31676
  }
31121
31677
 
31122
- },{".":159,"./types":161}],159:[function(require,module,exports){
31678
+ },{".":160,"./types":162}],160:[function(require,module,exports){
31123
31679
  "use strict";
31124
31680
  var __assign = (this && this.__assign) || function () {
31125
31681
  __assign = Object.assign || function(t) {
@@ -31577,713 +32133,157 @@ function callOrIdentity(value) {
31577
32133
  /**
31578
32134
  * Convenience passthrough template tag to get the benefits of tooling for the gql template tag. This does not actually parse the input into a GraphQL DocumentNode like graphql-tag package does. It just returns the string with any variables given interpolated. Can save you a bit of performance and having to install another package.
31579
32135
  *
31580
- * @example
31581
- *
31582
- * import { gql } from 'graphql-request'
31583
- *
31584
- * await request('https://foo.bar/graphql', gql`...`)
31585
- *
31586
- * @remarks
31587
- *
31588
- * Several tools in the Node GraphQL ecosystem are hardcoded to specially treat any template tag named "gql". For example see this prettier issue: https://github.com/prettier/prettier/issues/4360. Using this template tag has no runtime effect beyond variable interpolation.
31589
- */
31590
- function gql(chunks) {
31591
- var variables = [];
31592
- for (var _i = 1; _i < arguments.length; _i++) {
31593
- variables[_i - 1] = arguments[_i];
31594
- }
31595
- return chunks.reduce(function (accumulator, chunk, index) { return "" + accumulator + chunk + (index in variables ? variables[index] : ''); }, '');
31596
- }
31597
- exports.gql = gql;
31598
- /**
31599
- * Convert Headers instance into regular object
31600
- */
31601
- function HeadersInstanceToPlainObject(headers) {
31602
- var o = {};
31603
- headers.forEach(function (v, k) {
31604
- o[k] = v;
31605
- });
31606
- return o;
31607
- }
31608
- var graphql_ws_1 = require("./graphql-ws");
31609
- Object.defineProperty(exports, "GraphQLWebSocketClient", { enumerable: true, get: function () { return graphql_ws_1.GraphQLWebSocketClient; } });
31610
-
31611
- },{"./createRequestBody":156,"./defaultJsonSerializer":157,"./graphql-ws":158,"./parseArgs":160,"./types":161,"cross-fetch":162,"graphql/language/parser":203,"graphql/language/printer":206}],160:[function(require,module,exports){
31612
- "use strict";
31613
- Object.defineProperty(exports, "__esModule", { value: true });
31614
- exports.parseBatchRequestsExtendedArgs = exports.parseRawRequestExtendedArgs = exports.parseRequestExtendedArgs = exports.parseBatchRequestArgs = exports.parseRawRequestArgs = exports.parseRequestArgs = void 0;
31615
- function parseRequestArgs(documentOrOptions, variables, requestHeaders) {
31616
- return documentOrOptions.document
31617
- ? documentOrOptions
31618
- : {
31619
- document: documentOrOptions,
31620
- variables: variables,
31621
- requestHeaders: requestHeaders,
31622
- signal: undefined,
31623
- };
31624
- }
31625
- exports.parseRequestArgs = parseRequestArgs;
31626
- function parseRawRequestArgs(queryOrOptions, variables, requestHeaders) {
31627
- return queryOrOptions.query
31628
- ? queryOrOptions
31629
- : {
31630
- query: queryOrOptions,
31631
- variables: variables,
31632
- requestHeaders: requestHeaders,
31633
- signal: undefined,
31634
- };
31635
- }
31636
- exports.parseRawRequestArgs = parseRawRequestArgs;
31637
- function parseBatchRequestArgs(documentsOrOptions, requestHeaders) {
31638
- return documentsOrOptions.documents
31639
- ? documentsOrOptions
31640
- : {
31641
- documents: documentsOrOptions,
31642
- requestHeaders: requestHeaders,
31643
- signal: undefined,
31644
- };
31645
- }
31646
- exports.parseBatchRequestArgs = parseBatchRequestArgs;
31647
- function parseRequestExtendedArgs(urlOrOptions, document, variables, requestHeaders) {
31648
- return urlOrOptions.document
31649
- ? urlOrOptions
31650
- : {
31651
- url: urlOrOptions,
31652
- document: document,
31653
- variables: variables,
31654
- requestHeaders: requestHeaders,
31655
- signal: undefined,
31656
- };
31657
- }
31658
- exports.parseRequestExtendedArgs = parseRequestExtendedArgs;
31659
- function parseRawRequestExtendedArgs(urlOrOptions, query, variables, requestHeaders) {
31660
- return urlOrOptions.query
31661
- ? urlOrOptions
31662
- : {
31663
- url: urlOrOptions,
31664
- query: query,
31665
- variables: variables,
31666
- requestHeaders: requestHeaders,
31667
- signal: undefined,
31668
- };
31669
- }
31670
- exports.parseRawRequestExtendedArgs = parseRawRequestExtendedArgs;
31671
- function parseBatchRequestsExtendedArgs(urlOrOptions, documents, requestHeaders) {
31672
- return urlOrOptions.documents
31673
- ? urlOrOptions
31674
- : {
31675
- url: urlOrOptions,
31676
- documents: documents,
31677
- requestHeaders: requestHeaders,
31678
- signal: undefined,
31679
- };
31680
- }
31681
- exports.parseBatchRequestsExtendedArgs = parseBatchRequestsExtendedArgs;
31682
-
31683
- },{}],161:[function(require,module,exports){
31684
- "use strict";
31685
- var __extends = (this && this.__extends) || (function () {
31686
- var extendStatics = function (d, b) {
31687
- extendStatics = Object.setPrototypeOf ||
31688
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
31689
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
31690
- return extendStatics(d, b);
31691
- };
31692
- return function (d, b) {
31693
- if (typeof b !== "function" && b !== null)
31694
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
31695
- extendStatics(d, b);
31696
- function __() { this.constructor = d; }
31697
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
31698
- };
31699
- })();
31700
- Object.defineProperty(exports, "__esModule", { value: true });
31701
- exports.ClientError = void 0;
31702
- var ClientError = /** @class */ (function (_super) {
31703
- __extends(ClientError, _super);
31704
- function ClientError(response, request) {
31705
- var _this = this;
31706
- var message = ClientError.extractMessage(response) + ": " + JSON.stringify({
31707
- response: response,
31708
- request: request,
31709
- });
31710
- _this = _super.call(this, message) || this;
31711
- Object.setPrototypeOf(_this, ClientError.prototype);
31712
- _this.response = response;
31713
- _this.request = request;
31714
- // this is needed as Safari doesn't support .captureStackTrace
31715
- if (typeof Error.captureStackTrace === 'function') {
31716
- Error.captureStackTrace(_this, ClientError);
31717
- }
31718
- return _this;
31719
- }
31720
- ClientError.extractMessage = function (response) {
31721
- try {
31722
- return response.errors[0].message;
31723
- }
31724
- catch (e) {
31725
- return "GraphQL Error (Code: " + response.status + ")";
31726
- }
31727
- };
31728
- return ClientError;
31729
- }(Error));
31730
- exports.ClientError = ClientError;
31731
-
31732
- },{}],162:[function(require,module,exports){
31733
- var global = typeof self !== 'undefined' ? self : this;
31734
- var __self__ = (function () {
31735
- function F() {
31736
- this.fetch = false;
31737
- this.DOMException = global.DOMException
31738
- }
31739
- F.prototype = global;
31740
- return new F();
31741
- })();
31742
- (function(self) {
31743
-
31744
- var irrelevant = (function (exports) {
31745
-
31746
- var support = {
31747
- searchParams: 'URLSearchParams' in self,
31748
- iterable: 'Symbol' in self && 'iterator' in Symbol,
31749
- blob:
31750
- 'FileReader' in self &&
31751
- 'Blob' in self &&
31752
- (function() {
31753
- try {
31754
- new Blob();
31755
- return true
31756
- } catch (e) {
31757
- return false
31758
- }
31759
- })(),
31760
- formData: 'FormData' in self,
31761
- arrayBuffer: 'ArrayBuffer' in self
31762
- };
31763
-
31764
- function isDataView(obj) {
31765
- return obj && DataView.prototype.isPrototypeOf(obj)
31766
- }
31767
-
31768
- if (support.arrayBuffer) {
31769
- var viewClasses = [
31770
- '[object Int8Array]',
31771
- '[object Uint8Array]',
31772
- '[object Uint8ClampedArray]',
31773
- '[object Int16Array]',
31774
- '[object Uint16Array]',
31775
- '[object Int32Array]',
31776
- '[object Uint32Array]',
31777
- '[object Float32Array]',
31778
- '[object Float64Array]'
31779
- ];
31780
-
31781
- var isArrayBufferView =
31782
- ArrayBuffer.isView ||
31783
- function(obj) {
31784
- return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
31785
- };
31786
- }
31787
-
31788
- function normalizeName(name) {
31789
- if (typeof name !== 'string') {
31790
- name = String(name);
31791
- }
31792
- if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) {
31793
- throw new TypeError('Invalid character in header field name')
31794
- }
31795
- return name.toLowerCase()
31796
- }
31797
-
31798
- function normalizeValue(value) {
31799
- if (typeof value !== 'string') {
31800
- value = String(value);
31801
- }
31802
- return value
31803
- }
31804
-
31805
- // Build a destructive iterator for the value list
31806
- function iteratorFor(items) {
31807
- var iterator = {
31808
- next: function() {
31809
- var value = items.shift();
31810
- return {done: value === undefined, value: value}
31811
- }
31812
- };
31813
-
31814
- if (support.iterable) {
31815
- iterator[Symbol.iterator] = function() {
31816
- return iterator
31817
- };
31818
- }
31819
-
31820
- return iterator
31821
- }
31822
-
31823
- function Headers(headers) {
31824
- this.map = {};
31825
-
31826
- if (headers instanceof Headers) {
31827
- headers.forEach(function(value, name) {
31828
- this.append(name, value);
31829
- }, this);
31830
- } else if (Array.isArray(headers)) {
31831
- headers.forEach(function(header) {
31832
- this.append(header[0], header[1]);
31833
- }, this);
31834
- } else if (headers) {
31835
- Object.getOwnPropertyNames(headers).forEach(function(name) {
31836
- this.append(name, headers[name]);
31837
- }, this);
31838
- }
31839
- }
31840
-
31841
- Headers.prototype.append = function(name, value) {
31842
- name = normalizeName(name);
31843
- value = normalizeValue(value);
31844
- var oldValue = this.map[name];
31845
- this.map[name] = oldValue ? oldValue + ', ' + value : value;
31846
- };
31847
-
31848
- Headers.prototype['delete'] = function(name) {
31849
- delete this.map[normalizeName(name)];
31850
- };
31851
-
31852
- Headers.prototype.get = function(name) {
31853
- name = normalizeName(name);
31854
- return this.has(name) ? this.map[name] : null
31855
- };
31856
-
31857
- Headers.prototype.has = function(name) {
31858
- return this.map.hasOwnProperty(normalizeName(name))
31859
- };
31860
-
31861
- Headers.prototype.set = function(name, value) {
31862
- this.map[normalizeName(name)] = normalizeValue(value);
31863
- };
31864
-
31865
- Headers.prototype.forEach = function(callback, thisArg) {
31866
- for (var name in this.map) {
31867
- if (this.map.hasOwnProperty(name)) {
31868
- callback.call(thisArg, this.map[name], name, this);
31869
- }
31870
- }
31871
- };
31872
-
31873
- Headers.prototype.keys = function() {
31874
- var items = [];
31875
- this.forEach(function(value, name) {
31876
- items.push(name);
31877
- });
31878
- return iteratorFor(items)
31879
- };
31880
-
31881
- Headers.prototype.values = function() {
31882
- var items = [];
31883
- this.forEach(function(value) {
31884
- items.push(value);
31885
- });
31886
- return iteratorFor(items)
31887
- };
31888
-
31889
- Headers.prototype.entries = function() {
31890
- var items = [];
31891
- this.forEach(function(value, name) {
31892
- items.push([name, value]);
31893
- });
31894
- return iteratorFor(items)
31895
- };
31896
-
31897
- if (support.iterable) {
31898
- Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
31899
- }
31900
-
31901
- function consumed(body) {
31902
- if (body.bodyUsed) {
31903
- return Promise.reject(new TypeError('Already read'))
31904
- }
31905
- body.bodyUsed = true;
31906
- }
31907
-
31908
- function fileReaderReady(reader) {
31909
- return new Promise(function(resolve, reject) {
31910
- reader.onload = function() {
31911
- resolve(reader.result);
31912
- };
31913
- reader.onerror = function() {
31914
- reject(reader.error);
31915
- };
31916
- })
31917
- }
31918
-
31919
- function readBlobAsArrayBuffer(blob) {
31920
- var reader = new FileReader();
31921
- var promise = fileReaderReady(reader);
31922
- reader.readAsArrayBuffer(blob);
31923
- return promise
31924
- }
31925
-
31926
- function readBlobAsText(blob) {
31927
- var reader = new FileReader();
31928
- var promise = fileReaderReady(reader);
31929
- reader.readAsText(blob);
31930
- return promise
31931
- }
31932
-
31933
- function readArrayBufferAsText(buf) {
31934
- var view = new Uint8Array(buf);
31935
- var chars = new Array(view.length);
31936
-
31937
- for (var i = 0; i < view.length; i++) {
31938
- chars[i] = String.fromCharCode(view[i]);
31939
- }
31940
- return chars.join('')
31941
- }
31942
-
31943
- function bufferClone(buf) {
31944
- if (buf.slice) {
31945
- return buf.slice(0)
31946
- } else {
31947
- var view = new Uint8Array(buf.byteLength);
31948
- view.set(new Uint8Array(buf));
31949
- return view.buffer
31950
- }
31951
- }
31952
-
31953
- function Body() {
31954
- this.bodyUsed = false;
31955
-
31956
- this._initBody = function(body) {
31957
- this._bodyInit = body;
31958
- if (!body) {
31959
- this._bodyText = '';
31960
- } else if (typeof body === 'string') {
31961
- this._bodyText = body;
31962
- } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
31963
- this._bodyBlob = body;
31964
- } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
31965
- this._bodyFormData = body;
31966
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
31967
- this._bodyText = body.toString();
31968
- } else if (support.arrayBuffer && support.blob && isDataView(body)) {
31969
- this._bodyArrayBuffer = bufferClone(body.buffer);
31970
- // IE 10-11 can't handle a DataView body.
31971
- this._bodyInit = new Blob([this._bodyArrayBuffer]);
31972
- } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
31973
- this._bodyArrayBuffer = bufferClone(body);
31974
- } else {
31975
- this._bodyText = body = Object.prototype.toString.call(body);
31976
- }
31977
-
31978
- if (!this.headers.get('content-type')) {
31979
- if (typeof body === 'string') {
31980
- this.headers.set('content-type', 'text/plain;charset=UTF-8');
31981
- } else if (this._bodyBlob && this._bodyBlob.type) {
31982
- this.headers.set('content-type', this._bodyBlob.type);
31983
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
31984
- this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
31985
- }
31986
- }
31987
- };
31988
-
31989
- if (support.blob) {
31990
- this.blob = function() {
31991
- var rejected = consumed(this);
31992
- if (rejected) {
31993
- return rejected
31994
- }
31995
-
31996
- if (this._bodyBlob) {
31997
- return Promise.resolve(this._bodyBlob)
31998
- } else if (this._bodyArrayBuffer) {
31999
- return Promise.resolve(new Blob([this._bodyArrayBuffer]))
32000
- } else if (this._bodyFormData) {
32001
- throw new Error('could not read FormData body as blob')
32002
- } else {
32003
- return Promise.resolve(new Blob([this._bodyText]))
32004
- }
32005
- };
32006
-
32007
- this.arrayBuffer = function() {
32008
- if (this._bodyArrayBuffer) {
32009
- return consumed(this) || Promise.resolve(this._bodyArrayBuffer)
32010
- } else {
32011
- return this.blob().then(readBlobAsArrayBuffer)
32012
- }
32013
- };
32014
- }
32015
-
32016
- this.text = function() {
32017
- var rejected = consumed(this);
32018
- if (rejected) {
32019
- return rejected
32020
- }
32021
-
32022
- if (this._bodyBlob) {
32023
- return readBlobAsText(this._bodyBlob)
32024
- } else if (this._bodyArrayBuffer) {
32025
- return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
32026
- } else if (this._bodyFormData) {
32027
- throw new Error('could not read FormData body as text')
32028
- } else {
32029
- return Promise.resolve(this._bodyText)
32030
- }
32031
- };
32032
-
32033
- if (support.formData) {
32034
- this.formData = function() {
32035
- return this.text().then(decode)
32036
- };
32037
- }
32038
-
32039
- this.json = function() {
32040
- return this.text().then(JSON.parse)
32041
- };
32042
-
32043
- return this
32044
- }
32045
-
32046
- // HTTP methods whose capitalization should be normalized
32047
- var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
32048
-
32049
- function normalizeMethod(method) {
32050
- var upcased = method.toUpperCase();
32051
- return methods.indexOf(upcased) > -1 ? upcased : method
32052
- }
32053
-
32054
- function Request(input, options) {
32055
- options = options || {};
32056
- var body = options.body;
32057
-
32058
- if (input instanceof Request) {
32059
- if (input.bodyUsed) {
32060
- throw new TypeError('Already read')
32061
- }
32062
- this.url = input.url;
32063
- this.credentials = input.credentials;
32064
- if (!options.headers) {
32065
- this.headers = new Headers(input.headers);
32066
- }
32067
- this.method = input.method;
32068
- this.mode = input.mode;
32069
- this.signal = input.signal;
32070
- if (!body && input._bodyInit != null) {
32071
- body = input._bodyInit;
32072
- input.bodyUsed = true;
32073
- }
32074
- } else {
32075
- this.url = String(input);
32076
- }
32077
-
32078
- this.credentials = options.credentials || this.credentials || 'same-origin';
32079
- if (options.headers || !this.headers) {
32080
- this.headers = new Headers(options.headers);
32081
- }
32082
- this.method = normalizeMethod(options.method || this.method || 'GET');
32083
- this.mode = options.mode || this.mode || null;
32084
- this.signal = options.signal || this.signal;
32085
- this.referrer = null;
32086
-
32087
- if ((this.method === 'GET' || this.method === 'HEAD') && body) {
32088
- throw new TypeError('Body not allowed for GET or HEAD requests')
32089
- }
32090
- this._initBody(body);
32091
- }
32092
-
32093
- Request.prototype.clone = function() {
32094
- return new Request(this, {body: this._bodyInit})
32095
- };
32096
-
32097
- function decode(body) {
32098
- var form = new FormData();
32099
- body
32100
- .trim()
32101
- .split('&')
32102
- .forEach(function(bytes) {
32103
- if (bytes) {
32104
- var split = bytes.split('=');
32105
- var name = split.shift().replace(/\+/g, ' ');
32106
- var value = split.join('=').replace(/\+/g, ' ');
32107
- form.append(decodeURIComponent(name), decodeURIComponent(value));
32108
- }
32109
- });
32110
- return form
32111
- }
32112
-
32113
- function parseHeaders(rawHeaders) {
32114
- var headers = new Headers();
32115
- // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
32116
- // https://tools.ietf.org/html/rfc7230#section-3.2
32117
- var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
32118
- preProcessedHeaders.split(/\r?\n/).forEach(function(line) {
32119
- var parts = line.split(':');
32120
- var key = parts.shift().trim();
32121
- if (key) {
32122
- var value = parts.join(':').trim();
32123
- headers.append(key, value);
32124
- }
32125
- });
32126
- return headers
32127
- }
32128
-
32129
- Body.call(Request.prototype);
32130
-
32131
- function Response(bodyInit, options) {
32132
- if (!options) {
32133
- options = {};
32134
- }
32135
-
32136
- this.type = 'default';
32137
- this.status = options.status === undefined ? 200 : options.status;
32138
- this.ok = this.status >= 200 && this.status < 300;
32139
- this.statusText = 'statusText' in options ? options.statusText : 'OK';
32140
- this.headers = new Headers(options.headers);
32141
- this.url = options.url || '';
32142
- this._initBody(bodyInit);
32143
- }
32144
-
32145
- Body.call(Response.prototype);
32146
-
32147
- Response.prototype.clone = function() {
32148
- return new Response(this._bodyInit, {
32149
- status: this.status,
32150
- statusText: this.statusText,
32151
- headers: new Headers(this.headers),
32152
- url: this.url
32153
- })
32154
- };
32155
-
32156
- Response.error = function() {
32157
- var response = new Response(null, {status: 0, statusText: ''});
32158
- response.type = 'error';
32159
- return response
32160
- };
32161
-
32162
- var redirectStatuses = [301, 302, 303, 307, 308];
32163
-
32164
- Response.redirect = function(url, status) {
32165
- if (redirectStatuses.indexOf(status) === -1) {
32166
- throw new RangeError('Invalid status code')
32136
+ * @example
32137
+ *
32138
+ * import { gql } from 'graphql-request'
32139
+ *
32140
+ * await request('https://foo.bar/graphql', gql`...`)
32141
+ *
32142
+ * @remarks
32143
+ *
32144
+ * Several tools in the Node GraphQL ecosystem are hardcoded to specially treat any template tag named "gql". For example see this prettier issue: https://github.com/prettier/prettier/issues/4360. Using this template tag has no runtime effect beyond variable interpolation.
32145
+ */
32146
+ function gql(chunks) {
32147
+ var variables = [];
32148
+ for (var _i = 1; _i < arguments.length; _i++) {
32149
+ variables[_i - 1] = arguments[_i];
32167
32150
  }
32151
+ return chunks.reduce(function (accumulator, chunk, index) { return "" + accumulator + chunk + (index in variables ? variables[index] : ''); }, '');
32152
+ }
32153
+ exports.gql = gql;
32154
+ /**
32155
+ * Convert Headers instance into regular object
32156
+ */
32157
+ function HeadersInstanceToPlainObject(headers) {
32158
+ var o = {};
32159
+ headers.forEach(function (v, k) {
32160
+ o[k] = v;
32161
+ });
32162
+ return o;
32163
+ }
32164
+ var graphql_ws_1 = require("./graphql-ws");
32165
+ Object.defineProperty(exports, "GraphQLWebSocketClient", { enumerable: true, get: function () { return graphql_ws_1.GraphQLWebSocketClient; } });
32168
32166
 
32169
- return new Response(null, {status: status, headers: {location: url}})
32170
- };
32171
-
32172
- exports.DOMException = self.DOMException;
32173
- try {
32174
- new exports.DOMException();
32175
- } catch (err) {
32176
- exports.DOMException = function(message, name) {
32177
- this.message = message;
32178
- this.name = name;
32179
- var error = Error(message);
32180
- this.stack = error.stack;
32181
- };
32182
- exports.DOMException.prototype = Object.create(Error.prototype);
32183
- exports.DOMException.prototype.constructor = exports.DOMException;
32184
- }
32185
-
32186
- function fetch(input, init) {
32187
- return new Promise(function(resolve, reject) {
32188
- var request = new Request(input, init);
32189
-
32190
- if (request.signal && request.signal.aborted) {
32191
- return reject(new exports.DOMException('Aborted', 'AbortError'))
32192
- }
32193
-
32194
- var xhr = new XMLHttpRequest();
32195
-
32196
- function abortXhr() {
32197
- xhr.abort();
32198
- }
32199
-
32200
- xhr.onload = function() {
32201
- var options = {
32202
- status: xhr.status,
32203
- statusText: xhr.statusText,
32204
- headers: parseHeaders(xhr.getAllResponseHeaders() || '')
32167
+ },{"./createRequestBody":157,"./defaultJsonSerializer":158,"./graphql-ws":159,"./parseArgs":161,"./types":162,"cross-fetch":131,"graphql/language/parser":203,"graphql/language/printer":206}],161:[function(require,module,exports){
32168
+ "use strict";
32169
+ Object.defineProperty(exports, "__esModule", { value: true });
32170
+ exports.parseBatchRequestsExtendedArgs = exports.parseRawRequestExtendedArgs = exports.parseRequestExtendedArgs = exports.parseBatchRequestArgs = exports.parseRawRequestArgs = exports.parseRequestArgs = void 0;
32171
+ function parseRequestArgs(documentOrOptions, variables, requestHeaders) {
32172
+ return documentOrOptions.document
32173
+ ? documentOrOptions
32174
+ : {
32175
+ document: documentOrOptions,
32176
+ variables: variables,
32177
+ requestHeaders: requestHeaders,
32178
+ signal: undefined,
32205
32179
  };
32206
- options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
32207
- var body = 'response' in xhr ? xhr.response : xhr.responseText;
32208
- resolve(new Response(body, options));
32209
- };
32210
-
32211
- xhr.onerror = function() {
32212
- reject(new TypeError('Network request failed'));
32213
- };
32214
-
32215
- xhr.ontimeout = function() {
32216
- reject(new TypeError('Network request failed'));
32217
- };
32218
-
32219
- xhr.onabort = function() {
32220
- reject(new exports.DOMException('Aborted', 'AbortError'));
32221
- };
32222
-
32223
- xhr.open(request.method, request.url, true);
32224
-
32225
- if (request.credentials === 'include') {
32226
- xhr.withCredentials = true;
32227
- } else if (request.credentials === 'omit') {
32228
- xhr.withCredentials = false;
32229
- }
32230
-
32231
- if ('responseType' in xhr && support.blob) {
32232
- xhr.responseType = 'blob';
32233
- }
32234
-
32235
- request.headers.forEach(function(value, name) {
32236
- xhr.setRequestHeader(name, value);
32237
- });
32238
-
32239
- if (request.signal) {
32240
- request.signal.addEventListener('abort', abortXhr);
32241
-
32242
- xhr.onreadystatechange = function() {
32243
- // DONE (success or failure)
32244
- if (xhr.readyState === 4) {
32245
- request.signal.removeEventListener('abort', abortXhr);
32246
- }
32180
+ }
32181
+ exports.parseRequestArgs = parseRequestArgs;
32182
+ function parseRawRequestArgs(queryOrOptions, variables, requestHeaders) {
32183
+ return queryOrOptions.query
32184
+ ? queryOrOptions
32185
+ : {
32186
+ query: queryOrOptions,
32187
+ variables: variables,
32188
+ requestHeaders: requestHeaders,
32189
+ signal: undefined,
32247
32190
  };
32248
- }
32249
-
32250
- xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
32251
- })
32252
- }
32253
-
32254
- fetch.polyfill = true;
32255
-
32256
- if (!self.fetch) {
32257
- self.fetch = fetch;
32258
- self.Headers = Headers;
32259
- self.Request = Request;
32260
- self.Response = Response;
32261
- }
32262
-
32263
- exports.Headers = Headers;
32264
- exports.Request = Request;
32265
- exports.Response = Response;
32266
- exports.fetch = fetch;
32267
-
32268
- Object.defineProperty(exports, '__esModule', { value: true });
32269
-
32270
- return exports;
32191
+ }
32192
+ exports.parseRawRequestArgs = parseRawRequestArgs;
32193
+ function parseBatchRequestArgs(documentsOrOptions, requestHeaders) {
32194
+ return documentsOrOptions.documents
32195
+ ? documentsOrOptions
32196
+ : {
32197
+ documents: documentsOrOptions,
32198
+ requestHeaders: requestHeaders,
32199
+ signal: undefined,
32200
+ };
32201
+ }
32202
+ exports.parseBatchRequestArgs = parseBatchRequestArgs;
32203
+ function parseRequestExtendedArgs(urlOrOptions, document, variables, requestHeaders) {
32204
+ return urlOrOptions.document
32205
+ ? urlOrOptions
32206
+ : {
32207
+ url: urlOrOptions,
32208
+ document: document,
32209
+ variables: variables,
32210
+ requestHeaders: requestHeaders,
32211
+ signal: undefined,
32212
+ };
32213
+ }
32214
+ exports.parseRequestExtendedArgs = parseRequestExtendedArgs;
32215
+ function parseRawRequestExtendedArgs(urlOrOptions, query, variables, requestHeaders) {
32216
+ return urlOrOptions.query
32217
+ ? urlOrOptions
32218
+ : {
32219
+ url: urlOrOptions,
32220
+ query: query,
32221
+ variables: variables,
32222
+ requestHeaders: requestHeaders,
32223
+ signal: undefined,
32224
+ };
32225
+ }
32226
+ exports.parseRawRequestExtendedArgs = parseRawRequestExtendedArgs;
32227
+ function parseBatchRequestsExtendedArgs(urlOrOptions, documents, requestHeaders) {
32228
+ return urlOrOptions.documents
32229
+ ? urlOrOptions
32230
+ : {
32231
+ url: urlOrOptions,
32232
+ documents: documents,
32233
+ requestHeaders: requestHeaders,
32234
+ signal: undefined,
32235
+ };
32236
+ }
32237
+ exports.parseBatchRequestsExtendedArgs = parseBatchRequestsExtendedArgs;
32271
32238
 
32272
- })({});
32273
- })(__self__);
32274
- __self__.fetch.ponyfill = true;
32275
- // Remove "polyfill" property added by whatwg-fetch
32276
- delete __self__.fetch.polyfill;
32277
- // Choose between native implementation (global) or custom implementation (__self__)
32278
- // var ctx = global.fetch ? global : __self__;
32279
- var ctx = __self__; // this line disable service worker support temporarily
32280
- exports = ctx.fetch // To enable: import fetch from 'cross-fetch'
32281
- exports.default = ctx.fetch // For TypeScript consumers without esModuleInterop.
32282
- exports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch'
32283
- exports.Headers = ctx.Headers
32284
- exports.Request = ctx.Request
32285
- exports.Response = ctx.Response
32286
- module.exports = exports
32239
+ },{}],162:[function(require,module,exports){
32240
+ "use strict";
32241
+ var __extends = (this && this.__extends) || (function () {
32242
+ var extendStatics = function (d, b) {
32243
+ extendStatics = Object.setPrototypeOf ||
32244
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
32245
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
32246
+ return extendStatics(d, b);
32247
+ };
32248
+ return function (d, b) {
32249
+ if (typeof b !== "function" && b !== null)
32250
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
32251
+ extendStatics(d, b);
32252
+ function __() { this.constructor = d; }
32253
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
32254
+ };
32255
+ })();
32256
+ Object.defineProperty(exports, "__esModule", { value: true });
32257
+ exports.ClientError = void 0;
32258
+ var ClientError = /** @class */ (function (_super) {
32259
+ __extends(ClientError, _super);
32260
+ function ClientError(response, request) {
32261
+ var _this = this;
32262
+ var message = ClientError.extractMessage(response) + ": " + JSON.stringify({
32263
+ response: response,
32264
+ request: request,
32265
+ });
32266
+ _this = _super.call(this, message) || this;
32267
+ Object.setPrototypeOf(_this, ClientError.prototype);
32268
+ _this.response = response;
32269
+ _this.request = request;
32270
+ // this is needed as Safari doesn't support .captureStackTrace
32271
+ if (typeof Error.captureStackTrace === 'function') {
32272
+ Error.captureStackTrace(_this, ClientError);
32273
+ }
32274
+ return _this;
32275
+ }
32276
+ ClientError.extractMessage = function (response) {
32277
+ try {
32278
+ return response.errors[0].message;
32279
+ }
32280
+ catch (e) {
32281
+ return "GraphQL Error (Code: " + response.status + ")";
32282
+ }
32283
+ };
32284
+ return ClientError;
32285
+ }(Error));
32286
+ exports.ClientError = ClientError;
32287
32287
 
32288
32288
  },{}],163:[function(require,module,exports){
32289
32289
  "use strict";
@@ -72109,7 +72109,7 @@ class BatchCall {
72109
72109
  }
72110
72110
  exports.default = BatchCall;
72111
72111
 
72112
- },{"./Host":316,"./SFError":320,"./abi/Superfluid.json":328,"./utils":382,"ethers":149}],312:[function(require,module,exports){
72112
+ },{"./Host":316,"./SFError":320,"./abi/Superfluid.json":328,"./utils":382,"ethers":150}],312:[function(require,module,exports){
72113
72113
  "use strict";
72114
72114
  var __importDefault = (this && this.__importDefault) || function (mod) {
72115
72115
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -72476,7 +72476,7 @@ class ConstantFlowAgreementV1 {
72476
72476
  }
72477
72477
  exports.default = ConstantFlowAgreementV1;
72478
72478
 
72479
- },{"./Host":316,"./SFError":320,"./abi/IConstantFlowAgreementV1.json":323,"./utils":382,"ethers":149}],313:[function(require,module,exports){
72479
+ },{"./Host":316,"./SFError":320,"./abi/IConstantFlowAgreementV1.json":323,"./utils":382,"ethers":150}],313:[function(require,module,exports){
72480
72480
  "use strict";
72481
72481
  var __importDefault = (this && this.__importDefault) || function (mod) {
72482
72482
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -72639,7 +72639,7 @@ class ERC20Token {
72639
72639
  }
72640
72640
  exports.default = ERC20Token;
72641
72641
 
72642
- },{"./Operation":318,"./SFError":320,"./abi/ERC20WithTokenInfo.json":322,"./utils":382,"ethers":149}],314:[function(require,module,exports){
72642
+ },{"./Operation":318,"./SFError":320,"./abi/ERC20WithTokenInfo.json":322,"./utils":382,"ethers":150}],314:[function(require,module,exports){
72643
72643
  "use strict";
72644
72644
  var __importDefault = (this && this.__importDefault) || function (mod) {
72645
72645
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -72924,7 +72924,7 @@ Framework.create = async (options) => {
72924
72924
  }
72925
72925
  };
72926
72926
 
72927
- },{"./BatchCall":311,"./ConstantFlowAgreementV1":312,"./Governance":315,"./Host":316,"./InstantDistributionAgreementV1":317,"./Operation":318,"./Query":319,"./SFError":320,"./SuperToken":321,"./abi/IResolver.json":325,"./abi/SuperfluidLoader.json":330,"./constants":332,"./frameworkHelpers":335,"./utils":382,"ethers":149}],315:[function(require,module,exports){
72927
+ },{"./BatchCall":311,"./ConstantFlowAgreementV1":312,"./Governance":315,"./Host":316,"./InstantDistributionAgreementV1":317,"./Operation":318,"./Query":319,"./SFError":320,"./SuperToken":321,"./abi/IResolver.json":325,"./abi/SuperfluidLoader.json":330,"./constants":332,"./frameworkHelpers":335,"./utils":382,"ethers":150}],315:[function(require,module,exports){
72928
72928
  "use strict";
72929
72929
  var __importDefault = (this && this.__importDefault) || function (mod) {
72930
72930
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -73007,7 +73007,7 @@ class Governance {
73007
73007
  }
73008
73008
  exports.default = Governance;
73009
73009
 
73010
- },{"./abi/SuperfluidGovernanceII.json":329,"ethers":149}],316:[function(require,module,exports){
73010
+ },{"./abi/SuperfluidGovernanceII.json":329,"ethers":150}],316:[function(require,module,exports){
73011
73011
  "use strict";
73012
73012
  var __importDefault = (this && this.__importDefault) || function (mod) {
73013
73013
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -73050,7 +73050,7 @@ class Host {
73050
73050
  }
73051
73051
  exports.default = Host;
73052
73052
 
73053
- },{"./Operation":318,"./abi/Superfluid.json":328,"ethers":149}],317:[function(require,module,exports){
73053
+ },{"./Operation":318,"./abi/Superfluid.json":328,"ethers":150}],317:[function(require,module,exports){
73054
73054
  "use strict";
73055
73055
  var __importDefault = (this && this.__importDefault) || function (mod) {
73056
73056
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -73298,7 +73298,7 @@ class InstantDistributionAgreementV1 {
73298
73298
  }
73299
73299
  exports.default = InstantDistributionAgreementV1;
73300
73300
 
73301
- },{"./Host":316,"./SFError":320,"./abi/IInstantDistributionAgreementV1.json":324,"./utils":382,"ethers":149}],318:[function(require,module,exports){
73301
+ },{"./Host":316,"./SFError":320,"./abi/IInstantDistributionAgreementV1.json":324,"./utils":382,"ethers":150}],318:[function(require,module,exports){
73302
73302
  "use strict";
73303
73303
  Object.defineProperty(exports, "__esModule", { value: true });
73304
73304
  const ethers_1 = require("ethers");
@@ -73353,7 +73353,7 @@ class Operation {
73353
73353
  }
73354
73354
  exports.default = Operation;
73355
73355
 
73356
- },{"ethers":149}],319:[function(require,module,exports){
73356
+ },{"ethers":150}],319:[function(require,module,exports){
73357
73357
  "use strict";
73358
73358
  var __importDefault = (this && this.__importDefault) || function (mod) {
73359
73359
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -74268,7 +74268,7 @@ class NativeAssetSuperToken extends SuperToken {
74268
74268
  }
74269
74269
  exports.NativeAssetSuperToken = NativeAssetSuperToken;
74270
74270
 
74271
- },{"./ConstantFlowAgreementV1":312,"./ERC20Token":313,"./Governance":315,"./InstantDistributionAgreementV1":317,"./Operation":318,"./SFError":320,"./abi/ISETH.json":326,"./abi/SuperToken.json":327,"./constants":332,"./frameworkHelpers":335,"./utils":382,"ethers":149}],322:[function(require,module,exports){
74271
+ },{"./ConstantFlowAgreementV1":312,"./ERC20Token":313,"./Governance":315,"./InstantDistributionAgreementV1":317,"./Operation":318,"./SFError":320,"./abi/ISETH.json":326,"./abi/SuperToken.json":327,"./constants":332,"./frameworkHelpers":335,"./utils":382,"ethers":150}],322:[function(require,module,exports){
74272
74272
  module.exports={ "abi": [
74273
74273
  {
74274
74274
  "anonymous": false,
@@ -74496,6 +74496,76 @@ module.exports={ "abi": [
74496
74496
 
74497
74497
  },{}],323:[function(require,module,exports){
74498
74498
  module.exports={ "abi": [
74499
+ {
74500
+ "inputs": [],
74501
+ "name": "CFA_ACL_FLOW_RATE_ALLOWANCE_EXCEEDED",
74502
+ "type": "error"
74503
+ },
74504
+ {
74505
+ "inputs": [],
74506
+ "name": "CFA_ACL_NO_NEGATIVE_ALLOWANCE",
74507
+ "type": "error"
74508
+ },
74509
+ {
74510
+ "inputs": [],
74511
+ "name": "CFA_ACL_NO_SENDER_CREATE",
74512
+ "type": "error"
74513
+ },
74514
+ {
74515
+ "inputs": [],
74516
+ "name": "CFA_ACL_NO_SENDER_FLOW_OPERATOR",
74517
+ "type": "error"
74518
+ },
74519
+ {
74520
+ "inputs": [],
74521
+ "name": "CFA_ACL_NO_SENDER_UPDATE",
74522
+ "type": "error"
74523
+ },
74524
+ {
74525
+ "inputs": [],
74526
+ "name": "CFA_ACL_OPERATOR_NO_CREATE_PERMISSIONS",
74527
+ "type": "error"
74528
+ },
74529
+ {
74530
+ "inputs": [],
74531
+ "name": "CFA_ACL_OPERATOR_NO_DELETE_PERMISSIONS",
74532
+ "type": "error"
74533
+ },
74534
+ {
74535
+ "inputs": [],
74536
+ "name": "CFA_ACL_OPERATOR_NO_UPDATE_PERMISSIONS",
74537
+ "type": "error"
74538
+ },
74539
+ {
74540
+ "inputs": [],
74541
+ "name": "CFA_ACL_UNCLEAN_PERMISSIONS",
74542
+ "type": "error"
74543
+ },
74544
+ {
74545
+ "inputs": [],
74546
+ "name": "CFA_DEPOSIT_TOO_BIG",
74547
+ "type": "error"
74548
+ },
74549
+ {
74550
+ "inputs": [],
74551
+ "name": "CFA_FLOW_RATE_TOO_BIG",
74552
+ "type": "error"
74553
+ },
74554
+ {
74555
+ "inputs": [],
74556
+ "name": "CFA_INVALID_FLOW_RATE",
74557
+ "type": "error"
74558
+ },
74559
+ {
74560
+ "inputs": [],
74561
+ "name": "CFA_NON_CRITICAL_SENDER",
74562
+ "type": "error"
74563
+ },
74564
+ {
74565
+ "inputs": [],
74566
+ "name": "CFA_NO_SELF_FLOW",
74567
+ "type": "error"
74568
+ },
74499
74569
  {
74500
74570
  "anonymous": false,
74501
74571
  "inputs": [
@@ -75288,6 +75358,16 @@ module.exports={ "abi": [
75288
75358
 
75289
75359
  },{}],324:[function(require,module,exports){
75290
75360
  module.exports={ "abi": [
75361
+ {
75362
+ "inputs": [],
75363
+ "name": "IDA_INDEX_SHOULD_GROW",
75364
+ "type": "error"
75365
+ },
75366
+ {
75367
+ "inputs": [],
75368
+ "name": "IDA_OPERATION_NOT_ALLOWED",
75369
+ "type": "error"
75370
+ },
75291
75371
  {
75292
75372
  "anonymous": false,
75293
75373
  "inputs": [
@@ -76290,6 +76370,31 @@ module.exports={ "abi": [
76290
76370
 
76291
76371
  },{}],326:[function(require,module,exports){
76292
76372
  module.exports={ "abi": [
76373
+ {
76374
+ "inputs": [],
76375
+ "name": "SUPER_TOKEN_CALLER_IS_NOT_OPERATOR_FOR_HOLDER",
76376
+ "type": "error"
76377
+ },
76378
+ {
76379
+ "inputs": [],
76380
+ "name": "SUPER_TOKEN_INFLATIONARY_DEFLATIONARY_NOT_SUPPORTED",
76381
+ "type": "error"
76382
+ },
76383
+ {
76384
+ "inputs": [],
76385
+ "name": "SUPER_TOKEN_NOT_ERC777_TOKENS_RECIPIENT",
76386
+ "type": "error"
76387
+ },
76388
+ {
76389
+ "inputs": [],
76390
+ "name": "SUPER_TOKEN_NO_UNDERLYING_TOKEN",
76391
+ "type": "error"
76392
+ },
76393
+ {
76394
+ "inputs": [],
76395
+ "name": "SUPER_TOKEN_ONLY_SELF",
76396
+ "type": "error"
76397
+ },
76293
76398
  {
76294
76399
  "anonymous": false,
76295
76400
  "inputs": [
@@ -77907,6 +78012,97 @@ module.exports={ "abi": [
77907
78012
  "stateMutability": "nonpayable",
77908
78013
  "type": "constructor"
77909
78014
  },
78015
+ {
78016
+ "inputs": [
78017
+ {
78018
+ "internalType": "uint256",
78019
+ "name": "_code",
78020
+ "type": "uint256"
78021
+ }
78022
+ ],
78023
+ "name": "ALREADY_EXISTS",
78024
+ "type": "error"
78025
+ },
78026
+ {
78027
+ "inputs": [
78028
+ {
78029
+ "internalType": "uint256",
78030
+ "name": "_code",
78031
+ "type": "uint256"
78032
+ }
78033
+ ],
78034
+ "name": "DOES_NOT_EXIST",
78035
+ "type": "error"
78036
+ },
78037
+ {
78038
+ "inputs": [
78039
+ {
78040
+ "internalType": "uint256",
78041
+ "name": "_code",
78042
+ "type": "uint256"
78043
+ }
78044
+ ],
78045
+ "name": "INSUFFICIENT_BALANCE",
78046
+ "type": "error"
78047
+ },
78048
+ {
78049
+ "inputs": [
78050
+ {
78051
+ "internalType": "uint256",
78052
+ "name": "_code",
78053
+ "type": "uint256"
78054
+ }
78055
+ ],
78056
+ "name": "ONLY_HOST",
78057
+ "type": "error"
78058
+ },
78059
+ {
78060
+ "inputs": [
78061
+ {
78062
+ "internalType": "uint256",
78063
+ "name": "_code",
78064
+ "type": "uint256"
78065
+ }
78066
+ ],
78067
+ "name": "ONLY_LISTED_AGREEMENT",
78068
+ "type": "error"
78069
+ },
78070
+ {
78071
+ "inputs": [],
78072
+ "name": "SUPER_TOKEN_CALLER_IS_NOT_OPERATOR_FOR_HOLDER",
78073
+ "type": "error"
78074
+ },
78075
+ {
78076
+ "inputs": [],
78077
+ "name": "SUPER_TOKEN_INFLATIONARY_DEFLATIONARY_NOT_SUPPORTED",
78078
+ "type": "error"
78079
+ },
78080
+ {
78081
+ "inputs": [],
78082
+ "name": "SUPER_TOKEN_NOT_ERC777_TOKENS_RECIPIENT",
78083
+ "type": "error"
78084
+ },
78085
+ {
78086
+ "inputs": [],
78087
+ "name": "SUPER_TOKEN_NO_UNDERLYING_TOKEN",
78088
+ "type": "error"
78089
+ },
78090
+ {
78091
+ "inputs": [],
78092
+ "name": "SUPER_TOKEN_ONLY_SELF",
78093
+ "type": "error"
78094
+ },
78095
+ {
78096
+ "inputs": [
78097
+ {
78098
+ "internalType": "uint256",
78099
+ "name": "_code",
78100
+ "type": "uint256"
78101
+ }
78102
+ ],
78103
+ "name": "ZERO_ADDRESS",
78104
+ "type": "error"
78105
+ },
77910
78106
  {
77911
78107
  "anonymous": false,
77912
78108
  "inputs": [
@@ -79574,6 +79770,156 @@ module.exports={ "abi": [
79574
79770
  "stateMutability": "nonpayable",
79575
79771
  "type": "constructor"
79576
79772
  },
79773
+ {
79774
+ "inputs": [
79775
+ {
79776
+ "internalType": "uint256",
79777
+ "name": "_code",
79778
+ "type": "uint256"
79779
+ }
79780
+ ],
79781
+ "name": "ALREADY_EXISTS",
79782
+ "type": "error"
79783
+ },
79784
+ {
79785
+ "inputs": [
79786
+ {
79787
+ "internalType": "uint256",
79788
+ "name": "_code",
79789
+ "type": "uint256"
79790
+ }
79791
+ ],
79792
+ "name": "APP_RULE",
79793
+ "type": "error"
79794
+ },
79795
+ {
79796
+ "inputs": [
79797
+ {
79798
+ "internalType": "uint256",
79799
+ "name": "_code",
79800
+ "type": "uint256"
79801
+ }
79802
+ ],
79803
+ "name": "DOES_NOT_EXIST",
79804
+ "type": "error"
79805
+ },
79806
+ {
79807
+ "inputs": [],
79808
+ "name": "HOST_AGREEMENT_CALLBACK_IS_NOT_ACTION",
79809
+ "type": "error"
79810
+ },
79811
+ {
79812
+ "inputs": [],
79813
+ "name": "HOST_CALL_AGREEMENT_WITH_CTX_FROM_WRONG_ADDRESS",
79814
+ "type": "error"
79815
+ },
79816
+ {
79817
+ "inputs": [],
79818
+ "name": "HOST_CALL_APP_ACTION_WITH_CTX_FROM_WRONG_ADDRESS",
79819
+ "type": "error"
79820
+ },
79821
+ {
79822
+ "inputs": [],
79823
+ "name": "HOST_CANNOT_DOWNGRADE_TO_NON_UPGRADEABLE",
79824
+ "type": "error"
79825
+ },
79826
+ {
79827
+ "inputs": [],
79828
+ "name": "HOST_INVALID_CONFIG_WORD",
79829
+ "type": "error"
79830
+ },
79831
+ {
79832
+ "inputs": [],
79833
+ "name": "HOST_INVALID_OR_EXPIRED_SUPER_APP_REGISTRATION_KEY",
79834
+ "type": "error"
79835
+ },
79836
+ {
79837
+ "inputs": [],
79838
+ "name": "HOST_MAX_256_AGREEMENTS",
79839
+ "type": "error"
79840
+ },
79841
+ {
79842
+ "inputs": [],
79843
+ "name": "HOST_NON_UPGRADEABLE",
79844
+ "type": "error"
79845
+ },
79846
+ {
79847
+ "inputs": [],
79848
+ "name": "HOST_NON_ZERO_LENGTH_PLACEHOLDER_CTX",
79849
+ "type": "error"
79850
+ },
79851
+ {
79852
+ "inputs": [],
79853
+ "name": "HOST_NOT_A_SUPER_APP",
79854
+ "type": "error"
79855
+ },
79856
+ {
79857
+ "inputs": [],
79858
+ "name": "HOST_NO_APP_REGISTRATION_PERMISSIONS",
79859
+ "type": "error"
79860
+ },
79861
+ {
79862
+ "inputs": [],
79863
+ "name": "HOST_ONLY_GOVERNANCE",
79864
+ "type": "error"
79865
+ },
79866
+ {
79867
+ "inputs": [],
79868
+ "name": "HOST_RECEIVER_IS_NOT_SUPER_APP",
79869
+ "type": "error"
79870
+ },
79871
+ {
79872
+ "inputs": [],
79873
+ "name": "HOST_SENDER_IS_NOT_SUPER_APP",
79874
+ "type": "error"
79875
+ },
79876
+ {
79877
+ "inputs": [],
79878
+ "name": "HOST_SOURCE_APP_NEEDS_HIGHER_APP_LEVEL",
79879
+ "type": "error"
79880
+ },
79881
+ {
79882
+ "inputs": [],
79883
+ "name": "HOST_SUPER_APP_ALREADY_REGISTERED",
79884
+ "type": "error"
79885
+ },
79886
+ {
79887
+ "inputs": [],
79888
+ "name": "HOST_SUPER_APP_IS_JAILED",
79889
+ "type": "error"
79890
+ },
79891
+ {
79892
+ "inputs": [],
79893
+ "name": "HOST_UNAUTHORIZED_SUPER_APP_FACTORY",
79894
+ "type": "error"
79895
+ },
79896
+ {
79897
+ "inputs": [],
79898
+ "name": "HOST_UNKNOWN_BATCH_CALL_OPERATION_TYPE",
79899
+ "type": "error"
79900
+ },
79901
+ {
79902
+ "inputs": [
79903
+ {
79904
+ "internalType": "uint256",
79905
+ "name": "_code",
79906
+ "type": "uint256"
79907
+ }
79908
+ ],
79909
+ "name": "MUST_BE_CONTRACT",
79910
+ "type": "error"
79911
+ },
79912
+ {
79913
+ "inputs": [
79914
+ {
79915
+ "internalType": "uint256",
79916
+ "name": "_code",
79917
+ "type": "uint256"
79918
+ }
79919
+ ],
79920
+ "name": "ONLY_LISTED_AGREEMENT",
79921
+ "type": "error"
79922
+ },
79577
79923
  {
79578
79924
  "anonymous": false,
79579
79925
  "inputs": [
@@ -79753,19 +80099,6 @@ module.exports={ "abi": [
79753
80099
  "stateMutability": "view",
79754
80100
  "type": "function"
79755
80101
  },
79756
- {
79757
- "inputs": [],
79758
- "name": "MAX_APP_CALLBACK_LEVEL",
79759
- "outputs": [
79760
- {
79761
- "internalType": "uint256",
79762
- "name": "",
79763
- "type": "uint256"
79764
- }
79765
- ],
79766
- "stateMutability": "view",
79767
- "type": "function"
79768
- },
79769
80102
  {
79770
80103
  "inputs": [],
79771
80104
  "name": "NON_UPGRADABLE_DEPLOYMENT",
@@ -80747,6 +81080,32 @@ module.exports={ "abi": [
80747
81080
 
80748
81081
  },{}],329:[function(require,module,exports){
80749
81082
  module.exports={ "abi": [
81083
+ {
81084
+ "inputs": [
81085
+ {
81086
+ "internalType": "uint256",
81087
+ "name": "_code",
81088
+ "type": "uint256"
81089
+ }
81090
+ ],
81091
+ "name": "MUST_BE_CONTRACT",
81092
+ "type": "error"
81093
+ },
81094
+ {
81095
+ "inputs": [],
81096
+ "name": "SF_GOV_ARRAYS_NOT_SAME_LENGTH",
81097
+ "type": "error"
81098
+ },
81099
+ {
81100
+ "inputs": [],
81101
+ "name": "SF_GOV_II_ONLY_OWNER",
81102
+ "type": "error"
81103
+ },
81104
+ {
81105
+ "inputs": [],
81106
+ "name": "SF_GOV_INVALID_LIQUIDATION_OR_PATRICIAN_PERIOD",
81107
+ "type": "error"
81108
+ },
80750
81109
  {
80751
81110
  "anonymous": false,
80752
81111
  "inputs": [
@@ -83343,7 +83702,7 @@ function cleanVariables(variables) {
83343
83702
  ]));
83344
83703
  }
83345
83704
 
83346
- },{"../SFError":320,"graphql":172,"graphql-request":159,"lodash":305}],343:[function(require,module,exports){
83705
+ },{"../SFError":320,"graphql":172,"graphql-request":160,"lodash":305}],343:[function(require,module,exports){
83347
83706
  "use strict";
83348
83707
  Object.defineProperty(exports, "__esModule", { value: true });
83349
83708
  exports.AccountQueryHandler = void 0;
@@ -84331,5 +84690,5 @@ const getFlowOperatorId = (sender, flowOperator) => {
84331
84690
  };
84332
84691
  exports.getFlowOperatorId = getFlowOperatorId;
84333
84692
 
84334
- },{"./SFError":320,"./constants":332,"ethers":149}]},{},[336])(336)
84693
+ },{"./SFError":320,"./constants":332,"ethers":150}]},{},[336])(336)
84335
84694
  });