@ape.swap/bonds-sdk 3.0.62 → 3.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +68 -134
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -25826,9 +25826,9 @@ bn$1.exports;
|
|
|
25826
25826
|
} (bn$1));
|
|
25827
25827
|
|
|
25828
25828
|
var bnExports = bn$1.exports;
|
|
25829
|
-
var
|
|
25829
|
+
var BN$1 = /*@__PURE__*/getDefaultExportFromCjs(bnExports);
|
|
25830
25830
|
|
|
25831
|
-
const version$j = "logger/5.
|
|
25831
|
+
const version$j = "logger/5.7.0";
|
|
25832
25832
|
|
|
25833
25833
|
let _permanentCensorErrors = false;
|
|
25834
25834
|
let _censorErrors = false;
|
|
@@ -26179,7 +26179,7 @@ class Logger {
|
|
|
26179
26179
|
Logger.errors = ErrorCode;
|
|
26180
26180
|
Logger.levels = LogLevel;
|
|
26181
26181
|
|
|
26182
|
-
const version$i = "bytes/5.
|
|
26182
|
+
const version$i = "bytes/5.7.0";
|
|
26183
26183
|
|
|
26184
26184
|
const logger$o = new Logger(version$i);
|
|
26185
26185
|
///////////////////////////////
|
|
@@ -26579,9 +26579,9 @@ function splitSignature(signature) {
|
|
|
26579
26579
|
return result;
|
|
26580
26580
|
}
|
|
26581
26581
|
|
|
26582
|
-
const version$h = "bignumber/5.
|
|
26582
|
+
const version$h = "bignumber/5.7.0";
|
|
26583
26583
|
|
|
26584
|
-
var BN =
|
|
26584
|
+
var BN = BN$1.BN;
|
|
26585
26585
|
const logger$n = new Logger(version$h);
|
|
26586
26586
|
const _constructorGuard$3 = {};
|
|
26587
26587
|
const MAX_SAFE = 0x1fffffffffffff;
|
|
@@ -27224,7 +27224,7 @@ class FixedNumber {
|
|
|
27224
27224
|
const ONE = FixedNumber.from(1);
|
|
27225
27225
|
const BUMP = FixedNumber.from("0.5");
|
|
27226
27226
|
|
|
27227
|
-
const version$g = "properties/5.
|
|
27227
|
+
const version$g = "properties/5.7.0";
|
|
27228
27228
|
|
|
27229
27229
|
var __awaiter$8 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
27230
27230
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -27349,7 +27349,7 @@ class Description {
|
|
|
27349
27349
|
}
|
|
27350
27350
|
}
|
|
27351
27351
|
|
|
27352
|
-
const version$f = "abi/5.
|
|
27352
|
+
const version$f = "abi/5.7.0";
|
|
27353
27353
|
|
|
27354
27354
|
const logger$k = new Logger(version$f);
|
|
27355
27355
|
const _constructorGuard$1 = {};
|
|
@@ -29002,7 +29002,7 @@ function keccak256(data) {
|
|
|
29002
29002
|
return '0x' + sha3.keccak_256(arrayify(data));
|
|
29003
29003
|
}
|
|
29004
29004
|
|
|
29005
|
-
const version$e = "rlp/5.
|
|
29005
|
+
const version$e = "rlp/5.7.0";
|
|
29006
29006
|
|
|
29007
29007
|
const logger$i = new Logger(version$e);
|
|
29008
29008
|
function arrayifyInteger(value) {
|
|
@@ -29119,7 +29119,7 @@ function decode$2(data) {
|
|
|
29119
29119
|
return decoded.result;
|
|
29120
29120
|
}
|
|
29121
29121
|
|
|
29122
|
-
const version$d = "address/5.
|
|
29122
|
+
const version$d = "address/5.7.0";
|
|
29123
29123
|
|
|
29124
29124
|
const logger$h = new Logger(version$d);
|
|
29125
29125
|
function getChecksumAddress(address) {
|
|
@@ -29594,7 +29594,7 @@ class NumberCoder extends Coder {
|
|
|
29594
29594
|
}
|
|
29595
29595
|
}
|
|
29596
29596
|
|
|
29597
|
-
const version$c = "strings/5.
|
|
29597
|
+
const version$c = "strings/5.7.0";
|
|
29598
29598
|
|
|
29599
29599
|
const logger$f = new Logger(version$c);
|
|
29600
29600
|
///////////////////////////////
|
|
@@ -29962,7 +29962,7 @@ function id(text) {
|
|
|
29962
29962
|
return keccak256(toUtf8Bytes(text));
|
|
29963
29963
|
}
|
|
29964
29964
|
|
|
29965
|
-
const version$b = "hash/5.
|
|
29965
|
+
const version$b = "hash/5.7.0";
|
|
29966
29966
|
|
|
29967
29967
|
function decode$1(textData) {
|
|
29968
29968
|
textData = atob(textData);
|
|
@@ -31633,7 +31633,7 @@ var multicallV2Abi = [
|
|
|
31633
31633
|
}
|
|
31634
31634
|
];
|
|
31635
31635
|
|
|
31636
|
-
const version$a = "abstract-provider/5.
|
|
31636
|
+
const version$a = "abstract-provider/5.7.0";
|
|
31637
31637
|
|
|
31638
31638
|
var __awaiter$6 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31639
31639
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -31695,7 +31695,7 @@ class Provider {
|
|
|
31695
31695
|
}
|
|
31696
31696
|
}
|
|
31697
31697
|
|
|
31698
|
-
const version$9 = "abstract-signer/5.
|
|
31698
|
+
const version$9 = "abstract-signer/5.7.0";
|
|
31699
31699
|
|
|
31700
31700
|
var __awaiter$5 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31701
31701
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -33372,15 +33372,12 @@ utils.encode = utils_1.encode;
|
|
|
33372
33372
|
// Represent num in a w-NAF form
|
|
33373
33373
|
function getNAF(num, w, bits) {
|
|
33374
33374
|
var naf = new Array(Math.max(num.bitLength(), bits) + 1);
|
|
33375
|
-
|
|
33376
|
-
for (i = 0; i < naf.length; i += 1) {
|
|
33377
|
-
naf[i] = 0;
|
|
33378
|
-
}
|
|
33375
|
+
naf.fill(0);
|
|
33379
33376
|
|
|
33380
33377
|
var ws = 1 << (w + 1);
|
|
33381
33378
|
var k = num.clone();
|
|
33382
33379
|
|
|
33383
|
-
for (i = 0; i < naf.length; i++) {
|
|
33380
|
+
for (var i = 0; i < naf.length; i++) {
|
|
33384
33381
|
var z;
|
|
33385
33382
|
var mod = k.andln(ws - 1);
|
|
33386
33383
|
if (k.isOdd()) {
|
|
@@ -33474,7 +33471,7 @@ function parseBytes(bytes) {
|
|
|
33474
33471
|
utils.parseBytes = parseBytes;
|
|
33475
33472
|
|
|
33476
33473
|
function intFromLE(bytes) {
|
|
33477
|
-
return new
|
|
33474
|
+
return new BN$1(bytes, 'hex', 'le');
|
|
33478
33475
|
}
|
|
33479
33476
|
utils.intFromLE = intFromLE;
|
|
33480
33477
|
});
|
|
@@ -33487,18 +33484,18 @@ var assert$1 = utils_1$1.assert;
|
|
|
33487
33484
|
|
|
33488
33485
|
function BaseCurve(type, conf) {
|
|
33489
33486
|
this.type = type;
|
|
33490
|
-
this.p = new
|
|
33487
|
+
this.p = new BN$1(conf.p, 16);
|
|
33491
33488
|
|
|
33492
33489
|
// Use Montgomery, when there is no fast reduction for the prime
|
|
33493
|
-
this.red = conf.prime ?
|
|
33490
|
+
this.red = conf.prime ? BN$1.red(conf.prime) : BN$1.mont(this.p);
|
|
33494
33491
|
|
|
33495
33492
|
// Useful for many curves
|
|
33496
|
-
this.zero = new
|
|
33497
|
-
this.one = new
|
|
33498
|
-
this.two = new
|
|
33493
|
+
this.zero = new BN$1(0).toRed(this.red);
|
|
33494
|
+
this.one = new BN$1(1).toRed(this.red);
|
|
33495
|
+
this.two = new BN$1(2).toRed(this.red);
|
|
33499
33496
|
|
|
33500
33497
|
// Curve configuration, optional
|
|
33501
|
-
this.n = conf.n && new
|
|
33498
|
+
this.n = conf.n && new BN$1(conf.n, 16);
|
|
33502
33499
|
this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);
|
|
33503
33500
|
|
|
33504
33501
|
// Temporary arrays
|
|
@@ -33898,8 +33895,8 @@ var assert$2 = utils_1$1.assert;
|
|
|
33898
33895
|
function ShortCurve(conf) {
|
|
33899
33896
|
base.call(this, 'short', conf);
|
|
33900
33897
|
|
|
33901
|
-
this.a = new
|
|
33902
|
-
this.b = new
|
|
33898
|
+
this.a = new BN$1(conf.a, 16).toRed(this.red);
|
|
33899
|
+
this.b = new BN$1(conf.b, 16).toRed(this.red);
|
|
33903
33900
|
this.tinv = this.two.redInvm();
|
|
33904
33901
|
|
|
33905
33902
|
this.zeroA = this.a.fromRed().cmpn(0) === 0;
|
|
@@ -33922,7 +33919,7 @@ ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {
|
|
|
33922
33919
|
var beta;
|
|
33923
33920
|
var lambda;
|
|
33924
33921
|
if (conf.beta) {
|
|
33925
|
-
beta = new
|
|
33922
|
+
beta = new BN$1(conf.beta, 16).toRed(this.red);
|
|
33926
33923
|
} else {
|
|
33927
33924
|
var betas = this._getEndoRoots(this.p);
|
|
33928
33925
|
// Choose the smallest beta
|
|
@@ -33930,7 +33927,7 @@ ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {
|
|
|
33930
33927
|
beta = beta.toRed(this.red);
|
|
33931
33928
|
}
|
|
33932
33929
|
if (conf.lambda) {
|
|
33933
|
-
lambda = new
|
|
33930
|
+
lambda = new BN$1(conf.lambda, 16);
|
|
33934
33931
|
} else {
|
|
33935
33932
|
// Choose the lambda that is matching selected beta
|
|
33936
33933
|
var lambdas = this._getEndoRoots(this.n);
|
|
@@ -33947,8 +33944,8 @@ ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {
|
|
|
33947
33944
|
if (conf.basis) {
|
|
33948
33945
|
basis = conf.basis.map(function(vec) {
|
|
33949
33946
|
return {
|
|
33950
|
-
a: new
|
|
33951
|
-
b: new
|
|
33947
|
+
a: new BN$1(vec.a, 16),
|
|
33948
|
+
b: new BN$1(vec.b, 16),
|
|
33952
33949
|
};
|
|
33953
33950
|
});
|
|
33954
33951
|
} else {
|
|
@@ -33966,11 +33963,11 @@ ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {
|
|
|
33966
33963
|
// Find roots of for x^2 + x + 1 in F
|
|
33967
33964
|
// Root = (-1 +- Sqrt(-3)) / 2
|
|
33968
33965
|
//
|
|
33969
|
-
var red = num === this.p ? this.red :
|
|
33970
|
-
var tinv = new
|
|
33966
|
+
var red = num === this.p ? this.red : BN$1.mont(num);
|
|
33967
|
+
var tinv = new BN$1(2).toRed(red).redInvm();
|
|
33971
33968
|
var ntinv = tinv.redNeg();
|
|
33972
33969
|
|
|
33973
|
-
var s = new
|
|
33970
|
+
var s = new BN$1(3).toRed(red).redNeg().redSqrt().redMul(tinv);
|
|
33974
33971
|
|
|
33975
33972
|
var l1 = ntinv.redAdd(s).fromRed();
|
|
33976
33973
|
var l2 = ntinv.redSub(s).fromRed();
|
|
@@ -33985,10 +33982,10 @@ ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {
|
|
|
33985
33982
|
// Run EGCD, until r(L + 1) < aprxSqrt
|
|
33986
33983
|
var u = lambda;
|
|
33987
33984
|
var v = this.n.clone();
|
|
33988
|
-
var x1 = new
|
|
33989
|
-
var y1 = new
|
|
33990
|
-
var x2 = new
|
|
33991
|
-
var y2 = new
|
|
33985
|
+
var x1 = new BN$1(1);
|
|
33986
|
+
var y1 = new BN$1(0);
|
|
33987
|
+
var x2 = new BN$1(0);
|
|
33988
|
+
var y2 = new BN$1(1);
|
|
33992
33989
|
|
|
33993
33990
|
// NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)
|
|
33994
33991
|
var a0;
|
|
@@ -34073,7 +34070,7 @@ ShortCurve.prototype._endoSplit = function _endoSplit(k) {
|
|
|
34073
34070
|
};
|
|
34074
34071
|
|
|
34075
34072
|
ShortCurve.prototype.pointFromX = function pointFromX(x, odd) {
|
|
34076
|
-
x = new
|
|
34073
|
+
x = new BN$1(x, 16);
|
|
34077
34074
|
if (!x.red)
|
|
34078
34075
|
x = x.toRed(this.red);
|
|
34079
34076
|
|
|
@@ -34143,8 +34140,8 @@ function Point(curve, x, y, isRed) {
|
|
|
34143
34140
|
this.y = null;
|
|
34144
34141
|
this.inf = true;
|
|
34145
34142
|
} else {
|
|
34146
|
-
this.x = new
|
|
34147
|
-
this.y = new
|
|
34143
|
+
this.x = new BN$1(x, 16);
|
|
34144
|
+
this.y = new BN$1(y, 16);
|
|
34148
34145
|
// Force redgomery representation when loading from JSON
|
|
34149
34146
|
if (isRed) {
|
|
34150
34147
|
this.x.forceRed(this.curve.red);
|
|
@@ -34308,7 +34305,7 @@ Point.prototype.getY = function getY() {
|
|
|
34308
34305
|
};
|
|
34309
34306
|
|
|
34310
34307
|
Point.prototype.mul = function mul(k) {
|
|
34311
|
-
k = new
|
|
34308
|
+
k = new BN$1(k, 16);
|
|
34312
34309
|
if (this.isInfinity())
|
|
34313
34310
|
return this;
|
|
34314
34311
|
else if (this._hasDoubles(k))
|
|
@@ -34380,11 +34377,11 @@ function JPoint(curve, x, y, z) {
|
|
|
34380
34377
|
if (x === null && y === null && z === null) {
|
|
34381
34378
|
this.x = this.curve.one;
|
|
34382
34379
|
this.y = this.curve.one;
|
|
34383
|
-
this.z = new
|
|
34380
|
+
this.z = new BN$1(0);
|
|
34384
34381
|
} else {
|
|
34385
|
-
this.x = new
|
|
34386
|
-
this.y = new
|
|
34387
|
-
this.z = new
|
|
34382
|
+
this.x = new BN$1(x, 16);
|
|
34383
|
+
this.y = new BN$1(y, 16);
|
|
34384
|
+
this.z = new BN$1(z, 16);
|
|
34388
34385
|
}
|
|
34389
34386
|
if (!this.x.red)
|
|
34390
34387
|
this.x = this.x.toRed(this.curve.red);
|
|
@@ -34769,7 +34766,7 @@ JPoint.prototype.trpl = function trpl() {
|
|
|
34769
34766
|
};
|
|
34770
34767
|
|
|
34771
34768
|
JPoint.prototype.mul = function mul(k, kbase) {
|
|
34772
|
-
k = new
|
|
34769
|
+
k = new BN$1(k, kbase);
|
|
34773
34770
|
|
|
34774
34771
|
return this.curve._wnafMul(this, k);
|
|
34775
34772
|
};
|
|
@@ -35229,7 +35226,7 @@ KeyPair.prototype.getPrivate = function getPrivate(enc) {
|
|
|
35229
35226
|
};
|
|
35230
35227
|
|
|
35231
35228
|
KeyPair.prototype._importPrivate = function _importPrivate(key, enc) {
|
|
35232
|
-
this.priv = new
|
|
35229
|
+
this.priv = new BN$1(key, enc || 16);
|
|
35233
35230
|
|
|
35234
35231
|
// Ensure that the priv won't be bigger than n, otherwise we may fail
|
|
35235
35232
|
// in fixed multiplication method
|
|
@@ -35266,8 +35263,8 @@ KeyPair.prototype.sign = function sign(msg, enc, options) {
|
|
|
35266
35263
|
return this.ec.sign(msg, this, enc, options);
|
|
35267
35264
|
};
|
|
35268
35265
|
|
|
35269
|
-
KeyPair.prototype.verify = function verify(msg, signature
|
|
35270
|
-
return this.ec.verify(msg, signature, this
|
|
35266
|
+
KeyPair.prototype.verify = function verify(msg, signature) {
|
|
35267
|
+
return this.ec.verify(msg, signature, this);
|
|
35271
35268
|
};
|
|
35272
35269
|
|
|
35273
35270
|
KeyPair.prototype.inspect = function inspect() {
|
|
@@ -35288,8 +35285,8 @@ function Signature(options, enc) {
|
|
|
35288
35285
|
return;
|
|
35289
35286
|
|
|
35290
35287
|
assert$4(options.r && options.s, 'Signature without r or s');
|
|
35291
|
-
this.r = new
|
|
35292
|
-
this.s = new
|
|
35288
|
+
this.r = new BN$1(options.r, 16);
|
|
35289
|
+
this.s = new BN$1(options.s, 16);
|
|
35293
35290
|
if (options.recoveryParam === undefined)
|
|
35294
35291
|
this.recoveryParam = null;
|
|
35295
35292
|
else
|
|
@@ -35313,10 +35310,6 @@ function getLength(buf, p) {
|
|
|
35313
35310
|
return false;
|
|
35314
35311
|
}
|
|
35315
35312
|
|
|
35316
|
-
if(buf[p.place] === 0x00) {
|
|
35317
|
-
return false;
|
|
35318
|
-
}
|
|
35319
|
-
|
|
35320
35313
|
var val = 0;
|
|
35321
35314
|
for (var i = 0, off = p.place; i < octetLen; i++, off++) {
|
|
35322
35315
|
val <<= 8;
|
|
@@ -35365,9 +35358,6 @@ Signature.prototype._importDER = function _importDER(data, enc) {
|
|
|
35365
35358
|
if (rlen === false) {
|
|
35366
35359
|
return false;
|
|
35367
35360
|
}
|
|
35368
|
-
if ((data[p.place] & 128) !== 0) {
|
|
35369
|
-
return false;
|
|
35370
|
-
}
|
|
35371
35361
|
var r = data.slice(p.place, rlen + p.place);
|
|
35372
35362
|
p.place += rlen;
|
|
35373
35363
|
if (data[p.place++] !== 0x02) {
|
|
@@ -35380,9 +35370,6 @@ Signature.prototype._importDER = function _importDER(data, enc) {
|
|
|
35380
35370
|
if (data.length !== slen + p.place) {
|
|
35381
35371
|
return false;
|
|
35382
35372
|
}
|
|
35383
|
-
if ((data[p.place] & 128) !== 0) {
|
|
35384
|
-
return false;
|
|
35385
|
-
}
|
|
35386
35373
|
var s = data.slice(p.place, slen + p.place);
|
|
35387
35374
|
if (r[0] === 0) {
|
|
35388
35375
|
if (r[1] & 0x80) {
|
|
@@ -35401,8 +35388,8 @@ Signature.prototype._importDER = function _importDER(data, enc) {
|
|
|
35401
35388
|
}
|
|
35402
35389
|
}
|
|
35403
35390
|
|
|
35404
|
-
this.r = new
|
|
35405
|
-
this.s = new
|
|
35391
|
+
this.r = new BN$1(r);
|
|
35392
|
+
this.s = new BN$1(s);
|
|
35406
35393
|
this.recoveryParam = null;
|
|
35407
35394
|
|
|
35408
35395
|
return true;
|
|
@@ -35517,9 +35504,9 @@ EC.prototype.genKeyPair = function genKeyPair(options) {
|
|
|
35517
35504
|
});
|
|
35518
35505
|
|
|
35519
35506
|
var bytes = this.n.byteLength();
|
|
35520
|
-
var ns2 = this.n.sub(new
|
|
35507
|
+
var ns2 = this.n.sub(new BN$1(2));
|
|
35521
35508
|
for (;;) {
|
|
35522
|
-
var priv = new
|
|
35509
|
+
var priv = new BN$1(drbg.generate(bytes));
|
|
35523
35510
|
if (priv.cmp(ns2) > 0)
|
|
35524
35511
|
continue;
|
|
35525
35512
|
|
|
@@ -35528,27 +35515,8 @@ EC.prototype.genKeyPair = function genKeyPair(options) {
|
|
|
35528
35515
|
}
|
|
35529
35516
|
};
|
|
35530
35517
|
|
|
35531
|
-
EC.prototype._truncateToN = function _truncateToN(msg, truncOnly
|
|
35532
|
-
var byteLength;
|
|
35533
|
-
if (_BN.isBN(msg) || typeof msg === 'number') {
|
|
35534
|
-
msg = new _BN(msg, 16);
|
|
35535
|
-
byteLength = msg.byteLength();
|
|
35536
|
-
} else if (typeof msg === 'object') {
|
|
35537
|
-
// BN assumes an array-like input and asserts length
|
|
35538
|
-
byteLength = msg.length;
|
|
35539
|
-
msg = new _BN(msg, 16);
|
|
35540
|
-
} else {
|
|
35541
|
-
// BN converts the value to string
|
|
35542
|
-
var str = msg.toString();
|
|
35543
|
-
// HEX encoding
|
|
35544
|
-
byteLength = (str.length + 1) >>> 1;
|
|
35545
|
-
msg = new _BN(str, 16);
|
|
35546
|
-
}
|
|
35547
|
-
// Allow overriding
|
|
35548
|
-
if (typeof bitLength !== 'number') {
|
|
35549
|
-
bitLength = byteLength * 8;
|
|
35550
|
-
}
|
|
35551
|
-
var delta = bitLength - this.n.bitLength();
|
|
35518
|
+
EC.prototype._truncateToN = function _truncateToN(msg, truncOnly) {
|
|
35519
|
+
var delta = msg.byteLength() * 8 - this.n.bitLength();
|
|
35552
35520
|
if (delta > 0)
|
|
35553
35521
|
msg = msg.ushrn(delta);
|
|
35554
35522
|
if (!truncOnly && msg.cmp(this.n) >= 0)
|
|
@@ -35565,18 +35533,8 @@ EC.prototype.sign = function sign(msg, key, enc, options) {
|
|
|
35565
35533
|
if (!options)
|
|
35566
35534
|
options = {};
|
|
35567
35535
|
|
|
35568
|
-
if (typeof msg !== 'string' && typeof msg !== 'number' && !_BN.isBN(msg)) {
|
|
35569
|
-
assert$5(typeof msg === 'object' && msg && typeof msg.length === 'number',
|
|
35570
|
-
'Expected message to be an array-like, a hex string, or a BN instance');
|
|
35571
|
-
assert$5((msg.length >>> 0) === msg.length); // non-negative 32-bit integer
|
|
35572
|
-
for (var i = 0; i < msg.length; i++) assert$5((msg[i] & 255) === msg[i]);
|
|
35573
|
-
}
|
|
35574
|
-
|
|
35575
35536
|
key = this.keyFromPrivate(key, enc);
|
|
35576
|
-
msg = this._truncateToN(msg,
|
|
35577
|
-
|
|
35578
|
-
// Would fail further checks, but let's make the error message clear
|
|
35579
|
-
assert$5(!msg.isNeg(), 'Can not sign a negative message');
|
|
35537
|
+
msg = this._truncateToN(new BN$1(msg, 16));
|
|
35580
35538
|
|
|
35581
35539
|
// Zero-extend key to provide enough entropy
|
|
35582
35540
|
var bytes = this.n.byteLength();
|
|
@@ -35585,9 +35543,6 @@ EC.prototype.sign = function sign(msg, key, enc, options) {
|
|
|
35585
35543
|
// Zero-extend nonce to have the same byte size as N
|
|
35586
35544
|
var nonce = msg.toArray('be', bytes);
|
|
35587
35545
|
|
|
35588
|
-
// Recheck nonce to be bijective to msg
|
|
35589
|
-
assert$5((new _BN(nonce)).eq(msg), 'Can not sign message');
|
|
35590
|
-
|
|
35591
35546
|
// Instantiate Hmac_DRBG
|
|
35592
35547
|
var drbg = new hmacDrbg({
|
|
35593
35548
|
hash: this.hash,
|
|
@@ -35598,12 +35553,12 @@ EC.prototype.sign = function sign(msg, key, enc, options) {
|
|
|
35598
35553
|
});
|
|
35599
35554
|
|
|
35600
35555
|
// Number of bytes to generate
|
|
35601
|
-
var ns1 = this.n.sub(new
|
|
35556
|
+
var ns1 = this.n.sub(new BN$1(1));
|
|
35602
35557
|
|
|
35603
35558
|
for (var iter = 0; ; iter++) {
|
|
35604
35559
|
var k = options.k ?
|
|
35605
35560
|
options.k(iter) :
|
|
35606
|
-
new
|
|
35561
|
+
new BN$1(drbg.generate(this.n.byteLength()));
|
|
35607
35562
|
k = this._truncateToN(k, true);
|
|
35608
35563
|
if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)
|
|
35609
35564
|
continue;
|
|
@@ -35635,11 +35590,8 @@ EC.prototype.sign = function sign(msg, key, enc, options) {
|
|
|
35635
35590
|
}
|
|
35636
35591
|
};
|
|
35637
35592
|
|
|
35638
|
-
EC.prototype.verify = function verify(msg, signature$1, key, enc
|
|
35639
|
-
|
|
35640
|
-
options = {};
|
|
35641
|
-
|
|
35642
|
-
msg = this._truncateToN(msg, false, options.msgBitLength);
|
|
35593
|
+
EC.prototype.verify = function verify(msg, signature$1, key, enc) {
|
|
35594
|
+
msg = this._truncateToN(new BN$1(msg, 16));
|
|
35643
35595
|
key = this.keyFromPublic(key, enc);
|
|
35644
35596
|
signature$1 = new signature(signature$1, 'hex');
|
|
35645
35597
|
|
|
@@ -35683,7 +35635,7 @@ EC.prototype.recoverPubKey = function(msg, signature$1, j, enc) {
|
|
|
35683
35635
|
signature$1 = new signature(signature$1, enc);
|
|
35684
35636
|
|
|
35685
35637
|
var n = this.n;
|
|
35686
|
-
var e = new
|
|
35638
|
+
var e = new BN$1(msg);
|
|
35687
35639
|
var r = signature$1.r;
|
|
35688
35640
|
var s = signature$1.s;
|
|
35689
35641
|
|
|
@@ -35731,7 +35683,7 @@ var elliptic_1 = createCommonjsModule(function (module, exports) {
|
|
|
35731
35683
|
|
|
35732
35684
|
var elliptic = exports;
|
|
35733
35685
|
|
|
35734
|
-
elliptic.version = /*RicMoo:ethers*/{ version: "6.
|
|
35686
|
+
elliptic.version = /*RicMoo:ethers*/{ version: "6.5.4" }.version;
|
|
35735
35687
|
elliptic.utils = utils_1$1;
|
|
35736
35688
|
elliptic.rand = /*RicMoo:ethers:require(brorand)*/(function() { throw new Error('unsupported'); });
|
|
35737
35689
|
elliptic.curve = curve_1;
|
|
@@ -35744,7 +35696,7 @@ elliptic.eddsa = /*RicMoo:ethers:require(./elliptic/eddsa)*/(null);
|
|
|
35744
35696
|
|
|
35745
35697
|
var EC$1 = elliptic_1.ec;
|
|
35746
35698
|
|
|
35747
|
-
const version$8 = "signing-key/5.
|
|
35699
|
+
const version$8 = "signing-key/5.7.0";
|
|
35748
35700
|
|
|
35749
35701
|
const logger$8 = new Logger(version$8);
|
|
35750
35702
|
let _curve = null;
|
|
@@ -35815,7 +35767,7 @@ function computePublicKey(key, compressed) {
|
|
|
35815
35767
|
return logger$8.throwArgumentError("invalid public or private key", "key", "[REDACTED]");
|
|
35816
35768
|
}
|
|
35817
35769
|
|
|
35818
|
-
const version$7 = "transactions/5.
|
|
35770
|
+
const version$7 = "transactions/5.7.0";
|
|
35819
35771
|
|
|
35820
35772
|
const logger$7 = new Logger(version$7);
|
|
35821
35773
|
var TransactionTypes;
|
|
@@ -37087,7 +37039,7 @@ function sha256(data) {
|
|
|
37087
37039
|
return "0x" + (hash.sha256().update(arrayify(data)).digest("hex"));
|
|
37088
37040
|
}
|
|
37089
37041
|
|
|
37090
|
-
const version$5 = "networks/5.
|
|
37042
|
+
const version$5 = "networks/5.7.1";
|
|
37091
37043
|
|
|
37092
37044
|
const logger$5 = new Logger(version$5);
|
|
37093
37045
|
function isRenetworkable(value) {
|
|
@@ -37147,12 +37099,6 @@ function ethDefaultProvider(network) {
|
|
|
37147
37099
|
}
|
|
37148
37100
|
catch (error) { }
|
|
37149
37101
|
}
|
|
37150
|
-
if (providers.QuickNodeProvider && options.quicknode !== "-") {
|
|
37151
|
-
try {
|
|
37152
|
-
providerList.push(new providers.QuickNodeProvider(network, options.quicknode));
|
|
37153
|
-
}
|
|
37154
|
-
catch (error) { }
|
|
37155
|
-
}
|
|
37156
37102
|
if (providerList.length === 0) {
|
|
37157
37103
|
return null;
|
|
37158
37104
|
}
|
|
@@ -37230,15 +37176,9 @@ const networks = {
|
|
|
37230
37176
|
kintsugi: { chainId: 1337702, name: "kintsugi" },
|
|
37231
37177
|
sepolia: {
|
|
37232
37178
|
chainId: 11155111,
|
|
37233
|
-
ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
|
|
37234
37179
|
name: "sepolia",
|
|
37235
37180
|
_defaultProvider: ethDefaultProvider("sepolia")
|
|
37236
37181
|
},
|
|
37237
|
-
holesky: {
|
|
37238
|
-
chainId: 17000,
|
|
37239
|
-
name: "holesky",
|
|
37240
|
-
_defaultProvider: ethDefaultProvider("holesky")
|
|
37241
|
-
},
|
|
37242
37182
|
// ETC (See: #351)
|
|
37243
37183
|
classic: {
|
|
37244
37184
|
chainId: 61,
|
|
@@ -37259,11 +37199,7 @@ const networks = {
|
|
|
37259
37199
|
name: "matic",
|
|
37260
37200
|
_defaultProvider: ethDefaultProvider("matic")
|
|
37261
37201
|
},
|
|
37262
|
-
maticmum: {
|
|
37263
|
-
chainId: 80001,
|
|
37264
|
-
name: "maticmum",
|
|
37265
|
-
_defaultProvider: ethDefaultProvider("maticmum")
|
|
37266
|
-
},
|
|
37202
|
+
maticmum: { chainId: 80001, name: "maticmum" },
|
|
37267
37203
|
optimism: {
|
|
37268
37204
|
chainId: 10,
|
|
37269
37205
|
name: "optimism",
|
|
@@ -37271,11 +37207,9 @@ const networks = {
|
|
|
37271
37207
|
},
|
|
37272
37208
|
"optimism-kovan": { chainId: 69, name: "optimism-kovan" },
|
|
37273
37209
|
"optimism-goerli": { chainId: 420, name: "optimism-goerli" },
|
|
37274
|
-
"optimism-sepolia": { chainId: 11155420, name: "optimism-sepolia" },
|
|
37275
37210
|
arbitrum: { chainId: 42161, name: "arbitrum" },
|
|
37276
37211
|
"arbitrum-rinkeby": { chainId: 421611, name: "arbitrum-rinkeby" },
|
|
37277
37212
|
"arbitrum-goerli": { chainId: 421613, name: "arbitrum-goerli" },
|
|
37278
|
-
"arbitrum-sepolia": { chainId: 421614, name: "arbitrum-sepolia" },
|
|
37279
37213
|
bnb: { chainId: 56, name: "bnb" },
|
|
37280
37214
|
bnbt: { chainId: 97, name: "bnbt" },
|
|
37281
37215
|
};
|
|
@@ -37351,7 +37285,7 @@ function getNetwork(network) {
|
|
|
37351
37285
|
};
|
|
37352
37286
|
}
|
|
37353
37287
|
|
|
37354
|
-
const version$4 = "web/5.
|
|
37288
|
+
const version$4 = "web/5.7.1";
|
|
37355
37289
|
|
|
37356
37290
|
var __awaiter$3 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37357
37291
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -77712,7 +77646,7 @@ const useApproval = (amount, currency, spender, account, chainId) => {
|
|
|
77712
77646
|
return [approvalState !== null && approvalState !== void 0 ? approvalState : ApprovalState.NOT_APPROVED, handleApprove];
|
|
77713
77647
|
};
|
|
77714
77648
|
|
|
77715
|
-
const version$1 = '2.
|
|
77649
|
+
const version$1 = '2.29.1';
|
|
77716
77650
|
|
|
77717
77651
|
let errorConfig = {
|
|
77718
77652
|
getDocsUrl: ({ docsBaseUrl, docsPath = '', docsSlug, }) => docsPath
|