@rash2x/bridge-widget 0.6.32 → 0.6.34
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/evaa-bridge.cjs +1 -1
- package/dist/evaa-bridge.mjs +1 -1
- package/dist/{index-D0iCKCsz.js → index-CO2PQtBo.js} +903 -1245
- package/dist/index-CO2PQtBo.js.map +1 -0
- package/dist/{index-BsEjYruO.cjs → index-CmbarigA.cjs} +866 -646
- package/dist/index-CmbarigA.cjs.map +1 -0
- package/dist/{index-BOtiGj6h.cjs → index-DvjGvKnp.cjs} +903 -1245
- package/dist/index-DvjGvKnp.cjs.map +1 -0
- package/dist/{index-BbLtc5UN.js → index-sU0Z-m5M.js} +866 -646
- package/dist/index-sU0Z-m5M.js.map +1 -0
- package/dist/index.html +89 -0
- package/dist/styles.css +1 -1
- package/package.json +13 -11
- package/dist/index-BOtiGj6h.cjs.map +0 -1
- package/dist/index-BbLtc5UN.js.map +0 -1
- package/dist/index-BsEjYruO.cjs.map +0 -1
- package/dist/index-D0iCKCsz.js.map +0 -1
|
@@ -351,7 +351,7 @@ const useChainsStore = zustand.create()(
|
|
|
351
351
|
if (same) return;
|
|
352
352
|
set2({ allowedToChains: data });
|
|
353
353
|
},
|
|
354
|
-
setIsLoadingToChains: (
|
|
354
|
+
setIsLoadingToChains: (v2) => set2({ isLoadingToChains: v2 }),
|
|
355
355
|
swapChains: () => set2((state2) => ({
|
|
356
356
|
fromChain: state2.toChain,
|
|
357
357
|
toChain: state2.fromChain
|
|
@@ -593,11 +593,11 @@ const useBridgeQuoteStore = zustand.create((set2) => ({
|
|
|
593
593
|
error: void 0,
|
|
594
594
|
noRoute: false,
|
|
595
595
|
refetchTrigger: 0,
|
|
596
|
-
setInputAmount: (
|
|
596
|
+
setInputAmount: (v2) => set2({ inputAmount: v2 }),
|
|
597
597
|
setLoading: () => set2({ status: "loading", error: void 0 }),
|
|
598
|
-
setQuote: (
|
|
598
|
+
setQuote: (q3) => set2({ quote: q3, status: q3 ? "success" : "idle", error: void 0 }),
|
|
599
599
|
setError: (e2) => set2({ error: e2, status: "error" }),
|
|
600
|
-
setNoRoute: (
|
|
600
|
+
setNoRoute: (v2) => set2({ noRoute: v2 }),
|
|
601
601
|
triggerRefetch: () => set2((s2) => ({ refetchTrigger: s2.refetchTrigger + 1 })),
|
|
602
602
|
reset: () => set2({
|
|
603
603
|
inputAmount: "",
|
|
@@ -1591,6 +1591,34 @@ async function getDestTokens(srcChainKey, srcTokenAddr) {
|
|
|
1591
1591
|
});
|
|
1592
1592
|
return unique.map(normalizeTokenSymbol);
|
|
1593
1593
|
}
|
|
1594
|
+
function parseBridgeUrlParams(source) {
|
|
1595
|
+
if (source && typeof source === "object") {
|
|
1596
|
+
return source;
|
|
1597
|
+
}
|
|
1598
|
+
const queryString = typeof source === "string" ? source : typeof window !== "undefined" ? window.location.search : "";
|
|
1599
|
+
const searchParams = new URLSearchParams(queryString);
|
|
1600
|
+
return {
|
|
1601
|
+
srcToken: searchParams.get("srcToken") || void 0,
|
|
1602
|
+
srcChain: searchParams.get("srcChain") || void 0,
|
|
1603
|
+
dstChain: searchParams.get("dstChain") || void 0,
|
|
1604
|
+
amount: searchParams.get("amount") || void 0
|
|
1605
|
+
};
|
|
1606
|
+
}
|
|
1607
|
+
function buildQueryString(params) {
|
|
1608
|
+
const searchParams = new URLSearchParams();
|
|
1609
|
+
if (params.srcToken) searchParams.set("srcToken", params.srcToken);
|
|
1610
|
+
if (params.srcChain) searchParams.set("srcChain", params.srcChain);
|
|
1611
|
+
if (params.dstChain) searchParams.set("dstChain", params.dstChain);
|
|
1612
|
+
if (params.amount) searchParams.set("amount", params.amount);
|
|
1613
|
+
const queryString = searchParams.toString();
|
|
1614
|
+
return queryString ? `?${queryString}` : "";
|
|
1615
|
+
}
|
|
1616
|
+
function updateBridgeUrlNative(params) {
|
|
1617
|
+
if (typeof window === "undefined" || !window.history) return;
|
|
1618
|
+
const queryString = buildQueryString(params);
|
|
1619
|
+
const newUrl = `${window.location.pathname}${queryString}${window.location.hash}`;
|
|
1620
|
+
window.history.replaceState(null, "", newUrl);
|
|
1621
|
+
}
|
|
1594
1622
|
function resolveTokenOnChainFromMatrix$1(assetMatrix, assetSymbol, chainKey) {
|
|
1595
1623
|
if (!assetMatrix || !assetSymbol || !chainKey) return void 0;
|
|
1596
1624
|
const byChain = assetMatrix[assetSymbol.toUpperCase()];
|
|
@@ -1620,7 +1648,12 @@ const useChainDerivations = () => {
|
|
|
1620
1648
|
return result;
|
|
1621
1649
|
}, [selectedAssetSymbol, assetMatrix, chains]);
|
|
1622
1650
|
react.useEffect(() => {
|
|
1651
|
+
const urlParams = parseBridgeUrlParams();
|
|
1652
|
+
const hasUrlParams = !!urlParams.srcToken || !!urlParams.srcChain || !!urlParams.dstChain;
|
|
1623
1653
|
setAllowedFromChains(supportedFrom);
|
|
1654
|
+
if (hasUrlParams) {
|
|
1655
|
+
return;
|
|
1656
|
+
}
|
|
1624
1657
|
if (!supportedFrom.length) {
|
|
1625
1658
|
if (fromChain) setFromChain(void 0);
|
|
1626
1659
|
if (toChain) setToChain(void 0);
|
|
@@ -1752,8 +1785,8 @@ function useBalances(chainKey, address) {
|
|
|
1752
1785
|
const map = /* @__PURE__ */ new Map();
|
|
1753
1786
|
const data = query.data;
|
|
1754
1787
|
if (data) {
|
|
1755
|
-
for (const [sum,
|
|
1756
|
-
map.set(normalizeTickerSymbol$1(sum), Number(
|
|
1788
|
+
for (const [sum, v2] of Object.entries(data)) {
|
|
1789
|
+
map.set(normalizeTickerSymbol$1(sum), Number(v2.balance ?? 0));
|
|
1757
1790
|
}
|
|
1758
1791
|
}
|
|
1759
1792
|
return map;
|
|
@@ -2022,59 +2055,6 @@ const SearchIcon = (props) => {
|
|
|
2022
2055
|
}
|
|
2023
2056
|
);
|
|
2024
2057
|
};
|
|
2025
|
-
const StargateIcon = (props) => {
|
|
2026
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2027
|
-
"svg",
|
|
2028
|
-
{
|
|
2029
|
-
width: "16",
|
|
2030
|
-
height: "16",
|
|
2031
|
-
viewBox: "0 0 16 16",
|
|
2032
|
-
fill: "none",
|
|
2033
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2034
|
-
...props,
|
|
2035
|
-
children: [
|
|
2036
|
-
/* @__PURE__ */ jsxRuntime.jsxs("g", { clipPath: "url(#clip0_13294_89003)", children: [
|
|
2037
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2038
|
-
"path",
|
|
2039
|
-
{
|
|
2040
|
-
d: "M9.58707 0.636789L10.0135 1.63492C10.8488 3.59268 12.4067 5.15059 14.3644 5.98584L15.3626 6.41231C15.6232 6.52489 15.8365 6.68184 15.9994 6.87438C15.4988 3.31131 12.6851 0.494623 9.125 0C9.31455 0.1629 9.47449 0.376148 9.58707 0.636789Z",
|
|
2041
|
-
fill: "#999999"
|
|
2042
|
-
}
|
|
2043
|
-
),
|
|
2044
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2045
|
-
"path",
|
|
2046
|
-
{
|
|
2047
|
-
d: "M0.636791 6.41231L1.63492 5.98584C3.59268 5.15059 5.15059 3.59268 5.98876 1.63492L6.41528 0.636789C6.52781 0.376148 6.68775 0.1629 6.8773 0C3.31131 0.494623 0.497584 3.31131 0 6.87139C0.1629 6.68184 0.37615 6.52189 0.636791 6.40937V6.41231Z",
|
|
2048
|
-
fill: "#999999"
|
|
2049
|
-
}
|
|
2050
|
-
),
|
|
2051
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2052
|
-
"path",
|
|
2053
|
-
{
|
|
2054
|
-
d: "M15.3626 9.58017L14.3644 10.0067C12.4067 10.8419 10.8488 12.4028 10.0135 14.3606L9.58707 15.3557C9.47449 15.6164 9.31455 15.8296 9.125 15.9925C12.6851 15.4949 15.4988 12.6812 15.9964 9.12109C15.8335 9.31065 15.6203 9.47059 15.3596 9.58317L15.3626 9.58017Z",
|
|
2055
|
-
fill: "#999999"
|
|
2056
|
-
}
|
|
2057
|
-
),
|
|
2058
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2059
|
-
"path",
|
|
2060
|
-
{
|
|
2061
|
-
d: "M6.4153 15.3587L5.98878 14.3635C5.15355 12.4057 3.59268 10.8478 1.63492 10.0096L0.636789 9.58311C0.37615 9.47059 0.1629 9.31359 0 9.12109C0.497584 12.6812 3.31131 15.4979 6.87139 15.9925C6.68184 15.8296 6.52189 15.6164 6.40937 15.3557L6.4153 15.3587Z",
|
|
2062
|
-
fill: "#999999"
|
|
2063
|
-
}
|
|
2064
|
-
),
|
|
2065
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2066
|
-
"path",
|
|
2067
|
-
{
|
|
2068
|
-
d: "M4.37473 7.21715L4.86639 7.00685C5.83193 6.59514 6.59903 5.82804 7.01074 4.86248L7.22104 4.37082C7.51425 3.68368 8.49163 3.68368 8.78489 4.37082L8.99514 4.86248C9.40685 5.82804 10.1739 6.59514 11.1395 7.00685L11.6312 7.21715C12.3183 7.51036 12.3183 8.4848 11.6312 8.78095L11.1395 8.99125C10.1739 9.40296 9.40685 10.1701 8.99514 11.1356L8.78489 11.6273C8.49163 12.3144 7.51425 12.3144 7.22104 11.6273L7.01074 11.1356C6.59903 10.1701 5.83193 9.40296 4.86639 8.99125L4.37473 8.78095C3.68759 8.48774 3.68759 7.5133 4.37473 7.21715Z",
|
|
2069
|
-
fill: "currentColor"
|
|
2070
|
-
}
|
|
2071
|
-
)
|
|
2072
|
-
] }),
|
|
2073
|
-
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip0_13294_89003", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
2074
|
-
]
|
|
2075
|
-
}
|
|
2076
|
-
);
|
|
2077
|
-
};
|
|
2078
2058
|
const MetaMaskIcon = (props) => {
|
|
2079
2059
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2080
2060
|
"svg",
|
|
@@ -2489,7 +2469,7 @@ function useModal(initial = false) {
|
|
|
2489
2469
|
const [isOpen, setOpen] = react.useState(initial);
|
|
2490
2470
|
const onOpen = react.useCallback(() => setOpen(true), []);
|
|
2491
2471
|
const onClose = react.useCallback(() => setOpen(false), []);
|
|
2492
|
-
const toggle = react.useCallback(() => setOpen((
|
|
2472
|
+
const toggle = react.useCallback(() => setOpen((v2) => !v2), []);
|
|
2493
2473
|
return { isOpen, onOpen, onClose, toggle };
|
|
2494
2474
|
}
|
|
2495
2475
|
const SearchInput = ({
|
|
@@ -2585,9 +2565,9 @@ const ChainSelectModal = ({
|
|
|
2585
2565
|
[chains, assetMatrix]
|
|
2586
2566
|
);
|
|
2587
2567
|
const groupedChains = react.useMemo(() => {
|
|
2588
|
-
const
|
|
2589
|
-
const filtered =
|
|
2590
|
-
(c2) => c2.name.toLowerCase().includes(
|
|
2568
|
+
const q3 = query.trim().toLowerCase();
|
|
2569
|
+
const filtered = q3 ? (items ?? []).filter(
|
|
2570
|
+
(c2) => c2.name.toLowerCase().includes(q3) || c2.chainKey.toLowerCase().includes(q3)
|
|
2591
2571
|
) : items ?? [];
|
|
2592
2572
|
const groups = {
|
|
2593
2573
|
available: [],
|
|
@@ -2963,7 +2943,7 @@ const SwapSection = ({
|
|
|
2963
2943
|
{
|
|
2964
2944
|
value: amount,
|
|
2965
2945
|
onAmountChange: react.useCallback(
|
|
2966
|
-
(
|
|
2946
|
+
(v2) => onAmountChange?.(v2),
|
|
2967
2947
|
[onAmountChange]
|
|
2968
2948
|
),
|
|
2969
2949
|
onAmountBlur,
|
|
@@ -3411,10 +3391,7 @@ const Details = () => {
|
|
|
3411
3391
|
DetailsRow,
|
|
3412
3392
|
{
|
|
3413
3393
|
label: t2("transaction.route"),
|
|
3414
|
-
value: /* @__PURE__ */ jsxRuntime.
|
|
3415
|
-
/* @__PURE__ */ jsxRuntime.jsx(StargateIcon, { className: "w-4 h-4" }),
|
|
3416
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "", children: routeText })
|
|
3417
|
-
] })
|
|
3394
|
+
value: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "", children: routeText }) })
|
|
3418
3395
|
}
|
|
3419
3396
|
),
|
|
3420
3397
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6253,8 +6230,8 @@ class TronChainStrategy {
|
|
|
6253
6230
|
);
|
|
6254
6231
|
}
|
|
6255
6232
|
if (tx?.to && tx?.value && !tx?.data) {
|
|
6256
|
-
const
|
|
6257
|
-
const amountSun = Number(
|
|
6233
|
+
const v2 = BigInt(tx.value.toString());
|
|
6234
|
+
const amountSun = Number(v2);
|
|
6258
6235
|
if (!Number.isFinite(amountSun)) {
|
|
6259
6236
|
throw new InvalidTransactionDataError("tron", "Invalid TRX value");
|
|
6260
6237
|
}
|
|
@@ -6829,9 +6806,9 @@ const TokenSelectModal = ({
|
|
|
6829
6806
|
[assetMatrix, chains]
|
|
6830
6807
|
);
|
|
6831
6808
|
const groupedTokens = react.useMemo(() => {
|
|
6832
|
-
const
|
|
6833
|
-
const filtered =
|
|
6834
|
-
(a2) => a2.name.toLowerCase().includes(
|
|
6809
|
+
const q3 = query.trim().toLowerCase();
|
|
6810
|
+
const filtered = q3 ? items.filter(
|
|
6811
|
+
(a2) => a2.name.toLowerCase().includes(q3) || a2.symbol.toLowerCase().includes(q3)
|
|
6835
6812
|
) : items;
|
|
6836
6813
|
const groups = {
|
|
6837
6814
|
withBalance: [],
|
|
@@ -7630,7 +7607,7 @@ function requireEvents() {
|
|
|
7630
7607
|
return events.exports;
|
|
7631
7608
|
}
|
|
7632
7609
|
var eventsExports = requireEvents();
|
|
7633
|
-
const xe$
|
|
7610
|
+
const xe$3 = /* @__PURE__ */ getDefaultExportFromCjs(eventsExports);
|
|
7634
7611
|
var cjs$3 = {};
|
|
7635
7612
|
/*! *****************************************************************************
|
|
7636
7613
|
Copyright (c) Microsoft Corporation.
|
|
@@ -7732,8 +7709,8 @@ function __generator(thisArg, body) {
|
|
|
7732
7709
|
return this;
|
|
7733
7710
|
}), g2;
|
|
7734
7711
|
function verb(n3) {
|
|
7735
|
-
return function(
|
|
7736
|
-
return step([n3,
|
|
7712
|
+
return function(v2) {
|
|
7713
|
+
return step([n3, v2]);
|
|
7737
7714
|
};
|
|
7738
7715
|
}
|
|
7739
7716
|
function step(op) {
|
|
@@ -7835,35 +7812,35 @@ function __spread() {
|
|
|
7835
7812
|
function __spreadArrays() {
|
|
7836
7813
|
for (var s2 = 0, i3 = 0, il = arguments.length; i3 < il; i3++) s2 += arguments[i3].length;
|
|
7837
7814
|
for (var r2 = Array(s2), k2 = 0, i3 = 0; i3 < il; i3++)
|
|
7838
|
-
for (var a2 = arguments[i3],
|
|
7839
|
-
r2[k2] = a2[
|
|
7815
|
+
for (var a2 = arguments[i3], j2 = 0, jl = a2.length; j2 < jl; j2++, k2++)
|
|
7816
|
+
r2[k2] = a2[j2];
|
|
7840
7817
|
return r2;
|
|
7841
7818
|
}
|
|
7842
|
-
function __await(
|
|
7843
|
-
return this instanceof __await ? (this.v =
|
|
7819
|
+
function __await(v2) {
|
|
7820
|
+
return this instanceof __await ? (this.v = v2, this) : new __await(v2);
|
|
7844
7821
|
}
|
|
7845
7822
|
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
7846
7823
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
7847
|
-
var g2 = generator.apply(thisArg, _arguments || []), i3,
|
|
7824
|
+
var g2 = generator.apply(thisArg, _arguments || []), i3, q3 = [];
|
|
7848
7825
|
return i3 = {}, verb("next"), verb("throw"), verb("return"), i3[Symbol.asyncIterator] = function() {
|
|
7849
7826
|
return this;
|
|
7850
7827
|
}, i3;
|
|
7851
7828
|
function verb(n3) {
|
|
7852
|
-
if (g2[n3]) i3[n3] = function(
|
|
7829
|
+
if (g2[n3]) i3[n3] = function(v2) {
|
|
7853
7830
|
return new Promise(function(a2, b2) {
|
|
7854
|
-
|
|
7831
|
+
q3.push([n3, v2, a2, b2]) > 1 || resume(n3, v2);
|
|
7855
7832
|
});
|
|
7856
7833
|
};
|
|
7857
7834
|
}
|
|
7858
|
-
function resume(n3,
|
|
7835
|
+
function resume(n3, v2) {
|
|
7859
7836
|
try {
|
|
7860
|
-
step(g2[n3](
|
|
7837
|
+
step(g2[n3](v2));
|
|
7861
7838
|
} catch (e2) {
|
|
7862
|
-
settle(
|
|
7839
|
+
settle(q3[0][3], e2);
|
|
7863
7840
|
}
|
|
7864
7841
|
}
|
|
7865
7842
|
function step(r2) {
|
|
7866
|
-
r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(
|
|
7843
|
+
r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q3[0][2], r2);
|
|
7867
7844
|
}
|
|
7868
7845
|
function fulfill(value) {
|
|
7869
7846
|
resume("next", value);
|
|
@@ -7871,8 +7848,8 @@ function __asyncGenerator(thisArg, _arguments, generator) {
|
|
|
7871
7848
|
function reject(value) {
|
|
7872
7849
|
resume("throw", value);
|
|
7873
7850
|
}
|
|
7874
|
-
function settle(f4,
|
|
7875
|
-
if (f4(
|
|
7851
|
+
function settle(f4, v2) {
|
|
7852
|
+
if (f4(v2), q3.shift(), q3.length) resume(q3[0][0], q3[0][1]);
|
|
7876
7853
|
}
|
|
7877
7854
|
}
|
|
7878
7855
|
function __asyncDelegator(o3) {
|
|
@@ -7883,8 +7860,8 @@ function __asyncDelegator(o3) {
|
|
|
7883
7860
|
return this;
|
|
7884
7861
|
}, i3;
|
|
7885
7862
|
function verb(n3, f4) {
|
|
7886
|
-
i3[n3] = o3[n3] ? function(
|
|
7887
|
-
return (p2 = !p2) ? { value: __await(o3[n3](
|
|
7863
|
+
i3[n3] = o3[n3] ? function(v2) {
|
|
7864
|
+
return (p2 = !p2) ? { value: __await(o3[n3](v2)), done: n3 === "return" } : f4 ? f4(v2) : v2;
|
|
7888
7865
|
} : f4;
|
|
7889
7866
|
}
|
|
7890
7867
|
}
|
|
@@ -7895,15 +7872,15 @@ function __asyncValues(o3) {
|
|
|
7895
7872
|
return this;
|
|
7896
7873
|
}, i3);
|
|
7897
7874
|
function verb(n3) {
|
|
7898
|
-
i3[n3] = o3[n3] && function(
|
|
7875
|
+
i3[n3] = o3[n3] && function(v2) {
|
|
7899
7876
|
return new Promise(function(resolve, reject) {
|
|
7900
|
-
|
|
7877
|
+
v2 = o3[n3](v2), settle(resolve, reject, v2.done, v2.value);
|
|
7901
7878
|
});
|
|
7902
7879
|
};
|
|
7903
7880
|
}
|
|
7904
|
-
function settle(resolve, reject, d3,
|
|
7905
|
-
Promise.resolve(
|
|
7906
|
-
resolve({ value:
|
|
7881
|
+
function settle(resolve, reject, d3, v2) {
|
|
7882
|
+
Promise.resolve(v2).then(function(v3) {
|
|
7883
|
+
resolve({ value: v3, done: d3 });
|
|
7907
7884
|
}, reject);
|
|
7908
7885
|
}
|
|
7909
7886
|
}
|
|
@@ -8165,10 +8142,10 @@ let n$1 = class n extends IEvents {
|
|
|
8165
8142
|
super();
|
|
8166
8143
|
}
|
|
8167
8144
|
};
|
|
8168
|
-
const s$
|
|
8169
|
-
let i$
|
|
8145
|
+
const s$1 = cjsExports$3.FIVE_SECONDS, r$1 = { pulse: "heartbeat_pulse" };
|
|
8146
|
+
let i$1 = class i extends n$1 {
|
|
8170
8147
|
constructor(e2) {
|
|
8171
|
-
super(e2), this.events = new eventsExports.EventEmitter(), this.interval = s$
|
|
8148
|
+
super(e2), this.events = new eventsExports.EventEmitter(), this.interval = s$1, this.interval = e2?.interval || s$1;
|
|
8172
8149
|
}
|
|
8173
8150
|
static async init(e2) {
|
|
8174
8151
|
const t2 = new i(e2);
|
|
@@ -8892,7 +8869,7 @@ function safeJsonStringify(value) {
|
|
|
8892
8869
|
return typeof value === "string" ? value : JSONStringify(value) || "";
|
|
8893
8870
|
}
|
|
8894
8871
|
const x$4 = "idb-keyval";
|
|
8895
|
-
var z$
|
|
8872
|
+
var z$3 = (i3 = {}) => {
|
|
8896
8873
|
const t2 = i3.base && i3.base.length > 0 ? `${i3.base}:` : "", e2 = (s2) => t2 + s2;
|
|
8897
8874
|
let n3;
|
|
8898
8875
|
return i3.dbName && i3.storeName && (n3 = createStore(i3.dbName, i3.storeName)), { name: x$4, options: i3, async hasItem(s2) {
|
|
@@ -8909,10 +8886,10 @@ var z$4 = (i3 = {}) => {
|
|
|
8909
8886
|
return clear(n3);
|
|
8910
8887
|
} };
|
|
8911
8888
|
};
|
|
8912
|
-
const D
|
|
8913
|
-
let _$
|
|
8889
|
+
const D = "WALLET_CONNECT_V2_INDEXED_DB", E$3 = "keyvaluestorage";
|
|
8890
|
+
let _$2 = class _ {
|
|
8914
8891
|
constructor() {
|
|
8915
|
-
this.indexedDb = createStorage({ driver: z$
|
|
8892
|
+
this.indexedDb = createStorage({ driver: z$3({ dbName: D, storeName: E$3 }) });
|
|
8916
8893
|
}
|
|
8917
8894
|
async getKeys() {
|
|
8918
8895
|
return this.indexedDb.getKeys();
|
|
@@ -8931,7 +8908,7 @@ let _$3 = class _ {
|
|
|
8931
8908
|
await this.indexedDb.removeItem(t2);
|
|
8932
8909
|
}
|
|
8933
8910
|
};
|
|
8934
|
-
var l$
|
|
8911
|
+
var l$2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, c$4 = { exports: {} };
|
|
8935
8912
|
(function() {
|
|
8936
8913
|
let i3;
|
|
8937
8914
|
function t2() {
|
|
@@ -8951,21 +8928,21 @@ var l$3 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window :
|
|
|
8951
8928
|
return e2 = e2 || 0, Object.keys(this)[e2];
|
|
8952
8929
|
}, i3.prototype.__defineGetter__("length", function() {
|
|
8953
8930
|
return Object.keys(this).length;
|
|
8954
|
-
}), typeof l$
|
|
8931
|
+
}), typeof l$2 < "u" && l$2.localStorage ? c$4.exports = l$2.localStorage : typeof window < "u" && window.localStorage ? c$4.exports = window.localStorage : c$4.exports = new t2();
|
|
8955
8932
|
})();
|
|
8956
|
-
function k$
|
|
8933
|
+
function k$2(i3) {
|
|
8957
8934
|
var t2;
|
|
8958
8935
|
return [i3[0], safeJsonParse((t2 = i3[1]) != null ? t2 : "")];
|
|
8959
8936
|
}
|
|
8960
|
-
let K$
|
|
8937
|
+
let K$5 = class K {
|
|
8961
8938
|
constructor() {
|
|
8962
|
-
this.localStorage = c$
|
|
8939
|
+
this.localStorage = c$4.exports;
|
|
8963
8940
|
}
|
|
8964
8941
|
async getKeys() {
|
|
8965
8942
|
return Object.keys(this.localStorage);
|
|
8966
8943
|
}
|
|
8967
8944
|
async getEntries() {
|
|
8968
|
-
return Object.entries(this.localStorage).map(k$
|
|
8945
|
+
return Object.entries(this.localStorage).map(k$2);
|
|
8969
8946
|
}
|
|
8970
8947
|
async getItem(t2) {
|
|
8971
8948
|
const e2 = this.localStorage.getItem(t2);
|
|
@@ -8978,7 +8955,7 @@ let K$4 = class K {
|
|
|
8978
8955
|
this.localStorage.removeItem(t2);
|
|
8979
8956
|
}
|
|
8980
8957
|
};
|
|
8981
|
-
const N$5 = "wc_storage_version", y$4 = 1, O$
|
|
8958
|
+
const N$5 = "wc_storage_version", y$4 = 1, O$2 = async (i3, t2, e2) => {
|
|
8982
8959
|
const n3 = N$5, s2 = await t2.getItem(n3);
|
|
8983
8960
|
if (s2 && s2 >= y$4) {
|
|
8984
8961
|
e2(t2);
|
|
@@ -9005,16 +8982,16 @@ const N$5 = "wc_storage_version", y$4 = 1, O$3 = async (i3, t2, e2) => {
|
|
|
9005
8982
|
await i3.removeItem(e2);
|
|
9006
8983
|
});
|
|
9007
8984
|
};
|
|
9008
|
-
let h$
|
|
8985
|
+
let h$3 = class h {
|
|
9009
8986
|
constructor() {
|
|
9010
8987
|
this.initialized = false, this.setInitialized = (e2) => {
|
|
9011
8988
|
this.storage = e2, this.initialized = true;
|
|
9012
8989
|
};
|
|
9013
|
-
const t2 = new K$
|
|
8990
|
+
const t2 = new K$5();
|
|
9014
8991
|
this.storage = t2;
|
|
9015
8992
|
try {
|
|
9016
|
-
const e2 = new _$
|
|
9017
|
-
O$
|
|
8993
|
+
const e2 = new _$2();
|
|
8994
|
+
O$2(t2, e2, this.setInitialized);
|
|
9018
8995
|
} catch {
|
|
9019
8996
|
this.initialized = true;
|
|
9020
8997
|
}
|
|
@@ -9042,566 +9019,271 @@ let h$4 = class h {
|
|
|
9042
9019
|
});
|
|
9043
9020
|
}
|
|
9044
9021
|
};
|
|
9045
|
-
var
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
var
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
case 102:
|
|
9088
|
-
if (a2 >= argLen)
|
|
9089
|
-
break;
|
|
9090
|
-
if (args[a2] == null) break;
|
|
9091
|
-
if (lastPos < i3)
|
|
9092
|
-
str += f4.slice(lastPos, i3);
|
|
9093
|
-
str += Number(args[a2]);
|
|
9094
|
-
lastPos = i3 + 2;
|
|
9095
|
-
i3++;
|
|
9096
|
-
break;
|
|
9097
|
-
case 105:
|
|
9098
|
-
if (a2 >= argLen)
|
|
9099
|
-
break;
|
|
9100
|
-
if (args[a2] == null) break;
|
|
9101
|
-
if (lastPos < i3)
|
|
9102
|
-
str += f4.slice(lastPos, i3);
|
|
9103
|
-
str += Math.floor(Number(args[a2]));
|
|
9104
|
-
lastPos = i3 + 2;
|
|
9105
|
-
i3++;
|
|
9106
|
-
break;
|
|
9107
|
-
case 79:
|
|
9108
|
-
// 'O'
|
|
9109
|
-
case 111:
|
|
9110
|
-
// 'o'
|
|
9111
|
-
case 106:
|
|
9112
|
-
if (a2 >= argLen)
|
|
9113
|
-
break;
|
|
9114
|
-
if (args[a2] === void 0) break;
|
|
9115
|
-
if (lastPos < i3)
|
|
9116
|
-
str += f4.slice(lastPos, i3);
|
|
9117
|
-
var type = typeof args[a2];
|
|
9118
|
-
if (type === "string") {
|
|
9119
|
-
str += "'" + args[a2] + "'";
|
|
9120
|
-
lastPos = i3 + 2;
|
|
9121
|
-
i3++;
|
|
9122
|
-
break;
|
|
9123
|
-
}
|
|
9124
|
-
if (type === "function") {
|
|
9125
|
-
str += args[a2].name || "<anonymous>";
|
|
9126
|
-
lastPos = i3 + 2;
|
|
9127
|
-
i3++;
|
|
9128
|
-
break;
|
|
9129
|
-
}
|
|
9130
|
-
str += ss2(args[a2]);
|
|
9131
|
-
lastPos = i3 + 2;
|
|
9132
|
-
i3++;
|
|
9133
|
-
break;
|
|
9134
|
-
case 115:
|
|
9135
|
-
if (a2 >= argLen)
|
|
9136
|
-
break;
|
|
9137
|
-
if (lastPos < i3)
|
|
9138
|
-
str += f4.slice(lastPos, i3);
|
|
9139
|
-
str += String(args[a2]);
|
|
9140
|
-
lastPos = i3 + 2;
|
|
9141
|
-
i3++;
|
|
9022
|
+
var b$4 = { exports: {} };
|
|
9023
|
+
function se$3(e2) {
|
|
9024
|
+
try {
|
|
9025
|
+
return JSON.stringify(e2);
|
|
9026
|
+
} catch {
|
|
9027
|
+
return '"[Circular]"';
|
|
9028
|
+
}
|
|
9029
|
+
}
|
|
9030
|
+
var ie$2 = oe$3;
|
|
9031
|
+
function oe$3(e2, t2, r2) {
|
|
9032
|
+
var s2 = r2 && r2.stringify || se$3, i3 = 1;
|
|
9033
|
+
if (typeof e2 == "object" && e2 !== null) {
|
|
9034
|
+
var h4 = t2.length + i3;
|
|
9035
|
+
if (h4 === 1) return e2;
|
|
9036
|
+
var f4 = new Array(h4);
|
|
9037
|
+
f4[0] = s2(e2);
|
|
9038
|
+
for (var u2 = 1; u2 < h4; u2++) f4[u2] = s2(t2[u2]);
|
|
9039
|
+
return f4.join(" ");
|
|
9040
|
+
}
|
|
9041
|
+
if (typeof e2 != "string") return e2;
|
|
9042
|
+
var c2 = t2.length;
|
|
9043
|
+
if (c2 === 0) return e2;
|
|
9044
|
+
for (var n3 = "", o3 = 1 - i3, l2 = -1, p2 = e2 && e2.length || 0, a2 = 0; a2 < p2; ) {
|
|
9045
|
+
if (e2.charCodeAt(a2) === 37 && a2 + 1 < p2) {
|
|
9046
|
+
switch (l2 = l2 > -1 ? l2 : 0, e2.charCodeAt(a2 + 1)) {
|
|
9047
|
+
case 100:
|
|
9048
|
+
case 102:
|
|
9049
|
+
if (o3 >= c2 || t2[o3] == null) break;
|
|
9050
|
+
l2 < a2 && (n3 += e2.slice(l2, a2)), n3 += Number(t2[o3]), l2 = a2 + 2, a2++;
|
|
9051
|
+
break;
|
|
9052
|
+
case 105:
|
|
9053
|
+
if (o3 >= c2 || t2[o3] == null) break;
|
|
9054
|
+
l2 < a2 && (n3 += e2.slice(l2, a2)), n3 += Math.floor(Number(t2[o3])), l2 = a2 + 2, a2++;
|
|
9055
|
+
break;
|
|
9056
|
+
case 79:
|
|
9057
|
+
case 111:
|
|
9058
|
+
case 106:
|
|
9059
|
+
if (o3 >= c2 || t2[o3] === void 0) break;
|
|
9060
|
+
l2 < a2 && (n3 += e2.slice(l2, a2));
|
|
9061
|
+
var O3 = typeof t2[o3];
|
|
9062
|
+
if (O3 === "string") {
|
|
9063
|
+
n3 += "'" + t2[o3] + "'", l2 = a2 + 2, a2++;
|
|
9142
9064
|
break;
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
str += "%";
|
|
9147
|
-
lastPos = i3 + 2;
|
|
9148
|
-
i3++;
|
|
9149
|
-
a2--;
|
|
9065
|
+
}
|
|
9066
|
+
if (O3 === "function") {
|
|
9067
|
+
n3 += t2[o3].name || "<anonymous>", l2 = a2 + 2, a2++;
|
|
9150
9068
|
break;
|
|
9151
|
-
|
|
9152
|
-
|
|
9069
|
+
}
|
|
9070
|
+
n3 += s2(t2[o3]), l2 = a2 + 2, a2++;
|
|
9071
|
+
break;
|
|
9072
|
+
case 115:
|
|
9073
|
+
if (o3 >= c2) break;
|
|
9074
|
+
l2 < a2 && (n3 += e2.slice(l2, a2)), n3 += String(t2[o3]), l2 = a2 + 2, a2++;
|
|
9075
|
+
break;
|
|
9076
|
+
case 37:
|
|
9077
|
+
l2 < a2 && (n3 += e2.slice(l2, a2)), n3 += "%", l2 = a2 + 2, a2++, o3--;
|
|
9078
|
+
break;
|
|
9153
9079
|
}
|
|
9154
|
-
++
|
|
9080
|
+
++o3;
|
|
9155
9081
|
}
|
|
9156
|
-
|
|
9157
|
-
return f4;
|
|
9158
|
-
else if (lastPos < flen) {
|
|
9159
|
-
str += f4.slice(lastPos);
|
|
9160
|
-
}
|
|
9161
|
-
return str;
|
|
9162
|
-
}
|
|
9163
|
-
return quickFormatUnescaped;
|
|
9164
|
-
}
|
|
9165
|
-
var hasRequiredBrowser;
|
|
9166
|
-
function requireBrowser() {
|
|
9167
|
-
if (hasRequiredBrowser) return browser.exports;
|
|
9168
|
-
hasRequiredBrowser = 1;
|
|
9169
|
-
const format = requireQuickFormatUnescaped();
|
|
9170
|
-
browser.exports = pino;
|
|
9171
|
-
const _console = pfGlobalThisOrFallback().console || {};
|
|
9172
|
-
const stdSerializers = {
|
|
9173
|
-
mapHttpRequest: mock,
|
|
9174
|
-
mapHttpResponse: mock,
|
|
9175
|
-
wrapRequestSerializer: passthrough,
|
|
9176
|
-
wrapResponseSerializer: passthrough,
|
|
9177
|
-
wrapErrorSerializer: passthrough,
|
|
9178
|
-
req: mock,
|
|
9179
|
-
res: mock,
|
|
9180
|
-
err: asErrValue,
|
|
9181
|
-
errWithCause: asErrValue
|
|
9182
|
-
};
|
|
9183
|
-
function levelToValue(level, logger) {
|
|
9184
|
-
return level === "silent" ? Infinity : logger.levels.values[level];
|
|
9185
|
-
}
|
|
9186
|
-
const baseLogFunctionSymbol = Symbol("pino.logFuncs");
|
|
9187
|
-
const hierarchySymbol = Symbol("pino.hierarchy");
|
|
9188
|
-
const logFallbackMap = {
|
|
9189
|
-
error: "log",
|
|
9190
|
-
fatal: "error",
|
|
9191
|
-
warn: "error",
|
|
9192
|
-
info: "log",
|
|
9193
|
-
debug: "log",
|
|
9194
|
-
trace: "log"
|
|
9195
|
-
};
|
|
9196
|
-
function appendChildLogger(parentLogger, childLogger) {
|
|
9197
|
-
const newEntry = {
|
|
9198
|
-
logger: childLogger,
|
|
9199
|
-
parent: parentLogger[hierarchySymbol]
|
|
9200
|
-
};
|
|
9201
|
-
childLogger[hierarchySymbol] = newEntry;
|
|
9082
|
+
++a2;
|
|
9202
9083
|
}
|
|
9203
|
-
|
|
9204
|
-
|
|
9205
|
-
|
|
9206
|
-
|
|
9084
|
+
return l2 === -1 ? e2 : (l2 < p2 && (n3 += e2.slice(l2)), n3);
|
|
9085
|
+
}
|
|
9086
|
+
const G$3 = ie$2;
|
|
9087
|
+
b$4.exports = v$5;
|
|
9088
|
+
const j$4 = we$4().console || {}, le$2 = { mapHttpRequest: C$3, mapHttpResponse: C$3, wrapRequestSerializer: $$1, wrapResponseSerializer: $$1, wrapErrorSerializer: $$1, req: C$3, res: C$3, err: U$2, errWithCause: U$2 };
|
|
9089
|
+
function m$2(e2, t2) {
|
|
9090
|
+
return e2 === "silent" ? 1 / 0 : t2.levels.values[e2];
|
|
9091
|
+
}
|
|
9092
|
+
const A$2 = Symbol("pino.logFuncs"), P$4 = Symbol("pino.hierarchy"), ae$2 = { error: "log", fatal: "error", warn: "error", info: "log", debug: "log", trace: "log" };
|
|
9093
|
+
function R$2(e2, t2) {
|
|
9094
|
+
const r2 = { logger: t2, parent: e2[P$4] };
|
|
9095
|
+
t2[P$4] = r2;
|
|
9096
|
+
}
|
|
9097
|
+
function ue$2(e2, t2, r2) {
|
|
9098
|
+
const s2 = {};
|
|
9099
|
+
t2.forEach((i3) => {
|
|
9100
|
+
s2[i3] = r2[i3] ? r2[i3] : j$4[i3] || j$4[ae$2[i3] || "log"] || w$3;
|
|
9101
|
+
}), e2[A$2] = s2;
|
|
9102
|
+
}
|
|
9103
|
+
function ce$2(e2, t2) {
|
|
9104
|
+
return Array.isArray(e2) ? e2.filter(function(s2) {
|
|
9105
|
+
return s2 !== "!stdSerializers.err";
|
|
9106
|
+
}) : e2 === true ? Object.keys(t2) : false;
|
|
9107
|
+
}
|
|
9108
|
+
function v$5(e2) {
|
|
9109
|
+
e2 = e2 || {}, e2.browser = e2.browser || {};
|
|
9110
|
+
const t2 = e2.browser.transmit;
|
|
9111
|
+
if (t2 && typeof t2.send != "function") throw Error("pino: transmit option must have a send function");
|
|
9112
|
+
const r2 = e2.browser.write || j$4;
|
|
9113
|
+
e2.browser.write && (e2.browser.asObject = true);
|
|
9114
|
+
const s2 = e2.serializers || {}, i3 = ce$2(e2.browser.serialize, s2);
|
|
9115
|
+
let h4 = e2.browser.serialize;
|
|
9116
|
+
Array.isArray(e2.browser.serialize) && e2.browser.serialize.indexOf("!stdSerializers.err") > -1 && (h4 = false);
|
|
9117
|
+
const f4 = Object.keys(e2.customLevels || {}), u2 = ["error", "fatal", "warn", "info", "debug", "trace"].concat(f4);
|
|
9118
|
+
typeof r2 == "function" && u2.forEach(function(g2) {
|
|
9119
|
+
r2[g2] = r2;
|
|
9120
|
+
}), (e2.enabled === false || e2.browser.disabled) && (e2.level = "silent");
|
|
9121
|
+
const c2 = e2.level || "info", n3 = Object.create(r2);
|
|
9122
|
+
n3.log || (n3.log = w$3), ue$2(n3, u2, r2), R$2({}, n3), Object.defineProperty(n3, "levelVal", { get: l2 }), Object.defineProperty(n3, "level", { get: p2, set: a2 });
|
|
9123
|
+
const o3 = { transmit: t2, serialize: i3, asObject: e2.browser.asObject, asObjectBindingsOnly: e2.browser.asObjectBindingsOnly, formatters: e2.browser.formatters, levels: u2, timestamp: ye$4(e2), messageKey: e2.messageKey || "msg", onChild: e2.onChild || w$3 };
|
|
9124
|
+
n3.levels = he$4(e2), n3.level = c2, n3.isLevelEnabled = function(g2) {
|
|
9125
|
+
return this.levels.values[g2] ? this.levels.values[g2] >= this.levels.values[this.level] : false;
|
|
9126
|
+
}, n3.setMaxListeners = n3.getMaxListeners = n3.emit = n3.addListener = n3.on = n3.prependListener = n3.once = n3.prependOnceListener = n3.removeListener = n3.removeAllListeners = n3.listeners = n3.listenerCount = n3.eventNames = n3.write = n3.flush = w$3, n3.serializers = s2, n3._serialize = i3, n3._stdErrSerialize = h4, n3.child = function(...g2) {
|
|
9127
|
+
return O3.call(this, o3, ...g2);
|
|
9128
|
+
}, t2 && (n3._logEvent = N$4());
|
|
9129
|
+
function l2() {
|
|
9130
|
+
return m$2(this.level, this);
|
|
9131
|
+
}
|
|
9132
|
+
function p2() {
|
|
9133
|
+
return this._level;
|
|
9134
|
+
}
|
|
9135
|
+
function a2(g2) {
|
|
9136
|
+
if (g2 !== "silent" && !this.levels.values[g2]) throw Error("unknown level " + g2);
|
|
9137
|
+
this._level = g2, L$2(this, o3, n3, "error"), L$2(this, o3, n3, "fatal"), L$2(this, o3, n3, "warn"), L$2(this, o3, n3, "info"), L$2(this, o3, n3, "debug"), L$2(this, o3, n3, "trace"), f4.forEach((d3) => {
|
|
9138
|
+
L$2(this, o3, n3, d3);
|
|
9207
9139
|
});
|
|
9208
|
-
logger[baseLogFunctionSymbol] = logFunctions;
|
|
9209
9140
|
}
|
|
9210
|
-
function
|
|
9211
|
-
if (
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
|
|
9216
|
-
|
|
9217
|
-
return Object.keys(serializers);
|
|
9141
|
+
function O3(g2, d3, z2) {
|
|
9142
|
+
if (!d3) throw new Error("missing bindings for child Pino");
|
|
9143
|
+
z2 = z2 || {}, i3 && d3.serializers && (z2.serializers = d3.serializers);
|
|
9144
|
+
const F2 = z2.serializers;
|
|
9145
|
+
if (i3 && F2) {
|
|
9146
|
+
var E2 = Object.assign({}, s2, F2), M3 = e2.browser.serialize === true ? Object.keys(E2) : i3;
|
|
9147
|
+
delete d3.serializers, V$2([d3], M3, E2, this._stdErrSerialize);
|
|
9218
9148
|
}
|
|
9219
|
-
|
|
9220
|
-
|
|
9221
|
-
function pino(opts) {
|
|
9222
|
-
opts = opts || {};
|
|
9223
|
-
opts.browser = opts.browser || {};
|
|
9224
|
-
const transmit2 = opts.browser.transmit;
|
|
9225
|
-
if (transmit2 && typeof transmit2.send !== "function") {
|
|
9226
|
-
throw Error("pino: transmit option must have a send function");
|
|
9227
|
-
}
|
|
9228
|
-
const proto = opts.browser.write || _console;
|
|
9229
|
-
if (opts.browser.write) opts.browser.asObject = true;
|
|
9230
|
-
const serializers = opts.serializers || {};
|
|
9231
|
-
const serialize = shouldSerialize(opts.browser.serialize, serializers);
|
|
9232
|
-
let stdErrSerialize = opts.browser.serialize;
|
|
9233
|
-
if (Array.isArray(opts.browser.serialize) && opts.browser.serialize.indexOf("!stdSerializers.err") > -1) stdErrSerialize = false;
|
|
9234
|
-
const customLevels = Object.keys(opts.customLevels || {});
|
|
9235
|
-
const levels = ["error", "fatal", "warn", "info", "debug", "trace"].concat(customLevels);
|
|
9236
|
-
if (typeof proto === "function") {
|
|
9237
|
-
levels.forEach(function(level2) {
|
|
9238
|
-
proto[level2] = proto;
|
|
9239
|
-
});
|
|
9149
|
+
function D2(k2) {
|
|
9150
|
+
this._childLevel = (k2._childLevel | 0) + 1, this.bindings = d3, E2 && (this.serializers = E2, this._serialize = M3), t2 && (this._logEvent = N$4([].concat(k2._logEvent.bindings, d3)));
|
|
9240
9151
|
}
|
|
9241
|
-
|
|
9242
|
-
const
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
appendChildLogger({}, logger);
|
|
9247
|
-
Object.defineProperty(logger, "levelVal", {
|
|
9248
|
-
get: getLevelVal
|
|
9249
|
-
});
|
|
9250
|
-
Object.defineProperty(logger, "level", {
|
|
9251
|
-
get: getLevel,
|
|
9252
|
-
set: setLevel
|
|
9253
|
-
});
|
|
9254
|
-
const setOpts = {
|
|
9255
|
-
transmit: transmit2,
|
|
9256
|
-
serialize,
|
|
9257
|
-
asObject: opts.browser.asObject,
|
|
9258
|
-
asObjectBindingsOnly: opts.browser.asObjectBindingsOnly,
|
|
9259
|
-
formatters: opts.browser.formatters,
|
|
9260
|
-
levels,
|
|
9261
|
-
timestamp: getTimeFunction(opts),
|
|
9262
|
-
messageKey: opts.messageKey || "msg",
|
|
9263
|
-
onChild: opts.onChild || noop
|
|
9264
|
-
};
|
|
9265
|
-
logger.levels = getLevels(opts);
|
|
9266
|
-
logger.level = level;
|
|
9267
|
-
logger.isLevelEnabled = function(level2) {
|
|
9268
|
-
if (!this.levels.values[level2]) {
|
|
9269
|
-
return false;
|
|
9270
|
-
}
|
|
9271
|
-
return this.levels.values[level2] >= this.levels.values[this.level];
|
|
9272
|
-
};
|
|
9273
|
-
logger.setMaxListeners = logger.getMaxListeners = logger.emit = logger.addListener = logger.on = logger.prependListener = logger.once = logger.prependOnceListener = logger.removeListener = logger.removeAllListeners = logger.listeners = logger.listenerCount = logger.eventNames = logger.write = logger.flush = noop;
|
|
9274
|
-
logger.serializers = serializers;
|
|
9275
|
-
logger._serialize = serialize;
|
|
9276
|
-
logger._stdErrSerialize = stdErrSerialize;
|
|
9277
|
-
logger.child = function(...args) {
|
|
9278
|
-
return child.call(this, setOpts, ...args);
|
|
9279
|
-
};
|
|
9280
|
-
if (transmit2) logger._logEvent = createLogEventShape();
|
|
9281
|
-
function getLevelVal() {
|
|
9282
|
-
return levelToValue(this.level, this);
|
|
9283
|
-
}
|
|
9284
|
-
function getLevel() {
|
|
9285
|
-
return this._level;
|
|
9286
|
-
}
|
|
9287
|
-
function setLevel(level2) {
|
|
9288
|
-
if (level2 !== "silent" && !this.levels.values[level2]) {
|
|
9289
|
-
throw Error("unknown level " + level2);
|
|
9290
|
-
}
|
|
9291
|
-
this._level = level2;
|
|
9292
|
-
set2(this, setOpts, logger, "error");
|
|
9293
|
-
set2(this, setOpts, logger, "fatal");
|
|
9294
|
-
set2(this, setOpts, logger, "warn");
|
|
9295
|
-
set2(this, setOpts, logger, "info");
|
|
9296
|
-
set2(this, setOpts, logger, "debug");
|
|
9297
|
-
set2(this, setOpts, logger, "trace");
|
|
9298
|
-
customLevels.forEach((level3) => {
|
|
9299
|
-
set2(this, setOpts, logger, level3);
|
|
9300
|
-
});
|
|
9301
|
-
}
|
|
9302
|
-
function child(setOpts2, bindings, childOptions) {
|
|
9303
|
-
if (!bindings) {
|
|
9304
|
-
throw new Error("missing bindings for child Pino");
|
|
9305
|
-
}
|
|
9306
|
-
childOptions = childOptions || {};
|
|
9307
|
-
if (serialize && bindings.serializers) {
|
|
9308
|
-
childOptions.serializers = bindings.serializers;
|
|
9309
|
-
}
|
|
9310
|
-
const childOptionsSerializers = childOptions.serializers;
|
|
9311
|
-
if (serialize && childOptionsSerializers) {
|
|
9312
|
-
var childSerializers = Object.assign({}, serializers, childOptionsSerializers);
|
|
9313
|
-
var childSerialize = opts.browser.serialize === true ? Object.keys(childSerializers) : serialize;
|
|
9314
|
-
delete bindings.serializers;
|
|
9315
|
-
applySerializers([bindings], childSerialize, childSerializers, this._stdErrSerialize);
|
|
9316
|
-
}
|
|
9317
|
-
function Child(parent) {
|
|
9318
|
-
this._childLevel = (parent._childLevel | 0) + 1;
|
|
9319
|
-
this.bindings = bindings;
|
|
9320
|
-
if (childSerializers) {
|
|
9321
|
-
this.serializers = childSerializers;
|
|
9322
|
-
this._serialize = childSerialize;
|
|
9323
|
-
}
|
|
9324
|
-
if (transmit2) {
|
|
9325
|
-
this._logEvent = createLogEventShape(
|
|
9326
|
-
[].concat(parent._logEvent.bindings, bindings)
|
|
9327
|
-
);
|
|
9328
|
-
}
|
|
9329
|
-
}
|
|
9330
|
-
Child.prototype = this;
|
|
9331
|
-
const newLogger = new Child(this);
|
|
9332
|
-
appendChildLogger(this, newLogger);
|
|
9333
|
-
newLogger.child = function(...args) {
|
|
9334
|
-
return child.call(this, setOpts2, ...args);
|
|
9335
|
-
};
|
|
9336
|
-
newLogger.level = childOptions.level || this.level;
|
|
9337
|
-
setOpts2.onChild(newLogger);
|
|
9338
|
-
return newLogger;
|
|
9339
|
-
}
|
|
9340
|
-
return logger;
|
|
9152
|
+
D2.prototype = this;
|
|
9153
|
+
const _3 = new D2(this);
|
|
9154
|
+
return R$2(this, _3), _3.child = function(...k2) {
|
|
9155
|
+
return O3.call(this, g2, ...k2);
|
|
9156
|
+
}, _3.level = z2.level || this.level, g2.onChild(_3), _3;
|
|
9341
9157
|
}
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
|
|
9351
|
-
|
|
9352
|
-
|
|
9353
|
-
|
|
9354
|
-
|
|
9355
|
-
|
|
9356
|
-
|
|
9357
|
-
|
|
9358
|
-
|
|
9359
|
-
|
|
9360
|
-
|
|
9361
|
-
|
|
9362
|
-
|
|
9363
|
-
|
|
9364
|
-
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
|
|
9373
|
-
|
|
9374
|
-
|
|
9158
|
+
return n3;
|
|
9159
|
+
}
|
|
9160
|
+
function he$4(e2) {
|
|
9161
|
+
const t2 = e2.customLevels || {}, r2 = Object.assign({}, v$5.levels.values, t2), s2 = Object.assign({}, v$5.levels.labels, fe$3(t2));
|
|
9162
|
+
return { values: r2, labels: s2 };
|
|
9163
|
+
}
|
|
9164
|
+
function fe$3(e2) {
|
|
9165
|
+
const t2 = {};
|
|
9166
|
+
return Object.keys(e2).forEach(function(r2) {
|
|
9167
|
+
t2[e2[r2]] = r2;
|
|
9168
|
+
}), t2;
|
|
9169
|
+
}
|
|
9170
|
+
v$5.levels = { values: { fatal: 60, error: 50, warn: 40, info: 30, debug: 20, trace: 10 }, labels: { 10: "trace", 20: "debug", 30: "info", 40: "warn", 50: "error", 60: "fatal" } }, v$5.stdSerializers = le$2, v$5.stdTimeFunctions = Object.assign({}, { nullTime: X$2, epochTime: Y$1, unixTime: pe$3, isoTime: Le$4 });
|
|
9171
|
+
function ge$4(e2) {
|
|
9172
|
+
const t2 = [];
|
|
9173
|
+
e2.bindings && t2.push(e2.bindings);
|
|
9174
|
+
let r2 = e2[P$4];
|
|
9175
|
+
for (; r2.parent; ) r2 = r2.parent, r2.logger.bindings && t2.push(r2.logger.bindings);
|
|
9176
|
+
return t2.reverse();
|
|
9177
|
+
}
|
|
9178
|
+
function L$2(e2, t2, r2, s2) {
|
|
9179
|
+
if (Object.defineProperty(e2, s2, { value: m$2(e2.level, r2) > m$2(s2, r2) ? w$3 : r2[A$2][s2], writable: true, enumerable: true, configurable: true }), e2[s2] === w$3) {
|
|
9180
|
+
if (!t2.transmit) return;
|
|
9181
|
+
const h4 = t2.transmit.level || e2.level, f4 = m$2(h4, r2);
|
|
9182
|
+
if (m$2(s2, r2) < f4) return;
|
|
9183
|
+
}
|
|
9184
|
+
e2[s2] = de$3(e2, t2, r2, s2);
|
|
9185
|
+
const i3 = ge$4(e2);
|
|
9186
|
+
i3.length !== 0 && (e2[s2] = be$4(i3, e2[s2]));
|
|
9187
|
+
}
|
|
9188
|
+
function be$4(e2, t2) {
|
|
9189
|
+
return function() {
|
|
9190
|
+
return t2.apply(this, [...e2, ...arguments]);
|
|
9375
9191
|
};
|
|
9376
|
-
|
|
9377
|
-
|
|
9378
|
-
|
|
9379
|
-
const bindings = [];
|
|
9380
|
-
if (logger.bindings) {
|
|
9381
|
-
bindings.push(logger.bindings);
|
|
9382
|
-
}
|
|
9383
|
-
let hierarchy = logger[hierarchySymbol];
|
|
9384
|
-
while (hierarchy.parent) {
|
|
9385
|
-
hierarchy = hierarchy.parent;
|
|
9386
|
-
if (hierarchy.logger.bindings) {
|
|
9387
|
-
bindings.push(hierarchy.logger.bindings);
|
|
9388
|
-
}
|
|
9389
|
-
}
|
|
9390
|
-
return bindings.reverse();
|
|
9391
|
-
}
|
|
9392
|
-
function set2(self2, opts, rootLogger, level) {
|
|
9393
|
-
Object.defineProperty(self2, level, {
|
|
9394
|
-
value: levelToValue(self2.level, rootLogger) > levelToValue(level, rootLogger) ? noop : rootLogger[baseLogFunctionSymbol][level],
|
|
9395
|
-
writable: true,
|
|
9396
|
-
enumerable: true,
|
|
9397
|
-
configurable: true
|
|
9398
|
-
});
|
|
9399
|
-
if (self2[level] === noop) {
|
|
9400
|
-
if (!opts.transmit) return;
|
|
9401
|
-
const transmitLevel = opts.transmit.level || self2.level;
|
|
9402
|
-
const transmitValue = levelToValue(transmitLevel, rootLogger);
|
|
9403
|
-
const methodValue = levelToValue(level, rootLogger);
|
|
9404
|
-
if (methodValue < transmitValue) return;
|
|
9405
|
-
}
|
|
9406
|
-
self2[level] = createWrap(self2, opts, rootLogger, level);
|
|
9407
|
-
const bindings = getBindingChain(self2);
|
|
9408
|
-
if (bindings.length === 0) {
|
|
9409
|
-
return;
|
|
9410
|
-
}
|
|
9411
|
-
self2[level] = prependBindingsInArguments(bindings, self2[level]);
|
|
9412
|
-
}
|
|
9413
|
-
function prependBindingsInArguments(bindings, logFunc) {
|
|
9192
|
+
}
|
|
9193
|
+
function de$3(e2, t2, r2, s2) {
|
|
9194
|
+
return /* @__PURE__ */ (function(i3) {
|
|
9414
9195
|
return function() {
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
const args = new Array(arguments.length);
|
|
9423
|
-
const proto = Object.getPrototypeOf && Object.getPrototypeOf(this) === _console ? _console : this;
|
|
9424
|
-
for (var i3 = 0; i3 < args.length; i3++) args[i3] = arguments[i3];
|
|
9425
|
-
var argsIsSerialized = false;
|
|
9426
|
-
if (opts.serialize) {
|
|
9427
|
-
applySerializers(args, this._serialize, this.serializers, this._stdErrSerialize);
|
|
9428
|
-
argsIsSerialized = true;
|
|
9429
|
-
}
|
|
9430
|
-
if (opts.asObject || opts.formatters) {
|
|
9431
|
-
write.call(proto, ...asObject(this, level, args, ts2, opts));
|
|
9432
|
-
} else write.apply(proto, args);
|
|
9433
|
-
if (opts.transmit) {
|
|
9434
|
-
const transmitLevel = opts.transmit.level || self2._level;
|
|
9435
|
-
const transmitValue = levelToValue(transmitLevel, rootLogger);
|
|
9436
|
-
const methodValue = levelToValue(level, rootLogger);
|
|
9437
|
-
if (methodValue < transmitValue) return;
|
|
9438
|
-
transmit(this, {
|
|
9439
|
-
ts: ts2,
|
|
9440
|
-
methodLevel: level,
|
|
9441
|
-
methodValue,
|
|
9442
|
-
transmitValue: rootLogger.levels.values[opts.transmit.level || self2._level],
|
|
9443
|
-
send: opts.transmit.send,
|
|
9444
|
-
val: levelToValue(self2._level, rootLogger)
|
|
9445
|
-
}, args, argsIsSerialized);
|
|
9446
|
-
}
|
|
9447
|
-
};
|
|
9448
|
-
})(self2[baseLogFunctionSymbol][level]);
|
|
9449
|
-
}
|
|
9450
|
-
function asObject(logger, level, args, ts2, opts) {
|
|
9451
|
-
const {
|
|
9452
|
-
level: levelFormatter,
|
|
9453
|
-
log: logObjectFormatter = (obj) => obj
|
|
9454
|
-
} = opts.formatters || {};
|
|
9455
|
-
const argsCloned = args.slice();
|
|
9456
|
-
let msg = argsCloned[0];
|
|
9457
|
-
const logObject = {};
|
|
9458
|
-
let lvl = (logger._childLevel | 0) + 1;
|
|
9459
|
-
if (lvl < 1) lvl = 1;
|
|
9460
|
-
if (ts2) {
|
|
9461
|
-
logObject.time = ts2;
|
|
9462
|
-
}
|
|
9463
|
-
if (levelFormatter) {
|
|
9464
|
-
const formattedLevel = levelFormatter(level, logger.levels.values[level]);
|
|
9465
|
-
Object.assign(logObject, formattedLevel);
|
|
9466
|
-
} else {
|
|
9467
|
-
logObject.level = logger.levels.values[level];
|
|
9468
|
-
}
|
|
9469
|
-
if (opts.asObjectBindingsOnly) {
|
|
9470
|
-
if (msg !== null && typeof msg === "object") {
|
|
9471
|
-
while (lvl-- && typeof argsCloned[0] === "object") {
|
|
9472
|
-
Object.assign(logObject, argsCloned.shift());
|
|
9473
|
-
}
|
|
9474
|
-
}
|
|
9475
|
-
const formattedLogObject = logObjectFormatter(logObject);
|
|
9476
|
-
return [formattedLogObject, ...argsCloned];
|
|
9477
|
-
} else {
|
|
9478
|
-
if (msg !== null && typeof msg === "object") {
|
|
9479
|
-
while (lvl-- && typeof argsCloned[0] === "object") {
|
|
9480
|
-
Object.assign(logObject, argsCloned.shift());
|
|
9481
|
-
}
|
|
9482
|
-
msg = argsCloned.length ? format(argsCloned.shift(), argsCloned) : void 0;
|
|
9483
|
-
} else if (typeof msg === "string") msg = format(argsCloned.shift(), argsCloned);
|
|
9484
|
-
if (msg !== void 0) logObject[opts.messageKey] = msg;
|
|
9485
|
-
const formattedLogObject = logObjectFormatter(logObject);
|
|
9486
|
-
return [formattedLogObject];
|
|
9487
|
-
}
|
|
9488
|
-
}
|
|
9489
|
-
function applySerializers(args, serialize, serializers, stdErrSerialize) {
|
|
9490
|
-
for (const i3 in args) {
|
|
9491
|
-
if (stdErrSerialize && args[i3] instanceof Error) {
|
|
9492
|
-
args[i3] = pino.stdSerializers.err(args[i3]);
|
|
9493
|
-
} else if (typeof args[i3] === "object" && !Array.isArray(args[i3]) && serialize) {
|
|
9494
|
-
for (const k2 in args[i3]) {
|
|
9495
|
-
if (serialize.indexOf(k2) > -1 && k2 in serializers) {
|
|
9496
|
-
args[i3][k2] = serializers[k2](args[i3][k2]);
|
|
9497
|
-
}
|
|
9498
|
-
}
|
|
9196
|
+
const f4 = t2.timestamp(), u2 = new Array(arguments.length), c2 = Object.getPrototypeOf && Object.getPrototypeOf(this) === j$4 ? j$4 : this;
|
|
9197
|
+
for (var n3 = 0; n3 < u2.length; n3++) u2[n3] = arguments[n3];
|
|
9198
|
+
var o3 = false;
|
|
9199
|
+
if (t2.serialize && (V$2(u2, this._serialize, this.serializers, this._stdErrSerialize), o3 = true), t2.asObject || t2.formatters ? i3.call(c2, ...ve$4(this, s2, u2, f4, t2)) : i3.apply(c2, u2), t2.transmit) {
|
|
9200
|
+
const l2 = t2.transmit.level || e2._level, p2 = m$2(l2, r2), a2 = m$2(s2, r2);
|
|
9201
|
+
if (a2 < p2) return;
|
|
9202
|
+
me$4(this, { ts: f4, methodLevel: s2, methodValue: a2, transmitValue: r2.levels.values[t2.transmit.level || e2._level], send: t2.transmit.send, val: m$2(e2._level, r2) }, u2, o3);
|
|
9499
9203
|
}
|
|
9500
|
-
}
|
|
9501
|
-
}
|
|
9502
|
-
function transmit(logger, opts, args, argsIsSerialized = false) {
|
|
9503
|
-
const send = opts.send;
|
|
9504
|
-
const ts2 = opts.ts;
|
|
9505
|
-
const methodLevel = opts.methodLevel;
|
|
9506
|
-
const methodValue = opts.methodValue;
|
|
9507
|
-
const val = opts.val;
|
|
9508
|
-
const bindings = logger._logEvent.bindings;
|
|
9509
|
-
if (!argsIsSerialized) {
|
|
9510
|
-
applySerializers(
|
|
9511
|
-
args,
|
|
9512
|
-
logger._serialize || Object.keys(logger.serializers),
|
|
9513
|
-
logger.serializers,
|
|
9514
|
-
logger._stdErrSerialize === void 0 ? true : logger._stdErrSerialize
|
|
9515
|
-
);
|
|
9516
|
-
}
|
|
9517
|
-
logger._logEvent.ts = ts2;
|
|
9518
|
-
logger._logEvent.messages = args.filter(function(arg) {
|
|
9519
|
-
return bindings.indexOf(arg) === -1;
|
|
9520
|
-
});
|
|
9521
|
-
logger._logEvent.level.label = methodLevel;
|
|
9522
|
-
logger._logEvent.level.value = methodValue;
|
|
9523
|
-
send(methodLevel, logger._logEvent, val);
|
|
9524
|
-
logger._logEvent = createLogEventShape(bindings);
|
|
9525
|
-
}
|
|
9526
|
-
function createLogEventShape(bindings) {
|
|
9527
|
-
return {
|
|
9528
|
-
ts: 0,
|
|
9529
|
-
messages: [],
|
|
9530
|
-
bindings: bindings || [],
|
|
9531
|
-
level: { label: "", value: 0 }
|
|
9532
|
-
};
|
|
9533
|
-
}
|
|
9534
|
-
function asErrValue(err) {
|
|
9535
|
-
const obj = {
|
|
9536
|
-
type: err.constructor.name,
|
|
9537
|
-
msg: err.message,
|
|
9538
|
-
stack: err.stack
|
|
9539
9204
|
};
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
return a2;
|
|
9561
|
-
}
|
|
9562
|
-
function noop() {
|
|
9563
|
-
}
|
|
9564
|
-
function nullTime() {
|
|
9565
|
-
return false;
|
|
9566
|
-
}
|
|
9567
|
-
function epochTime() {
|
|
9568
|
-
return Date.now();
|
|
9569
|
-
}
|
|
9570
|
-
function unixTime() {
|
|
9571
|
-
return Math.round(Date.now() / 1e3);
|
|
9205
|
+
})(e2[A$2][s2]);
|
|
9206
|
+
}
|
|
9207
|
+
function ve$4(e2, t2, r2, s2, i3) {
|
|
9208
|
+
const { level: h4, log: f4 = (l2) => l2 } = i3.formatters || {}, u2 = r2.slice();
|
|
9209
|
+
let c2 = u2[0];
|
|
9210
|
+
const n3 = {};
|
|
9211
|
+
let o3 = (e2._childLevel | 0) + 1;
|
|
9212
|
+
if (o3 < 1 && (o3 = 1), s2 && (n3.time = s2), h4) {
|
|
9213
|
+
const l2 = h4(t2, e2.levels.values[t2]);
|
|
9214
|
+
Object.assign(n3, l2);
|
|
9215
|
+
} else n3.level = e2.levels.values[t2];
|
|
9216
|
+
if (i3.asObjectBindingsOnly) {
|
|
9217
|
+
if (c2 !== null && typeof c2 == "object") for (; o3-- && typeof u2[0] == "object"; ) Object.assign(n3, u2.shift());
|
|
9218
|
+
return [f4(n3), ...u2];
|
|
9219
|
+
} else {
|
|
9220
|
+
if (c2 !== null && typeof c2 == "object") {
|
|
9221
|
+
for (; o3-- && typeof u2[0] == "object"; ) Object.assign(n3, u2.shift());
|
|
9222
|
+
c2 = u2.length ? G$3(u2.shift(), u2) : void 0;
|
|
9223
|
+
} else typeof c2 == "string" && (c2 = G$3(u2.shift(), u2));
|
|
9224
|
+
return c2 !== void 0 && (n3[i3.messageKey] = c2), [f4(n3)];
|
|
9572
9225
|
}
|
|
9573
|
-
|
|
9574
|
-
|
|
9226
|
+
}
|
|
9227
|
+
function V$2(e2, t2, r2, s2) {
|
|
9228
|
+
for (const i3 in e2) if (s2 && e2[i3] instanceof Error) e2[i3] = v$5.stdSerializers.err(e2[i3]);
|
|
9229
|
+
else if (typeof e2[i3] == "object" && !Array.isArray(e2[i3]) && t2) for (const h4 in e2[i3]) t2.indexOf(h4) > -1 && h4 in r2 && (e2[i3][h4] = r2[h4](e2[i3][h4]));
|
|
9230
|
+
}
|
|
9231
|
+
function me$4(e2, t2, r2, s2 = false) {
|
|
9232
|
+
const i3 = t2.send, h4 = t2.ts, f4 = t2.methodLevel, u2 = t2.methodValue, c2 = t2.val, n3 = e2._logEvent.bindings;
|
|
9233
|
+
s2 || V$2(r2, e2._serialize || Object.keys(e2.serializers), e2.serializers, e2._stdErrSerialize === void 0 ? true : e2._stdErrSerialize), e2._logEvent.ts = h4, e2._logEvent.messages = r2.filter(function(o3) {
|
|
9234
|
+
return n3.indexOf(o3) === -1;
|
|
9235
|
+
}), e2._logEvent.level.label = f4, e2._logEvent.level.value = u2, i3(f4, e2._logEvent, c2), e2._logEvent = N$4(n3);
|
|
9236
|
+
}
|
|
9237
|
+
function N$4(e2) {
|
|
9238
|
+
return { ts: 0, messages: [], bindings: e2 || [], level: { label: "", value: 0 } };
|
|
9239
|
+
}
|
|
9240
|
+
function U$2(e2) {
|
|
9241
|
+
const t2 = { type: e2.constructor.name, msg: e2.message, stack: e2.stack };
|
|
9242
|
+
for (const r2 in e2) t2[r2] === void 0 && (t2[r2] = e2[r2]);
|
|
9243
|
+
return t2;
|
|
9244
|
+
}
|
|
9245
|
+
function ye$4(e2) {
|
|
9246
|
+
return typeof e2.timestamp == "function" ? e2.timestamp : e2.timestamp === false ? X$2 : Y$1;
|
|
9247
|
+
}
|
|
9248
|
+
function C$3() {
|
|
9249
|
+
return {};
|
|
9250
|
+
}
|
|
9251
|
+
function $$1(e2) {
|
|
9252
|
+
return e2;
|
|
9253
|
+
}
|
|
9254
|
+
function w$3() {
|
|
9255
|
+
}
|
|
9256
|
+
function X$2() {
|
|
9257
|
+
return false;
|
|
9258
|
+
}
|
|
9259
|
+
function Y$1() {
|
|
9260
|
+
return Date.now();
|
|
9261
|
+
}
|
|
9262
|
+
function pe$3() {
|
|
9263
|
+
return Math.round(Date.now() / 1e3);
|
|
9264
|
+
}
|
|
9265
|
+
function Le$4() {
|
|
9266
|
+
return new Date(Date.now()).toISOString();
|
|
9267
|
+
}
|
|
9268
|
+
function we$4() {
|
|
9269
|
+
function e2(t2) {
|
|
9270
|
+
return typeof t2 < "u" && t2;
|
|
9575
9271
|
}
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
return
|
|
9579
|
-
}
|
|
9580
|
-
|
|
9581
|
-
|
|
9582
|
-
Object.defineProperty(Object.prototype, "globalThis", {
|
|
9583
|
-
get: function() {
|
|
9584
|
-
delete Object.prototype.globalThis;
|
|
9585
|
-
return this.globalThis = this;
|
|
9586
|
-
},
|
|
9587
|
-
configurable: true
|
|
9588
|
-
});
|
|
9589
|
-
return globalThis;
|
|
9590
|
-
} catch (e2) {
|
|
9591
|
-
return defd(self) || defd(window) || defd(this) || {};
|
|
9592
|
-
}
|
|
9272
|
+
try {
|
|
9273
|
+
return typeof globalThis < "u" || Object.defineProperty(Object.prototype, "globalThis", { get: function() {
|
|
9274
|
+
return delete Object.prototype.globalThis, this.globalThis = this;
|
|
9275
|
+
}, configurable: true }), globalThis;
|
|
9276
|
+
} catch {
|
|
9277
|
+
return e2(self) || e2(window) || e2(this) || {};
|
|
9593
9278
|
}
|
|
9594
|
-
browser.exports.default = pino;
|
|
9595
|
-
browser.exports.pino = pino;
|
|
9596
|
-
return browser.exports;
|
|
9597
9279
|
}
|
|
9598
|
-
|
|
9599
|
-
|
|
9600
|
-
const
|
|
9601
|
-
var
|
|
9602
|
-
let
|
|
9603
|
-
constructor(
|
|
9604
|
-
|
|
9280
|
+
b$4.exports.default = v$5;
|
|
9281
|
+
b$4.exports.pino = v$5;
|
|
9282
|
+
const Z$1 = { level: "info" }, S$3 = "custom_context", I$1 = 1e3 * 1024;
|
|
9283
|
+
var ze$3 = Object.defineProperty, _e$4 = (e2, t2, r2) => t2 in e2 ? ze$3(e2, t2, { enumerable: true, configurable: true, writable: true, value: r2 }) : e2[t2] = r2, y$3 = (e2, t2, r2) => _e$4(e2, typeof t2 != "symbol" ? t2 + "" : t2, r2);
|
|
9284
|
+
let je$2 = class je {
|
|
9285
|
+
constructor(t2) {
|
|
9286
|
+
y$3(this, "nodeValue"), y$3(this, "sizeInBytes"), y$3(this, "next"), this.nodeValue = t2, this.sizeInBytes = new TextEncoder().encode(this.nodeValue).length, this.next = null;
|
|
9605
9287
|
}
|
|
9606
9288
|
get value() {
|
|
9607
9289
|
return this.nodeValue;
|
|
@@ -9610,26 +9292,26 @@ let S$3 = class S {
|
|
|
9610
9292
|
return this.sizeInBytes;
|
|
9611
9293
|
}
|
|
9612
9294
|
};
|
|
9613
|
-
let
|
|
9614
|
-
constructor(
|
|
9615
|
-
|
|
9295
|
+
let q$1 = class q {
|
|
9296
|
+
constructor(t2) {
|
|
9297
|
+
y$3(this, "lengthInNodes"), y$3(this, "sizeInBytes"), y$3(this, "head"), y$3(this, "tail"), y$3(this, "maxSizeInBytes"), this.head = null, this.tail = null, this.lengthInNodes = 0, this.maxSizeInBytes = t2, this.sizeInBytes = 0;
|
|
9616
9298
|
}
|
|
9617
|
-
append(
|
|
9618
|
-
const
|
|
9619
|
-
if (
|
|
9620
|
-
for (; this.size +
|
|
9621
|
-
this.head ? (this.tail && (this.tail.next =
|
|
9299
|
+
append(t2) {
|
|
9300
|
+
const r2 = new je$2(t2);
|
|
9301
|
+
if (r2.size > this.maxSizeInBytes) throw new Error(`[LinkedList] Value too big to insert into list: ${t2} with size ${r2.size}`);
|
|
9302
|
+
for (; this.size + r2.size > this.maxSizeInBytes; ) this.shift();
|
|
9303
|
+
this.head ? (this.tail && (this.tail.next = r2), this.tail = r2) : (this.head = r2, this.tail = r2), this.lengthInNodes++, this.sizeInBytes += r2.size;
|
|
9622
9304
|
}
|
|
9623
9305
|
shift() {
|
|
9624
9306
|
if (!this.head) return;
|
|
9625
|
-
const
|
|
9626
|
-
this.head = this.head.next, this.head || (this.tail = null), this.lengthInNodes--, this.sizeInBytes -=
|
|
9307
|
+
const t2 = this.head;
|
|
9308
|
+
this.head = this.head.next, this.head || (this.tail = null), this.lengthInNodes--, this.sizeInBytes -= t2.size;
|
|
9627
9309
|
}
|
|
9628
9310
|
toArray() {
|
|
9629
|
-
const
|
|
9630
|
-
let
|
|
9631
|
-
for (;
|
|
9632
|
-
return
|
|
9311
|
+
const t2 = [];
|
|
9312
|
+
let r2 = this.head;
|
|
9313
|
+
for (; r2 !== null; ) t2.push(r2.value), r2 = r2.next;
|
|
9314
|
+
return t2;
|
|
9633
9315
|
}
|
|
9634
9316
|
get length() {
|
|
9635
9317
|
return this.lengthInNodes;
|
|
@@ -9641,48 +9323,52 @@ let v$5 = class v {
|
|
|
9641
9323
|
return Array.from(this);
|
|
9642
9324
|
}
|
|
9643
9325
|
[Symbol.iterator]() {
|
|
9644
|
-
let
|
|
9326
|
+
let t2 = this.head;
|
|
9645
9327
|
return { next: () => {
|
|
9646
|
-
if (!
|
|
9647
|
-
const
|
|
9648
|
-
return
|
|
9328
|
+
if (!t2) return { done: true, value: null };
|
|
9329
|
+
const r2 = t2.value;
|
|
9330
|
+
return t2 = t2.next, { done: false, value: r2 };
|
|
9649
9331
|
} };
|
|
9650
9332
|
}
|
|
9651
9333
|
};
|
|
9652
|
-
|
|
9653
|
-
|
|
9654
|
-
|
|
9655
|
-
|
|
9334
|
+
const Se$4 = (e2) => JSON.stringify(e2, (t2, r2) => typeof r2 == "bigint" ? r2.toString() + "n" : r2);
|
|
9335
|
+
function K$4(e2) {
|
|
9336
|
+
return typeof e2 == "string" ? e2 : Se$4(e2) || "";
|
|
9337
|
+
}
|
|
9338
|
+
var Ee$3 = Object.defineProperty, ke$3 = (e2, t2, r2) => t2 in e2 ? Ee$3(e2, t2, { enumerable: true, configurable: true, writable: true, value: r2 }) : e2[t2] = r2, T$3 = (e2, t2, r2) => ke$3(e2, typeof t2 != "symbol" ? t2 + "" : t2, r2);
|
|
9339
|
+
let J$5 = class J {
|
|
9340
|
+
constructor(t2, r2 = I$1) {
|
|
9341
|
+
T$3(this, "logs"), T$3(this, "level"), T$3(this, "levelValue"), T$3(this, "MAX_LOG_SIZE_IN_BYTES"), this.level = t2 ?? "error", this.levelValue = b$4.exports.levels.values[this.level], this.MAX_LOG_SIZE_IN_BYTES = r2, this.logs = new q$1(this.MAX_LOG_SIZE_IN_BYTES);
|
|
9656
9342
|
}
|
|
9657
|
-
forwardToConsole(
|
|
9658
|
-
|
|
9343
|
+
forwardToConsole(t2, r2) {
|
|
9344
|
+
r2 === b$4.exports.levels.values.error ? console.error(t2) : r2 === b$4.exports.levels.values.warn ? console.warn(t2) : r2 === b$4.exports.levels.values.debug ? console.debug(t2) : r2 === b$4.exports.levels.values.trace ? console.trace(t2) : console.log(t2);
|
|
9659
9345
|
}
|
|
9660
|
-
appendToLogs(
|
|
9661
|
-
this.logs.append(
|
|
9662
|
-
const
|
|
9663
|
-
|
|
9346
|
+
appendToLogs(t2) {
|
|
9347
|
+
this.logs.append(K$4({ timestamp: (/* @__PURE__ */ new Date()).toISOString(), log: t2 }));
|
|
9348
|
+
const r2 = typeof t2 == "string" ? JSON.parse(t2).level : t2.level;
|
|
9349
|
+
r2 >= this.levelValue && this.forwardToConsole(t2, r2);
|
|
9664
9350
|
}
|
|
9665
9351
|
getLogs() {
|
|
9666
9352
|
return this.logs;
|
|
9667
9353
|
}
|
|
9668
9354
|
clearLogs() {
|
|
9669
|
-
this.logs = new
|
|
9355
|
+
this.logs = new q$1(this.MAX_LOG_SIZE_IN_BYTES);
|
|
9670
9356
|
}
|
|
9671
9357
|
getLogArray() {
|
|
9672
9358
|
return Array.from(this.logs);
|
|
9673
9359
|
}
|
|
9674
|
-
logsToBlob(
|
|
9675
|
-
const
|
|
9676
|
-
return
|
|
9360
|
+
logsToBlob(t2) {
|
|
9361
|
+
const r2 = this.getLogArray();
|
|
9362
|
+
return r2.push(K$4({ extraMetadata: t2 })), new Blob(r2, { type: "application/json" });
|
|
9677
9363
|
}
|
|
9678
9364
|
};
|
|
9679
|
-
var
|
|
9680
|
-
let
|
|
9681
|
-
constructor(
|
|
9682
|
-
|
|
9365
|
+
var Ce$3 = Object.defineProperty, Ie$4 = (e2, t2, r2) => t2 in e2 ? Ce$3(e2, t2, { enumerable: true, configurable: true, writable: true, value: r2 }) : e2[t2] = r2, Te$4 = (e2, t2, r2) => Ie$4(e2, t2 + "", r2);
|
|
9366
|
+
let xe$2 = class xe {
|
|
9367
|
+
constructor(t2, r2 = I$1) {
|
|
9368
|
+
Te$4(this, "baseChunkLogger"), this.baseChunkLogger = new J$5(t2, r2);
|
|
9683
9369
|
}
|
|
9684
|
-
write(
|
|
9685
|
-
this.baseChunkLogger.appendToLogs(
|
|
9370
|
+
write(t2) {
|
|
9371
|
+
this.baseChunkLogger.appendToLogs(t2);
|
|
9686
9372
|
}
|
|
9687
9373
|
getLogs() {
|
|
9688
9374
|
return this.baseChunkLogger.getLogs();
|
|
@@ -9693,21 +9379,21 @@ let E$3 = class E {
|
|
|
9693
9379
|
getLogArray() {
|
|
9694
9380
|
return this.baseChunkLogger.getLogArray();
|
|
9695
9381
|
}
|
|
9696
|
-
logsToBlob(
|
|
9697
|
-
return this.baseChunkLogger.logsToBlob(
|
|
9382
|
+
logsToBlob(t2) {
|
|
9383
|
+
return this.baseChunkLogger.logsToBlob(t2);
|
|
9698
9384
|
}
|
|
9699
|
-
downloadLogsBlobInBrowser(
|
|
9700
|
-
const
|
|
9701
|
-
|
|
9385
|
+
downloadLogsBlobInBrowser(t2) {
|
|
9386
|
+
const r2 = URL.createObjectURL(this.logsToBlob(t2)), s2 = document.createElement("a");
|
|
9387
|
+
s2.href = r2, s2.download = `walletconnect-logs-${(/* @__PURE__ */ new Date()).toISOString()}.txt`, document.body.appendChild(s2), s2.click(), document.body.removeChild(s2), URL.revokeObjectURL(r2);
|
|
9702
9388
|
}
|
|
9703
9389
|
};
|
|
9704
|
-
var
|
|
9705
|
-
let
|
|
9706
|
-
constructor(
|
|
9707
|
-
|
|
9390
|
+
var Be$4 = Object.defineProperty, Ae$3 = (e2, t2, r2) => t2 in e2 ? Be$4(e2, t2, { enumerable: true, configurable: true, writable: true, value: r2 }) : e2[t2] = r2, Pe$4 = (e2, t2, r2) => Ae$3(e2, t2 + "", r2);
|
|
9391
|
+
let Ve$4 = class Ve {
|
|
9392
|
+
constructor(t2, r2 = I$1) {
|
|
9393
|
+
Pe$4(this, "baseChunkLogger"), this.baseChunkLogger = new J$5(t2, r2);
|
|
9708
9394
|
}
|
|
9709
|
-
write(
|
|
9710
|
-
this.baseChunkLogger.appendToLogs(
|
|
9395
|
+
write(t2) {
|
|
9396
|
+
this.baseChunkLogger.appendToLogs(t2);
|
|
9711
9397
|
}
|
|
9712
9398
|
getLogs() {
|
|
9713
9399
|
return this.baseChunkLogger.getLogs();
|
|
@@ -9718,44 +9404,44 @@ let j$4 = class j {
|
|
|
9718
9404
|
getLogArray() {
|
|
9719
9405
|
return this.baseChunkLogger.getLogArray();
|
|
9720
9406
|
}
|
|
9721
|
-
logsToBlob(
|
|
9722
|
-
return this.baseChunkLogger.logsToBlob(
|
|
9407
|
+
logsToBlob(t2) {
|
|
9408
|
+
return this.baseChunkLogger.logsToBlob(t2);
|
|
9723
9409
|
}
|
|
9724
9410
|
};
|
|
9725
|
-
var
|
|
9726
|
-
for (var
|
|
9727
|
-
if (
|
|
9728
|
-
return
|
|
9729
|
-
},
|
|
9730
|
-
function
|
|
9731
|
-
return
|
|
9411
|
+
var Ne$2 = Object.defineProperty, $e$4 = Object.defineProperties, Fe$3 = Object.getOwnPropertyDescriptors, H$2 = Object.getOwnPropertySymbols, Me$5 = Object.prototype.hasOwnProperty, De$4 = Object.prototype.propertyIsEnumerable, W$4 = (e2, t2, r2) => t2 in e2 ? Ne$2(e2, t2, { enumerable: true, configurable: true, writable: true, value: r2 }) : e2[t2] = r2, x$3 = (e2, t2) => {
|
|
9412
|
+
for (var r2 in t2 || (t2 = {})) Me$5.call(t2, r2) && W$4(e2, r2, t2[r2]);
|
|
9413
|
+
if (H$2) for (var r2 of H$2(t2)) De$4.call(t2, r2) && W$4(e2, r2, t2[r2]);
|
|
9414
|
+
return e2;
|
|
9415
|
+
}, B$1 = (e2, t2) => $e$4(e2, Fe$3(t2));
|
|
9416
|
+
function Ge$5(e2) {
|
|
9417
|
+
return B$1(x$3({}, e2), { level: e2?.level || Z$1.level });
|
|
9732
9418
|
}
|
|
9733
|
-
function
|
|
9734
|
-
return r2
|
|
9419
|
+
function Q$2(e2, t2, r2 = S$3) {
|
|
9420
|
+
return e2[r2] = t2, e2;
|
|
9735
9421
|
}
|
|
9736
|
-
function
|
|
9737
|
-
return
|
|
9422
|
+
function ee$3(e2, t2 = S$3) {
|
|
9423
|
+
return e2[t2] || "";
|
|
9738
9424
|
}
|
|
9739
|
-
function
|
|
9740
|
-
const
|
|
9741
|
-
return
|
|
9425
|
+
function te$3(e2, t2, r2 = S$3) {
|
|
9426
|
+
const s2 = ee$3(e2, r2);
|
|
9427
|
+
return s2.trim() ? `${s2}/${t2}` : t2;
|
|
9742
9428
|
}
|
|
9743
|
-
function
|
|
9744
|
-
const
|
|
9745
|
-
return
|
|
9429
|
+
function Re$3(e2, t2, r2 = S$3) {
|
|
9430
|
+
const s2 = te$3(e2, t2, r2), i3 = e2.child({ context: s2 });
|
|
9431
|
+
return Q$2(i3, s2, r2);
|
|
9746
9432
|
}
|
|
9747
|
-
function
|
|
9748
|
-
var
|
|
9749
|
-
const
|
|
9750
|
-
return { logger:
|
|
9433
|
+
function re$2(e2) {
|
|
9434
|
+
var t2, r2;
|
|
9435
|
+
const s2 = new xe$2((t2 = e2.opts) == null ? void 0 : t2.level, e2.maxSizeInBytes);
|
|
9436
|
+
return { logger: b$4.exports(B$1(x$3({}, e2.opts), { level: "trace", browser: B$1(x$3({}, (r2 = e2.opts) == null ? void 0 : r2.browser), { write: (i3) => s2.write(i3) }) })), chunkLoggerController: s2 };
|
|
9751
9437
|
}
|
|
9752
|
-
function
|
|
9753
|
-
var
|
|
9754
|
-
const
|
|
9755
|
-
return { logger:
|
|
9438
|
+
function ne$2(e2) {
|
|
9439
|
+
var t2;
|
|
9440
|
+
const r2 = new Ve$4((t2 = e2.opts) == null ? void 0 : t2.level, e2.maxSizeInBytes);
|
|
9441
|
+
return { logger: b$4.exports(B$1(x$3({}, e2.opts), { level: "trace" }), r2), chunkLoggerController: r2 };
|
|
9756
9442
|
}
|
|
9757
|
-
function
|
|
9758
|
-
return typeof
|
|
9443
|
+
function Ue$5(e2) {
|
|
9444
|
+
return typeof e2.loggerOverride < "u" && typeof e2.loggerOverride != "string" ? { logger: e2.loggerOverride, chunkLoggerController: null } : typeof window < "u" ? re$2(e2) : ne$2(e2);
|
|
9759
9445
|
}
|
|
9760
9446
|
var a = Object.defineProperty, u = (e2, s2, r2) => s2 in e2 ? a(e2, s2, { enumerable: true, configurable: true, writable: true, value: r2 }) : e2[s2] = r2, c$3 = (e2, s2, r2) => u(e2, typeof s2 != "symbol" ? s2 + "" : s2, r2);
|
|
9761
9447
|
let h$2 = class h2 extends IEvents {
|
|
@@ -9785,7 +9471,7 @@ let d$4 = class d extends IEvents {
|
|
|
9785
9471
|
}
|
|
9786
9472
|
};
|
|
9787
9473
|
let f$3 = class f {
|
|
9788
|
-
constructor(s2, r2, t2,
|
|
9474
|
+
constructor(s2, r2, t2, q3) {
|
|
9789
9475
|
this.core = s2, this.logger = r2, this.name = t2;
|
|
9790
9476
|
}
|
|
9791
9477
|
};
|
|
@@ -9794,7 +9480,7 @@ let P$3 = class P extends IEvents {
|
|
|
9794
9480
|
super(), this.relayer = s2, this.logger = r2;
|
|
9795
9481
|
}
|
|
9796
9482
|
};
|
|
9797
|
-
let S$2 = class
|
|
9483
|
+
let S$2 = class S extends IEvents {
|
|
9798
9484
|
constructor(s2, r2) {
|
|
9799
9485
|
super(), this.core = s2, this.logger = r2;
|
|
9800
9486
|
}
|
|
@@ -9815,7 +9501,7 @@ let R$1 = class R {
|
|
|
9815
9501
|
}
|
|
9816
9502
|
};
|
|
9817
9503
|
var T$2 = Object.defineProperty, k$1 = (e2, s2, r2) => s2 in e2 ? T$2(e2, s2, { enumerable: true, configurable: true, writable: true, value: r2 }) : e2[s2] = r2, i2 = (e2, s2, r2) => k$1(e2, typeof s2 != "symbol" ? s2 + "" : s2, r2);
|
|
9818
|
-
let J$4 = class
|
|
9504
|
+
let J$4 = class J2 {
|
|
9819
9505
|
constructor(s2) {
|
|
9820
9506
|
this.opts = s2, i2(this, "protocol", "wc"), i2(this, "version", 2);
|
|
9821
9507
|
}
|
|
@@ -9938,26 +9624,26 @@ let Jn$2 = class Jn extends An$2 {
|
|
|
9938
9624
|
super(128, 64, 16, false), this.Ah = 1779033703, this.Al = -205731576, this.Bh = -1150833019, this.Bl = -2067093701, this.Ch = 1013904242, this.Cl = -23791573, this.Dh = -1521486534, this.Dl = 1595750129, this.Eh = 1359893119, this.El = -1377402159, this.Fh = -1694144372, this.Fl = 725511199, this.Gh = 528734635, this.Gl = -79577749, this.Hh = 1541459225, this.Hl = 327033209;
|
|
9939
9625
|
}
|
|
9940
9626
|
get() {
|
|
9941
|
-
const { Ah: e2, Al: n3, Bh: r2, Bl: o3, Ch: s2, Cl: a2, Dh: u2, Dl: i3, Eh: D2, El: c2, Fh: l2, Fl: p2, Gh: w2, Gl: h4, Hh: g2, Hl:
|
|
9942
|
-
return [e2, n3, r2, o3, s2, a2, u2, i3, D2, c2, l2, p2, w2, h4, g2,
|
|
9627
|
+
const { Ah: e2, Al: n3, Bh: r2, Bl: o3, Ch: s2, Cl: a2, Dh: u2, Dl: i3, Eh: D2, El: c2, Fh: l2, Fl: p2, Gh: w2, Gl: h4, Hh: g2, Hl: S3 } = this;
|
|
9628
|
+
return [e2, n3, r2, o3, s2, a2, u2, i3, D2, c2, l2, p2, w2, h4, g2, S3];
|
|
9943
9629
|
}
|
|
9944
|
-
set(e2, n3, r2, o3, s2, a2, u2, i3, D2, c2, l2, p2, w2, h4, g2,
|
|
9945
|
-
this.Ah = e2 | 0, this.Al = n3 | 0, this.Bh = r2 | 0, this.Bl = o3 | 0, this.Ch = s2 | 0, this.Cl = a2 | 0, this.Dh = u2 | 0, this.Dl = i3 | 0, this.Eh = D2 | 0, this.El = c2 | 0, this.Fh = l2 | 0, this.Fl = p2 | 0, this.Gh = w2 | 0, this.Gl = h4 | 0, this.Hh = g2 | 0, this.Hl =
|
|
9630
|
+
set(e2, n3, r2, o3, s2, a2, u2, i3, D2, c2, l2, p2, w2, h4, g2, S3) {
|
|
9631
|
+
this.Ah = e2 | 0, this.Al = n3 | 0, this.Bh = r2 | 0, this.Bl = o3 | 0, this.Ch = s2 | 0, this.Cl = a2 | 0, this.Dh = u2 | 0, this.Dl = i3 | 0, this.Eh = D2 | 0, this.El = c2 | 0, this.Fh = l2 | 0, this.Fl = p2 | 0, this.Gh = w2 | 0, this.Gl = h4 | 0, this.Hh = g2 | 0, this.Hl = S3 | 0;
|
|
9946
9632
|
}
|
|
9947
9633
|
process(e2, n3) {
|
|
9948
9634
|
for (let d3 = 0; d3 < 16; d3++, n3 += 4) P$2[d3] = e2.getUint32(n3), Q$1[d3] = e2.getUint32(n3 += 4);
|
|
9949
9635
|
for (let d3 = 16; d3 < 80; d3++) {
|
|
9950
|
-
const m3 = P$2[d3 - 15] | 0, F2 = Q$1[d3 - 15] | 0,
|
|
9636
|
+
const m3 = P$2[d3 - 15] | 0, F2 = Q$1[d3 - 15] | 0, q3 = x$2.rotrSH(m3, F2, 1) ^ x$2.rotrSH(m3, F2, 8) ^ x$2.shrSH(m3, F2, 7), z2 = x$2.rotrSL(m3, F2, 1) ^ x$2.rotrSL(m3, F2, 8) ^ x$2.shrSL(m3, F2, 7), I2 = P$2[d3 - 2] | 0, O3 = Q$1[d3 - 2] | 0, ot2 = x$2.rotrSH(I2, O3, 19) ^ x$2.rotrBH(I2, O3, 61) ^ x$2.shrSH(I2, O3, 6), tt2 = x$2.rotrSL(I2, O3, 19) ^ x$2.rotrBL(I2, O3, 61) ^ x$2.shrSL(I2, O3, 6), st2 = x$2.add4L(z2, tt2, Q$1[d3 - 7], Q$1[d3 - 16]), at2 = x$2.add4H(st2, q3, ot2, P$2[d3 - 7], P$2[d3 - 16]);
|
|
9951
9637
|
P$2[d3] = at2 | 0, Q$1[d3] = st2 | 0;
|
|
9952
9638
|
}
|
|
9953
|
-
let { Ah: r2, Al: o3, Bh: s2, Bl: a2, Ch: u2, Cl: i3, Dh: D2, Dl: c2, Eh: l2, El: p2, Fh: w2, Fl: h4, Gh: g2, Gl:
|
|
9639
|
+
let { Ah: r2, Al: o3, Bh: s2, Bl: a2, Ch: u2, Cl: i3, Dh: D2, Dl: c2, Eh: l2, El: p2, Fh: w2, Fl: h4, Gh: g2, Gl: S3, Hh: v2, Hl: L2 } = this;
|
|
9954
9640
|
for (let d3 = 0; d3 < 80; d3++) {
|
|
9955
|
-
const m3 = x$2.rotrSH(l2, p2, 14) ^ x$2.rotrSH(l2, p2, 18) ^ x$2.rotrBH(l2, p2, 41), F2 = x$2.rotrSL(l2, p2, 14) ^ x$2.rotrSL(l2, p2, 18) ^ x$2.rotrBL(l2, p2, 41),
|
|
9956
|
-
|
|
9641
|
+
const m3 = x$2.rotrSH(l2, p2, 14) ^ x$2.rotrSH(l2, p2, 18) ^ x$2.rotrBH(l2, p2, 41), F2 = x$2.rotrSL(l2, p2, 14) ^ x$2.rotrSL(l2, p2, 18) ^ x$2.rotrBL(l2, p2, 41), q3 = l2 & w2 ^ ~l2 & g2, z2 = p2 & h4 ^ ~p2 & S3, I2 = x$2.add5L(L2, F2, z2, Yn$2[d3], Q$1[d3]), O3 = x$2.add5H(I2, v2, m3, q3, Vn$2[d3], P$2[d3]), ot2 = I2 | 0, tt2 = x$2.rotrSH(r2, o3, 28) ^ x$2.rotrBH(r2, o3, 34) ^ x$2.rotrBH(r2, o3, 39), st2 = x$2.rotrSL(r2, o3, 28) ^ x$2.rotrBL(r2, o3, 34) ^ x$2.rotrBL(r2, o3, 39), at2 = r2 & s2 ^ r2 & u2 ^ s2 & u2, Ct2 = o3 & a2 ^ o3 & i3 ^ a2 & i3;
|
|
9642
|
+
v2 = g2 | 0, L2 = S3 | 0, g2 = w2 | 0, S3 = h4 | 0, w2 = l2 | 0, h4 = p2 | 0, { h: l2, l: p2 } = x$2.add(D2 | 0, c2 | 0, O3 | 0, ot2 | 0), D2 = u2 | 0, c2 = i3 | 0, u2 = s2 | 0, i3 = a2 | 0, s2 = r2 | 0, a2 = o3 | 0;
|
|
9957
9643
|
const At2 = x$2.add3L(ot2, st2, Ct2);
|
|
9958
9644
|
r2 = x$2.add3H(At2, O3, tt2, at2), o3 = At2 | 0;
|
|
9959
9645
|
}
|
|
9960
|
-
({ h: r2, l: o3 } = x$2.add(this.Ah | 0, this.Al | 0, r2 | 0, o3 | 0)), { h: s2, l: a2 } = x$2.add(this.Bh | 0, this.Bl | 0, s2 | 0, a2 | 0), { h: u2, l: i3 } = x$2.add(this.Ch | 0, this.Cl | 0, u2 | 0, i3 | 0), { h: D2, l: c2 } = x$2.add(this.Dh | 0, this.Dl | 0, D2 | 0, c2 | 0), { h: l2, l: p2 } = x$2.add(this.Eh | 0, this.El | 0, l2 | 0, p2 | 0), { h: w2, l: h4 } = x$2.add(this.Fh | 0, this.Fl | 0, w2 | 0, h4 | 0), { h: g2, l:
|
|
9646
|
+
({ h: r2, l: o3 } = x$2.add(this.Ah | 0, this.Al | 0, r2 | 0, o3 | 0)), { h: s2, l: a2 } = x$2.add(this.Bh | 0, this.Bl | 0, s2 | 0, a2 | 0), { h: u2, l: i3 } = x$2.add(this.Ch | 0, this.Cl | 0, u2 | 0, i3 | 0), { h: D2, l: c2 } = x$2.add(this.Dh | 0, this.Dl | 0, D2 | 0, c2 | 0), { h: l2, l: p2 } = x$2.add(this.Eh | 0, this.El | 0, l2 | 0, p2 | 0), { h: w2, l: h4 } = x$2.add(this.Fh | 0, this.Fl | 0, w2 | 0, h4 | 0), { h: g2, l: S3 } = x$2.add(this.Gh | 0, this.Gl | 0, g2 | 0, S3 | 0), { h: v2, l: L2 } = x$2.add(this.Hh | 0, this.Hl | 0, v2 | 0, L2 | 0), this.set(r2, o3, s2, a2, u2, i3, D2, c2, l2, p2, w2, h4, g2, S3, v2, L2);
|
|
9961
9647
|
}
|
|
9962
9648
|
roundClean() {
|
|
9963
9649
|
P$2.fill(0), Q$1.fill(0);
|
|
@@ -10244,8 +9930,8 @@ function lr$2(t2, e2) {
|
|
|
10244
9930
|
const w2 = p2 * a2;
|
|
10245
9931
|
let h4 = Number(o3 & D2);
|
|
10246
9932
|
o3 >>= l2, h4 > a2 && (h4 -= c2, o3 += gt$3);
|
|
10247
|
-
const g2 = w2,
|
|
10248
|
-
h4 === 0 ? i3 = i3.add(zt$3(
|
|
9933
|
+
const g2 = w2, S3 = w2 + Math.abs(h4) - 1, v2 = p2 % 2 !== 0, L2 = h4 < 0;
|
|
9934
|
+
h4 === 0 ? i3 = i3.add(zt$3(v2, r2[g2])) : u2 = u2.add(zt$3(L2, r2[S3]));
|
|
10249
9935
|
}
|
|
10250
9936
|
return { p: u2, f: i3 };
|
|
10251
9937
|
}, wNAFUnsafe(n3, r2, o3, s2 = t2.ZERO) {
|
|
@@ -10310,28 +9996,28 @@ function yr$2(t2) {
|
|
|
10310
9996
|
function g2(y3, f4) {
|
|
10311
9997
|
ft$3("coordinate " + y3, f4, G$2, D2);
|
|
10312
9998
|
}
|
|
10313
|
-
function
|
|
9999
|
+
function S3(y3) {
|
|
10314
10000
|
if (!(y3 instanceof d3)) throw new Error("ExtendedPoint expected");
|
|
10315
10001
|
}
|
|
10316
|
-
const
|
|
10317
|
-
const { ex: b2, ey:
|
|
10002
|
+
const v2 = xe$1((y3, f4) => {
|
|
10003
|
+
const { ex: b2, ey: E2, ez: B2 } = y3, C2 = y3.is0();
|
|
10318
10004
|
f4 == null && (f4 = C2 ? wr$2 : n3.inv(B2));
|
|
10319
|
-
const A2 = c2(b2 * f4), U2 = c2(
|
|
10005
|
+
const A2 = c2(b2 * f4), U2 = c2(E2 * f4), _3 = c2(B2 * f4);
|
|
10320
10006
|
if (C2) return { x: G$2, y: j$3 };
|
|
10321
10007
|
if (_3 !== j$3) throw new Error("invZ was invalid");
|
|
10322
10008
|
return { x: A2, y: U2 };
|
|
10323
|
-
}),
|
|
10009
|
+
}), L2 = xe$1((y3) => {
|
|
10324
10010
|
const { a: f4, d: b2 } = e2;
|
|
10325
10011
|
if (y3.is0()) throw new Error("bad point: ZERO");
|
|
10326
|
-
const { ex:
|
|
10012
|
+
const { ex: E2, ey: B2, ez: C2, et: A2 } = y3, U2 = c2(E2 * E2), _3 = c2(B2 * B2), T2 = c2(C2 * C2), $2 = c2(T2 * T2), R3 = c2(U2 * f4), V3 = c2(T2 * c2(R3 + _3)), Y2 = c2($2 + c2(b2 * c2(U2 * _3)));
|
|
10327
10013
|
if (V3 !== Y2) throw new Error("bad point: equation left != right (1)");
|
|
10328
|
-
const Z2 = c2(
|
|
10014
|
+
const Z2 = c2(E2 * B2), X2 = c2(C2 * A2);
|
|
10329
10015
|
if (Z2 !== X2) throw new Error("bad point: equation left != right (2)");
|
|
10330
10016
|
return true;
|
|
10331
10017
|
});
|
|
10332
10018
|
class d3 {
|
|
10333
|
-
constructor(f4, b2,
|
|
10334
|
-
this.ex = f4, this.ey = b2, this.ez =
|
|
10019
|
+
constructor(f4, b2, E2, B2) {
|
|
10020
|
+
this.ex = f4, this.ey = b2, this.ez = E2, this.et = B2, g2("x", f4), g2("y", b2), g2("z", E2), g2("t", B2), Object.freeze(this);
|
|
10335
10021
|
}
|
|
10336
10022
|
get x() {
|
|
10337
10023
|
return this.toAffine().x;
|
|
@@ -10341,25 +10027,25 @@ function yr$2(t2) {
|
|
|
10341
10027
|
}
|
|
10342
10028
|
static fromAffine(f4) {
|
|
10343
10029
|
if (f4 instanceof d3) throw new Error("extended point not allowed");
|
|
10344
|
-
const { x: b2, y:
|
|
10345
|
-
return g2("x", b2), g2("y",
|
|
10030
|
+
const { x: b2, y: E2 } = f4 || {};
|
|
10031
|
+
return g2("x", b2), g2("y", E2), new d3(b2, E2, j$3, c2(b2 * E2));
|
|
10346
10032
|
}
|
|
10347
10033
|
static normalizeZ(f4) {
|
|
10348
|
-
const b2 = n3.invertBatch(f4.map((
|
|
10349
|
-
return f4.map((
|
|
10034
|
+
const b2 = n3.invertBatch(f4.map((E2) => E2.ez));
|
|
10035
|
+
return f4.map((E2, B2) => E2.toAffine(b2[B2])).map(d3.fromAffine);
|
|
10350
10036
|
}
|
|
10351
10037
|
static msm(f4, b2) {
|
|
10352
10038
|
return br$2(d3, l2, f4, b2);
|
|
10353
10039
|
}
|
|
10354
10040
|
_setWindowSize(f4) {
|
|
10355
|
-
|
|
10041
|
+
q3.setWindowSize(this, f4);
|
|
10356
10042
|
}
|
|
10357
10043
|
assertValidity() {
|
|
10358
|
-
|
|
10044
|
+
L2(this);
|
|
10359
10045
|
}
|
|
10360
10046
|
equals(f4) {
|
|
10361
|
-
|
|
10362
|
-
const { ex: b2, ey:
|
|
10047
|
+
S3(f4);
|
|
10048
|
+
const { ex: b2, ey: E2, ez: B2 } = this, { ex: C2, ey: A2, ez: U2 } = f4, _3 = c2(b2 * U2), T2 = c2(C2 * B2), $2 = c2(E2 * U2), R3 = c2(A2 * B2);
|
|
10363
10049
|
return _3 === T2 && $2 === R3;
|
|
10364
10050
|
}
|
|
10365
10051
|
is0() {
|
|
@@ -10369,58 +10055,58 @@ function yr$2(t2) {
|
|
|
10369
10055
|
return new d3(c2(-this.ex), this.ey, this.ez, c2(-this.et));
|
|
10370
10056
|
}
|
|
10371
10057
|
double() {
|
|
10372
|
-
const { a: f4 } = e2, { ex: b2, ey:
|
|
10058
|
+
const { a: f4 } = e2, { ex: b2, ey: E2, ez: B2 } = this, C2 = c2(b2 * b2), A2 = c2(E2 * E2), U2 = c2(yt$3 * c2(B2 * B2)), _3 = c2(f4 * C2), T2 = b2 + E2, $2 = c2(c2(T2 * T2) - C2 - A2), R3 = _3 + A2, V3 = R3 - U2, Y2 = _3 - A2, Z2 = c2($2 * V3), X2 = c2(R3 * Y2), et2 = c2($2 * Y2), pt2 = c2(V3 * R3);
|
|
10373
10059
|
return new d3(Z2, X2, pt2, et2);
|
|
10374
10060
|
}
|
|
10375
10061
|
add(f4) {
|
|
10376
|
-
|
|
10377
|
-
const { a: b2, d:
|
|
10062
|
+
S3(f4);
|
|
10063
|
+
const { a: b2, d: E2 } = e2, { ex: B2, ey: C2, ez: A2, et: U2 } = this, { ex: _3, ey: T2, ez: $2, et: R3 } = f4;
|
|
10378
10064
|
if (b2 === BigInt(-1)) {
|
|
10379
10065
|
const re2 = c2((C2 - B2) * (T2 + _3)), oe2 = c2((C2 + B2) * (T2 - _3)), mt2 = c2(oe2 - re2);
|
|
10380
10066
|
if (mt2 === G$2) return this.double();
|
|
10381
10067
|
const se2 = c2(A2 * yt$3 * R3), ie2 = c2(U2 * yt$3 * $2), ue2 = ie2 + se2, ce2 = oe2 + re2, ae2 = ie2 - se2, Dn2 = c2(ue2 * mt2), dn3 = c2(ce2 * ae2), hn2 = c2(ue2 * ae2), ln2 = c2(mt2 * ce2);
|
|
10382
10068
|
return new d3(Dn2, dn3, ln2, hn2);
|
|
10383
10069
|
}
|
|
10384
|
-
const V3 = c2(B2 * _3), Y2 = c2(C2 * T2), Z2 = c2(U2 *
|
|
10070
|
+
const V3 = c2(B2 * _3), Y2 = c2(C2 * T2), Z2 = c2(U2 * E2 * R3), X2 = c2(A2 * $2), et2 = c2((B2 + C2) * (_3 + T2) - V3 - Y2), pt2 = X2 - Z2, ee2 = X2 + Z2, ne2 = c2(Y2 - b2 * V3), un2 = c2(et2 * pt2), cn2 = c2(ee2 * ne2), an2 = c2(et2 * ne2), fn2 = c2(pt2 * ee2);
|
|
10385
10071
|
return new d3(un2, cn2, fn2, an2);
|
|
10386
10072
|
}
|
|
10387
10073
|
subtract(f4) {
|
|
10388
10074
|
return this.add(f4.negate());
|
|
10389
10075
|
}
|
|
10390
10076
|
wNAF(f4) {
|
|
10391
|
-
return
|
|
10077
|
+
return q3.wNAFCached(this, f4, d3.normalizeZ);
|
|
10392
10078
|
}
|
|
10393
10079
|
multiply(f4) {
|
|
10394
10080
|
const b2 = f4;
|
|
10395
10081
|
ft$3("scalar", b2, j$3, r2);
|
|
10396
|
-
const { p:
|
|
10397
|
-
return d3.normalizeZ([
|
|
10082
|
+
const { p: E2, f: B2 } = this.wNAF(b2);
|
|
10083
|
+
return d3.normalizeZ([E2, B2])[0];
|
|
10398
10084
|
}
|
|
10399
10085
|
multiplyUnsafe(f4, b2 = d3.ZERO) {
|
|
10400
|
-
const
|
|
10401
|
-
return ft$3("scalar",
|
|
10086
|
+
const E2 = f4;
|
|
10087
|
+
return ft$3("scalar", E2, G$2, r2), E2 === G$2 ? F2 : this.is0() || E2 === j$3 ? this : q3.wNAFCachedUnsafe(this, E2, d3.normalizeZ, b2);
|
|
10402
10088
|
}
|
|
10403
10089
|
isSmallOrder() {
|
|
10404
10090
|
return this.multiplyUnsafe(i3).is0();
|
|
10405
10091
|
}
|
|
10406
10092
|
isTorsionFree() {
|
|
10407
|
-
return
|
|
10093
|
+
return q3.unsafeLadder(this, r2).is0();
|
|
10408
10094
|
}
|
|
10409
10095
|
toAffine(f4) {
|
|
10410
|
-
return
|
|
10096
|
+
return v2(this, f4);
|
|
10411
10097
|
}
|
|
10412
10098
|
clearCofactor() {
|
|
10413
10099
|
const { h: f4 } = e2;
|
|
10414
10100
|
return f4 === j$3 ? this : this.multiplyUnsafe(f4);
|
|
10415
10101
|
}
|
|
10416
10102
|
static fromHex(f4, b2 = false) {
|
|
10417
|
-
const { d:
|
|
10103
|
+
const { d: E2, a: B2 } = e2, C2 = n3.BYTES;
|
|
10418
10104
|
f4 = W$3("pointHex", f4, C2), Tt$3("zip215", b2);
|
|
10419
10105
|
const A2 = f4.slice(), U2 = f4[C2 - 1];
|
|
10420
10106
|
A2[C2 - 1] = U2 & -129;
|
|
10421
10107
|
const _3 = Et$4(A2), T2 = b2 ? D2 : n3.ORDER;
|
|
10422
10108
|
ft$3("pointHex.y", _3, G$2, T2);
|
|
10423
|
-
const $2 = c2(_3 * _3), R3 = c2($2 - j$3), V3 = c2(
|
|
10109
|
+
const $2 = c2(_3 * _3), R3 = c2($2 - j$3), V3 = c2(E2 * $2 - B2);
|
|
10424
10110
|
let { isValid: Y2, value: Z2 } = p2(R3, V3);
|
|
10425
10111
|
if (!Y2) throw new Error("Point.fromHex: invalid y coordinate");
|
|
10426
10112
|
const X2 = (Z2 & j$3) === j$3, et2 = (U2 & 128) !== 0;
|
|
@@ -10431,15 +10117,15 @@ function yr$2(t2) {
|
|
|
10431
10117
|
return O3(f4).point;
|
|
10432
10118
|
}
|
|
10433
10119
|
toRawBytes() {
|
|
10434
|
-
const { x: f4, y: b2 } = this.toAffine(),
|
|
10435
|
-
return
|
|
10120
|
+
const { x: f4, y: b2 } = this.toAffine(), E2 = Nt$3(b2, n3.BYTES);
|
|
10121
|
+
return E2[E2.length - 1] |= f4 & j$3 ? 128 : 0, E2;
|
|
10436
10122
|
}
|
|
10437
10123
|
toHex() {
|
|
10438
10124
|
return Ft$3(this.toRawBytes());
|
|
10439
10125
|
}
|
|
10440
10126
|
}
|
|
10441
10127
|
d3.BASE = new d3(e2.Gx, e2.Gy, j$3, c2(e2.Gx * e2.Gy)), d3.ZERO = new d3(G$2, j$3, j$3, G$2);
|
|
10442
|
-
const { BASE: m3, ZERO: F2 } = d3,
|
|
10128
|
+
const { BASE: m3, ZERO: F2 } = d3, q3 = lr$2(d3, u2 * 8);
|
|
10443
10129
|
function z2(y3) {
|
|
10444
10130
|
return H$1(y3, r2);
|
|
10445
10131
|
}
|
|
@@ -10449,8 +10135,8 @@ function yr$2(t2) {
|
|
|
10449
10135
|
function O3(y3) {
|
|
10450
10136
|
const f4 = n3.BYTES;
|
|
10451
10137
|
y3 = W$3("private key", y3, f4);
|
|
10452
|
-
const b2 = W$3("hashed private key", s2(y3), 2 * f4),
|
|
10453
|
-
return { head:
|
|
10138
|
+
const b2 = W$3("hashed private key", s2(y3), 2 * f4), E2 = w2(b2.slice(0, f4)), B2 = b2.slice(f4, 2 * f4), C2 = I2(E2), A2 = m3.multiply(C2), U2 = A2.toRawBytes();
|
|
10139
|
+
return { head: E2, prefix: B2, scalar: C2, point: A2, pointBytes: U2 };
|
|
10454
10140
|
}
|
|
10455
10141
|
function ot2(y3) {
|
|
10456
10142
|
return O3(y3).pointBytes;
|
|
@@ -10461,14 +10147,14 @@ function yr$2(t2) {
|
|
|
10461
10147
|
}
|
|
10462
10148
|
function st2(y3, f4, b2 = {}) {
|
|
10463
10149
|
y3 = W$3("message", y3), o3 && (y3 = o3(y3));
|
|
10464
|
-
const { prefix:
|
|
10150
|
+
const { prefix: E2, scalar: B2, pointBytes: C2 } = O3(f4), A2 = tt2(b2.context, E2, y3), U2 = m3.multiply(A2).toRawBytes(), _3 = tt2(b2.context, U2, C2, y3), T2 = z2(A2 + _3 * B2);
|
|
10465
10151
|
ft$3("signature.s", T2, G$2, r2);
|
|
10466
10152
|
const $2 = ye$3(U2, Nt$3(T2, n3.BYTES));
|
|
10467
10153
|
return W$3("result", $2, n3.BYTES * 2);
|
|
10468
10154
|
}
|
|
10469
10155
|
const at2 = Er$1;
|
|
10470
|
-
function Ct2(y3, f4, b2,
|
|
10471
|
-
const { context: B2, zip215: C2 } =
|
|
10156
|
+
function Ct2(y3, f4, b2, E2 = at2) {
|
|
10157
|
+
const { context: B2, zip215: C2 } = E2, A2 = n3.BYTES;
|
|
10472
10158
|
y3 = W$3("signature", y3, 2 * A2), f4 = W$3("message", f4), b2 = W$3("publicKey", b2, A2), C2 !== void 0 && Tt$3("zip215", C2), o3 && (f4 = o3(f4));
|
|
10473
10159
|
const U2 = Et$4(y3.slice(A2, 2 * A2));
|
|
10474
10160
|
let _3, T2, $2;
|
|
@@ -10492,8 +10178,8 @@ const xr$1 = BigInt(1), Te$3 = BigInt(2);
|
|
|
10492
10178
|
BigInt(3);
|
|
10493
10179
|
const Br$2 = BigInt(5), Cr$2 = BigInt(8);
|
|
10494
10180
|
function Ar$2(t2) {
|
|
10495
|
-
const e2 = BigInt(10), n3 = BigInt(20), r2 = BigInt(40), o3 = BigInt(80), s2 = kt$3, u2 = t2 * t2 % s2 * t2 % s2, i3 = J$3(u2, Te$3, s2) * u2 % s2, D2 = J$3(i3, xr$1, s2) * t2 % s2, c2 = J$3(D2, Br$2, s2) * D2 % s2, l2 = J$3(c2, e2, s2) * c2 % s2, p2 = J$3(l2, n3, s2) * l2 % s2, w2 = J$3(p2, r2, s2) * p2 % s2, h4 = J$3(w2, o3, s2) * w2 % s2, g2 = J$3(h4, o3, s2) * w2 % s2,
|
|
10496
|
-
return { pow_p_5_8: J$3(
|
|
10181
|
+
const e2 = BigInt(10), n3 = BigInt(20), r2 = BigInt(40), o3 = BigInt(80), s2 = kt$3, u2 = t2 * t2 % s2 * t2 % s2, i3 = J$3(u2, Te$3, s2) * u2 % s2, D2 = J$3(i3, xr$1, s2) * t2 % s2, c2 = J$3(D2, Br$2, s2) * D2 % s2, l2 = J$3(c2, e2, s2) * c2 % s2, p2 = J$3(l2, n3, s2) * l2 % s2, w2 = J$3(p2, r2, s2) * p2 % s2, h4 = J$3(w2, o3, s2) * w2 % s2, g2 = J$3(h4, o3, s2) * w2 % s2, S3 = J$3(g2, e2, s2) * c2 % s2;
|
|
10182
|
+
return { pow_p_5_8: J$3(S3, Te$3, s2) * t2 % s2, b2: u2 };
|
|
10497
10183
|
}
|
|
10498
10184
|
function mr$2(t2) {
|
|
10499
10185
|
return t2[0] &= 248, t2[31] &= 127, t2[31] |= 64, t2;
|
|
@@ -10530,13 +10216,13 @@ function Ir$2(t2, e2) {
|
|
|
10530
10216
|
function l2(h4) {
|
|
10531
10217
|
if (h4 instanceof Uint8Array || (ArrayBuffer.isView(h4) ? h4 = new Uint8Array(h4.buffer, h4.byteOffset, h4.byteLength) : Array.isArray(h4) && (h4 = Uint8Array.from(h4))), !(h4 instanceof Uint8Array)) throw new TypeError("Expected Uint8Array");
|
|
10532
10218
|
if (h4.length === 0) return "";
|
|
10533
|
-
for (var g2 = 0,
|
|
10534
|
-
for (var d3 = (
|
|
10535
|
-
for (var F2 = h4[
|
|
10219
|
+
for (var g2 = 0, S3 = 0, v2 = 0, L2 = h4.length; v2 !== L2 && h4[v2] === 0; ) v2++, g2++;
|
|
10220
|
+
for (var d3 = (L2 - v2) * c2 + 1 >>> 0, m3 = new Uint8Array(d3); v2 !== L2; ) {
|
|
10221
|
+
for (var F2 = h4[v2], q3 = 0, z2 = d3 - 1; (F2 !== 0 || q3 < S3) && z2 !== -1; z2--, q3++) F2 += 256 * m3[z2] >>> 0, m3[z2] = F2 % u2 >>> 0, F2 = F2 / u2 >>> 0;
|
|
10536
10222
|
if (F2 !== 0) throw new Error("Non-zero carry");
|
|
10537
|
-
|
|
10223
|
+
S3 = q3, v2++;
|
|
10538
10224
|
}
|
|
10539
|
-
for (var I2 = d3 -
|
|
10225
|
+
for (var I2 = d3 - S3; I2 !== d3 && m3[I2] === 0; ) I2++;
|
|
10540
10226
|
for (var O3 = i3.repeat(g2); I2 < d3; ++I2) O3 += t2.charAt(m3[I2]);
|
|
10541
10227
|
return O3;
|
|
10542
10228
|
}
|
|
@@ -10545,17 +10231,17 @@ function Ir$2(t2, e2) {
|
|
|
10545
10231
|
if (h4.length === 0) return new Uint8Array();
|
|
10546
10232
|
var g2 = 0;
|
|
10547
10233
|
if (h4[g2] !== " ") {
|
|
10548
|
-
for (var
|
|
10549
|
-
for (var
|
|
10234
|
+
for (var S3 = 0, v2 = 0; h4[g2] === i3; ) S3++, g2++;
|
|
10235
|
+
for (var L2 = (h4.length - g2) * D2 + 1 >>> 0, d3 = new Uint8Array(L2); h4[g2]; ) {
|
|
10550
10236
|
var m3 = n3[h4.charCodeAt(g2)];
|
|
10551
10237
|
if (m3 === 255) return;
|
|
10552
|
-
for (var F2 = 0,
|
|
10238
|
+
for (var F2 = 0, q3 = L2 - 1; (m3 !== 0 || F2 < v2) && q3 !== -1; q3--, F2++) m3 += u2 * d3[q3] >>> 0, d3[q3] = m3 % 256 >>> 0, m3 = m3 / 256 >>> 0;
|
|
10553
10239
|
if (m3 !== 0) throw new Error("Non-zero carry");
|
|
10554
|
-
|
|
10240
|
+
v2 = F2, g2++;
|
|
10555
10241
|
}
|
|
10556
10242
|
if (h4[g2] !== " ") {
|
|
10557
|
-
for (var z2 =
|
|
10558
|
-
for (var I2 = new Uint8Array(
|
|
10243
|
+
for (var z2 = L2 - v2; z2 !== L2 && d3[z2] === 0; ) z2++;
|
|
10244
|
+
for (var I2 = new Uint8Array(S3 + (L2 - z2)), O3 = S3; z2 !== L2; ) I2[O3++] = d3[z2++];
|
|
10559
10245
|
return I2;
|
|
10560
10246
|
}
|
|
10561
10247
|
}
|
|
@@ -10939,12 +10625,12 @@ function detect(userAgent) {
|
|
|
10939
10625
|
}
|
|
10940
10626
|
function matchUserAgent(ua2) {
|
|
10941
10627
|
return ua2 !== "" && userAgentRules.reduce(function(matched, _a2) {
|
|
10942
|
-
var
|
|
10628
|
+
var browser = _a2[0], regex = _a2[1];
|
|
10943
10629
|
if (matched) {
|
|
10944
10630
|
return matched;
|
|
10945
10631
|
}
|
|
10946
10632
|
var uaMatch = regex.exec(ua2);
|
|
10947
|
-
return !!uaMatch && [
|
|
10633
|
+
return !!uaMatch && [browser, uaMatch];
|
|
10948
10634
|
}, false);
|
|
10949
10635
|
}
|
|
10950
10636
|
function parseUserAgent(ua2) {
|
|
@@ -11507,10 +11193,10 @@ for (let round = 0, R3 = _1n$5, x2 = 1, y3 = 0; round < 24; round++) {
|
|
|
11507
11193
|
SHA3_PI.push(2 * (5 * y3 + x2));
|
|
11508
11194
|
SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64);
|
|
11509
11195
|
let t2 = _0n$5;
|
|
11510
|
-
for (let
|
|
11196
|
+
for (let j2 = 0; j2 < 7; j2++) {
|
|
11511
11197
|
R3 = (R3 << _1n$5 ^ (R3 >> _7n) * _0x71n) % _256n;
|
|
11512
11198
|
if (R3 & _2n$2)
|
|
11513
|
-
t2 ^= _1n$5 << (_1n$5 << /* @__PURE__ */ BigInt(
|
|
11199
|
+
t2 ^= _1n$5 << (_1n$5 << /* @__PURE__ */ BigInt(j2)) - _1n$5;
|
|
11514
11200
|
}
|
|
11515
11201
|
_SHA3_IOTA.push(t2);
|
|
11516
11202
|
}
|
|
@@ -11752,16 +11438,16 @@ class SHA256 extends HashMD {
|
|
|
11752
11438
|
this.H = SHA256_IV[7] | 0;
|
|
11753
11439
|
}
|
|
11754
11440
|
get() {
|
|
11755
|
-
const { A: A2, B: B2, C: C2, D: D2, E:
|
|
11756
|
-
return [A2, B2, C2, D2,
|
|
11441
|
+
const { A: A2, B: B2, C: C2, D: D2, E: E2, F: F2, G: G2, H: H2 } = this;
|
|
11442
|
+
return [A2, B2, C2, D2, E2, F2, G2, H2];
|
|
11757
11443
|
}
|
|
11758
11444
|
// prettier-ignore
|
|
11759
|
-
set(A2, B2, C2, D2,
|
|
11445
|
+
set(A2, B2, C2, D2, E2, F2, G2, H2) {
|
|
11760
11446
|
this.A = A2 | 0;
|
|
11761
11447
|
this.B = B2 | 0;
|
|
11762
11448
|
this.C = C2 | 0;
|
|
11763
11449
|
this.D = D2 | 0;
|
|
11764
|
-
this.E =
|
|
11450
|
+
this.E = E2 | 0;
|
|
11765
11451
|
this.F = F2 | 0;
|
|
11766
11452
|
this.G = G2 | 0;
|
|
11767
11453
|
this.H = H2 | 0;
|
|
@@ -11776,16 +11462,16 @@ class SHA256 extends HashMD {
|
|
|
11776
11462
|
const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10;
|
|
11777
11463
|
SHA256_W[i3] = s1 + SHA256_W[i3 - 7] + s0 + SHA256_W[i3 - 16] | 0;
|
|
11778
11464
|
}
|
|
11779
|
-
let { A: A2, B: B2, C: C2, D: D2, E:
|
|
11465
|
+
let { A: A2, B: B2, C: C2, D: D2, E: E2, F: F2, G: G2, H: H2 } = this;
|
|
11780
11466
|
for (let i3 = 0; i3 < 64; i3++) {
|
|
11781
|
-
const sigma1 = rotr(
|
|
11782
|
-
const T1 = H2 + sigma1 + Chi(
|
|
11467
|
+
const sigma1 = rotr(E2, 6) ^ rotr(E2, 11) ^ rotr(E2, 25);
|
|
11468
|
+
const T1 = H2 + sigma1 + Chi(E2, F2, G2) + SHA256_K[i3] + SHA256_W[i3] | 0;
|
|
11783
11469
|
const sigma0 = rotr(A2, 2) ^ rotr(A2, 13) ^ rotr(A2, 22);
|
|
11784
11470
|
const T2 = sigma0 + Maj(A2, B2, C2) | 0;
|
|
11785
11471
|
H2 = G2;
|
|
11786
11472
|
G2 = F2;
|
|
11787
|
-
F2 =
|
|
11788
|
-
|
|
11473
|
+
F2 = E2;
|
|
11474
|
+
E2 = D2 + T1 | 0;
|
|
11789
11475
|
D2 = C2;
|
|
11790
11476
|
C2 = B2;
|
|
11791
11477
|
B2 = A2;
|
|
@@ -11795,11 +11481,11 @@ class SHA256 extends HashMD {
|
|
|
11795
11481
|
B2 = B2 + this.B | 0;
|
|
11796
11482
|
C2 = C2 + this.C | 0;
|
|
11797
11483
|
D2 = D2 + this.D | 0;
|
|
11798
|
-
|
|
11484
|
+
E2 = E2 + this.E | 0;
|
|
11799
11485
|
F2 = F2 + this.F | 0;
|
|
11800
11486
|
G2 = G2 + this.G | 0;
|
|
11801
11487
|
H2 = H2 + this.H | 0;
|
|
11802
|
-
this.set(A2, B2, C2, D2,
|
|
11488
|
+
this.set(A2, B2, C2, D2, E2, F2, G2, H2);
|
|
11803
11489
|
}
|
|
11804
11490
|
roundClean() {
|
|
11805
11491
|
clean(SHA256_W);
|
|
@@ -11949,22 +11635,22 @@ function createHmacDrbg(hashLen, qByteLen, hmacFn) {
|
|
|
11949
11635
|
throw new Error("qByteLen must be a number");
|
|
11950
11636
|
if (typeof hmacFn !== "function")
|
|
11951
11637
|
throw new Error("hmacFn must be a function");
|
|
11952
|
-
let
|
|
11638
|
+
let v2 = u8n(hashLen);
|
|
11953
11639
|
let k2 = u8n(hashLen);
|
|
11954
11640
|
let i3 = 0;
|
|
11955
11641
|
const reset = () => {
|
|
11956
|
-
|
|
11642
|
+
v2.fill(1);
|
|
11957
11643
|
k2.fill(0);
|
|
11958
11644
|
i3 = 0;
|
|
11959
11645
|
};
|
|
11960
|
-
const h4 = (...b2) => hmacFn(k2,
|
|
11646
|
+
const h4 = (...b2) => hmacFn(k2, v2, ...b2);
|
|
11961
11647
|
const reseed = (seed = u8n(0)) => {
|
|
11962
11648
|
k2 = h4(u8fr([0]), seed);
|
|
11963
|
-
|
|
11649
|
+
v2 = h4();
|
|
11964
11650
|
if (seed.length === 0)
|
|
11965
11651
|
return;
|
|
11966
11652
|
k2 = h4(u8fr([1]), seed);
|
|
11967
|
-
|
|
11653
|
+
v2 = h4();
|
|
11968
11654
|
};
|
|
11969
11655
|
const gen2 = () => {
|
|
11970
11656
|
if (i3++ >= 1e3)
|
|
@@ -11972,10 +11658,10 @@ function createHmacDrbg(hashLen, qByteLen, hmacFn) {
|
|
|
11972
11658
|
let len = 0;
|
|
11973
11659
|
const out = [];
|
|
11974
11660
|
while (len < qByteLen) {
|
|
11975
|
-
|
|
11976
|
-
const sl =
|
|
11661
|
+
v2 = h4();
|
|
11662
|
+
const sl = v2.slice();
|
|
11977
11663
|
out.push(sl);
|
|
11978
|
-
len +=
|
|
11664
|
+
len += v2.length;
|
|
11979
11665
|
}
|
|
11980
11666
|
return concatBytes(...out);
|
|
11981
11667
|
};
|
|
@@ -12313,11 +11999,11 @@ function fromHex$2(value, options = {}) {
|
|
|
12313
11999
|
hexString = `0${hexString}`;
|
|
12314
12000
|
const length = hexString.length / 2;
|
|
12315
12001
|
const bytes = new Uint8Array(length);
|
|
12316
|
-
for (let index = 0,
|
|
12317
|
-
const nibbleLeft = charCodeToBase16(hexString.charCodeAt(
|
|
12318
|
-
const nibbleRight = charCodeToBase16(hexString.charCodeAt(
|
|
12002
|
+
for (let index = 0, j2 = 0; index < length; index++) {
|
|
12003
|
+
const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j2++));
|
|
12004
|
+
const nibbleRight = charCodeToBase16(hexString.charCodeAt(j2++));
|
|
12319
12005
|
if (nibbleLeft === void 0 || nibbleRight === void 0) {
|
|
12320
|
-
throw new BaseError(`Invalid byte sequence ("${hexString[
|
|
12006
|
+
throw new BaseError(`Invalid byte sequence ("${hexString[j2 - 2]}${hexString[j2 - 1]}" in "${hexString}").`);
|
|
12321
12007
|
}
|
|
12322
12008
|
bytes[index] = nibbleLeft * 16 + nibbleRight;
|
|
12323
12009
|
}
|
|
@@ -12741,9 +12427,9 @@ function invert(number, modulo) {
|
|
|
12741
12427
|
let b2 = modulo;
|
|
12742
12428
|
let x2 = _0n$3, u2 = _1n$3;
|
|
12743
12429
|
while (a2 !== _0n$3) {
|
|
12744
|
-
const
|
|
12430
|
+
const q3 = b2 / a2;
|
|
12745
12431
|
const r2 = b2 % a2;
|
|
12746
|
-
const m3 = x2 - u2 *
|
|
12432
|
+
const m3 = x2 - u2 * q3;
|
|
12747
12433
|
b2 = a2, a2 = r2, x2 = u2, u2 = m3;
|
|
12748
12434
|
}
|
|
12749
12435
|
const gcd2 = b2;
|
|
@@ -12761,9 +12447,9 @@ function sqrt3mod4(Fp, n3) {
|
|
|
12761
12447
|
function sqrt5mod8(Fp, n3) {
|
|
12762
12448
|
const p5div8 = (Fp.ORDER - _5n) / _8n;
|
|
12763
12449
|
const n22 = Fp.mul(n3, _2n$1);
|
|
12764
|
-
const
|
|
12765
|
-
const nv = Fp.mul(n3,
|
|
12766
|
-
const i3 = Fp.mul(Fp.mul(nv, _2n$1),
|
|
12450
|
+
const v2 = Fp.pow(n22, p5div8);
|
|
12451
|
+
const nv = Fp.mul(n3, v2);
|
|
12452
|
+
const i3 = Fp.mul(Fp.mul(nv, _2n$1), v2);
|
|
12767
12453
|
const root = Fp.mul(nv, Fp.sub(i3, Fp.ONE));
|
|
12768
12454
|
if (!Fp.eql(Fp.sqr(root), n3))
|
|
12769
12455
|
throw new Error("Cannot find square root");
|
|
@@ -12773,10 +12459,10 @@ function tonelliShanks(P3) {
|
|
|
12773
12459
|
if (P3 < BigInt(3))
|
|
12774
12460
|
throw new Error("sqrt is not defined for small field");
|
|
12775
12461
|
let Q2 = P3 - _1n$3;
|
|
12776
|
-
let
|
|
12462
|
+
let S3 = 0;
|
|
12777
12463
|
while (Q2 % _2n$1 === _0n$3) {
|
|
12778
12464
|
Q2 /= _2n$1;
|
|
12779
|
-
|
|
12465
|
+
S3++;
|
|
12780
12466
|
}
|
|
12781
12467
|
let Z2 = _2n$1;
|
|
12782
12468
|
const _Fp = Field(P3);
|
|
@@ -12784,7 +12470,7 @@ function tonelliShanks(P3) {
|
|
|
12784
12470
|
if (Z2++ > 1e3)
|
|
12785
12471
|
throw new Error("Cannot find square root: probably non-prime P");
|
|
12786
12472
|
}
|
|
12787
|
-
if (
|
|
12473
|
+
if (S3 === 1)
|
|
12788
12474
|
return sqrt3mod4;
|
|
12789
12475
|
let cc2 = _Fp.pow(Z2, Q2);
|
|
12790
12476
|
const Q1div2 = (Q2 + _1n$3) / _2n$1;
|
|
@@ -12793,7 +12479,7 @@ function tonelliShanks(P3) {
|
|
|
12793
12479
|
return n3;
|
|
12794
12480
|
if (FpLegendre(Fp, n3) !== 1)
|
|
12795
12481
|
throw new Error("Cannot find square root");
|
|
12796
|
-
let M3 =
|
|
12482
|
+
let M3 = S3;
|
|
12797
12483
|
let c2 = Fp.mul(Fp.ONE, cc2);
|
|
12798
12484
|
let t2 = Fp.pow(n3, Q2);
|
|
12799
12485
|
let R3 = Fp.pow(n3, Q1div2);
|
|
@@ -13183,19 +12869,19 @@ function pippenger(c2, fieldN, points, scalars) {
|
|
|
13183
12869
|
let sum = zero;
|
|
13184
12870
|
for (let i3 = lastBits; i3 >= 0; i3 -= windowSize) {
|
|
13185
12871
|
buckets.fill(zero);
|
|
13186
|
-
for (let
|
|
13187
|
-
const scalar = scalars[
|
|
12872
|
+
for (let j2 = 0; j2 < slength; j2++) {
|
|
12873
|
+
const scalar = scalars[j2];
|
|
13188
12874
|
const wbits2 = Number(scalar >> BigInt(i3) & MASK);
|
|
13189
|
-
buckets[wbits2] = buckets[wbits2].add(points[
|
|
12875
|
+
buckets[wbits2] = buckets[wbits2].add(points[j2]);
|
|
13190
12876
|
}
|
|
13191
12877
|
let resI = zero;
|
|
13192
|
-
for (let
|
|
13193
|
-
sumI = sumI.add(buckets[
|
|
12878
|
+
for (let j2 = buckets.length - 1, sumI = zero; j2 > 0; j2--) {
|
|
12879
|
+
sumI = sumI.add(buckets[j2]);
|
|
13194
12880
|
resI = resI.add(sumI);
|
|
13195
12881
|
}
|
|
13196
12882
|
sum = sum.add(resI);
|
|
13197
12883
|
if (i3 !== 0)
|
|
13198
|
-
for (let
|
|
12884
|
+
for (let j2 = 0; j2 < windowSize; j2++)
|
|
13199
12885
|
sum = sum.double();
|
|
13200
12886
|
}
|
|
13201
12887
|
return sum;
|
|
@@ -13260,27 +12946,27 @@ const DER = {
|
|
|
13260
12946
|
// Basic building block is TLV (Tag-Length-Value)
|
|
13261
12947
|
_tlv: {
|
|
13262
12948
|
encode: (tag, data) => {
|
|
13263
|
-
const { Err:
|
|
12949
|
+
const { Err: E2 } = DER;
|
|
13264
12950
|
if (tag < 0 || tag > 256)
|
|
13265
|
-
throw new
|
|
12951
|
+
throw new E2("tlv.encode: wrong tag");
|
|
13266
12952
|
if (data.length & 1)
|
|
13267
|
-
throw new
|
|
12953
|
+
throw new E2("tlv.encode: unpadded data");
|
|
13268
12954
|
const dataLen = data.length / 2;
|
|
13269
12955
|
const len = numberToHexUnpadded(dataLen);
|
|
13270
12956
|
if (len.length / 2 & 128)
|
|
13271
|
-
throw new
|
|
12957
|
+
throw new E2("tlv.encode: long form length too big");
|
|
13272
12958
|
const lenLen = dataLen > 127 ? numberToHexUnpadded(len.length / 2 | 128) : "";
|
|
13273
12959
|
const t2 = numberToHexUnpadded(tag);
|
|
13274
12960
|
return t2 + lenLen + len + data;
|
|
13275
12961
|
},
|
|
13276
12962
|
// v - value, l - left bytes (unparsed)
|
|
13277
12963
|
decode(tag, data) {
|
|
13278
|
-
const { Err:
|
|
12964
|
+
const { Err: E2 } = DER;
|
|
13279
12965
|
let pos = 0;
|
|
13280
12966
|
if (tag < 0 || tag > 256)
|
|
13281
|
-
throw new
|
|
12967
|
+
throw new E2("tlv.encode: wrong tag");
|
|
13282
12968
|
if (data.length < 2 || data[pos++] !== tag)
|
|
13283
|
-
throw new
|
|
12969
|
+
throw new E2("tlv.decode: wrong tlv");
|
|
13284
12970
|
const first = data[pos++];
|
|
13285
12971
|
const isLong = !!(first & 128);
|
|
13286
12972
|
let length = 0;
|
|
@@ -13289,24 +12975,24 @@ const DER = {
|
|
|
13289
12975
|
else {
|
|
13290
12976
|
const lenLen = first & 127;
|
|
13291
12977
|
if (!lenLen)
|
|
13292
|
-
throw new
|
|
12978
|
+
throw new E2("tlv.decode(long): indefinite length not supported");
|
|
13293
12979
|
if (lenLen > 4)
|
|
13294
|
-
throw new
|
|
12980
|
+
throw new E2("tlv.decode(long): byte length is too big");
|
|
13295
12981
|
const lengthBytes = data.subarray(pos, pos + lenLen);
|
|
13296
12982
|
if (lengthBytes.length !== lenLen)
|
|
13297
|
-
throw new
|
|
12983
|
+
throw new E2("tlv.decode: length bytes not complete");
|
|
13298
12984
|
if (lengthBytes[0] === 0)
|
|
13299
|
-
throw new
|
|
12985
|
+
throw new E2("tlv.decode(long): zero leftmost byte");
|
|
13300
12986
|
for (const b2 of lengthBytes)
|
|
13301
12987
|
length = length << 8 | b2;
|
|
13302
12988
|
pos += lenLen;
|
|
13303
12989
|
if (length < 128)
|
|
13304
|
-
throw new
|
|
12990
|
+
throw new E2("tlv.decode(long): not minimal encoding");
|
|
13305
12991
|
}
|
|
13306
|
-
const
|
|
13307
|
-
if (
|
|
13308
|
-
throw new
|
|
13309
|
-
return { v:
|
|
12992
|
+
const v2 = data.subarray(pos, pos + length);
|
|
12993
|
+
if (v2.length !== length)
|
|
12994
|
+
throw new E2("tlv.decode: wrong value length");
|
|
12995
|
+
return { v: v2, l: data.subarray(pos + length) };
|
|
13310
12996
|
}
|
|
13311
12997
|
},
|
|
13312
12998
|
// https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,
|
|
@@ -13315,35 +13001,35 @@ const DER = {
|
|
|
13315
13001
|
// - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)
|
|
13316
13002
|
_int: {
|
|
13317
13003
|
encode(num) {
|
|
13318
|
-
const { Err:
|
|
13004
|
+
const { Err: E2 } = DER;
|
|
13319
13005
|
if (num < _0n$1)
|
|
13320
|
-
throw new
|
|
13006
|
+
throw new E2("integer: negative integers are not allowed");
|
|
13321
13007
|
let hex = numberToHexUnpadded(num);
|
|
13322
13008
|
if (Number.parseInt(hex[0], 16) & 8)
|
|
13323
13009
|
hex = "00" + hex;
|
|
13324
13010
|
if (hex.length & 1)
|
|
13325
|
-
throw new
|
|
13011
|
+
throw new E2("unexpected DER parsing assertion: unpadded hex");
|
|
13326
13012
|
return hex;
|
|
13327
13013
|
},
|
|
13328
13014
|
decode(data) {
|
|
13329
|
-
const { Err:
|
|
13015
|
+
const { Err: E2 } = DER;
|
|
13330
13016
|
if (data[0] & 128)
|
|
13331
|
-
throw new
|
|
13017
|
+
throw new E2("invalid signature integer: negative");
|
|
13332
13018
|
if (data[0] === 0 && !(data[1] & 128))
|
|
13333
|
-
throw new
|
|
13019
|
+
throw new E2("invalid signature integer: unnecessary leading zero");
|
|
13334
13020
|
return bytesToNumberBE(data);
|
|
13335
13021
|
}
|
|
13336
13022
|
},
|
|
13337
13023
|
toSig(hex) {
|
|
13338
|
-
const { Err:
|
|
13024
|
+
const { Err: E2, _int: int, _tlv: tlv } = DER;
|
|
13339
13025
|
const data = ensureBytes("signature", hex);
|
|
13340
13026
|
const { v: seqBytes, l: seqLeftBytes } = tlv.decode(48, data);
|
|
13341
13027
|
if (seqLeftBytes.length)
|
|
13342
|
-
throw new
|
|
13028
|
+
throw new E2("invalid signature: left bytes after parsing");
|
|
13343
13029
|
const { v: rBytes, l: rLeftBytes } = tlv.decode(2, seqBytes);
|
|
13344
13030
|
const { v: sBytes, l: sLeftBytes } = tlv.decode(2, rLeftBytes);
|
|
13345
13031
|
if (sLeftBytes.length)
|
|
13346
|
-
throw new
|
|
13032
|
+
throw new E2("invalid signature: left bytes after parsing");
|
|
13347
13033
|
return { r: int.decode(rBytes), s: int.decode(sBytes) };
|
|
13348
13034
|
},
|
|
13349
13035
|
hexFromSig(sig) {
|
|
@@ -14012,14 +13698,14 @@ function weierstrass(curveDef) {
|
|
|
14012
13698
|
if (!isWithinCurveOrder(k2))
|
|
14013
13699
|
return;
|
|
14014
13700
|
const ik = invN(k2);
|
|
14015
|
-
const
|
|
14016
|
-
const r2 = modN(
|
|
13701
|
+
const q3 = Point.BASE.multiply(k2).toAffine();
|
|
13702
|
+
const r2 = modN(q3.x);
|
|
14017
13703
|
if (r2 === _0n$1)
|
|
14018
13704
|
return;
|
|
14019
13705
|
const s2 = modN(ik * modN(m3 + r2 * d3));
|
|
14020
13706
|
if (s2 === _0n$1)
|
|
14021
13707
|
return;
|
|
14022
|
-
let recovery = (
|
|
13708
|
+
let recovery = (q3.x === r2 ? 0 : 2) | Number(q3.y & _1n$1);
|
|
14023
13709
|
let normS = s2;
|
|
14024
13710
|
if (lowS && isBiggerThanHalfOrder(s2)) {
|
|
14025
13711
|
normS = normalizeS(s2);
|
|
@@ -14086,8 +13772,8 @@ function weierstrass(curveDef) {
|
|
|
14086
13772
|
const R3 = Point.BASE.multiplyAndAddUnsafe(P3, u1, u2)?.toAffine();
|
|
14087
13773
|
if (!R3)
|
|
14088
13774
|
return false;
|
|
14089
|
-
const
|
|
14090
|
-
return
|
|
13775
|
+
const v2 = modN(R3.x);
|
|
13776
|
+
return v2 === r2;
|
|
14091
13777
|
}
|
|
14092
13778
|
return {
|
|
14093
13779
|
CURVE,
|
|
@@ -14205,14 +13891,14 @@ function fromHex(signature) {
|
|
|
14205
13891
|
yParity
|
|
14206
13892
|
};
|
|
14207
13893
|
}
|
|
14208
|
-
function vToYParity(
|
|
14209
|
-
if (
|
|
13894
|
+
function vToYParity(v2) {
|
|
13895
|
+
if (v2 === 0 || v2 === 27)
|
|
14210
13896
|
return 0;
|
|
14211
|
-
if (
|
|
13897
|
+
if (v2 === 1 || v2 === 28)
|
|
14212
13898
|
return 1;
|
|
14213
|
-
if (
|
|
14214
|
-
return
|
|
14215
|
-
throw new InvalidVError({ value:
|
|
13899
|
+
if (v2 >= 35)
|
|
13900
|
+
return v2 % 2 === 0 ? 1 : 0;
|
|
13901
|
+
throw new InvalidVError({ value: v2 });
|
|
14216
13902
|
}
|
|
14217
13903
|
class InvalidSerializedSizeError2 extends BaseError {
|
|
14218
13904
|
constructor({ signature }) {
|
|
@@ -14444,8 +14130,8 @@ function base$1(ALPHABET2) {
|
|
|
14444
14130
|
throw new TypeError("Alphabet too long");
|
|
14445
14131
|
}
|
|
14446
14132
|
const BASE_MAP = new Uint8Array(256);
|
|
14447
|
-
for (let
|
|
14448
|
-
BASE_MAP[
|
|
14133
|
+
for (let j2 = 0; j2 < BASE_MAP.length; j2++) {
|
|
14134
|
+
BASE_MAP[j2] = 255;
|
|
14449
14135
|
}
|
|
14450
14136
|
for (let i3 = 0; i3 < ALPHABET2.length; i3++) {
|
|
14451
14137
|
const x2 = ALPHABET2.charAt(i3);
|
|
@@ -14548,9 +14234,9 @@ function base$1(ALPHABET2) {
|
|
|
14548
14234
|
it4++;
|
|
14549
14235
|
}
|
|
14550
14236
|
const vch = new Uint8Array(zeroes + (size2 - it4));
|
|
14551
|
-
let
|
|
14237
|
+
let j2 = zeroes;
|
|
14552
14238
|
while (it4 !== size2) {
|
|
14553
|
-
vch[
|
|
14239
|
+
vch[j2++] = b256[it4++];
|
|
14554
14240
|
}
|
|
14555
14241
|
return vch;
|
|
14556
14242
|
}
|
|
@@ -15301,8 +14987,8 @@ class CachedKeyDecoder {
|
|
|
15301
14987
|
const records = this.caches[byteLength - 1];
|
|
15302
14988
|
FIND_CHUNK: for (const record of records) {
|
|
15303
14989
|
const recordBytes = record.bytes;
|
|
15304
|
-
for (let
|
|
15305
|
-
if (recordBytes[
|
|
14990
|
+
for (let j2 = 0; j2 < byteLength; j2++) {
|
|
14991
|
+
if (recordBytes[j2] !== bytes[inputOffset + j2]) {
|
|
15306
14992
|
continue FIND_CHUNK;
|
|
15307
14993
|
}
|
|
15308
14994
|
}
|
|
@@ -15982,8 +15668,8 @@ function base(ALPHABET2, name) {
|
|
|
15982
15668
|
throw new TypeError("Alphabet too long");
|
|
15983
15669
|
}
|
|
15984
15670
|
var BASE_MAP = new Uint8Array(256);
|
|
15985
|
-
for (var
|
|
15986
|
-
BASE_MAP[
|
|
15671
|
+
for (var j2 = 0; j2 < BASE_MAP.length; j2++) {
|
|
15672
|
+
BASE_MAP[j2] = 255;
|
|
15987
15673
|
}
|
|
15988
15674
|
for (var i3 = 0; i3 < ALPHABET2.length; i3++) {
|
|
15989
15675
|
var x2 = ALPHABET2.charAt(i3);
|
|
@@ -16088,9 +15774,9 @@ function base(ALPHABET2, name) {
|
|
|
16088
15774
|
it4++;
|
|
16089
15775
|
}
|
|
16090
15776
|
var vch = new Uint8Array(zeroes + (size2 - it4));
|
|
16091
|
-
var
|
|
15777
|
+
var j3 = zeroes;
|
|
16092
15778
|
while (it4 !== size2) {
|
|
16093
|
-
vch[
|
|
15779
|
+
vch[j3++] = b256[it4++];
|
|
16094
15780
|
}
|
|
16095
15781
|
return vch;
|
|
16096
15782
|
}
|
|
@@ -16647,26 +16333,26 @@ function requireBlake2b() {
|
|
|
16647
16333
|
if (hasRequiredBlake2b) return blake2b_1;
|
|
16648
16334
|
hasRequiredBlake2b = 1;
|
|
16649
16335
|
const util2 = requireUtil();
|
|
16650
|
-
function ADD64AA(
|
|
16651
|
-
const o0 =
|
|
16652
|
-
let o1 =
|
|
16336
|
+
function ADD64AA(v3, a2, b2) {
|
|
16337
|
+
const o0 = v3[a2] + v3[b2];
|
|
16338
|
+
let o1 = v3[a2 + 1] + v3[b2 + 1];
|
|
16653
16339
|
if (o0 >= 4294967296) {
|
|
16654
16340
|
o1++;
|
|
16655
16341
|
}
|
|
16656
|
-
|
|
16657
|
-
|
|
16342
|
+
v3[a2] = o0;
|
|
16343
|
+
v3[a2 + 1] = o1;
|
|
16658
16344
|
}
|
|
16659
|
-
function ADD64AC(
|
|
16660
|
-
let o0 =
|
|
16345
|
+
function ADD64AC(v3, a2, b0, b1) {
|
|
16346
|
+
let o0 = v3[a2] + b0;
|
|
16661
16347
|
if (b0 < 0) {
|
|
16662
16348
|
o0 += 4294967296;
|
|
16663
16349
|
}
|
|
16664
|
-
let o1 =
|
|
16350
|
+
let o1 = v3[a2 + 1] + b1;
|
|
16665
16351
|
if (o0 >= 4294967296) {
|
|
16666
16352
|
o1++;
|
|
16667
16353
|
}
|
|
16668
|
-
|
|
16669
|
-
|
|
16354
|
+
v3[a2] = o0;
|
|
16355
|
+
v3[a2 + 1] = o1;
|
|
16670
16356
|
}
|
|
16671
16357
|
function B2B_GET32(arr, i3) {
|
|
16672
16358
|
return arr[i3] ^ arr[i3 + 1] << 8 ^ arr[i3 + 2] << 16 ^ arr[i3 + 3] << 24;
|
|
@@ -16676,28 +16362,28 @@ function requireBlake2b() {
|
|
|
16676
16362
|
const x1 = m3[ix + 1];
|
|
16677
16363
|
const y0 = m3[iy];
|
|
16678
16364
|
const y1 = m3[iy + 1];
|
|
16679
|
-
ADD64AA(
|
|
16680
|
-
ADD64AC(
|
|
16681
|
-
let xor0 =
|
|
16682
|
-
let xor1 =
|
|
16683
|
-
|
|
16684
|
-
|
|
16685
|
-
ADD64AA(
|
|
16686
|
-
xor0 =
|
|
16687
|
-
xor1 =
|
|
16688
|
-
|
|
16689
|
-
|
|
16690
|
-
ADD64AA(
|
|
16691
|
-
ADD64AC(
|
|
16692
|
-
xor0 =
|
|
16693
|
-
xor1 =
|
|
16694
|
-
|
|
16695
|
-
|
|
16696
|
-
ADD64AA(
|
|
16697
|
-
xor0 =
|
|
16698
|
-
xor1 =
|
|
16699
|
-
|
|
16700
|
-
|
|
16365
|
+
ADD64AA(v2, a2, b2);
|
|
16366
|
+
ADD64AC(v2, a2, x0, x1);
|
|
16367
|
+
let xor0 = v2[d3] ^ v2[a2];
|
|
16368
|
+
let xor1 = v2[d3 + 1] ^ v2[a2 + 1];
|
|
16369
|
+
v2[d3] = xor1;
|
|
16370
|
+
v2[d3 + 1] = xor0;
|
|
16371
|
+
ADD64AA(v2, c2, d3);
|
|
16372
|
+
xor0 = v2[b2] ^ v2[c2];
|
|
16373
|
+
xor1 = v2[b2 + 1] ^ v2[c2 + 1];
|
|
16374
|
+
v2[b2] = xor0 >>> 24 ^ xor1 << 8;
|
|
16375
|
+
v2[b2 + 1] = xor1 >>> 24 ^ xor0 << 8;
|
|
16376
|
+
ADD64AA(v2, a2, b2);
|
|
16377
|
+
ADD64AC(v2, a2, y0, y1);
|
|
16378
|
+
xor0 = v2[d3] ^ v2[a2];
|
|
16379
|
+
xor1 = v2[d3 + 1] ^ v2[a2 + 1];
|
|
16380
|
+
v2[d3] = xor0 >>> 16 ^ xor1 << 16;
|
|
16381
|
+
v2[d3 + 1] = xor1 >>> 16 ^ xor0 << 16;
|
|
16382
|
+
ADD64AA(v2, c2, d3);
|
|
16383
|
+
xor0 = v2[b2] ^ v2[c2];
|
|
16384
|
+
xor1 = v2[b2 + 1] ^ v2[c2 + 1];
|
|
16385
|
+
v2[b2] = xor1 >>> 31 ^ xor0 << 1;
|
|
16386
|
+
v2[b2 + 1] = xor0 >>> 31 ^ xor1 << 1;
|
|
16701
16387
|
}
|
|
16702
16388
|
const BLAKE2B_IV32 = new Uint32Array([
|
|
16703
16389
|
4089235720,
|
|
@@ -16916,19 +16602,19 @@ function requireBlake2b() {
|
|
|
16916
16602
|
return x2 * 2;
|
|
16917
16603
|
})
|
|
16918
16604
|
);
|
|
16919
|
-
const
|
|
16605
|
+
const v2 = new Uint32Array(32);
|
|
16920
16606
|
const m3 = new Uint32Array(32);
|
|
16921
16607
|
function blake2bCompress(ctx, last) {
|
|
16922
16608
|
let i3 = 0;
|
|
16923
16609
|
for (i3 = 0; i3 < 16; i3++) {
|
|
16924
|
-
|
|
16925
|
-
|
|
16610
|
+
v2[i3] = ctx.h[i3];
|
|
16611
|
+
v2[i3 + 16] = BLAKE2B_IV32[i3];
|
|
16926
16612
|
}
|
|
16927
|
-
|
|
16928
|
-
|
|
16613
|
+
v2[24] = v2[24] ^ ctx.t;
|
|
16614
|
+
v2[25] = v2[25] ^ ctx.t / 4294967296;
|
|
16929
16615
|
if (last) {
|
|
16930
|
-
|
|
16931
|
-
|
|
16616
|
+
v2[28] = ~v2[28];
|
|
16617
|
+
v2[29] = ~v2[29];
|
|
16932
16618
|
}
|
|
16933
16619
|
for (i3 = 0; i3 < 32; i3++) {
|
|
16934
16620
|
m3[i3] = B2B_GET32(ctx.b, 4 * i3);
|
|
@@ -16944,7 +16630,7 @@ function requireBlake2b() {
|
|
|
16944
16630
|
B2B_G(6, 8, 18, 28, SIGMA82[i3 * 16 + 14], SIGMA82[i3 * 16 + 15]);
|
|
16945
16631
|
}
|
|
16946
16632
|
for (i3 = 0; i3 < 16; i3++) {
|
|
16947
|
-
ctx.h[i3] = ctx.h[i3] ^
|
|
16633
|
+
ctx.h[i3] = ctx.h[i3] ^ v2[i3] ^ v2[i3 + 16];
|
|
16948
16634
|
}
|
|
16949
16635
|
}
|
|
16950
16636
|
const parameterBlock = new Uint8Array([
|
|
@@ -17122,18 +16808,18 @@ function requireBlake2s() {
|
|
|
17122
16808
|
if (hasRequiredBlake2s) return blake2s_1;
|
|
17123
16809
|
hasRequiredBlake2s = 1;
|
|
17124
16810
|
const util2 = requireUtil();
|
|
17125
|
-
function B2S_GET32(
|
|
17126
|
-
return
|
|
16811
|
+
function B2S_GET32(v3, i3) {
|
|
16812
|
+
return v3[i3] ^ v3[i3 + 1] << 8 ^ v3[i3 + 2] << 16 ^ v3[i3 + 3] << 24;
|
|
17127
16813
|
}
|
|
17128
16814
|
function B2S_G(a2, b2, c2, d3, x2, y3) {
|
|
17129
|
-
|
|
17130
|
-
|
|
17131
|
-
|
|
17132
|
-
|
|
17133
|
-
|
|
17134
|
-
|
|
17135
|
-
|
|
17136
|
-
|
|
16815
|
+
v2[a2] = v2[a2] + v2[b2] + x2;
|
|
16816
|
+
v2[d3] = ROTR32(v2[d3] ^ v2[a2], 16);
|
|
16817
|
+
v2[c2] = v2[c2] + v2[d3];
|
|
16818
|
+
v2[b2] = ROTR32(v2[b2] ^ v2[c2], 12);
|
|
16819
|
+
v2[a2] = v2[a2] + v2[b2] + y3;
|
|
16820
|
+
v2[d3] = ROTR32(v2[d3] ^ v2[a2], 8);
|
|
16821
|
+
v2[c2] = v2[c2] + v2[d3];
|
|
16822
|
+
v2[b2] = ROTR32(v2[b2] ^ v2[c2], 7);
|
|
17137
16823
|
}
|
|
17138
16824
|
function ROTR32(x2, y3) {
|
|
17139
16825
|
return x2 >>> y3 ^ x2 << 32 - y3;
|
|
@@ -17310,18 +16996,18 @@ function requireBlake2s() {
|
|
|
17310
16996
|
13,
|
|
17311
16997
|
0
|
|
17312
16998
|
]);
|
|
17313
|
-
const
|
|
16999
|
+
const v2 = new Uint32Array(16);
|
|
17314
17000
|
const m3 = new Uint32Array(16);
|
|
17315
17001
|
function blake2sCompress(ctx, last) {
|
|
17316
17002
|
let i3 = 0;
|
|
17317
17003
|
for (i3 = 0; i3 < 8; i3++) {
|
|
17318
|
-
|
|
17319
|
-
|
|
17004
|
+
v2[i3] = ctx.h[i3];
|
|
17005
|
+
v2[i3 + 8] = BLAKE2S_IV[i3];
|
|
17320
17006
|
}
|
|
17321
|
-
|
|
17322
|
-
|
|
17007
|
+
v2[12] ^= ctx.t;
|
|
17008
|
+
v2[13] ^= ctx.t / 4294967296;
|
|
17323
17009
|
if (last) {
|
|
17324
|
-
|
|
17010
|
+
v2[14] = ~v2[14];
|
|
17325
17011
|
}
|
|
17326
17012
|
for (i3 = 0; i3 < 16; i3++) {
|
|
17327
17013
|
m3[i3] = B2S_GET32(ctx.b, 4 * i3);
|
|
@@ -17337,7 +17023,7 @@ function requireBlake2s() {
|
|
|
17337
17023
|
B2S_G(3, 4, 9, 14, m3[SIGMA[i3 * 16 + 14]], m3[SIGMA[i3 * 16 + 15]]);
|
|
17338
17024
|
}
|
|
17339
17025
|
for (i3 = 0; i3 < 8; i3++) {
|
|
17340
|
-
ctx.h[i3] ^=
|
|
17026
|
+
ctx.h[i3] ^= v2[i3] ^ v2[i3 + 8];
|
|
17341
17027
|
}
|
|
17342
17028
|
}
|
|
17343
17029
|
function blake2sInit(outlen, key) {
|
|
@@ -17997,12 +17683,12 @@ let dn$1 = class dn extends qr$1 {
|
|
|
17997
17683
|
process(e2, n3) {
|
|
17998
17684
|
for (let R3 = 0; R3 < 16; R3++, n3 += 4) Tt$2[R3] = e2.getUint32(n3), Ct$2[R3] = e2.getUint32(n3 += 4);
|
|
17999
17685
|
for (let R3 = 16; R3 < 80; R3++) {
|
|
18000
|
-
const Z2 = Tt$2[R3 - 15] | 0, H2 = Ct$2[R3 - 15] | 0,
|
|
17686
|
+
const Z2 = Tt$2[R3 - 15] | 0, H2 = Ct$2[R3 - 15] | 0, j2 = St$3(Z2, H2, 1) ^ St$3(Z2, H2, 8) ^ Rr$1(Z2, H2, 7), L2 = Ot$2(Z2, H2, 1) ^ Ot$2(Z2, H2, 8) ^ $r$1(Z2, H2, 7), k2 = Tt$2[R3 - 2] | 0, O3 = Ct$2[R3 - 2] | 0, T2 = St$3(k2, O3, 19) ^ de$1(k2, O3, 61) ^ Rr$1(k2, O3, 6), C2 = Ot$2(k2, O3, 19) ^ he$2(k2, O3, 61) ^ $r$1(k2, O3, 6), _3 = Zi(L2, C2, Ct$2[R3 - 7], Ct$2[R3 - 16]), p2 = Gi$1(_3, j2, T2, Tt$2[R3 - 7], Tt$2[R3 - 16]);
|
|
18001
17687
|
Tt$2[R3] = p2 | 0, Ct$2[R3] = _3 | 0;
|
|
18002
17688
|
}
|
|
18003
17689
|
let { Ah: r2, Al: o3, Bh: s2, Bl: i3, Ch: c2, Cl: f4, Dh: u2, Dl: a2, Eh: l2, El: d3, Fh: h4, Fl: y3, Gh: m3, Gl: w2, Hh: U2, Hl: F2 } = this;
|
|
18004
17690
|
for (let R3 = 0; R3 < 80; R3++) {
|
|
18005
|
-
const Z2 = St$3(l2, d3, 14) ^ St$3(l2, d3, 18) ^ de$1(l2, d3, 41), H2 = Ot$2(l2, d3, 14) ^ Ot$2(l2, d3, 18) ^ he$2(l2, d3, 41),
|
|
17691
|
+
const Z2 = St$3(l2, d3, 14) ^ St$3(l2, d3, 18) ^ de$1(l2, d3, 41), H2 = Ot$2(l2, d3, 14) ^ Ot$2(l2, d3, 18) ^ he$2(l2, d3, 41), j2 = l2 & h4 ^ ~l2 & m3, L2 = d3 & y3 ^ ~d3 & w2, k2 = zi$1(F2, H2, L2, gc[R3], Ct$2[R3]), O3 = Yi(k2, U2, Z2, j2, pc[R3], Tt$2[R3]), T2 = k2 | 0, C2 = St$3(r2, o3, 28) ^ de$1(r2, o3, 34) ^ de$1(r2, o3, 39), _3 = Ot$2(r2, o3, 28) ^ he$2(r2, o3, 34) ^ he$2(r2, o3, 39), p2 = r2 & s2 ^ r2 & c2 ^ s2 & c2, b2 = o3 & i3 ^ o3 & f4 ^ i3 & f4;
|
|
18006
17692
|
U2 = m3 | 0, F2 = w2 | 0, m3 = h4 | 0, w2 = y3 | 0, h4 = l2 | 0, y3 = d3 | 0, { h: l2, l: d3 } = dt$2(u2 | 0, a2 | 0, O3 | 0, T2 | 0), u2 = c2 | 0, a2 = f4 | 0, c2 = s2 | 0, f4 = i3 | 0, s2 = r2 | 0, i3 = o3 | 0;
|
|
18007
17693
|
const g2 = fn$1(T2, _3, b2);
|
|
18008
17694
|
r2 = an$1(g2, O3, C2, p2), o3 = g2 | 0;
|
|
@@ -18249,7 +17935,7 @@ const ro$1 = (t2, e2) => {
|
|
|
18249
17935
|
if (!t2.aud && !t2.uri) throw new Error("Either `aud` or `uri` is required to construct the message");
|
|
18250
17936
|
let s2 = t2.statement || void 0;
|
|
18251
17937
|
const i3 = `URI: ${t2.aud || t2.uri}`, c2 = `Version: ${t2.version}`, f4 = `Chain ID: ${to$1(e2)}`, u2 = `Nonce: ${t2.nonce}`, a2 = `Issued At: ${t2.iat}`, l2 = t2.exp ? `Expiration Time: ${t2.exp}` : void 0, d3 = t2.nbf ? `Not Before: ${t2.nbf}` : void 0, h4 = t2.requestId ? `Request ID: ${t2.requestId}` : void 0, y3 = t2.resources ? `Resources:${t2.resources.map((w2) => `
|
|
18252
|
-
- ${w2}`).join("")}` : void 0, m3 =
|
|
17938
|
+
- ${w2}`).join("")}` : void 0, m3 = je2(t2.resources);
|
|
18253
17939
|
if (m3) {
|
|
18254
17940
|
const w2 = kt$2(m3);
|
|
18255
17941
|
s2 = wn$1(s2, w2);
|
|
@@ -18357,7 +18043,7 @@ function Yc(t2) {
|
|
|
18357
18043
|
});
|
|
18358
18044
|
}), [...new Set(n3.flat())];
|
|
18359
18045
|
}
|
|
18360
|
-
function
|
|
18046
|
+
function je2(t2) {
|
|
18361
18047
|
if (!t2) return;
|
|
18362
18048
|
const e2 = t2?.[t2.length - 1];
|
|
18363
18049
|
return mn$1(e2) ? e2 : void 0;
|
|
@@ -18526,27 +18212,27 @@ class hf {
|
|
|
18526
18212
|
for (let a2 = 0; a2 < 8; a2++) this.pad[a2] = W$2(e2, 16 + 2 * a2);
|
|
18527
18213
|
}
|
|
18528
18214
|
process(e2, n3, r2 = false) {
|
|
18529
|
-
const o3 = r2 ? 0 : 2048, { h: s2, r: i3 } = this, c2 = i3[0], f4 = i3[1], u2 = i3[2], a2 = i3[3], l2 = i3[4], d3 = i3[5], h4 = i3[6], y3 = i3[7], m3 = i3[8], w2 = i3[9], U2 = W$2(e2, n3 + 0), F2 = W$2(e2, n3 + 2), R3 = W$2(e2, n3 + 4), Z2 = W$2(e2, n3 + 6), H2 = W$2(e2, n3 + 8),
|
|
18530
|
-
let O3 = s2[0] + (U2 & 8191), T2 = s2[1] + ((U2 >>> 13 | F2 << 3) & 8191), C2 = s2[2] + ((F2 >>> 10 | R3 << 6) & 8191), _3 = s2[3] + ((R3 >>> 7 | Z2 << 9) & 8191), p2 = s2[4] + ((Z2 >>> 4 | H2 << 12) & 8191), b2 = s2[5] + (H2 >>> 1 & 8191), g2 = s2[6] + ((H2 >>> 14 |
|
|
18531
|
-
|
|
18532
|
-
let A2 =
|
|
18533
|
-
|
|
18534
|
-
let N2 =
|
|
18535
|
-
|
|
18536
|
-
let D2 =
|
|
18537
|
-
|
|
18538
|
-
let P3 =
|
|
18539
|
-
|
|
18540
|
-
let $2 =
|
|
18541
|
-
|
|
18542
|
-
let V3 =
|
|
18543
|
-
|
|
18544
|
-
let
|
|
18545
|
-
|
|
18546
|
-
let G2 =
|
|
18547
|
-
|
|
18548
|
-
let M3 =
|
|
18549
|
-
|
|
18215
|
+
const o3 = r2 ? 0 : 2048, { h: s2, r: i3 } = this, c2 = i3[0], f4 = i3[1], u2 = i3[2], a2 = i3[3], l2 = i3[4], d3 = i3[5], h4 = i3[6], y3 = i3[7], m3 = i3[8], w2 = i3[9], U2 = W$2(e2, n3 + 0), F2 = W$2(e2, n3 + 2), R3 = W$2(e2, n3 + 4), Z2 = W$2(e2, n3 + 6), H2 = W$2(e2, n3 + 8), j2 = W$2(e2, n3 + 10), L2 = W$2(e2, n3 + 12), k2 = W$2(e2, n3 + 14);
|
|
18216
|
+
let O3 = s2[0] + (U2 & 8191), T2 = s2[1] + ((U2 >>> 13 | F2 << 3) & 8191), C2 = s2[2] + ((F2 >>> 10 | R3 << 6) & 8191), _3 = s2[3] + ((R3 >>> 7 | Z2 << 9) & 8191), p2 = s2[4] + ((Z2 >>> 4 | H2 << 12) & 8191), b2 = s2[5] + (H2 >>> 1 & 8191), g2 = s2[6] + ((H2 >>> 14 | j2 << 2) & 8191), x2 = s2[7] + ((j2 >>> 11 | L2 << 5) & 8191), E2 = s2[8] + ((L2 >>> 8 | k2 << 8) & 8191), I2 = s2[9] + (k2 >>> 5 | o3), v2 = 0, B2 = v2 + O3 * c2 + T2 * (5 * w2) + C2 * (5 * m3) + _3 * (5 * y3) + p2 * (5 * h4);
|
|
18217
|
+
v2 = B2 >>> 13, B2 &= 8191, B2 += b2 * (5 * d3) + g2 * (5 * l2) + x2 * (5 * a2) + E2 * (5 * u2) + I2 * (5 * f4), v2 += B2 >>> 13, B2 &= 8191;
|
|
18218
|
+
let A2 = v2 + O3 * f4 + T2 * c2 + C2 * (5 * w2) + _3 * (5 * m3) + p2 * (5 * y3);
|
|
18219
|
+
v2 = A2 >>> 13, A2 &= 8191, A2 += b2 * (5 * h4) + g2 * (5 * d3) + x2 * (5 * l2) + E2 * (5 * a2) + I2 * (5 * u2), v2 += A2 >>> 13, A2 &= 8191;
|
|
18220
|
+
let N2 = v2 + O3 * u2 + T2 * f4 + C2 * c2 + _3 * (5 * w2) + p2 * (5 * m3);
|
|
18221
|
+
v2 = N2 >>> 13, N2 &= 8191, N2 += b2 * (5 * y3) + g2 * (5 * h4) + x2 * (5 * d3) + E2 * (5 * l2) + I2 * (5 * a2), v2 += N2 >>> 13, N2 &= 8191;
|
|
18222
|
+
let D2 = v2 + O3 * a2 + T2 * u2 + C2 * f4 + _3 * c2 + p2 * (5 * w2);
|
|
18223
|
+
v2 = D2 >>> 13, D2 &= 8191, D2 += b2 * (5 * m3) + g2 * (5 * y3) + x2 * (5 * h4) + E2 * (5 * d3) + I2 * (5 * l2), v2 += D2 >>> 13, D2 &= 8191;
|
|
18224
|
+
let P3 = v2 + O3 * l2 + T2 * a2 + C2 * u2 + _3 * f4 + p2 * c2;
|
|
18225
|
+
v2 = P3 >>> 13, P3 &= 8191, P3 += b2 * (5 * w2) + g2 * (5 * m3) + x2 * (5 * y3) + E2 * (5 * h4) + I2 * (5 * d3), v2 += P3 >>> 13, P3 &= 8191;
|
|
18226
|
+
let $2 = v2 + O3 * d3 + T2 * l2 + C2 * a2 + _3 * u2 + p2 * f4;
|
|
18227
|
+
v2 = $2 >>> 13, $2 &= 8191, $2 += b2 * c2 + g2 * (5 * w2) + x2 * (5 * m3) + E2 * (5 * y3) + I2 * (5 * h4), v2 += $2 >>> 13, $2 &= 8191;
|
|
18228
|
+
let V3 = v2 + O3 * h4 + T2 * d3 + C2 * l2 + _3 * a2 + p2 * u2;
|
|
18229
|
+
v2 = V3 >>> 13, V3 &= 8191, V3 += b2 * f4 + g2 * c2 + x2 * (5 * w2) + E2 * (5 * m3) + I2 * (5 * y3), v2 += V3 >>> 13, V3 &= 8191;
|
|
18230
|
+
let q3 = v2 + O3 * y3 + T2 * h4 + C2 * d3 + _3 * l2 + p2 * a2;
|
|
18231
|
+
v2 = q3 >>> 13, q3 &= 8191, q3 += b2 * u2 + g2 * f4 + x2 * c2 + E2 * (5 * w2) + I2 * (5 * m3), v2 += q3 >>> 13, q3 &= 8191;
|
|
18232
|
+
let G2 = v2 + O3 * m3 + T2 * y3 + C2 * h4 + _3 * d3 + p2 * l2;
|
|
18233
|
+
v2 = G2 >>> 13, G2 &= 8191, G2 += b2 * a2 + g2 * u2 + x2 * f4 + E2 * c2 + I2 * (5 * w2), v2 += G2 >>> 13, G2 &= 8191;
|
|
18234
|
+
let M3 = v2 + O3 * w2 + T2 * m3 + C2 * y3 + _3 * h4 + p2 * d3;
|
|
18235
|
+
v2 = M3 >>> 13, M3 &= 8191, M3 += b2 * l2 + g2 * a2 + x2 * u2 + E2 * f4 + I2 * c2, v2 += M3 >>> 13, M3 &= 8191, v2 = (v2 << 2) + v2 | 0, v2 = v2 + B2 | 0, B2 = v2 & 8191, v2 = v2 >>> 13, A2 += v2, s2[0] = B2, s2[1] = A2, s2[2] = N2, s2[3] = D2, s2[4] = P3, s2[5] = $2, s2[6] = V3, s2[7] = q3, s2[8] = G2, s2[9] = M3;
|
|
18550
18236
|
}
|
|
18551
18237
|
finalize() {
|
|
18552
18238
|
const { h: e2, pad: n3 } = this, r2 = new Uint16Array(10);
|
|
@@ -18608,10 +18294,10 @@ function pf(t2) {
|
|
|
18608
18294
|
}
|
|
18609
18295
|
const gf = pf((t2) => new hf(t2));
|
|
18610
18296
|
function bf(t2, e2, n3, r2, o3, s2 = 20) {
|
|
18611
|
-
let i3 = t2[0], c2 = t2[1], f4 = t2[2], u2 = t2[3], a2 = e2[0], l2 = e2[1], d3 = e2[2], h4 = e2[3], y3 = e2[4], m3 = e2[5], w2 = e2[6], U2 = e2[7], F2 = o3, R3 = n3[0], Z2 = n3[1], H2 = n3[2],
|
|
18612
|
-
for (let D2 = 0; D2 < s2; D2 += 2)
|
|
18297
|
+
let i3 = t2[0], c2 = t2[1], f4 = t2[2], u2 = t2[3], a2 = e2[0], l2 = e2[1], d3 = e2[2], h4 = e2[3], y3 = e2[4], m3 = e2[5], w2 = e2[6], U2 = e2[7], F2 = o3, R3 = n3[0], Z2 = n3[1], H2 = n3[2], j2 = i3, L2 = c2, k2 = f4, O3 = u2, T2 = a2, C2 = l2, _3 = d3, p2 = h4, b2 = y3, g2 = m3, x2 = w2, E2 = U2, I2 = F2, v2 = R3, B2 = Z2, A2 = H2;
|
|
18298
|
+
for (let D2 = 0; D2 < s2; D2 += 2) j2 = j2 + T2 | 0, I2 = K$2(I2 ^ j2, 16), b2 = b2 + I2 | 0, T2 = K$2(T2 ^ b2, 12), j2 = j2 + T2 | 0, I2 = K$2(I2 ^ j2, 8), b2 = b2 + I2 | 0, T2 = K$2(T2 ^ b2, 7), L2 = L2 + C2 | 0, v2 = K$2(v2 ^ L2, 16), g2 = g2 + v2 | 0, C2 = K$2(C2 ^ g2, 12), L2 = L2 + C2 | 0, v2 = K$2(v2 ^ L2, 8), g2 = g2 + v2 | 0, C2 = K$2(C2 ^ g2, 7), k2 = k2 + _3 | 0, B2 = K$2(B2 ^ k2, 16), x2 = x2 + B2 | 0, _3 = K$2(_3 ^ x2, 12), k2 = k2 + _3 | 0, B2 = K$2(B2 ^ k2, 8), x2 = x2 + B2 | 0, _3 = K$2(_3 ^ x2, 7), O3 = O3 + p2 | 0, A2 = K$2(A2 ^ O3, 16), E2 = E2 + A2 | 0, p2 = K$2(p2 ^ E2, 12), O3 = O3 + p2 | 0, A2 = K$2(A2 ^ O3, 8), E2 = E2 + A2 | 0, p2 = K$2(p2 ^ E2, 7), j2 = j2 + C2 | 0, A2 = K$2(A2 ^ j2, 16), x2 = x2 + A2 | 0, C2 = K$2(C2 ^ x2, 12), j2 = j2 + C2 | 0, A2 = K$2(A2 ^ j2, 8), x2 = x2 + A2 | 0, C2 = K$2(C2 ^ x2, 7), L2 = L2 + _3 | 0, I2 = K$2(I2 ^ L2, 16), E2 = E2 + I2 | 0, _3 = K$2(_3 ^ E2, 12), L2 = L2 + _3 | 0, I2 = K$2(I2 ^ L2, 8), E2 = E2 + I2 | 0, _3 = K$2(_3 ^ E2, 7), k2 = k2 + p2 | 0, v2 = K$2(v2 ^ k2, 16), b2 = b2 + v2 | 0, p2 = K$2(p2 ^ b2, 12), k2 = k2 + p2 | 0, v2 = K$2(v2 ^ k2, 8), b2 = b2 + v2 | 0, p2 = K$2(p2 ^ b2, 7), O3 = O3 + T2 | 0, B2 = K$2(B2 ^ O3, 16), g2 = g2 + B2 | 0, T2 = K$2(T2 ^ g2, 12), O3 = O3 + T2 | 0, B2 = K$2(B2 ^ O3, 8), g2 = g2 + B2 | 0, T2 = K$2(T2 ^ g2, 7);
|
|
18613
18299
|
let N2 = 0;
|
|
18614
|
-
r2[N2++] = i3 +
|
|
18300
|
+
r2[N2++] = i3 + j2 | 0, r2[N2++] = c2 + L2 | 0, r2[N2++] = f4 + k2 | 0, r2[N2++] = u2 + O3 | 0, r2[N2++] = a2 + T2 | 0, r2[N2++] = l2 + C2 | 0, r2[N2++] = d3 + _3 | 0, r2[N2++] = h4 + p2 | 0, r2[N2++] = y3 + b2 | 0, r2[N2++] = m3 + g2 | 0, r2[N2++] = w2 + x2 | 0, r2[N2++] = U2 + E2 | 0, r2[N2++] = F2 + I2 | 0, r2[N2++] = R3 + v2 | 0, r2[N2++] = Z2 + B2 | 0, r2[N2++] = H2 + A2 | 0;
|
|
18615
18301
|
}
|
|
18616
18302
|
const yf = df(bf, { counterRight: false, counterLength: 4, allowShortKeys: false }), mf = new Uint8Array(16), xo$1 = (t2, e2) => {
|
|
18617
18303
|
t2.update(e2);
|
|
@@ -19105,33 +18791,33 @@ function Mf(t2) {
|
|
|
19105
18791
|
if (g2 === we$2) throw new Error("invalid private or public key received");
|
|
19106
18792
|
return F2(g2);
|
|
19107
18793
|
}
|
|
19108
|
-
function
|
|
18794
|
+
function j2(p2) {
|
|
19109
18795
|
return H2(p2, U2);
|
|
19110
18796
|
}
|
|
19111
|
-
function
|
|
18797
|
+
function L2(p2, b2, g2) {
|
|
19112
18798
|
const x2 = w2(p2 * (b2 - g2));
|
|
19113
18799
|
return b2 = w2(b2 - x2), g2 = w2(g2 + x2), { x_2: b2, x_3: g2 };
|
|
19114
18800
|
}
|
|
19115
18801
|
function k2(p2, b2) {
|
|
19116
18802
|
Rn$1("u", p2, we$2, n3), Rn$1("scalar", b2, h4, m3);
|
|
19117
18803
|
const g2 = b2, x2 = p2;
|
|
19118
|
-
let
|
|
18804
|
+
let E2 = ee$2, I2 = we$2, v2 = p2, B2 = ee$2, A2 = we$2;
|
|
19119
18805
|
for (let D2 = BigInt(u2 - 1); D2 >= we$2; D2--) {
|
|
19120
18806
|
const P3 = g2 >> D2 & ee$2;
|
|
19121
|
-
A2 ^= P3, { x_2:
|
|
19122
|
-
const $2 =
|
|
19123
|
-
|
|
18807
|
+
A2 ^= P3, { x_2: E2, x_3: v2 } = L2(A2, E2, v2), { x_2: I2, x_3: B2 } = L2(A2, I2, B2), A2 = P3;
|
|
18808
|
+
const $2 = E2 + I2, V3 = w2($2 * $2), q3 = E2 - I2, G2 = w2(q3 * q3), M3 = V3 - G2, Y2 = v2 + B2, Yt2 = v2 - B2, ce2 = w2(Yt2 * $2), fe2 = w2(Y2 * q3), Qn2 = ce2 + fe2, tr2 = ce2 - fe2;
|
|
18809
|
+
v2 = w2(Qn2 * Qn2), B2 = w2(x2 * w2(tr2 * tr2)), E2 = w2(V3 * G2), I2 = w2(M3 * (V3 + w2(d3 * M3)));
|
|
19124
18810
|
}
|
|
19125
|
-
({ x_2:
|
|
18811
|
+
({ x_2: E2, x_3: v2 } = L2(A2, E2, v2)), { x_2: I2, x_3: B2 } = L2(A2, I2, B2);
|
|
19126
18812
|
const N2 = s2(I2);
|
|
19127
|
-
return w2(
|
|
18813
|
+
return w2(E2 * N2);
|
|
19128
18814
|
}
|
|
19129
18815
|
const O3 = { secretKey: a2, publicKey: a2, seed: a2 }, T2 = (p2 = f4(a2)) => (ht$1(p2, O3.seed), p2);
|
|
19130
18816
|
function C2(p2) {
|
|
19131
18817
|
const b2 = T2(p2);
|
|
19132
|
-
return { secretKey: b2, publicKey:
|
|
18818
|
+
return { secretKey: b2, publicKey: j2(b2) };
|
|
19133
18819
|
}
|
|
19134
|
-
return { keygen: C2, getSharedSecret: (p2, b2) => H2(p2, b2), getPublicKey: (p2) =>
|
|
18820
|
+
return { keygen: C2, getSharedSecret: (p2, b2) => H2(p2, b2), getPublicKey: (p2) => j2(p2), scalarMult: H2, scalarMultBase: j2, utils: { randomSecretKey: T2, randomPrivateKey: T2 }, GuBytes: U2.slice(), lengths: O3 };
|
|
19135
18821
|
}
|
|
19136
18822
|
const Kf = BigInt(1), Go$1 = BigInt(2), qf = BigInt(3), Ff = BigInt(5);
|
|
19137
18823
|
BigInt(8);
|
|
@@ -19250,23 +18936,23 @@ function ta$1(t2, e2 = {}) {
|
|
|
19250
18936
|
if (!r2.isOdd) throw new Error("compression is not supported: Field does not have .isOdd()");
|
|
19251
18937
|
}
|
|
19252
18938
|
function l2(_3, p2, b2) {
|
|
19253
|
-
const { x: g2, y: x2 } = p2.toAffine(),
|
|
18939
|
+
const { x: g2, y: x2 } = p2.toAffine(), E2 = r2.toBytes(g2);
|
|
19254
18940
|
if (He$2(b2, "isCompressed"), b2) {
|
|
19255
18941
|
a2();
|
|
19256
18942
|
const I2 = !r2.isOdd(x2);
|
|
19257
|
-
return _t$2(Xo$1(I2),
|
|
19258
|
-
} else return _t$2(Uint8Array.of(4),
|
|
18943
|
+
return _t$2(Xo$1(I2), E2);
|
|
18944
|
+
} else return _t$2(Uint8Array.of(4), E2, r2.toBytes(x2));
|
|
19259
18945
|
}
|
|
19260
18946
|
function d3(_3) {
|
|
19261
18947
|
Kt$2(_3, void 0, "Point");
|
|
19262
|
-
const { publicKey: p2, publicKeyUncompressed: b2 } = u2, g2 = _3.length, x2 = _3[0],
|
|
18948
|
+
const { publicKey: p2, publicKeyUncompressed: b2 } = u2, g2 = _3.length, x2 = _3[0], E2 = _3.subarray(1);
|
|
19263
18949
|
if (g2 === p2 && (x2 === 2 || x2 === 3)) {
|
|
19264
|
-
const I2 = r2.fromBytes(
|
|
18950
|
+
const I2 = r2.fromBytes(E2);
|
|
19265
18951
|
if (!r2.isValid(I2)) throw new Error("bad point: is not on curve, wrong x");
|
|
19266
|
-
const
|
|
18952
|
+
const v2 = m3(I2);
|
|
19267
18953
|
let B2;
|
|
19268
18954
|
try {
|
|
19269
|
-
B2 = r2.sqrt(
|
|
18955
|
+
B2 = r2.sqrt(v2);
|
|
19270
18956
|
} catch (D2) {
|
|
19271
18957
|
const P3 = D2 instanceof Error ? ": " + D2.message : "";
|
|
19272
18958
|
throw new Error("bad point: is not on curve, sqrt error" + P3);
|
|
@@ -19275,9 +18961,9 @@ function ta$1(t2, e2 = {}) {
|
|
|
19275
18961
|
const A2 = r2.isOdd(B2);
|
|
19276
18962
|
return (x2 & 1) === 1 !== A2 && (B2 = r2.neg(B2)), { x: I2, y: B2 };
|
|
19277
18963
|
} else if (g2 === b2 && x2 === 4) {
|
|
19278
|
-
const I2 = r2.BYTES,
|
|
19279
|
-
if (!w2(
|
|
19280
|
-
return { x:
|
|
18964
|
+
const I2 = r2.BYTES, v2 = r2.fromBytes(E2.subarray(0, I2)), B2 = r2.fromBytes(E2.subarray(I2, I2 * 2));
|
|
18965
|
+
if (!w2(v2, B2)) throw new Error("bad point: is not on curve");
|
|
18966
|
+
return { x: v2, y: B2 };
|
|
19281
18967
|
} else throw new Error(`bad point: got length ${g2}, expected compressed=${p2} or uncompressed=${b2}`);
|
|
19282
18968
|
}
|
|
19283
18969
|
const h4 = e2.toBytes || l2, y3 = e2.fromBytes || d3;
|
|
@@ -19303,16 +18989,16 @@ function ta$1(t2, e2 = {}) {
|
|
|
19303
18989
|
if (!f4 || !f4.basises) throw new Error("no endo");
|
|
19304
18990
|
return Xf(_3, f4.basises, o3.ORDER);
|
|
19305
18991
|
}
|
|
19306
|
-
const
|
|
18992
|
+
const j2 = No$1((_3, p2) => {
|
|
19307
18993
|
const { X: b2, Y: g2, Z: x2 } = _3;
|
|
19308
18994
|
if (r2.eql(x2, r2.ONE)) return { x: b2, y: g2 };
|
|
19309
|
-
const
|
|
19310
|
-
p2 == null && (p2 =
|
|
19311
|
-
const I2 = r2.mul(b2, p2),
|
|
19312
|
-
if (
|
|
18995
|
+
const E2 = _3.is0();
|
|
18996
|
+
p2 == null && (p2 = E2 ? r2.ONE : r2.inv(x2));
|
|
18997
|
+
const I2 = r2.mul(b2, p2), v2 = r2.mul(g2, p2), B2 = r2.mul(x2, p2);
|
|
18998
|
+
if (E2) return { x: r2.ZERO, y: r2.ZERO };
|
|
19313
18999
|
if (!r2.eql(B2, r2.ONE)) throw new Error("invZ was invalid");
|
|
19314
|
-
return { x: I2, y:
|
|
19315
|
-
}),
|
|
19000
|
+
return { x: I2, y: v2 };
|
|
19001
|
+
}), L2 = No$1((_3) => {
|
|
19316
19002
|
if (_3.is0()) {
|
|
19317
19003
|
if (e2.allowInfinityPoint && !r2.is0(_3.Y)) return;
|
|
19318
19004
|
throw new Error("bad point: ZERO");
|
|
@@ -19356,7 +19042,7 @@ function ta$1(t2, e2 = {}) {
|
|
|
19356
19042
|
return C2.createCache(this, p2), b2 || this.multiply(Ze$2), this;
|
|
19357
19043
|
}
|
|
19358
19044
|
assertValidity() {
|
|
19359
|
-
|
|
19045
|
+
L2(this);
|
|
19360
19046
|
}
|
|
19361
19047
|
hasEvenY() {
|
|
19362
19048
|
const { y: p2 } = this.toAffine();
|
|
@@ -19365,26 +19051,26 @@ function ta$1(t2, e2 = {}) {
|
|
|
19365
19051
|
}
|
|
19366
19052
|
equals(p2) {
|
|
19367
19053
|
Z2(p2);
|
|
19368
|
-
const { X: b2, Y: g2, Z: x2 } = this, { X:
|
|
19054
|
+
const { X: b2, Y: g2, Z: x2 } = this, { X: E2, Y: I2, Z: v2 } = p2, B2 = r2.eql(r2.mul(b2, v2), r2.mul(E2, x2)), A2 = r2.eql(r2.mul(g2, v2), r2.mul(I2, x2));
|
|
19369
19055
|
return B2 && A2;
|
|
19370
19056
|
}
|
|
19371
19057
|
negate() {
|
|
19372
19058
|
return new O3(this.X, r2.neg(this.Y), this.Z);
|
|
19373
19059
|
}
|
|
19374
19060
|
double() {
|
|
19375
|
-
const { a: p2, b: b2 } = s2, g2 = r2.mul(b2, Ze$2), { X: x2, Y:
|
|
19376
|
-
let
|
|
19377
|
-
return $2 = r2.add($2, $2), A2 = r2.mul(x2, I2), A2 = r2.add(A2, A2),
|
|
19061
|
+
const { a: p2, b: b2 } = s2, g2 = r2.mul(b2, Ze$2), { X: x2, Y: E2, Z: I2 } = this;
|
|
19062
|
+
let v2 = r2.ZERO, B2 = r2.ZERO, A2 = r2.ZERO, N2 = r2.mul(x2, x2), D2 = r2.mul(E2, E2), P3 = r2.mul(I2, I2), $2 = r2.mul(x2, E2);
|
|
19063
|
+
return $2 = r2.add($2, $2), A2 = r2.mul(x2, I2), A2 = r2.add(A2, A2), v2 = r2.mul(p2, A2), B2 = r2.mul(g2, P3), B2 = r2.add(v2, B2), v2 = r2.sub(D2, B2), B2 = r2.add(D2, B2), B2 = r2.mul(v2, B2), v2 = r2.mul($2, v2), A2 = r2.mul(g2, A2), P3 = r2.mul(p2, P3), $2 = r2.sub(N2, P3), $2 = r2.mul(p2, $2), $2 = r2.add($2, A2), A2 = r2.add(N2, N2), N2 = r2.add(A2, N2), N2 = r2.add(N2, P3), N2 = r2.mul(N2, $2), B2 = r2.add(B2, N2), P3 = r2.mul(E2, I2), P3 = r2.add(P3, P3), N2 = r2.mul(P3, $2), v2 = r2.sub(v2, N2), A2 = r2.mul(P3, D2), A2 = r2.add(A2, A2), A2 = r2.add(A2, A2), new O3(v2, B2, A2);
|
|
19378
19064
|
}
|
|
19379
19065
|
add(p2) {
|
|
19380
19066
|
Z2(p2);
|
|
19381
|
-
const { X: b2, Y: g2, Z: x2 } = this, { X:
|
|
19067
|
+
const { X: b2, Y: g2, Z: x2 } = this, { X: E2, Y: I2, Z: v2 } = p2;
|
|
19382
19068
|
let B2 = r2.ZERO, A2 = r2.ZERO, N2 = r2.ZERO;
|
|
19383
19069
|
const D2 = s2.a, P3 = r2.mul(s2.b, Ze$2);
|
|
19384
|
-
let $2 = r2.mul(b2,
|
|
19070
|
+
let $2 = r2.mul(b2, E2), V3 = r2.mul(g2, I2), q3 = r2.mul(x2, v2), G2 = r2.add(b2, g2), M3 = r2.add(E2, I2);
|
|
19385
19071
|
G2 = r2.mul(G2, M3), M3 = r2.add($2, V3), G2 = r2.sub(G2, M3), M3 = r2.add(b2, x2);
|
|
19386
|
-
let Y2 = r2.add(
|
|
19387
|
-
return M3 = r2.mul(M3, Y2), Y2 = r2.add($2,
|
|
19072
|
+
let Y2 = r2.add(E2, v2);
|
|
19073
|
+
return M3 = r2.mul(M3, Y2), Y2 = r2.add($2, q3), M3 = r2.sub(M3, Y2), Y2 = r2.add(g2, x2), B2 = r2.add(I2, v2), Y2 = r2.mul(Y2, B2), B2 = r2.add(V3, q3), Y2 = r2.sub(Y2, B2), N2 = r2.mul(D2, M3), B2 = r2.mul(P3, q3), N2 = r2.add(B2, N2), B2 = r2.sub(V3, N2), N2 = r2.add(V3, N2), A2 = r2.mul(B2, N2), V3 = r2.add($2, $2), V3 = r2.add(V3, $2), q3 = r2.mul(D2, q3), M3 = r2.mul(P3, M3), V3 = r2.add(V3, q3), q3 = r2.sub($2, q3), q3 = r2.mul(D2, q3), M3 = r2.add(M3, q3), $2 = r2.mul(V3, M3), A2 = r2.add(A2, $2), $2 = r2.mul(Y2, M3), B2 = r2.mul(G2, B2), B2 = r2.sub(B2, $2), $2 = r2.mul(G2, V3), N2 = r2.mul(Y2, N2), N2 = r2.add(N2, $2), new O3(B2, A2, N2);
|
|
19388
19074
|
}
|
|
19389
19075
|
subtract(p2) {
|
|
19390
19076
|
return this.add(p2.negate());
|
|
@@ -19396,13 +19082,13 @@ function ta$1(t2, e2 = {}) {
|
|
|
19396
19082
|
const { endo: b2 } = e2;
|
|
19397
19083
|
if (!o3.isValidNot0(p2)) throw new Error("invalid scalar: out of range");
|
|
19398
19084
|
let g2, x2;
|
|
19399
|
-
const
|
|
19085
|
+
const E2 = (I2) => C2.cached(this, I2, (v2) => Tn$1(O3, v2));
|
|
19400
19086
|
if (b2) {
|
|
19401
|
-
const { k1neg: I2, k1:
|
|
19087
|
+
const { k1neg: I2, k1: v2, k2neg: B2, k2: A2 } = H2(p2), { p: N2, f: D2 } = E2(v2), { p: P3, f: $2 } = E2(A2);
|
|
19402
19088
|
x2 = D2.add($2), g2 = k2(b2.beta, N2, P3, I2, B2);
|
|
19403
19089
|
} else {
|
|
19404
|
-
const { p: I2, f:
|
|
19405
|
-
g2 = I2, x2 =
|
|
19090
|
+
const { p: I2, f: v2 } = E2(p2);
|
|
19091
|
+
g2 = I2, x2 = v2;
|
|
19406
19092
|
}
|
|
19407
19093
|
return Tn$1(O3, [g2, x2])[0];
|
|
19408
19094
|
}
|
|
@@ -19413,7 +19099,7 @@ function ta$1(t2, e2 = {}) {
|
|
|
19413
19099
|
if (p2 === ne$1) return g2;
|
|
19414
19100
|
if (C2.hasCache(this)) return this.multiply(p2);
|
|
19415
19101
|
if (b2) {
|
|
19416
|
-
const { k1neg: x2, k1:
|
|
19102
|
+
const { k1neg: x2, k1: E2, k2neg: I2, k2: v2 } = H2(p2), { p1: B2, p2: A2 } = Pf(O3, g2, E2, v2);
|
|
19417
19103
|
return k2(b2.beta, B2, A2, x2, I2);
|
|
19418
19104
|
} else return C2.unsafe(g2, p2);
|
|
19419
19105
|
}
|
|
@@ -19422,7 +19108,7 @@ function ta$1(t2, e2 = {}) {
|
|
|
19422
19108
|
return x2.is0() ? void 0 : x2;
|
|
19423
19109
|
}
|
|
19424
19110
|
toAffine(p2) {
|
|
19425
|
-
return
|
|
19111
|
+
return j2(this, p2);
|
|
19426
19112
|
}
|
|
19427
19113
|
isTorsionFree() {
|
|
19428
19114
|
const { isTorsionFree: p2 } = e2;
|
|
@@ -19538,23 +19224,23 @@ function na(t2, e2, n3 = {}) {
|
|
|
19538
19224
|
}
|
|
19539
19225
|
function F2(b2, g2) {
|
|
19540
19226
|
Pn$1(g2);
|
|
19541
|
-
const x2 = h4.signature,
|
|
19542
|
-
return Kt$2(b2,
|
|
19227
|
+
const x2 = h4.signature, E2 = g2 === "compact" ? x2 : g2 === "recovered" ? x2 + 1 : void 0;
|
|
19228
|
+
return Kt$2(b2, E2, `${g2} signature`);
|
|
19543
19229
|
}
|
|
19544
19230
|
class R3 {
|
|
19545
|
-
constructor(g2, x2,
|
|
19546
|
-
this.r = U2("r", g2), this.s = U2("s", x2),
|
|
19231
|
+
constructor(g2, x2, E2) {
|
|
19232
|
+
this.r = U2("r", g2), this.s = U2("s", x2), E2 != null && (this.recovery = E2), Object.freeze(this);
|
|
19547
19233
|
}
|
|
19548
19234
|
static fromBytes(g2, x2 = m3) {
|
|
19549
19235
|
F2(g2, x2);
|
|
19550
|
-
let
|
|
19236
|
+
let E2;
|
|
19551
19237
|
if (x2 === "der") {
|
|
19552
19238
|
const { r: A2, s: N2 } = xt$2.toSig(Kt$2(g2));
|
|
19553
19239
|
return new R3(A2, N2);
|
|
19554
19240
|
}
|
|
19555
|
-
x2 === "recovered" && (
|
|
19556
|
-
const I2 = i3.BYTES,
|
|
19557
|
-
return new R3(i3.fromBytes(
|
|
19241
|
+
x2 === "recovered" && (E2 = g2[0], x2 = "compact", g2 = g2.subarray(1));
|
|
19242
|
+
const I2 = i3.BYTES, v2 = g2.subarray(0, I2), B2 = g2.subarray(I2, I2 * 2);
|
|
19243
|
+
return new R3(i3.fromBytes(v2), i3.fromBytes(B2), E2);
|
|
19558
19244
|
}
|
|
19559
19245
|
static fromHex(g2, x2) {
|
|
19560
19246
|
return this.fromBytes(Re$1(g2), x2);
|
|
@@ -19563,12 +19249,12 @@ function na(t2, e2, n3 = {}) {
|
|
|
19563
19249
|
return new R3(this.r, this.s, g2);
|
|
19564
19250
|
}
|
|
19565
19251
|
recoverPublicKey(g2) {
|
|
19566
|
-
const x2 = s2.ORDER, { r:
|
|
19567
|
-
if (
|
|
19568
|
-
if (c2 * Wo$1 < x2 &&
|
|
19569
|
-
const A2 =
|
|
19252
|
+
const x2 = s2.ORDER, { r: E2, s: I2, recovery: v2 } = this;
|
|
19253
|
+
if (v2 == null || ![0, 1, 2, 3].includes(v2)) throw new Error("recovery id invalid");
|
|
19254
|
+
if (c2 * Wo$1 < x2 && v2 > 1) throw new Error("recovery id is ambiguous for h>1 curve");
|
|
19255
|
+
const A2 = v2 === 2 || v2 === 3 ? E2 + c2 : E2;
|
|
19570
19256
|
if (!s2.isValid(A2)) throw new Error("recovery id 2 or 3 invalid");
|
|
19571
|
-
const N2 = s2.toBytes(A2), D2 = t2.fromBytes(_t$2(Xo$1((
|
|
19257
|
+
const N2 = s2.toBytes(A2), D2 = t2.fromBytes(_t$2(Xo$1((v2 & 1) === 0), N2)), P3 = i3.inv(A2), $2 = H2(tt$2("msgHash", g2)), V3 = i3.create(-$2 * P3), q3 = i3.create(I2 * P3), G2 = t2.BASE.multiplyUnsafe(V3).add(D2.multiplyUnsafe(q3));
|
|
19572
19258
|
if (G2.is0()) throw new Error("point at infinify");
|
|
19573
19259
|
return G2.assertValidity(), G2;
|
|
19574
19260
|
}
|
|
@@ -19577,12 +19263,12 @@ function na(t2, e2, n3 = {}) {
|
|
|
19577
19263
|
}
|
|
19578
19264
|
toBytes(g2 = m3) {
|
|
19579
19265
|
if (Pn$1(g2), g2 === "der") return Re$1(xt$2.hexFromSig(this));
|
|
19580
|
-
const x2 = i3.toBytes(this.r),
|
|
19266
|
+
const x2 = i3.toBytes(this.r), E2 = i3.toBytes(this.s);
|
|
19581
19267
|
if (g2 === "recovered") {
|
|
19582
19268
|
if (this.recovery == null) throw new Error("recovery bit must be present");
|
|
19583
|
-
return _t$2(Uint8Array.of(this.recovery), x2,
|
|
19269
|
+
return _t$2(Uint8Array.of(this.recovery), x2, E2);
|
|
19584
19270
|
}
|
|
19585
|
-
return _t$2(x2,
|
|
19271
|
+
return _t$2(x2, E2);
|
|
19586
19272
|
}
|
|
19587
19273
|
toHex(g2) {
|
|
19588
19274
|
return Jt$2(this.toBytes(g2));
|
|
@@ -19613,49 +19299,49 @@ function na(t2, e2, n3 = {}) {
|
|
|
19613
19299
|
}
|
|
19614
19300
|
const Z2 = n3.bits2int || function(g2) {
|
|
19615
19301
|
if (g2.length > 8192) throw new Error("input is too large");
|
|
19616
|
-
const x2 = Ve$2(g2),
|
|
19617
|
-
return
|
|
19302
|
+
const x2 = Ve$2(g2), E2 = g2.length * 8 - f4;
|
|
19303
|
+
return E2 > 0 ? x2 >> BigInt(E2) : x2;
|
|
19618
19304
|
}, H2 = n3.bits2int_modN || function(g2) {
|
|
19619
19305
|
return i3.create(Z2(g2));
|
|
19620
|
-
},
|
|
19621
|
-
function
|
|
19622
|
-
return Rn$1("num < 2^" + f4, b2, Et$3,
|
|
19306
|
+
}, j2 = me$2(f4);
|
|
19307
|
+
function L2(b2) {
|
|
19308
|
+
return Rn$1("num < 2^" + f4, b2, Et$3, j2), i3.toBytes(b2);
|
|
19623
19309
|
}
|
|
19624
19310
|
function k2(b2, g2) {
|
|
19625
19311
|
return Kt$2(b2, void 0, "message"), g2 ? Kt$2(e2(b2), void 0, "prehashed message") : b2;
|
|
19626
19312
|
}
|
|
19627
19313
|
function O3(b2, g2, x2) {
|
|
19628
19314
|
if (["recovered", "canonical"].some((V3) => V3 in x2)) throw new Error("sign() legacy options not supported");
|
|
19629
|
-
const { lowS:
|
|
19315
|
+
const { lowS: E2, prehash: I2, extraEntropy: v2 } = Hn$1(x2, y3);
|
|
19630
19316
|
b2 = k2(b2, I2);
|
|
19631
|
-
const B2 = H2(b2), A2 = re$1(i3, g2), N2 = [
|
|
19632
|
-
if (
|
|
19633
|
-
const V3 =
|
|
19317
|
+
const B2 = H2(b2), A2 = re$1(i3, g2), N2 = [L2(A2), L2(B2)];
|
|
19318
|
+
if (v2 != null && v2 !== false) {
|
|
19319
|
+
const V3 = v2 === true ? r2(h4.secretKey) : v2;
|
|
19634
19320
|
N2.push(tt$2("extraEntropy", V3));
|
|
19635
19321
|
}
|
|
19636
19322
|
const D2 = _t$2(...N2), P3 = B2;
|
|
19637
19323
|
function $2(V3) {
|
|
19638
|
-
const
|
|
19639
|
-
if (!i3.isValidNot0(
|
|
19640
|
-
const G2 = i3.inv(
|
|
19324
|
+
const q3 = Z2(V3);
|
|
19325
|
+
if (!i3.isValidNot0(q3)) return;
|
|
19326
|
+
const G2 = i3.inv(q3), M3 = t2.BASE.multiply(q3).toAffine(), Y2 = i3.create(M3.x);
|
|
19641
19327
|
if (Y2 === Et$3) return;
|
|
19642
19328
|
const Yt2 = i3.create(G2 * i3.create(P3 + Y2 * A2));
|
|
19643
19329
|
if (Yt2 === Et$3) return;
|
|
19644
19330
|
let ce2 = (M3.x === Y2 ? 0 : 2) | Number(M3.y & ne$1), fe2 = Yt2;
|
|
19645
|
-
return
|
|
19331
|
+
return E2 && w2(Yt2) && (fe2 = i3.neg(Yt2), ce2 ^= 1), new R3(Y2, fe2, ce2);
|
|
19646
19332
|
}
|
|
19647
19333
|
return { seed: D2, k2sig: $2 };
|
|
19648
19334
|
}
|
|
19649
19335
|
function T2(b2, g2, x2 = {}) {
|
|
19650
19336
|
b2 = tt$2("message", b2);
|
|
19651
|
-
const { seed:
|
|
19652
|
-
return Af(e2.outputLen, i3.BYTES, o3)(
|
|
19337
|
+
const { seed: E2, k2sig: I2 } = O3(b2, g2, x2);
|
|
19338
|
+
return Af(e2.outputLen, i3.BYTES, o3)(E2, I2);
|
|
19653
19339
|
}
|
|
19654
19340
|
function C2(b2) {
|
|
19655
19341
|
let g2;
|
|
19656
|
-
const x2 = typeof b2 == "string" || Ue$3(b2),
|
|
19657
|
-
if (!x2 && !
|
|
19658
|
-
if (
|
|
19342
|
+
const x2 = typeof b2 == "string" || Ue$3(b2), E2 = !x2 && b2 !== null && typeof b2 == "object" && typeof b2.r == "bigint" && typeof b2.s == "bigint";
|
|
19343
|
+
if (!x2 && !E2) throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");
|
|
19344
|
+
if (E2) g2 = new R3(b2.r, b2.s);
|
|
19659
19345
|
else if (x2) {
|
|
19660
19346
|
try {
|
|
19661
19347
|
g2 = R3.fromBytes(tt$2("sig", b2), "der");
|
|
@@ -19670,23 +19356,23 @@ function na(t2, e2, n3 = {}) {
|
|
|
19670
19356
|
}
|
|
19671
19357
|
return g2 || false;
|
|
19672
19358
|
}
|
|
19673
|
-
function _3(b2, g2, x2,
|
|
19674
|
-
const { lowS: I2, prehash:
|
|
19675
|
-
if (x2 = tt$2("publicKey", x2), g2 = k2(tt$2("message", g2),
|
|
19359
|
+
function _3(b2, g2, x2, E2 = {}) {
|
|
19360
|
+
const { lowS: I2, prehash: v2, format: B2 } = Hn$1(E2, y3);
|
|
19361
|
+
if (x2 = tt$2("publicKey", x2), g2 = k2(tt$2("message", g2), v2), "strict" in E2) throw new Error("options.strict was renamed to lowS");
|
|
19676
19362
|
const A2 = B2 === void 0 ? C2(b2) : R3.fromBytes(tt$2("sig", b2), B2);
|
|
19677
19363
|
if (A2 === false) return false;
|
|
19678
19364
|
try {
|
|
19679
19365
|
const N2 = t2.fromBytes(x2);
|
|
19680
19366
|
if (I2 && A2.hasHighS()) return false;
|
|
19681
|
-
const { r: D2, s: P3 } = A2, $2 = H2(g2), V3 = i3.inv(P3),
|
|
19367
|
+
const { r: D2, s: P3 } = A2, $2 = H2(g2), V3 = i3.inv(P3), q3 = i3.create($2 * V3), G2 = i3.create(D2 * V3), M3 = t2.BASE.multiplyUnsafe(q3).add(N2.multiplyUnsafe(G2));
|
|
19682
19368
|
return M3.is0() ? false : i3.create(M3.x) === D2;
|
|
19683
19369
|
} catch {
|
|
19684
19370
|
return false;
|
|
19685
19371
|
}
|
|
19686
19372
|
}
|
|
19687
19373
|
function p2(b2, g2, x2 = {}) {
|
|
19688
|
-
const { prehash:
|
|
19689
|
-
return g2 = k2(g2,
|
|
19374
|
+
const { prehash: E2 } = Hn$1(x2, y3);
|
|
19375
|
+
return g2 = k2(g2, E2), R3.fromBytes(b2, "recovered").recoverPublicKey(g2).toBytes();
|
|
19690
19376
|
}
|
|
19691
19377
|
return Object.freeze({ keygen: u2, getPublicKey: a2, getSharedSecret: l2, utils: d3, lengths: h4, Point: t2, sign: T2, verify: _3, recoverPublicKey: p2, Signature: R3, hash: e2 });
|
|
19692
19378
|
}
|
|
@@ -19714,7 +19400,7 @@ function Dn$1(t2, e2) {
|
|
|
19714
19400
|
}
|
|
19715
19401
|
const Qo$1 = { p: BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"), n: BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"), h: BigInt(1), a: BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"), b: BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"), Gx: BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"), Gy: BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5") }, ts$1 = { p: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"), n: BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"), h: BigInt(1), a: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"), b: BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"), Gx: BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"), Gy: BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f") }, es$1 = { p: BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), n: BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"), h: BigInt(1), a: BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"), b: BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"), Gx: BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"), Gy: BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650") }, ca = Ht$2(Qo$1.p), fa = Ht$2(ts$1.p), aa = Ht$2(es$1.p), ua = Dn$1({ ...Qo$1, Fp: ca, lowS: false }, Te$2);
|
|
19716
19402
|
Dn$1({ ...ts$1, Fp: fa, lowS: false }, wc), Dn$1({ ...es$1, Fp: aa, lowS: false, allowedPrivateKeyLengths: [130, 131, 132] }, mc);
|
|
19717
|
-
const la = ua, Vn$1 = "base10", rt$1 = "base16", oe$2 = "base64pad", Ge$3 = "base64url", se$2 = "utf8", Mn$1 = 0, ie$1 = 1, ve$2 = 2, da = 0, ns = 1,
|
|
19403
|
+
const la = ua, Vn$1 = "base10", rt$1 = "base16", oe$2 = "base64pad", Ge$3 = "base64url", se$2 = "utf8", Mn$1 = 0, ie$1 = 1, ve$2 = 2, da = 0, ns = 1, xe2 = 12, Kn$1 = 32;
|
|
19718
19404
|
function ha() {
|
|
19719
19405
|
const t2 = kn$1.utils.randomPrivateKey(), e2 = kn$1.getPublicKey(t2);
|
|
19720
19406
|
return { privateKey: toString(t2, rt$1), publicKey: toString(e2, rt$1) };
|
|
@@ -19751,7 +19437,7 @@ function os(t2) {
|
|
|
19751
19437
|
function ma(t2) {
|
|
19752
19438
|
const e2 = qn$1(typeof t2.type < "u" ? t2.type : Mn$1);
|
|
19753
19439
|
if (Zt$2(e2) === ie$1 && typeof t2.senderPublicKey > "u") throw new Error("Missing sender public key for type 1 envelope");
|
|
19754
|
-
const n3 = typeof t2.senderPublicKey < "u" ? fromString(t2.senderPublicKey, rt$1) : void 0, r2 = typeof t2.iv < "u" ? fromString(t2.iv, rt$1) : Mt$2(
|
|
19440
|
+
const n3 = typeof t2.senderPublicKey < "u" ? fromString(t2.senderPublicKey, rt$1) : void 0, r2 = typeof t2.iv < "u" ? fromString(t2.iv, rt$1) : Mt$2(xe2), o3 = fromString(t2.symKey, rt$1), s2 = Bo$1(o3, r2).encrypt(fromString(t2.message, se$2)), i3 = Fn$1({ type: e2, sealed: s2, iv: r2, senderPublicKey: n3 });
|
|
19755
19441
|
return t2.encoding === Ge$3 ? rs(i3) : i3;
|
|
19756
19442
|
}
|
|
19757
19443
|
function wa(t2) {
|
|
@@ -19760,7 +19446,7 @@ function wa(t2) {
|
|
|
19760
19446
|
return toString(o3, se$2);
|
|
19761
19447
|
}
|
|
19762
19448
|
function va(t2, e2) {
|
|
19763
|
-
const n3 = qn$1(ve$2), r2 = Mt$2(
|
|
19449
|
+
const n3 = qn$1(ve$2), r2 = Mt$2(xe2), o3 = fromString(t2, se$2), s2 = Fn$1({ type: n3, sealed: o3, iv: r2 });
|
|
19764
19450
|
return e2 === Ge$3 ? rs(s2) : s2;
|
|
19765
19451
|
}
|
|
19766
19452
|
function xa(t2, e2) {
|
|
@@ -19778,14 +19464,14 @@ function Fn$1(t2) {
|
|
|
19778
19464
|
function ze$1(t2) {
|
|
19779
19465
|
const e2 = (t2.encoding || oe$2) === Ge$3 ? os(t2.encoded) : t2.encoded, n3 = fromString(e2, oe$2), r2 = n3.slice(da, ns), o3 = ns;
|
|
19780
19466
|
if (Zt$2(r2) === ie$1) {
|
|
19781
|
-
const f4 = o3 + Kn$1, u2 = f4 +
|
|
19467
|
+
const f4 = o3 + Kn$1, u2 = f4 + xe2, a2 = n3.slice(o3, f4), l2 = n3.slice(f4, u2), d3 = n3.slice(u2);
|
|
19782
19468
|
return { type: r2, sealed: d3, iv: l2, senderPublicKey: a2 };
|
|
19783
19469
|
}
|
|
19784
19470
|
if (Zt$2(r2) === ve$2) {
|
|
19785
|
-
const f4 = n3.slice(o3), u2 = Mt$2(
|
|
19471
|
+
const f4 = n3.slice(o3), u2 = Mt$2(xe2);
|
|
19786
19472
|
return { type: r2, sealed: f4, iv: u2 };
|
|
19787
19473
|
}
|
|
19788
|
-
const s2 = o3 +
|
|
19474
|
+
const s2 = o3 + xe2, i3 = n3.slice(o3, s2), c2 = n3.slice(s2);
|
|
19789
19475
|
return { type: r2, sealed: c2, iv: i3 };
|
|
19790
19476
|
}
|
|
19791
19477
|
function Ea(t2, e2) {
|
|
@@ -20278,7 +19964,7 @@ function Bu(t2) {
|
|
|
20278
19964
|
return Hs$1(o3);
|
|
20279
19965
|
}
|
|
20280
19966
|
function Iu({ logger: t2, name: e2 }) {
|
|
20281
|
-
const n3 = typeof t2 == "string" ?
|
|
19967
|
+
const n3 = typeof t2 == "string" ? Ue$5({ opts: { level: t2, name: e2 } }).logger : t2;
|
|
20282
19968
|
return n3.level = typeof t2 == "string" ? t2 : t2.level, n3;
|
|
20283
19969
|
}
|
|
20284
19970
|
const PARSE_ERROR = "PARSE_ERROR";
|
|
@@ -20623,7 +20309,7 @@ let f$2 = class f2 {
|
|
|
20623
20309
|
return this.events.emit("register_error", t2), t2;
|
|
20624
20310
|
}
|
|
20625
20311
|
};
|
|
20626
|
-
const Ue$2 = "wc", Fe$1 = 2, ge$1 = "core", W$1 = `${Ue$2}@2:${ge$1}:`, Et$2 = { logger: "error" }, It$2 = { database: ":memory:" }, Tt$1 = "crypto", Me$2 = "client_ed25519_seed", Ct$1 = cjsExports$3.ONE_DAY, Pt$1 = "keychain", St$2 = "0.3", Ot$1 = "messages", Rt$2 = "0.3", At$1 = cjsExports$3.SIX_HOURS, xt$1 = "publisher", Nt$1 = "irn", $t$1 = "error", Ke$2 = "wss://relay.walletconnect.org", zt$1 = "relayer", C$1 = { message: "relayer_message", message_ack: "relayer_message_ack", connect: "relayer_connect", disconnect: "relayer_disconnect", error: "relayer_error", connection_stalled: "relayer_connection_stalled", transport_closed: "relayer_transport_closed", publish: "relayer_publish" }, Lt$1 = "_subscription", M$1 = { payload: "payload", connect: "connect", disconnect: "disconnect", error: "error" }, kt$1 = 0.1, Pe$1 = "2.23.
|
|
20312
|
+
const Ue$2 = "wc", Fe$1 = 2, ge$1 = "core", W$1 = `${Ue$2}@2:${ge$1}:`, Et$2 = { logger: "error" }, It$2 = { database: ":memory:" }, Tt$1 = "crypto", Me$2 = "client_ed25519_seed", Ct$1 = cjsExports$3.ONE_DAY, Pt$1 = "keychain", St$2 = "0.3", Ot$1 = "messages", Rt$2 = "0.3", At$1 = cjsExports$3.SIX_HOURS, xt$1 = "publisher", Nt$1 = "irn", $t$1 = "error", Ke$2 = "wss://relay.walletconnect.org", zt$1 = "relayer", C$1 = { message: "relayer_message", message_ack: "relayer_message_ack", connect: "relayer_connect", disconnect: "relayer_disconnect", error: "relayer_error", connection_stalled: "relayer_connection_stalled", transport_closed: "relayer_transport_closed", publish: "relayer_publish" }, Lt$1 = "_subscription", M$1 = { payload: "payload", connect: "connect", disconnect: "disconnect", error: "error" }, kt$1 = 0.1, Pe$1 = "2.23.1", ee$1 = { link_mode: "link_mode", relay: "relay" }, ye$1 = { inbound: "inbound", outbound: "outbound" }, jt$1 = "0.3", Ut$1 = "WALLETCONNECT_CLIENT_ID", Be$1 = "WALLETCONNECT_LINK_MODE_APPS", j$2 = { created: "subscription_created", deleted: "subscription_deleted", expired: "subscription_expired", disabled: "subscription_disabled", sync: "subscription_sync", resubscribed: "subscription_resubscribed" }, Ft$1 = "subscription", Mt$1 = "0.3", Kt$1 = "pairing", Bt$1 = "0.3", oe$1 = { wc_pairingDelete: { req: { ttl: cjsExports$3.ONE_DAY, prompt: false, tag: 1e3 }, res: { ttl: cjsExports$3.ONE_DAY, prompt: false, tag: 1001 } }, wc_pairingPing: { req: { ttl: cjsExports$3.THIRTY_SECONDS, prompt: false, tag: 1002 }, res: { ttl: cjsExports$3.THIRTY_SECONDS, prompt: false, tag: 1003 } }, unregistered_method: { req: { ttl: cjsExports$3.ONE_DAY, prompt: false, tag: 0 }, res: { ttl: cjsExports$3.ONE_DAY, prompt: false, tag: 0 } } }, ae$1 = { create: "pairing_create", expire: "pairing_expire", delete: "pairing_delete", ping: "pairing_ping" }, V2 = { created: "history_created", updated: "history_updated", deleted: "history_deleted", sync: "history_sync" }, Vt$1 = "history", qt$1 = "0.3", Gt$1 = "expirer", q2 = { created: "expirer_created", deleted: "expirer_deleted", expired: "expirer_expired", sync: "expirer_sync" }, Wt$1 = "0.3", Ht$1 = "verify-api", ir = "https://verify.walletconnect.com", Yt$1 = "https://verify.walletconnect.org", be$1 = Yt$1, Jt$1 = `${be$1}/v3`, Xt$1 = [ir, Yt$1], Zt$1 = "echo", Qt$1 = "https://echo.walletconnect.com", Y = { pairing_started: "pairing_started", pairing_uri_validation_success: "pairing_uri_validation_success", pairing_uri_not_expired: "pairing_uri_not_expired", store_new_pairing: "store_new_pairing", subscribing_pairing_topic: "subscribing_pairing_topic", subscribe_pairing_topic_success: "subscribe_pairing_topic_success", existing_pairing: "existing_pairing", pairing_not_expired: "pairing_not_expired", emit_inactive_pairing: "emit_inactive_pairing", emit_session_proposal: "emit_session_proposal", subscribing_to_pairing_topic: "subscribing_to_pairing_topic" }, X = { no_wss_connection: "no_wss_connection", no_internet_connection: "no_internet_connection", malformed_pairing_uri: "malformed_pairing_uri", active_pairing_already_exists: "active_pairing_already_exists", subscribe_pairing_topic_failure: "subscribe_pairing_topic_failure", pairing_expired: "pairing_expired", proposal_expired: "proposal_expired", proposal_listener_not_found: "proposal_listener_not_found" }, rr = { session_approve_started: "session_approve_started", proposal_not_expired: "proposal_not_expired", session_namespaces_validation_success: "session_namespaces_validation_success", create_session_topic: "create_session_topic", subscribing_session_topic: "subscribing_session_topic", subscribe_session_topic_success: "subscribe_session_topic_success", publishing_session_approve: "publishing_session_approve", session_approve_publish_success: "session_approve_publish_success", store_session: "store_session", publishing_session_settle: "publishing_session_settle", session_settle_publish_success: "session_settle_publish_success", session_request_response_started: "session_request_response_started", session_request_response_validation_success: "session_request_response_validation_success", session_request_response_publish_started: "session_request_response_publish_started" }, nr = { no_internet_connection: "no_internet_connection", no_wss_connection: "no_wss_connection", proposal_expired: "proposal_expired", subscribe_session_topic_failure: "subscribe_session_topic_failure", session_approve_publish_failure: "session_approve_publish_failure", session_settle_publish_failure: "session_settle_publish_failure", session_approve_namespace_validation_failure: "session_approve_namespace_validation_failure", proposal_not_found: "proposal_not_found", session_request_response_validation_failure: "session_request_response_validation_failure", session_request_response_publish_failure: "session_request_response_publish_failure" }, or = { authenticated_session_approve_started: "authenticated_session_approve_started", create_authenticated_session_topic: "create_authenticated_session_topic", cacaos_verified: "cacaos_verified", store_authenticated_session: "store_authenticated_session", subscribing_authenticated_session_topic: "subscribing_authenticated_session_topic", subscribe_authenticated_session_topic_success: "subscribe_authenticated_session_topic_success", publishing_authenticated_session_approve: "publishing_authenticated_session_approve" }, ar = { no_internet_connection: "no_internet_connection", invalid_cacao: "invalid_cacao", subscribe_authenticated_session_topic_failure: "subscribe_authenticated_session_topic_failure", authenticated_session_approve_publish_failure: "authenticated_session_approve_publish_failure", authenticated_session_pending_request_not_found: "authenticated_session_pending_request_not_found" }, ei = 0.1, ti = "event-client", ii = 86400, si = "https://pulse.walletconnect.org/batch";
|
|
20627
20313
|
function cr(r2, e2) {
|
|
20628
20314
|
if (r2.length >= 255) throw new TypeError("Alphabet too long");
|
|
20629
20315
|
for (var t2 = new Uint8Array(256), i3 = 0; i3 < t2.length; i3++) t2[i3] = 255;
|
|
@@ -20636,14 +20322,14 @@ function cr(r2, e2) {
|
|
|
20636
20322
|
function g2(u2) {
|
|
20637
20323
|
if (u2 instanceof Uint8Array || (ArrayBuffer.isView(u2) ? u2 = new Uint8Array(u2.buffer, u2.byteOffset, u2.byteLength) : Array.isArray(u2) && (u2 = Uint8Array.from(u2))), !(u2 instanceof Uint8Array)) throw new TypeError("Expected Uint8Array");
|
|
20638
20324
|
if (u2.length === 0) return "";
|
|
20639
|
-
for (var m3 = 0, D2 = 0, w2 = 0,
|
|
20640
|
-
for (var
|
|
20641
|
-
for (var k2 = u2[w2], T2 = 0,
|
|
20325
|
+
for (var m3 = 0, D2 = 0, w2 = 0, E2 = u2.length; w2 !== E2 && u2[w2] === 0; ) w2++, m3++;
|
|
20326
|
+
for (var L2 = (E2 - w2) * l2 + 1 >>> 0, I2 = new Uint8Array(L2); w2 !== E2; ) {
|
|
20327
|
+
for (var k2 = u2[w2], T2 = 0, S3 = L2 - 1; (k2 !== 0 || T2 < D2) && S3 !== -1; S3--, T2++) k2 += 256 * I2[S3] >>> 0, I2[S3] = k2 % a2 >>> 0, k2 = k2 / a2 >>> 0;
|
|
20642
20328
|
if (k2 !== 0) throw new Error("Non-zero carry");
|
|
20643
20329
|
D2 = T2, w2++;
|
|
20644
20330
|
}
|
|
20645
|
-
for (var O3 =
|
|
20646
|
-
for (var te2 = c2.repeat(m3); O3 <
|
|
20331
|
+
for (var O3 = L2 - D2; O3 !== L2 && I2[O3] === 0; ) O3++;
|
|
20332
|
+
for (var te2 = c2.repeat(m3); O3 < L2; ++O3) te2 += r2.charAt(I2[O3]);
|
|
20647
20333
|
return te2;
|
|
20648
20334
|
}
|
|
20649
20335
|
function y3(u2) {
|
|
@@ -20652,16 +20338,16 @@ function cr(r2, e2) {
|
|
|
20652
20338
|
var m3 = 0;
|
|
20653
20339
|
if (u2[m3] !== " ") {
|
|
20654
20340
|
for (var D2 = 0, w2 = 0; u2[m3] === c2; ) D2++, m3++;
|
|
20655
|
-
for (var
|
|
20341
|
+
for (var E2 = (u2.length - m3) * h4 + 1 >>> 0, L2 = new Uint8Array(E2); u2[m3]; ) {
|
|
20656
20342
|
var I2 = t2[u2.charCodeAt(m3)];
|
|
20657
20343
|
if (I2 === 255) return;
|
|
20658
|
-
for (var k2 = 0, T2 =
|
|
20344
|
+
for (var k2 = 0, T2 = E2 - 1; (I2 !== 0 || k2 < w2) && T2 !== -1; T2--, k2++) I2 += a2 * L2[T2] >>> 0, L2[T2] = I2 % 256 >>> 0, I2 = I2 / 256 >>> 0;
|
|
20659
20345
|
if (I2 !== 0) throw new Error("Non-zero carry");
|
|
20660
20346
|
w2 = k2, m3++;
|
|
20661
20347
|
}
|
|
20662
20348
|
if (u2[m3] !== " ") {
|
|
20663
|
-
for (var
|
|
20664
|
-
for (var O3 = new Uint8Array(D2 + (
|
|
20349
|
+
for (var S3 = E2 - w2; S3 !== E2 && L2[S3] === 0; ) S3++;
|
|
20350
|
+
for (var O3 = new Uint8Array(D2 + (E2 - S3)), te2 = D2; S3 !== E2; ) O3[te2++] = L2[S3++];
|
|
20665
20351
|
return O3;
|
|
20666
20352
|
}
|
|
20667
20353
|
}
|
|
@@ -20879,10 +20565,10 @@ class _i {
|
|
|
20879
20565
|
return s2;
|
|
20880
20566
|
}), J$1(this, "del", async (i3) => {
|
|
20881
20567
|
this.isInitialized(), this.keychain.delete(i3), await this.persist();
|
|
20882
|
-
}), this.core = e2, this.logger =
|
|
20568
|
+
}), this.core = e2, this.logger = Re$3(t2, this.name);
|
|
20883
20569
|
}
|
|
20884
20570
|
get context() {
|
|
20885
|
-
return
|
|
20571
|
+
return ee$3(this.logger);
|
|
20886
20572
|
}
|
|
20887
20573
|
get storageKey() {
|
|
20888
20574
|
return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name;
|
|
@@ -20966,10 +20652,10 @@ class wi {
|
|
|
20966
20652
|
}), R2(this, "getPayloadSenderPublicKey", (s2, n3 = oe$2) => {
|
|
20967
20653
|
const o3 = ze$1({ encoded: s2, encoding: n3 });
|
|
20968
20654
|
return o3.senderPublicKey ? toString(o3.senderPublicKey, rt$1) : void 0;
|
|
20969
|
-
}), this.core = e2, this.logger =
|
|
20655
|
+
}), this.core = e2, this.logger = Re$3(t2, this.name), this.keychain = i3 || new _i(this.core, this.logger);
|
|
20970
20656
|
}
|
|
20971
20657
|
get context() {
|
|
20972
|
-
return
|
|
20658
|
+
return ee$3(this.logger);
|
|
20973
20659
|
}
|
|
20974
20660
|
async setPrivateKey(e2, t2) {
|
|
20975
20661
|
return await this.keychain.set(e2, t2), e2;
|
|
@@ -21051,10 +20737,10 @@ class Ii extends y$2 {
|
|
|
21051
20737
|
delete n3[o3], Object.keys(n3).length === 0 ? this.messagesWithoutClientAck.delete(i3) : this.messagesWithoutClientAck.set(i3, n3), await this.persist();
|
|
21052
20738
|
}), K$1(this, "del", async (i3) => {
|
|
21053
20739
|
this.isInitialized(), this.messages.delete(i3), this.messagesWithoutClientAck.delete(i3), await this.persist();
|
|
21054
|
-
}), this.logger =
|
|
20740
|
+
}), this.logger = Re$3(e2, this.name), this.core = t2;
|
|
21055
20741
|
}
|
|
21056
20742
|
get context() {
|
|
21057
|
-
return
|
|
20743
|
+
return ee$3(this.logger);
|
|
21058
20744
|
}
|
|
21059
20745
|
get storageKey() {
|
|
21060
20746
|
return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name;
|
|
@@ -21099,15 +20785,15 @@ class Yn extends m$1 {
|
|
|
21099
20785
|
const g2 = n3?.ttl || At$1, y3 = n3?.prompt || false, _3 = n3?.tag || 0, u2 = n3?.id || getBigIntRpcId().toString(), m3 = Oa(Sa().protocol), D2 = { id: u2, method: n3?.publishMethod || m3.publish, params: ce$1({ topic: i3, message: s2, ttl: g2, prompt: y3, tag: _3, attestation: n3?.attestation }, n3?.tvf) }, w2 = `Failed to publish payload, please try again. id:${u2} tag:${_3}`;
|
|
21100
20786
|
try {
|
|
21101
20787
|
Dt$1((o3 = D2.params) == null ? void 0 : o3.prompt) && ((a2 = D2.params) == null || delete a2.prompt), Dt$1((c2 = D2.params) == null ? void 0 : c2.tag) && ((h4 = D2.params) == null || delete h4.tag);
|
|
21102
|
-
const
|
|
20788
|
+
const E2 = new Promise(async (L2) => {
|
|
21103
20789
|
const I2 = ({ id: T2 }) => {
|
|
21104
|
-
var
|
|
21105
|
-
((
|
|
20790
|
+
var S3;
|
|
20791
|
+
((S3 = D2.id) == null ? void 0 : S3.toString()) === T2.toString() && (this.removeRequestFromQueue(T2), this.relayer.events.removeListener(C$1.publish, I2), L2());
|
|
21106
20792
|
};
|
|
21107
20793
|
this.relayer.events.on(C$1.publish, I2);
|
|
21108
|
-
const k2 = Si$1(new Promise((T2,
|
|
20794
|
+
const k2 = Si$1(new Promise((T2, S3) => {
|
|
21109
20795
|
this.rpcPublish(D2, n3).then(T2).catch((O3) => {
|
|
21110
|
-
this.logger.warn(O3, O3?.message),
|
|
20796
|
+
this.logger.warn(O3, O3?.message), S3(O3);
|
|
21111
20797
|
});
|
|
21112
20798
|
}), this.initialPublishTimeout, `Failed initial publish, retrying.... id:${u2} tag:${_3}`);
|
|
21113
20799
|
try {
|
|
@@ -21116,29 +20802,29 @@ class Yn extends m$1 {
|
|
|
21116
20802
|
this.queue.set(u2, { request: D2, opts: n3, attempt: 1 }), this.logger.warn(T2, T2?.message);
|
|
21117
20803
|
}
|
|
21118
20804
|
});
|
|
21119
|
-
this.logger.trace({ type: "method", method: "publish", params: { id: u2, topic: i3, message: s2, opts: n3 } }), await Si$1(
|
|
21120
|
-
} catch (
|
|
21121
|
-
if (this.logger.debug("Failed to Publish Payload"), this.logger.error(
|
|
20805
|
+
this.logger.trace({ type: "method", method: "publish", params: { id: u2, topic: i3, message: s2, opts: n3 } }), await Si$1(E2, this.publishTimeout, w2);
|
|
20806
|
+
} catch (E2) {
|
|
20807
|
+
if (this.logger.debug("Failed to Publish Payload"), this.logger.error(E2), (l2 = n3?.internal) != null && l2.throwOnFailedPublish) throw E2;
|
|
21122
20808
|
} finally {
|
|
21123
20809
|
this.queue.delete(u2);
|
|
21124
20810
|
}
|
|
21125
20811
|
}), G$1(this, "publishCustom", async (i3) => {
|
|
21126
20812
|
var s2, n3, o3, a2, c2;
|
|
21127
20813
|
this.logger.debug("Publishing custom payload"), this.logger.trace({ type: "method", method: "publishCustom", params: i3 });
|
|
21128
|
-
const { payload: h4, opts: l2 = {} } = i3, { attestation: g2, tvf: y3, publishMethod: _3, prompt: u2, tag: m3, ttl: D2 = cjsExports$3.FIVE_MINUTES } = l2, w2 = l2.id || getBigIntRpcId().toString(),
|
|
20814
|
+
const { payload: h4, opts: l2 = {} } = i3, { attestation: g2, tvf: y3, publishMethod: _3, prompt: u2, tag: m3, ttl: D2 = cjsExports$3.FIVE_MINUTES } = l2, w2 = l2.id || getBigIntRpcId().toString(), E2 = Oa(Sa().protocol), L2 = _3 || E2.publish, I2 = { id: w2, method: L2, params: ce$1(Ci(ce$1({}, h4), { ttl: D2, prompt: u2, tag: m3, attestation: g2 }), y3) }, k2 = `Failed to publish custom payload, please try again. id:${w2} tag:${m3}`;
|
|
21129
20815
|
try {
|
|
21130
20816
|
Dt$1((s2 = I2.params) == null ? void 0 : s2.prompt) && ((n3 = I2.params) == null || delete n3.prompt), Dt$1((o3 = I2.params) == null ? void 0 : o3.tag) && ((a2 = I2.params) == null || delete a2.tag);
|
|
21131
|
-
const T2 = new Promise(async (
|
|
20817
|
+
const T2 = new Promise(async (S3) => {
|
|
21132
20818
|
const O3 = ({ id: Z2 }) => {
|
|
21133
20819
|
var we2;
|
|
21134
|
-
((we2 = I2.id) == null ? void 0 : we2.toString()) === Z2.toString() && (this.removeRequestFromQueue(Z2), this.relayer.events.removeListener(C$1.publish, O3),
|
|
20820
|
+
((we2 = I2.id) == null ? void 0 : we2.toString()) === Z2.toString() && (this.removeRequestFromQueue(Z2), this.relayer.events.removeListener(C$1.publish, O3), S3());
|
|
21135
20821
|
};
|
|
21136
20822
|
this.relayer.events.on(C$1.publish, O3);
|
|
21137
20823
|
const te2 = Si$1(new Promise((Z2, we2) => {
|
|
21138
20824
|
this.rpcPublish(I2, l2).then(Z2).catch((Ee2) => {
|
|
21139
20825
|
this.logger.warn(Ee2, Ee2?.message), we2(Ee2);
|
|
21140
20826
|
});
|
|
21141
|
-
}), this.initialPublishTimeout, `Failed initial custom payload publish, retrying.... method:${
|
|
20827
|
+
}), this.initialPublishTimeout, `Failed initial custom payload publish, retrying.... method:${L2} id:${w2} tag:${m3}`);
|
|
21142
20828
|
try {
|
|
21143
20829
|
await te2, this.events.removeListener(C$1.publish, O3);
|
|
21144
20830
|
} catch (Z2) {
|
|
@@ -21159,10 +20845,10 @@ class Yn extends m$1 {
|
|
|
21159
20845
|
this.events.off(i3, s2);
|
|
21160
20846
|
}), G$1(this, "removeListener", (i3, s2) => {
|
|
21161
20847
|
this.events.removeListener(i3, s2);
|
|
21162
|
-
}), this.relayer = e2, this.logger =
|
|
20848
|
+
}), this.relayer = e2, this.logger = Re$3(t2, this.name), this.registerEventListeners();
|
|
21163
20849
|
}
|
|
21164
20850
|
get context() {
|
|
21165
|
-
return
|
|
20851
|
+
return ee$3(this.logger);
|
|
21166
20852
|
}
|
|
21167
20853
|
async rpcPublish(e2, t2) {
|
|
21168
20854
|
this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "message", direction: "outgoing", request: e2 });
|
|
@@ -21275,10 +20961,10 @@ class Si extends P$3 {
|
|
|
21275
20961
|
const s2 = j$2.deleted;
|
|
21276
20962
|
this.logger.info(`Emitting ${s2}`), this.logger.debug({ type: "event", event: s2, data: i3 }), await this.persist();
|
|
21277
20963
|
});
|
|
21278
|
-
}), this.relayer = e2, this.logger =
|
|
20964
|
+
}), this.relayer = e2, this.logger = Re$3(t2, this.name), this.clientId = "";
|
|
21279
20965
|
}
|
|
21280
20966
|
get context() {
|
|
21281
|
-
return
|
|
20967
|
+
return ee$3(this.logger);
|
|
21282
20968
|
}
|
|
21283
20969
|
get storageKey() {
|
|
21284
20970
|
return this.storagePrefix + this.version + this.relayer.core.customStoragePrefix + "//" + this.name;
|
|
@@ -21537,7 +21223,7 @@ class Ai extends d$4 {
|
|
|
21537
21223
|
this.logger.trace("Initialized"), this.registerEventListeners(), await Promise.all([this.messages.init(), this.subscriber.init()]), this.initialized = true, this.transportOpen().catch((e2) => this.logger.warn(e2, e2?.message));
|
|
21538
21224
|
}
|
|
21539
21225
|
get context() {
|
|
21540
|
-
return
|
|
21226
|
+
return ee$3(this.logger);
|
|
21541
21227
|
}
|
|
21542
21228
|
get connected() {
|
|
21543
21229
|
var e2, t2, i3;
|
|
@@ -21887,10 +21573,10 @@ class ji extends f$3 {
|
|
|
21887
21573
|
this.map.set(o3, c2), await this.persist();
|
|
21888
21574
|
}), U$1(this, "delete", async (o3, a2) => {
|
|
21889
21575
|
this.isInitialized(), this.map.has(o3) && (this.logger.debug("Deleting value"), this.logger.trace({ type: "method", method: "delete", key: o3, reason: a2 }), this.map.delete(o3), this.addToRecentlyDeleted(o3), await this.persist());
|
|
21890
|
-
}), this.logger =
|
|
21576
|
+
}), this.logger = Re$3(t2, this.name), this.storagePrefix = s2, this.getKey = n3;
|
|
21891
21577
|
}
|
|
21892
21578
|
get context() {
|
|
21893
|
-
return
|
|
21579
|
+
return ee$3(this.logger);
|
|
21894
21580
|
}
|
|
21895
21581
|
get storageKey() {
|
|
21896
21582
|
return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name;
|
|
@@ -21951,7 +21637,7 @@ class ji extends f$3 {
|
|
|
21951
21637
|
var Uo = Object.defineProperty, Fo = (r2, e2, t2) => e2 in r2 ? Uo(r2, e2, { enumerable: true, configurable: true, writable: true, value: t2 }) : r2[e2] = t2, d$2 = (r2, e2, t2) => Fo(r2, typeof e2 != "symbol" ? e2 + "" : e2, t2);
|
|
21952
21638
|
class Ui {
|
|
21953
21639
|
constructor(e2, t2) {
|
|
21954
|
-
this.core = e2, this.logger = t2, d$2(this, "name", Kt$1), d$2(this, "version", Bt$1), d$2(this, "events", new xe$
|
|
21640
|
+
this.core = e2, this.logger = t2, d$2(this, "name", Kt$1), d$2(this, "version", Bt$1), d$2(this, "events", new xe$3()), d$2(this, "pairings"), d$2(this, "initialized", false), d$2(this, "storagePrefix", W$1), d$2(this, "ignoredPayloadTypes", [ie$1]), d$2(this, "registeredMethods", []), d$2(this, "init", async () => {
|
|
21955
21641
|
this.initialized || (await this.pairings.init(), await this.cleanup(), this.registerRelayerEvents(), this.registerExpirerEvents(), this.initialized = true, this.logger.trace("Initialized"));
|
|
21956
21642
|
}), d$2(this, "register", ({ methods: i3 }) => {
|
|
21957
21643
|
this.isInitialized(), this.registeredMethods = [.../* @__PURE__ */ new Set([...this.registeredMethods, ...i3])];
|
|
@@ -22122,10 +21808,10 @@ class Ui {
|
|
|
22122
21808
|
const { message: s2 } = Bt$2("EXPIRED", `pairing topic: ${i3}`);
|
|
22123
21809
|
throw new Error(s2);
|
|
22124
21810
|
}
|
|
22125
|
-
}), this.core = e2, this.logger =
|
|
21811
|
+
}), this.core = e2, this.logger = Re$3(t2, this.name), this.pairings = new ji(this.core, this.logger, this.name, this.storagePrefix);
|
|
22126
21812
|
}
|
|
22127
21813
|
get context() {
|
|
22128
|
-
return
|
|
21814
|
+
return ee$3(this.logger);
|
|
22129
21815
|
}
|
|
22130
21816
|
isInitialized() {
|
|
22131
21817
|
if (!this.initialized) {
|
|
@@ -22145,7 +21831,7 @@ class Ui {
|
|
|
22145
21831
|
});
|
|
22146
21832
|
}
|
|
22147
21833
|
registerExpirerEvents() {
|
|
22148
|
-
this.core.expirer.on(
|
|
21834
|
+
this.core.expirer.on(q2.expired, async (e2) => {
|
|
22149
21835
|
const { topic: t2 } = Ui$1(e2.target);
|
|
22150
21836
|
t2 && this.pairings.keys.includes(t2) && (await this.deletePairing(t2, true), this.events.emit(ae$1.expire, { topic: t2 }));
|
|
22151
21837
|
});
|
|
@@ -22179,10 +21865,10 @@ class Fi extends I {
|
|
|
22179
21865
|
this.events.off(i3, s2);
|
|
22180
21866
|
}), N$2(this, "removeListener", (i3, s2) => {
|
|
22181
21867
|
this.events.removeListener(i3, s2);
|
|
22182
|
-
}), this.logger =
|
|
21868
|
+
}), this.logger = Re$3(t2, this.name);
|
|
22183
21869
|
}
|
|
22184
21870
|
get context() {
|
|
22185
|
-
return
|
|
21871
|
+
return ee$3(this.logger);
|
|
22186
21872
|
}
|
|
22187
21873
|
get storageKey() {
|
|
22188
21874
|
return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name;
|
|
@@ -22282,7 +21968,7 @@ class Mi extends S$2 {
|
|
|
22282
21968
|
}), z$1(this, "set", (i3, s2) => {
|
|
22283
21969
|
this.isInitialized();
|
|
22284
21970
|
const n3 = this.formatTarget(i3), o3 = { target: n3, expiry: s2 };
|
|
22285
|
-
this.expirations.set(n3, o3), this.checkExpiry(n3, o3), this.events.emit(
|
|
21971
|
+
this.expirations.set(n3, o3), this.checkExpiry(n3, o3), this.events.emit(q2.created, { target: n3, expiration: o3 });
|
|
22286
21972
|
}), z$1(this, "get", (i3) => {
|
|
22287
21973
|
this.isInitialized();
|
|
22288
21974
|
const s2 = this.formatTarget(i3);
|
|
@@ -22290,7 +21976,7 @@ class Mi extends S$2 {
|
|
|
22290
21976
|
}), z$1(this, "del", (i3) => {
|
|
22291
21977
|
if (this.isInitialized(), this.has(i3)) {
|
|
22292
21978
|
const s2 = this.formatTarget(i3), n3 = this.getExpiration(s2);
|
|
22293
|
-
this.expirations.delete(s2), this.events.emit(
|
|
21979
|
+
this.expirations.delete(s2), this.events.emit(q2.deleted, { target: s2, expiration: n3 });
|
|
22294
21980
|
}
|
|
22295
21981
|
}), z$1(this, "on", (i3, s2) => {
|
|
22296
21982
|
this.events.on(i3, s2);
|
|
@@ -22300,10 +21986,10 @@ class Mi extends S$2 {
|
|
|
22300
21986
|
this.events.off(i3, s2);
|
|
22301
21987
|
}), z$1(this, "removeListener", (i3, s2) => {
|
|
22302
21988
|
this.events.removeListener(i3, s2);
|
|
22303
|
-
}), this.logger =
|
|
21989
|
+
}), this.logger = Re$3(t2, this.name);
|
|
22304
21990
|
}
|
|
22305
21991
|
get context() {
|
|
22306
|
-
return
|
|
21992
|
+
return ee$3(this.logger);
|
|
22307
21993
|
}
|
|
22308
21994
|
get storageKey() {
|
|
22309
21995
|
return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name;
|
|
@@ -22330,7 +22016,7 @@ class Mi extends S$2 {
|
|
|
22330
22016
|
return await this.core.storage.getItem(this.storageKey);
|
|
22331
22017
|
}
|
|
22332
22018
|
async persist() {
|
|
22333
|
-
await this.setExpirations(this.values), this.events.emit(
|
|
22019
|
+
await this.setExpirations(this.values), this.events.emit(q2.sync);
|
|
22334
22020
|
}
|
|
22335
22021
|
async restore() {
|
|
22336
22022
|
try {
|
|
@@ -22358,20 +22044,20 @@ class Mi extends S$2 {
|
|
|
22358
22044
|
cjsExports$3.toMiliseconds(i3) - Date.now() <= 0 && this.expire(e2, t2);
|
|
22359
22045
|
}
|
|
22360
22046
|
expire(e2, t2) {
|
|
22361
|
-
this.expirations.delete(e2), this.events.emit(
|
|
22047
|
+
this.expirations.delete(e2), this.events.emit(q2.expired, { target: e2, expiration: t2 });
|
|
22362
22048
|
}
|
|
22363
22049
|
checkExpirations() {
|
|
22364
22050
|
this.core.relayer.connected && this.expirations.forEach((e2, t2) => this.checkExpiry(t2, e2));
|
|
22365
22051
|
}
|
|
22366
22052
|
registerEventListeners() {
|
|
22367
|
-
this.core.heartbeat.on(r$1.pulse, () => this.checkExpirations()), this.events.on(
|
|
22368
|
-
const t2 =
|
|
22053
|
+
this.core.heartbeat.on(r$1.pulse, () => this.checkExpirations()), this.events.on(q2.created, (e2) => {
|
|
22054
|
+
const t2 = q2.created;
|
|
22369
22055
|
this.logger.info(`Emitting ${t2}`), this.logger.debug({ type: "event", event: t2, data: e2 }), this.persist();
|
|
22370
|
-
}), this.events.on(
|
|
22371
|
-
const t2 =
|
|
22056
|
+
}), this.events.on(q2.expired, (e2) => {
|
|
22057
|
+
const t2 = q2.expired;
|
|
22372
22058
|
this.logger.info(`Emitting ${t2}`), this.logger.debug({ type: "event", event: t2, data: e2 }), this.persist();
|
|
22373
|
-
}), this.events.on(
|
|
22374
|
-
const t2 =
|
|
22059
|
+
}), this.events.on(q2.deleted, (e2) => {
|
|
22060
|
+
const t2 = q2.deleted;
|
|
22375
22061
|
this.logger.info(`Emitting ${t2}`), this.logger.debug({ type: "event", event: t2, data: e2 }), this.persist();
|
|
22376
22062
|
});
|
|
22377
22063
|
}
|
|
@@ -22401,13 +22087,13 @@ class Ki extends M$3 {
|
|
|
22401
22087
|
m3.src = c2, m3.style.display = "none", m3.addEventListener("error", u2, { signal: this.abortController.signal });
|
|
22402
22088
|
const D2 = (w2) => {
|
|
22403
22089
|
if (w2.data && typeof w2.data == "string") try {
|
|
22404
|
-
const
|
|
22405
|
-
if (
|
|
22406
|
-
if (sn$1(
|
|
22407
|
-
clearInterval(l2), h4.body.removeChild(m3), this.abortController.signal.removeEventListener("abort", u2), window.removeEventListener("message", D2), y3(
|
|
22090
|
+
const E2 = JSON.parse(w2.data);
|
|
22091
|
+
if (E2.type === "verify_attestation") {
|
|
22092
|
+
if (sn$1(E2.attestation).payload.id !== o3) return;
|
|
22093
|
+
clearInterval(l2), h4.body.removeChild(m3), this.abortController.signal.removeEventListener("abort", u2), window.removeEventListener("message", D2), y3(E2.attestation === null ? "" : E2.attestation);
|
|
22408
22094
|
}
|
|
22409
|
-
} catch (
|
|
22410
|
-
this.logger.warn(
|
|
22095
|
+
} catch (E2) {
|
|
22096
|
+
this.logger.warn(E2);
|
|
22411
22097
|
}
|
|
22412
22098
|
};
|
|
22413
22099
|
h4.body.appendChild(m3), window.addEventListener("message", D2, { signal: this.abortController.signal });
|
|
@@ -22482,13 +22168,13 @@ class Ki extends M$3 {
|
|
|
22482
22168
|
const o3 = Aa(s2, n3.publicKey), a2 = { hasExpired: cjsExports$3.toMiliseconds(o3.exp) < Date.now(), payload: o3 };
|
|
22483
22169
|
if (a2.hasExpired) throw this.logger.warn("resolve: jwt attestation expired"), new Error("JWT attestation expired");
|
|
22484
22170
|
return { origin: a2.payload.origin, isScam: a2.payload.isScam, isVerified: a2.payload.isVerified };
|
|
22485
|
-
}), this.logger =
|
|
22171
|
+
}), this.logger = Re$3(t2, this.name), this.abortController = new AbortController(), this.isDevEnv = ki$1(), this.init();
|
|
22486
22172
|
}
|
|
22487
22173
|
get storeKey() {
|
|
22488
22174
|
return this.storagePrefix + this.version + this.core.customStoragePrefix + "//verify:public:key";
|
|
22489
22175
|
}
|
|
22490
22176
|
get context() {
|
|
22491
|
-
return
|
|
22177
|
+
return ee$3(this.logger);
|
|
22492
22178
|
}
|
|
22493
22179
|
startAbortTimer(e2) {
|
|
22494
22180
|
return this.abortController = new AbortController(), setTimeout(() => this.abortController.abort(), cjsExports$3.toMiliseconds(e2));
|
|
@@ -22500,7 +22186,7 @@ class Vi extends O$1 {
|
|
|
22500
22186
|
super(e2, t2), this.projectId = e2, this.logger = t2, Bi(this, "context", Zt$1), Bi(this, "registerDeviceToken", async (i3) => {
|
|
22501
22187
|
const { clientId: s2, token: n3, notificationType: o3, enableEncrypted: a2 = false } = i3, c2 = `${Qt$1}/${this.projectId}/clients`;
|
|
22502
22188
|
await fetch(c2, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ client_id: s2, type: o3, token: n3, always_raw: a2 }) });
|
|
22503
|
-
}), this.logger =
|
|
22189
|
+
}), this.logger = Re$3(t2, this.context);
|
|
22504
22190
|
}
|
|
22505
22191
|
}
|
|
22506
22192
|
var Yo = Object.defineProperty, qi = Object.getOwnPropertySymbols, Jo = Object.prototype.hasOwnProperty, Xo = Object.prototype.propertyIsEnumerable, et$1 = (r2, e2, t2) => e2 in r2 ? Yo(r2, e2, { enumerable: true, configurable: true, writable: true, value: t2 }) : r2[e2] = t2, _e$1 = (r2, e2) => {
|
|
@@ -22564,7 +22250,7 @@ class Gi extends R$1 {
|
|
|
22564
22250
|
}), A$1(this, "sendEvent", async (s2) => {
|
|
22565
22251
|
const n3 = this.getAppDomain() ? "" : "&sp=desktop";
|
|
22566
22252
|
return await fetch(`${si}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${Pe$1}${n3}`, { method: "POST", body: JSON.stringify(s2) });
|
|
22567
|
-
}), A$1(this, "getAppDomain", () => br$1().url), this.logger =
|
|
22253
|
+
}), A$1(this, "getAppDomain", () => br$1().url), this.logger = Re$3(t2, this.context), this.telemetryEnabled = i3, i3 ? this.restore().then(async () => {
|
|
22568
22254
|
await this.submit(), this.setEventListeners();
|
|
22569
22255
|
}) : this.persist();
|
|
22570
22256
|
}
|
|
@@ -22592,11 +22278,11 @@ let Oe$1 = class Oe extends h$2 {
|
|
|
22592
22278
|
console.warn("Failed to copy global core", a2);
|
|
22593
22279
|
}
|
|
22594
22280
|
this.projectId = e2?.projectId, this.relayUrl = e2?.relayUrl || Ke$2, this.customStoragePrefix = e2 != null && e2.customStoragePrefix ? `:${e2.customStoragePrefix}` : "";
|
|
22595
|
-
const s2 =
|
|
22281
|
+
const s2 = Ge$5({ level: typeof e2?.logger == "string" && e2.logger ? e2.logger : Et$2.logger, name: ge$1 }), { logger: n3, chunkLoggerController: o3 } = Ue$5({ opts: s2, maxSizeInBytes: e2?.maxLogBlobSizeInBytes, loggerOverride: e2?.logger });
|
|
22596
22282
|
this.logChunkController = o3, (t2 = this.logChunkController) != null && t2.downloadLogsBlobInBrowser && (window.downloadLogsBlobInBrowser = async () => {
|
|
22597
22283
|
var a2, c2;
|
|
22598
22284
|
(a2 = this.logChunkController) != null && a2.downloadLogsBlobInBrowser && ((c2 = this.logChunkController) == null || c2.downloadLogsBlobInBrowser({ clientId: await this.crypto.getClientId() }));
|
|
22599
|
-
}), this.logger =
|
|
22285
|
+
}), this.logger = Re$3(n3, this.name), this.heartbeat = new i$1(), this.crypto = new wi(this, this.logger, e2?.keychain), this.history = new Fi(this, this.logger), this.expirer = new Mi(this, this.logger), this.storage = e2 != null && e2.storage ? e2.storage : new h$3(Hi2(Hi2({}, It$2), e2?.storageOptions)), this.relayer = new Ai({ core: this, logger: this.logger, relayUrl: this.relayUrl, projectId: this.projectId }), this.pairing = new Ui(this, this.logger), this.verify = new Ki(this, this.logger, this.storage), this.echoClient = new Vi(this.projectId || "", this.logger), this.linkModeSupportedApps = [], this.eventClient = new Gi(this, this.logger, e2?.telemetryEnabled), this.setGlobalCore(this);
|
|
22600
22286
|
}
|
|
22601
22287
|
static async init(e2) {
|
|
22602
22288
|
const t2 = new Oe(e2);
|
|
@@ -22605,7 +22291,7 @@ let Oe$1 = class Oe extends h$2 {
|
|
|
22605
22291
|
return await t2.storage.setItem(Ut$1, i3), t2;
|
|
22606
22292
|
}
|
|
22607
22293
|
get context() {
|
|
22608
|
-
return
|
|
22294
|
+
return ee$3(this.logger);
|
|
22609
22295
|
}
|
|
22610
22296
|
async start() {
|
|
22611
22297
|
this.initialized || await this.initialize();
|
|
@@ -22655,14 +22341,14 @@ let Oe$1 = class Oe extends h$2 {
|
|
|
22655
22341
|
};
|
|
22656
22342
|
const ta = Oe$1;
|
|
22657
22343
|
const De = "wc", Le$1 = 2, Me$1 = "client", Re = `${De}@${Le$1}:${Me$1}:`, Ie$1 = { name: Me$1, logger: "error" }, $e$1 = "WALLETCONNECT_DEEPLINK_CHOICE", dt$1 = "proposal", Ke$1 = "Proposal expired", ut$1 = "session", se$1 = cjsExports$3.SEVEN_DAYS, gt$1 = "engine", N$1 = { wc_sessionPropose: { req: { ttl: cjsExports$3.FIVE_MINUTES, prompt: true, tag: 1100 }, res: { ttl: cjsExports$3.FIVE_MINUTES, prompt: false, tag: 1101 }, reject: { ttl: cjsExports$3.FIVE_MINUTES, prompt: false, tag: 1120 }, autoReject: { ttl: cjsExports$3.FIVE_MINUTES, prompt: false, tag: 1121 } }, wc_sessionSettle: { req: { ttl: cjsExports$3.FIVE_MINUTES, prompt: false, tag: 1102 }, res: { ttl: cjsExports$3.FIVE_MINUTES, prompt: false, tag: 1103 } }, wc_sessionUpdate: { req: { ttl: cjsExports$3.ONE_DAY, prompt: false, tag: 1104 }, res: { ttl: cjsExports$3.ONE_DAY, prompt: false, tag: 1105 } }, wc_sessionExtend: { req: { ttl: cjsExports$3.ONE_DAY, prompt: false, tag: 1106 }, res: { ttl: cjsExports$3.ONE_DAY, prompt: false, tag: 1107 } }, wc_sessionRequest: { req: { ttl: cjsExports$3.FIVE_MINUTES, prompt: true, tag: 1108 }, res: { ttl: cjsExports$3.FIVE_MINUTES, prompt: false, tag: 1109 } }, wc_sessionEvent: { req: { ttl: cjsExports$3.FIVE_MINUTES, prompt: true, tag: 1110 }, res: { ttl: cjsExports$3.FIVE_MINUTES, prompt: false, tag: 1111 } }, wc_sessionDelete: { req: { ttl: cjsExports$3.ONE_DAY, prompt: false, tag: 1112 }, res: { ttl: cjsExports$3.ONE_DAY, prompt: false, tag: 1113 } }, wc_sessionPing: { req: { ttl: cjsExports$3.ONE_DAY, prompt: false, tag: 1114 }, res: { ttl: cjsExports$3.ONE_DAY, prompt: false, tag: 1115 } }, wc_sessionAuthenticate: { req: { ttl: cjsExports$3.ONE_HOUR, prompt: true, tag: 1116 }, res: { ttl: cjsExports$3.ONE_HOUR, prompt: false, tag: 1117 }, reject: { ttl: cjsExports$3.FIVE_MINUTES, prompt: false, tag: 1118 }, autoReject: { ttl: cjsExports$3.FIVE_MINUTES, prompt: false, tag: 1119 } } }, Te$1 = { min: cjsExports$3.FIVE_MINUTES, max: cjsExports$3.SEVEN_DAYS }, K2 = { idle: "IDLE", active: "ACTIVE" }, yt$1 = { eth_sendTransaction: { key: "" }, eth_sendRawTransaction: { key: "" }, wallet_sendCalls: { key: "" }, solana_signTransaction: { key: "signature" }, solana_signAllTransactions: { key: "transactions" }, solana_signAndSendTransaction: { key: "signature" }, sui_signAndExecuteTransaction: { key: "digest" }, sui_signTransaction: { key: "" }, hedera_signAndExecuteTransaction: { key: "transactionId" }, hedera_executeTransaction: { key: "transactionId" }, near_signTransaction: { key: "" }, near_signTransactions: { key: "" }, tron_signTransaction: { key: "txID" }, xrpl_signTransaction: { key: "" }, xrpl_signTransactionFor: { key: "" }, algo_signTxn: { key: "" }, sendTransfer: { key: "txid" }, stacks_stxTransfer: { key: "txId" }, polkadot_signTransaction: { key: "" }, cosmos_signDirect: { key: "" } }, mt$1 = "request", wt$1 = ["wc_sessionPropose", "wc_sessionRequest", "wc_authRequest", "wc_sessionAuthenticate"], _t$1 = "wc", vt$1 = "auth", St$1 = "authKeys", Et$1 = "pairingTopics", ft$1 = "requests", we$1 = `${_t$1}@${1.5}:${vt$1}:`, _e = `${we$1}:PUB_KEY`;
|
|
22658
|
-
var As = Object.defineProperty, xs = Object.defineProperties, Cs = Object.getOwnPropertyDescriptors, Rt$1 = Object.getOwnPropertySymbols, Vs = Object.prototype.hasOwnProperty, ks = Object.prototype.propertyIsEnumerable, Ue$1 = (
|
|
22659
|
-
for (var e2 in o3 || (o3 = {})) Vs.call(o3, e2) && Ue$1(
|
|
22660
|
-
if (Rt$1) for (var e2 of Rt$1(o3)) ks.call(o3, e2) && Ue$1(
|
|
22661
|
-
return
|
|
22662
|
-
}, b$1 = (
|
|
22344
|
+
var As = Object.defineProperty, xs = Object.defineProperties, Cs = Object.getOwnPropertyDescriptors, Rt$1 = Object.getOwnPropertySymbols, Vs = Object.prototype.hasOwnProperty, ks = Object.prototype.propertyIsEnumerable, Ue$1 = (S3, o3, e2) => o3 in S3 ? As(S3, o3, { enumerable: true, configurable: true, writable: true, value: e2 }) : S3[o3] = e2, E$2 = (S3, o3) => {
|
|
22345
|
+
for (var e2 in o3 || (o3 = {})) Vs.call(o3, e2) && Ue$1(S3, e2, o3[e2]);
|
|
22346
|
+
if (Rt$1) for (var e2 of Rt$1(o3)) ks.call(o3, e2) && Ue$1(S3, e2, o3[e2]);
|
|
22347
|
+
return S3;
|
|
22348
|
+
}, b$1 = (S3, o3) => xs(S3, Cs(o3)), c$2 = (S3, o3, e2) => Ue$1(S3, typeof o3 != "symbol" ? o3 + "" : o3, e2);
|
|
22663
22349
|
class Ds extends V$1 {
|
|
22664
22350
|
constructor(o3) {
|
|
22665
|
-
super(o3), c$2(this, "name", gt$1), c$2(this, "events", new xe$
|
|
22351
|
+
super(o3), c$2(this, "name", gt$1), c$2(this, "events", new xe$3()), c$2(this, "initialized", false), c$2(this, "requestQueue", { state: K2.idle, queue: [] }), c$2(this, "sessionRequestQueue", { state: K2.idle, queue: [] }), c$2(this, "emittedSessionRequests", new Hi$1({ limit: 500 })), c$2(this, "requestQueueDelay", cjsExports$3.ONE_SECOND), c$2(this, "expectedPairingMethodMap", /* @__PURE__ */ new Map()), c$2(this, "recentlyDeletedMap", /* @__PURE__ */ new Map()), c$2(this, "recentlyDeletedLimit", 200), c$2(this, "relayMessageCache", []), c$2(this, "pendingSessions", /* @__PURE__ */ new Map()), c$2(this, "init", async () => {
|
|
22666
22352
|
this.initialized || (await this.cleanup(), this.registerRelayerEvents(), this.registerExpirerEvents(), this.registerPairingEvents(), await this.registerLinkModeListeners(), this.client.core.pairing.register({ methods: Object.keys(N$1) }), this.initialized = true, setTimeout(async () => {
|
|
22667
22353
|
await this.processPendingMessageEvents(), this.sessionRequestQueue.queue = this.getPendingSessionRequests(), this.processSessionRequestQueue();
|
|
22668
22354
|
}, cjsExports$3.toMiliseconds(this.requestQueueDelay)));
|
|
@@ -22683,21 +22369,21 @@ class Ds extends V$1 {
|
|
|
22683
22369
|
throw this.client.logger.error(`connect() -> pairing.get(${u2}) failed`), R3;
|
|
22684
22370
|
}
|
|
22685
22371
|
if (!u2 || !g2) {
|
|
22686
|
-
const { topic: R3, uri:
|
|
22687
|
-
u2 = R3, w2 =
|
|
22372
|
+
const { topic: R3, uri: q3 } = await this.client.core.pairing.create({ internal: { skipSubscribe: true } });
|
|
22373
|
+
u2 = R3, w2 = q3;
|
|
22688
22374
|
}
|
|
22689
22375
|
if (!u2) {
|
|
22690
22376
|
const { message: R3 } = Bt$2("NO_MATCHING_KEY", `connect() pairing topic: ${u2}`);
|
|
22691
22377
|
throw new Error(R3);
|
|
22692
22378
|
}
|
|
22693
|
-
const f4 = await this.client.core.crypto.generateKeyPair(),
|
|
22694
|
-
const { domain:
|
|
22695
|
-
return { domain:
|
|
22379
|
+
const f4 = await this.client.core.crypto.generateKeyPair(), v2 = _i$1(d3), T2 = E$2(b$1(E$2(E$2({ requiredNamespaces: r2, optionalNamespaces: n3, relays: h4 ?? [{ protocol: Nt$1 }], proposer: { publicKey: f4, metadata: this.client.metadata }, expiryTimestamp: v2, pairingTopic: u2 }, a2 && { sessionProperties: a2 }), l2 && { scopedProperties: l2 }), { id: payloadId() }), (p2 || y3) && { requests: { authentication: p2?.map((R3) => {
|
|
22380
|
+
const { domain: q3, chains: ve2, nonce: ce2, uri: Y2, exp: ie2, nbf: le2, type: J4, statement: pe2, requestId: he2, resources: C2, signatureTypes: D2 } = R3;
|
|
22381
|
+
return { domain: q3, chains: ve2, nonce: ce2, type: J4 ?? "caip122", aud: Y2, version: "1", iat: (/* @__PURE__ */ new Date()).toISOString(), exp: ie2, nbf: le2, statement: pe2, requestId: he2, resources: C2, signatureTypes: D2 };
|
|
22696
22382
|
}), walletPay: y3 } }), A2 = $i$1("session_connect", T2.id), { reject: V3, resolve: x2, done: U2 } = Ai$1(d3, Ke$1), z2 = ({ id: R3 }) => {
|
|
22697
22383
|
R3 === T2.id && (this.client.events.off("proposal_expire", z2), this.pendingSessions.delete(T2.id), this.events.emit(A2, { error: { message: Ke$1, code: 0 } }));
|
|
22698
22384
|
};
|
|
22699
|
-
return this.client.events.on("proposal_expire", z2), this.events.once(A2, ({ error: R3, session:
|
|
22700
|
-
this.client.events.off("proposal_expire", z2), R3 ? V3(R3) :
|
|
22385
|
+
return this.client.events.on("proposal_expire", z2), this.events.once(A2, ({ error: R3, session: q3 }) => {
|
|
22386
|
+
this.client.events.off("proposal_expire", z2), R3 ? V3(R3) : q3 && x2(q3);
|
|
22701
22387
|
}), await this.setProposal(T2.id, T2), await this.sendProposeSession({ proposal: T2, publishOpts: { internal: { throwOnFailedPublish: true }, tvf: { correlationId: T2.id } } }).catch((R3) => {
|
|
22702
22388
|
throw this.deleteProposal(T2.id), R3;
|
|
22703
22389
|
}), { uri: w2, approval: U2 };
|
|
@@ -22713,38 +22399,38 @@ class Ds extends V$1 {
|
|
|
22713
22399
|
const r2 = this.client.core.eventClient.createEvent({ properties: { topic: (t2 = e2?.id) == null ? void 0 : t2.toString(), trace: [rr.session_approve_started] } });
|
|
22714
22400
|
try {
|
|
22715
22401
|
this.isInitialized(), await this.confirmOnlineStateOrThrow();
|
|
22716
|
-
} catch (
|
|
22717
|
-
throw r2.setError(nr.no_internet_connection),
|
|
22402
|
+
} catch (q3) {
|
|
22403
|
+
throw r2.setError(nr.no_internet_connection), q3;
|
|
22718
22404
|
}
|
|
22719
22405
|
try {
|
|
22720
22406
|
await this.isValidProposalId(e2?.id);
|
|
22721
|
-
} catch (
|
|
22722
|
-
throw this.client.logger.error(`approve() -> proposal.get(${e2?.id}) failed`), r2.setError(nr.proposal_not_found),
|
|
22407
|
+
} catch (q3) {
|
|
22408
|
+
throw this.client.logger.error(`approve() -> proposal.get(${e2?.id}) failed`), r2.setError(nr.proposal_not_found), q3;
|
|
22723
22409
|
}
|
|
22724
22410
|
try {
|
|
22725
22411
|
await this.isValidApprove(e2);
|
|
22726
|
-
} catch (
|
|
22727
|
-
throw this.client.logger.error("approve() -> isValidApprove() failed"), r2.setError(nr.session_approve_namespace_validation_failure),
|
|
22412
|
+
} catch (q3) {
|
|
22413
|
+
throw this.client.logger.error("approve() -> isValidApprove() failed"), r2.setError(nr.session_approve_namespace_validation_failure), q3;
|
|
22728
22414
|
}
|
|
22729
22415
|
const { id: n3, relayProtocol: a2, namespaces: l2, sessionProperties: h4, scopedProperties: p2, sessionConfig: y3, proposalRequestsResponses: d3 } = e2, u2 = this.client.proposal.get(n3);
|
|
22730
22416
|
this.client.core.eventClient.deleteEvent({ eventId: r2.eventId });
|
|
22731
|
-
const { pairingTopic: w2, proposer: g2, requiredNamespaces: f4, optionalNamespaces:
|
|
22417
|
+
const { pairingTopic: w2, proposer: g2, requiredNamespaces: f4, optionalNamespaces: v2 } = u2;
|
|
22732
22418
|
let T2 = (s2 = this.client.core.eventClient) == null ? void 0 : s2.getEvent({ topic: w2 });
|
|
22733
22419
|
T2 || (T2 = (i3 = this.client.core.eventClient) == null ? void 0 : i3.createEvent({ type: rr.session_approve_started, properties: { topic: w2, trace: [rr.session_approve_started, rr.session_namespaces_validation_success] } }));
|
|
22734
22420
|
const A2 = await this.client.core.crypto.generateKeyPair(), V3 = g2.publicKey, x2 = await this.client.core.crypto.generateSharedKey(A2, V3), U2 = b$1(E$2(E$2(E$2({ relay: { protocol: a2 ?? "irn" }, namespaces: l2, controller: { publicKey: A2, metadata: this.client.metadata }, expiry: _i$1(se$1) }, h4 && { sessionProperties: h4 }), p2 && { scopedProperties: p2 }), y3 && { sessionConfig: y3 }), { proposalRequestsResponses: d3 }), z2 = ee$1.relay;
|
|
22735
22421
|
T2.addTrace(rr.subscribing_session_topic);
|
|
22736
22422
|
try {
|
|
22737
22423
|
await this.client.core.relayer.subscribe(x2, { transportType: z2, internal: { skipSubscribe: true } });
|
|
22738
|
-
} catch (
|
|
22739
|
-
throw T2.setError(nr.subscribe_session_topic_failure),
|
|
22424
|
+
} catch (q3) {
|
|
22425
|
+
throw T2.setError(nr.subscribe_session_topic_failure), q3;
|
|
22740
22426
|
}
|
|
22741
22427
|
T2.addTrace(rr.subscribe_session_topic_success);
|
|
22742
|
-
const R3 = b$1(E$2({}, U2), { topic: x2, requiredNamespaces: f4, optionalNamespaces:
|
|
22428
|
+
const R3 = b$1(E$2({}, U2), { topic: x2, requiredNamespaces: f4, optionalNamespaces: v2, pairingTopic: w2, acknowledged: false, self: U2.controller, peer: { publicKey: g2.publicKey, metadata: g2.metadata }, controller: A2, transportType: ee$1.relay, authentication: d3?.authentication, walletPayResult: d3?.walletPay });
|
|
22743
22429
|
await this.client.session.set(x2, R3), T2.addTrace(rr.store_session);
|
|
22744
22430
|
try {
|
|
22745
22431
|
await this.sendApproveSession({ sessionTopic: x2, proposal: u2, pairingProposalResponse: { relay: { protocol: a2 ?? "irn" }, responderPublicKey: A2 }, sessionSettleRequest: U2, publishOpts: { internal: { throwOnFailedPublish: true }, tvf: E$2({ correlationId: n3 }, this.getTVFApproveParams(R3)) } }), T2.addTrace(rr.session_approve_publish_success);
|
|
22746
|
-
} catch (
|
|
22747
|
-
throw this.client.logger.error(
|
|
22432
|
+
} catch (q3) {
|
|
22433
|
+
throw this.client.logger.error(q3), this.client.session.delete(x2, zt$2("USER_DISCONNECTED")), await this.client.core.relayer.unsubscribe(x2), q3;
|
|
22748
22434
|
}
|
|
22749
22435
|
return this.client.core.eventClient.deleteEvent({ eventId: T2.eventId }), await this.client.core.pairing.updateMetadata({ topic: w2, metadata: g2.metadata }), await this.deleteProposal(n3), await this.client.core.pairing.activate({ topic: w2 }), await this.setExpiry(x2, _i$1(se$1)), { topic: x2, acknowledged: () => Promise.resolve(this.client.session.get(x2)) };
|
|
22750
22436
|
}), c$2(this, "reject", async (e2) => {
|
|
@@ -22809,8 +22495,8 @@ class Ds extends V$1 {
|
|
|
22809
22495
|
}), new Promise(async (g2) => {
|
|
22810
22496
|
var f4;
|
|
22811
22497
|
if (!((f4 = n3.sessionConfig) != null && f4.disableDeepLink)) {
|
|
22812
|
-
const
|
|
22813
|
-
await Ti$1({ id: a2, topic: i3, wcDeepLink:
|
|
22498
|
+
const v2 = await Ci$1(this.client.core.storage, $e$1);
|
|
22499
|
+
await Ti$1({ id: a2, topic: i3, wcDeepLink: v2 });
|
|
22814
22500
|
}
|
|
22815
22501
|
g2();
|
|
22816
22502
|
}), h4()]).then((g2) => g2[2]);
|
|
@@ -22864,27 +22550,27 @@ class Ds extends V$1 {
|
|
|
22864
22550
|
this.isInitialized(), this.isValidAuthenticate(e2);
|
|
22865
22551
|
const i3 = t2 && this.client.core.linkModeSupportedApps.includes(t2) && ((s2 = this.client.metadata.redirect) == null ? void 0 : s2.linkMode), r2 = i3 ? ee$1.link_mode : ee$1.relay;
|
|
22866
22552
|
r2 === ee$1.relay && await this.confirmOnlineStateOrThrow();
|
|
22867
|
-
const { chains: n3, statement: a2 = "", uri: l2, domain: h4, nonce: p2, type: y3, exp: d3, nbf: u2, methods: w2 = [], expiry: g2 } = e2, f4 = [...e2.resources || []], { topic:
|
|
22868
|
-
this.client.logger.info({ message: "Generated new pairing", pairing: { topic:
|
|
22553
|
+
const { chains: n3, statement: a2 = "", uri: l2, domain: h4, nonce: p2, type: y3, exp: d3, nbf: u2, methods: w2 = [], expiry: g2 } = e2, f4 = [...e2.resources || []], { topic: v2, uri: T2 } = await this.client.core.pairing.create({ methods: ["wc_sessionAuthenticate"], transportType: r2 });
|
|
22554
|
+
this.client.logger.info({ message: "Generated new pairing", pairing: { topic: v2, uri: T2 } });
|
|
22869
22555
|
const A2 = await this.client.core.crypto.generateKeyPair(), V3 = ba(A2);
|
|
22870
|
-
if (await Promise.all([this.client.auth.authKeys.set(_e, { responseTopic: V3, publicKey: A2 }), this.client.auth.pairingTopics.set(V3, { topic: V3, pairingTopic:
|
|
22556
|
+
if (await Promise.all([this.client.auth.authKeys.set(_e, { responseTopic: V3, publicKey: A2 }), this.client.auth.pairingTopics.set(V3, { topic: V3, pairingTopic: v2 })]), await this.client.core.relayer.subscribe(V3, { transportType: r2 }), this.client.logger.info(`sending request to new pairing topic: ${v2}`), w2.length > 0) {
|
|
22871
22557
|
const { namespace: C2 } = Je$2(n3[0]);
|
|
22872
22558
|
let D2 = Zc(C2, "request", w2);
|
|
22873
|
-
|
|
22559
|
+
je2(f4) && (D2 = Gc(D2, f4.pop())), f4.push(D2);
|
|
22874
22560
|
}
|
|
22875
|
-
const x2 = g2 && g2 > N$1.wc_sessionAuthenticate.req.ttl ? g2 : N$1.wc_sessionAuthenticate.req.ttl, U2 = { authPayload: { type: y3 ?? "caip122", chains: n3, statement: a2, aud: l2, domain: h4, version: "1", nonce: p2, iat: (/* @__PURE__ */ new Date()).toISOString(), exp: d3, nbf: u2, resources: f4 }, requester: { publicKey: A2, metadata: this.client.metadata }, expiryTimestamp: _i$1(x2) }, z2 = { eip155: { chains: n3, methods: [.../* @__PURE__ */ new Set(["personal_sign", ...w2])], events: ["chainChanged", "accountsChanged"] } }, R3 = { requiredNamespaces: {}, optionalNamespaces: z2, relays: [{ protocol: "irn" }], pairingTopic:
|
|
22561
|
+
const x2 = g2 && g2 > N$1.wc_sessionAuthenticate.req.ttl ? g2 : N$1.wc_sessionAuthenticate.req.ttl, U2 = { authPayload: { type: y3 ?? "caip122", chains: n3, statement: a2, aud: l2, domain: h4, version: "1", nonce: p2, iat: (/* @__PURE__ */ new Date()).toISOString(), exp: d3, nbf: u2, resources: f4 }, requester: { publicKey: A2, metadata: this.client.metadata }, expiryTimestamp: _i$1(x2) }, z2 = { eip155: { chains: n3, methods: [.../* @__PURE__ */ new Set(["personal_sign", ...w2])], events: ["chainChanged", "accountsChanged"] } }, R3 = { requiredNamespaces: {}, optionalNamespaces: z2, relays: [{ protocol: "irn" }], pairingTopic: v2, proposer: { publicKey: A2, metadata: this.client.metadata }, expiryTimestamp: _i$1(N$1.wc_sessionPropose.req.ttl), id: payloadId() }, { done: q3, resolve: ve2, reject: ce2 } = Ai$1(x2, "Request expired"), Y2 = payloadId(), ie2 = $i$1("session_connect", R3.id), le2 = $i$1("session_request", Y2), J4 = async ({ error: C2, session: D2 }) => {
|
|
22876
22562
|
this.events.off(le2, pe2), C2 ? ce2(C2) : D2 && ve2({ session: D2 });
|
|
22877
22563
|
}, pe2 = async (C2) => {
|
|
22878
22564
|
var D2, je$12, Fe2;
|
|
22879
22565
|
if (await this.deletePendingAuthRequest(Y2, { message: "fulfilled", code: 0 }), C2.error) {
|
|
22880
22566
|
const ue2 = zt$2("WC_METHOD_UNSUPPORTED", "wc_sessionAuthenticate");
|
|
22881
|
-
return C2.error.code === ue2.code ? void 0 : (this.events.off(ie2,
|
|
22567
|
+
return C2.error.code === ue2.code ? void 0 : (this.events.off(ie2, J4), ce2(C2.error.message));
|
|
22882
22568
|
}
|
|
22883
|
-
await this.deleteProposal(R3.id), this.events.off(ie2,
|
|
22569
|
+
await this.deleteProposal(R3.id), this.events.off(ie2, J4);
|
|
22884
22570
|
const { cacaos: He2, responder: X2 } = C2.result, Pe2 = [], Qe2 = [];
|
|
22885
22571
|
for (const ue2 of He2) {
|
|
22886
22572
|
await Vc({ cacao: ue2, projectId: this.client.core.projectId }) || (this.client.logger.error(ue2, "Signature verification failed"), ce2(zt$2("SESSION_SETTLEMENT_FAILED", "Signature verification failed")));
|
|
22887
|
-
const { p: Ne2 } = ue2, Oe3 =
|
|
22573
|
+
const { p: Ne2 } = ue2, Oe3 = je2(Ne2.resources), ze2 = [no$1(Ne2.iss)], Tt2 = bn$1(Ne2.iss);
|
|
22888
22574
|
if (Oe3) {
|
|
22889
22575
|
const be2 = zc(Oe3), qt2 = Yc(Oe3);
|
|
22890
22576
|
Pe2.push(...be2), ze2.push(...qt2);
|
|
@@ -22893,21 +22579,21 @@ class Ds extends V$1 {
|
|
|
22893
22579
|
}
|
|
22894
22580
|
const de2 = await this.client.core.crypto.generateSharedKey(A2, X2.publicKey);
|
|
22895
22581
|
let Se2;
|
|
22896
|
-
Pe2.length > 0 && (Se2 = { topic: de2, acknowledged: true, self: { publicKey: A2, metadata: this.client.metadata }, peer: X2, controller: X2.publicKey, expiry: _i$1(se$1), requiredNamespaces: {}, optionalNamespaces: {}, relay: { protocol: "irn" }, pairingTopic:
|
|
22582
|
+
Pe2.length > 0 && (Se2 = { topic: de2, acknowledged: true, self: { publicKey: A2, metadata: this.client.metadata }, peer: X2, controller: X2.publicKey, expiry: _i$1(se$1), requiredNamespaces: {}, optionalNamespaces: {}, relay: { protocol: "irn" }, pairingTopic: v2, namespaces: za([...new Set(Pe2)], [...new Set(Qe2)]), transportType: r2 }, await this.client.core.relayer.subscribe(de2, { transportType: r2 }), await this.client.session.set(de2, Se2), v2 && await this.client.core.pairing.updateMetadata({ topic: v2, metadata: X2.metadata }), Se2 = this.client.session.get(de2)), (D2 = this.client.metadata.redirect) != null && D2.linkMode && (je$12 = X2.metadata.redirect) != null && je$12.linkMode && (Fe2 = X2.metadata.redirect) != null && Fe2.universal && t2 && (this.client.core.addLinkModeSupportedApp(X2.metadata.redirect.universal), this.client.session.update(de2, { transportType: ee$1.link_mode })), ve2({ auths: He2, session: Se2 });
|
|
22897
22583
|
};
|
|
22898
|
-
this.events.once(ie2,
|
|
22584
|
+
this.events.once(ie2, J4), this.events.once(le2, pe2);
|
|
22899
22585
|
let he2;
|
|
22900
22586
|
try {
|
|
22901
22587
|
if (i3) {
|
|
22902
22588
|
const C2 = formatJsonRpcRequest("wc_sessionAuthenticate", U2, Y2);
|
|
22903
|
-
this.client.core.history.set(
|
|
22589
|
+
this.client.core.history.set(v2, C2);
|
|
22904
22590
|
const D2 = await this.client.core.crypto.encode("", C2, { type: ve$2, encoding: Ge$3 });
|
|
22905
|
-
he2 = La(t2,
|
|
22906
|
-
} else await Promise.all([this.sendRequest({ topic:
|
|
22591
|
+
he2 = La(t2, v2, D2);
|
|
22592
|
+
} else await Promise.all([this.sendRequest({ topic: v2, method: "wc_sessionAuthenticate", params: U2, expiry: e2.expiry, throwOnFailedPublish: true, clientRpcId: Y2 }), this.sendRequest({ topic: v2, method: "wc_sessionPropose", params: R3, expiry: N$1.wc_sessionPropose.req.ttl, throwOnFailedPublish: true, clientRpcId: R3.id })]);
|
|
22907
22593
|
} catch (C2) {
|
|
22908
|
-
throw this.events.off(ie2,
|
|
22594
|
+
throw this.events.off(ie2, J4), this.events.off(le2, pe2), C2;
|
|
22909
22595
|
}
|
|
22910
|
-
return await this.setProposal(R3.id, R3), await this.setAuthRequest(Y2, { request: b$1(E$2({}, U2), { verifyContext: {} }), pairingTopic:
|
|
22596
|
+
return await this.setProposal(R3.id, R3), await this.setAuthRequest(Y2, { request: b$1(E$2({}, U2), { verifyContext: {} }), pairingTopic: v2, transportType: r2 }), { uri: he2 ?? T2, response: q3 };
|
|
22911
22597
|
}), c$2(this, "approveSessionAuthenticate", async (e2) => {
|
|
22912
22598
|
const { id: t2, auths: s2 } = e2, i3 = this.client.core.eventClient.createEvent({ properties: { topic: t2.toString(), trace: [or.authenticated_session_approve_started] } });
|
|
22913
22599
|
try {
|
|
@@ -22927,9 +22613,9 @@ class Ds extends V$1 {
|
|
|
22927
22613
|
throw await this.sendError({ id: t2, topic: h4, error: V3, encodeOpts: p2 }), new Error(V3.message);
|
|
22928
22614
|
}
|
|
22929
22615
|
i3.addTrace(or.cacaos_verified);
|
|
22930
|
-
const { p: f4 } = g2,
|
|
22931
|
-
if (
|
|
22932
|
-
const V3 = zc(
|
|
22616
|
+
const { p: f4 } = g2, v2 = je2(f4.resources), T2 = [no$1(f4.iss)], A2 = bn$1(f4.iss);
|
|
22617
|
+
if (v2) {
|
|
22618
|
+
const V3 = zc(v2), x2 = Yc(v2);
|
|
22933
22619
|
y3.push(...V3), T2.push(...x2);
|
|
22934
22620
|
}
|
|
22935
22621
|
for (const V3 of T2) d3.push(`${V3}:${A2}`);
|
|
@@ -23014,21 +22700,21 @@ class Ds extends V$1 {
|
|
|
23014
22700
|
let u2;
|
|
23015
22701
|
const w2 = !!h4;
|
|
23016
22702
|
try {
|
|
23017
|
-
const
|
|
23018
|
-
u2 = await this.client.core.crypto.encode(t2, d3, { encoding:
|
|
23019
|
-
} catch (
|
|
23020
|
-
throw await this.cleanup(), this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${t2} failed`),
|
|
22703
|
+
const v2 = w2 ? Ge$3 : oe$2;
|
|
22704
|
+
u2 = await this.client.core.crypto.encode(t2, d3, { encoding: v2 });
|
|
22705
|
+
} catch (v2) {
|
|
22706
|
+
throw await this.cleanup(), this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${t2} failed`), v2;
|
|
23021
22707
|
}
|
|
23022
22708
|
let g2;
|
|
23023
22709
|
if (wt$1.includes(s2)) {
|
|
23024
|
-
const
|
|
23025
|
-
g2 = await this.client.core.verify.register({ id: T2, decryptedId:
|
|
22710
|
+
const v2 = ya(JSON.stringify(d3)), T2 = ya(u2);
|
|
22711
|
+
g2 = await this.client.core.verify.register({ id: T2, decryptedId: v2 });
|
|
23026
22712
|
}
|
|
23027
22713
|
const f4 = E$2(E$2({}, N$1[s2].req), y3);
|
|
23028
22714
|
if (f4.attestation = g2, r2 && (f4.ttl = r2), n3 && (f4.id = n3), this.client.core.history.set(t2, d3), w2) {
|
|
23029
|
-
const
|
|
23030
|
-
await global.Linking.openURL(
|
|
23031
|
-
} else f4.tvf = b$1(E$2({}, p2), { correlationId: d3.id }), l2 ? (f4.internal = b$1(E$2({}, f4.internal), { throwOnFailedPublish: true }), await this.client.core.relayer.publish(t2, u2, f4)) : this.client.core.relayer.publish(t2, u2, f4).catch((
|
|
22715
|
+
const v2 = La(h4, t2, u2);
|
|
22716
|
+
await global.Linking.openURL(v2, this.client.name);
|
|
22717
|
+
} else f4.tvf = b$1(E$2({}, p2), { correlationId: d3.id }), l2 ? (f4.internal = b$1(E$2({}, f4.internal), { throwOnFailedPublish: true }), await this.client.core.relayer.publish(t2, u2, f4)) : this.client.core.relayer.publish(t2, u2, f4).catch((v2) => this.client.logger.error(v2));
|
|
23032
22718
|
return d3.id;
|
|
23033
22719
|
}), c$2(this, "sendProposeSession", async (e2) => {
|
|
23034
22720
|
const { proposal: t2, publishOpts: s2 } = e2, i3 = formatJsonRpcRequest("wc_sessionPropose", t2, t2.id);
|
|
@@ -23663,7 +23349,7 @@ class Ds extends V$1 {
|
|
|
23663
23349
|
}
|
|
23664
23350
|
}
|
|
23665
23351
|
registerExpirerEvents() {
|
|
23666
|
-
this.client.core.expirer.on(
|
|
23352
|
+
this.client.core.expirer.on(q2.expired, async (o3) => {
|
|
23667
23353
|
const { topic: e2, id: t2 } = Ui$1(o3.target);
|
|
23668
23354
|
if (t2 && this.client.pendingRequest.keys.includes(t2)) return await this.deletePendingSessionRequest(t2, Bt$2("EXPIRED"), true);
|
|
23669
23355
|
if (t2 && this.client.auth.requests.keys.includes(t2)) return await this.deletePendingAuthRequest(t2, Bt$2("EXPIRED"), true);
|
|
@@ -23771,7 +23457,7 @@ class Us extends ji {
|
|
|
23771
23457
|
super(o3, e2, ft$1, we$1, (t2) => t2.id), this.core = o3, this.logger = e2;
|
|
23772
23458
|
}
|
|
23773
23459
|
}
|
|
23774
|
-
var Gs = Object.defineProperty, js = (
|
|
23460
|
+
var Gs = Object.defineProperty, js = (S3, o3, e2) => o3 in S3 ? Gs(S3, o3, { enumerable: true, configurable: true, writable: true, value: e2 }) : S3[o3] = e2, Ge$1 = (S3, o3, e2) => js(S3, typeof o3 != "symbol" ? o3 + "" : o3, e2);
|
|
23775
23461
|
class Fs {
|
|
23776
23462
|
constructor(o3, e2) {
|
|
23777
23463
|
this.core = o3, this.logger = e2, Ge$1(this, "authKeys"), Ge$1(this, "pairingTopics"), Ge$1(this, "requests"), this.authKeys = new $s(this.core, this.logger), this.pairingTopics = new Ks(this.core, this.logger), this.requests = new Us(this.core, this.logger);
|
|
@@ -23780,7 +23466,7 @@ class Fs {
|
|
|
23780
23466
|
await this.authKeys.init(), await this.pairingTopics.init(), await this.requests.init();
|
|
23781
23467
|
}
|
|
23782
23468
|
}
|
|
23783
|
-
var Hs = Object.defineProperty, Qs = (
|
|
23469
|
+
var Hs = Object.defineProperty, Qs = (S3, o3, e2) => o3 in S3 ? Hs(S3, o3, { enumerable: true, configurable: true, writable: true, value: e2 }) : S3[o3] = e2, _$1 = (S3, o3, e2) => Qs(S3, typeof o3 != "symbol" ? o3 + "" : o3, e2);
|
|
23784
23470
|
class qe extends J$4 {
|
|
23785
23471
|
constructor(o3) {
|
|
23786
23472
|
super(o3), _$1(this, "protocol", De), _$1(this, "version", Le$1), _$1(this, "name", Ie$1.name), _$1(this, "metadata"), _$1(this, "core"), _$1(this, "logger"), _$1(this, "events", new eventsExports.EventEmitter()), _$1(this, "engine"), _$1(this, "session"), _$1(this, "proposal"), _$1(this, "pendingRequest"), _$1(this, "auth"), _$1(this, "signConfig"), _$1(this, "on", (t2, s2) => this.events.on(t2, s2)), _$1(this, "once", (t2, s2) => this.events.once(t2, s2)), _$1(this, "off", (t2, s2) => this.events.off(t2, s2)), _$1(this, "removeListener", (t2, s2) => this.events.removeListener(t2, s2)), _$1(this, "removeAllListeners", (t2) => this.events.removeAllListeners(t2)), _$1(this, "connect", async (t2) => {
|
|
@@ -23894,7 +23580,7 @@ class qe extends J$4 {
|
|
|
23894
23580
|
return await e2.initialize(), e2;
|
|
23895
23581
|
}
|
|
23896
23582
|
get context() {
|
|
23897
|
-
return
|
|
23583
|
+
return ee$3(this.logger);
|
|
23898
23584
|
}
|
|
23899
23585
|
get pairing() {
|
|
23900
23586
|
return this.core.pairing.pairings;
|
|
@@ -24571,7 +24257,7 @@ function Z(t2) {
|
|
|
24571
24257
|
function T(t2) {
|
|
24572
24258
|
return t2 == null ? t2 === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(t2);
|
|
24573
24259
|
}
|
|
24574
|
-
const Fe = "[object RegExp]", ee = "[object String]", te = "[object Number]", se = "[object Boolean]", ie = "[object Arguments]", He = "[object Symbol]", Ue = "[object Date]", Be = "[object Map]", Le = "[object Set]", Me = "[object Array]", ze = "[object ArrayBuffer]", Ge = "[object Object]", We = "[object DataView]", Je = "[object Uint8Array]", Ke = "[object Uint8ClampedArray]",
|
|
24260
|
+
const Fe = "[object RegExp]", ee = "[object String]", te = "[object Number]", se = "[object Boolean]", ie = "[object Arguments]", He = "[object Symbol]", Ue = "[object Date]", Be = "[object Map]", Le = "[object Set]", Me = "[object Array]", ze = "[object ArrayBuffer]", Ge = "[object Object]", We = "[object DataView]", Je = "[object Uint8Array]", Ke = "[object Uint8ClampedArray]", Ve2 = "[object Uint16Array]", Ye = "[object Uint32Array]", Xe = "[object Int8Array]", ke = "[object Int16Array]", Qe = "[object Int32Array]", Ze = "[object Float32Array]", Te = "[object Float64Array]";
|
|
24575
24261
|
function x(t2) {
|
|
24576
24262
|
return ArrayBuffer.isView(t2) && !(t2 instanceof DataView);
|
|
24577
24263
|
}
|
|
@@ -24665,7 +24351,7 @@ function tt(t2) {
|
|
|
24665
24351
|
case He:
|
|
24666
24352
|
case Je:
|
|
24667
24353
|
case Ke:
|
|
24668
|
-
case
|
|
24354
|
+
case Ve2:
|
|
24669
24355
|
case Ye:
|
|
24670
24356
|
return true;
|
|
24671
24357
|
default:
|
|
@@ -24772,8 +24458,8 @@ function $(t2, e2, s2, i3) {
|
|
|
24772
24458
|
function ot(t2, ...e2) {
|
|
24773
24459
|
return ct(t2, ...e2, it);
|
|
24774
24460
|
}
|
|
24775
|
-
const ce = "error", ht = "wss://relay.walletconnect.org", pt = "wc", oe = "universal_provider", A = `${pt}@2:${oe}:`, he = "https://rpc.walletconnect.org/v1/", pe = "generic", lt = `${he}bundler`,
|
|
24776
|
-
var dt = Object.defineProperty, ft = Object.defineProperties, mt = Object.getOwnPropertyDescriptors, le = Object.getOwnPropertySymbols, gt = Object.prototype.hasOwnProperty, yt = Object.prototype.propertyIsEnumerable, ue = (t2, e2, s2) => e2 in t2 ? dt(t2, e2, { enumerable: true, configurable: true, writable: true, value: s2 }) : t2[e2] = s2,
|
|
24461
|
+
const ce = "error", ht = "wss://relay.walletconnect.org", pt = "wc", oe = "universal_provider", A = `${pt}@2:${oe}:`, he = "https://rpc.walletconnect.org/v1/", pe = "generic", lt = `${he}bundler`, v = "call_status", ut = 86400, F = { DEFAULT_CHAIN_CHANGED: "default_chain_changed" };
|
|
24462
|
+
var dt = Object.defineProperty, ft = Object.defineProperties, mt = Object.getOwnPropertyDescriptors, le = Object.getOwnPropertySymbols, gt = Object.prototype.hasOwnProperty, yt = Object.prototype.propertyIsEnumerable, ue = (t2, e2, s2) => e2 in t2 ? dt(t2, e2, { enumerable: true, configurable: true, writable: true, value: s2 }) : t2[e2] = s2, E = (t2, e2) => {
|
|
24777
24463
|
for (var s2 in e2 || (e2 = {})) gt.call(e2, s2) && ue(t2, s2, e2[s2]);
|
|
24778
24464
|
if (le) for (var s2 of le(e2)) yt.call(e2, s2) && ue(t2, s2, e2[s2]);
|
|
24779
24465
|
return t2;
|
|
@@ -24814,7 +24500,7 @@ function ge(t2) {
|
|
|
24814
24500
|
if (!Ye$2(t2)) return n3;
|
|
24815
24501
|
for (const [c2, o3] of Object.entries(t2)) {
|
|
24816
24502
|
const p2 = Gn$1(c2) ? [c2] : o3.chains, l2 = o3.methods || [], h4 = o3.events || [], f4 = o3.rpcMap || {}, u2 = ms(c2);
|
|
24817
|
-
n3[u2] = vt(
|
|
24503
|
+
n3[u2] = vt(E(E({}, n3[u2]), o3), { chains: ut$2(p2, (e2 = n3[u2]) == null ? void 0 : e2.chains), methods: ut$2(l2, (s2 = n3[u2]) == null ? void 0 : s2.methods), events: ut$2(h4, (i3 = n3[u2]) == null ? void 0 : i3.events) }), (Ye$2(f4) || Ye$2(((r2 = n3[u2]) == null ? void 0 : r2.rpcMap) || {})) && (n3[u2].rpcMap = E(E({}, f4), (a2 = n3[u2]) == null ? void 0 : a2.rpcMap));
|
|
24818
24504
|
}
|
|
24819
24505
|
return n3;
|
|
24820
24506
|
}
|
|
@@ -24866,8 +24552,8 @@ const Ie = "eip155", $t = ["atomic", "flow-control", "paymasterService", "sessio
|
|
|
24866
24552
|
return Object.keys(a2).length > 0 ? a2 : void 0;
|
|
24867
24553
|
};
|
|
24868
24554
|
var jt = Object.defineProperty, Nt = (t2, e2, s2) => e2 in t2 ? jt(t2, e2, { enumerable: true, configurable: true, writable: true, value: s2 }) : t2[e2] = s2, qt = (t2, e2, s2) => Nt(t2, e2 + "", s2);
|
|
24869
|
-
let
|
|
24870
|
-
class
|
|
24555
|
+
let L;
|
|
24556
|
+
class J3 {
|
|
24871
24557
|
constructor(e2) {
|
|
24872
24558
|
qt(this, "storage"), this.storage = e2;
|
|
24873
24559
|
}
|
|
@@ -24881,7 +24567,7 @@ class J2 {
|
|
|
24881
24567
|
return await this.storage.removeItem(e2);
|
|
24882
24568
|
}
|
|
24883
24569
|
static getStorage(e2) {
|
|
24884
|
-
return
|
|
24570
|
+
return L || (L = new J3(e2)), L;
|
|
24885
24571
|
}
|
|
24886
24572
|
}
|
|
24887
24573
|
var Dt = Object.defineProperty, Rt = Object.defineProperties, _t = Object.getOwnPropertyDescriptors, $e2 = Object.getOwnPropertySymbols, xt = Object.prototype.hasOwnProperty, Ft = Object.prototype.propertyIsEnumerable, Ae = (t2, e2, s2) => e2 in t2 ? Dt(t2, e2, { enumerable: true, configurable: true, writable: true, value: s2 }) : t2[e2] = s2, Ht = (t2, e2) => {
|
|
@@ -24900,19 +24586,19 @@ async function Lt(t2, e2, s2) {
|
|
|
24900
24586
|
return await s2(parseInt(t2)).request(formatJsonRpcRequest("eth_getTransactionReceipt", [e2]));
|
|
24901
24587
|
}
|
|
24902
24588
|
async function Mt({ sendCalls: t2, storage: e2 }) {
|
|
24903
|
-
const s2 = await e2.getItem(
|
|
24904
|
-
await e2.setItem(
|
|
24589
|
+
const s2 = await e2.getItem(v);
|
|
24590
|
+
await e2.setItem(v, Ut(Ht({}, s2), { [t2.result.id]: { request: t2.request, result: t2.result, expiry: _i$1(ut) } }));
|
|
24905
24591
|
}
|
|
24906
24592
|
async function zt({ resultId: t2, storage: e2 }) {
|
|
24907
|
-
const s2 = await e2.getItem(
|
|
24593
|
+
const s2 = await e2.getItem(v);
|
|
24908
24594
|
if (s2) {
|
|
24909
|
-
delete s2[t2], await e2.setItem(
|
|
24595
|
+
delete s2[t2], await e2.setItem(v, s2);
|
|
24910
24596
|
for (const i3 in s2) Ri$1(s2[i3].expiry) && delete s2[i3];
|
|
24911
|
-
await e2.setItem(
|
|
24597
|
+
await e2.setItem(v, s2);
|
|
24912
24598
|
}
|
|
24913
24599
|
}
|
|
24914
24600
|
async function Gt({ resultId: t2, storage: e2 }) {
|
|
24915
|
-
const s2 = await e2.getItem(
|
|
24601
|
+
const s2 = await e2.getItem(v), i3 = s2?.[t2];
|
|
24916
24602
|
if (i3 && !Ri$1(i3.expiry)) return i3;
|
|
24917
24603
|
await zt({ resultId: t2, storage: e2 });
|
|
24918
24604
|
}
|
|
@@ -24923,7 +24609,7 @@ var Wt = Object.defineProperty, Jt = Object.defineProperties, Kt = Object.getOwn
|
|
|
24923
24609
|
}, G = (t2, e2) => Jt(t2, Kt(e2)), g = (t2, e2, s2) => M2(t2, typeof e2 != "symbol" ? e2 + "" : e2, s2);
|
|
24924
24610
|
class Xt {
|
|
24925
24611
|
constructor(e2) {
|
|
24926
|
-
g(this, "name", "eip155"), g(this, "client"), g(this, "chainId"), g(this, "namespace"), g(this, "httpProviders"), g(this, "events"), g(this, "storage"), this.namespace = e2.namespace, this.events = w("events"), this.client = w("client"), this.httpProviders = this.createHttpProviders(), this.chainId = parseInt(this.getDefaultChain()), this.storage =
|
|
24612
|
+
g(this, "name", "eip155"), g(this, "client"), g(this, "chainId"), g(this, "namespace"), g(this, "httpProviders"), g(this, "events"), g(this, "storage"), this.namespace = e2.namespace, this.events = w("events"), this.client = w("client"), this.httpProviders = this.createHttpProviders(), this.chainId = parseInt(this.getDefaultChain()), this.storage = J3.getStorage(this.client.core.storage);
|
|
24927
24613
|
}
|
|
24928
24614
|
async request(e2) {
|
|
24929
24615
|
switch (e2.request.method) {
|
|
@@ -25009,15 +24695,15 @@ class Xt {
|
|
|
25009
24695
|
let u2;
|
|
25010
24696
|
try {
|
|
25011
24697
|
u2 = Ct(p2, c2, o3);
|
|
25012
|
-
} catch (
|
|
25013
|
-
console.warn("Failed to extract capabilities from session",
|
|
24698
|
+
} catch (q3) {
|
|
24699
|
+
console.warn("Failed to extract capabilities from session", q3);
|
|
25014
24700
|
}
|
|
25015
24701
|
if (u2) return u2;
|
|
25016
24702
|
const K3 = await this.client.request(e2);
|
|
25017
24703
|
try {
|
|
25018
24704
|
await this.client.session.update(e2.topic, { sessionProperties: G(z({}, p2.sessionProperties || {}), { capabilities: G(z({}, l2 || {}), { [h4]: K3 }) }) });
|
|
25019
|
-
} catch (
|
|
25020
|
-
console.warn("Failed to update session with capabilities",
|
|
24705
|
+
} catch (q3) {
|
|
24706
|
+
console.warn("Failed to update session with capabilities", q3);
|
|
25021
24707
|
}
|
|
25022
24708
|
return K3;
|
|
25023
24709
|
}
|
|
@@ -25121,14 +24807,14 @@ class Zt {
|
|
|
25121
24807
|
return new o$1(new f3(i3, w("disableProviderPing")));
|
|
25122
24808
|
}
|
|
25123
24809
|
}
|
|
25124
|
-
var Tt = Object.defineProperty, es = Object.defineProperties, ts = Object.getOwnPropertyDescriptors, Ce = Object.getOwnPropertySymbols, ss = Object.prototype.hasOwnProperty, is = Object.prototype.propertyIsEnumerable, W = (t2, e2, s2) => e2 in t2 ? Tt(t2, e2, { enumerable: true, configurable: true, writable: true, value: s2 }) : t2[e2] = s2,
|
|
24810
|
+
var Tt = Object.defineProperty, es = Object.defineProperties, ts = Object.getOwnPropertyDescriptors, Ce = Object.getOwnPropertySymbols, ss = Object.prototype.hasOwnProperty, is = Object.prototype.propertyIsEnumerable, W = (t2, e2, s2) => e2 in t2 ? Tt(t2, e2, { enumerable: true, configurable: true, writable: true, value: s2 }) : t2[e2] = s2, S2 = (t2, e2) => {
|
|
25125
24811
|
for (var s2 in e2 || (e2 = {})) ss.call(e2, s2) && W(t2, s2, e2[s2]);
|
|
25126
24812
|
if (Ce) for (var s2 of Ce(e2)) is.call(e2, s2) && W(t2, s2, e2[s2]);
|
|
25127
24813
|
return t2;
|
|
25128
|
-
},
|
|
24814
|
+
}, j = (t2, e2) => es(t2, ts(e2)), d2 = (t2, e2, s2) => W(t2, typeof e2 != "symbol" ? e2 + "" : e2, s2);
|
|
25129
24815
|
class N {
|
|
25130
24816
|
constructor(e2) {
|
|
25131
|
-
d2(this, "client"), d2(this, "namespaces"), d2(this, "optionalNamespaces"), d2(this, "sessionProperties"), d2(this, "scopedProperties"), d2(this, "events", new xe$
|
|
24817
|
+
d2(this, "client"), d2(this, "namespaces"), d2(this, "optionalNamespaces"), d2(this, "sessionProperties"), d2(this, "scopedProperties"), d2(this, "events", new xe$3()), d2(this, "rpcProviders", {}), d2(this, "session"), d2(this, "providerOpts"), d2(this, "logger"), d2(this, "uri"), d2(this, "disableProviderPing", false), d2(this, "connectParams");
|
|
25132
24818
|
var s2, i3;
|
|
25133
24819
|
this.providerOpts = e2, this.logger = Iu({ logger: (s2 = e2.logger) != null ? s2 : ce, name: (i3 = this.providerOpts.name) != null ? i3 : oe }), this.disableProviderPing = e2?.disableProviderPing || false;
|
|
25134
24820
|
}
|
|
@@ -25139,7 +24825,7 @@ class N {
|
|
|
25139
24825
|
async request(e2, s2, i3) {
|
|
25140
24826
|
const [r2, a2] = this.validateChain(s2);
|
|
25141
24827
|
if (!this.session) throw new Error("Please call connect() before request()");
|
|
25142
|
-
return await this.getProvider(r2).request({ request:
|
|
24828
|
+
return await this.getProvider(r2).request({ request: S2({}, e2), chainId: `${r2}:${a2}`, topic: this.session.topic, expiry: i3 });
|
|
25143
24829
|
}
|
|
25144
24830
|
sendAsync(e2, s2, i3, r2) {
|
|
25145
24831
|
const a2 = (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -25244,7 +24930,7 @@ class N {
|
|
|
25244
24930
|
if (!this.session) return;
|
|
25245
24931
|
const i3 = bt(s2, this.session);
|
|
25246
24932
|
if (i3?.length === 0) return;
|
|
25247
|
-
const r2 = fe(i3), a2 = C(this.namespaces, this.optionalNamespaces), n3 =
|
|
24933
|
+
const r2 = fe(i3), a2 = C(this.namespaces, this.optionalNamespaces), n3 = j(S2({}, a2[s2]), { accounts: i3, chains: r2 });
|
|
25248
24934
|
switch (s2) {
|
|
25249
24935
|
case "eip155":
|
|
25250
24936
|
this.rpcProviders[s2] = new Xt({ namespace: n3 });
|
|
@@ -25277,12 +24963,12 @@ class N {
|
|
|
25277
24963
|
var i3, r2;
|
|
25278
24964
|
if (e2 !== ((i3 = this.session) == null ? void 0 : i3.topic)) return;
|
|
25279
24965
|
const { namespaces: a2 } = s2, n3 = (r2 = this.client) == null ? void 0 : r2.session.get(e2);
|
|
25280
|
-
this.session =
|
|
24966
|
+
this.session = j(S2({}, n3), { namespaces: a2 }), this.onSessionUpdate(), this.events.emit("session_update", { topic: e2, params: s2 });
|
|
25281
24967
|
}), this.client.on("session_delete", async (e2) => {
|
|
25282
24968
|
var s2;
|
|
25283
|
-
e2.topic === ((s2 = this.session) == null ? void 0 : s2.topic) && (await this.cleanup(), this.events.emit("session_delete", e2), this.events.emit("disconnect",
|
|
24969
|
+
e2.topic === ((s2 = this.session) == null ? void 0 : s2.topic) && (await this.cleanup(), this.events.emit("session_delete", e2), this.events.emit("disconnect", j(S2({}, zt$2("USER_DISCONNECTED")), { data: e2.topic })));
|
|
25284
24970
|
}), this.on(F.DEFAULT_CHAIN_CHANGED, (e2) => {
|
|
25285
|
-
this.onChainChanged(
|
|
24971
|
+
this.onChainChanged(j(S2({}, e2), { internal: true }));
|
|
25286
24972
|
});
|
|
25287
24973
|
}
|
|
25288
24974
|
getProvider(e2) {
|
|
@@ -25521,10 +25207,10 @@ const buildProxyFunction = (objectIs = Object.is, newProxy = (target, handler) =
|
|
|
25521
25207
|
}
|
|
25522
25208
|
let nextValue = value;
|
|
25523
25209
|
if (value instanceof Promise) {
|
|
25524
|
-
value.then((
|
|
25210
|
+
value.then((v2) => {
|
|
25525
25211
|
value.status = "fulfilled";
|
|
25526
|
-
value.value =
|
|
25527
|
-
notifyUpdate(["resolve", [prop],
|
|
25212
|
+
value.value = v2;
|
|
25213
|
+
notifyUpdate(["resolve", [prop], v2]);
|
|
25528
25214
|
}).catch((e2) => {
|
|
25529
25215
|
value.status = "rejected";
|
|
25530
25216
|
value.reason = e2;
|
|
@@ -26154,7 +25840,7 @@ class WalletConnectModal {
|
|
|
26154
25840
|
}
|
|
26155
25841
|
async initUi() {
|
|
26156
25842
|
if (typeof window !== "undefined") {
|
|
26157
|
-
await Promise.resolve().then(() => require("./index-
|
|
25843
|
+
await Promise.resolve().then(() => require("./index-CmbarigA.cjs"));
|
|
26158
25844
|
const modal = document.createElement("wcm-modal");
|
|
26159
25845
|
document.body.insertAdjacentElement("beforeend", modal);
|
|
26160
25846
|
OptionsCtrl.setIsUiLoaded(true);
|
|
@@ -26377,34 +26063,6 @@ function useTronWalletConnect(projectId) {
|
|
|
26377
26063
|
signTransaction
|
|
26378
26064
|
};
|
|
26379
26065
|
}
|
|
26380
|
-
function parseBridgeUrlParams(source) {
|
|
26381
|
-
if (source && typeof source === "object") {
|
|
26382
|
-
return source;
|
|
26383
|
-
}
|
|
26384
|
-
const queryString = typeof source === "string" ? source : typeof window !== "undefined" ? window.location.search : "";
|
|
26385
|
-
const searchParams = new URLSearchParams(queryString);
|
|
26386
|
-
return {
|
|
26387
|
-
srcToken: searchParams.get("srcToken") || void 0,
|
|
26388
|
-
srcChain: searchParams.get("srcChain") || void 0,
|
|
26389
|
-
dstChain: searchParams.get("dstChain") || void 0,
|
|
26390
|
-
amount: searchParams.get("amount") || void 0
|
|
26391
|
-
};
|
|
26392
|
-
}
|
|
26393
|
-
function buildQueryString(params) {
|
|
26394
|
-
const searchParams = new URLSearchParams();
|
|
26395
|
-
if (params.srcToken) searchParams.set("srcToken", params.srcToken);
|
|
26396
|
-
if (params.srcChain) searchParams.set("srcChain", params.srcChain);
|
|
26397
|
-
if (params.dstChain) searchParams.set("dstChain", params.dstChain);
|
|
26398
|
-
if (params.amount) searchParams.set("amount", params.amount);
|
|
26399
|
-
const queryString = searchParams.toString();
|
|
26400
|
-
return queryString ? `?${queryString}` : "";
|
|
26401
|
-
}
|
|
26402
|
-
function updateBridgeUrlNative(params) {
|
|
26403
|
-
if (typeof window === "undefined" || !window.history) return;
|
|
26404
|
-
const queryString = buildQueryString(params);
|
|
26405
|
-
const newUrl = `${window.location.pathname}${queryString}${window.location.hash}`;
|
|
26406
|
-
window.history.replaceState(null, "", newUrl);
|
|
26407
|
-
}
|
|
26408
26066
|
function useUrlSync(options) {
|
|
26409
26067
|
const {
|
|
26410
26068
|
enabled = true,
|
|
@@ -26904,4 +26562,4 @@ exports.useSettingsStore = useSettingsStore;
|
|
|
26904
26562
|
exports.useSwapModel = useSwapModel;
|
|
26905
26563
|
exports.useTokensStore = useTokensStore;
|
|
26906
26564
|
exports.useTransactionStore = useTransactionStore;
|
|
26907
|
-
//# sourceMappingURL=index-
|
|
26565
|
+
//# sourceMappingURL=index-DvjGvKnp.cjs.map
|