@orbs-network/spot-react 0.0.43 → 0.0.45
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-D0aBkOIS.js → ccip-BLmrJSyG.js} +1 -1
- package/dist/{index-DOAuS_b4.js → index-DnCumGZ0.js} +315 -300
- package/dist/spot-react/package.json.d.ts +1 -1
- package/dist/spot-react/src/components/submit-order-panel.d.ts.map +1 -1
- package/dist/spot-react/src/hooks/order-hooks.d.ts.map +1 -1
- package/dist/spot-react/src/hooks/use-submit-order.d.ts.map +1 -1
- package/dist/spot-react/src/spot-context.d.ts.map +1 -1
- package/dist/spot-react/src/utils.d.ts +1 -3
- package/dist/spot-react/src/utils.d.ts.map +1 -1
- package/dist/spot-react.js +81 -80
- package/dist/spot-react.umd.cjs +27 -27
- package/dist/spot-ui/src/index.d.ts +2 -1
- package/dist/spot-ui/src/index.d.ts.map +1 -1
- package/dist/spot-ui/src/lib/utils.d.ts +2 -0
- package/dist/spot-ui/src/lib/utils.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1793,17 +1793,37 @@ function ao(e, t) {
|
|
|
1793
1793
|
function M5(e, t, r) {
|
|
1794
1794
|
if (typeof e != "string") return Rm(e);
|
|
1795
1795
|
const n = ".", s = e.replace(new RegExp(`[^${n}\\d-]+`, "g"), "");
|
|
1796
|
-
return Rm(
|
|
1796
|
+
return Rm(
|
|
1797
|
+
s
|
|
1798
|
+
);
|
|
1797
1799
|
}
|
|
1798
|
-
const ho = (e) => !!
|
|
1800
|
+
const ho = (e) => !!W5.find((t) => ao(t, e || ""));
|
|
1799
1801
|
function R5(e) {
|
|
1800
|
-
return [
|
|
1802
|
+
return [
|
|
1803
|
+
er.Years,
|
|
1804
|
+
er.Months,
|
|
1805
|
+
er.Weeks,
|
|
1806
|
+
er.Days,
|
|
1807
|
+
er.Hours,
|
|
1808
|
+
er.Minutes
|
|
1809
|
+
].find((r) => r <= e) || er.Minutes;
|
|
1801
1810
|
}
|
|
1802
1811
|
const gs = (e) => e ? e.value * e.unit : 0, N5 = (e) => !e || e === "NaN" ? "0" : H(e).decimalPlaces(0).toFixed(), bo = (e) => Object.values(Rt).find((t) => t.id === e), z5 = (e) => {
|
|
1803
1812
|
if (!e) return;
|
|
1804
|
-
const t = e.map((a) => Gt(a)), r = Object.entries(
|
|
1813
|
+
const t = e.map((a) => Gt(a)), r = Object.entries(q5).filter(([a]) => t.includes(a)).flatMap(([, a]) => a), n = e.map((a) => a.exchangeAddress), s = new Set(
|
|
1814
|
+
[...n, ...r].map((a) => a.toLowerCase())
|
|
1815
|
+
);
|
|
1805
1816
|
return Array.from(s);
|
|
1806
|
-
}, mb = (e, t) => e.version === 1 ? (e.fillDelay || 0) * 1e3 + yb(t) : (e.fillDelay || 0) * 1e3, Xl = (e) => typeof window > "u" ? null : new URLSearchParams(window.location.search).get(e), L5 = (e) =>
|
|
1817
|
+
}, mb = (e, t) => e.version === 1 ? (e.fillDelay || 0) * 1e3 + yb(t) : (e.fillDelay || 0) * 1e3, Xl = (e) => typeof window > "u" ? null : new URLSearchParams(window.location.search).get(e), L5 = (e) => vw().filter((t) => t.name === e).map((t) => t.chainId), $5 = (e, t, r) => {
|
|
1818
|
+
if (!H(e.srcAmountFilled || 0).gt(0) || !H(e.dstAmountFilled || 0).gt(0))
|
|
1819
|
+
return "";
|
|
1820
|
+
const n = ys(t, e.srcAmountFilled), s = ys(r, e.dstAmountFilled);
|
|
1821
|
+
return H(s).div(n).toFixed();
|
|
1822
|
+
}, H5 = (e, t, r) => {
|
|
1823
|
+
if (e.type === ht.TWAP_MARKET) return "";
|
|
1824
|
+
const n = ys(t, e.srcAmountPerTrade), s = ys(r, e.dstMinAmountPerTrade);
|
|
1825
|
+
return H(s).div(n).toFixed();
|
|
1826
|
+
}, Nm = "https://order-sink-dev.orbs.network", td = "https://order-sink.orbs.network";
|
|
1807
1827
|
let Kd;
|
|
1808
1828
|
const RY = (e) => {
|
|
1809
1829
|
Kd = e;
|
|
@@ -1813,9 +1833,9 @@ const RY = (e) => {
|
|
|
1813
1833
|
/* ENV */
|
|
1814
1834
|
);
|
|
1815
1835
|
return e === "prod" ? td : e === "dev" ? Nm : Kd === "prod" ? td : Kd === "dev" ? Nm : td;
|
|
1816
|
-
}, NY = 100, zY = 1, Zd = 300 * 1e3, ni = 365 * 24 * 60 * 60 * 1e3, zm = 300 * 1e3,
|
|
1836
|
+
}, NY = 100, zY = 1, Zd = 300 * 1e3, ni = 365 * 24 * 60 * 60 * 1e3, zm = 300 * 1e3, G5 = new Date(
|
|
1817
1837
|
Zd
|
|
1818
|
-
).getMinutes(), Lm = (e) => `https://hub.orbs.network/api/private/project_cm7nb67z86nyr01z12gs0fxpf/subgraphs/orbs-twap-${e}/prod/gn`, vr = "https://hub.orbs.network/api/apikey/subgraphs/id",
|
|
1838
|
+
).getMinutes(), Lm = (e) => `https://hub.orbs.network/api/private/project_cm7nb67z86nyr01z12gs0fxpf/subgraphs/orbs-twap-${e}/prod/gn`, vr = "https://hub.orbs.network/api/apikey/subgraphs/id", j5 = {
|
|
1819
1839
|
[Rt.eth.id]: `${vr}/Bf7bvMYcJbDAvYWJmhMpHZ4cpFjqzkhK6GXXEpnPRq6`,
|
|
1820
1840
|
[Rt.bsc.id]: `${vr}/4NfXEi8rreQsnAr4aJ45RLCKgnjcWX46Lbt9SadiCcz6`,
|
|
1821
1841
|
[Rt.poly.id]: `${vr}/3PyRPWSvDnMowGbeBy7aNsvUkD5ZuxdXQw2RdJq4NdXi`,
|
|
@@ -1830,14 +1850,14 @@ const RY = (e) => {
|
|
|
1830
1850
|
[Rt.bera.id]: `${vr}/H7aY53mY1hgaSURwXj3ZVirwNSifExwjgEL5GNtTqmEj`,
|
|
1831
1851
|
[Rt.flare.id]: Lm("flare"),
|
|
1832
1852
|
[Rt.cronosZkEvm.id]: Lm("cronos-zkevm")
|
|
1833
|
-
},
|
|
1834
|
-
|
|
1853
|
+
}, V5 = "0x0000000000000000000000000000000000000000", W5 = [
|
|
1854
|
+
V5,
|
|
1835
1855
|
"0x0000000000000000000000000000000000001010",
|
|
1836
1856
|
"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
|
1837
1857
|
"0x000000000000000000000000000000000000dEaD",
|
|
1838
1858
|
"0x000000000000000000000000000000000000800A",
|
|
1839
1859
|
"0x000000000000000000000000000000000000800a"
|
|
1840
|
-
], LY = "115792089237316195423570985008687907853269984665640564039457584007913129639935", Gt = (e) => `${e.name}_${e.chainId}`,
|
|
1860
|
+
], LY = "115792089237316195423570985008687907853269984665640564039457584007913129639935", Gt = (e) => `${e.name}_${e.chainId}`, q5 = {
|
|
1841
1861
|
[Gt(Ht.SushiArb)]: [
|
|
1842
1862
|
"0x846F2B29ef314bF3D667981b4ffdADc5B858312a",
|
|
1843
1863
|
"0x08c41f5D1C844061f6D952E25827eeAA576c6536"
|
|
@@ -1888,8 +1908,8 @@ const RY = (e) => {
|
|
|
1888
1908
|
]
|
|
1889
1909
|
}, Xd = {
|
|
1890
1910
|
unit: er.Minutes,
|
|
1891
|
-
value:
|
|
1892
|
-
}, $Y = 0.25, HY = "100",
|
|
1911
|
+
value: G5
|
|
1912
|
+
}, $Y = 0.25, HY = "100", Y5 = "RePermitWitnessTransferFrom", K5 = {
|
|
1893
1913
|
RePermitWitnessTransferFrom: [
|
|
1894
1914
|
{
|
|
1895
1915
|
name: "permitted",
|
|
@@ -2016,8 +2036,8 @@ const RY = (e) => {
|
|
|
2016
2036
|
]
|
|
2017
2037
|
}, xf = "https://www.orbs.com/dtwap-and-dlimit-faq/", GY = "https://www.orbs.com/dtwap-and-dlimit-faq/#dSLTP", jY = "https://raw.githubusercontent.com/orbs-network/twap-ui/master/logo/orbslogo.svg", VY = "https://www.orbs.com/assets/img/common/logo.svg", WY = "https://www.orbs.com/", qY = "https://www.orbs.com/dtwap-dlimit-disclaimer";
|
|
2018
2038
|
var wf = /* @__PURE__ */ ((e) => (e.FRESHNESS = "freshness", e.MIN_CHUNK_SIZE_USD = "minChunkSizeUsd", e.ENV = "env", e))(wf || {});
|
|
2019
|
-
const
|
|
2020
|
-
function
|
|
2039
|
+
const Z5 = "-5", X5 = "10", Q5 = "-10", J5 = "5", YY = "Something went wrong";
|
|
2040
|
+
function ew(e) {
|
|
2021
2041
|
if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
|
|
2022
2042
|
var t = e.default;
|
|
2023
2043
|
if (typeof t == "function") {
|
|
@@ -2036,10 +2056,10 @@ function Q5(e) {
|
|
|
2036
2056
|
});
|
|
2037
2057
|
}), r;
|
|
2038
2058
|
}
|
|
2039
|
-
function
|
|
2059
|
+
function tw(e) {
|
|
2040
2060
|
throw new Error('Could not dynamically require "' + e + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
2041
2061
|
}
|
|
2042
|
-
const
|
|
2062
|
+
const rw = {
|
|
2043
2063
|
14: { dex: { spark: { type: "default:spark", adapter: "0xB18c633B6584A33E45a8840a759f56dF17117b1D", fee: "0xaeA8C3e1a129A77686E115b1a46D9aD8405F7D2b" } } },
|
|
2044
2064
|
56: { dex: { thena: { type: "default:odos-v2", adapter: "0xB75218ba5A99bF57Fd02556B70F05A4A0f1Dbe67", fee: "0x15eBc8b5b3877512FFF23650188694A9a8891FAc" }, pancake: { type: "p2:pancakeswap-v2", adapter: "0x654272F7e6e6E912D38650f783eFd44452fD6ee5", fee: "0x37A957f10F458e0d7fDECBE2917971b57F15c927" }, newera: { type: "default:odos-v2", adapter: "0x845f459271D800f6Ab32D78400b8Aa18414E80b0", fee: "0x4E7454909eB6D539111D56b50d68897E933D2d11" } } },
|
|
2045
2065
|
137: { dex: { quick: { type: "paraswap:paraswap-v5", adapter: "0x023fD6848234f2655818705237F77F02215FEfe5", fee: "0xd207DC6a6dA88f27c8DB78201F974161b1d84b1f" }, teafi: { type: "paraswap:paraswap-v5", adapter: "0xe95db7a60164B112C64cE67bA8587b1d4a0E0D29", fee: "0x04Ff96e2c4D62b5771795d307AD679a25b3D2D50" } } },
|
|
@@ -2054,10 +2074,10 @@ const ew = {
|
|
|
2054
2074
|
"*": { wm: "0x0005d5cE0dB57e5BE3b2b8b6FeB75f0ccd015000", repermit: "0x00002a9C4D9497df5Bd31768eC5d30eEf5405000", cosigner: "0x0007ec53404c423C935e830ec21903e184690000", reactor: "0x0006a959430e8fBB858D81B2D1140B0ae5c26001", executor: "0x000eBA869d76C618ddc4A6D685A0820A620Ce002", refinery: "0x000E474c0D7084EAA35A501035E73269f4b009A5", salt: { wm: "0xc9b46eae42dfeba3222a0315bf682f33cd5cc9d60c9625642e88406f8415f152", repermit: "0x4871dc9008e605821ea9677b65ea2a60ffb774afb31e0dcaea2e192880096be7", cosigner: "0x37576f2ac1d2a602f00777611edf6f0cbc27611b0980b29bc7856fa79b2b8073", reactor: "0x034169222370f2fd587ef8998082d762cceef58a272330215f5110ec0d76d400", executor: "0xea139bc421fa5e272bed3db74233b2e02077e0aacf8b855f87961e98f2fb467f", refinery: "0x9746de29f1dd31b2c8460d71e92a7aefa34911130e61f274f37776e598c48bec" } }
|
|
2055
2075
|
};
|
|
2056
2076
|
var rd, $m;
|
|
2057
|
-
function
|
|
2077
|
+
function nw() {
|
|
2058
2078
|
if ($m) return rd;
|
|
2059
2079
|
$m = 1;
|
|
2060
|
-
const e =
|
|
2080
|
+
const e = rw, t = (s) => tw(`./out/${s}.sol/${s}.json`).abi, r = () => ({
|
|
2061
2081
|
wm: t("WM"),
|
|
2062
2082
|
repermit: t("RePermit"),
|
|
2063
2083
|
reactor: t("OrderReactor"),
|
|
@@ -2075,75 +2095,75 @@ function tw() {
|
|
|
2075
2095
|
}
|
|
2076
2096
|
return rd = { config: n, abis: r, raw: e }, rd;
|
|
2077
2097
|
}
|
|
2078
|
-
var bb =
|
|
2079
|
-
const
|
|
2098
|
+
var bb = nw();
|
|
2099
|
+
const sw = (e, t, r) => {
|
|
2080
2100
|
if (!e || !t || !r) return;
|
|
2081
2101
|
const n = H(e).times(t), s = H(10).pow(r);
|
|
2082
2102
|
return n.div(s).toFixed(0);
|
|
2083
|
-
},
|
|
2103
|
+
}, aw = (e, t, r, n) => {
|
|
2084
2104
|
if (r || !n || !e || !t)
|
|
2085
2105
|
return H(0).toString();
|
|
2086
2106
|
const s = H(e).times(H(t)), a = H(10).pow(n), o = s.div(a);
|
|
2087
2107
|
return H.max(1, o).integerValue(H.ROUND_FLOOR).toFixed(0);
|
|
2088
|
-
},
|
|
2108
|
+
}, ow = (e, t, r, n) => {
|
|
2089
2109
|
if (e === ke.TWAP || e === ke.LIMIT)
|
|
2090
2110
|
return "0";
|
|
2091
2111
|
if (!n || !t || !r) return;
|
|
2092
2112
|
const s = H(t).times(H(r)), a = H(10).pow(n), o = s.div(a);
|
|
2093
2113
|
return H.max(1, o).integerValue(H.ROUND_FLOOR).toFixed(0) || "0";
|
|
2094
|
-
},
|
|
2114
|
+
}, iw = (e, t, r, n) => {
|
|
2095
2115
|
const s = gs(r) * 2 * t, a = R5(s);
|
|
2096
2116
|
return n || (e === ke.LIMIT ? { unit: er.Days, value: 7 } : e === ke.STOP_LOSS || e === ke.TAKE_PROFIT ? { unit: er.Days, value: 1 } : { unit: a, value: Number(H(s / a).toFixed(2)) });
|
|
2097
|
-
},
|
|
2117
|
+
}, cw = (e, t, r) => t !== ke.TWAP ? 1 : r !== void 0 ? r : e, lw = (e, t, r, n) => {
|
|
2098
2118
|
if (!t || !r || !n) return 1;
|
|
2099
2119
|
const a = H(r).times(t).div(n).integerValue(H.ROUND_FLOOR).toNumber(), o = Math.floor(
|
|
2100
2120
|
ni / 2 / gs(e)
|
|
2101
2121
|
);
|
|
2102
2122
|
return Math.max(1, Math.min(a, o));
|
|
2103
|
-
}, KY = (e) => yb(e) / 1e3 / 60,
|
|
2123
|
+
}, KY = (e) => yb(e) / 1e3 / 60, uw = (e, t) => e + gs(t) + 6e4, yb = (e) => e.bidDelaySeconds * 1e3 * 2, dw = (e, t) => !e || !t ? "0" : H(e).div(t).integerValue(H.ROUND_FLOOR).toFixed(0), ZY = (e, t) => ({
|
|
2104
2124
|
isError: !(e.unit === Xd.unit && e.value === Xd.value) && gs(e) * t > ni,
|
|
2105
2125
|
value: Math.floor(ni / t)
|
|
2106
|
-
}),
|
|
2126
|
+
}), pw = (e = "", t = "", r) => {
|
|
2107
2127
|
if (r === ke.STOP_LOSS)
|
|
2108
2128
|
return {
|
|
2109
2129
|
isError: H(t || 0).gte(H(e || 0)),
|
|
2110
2130
|
value: e
|
|
2111
2131
|
};
|
|
2112
|
-
},
|
|
2132
|
+
}, fw = (e = "", t = "", r) => {
|
|
2113
2133
|
if (r === ke.TAKE_PROFIT)
|
|
2114
2134
|
return {
|
|
2115
2135
|
isError: H(t || 0).lte(H(e || 0)),
|
|
2116
2136
|
value: e
|
|
2117
2137
|
};
|
|
2118
|
-
},
|
|
2138
|
+
}, mw = (e = "", t = "", r = !1, n) => {
|
|
2119
2139
|
if (!r && n === ke.STOP_LOSS)
|
|
2120
2140
|
return {
|
|
2121
2141
|
isError: H(t || 0).gte(H(e || 0)),
|
|
2122
2142
|
value: e
|
|
2123
2143
|
};
|
|
2124
|
-
},
|
|
2144
|
+
}, hw = (e = "", t = "", r = !1, n) => {
|
|
2125
2145
|
if (!r && n === ke.TAKE_PROFIT)
|
|
2126
2146
|
return {
|
|
2127
2147
|
isError: H(t || 0).gte(H(e || 0)),
|
|
2128
2148
|
value: e
|
|
2129
2149
|
};
|
|
2130
|
-
},
|
|
2150
|
+
}, bw = (e, t) => e === ke.STOP_LOSS || e === ke.TAKE_PROFIT ? {
|
|
2131
2151
|
isError: gs(t) > 5184e6,
|
|
2132
2152
|
value: 5184e6
|
|
2133
2153
|
} : {
|
|
2134
2154
|
isError: gs(t) > ni,
|
|
2135
2155
|
// 365 days
|
|
2136
2156
|
value: ni
|
|
2137
|
-
},
|
|
2157
|
+
}, yw = (e) => ({
|
|
2138
2158
|
isError: gs(e) < zm,
|
|
2139
2159
|
value: zm
|
|
2140
|
-
}),
|
|
2160
|
+
}), gw = (e) => ({
|
|
2141
2161
|
isError: gs(e) < Zd,
|
|
2142
2162
|
value: Zd
|
|
2143
|
-
}),
|
|
2163
|
+
}), xw = (e, t, r) => ({
|
|
2144
2164
|
isError: H(t || 0).multipliedBy(e || 0).isLessThan(r),
|
|
2145
2165
|
value: r
|
|
2146
|
-
}),
|
|
2166
|
+
}), ww = (e, t, r) => ({
|
|
2147
2167
|
isError: r === ke.TWAP && H(e).isGreaterThan(t),
|
|
2148
2168
|
value: t
|
|
2149
2169
|
}), gb = (e, t = 0) => {
|
|
@@ -2156,7 +2176,7 @@ const rw = (e, t, r) => {
|
|
|
2156
2176
|
partner: e,
|
|
2157
2177
|
twapConfig: r
|
|
2158
2178
|
};
|
|
2159
|
-
},
|
|
2179
|
+
}, vw = () => {
|
|
2160
2180
|
const e = bb.raw;
|
|
2161
2181
|
return Object.entries(e).filter(([t]) => t !== "*").flatMap(([t, r]) => {
|
|
2162
2182
|
const n = r == null ? void 0 : r.dex;
|
|
@@ -2166,7 +2186,7 @@ const rw = (e, t, r) => {
|
|
|
2166
2186
|
config: gb(s, Number(t))
|
|
2167
2187
|
}));
|
|
2168
2188
|
}).sort((t, r) => t.name.localeCompare(r.name));
|
|
2169
|
-
},
|
|
2189
|
+
}, Ew = ({
|
|
2170
2190
|
chainId: e,
|
|
2171
2191
|
srcToken: t,
|
|
2172
2192
|
dstToken: r,
|
|
@@ -2226,21 +2246,21 @@ const rw = (e, t, r) => {
|
|
|
2226
2246
|
verifyingContract: d.repermit
|
|
2227
2247
|
},
|
|
2228
2248
|
order: v,
|
|
2229
|
-
types:
|
|
2230
|
-
primaryType:
|
|
2249
|
+
types: K5,
|
|
2250
|
+
primaryType: Y5
|
|
2231
2251
|
};
|
|
2232
|
-
},
|
|
2233
|
-
version:
|
|
2234
|
-
},
|
|
2252
|
+
}, kw = "0.0.20", Cw = {
|
|
2253
|
+
version: kw
|
|
2254
|
+
}, Tw = 0.7, Aw = `https://bi.orbs.network/putes/twap-ui-${Tw}`, xb = Cw.version;
|
|
2235
2255
|
let Qd = "unknown";
|
|
2236
|
-
function
|
|
2256
|
+
function Sw(e) {
|
|
2237
2257
|
Qd = e;
|
|
2238
2258
|
}
|
|
2239
2259
|
function nd() {
|
|
2240
2260
|
const e = Math.random().toString(36).substring(2, 16), t = Math.random().toString(36).substring(2, 16), r = Date.now().toString(36);
|
|
2241
2261
|
return `id_${e + t + r}`;
|
|
2242
2262
|
}
|
|
2243
|
-
const
|
|
2263
|
+
const Pw = (e, t, r) => {
|
|
2244
2264
|
var n, s, a, o, i, c, l, u, d;
|
|
2245
2265
|
return {
|
|
2246
2266
|
spotVersion: xb,
|
|
@@ -2269,7 +2289,7 @@ const Aw = (e, t, r) => {
|
|
|
2269
2289
|
};
|
|
2270
2290
|
}, Hm = async (e) => {
|
|
2271
2291
|
try {
|
|
2272
|
-
await fetch(
|
|
2292
|
+
await fetch(Aw, {
|
|
2273
2293
|
method: "POST",
|
|
2274
2294
|
headers: {
|
|
2275
2295
|
Accept: "application/json",
|
|
@@ -2281,7 +2301,7 @@ const Aw = (e, t, r) => {
|
|
|
2281
2301
|
console.error("Failed to send BI", t);
|
|
2282
2302
|
}
|
|
2283
2303
|
};
|
|
2284
|
-
class
|
|
2304
|
+
class Iw {
|
|
2285
2305
|
constructor() {
|
|
2286
2306
|
Ac(this, "timeout");
|
|
2287
2307
|
Ac(this, "config");
|
|
@@ -2412,7 +2432,7 @@ class Sw {
|
|
|
2412
2432
|
_id: nd(),
|
|
2413
2433
|
action: "module-import",
|
|
2414
2434
|
uiVersion: Qd,
|
|
2415
|
-
...
|
|
2435
|
+
...Pw(t, r, n),
|
|
2416
2436
|
origin: window.location.origin
|
|
2417
2437
|
}, this.updateAndSend(this.data));
|
|
2418
2438
|
}
|
|
@@ -2471,15 +2491,15 @@ class Sw {
|
|
|
2471
2491
|
});
|
|
2472
2492
|
}
|
|
2473
2493
|
}
|
|
2474
|
-
const bt = new
|
|
2494
|
+
const bt = new Iw(), Bw = (e) => {
|
|
2475
2495
|
var s;
|
|
2476
2496
|
const t = H(e.order.witness.output.limit || 0).gt(1), r = H(e.order.witness.output.stop || 0).gt(0), n = ((s = e.metadata.chunks) == null ? void 0 : s.length) || H(e.order.witness.input.maxAmount).div(H(e.order.witness.input.amount)).toNumber();
|
|
2477
2497
|
return r && t ? ht.TRIGGER_PRICE_LIMIT : r ? ht.TRIGGER_PRICE_MARKET : !t && n <= 1 ? ht.TWAP_MARKET : n >= 1 && t ? ht.TWAP_LIMIT : t ? ht.LIMIT : ht.TWAP_MARKET;
|
|
2478
|
-
},
|
|
2498
|
+
}, Fw = (e) => {
|
|
2479
2499
|
var s;
|
|
2480
2500
|
const t = ((s = e.metadata.chunks) == null ? void 0 : s.filter((a) => a.status === "success").length) || 0, r = e.metadata.expectedChunks || 0, n = H(t).dividedBy(r).toNumber();
|
|
2481
2501
|
return n >= 0.99 ? 100 : n <= 0 ? 0 : Number((n * 100).toFixed(2));
|
|
2482
|
-
},
|
|
2502
|
+
}, Uw = (e, t) => e.metadata.status === "completed" || t >= 99 ? yt.Completed : ["pending", "eligible"].includes(e.metadata.status) ? yt.Open : e.metadata.description.toLowerCase() === "cancelled by contract" ? yt.Canceled : yt.Expired, Ow = (e) => {
|
|
2483
2503
|
var r;
|
|
2484
2504
|
return (((r = e.metadata.chunks) == null ? void 0 : r.filter((n) => n.status === "success")) || []).map((n) => ({
|
|
2485
2505
|
inAmount: n.inAmount,
|
|
@@ -2487,17 +2507,17 @@ const bt = new Sw(), Pw = (e) => {
|
|
|
2487
2507
|
timestamp: new Date(n.timestamp).getTime(),
|
|
2488
2508
|
txHash: n.txHash
|
|
2489
2509
|
}));
|
|
2490
|
-
},
|
|
2510
|
+
}, Dw = (e, t) => {
|
|
2491
2511
|
var n;
|
|
2492
2512
|
const r = e.length;
|
|
2493
2513
|
return r >= t && ((n = e[r - 1]) == null ? void 0 : n.timestamp) || 0;
|
|
2494
2514
|
}, wb = (e) => {
|
|
2495
|
-
const t =
|
|
2515
|
+
const t = Fw(e), r = Number(e.order.witness.output.limit) === 1 ? "" : e.order.witness.output.limit, n = e.metadata.expectedChunks || 1, s = Ow(e);
|
|
2496
2516
|
return {
|
|
2497
2517
|
id: e.hash,
|
|
2498
2518
|
hash: e.hash,
|
|
2499
2519
|
version: 2,
|
|
2500
|
-
type:
|
|
2520
|
+
type: Bw(e),
|
|
2501
2521
|
maker: e.order.witness.swapper,
|
|
2502
2522
|
progress: t,
|
|
2503
2523
|
srcAmountFilled: s.reduce((a, o) => a.plus(o.inAmount), new H(0)).toFixed() || "",
|
|
@@ -2517,13 +2537,13 @@ const bt = new Sw(), Pw = (e) => {
|
|
|
2517
2537
|
totalTradesAmount: n,
|
|
2518
2538
|
isMarketPrice: H(r || 0).lte(1),
|
|
2519
2539
|
chainId: e.order.witness.chainid,
|
|
2520
|
-
filledOrderTimestamp:
|
|
2521
|
-
status:
|
|
2540
|
+
filledOrderTimestamp: Dw(s, n),
|
|
2541
|
+
status: Uw(e, t),
|
|
2522
2542
|
rawOrder: e
|
|
2523
2543
|
};
|
|
2524
|
-
},
|
|
2544
|
+
}, _w = async ({ chainId: e, signal: t, account: r }) => r ? (await (await fetch(`${hb()}/orders?swapper=${r}&chainId=${e}`, {
|
|
2525
2545
|
signal: t
|
|
2526
|
-
})).json()).orders.map(wb) : [],
|
|
2546
|
+
})).json()).orders.map(wb) : [], Mw = async (e, t) => {
|
|
2527
2547
|
try {
|
|
2528
2548
|
const r = {
|
|
2529
2549
|
signature: t,
|
|
@@ -2542,9 +2562,9 @@ const bt = new Sw(), Pw = (e) => {
|
|
|
2542
2562
|
} catch (r) {
|
|
2543
2563
|
throw bt.onCreateOrderError(r), console.error(r), r;
|
|
2544
2564
|
}
|
|
2545
|
-
}, xn = (e, t) => e && e.length ? e.map(t || ((r) => `${r}`)) : void 0,
|
|
2565
|
+
}, xn = (e, t) => e && e.length ? e.map(t || ((r) => `${r}`)) : void 0, Rw = (e) => {
|
|
2546
2566
|
if (e)
|
|
2547
|
-
return
|
|
2567
|
+
return j5[e];
|
|
2548
2568
|
}, vf = async ({
|
|
2549
2569
|
chainId: e,
|
|
2550
2570
|
buildQuery: t,
|
|
@@ -2554,8 +2574,8 @@ const bt = new Sw(), Pw = (e) => {
|
|
|
2554
2574
|
limit: a = 1e3,
|
|
2555
2575
|
page: o
|
|
2556
2576
|
}) => {
|
|
2557
|
-
const i =
|
|
2558
|
-
if (!i) throw new
|
|
2577
|
+
const i = Rw(e);
|
|
2578
|
+
if (!i) throw new Gw();
|
|
2559
2579
|
const c = async (d) => {
|
|
2560
2580
|
let f = 0;
|
|
2561
2581
|
for (; f <= s; )
|
|
@@ -2617,7 +2637,7 @@ const bt = new Sw(), Pw = (e) => {
|
|
|
2617
2637
|
})), Gm = (e, t) => {
|
|
2618
2638
|
const r = H(e || 0).gt(1);
|
|
2619
2639
|
return !r && t === 1 ? ht.TWAP_MARKET : t > 1 && r ? ht.TWAP_LIMIT : r ? ht.LIMIT : ht.TWAP_MARKET;
|
|
2620
|
-
},
|
|
2640
|
+
}, Nw = (e, t, r, n) => {
|
|
2621
2641
|
var f;
|
|
2622
2642
|
const s = vb(r || []), a = new H(e.ask_srcAmount || 0).div(e.ask_srcBidAmount).integerValue(H.ROUND_FLOOR).toNumber(), i = (r == null ? void 0 : r.length) === a ? (f = r == null ? void 0 : r[(r == null ? void 0 : r.length) - 1]) == null ? void 0 : f.timestamp : void 0, c = s.reduce((m, y) => m.plus(y.inAmount), new H(0)).toFixed(), l = s.reduce((m, y) => m.plus(y.outAmount), new H(0)).toFixed(), u = Eb(e.ask_srcAmount, c), d = Gm(e.ask_dstMinAmount, a);
|
|
2623
2643
|
return {
|
|
@@ -2651,7 +2671,7 @@ const bt = new Sw(), Pw = (e) => {
|
|
|
2651
2671
|
status: n,
|
|
2652
2672
|
rawOrder: e
|
|
2653
2673
|
};
|
|
2654
|
-
},
|
|
2674
|
+
}, zw = (e) => {
|
|
2655
2675
|
var d;
|
|
2656
2676
|
if (!e) return "";
|
|
2657
2677
|
const t = xn(
|
|
@@ -2696,14 +2716,14 @@ const bt = new Sw(), Pw = (e) => {
|
|
|
2696
2716
|
(e == null ? void 0 : e.orderType) === "market" ? "ask_dstMinAmount_lte: 1" : ""
|
|
2697
2717
|
].filter(Boolean).join(", ");
|
|
2698
2718
|
};
|
|
2699
|
-
async function
|
|
2719
|
+
async function Lw({
|
|
2700
2720
|
chainId: e,
|
|
2701
2721
|
signal: t,
|
|
2702
2722
|
page: r,
|
|
2703
2723
|
limit: n,
|
|
2704
2724
|
filters: s
|
|
2705
2725
|
}) {
|
|
2706
|
-
const a = n || 1e3, o =
|
|
2726
|
+
const a = n || 1e3, o = zw(s);
|
|
2707
2727
|
return await vf({
|
|
2708
2728
|
chainId: e,
|
|
2709
2729
|
signal: t,
|
|
@@ -2750,7 +2770,7 @@ async function Nw({
|
|
|
2750
2770
|
}
|
|
2751
2771
|
});
|
|
2752
2772
|
}
|
|
2753
|
-
const
|
|
2773
|
+
const $w = async ({
|
|
2754
2774
|
chainId: e,
|
|
2755
2775
|
orders: t,
|
|
2756
2776
|
signal: r
|
|
@@ -2785,7 +2805,7 @@ const zw = async ({
|
|
|
2785
2805
|
function Jd(e) {
|
|
2786
2806
|
return Array.from(new Set(e));
|
|
2787
2807
|
}
|
|
2788
|
-
const
|
|
2808
|
+
const Hw = async ({
|
|
2789
2809
|
chainId: e,
|
|
2790
2810
|
orders: t,
|
|
2791
2811
|
signal: r
|
|
@@ -2827,50 +2847,50 @@ const Lw = async ({
|
|
|
2827
2847
|
}
|
|
2828
2848
|
});
|
|
2829
2849
|
};
|
|
2830
|
-
class
|
|
2850
|
+
class Gw extends Error {
|
|
2831
2851
|
constructor() {
|
|
2832
2852
|
super("No graph endpoint found"), this.name = "NoGraphEndpointError";
|
|
2833
2853
|
}
|
|
2834
2854
|
}
|
|
2835
|
-
const
|
|
2855
|
+
const jw = async ({
|
|
2836
2856
|
chainId: e,
|
|
2837
2857
|
signal: t,
|
|
2838
2858
|
page: r,
|
|
2839
2859
|
limit: n,
|
|
2840
2860
|
filters: s
|
|
2841
2861
|
}) => {
|
|
2842
|
-
const a = await
|
|
2862
|
+
const a = await Lw({
|
|
2843
2863
|
chainId: e,
|
|
2844
2864
|
signal: t,
|
|
2845
2865
|
page: r,
|
|
2846
2866
|
limit: n,
|
|
2847
2867
|
filters: s
|
|
2848
2868
|
}), [o, i] = await Promise.all([
|
|
2849
|
-
|
|
2850
|
-
|
|
2869
|
+
Hw({ chainId: e, orders: a, signal: t }),
|
|
2870
|
+
$w({ chainId: e, orders: a, signal: t })
|
|
2851
2871
|
]);
|
|
2852
2872
|
return a.map((l) => {
|
|
2853
2873
|
const u = o == null ? void 0 : o.filter(
|
|
2854
2874
|
(d) => d.TWAP_id === Number(l.Contract_id) && ao(d.exchange, l.exchange) && ao(d.twapAddress, l.twapAddress)
|
|
2855
2875
|
);
|
|
2856
|
-
return
|
|
2876
|
+
return Nw(
|
|
2857
2877
|
l,
|
|
2858
2878
|
e,
|
|
2859
2879
|
u,
|
|
2860
|
-
|
|
2880
|
+
Vw(l, u || [], i)
|
|
2861
2881
|
);
|
|
2862
2882
|
}).sort((l, u) => u.createdAt - l.createdAt);
|
|
2863
|
-
},
|
|
2883
|
+
}, Vw = (e, t, r) => {
|
|
2864
2884
|
var i;
|
|
2865
2885
|
const n = (i = r == null ? void 0 : r.find(
|
|
2866
2886
|
(c) => c.twapId === e.Contract_id.toString() && ao(c.twapAddress, e.twapAddress)
|
|
2867
2887
|
)) == null ? void 0 : i.status, a = vb(t).reduce((c, l) => c.plus(l.inAmount), new H(0)).toFixed(), o = Eb(e.ask_srcAmount, a);
|
|
2868
|
-
return
|
|
2888
|
+
return Ww(o, e.ask_deadline * 1e3, n);
|
|
2869
2889
|
}, Eb = (e, t) => {
|
|
2870
2890
|
if (!t || !e) return 0;
|
|
2871
2891
|
const r = H(t).dividedBy(e).toNumber();
|
|
2872
2892
|
return r >= 0.99 ? 100 : r <= 0 ? 0 : Number((r * 100).toFixed(2));
|
|
2873
|
-
},
|
|
2893
|
+
}, Ww = (e, t, r) => e === 100 ? yt.Completed : r === "CANCELED" ? yt.Canceled : r === "COMPLETED" ? yt.Completed : t > Date.now() ? yt.Open : yt.Expired, qw = async ({
|
|
2874
2894
|
signal: e,
|
|
2875
2895
|
page: t,
|
|
2876
2896
|
chainId: r,
|
|
@@ -2878,10 +2898,10 @@ const Hw = async ({
|
|
|
2878
2898
|
config: s,
|
|
2879
2899
|
account: a
|
|
2880
2900
|
}) => (await Promise.all([
|
|
2881
|
-
s ?
|
|
2882
|
-
|
|
2883
|
-
]).then(([c, l]) => [...c, ...l])).sort((c, l) => l.createdAt - c.createdAt),
|
|
2884
|
-
version:
|
|
2901
|
+
s ? jw({ chainId: r, signal: e, page: t, limit: n, filters: { accounts: [a], configs: [s] } }) : Promise.resolve([]),
|
|
2902
|
+
_w({ chainId: r, signal: e, account: a })
|
|
2903
|
+
]).then(([c, l]) => [...c, ...l])).sort((c, l) => l.createdAt - c.createdAt), Yw = "0.0.45", Kw = {
|
|
2904
|
+
version: Yw
|
|
2885
2905
|
};
|
|
2886
2906
|
var yo = class {
|
|
2887
2907
|
constructor() {
|
|
@@ -2899,7 +2919,7 @@ var yo = class {
|
|
|
2899
2919
|
}
|
|
2900
2920
|
onUnsubscribe() {
|
|
2901
2921
|
}
|
|
2902
|
-
},
|
|
2922
|
+
}, Zw = {
|
|
2903
2923
|
// We need the wrapper function syntax below instead of direct references to
|
|
2904
2924
|
// global setTimeout etc.
|
|
2905
2925
|
//
|
|
@@ -2914,7 +2934,7 @@ var yo = class {
|
|
|
2914
2934
|
clearTimeout: (e) => clearTimeout(e),
|
|
2915
2935
|
setInterval: (e, t) => setInterval(e, t),
|
|
2916
2936
|
clearInterval: (e) => clearInterval(e)
|
|
2917
|
-
}, Jr, Ns, rb,
|
|
2937
|
+
}, Jr, Ns, rb, Xw = (rb = class {
|
|
2918
2938
|
constructor() {
|
|
2919
2939
|
// We cannot have TimeoutManager<T> as we must instantiate it with a concrete
|
|
2920
2940
|
// type at app boot; and if we leave that type, then any new timer provider
|
|
@@ -2922,7 +2942,7 @@ var yo = class {
|
|
|
2922
2942
|
//
|
|
2923
2943
|
// We settle for type safety for the TimeoutProvider type, and accept that
|
|
2924
2944
|
// this class is unsafe internally to allow for extension.
|
|
2925
|
-
le(this, Jr,
|
|
2945
|
+
le(this, Jr, Zw);
|
|
2926
2946
|
le(this, Ns, !1);
|
|
2927
2947
|
}
|
|
2928
2948
|
setTimeoutProvider(e) {
|
|
@@ -2943,14 +2963,14 @@ var yo = class {
|
|
|
2943
2963
|
clearInterval(e) {
|
|
2944
2964
|
M(this, Jr).clearInterval(e);
|
|
2945
2965
|
}
|
|
2946
|
-
}, Jr = new WeakMap(), Ns = new WeakMap(), rb), Us = new
|
|
2947
|
-
function
|
|
2966
|
+
}, Jr = new WeakMap(), Ns = new WeakMap(), rb), Us = new Xw();
|
|
2967
|
+
function Qw(e) {
|
|
2948
2968
|
setTimeout(e, 0);
|
|
2949
2969
|
}
|
|
2950
2970
|
var Qs = typeof window > "u" || "Deno" in globalThis;
|
|
2951
2971
|
function Wt() {
|
|
2952
2972
|
}
|
|
2953
|
-
function
|
|
2973
|
+
function Jw(e, t) {
|
|
2954
2974
|
return typeof e == "function" ? e(t) : e;
|
|
2955
2975
|
}
|
|
2956
2976
|
function ep(e) {
|
|
@@ -3013,7 +3033,7 @@ function Js(e) {
|
|
|
3013
3033
|
function si(e, t) {
|
|
3014
3034
|
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((r) => si(e[r], t[r])) : !1;
|
|
3015
3035
|
}
|
|
3016
|
-
var
|
|
3036
|
+
var e3 = Object.prototype.hasOwnProperty;
|
|
3017
3037
|
function tp(e, t) {
|
|
3018
3038
|
if (e === t)
|
|
3019
3039
|
return e;
|
|
@@ -3024,7 +3044,7 @@ function tp(e, t) {
|
|
|
3024
3044
|
for (let l = 0; l < o; l++) {
|
|
3025
3045
|
const u = r ? l : a[l], d = e[u], f = t[u];
|
|
3026
3046
|
if (d === f) {
|
|
3027
|
-
i[u] = d, (r ? l < s :
|
|
3047
|
+
i[u] = d, (r ? l < s : e3.call(e, u)) && c++;
|
|
3028
3048
|
continue;
|
|
3029
3049
|
}
|
|
3030
3050
|
if (d === null || f === null || typeof d != "object" || typeof f != "object") {
|
|
@@ -3059,7 +3079,7 @@ function rp(e) {
|
|
|
3059
3079
|
function qm(e) {
|
|
3060
3080
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
3061
3081
|
}
|
|
3062
|
-
function
|
|
3082
|
+
function t3(e) {
|
|
3063
3083
|
return new Promise((t) => {
|
|
3064
3084
|
Us.setTimeout(t, e);
|
|
3065
3085
|
});
|
|
@@ -3080,11 +3100,11 @@ function np(e, t, r) {
|
|
|
3080
3100
|
}
|
|
3081
3101
|
return t;
|
|
3082
3102
|
}
|
|
3083
|
-
function
|
|
3103
|
+
function r3(e, t, r = 0) {
|
|
3084
3104
|
const n = [...e, t];
|
|
3085
3105
|
return r && n.length > r ? n.slice(1) : n;
|
|
3086
3106
|
}
|
|
3087
|
-
function
|
|
3107
|
+
function n3(e, t, r = 0) {
|
|
3088
3108
|
const n = [t, ...e];
|
|
3089
3109
|
return r && n.length > r ? n.slice(0, -1) : n;
|
|
3090
3110
|
}
|
|
@@ -3097,7 +3117,7 @@ function Cb(e, t) {
|
|
|
3097
3117
|
function Tb(e, t) {
|
|
3098
3118
|
return typeof e == "function" ? e(...t) : !!e;
|
|
3099
3119
|
}
|
|
3100
|
-
var zs, ns, qa, nb,
|
|
3120
|
+
var zs, ns, qa, nb, s3 = (nb = class extends yo {
|
|
3101
3121
|
constructor() {
|
|
3102
3122
|
super();
|
|
3103
3123
|
le(this, zs);
|
|
@@ -3138,7 +3158,7 @@ var zs, ns, qa, nb, r3 = (nb = class extends yo {
|
|
|
3138
3158
|
var t;
|
|
3139
3159
|
return typeof M(this, zs) == "boolean" ? M(this, zs) : ((t = globalThis.document) == null ? void 0 : t.visibilityState) !== "hidden";
|
|
3140
3160
|
}
|
|
3141
|
-
}, zs = new WeakMap(), ns = new WeakMap(), qa = new WeakMap(), nb), kf = new
|
|
3161
|
+
}, zs = new WeakMap(), ns = new WeakMap(), qa = new WeakMap(), nb), kf = new s3();
|
|
3142
3162
|
function sp() {
|
|
3143
3163
|
let e, t;
|
|
3144
3164
|
const r = new Promise((s, a) => {
|
|
@@ -3161,13 +3181,13 @@ function sp() {
|
|
|
3161
3181
|
}), t(s);
|
|
3162
3182
|
}, r;
|
|
3163
3183
|
}
|
|
3164
|
-
var
|
|
3165
|
-
function
|
|
3184
|
+
var a3 = Qw;
|
|
3185
|
+
function o3() {
|
|
3166
3186
|
let e = [], t = 0, r = (i) => {
|
|
3167
3187
|
i();
|
|
3168
3188
|
}, n = (i) => {
|
|
3169
3189
|
i();
|
|
3170
|
-
}, s =
|
|
3190
|
+
}, s = a3;
|
|
3171
3191
|
const a = (i) => {
|
|
3172
3192
|
t ? e.push(i) : s(() => {
|
|
3173
3193
|
r(i);
|
|
@@ -3221,7 +3241,7 @@ function s3() {
|
|
|
3221
3241
|
}
|
|
3222
3242
|
};
|
|
3223
3243
|
}
|
|
3224
|
-
var Tt =
|
|
3244
|
+
var Tt = o3(), Ya, ss, Ka, sb, i3 = (sb = class extends yo {
|
|
3225
3245
|
constructor() {
|
|
3226
3246
|
super();
|
|
3227
3247
|
le(this, Ya, !0);
|
|
@@ -3255,8 +3275,8 @@ var Tt = s3(), Ya, ss, Ka, sb, a3 = (sb = class extends yo {
|
|
|
3255
3275
|
isOnline() {
|
|
3256
3276
|
return M(this, Ya);
|
|
3257
3277
|
}
|
|
3258
|
-
}, Ya = new WeakMap(), ss = new WeakMap(), Ka = new WeakMap(), sb), Bl = new
|
|
3259
|
-
function
|
|
3278
|
+
}, Ya = new WeakMap(), ss = new WeakMap(), Ka = new WeakMap(), sb), Bl = new i3();
|
|
3279
|
+
function c3(e) {
|
|
3260
3280
|
return Math.min(1e3 * 2 ** e, 3e4);
|
|
3261
3281
|
}
|
|
3262
3282
|
function Ab(e) {
|
|
@@ -3305,12 +3325,12 @@ function Sb(e) {
|
|
|
3305
3325
|
var R;
|
|
3306
3326
|
if (a())
|
|
3307
3327
|
return;
|
|
3308
|
-
const w = e.retry ?? (Qs ? 0 : 3), S = e.retryDelay ??
|
|
3328
|
+
const w = e.retry ?? (Qs ? 0 : 3), S = e.retryDelay ?? c3, C = typeof S == "function" ? S(r, v) : S, O = w === !0 || typeof w == "number" && r < w || typeof w == "function" && w(r, v);
|
|
3309
3329
|
if (t || !O) {
|
|
3310
3330
|
f(v);
|
|
3311
3331
|
return;
|
|
3312
3332
|
}
|
|
3313
|
-
r++, (R = e.onFail) == null || R.call(e, r, v),
|
|
3333
|
+
r++, (R = e.onFail) == null || R.call(e, r, v), t3(C).then(() => l() ? void 0 : m()).then(() => {
|
|
3314
3334
|
t ? f(v) : y();
|
|
3315
3335
|
});
|
|
3316
3336
|
});
|
|
@@ -3347,7 +3367,7 @@ var Ls, ab, Pb = (ab = class {
|
|
|
3347
3367
|
clearGcTimeout() {
|
|
3348
3368
|
M(this, Ls) && (Us.clearTimeout(M(this, Ls)), Q(this, Ls, void 0));
|
|
3349
3369
|
}
|
|
3350
|
-
}, Ls = new WeakMap(), ab), $s, Za, Ar, Hs, Bt, ji, Gs, Mr, Tn, ob,
|
|
3370
|
+
}, Ls = new WeakMap(), ab), $s, Za, Ar, Hs, Bt, ji, Gs, Mr, Tn, ob, l3 = (ob = class extends Pb {
|
|
3351
3371
|
constructor(t) {
|
|
3352
3372
|
super();
|
|
3353
3373
|
le(this, Mr);
|
|
@@ -3658,7 +3678,7 @@ function Km(e) {
|
|
|
3658
3678
|
fetchStatus: "idle"
|
|
3659
3679
|
};
|
|
3660
3680
|
}
|
|
3661
|
-
var Qt, De, Vi, jt, js, Xa, Pn, as, Wi, Qa, Ja, Vs, Ws, os, eo, qe, Ko, op, ip, cp, lp, up, dp, pp, Bb, ib,
|
|
3681
|
+
var Qt, De, Vi, jt, js, Xa, Pn, as, Wi, Qa, Ja, Vs, Ws, os, eo, qe, Ko, op, ip, cp, lp, up, dp, pp, Bb, ib, u3 = (ib = class extends yo {
|
|
3662
3682
|
constructor(t, r) {
|
|
3663
3683
|
super();
|
|
3664
3684
|
le(this, qe);
|
|
@@ -3730,7 +3750,7 @@ var Qt, De, Vi, jt, js, Xa, Pn, as, Wi, Qa, Ja, Vs, Ws, os, eo, qe, Ko, op, ip,
|
|
|
3730
3750
|
}
|
|
3731
3751
|
getOptimisticResult(t) {
|
|
3732
3752
|
const r = M(this, Qt).getQueryCache().build(M(this, Qt), t), n = this.createResult(r, t);
|
|
3733
|
-
return
|
|
3753
|
+
return p3(this, n) && (Q(this, jt, n), Q(this, Xa, this.options), Q(this, js, M(this, De).state)), n;
|
|
3734
3754
|
}
|
|
3735
3755
|
getCurrentResult() {
|
|
3736
3756
|
return M(this, jt);
|
|
@@ -3920,11 +3940,11 @@ var Qt, De, Vi, jt, js, Xa, Pn, as, Wi, Qa, Ja, Vs, Ws, os, eo, qe, Ko, op, ip,
|
|
|
3920
3940
|
});
|
|
3921
3941
|
});
|
|
3922
3942
|
}, ib);
|
|
3923
|
-
function
|
|
3943
|
+
function d3(e, t) {
|
|
3924
3944
|
return Sr(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
|
|
3925
3945
|
}
|
|
3926
3946
|
function Zm(e, t) {
|
|
3927
|
-
return
|
|
3947
|
+
return d3(e, t) || e.state.data !== void 0 && fp(e, t, t.refetchOnMount);
|
|
3928
3948
|
}
|
|
3929
3949
|
function fp(e, t, r) {
|
|
3930
3950
|
if (Sr(t.enabled, e) !== !1 && fs(t.staleTime, e) !== "static") {
|
|
@@ -3939,7 +3959,7 @@ function Xm(e, t, r, n) {
|
|
|
3939
3959
|
function Cf(e, t) {
|
|
3940
3960
|
return Sr(t.enabled, e) !== !1 && e.isStaleByTime(fs(t.staleTime, e));
|
|
3941
3961
|
}
|
|
3942
|
-
function
|
|
3962
|
+
function p3(e, t) {
|
|
3943
3963
|
return !Pl(e.getCurrentResult(), t);
|
|
3944
3964
|
}
|
|
3945
3965
|
function Qm(e) {
|
|
@@ -3971,14 +3991,14 @@ function Qm(e) {
|
|
|
3971
3991
|
meta: t.options.meta
|
|
3972
3992
|
};
|
|
3973
3993
|
return E(A), A;
|
|
3974
|
-
})(), h = await v(T), { maxPages: b } = t.options, x = O ?
|
|
3994
|
+
})(), h = await v(T), { maxPages: b } = t.options, x = O ? n3 : r3;
|
|
3975
3995
|
return {
|
|
3976
3996
|
pages: x(S.pages, h, b),
|
|
3977
3997
|
pageParams: x(S.pageParams, C, b)
|
|
3978
3998
|
};
|
|
3979
3999
|
};
|
|
3980
4000
|
if (s && a.length) {
|
|
3981
|
-
const S = s === "backward", C = S ?
|
|
4001
|
+
const S = s === "backward", C = S ? f3 : Jm, O = {
|
|
3982
4002
|
pages: a,
|
|
3983
4003
|
pageParams: o
|
|
3984
4004
|
}, R = C(n, O);
|
|
@@ -4020,11 +4040,11 @@ function Jm(e, { pages: t, pageParams: r }) {
|
|
|
4020
4040
|
r
|
|
4021
4041
|
) : void 0;
|
|
4022
4042
|
}
|
|
4023
|
-
function
|
|
4043
|
+
function f3(e, { pages: t, pageParams: r }) {
|
|
4024
4044
|
var n;
|
|
4025
4045
|
return t.length > 0 ? (n = e.getPreviousPageParam) == null ? void 0 : n.call(e, t[0], t, r[0], r) : void 0;
|
|
4026
4046
|
}
|
|
4027
|
-
var qi, en, Vt, qs, tn, ts, cb,
|
|
4047
|
+
var qi, en, Vt, qs, tn, ts, cb, m3 = (cb = class extends Pb {
|
|
4028
4048
|
constructor(t) {
|
|
4029
4049
|
super();
|
|
4030
4050
|
le(this, tn);
|
|
@@ -4253,7 +4273,7 @@ function Fb() {
|
|
|
4253
4273
|
submittedAt: 0
|
|
4254
4274
|
};
|
|
4255
4275
|
}
|
|
4256
|
-
var In, Rr, Yi, lb,
|
|
4276
|
+
var In, Rr, Yi, lb, h3 = (lb = class extends yo {
|
|
4257
4277
|
constructor(t = {}) {
|
|
4258
4278
|
super();
|
|
4259
4279
|
le(this, In);
|
|
@@ -4262,7 +4282,7 @@ var In, Rr, Yi, lb, f3 = (lb = class extends yo {
|
|
|
4262
4282
|
this.config = t, Q(this, In, /* @__PURE__ */ new Set()), Q(this, Rr, /* @__PURE__ */ new Map()), Q(this, Yi, 0);
|
|
4263
4283
|
}
|
|
4264
4284
|
build(t, r, n) {
|
|
4265
|
-
const s = new
|
|
4285
|
+
const s = new m3({
|
|
4266
4286
|
client: t,
|
|
4267
4287
|
mutationCache: this,
|
|
4268
4288
|
mutationId: ++Sc(this, Yi)._,
|
|
@@ -4352,7 +4372,7 @@ function Bc(e) {
|
|
|
4352
4372
|
var t;
|
|
4353
4373
|
return (t = e.options.scope) == null ? void 0 : t.id;
|
|
4354
4374
|
}
|
|
4355
|
-
var Bn, is, Jt, Fn, $n, wl, mp, ub,
|
|
4375
|
+
var Bn, is, Jt, Fn, $n, wl, mp, ub, b3 = (ub = class extends yo {
|
|
4356
4376
|
constructor(t, r) {
|
|
4357
4377
|
super();
|
|
4358
4378
|
le(this, $n);
|
|
@@ -4445,7 +4465,7 @@ var Bn, is, Jt, Fn, $n, wl, mp, ub, m3 = (ub = class extends yo {
|
|
|
4445
4465
|
u(M(this, is));
|
|
4446
4466
|
});
|
|
4447
4467
|
});
|
|
4448
|
-
}, ub), rn, db,
|
|
4468
|
+
}, ub), rn, db, y3 = (db = class extends yo {
|
|
4449
4469
|
constructor(t = {}) {
|
|
4450
4470
|
super();
|
|
4451
4471
|
le(this, rn);
|
|
@@ -4454,7 +4474,7 @@ var Bn, is, Jt, Fn, $n, wl, mp, ub, m3 = (ub = class extends yo {
|
|
|
4454
4474
|
build(t, r, n) {
|
|
4455
4475
|
const s = r.queryKey, a = r.queryHash ?? Ef(s, r);
|
|
4456
4476
|
let o = this.get(a);
|
|
4457
|
-
return o || (o = new
|
|
4477
|
+
return o || (o = new l3({
|
|
4458
4478
|
client: t,
|
|
4459
4479
|
queryKey: s,
|
|
4460
4480
|
queryHash: a,
|
|
@@ -4517,7 +4537,7 @@ var Bn, is, Jt, Fn, $n, wl, mp, ub, m3 = (ub = class extends yo {
|
|
|
4517
4537
|
});
|
|
4518
4538
|
});
|
|
4519
4539
|
}
|
|
4520
|
-
}, rn = new WeakMap(), db), dt, cs, ls, to, ro, us, no, so, pb,
|
|
4540
|
+
}, rn = new WeakMap(), db), dt, cs, ls, to, ro, us, no, so, pb, g3 = (pb = class {
|
|
4521
4541
|
constructor(e = {}) {
|
|
4522
4542
|
le(this, dt);
|
|
4523
4543
|
le(this, cs);
|
|
@@ -4527,7 +4547,7 @@ var Bn, is, Jt, Fn, $n, wl, mp, ub, m3 = (ub = class extends yo {
|
|
|
4527
4547
|
le(this, us);
|
|
4528
4548
|
le(this, no);
|
|
4529
4549
|
le(this, so);
|
|
4530
|
-
Q(this, dt, e.queryCache || new
|
|
4550
|
+
Q(this, dt, e.queryCache || new y3()), Q(this, cs, e.mutationCache || new h3()), Q(this, ls, e.defaultOptions || {}), Q(this, to, /* @__PURE__ */ new Map()), Q(this, ro, /* @__PURE__ */ new Map()), Q(this, us, 0);
|
|
4531
4551
|
}
|
|
4532
4552
|
mount() {
|
|
4533
4553
|
Sc(this, us)._++, M(this, us) === 1 && (Q(this, no, kf.subscribe(async (e) => {
|
|
@@ -4571,7 +4591,7 @@ var Bn, is, Jt, Fn, $n, wl, mp, ub, m3 = (ub = class extends yo {
|
|
|
4571
4591
|
setQueryData(e, t, r) {
|
|
4572
4592
|
const n = this.defaultQueryOptions({ queryKey: e }), s = M(this, dt).get(
|
|
4573
4593
|
n.queryHash
|
|
4574
|
-
), a = s == null ? void 0 : s.state.data, o =
|
|
4594
|
+
), a = s == null ? void 0 : s.state.data, o = Jw(t, a);
|
|
4575
4595
|
if (o !== void 0)
|
|
4576
4596
|
return M(this, dt).build(this, n).setData(o, { ...r, manual: !0 });
|
|
4577
4597
|
}
|
|
@@ -4730,14 +4750,14 @@ var Bn, is, Jt, Fn, $n, wl, mp, ub, m3 = (ub = class extends yo {
|
|
|
4730
4750
|
if (!t)
|
|
4731
4751
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
4732
4752
|
return t;
|
|
4733
|
-
},
|
|
4753
|
+
}, x3 = ({
|
|
4734
4754
|
client: e,
|
|
4735
4755
|
children: t
|
|
4736
4756
|
}) => (vt.useEffect(() => (e.mount(), () => {
|
|
4737
4757
|
e.unmount();
|
|
4738
|
-
}), [e]), /* @__PURE__ */ _(Ub.Provider, { value: e, children: t })), Ob = vt.createContext(!1),
|
|
4758
|
+
}), [e]), /* @__PURE__ */ _(Ub.Provider, { value: e, children: t })), Ob = vt.createContext(!1), w3 = () => vt.useContext(Ob);
|
|
4739
4759
|
Ob.Provider;
|
|
4740
|
-
function
|
|
4760
|
+
function v3() {
|
|
4741
4761
|
let e = !1;
|
|
4742
4762
|
return {
|
|
4743
4763
|
clearReset: () => {
|
|
@@ -4749,19 +4769,19 @@ function x3() {
|
|
|
4749
4769
|
isReset: () => e
|
|
4750
4770
|
};
|
|
4751
4771
|
}
|
|
4752
|
-
var
|
|
4772
|
+
var E3 = vt.createContext(v3()), k3 = () => vt.useContext(E3), C3 = (e, t) => {
|
|
4753
4773
|
(e.suspense || e.throwOnError || e.experimental_prefetchInRender) && (t.isReset() || (e.retryOnMount = !1));
|
|
4754
|
-
},
|
|
4774
|
+
}, T3 = (e) => {
|
|
4755
4775
|
vt.useEffect(() => {
|
|
4756
4776
|
e.clearReset();
|
|
4757
4777
|
}, [e]);
|
|
4758
|
-
},
|
|
4778
|
+
}, A3 = ({
|
|
4759
4779
|
result: e,
|
|
4760
4780
|
errorResetBoundary: t,
|
|
4761
4781
|
throwOnError: r,
|
|
4762
4782
|
query: n,
|
|
4763
4783
|
suspense: s
|
|
4764
|
-
}) => e.isError && !t.isReset() && !e.isFetching && n && (s && e.data === void 0 || Tb(r, [e.error, n])),
|
|
4784
|
+
}) => e.isError && !t.isReset() && !e.isFetching && n && (s && e.data === void 0 || Tb(r, [e.error, n])), S3 = (e) => {
|
|
4765
4785
|
if (e.suspense) {
|
|
4766
4786
|
const r = (s) => s === "static" ? s : Math.max(s ?? 1e3, 1e3), n = e.staleTime;
|
|
4767
4787
|
e.staleTime = typeof n == "function" ? (...s) => r(n(...s)) : r(n), typeof e.gcTime == "number" && (e.gcTime = Math.max(
|
|
@@ -4769,22 +4789,22 @@ var w3 = vt.createContext(x3()), v3 = () => vt.useContext(w3), E3 = (e, t) => {
|
|
|
4769
4789
|
1e3
|
|
4770
4790
|
));
|
|
4771
4791
|
}
|
|
4772
|
-
},
|
|
4792
|
+
}, P3 = (e, t) => e.isLoading && e.isFetching && !t, I3 = (e, t) => (e == null ? void 0 : e.suspense) && t.isPending, eh = (e, t, r) => t.fetchOptimistic(e).catch(() => {
|
|
4773
4793
|
r.clearReset();
|
|
4774
4794
|
});
|
|
4775
|
-
function
|
|
4795
|
+
function B3(e, t, r) {
|
|
4776
4796
|
var d, f, m, y, g;
|
|
4777
4797
|
if (process.env.NODE_ENV !== "production" && (typeof e != "object" || Array.isArray(e)))
|
|
4778
4798
|
throw new Error(
|
|
4779
4799
|
'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
|
|
4780
4800
|
);
|
|
4781
|
-
const n =
|
|
4801
|
+
const n = w3(), s = k3(), a = Ql(), o = a.defaultQueryOptions(e);
|
|
4782
4802
|
(f = (d = a.getDefaultOptions().queries) == null ? void 0 : d._experimental_beforeQuery) == null || f.call(
|
|
4783
4803
|
d,
|
|
4784
4804
|
o
|
|
4785
4805
|
), process.env.NODE_ENV !== "production" && (o.queryFn || console.error(
|
|
4786
4806
|
`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
|
|
4787
|
-
)), o._optimisticResults = n ? "isRestoring" : "optimistic",
|
|
4807
|
+
)), o._optimisticResults = n ? "isRestoring" : "optimistic", S3(o), C3(o, s), T3(s);
|
|
4788
4808
|
const i = !a.getQueryCache().get(o.queryHash), [c] = vt.useState(
|
|
4789
4809
|
() => new t(
|
|
4790
4810
|
a,
|
|
@@ -4803,9 +4823,9 @@ function P3(e, t, r) {
|
|
|
4803
4823
|
() => c.getCurrentResult()
|
|
4804
4824
|
), vt.useEffect(() => {
|
|
4805
4825
|
c.setOptions(o);
|
|
4806
|
-
}, [o, c]),
|
|
4826
|
+
}, [o, c]), I3(o, l))
|
|
4807
4827
|
throw eh(o, c, s);
|
|
4808
|
-
if (
|
|
4828
|
+
if (A3({
|
|
4809
4829
|
result: l,
|
|
4810
4830
|
errorResetBoundary: s,
|
|
4811
4831
|
throwOnError: o.throwOnError,
|
|
@@ -4817,7 +4837,7 @@ function P3(e, t, r) {
|
|
|
4817
4837
|
m,
|
|
4818
4838
|
o,
|
|
4819
4839
|
l
|
|
4820
|
-
), o.experimental_prefetchInRender && !Qs &&
|
|
4840
|
+
), o.experimental_prefetchInRender && !Qs && P3(l, n)) {
|
|
4821
4841
|
const E = i ? (
|
|
4822
4842
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
4823
4843
|
eh(o, c, s)
|
|
@@ -4831,12 +4851,12 @@ function P3(e, t, r) {
|
|
|
4831
4851
|
}
|
|
4832
4852
|
return o.notifyOnChangeProps ? l : c.trackResult(l);
|
|
4833
4853
|
}
|
|
4834
|
-
function
|
|
4835
|
-
return
|
|
4854
|
+
function F3(e, t) {
|
|
4855
|
+
return B3(e, u3);
|
|
4836
4856
|
}
|
|
4837
4857
|
function Vn(e, t) {
|
|
4838
4858
|
const r = Ql(), [n] = vt.useState(
|
|
4839
|
-
() => new
|
|
4859
|
+
() => new b3(
|
|
4840
4860
|
r,
|
|
4841
4861
|
e
|
|
4842
4862
|
)
|
|
@@ -4861,11 +4881,11 @@ function Vn(e, t) {
|
|
|
4861
4881
|
throw s.error;
|
|
4862
4882
|
return { ...s, mutate: a, mutateAsync: s.mutate };
|
|
4863
4883
|
}
|
|
4864
|
-
const
|
|
4884
|
+
const U3 = Ki(null), sd = {
|
|
4865
4885
|
didCatch: !1,
|
|
4866
4886
|
error: null
|
|
4867
4887
|
};
|
|
4868
|
-
class
|
|
4888
|
+
class O3 extends qx {
|
|
4869
4889
|
constructor(t) {
|
|
4870
4890
|
super(t), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = sd;
|
|
4871
4891
|
}
|
|
@@ -4898,7 +4918,7 @@ class F3 extends qx {
|
|
|
4898
4918
|
} = this.state, {
|
|
4899
4919
|
resetKeys: s
|
|
4900
4920
|
} = this.props;
|
|
4901
|
-
if (n && r.error !== null &&
|
|
4921
|
+
if (n && r.error !== null && D3(t.resetKeys, s)) {
|
|
4902
4922
|
var a, o;
|
|
4903
4923
|
(a = (o = this.props).onReset) === null || a === void 0 || a.call(o, {
|
|
4904
4924
|
next: s,
|
|
@@ -4932,7 +4952,7 @@ class F3 extends qx {
|
|
|
4932
4952
|
else
|
|
4933
4953
|
throw o;
|
|
4934
4954
|
}
|
|
4935
|
-
return _a(
|
|
4955
|
+
return _a(U3.Provider, {
|
|
4936
4956
|
value: {
|
|
4937
4957
|
didCatch: a,
|
|
4938
4958
|
error: o,
|
|
@@ -4941,7 +4961,7 @@ class F3 extends qx {
|
|
|
4941
4961
|
}, i);
|
|
4942
4962
|
}
|
|
4943
4963
|
}
|
|
4944
|
-
function
|
|
4964
|
+
function D3() {
|
|
4945
4965
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
|
|
4946
4966
|
return e.length !== t.length || e.some((r, n) => !Object.is(r, t[n]));
|
|
4947
4967
|
}
|
|
@@ -4955,8 +4975,8 @@ const th = (e) => {
|
|
|
4955
4975
|
}
|
|
4956
4976
|
}, s = () => t, i = { setState: n, getState: s, getInitialState: () => c, subscribe: (l) => (r.add(l), () => r.delete(l)) }, c = t = e(n, s, i);
|
|
4957
4977
|
return i;
|
|
4958
|
-
},
|
|
4959
|
-
function
|
|
4978
|
+
}, _3 = ((e) => e ? th(e) : th), M3 = (e) => e;
|
|
4979
|
+
function R3(e, t = M3) {
|
|
4960
4980
|
const r = te.useSyncExternalStore(
|
|
4961
4981
|
e.subscribe,
|
|
4962
4982
|
te.useCallback(() => t(e.getState()), [e, t]),
|
|
@@ -4965,13 +4985,13 @@ function _3(e, t = D3) {
|
|
|
4965
4985
|
return te.useDebugValue(r), r;
|
|
4966
4986
|
}
|
|
4967
4987
|
const rh = (e) => {
|
|
4968
|
-
const t =
|
|
4988
|
+
const t = _3(e), r = (n) => R3(t, n);
|
|
4969
4989
|
return Object.assign(r, t), r;
|
|
4970
|
-
},
|
|
4990
|
+
}, N3 = ((e) => e ? rh(e) : rh), nh = {
|
|
4971
4991
|
disclaimerAccepted: !0,
|
|
4972
4992
|
currentTime: Date.now(),
|
|
4973
4993
|
swapExecution: {}
|
|
4974
|
-
}, Y =
|
|
4994
|
+
}, Y = N3((e, t) => ({
|
|
4975
4995
|
state: nh,
|
|
4976
4996
|
updateState: (r) => e((n) => ({ state: { ...n.state, ...r } })),
|
|
4977
4997
|
updateSwapExecution: (r) => e((n) => ({ state: { ...n.state, swapExecution: { ...n.state.swapExecution, ...r } } })),
|
|
@@ -5006,12 +5026,12 @@ function ai({ children: e, className: t = "" }) {
|
|
|
5006
5026
|
return /* @__PURE__ */ _("p", { className: `${t} ${Le("Text")}`, children: e });
|
|
5007
5027
|
}
|
|
5008
5028
|
const Db = Ki({});
|
|
5009
|
-
function
|
|
5029
|
+
function z3({ children: e, ...t }) {
|
|
5010
5030
|
return /* @__PURE__ */ _(Db.Provider, { value: t, children: e });
|
|
5011
5031
|
}
|
|
5012
5032
|
const pn = () => Zl(Db);
|
|
5013
5033
|
var gt = /* @__PURE__ */ ((e) => (e[e.LOADING = 1] = "LOADING", e[e.SUCCESS = 2] = "SUCCESS", e[e.FAILED = 3] = "FAILED", e))(gt || {});
|
|
5014
|
-
const
|
|
5034
|
+
const L3 = ({
|
|
5015
5035
|
className: e = "",
|
|
5016
5036
|
size: t = 38,
|
|
5017
5037
|
borderWidth: r = 3,
|
|
@@ -5042,21 +5062,21 @@ function Jl({
|
|
|
5042
5062
|
}) {
|
|
5043
5063
|
return /* @__PURE__ */ fe("div", { className: `${Le("TradeStepLayout")} ${e}`, children: [
|
|
5044
5064
|
/* @__PURE__ */ fe("div", { className: Le("TradeStepLayoutHeader"), children: [
|
|
5045
|
-
/* @__PURE__ */ _(
|
|
5065
|
+
/* @__PURE__ */ _(V3, {}),
|
|
5046
5066
|
s && /* @__PURE__ */ _(ai, { className: Le("TradeStepLayoutTitle"), children: s })
|
|
5047
5067
|
] }),
|
|
5048
5068
|
t && /* @__PURE__ */ _("div", { className: Le("TradeStepLayoutBody"), children: t }),
|
|
5049
|
-
/* @__PURE__ */ _(
|
|
5069
|
+
/* @__PURE__ */ _($3, { link: r, text: n }),
|
|
5050
5070
|
a
|
|
5051
5071
|
] });
|
|
5052
5072
|
}
|
|
5053
|
-
const
|
|
5073
|
+
const $3 = ({ link: e, text: t }) => {
|
|
5054
5074
|
const { swapStatus: r } = pn();
|
|
5055
5075
|
return !e && !t ? null : /* @__PURE__ */ fe("div", { className: Le("TradeStepLayoutFooter"), children: [
|
|
5056
|
-
/* @__PURE__ */ _(
|
|
5057
|
-
e ? /* @__PURE__ */ _(
|
|
5076
|
+
/* @__PURE__ */ _(q3, {}),
|
|
5077
|
+
e ? /* @__PURE__ */ _(H3, { link: e, text: t }) : r === gt.FAILED ? void 0 : /* @__PURE__ */ _(ai, { children: t })
|
|
5058
5078
|
] });
|
|
5059
|
-
},
|
|
5079
|
+
}, H3 = ({ link: e, text: t }) => /* @__PURE__ */ _(
|
|
5060
5080
|
"a",
|
|
5061
5081
|
{
|
|
5062
5082
|
target: "_blank",
|
|
@@ -5065,7 +5085,7 @@ const z3 = ({ link: e, text: t }) => {
|
|
|
5065
5085
|
children: t
|
|
5066
5086
|
}
|
|
5067
5087
|
);
|
|
5068
|
-
function
|
|
5088
|
+
function G3() {
|
|
5069
5089
|
const { components: e } = pn();
|
|
5070
5090
|
return e.SuccessIcon ? e.SuccessIcon : /* @__PURE__ */ fe(
|
|
5071
5091
|
"svg",
|
|
@@ -5089,7 +5109,7 @@ function $3() {
|
|
|
5089
5109
|
}
|
|
5090
5110
|
);
|
|
5091
5111
|
}
|
|
5092
|
-
function
|
|
5112
|
+
function j3() {
|
|
5093
5113
|
const { components: e } = pn();
|
|
5094
5114
|
return e.FailedIcon ? e.FailedIcon : /* @__PURE__ */ fe(
|
|
5095
5115
|
"svg",
|
|
@@ -5113,20 +5133,20 @@ function H3() {
|
|
|
5113
5133
|
}
|
|
5114
5134
|
);
|
|
5115
5135
|
}
|
|
5116
|
-
const
|
|
5136
|
+
const V3 = () => {
|
|
5117
5137
|
const { swapStatus: e } = pn();
|
|
5118
|
-
return e === gt.SUCCESS ? /* @__PURE__ */ _(
|
|
5119
|
-
},
|
|
5138
|
+
return e === gt.SUCCESS ? /* @__PURE__ */ _(G3, {}) : e === gt.FAILED ? /* @__PURE__ */ _(j3, {}) : /* @__PURE__ */ _(W3, {});
|
|
5139
|
+
}, W3 = () => {
|
|
5120
5140
|
const { components: e } = pn();
|
|
5121
5141
|
return e.Loader ? e.Loader : /* @__PURE__ */ _(
|
|
5122
|
-
|
|
5142
|
+
L3,
|
|
5123
5143
|
{
|
|
5124
5144
|
size: 60,
|
|
5125
5145
|
borderWidth: 5,
|
|
5126
5146
|
className: Le("TradeStepLayoutSpinner")
|
|
5127
5147
|
}
|
|
5128
5148
|
);
|
|
5129
|
-
},
|
|
5149
|
+
}, q3 = () => {
|
|
5130
5150
|
const { totalSteps: e, currentStepIndex: t = 0, swapStatus: r } = pn();
|
|
5131
5151
|
return r !== gt.LOADING || e === 1 ? null : /* @__PURE__ */ _("div", { className: Le("StepIndicator"), children: /* @__PURE__ */ _(
|
|
5132
5152
|
"div",
|
|
@@ -5138,7 +5158,7 @@ const G3 = () => {
|
|
|
5138
5158
|
className: Le("StepIndicatorLine")
|
|
5139
5159
|
}
|
|
5140
5160
|
) });
|
|
5141
|
-
},
|
|
5161
|
+
}, Y3 = ({
|
|
5142
5162
|
error: e,
|
|
5143
5163
|
footerLink: t,
|
|
5144
5164
|
footerText: r
|
|
@@ -5151,7 +5171,7 @@ const G3 = () => {
|
|
|
5151
5171
|
className: Le("FailedContent")
|
|
5152
5172
|
}
|
|
5153
5173
|
);
|
|
5154
|
-
function
|
|
5174
|
+
function K3() {
|
|
5155
5175
|
return /* @__PURE__ */ _(
|
|
5156
5176
|
"svg",
|
|
5157
5177
|
{
|
|
@@ -5173,7 +5193,7 @@ const _b = ({ inTokenOnly: e }) => {
|
|
|
5173
5193
|
return /* @__PURE__ */ fe("div", { className: Le("TradePreview"), children: [
|
|
5174
5194
|
/* @__PURE__ */ _(sh, { token: t, amount: n, Logo: a == null ? void 0 : a.SrcTokenLogo }),
|
|
5175
5195
|
!e && /* @__PURE__ */ fe(mo, { children: [
|
|
5176
|
-
/* @__PURE__ */ _(
|
|
5196
|
+
/* @__PURE__ */ _(K3, {}),
|
|
5177
5197
|
/* @__PURE__ */ _(sh, { token: r, amount: s, Logo: a == null ? void 0 : a.DstTokenLogo })
|
|
5178
5198
|
] })
|
|
5179
5199
|
] });
|
|
@@ -5185,7 +5205,7 @@ const _b = ({ inTokenOnly: e }) => {
|
|
|
5185
5205
|
e == null ? void 0 : e.symbol
|
|
5186
5206
|
] })
|
|
5187
5207
|
] });
|
|
5188
|
-
function
|
|
5208
|
+
function Z3({
|
|
5189
5209
|
title: e,
|
|
5190
5210
|
footerLink: t,
|
|
5191
5211
|
footerText: r,
|
|
@@ -5223,7 +5243,7 @@ function oh({
|
|
|
5223
5243
|
}) {
|
|
5224
5244
|
return /* @__PURE__ */ _("div", { style: e, className: `${Le("SkeletonLoader")} ${t}` });
|
|
5225
5245
|
}
|
|
5226
|
-
const
|
|
5246
|
+
const X3 = () => /* @__PURE__ */ fe("div", { className: `${Le("MainContentLoader")}`, children: [
|
|
5227
5247
|
/* @__PURE__ */ _(
|
|
5228
5248
|
oh,
|
|
5229
5249
|
{
|
|
@@ -5236,7 +5256,7 @@ const K3 = () => /* @__PURE__ */ fe("div", { className: `${Le("MainContentLoader
|
|
|
5236
5256
|
className: `${Le("MainContentRectengularLoader")}`
|
|
5237
5257
|
}
|
|
5238
5258
|
)
|
|
5239
|
-
] }),
|
|
5259
|
+
] }), Q3 = ({
|
|
5240
5260
|
fromTitle: e,
|
|
5241
5261
|
toTitle: t,
|
|
5242
5262
|
inUsd: r,
|
|
@@ -5265,9 +5285,9 @@ const K3 = () => /* @__PURE__ */ fe("div", { className: `${Le("MainContentLoader
|
|
|
5265
5285
|
DstTokenLogo: l.DstTokenLogo
|
|
5266
5286
|
}
|
|
5267
5287
|
);
|
|
5268
|
-
return s ? u ? /* @__PURE__ */ _(
|
|
5288
|
+
return s ? u ? /* @__PURE__ */ _(J3, {}) : /* @__PURE__ */ fe(ah, { children: [
|
|
5269
5289
|
d,
|
|
5270
|
-
/* @__PURE__ */ _(
|
|
5290
|
+
/* @__PURE__ */ _(X3, {})
|
|
5271
5291
|
] }) : /* @__PURE__ */ _(ah, { children: d });
|
|
5272
5292
|
}, ih = ({
|
|
5273
5293
|
amount: e,
|
|
@@ -5283,7 +5303,7 @@ const K3 = () => /* @__PURE__ */ fe("div", { className: `${Le("MainContentLoader
|
|
|
5283
5303
|
] }),
|
|
5284
5304
|
s || /* @__PURE__ */ _("div", { className: ` ${Le("MainTokenLogo")}`, children: t != null && t.logoUrl ? /* @__PURE__ */ _("img", { src: t == null ? void 0 : t.logoUrl, alt: "Token logo" }) : null })
|
|
5285
5305
|
] });
|
|
5286
|
-
function
|
|
5306
|
+
function J3() {
|
|
5287
5307
|
const { currentStep: e } = pn();
|
|
5288
5308
|
return e ? /* @__PURE__ */ _(
|
|
5289
5309
|
Jl,
|
|
@@ -5328,18 +5348,18 @@ const Mb = ({
|
|
|
5328
5348
|
}
|
|
5329
5349
|
)
|
|
5330
5350
|
] }), ks = (e) => /* @__PURE__ */ _(
|
|
5331
|
-
|
|
5351
|
+
z3,
|
|
5332
5352
|
{
|
|
5333
5353
|
...e,
|
|
5334
|
-
children: /* @__PURE__ */ _(
|
|
5354
|
+
children: /* @__PURE__ */ _(e8, {})
|
|
5335
5355
|
}
|
|
5336
|
-
),
|
|
5356
|
+
), e8 = () => {
|
|
5337
5357
|
const { swapStatus: e, components: t, className: r } = pn();
|
|
5338
5358
|
return /* @__PURE__ */ _("div", { className: `${Le("SwapFlow")} ${r}`, children: e === gt.SUCCESS ? t == null ? void 0 : t.Success : e === gt.FAILED ? t == null ? void 0 : t.Failed : t == null ? void 0 : t.Main });
|
|
5339
5359
|
};
|
|
5340
|
-
ks.Success =
|
|
5341
|
-
ks.Failed =
|
|
5342
|
-
ks.Main =
|
|
5360
|
+
ks.Success = Z3;
|
|
5361
|
+
ks.Failed = Y3;
|
|
5362
|
+
ks.Main = Q3;
|
|
5343
5363
|
ks.StepLayout = Jl;
|
|
5344
5364
|
var qt = /* @__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))(qt || {}), Ma = /* @__PURE__ */ ((e) => (e.WRAP = "wrap", e.APPROVE = "approve", e.CREATE = "create", e))(Ma || {});
|
|
5345
5365
|
const XY = (e) => e.replace(/,/g, ""), QY = async (e) => {
|
|
@@ -5350,12 +5370,14 @@ const XY = (e) => e.replace(/,/g, ""), QY = async (e) => {
|
|
|
5350
5370
|
} catch (t) {
|
|
5351
5371
|
return console.warn("Copy failed", t), !1;
|
|
5352
5372
|
}
|
|
5353
|
-
},
|
|
5373
|
+
}, t8 = (e) => {
|
|
5354
5374
|
if (!e)
|
|
5355
5375
|
return "";
|
|
5356
5376
|
const t = Math.floor(e / 1e3), r = Math.floor(t / (1440 * 60)), n = Math.floor(t % (1440 * 60) / 3600), s = Math.floor(t % 3600 / 60), a = t % 60, o = [];
|
|
5357
5377
|
return r && o.push(`${r} days `), n && o.push(`${n} hours `), s && o.push(`${s} minutes`), a && o.push(`${a} seconds`), o.join(" ");
|
|
5358
|
-
}, Rb = (e, t) => e ? `${e.substring(0, (t == null ? void 0 : t.start) || 6)}...${e.substring(
|
|
5378
|
+
}, Rb = (e, t) => e ? `${e.substring(0, (t == null ? void 0 : t.start) || 6)}...${e.substring(
|
|
5379
|
+
e.length - ((t == null ? void 0 : t.end) || 5)
|
|
5380
|
+
)}` : "", JY = (e) => {
|
|
5359
5381
|
const t = "An error occurred.";
|
|
5360
5382
|
if (!e || !e.message) return t;
|
|
5361
5383
|
try {
|
|
@@ -5388,14 +5410,6 @@ const Nb = (e) => {
|
|
|
5388
5410
|
default:
|
|
5389
5411
|
return 0.01;
|
|
5390
5412
|
}
|
|
5391
|
-
}, e8 = (e, t, r) => {
|
|
5392
|
-
if (!H(e.srcAmountFilled || 0).gt(0) || !H(e.dstAmountFilled || 0).gt(0)) return "";
|
|
5393
|
-
const n = ys(t, e.srcAmountFilled), s = ys(r, e.dstAmountFilled);
|
|
5394
|
-
return H(s).div(n).toFixed();
|
|
5395
|
-
}, t8 = (e, t, r) => {
|
|
5396
|
-
if (e.type === ht.TWAP_MARKET) return "";
|
|
5397
|
-
const n = ys(t, e.srcAmountPerTrade), s = ys(r, e.dstMinAmountPerTrade);
|
|
5398
|
-
return H(s).div(n).toFixed();
|
|
5399
5413
|
}, r8 = (e, t) => {
|
|
5400
5414
|
const r = bo(t);
|
|
5401
5415
|
return r && ho(e.address) ? r.wToken : e;
|
|
@@ -27811,7 +27825,7 @@ async function ku(e, t) {
|
|
|
27811
27825
|
});
|
|
27812
27826
|
return ie === "0x" ? { data: void 0 } : { data: ie };
|
|
27813
27827
|
} catch (U) {
|
|
27814
|
-
const F = OD(U), { offchainLookup: N, offchainLookupSignature: z } = await import("./ccip-
|
|
27828
|
+
const F = OD(U), { offchainLookup: N, offchainLookupSignature: z } = await import("./ccip-BLmrJSyG.js");
|
|
27815
27829
|
if (e.ccipRead !== !1 && (F == null ? void 0 : F.slice(0, 10)) === z && C)
|
|
27816
27830
|
return { data: await N(e, { data: F, to: C }) };
|
|
27817
27831
|
throw A && (F == null ? void 0 : F.slice(0, 10)) === "0x101bb98d" ? new ZA({ factory: f }) : Zf(U, {
|
|
@@ -35755,7 +35769,7 @@ const xz = (e, t) => {
|
|
|
35755
35769
|
) });
|
|
35756
35770
|
function vz({ children: e }) {
|
|
35757
35771
|
return /* @__PURE__ */ _(
|
|
35758
|
-
|
|
35772
|
+
O3,
|
|
35759
35773
|
{
|
|
35760
35774
|
FallbackComponent: wz,
|
|
35761
35775
|
onError: (t) => bt.onCrash(t),
|
|
@@ -35763,7 +35777,7 @@ function vz({ children: e }) {
|
|
|
35763
35777
|
}
|
|
35764
35778
|
);
|
|
35765
35779
|
}
|
|
35766
|
-
const Jp = Ki({}), Ez = new
|
|
35780
|
+
const Jp = Ki({}), Ez = new g3({
|
|
35767
35781
|
defaultOptions: {
|
|
35768
35782
|
queries: {
|
|
35769
35783
|
refetchOnWindowFocus: !1
|
|
@@ -35885,7 +35899,7 @@ const Jp = Ki({}), Ez = new b3({
|
|
|
35885
35899
|
]
|
|
35886
35900
|
}
|
|
35887
35901
|
);
|
|
35888
|
-
}, CK = (e) => /* @__PURE__ */ _(
|
|
35902
|
+
}, CK = (e) => /* @__PURE__ */ _(x3, { client: Ez, children: /* @__PURE__ */ _(Az, { ...e }) }), ne = () => {
|
|
35889
35903
|
if (!Jp)
|
|
35890
35904
|
throw new Error("useSpotContext must be used within a WidgetProvider");
|
|
35891
35905
|
return Zl(Jp);
|
|
@@ -36112,7 +36126,7 @@ const Fz = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
36112
36126
|
IconBase: X6,
|
|
36113
36127
|
IconContext: ef,
|
|
36114
36128
|
IconsManifest: Pz
|
|
36115
|
-
}, Symbol.toStringTag, { value: "Module" })), Fu = /* @__PURE__ */
|
|
36129
|
+
}, Symbol.toStringTag, { value: "Module" })), Fu = /* @__PURE__ */ ew(Fz);
|
|
36116
36130
|
var v1;
|
|
36117
36131
|
function Uz() {
|
|
36118
36132
|
if (v1) return _d;
|
|
@@ -39223,7 +39237,7 @@ const Re = () => {
|
|
|
39223
39237
|
const e = Re(), { account: t } = ne(), r = (s = xc()) == null ? void 0 : s.explorer, n = Rb(t);
|
|
39224
39238
|
return /* @__PURE__ */ _(fr, { title: e("recipient") || "", children: r ? /* @__PURE__ */ _("a", { href: `${r}/address/${t}`, target: "_blank", children: n }) : n });
|
|
39225
39239
|
}, jV = ({ fillDelayMillis: e, chunks: t = 0, label: r, tooltip: n }) => {
|
|
39226
|
-
const s = ee(() =>
|
|
39240
|
+
const s = ee(() => t8(e), [e]);
|
|
39227
39241
|
return t === 1 ? null : /* @__PURE__ */ _(fr, { title: r, tooltip: n, children: s });
|
|
39228
39242
|
}, fr = ({
|
|
39229
39243
|
title: e,
|
|
@@ -39401,7 +39415,7 @@ const cm = () => {
|
|
|
39401
39415
|
);
|
|
39402
39416
|
}, XV = () => {
|
|
39403
39417
|
const { account: e, config: t, chainId: r } = ne(), n = um(), s = ZV();
|
|
39404
|
-
return
|
|
39418
|
+
return F3({
|
|
39405
39419
|
refetchInterval: Sz,
|
|
39406
39420
|
refetchOnWindowFocus: !0,
|
|
39407
39421
|
retry: !1,
|
|
@@ -39409,7 +39423,7 @@ const cm = () => {
|
|
|
39409
39423
|
queryKey: n,
|
|
39410
39424
|
queryFn: async ({ signal: a }) => {
|
|
39411
39425
|
if (!e || !r || !t) return [];
|
|
39412
|
-
const o = await
|
|
39426
|
+
const o = await qw({
|
|
39413
39427
|
signal: a,
|
|
39414
39428
|
chainId: r,
|
|
39415
39429
|
config: t.twapConfig,
|
|
@@ -39450,14 +39464,14 @@ const cm = () => {
|
|
|
39450
39464
|
) || [] : t.all, [e, t]);
|
|
39451
39465
|
}, yl = (e, t) => e.filter((r) => r.status === t).sort((r, n) => n.createdAt - r.createdAt), QV = (e, t, r) => ee(() => {
|
|
39452
39466
|
if (!(!e || !t || !r || r != null && r.isMarketPrice))
|
|
39453
|
-
return
|
|
39467
|
+
return H5(
|
|
39454
39468
|
r,
|
|
39455
39469
|
e == null ? void 0 : e.decimals,
|
|
39456
39470
|
t == null ? void 0 : t.decimals
|
|
39457
39471
|
);
|
|
39458
39472
|
}, [r, e, t]), JV = (e, t, r) => ee(() => {
|
|
39459
39473
|
if (!(!e || !t || !r))
|
|
39460
|
-
return
|
|
39474
|
+
return $5(r, e.decimals, t.decimals);
|
|
39461
39475
|
}, [r, e, t]), X2 = () => {
|
|
39462
39476
|
const e = Y((r) => r.updateState), t = Y((r) => r.state.orderIdsToCancel);
|
|
39463
39477
|
return Fe(
|
|
@@ -43283,7 +43297,7 @@ const rY = () => {
|
|
|
43283
43297
|
}, nY = (e) => {
|
|
43284
43298
|
const t = Re(), { marketPrice: r } = ne(), n = Y((a) => a.state.typedSrcAmount);
|
|
43285
43299
|
return ee(() => {
|
|
43286
|
-
const { isError: a, value: o } =
|
|
43300
|
+
const { isError: a, value: o } = gw(e);
|
|
43287
43301
|
if (!(!a || H(n || "0").isZero() || !r))
|
|
43288
43302
|
return {
|
|
43289
43303
|
type: qt.MIN_FILL_DELAY,
|
|
@@ -43328,14 +43342,14 @@ const rY = () => {
|
|
|
43328
43342
|
value: 1,
|
|
43329
43343
|
message: o("minChunksError", { minChunks: "1" })
|
|
43330
43344
|
};
|
|
43331
|
-
const { isError: c } =
|
|
43345
|
+
const { isError: c } = ww(e, t, r);
|
|
43332
43346
|
if (c)
|
|
43333
43347
|
return {
|
|
43334
43348
|
type: qt.MAX_CHUNKS,
|
|
43335
43349
|
value: t,
|
|
43336
43350
|
message: o("maxChunksError", { maxChunks: `${t}` })
|
|
43337
43351
|
};
|
|
43338
|
-
const { isError: l, value: u } =
|
|
43352
|
+
const { isError: l, value: u } = xw(i || "", n || "", a || 0);
|
|
43339
43353
|
if (l)
|
|
43340
43354
|
return {
|
|
43341
43355
|
type: qt.MIN_TRADE_SIZE,
|
|
@@ -43345,14 +43359,14 @@ const rY = () => {
|
|
|
43345
43359
|
}, [e, t, r, i, n, a, o, s]);
|
|
43346
43360
|
}, dn = () => {
|
|
43347
43361
|
const { srcToken: e, srcUsd1Token: t, module: r, minChunkSizeUsd: n } = ne(), s = Y((g) => g.state.typedChunks), a = xa().fillDelay, o = Y((g) => g.updateState), { amountWei: i, amountUI: c } = yn(), l = ee(
|
|
43348
|
-
() =>
|
|
43362
|
+
() => lw(a, c || "", t || "", n || 0),
|
|
43349
43363
|
[c, t, n, a]
|
|
43350
|
-
), u = ee(() =>
|
|
43364
|
+
), u = ee(() => cw(l, r, s), [l, s, r]), d = Fe(
|
|
43351
43365
|
(g) => o({
|
|
43352
43366
|
typedChunks: g
|
|
43353
43367
|
}),
|
|
43354
43368
|
[o]
|
|
43355
|
-
), f = ee(() =>
|
|
43369
|
+
), f = ee(() => dw(i || "", u), [i, u]), m = Nr(e == null ? void 0 : e.decimals, f), y = ee(() => t ? H(m || "0").times(t || 0).toString() : "0", [m, t]);
|
|
43356
43370
|
return {
|
|
43357
43371
|
totalTrades: u,
|
|
43358
43372
|
maxTrades: l,
|
|
@@ -43380,7 +43394,7 @@ const rY = () => {
|
|
|
43380
43394
|
}, aY = (e) => {
|
|
43381
43395
|
const { module: t, marketPrice: r } = ne(), n = Re();
|
|
43382
43396
|
return ee(() => {
|
|
43383
|
-
const s =
|
|
43397
|
+
const s = bw(t, e), a = yw(e);
|
|
43384
43398
|
if (r) {
|
|
43385
43399
|
if (s.isError)
|
|
43386
43400
|
return {
|
|
@@ -43397,7 +43411,7 @@ const rY = () => {
|
|
|
43397
43411
|
}
|
|
43398
43412
|
}, [e, n, t, r]);
|
|
43399
43413
|
}, km = () => {
|
|
43400
|
-
const { module: e } = ne(), t = Y((i) => i.state.typedDuration), r = Y((i) => i.updateState), n = dn().totalTrades, s = xa().fillDelay, a = ee(() =>
|
|
43414
|
+
const { module: e } = ne(), t = Y((i) => i.state.typedDuration), r = Y((i) => i.updateState), n = dn().totalTrades, s = xa().fillDelay, a = ee(() => iw(e, n, s, t), [n, s, t, e]), o = aY(a);
|
|
43401
43415
|
return {
|
|
43402
43416
|
duration: a,
|
|
43403
43417
|
setDuration: Fe((i) => r({ typedDuration: i }), [r]),
|
|
@@ -43511,22 +43525,22 @@ const rY = () => {
|
|
|
43511
43525
|
};
|
|
43512
43526
|
}, oY = () => {
|
|
43513
43527
|
const { module: e } = ne();
|
|
43514
|
-
return ee(() => e === ke.STOP_LOSS ?
|
|
43528
|
+
return ee(() => e === ke.STOP_LOSS ? Z5 : X5, [e]);
|
|
43515
43529
|
}, Tm = () => {
|
|
43516
43530
|
const { module: e } = ne(), t = Y((r) => r.state.isMarketOrder);
|
|
43517
|
-
return ee(() => e !== ke.STOP_LOSS && e !== ke.TAKE_PROFIT || t ? void 0 : e === ke.STOP_LOSS ?
|
|
43531
|
+
return ee(() => e !== ke.STOP_LOSS && e !== ke.TAKE_PROFIT || t ? void 0 : e === ke.STOP_LOSS ? Q5 : J5, [e, t]);
|
|
43518
43532
|
}, iY = (e = "") => {
|
|
43519
43533
|
const { module: t, marketPrice: r } = ne(), n = Re(), s = Y((a) => a.state.typedSrcAmount);
|
|
43520
43534
|
return ee(() => {
|
|
43521
43535
|
if (H(s || "0").isZero() || !r || t !== ke.STOP_LOSS && t !== ke.TAKE_PROFIT) return;
|
|
43522
|
-
const a =
|
|
43536
|
+
const a = pw(r || "", e || "", t);
|
|
43523
43537
|
if (a != null && a.isError)
|
|
43524
43538
|
return {
|
|
43525
43539
|
type: qt.STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE,
|
|
43526
43540
|
value: a.value,
|
|
43527
43541
|
message: n("StopLossTriggerPriceError") || ""
|
|
43528
43542
|
};
|
|
43529
|
-
const o =
|
|
43543
|
+
const o = fw(r || "", e || "", t);
|
|
43530
43544
|
if (o != null && o.isError)
|
|
43531
43545
|
return {
|
|
43532
43546
|
type: qt.TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE,
|
|
@@ -43541,7 +43555,7 @@ const rY = () => {
|
|
|
43541
43555
|
};
|
|
43542
43556
|
}, [r, e, t, n, s]);
|
|
43543
43557
|
}, cY = (e) => {
|
|
43544
|
-
const { srcToken: t, dstToken: r, module: n } = ne(), s = dn().amountPerTradeWei, a = Y((i) => i.state.isMarketOrder), o = ee(() =>
|
|
43558
|
+
const { srcToken: t, dstToken: r, module: n } = ne(), s = dn().amountPerTradeWei, a = Y((i) => i.state.isMarketOrder), o = ee(() => ow(n, s, e, (t == null ? void 0 : t.decimals) || 0), [e, s, a, t == null ? void 0 : t.decimals, n]);
|
|
43545
43559
|
return {
|
|
43546
43560
|
amountWei: o,
|
|
43547
43561
|
amountUI: Nr((r == null ? void 0 : r.decimals) || 0, o)
|
|
@@ -43593,7 +43607,7 @@ const rY = () => {
|
|
|
43593
43607
|
const { module: t, marketPrice: r } = ne(), n = Re(), { amountWei: s } = wa(), a = Y((i) => i.state.isMarketOrder), o = Y((i) => i.state.typedSrcAmount);
|
|
43594
43608
|
return ee(() => {
|
|
43595
43609
|
if (H(o || "0").isZero() || !s || !r) return;
|
|
43596
|
-
const i =
|
|
43610
|
+
const i = mw(s, e, a, t), c = hw(s, e, a, t);
|
|
43597
43611
|
if (i != null && i.isError)
|
|
43598
43612
|
return {
|
|
43599
43613
|
type: qt.TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE,
|
|
@@ -43673,14 +43687,14 @@ const rY = () => {
|
|
|
43673
43687
|
const { module: e, marketPrice: t } = ne(), r = kc().amountWei, n = wa().amountWei, s = Y((a) => a.state.isMarketOrder);
|
|
43674
43688
|
return e === ke.LIMIT || !s ? r || "" : e === ke.STOP_LOSS || e === ke.TAKE_PROFIT ? n || "" : t || "";
|
|
43675
43689
|
}, Cc = () => {
|
|
43676
|
-
const { srcToken: e, dstToken: t } = ne(), r = Mx(), n = yn().amountWei, s = ee(() =>
|
|
43690
|
+
const { srcToken: e, dstToken: t } = ne(), r = Mx(), n = yn().amountWei, s = ee(() => sw(n || "", r, (e == null ? void 0 : e.decimals) || 0), [n, r, e == null ? void 0 : e.decimals]);
|
|
43677
43691
|
return {
|
|
43678
43692
|
amountWei: s,
|
|
43679
43693
|
amountUI: Nr(t == null ? void 0 : t.decimals, s)
|
|
43680
43694
|
};
|
|
43681
43695
|
}, Am = () => {
|
|
43682
43696
|
const { srcToken: e, dstToken: t, dstUsd1Token: r } = ne(), n = Mx(), s = dn().amountPerTradeWei, a = Y((c) => c.state.isMarketOrder), o = ee(
|
|
43683
|
-
() =>
|
|
43697
|
+
() => aw(s, n, !!a, (e == null ? void 0 : e.decimals) || 0),
|
|
43684
43698
|
[s, n, a, e == null ? void 0 : e.decimals]
|
|
43685
43699
|
), i = Nr(t == null ? void 0 : t.decimals, o);
|
|
43686
43700
|
return {
|
|
@@ -43757,7 +43771,7 @@ const Nx = (e, t) => {
|
|
|
43757
43771
|
};
|
|
43758
43772
|
}, Sm = () => {
|
|
43759
43773
|
const e = Y((r) => r.state.currentTime), t = km().duration;
|
|
43760
|
-
return ee(() =>
|
|
43774
|
+
return ee(() => uw(e, t), [e, t]);
|
|
43761
43775
|
}, pY = () => {
|
|
43762
43776
|
const { srcUsd1Token: e, dstUsd1Token: t } = ne(), r = yn().amountUI, n = Cc().amountUI, s = ca(r, e), a = ca(n, t);
|
|
43763
43777
|
return { srcAmountUsd: s, dstAmountUsd: a };
|
|
@@ -43784,7 +43798,7 @@ const Nx = (e, t) => {
|
|
|
43784
43798
|
tradeInterval: m,
|
|
43785
43799
|
triggerPricePerTrade: f,
|
|
43786
43800
|
maker: r,
|
|
43787
|
-
rePermitData:
|
|
43801
|
+
rePermitData: Ew({
|
|
43788
43802
|
chainId: n,
|
|
43789
43803
|
srcToken: ho((e == null ? void 0 : e.address) || "") ? ((y = bo(n)) == null ? void 0 : y.wToken.address) || "" : (e == null ? void 0 : e.address) || "",
|
|
43790
43804
|
dstToken: (t == null ? void 0 : t.address) || "",
|
|
@@ -43955,7 +43969,7 @@ const kY = () => {
|
|
|
43955
43969
|
usd: o.triggerPricePerTrade.usd
|
|
43956
43970
|
}
|
|
43957
43971
|
),
|
|
43958
|
-
/* @__PURE__ */ _(
|
|
43972
|
+
o.limitPrice.value ? /* @__PURE__ */ _(
|
|
43959
43973
|
xY,
|
|
43960
43974
|
{
|
|
43961
43975
|
price: o.limitPrice.value,
|
|
@@ -43963,7 +43977,7 @@ const kY = () => {
|
|
|
43963
43977
|
label: o.limitPrice.label,
|
|
43964
43978
|
usd: o.limitPrice.usd
|
|
43965
43979
|
}
|
|
43966
|
-
),
|
|
43980
|
+
) : null,
|
|
43967
43981
|
/* @__PURE__ */ _(
|
|
43968
43982
|
Ee.MinDestAmount,
|
|
43969
43983
|
{
|
|
@@ -44145,7 +44159,7 @@ const kY = () => {
|
|
|
44145
44159
|
v: V(d.v || 0),
|
|
44146
44160
|
r: d.r,
|
|
44147
44161
|
s: d.s
|
|
44148
|
-
}, m = await
|
|
44162
|
+
}, m = await Mw(o, f);
|
|
44149
44163
|
return (v = n == null ? void 0 : n.onOrderCreated) == null || v.call(n, m), a(m), m;
|
|
44150
44164
|
}
|
|
44151
44165
|
});
|
|
@@ -44368,13 +44382,13 @@ const FY = () => {
|
|
|
44368
44382
|
loading: u
|
|
44369
44383
|
}), [m, f, u]);
|
|
44370
44384
|
};
|
|
44371
|
-
|
|
44385
|
+
Sw(Kw.version);
|
|
44372
44386
|
const HK = {
|
|
44373
44387
|
SubmitOrderPanel: CY,
|
|
44374
44388
|
Orders: rY
|
|
44375
44389
|
};
|
|
44376
44390
|
export {
|
|
44377
|
-
|
|
44391
|
+
n8 as $,
|
|
44378
44392
|
zK as A,
|
|
44379
44393
|
L as B,
|
|
44380
44394
|
HK as C,
|
|
@@ -44395,95 +44409,96 @@ export {
|
|
|
44395
44409
|
XY as R,
|
|
44396
44410
|
CK as S,
|
|
44397
44411
|
QY as T,
|
|
44398
|
-
|
|
44412
|
+
t8 as U,
|
|
44399
44413
|
Rb as V,
|
|
44400
44414
|
JY as W,
|
|
44401
44415
|
Fl as X,
|
|
44402
44416
|
Nb as Y,
|
|
44403
44417
|
eK as Z,
|
|
44404
|
-
|
|
44418
|
+
r8 as _,
|
|
44405
44419
|
BR as a,
|
|
44406
|
-
|
|
44407
|
-
|
|
44408
|
-
|
|
44409
|
-
|
|
44410
|
-
|
|
44411
|
-
|
|
44412
|
-
|
|
44413
|
-
|
|
44414
|
-
|
|
44415
|
-
|
|
44416
|
-
|
|
44417
|
-
|
|
44418
|
-
|
|
44419
|
-
|
|
44420
|
-
|
|
44421
|
-
|
|
44422
|
-
|
|
44423
|
-
|
|
44424
|
-
|
|
44425
|
-
|
|
44426
|
-
|
|
44427
|
-
|
|
44428
|
-
|
|
44429
|
-
|
|
44430
|
-
|
|
44431
|
-
|
|
44432
|
-
|
|
44433
|
-
|
|
44434
|
-
|
|
44435
|
-
|
|
44436
|
-
|
|
44437
|
-
|
|
44438
|
-
|
|
44439
|
-
|
|
44440
|
-
|
|
44441
|
-
|
|
44442
|
-
|
|
44443
|
-
|
|
44444
|
-
|
|
44445
|
-
|
|
44446
|
-
|
|
44447
|
-
|
|
44448
|
-
|
|
44449
|
-
|
|
44450
|
-
|
|
44451
|
-
|
|
44420
|
+
KY as a$,
|
|
44421
|
+
zb as a0,
|
|
44422
|
+
tK as a1,
|
|
44423
|
+
Lb as a2,
|
|
44424
|
+
$b as a3,
|
|
44425
|
+
ao as a4,
|
|
44426
|
+
ho as a5,
|
|
44427
|
+
eu as a6,
|
|
44428
|
+
Ht as a7,
|
|
44429
|
+
bt as a8,
|
|
44430
|
+
Sw as a9,
|
|
44431
|
+
W5 as aA,
|
|
44432
|
+
LY as aB,
|
|
44433
|
+
Gt as aC,
|
|
44434
|
+
q5 as aD,
|
|
44435
|
+
Xd as aE,
|
|
44436
|
+
$Y as aF,
|
|
44437
|
+
HY as aG,
|
|
44438
|
+
Y5 as aH,
|
|
44439
|
+
K5 as aI,
|
|
44440
|
+
xf as aJ,
|
|
44441
|
+
GY as aK,
|
|
44442
|
+
jY as aL,
|
|
44443
|
+
VY as aM,
|
|
44444
|
+
WY as aN,
|
|
44445
|
+
qY as aO,
|
|
44446
|
+
wf as aP,
|
|
44447
|
+
Z5 as aQ,
|
|
44448
|
+
X5 as aR,
|
|
44449
|
+
Q5 as aS,
|
|
44450
|
+
J5 as aT,
|
|
44451
|
+
YY as aU,
|
|
44452
|
+
sw as aV,
|
|
44453
|
+
aw as aW,
|
|
44454
|
+
ow as aX,
|
|
44455
|
+
iw as aY,
|
|
44456
|
+
cw as aZ,
|
|
44457
|
+
lw as a_,
|
|
44458
|
+
bo as aa,
|
|
44459
|
+
gf as ab,
|
|
44460
|
+
ys as ac,
|
|
44461
|
+
mb as ad,
|
|
44462
|
+
Xl as ae,
|
|
44463
|
+
L5 as af,
|
|
44464
|
+
$5 as ag,
|
|
44465
|
+
H5 as ah,
|
|
44452
44466
|
Rt as ai,
|
|
44453
|
-
|
|
44454
|
-
|
|
44455
|
-
|
|
44456
|
-
|
|
44457
|
-
|
|
44458
|
-
|
|
44459
|
-
|
|
44460
|
-
|
|
44461
|
-
|
|
44462
|
-
|
|
44463
|
-
|
|
44464
|
-
|
|
44465
|
-
|
|
44466
|
-
|
|
44467
|
-
|
|
44468
|
-
|
|
44469
|
-
|
|
44467
|
+
qw as aj,
|
|
44468
|
+
wb as ak,
|
|
44469
|
+
B5 as al,
|
|
44470
|
+
MY as am,
|
|
44471
|
+
F5 as an,
|
|
44472
|
+
U5 as ao,
|
|
44473
|
+
er as ap,
|
|
44474
|
+
RY as aq,
|
|
44475
|
+
hb as ar,
|
|
44476
|
+
NY as as,
|
|
44477
|
+
zY as at,
|
|
44478
|
+
Zd as au,
|
|
44479
|
+
ni as av,
|
|
44480
|
+
zm as aw,
|
|
44481
|
+
G5 as ax,
|
|
44482
|
+
j5 as ay,
|
|
44483
|
+
V5 as az,
|
|
44470
44484
|
Fr as b,
|
|
44471
|
-
|
|
44472
|
-
|
|
44473
|
-
|
|
44474
|
-
|
|
44475
|
-
|
|
44476
|
-
|
|
44477
|
-
|
|
44478
|
-
|
|
44479
|
-
|
|
44480
|
-
|
|
44481
|
-
|
|
44482
|
-
|
|
44483
|
-
|
|
44484
|
-
|
|
44485
|
-
|
|
44486
|
-
|
|
44485
|
+
uw as b0,
|
|
44486
|
+
yb as b1,
|
|
44487
|
+
dw as b2,
|
|
44488
|
+
ZY as b3,
|
|
44489
|
+
pw as b4,
|
|
44490
|
+
fw as b5,
|
|
44491
|
+
mw as b6,
|
|
44492
|
+
hw as b7,
|
|
44493
|
+
bw as b8,
|
|
44494
|
+
yw as b9,
|
|
44495
|
+
gw as ba,
|
|
44496
|
+
xw as bb,
|
|
44497
|
+
ww as bc,
|
|
44498
|
+
gb as bd,
|
|
44499
|
+
vw as be,
|
|
44500
|
+
Ew as bf,
|
|
44501
|
+
Mw as bg,
|
|
44487
44502
|
ku as c,
|
|
44488
44503
|
jA as d,
|
|
44489
44504
|
pa as e,
|