@orbs-network/spot-react 0.0.82 → 0.0.83
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/{ccip-BRRC7Ayf.js → ccip-C3uRf6DX.js} +1 -1
- package/dist/{index-4m06Z9Yu.js → index-DcxqFWqQ.js} +115 -115
- package/dist/spot-react/package.json.d.ts +1 -1
- package/dist/spot-react/src/spot-context.d.ts.map +1 -1
- package/dist/spot-react.js +1 -1
- package/dist/spot-react.umd.cjs +2 -2
- package/package.json +1 -1
|
@@ -707,7 +707,7 @@ const Xx = { chainName: "ftm", chainId: 250, twapVersion: 4, twapAddress: "0xd3B
|
|
|
707
707
|
]
|
|
708
708
|
}
|
|
709
709
|
], U5 = P5, GK = I5, O5 = F5, D5 = B5;
|
|
710
|
-
var
|
|
710
|
+
var Ee = /* @__PURE__ */ ((e) => (e.TWAP = "TWAP", e.LIMIT = "LIMIT", e.STOP_LOSS = "STOP_LOSS", e.TAKE_PROFIT = "TAKE_PROFIT", e))(Ee || {}), pt = /* @__PURE__ */ ((e) => (e.Open = "OPEN", e.Canceled = "CANCELED", e.Completed = "COMPLETED", e.Expired = "EXPIRED", e))(pt || {}), Jt = /* @__PURE__ */ ((e) => (e[e.Minutes = 6e4] = "Minutes", e[e.Hours = 36e5] = "Hours", e[e.Weeks = 6048e5] = "Weeks", e[e.Days = 864e5] = "Days", e[e.Months = 2592e6] = "Months", e[e.Years = 31536e6] = "Years", e))(Jt || {}), Ve = /* @__PURE__ */ ((e) => (e.LIMIT = "limit", e.TWAP_LIMIT = "twap-limit", e.TWAP_MARKET = "twap-market", e.TAKE_PROFIT = "take-profit", e.STOP_LOSS_LIMIT = "stop-loss-limit", e.STOP_LOSS_MARKET = "stop-loss-market", e))(Ve || {}), _5 = /* @__PURE__ */ ((e) => (e.Arbidex = "arbidex", e.Blackhole = "blackhole", e.Chronos = "chronos", e.Dragon = "dragon", e.Kodiak = "kodiak", e.Lynex = "lynex", e.Nami = "nami", e.Newera = "newera", e.Omni = "omni", e.Pancake = "pancake", e.Quick = "quick", e.Ramses = "ramses", e.Shadow = "shadow", e.Spark = "spark", e.Spooky = "spooky", e.Swapx = "swapx", e.Teafi = "teafi", e.Thena = "thena", e.Yowie = "yowie", e.Pangolin = "pangolin", e.Sushiswap = "sushiswap", e))(_5 || {}), Wt = /* @__PURE__ */ ((e) => (e[e.EMPTY_LIMIT_PRICE = 0] = "EMPTY_LIMIT_PRICE", e[e.MAX_CHUNKS = 1] = "MAX_CHUNKS", e[e.MIN_CHUNKS = 2] = "MIN_CHUNKS", e[e.MIN_TRADE_SIZE = 3] = "MIN_TRADE_SIZE", e[e.MAX_FILL_DELAY = 4] = "MAX_FILL_DELAY", e[e.MIN_FILL_DELAY = 5] = "MIN_FILL_DELAY", e[e.MAX_ORDER_DURATION = 6] = "MAX_ORDER_DURATION", e[e.MIN_ORDER_DURATION = 7] = "MIN_ORDER_DURATION", e[e.MISSING_LIMIT_PRICE = 8] = "MISSING_LIMIT_PRICE", e[e.STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE = 9] = "STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE", e[e.TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE = 10] = "TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE", e[e.TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE = 11] = "TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE", e[e.EMPTY_TRIGGER_PRICE = 12] = "EMPTY_TRIGGER_PRICE", e[e.INSUFFICIENT_BALANCE = 13] = "INSUFFICIENT_BALANCE", e[e.MAX_ORDER_SIZE = 14] = "MAX_ORDER_SIZE", e[e.MIN_TRADE_SIZE_ERROR = 15] = "MIN_TRADE_SIZE_ERROR", e))(Wt || {});
|
|
711
711
|
const gt = "0x0000000000000000000000000000000000000000", Mt = {
|
|
712
712
|
eth: {
|
|
713
713
|
id: 1,
|
|
@@ -1158,7 +1158,7 @@ const gt = "0x0000000000000000000000000000000000000000", Mt = {
|
|
|
1158
1158
|
eip1559: !0
|
|
1159
1159
|
}
|
|
1160
1160
|
};
|
|
1161
|
-
var M5 = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, td = Math.ceil, vr = Math.floor, Yt = "[BigNumber Error] ", Nm = Yt + "Number primitive has more than 15 significant digits: ", Dr = 1e14,
|
|
1161
|
+
var M5 = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, td = Math.ceil, vr = Math.floor, Yt = "[BigNumber Error] ", Nm = Yt + "Number primitive has more than 15 significant digits: ", Dr = 1e14, ve = 14, rd = 9007199254740991, nd = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], Zn = 1e7, Pt = 1e9;
|
|
1162
1162
|
function fb(e) {
|
|
1163
1163
|
var t, r, n, s = w.prototype = { constructor: w, toString: null, valueOf: null }, a = new w(1), o = 20, i = 4, c = -7, l = 21, u = -1e7, d = 1e7, f = !1, m = 1, y = 0, g = {
|
|
1164
1164
|
prefix: "",
|
|
@@ -1225,10 +1225,10 @@ function fb(e) {
|
|
|
1225
1225
|
else if (B < u)
|
|
1226
1226
|
F.c = [F.e = 0];
|
|
1227
1227
|
else {
|
|
1228
|
-
if (F.e = B, F.c = [], D = (B + 1) %
|
|
1229
|
-
for (D && F.c.push(+U.slice(0, D)), P -=
|
|
1230
|
-
F.c.push(+U.slice(D, D +=
|
|
1231
|
-
D =
|
|
1228
|
+
if (F.e = B, F.c = [], D = (B + 1) % ve, B < 0 && (D += ve), D < P) {
|
|
1229
|
+
for (D && F.c.push(+U.slice(0, D)), P -= ve; D < P; )
|
|
1230
|
+
F.c.push(+U.slice(D, D += ve));
|
|
1231
|
+
D = ve - (U = U.slice(D)).length;
|
|
1232
1232
|
} else
|
|
1233
1233
|
D -= P;
|
|
1234
1234
|
for (; D--; U += "0") ;
|
|
@@ -1290,7 +1290,7 @@ function fb(e) {
|
|
|
1290
1290
|
if (I === 0 && S.length === 1) return !0;
|
|
1291
1291
|
break e;
|
|
1292
1292
|
}
|
|
1293
|
-
if (b = (I + 1) %
|
|
1293
|
+
if (b = (I + 1) % ve, b < 1 && (b += ve), String(S[0]).length == b) {
|
|
1294
1294
|
for (b = 0; b < S.length; b++)
|
|
1295
1295
|
if (x = S[b], x < 0 || x >= Dr || x !== vr(x)) break e;
|
|
1296
1296
|
if (x !== 0) return !0;
|
|
@@ -1311,7 +1311,7 @@ function fb(e) {
|
|
|
1311
1311
|
};
|
|
1312
1312
|
return function(x) {
|
|
1313
1313
|
var S, I, B, D, k, P = 0, U = [], F = new w(a);
|
|
1314
|
-
if (x == null ? x = o : lt(x, 0, Pt), D = td(x /
|
|
1314
|
+
if (x == null ? x = o : lt(x, 0, Pt), D = td(x / ve), f)
|
|
1315
1315
|
if (crypto.getRandomValues) {
|
|
1316
1316
|
for (S = crypto.getRandomValues(new Uint32Array(D *= 2)); P < D; )
|
|
1317
1317
|
k = S[P] * 131072 + (S[P + 1] >>> 11), k >= 9e15 ? (I = crypto.getRandomValues(new Uint32Array(2)), S[P] = I[0], S[P + 1] = I[1]) : (U.push(k % 1e14), P += 2);
|
|
@@ -1325,13 +1325,13 @@ function fb(e) {
|
|
|
1325
1325
|
if (!f)
|
|
1326
1326
|
for (; P < D; )
|
|
1327
1327
|
k = b(), k < 9e15 && (U[P++] = k % 1e14);
|
|
1328
|
-
for (D = U[--P], x %=
|
|
1328
|
+
for (D = U[--P], x %= ve, D && x && (k = nd[ve - x], U[P] = vr(D / k) * k); U[P] === 0; U.pop(), P--) ;
|
|
1329
1329
|
if (P < 0)
|
|
1330
1330
|
U = [B = 0];
|
|
1331
1331
|
else {
|
|
1332
|
-
for (B = -1; U[0] === 0; U.splice(0, 1), B -=
|
|
1332
|
+
for (B = -1; U[0] === 0; U.splice(0, 1), B -= ve) ;
|
|
1333
1333
|
for (P = 1, k = U[0]; k >= 10; k /= 10, P++) ;
|
|
1334
|
-
P <
|
|
1334
|
+
P < ve && (B -= ve - P);
|
|
1335
1335
|
}
|
|
1336
1336
|
return F.e = B, F.c = U, F;
|
|
1337
1337
|
};
|
|
@@ -1394,20 +1394,20 @@ function fb(e) {
|
|
|
1394
1394
|
for (; !S[0] && S.length > 1; S.splice(0, 1)) ;
|
|
1395
1395
|
}
|
|
1396
1396
|
return function(S, I, B, D, k) {
|
|
1397
|
-
var P, U, F, R, L, $, Z, pe, be, ie, de, Be, K,
|
|
1398
|
-
if (!
|
|
1397
|
+
var P, U, F, R, L, $, Z, pe, be, ie, de, Be, K, xe, Ue, ze, st, Ae = S.s == I.s ? 1 : -1, we = S.c, ye = I.c;
|
|
1398
|
+
if (!we || !we[0] || !ye || !ye[0])
|
|
1399
1399
|
return new w(
|
|
1400
1400
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
1401
|
-
!S.s || !I.s || (
|
|
1401
|
+
!S.s || !I.s || (we ? ye && we[0] == ye[0] : !ye) ? NaN : (
|
|
1402
1402
|
// Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
|
|
1403
|
-
|
|
1403
|
+
we && we[0] == 0 || !ye ? Ae * 0 : Ae / 0
|
|
1404
1404
|
)
|
|
1405
1405
|
);
|
|
1406
|
-
for (pe = new w(Ae), be = pe.c = [], U = S.e - I.e, Ae = B + U + 1, k || (k = Dr, U = Er(S.e /
|
|
1407
|
-
if (ye[F] > (
|
|
1406
|
+
for (pe = new w(Ae), be = pe.c = [], U = S.e - I.e, Ae = B + U + 1, k || (k = Dr, U = Er(S.e / ve) - Er(I.e / ve), Ae = Ae / ve | 0), F = 0; ye[F] == (we[F] || 0); F++) ;
|
|
1407
|
+
if (ye[F] > (we[F] || 0) && U--, Ae < 0)
|
|
1408
1408
|
be.push(1), R = !0;
|
|
1409
1409
|
else {
|
|
1410
|
-
for (
|
|
1410
|
+
for (xe = we.length, ze = ye.length, F = 0, Ae += 2, L = vr(k / (ye[0] + 1)), L > 1 && (ye = h(ye, L, k), we = h(we, L, k), ze = ye.length, xe = we.length), K = ze, ie = we.slice(0, ze), de = ie.length; de < ze; ie[de++] = 0) ;
|
|
1411
1411
|
st = ye.slice(), st = [0].concat(st), Ue = ye[0], ye[1] >= k / 2 && Ue++;
|
|
1412
1412
|
do {
|
|
1413
1413
|
if (L = 0, P = b(ye, ie, ze, de), P < 0) {
|
|
@@ -1420,13 +1420,13 @@ function fb(e) {
|
|
|
1420
1420
|
for (; b(ye, ie, ze, de) < 1; )
|
|
1421
1421
|
L++, x(ie, ze < de ? st : ye, de, k), de = ie.length;
|
|
1422
1422
|
} else P === 0 && (L++, ie = [0]);
|
|
1423
|
-
be[F++] = L, ie[0] ? ie[de++] =
|
|
1424
|
-
} while ((K++ <
|
|
1423
|
+
be[F++] = L, ie[0] ? ie[de++] = we[K] || 0 : (ie = [we[K]], de = 1);
|
|
1424
|
+
} while ((K++ < xe || ie[0] != null) && Ae--);
|
|
1425
1425
|
R = ie[0] != null, be[0] || be.splice(0, 1);
|
|
1426
1426
|
}
|
|
1427
1427
|
if (k == Dr) {
|
|
1428
1428
|
for (F = 1, Ae = be[0]; Ae >= 10; Ae /= 10, F++) ;
|
|
1429
|
-
N(pe, B + (pe.e = F + U *
|
|
1429
|
+
N(pe, B + (pe.e = F + U * ve - 1) + 1, D, R);
|
|
1430
1430
|
} else
|
|
1431
1431
|
pe.e = U, pe.r = +R;
|
|
1432
1432
|
return pe;
|
|
@@ -1454,7 +1454,7 @@ function fb(e) {
|
|
|
1454
1454
|
function O(h, b, x) {
|
|
1455
1455
|
for (var S = 1, I = b.length; !b[--I]; b.pop()) ;
|
|
1456
1456
|
for (I = b[0]; I >= 10; I /= 10, S++) ;
|
|
1457
|
-
return (x = S + x *
|
|
1457
|
+
return (x = S + x * ve - 1) > d ? h.c = h.e = null : x < u ? h.c = [h.e = 0] : (h.e = x, h.c = b), h;
|
|
1458
1458
|
}
|
|
1459
1459
|
n = /* @__PURE__ */ (function() {
|
|
1460
1460
|
var h = /^(-?)0([xbo])(?=\w[\w.]*$)/i, b = /^([^.]+)\.$/, x = /^\.([^.]+)$/, S = /^-?(Infinity|NaN)$/, I = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
|
|
@@ -1480,24 +1480,24 @@ function fb(e) {
|
|
|
1480
1480
|
e: {
|
|
1481
1481
|
for (I = 1, k = R[0]; k >= 10; k /= 10, I++) ;
|
|
1482
1482
|
if (B = b - I, B < 0)
|
|
1483
|
-
B +=
|
|
1484
|
-
else if (U = td((B + 1) /
|
|
1483
|
+
B += ve, D = b, P = R[U = 0], F = vr(P / L[I - D - 1] % 10);
|
|
1484
|
+
else if (U = td((B + 1) / ve), U >= R.length)
|
|
1485
1485
|
if (S) {
|
|
1486
1486
|
for (; R.length <= U; R.push(0)) ;
|
|
1487
|
-
P = F = 0, I = 1, B %=
|
|
1487
|
+
P = F = 0, I = 1, B %= ve, D = B - ve + 1;
|
|
1488
1488
|
} else
|
|
1489
1489
|
break e;
|
|
1490
1490
|
else {
|
|
1491
1491
|
for (P = k = R[U], I = 1; k >= 10; k /= 10, I++) ;
|
|
1492
|
-
B %=
|
|
1492
|
+
B %= ve, D = B - ve + I, F = D < 0 ? 0 : vr(P / L[I - D - 1] % 10);
|
|
1493
1493
|
}
|
|
1494
1494
|
if (S = S || b < 0 || // Are there any non-zero digits after the rounding digit?
|
|
1495
1495
|
// The expression n % pows10[d - j - 1] returns all digits of n to the right
|
|
1496
1496
|
// of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
|
|
1497
1497
|
R[U + 1] != null || (D < 0 ? P : P % L[I - D - 1]), S = x < 4 ? (F || S) && (x == 0 || x == (h.s < 0 ? 3 : 2)) : F > 5 || F == 5 && (x == 4 || S || x == 6 && // Check whether the digit to the left of the rounding digit is odd.
|
|
1498
1498
|
(B > 0 ? D > 0 ? P / L[I - D] : 0 : R[U - 1]) % 10 & 1 || x == (h.s < 0 ? 8 : 7)), b < 1 || !R[0])
|
|
1499
|
-
return R.length = 0, S ? (b -= h.e + 1, R[0] = L[(
|
|
1500
|
-
if (B == 0 ? (R.length = U, k = 1, U--) : (R.length = U + 1, k = L[
|
|
1499
|
+
return R.length = 0, S ? (b -= h.e + 1, R[0] = L[(ve - b % ve) % ve], h.e = -b || 0) : R[0] = h.e = 0, h;
|
|
1500
|
+
if (B == 0 ? (R.length = U, k = 1, U--) : (R.length = U + 1, k = L[ve - B], R[U] = D > 0 ? vr(P / L[I - D] % L[D]) * k : 0), S)
|
|
1501
1501
|
for (; ; )
|
|
1502
1502
|
if (U == 0) {
|
|
1503
1503
|
for (B = 1, D = R[0]; D >= 10; D /= 10, B++) ;
|
|
@@ -1528,7 +1528,7 @@ function fb(e) {
|
|
|
1528
1528
|
if (h != null)
|
|
1529
1529
|
return lt(h, 0, Pt), b == null ? b = i : lt(b, 0, 8), N(new w(B), h + B.e + 1, b);
|
|
1530
1530
|
if (!(x = B.c)) return null;
|
|
1531
|
-
if (S = ((I = x.length - 1) - Er(this.e /
|
|
1531
|
+
if (S = ((I = x.length - 1) - Er(this.e / ve)) * ve, I = x[I]) for (; I % 10 == 0; I /= 10, S--) ;
|
|
1532
1532
|
return S < 0 && (S = 0), S;
|
|
1533
1533
|
}, s.dividedBy = s.div = function(h, b) {
|
|
1534
1534
|
return t(this, new w(h, b), o, i);
|
|
@@ -1546,7 +1546,7 @@ function fb(e) {
|
|
|
1546
1546
|
} else {
|
|
1547
1547
|
if (h.e > 9 && (R.e > 0 || R.e < -1 || (R.e == 0 ? R.c[0] > 1 || k && R.c[1] >= 24e7 : R.c[0] < 8e13 || k && R.c[0] <= 9999975e7)))
|
|
1548
1548
|
return B = R.s < 0 && Fc(h) ? -0 : 0, R.e > -1 && (B = 1 / B), new w(P ? 1 / B : B);
|
|
1549
|
-
y && (B = td(y /
|
|
1549
|
+
y && (B = td(y / ve + 2));
|
|
1550
1550
|
}
|
|
1551
1551
|
for (k ? (x = new w(0.5), P && (h.s = 1), U = Fc(h)) : (I = Math.abs(+T(h)), U = I % 2), F = new w(a); ; ) {
|
|
1552
1552
|
if (U) {
|
|
@@ -1577,7 +1577,7 @@ function fb(e) {
|
|
|
1577
1577
|
}, s.isGreaterThanOrEqualTo = s.gte = function(h, b) {
|
|
1578
1578
|
return (b = Us(this, new w(h, b))) === 1 || b === 0;
|
|
1579
1579
|
}, s.isInteger = function() {
|
|
1580
|
-
return !!this.c && Er(this.e /
|
|
1580
|
+
return !!this.c && Er(this.e / ve) > this.c.length - 2;
|
|
1581
1581
|
}, s.isLessThan = s.lt = function(h, b) {
|
|
1582
1582
|
return Us(this, new w(h, b)) < 0;
|
|
1583
1583
|
}, s.isLessThanOrEqualTo = s.lte = function(h, b) {
|
|
@@ -1595,7 +1595,7 @@ function fb(e) {
|
|
|
1595
1595
|
if (h = new w(h, b), b = h.s, !k || !b) return new w(NaN);
|
|
1596
1596
|
if (k != b)
|
|
1597
1597
|
return h.s = -b, D.plus(h);
|
|
1598
|
-
var P = D.e /
|
|
1598
|
+
var P = D.e / ve, U = h.e / ve, F = D.c, R = h.c;
|
|
1599
1599
|
if (!P || !U) {
|
|
1600
1600
|
if (!F || !R) return F ? (h.s = -b, h) : new w(R ? D : NaN);
|
|
1601
1601
|
if (!F[0] || !R[0])
|
|
@@ -1630,7 +1630,7 @@ function fb(e) {
|
|
|
1630
1630
|
var x, S, I, B, D, k, P, U, F, R, L, $, Z, pe, be, ie = this, de = ie.c, Be = (h = new w(h, b)).c;
|
|
1631
1631
|
if (!de || !Be || !de[0] || !Be[0])
|
|
1632
1632
|
return !ie.s || !h.s || de && !de[0] && !Be || Be && !Be[0] && !de ? h.c = h.e = h.s = null : (h.s *= ie.s, !de || !Be ? h.c = h.e = null : (h.c = [0], h.e = 0)), h;
|
|
1633
|
-
for (S = Er(ie.e /
|
|
1633
|
+
for (S = Er(ie.e / ve) + Er(h.e / ve), h.s *= ie.s, P = de.length, R = Be.length, P < R && (Z = de, de = Be, Be = Z, I = P, P = R, R = I), I = P + R, Z = []; I--; Z.push(0)) ;
|
|
1634
1634
|
for (pe = Dr, be = Zn, I = R; --I >= 0; ) {
|
|
1635
1635
|
for (x = 0, L = Be[I] % be, $ = Be[I] / be | 0, D = P, B = I + D; B > I; )
|
|
1636
1636
|
U = de[--D] % be, F = de[D] / be | 0, k = $ * U + F * L, U = L * U + k % be * be + Z[B] + x, x = (U / pe | 0) + (k / be | 0) + $ * F, Z[B--] = U % pe;
|
|
@@ -1645,7 +1645,7 @@ function fb(e) {
|
|
|
1645
1645
|
if (h = new w(h, b), b = h.s, !I || !b) return new w(NaN);
|
|
1646
1646
|
if (I != b)
|
|
1647
1647
|
return h.s = -b, S.minus(h);
|
|
1648
|
-
var B = S.e /
|
|
1648
|
+
var B = S.e / ve, D = h.e / ve, k = S.c, P = h.c;
|
|
1649
1649
|
if (!B || !D) {
|
|
1650
1650
|
if (!k || !P) return new w(I / 0);
|
|
1651
1651
|
if (!k[0] || !P[0]) return P[0] ? h : new w(k[0] ? S : I * 0);
|
|
@@ -1662,7 +1662,7 @@ function fb(e) {
|
|
|
1662
1662
|
if (h != null && h !== !!h)
|
|
1663
1663
|
return lt(h, 1, Pt), b == null ? b = i : lt(b, 0, 8), N(new w(B), h, b);
|
|
1664
1664
|
if (!(x = B.c)) return null;
|
|
1665
|
-
if (I = x.length - 1, S = I *
|
|
1665
|
+
if (I = x.length - 1, S = I * ve + 1, I = x[I]) {
|
|
1666
1666
|
for (; I % 10 == 0; I /= 10, S--) ;
|
|
1667
1667
|
for (I = x[0]; I >= 10; I /= 10, S++) ;
|
|
1668
1668
|
}
|
|
@@ -1715,7 +1715,7 @@ function fb(e) {
|
|
|
1715
1715
|
if (h != null && (k = new w(h), !k.isInteger() && (k.c || k.s !== 1) || k.lt(a)))
|
|
1716
1716
|
throw Error(Yt + "Argument " + (k.isInteger() ? "out of range: " : "not an integer: ") + T(k));
|
|
1717
1717
|
if (!Z) return new w($);
|
|
1718
|
-
for (b = new w(a), U = x = new w(a), S = P = new w(a), L = xr(Z), B = b.e = L.length - $.e - 1, b.c[0] = nd[(D = B %
|
|
1718
|
+
for (b = new w(a), U = x = new w(a), S = P = new w(a), L = xr(Z), B = b.e = L.length - $.e - 1, b.c[0] = nd[(D = B % ve) < 0 ? ve + D : D], h = !h || k.comparedTo(b) > 0 ? B > 0 ? b : U : k, D = d, d = 1 / 0, k = new w(L), P.c[0] = 0; F = t(k, b, 0, 1), I = x.plus(F.times(S)), I.comparedTo(h) != 1; )
|
|
1719
1719
|
x = S, S = I, U = P.plus(F.times(I = U)), P = I, b = k.minus(F.times(I = b)), k = I;
|
|
1720
1720
|
return I = t(h.minus(x), S, 0, 1), P = P.plus(I.times(U)), x = x.plus(I.times(S)), P.s = U.s = $.s, B = B * 2, R = t(U, S, B, i).minus($).abs().comparedTo(
|
|
1721
1721
|
t(P, x, B, i).minus($).abs()
|
|
@@ -1737,7 +1737,7 @@ function Er(e) {
|
|
|
1737
1737
|
}
|
|
1738
1738
|
function xr(e) {
|
|
1739
1739
|
for (var t, r, n = 1, s = e.length, a = e[0] + ""; n < s; ) {
|
|
1740
|
-
for (t = e[n++] + "", r =
|
|
1740
|
+
for (t = e[n++] + "", r = ve - t.length; r--; t = "0" + t) ;
|
|
1741
1741
|
a += t;
|
|
1742
1742
|
}
|
|
1743
1743
|
for (s = a.length; a.charCodeAt(--s) === 48; ) ;
|
|
@@ -1759,7 +1759,7 @@ function lt(e, t, r, n) {
|
|
|
1759
1759
|
}
|
|
1760
1760
|
function Fc(e) {
|
|
1761
1761
|
var t = e.c.length - 1;
|
|
1762
|
-
return Er(e.e /
|
|
1762
|
+
return Er(e.e / ve) == t && e.c[t] % 2 != 0;
|
|
1763
1763
|
}
|
|
1764
1764
|
function Uc(e, t) {
|
|
1765
1765
|
return (e.length > 1 ? e.charAt(0) + "." + e.slice(1) : e) + (t < 0 ? "e" : "e+") + t;
|
|
@@ -2103,15 +2103,15 @@ const aw = (e, t, r) => {
|
|
|
2103
2103
|
const s = H(e).times(H(t)), a = H(10).pow(n), o = s.div(a);
|
|
2104
2104
|
return H.max(1, o).integerValue(H.ROUND_FLOOR).toFixed(0);
|
|
2105
2105
|
}, iw = (e, t, r, n) => {
|
|
2106
|
-
if (e ===
|
|
2106
|
+
if (e === Ee.TWAP || e === Ee.LIMIT)
|
|
2107
2107
|
return "0";
|
|
2108
2108
|
if (!n || !t || !r) return;
|
|
2109
2109
|
const s = H(t).times(H(r)), a = H(10).pow(n), o = s.div(a);
|
|
2110
2110
|
return H.max(1, o).integerValue(H.ROUND_FLOOR).toFixed(0) || "0";
|
|
2111
2111
|
}, cw = (e, t, r, n) => {
|
|
2112
2112
|
const s = ys(r) * 2 * t, a = Zi(Xi.DURATION), o = R5(a ? Number(a) : s);
|
|
2113
|
-
return a ? { unit: o, value: Number(H(Number(a) / o).toFixed(2)) } : n || (e ===
|
|
2114
|
-
}, lw = (e, t, r) => t !==
|
|
2113
|
+
return a ? { unit: o, value: Number(H(Number(a) / o).toFixed(2)) } : n || (e === Ee.LIMIT ? { unit: Jt.Days, value: 7 } : e === Ee.STOP_LOSS || e === Ee.TAKE_PROFIT ? { unit: Jt.Days, value: 1 } : { unit: o, value: Number(H(s / o).toFixed(2)) });
|
|
2114
|
+
}, lw = (e, t, r) => t !== Ee.TWAP ? 1 : r !== void 0 ? r : e, uw = (e, t, r, n) => {
|
|
2115
2115
|
if (!t || !r || !n) return 1;
|
|
2116
2116
|
const a = H(r).times(t).div(n).integerValue(H.ROUND_FLOOR).toNumber(), o = Math.floor(
|
|
2117
2117
|
ni / 2 / ys(e)
|
|
@@ -2121,30 +2121,30 @@ const aw = (e, t, r) => {
|
|
|
2121
2121
|
isError: !(e.unit === rp.unit && e.value === rp.value) && ys(e) * t > ni,
|
|
2122
2122
|
value: Math.floor(ni / t)
|
|
2123
2123
|
}), mw = (e = "", t = "", r) => {
|
|
2124
|
-
if (r ===
|
|
2124
|
+
if (r === Ee.STOP_LOSS)
|
|
2125
2125
|
return {
|
|
2126
2126
|
isError: H(t || 0).gte(H(e || 0)),
|
|
2127
2127
|
value: e
|
|
2128
2128
|
};
|
|
2129
2129
|
}, hw = (e = "", t = "", r) => {
|
|
2130
|
-
if (r ===
|
|
2130
|
+
if (r === Ee.TAKE_PROFIT)
|
|
2131
2131
|
return {
|
|
2132
2132
|
isError: H(t || 0).lte(H(e || 0)),
|
|
2133
2133
|
value: e
|
|
2134
2134
|
};
|
|
2135
2135
|
}, bw = (e = "", t = "", r = !1, n) => {
|
|
2136
|
-
if (!r && n ===
|
|
2136
|
+
if (!r && n === Ee.STOP_LOSS)
|
|
2137
2137
|
return {
|
|
2138
2138
|
isError: H(t || 0).gte(H(e || 0)),
|
|
2139
2139
|
value: e
|
|
2140
2140
|
};
|
|
2141
2141
|
}, yw = (e = "", t = "", r = !1, n) => {
|
|
2142
|
-
if (!r && n ===
|
|
2142
|
+
if (!r && n === Ee.TAKE_PROFIT)
|
|
2143
2143
|
return {
|
|
2144
2144
|
isError: H(t || 0).gte(H(e || 0)),
|
|
2145
2145
|
value: e
|
|
2146
2146
|
};
|
|
2147
|
-
}, gw = (e, t) => e ===
|
|
2147
|
+
}, gw = (e, t) => e === Ee.STOP_LOSS || e === Ee.TAKE_PROFIT ? {
|
|
2148
2148
|
isError: ys(t) > 5184e6,
|
|
2149
2149
|
value: 5184e6
|
|
2150
2150
|
} : {
|
|
@@ -2161,7 +2161,7 @@ const aw = (e, t, r) => {
|
|
|
2161
2161
|
isError: H(t || 0).multipliedBy(e || 0).isLessThan(r),
|
|
2162
2162
|
value: r
|
|
2163
2163
|
}), Ew = (e, t, r) => ({
|
|
2164
|
-
isError: r ===
|
|
2164
|
+
isError: r === Ee.TWAP && H(e).isGreaterThan(t),
|
|
2165
2165
|
value: t
|
|
2166
2166
|
}), gb = (e, t = 0) => {
|
|
2167
2167
|
var o;
|
|
@@ -2218,7 +2218,7 @@ const aw = (e, t, r) => {
|
|
|
2218
2218
|
config: d,
|
|
2219
2219
|
module: f
|
|
2220
2220
|
}) => {
|
|
2221
|
-
const m = Date.now().toString(), y = parseInt((a / 1e3).toFixed(0)), g = N5(s / 1e3), E = Zi(Xi.FRESHNESS), v = E ? parseInt(E) : 60, w = f ===
|
|
2221
|
+
const m = Date.now().toString(), y = parseInt((a / 1e3).toFixed(0)), g = N5(s / 1e3), E = Zi(Xi.FRESHNESS), v = E ? parseInt(E) : 60, w = f === Ee.TAKE_PROFIT ? Ef : u, A = f === Ee.TAKE_PROFIT ? u : l, C = {
|
|
2222
2222
|
permitted: {
|
|
2223
2223
|
token: t,
|
|
2224
2224
|
amount: n
|
|
@@ -2938,7 +2938,7 @@ const Yw = async ({
|
|
|
2938
2938
|
}) => (await Promise.all([
|
|
2939
2939
|
s ? Yw({ chainId: r, signal: e, page: t, limit: n, filters: { accounts: [a], configs: s.twapConfig ? [s.twapConfig] : [] } }) : Promise.resolve([]),
|
|
2940
2940
|
zw({ chainId: r, signal: e, account: a, exchange: s == null ? void 0 : s.adapter })
|
|
2941
|
-
]).then(([c, l]) => [...c, ...l])).sort((c, l) => l.createdAt - c.createdAt), Jw = "0.0.
|
|
2941
|
+
]).then(([c, l]) => [...c, ...l])).sort((c, l) => l.createdAt - c.createdAt), Jw = "0.0.83", e3 = {
|
|
2942
2942
|
version: Jw
|
|
2943
2943
|
};
|
|
2944
2944
|
var yo = class {
|
|
@@ -11592,7 +11592,7 @@ async function gu(e, t) {
|
|
|
11592
11592
|
});
|
|
11593
11593
|
return ie === "0x" ? { data: void 0 } : { data: ie };
|
|
11594
11594
|
} catch (U) {
|
|
11595
|
-
const F = i7(U), { offchainLookup: R, offchainLookupSignature: L } = await import("./ccip-
|
|
11595
|
+
const F = i7(U), { offchainLookup: R, offchainLookupSignature: L } = await import("./ccip-C3uRf6DX.js");
|
|
11596
11596
|
if (e.ccipRead !== !1 && (F == null ? void 0 : F.slice(0, 10)) === L && C)
|
|
11597
11597
|
return { data: await R(e, { data: F, to: C }) };
|
|
11598
11598
|
throw S && (F == null ? void 0 : F.slice(0, 10)) === "0x101bb98d" ? new ME({ factory: f }) : l0(U, {
|
|
@@ -15799,29 +15799,29 @@ function _9(e) {
|
|
|
15799
15799
|
return Na("num < 2^" + a, k, Un, h), cc(k, s);
|
|
15800
15800
|
}
|
|
15801
15801
|
function x(k, P, U = S) {
|
|
15802
|
-
if (["recovered", "canonical"].some((
|
|
15802
|
+
if (["recovered", "canonical"].some((xe) => xe in U))
|
|
15803
15803
|
throw new Error("sign() legacy options not supported");
|
|
15804
15804
|
const { hash: F, randomBytes: R } = t;
|
|
15805
15805
|
let { lowS: L, prehash: $, extraEntropy: Z } = U;
|
|
15806
15806
|
L == null && (L = !0), k = kr("msgHash", k), s1(U), $ && (k = kr("prehashed msgHash", F(k)));
|
|
15807
15807
|
const pe = T(k), be = d(P), ie = [b(be), b(pe)];
|
|
15808
15808
|
if (Z != null && Z !== !1) {
|
|
15809
|
-
const
|
|
15810
|
-
ie.push(kr("extraEntropy",
|
|
15809
|
+
const xe = Z === !0 ? R(r.BYTES) : Z;
|
|
15810
|
+
ie.push(kr("extraEntropy", xe));
|
|
15811
15811
|
}
|
|
15812
15812
|
const de = Nl(...ie), Be = pe;
|
|
15813
|
-
function K(
|
|
15814
|
-
const Ue = N(
|
|
15813
|
+
function K(xe) {
|
|
15814
|
+
const Ue = N(xe);
|
|
15815
15815
|
if (!m(Ue))
|
|
15816
15816
|
return;
|
|
15817
15817
|
const ze = l(Ue), st = u.BASE.multiply(Ue).toAffine(), Ae = c(st.x);
|
|
15818
15818
|
if (Ae === Un)
|
|
15819
15819
|
return;
|
|
15820
|
-
const
|
|
15821
|
-
if (
|
|
15820
|
+
const we = c(ze * c(Be + Ae * be));
|
|
15821
|
+
if (we === Un)
|
|
15822
15822
|
return;
|
|
15823
|
-
let ye = (st.x === Ae ? 0 : 2) | Number(st.y & Bt), Xe =
|
|
15824
|
-
return L && y(
|
|
15823
|
+
let ye = (st.x === Ae ? 0 : 2) | Number(st.y & Bt), Xe = we;
|
|
15824
|
+
return L && y(we) && (Xe = g(we), ye ^= 1), new v(Ae, Xe, ye);
|
|
15825
15825
|
}
|
|
15826
15826
|
return { seed: de, k2sig: K };
|
|
15827
15827
|
}
|
|
@@ -15861,7 +15861,7 @@ function _9(e) {
|
|
|
15861
15861
|
if (!ie || L && ie.hasHighS())
|
|
15862
15862
|
return !1;
|
|
15863
15863
|
$ && (P = t.hash(P));
|
|
15864
|
-
const { r: Be, s: K } = ie,
|
|
15864
|
+
const { r: Be, s: K } = ie, xe = T(P), Ue = l(K), ze = c(xe * Ue), st = c(Be * Ue), Ae = (ye = u.BASE.multiplyAndAddUnsafe(de, ze, st)) == null ? void 0 : ye.toAffine();
|
|
15865
15865
|
return Ae ? c(Ae.x) === Be : !1;
|
|
15866
15866
|
}
|
|
15867
15867
|
return {
|
|
@@ -35861,7 +35861,7 @@ const sf = Yi({}), BL = new k3({
|
|
|
35861
35861
|
}, [t]), rs(() => {
|
|
35862
35862
|
var o, i, c, l, u, d, f, m, y, g, E, v;
|
|
35863
35863
|
t({
|
|
35864
|
-
isMarketOrder:
|
|
35864
|
+
isMarketOrder: (i = (o = e.overrides) == null ? void 0 : o.state) == null ? void 0 : i.isMarketOrder,
|
|
35865
35865
|
typedChunks: (l = (c = e.overrides) == null ? void 0 : c.state) == null ? void 0 : l.chunks,
|
|
35866
35866
|
typedFillDelay: (d = (u = e.overrides) == null ? void 0 : u.state) == null ? void 0 : d.fillDelay,
|
|
35867
35867
|
typedDuration: (m = (f = e.overrides) == null ? void 0 : f.state) == null ? void 0 : m.duration,
|
|
@@ -35879,7 +35879,7 @@ const sf = Yi({}), BL = new k3({
|
|
|
35879
35879
|
limitPricePercent: void 0
|
|
35880
35880
|
});
|
|
35881
35881
|
}, [(s = e.srcToken) == null ? void 0 : s.address, (a = e.dstToken) == null ? void 0 : a.address]), rs(() => {
|
|
35882
|
-
e.module ===
|
|
35882
|
+
e.module === Ee.LIMIT && t({ isMarketOrder: !1 }), e.module === Ee.TAKE_PROFIT && t({ isMarketOrder: !0 });
|
|
35883
35883
|
}, [e.module]), rs(() => {
|
|
35884
35884
|
r && t({ isInvertedTrade: !1 });
|
|
35885
35885
|
}, [r]), null;
|
|
@@ -39556,7 +39556,7 @@ const fm = () => {
|
|
|
39556
39556
|
}, [t, e]);
|
|
39557
39557
|
}, X2 = () => {
|
|
39558
39558
|
const { module: e } = ne(), t = ee((r) => r.state.isMarketOrder);
|
|
39559
|
-
return Q(() => e ===
|
|
39559
|
+
return Q(() => e === Ee.TWAP ? t ? Ve.TWAP_MARKET : Ve.TWAP_LIMIT : e === Ee.LIMIT ? Ve.LIMIT : e === Ee.STOP_LOSS ? t ? Ve.STOP_LOSS_MARKET : Ve.STOP_LOSS_LIMIT : e === Ee.TAKE_PROFIT ? Ve.TAKE_PROFIT : Ve.TWAP_MARKET, [e, t]);
|
|
39560
39560
|
}, Q2 = () => {
|
|
39561
39561
|
const e = X2();
|
|
39562
39562
|
return Z2(e);
|
|
@@ -41623,10 +41623,10 @@ const xa = je(
|
|
|
41623
41623
|
);
|
|
41624
41624
|
const de = [];
|
|
41625
41625
|
if (B.length > 0) {
|
|
41626
|
-
const Ae = B[0],
|
|
41626
|
+
const Ae = B[0], we = B[B.length - 1];
|
|
41627
41627
|
let ye = 0;
|
|
41628
|
-
for (const Xe of Va(be, Ae,
|
|
41629
|
-
const Ke = Xe.value, Je = Math.max(Xe.start, Ae), gr = Math.min(Xe.end,
|
|
41628
|
+
for (const Xe of Va(be, Ae, we)) {
|
|
41629
|
+
const Ke = Xe.value, Je = Math.max(Xe.start, Ae), gr = Math.min(Xe.end, we);
|
|
41630
41630
|
for (let Ut = Je; Ut <= gr; Ut++)
|
|
41631
41631
|
de.push({ data: U == null ? void 0 : U[Ut], index: Ut, offset: ye, size: Ke }), ye += Ke;
|
|
41632
41632
|
}
|
|
@@ -41636,24 +41636,24 @@ const xa = je(
|
|
|
41636
41636
|
const Be = B.length > 0 ? B[B.length - 1] + 1 : 0, K = WW(pe, T, h, Be);
|
|
41637
41637
|
if (K.length === 0)
|
|
41638
41638
|
return null;
|
|
41639
|
-
const
|
|
41640
|
-
for (const
|
|
41641
|
-
const ye =
|
|
41642
|
-
let Xe = ye.offset, Ke =
|
|
41639
|
+
const xe = b - 1, Ue = Yu([], (Ae) => {
|
|
41640
|
+
for (const we of K) {
|
|
41641
|
+
const ye = we.value;
|
|
41642
|
+
let Xe = ye.offset, Ke = we.start;
|
|
41643
41643
|
const Je = ye.size;
|
|
41644
41644
|
if (ye.offset < T) {
|
|
41645
41645
|
Ke += Math.floor((T - ye.offset + k) / (Je + k));
|
|
41646
|
-
const Ut = Ke -
|
|
41646
|
+
const Ut = Ke - we.start;
|
|
41647
41647
|
Xe += Ut * Je + Ut * k;
|
|
41648
41648
|
}
|
|
41649
41649
|
Ke < Be && (Xe += (Be - Ke) * Je, Ke = Be);
|
|
41650
|
-
const gr = Math.min(
|
|
41650
|
+
const gr = Math.min(we.end, xe);
|
|
41651
41651
|
for (let Ut = Ke; Ut <= gr && !(Xe >= h); Ut++)
|
|
41652
41652
|
Ae.push({ data: U == null ? void 0 : U[Ut], index: Ut, offset: Xe, size: Je }), Xe += Je + k;
|
|
41653
41653
|
}
|
|
41654
41654
|
}), ze = j1(P, Hi), st = j1(P, Gi);
|
|
41655
41655
|
if (Ue.length > 0 && (ze > 0 || st > 0)) {
|
|
41656
|
-
const Ae = Ue[0],
|
|
41656
|
+
const Ae = Ue[0], we = Ue[Ue.length - 1];
|
|
41657
41657
|
if (ze > 0 && Ae.index > Be) {
|
|
41658
41658
|
const ye = Math.min(ze, Ae.index - Be), Xe = [];
|
|
41659
41659
|
let Ke = Ae.offset;
|
|
@@ -41663,11 +41663,11 @@ const xa = je(
|
|
|
41663
41663
|
}
|
|
41664
41664
|
Ue.unshift(...Xe);
|
|
41665
41665
|
}
|
|
41666
|
-
if (st > 0 &&
|
|
41667
|
-
const ye = Math.min(st,
|
|
41668
|
-
let Xe =
|
|
41669
|
-
for (let Ke =
|
|
41670
|
-
const Je = ($ = (L = Va(be, Ke, Ke)[0]) == null ? void 0 : L.value) != null ? $ :
|
|
41666
|
+
if (st > 0 && we.index < xe) {
|
|
41667
|
+
const ye = Math.min(st, xe - we.index);
|
|
41668
|
+
let Xe = we.offset + we.size + k;
|
|
41669
|
+
for (let Ke = we.index + 1; Ke <= we.index + ye; Ke++) {
|
|
41670
|
+
const Je = ($ = (L = Va(be, Ke, Ke)[0]) == null ? void 0 : L.value) != null ? $ : we.size;
|
|
41671
41671
|
Ue.push({ data: U == null ? void 0 : U[Ke], index: Ke, offset: Xe, size: Je }), Xe += Je + k;
|
|
41672
41672
|
}
|
|
41673
41673
|
}
|
|
@@ -42862,7 +42862,7 @@ const Hq = /* @__PURE__ */ je(
|
|
|
42862
42862
|
j(
|
|
42863
42863
|
y,
|
|
42864
42864
|
Pe(R),
|
|
42865
|
-
me(([K,
|
|
42865
|
+
me(([K, xe]) => !!xe)
|
|
42866
42866
|
),
|
|
42867
42867
|
() => {
|
|
42868
42868
|
Te(L, !1);
|
|
@@ -42870,7 +42870,7 @@ const Hq = /* @__PURE__ */ je(
|
|
|
42870
42870
|
), We(
|
|
42871
42871
|
j(
|
|
42872
42872
|
vt(y, L, x, b, R, $),
|
|
42873
|
-
me(([K,
|
|
42873
|
+
me(([K, xe, Ue, ze, , st]) => K && !xe && Ue.height !== 0 && ze.height !== 0 && !st)
|
|
42874
42874
|
),
|
|
42875
42875
|
([, , , , K]) => {
|
|
42876
42876
|
Te($, !0), vm(1, () => {
|
|
@@ -42893,7 +42893,7 @@ const Hq = /* @__PURE__ */ je(
|
|
|
42893
42893
|
me(([, K]) => K != null)
|
|
42894
42894
|
),
|
|
42895
42895
|
([, K]) => {
|
|
42896
|
-
K && (Te(b, K.viewport), Te(x, K.item), Te(k, K.gap), K.scrollTop > 0 && (Te(F, !0), $r(j(l, ua(1)), (
|
|
42896
|
+
K && (Te(b, K.viewport), Te(x, K.item), Te(k, K.gap), K.scrollTop > 0 && (Te(F, !0), $r(j(l, ua(1)), (xe) => {
|
|
42897
42897
|
Te(F, !1);
|
|
42898
42898
|
}), Te(c, { top: K.scrollTop })));
|
|
42899
42899
|
}
|
|
@@ -42908,12 +42908,12 @@ const Hq = /* @__PURE__ */ je(
|
|
|
42908
42908
|
vt(
|
|
42909
42909
|
fe(b, El),
|
|
42910
42910
|
fe(x, El),
|
|
42911
|
-
fe(k, (K,
|
|
42911
|
+
fe(k, (K, xe) => K && K.column === xe.column && K.row === xe.row),
|
|
42912
42912
|
fe(l)
|
|
42913
42913
|
),
|
|
42914
|
-
re(([K,
|
|
42914
|
+
re(([K, xe, Ue, ze]) => ({
|
|
42915
42915
|
gap: Ue,
|
|
42916
|
-
item:
|
|
42916
|
+
item: xe,
|
|
42917
42917
|
scrollTop: ze,
|
|
42918
42918
|
viewport: K
|
|
42919
42919
|
}))
|
|
@@ -42937,11 +42937,11 @@ const Hq = /* @__PURE__ */ je(
|
|
|
42937
42937
|
re(
|
|
42938
42938
|
([
|
|
42939
42939
|
K,
|
|
42940
|
-
[
|
|
42940
|
+
[xe, Ue],
|
|
42941
42941
|
ze,
|
|
42942
42942
|
st,
|
|
42943
42943
|
Ae,
|
|
42944
|
-
|
|
42944
|
+
we,
|
|
42945
42945
|
ye,
|
|
42946
42946
|
,
|
|
42947
42947
|
Xe,
|
|
@@ -42952,12 +42952,12 @@ const Hq = /* @__PURE__ */ je(
|
|
|
42952
42952
|
return K1;
|
|
42953
42953
|
if (Ju === 0) {
|
|
42954
42954
|
const Mm = Em(Ke, K), jx = Mm + Math.max(ye - 1, 0);
|
|
42955
|
-
return zq(X1(Mm, jx,
|
|
42955
|
+
return zq(X1(Mm, jx, we));
|
|
42956
42956
|
}
|
|
42957
42957
|
const Pc = _x(Fm, Ju, Je);
|
|
42958
42958
|
let wa, Fs;
|
|
42959
|
-
Xe ?
|
|
42960
|
-
const Um = X1(wa, Fs,
|
|
42959
|
+
Xe ? xe === 0 && Ue === 0 && ye > 0 ? (wa = 0, Fs = ye - 1) : (wa = Pc * Xl((xe + gr) / (Ut + gr)), Fs = Pc * Y1((Ue + gr) / (Ut + gr)) - 1, Fs = Xd(K - 1, ri(Fs, Pc - 1)), wa = Xd(Fs, ri(0, wa))) : (wa = 0, Fs = -1);
|
|
42960
|
+
const Um = X1(wa, Fs, we), { bottom: Om, top: Dm } = Q1(Ae, ze, st, Um), _m = Y1(K / Pc), Gx = _m * Ut + (_m - 1) * gr - Om;
|
|
42961
42961
|
return { bottom: Om, itemHeight: Ut, items: Um, itemWidth: Ju, offsetBottom: Gx, offsetTop: Dm, top: Dm };
|
|
42962
42962
|
}
|
|
42963
42963
|
)
|
|
@@ -42973,9 +42973,9 @@ const Hq = /* @__PURE__ */ je(
|
|
|
42973
42973
|
), ce(
|
|
42974
42974
|
j(
|
|
42975
42975
|
vt(b, x, h, k),
|
|
42976
|
-
me(([K,
|
|
42977
|
-
re(([K,
|
|
42978
|
-
const { bottom: st, top: Ae } = Q1(K, ze,
|
|
42976
|
+
me(([K, xe, { items: Ue }]) => Ue.length > 0 && xe.height !== 0 && K.height !== 0),
|
|
42977
|
+
re(([K, xe, { items: Ue }, ze]) => {
|
|
42978
|
+
const { bottom: st, top: Ae } = Q1(K, ze, xe, Ue);
|
|
42979
42979
|
return [Ae, st];
|
|
42980
42980
|
}),
|
|
42981
42981
|
et(Li)
|
|
@@ -42987,7 +42987,7 @@ const Hq = /* @__PURE__ */ je(
|
|
|
42987
42987
|
j(
|
|
42988
42988
|
l,
|
|
42989
42989
|
Pe(pe),
|
|
42990
|
-
re(([K,
|
|
42990
|
+
re(([K, xe]) => xe || K !== 0)
|
|
42991
42991
|
),
|
|
42992
42992
|
pe
|
|
42993
42993
|
);
|
|
@@ -42996,9 +42996,9 @@ const Hq = /* @__PURE__ */ je(
|
|
|
42996
42996
|
vt(h, N),
|
|
42997
42997
|
me(([{ items: K }]) => K.length > 0),
|
|
42998
42998
|
Pe(pe),
|
|
42999
|
-
me(([[K,
|
|
43000
|
-
const ze = K.items[K.items.length - 1].index ===
|
|
43001
|
-
return (Ue || K.bottom > 0 && K.itemHeight > 0 && K.offsetBottom === 0 && K.items.length ===
|
|
42999
|
+
me(([[K, xe], Ue]) => {
|
|
43000
|
+
const ze = K.items[K.items.length - 1].index === xe - 1;
|
|
43001
|
+
return (Ue || K.bottom > 0 && K.itemHeight > 0 && K.offsetBottom === 0 && K.items.length === xe) && ze;
|
|
43002
43002
|
}),
|
|
43003
43003
|
re(([[, K]]) => K - 1),
|
|
43004
43004
|
et()
|
|
@@ -43014,7 +43014,7 @@ const Hq = /* @__PURE__ */ je(
|
|
|
43014
43014
|
j(
|
|
43015
43015
|
fe(h),
|
|
43016
43016
|
Pe(F),
|
|
43017
|
-
me(([{ items: K },
|
|
43017
|
+
me(([{ items: K }, xe]) => K.length > 0 && !xe),
|
|
43018
43018
|
re(([{ items: K }]) => ({
|
|
43019
43019
|
endIndex: K[K.length - 1].index,
|
|
43020
43020
|
startIndex: K[0].index
|
|
@@ -43027,12 +43027,12 @@ const Hq = /* @__PURE__ */ je(
|
|
|
43027
43027
|
j(
|
|
43028
43028
|
S,
|
|
43029
43029
|
Pe(b, x, N, k),
|
|
43030
|
-
re(([K,
|
|
43031
|
-
const Ae = gx(K), { align:
|
|
43030
|
+
re(([K, xe, Ue, ze, st]) => {
|
|
43031
|
+
const Ae = gx(K), { align: we, behavior: ye, offset: Xe } = Ae;
|
|
43032
43032
|
let Ke = Ae.index;
|
|
43033
43033
|
Ke === "LAST" && (Ke = ze - 1), Ke = ri(0, Ke, Xd(ze - 1, Ke));
|
|
43034
|
-
let Je = vf(
|
|
43035
|
-
return
|
|
43034
|
+
let Je = vf(xe, st, Ue, Ke);
|
|
43035
|
+
return we === "end" ? Je = Z1(Je - xe.height + Ue.height) : we === "center" && (Je = Z1(Je - xe.height / 2 + Ue.height / 2)), Xe && (Je += Xe), { behavior: ye, top: Je };
|
|
43036
43036
|
})
|
|
43037
43037
|
),
|
|
43038
43038
|
c
|
|
@@ -43518,7 +43518,7 @@ const cK = () => {
|
|
|
43518
43518
|
n({ unit: c, value: r.value });
|
|
43519
43519
|
},
|
|
43520
43520
|
[n, r]
|
|
43521
|
-
), i = Q(() => e ===
|
|
43521
|
+
), i = Q(() => e === Ee.STOP_LOSS ? t("stopLossDurationTooltip") : t("maxDurationTooltip"), [t, e]);
|
|
43522
43522
|
return {
|
|
43523
43523
|
duration: r,
|
|
43524
43524
|
onChange: n,
|
|
@@ -43531,13 +43531,13 @@ const cK = () => {
|
|
|
43531
43531
|
};
|
|
43532
43532
|
}, MY = () => {
|
|
43533
43533
|
const e = ee((a) => a.state.isMarketOrder), { module: t } = ne(), r = Re(), n = Q(() => {
|
|
43534
|
-
if (e && t ===
|
|
43534
|
+
if (e && t === Ee.STOP_LOSS)
|
|
43535
43535
|
return {
|
|
43536
43536
|
text: r("triggerMarketPriceDisclaimer"),
|
|
43537
43537
|
url: bb
|
|
43538
43538
|
};
|
|
43539
43539
|
}, [e, r, t]), s = Q(() => {
|
|
43540
|
-
if (!(t !==
|
|
43540
|
+
if (!(t !== Ee.LIMIT && t !== Ee.TWAP))
|
|
43541
43541
|
return {
|
|
43542
43542
|
text: r(e ? "marketOrderWarning" : "limitPriceMessage"),
|
|
43543
43543
|
url: "https://www.orbs.com/dtwap-and-dlimit-faq/"
|
|
@@ -43616,14 +43616,14 @@ const cK = () => {
|
|
|
43616
43616
|
};
|
|
43617
43617
|
}, pK = () => {
|
|
43618
43618
|
const { module: e } = ne();
|
|
43619
|
-
return Q(() => e ===
|
|
43619
|
+
return Q(() => e === Ee.STOP_LOSS ? X5 : Q5, [e]);
|
|
43620
43620
|
}, Bm = () => {
|
|
43621
43621
|
const { module: e } = ne(), t = ee((r) => r.state.isMarketOrder);
|
|
43622
|
-
return Q(() => e !==
|
|
43622
|
+
return Q(() => e !== Ee.STOP_LOSS && e !== Ee.TAKE_PROFIT || t ? void 0 : e === Ee.STOP_LOSS ? J5 : ew, [e, t]);
|
|
43623
43623
|
}, fK = (e = "") => {
|
|
43624
43624
|
const { module: t, marketPrice: r, typedInputAmount: n } = ne(), s = Re();
|
|
43625
43625
|
return Q(() => {
|
|
43626
|
-
if (H(n || "0").isZero() || !r || t !==
|
|
43626
|
+
if (H(n || "0").isZero() || !r || t !== Ee.STOP_LOSS && t !== Ee.TAKE_PROFIT) return;
|
|
43627
43627
|
const a = mw(r || "", e || "", t);
|
|
43628
43628
|
if (a != null && a.isError)
|
|
43629
43629
|
return {
|
|
@@ -43653,7 +43653,7 @@ const cK = () => {
|
|
|
43653
43653
|
usd: vs(c, s)
|
|
43654
43654
|
};
|
|
43655
43655
|
}, Bs = () => {
|
|
43656
|
-
const { dstToken: e, marketPrice: t, module: r, callbacks: n } = ne(), s = ee((y) => y.updateState), a = pK(), o = ee((y) => y.state.triggerPricePercent), i = o === void 0 ? a : o, c = r ===
|
|
43656
|
+
const { dstToken: e, marketPrice: t, module: r, callbacks: n } = ne(), s = ee((y) => y.updateState), a = pK(), o = ee((y) => y.state.triggerPricePercent), i = o === void 0 ? a : o, c = r === Ee.STOP_LOSS || r === Ee.TAKE_PROFIT, l = Rx({
|
|
43657
43657
|
typedValue: ee((y) => y.state.typedTriggerPrice),
|
|
43658
43658
|
percentage: i,
|
|
43659
43659
|
tokenDecimals: (e == null ? void 0 : e.decimals) || 18,
|
|
@@ -43680,14 +43680,14 @@ const cK = () => {
|
|
|
43680
43680
|
}, RY = () => {
|
|
43681
43681
|
const { module: e, marketPrice: t, marketPriceLoading: r } = ne(), n = Re(), { amountUI: s, onChange: a, onPercentageChange: o, usd: i, selectedPercentage: c, error: l, pricePerChunkUI: u, pricePerChunkUsd: d, isTypedValue: f } = Bs(), m = ee((O) => O.state.isMarketOrder), y = ee((O) => O.updateState), { isInverted: g, onInvert: E, fromToken: v, toToken: w } = Im(), A = $e(() => {
|
|
43682
43682
|
y({ triggerPricePercent: void 0, typedTriggerPrice: void 0 });
|
|
43683
|
-
}, [y]), C = e !==
|
|
43683
|
+
}, [y]), C = e !== Ee.STOP_LOSS && e !== Ee.TAKE_PROFIT;
|
|
43684
43684
|
return {
|
|
43685
43685
|
price: s,
|
|
43686
43686
|
amountPerChunk: u,
|
|
43687
43687
|
amountPerChunkUsd: d,
|
|
43688
43688
|
error: l,
|
|
43689
43689
|
label: n("stopLossLabel"),
|
|
43690
|
-
tooltip: e ===
|
|
43690
|
+
tooltip: e === Ee.STOP_LOSS ? n("stopLossTooltip") : n("takeProfitTooltip"),
|
|
43691
43691
|
onChange: a,
|
|
43692
43692
|
onPercentageChange: o,
|
|
43693
43693
|
percentage: c,
|
|
@@ -43751,8 +43751,8 @@ const cK = () => {
|
|
|
43751
43751
|
error: c
|
|
43752
43752
|
}), [i, c]);
|
|
43753
43753
|
}, bK = () => {
|
|
43754
|
-
const { module: e } = ne(), t = ee((i) => i.updateState), r = ee((i) => i.state.isMarketOrder), n = Bm(), s = ee((i) => i.state.triggerPricePercent) || 0, a = e ===
|
|
43755
|
-
!r && e ===
|
|
43754
|
+
const { module: e } = ne(), t = ee((i) => i.updateState), r = ee((i) => i.state.isMarketOrder), n = Bm(), s = ee((i) => i.state.triggerPricePercent) || 0, a = e === Ee.LIMIT, o = $e(() => {
|
|
43755
|
+
!r && e === Ee.STOP_LOSS && t({ limitPricePercent: n }), t({ isMarketOrder: !r });
|
|
43756
43756
|
}, [t, s, e, r, n]);
|
|
43757
43757
|
return {
|
|
43758
43758
|
isLimitPrice: !r,
|
|
@@ -43761,7 +43761,7 @@ const cK = () => {
|
|
|
43761
43761
|
};
|
|
43762
43762
|
}, Nx = () => {
|
|
43763
43763
|
const { module: e, marketPrice: t } = ne(), r = Tc().amountWei, n = Bs().amountWei, s = ee((a) => a.state.isMarketOrder);
|
|
43764
|
-
return e ===
|
|
43764
|
+
return e === Ee.LIMIT || !s ? r || "" : e === Ee.STOP_LOSS || e === Ee.TAKE_PROFIT ? n || "" : t || "";
|
|
43765
43765
|
}, Ac = () => {
|
|
43766
43766
|
const { srcToken: e, dstToken: t, dstUsd1Token: r } = ne(), n = Nx(), s = Xr().amountWei, a = Q(() => aw(s || "", n, (e == null ? void 0 : e.decimals) || 0), [s, n, e == null ? void 0 : e.decimals]), o = On(t == null ? void 0 : t.decimals, a);
|
|
43767
43767
|
return {
|
|
@@ -43790,7 +43790,7 @@ const cK = () => {
|
|
|
43790
43790
|
}, LY = () => {
|
|
43791
43791
|
const { module: e, marketPriceLoading: t } = ne(), r = Re(), { amountUI: n, onChange: s, onPercentageChange: a, usd: o, selectedPercentage: i, error: c, isTypedValue: l } = Tc(), { amountUI: u, usd: d } = Sc(), f = ee((N) => N.updateState), m = Bm(), { isLimitPrice: y, toggleLimitPrice: g } = bK(), { isInverted: E, onInvert: v, fromToken: w, toToken: A } = Im(), C = $e(() => {
|
|
43792
43792
|
f({ typedLimitPrice: void 0 }), f({ limitPricePercent: m });
|
|
43793
|
-
}, [f, e, m]), O = Q(() => e ===
|
|
43793
|
+
}, [f, e, m]), O = Q(() => e === Ee.STOP_LOSS ? r("stopLossLimitPriceTooltip") : r("limitPriceTooltip"), [r, e]);
|
|
43794
43794
|
return {
|
|
43795
43795
|
price: n,
|
|
43796
43796
|
amountPerChunk: u,
|
|
@@ -44536,7 +44536,7 @@ export {
|
|
|
44536
44536
|
pt as Q,
|
|
44537
44537
|
Ve as R,
|
|
44538
44538
|
IY as S,
|
|
44539
|
-
|
|
44539
|
+
Ee as T,
|
|
44540
44540
|
kY as U,
|
|
44541
44541
|
O0 as V,
|
|
44542
44542
|
Iu as W,
|