@ape.swap/bonds-sdk 3.0.62 → 3.0.64-test.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +308 -178
- package/dist/state/bonds/useBondsData.d.ts +1 -1
- package/dist/state/bonds/useBondsList.d.ts +1 -1
- package/dist/state/bonds/useHotBonds.d.ts +1 -1
- package/dist/state/bonds/useUserBonds.d.ts +1 -1
- package/dist/state/bonds/useUserTokensBalance.d.ts +1 -1
- package/dist/state/preTGEBonds/usePreTGEBondsData.d.ts +1 -1
- package/dist/state/preTGEBonds/usePreTGEList.d.ts +1 -1
- package/dist/state/preTGEBonds/usePreTGEUserBonds.d.ts +1 -1
- package/dist/state/tiers/useTierPoints.d.ts +1 -1
- package/dist/state/tokenPrices/useTokenPrices.d.ts +1 -1
- package/dist/utils/reportError.d.ts +8 -0
- 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); }); }
|
|
@@ -58395,6 +58329,38 @@ const useURLByEnvironment = (key) => {
|
|
|
58395
58329
|
return config === null || config === void 0 ? void 0 : config.urls[key];
|
|
58396
58330
|
};
|
|
58397
58331
|
|
|
58332
|
+
function reportError(_a) {
|
|
58333
|
+
return __awaiter$9(this, arguments, void 0, function* ({ apiUrl, error, extraInfo = {}, chainId, account, rpc, }) {
|
|
58334
|
+
const isClient = typeof window !== 'undefined';
|
|
58335
|
+
const url = isClient ? window.location.href : null;
|
|
58336
|
+
const errors = {
|
|
58337
|
+
message: error instanceof Error ? error.message : String(error),
|
|
58338
|
+
stack: error instanceof Error ? error.stack : null,
|
|
58339
|
+
extra: extraInfo,
|
|
58340
|
+
};
|
|
58341
|
+
const payload = {
|
|
58342
|
+
chainId: chainId,
|
|
58343
|
+
walletAddress: account,
|
|
58344
|
+
rpc,
|
|
58345
|
+
url,
|
|
58346
|
+
log: errors,
|
|
58347
|
+
};
|
|
58348
|
+
console.log('errorPayload', payload);
|
|
58349
|
+
try {
|
|
58350
|
+
yield fetch(`${apiUrl}/stats/log`, {
|
|
58351
|
+
method: 'POST',
|
|
58352
|
+
body: JSON.stringify(payload),
|
|
58353
|
+
headers: {
|
|
58354
|
+
'Content-Type': 'application/json',
|
|
58355
|
+
},
|
|
58356
|
+
});
|
|
58357
|
+
}
|
|
58358
|
+
catch (err) {
|
|
58359
|
+
console.error('Error al reportar el error:', err);
|
|
58360
|
+
}
|
|
58361
|
+
});
|
|
58362
|
+
}
|
|
58363
|
+
|
|
58398
58364
|
/**
|
|
58399
58365
|
* @deprecated This map is deprecated. Boost values are now being retrieved from the Realtime API.
|
|
58400
58366
|
*/
|
|
@@ -58451,7 +58417,7 @@ const getUserTier = (weight) => {
|
|
|
58451
58417
|
else
|
|
58452
58418
|
return null;
|
|
58453
58419
|
};
|
|
58454
|
-
const fetchUserPoints = (account, useTiers) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
58420
|
+
const fetchUserPoints = (account, useTiers, apiUrl) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
58455
58421
|
const lensContractAddress = LENS_CONTRACT[types.ChainId.BSC];
|
|
58456
58422
|
if (account && useTiers) {
|
|
58457
58423
|
try {
|
|
@@ -58466,6 +58432,12 @@ const fetchUserPoints = (account, useTiers) => __awaiter$9(void 0, void 0, void
|
|
|
58466
58432
|
}
|
|
58467
58433
|
catch (e) {
|
|
58468
58434
|
console.error(e);
|
|
58435
|
+
reportError({
|
|
58436
|
+
apiUrl,
|
|
58437
|
+
error: e,
|
|
58438
|
+
extraInfo: { type: 'fetchUserPoints', e },
|
|
58439
|
+
account,
|
|
58440
|
+
});
|
|
58469
58441
|
return '0';
|
|
58470
58442
|
}
|
|
58471
58443
|
}
|
|
@@ -58473,11 +58445,13 @@ const fetchUserPoints = (account, useTiers) => __awaiter$9(void 0, void 0, void
|
|
|
58473
58445
|
return '0';
|
|
58474
58446
|
});
|
|
58475
58447
|
function useTierPoints() {
|
|
58448
|
+
var _a;
|
|
58476
58449
|
const { address: account } = useAccount();
|
|
58477
58450
|
const SDKConfig = useSDKConfig();
|
|
58451
|
+
const apiUrl = (_a = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.urls) === null || _a === void 0 ? void 0 : _a.apiV2;
|
|
58478
58452
|
return useQuery({
|
|
58479
58453
|
queryKey: [QUERY_KEYS.TIERS, account],
|
|
58480
|
-
queryFn: () => fetchUserPoints(account, SDKConfig.useTiers),
|
|
58454
|
+
queryFn: () => fetchUserPoints(account, SDKConfig.useTiers, apiUrl),
|
|
58481
58455
|
staleTime: 60000,
|
|
58482
58456
|
refetchInterval: 30000, // i.e. 30 secs
|
|
58483
58457
|
refetchOnWindowFocus: false,
|
|
@@ -61103,6 +61077,12 @@ const getBillNftBatchData = (apiV2URL, billNftIds, billNftAddress, chainId) => _
|
|
|
61103
61077
|
}
|
|
61104
61078
|
catch (e) {
|
|
61105
61079
|
console.error(e);
|
|
61080
|
+
reportError({
|
|
61081
|
+
apiUrl: apiV2URL,
|
|
61082
|
+
error: e,
|
|
61083
|
+
extraInfo: { type: 'getBillNftBatchData', billNftIds, billNftAddress, e },
|
|
61084
|
+
chainId,
|
|
61085
|
+
});
|
|
61106
61086
|
// If an error occurs, return null
|
|
61107
61087
|
return null;
|
|
61108
61088
|
}
|
|
@@ -61127,6 +61107,12 @@ const getBondNFTData = (apiV2URL, id, billNftAddress, chainId) => __awaiter$9(vo
|
|
|
61127
61107
|
}
|
|
61128
61108
|
catch (e) {
|
|
61129
61109
|
console.error(e);
|
|
61110
|
+
reportError({
|
|
61111
|
+
apiUrl: apiV2URL,
|
|
61112
|
+
error: e,
|
|
61113
|
+
extraInfo: { type: 'getBondNFTData', billNftAddress, e },
|
|
61114
|
+
chainId,
|
|
61115
|
+
});
|
|
61130
61116
|
}
|
|
61131
61117
|
});
|
|
61132
61118
|
|
|
@@ -62409,6 +62395,7 @@ const useMonitorTxHash = (txHash, chainId) => {
|
|
|
62409
62395
|
const TransferAction = ({ userBill, toAddress, disabled, }) => {
|
|
62410
62396
|
var _a, _b, _c;
|
|
62411
62397
|
// Hooks
|
|
62398
|
+
const SDKConfig = useSDKConfig();
|
|
62412
62399
|
const userChainId = useChainId();
|
|
62413
62400
|
const { address: account } = useAccount();
|
|
62414
62401
|
const { switchChain } = useSwitchChain();
|
|
@@ -62420,7 +62407,7 @@ const TransferAction = ({ userBill, toAddress, disabled, }) => {
|
|
|
62420
62407
|
const { addToastError } = usePopups();
|
|
62421
62408
|
const load = loadingTx || (isLoading && !isConfirmed);
|
|
62422
62409
|
const handleTransfer = () => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
62423
|
-
var _a;
|
|
62410
|
+
var _a, _b;
|
|
62424
62411
|
const address = userBill === null || userBill === void 0 ? void 0 : userBill.billNftAddress;
|
|
62425
62412
|
try {
|
|
62426
62413
|
setLoadingTx(true);
|
|
@@ -62453,6 +62440,13 @@ const TransferAction = ({ userBill, toAddress, disabled, }) => {
|
|
|
62453
62440
|
console.error('Transfer failed:', error);
|
|
62454
62441
|
setLoadingTx(false);
|
|
62455
62442
|
addToastError(error.shortMessage);
|
|
62443
|
+
reportError({
|
|
62444
|
+
apiUrl: (_b = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.urls) === null || _b === void 0 ? void 0 : _b.apiV2,
|
|
62445
|
+
error,
|
|
62446
|
+
extraInfo: { type: 'transfer', userBill, error },
|
|
62447
|
+
chainId: userChainId,
|
|
62448
|
+
account,
|
|
62449
|
+
});
|
|
62456
62450
|
}
|
|
62457
62451
|
});
|
|
62458
62452
|
return (jsx$2(Fragment$1, { children: userChainId !== ((_b = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _b === void 0 ? void 0 : _b.chainId) ? (jsxs(Button, { onClick: () => { var _a; return switchChain({ chainId: (_a = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _a === void 0 ? void 0 : _a.chainId }); }, children: ["Switch to ", NETWORK_LABEL[(_c = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _c === void 0 ? void 0 : _c.chainId]] })) : (jsx$2(Button, { onClick: handleTransfer, load: load, disabled: load || disabled, fullWidth: true, children: "transfer" })) }));
|
|
@@ -69754,28 +69748,35 @@ var PRICE_GETTER_V3_ABI = [
|
|
|
69754
69748
|
];
|
|
69755
69749
|
|
|
69756
69750
|
function useTokenPrices() {
|
|
69751
|
+
var _a;
|
|
69757
69752
|
const realTime = useURLByEnvironment('realTimeApi');
|
|
69758
69753
|
const SDKConfig = useSDKConfig();
|
|
69754
|
+
const apiUrl = (_a = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.urls) === null || _a === void 0 ? void 0 : _a.apiV2;
|
|
69759
69755
|
return useQuery({
|
|
69760
69756
|
queryKey: [QUERY_KEYS.TOKEN_PRICES],
|
|
69761
|
-
queryFn: () => getTokenPrices(realTime, SDKConfig.chains),
|
|
69757
|
+
queryFn: () => getTokenPrices(realTime, SDKConfig.chains, apiUrl),
|
|
69762
69758
|
refetchInterval: 60000, // 60 sec
|
|
69763
69759
|
refetchOnMount: false,
|
|
69764
69760
|
refetchOnWindowFocus: false,
|
|
69765
69761
|
enabled: !!SDKConfig.chains && SDKConfig.chains.length > 0,
|
|
69766
69762
|
});
|
|
69767
69763
|
}
|
|
69768
|
-
const getTokenPrices = (
|
|
69764
|
+
const getTokenPrices = (realTimeApiURL, chains, apiUrl) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
69769
69765
|
try {
|
|
69770
|
-
const response = yield axios.get(`${
|
|
69766
|
+
const response = yield axios.get(`${realTimeApiURL}/utils/tokens`);
|
|
69771
69767
|
const tokenList = response.data;
|
|
69772
69768
|
const promises = chains.map((chain) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
69773
69769
|
try {
|
|
69774
69770
|
// Directly return the result of fetching prices, or handle any exceptions here
|
|
69775
|
-
return yield getAllTokenPrices(+chain, tokenList);
|
|
69771
|
+
return yield getAllTokenPrices(+chain, tokenList, apiUrl);
|
|
69776
69772
|
}
|
|
69777
69773
|
catch (error) {
|
|
69778
69774
|
console.error(`Failed to fetch prices for chain ${chain}:`, error);
|
|
69775
|
+
reportError({
|
|
69776
|
+
apiUrl,
|
|
69777
|
+
error,
|
|
69778
|
+
extraInfo: { type: 'getAllTokenPrices', chains, error },
|
|
69779
|
+
});
|
|
69779
69780
|
return null;
|
|
69780
69781
|
}
|
|
69781
69782
|
}));
|
|
@@ -69789,11 +69790,16 @@ const getTokenPrices = (apiURL, chains) => __awaiter$9(void 0, void 0, void 0, f
|
|
|
69789
69790
|
}, []);
|
|
69790
69791
|
return flattenedPrices;
|
|
69791
69792
|
}
|
|
69792
|
-
catch (
|
|
69793
|
+
catch (error) {
|
|
69794
|
+
reportError({
|
|
69795
|
+
apiUrl,
|
|
69796
|
+
error,
|
|
69797
|
+
extraInfo: { type: 'getTokenPrices', chains, error },
|
|
69798
|
+
});
|
|
69793
69799
|
return [];
|
|
69794
69800
|
}
|
|
69795
69801
|
});
|
|
69796
|
-
const getAllTokenPrices = (chainId, tokens) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
69802
|
+
const getAllTokenPrices = (chainId, tokens, apiUrl) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
69797
69803
|
const { externalTokens, filterTokensToCall, arrayFilterTokens } = Object.keys(tokens).reduce((acc, key) => {
|
|
69798
69804
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
69799
69805
|
const token = tokens[key];
|
|
@@ -69828,7 +69834,7 @@ const getAllTokenPrices = (chainId, tokens) => __awaiter$9(void 0, void 0, void
|
|
|
69828
69834
|
};
|
|
69829
69835
|
});
|
|
69830
69836
|
}
|
|
69831
|
-
const externalResults = yield getBatchTokensExternal({ chainId, tokens: externalTokens });
|
|
69837
|
+
const externalResults = yield getBatchTokensExternal({ chainId, tokens: externalTokens, apiUrl });
|
|
69832
69838
|
const tokenResults = yield getTokenPricesV3FromPriceGetter(filterTokensToCall, chainId);
|
|
69833
69839
|
const parsedTokenResults = arrayFilterTokens.map((token, i) => {
|
|
69834
69840
|
var _a, _b, _c;
|
|
@@ -69844,7 +69850,7 @@ const getAllTokenPrices = (chainId, tokens) => __awaiter$9(void 0, void 0, void
|
|
|
69844
69850
|
return [...parsedTokenResults, ...externalResults];
|
|
69845
69851
|
});
|
|
69846
69852
|
const getBatchTokensExternal = (params) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
69847
|
-
const { chainId, tokens } = params;
|
|
69853
|
+
const { chainId, tokens, apiUrl } = params;
|
|
69848
69854
|
try {
|
|
69849
69855
|
const baseURL = 'https://price-api.ape.bond/prices';
|
|
69850
69856
|
const tokensToCall = tokens.map((token) => token.address);
|
|
@@ -69864,8 +69870,14 @@ const getBatchTokensExternal = (params) => __awaiter$9(void 0, void 0, void 0, f
|
|
|
69864
69870
|
};
|
|
69865
69871
|
});
|
|
69866
69872
|
}
|
|
69867
|
-
catch (
|
|
69873
|
+
catch (error) {
|
|
69868
69874
|
console.log(`Failed to get price from api for chain ${chainId}.`);
|
|
69875
|
+
reportError({
|
|
69876
|
+
apiUrl,
|
|
69877
|
+
error,
|
|
69878
|
+
extraInfo: { type: 'getBatchTokensExternal', tokens, error },
|
|
69879
|
+
chainId,
|
|
69880
|
+
});
|
|
69869
69881
|
return [];
|
|
69870
69882
|
}
|
|
69871
69883
|
});
|
|
@@ -69954,6 +69966,7 @@ const SafeHTMLComponent = ({ html }) => {
|
|
|
69954
69966
|
const YourBondsModal = ({ onDismiss, userBill }) => {
|
|
69955
69967
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
69956
69968
|
// Hooks
|
|
69969
|
+
const SDKConfig = useSDKConfig();
|
|
69957
69970
|
const chainId = useChainId();
|
|
69958
69971
|
const { switchChain } = useSwitchChain();
|
|
69959
69972
|
const { data: bondNFTData } = useBondNFTData(userBill === null || userBill === void 0 ? void 0 : userBill.id, userBill === null || userBill === void 0 ? void 0 : userBill.billNftAddress, (_a = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _a === void 0 ? void 0 : _a.chainId);
|
|
@@ -69974,6 +69987,7 @@ const YourBondsModal = ({ onDismiss, userBill }) => {
|
|
|
69974
69987
|
const isPendingCliff = vestingCliff ? currentTime - lastBlockTimestamp < vestingCliff : false;
|
|
69975
69988
|
const cliffCountdown = getTimePeriods(lastBlockTimestamp + (vestingCliff !== null && vestingCliff !== void 0 ? vestingCliff : 0) - currentTime, true);
|
|
69976
69989
|
const handleClaim = (billId, billAddress) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
69990
|
+
var _a;
|
|
69977
69991
|
const address = billAddress;
|
|
69978
69992
|
try {
|
|
69979
69993
|
setLoadingTx(true);
|
|
@@ -70004,6 +70018,13 @@ const YourBondsModal = ({ onDismiss, userBill }) => {
|
|
|
70004
70018
|
console.error('Claim Failed:', error);
|
|
70005
70019
|
setLoadingTx(false);
|
|
70006
70020
|
addToastError(error.message);
|
|
70021
|
+
reportError({
|
|
70022
|
+
apiUrl: (_a = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.urls) === null || _a === void 0 ? void 0 : _a.apiV2,
|
|
70023
|
+
error,
|
|
70024
|
+
extraInfo: { type: 'redeem', userBill, error },
|
|
70025
|
+
chainId,
|
|
70026
|
+
account,
|
|
70027
|
+
});
|
|
70007
70028
|
}
|
|
70008
70029
|
});
|
|
70009
70030
|
// Functions to calculate display values for modal
|
|
@@ -70158,6 +70179,7 @@ const BondInfoTooltip = ({ earnTokenContract, earnTokenSymbol, bondContract, pro
|
|
|
70158
70179
|
const UserBondRow = ({ bill }) => {
|
|
70159
70180
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
70160
70181
|
const userChainId = useChainId();
|
|
70182
|
+
const SDKConfig = useSDKConfig();
|
|
70161
70183
|
const { address: account } = useAccount();
|
|
70162
70184
|
const { switchChain } = useSwitchChain();
|
|
70163
70185
|
const { writeContractAsync } = useWriteContract();
|
|
@@ -70168,6 +70190,7 @@ const UserBondRow = ({ bill }) => {
|
|
|
70168
70190
|
const load = loadingTx || (isConfirming && !isConfirmed);
|
|
70169
70191
|
const [onOpenPurchasedBond] = useModal(jsx$2(YourBondsModal, { userBill: bill }));
|
|
70170
70192
|
const handleClaim = (billId, billAddress) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
70193
|
+
var _a;
|
|
70171
70194
|
const address = billAddress;
|
|
70172
70195
|
try {
|
|
70173
70196
|
setLoadingTx(true);
|
|
@@ -70198,6 +70221,13 @@ const UserBondRow = ({ bill }) => {
|
|
|
70198
70221
|
setLoadingTx(false);
|
|
70199
70222
|
console.error('Claim failed:', error);
|
|
70200
70223
|
addToastError(error.message);
|
|
70224
|
+
reportError({
|
|
70225
|
+
apiUrl: (_a = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.urls) === null || _a === void 0 ? void 0 : _a.apiV2,
|
|
70226
|
+
error,
|
|
70227
|
+
extraInfo: { type: 'claim', bill, error },
|
|
70228
|
+
chainId: bill.bond.chainId,
|
|
70229
|
+
account,
|
|
70230
|
+
});
|
|
70201
70231
|
}
|
|
70202
70232
|
});
|
|
70203
70233
|
// Display Info
|
|
@@ -70223,19 +70253,25 @@ const UserBondRow = ({ bill }) => {
|
|
|
70223
70253
|
|
|
70224
70254
|
function useBondsList() {
|
|
70225
70255
|
const realTime = useURLByEnvironment('realTimeApi');
|
|
70256
|
+
const apiUrl = useURLByEnvironment('apiV2');
|
|
70226
70257
|
return useQuery({
|
|
70227
70258
|
queryKey: [QUERY_KEYS.BONDS_LIST],
|
|
70228
|
-
queryFn: () => getBondsList(realTime),
|
|
70259
|
+
queryFn: () => getBondsList(realTime, apiUrl),
|
|
70229
70260
|
staleTime: Infinity,
|
|
70230
70261
|
refetchOnWindowFocus: false,
|
|
70231
70262
|
});
|
|
70232
70263
|
}
|
|
70233
|
-
const getBondsList = (
|
|
70264
|
+
const getBondsList = (realTimeapiURL, apiUrl) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
70234
70265
|
try {
|
|
70235
|
-
const response = yield axios.get(`${
|
|
70266
|
+
const response = yield axios.get(`${realTimeapiURL}/utils/bonds`);
|
|
70236
70267
|
return response.data;
|
|
70237
70268
|
}
|
|
70238
|
-
catch (
|
|
70269
|
+
catch (e) {
|
|
70270
|
+
reportError({
|
|
70271
|
+
apiUrl,
|
|
70272
|
+
error: e,
|
|
70273
|
+
extraInfo: { type: 'getBondsList', e },
|
|
70274
|
+
});
|
|
70239
70275
|
return [];
|
|
70240
70276
|
}
|
|
70241
70277
|
});
|
|
@@ -70340,22 +70376,24 @@ const fetchUserOwnedBills = (chainId, account, bonds, tokenPrices) => __awaiter$
|
|
|
70340
70376
|
});
|
|
70341
70377
|
|
|
70342
70378
|
function useUserBonds() {
|
|
70379
|
+
var _a;
|
|
70343
70380
|
// First fetch the full list of bonds
|
|
70344
70381
|
const { data: bondList } = useBondsList();
|
|
70345
70382
|
const { address } = useAccount();
|
|
70346
70383
|
const SDKConfig = useSDKConfig();
|
|
70347
70384
|
const { data: tokenPrices } = useTokenPrices();
|
|
70348
70385
|
const chains = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains;
|
|
70386
|
+
const apiUrl = (_a = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.urls) === null || _a === void 0 ? void 0 : _a.apiV2;
|
|
70349
70387
|
// Once the full list is fetched, fetch user's purchased bonds
|
|
70350
70388
|
return useQuery({
|
|
70351
70389
|
queryKey: [QUERY_KEYS.USER_BONDS, address],
|
|
70352
|
-
queryFn: () => getUserBonds(address, bondList, chains, tokenPrices),
|
|
70390
|
+
queryFn: () => getUserBonds(address, bondList, chains, tokenPrices, apiUrl),
|
|
70353
70391
|
refetchOnWindowFocus: false,
|
|
70354
70392
|
refetchInterval: 60000,
|
|
70355
70393
|
enabled: !!bondList && !!address && !!tokenPrices,
|
|
70356
70394
|
});
|
|
70357
70395
|
}
|
|
70358
|
-
const getUserBonds = (account, bondList, chains, tokenPrices) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
70396
|
+
const getUserBonds = (account, bondList, chains, tokenPrices, apiUrl) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
70359
70397
|
try {
|
|
70360
70398
|
const bondsByChain = bondList.reduce((acc, bond) => {
|
|
70361
70399
|
var _a;
|
|
@@ -70385,7 +70423,13 @@ const getUserBonds = (account, bondList, chains, tokenPrices) => __awaiter$9(voi
|
|
|
70385
70423
|
.map((result) => result.value);
|
|
70386
70424
|
return fulfilledResults.flat().flatMap((result) => result.userOwnedBills);
|
|
70387
70425
|
}
|
|
70388
|
-
catch (
|
|
70426
|
+
catch (e) {
|
|
70427
|
+
reportError({
|
|
70428
|
+
apiUrl,
|
|
70429
|
+
error: e,
|
|
70430
|
+
extraInfo: { type: 'getUserBonds', bondList, chains, e },
|
|
70431
|
+
account,
|
|
70432
|
+
});
|
|
70389
70433
|
return [];
|
|
70390
70434
|
}
|
|
70391
70435
|
});
|
|
@@ -70727,6 +70771,7 @@ const ClaimAllModal = () => {
|
|
|
70727
70771
|
const { addToastError } = usePopups();
|
|
70728
70772
|
const { writeContractAsync } = useWriteContract();
|
|
70729
70773
|
const handleClaim = () => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
70774
|
+
var _a;
|
|
70730
70775
|
try {
|
|
70731
70776
|
bondsOfSelectedChain === null || bondsOfSelectedChain === void 0 ? void 0 : bondsOfSelectedChain.map((purchasedBond) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
70732
70777
|
const address = purchasedBond.bond.contractAddress[purchasedBond.bond.chainId];
|
|
@@ -70752,6 +70797,13 @@ const ClaimAllModal = () => {
|
|
|
70752
70797
|
catch (error) {
|
|
70753
70798
|
console.error('Claim All failed:', error);
|
|
70754
70799
|
addToastError(error.message);
|
|
70800
|
+
reportError({
|
|
70801
|
+
apiUrl: (_a = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.urls) === null || _a === void 0 ? void 0 : _a.apiV2,
|
|
70802
|
+
error,
|
|
70803
|
+
extraInfo: { type: 'claimAll', bondsOfSelectedChain, error },
|
|
70804
|
+
chainId,
|
|
70805
|
+
account,
|
|
70806
|
+
});
|
|
70755
70807
|
}
|
|
70756
70808
|
});
|
|
70757
70809
|
const purchasedBillsChains = (_a = groupedBills === null || groupedBills === void 0 ? void 0 : groupedBills.reduce((acc, bill) => {
|
|
@@ -73162,37 +73214,46 @@ var launchBondsABI_V2_2_0 = [
|
|
|
73162
73214
|
];
|
|
73163
73215
|
|
|
73164
73216
|
function usePreTGEList() {
|
|
73165
|
-
|
|
73217
|
+
var _a, _b;
|
|
73218
|
+
const SDKConfig = useSDKConfig();
|
|
73219
|
+
const realTime = (_a = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.urls) === null || _a === void 0 ? void 0 : _a.realTimeApi;
|
|
73220
|
+
const apiUrl = (_b = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.urls) === null || _b === void 0 ? void 0 : _b.apiV2;
|
|
73166
73221
|
return useQuery({
|
|
73167
73222
|
queryKey: [QUERY_KEYS.PRE_TGE_LIST],
|
|
73168
|
-
queryFn: () => getPreTGEList(realTime),
|
|
73223
|
+
queryFn: () => getPreTGEList(realTime, apiUrl),
|
|
73169
73224
|
staleTime: Infinity,
|
|
73170
73225
|
refetchOnWindowFocus: false,
|
|
73171
73226
|
});
|
|
73172
73227
|
}
|
|
73173
|
-
const getPreTGEList = (
|
|
73228
|
+
const getPreTGEList = (apiRealTimeURL, apiUrl) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
73174
73229
|
try {
|
|
73175
|
-
const response = yield axios.get(`${
|
|
73230
|
+
const response = yield axios.get(`${apiRealTimeURL}/utils/pre-tge-bonds`);
|
|
73176
73231
|
return response.data;
|
|
73177
73232
|
}
|
|
73178
|
-
catch (
|
|
73233
|
+
catch (e) {
|
|
73234
|
+
reportError({
|
|
73235
|
+
apiUrl,
|
|
73236
|
+
error: e,
|
|
73237
|
+
extraInfo: { type: 'getPreTGEList', e },
|
|
73238
|
+
});
|
|
73179
73239
|
return [];
|
|
73180
73240
|
}
|
|
73181
73241
|
});
|
|
73182
73242
|
|
|
73183
73243
|
function usePreTGEBondsData() {
|
|
73184
|
-
var _a;
|
|
73244
|
+
var _a, _b;
|
|
73185
73245
|
const { data: preTGEList } = usePreTGEList();
|
|
73186
73246
|
const SDKConfig = useSDKConfig();
|
|
73247
|
+
const apiUrl = (_a = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.urls) === null || _a === void 0 ? void 0 : _a.apiV2;
|
|
73187
73248
|
return useQuery({
|
|
73188
|
-
queryKey: [QUERY_KEYS.PRE_TGE_BONDS, (
|
|
73189
|
-
queryFn: () => getLaunchBondsPublicData(preTGEList, SDKConfig.chains),
|
|
73249
|
+
queryKey: [QUERY_KEYS.PRE_TGE_BONDS, (_b = preTGEList === null || preTGEList === void 0 ? void 0 : preTGEList.length) !== null && _b !== void 0 ? _b : ''],
|
|
73250
|
+
queryFn: () => getLaunchBondsPublicData(preTGEList, SDKConfig.chains, apiUrl),
|
|
73190
73251
|
staleTime: 60000,
|
|
73191
73252
|
refetchOnWindowFocus: false,
|
|
73192
73253
|
enabled: !!preTGEList && preTGEList.length > 0,
|
|
73193
73254
|
});
|
|
73194
73255
|
}
|
|
73195
|
-
const getLaunchBondsPublicData = (preTGEBonds, chains) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
73256
|
+
const getLaunchBondsPublicData = (preTGEBonds, chains, apiUrl) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
73196
73257
|
try {
|
|
73197
73258
|
if (!(preTGEBonds === null || preTGEBonds === void 0 ? void 0 : preTGEBonds.length))
|
|
73198
73259
|
return null;
|
|
@@ -73255,7 +73316,12 @@ const getLaunchBondsPublicData = (preTGEBonds, chains) => __awaiter$9(void 0, vo
|
|
|
73255
73316
|
}
|
|
73256
73317
|
return data.flat();
|
|
73257
73318
|
}
|
|
73258
|
-
catch (
|
|
73319
|
+
catch (e) {
|
|
73320
|
+
reportError({
|
|
73321
|
+
apiUrl,
|
|
73322
|
+
error: e,
|
|
73323
|
+
extraInfo: { type: 'getLaunchBondsPublicData', preTGEBonds, chains, e },
|
|
73324
|
+
});
|
|
73259
73325
|
return [];
|
|
73260
73326
|
}
|
|
73261
73327
|
});
|
|
@@ -73264,15 +73330,16 @@ function usePreTGEUserBonds() {
|
|
|
73264
73330
|
var _a;
|
|
73265
73331
|
const { data: preTGEBonds } = usePreTGEBondsData();
|
|
73266
73332
|
const { address } = useAccount();
|
|
73333
|
+
const apiUrl = useURLByEnvironment('apiV2');
|
|
73267
73334
|
return useQuery({
|
|
73268
73335
|
queryKey: [QUERY_KEYS.PRE_TGE_BONDS, (_a = preTGEBonds === null || preTGEBonds === void 0 ? void 0 : preTGEBonds.length) !== null && _a !== void 0 ? _a : '', address],
|
|
73269
|
-
queryFn: () => fetchPreTGEUserBonds(preTGEBonds, address),
|
|
73336
|
+
queryFn: () => fetchPreTGEUserBonds(preTGEBonds, address, apiUrl),
|
|
73270
73337
|
staleTime: 30000,
|
|
73271
73338
|
refetchOnWindowFocus: false,
|
|
73272
73339
|
enabled: !!preTGEBonds && preTGEBonds.length > 0 && !!address,
|
|
73273
73340
|
});
|
|
73274
73341
|
}
|
|
73275
|
-
const fetchPreTGEUserBonds = (preTGEBonds, account) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
73342
|
+
const fetchPreTGEUserBonds = (preTGEBonds, account, apiUrl) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
73276
73343
|
try {
|
|
73277
73344
|
const res = yield Promise.all(preTGEBonds.map((bond) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
73278
73345
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
@@ -73354,6 +73421,12 @@ const fetchPreTGEUserBonds = (preTGEBonds, account) => __awaiter$9(void 0, void
|
|
|
73354
73421
|
}
|
|
73355
73422
|
catch (e) {
|
|
73356
73423
|
console.log(e);
|
|
73424
|
+
reportError({
|
|
73425
|
+
apiUrl,
|
|
73426
|
+
error: e,
|
|
73427
|
+
extraInfo: { type: 'fetchPreTGEUserBonds', preTGEBonds, e },
|
|
73428
|
+
account,
|
|
73429
|
+
});
|
|
73357
73430
|
return [];
|
|
73358
73431
|
}
|
|
73359
73432
|
});
|
|
@@ -76026,10 +76099,11 @@ function useBondsData() {
|
|
|
76026
76099
|
const { data: tokenPrices } = useTokenPrices();
|
|
76027
76100
|
const { data: bondList } = useBondsList();
|
|
76028
76101
|
const SDKConfig = useSDKConfig();
|
|
76102
|
+
const apiUrl = useURLByEnvironment('apiV2');
|
|
76029
76103
|
const realTimeApiURL = useURLByEnvironment('realTimeApi');
|
|
76030
76104
|
return useQuery({
|
|
76031
76105
|
queryKey: [QUERY_KEYS.BONDS_DATA],
|
|
76032
|
-
queryFn: () => getBondsData(SDKConfig.chains, realTimeApiURL, tokenPrices, bondList),
|
|
76106
|
+
queryFn: () => getBondsData(SDKConfig.chains, realTimeApiURL, tokenPrices, bondList, apiUrl),
|
|
76033
76107
|
refetchInterval: 20000, // i.e. 20 sec
|
|
76034
76108
|
refetchOnWindowFocus: false,
|
|
76035
76109
|
retry: 0,
|
|
@@ -76037,12 +76111,12 @@ function useBondsData() {
|
|
|
76037
76111
|
enabled: !!SDKConfig.chains && SDKConfig.chains.length > 0,
|
|
76038
76112
|
});
|
|
76039
76113
|
}
|
|
76040
|
-
const getBondsData = (chains, realTimeApiURL, tokenPrices, bondList) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
76114
|
+
const getBondsData = (chains, realTimeApiURL, tokenPrices, bondList, apiUrl) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
76041
76115
|
try {
|
|
76042
76116
|
const response = yield axios.get(`${realTimeApiURL}/bonds`);
|
|
76043
76117
|
return response.data.bonds;
|
|
76044
76118
|
}
|
|
76045
|
-
catch (
|
|
76119
|
+
catch (e) {
|
|
76046
76120
|
console.time('Fallback'); // Start debug timer
|
|
76047
76121
|
const billData = [];
|
|
76048
76122
|
if (tokenPrices && bondList) {
|
|
@@ -76059,6 +76133,11 @@ const getBondsData = (chains, realTimeApiURL, tokenPrices, bondList) => __awaite
|
|
|
76059
76133
|
})));
|
|
76060
76134
|
}
|
|
76061
76135
|
console.timeEnd(`Fallback`); // End chain-specific timer
|
|
76136
|
+
reportError({
|
|
76137
|
+
apiUrl,
|
|
76138
|
+
error: e,
|
|
76139
|
+
extraInfo: { type: 'getBondsData', e },
|
|
76140
|
+
});
|
|
76062
76141
|
return billData === null || billData === void 0 ? void 0 : billData.flat();
|
|
76063
76142
|
}
|
|
76064
76143
|
});
|
|
@@ -76513,15 +76592,16 @@ var ERC_20_ABI = [
|
|
|
76513
76592
|
function useUserTokensBalance(tokens, chainId) {
|
|
76514
76593
|
const keys = tokens.map((token) => (token === 'NATIVE' ? 'NATIVE' : token.address[chainId]));
|
|
76515
76594
|
const { address: account } = useAccount();
|
|
76595
|
+
const apiUrl = useURLByEnvironment('apiV2');
|
|
76516
76596
|
return useQuery({
|
|
76517
76597
|
queryKey: [`${QUERY_KEYS.USER_TOKENS_BALANCES}-${keys}-${account}`],
|
|
76518
|
-
queryFn: () => getTokensBalance(account, tokens, chainId),
|
|
76598
|
+
queryFn: () => getTokensBalance(account, tokens, chainId, apiUrl),
|
|
76519
76599
|
staleTime: 60000,
|
|
76520
76600
|
refetchOnWindowFocus: false,
|
|
76521
76601
|
enabled: !!account,
|
|
76522
76602
|
});
|
|
76523
76603
|
}
|
|
76524
|
-
const getTokensBalance = (account, tokens, chainId) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
76604
|
+
const getTokensBalance = (account, tokens, chainId, apiUrl) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
76525
76605
|
try {
|
|
76526
76606
|
const callsToken = tokens
|
|
76527
76607
|
.filter((token) => token !== 'NATIVE')
|
|
@@ -76563,7 +76643,14 @@ const getTokensBalance = (account, tokens, chainId) => __awaiter$9(void 0, void
|
|
|
76563
76643
|
});
|
|
76564
76644
|
return [...balancesToken, ...balancesNative];
|
|
76565
76645
|
}
|
|
76566
|
-
catch (
|
|
76646
|
+
catch (e) {
|
|
76647
|
+
reportError({
|
|
76648
|
+
apiUrl,
|
|
76649
|
+
error: e,
|
|
76650
|
+
extraInfo: { type: 'getTokensBalance', tokens, e },
|
|
76651
|
+
account,
|
|
76652
|
+
chainId,
|
|
76653
|
+
});
|
|
76567
76654
|
return [];
|
|
76568
76655
|
}
|
|
76569
76656
|
});
|
|
@@ -77656,6 +77743,7 @@ const getTokenAllowance = (currency, spender, account, chainId) => __awaiter$9(v
|
|
|
77656
77743
|
return value.toNumber();
|
|
77657
77744
|
});
|
|
77658
77745
|
const useApproval = (amount, currency, spender, account, chainId) => {
|
|
77746
|
+
const apiUrl = useURLByEnvironment('apiV2');
|
|
77659
77747
|
const [confirmingTxOnWallet, setConfirmingTxOnWallet] = useState(false);
|
|
77660
77748
|
const [txHash, setTxHash] = useState('');
|
|
77661
77749
|
const { data: allowance, refetch } = useAllowance(currency, spender, account, chainId);
|
|
@@ -77697,6 +77785,13 @@ const useApproval = (amount, currency, spender, account, chainId) => {
|
|
|
77697
77785
|
setConfirmingTxOnWallet(false);
|
|
77698
77786
|
console.error('Approval failed:', error);
|
|
77699
77787
|
addToastError(error.message);
|
|
77788
|
+
reportError({
|
|
77789
|
+
apiUrl,
|
|
77790
|
+
error,
|
|
77791
|
+
extraInfo: { type: 'approval', tokenAddress: tokenAddress, spenderAddress: spender, error },
|
|
77792
|
+
chainId,
|
|
77793
|
+
account,
|
|
77794
|
+
});
|
|
77700
77795
|
}
|
|
77701
77796
|
}), [amount, currency, chainId]);
|
|
77702
77797
|
let approvalState = ApprovalState.NOT_APPROVED;
|
|
@@ -77712,7 +77807,7 @@ const useApproval = (amount, currency, spender, account, chainId) => {
|
|
|
77712
77807
|
return [approvalState !== null && approvalState !== void 0 ? approvalState : ApprovalState.NOT_APPROVED, handleApprove];
|
|
77713
77808
|
};
|
|
77714
77809
|
|
|
77715
|
-
const version$1 = '2.
|
|
77810
|
+
const version$1 = '2.29.1';
|
|
77716
77811
|
|
|
77717
77812
|
let errorConfig = {
|
|
77718
77813
|
getDocsUrl: ({ docsBaseUrl, docsPath = '', docsSlug, }) => docsPath
|
|
@@ -77945,6 +78040,7 @@ const ZapModal = ({ onDismiss, outputToken, account, chainId }) => {
|
|
|
77945
78040
|
const [typedValue, setTypedValue] = useState('');
|
|
77946
78041
|
const [inputTokenString, setInputTokenString] = useState('NATIVE');
|
|
77947
78042
|
// Hooks
|
|
78043
|
+
const SDKConfig = useSDKConfig();
|
|
77948
78044
|
const userChainId = useChainId();
|
|
77949
78045
|
const { switchChain } = useSwitchChain();
|
|
77950
78046
|
const inputToken = useTokenFromZapList(inputTokenString, chainId, null);
|
|
@@ -77973,7 +78069,7 @@ const ZapModal = ({ onDismiss, outputToken, account, chainId }) => {
|
|
|
77973
78069
|
setTypedValue(inputTokenBalance !== null && inputTokenBalance !== void 0 ? inputTokenBalance : '');
|
|
77974
78070
|
}, [inputTokenBalance]);
|
|
77975
78071
|
const soulZapCallback = useCallback(() => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
77976
|
-
var _a, _b;
|
|
78072
|
+
var _a, _b, _c;
|
|
77977
78073
|
if (zapData && ((_a = zapData === null || zapData === void 0 ? void 0 : zapData.txData) === null || _a === void 0 ? void 0 : _a.to) && ((_b = zapData === null || zapData === void 0 ? void 0 : zapData.txData) === null || _b === void 0 ? void 0 : _b.data)) {
|
|
77978
78074
|
try {
|
|
77979
78075
|
console.log(zapData);
|
|
@@ -78006,6 +78102,13 @@ const ZapModal = ({ onDismiss, outputToken, account, chainId }) => {
|
|
|
78006
78102
|
console.error(e);
|
|
78007
78103
|
setPendingTx(false);
|
|
78008
78104
|
addToastError(e.shortMessage);
|
|
78105
|
+
reportError({
|
|
78106
|
+
apiUrl: (_c = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.urls) === null || _c === void 0 ? void 0 : _c.apiV2,
|
|
78107
|
+
error: e,
|
|
78108
|
+
extraInfo: { type: 'zap-lp', zapData, e },
|
|
78109
|
+
chainId,
|
|
78110
|
+
account,
|
|
78111
|
+
});
|
|
78009
78112
|
}
|
|
78010
78113
|
}
|
|
78011
78114
|
}), [zapData, (_f = zapData === null || zapData === void 0 ? void 0 : zapData.txData) === null || _f === void 0 ? void 0 : _f.to, (_g = zapData === null || zapData === void 0 ? void 0 : zapData.txData) === null || _g === void 0 ? void 0 : _g.data]);
|
|
@@ -78544,7 +78647,14 @@ const getTierProofSig = (apiAddress, account, bondAddress, chainId) => __awaiter
|
|
|
78544
78647
|
const response = yield axios.post(`${apiAddress}/tier-signature`, requestBody);
|
|
78545
78648
|
return response.data.tierProofSignature;
|
|
78546
78649
|
}
|
|
78547
|
-
catch (
|
|
78650
|
+
catch (e) {
|
|
78651
|
+
reportError({
|
|
78652
|
+
apiUrl: apiAddress,
|
|
78653
|
+
error: e,
|
|
78654
|
+
extraInfo: { type: 'getTierProofSig', bondAddress, e },
|
|
78655
|
+
chainId,
|
|
78656
|
+
account,
|
|
78657
|
+
});
|
|
78548
78658
|
return null;
|
|
78549
78659
|
}
|
|
78550
78660
|
});
|
|
@@ -78673,7 +78783,7 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
|
|
|
78673
78783
|
};
|
|
78674
78784
|
// This is the regular buy bond interaction (a.k.a. write method called "deposit" in smartcontract)
|
|
78675
78785
|
const handleBuyCallback = () => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
78676
|
-
var _a, _b, _c, _d, _e;
|
|
78786
|
+
var _a, _b, _c, _d, _e, _f;
|
|
78677
78787
|
const billAddress = bondData === null || bondData === void 0 ? void 0 : bondData.billAddress;
|
|
78678
78788
|
const decimals = (_b = (_a = bondData === null || bondData === void 0 ? void 0 : bondData.lpToken.decimals) === null || _a === void 0 ? void 0 : _a[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]) !== null && _b !== void 0 ? _b : 18;
|
|
78679
78789
|
track({
|
|
@@ -78720,12 +78830,19 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
|
|
|
78720
78830
|
}
|
|
78721
78831
|
catch (error) {
|
|
78722
78832
|
console.error('Buy error', error);
|
|
78833
|
+
reportError({
|
|
78834
|
+
apiUrl: (_f = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.urls) === null || _f === void 0 ? void 0 : _f.apiV2,
|
|
78835
|
+
error,
|
|
78836
|
+
extraInfo: { type: 'buyBond', bondData, error },
|
|
78837
|
+
chainId: bondChain,
|
|
78838
|
+
account,
|
|
78839
|
+
});
|
|
78723
78840
|
addToastError(error.shortMessage);
|
|
78724
78841
|
}
|
|
78725
78842
|
});
|
|
78726
78843
|
// ignore this for SOL migration
|
|
78727
78844
|
const handleZapCallback = () => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
78728
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
78845
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
78729
78846
|
if (zapData && ((_a = zapData === null || zapData === void 0 ? void 0 : zapData.txData) === null || _a === void 0 ? void 0 : _a.to) && ((_b = zapData === null || zapData === void 0 ? void 0 : zapData.txData) === null || _b === void 0 ? void 0 : _b.data)) {
|
|
78730
78847
|
console.log('Attempting zap tx');
|
|
78731
78848
|
track({
|
|
@@ -78778,6 +78895,13 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
|
|
|
78778
78895
|
catch (e) {
|
|
78779
78896
|
console.log(e);
|
|
78780
78897
|
addToastError(e.shortMessage);
|
|
78898
|
+
reportError({
|
|
78899
|
+
apiUrl: (_j = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.urls) === null || _j === void 0 ? void 0 : _j.apiV2,
|
|
78900
|
+
error: e,
|
|
78901
|
+
extraInfo: { type: 'zapBuyBond', bondData, zapData, e },
|
|
78902
|
+
chainId: bondChain,
|
|
78903
|
+
account,
|
|
78904
|
+
});
|
|
78781
78905
|
}
|
|
78782
78906
|
}
|
|
78783
78907
|
});
|
|
@@ -79368,9 +79492,10 @@ const HotBondCard = ({ bond }) => {
|
|
|
79368
79492
|
};
|
|
79369
79493
|
|
|
79370
79494
|
function useHotBondContracts() {
|
|
79495
|
+
const apiUrl = useURLByEnvironment('apiV2');
|
|
79371
79496
|
return useQuery({
|
|
79372
79497
|
queryKey: [QUERY_KEYS.HOT_BONDS_CONTRACTS],
|
|
79373
|
-
queryFn: getHotBondsContracts,
|
|
79498
|
+
queryFn: () => getHotBondsContracts(apiUrl),
|
|
79374
79499
|
staleTime: Infinity,
|
|
79375
79500
|
refetchOnWindowFocus: false,
|
|
79376
79501
|
refetchOnMount: false,
|
|
@@ -79389,13 +79514,18 @@ function useHotBonds() {
|
|
|
79389
79514
|
retry: 0,
|
|
79390
79515
|
});
|
|
79391
79516
|
}
|
|
79392
|
-
const getHotBondsContracts = () => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
79517
|
+
const getHotBondsContracts = (apiUrl) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
79393
79518
|
try {
|
|
79394
79519
|
console.log('call!');
|
|
79395
79520
|
const response = yield axios.get(`${STRAPI_URL}/hot-bonds`);
|
|
79396
79521
|
return response.data.map((bond) => bond.BondAddress.toLowerCase());
|
|
79397
79522
|
}
|
|
79398
|
-
catch (
|
|
79523
|
+
catch (e) {
|
|
79524
|
+
reportError({
|
|
79525
|
+
apiUrl,
|
|
79526
|
+
error: e,
|
|
79527
|
+
extraInfo: { type: 'getHotBondsContracts', e },
|
|
79528
|
+
});
|
|
79399
79529
|
return [];
|
|
79400
79530
|
}
|
|
79401
79531
|
});
|