@rash2x/bridge-widget 0.6.31 → 0.6.33
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-ojFP6uCK.cjs → index-BpblK2_8.cjs} +927 -1197
- package/dist/index-BpblK2_8.cjs.map +1 -0
- package/dist/{index-DvX1RsdJ.cjs → index-CsqeJOar.cjs} +866 -646
- package/dist/index-CsqeJOar.cjs.map +1 -0
- package/dist/{index-CWy9GAOY.js → index-DOTV9TrI.js} +866 -646
- package/dist/index-DOTV9TrI.js.map +1 -0
- package/dist/{index-LQOauLrq.js → index-Dmn03M61.js} +928 -1198
- package/dist/index-Dmn03M61.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.html +89 -0
- package/dist/styles.css +1 -1
- package/package.json +13 -11
- package/dist/index-CWy9GAOY.js.map +0 -1
- package/dist/index-DvX1RsdJ.cjs.map +0 -1
- package/dist/index-LQOauLrq.js.map +0 -1
- package/dist/index-ojFP6uCK.cjs.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;
|
|
@@ -2489,7 +2522,7 @@ function useModal(initial = false) {
|
|
|
2489
2522
|
const [isOpen, setOpen] = react.useState(initial);
|
|
2490
2523
|
const onOpen = react.useCallback(() => setOpen(true), []);
|
|
2491
2524
|
const onClose = react.useCallback(() => setOpen(false), []);
|
|
2492
|
-
const toggle = react.useCallback(() => setOpen((
|
|
2525
|
+
const toggle = react.useCallback(() => setOpen((v2) => !v2), []);
|
|
2493
2526
|
return { isOpen, onOpen, onClose, toggle };
|
|
2494
2527
|
}
|
|
2495
2528
|
const SearchInput = ({
|
|
@@ -2585,9 +2618,9 @@ const ChainSelectModal = ({
|
|
|
2585
2618
|
[chains, assetMatrix]
|
|
2586
2619
|
);
|
|
2587
2620
|
const groupedChains = react.useMemo(() => {
|
|
2588
|
-
const
|
|
2589
|
-
const filtered =
|
|
2590
|
-
(c2) => c2.name.toLowerCase().includes(
|
|
2621
|
+
const q3 = query.trim().toLowerCase();
|
|
2622
|
+
const filtered = q3 ? (items ?? []).filter(
|
|
2623
|
+
(c2) => c2.name.toLowerCase().includes(q3) || c2.chainKey.toLowerCase().includes(q3)
|
|
2591
2624
|
) : items ?? [];
|
|
2592
2625
|
const groups = {
|
|
2593
2626
|
available: [],
|
|
@@ -2963,7 +2996,7 @@ const SwapSection = ({
|
|
|
2963
2996
|
{
|
|
2964
2997
|
value: amount,
|
|
2965
2998
|
onAmountChange: react.useCallback(
|
|
2966
|
-
(
|
|
2999
|
+
(v2) => onAmountChange?.(v2),
|
|
2967
3000
|
[onAmountChange]
|
|
2968
3001
|
),
|
|
2969
3002
|
onAmountBlur,
|
|
@@ -4135,8 +4168,8 @@ const WalletModalButton = (props) => {
|
|
|
4135
4168
|
"div",
|
|
4136
4169
|
{
|
|
4137
4170
|
className: utils$1.cn(
|
|
4138
|
-
|
|
4139
|
-
"
|
|
4171
|
+
"whitespace-nowrap text-sm font-medium transition-all h-13 rounded-xs w-full px-3 gap-3 flex items-center justify-start hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 cursor-default",
|
|
4172
|
+
""
|
|
4140
4173
|
),
|
|
4141
4174
|
children: [
|
|
4142
4175
|
/* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className: "min-w-8 min-h-8" }),
|
|
@@ -4145,7 +4178,14 @@ const WalletModalButton = (props) => {
|
|
|
4145
4178
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs leading-3 font-medium text-muted-foreground", children: name })
|
|
4146
4179
|
] }),
|
|
4147
4180
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4 ml-auto", children: [
|
|
4148
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4181
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4182
|
+
badge.Badge,
|
|
4183
|
+
{
|
|
4184
|
+
variant: "default",
|
|
4185
|
+
className: "bg-success/10 text-success h-7 px-2",
|
|
4186
|
+
children: t2("wallets.connectedStatus")
|
|
4187
|
+
}
|
|
4188
|
+
),
|
|
4149
4189
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4150
4190
|
"button",
|
|
4151
4191
|
{
|
|
@@ -6246,8 +6286,8 @@ class TronChainStrategy {
|
|
|
6246
6286
|
);
|
|
6247
6287
|
}
|
|
6248
6288
|
if (tx?.to && tx?.value && !tx?.data) {
|
|
6249
|
-
const
|
|
6250
|
-
const amountSun = Number(
|
|
6289
|
+
const v2 = BigInt(tx.value.toString());
|
|
6290
|
+
const amountSun = Number(v2);
|
|
6251
6291
|
if (!Number.isFinite(amountSun)) {
|
|
6252
6292
|
throw new InvalidTransactionDataError("tron", "Invalid TRX value");
|
|
6253
6293
|
}
|
|
@@ -6574,6 +6614,18 @@ const useConnectedWalletsStore = zustand.create((set2, get2) => ({
|
|
|
6574
6614
|
hasAnyWallet: () => {
|
|
6575
6615
|
const state2 = get2();
|
|
6576
6616
|
return state2.tonConnected || state2.metaMaskConnected || state2.tronConnected;
|
|
6617
|
+
},
|
|
6618
|
+
hasWalletForChain: (chainKey) => {
|
|
6619
|
+
if (!chainKey) return false;
|
|
6620
|
+
const state2 = get2();
|
|
6621
|
+
const key = chainKey.toLowerCase();
|
|
6622
|
+
if (key === "ton") {
|
|
6623
|
+
return state2.tonConnected;
|
|
6624
|
+
}
|
|
6625
|
+
if (key === "tron") {
|
|
6626
|
+
return state2.tronConnected;
|
|
6627
|
+
}
|
|
6628
|
+
return state2.metaMaskConnected;
|
|
6577
6629
|
}
|
|
6578
6630
|
}));
|
|
6579
6631
|
const gasPresets = ["auto", "none", "medium", "max"];
|
|
@@ -6778,7 +6830,6 @@ const TokenSelectModal = ({
|
|
|
6778
6830
|
fromChain?.chainKey,
|
|
6779
6831
|
srcAddress
|
|
6780
6832
|
);
|
|
6781
|
-
const effectiveTab = hasAnyWallet() ? tab : "all";
|
|
6782
6833
|
react.useEffect(() => {
|
|
6783
6834
|
if (!hasAnyWallet()) setTab("all");
|
|
6784
6835
|
}, [hasAnyWallet]);
|
|
@@ -6811,9 +6862,9 @@ const TokenSelectModal = ({
|
|
|
6811
6862
|
[assetMatrix, chains]
|
|
6812
6863
|
);
|
|
6813
6864
|
const groupedTokens = react.useMemo(() => {
|
|
6814
|
-
const
|
|
6815
|
-
const filtered =
|
|
6816
|
-
(a2) => a2.name.toLowerCase().includes(
|
|
6865
|
+
const q3 = query.trim().toLowerCase();
|
|
6866
|
+
const filtered = q3 ? items.filter(
|
|
6867
|
+
(a2) => a2.name.toLowerCase().includes(q3) || a2.symbol.toLowerCase().includes(q3)
|
|
6817
6868
|
) : items;
|
|
6818
6869
|
const groups = {
|
|
6819
6870
|
withBalance: [],
|
|
@@ -6847,10 +6898,8 @@ const TokenSelectModal = ({
|
|
|
6847
6898
|
findFirstAvailableChain,
|
|
6848
6899
|
getTokenUsdValue
|
|
6849
6900
|
]);
|
|
6850
|
-
const myTokens =
|
|
6851
|
-
|
|
6852
|
-
[groupedTokens.withBalance]
|
|
6853
|
-
);
|
|
6901
|
+
const myTokens = groupedTokens.withBalance;
|
|
6902
|
+
const effectiveTab = hasAnyWallet() ? tab : "all";
|
|
6854
6903
|
react.useEffect(() => {
|
|
6855
6904
|
if (query.trim() !== "" && tab === "my" && myTokens.length === 0 && !manualTabSwitch) {
|
|
6856
6905
|
setTab("all");
|
|
@@ -6923,7 +6972,7 @@ const TokenSelectModal = ({
|
|
|
6923
6972
|
}
|
|
6924
6973
|
),
|
|
6925
6974
|
hasAnyWallet() && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
6926
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6975
|
+
myTokens.length !== 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6927
6976
|
button.Button,
|
|
6928
6977
|
{
|
|
6929
6978
|
variant: tab === "my" ? "default" : "ghost",
|
|
@@ -7614,7 +7663,7 @@ function requireEvents() {
|
|
|
7614
7663
|
return events.exports;
|
|
7615
7664
|
}
|
|
7616
7665
|
var eventsExports = requireEvents();
|
|
7617
|
-
const xe$
|
|
7666
|
+
const xe$3 = /* @__PURE__ */ getDefaultExportFromCjs(eventsExports);
|
|
7618
7667
|
var cjs$3 = {};
|
|
7619
7668
|
/*! *****************************************************************************
|
|
7620
7669
|
Copyright (c) Microsoft Corporation.
|
|
@@ -7716,8 +7765,8 @@ function __generator(thisArg, body) {
|
|
|
7716
7765
|
return this;
|
|
7717
7766
|
}), g2;
|
|
7718
7767
|
function verb(n3) {
|
|
7719
|
-
return function(
|
|
7720
|
-
return step([n3,
|
|
7768
|
+
return function(v2) {
|
|
7769
|
+
return step([n3, v2]);
|
|
7721
7770
|
};
|
|
7722
7771
|
}
|
|
7723
7772
|
function step(op) {
|
|
@@ -7819,35 +7868,35 @@ function __spread() {
|
|
|
7819
7868
|
function __spreadArrays() {
|
|
7820
7869
|
for (var s2 = 0, i3 = 0, il = arguments.length; i3 < il; i3++) s2 += arguments[i3].length;
|
|
7821
7870
|
for (var r2 = Array(s2), k2 = 0, i3 = 0; i3 < il; i3++)
|
|
7822
|
-
for (var a2 = arguments[i3],
|
|
7823
|
-
r2[k2] = a2[
|
|
7871
|
+
for (var a2 = arguments[i3], j2 = 0, jl = a2.length; j2 < jl; j2++, k2++)
|
|
7872
|
+
r2[k2] = a2[j2];
|
|
7824
7873
|
return r2;
|
|
7825
7874
|
}
|
|
7826
|
-
function __await(
|
|
7827
|
-
return this instanceof __await ? (this.v =
|
|
7875
|
+
function __await(v2) {
|
|
7876
|
+
return this instanceof __await ? (this.v = v2, this) : new __await(v2);
|
|
7828
7877
|
}
|
|
7829
7878
|
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
7830
7879
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
7831
|
-
var g2 = generator.apply(thisArg, _arguments || []), i3,
|
|
7880
|
+
var g2 = generator.apply(thisArg, _arguments || []), i3, q3 = [];
|
|
7832
7881
|
return i3 = {}, verb("next"), verb("throw"), verb("return"), i3[Symbol.asyncIterator] = function() {
|
|
7833
7882
|
return this;
|
|
7834
7883
|
}, i3;
|
|
7835
7884
|
function verb(n3) {
|
|
7836
|
-
if (g2[n3]) i3[n3] = function(
|
|
7885
|
+
if (g2[n3]) i3[n3] = function(v2) {
|
|
7837
7886
|
return new Promise(function(a2, b2) {
|
|
7838
|
-
|
|
7887
|
+
q3.push([n3, v2, a2, b2]) > 1 || resume(n3, v2);
|
|
7839
7888
|
});
|
|
7840
7889
|
};
|
|
7841
7890
|
}
|
|
7842
|
-
function resume(n3,
|
|
7891
|
+
function resume(n3, v2) {
|
|
7843
7892
|
try {
|
|
7844
|
-
step(g2[n3](
|
|
7893
|
+
step(g2[n3](v2));
|
|
7845
7894
|
} catch (e2) {
|
|
7846
|
-
settle(
|
|
7895
|
+
settle(q3[0][3], e2);
|
|
7847
7896
|
}
|
|
7848
7897
|
}
|
|
7849
7898
|
function step(r2) {
|
|
7850
|
-
r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(
|
|
7899
|
+
r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q3[0][2], r2);
|
|
7851
7900
|
}
|
|
7852
7901
|
function fulfill(value) {
|
|
7853
7902
|
resume("next", value);
|
|
@@ -7855,8 +7904,8 @@ function __asyncGenerator(thisArg, _arguments, generator) {
|
|
|
7855
7904
|
function reject(value) {
|
|
7856
7905
|
resume("throw", value);
|
|
7857
7906
|
}
|
|
7858
|
-
function settle(f4,
|
|
7859
|
-
if (f4(
|
|
7907
|
+
function settle(f4, v2) {
|
|
7908
|
+
if (f4(v2), q3.shift(), q3.length) resume(q3[0][0], q3[0][1]);
|
|
7860
7909
|
}
|
|
7861
7910
|
}
|
|
7862
7911
|
function __asyncDelegator(o3) {
|
|
@@ -7867,8 +7916,8 @@ function __asyncDelegator(o3) {
|
|
|
7867
7916
|
return this;
|
|
7868
7917
|
}, i3;
|
|
7869
7918
|
function verb(n3, f4) {
|
|
7870
|
-
i3[n3] = o3[n3] ? function(
|
|
7871
|
-
return (p2 = !p2) ? { value: __await(o3[n3](
|
|
7919
|
+
i3[n3] = o3[n3] ? function(v2) {
|
|
7920
|
+
return (p2 = !p2) ? { value: __await(o3[n3](v2)), done: n3 === "return" } : f4 ? f4(v2) : v2;
|
|
7872
7921
|
} : f4;
|
|
7873
7922
|
}
|
|
7874
7923
|
}
|
|
@@ -7879,15 +7928,15 @@ function __asyncValues(o3) {
|
|
|
7879
7928
|
return this;
|
|
7880
7929
|
}, i3);
|
|
7881
7930
|
function verb(n3) {
|
|
7882
|
-
i3[n3] = o3[n3] && function(
|
|
7931
|
+
i3[n3] = o3[n3] && function(v2) {
|
|
7883
7932
|
return new Promise(function(resolve, reject) {
|
|
7884
|
-
|
|
7933
|
+
v2 = o3[n3](v2), settle(resolve, reject, v2.done, v2.value);
|
|
7885
7934
|
});
|
|
7886
7935
|
};
|
|
7887
7936
|
}
|
|
7888
|
-
function settle(resolve, reject, d3,
|
|
7889
|
-
Promise.resolve(
|
|
7890
|
-
resolve({ value:
|
|
7937
|
+
function settle(resolve, reject, d3, v2) {
|
|
7938
|
+
Promise.resolve(v2).then(function(v3) {
|
|
7939
|
+
resolve({ value: v3, done: d3 });
|
|
7891
7940
|
}, reject);
|
|
7892
7941
|
}
|
|
7893
7942
|
}
|
|
@@ -8149,10 +8198,10 @@ let n$1 = class n extends IEvents {
|
|
|
8149
8198
|
super();
|
|
8150
8199
|
}
|
|
8151
8200
|
};
|
|
8152
|
-
const s$
|
|
8153
|
-
let i$
|
|
8201
|
+
const s$1 = cjsExports$3.FIVE_SECONDS, r$1 = { pulse: "heartbeat_pulse" };
|
|
8202
|
+
let i$1 = class i extends n$1 {
|
|
8154
8203
|
constructor(e2) {
|
|
8155
|
-
super(e2), this.events = new eventsExports.EventEmitter(), this.interval = s$
|
|
8204
|
+
super(e2), this.events = new eventsExports.EventEmitter(), this.interval = s$1, this.interval = e2?.interval || s$1;
|
|
8156
8205
|
}
|
|
8157
8206
|
static async init(e2) {
|
|
8158
8207
|
const t2 = new i(e2);
|
|
@@ -8876,7 +8925,7 @@ function safeJsonStringify(value) {
|
|
|
8876
8925
|
return typeof value === "string" ? value : JSONStringify(value) || "";
|
|
8877
8926
|
}
|
|
8878
8927
|
const x$4 = "idb-keyval";
|
|
8879
|
-
var z$
|
|
8928
|
+
var z$3 = (i3 = {}) => {
|
|
8880
8929
|
const t2 = i3.base && i3.base.length > 0 ? `${i3.base}:` : "", e2 = (s2) => t2 + s2;
|
|
8881
8930
|
let n3;
|
|
8882
8931
|
return i3.dbName && i3.storeName && (n3 = createStore(i3.dbName, i3.storeName)), { name: x$4, options: i3, async hasItem(s2) {
|
|
@@ -8893,10 +8942,10 @@ var z$4 = (i3 = {}) => {
|
|
|
8893
8942
|
return clear(n3);
|
|
8894
8943
|
} };
|
|
8895
8944
|
};
|
|
8896
|
-
const D
|
|
8897
|
-
let _$
|
|
8945
|
+
const D = "WALLET_CONNECT_V2_INDEXED_DB", E$3 = "keyvaluestorage";
|
|
8946
|
+
let _$2 = class _ {
|
|
8898
8947
|
constructor() {
|
|
8899
|
-
this.indexedDb = createStorage({ driver: z$
|
|
8948
|
+
this.indexedDb = createStorage({ driver: z$3({ dbName: D, storeName: E$3 }) });
|
|
8900
8949
|
}
|
|
8901
8950
|
async getKeys() {
|
|
8902
8951
|
return this.indexedDb.getKeys();
|
|
@@ -8915,7 +8964,7 @@ let _$3 = class _ {
|
|
|
8915
8964
|
await this.indexedDb.removeItem(t2);
|
|
8916
8965
|
}
|
|
8917
8966
|
};
|
|
8918
|
-
var l$
|
|
8967
|
+
var l$2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, c$4 = { exports: {} };
|
|
8919
8968
|
(function() {
|
|
8920
8969
|
let i3;
|
|
8921
8970
|
function t2() {
|
|
@@ -8935,21 +8984,21 @@ var l$3 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window :
|
|
|
8935
8984
|
return e2 = e2 || 0, Object.keys(this)[e2];
|
|
8936
8985
|
}, i3.prototype.__defineGetter__("length", function() {
|
|
8937
8986
|
return Object.keys(this).length;
|
|
8938
|
-
}), typeof l$
|
|
8987
|
+
}), 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();
|
|
8939
8988
|
})();
|
|
8940
|
-
function k$
|
|
8989
|
+
function k$2(i3) {
|
|
8941
8990
|
var t2;
|
|
8942
8991
|
return [i3[0], safeJsonParse((t2 = i3[1]) != null ? t2 : "")];
|
|
8943
8992
|
}
|
|
8944
|
-
let K$
|
|
8993
|
+
let K$5 = class K {
|
|
8945
8994
|
constructor() {
|
|
8946
|
-
this.localStorage = c$
|
|
8995
|
+
this.localStorage = c$4.exports;
|
|
8947
8996
|
}
|
|
8948
8997
|
async getKeys() {
|
|
8949
8998
|
return Object.keys(this.localStorage);
|
|
8950
8999
|
}
|
|
8951
9000
|
async getEntries() {
|
|
8952
|
-
return Object.entries(this.localStorage).map(k$
|
|
9001
|
+
return Object.entries(this.localStorage).map(k$2);
|
|
8953
9002
|
}
|
|
8954
9003
|
async getItem(t2) {
|
|
8955
9004
|
const e2 = this.localStorage.getItem(t2);
|
|
@@ -8962,7 +9011,7 @@ let K$4 = class K {
|
|
|
8962
9011
|
this.localStorage.removeItem(t2);
|
|
8963
9012
|
}
|
|
8964
9013
|
};
|
|
8965
|
-
const N$5 = "wc_storage_version", y$4 = 1, O$
|
|
9014
|
+
const N$5 = "wc_storage_version", y$4 = 1, O$2 = async (i3, t2, e2) => {
|
|
8966
9015
|
const n3 = N$5, s2 = await t2.getItem(n3);
|
|
8967
9016
|
if (s2 && s2 >= y$4) {
|
|
8968
9017
|
e2(t2);
|
|
@@ -8989,16 +9038,16 @@ const N$5 = "wc_storage_version", y$4 = 1, O$3 = async (i3, t2, e2) => {
|
|
|
8989
9038
|
await i3.removeItem(e2);
|
|
8990
9039
|
});
|
|
8991
9040
|
};
|
|
8992
|
-
let h$
|
|
9041
|
+
let h$3 = class h {
|
|
8993
9042
|
constructor() {
|
|
8994
9043
|
this.initialized = false, this.setInitialized = (e2) => {
|
|
8995
9044
|
this.storage = e2, this.initialized = true;
|
|
8996
9045
|
};
|
|
8997
|
-
const t2 = new K$
|
|
9046
|
+
const t2 = new K$5();
|
|
8998
9047
|
this.storage = t2;
|
|
8999
9048
|
try {
|
|
9000
|
-
const e2 = new _$
|
|
9001
|
-
O$
|
|
9049
|
+
const e2 = new _$2();
|
|
9050
|
+
O$2(t2, e2, this.setInitialized);
|
|
9002
9051
|
} catch {
|
|
9003
9052
|
this.initialized = true;
|
|
9004
9053
|
}
|
|
@@ -9026,566 +9075,271 @@ let h$4 = class h {
|
|
|
9026
9075
|
});
|
|
9027
9076
|
}
|
|
9028
9077
|
};
|
|
9029
|
-
var
|
|
9030
|
-
|
|
9031
|
-
|
|
9032
|
-
|
|
9033
|
-
|
|
9034
|
-
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
var
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
case 102:
|
|
9072
|
-
if (a2 >= argLen)
|
|
9073
|
-
break;
|
|
9074
|
-
if (args[a2] == null) break;
|
|
9075
|
-
if (lastPos < i3)
|
|
9076
|
-
str += f4.slice(lastPos, i3);
|
|
9077
|
-
str += Number(args[a2]);
|
|
9078
|
-
lastPos = i3 + 2;
|
|
9079
|
-
i3++;
|
|
9080
|
-
break;
|
|
9081
|
-
case 105:
|
|
9082
|
-
if (a2 >= argLen)
|
|
9083
|
-
break;
|
|
9084
|
-
if (args[a2] == null) break;
|
|
9085
|
-
if (lastPos < i3)
|
|
9086
|
-
str += f4.slice(lastPos, i3);
|
|
9087
|
-
str += Math.floor(Number(args[a2]));
|
|
9088
|
-
lastPos = i3 + 2;
|
|
9089
|
-
i3++;
|
|
9090
|
-
break;
|
|
9091
|
-
case 79:
|
|
9092
|
-
// 'O'
|
|
9093
|
-
case 111:
|
|
9094
|
-
// 'o'
|
|
9095
|
-
case 106:
|
|
9096
|
-
if (a2 >= argLen)
|
|
9097
|
-
break;
|
|
9098
|
-
if (args[a2] === void 0) break;
|
|
9099
|
-
if (lastPos < i3)
|
|
9100
|
-
str += f4.slice(lastPos, i3);
|
|
9101
|
-
var type = typeof args[a2];
|
|
9102
|
-
if (type === "string") {
|
|
9103
|
-
str += "'" + args[a2] + "'";
|
|
9104
|
-
lastPos = i3 + 2;
|
|
9105
|
-
i3++;
|
|
9106
|
-
break;
|
|
9107
|
-
}
|
|
9108
|
-
if (type === "function") {
|
|
9109
|
-
str += args[a2].name || "<anonymous>";
|
|
9110
|
-
lastPos = i3 + 2;
|
|
9111
|
-
i3++;
|
|
9112
|
-
break;
|
|
9113
|
-
}
|
|
9114
|
-
str += ss2(args[a2]);
|
|
9115
|
-
lastPos = i3 + 2;
|
|
9116
|
-
i3++;
|
|
9117
|
-
break;
|
|
9118
|
-
case 115:
|
|
9119
|
-
if (a2 >= argLen)
|
|
9120
|
-
break;
|
|
9121
|
-
if (lastPos < i3)
|
|
9122
|
-
str += f4.slice(lastPos, i3);
|
|
9123
|
-
str += String(args[a2]);
|
|
9124
|
-
lastPos = i3 + 2;
|
|
9125
|
-
i3++;
|
|
9078
|
+
var b$4 = { exports: {} };
|
|
9079
|
+
function se$3(e2) {
|
|
9080
|
+
try {
|
|
9081
|
+
return JSON.stringify(e2);
|
|
9082
|
+
} catch {
|
|
9083
|
+
return '"[Circular]"';
|
|
9084
|
+
}
|
|
9085
|
+
}
|
|
9086
|
+
var ie$2 = oe$3;
|
|
9087
|
+
function oe$3(e2, t2, r2) {
|
|
9088
|
+
var s2 = r2 && r2.stringify || se$3, i3 = 1;
|
|
9089
|
+
if (typeof e2 == "object" && e2 !== null) {
|
|
9090
|
+
var h4 = t2.length + i3;
|
|
9091
|
+
if (h4 === 1) return e2;
|
|
9092
|
+
var f4 = new Array(h4);
|
|
9093
|
+
f4[0] = s2(e2);
|
|
9094
|
+
for (var u2 = 1; u2 < h4; u2++) f4[u2] = s2(t2[u2]);
|
|
9095
|
+
return f4.join(" ");
|
|
9096
|
+
}
|
|
9097
|
+
if (typeof e2 != "string") return e2;
|
|
9098
|
+
var c2 = t2.length;
|
|
9099
|
+
if (c2 === 0) return e2;
|
|
9100
|
+
for (var n3 = "", o3 = 1 - i3, l2 = -1, p2 = e2 && e2.length || 0, a2 = 0; a2 < p2; ) {
|
|
9101
|
+
if (e2.charCodeAt(a2) === 37 && a2 + 1 < p2) {
|
|
9102
|
+
switch (l2 = l2 > -1 ? l2 : 0, e2.charCodeAt(a2 + 1)) {
|
|
9103
|
+
case 100:
|
|
9104
|
+
case 102:
|
|
9105
|
+
if (o3 >= c2 || t2[o3] == null) break;
|
|
9106
|
+
l2 < a2 && (n3 += e2.slice(l2, a2)), n3 += Number(t2[o3]), l2 = a2 + 2, a2++;
|
|
9107
|
+
break;
|
|
9108
|
+
case 105:
|
|
9109
|
+
if (o3 >= c2 || t2[o3] == null) break;
|
|
9110
|
+
l2 < a2 && (n3 += e2.slice(l2, a2)), n3 += Math.floor(Number(t2[o3])), l2 = a2 + 2, a2++;
|
|
9111
|
+
break;
|
|
9112
|
+
case 79:
|
|
9113
|
+
case 111:
|
|
9114
|
+
case 106:
|
|
9115
|
+
if (o3 >= c2 || t2[o3] === void 0) break;
|
|
9116
|
+
l2 < a2 && (n3 += e2.slice(l2, a2));
|
|
9117
|
+
var O3 = typeof t2[o3];
|
|
9118
|
+
if (O3 === "string") {
|
|
9119
|
+
n3 += "'" + t2[o3] + "'", l2 = a2 + 2, a2++;
|
|
9126
9120
|
break;
|
|
9127
|
-
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
str += "%";
|
|
9131
|
-
lastPos = i3 + 2;
|
|
9132
|
-
i3++;
|
|
9133
|
-
a2--;
|
|
9121
|
+
}
|
|
9122
|
+
if (O3 === "function") {
|
|
9123
|
+
n3 += t2[o3].name || "<anonymous>", l2 = a2 + 2, a2++;
|
|
9134
9124
|
break;
|
|
9135
|
-
|
|
9136
|
-
|
|
9125
|
+
}
|
|
9126
|
+
n3 += s2(t2[o3]), l2 = a2 + 2, a2++;
|
|
9127
|
+
break;
|
|
9128
|
+
case 115:
|
|
9129
|
+
if (o3 >= c2) break;
|
|
9130
|
+
l2 < a2 && (n3 += e2.slice(l2, a2)), n3 += String(t2[o3]), l2 = a2 + 2, a2++;
|
|
9131
|
+
break;
|
|
9132
|
+
case 37:
|
|
9133
|
+
l2 < a2 && (n3 += e2.slice(l2, a2)), n3 += "%", l2 = a2 + 2, a2++, o3--;
|
|
9134
|
+
break;
|
|
9137
9135
|
}
|
|
9138
|
-
++
|
|
9139
|
-
}
|
|
9140
|
-
if (lastPos === -1)
|
|
9141
|
-
return f4;
|
|
9142
|
-
else if (lastPos < flen) {
|
|
9143
|
-
str += f4.slice(lastPos);
|
|
9136
|
+
++o3;
|
|
9144
9137
|
}
|
|
9145
|
-
|
|
9138
|
+
++a2;
|
|
9146
9139
|
}
|
|
9147
|
-
return
|
|
9148
|
-
}
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
|
|
9161
|
-
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
|
|
9168
|
-
return
|
|
9169
|
-
}
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
|
|
9175
|
-
|
|
9176
|
-
|
|
9177
|
-
|
|
9178
|
-
|
|
9179
|
-
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
}
|
|
9187
|
-
|
|
9188
|
-
|
|
9189
|
-
|
|
9190
|
-
|
|
9140
|
+
return l2 === -1 ? e2 : (l2 < p2 && (n3 += e2.slice(l2)), n3);
|
|
9141
|
+
}
|
|
9142
|
+
const G$3 = ie$2;
|
|
9143
|
+
b$4.exports = v$5;
|
|
9144
|
+
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 };
|
|
9145
|
+
function m$2(e2, t2) {
|
|
9146
|
+
return e2 === "silent" ? 1 / 0 : t2.levels.values[e2];
|
|
9147
|
+
}
|
|
9148
|
+
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" };
|
|
9149
|
+
function R$2(e2, t2) {
|
|
9150
|
+
const r2 = { logger: t2, parent: e2[P$4] };
|
|
9151
|
+
t2[P$4] = r2;
|
|
9152
|
+
}
|
|
9153
|
+
function ue$2(e2, t2, r2) {
|
|
9154
|
+
const s2 = {};
|
|
9155
|
+
t2.forEach((i3) => {
|
|
9156
|
+
s2[i3] = r2[i3] ? r2[i3] : j$4[i3] || j$4[ae$2[i3] || "log"] || w$3;
|
|
9157
|
+
}), e2[A$2] = s2;
|
|
9158
|
+
}
|
|
9159
|
+
function ce$2(e2, t2) {
|
|
9160
|
+
return Array.isArray(e2) ? e2.filter(function(s2) {
|
|
9161
|
+
return s2 !== "!stdSerializers.err";
|
|
9162
|
+
}) : e2 === true ? Object.keys(t2) : false;
|
|
9163
|
+
}
|
|
9164
|
+
function v$5(e2) {
|
|
9165
|
+
e2 = e2 || {}, e2.browser = e2.browser || {};
|
|
9166
|
+
const t2 = e2.browser.transmit;
|
|
9167
|
+
if (t2 && typeof t2.send != "function") throw Error("pino: transmit option must have a send function");
|
|
9168
|
+
const r2 = e2.browser.write || j$4;
|
|
9169
|
+
e2.browser.write && (e2.browser.asObject = true);
|
|
9170
|
+
const s2 = e2.serializers || {}, i3 = ce$2(e2.browser.serialize, s2);
|
|
9171
|
+
let h4 = e2.browser.serialize;
|
|
9172
|
+
Array.isArray(e2.browser.serialize) && e2.browser.serialize.indexOf("!stdSerializers.err") > -1 && (h4 = false);
|
|
9173
|
+
const f4 = Object.keys(e2.customLevels || {}), u2 = ["error", "fatal", "warn", "info", "debug", "trace"].concat(f4);
|
|
9174
|
+
typeof r2 == "function" && u2.forEach(function(g2) {
|
|
9175
|
+
r2[g2] = r2;
|
|
9176
|
+
}), (e2.enabled === false || e2.browser.disabled) && (e2.level = "silent");
|
|
9177
|
+
const c2 = e2.level || "info", n3 = Object.create(r2);
|
|
9178
|
+
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 });
|
|
9179
|
+
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 };
|
|
9180
|
+
n3.levels = he$4(e2), n3.level = c2, n3.isLevelEnabled = function(g2) {
|
|
9181
|
+
return this.levels.values[g2] ? this.levels.values[g2] >= this.levels.values[this.level] : false;
|
|
9182
|
+
}, 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) {
|
|
9183
|
+
return O3.call(this, o3, ...g2);
|
|
9184
|
+
}, t2 && (n3._logEvent = N$4());
|
|
9185
|
+
function l2() {
|
|
9186
|
+
return m$2(this.level, this);
|
|
9187
|
+
}
|
|
9188
|
+
function p2() {
|
|
9189
|
+
return this._level;
|
|
9190
|
+
}
|
|
9191
|
+
function a2(g2) {
|
|
9192
|
+
if (g2 !== "silent" && !this.levels.values[g2]) throw Error("unknown level " + g2);
|
|
9193
|
+
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) => {
|
|
9194
|
+
L$2(this, o3, n3, d3);
|
|
9191
9195
|
});
|
|
9192
|
-
logger[baseLogFunctionSymbol] = logFunctions;
|
|
9193
9196
|
}
|
|
9194
|
-
function
|
|
9195
|
-
if (
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
return Object.keys(serializers);
|
|
9202
|
-
}
|
|
9203
|
-
return false;
|
|
9204
|
-
}
|
|
9205
|
-
function pino(opts) {
|
|
9206
|
-
opts = opts || {};
|
|
9207
|
-
opts.browser = opts.browser || {};
|
|
9208
|
-
const transmit2 = opts.browser.transmit;
|
|
9209
|
-
if (transmit2 && typeof transmit2.send !== "function") {
|
|
9210
|
-
throw Error("pino: transmit option must have a send function");
|
|
9211
|
-
}
|
|
9212
|
-
const proto = opts.browser.write || _console;
|
|
9213
|
-
if (opts.browser.write) opts.browser.asObject = true;
|
|
9214
|
-
const serializers = opts.serializers || {};
|
|
9215
|
-
const serialize = shouldSerialize(opts.browser.serialize, serializers);
|
|
9216
|
-
let stdErrSerialize = opts.browser.serialize;
|
|
9217
|
-
if (Array.isArray(opts.browser.serialize) && opts.browser.serialize.indexOf("!stdSerializers.err") > -1) stdErrSerialize = false;
|
|
9218
|
-
const customLevels = Object.keys(opts.customLevels || {});
|
|
9219
|
-
const levels = ["error", "fatal", "warn", "info", "debug", "trace"].concat(customLevels);
|
|
9220
|
-
if (typeof proto === "function") {
|
|
9221
|
-
levels.forEach(function(level2) {
|
|
9222
|
-
proto[level2] = proto;
|
|
9223
|
-
});
|
|
9224
|
-
}
|
|
9225
|
-
if (opts.enabled === false || opts.browser.disabled) opts.level = "silent";
|
|
9226
|
-
const level = opts.level || "info";
|
|
9227
|
-
const logger = Object.create(proto);
|
|
9228
|
-
if (!logger.log) logger.log = noop;
|
|
9229
|
-
setupBaseLogFunctions(logger, levels, proto);
|
|
9230
|
-
appendChildLogger({}, logger);
|
|
9231
|
-
Object.defineProperty(logger, "levelVal", {
|
|
9232
|
-
get: getLevelVal
|
|
9233
|
-
});
|
|
9234
|
-
Object.defineProperty(logger, "level", {
|
|
9235
|
-
get: getLevel,
|
|
9236
|
-
set: setLevel
|
|
9237
|
-
});
|
|
9238
|
-
const setOpts = {
|
|
9239
|
-
transmit: transmit2,
|
|
9240
|
-
serialize,
|
|
9241
|
-
asObject: opts.browser.asObject,
|
|
9242
|
-
asObjectBindingsOnly: opts.browser.asObjectBindingsOnly,
|
|
9243
|
-
formatters: opts.browser.formatters,
|
|
9244
|
-
levels,
|
|
9245
|
-
timestamp: getTimeFunction(opts),
|
|
9246
|
-
messageKey: opts.messageKey || "msg",
|
|
9247
|
-
onChild: opts.onChild || noop
|
|
9248
|
-
};
|
|
9249
|
-
logger.levels = getLevels(opts);
|
|
9250
|
-
logger.level = level;
|
|
9251
|
-
logger.isLevelEnabled = function(level2) {
|
|
9252
|
-
if (!this.levels.values[level2]) {
|
|
9253
|
-
return false;
|
|
9254
|
-
}
|
|
9255
|
-
return this.levels.values[level2] >= this.levels.values[this.level];
|
|
9256
|
-
};
|
|
9257
|
-
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;
|
|
9258
|
-
logger.serializers = serializers;
|
|
9259
|
-
logger._serialize = serialize;
|
|
9260
|
-
logger._stdErrSerialize = stdErrSerialize;
|
|
9261
|
-
logger.child = function(...args) {
|
|
9262
|
-
return child.call(this, setOpts, ...args);
|
|
9263
|
-
};
|
|
9264
|
-
if (transmit2) logger._logEvent = createLogEventShape();
|
|
9265
|
-
function getLevelVal() {
|
|
9266
|
-
return levelToValue(this.level, this);
|
|
9267
|
-
}
|
|
9268
|
-
function getLevel() {
|
|
9269
|
-
return this._level;
|
|
9270
|
-
}
|
|
9271
|
-
function setLevel(level2) {
|
|
9272
|
-
if (level2 !== "silent" && !this.levels.values[level2]) {
|
|
9273
|
-
throw Error("unknown level " + level2);
|
|
9274
|
-
}
|
|
9275
|
-
this._level = level2;
|
|
9276
|
-
set2(this, setOpts, logger, "error");
|
|
9277
|
-
set2(this, setOpts, logger, "fatal");
|
|
9278
|
-
set2(this, setOpts, logger, "warn");
|
|
9279
|
-
set2(this, setOpts, logger, "info");
|
|
9280
|
-
set2(this, setOpts, logger, "debug");
|
|
9281
|
-
set2(this, setOpts, logger, "trace");
|
|
9282
|
-
customLevels.forEach((level3) => {
|
|
9283
|
-
set2(this, setOpts, logger, level3);
|
|
9284
|
-
});
|
|
9197
|
+
function O3(g2, d3, z2) {
|
|
9198
|
+
if (!d3) throw new Error("missing bindings for child Pino");
|
|
9199
|
+
z2 = z2 || {}, i3 && d3.serializers && (z2.serializers = d3.serializers);
|
|
9200
|
+
const F2 = z2.serializers;
|
|
9201
|
+
if (i3 && F2) {
|
|
9202
|
+
var E2 = Object.assign({}, s2, F2), M3 = e2.browser.serialize === true ? Object.keys(E2) : i3;
|
|
9203
|
+
delete d3.serializers, V$2([d3], M3, E2, this._stdErrSerialize);
|
|
9285
9204
|
}
|
|
9286
|
-
function
|
|
9287
|
-
|
|
9288
|
-
throw new Error("missing bindings for child Pino");
|
|
9289
|
-
}
|
|
9290
|
-
childOptions = childOptions || {};
|
|
9291
|
-
if (serialize && bindings.serializers) {
|
|
9292
|
-
childOptions.serializers = bindings.serializers;
|
|
9293
|
-
}
|
|
9294
|
-
const childOptionsSerializers = childOptions.serializers;
|
|
9295
|
-
if (serialize && childOptionsSerializers) {
|
|
9296
|
-
var childSerializers = Object.assign({}, serializers, childOptionsSerializers);
|
|
9297
|
-
var childSerialize = opts.browser.serialize === true ? Object.keys(childSerializers) : serialize;
|
|
9298
|
-
delete bindings.serializers;
|
|
9299
|
-
applySerializers([bindings], childSerialize, childSerializers, this._stdErrSerialize);
|
|
9300
|
-
}
|
|
9301
|
-
function Child(parent) {
|
|
9302
|
-
this._childLevel = (parent._childLevel | 0) + 1;
|
|
9303
|
-
this.bindings = bindings;
|
|
9304
|
-
if (childSerializers) {
|
|
9305
|
-
this.serializers = childSerializers;
|
|
9306
|
-
this._serialize = childSerialize;
|
|
9307
|
-
}
|
|
9308
|
-
if (transmit2) {
|
|
9309
|
-
this._logEvent = createLogEventShape(
|
|
9310
|
-
[].concat(parent._logEvent.bindings, bindings)
|
|
9311
|
-
);
|
|
9312
|
-
}
|
|
9313
|
-
}
|
|
9314
|
-
Child.prototype = this;
|
|
9315
|
-
const newLogger = new Child(this);
|
|
9316
|
-
appendChildLogger(this, newLogger);
|
|
9317
|
-
newLogger.child = function(...args) {
|
|
9318
|
-
return child.call(this, setOpts2, ...args);
|
|
9319
|
-
};
|
|
9320
|
-
newLogger.level = childOptions.level || this.level;
|
|
9321
|
-
setOpts2.onChild(newLogger);
|
|
9322
|
-
return newLogger;
|
|
9205
|
+
function D2(k2) {
|
|
9206
|
+
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)));
|
|
9323
9207
|
}
|
|
9324
|
-
|
|
9325
|
-
|
|
9326
|
-
|
|
9327
|
-
|
|
9328
|
-
|
|
9329
|
-
const labels = Object.assign({}, pino.levels.labels, invertObject(customLevels));
|
|
9330
|
-
return {
|
|
9331
|
-
values,
|
|
9332
|
-
labels
|
|
9333
|
-
};
|
|
9208
|
+
D2.prototype = this;
|
|
9209
|
+
const _3 = new D2(this);
|
|
9210
|
+
return R$2(this, _3), _3.child = function(...k2) {
|
|
9211
|
+
return O3.call(this, g2, ...k2);
|
|
9212
|
+
}, _3.level = z2.level || this.level, g2.onChild(_3), _3;
|
|
9334
9213
|
}
|
|
9335
|
-
|
|
9336
|
-
|
|
9337
|
-
|
|
9338
|
-
|
|
9339
|
-
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
|
|
9351
|
-
|
|
9352
|
-
|
|
9353
|
-
|
|
9354
|
-
|
|
9355
|
-
|
|
9356
|
-
|
|
9357
|
-
|
|
9358
|
-
|
|
9214
|
+
return n3;
|
|
9215
|
+
}
|
|
9216
|
+
function he$4(e2) {
|
|
9217
|
+
const t2 = e2.customLevels || {}, r2 = Object.assign({}, v$5.levels.values, t2), s2 = Object.assign({}, v$5.levels.labels, fe$3(t2));
|
|
9218
|
+
return { values: r2, labels: s2 };
|
|
9219
|
+
}
|
|
9220
|
+
function fe$3(e2) {
|
|
9221
|
+
const t2 = {};
|
|
9222
|
+
return Object.keys(e2).forEach(function(r2) {
|
|
9223
|
+
t2[e2[r2]] = r2;
|
|
9224
|
+
}), t2;
|
|
9225
|
+
}
|
|
9226
|
+
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 });
|
|
9227
|
+
function ge$4(e2) {
|
|
9228
|
+
const t2 = [];
|
|
9229
|
+
e2.bindings && t2.push(e2.bindings);
|
|
9230
|
+
let r2 = e2[P$4];
|
|
9231
|
+
for (; r2.parent; ) r2 = r2.parent, r2.logger.bindings && t2.push(r2.logger.bindings);
|
|
9232
|
+
return t2.reverse();
|
|
9233
|
+
}
|
|
9234
|
+
function L$2(e2, t2, r2, s2) {
|
|
9235
|
+
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) {
|
|
9236
|
+
if (!t2.transmit) return;
|
|
9237
|
+
const h4 = t2.transmit.level || e2.level, f4 = m$2(h4, r2);
|
|
9238
|
+
if (m$2(s2, r2) < f4) return;
|
|
9239
|
+
}
|
|
9240
|
+
e2[s2] = de$3(e2, t2, r2, s2);
|
|
9241
|
+
const i3 = ge$4(e2);
|
|
9242
|
+
i3.length !== 0 && (e2[s2] = be$4(i3, e2[s2]));
|
|
9243
|
+
}
|
|
9244
|
+
function be$4(e2, t2) {
|
|
9245
|
+
return function() {
|
|
9246
|
+
return t2.apply(this, [...e2, ...arguments]);
|
|
9359
9247
|
};
|
|
9360
|
-
|
|
9361
|
-
|
|
9362
|
-
|
|
9363
|
-
const bindings = [];
|
|
9364
|
-
if (logger.bindings) {
|
|
9365
|
-
bindings.push(logger.bindings);
|
|
9366
|
-
}
|
|
9367
|
-
let hierarchy = logger[hierarchySymbol];
|
|
9368
|
-
while (hierarchy.parent) {
|
|
9369
|
-
hierarchy = hierarchy.parent;
|
|
9370
|
-
if (hierarchy.logger.bindings) {
|
|
9371
|
-
bindings.push(hierarchy.logger.bindings);
|
|
9372
|
-
}
|
|
9373
|
-
}
|
|
9374
|
-
return bindings.reverse();
|
|
9375
|
-
}
|
|
9376
|
-
function set2(self2, opts, rootLogger, level) {
|
|
9377
|
-
Object.defineProperty(self2, level, {
|
|
9378
|
-
value: levelToValue(self2.level, rootLogger) > levelToValue(level, rootLogger) ? noop : rootLogger[baseLogFunctionSymbol][level],
|
|
9379
|
-
writable: true,
|
|
9380
|
-
enumerable: true,
|
|
9381
|
-
configurable: true
|
|
9382
|
-
});
|
|
9383
|
-
if (self2[level] === noop) {
|
|
9384
|
-
if (!opts.transmit) return;
|
|
9385
|
-
const transmitLevel = opts.transmit.level || self2.level;
|
|
9386
|
-
const transmitValue = levelToValue(transmitLevel, rootLogger);
|
|
9387
|
-
const methodValue = levelToValue(level, rootLogger);
|
|
9388
|
-
if (methodValue < transmitValue) return;
|
|
9389
|
-
}
|
|
9390
|
-
self2[level] = createWrap(self2, opts, rootLogger, level);
|
|
9391
|
-
const bindings = getBindingChain(self2);
|
|
9392
|
-
if (bindings.length === 0) {
|
|
9393
|
-
return;
|
|
9394
|
-
}
|
|
9395
|
-
self2[level] = prependBindingsInArguments(bindings, self2[level]);
|
|
9396
|
-
}
|
|
9397
|
-
function prependBindingsInArguments(bindings, logFunc) {
|
|
9248
|
+
}
|
|
9249
|
+
function de$3(e2, t2, r2, s2) {
|
|
9250
|
+
return /* @__PURE__ */ (function(i3) {
|
|
9398
9251
|
return function() {
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
const args = new Array(arguments.length);
|
|
9407
|
-
const proto = Object.getPrototypeOf && Object.getPrototypeOf(this) === _console ? _console : this;
|
|
9408
|
-
for (var i3 = 0; i3 < args.length; i3++) args[i3] = arguments[i3];
|
|
9409
|
-
var argsIsSerialized = false;
|
|
9410
|
-
if (opts.serialize) {
|
|
9411
|
-
applySerializers(args, this._serialize, this.serializers, this._stdErrSerialize);
|
|
9412
|
-
argsIsSerialized = true;
|
|
9413
|
-
}
|
|
9414
|
-
if (opts.asObject || opts.formatters) {
|
|
9415
|
-
write.call(proto, ...asObject(this, level, args, ts2, opts));
|
|
9416
|
-
} else write.apply(proto, args);
|
|
9417
|
-
if (opts.transmit) {
|
|
9418
|
-
const transmitLevel = opts.transmit.level || self2._level;
|
|
9419
|
-
const transmitValue = levelToValue(transmitLevel, rootLogger);
|
|
9420
|
-
const methodValue = levelToValue(level, rootLogger);
|
|
9421
|
-
if (methodValue < transmitValue) return;
|
|
9422
|
-
transmit(this, {
|
|
9423
|
-
ts: ts2,
|
|
9424
|
-
methodLevel: level,
|
|
9425
|
-
methodValue,
|
|
9426
|
-
transmitValue: rootLogger.levels.values[opts.transmit.level || self2._level],
|
|
9427
|
-
send: opts.transmit.send,
|
|
9428
|
-
val: levelToValue(self2._level, rootLogger)
|
|
9429
|
-
}, args, argsIsSerialized);
|
|
9430
|
-
}
|
|
9431
|
-
};
|
|
9432
|
-
})(self2[baseLogFunctionSymbol][level]);
|
|
9433
|
-
}
|
|
9434
|
-
function asObject(logger, level, args, ts2, opts) {
|
|
9435
|
-
const {
|
|
9436
|
-
level: levelFormatter,
|
|
9437
|
-
log: logObjectFormatter = (obj) => obj
|
|
9438
|
-
} = opts.formatters || {};
|
|
9439
|
-
const argsCloned = args.slice();
|
|
9440
|
-
let msg = argsCloned[0];
|
|
9441
|
-
const logObject = {};
|
|
9442
|
-
let lvl = (logger._childLevel | 0) + 1;
|
|
9443
|
-
if (lvl < 1) lvl = 1;
|
|
9444
|
-
if (ts2) {
|
|
9445
|
-
logObject.time = ts2;
|
|
9446
|
-
}
|
|
9447
|
-
if (levelFormatter) {
|
|
9448
|
-
const formattedLevel = levelFormatter(level, logger.levels.values[level]);
|
|
9449
|
-
Object.assign(logObject, formattedLevel);
|
|
9450
|
-
} else {
|
|
9451
|
-
logObject.level = logger.levels.values[level];
|
|
9452
|
-
}
|
|
9453
|
-
if (opts.asObjectBindingsOnly) {
|
|
9454
|
-
if (msg !== null && typeof msg === "object") {
|
|
9455
|
-
while (lvl-- && typeof argsCloned[0] === "object") {
|
|
9456
|
-
Object.assign(logObject, argsCloned.shift());
|
|
9457
|
-
}
|
|
9458
|
-
}
|
|
9459
|
-
const formattedLogObject = logObjectFormatter(logObject);
|
|
9460
|
-
return [formattedLogObject, ...argsCloned];
|
|
9461
|
-
} else {
|
|
9462
|
-
if (msg !== null && typeof msg === "object") {
|
|
9463
|
-
while (lvl-- && typeof argsCloned[0] === "object") {
|
|
9464
|
-
Object.assign(logObject, argsCloned.shift());
|
|
9465
|
-
}
|
|
9466
|
-
msg = argsCloned.length ? format(argsCloned.shift(), argsCloned) : void 0;
|
|
9467
|
-
} else if (typeof msg === "string") msg = format(argsCloned.shift(), argsCloned);
|
|
9468
|
-
if (msg !== void 0) logObject[opts.messageKey] = msg;
|
|
9469
|
-
const formattedLogObject = logObjectFormatter(logObject);
|
|
9470
|
-
return [formattedLogObject];
|
|
9471
|
-
}
|
|
9472
|
-
}
|
|
9473
|
-
function applySerializers(args, serialize, serializers, stdErrSerialize) {
|
|
9474
|
-
for (const i3 in args) {
|
|
9475
|
-
if (stdErrSerialize && args[i3] instanceof Error) {
|
|
9476
|
-
args[i3] = pino.stdSerializers.err(args[i3]);
|
|
9477
|
-
} else if (typeof args[i3] === "object" && !Array.isArray(args[i3]) && serialize) {
|
|
9478
|
-
for (const k2 in args[i3]) {
|
|
9479
|
-
if (serialize.indexOf(k2) > -1 && k2 in serializers) {
|
|
9480
|
-
args[i3][k2] = serializers[k2](args[i3][k2]);
|
|
9481
|
-
}
|
|
9482
|
-
}
|
|
9252
|
+
const f4 = t2.timestamp(), u2 = new Array(arguments.length), c2 = Object.getPrototypeOf && Object.getPrototypeOf(this) === j$4 ? j$4 : this;
|
|
9253
|
+
for (var n3 = 0; n3 < u2.length; n3++) u2[n3] = arguments[n3];
|
|
9254
|
+
var o3 = false;
|
|
9255
|
+
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) {
|
|
9256
|
+
const l2 = t2.transmit.level || e2._level, p2 = m$2(l2, r2), a2 = m$2(s2, r2);
|
|
9257
|
+
if (a2 < p2) return;
|
|
9258
|
+
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);
|
|
9483
9259
|
}
|
|
9484
|
-
}
|
|
9485
|
-
}
|
|
9486
|
-
function transmit(logger, opts, args, argsIsSerialized = false) {
|
|
9487
|
-
const send = opts.send;
|
|
9488
|
-
const ts2 = opts.ts;
|
|
9489
|
-
const methodLevel = opts.methodLevel;
|
|
9490
|
-
const methodValue = opts.methodValue;
|
|
9491
|
-
const val = opts.val;
|
|
9492
|
-
const bindings = logger._logEvent.bindings;
|
|
9493
|
-
if (!argsIsSerialized) {
|
|
9494
|
-
applySerializers(
|
|
9495
|
-
args,
|
|
9496
|
-
logger._serialize || Object.keys(logger.serializers),
|
|
9497
|
-
logger.serializers,
|
|
9498
|
-
logger._stdErrSerialize === void 0 ? true : logger._stdErrSerialize
|
|
9499
|
-
);
|
|
9500
|
-
}
|
|
9501
|
-
logger._logEvent.ts = ts2;
|
|
9502
|
-
logger._logEvent.messages = args.filter(function(arg) {
|
|
9503
|
-
return bindings.indexOf(arg) === -1;
|
|
9504
|
-
});
|
|
9505
|
-
logger._logEvent.level.label = methodLevel;
|
|
9506
|
-
logger._logEvent.level.value = methodValue;
|
|
9507
|
-
send(methodLevel, logger._logEvent, val);
|
|
9508
|
-
logger._logEvent = createLogEventShape(bindings);
|
|
9509
|
-
}
|
|
9510
|
-
function createLogEventShape(bindings) {
|
|
9511
|
-
return {
|
|
9512
|
-
ts: 0,
|
|
9513
|
-
messages: [],
|
|
9514
|
-
bindings: bindings || [],
|
|
9515
|
-
level: { label: "", value: 0 }
|
|
9516
9260
|
};
|
|
9261
|
+
})(e2[A$2][s2]);
|
|
9262
|
+
}
|
|
9263
|
+
function ve$4(e2, t2, r2, s2, i3) {
|
|
9264
|
+
const { level: h4, log: f4 = (l2) => l2 } = i3.formatters || {}, u2 = r2.slice();
|
|
9265
|
+
let c2 = u2[0];
|
|
9266
|
+
const n3 = {};
|
|
9267
|
+
let o3 = (e2._childLevel | 0) + 1;
|
|
9268
|
+
if (o3 < 1 && (o3 = 1), s2 && (n3.time = s2), h4) {
|
|
9269
|
+
const l2 = h4(t2, e2.levels.values[t2]);
|
|
9270
|
+
Object.assign(n3, l2);
|
|
9271
|
+
} else n3.level = e2.levels.values[t2];
|
|
9272
|
+
if (i3.asObjectBindingsOnly) {
|
|
9273
|
+
if (c2 !== null && typeof c2 == "object") for (; o3-- && typeof u2[0] == "object"; ) Object.assign(n3, u2.shift());
|
|
9274
|
+
return [f4(n3), ...u2];
|
|
9275
|
+
} else {
|
|
9276
|
+
if (c2 !== null && typeof c2 == "object") {
|
|
9277
|
+
for (; o3-- && typeof u2[0] == "object"; ) Object.assign(n3, u2.shift());
|
|
9278
|
+
c2 = u2.length ? G$3(u2.shift(), u2) : void 0;
|
|
9279
|
+
} else typeof c2 == "string" && (c2 = G$3(u2.shift(), u2));
|
|
9280
|
+
return c2 !== void 0 && (n3[i3.messageKey] = c2), [f4(n3)];
|
|
9517
9281
|
}
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
}
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9282
|
+
}
|
|
9283
|
+
function V$2(e2, t2, r2, s2) {
|
|
9284
|
+
for (const i3 in e2) if (s2 && e2[i3] instanceof Error) e2[i3] = v$5.stdSerializers.err(e2[i3]);
|
|
9285
|
+
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]));
|
|
9286
|
+
}
|
|
9287
|
+
function me$4(e2, t2, r2, s2 = false) {
|
|
9288
|
+
const i3 = t2.send, h4 = t2.ts, f4 = t2.methodLevel, u2 = t2.methodValue, c2 = t2.val, n3 = e2._logEvent.bindings;
|
|
9289
|
+
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) {
|
|
9290
|
+
return n3.indexOf(o3) === -1;
|
|
9291
|
+
}), e2._logEvent.level.label = f4, e2._logEvent.level.value = u2, i3(f4, e2._logEvent, c2), e2._logEvent = N$4(n3);
|
|
9292
|
+
}
|
|
9293
|
+
function N$4(e2) {
|
|
9294
|
+
return { ts: 0, messages: [], bindings: e2 || [], level: { label: "", value: 0 } };
|
|
9295
|
+
}
|
|
9296
|
+
function U$2(e2) {
|
|
9297
|
+
const t2 = { type: e2.constructor.name, msg: e2.message, stack: e2.stack };
|
|
9298
|
+
for (const r2 in e2) t2[r2] === void 0 && (t2[r2] = e2[r2]);
|
|
9299
|
+
return t2;
|
|
9300
|
+
}
|
|
9301
|
+
function ye$4(e2) {
|
|
9302
|
+
return typeof e2.timestamp == "function" ? e2.timestamp : e2.timestamp === false ? X$2 : Y$1;
|
|
9303
|
+
}
|
|
9304
|
+
function C$3() {
|
|
9305
|
+
return {};
|
|
9306
|
+
}
|
|
9307
|
+
function $$1(e2) {
|
|
9308
|
+
return e2;
|
|
9309
|
+
}
|
|
9310
|
+
function w$3() {
|
|
9311
|
+
}
|
|
9312
|
+
function X$2() {
|
|
9313
|
+
return false;
|
|
9314
|
+
}
|
|
9315
|
+
function Y$1() {
|
|
9316
|
+
return Date.now();
|
|
9317
|
+
}
|
|
9318
|
+
function pe$3() {
|
|
9319
|
+
return Math.round(Date.now() / 1e3);
|
|
9320
|
+
}
|
|
9321
|
+
function Le$4() {
|
|
9322
|
+
return new Date(Date.now()).toISOString();
|
|
9323
|
+
}
|
|
9324
|
+
function we$4() {
|
|
9325
|
+
function e2(t2) {
|
|
9326
|
+
return typeof t2 < "u" && t2;
|
|
9559
9327
|
}
|
|
9560
|
-
|
|
9561
|
-
|
|
9562
|
-
return
|
|
9563
|
-
}
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
Object.defineProperty(Object.prototype, "globalThis", {
|
|
9567
|
-
get: function() {
|
|
9568
|
-
delete Object.prototype.globalThis;
|
|
9569
|
-
return this.globalThis = this;
|
|
9570
|
-
},
|
|
9571
|
-
configurable: true
|
|
9572
|
-
});
|
|
9573
|
-
return globalThis;
|
|
9574
|
-
} catch (e2) {
|
|
9575
|
-
return defd(self) || defd(window) || defd(this) || {};
|
|
9576
|
-
}
|
|
9328
|
+
try {
|
|
9329
|
+
return typeof globalThis < "u" || Object.defineProperty(Object.prototype, "globalThis", { get: function() {
|
|
9330
|
+
return delete Object.prototype.globalThis, this.globalThis = this;
|
|
9331
|
+
}, configurable: true }), globalThis;
|
|
9332
|
+
} catch {
|
|
9333
|
+
return e2(self) || e2(window) || e2(this) || {};
|
|
9577
9334
|
}
|
|
9578
|
-
browser.exports.default = pino;
|
|
9579
|
-
browser.exports.pino = pino;
|
|
9580
|
-
return browser.exports;
|
|
9581
9335
|
}
|
|
9582
|
-
|
|
9583
|
-
|
|
9584
|
-
const
|
|
9585
|
-
var
|
|
9586
|
-
let
|
|
9587
|
-
constructor(
|
|
9588
|
-
|
|
9336
|
+
b$4.exports.default = v$5;
|
|
9337
|
+
b$4.exports.pino = v$5;
|
|
9338
|
+
const Z$1 = { level: "info" }, S$3 = "custom_context", I$1 = 1e3 * 1024;
|
|
9339
|
+
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);
|
|
9340
|
+
let je$2 = class je {
|
|
9341
|
+
constructor(t2) {
|
|
9342
|
+
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;
|
|
9589
9343
|
}
|
|
9590
9344
|
get value() {
|
|
9591
9345
|
return this.nodeValue;
|
|
@@ -9594,26 +9348,26 @@ let S$3 = class S {
|
|
|
9594
9348
|
return this.sizeInBytes;
|
|
9595
9349
|
}
|
|
9596
9350
|
};
|
|
9597
|
-
let
|
|
9598
|
-
constructor(
|
|
9599
|
-
|
|
9351
|
+
let q$1 = class q {
|
|
9352
|
+
constructor(t2) {
|
|
9353
|
+
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;
|
|
9600
9354
|
}
|
|
9601
|
-
append(
|
|
9602
|
-
const
|
|
9603
|
-
if (
|
|
9604
|
-
for (; this.size +
|
|
9605
|
-
this.head ? (this.tail && (this.tail.next =
|
|
9355
|
+
append(t2) {
|
|
9356
|
+
const r2 = new je$2(t2);
|
|
9357
|
+
if (r2.size > this.maxSizeInBytes) throw new Error(`[LinkedList] Value too big to insert into list: ${t2} with size ${r2.size}`);
|
|
9358
|
+
for (; this.size + r2.size > this.maxSizeInBytes; ) this.shift();
|
|
9359
|
+
this.head ? (this.tail && (this.tail.next = r2), this.tail = r2) : (this.head = r2, this.tail = r2), this.lengthInNodes++, this.sizeInBytes += r2.size;
|
|
9606
9360
|
}
|
|
9607
9361
|
shift() {
|
|
9608
9362
|
if (!this.head) return;
|
|
9609
|
-
const
|
|
9610
|
-
this.head = this.head.next, this.head || (this.tail = null), this.lengthInNodes--, this.sizeInBytes -=
|
|
9363
|
+
const t2 = this.head;
|
|
9364
|
+
this.head = this.head.next, this.head || (this.tail = null), this.lengthInNodes--, this.sizeInBytes -= t2.size;
|
|
9611
9365
|
}
|
|
9612
9366
|
toArray() {
|
|
9613
|
-
const
|
|
9614
|
-
let
|
|
9615
|
-
for (;
|
|
9616
|
-
return
|
|
9367
|
+
const t2 = [];
|
|
9368
|
+
let r2 = this.head;
|
|
9369
|
+
for (; r2 !== null; ) t2.push(r2.value), r2 = r2.next;
|
|
9370
|
+
return t2;
|
|
9617
9371
|
}
|
|
9618
9372
|
get length() {
|
|
9619
9373
|
return this.lengthInNodes;
|
|
@@ -9625,48 +9379,52 @@ let v$5 = class v {
|
|
|
9625
9379
|
return Array.from(this);
|
|
9626
9380
|
}
|
|
9627
9381
|
[Symbol.iterator]() {
|
|
9628
|
-
let
|
|
9382
|
+
let t2 = this.head;
|
|
9629
9383
|
return { next: () => {
|
|
9630
|
-
if (!
|
|
9631
|
-
const
|
|
9632
|
-
return
|
|
9384
|
+
if (!t2) return { done: true, value: null };
|
|
9385
|
+
const r2 = t2.value;
|
|
9386
|
+
return t2 = t2.next, { done: false, value: r2 };
|
|
9633
9387
|
} };
|
|
9634
9388
|
}
|
|
9635
9389
|
};
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9390
|
+
const Se$4 = (e2) => JSON.stringify(e2, (t2, r2) => typeof r2 == "bigint" ? r2.toString() + "n" : r2);
|
|
9391
|
+
function K$4(e2) {
|
|
9392
|
+
return typeof e2 == "string" ? e2 : Se$4(e2) || "";
|
|
9393
|
+
}
|
|
9394
|
+
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);
|
|
9395
|
+
let J$5 = class J {
|
|
9396
|
+
constructor(t2, r2 = I$1) {
|
|
9397
|
+
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);
|
|
9640
9398
|
}
|
|
9641
|
-
forwardToConsole(
|
|
9642
|
-
|
|
9399
|
+
forwardToConsole(t2, r2) {
|
|
9400
|
+
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);
|
|
9643
9401
|
}
|
|
9644
|
-
appendToLogs(
|
|
9645
|
-
this.logs.append(
|
|
9646
|
-
const
|
|
9647
|
-
|
|
9402
|
+
appendToLogs(t2) {
|
|
9403
|
+
this.logs.append(K$4({ timestamp: (/* @__PURE__ */ new Date()).toISOString(), log: t2 }));
|
|
9404
|
+
const r2 = typeof t2 == "string" ? JSON.parse(t2).level : t2.level;
|
|
9405
|
+
r2 >= this.levelValue && this.forwardToConsole(t2, r2);
|
|
9648
9406
|
}
|
|
9649
9407
|
getLogs() {
|
|
9650
9408
|
return this.logs;
|
|
9651
9409
|
}
|
|
9652
9410
|
clearLogs() {
|
|
9653
|
-
this.logs = new
|
|
9411
|
+
this.logs = new q$1(this.MAX_LOG_SIZE_IN_BYTES);
|
|
9654
9412
|
}
|
|
9655
9413
|
getLogArray() {
|
|
9656
9414
|
return Array.from(this.logs);
|
|
9657
9415
|
}
|
|
9658
|
-
logsToBlob(
|
|
9659
|
-
const
|
|
9660
|
-
return
|
|
9416
|
+
logsToBlob(t2) {
|
|
9417
|
+
const r2 = this.getLogArray();
|
|
9418
|
+
return r2.push(K$4({ extraMetadata: t2 })), new Blob(r2, { type: "application/json" });
|
|
9661
9419
|
}
|
|
9662
9420
|
};
|
|
9663
|
-
var
|
|
9664
|
-
let
|
|
9665
|
-
constructor(
|
|
9666
|
-
|
|
9421
|
+
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);
|
|
9422
|
+
let xe$2 = class xe {
|
|
9423
|
+
constructor(t2, r2 = I$1) {
|
|
9424
|
+
Te$4(this, "baseChunkLogger"), this.baseChunkLogger = new J$5(t2, r2);
|
|
9667
9425
|
}
|
|
9668
|
-
write(
|
|
9669
|
-
this.baseChunkLogger.appendToLogs(
|
|
9426
|
+
write(t2) {
|
|
9427
|
+
this.baseChunkLogger.appendToLogs(t2);
|
|
9670
9428
|
}
|
|
9671
9429
|
getLogs() {
|
|
9672
9430
|
return this.baseChunkLogger.getLogs();
|
|
@@ -9677,21 +9435,21 @@ let E$3 = class E {
|
|
|
9677
9435
|
getLogArray() {
|
|
9678
9436
|
return this.baseChunkLogger.getLogArray();
|
|
9679
9437
|
}
|
|
9680
|
-
logsToBlob(
|
|
9681
|
-
return this.baseChunkLogger.logsToBlob(
|
|
9438
|
+
logsToBlob(t2) {
|
|
9439
|
+
return this.baseChunkLogger.logsToBlob(t2);
|
|
9682
9440
|
}
|
|
9683
|
-
downloadLogsBlobInBrowser(
|
|
9684
|
-
const
|
|
9685
|
-
|
|
9441
|
+
downloadLogsBlobInBrowser(t2) {
|
|
9442
|
+
const r2 = URL.createObjectURL(this.logsToBlob(t2)), s2 = document.createElement("a");
|
|
9443
|
+
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);
|
|
9686
9444
|
}
|
|
9687
9445
|
};
|
|
9688
|
-
var
|
|
9689
|
-
let
|
|
9690
|
-
constructor(
|
|
9691
|
-
|
|
9446
|
+
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);
|
|
9447
|
+
let Ve$4 = class Ve {
|
|
9448
|
+
constructor(t2, r2 = I$1) {
|
|
9449
|
+
Pe$4(this, "baseChunkLogger"), this.baseChunkLogger = new J$5(t2, r2);
|
|
9692
9450
|
}
|
|
9693
|
-
write(
|
|
9694
|
-
this.baseChunkLogger.appendToLogs(
|
|
9451
|
+
write(t2) {
|
|
9452
|
+
this.baseChunkLogger.appendToLogs(t2);
|
|
9695
9453
|
}
|
|
9696
9454
|
getLogs() {
|
|
9697
9455
|
return this.baseChunkLogger.getLogs();
|
|
@@ -9702,44 +9460,44 @@ let j$4 = class j {
|
|
|
9702
9460
|
getLogArray() {
|
|
9703
9461
|
return this.baseChunkLogger.getLogArray();
|
|
9704
9462
|
}
|
|
9705
|
-
logsToBlob(
|
|
9706
|
-
return this.baseChunkLogger.logsToBlob(
|
|
9463
|
+
logsToBlob(t2) {
|
|
9464
|
+
return this.baseChunkLogger.logsToBlob(t2);
|
|
9707
9465
|
}
|
|
9708
9466
|
};
|
|
9709
|
-
var
|
|
9710
|
-
for (var
|
|
9711
|
-
if (
|
|
9712
|
-
return
|
|
9713
|
-
},
|
|
9714
|
-
function
|
|
9715
|
-
return
|
|
9467
|
+
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) => {
|
|
9468
|
+
for (var r2 in t2 || (t2 = {})) Me$5.call(t2, r2) && W$4(e2, r2, t2[r2]);
|
|
9469
|
+
if (H$2) for (var r2 of H$2(t2)) De$4.call(t2, r2) && W$4(e2, r2, t2[r2]);
|
|
9470
|
+
return e2;
|
|
9471
|
+
}, B$1 = (e2, t2) => $e$4(e2, Fe$3(t2));
|
|
9472
|
+
function Ge$5(e2) {
|
|
9473
|
+
return B$1(x$3({}, e2), { level: e2?.level || Z$1.level });
|
|
9716
9474
|
}
|
|
9717
|
-
function
|
|
9718
|
-
return r2
|
|
9475
|
+
function Q$2(e2, t2, r2 = S$3) {
|
|
9476
|
+
return e2[r2] = t2, e2;
|
|
9719
9477
|
}
|
|
9720
|
-
function
|
|
9721
|
-
return
|
|
9478
|
+
function ee$3(e2, t2 = S$3) {
|
|
9479
|
+
return e2[t2] || "";
|
|
9722
9480
|
}
|
|
9723
|
-
function
|
|
9724
|
-
const
|
|
9725
|
-
return
|
|
9481
|
+
function te$3(e2, t2, r2 = S$3) {
|
|
9482
|
+
const s2 = ee$3(e2, r2);
|
|
9483
|
+
return s2.trim() ? `${s2}/${t2}` : t2;
|
|
9726
9484
|
}
|
|
9727
|
-
function
|
|
9728
|
-
const
|
|
9729
|
-
return
|
|
9485
|
+
function Re$3(e2, t2, r2 = S$3) {
|
|
9486
|
+
const s2 = te$3(e2, t2, r2), i3 = e2.child({ context: s2 });
|
|
9487
|
+
return Q$2(i3, s2, r2);
|
|
9730
9488
|
}
|
|
9731
|
-
function
|
|
9732
|
-
var
|
|
9733
|
-
const
|
|
9734
|
-
return { logger:
|
|
9489
|
+
function re$2(e2) {
|
|
9490
|
+
var t2, r2;
|
|
9491
|
+
const s2 = new xe$2((t2 = e2.opts) == null ? void 0 : t2.level, e2.maxSizeInBytes);
|
|
9492
|
+
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 };
|
|
9735
9493
|
}
|
|
9736
|
-
function
|
|
9737
|
-
var
|
|
9738
|
-
const
|
|
9739
|
-
return { logger:
|
|
9494
|
+
function ne$2(e2) {
|
|
9495
|
+
var t2;
|
|
9496
|
+
const r2 = new Ve$4((t2 = e2.opts) == null ? void 0 : t2.level, e2.maxSizeInBytes);
|
|
9497
|
+
return { logger: b$4.exports(B$1(x$3({}, e2.opts), { level: "trace" }), r2), chunkLoggerController: r2 };
|
|
9740
9498
|
}
|
|
9741
|
-
function
|
|
9742
|
-
return typeof
|
|
9499
|
+
function Ue$5(e2) {
|
|
9500
|
+
return typeof e2.loggerOverride < "u" && typeof e2.loggerOverride != "string" ? { logger: e2.loggerOverride, chunkLoggerController: null } : typeof window < "u" ? re$2(e2) : ne$2(e2);
|
|
9743
9501
|
}
|
|
9744
9502
|
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);
|
|
9745
9503
|
let h$2 = class h2 extends IEvents {
|
|
@@ -9769,7 +9527,7 @@ let d$4 = class d extends IEvents {
|
|
|
9769
9527
|
}
|
|
9770
9528
|
};
|
|
9771
9529
|
let f$3 = class f {
|
|
9772
|
-
constructor(s2, r2, t2,
|
|
9530
|
+
constructor(s2, r2, t2, q3) {
|
|
9773
9531
|
this.core = s2, this.logger = r2, this.name = t2;
|
|
9774
9532
|
}
|
|
9775
9533
|
};
|
|
@@ -9778,7 +9536,7 @@ let P$3 = class P extends IEvents {
|
|
|
9778
9536
|
super(), this.relayer = s2, this.logger = r2;
|
|
9779
9537
|
}
|
|
9780
9538
|
};
|
|
9781
|
-
let S$2 = class
|
|
9539
|
+
let S$2 = class S extends IEvents {
|
|
9782
9540
|
constructor(s2, r2) {
|
|
9783
9541
|
super(), this.core = s2, this.logger = r2;
|
|
9784
9542
|
}
|
|
@@ -9799,7 +9557,7 @@ let R$1 = class R {
|
|
|
9799
9557
|
}
|
|
9800
9558
|
};
|
|
9801
9559
|
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);
|
|
9802
|
-
let J$4 = class
|
|
9560
|
+
let J$4 = class J2 {
|
|
9803
9561
|
constructor(s2) {
|
|
9804
9562
|
this.opts = s2, i2(this, "protocol", "wc"), i2(this, "version", 2);
|
|
9805
9563
|
}
|
|
@@ -9922,26 +9680,26 @@ let Jn$2 = class Jn extends An$2 {
|
|
|
9922
9680
|
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;
|
|
9923
9681
|
}
|
|
9924
9682
|
get() {
|
|
9925
|
-
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:
|
|
9926
|
-
return [e2, n3, r2, o3, s2, a2, u2, i3, D2, c2, l2, p2, w2, h4, g2,
|
|
9683
|
+
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;
|
|
9684
|
+
return [e2, n3, r2, o3, s2, a2, u2, i3, D2, c2, l2, p2, w2, h4, g2, S3];
|
|
9927
9685
|
}
|
|
9928
|
-
set(e2, n3, r2, o3, s2, a2, u2, i3, D2, c2, l2, p2, w2, h4, g2,
|
|
9929
|
-
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 =
|
|
9686
|
+
set(e2, n3, r2, o3, s2, a2, u2, i3, D2, c2, l2, p2, w2, h4, g2, S3) {
|
|
9687
|
+
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;
|
|
9930
9688
|
}
|
|
9931
9689
|
process(e2, n3) {
|
|
9932
9690
|
for (let d3 = 0; d3 < 16; d3++, n3 += 4) P$2[d3] = e2.getUint32(n3), Q$1[d3] = e2.getUint32(n3 += 4);
|
|
9933
9691
|
for (let d3 = 16; d3 < 80; d3++) {
|
|
9934
|
-
const m3 = P$2[d3 - 15] | 0, F2 = Q$1[d3 - 15] | 0,
|
|
9692
|
+
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]);
|
|
9935
9693
|
P$2[d3] = at2 | 0, Q$1[d3] = st2 | 0;
|
|
9936
9694
|
}
|
|
9937
|
-
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:
|
|
9695
|
+
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;
|
|
9938
9696
|
for (let d3 = 0; d3 < 80; d3++) {
|
|
9939
|
-
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),
|
|
9940
|
-
|
|
9697
|
+
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;
|
|
9698
|
+
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;
|
|
9941
9699
|
const At2 = x$2.add3L(ot2, st2, Ct2);
|
|
9942
9700
|
r2 = x$2.add3H(At2, O3, tt2, at2), o3 = At2 | 0;
|
|
9943
9701
|
}
|
|
9944
|
-
({ 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:
|
|
9702
|
+
({ 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);
|
|
9945
9703
|
}
|
|
9946
9704
|
roundClean() {
|
|
9947
9705
|
P$2.fill(0), Q$1.fill(0);
|
|
@@ -10228,8 +9986,8 @@ function lr$2(t2, e2) {
|
|
|
10228
9986
|
const w2 = p2 * a2;
|
|
10229
9987
|
let h4 = Number(o3 & D2);
|
|
10230
9988
|
o3 >>= l2, h4 > a2 && (h4 -= c2, o3 += gt$3);
|
|
10231
|
-
const g2 = w2,
|
|
10232
|
-
h4 === 0 ? i3 = i3.add(zt$3(
|
|
9989
|
+
const g2 = w2, S3 = w2 + Math.abs(h4) - 1, v2 = p2 % 2 !== 0, L2 = h4 < 0;
|
|
9990
|
+
h4 === 0 ? i3 = i3.add(zt$3(v2, r2[g2])) : u2 = u2.add(zt$3(L2, r2[S3]));
|
|
10233
9991
|
}
|
|
10234
9992
|
return { p: u2, f: i3 };
|
|
10235
9993
|
}, wNAFUnsafe(n3, r2, o3, s2 = t2.ZERO) {
|
|
@@ -10294,28 +10052,28 @@ function yr$2(t2) {
|
|
|
10294
10052
|
function g2(y3, f4) {
|
|
10295
10053
|
ft$3("coordinate " + y3, f4, G$2, D2);
|
|
10296
10054
|
}
|
|
10297
|
-
function
|
|
10055
|
+
function S3(y3) {
|
|
10298
10056
|
if (!(y3 instanceof d3)) throw new Error("ExtendedPoint expected");
|
|
10299
10057
|
}
|
|
10300
|
-
const
|
|
10301
|
-
const { ex: b2, ey:
|
|
10058
|
+
const v2 = xe$1((y3, f4) => {
|
|
10059
|
+
const { ex: b2, ey: E2, ez: B2 } = y3, C2 = y3.is0();
|
|
10302
10060
|
f4 == null && (f4 = C2 ? wr$2 : n3.inv(B2));
|
|
10303
|
-
const A2 = c2(b2 * f4), U2 = c2(
|
|
10061
|
+
const A2 = c2(b2 * f4), U2 = c2(E2 * f4), _3 = c2(B2 * f4);
|
|
10304
10062
|
if (C2) return { x: G$2, y: j$3 };
|
|
10305
10063
|
if (_3 !== j$3) throw new Error("invZ was invalid");
|
|
10306
10064
|
return { x: A2, y: U2 };
|
|
10307
|
-
}),
|
|
10065
|
+
}), L2 = xe$1((y3) => {
|
|
10308
10066
|
const { a: f4, d: b2 } = e2;
|
|
10309
10067
|
if (y3.is0()) throw new Error("bad point: ZERO");
|
|
10310
|
-
const { ex:
|
|
10068
|
+
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)));
|
|
10311
10069
|
if (V3 !== Y2) throw new Error("bad point: equation left != right (1)");
|
|
10312
|
-
const Z2 = c2(
|
|
10070
|
+
const Z2 = c2(E2 * B2), X2 = c2(C2 * A2);
|
|
10313
10071
|
if (Z2 !== X2) throw new Error("bad point: equation left != right (2)");
|
|
10314
10072
|
return true;
|
|
10315
10073
|
});
|
|
10316
10074
|
class d3 {
|
|
10317
|
-
constructor(f4, b2,
|
|
10318
|
-
this.ex = f4, this.ey = b2, this.ez =
|
|
10075
|
+
constructor(f4, b2, E2, B2) {
|
|
10076
|
+
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);
|
|
10319
10077
|
}
|
|
10320
10078
|
get x() {
|
|
10321
10079
|
return this.toAffine().x;
|
|
@@ -10325,25 +10083,25 @@ function yr$2(t2) {
|
|
|
10325
10083
|
}
|
|
10326
10084
|
static fromAffine(f4) {
|
|
10327
10085
|
if (f4 instanceof d3) throw new Error("extended point not allowed");
|
|
10328
|
-
const { x: b2, y:
|
|
10329
|
-
return g2("x", b2), g2("y",
|
|
10086
|
+
const { x: b2, y: E2 } = f4 || {};
|
|
10087
|
+
return g2("x", b2), g2("y", E2), new d3(b2, E2, j$3, c2(b2 * E2));
|
|
10330
10088
|
}
|
|
10331
10089
|
static normalizeZ(f4) {
|
|
10332
|
-
const b2 = n3.invertBatch(f4.map((
|
|
10333
|
-
return f4.map((
|
|
10090
|
+
const b2 = n3.invertBatch(f4.map((E2) => E2.ez));
|
|
10091
|
+
return f4.map((E2, B2) => E2.toAffine(b2[B2])).map(d3.fromAffine);
|
|
10334
10092
|
}
|
|
10335
10093
|
static msm(f4, b2) {
|
|
10336
10094
|
return br$2(d3, l2, f4, b2);
|
|
10337
10095
|
}
|
|
10338
10096
|
_setWindowSize(f4) {
|
|
10339
|
-
|
|
10097
|
+
q3.setWindowSize(this, f4);
|
|
10340
10098
|
}
|
|
10341
10099
|
assertValidity() {
|
|
10342
|
-
|
|
10100
|
+
L2(this);
|
|
10343
10101
|
}
|
|
10344
10102
|
equals(f4) {
|
|
10345
|
-
|
|
10346
|
-
const { ex: b2, ey:
|
|
10103
|
+
S3(f4);
|
|
10104
|
+
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);
|
|
10347
10105
|
return _3 === T2 && $2 === R3;
|
|
10348
10106
|
}
|
|
10349
10107
|
is0() {
|
|
@@ -10353,58 +10111,58 @@ function yr$2(t2) {
|
|
|
10353
10111
|
return new d3(c2(-this.ex), this.ey, this.ez, c2(-this.et));
|
|
10354
10112
|
}
|
|
10355
10113
|
double() {
|
|
10356
|
-
const { a: f4 } = e2, { ex: b2, ey:
|
|
10114
|
+
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);
|
|
10357
10115
|
return new d3(Z2, X2, pt2, et2);
|
|
10358
10116
|
}
|
|
10359
10117
|
add(f4) {
|
|
10360
|
-
|
|
10361
|
-
const { a: b2, d:
|
|
10118
|
+
S3(f4);
|
|
10119
|
+
const { a: b2, d: E2 } = e2, { ex: B2, ey: C2, ez: A2, et: U2 } = this, { ex: _3, ey: T2, ez: $2, et: R3 } = f4;
|
|
10362
10120
|
if (b2 === BigInt(-1)) {
|
|
10363
10121
|
const re2 = c2((C2 - B2) * (T2 + _3)), oe2 = c2((C2 + B2) * (T2 - _3)), mt2 = c2(oe2 - re2);
|
|
10364
10122
|
if (mt2 === G$2) return this.double();
|
|
10365
10123
|
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);
|
|
10366
10124
|
return new d3(Dn2, dn3, ln2, hn2);
|
|
10367
10125
|
}
|
|
10368
|
-
const V3 = c2(B2 * _3), Y2 = c2(C2 * T2), Z2 = c2(U2 *
|
|
10126
|
+
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);
|
|
10369
10127
|
return new d3(un2, cn2, fn2, an2);
|
|
10370
10128
|
}
|
|
10371
10129
|
subtract(f4) {
|
|
10372
10130
|
return this.add(f4.negate());
|
|
10373
10131
|
}
|
|
10374
10132
|
wNAF(f4) {
|
|
10375
|
-
return
|
|
10133
|
+
return q3.wNAFCached(this, f4, d3.normalizeZ);
|
|
10376
10134
|
}
|
|
10377
10135
|
multiply(f4) {
|
|
10378
10136
|
const b2 = f4;
|
|
10379
10137
|
ft$3("scalar", b2, j$3, r2);
|
|
10380
|
-
const { p:
|
|
10381
|
-
return d3.normalizeZ([
|
|
10138
|
+
const { p: E2, f: B2 } = this.wNAF(b2);
|
|
10139
|
+
return d3.normalizeZ([E2, B2])[0];
|
|
10382
10140
|
}
|
|
10383
10141
|
multiplyUnsafe(f4, b2 = d3.ZERO) {
|
|
10384
|
-
const
|
|
10385
|
-
return ft$3("scalar",
|
|
10142
|
+
const E2 = f4;
|
|
10143
|
+
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);
|
|
10386
10144
|
}
|
|
10387
10145
|
isSmallOrder() {
|
|
10388
10146
|
return this.multiplyUnsafe(i3).is0();
|
|
10389
10147
|
}
|
|
10390
10148
|
isTorsionFree() {
|
|
10391
|
-
return
|
|
10149
|
+
return q3.unsafeLadder(this, r2).is0();
|
|
10392
10150
|
}
|
|
10393
10151
|
toAffine(f4) {
|
|
10394
|
-
return
|
|
10152
|
+
return v2(this, f4);
|
|
10395
10153
|
}
|
|
10396
10154
|
clearCofactor() {
|
|
10397
10155
|
const { h: f4 } = e2;
|
|
10398
10156
|
return f4 === j$3 ? this : this.multiplyUnsafe(f4);
|
|
10399
10157
|
}
|
|
10400
10158
|
static fromHex(f4, b2 = false) {
|
|
10401
|
-
const { d:
|
|
10159
|
+
const { d: E2, a: B2 } = e2, C2 = n3.BYTES;
|
|
10402
10160
|
f4 = W$3("pointHex", f4, C2), Tt$3("zip215", b2);
|
|
10403
10161
|
const A2 = f4.slice(), U2 = f4[C2 - 1];
|
|
10404
10162
|
A2[C2 - 1] = U2 & -129;
|
|
10405
10163
|
const _3 = Et$4(A2), T2 = b2 ? D2 : n3.ORDER;
|
|
10406
10164
|
ft$3("pointHex.y", _3, G$2, T2);
|
|
10407
|
-
const $2 = c2(_3 * _3), R3 = c2($2 - j$3), V3 = c2(
|
|
10165
|
+
const $2 = c2(_3 * _3), R3 = c2($2 - j$3), V3 = c2(E2 * $2 - B2);
|
|
10408
10166
|
let { isValid: Y2, value: Z2 } = p2(R3, V3);
|
|
10409
10167
|
if (!Y2) throw new Error("Point.fromHex: invalid y coordinate");
|
|
10410
10168
|
const X2 = (Z2 & j$3) === j$3, et2 = (U2 & 128) !== 0;
|
|
@@ -10415,15 +10173,15 @@ function yr$2(t2) {
|
|
|
10415
10173
|
return O3(f4).point;
|
|
10416
10174
|
}
|
|
10417
10175
|
toRawBytes() {
|
|
10418
|
-
const { x: f4, y: b2 } = this.toAffine(),
|
|
10419
|
-
return
|
|
10176
|
+
const { x: f4, y: b2 } = this.toAffine(), E2 = Nt$3(b2, n3.BYTES);
|
|
10177
|
+
return E2[E2.length - 1] |= f4 & j$3 ? 128 : 0, E2;
|
|
10420
10178
|
}
|
|
10421
10179
|
toHex() {
|
|
10422
10180
|
return Ft$3(this.toRawBytes());
|
|
10423
10181
|
}
|
|
10424
10182
|
}
|
|
10425
10183
|
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);
|
|
10426
|
-
const { BASE: m3, ZERO: F2 } = d3,
|
|
10184
|
+
const { BASE: m3, ZERO: F2 } = d3, q3 = lr$2(d3, u2 * 8);
|
|
10427
10185
|
function z2(y3) {
|
|
10428
10186
|
return H$1(y3, r2);
|
|
10429
10187
|
}
|
|
@@ -10433,8 +10191,8 @@ function yr$2(t2) {
|
|
|
10433
10191
|
function O3(y3) {
|
|
10434
10192
|
const f4 = n3.BYTES;
|
|
10435
10193
|
y3 = W$3("private key", y3, f4);
|
|
10436
|
-
const b2 = W$3("hashed private key", s2(y3), 2 * f4),
|
|
10437
|
-
return { head:
|
|
10194
|
+
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();
|
|
10195
|
+
return { head: E2, prefix: B2, scalar: C2, point: A2, pointBytes: U2 };
|
|
10438
10196
|
}
|
|
10439
10197
|
function ot2(y3) {
|
|
10440
10198
|
return O3(y3).pointBytes;
|
|
@@ -10445,14 +10203,14 @@ function yr$2(t2) {
|
|
|
10445
10203
|
}
|
|
10446
10204
|
function st2(y3, f4, b2 = {}) {
|
|
10447
10205
|
y3 = W$3("message", y3), o3 && (y3 = o3(y3));
|
|
10448
|
-
const { prefix:
|
|
10206
|
+
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);
|
|
10449
10207
|
ft$3("signature.s", T2, G$2, r2);
|
|
10450
10208
|
const $2 = ye$3(U2, Nt$3(T2, n3.BYTES));
|
|
10451
10209
|
return W$3("result", $2, n3.BYTES * 2);
|
|
10452
10210
|
}
|
|
10453
10211
|
const at2 = Er$1;
|
|
10454
|
-
function Ct2(y3, f4, b2,
|
|
10455
|
-
const { context: B2, zip215: C2 } =
|
|
10212
|
+
function Ct2(y3, f4, b2, E2 = at2) {
|
|
10213
|
+
const { context: B2, zip215: C2 } = E2, A2 = n3.BYTES;
|
|
10456
10214
|
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));
|
|
10457
10215
|
const U2 = Et$4(y3.slice(A2, 2 * A2));
|
|
10458
10216
|
let _3, T2, $2;
|
|
@@ -10476,8 +10234,8 @@ const xr$1 = BigInt(1), Te$3 = BigInt(2);
|
|
|
10476
10234
|
BigInt(3);
|
|
10477
10235
|
const Br$2 = BigInt(5), Cr$2 = BigInt(8);
|
|
10478
10236
|
function Ar$2(t2) {
|
|
10479
|
-
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,
|
|
10480
|
-
return { pow_p_5_8: J$3(
|
|
10237
|
+
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;
|
|
10238
|
+
return { pow_p_5_8: J$3(S3, Te$3, s2) * t2 % s2, b2: u2 };
|
|
10481
10239
|
}
|
|
10482
10240
|
function mr$2(t2) {
|
|
10483
10241
|
return t2[0] &= 248, t2[31] &= 127, t2[31] |= 64, t2;
|
|
@@ -10514,13 +10272,13 @@ function Ir$2(t2, e2) {
|
|
|
10514
10272
|
function l2(h4) {
|
|
10515
10273
|
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");
|
|
10516
10274
|
if (h4.length === 0) return "";
|
|
10517
|
-
for (var g2 = 0,
|
|
10518
|
-
for (var d3 = (
|
|
10519
|
-
for (var F2 = h4[
|
|
10275
|
+
for (var g2 = 0, S3 = 0, v2 = 0, L2 = h4.length; v2 !== L2 && h4[v2] === 0; ) v2++, g2++;
|
|
10276
|
+
for (var d3 = (L2 - v2) * c2 + 1 >>> 0, m3 = new Uint8Array(d3); v2 !== L2; ) {
|
|
10277
|
+
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;
|
|
10520
10278
|
if (F2 !== 0) throw new Error("Non-zero carry");
|
|
10521
|
-
|
|
10279
|
+
S3 = q3, v2++;
|
|
10522
10280
|
}
|
|
10523
|
-
for (var I2 = d3 -
|
|
10281
|
+
for (var I2 = d3 - S3; I2 !== d3 && m3[I2] === 0; ) I2++;
|
|
10524
10282
|
for (var O3 = i3.repeat(g2); I2 < d3; ++I2) O3 += t2.charAt(m3[I2]);
|
|
10525
10283
|
return O3;
|
|
10526
10284
|
}
|
|
@@ -10529,17 +10287,17 @@ function Ir$2(t2, e2) {
|
|
|
10529
10287
|
if (h4.length === 0) return new Uint8Array();
|
|
10530
10288
|
var g2 = 0;
|
|
10531
10289
|
if (h4[g2] !== " ") {
|
|
10532
|
-
for (var
|
|
10533
|
-
for (var
|
|
10290
|
+
for (var S3 = 0, v2 = 0; h4[g2] === i3; ) S3++, g2++;
|
|
10291
|
+
for (var L2 = (h4.length - g2) * D2 + 1 >>> 0, d3 = new Uint8Array(L2); h4[g2]; ) {
|
|
10534
10292
|
var m3 = n3[h4.charCodeAt(g2)];
|
|
10535
10293
|
if (m3 === 255) return;
|
|
10536
|
-
for (var F2 = 0,
|
|
10294
|
+
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;
|
|
10537
10295
|
if (m3 !== 0) throw new Error("Non-zero carry");
|
|
10538
|
-
|
|
10296
|
+
v2 = F2, g2++;
|
|
10539
10297
|
}
|
|
10540
10298
|
if (h4[g2] !== " ") {
|
|
10541
|
-
for (var z2 =
|
|
10542
|
-
for (var I2 = new Uint8Array(
|
|
10299
|
+
for (var z2 = L2 - v2; z2 !== L2 && d3[z2] === 0; ) z2++;
|
|
10300
|
+
for (var I2 = new Uint8Array(S3 + (L2 - z2)), O3 = S3; z2 !== L2; ) I2[O3++] = d3[z2++];
|
|
10543
10301
|
return I2;
|
|
10544
10302
|
}
|
|
10545
10303
|
}
|
|
@@ -10923,12 +10681,12 @@ function detect(userAgent) {
|
|
|
10923
10681
|
}
|
|
10924
10682
|
function matchUserAgent(ua2) {
|
|
10925
10683
|
return ua2 !== "" && userAgentRules.reduce(function(matched, _a2) {
|
|
10926
|
-
var
|
|
10684
|
+
var browser = _a2[0], regex = _a2[1];
|
|
10927
10685
|
if (matched) {
|
|
10928
10686
|
return matched;
|
|
10929
10687
|
}
|
|
10930
10688
|
var uaMatch = regex.exec(ua2);
|
|
10931
|
-
return !!uaMatch && [
|
|
10689
|
+
return !!uaMatch && [browser, uaMatch];
|
|
10932
10690
|
}, false);
|
|
10933
10691
|
}
|
|
10934
10692
|
function parseUserAgent(ua2) {
|
|
@@ -11491,10 +11249,10 @@ for (let round = 0, R3 = _1n$5, x2 = 1, y3 = 0; round < 24; round++) {
|
|
|
11491
11249
|
SHA3_PI.push(2 * (5 * y3 + x2));
|
|
11492
11250
|
SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64);
|
|
11493
11251
|
let t2 = _0n$5;
|
|
11494
|
-
for (let
|
|
11252
|
+
for (let j2 = 0; j2 < 7; j2++) {
|
|
11495
11253
|
R3 = (R3 << _1n$5 ^ (R3 >> _7n) * _0x71n) % _256n;
|
|
11496
11254
|
if (R3 & _2n$2)
|
|
11497
|
-
t2 ^= _1n$5 << (_1n$5 << /* @__PURE__ */ BigInt(
|
|
11255
|
+
t2 ^= _1n$5 << (_1n$5 << /* @__PURE__ */ BigInt(j2)) - _1n$5;
|
|
11498
11256
|
}
|
|
11499
11257
|
_SHA3_IOTA.push(t2);
|
|
11500
11258
|
}
|
|
@@ -11736,16 +11494,16 @@ class SHA256 extends HashMD {
|
|
|
11736
11494
|
this.H = SHA256_IV[7] | 0;
|
|
11737
11495
|
}
|
|
11738
11496
|
get() {
|
|
11739
|
-
const { A: A2, B: B2, C: C2, D: D2, E:
|
|
11740
|
-
return [A2, B2, C2, D2,
|
|
11497
|
+
const { A: A2, B: B2, C: C2, D: D2, E: E2, F: F2, G: G2, H: H2 } = this;
|
|
11498
|
+
return [A2, B2, C2, D2, E2, F2, G2, H2];
|
|
11741
11499
|
}
|
|
11742
11500
|
// prettier-ignore
|
|
11743
|
-
set(A2, B2, C2, D2,
|
|
11501
|
+
set(A2, B2, C2, D2, E2, F2, G2, H2) {
|
|
11744
11502
|
this.A = A2 | 0;
|
|
11745
11503
|
this.B = B2 | 0;
|
|
11746
11504
|
this.C = C2 | 0;
|
|
11747
11505
|
this.D = D2 | 0;
|
|
11748
|
-
this.E =
|
|
11506
|
+
this.E = E2 | 0;
|
|
11749
11507
|
this.F = F2 | 0;
|
|
11750
11508
|
this.G = G2 | 0;
|
|
11751
11509
|
this.H = H2 | 0;
|
|
@@ -11760,16 +11518,16 @@ class SHA256 extends HashMD {
|
|
|
11760
11518
|
const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10;
|
|
11761
11519
|
SHA256_W[i3] = s1 + SHA256_W[i3 - 7] + s0 + SHA256_W[i3 - 16] | 0;
|
|
11762
11520
|
}
|
|
11763
|
-
let { A: A2, B: B2, C: C2, D: D2, E:
|
|
11521
|
+
let { A: A2, B: B2, C: C2, D: D2, E: E2, F: F2, G: G2, H: H2 } = this;
|
|
11764
11522
|
for (let i3 = 0; i3 < 64; i3++) {
|
|
11765
|
-
const sigma1 = rotr(
|
|
11766
|
-
const T1 = H2 + sigma1 + Chi(
|
|
11523
|
+
const sigma1 = rotr(E2, 6) ^ rotr(E2, 11) ^ rotr(E2, 25);
|
|
11524
|
+
const T1 = H2 + sigma1 + Chi(E2, F2, G2) + SHA256_K[i3] + SHA256_W[i3] | 0;
|
|
11767
11525
|
const sigma0 = rotr(A2, 2) ^ rotr(A2, 13) ^ rotr(A2, 22);
|
|
11768
11526
|
const T2 = sigma0 + Maj(A2, B2, C2) | 0;
|
|
11769
11527
|
H2 = G2;
|
|
11770
11528
|
G2 = F2;
|
|
11771
|
-
F2 =
|
|
11772
|
-
|
|
11529
|
+
F2 = E2;
|
|
11530
|
+
E2 = D2 + T1 | 0;
|
|
11773
11531
|
D2 = C2;
|
|
11774
11532
|
C2 = B2;
|
|
11775
11533
|
B2 = A2;
|
|
@@ -11779,11 +11537,11 @@ class SHA256 extends HashMD {
|
|
|
11779
11537
|
B2 = B2 + this.B | 0;
|
|
11780
11538
|
C2 = C2 + this.C | 0;
|
|
11781
11539
|
D2 = D2 + this.D | 0;
|
|
11782
|
-
|
|
11540
|
+
E2 = E2 + this.E | 0;
|
|
11783
11541
|
F2 = F2 + this.F | 0;
|
|
11784
11542
|
G2 = G2 + this.G | 0;
|
|
11785
11543
|
H2 = H2 + this.H | 0;
|
|
11786
|
-
this.set(A2, B2, C2, D2,
|
|
11544
|
+
this.set(A2, B2, C2, D2, E2, F2, G2, H2);
|
|
11787
11545
|
}
|
|
11788
11546
|
roundClean() {
|
|
11789
11547
|
clean(SHA256_W);
|
|
@@ -11933,22 +11691,22 @@ function createHmacDrbg(hashLen, qByteLen, hmacFn) {
|
|
|
11933
11691
|
throw new Error("qByteLen must be a number");
|
|
11934
11692
|
if (typeof hmacFn !== "function")
|
|
11935
11693
|
throw new Error("hmacFn must be a function");
|
|
11936
|
-
let
|
|
11694
|
+
let v2 = u8n(hashLen);
|
|
11937
11695
|
let k2 = u8n(hashLen);
|
|
11938
11696
|
let i3 = 0;
|
|
11939
11697
|
const reset = () => {
|
|
11940
|
-
|
|
11698
|
+
v2.fill(1);
|
|
11941
11699
|
k2.fill(0);
|
|
11942
11700
|
i3 = 0;
|
|
11943
11701
|
};
|
|
11944
|
-
const h4 = (...b2) => hmacFn(k2,
|
|
11702
|
+
const h4 = (...b2) => hmacFn(k2, v2, ...b2);
|
|
11945
11703
|
const reseed = (seed = u8n(0)) => {
|
|
11946
11704
|
k2 = h4(u8fr([0]), seed);
|
|
11947
|
-
|
|
11705
|
+
v2 = h4();
|
|
11948
11706
|
if (seed.length === 0)
|
|
11949
11707
|
return;
|
|
11950
11708
|
k2 = h4(u8fr([1]), seed);
|
|
11951
|
-
|
|
11709
|
+
v2 = h4();
|
|
11952
11710
|
};
|
|
11953
11711
|
const gen2 = () => {
|
|
11954
11712
|
if (i3++ >= 1e3)
|
|
@@ -11956,10 +11714,10 @@ function createHmacDrbg(hashLen, qByteLen, hmacFn) {
|
|
|
11956
11714
|
let len = 0;
|
|
11957
11715
|
const out = [];
|
|
11958
11716
|
while (len < qByteLen) {
|
|
11959
|
-
|
|
11960
|
-
const sl =
|
|
11717
|
+
v2 = h4();
|
|
11718
|
+
const sl = v2.slice();
|
|
11961
11719
|
out.push(sl);
|
|
11962
|
-
len +=
|
|
11720
|
+
len += v2.length;
|
|
11963
11721
|
}
|
|
11964
11722
|
return concatBytes(...out);
|
|
11965
11723
|
};
|
|
@@ -12297,11 +12055,11 @@ function fromHex$2(value, options = {}) {
|
|
|
12297
12055
|
hexString = `0${hexString}`;
|
|
12298
12056
|
const length = hexString.length / 2;
|
|
12299
12057
|
const bytes = new Uint8Array(length);
|
|
12300
|
-
for (let index = 0,
|
|
12301
|
-
const nibbleLeft = charCodeToBase16(hexString.charCodeAt(
|
|
12302
|
-
const nibbleRight = charCodeToBase16(hexString.charCodeAt(
|
|
12058
|
+
for (let index = 0, j2 = 0; index < length; index++) {
|
|
12059
|
+
const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j2++));
|
|
12060
|
+
const nibbleRight = charCodeToBase16(hexString.charCodeAt(j2++));
|
|
12303
12061
|
if (nibbleLeft === void 0 || nibbleRight === void 0) {
|
|
12304
|
-
throw new BaseError(`Invalid byte sequence ("${hexString[
|
|
12062
|
+
throw new BaseError(`Invalid byte sequence ("${hexString[j2 - 2]}${hexString[j2 - 1]}" in "${hexString}").`);
|
|
12305
12063
|
}
|
|
12306
12064
|
bytes[index] = nibbleLeft * 16 + nibbleRight;
|
|
12307
12065
|
}
|
|
@@ -12725,9 +12483,9 @@ function invert(number, modulo) {
|
|
|
12725
12483
|
let b2 = modulo;
|
|
12726
12484
|
let x2 = _0n$3, u2 = _1n$3;
|
|
12727
12485
|
while (a2 !== _0n$3) {
|
|
12728
|
-
const
|
|
12486
|
+
const q3 = b2 / a2;
|
|
12729
12487
|
const r2 = b2 % a2;
|
|
12730
|
-
const m3 = x2 - u2 *
|
|
12488
|
+
const m3 = x2 - u2 * q3;
|
|
12731
12489
|
b2 = a2, a2 = r2, x2 = u2, u2 = m3;
|
|
12732
12490
|
}
|
|
12733
12491
|
const gcd2 = b2;
|
|
@@ -12745,9 +12503,9 @@ function sqrt3mod4(Fp, n3) {
|
|
|
12745
12503
|
function sqrt5mod8(Fp, n3) {
|
|
12746
12504
|
const p5div8 = (Fp.ORDER - _5n) / _8n;
|
|
12747
12505
|
const n22 = Fp.mul(n3, _2n$1);
|
|
12748
|
-
const
|
|
12749
|
-
const nv = Fp.mul(n3,
|
|
12750
|
-
const i3 = Fp.mul(Fp.mul(nv, _2n$1),
|
|
12506
|
+
const v2 = Fp.pow(n22, p5div8);
|
|
12507
|
+
const nv = Fp.mul(n3, v2);
|
|
12508
|
+
const i3 = Fp.mul(Fp.mul(nv, _2n$1), v2);
|
|
12751
12509
|
const root = Fp.mul(nv, Fp.sub(i3, Fp.ONE));
|
|
12752
12510
|
if (!Fp.eql(Fp.sqr(root), n3))
|
|
12753
12511
|
throw new Error("Cannot find square root");
|
|
@@ -12757,10 +12515,10 @@ function tonelliShanks(P3) {
|
|
|
12757
12515
|
if (P3 < BigInt(3))
|
|
12758
12516
|
throw new Error("sqrt is not defined for small field");
|
|
12759
12517
|
let Q2 = P3 - _1n$3;
|
|
12760
|
-
let
|
|
12518
|
+
let S3 = 0;
|
|
12761
12519
|
while (Q2 % _2n$1 === _0n$3) {
|
|
12762
12520
|
Q2 /= _2n$1;
|
|
12763
|
-
|
|
12521
|
+
S3++;
|
|
12764
12522
|
}
|
|
12765
12523
|
let Z2 = _2n$1;
|
|
12766
12524
|
const _Fp = Field(P3);
|
|
@@ -12768,7 +12526,7 @@ function tonelliShanks(P3) {
|
|
|
12768
12526
|
if (Z2++ > 1e3)
|
|
12769
12527
|
throw new Error("Cannot find square root: probably non-prime P");
|
|
12770
12528
|
}
|
|
12771
|
-
if (
|
|
12529
|
+
if (S3 === 1)
|
|
12772
12530
|
return sqrt3mod4;
|
|
12773
12531
|
let cc2 = _Fp.pow(Z2, Q2);
|
|
12774
12532
|
const Q1div2 = (Q2 + _1n$3) / _2n$1;
|
|
@@ -12777,7 +12535,7 @@ function tonelliShanks(P3) {
|
|
|
12777
12535
|
return n3;
|
|
12778
12536
|
if (FpLegendre(Fp, n3) !== 1)
|
|
12779
12537
|
throw new Error("Cannot find square root");
|
|
12780
|
-
let M3 =
|
|
12538
|
+
let M3 = S3;
|
|
12781
12539
|
let c2 = Fp.mul(Fp.ONE, cc2);
|
|
12782
12540
|
let t2 = Fp.pow(n3, Q2);
|
|
12783
12541
|
let R3 = Fp.pow(n3, Q1div2);
|
|
@@ -13167,19 +12925,19 @@ function pippenger(c2, fieldN, points, scalars) {
|
|
|
13167
12925
|
let sum = zero;
|
|
13168
12926
|
for (let i3 = lastBits; i3 >= 0; i3 -= windowSize) {
|
|
13169
12927
|
buckets.fill(zero);
|
|
13170
|
-
for (let
|
|
13171
|
-
const scalar = scalars[
|
|
12928
|
+
for (let j2 = 0; j2 < slength; j2++) {
|
|
12929
|
+
const scalar = scalars[j2];
|
|
13172
12930
|
const wbits2 = Number(scalar >> BigInt(i3) & MASK);
|
|
13173
|
-
buckets[wbits2] = buckets[wbits2].add(points[
|
|
12931
|
+
buckets[wbits2] = buckets[wbits2].add(points[j2]);
|
|
13174
12932
|
}
|
|
13175
12933
|
let resI = zero;
|
|
13176
|
-
for (let
|
|
13177
|
-
sumI = sumI.add(buckets[
|
|
12934
|
+
for (let j2 = buckets.length - 1, sumI = zero; j2 > 0; j2--) {
|
|
12935
|
+
sumI = sumI.add(buckets[j2]);
|
|
13178
12936
|
resI = resI.add(sumI);
|
|
13179
12937
|
}
|
|
13180
12938
|
sum = sum.add(resI);
|
|
13181
12939
|
if (i3 !== 0)
|
|
13182
|
-
for (let
|
|
12940
|
+
for (let j2 = 0; j2 < windowSize; j2++)
|
|
13183
12941
|
sum = sum.double();
|
|
13184
12942
|
}
|
|
13185
12943
|
return sum;
|
|
@@ -13244,27 +13002,27 @@ const DER = {
|
|
|
13244
13002
|
// Basic building block is TLV (Tag-Length-Value)
|
|
13245
13003
|
_tlv: {
|
|
13246
13004
|
encode: (tag, data) => {
|
|
13247
|
-
const { Err:
|
|
13005
|
+
const { Err: E2 } = DER;
|
|
13248
13006
|
if (tag < 0 || tag > 256)
|
|
13249
|
-
throw new
|
|
13007
|
+
throw new E2("tlv.encode: wrong tag");
|
|
13250
13008
|
if (data.length & 1)
|
|
13251
|
-
throw new
|
|
13009
|
+
throw new E2("tlv.encode: unpadded data");
|
|
13252
13010
|
const dataLen = data.length / 2;
|
|
13253
13011
|
const len = numberToHexUnpadded(dataLen);
|
|
13254
13012
|
if (len.length / 2 & 128)
|
|
13255
|
-
throw new
|
|
13013
|
+
throw new E2("tlv.encode: long form length too big");
|
|
13256
13014
|
const lenLen = dataLen > 127 ? numberToHexUnpadded(len.length / 2 | 128) : "";
|
|
13257
13015
|
const t2 = numberToHexUnpadded(tag);
|
|
13258
13016
|
return t2 + lenLen + len + data;
|
|
13259
13017
|
},
|
|
13260
13018
|
// v - value, l - left bytes (unparsed)
|
|
13261
13019
|
decode(tag, data) {
|
|
13262
|
-
const { Err:
|
|
13020
|
+
const { Err: E2 } = DER;
|
|
13263
13021
|
let pos = 0;
|
|
13264
13022
|
if (tag < 0 || tag > 256)
|
|
13265
|
-
throw new
|
|
13023
|
+
throw new E2("tlv.encode: wrong tag");
|
|
13266
13024
|
if (data.length < 2 || data[pos++] !== tag)
|
|
13267
|
-
throw new
|
|
13025
|
+
throw new E2("tlv.decode: wrong tlv");
|
|
13268
13026
|
const first = data[pos++];
|
|
13269
13027
|
const isLong = !!(first & 128);
|
|
13270
13028
|
let length = 0;
|
|
@@ -13273,24 +13031,24 @@ const DER = {
|
|
|
13273
13031
|
else {
|
|
13274
13032
|
const lenLen = first & 127;
|
|
13275
13033
|
if (!lenLen)
|
|
13276
|
-
throw new
|
|
13034
|
+
throw new E2("tlv.decode(long): indefinite length not supported");
|
|
13277
13035
|
if (lenLen > 4)
|
|
13278
|
-
throw new
|
|
13036
|
+
throw new E2("tlv.decode(long): byte length is too big");
|
|
13279
13037
|
const lengthBytes = data.subarray(pos, pos + lenLen);
|
|
13280
13038
|
if (lengthBytes.length !== lenLen)
|
|
13281
|
-
throw new
|
|
13039
|
+
throw new E2("tlv.decode: length bytes not complete");
|
|
13282
13040
|
if (lengthBytes[0] === 0)
|
|
13283
|
-
throw new
|
|
13041
|
+
throw new E2("tlv.decode(long): zero leftmost byte");
|
|
13284
13042
|
for (const b2 of lengthBytes)
|
|
13285
13043
|
length = length << 8 | b2;
|
|
13286
13044
|
pos += lenLen;
|
|
13287
13045
|
if (length < 128)
|
|
13288
|
-
throw new
|
|
13046
|
+
throw new E2("tlv.decode(long): not minimal encoding");
|
|
13289
13047
|
}
|
|
13290
|
-
const
|
|
13291
|
-
if (
|
|
13292
|
-
throw new
|
|
13293
|
-
return { v:
|
|
13048
|
+
const v2 = data.subarray(pos, pos + length);
|
|
13049
|
+
if (v2.length !== length)
|
|
13050
|
+
throw new E2("tlv.decode: wrong value length");
|
|
13051
|
+
return { v: v2, l: data.subarray(pos + length) };
|
|
13294
13052
|
}
|
|
13295
13053
|
},
|
|
13296
13054
|
// https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,
|
|
@@ -13299,35 +13057,35 @@ const DER = {
|
|
|
13299
13057
|
// - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)
|
|
13300
13058
|
_int: {
|
|
13301
13059
|
encode(num) {
|
|
13302
|
-
const { Err:
|
|
13060
|
+
const { Err: E2 } = DER;
|
|
13303
13061
|
if (num < _0n$1)
|
|
13304
|
-
throw new
|
|
13062
|
+
throw new E2("integer: negative integers are not allowed");
|
|
13305
13063
|
let hex = numberToHexUnpadded(num);
|
|
13306
13064
|
if (Number.parseInt(hex[0], 16) & 8)
|
|
13307
13065
|
hex = "00" + hex;
|
|
13308
13066
|
if (hex.length & 1)
|
|
13309
|
-
throw new
|
|
13067
|
+
throw new E2("unexpected DER parsing assertion: unpadded hex");
|
|
13310
13068
|
return hex;
|
|
13311
13069
|
},
|
|
13312
13070
|
decode(data) {
|
|
13313
|
-
const { Err:
|
|
13071
|
+
const { Err: E2 } = DER;
|
|
13314
13072
|
if (data[0] & 128)
|
|
13315
|
-
throw new
|
|
13073
|
+
throw new E2("invalid signature integer: negative");
|
|
13316
13074
|
if (data[0] === 0 && !(data[1] & 128))
|
|
13317
|
-
throw new
|
|
13075
|
+
throw new E2("invalid signature integer: unnecessary leading zero");
|
|
13318
13076
|
return bytesToNumberBE(data);
|
|
13319
13077
|
}
|
|
13320
13078
|
},
|
|
13321
13079
|
toSig(hex) {
|
|
13322
|
-
const { Err:
|
|
13080
|
+
const { Err: E2, _int: int, _tlv: tlv } = DER;
|
|
13323
13081
|
const data = ensureBytes("signature", hex);
|
|
13324
13082
|
const { v: seqBytes, l: seqLeftBytes } = tlv.decode(48, data);
|
|
13325
13083
|
if (seqLeftBytes.length)
|
|
13326
|
-
throw new
|
|
13084
|
+
throw new E2("invalid signature: left bytes after parsing");
|
|
13327
13085
|
const { v: rBytes, l: rLeftBytes } = tlv.decode(2, seqBytes);
|
|
13328
13086
|
const { v: sBytes, l: sLeftBytes } = tlv.decode(2, rLeftBytes);
|
|
13329
13087
|
if (sLeftBytes.length)
|
|
13330
|
-
throw new
|
|
13088
|
+
throw new E2("invalid signature: left bytes after parsing");
|
|
13331
13089
|
return { r: int.decode(rBytes), s: int.decode(sBytes) };
|
|
13332
13090
|
},
|
|
13333
13091
|
hexFromSig(sig) {
|
|
@@ -13996,14 +13754,14 @@ function weierstrass(curveDef) {
|
|
|
13996
13754
|
if (!isWithinCurveOrder(k2))
|
|
13997
13755
|
return;
|
|
13998
13756
|
const ik = invN(k2);
|
|
13999
|
-
const
|
|
14000
|
-
const r2 = modN(
|
|
13757
|
+
const q3 = Point.BASE.multiply(k2).toAffine();
|
|
13758
|
+
const r2 = modN(q3.x);
|
|
14001
13759
|
if (r2 === _0n$1)
|
|
14002
13760
|
return;
|
|
14003
13761
|
const s2 = modN(ik * modN(m3 + r2 * d3));
|
|
14004
13762
|
if (s2 === _0n$1)
|
|
14005
13763
|
return;
|
|
14006
|
-
let recovery = (
|
|
13764
|
+
let recovery = (q3.x === r2 ? 0 : 2) | Number(q3.y & _1n$1);
|
|
14007
13765
|
let normS = s2;
|
|
14008
13766
|
if (lowS && isBiggerThanHalfOrder(s2)) {
|
|
14009
13767
|
normS = normalizeS(s2);
|
|
@@ -14070,8 +13828,8 @@ function weierstrass(curveDef) {
|
|
|
14070
13828
|
const R3 = Point.BASE.multiplyAndAddUnsafe(P3, u1, u2)?.toAffine();
|
|
14071
13829
|
if (!R3)
|
|
14072
13830
|
return false;
|
|
14073
|
-
const
|
|
14074
|
-
return
|
|
13831
|
+
const v2 = modN(R3.x);
|
|
13832
|
+
return v2 === r2;
|
|
14075
13833
|
}
|
|
14076
13834
|
return {
|
|
14077
13835
|
CURVE,
|
|
@@ -14189,14 +13947,14 @@ function fromHex(signature) {
|
|
|
14189
13947
|
yParity
|
|
14190
13948
|
};
|
|
14191
13949
|
}
|
|
14192
|
-
function vToYParity(
|
|
14193
|
-
if (
|
|
13950
|
+
function vToYParity(v2) {
|
|
13951
|
+
if (v2 === 0 || v2 === 27)
|
|
14194
13952
|
return 0;
|
|
14195
|
-
if (
|
|
13953
|
+
if (v2 === 1 || v2 === 28)
|
|
14196
13954
|
return 1;
|
|
14197
|
-
if (
|
|
14198
|
-
return
|
|
14199
|
-
throw new InvalidVError({ value:
|
|
13955
|
+
if (v2 >= 35)
|
|
13956
|
+
return v2 % 2 === 0 ? 1 : 0;
|
|
13957
|
+
throw new InvalidVError({ value: v2 });
|
|
14200
13958
|
}
|
|
14201
13959
|
class InvalidSerializedSizeError2 extends BaseError {
|
|
14202
13960
|
constructor({ signature }) {
|
|
@@ -14428,8 +14186,8 @@ function base$1(ALPHABET2) {
|
|
|
14428
14186
|
throw new TypeError("Alphabet too long");
|
|
14429
14187
|
}
|
|
14430
14188
|
const BASE_MAP = new Uint8Array(256);
|
|
14431
|
-
for (let
|
|
14432
|
-
BASE_MAP[
|
|
14189
|
+
for (let j2 = 0; j2 < BASE_MAP.length; j2++) {
|
|
14190
|
+
BASE_MAP[j2] = 255;
|
|
14433
14191
|
}
|
|
14434
14192
|
for (let i3 = 0; i3 < ALPHABET2.length; i3++) {
|
|
14435
14193
|
const x2 = ALPHABET2.charAt(i3);
|
|
@@ -14532,9 +14290,9 @@ function base$1(ALPHABET2) {
|
|
|
14532
14290
|
it4++;
|
|
14533
14291
|
}
|
|
14534
14292
|
const vch = new Uint8Array(zeroes + (size2 - it4));
|
|
14535
|
-
let
|
|
14293
|
+
let j2 = zeroes;
|
|
14536
14294
|
while (it4 !== size2) {
|
|
14537
|
-
vch[
|
|
14295
|
+
vch[j2++] = b256[it4++];
|
|
14538
14296
|
}
|
|
14539
14297
|
return vch;
|
|
14540
14298
|
}
|
|
@@ -15285,8 +15043,8 @@ class CachedKeyDecoder {
|
|
|
15285
15043
|
const records = this.caches[byteLength - 1];
|
|
15286
15044
|
FIND_CHUNK: for (const record of records) {
|
|
15287
15045
|
const recordBytes = record.bytes;
|
|
15288
|
-
for (let
|
|
15289
|
-
if (recordBytes[
|
|
15046
|
+
for (let j2 = 0; j2 < byteLength; j2++) {
|
|
15047
|
+
if (recordBytes[j2] !== bytes[inputOffset + j2]) {
|
|
15290
15048
|
continue FIND_CHUNK;
|
|
15291
15049
|
}
|
|
15292
15050
|
}
|
|
@@ -15966,8 +15724,8 @@ function base(ALPHABET2, name) {
|
|
|
15966
15724
|
throw new TypeError("Alphabet too long");
|
|
15967
15725
|
}
|
|
15968
15726
|
var BASE_MAP = new Uint8Array(256);
|
|
15969
|
-
for (var
|
|
15970
|
-
BASE_MAP[
|
|
15727
|
+
for (var j2 = 0; j2 < BASE_MAP.length; j2++) {
|
|
15728
|
+
BASE_MAP[j2] = 255;
|
|
15971
15729
|
}
|
|
15972
15730
|
for (var i3 = 0; i3 < ALPHABET2.length; i3++) {
|
|
15973
15731
|
var x2 = ALPHABET2.charAt(i3);
|
|
@@ -16072,9 +15830,9 @@ function base(ALPHABET2, name) {
|
|
|
16072
15830
|
it4++;
|
|
16073
15831
|
}
|
|
16074
15832
|
var vch = new Uint8Array(zeroes + (size2 - it4));
|
|
16075
|
-
var
|
|
15833
|
+
var j3 = zeroes;
|
|
16076
15834
|
while (it4 !== size2) {
|
|
16077
|
-
vch[
|
|
15835
|
+
vch[j3++] = b256[it4++];
|
|
16078
15836
|
}
|
|
16079
15837
|
return vch;
|
|
16080
15838
|
}
|
|
@@ -16631,26 +16389,26 @@ function requireBlake2b() {
|
|
|
16631
16389
|
if (hasRequiredBlake2b) return blake2b_1;
|
|
16632
16390
|
hasRequiredBlake2b = 1;
|
|
16633
16391
|
const util2 = requireUtil();
|
|
16634
|
-
function ADD64AA(
|
|
16635
|
-
const o0 =
|
|
16636
|
-
let o1 =
|
|
16392
|
+
function ADD64AA(v3, a2, b2) {
|
|
16393
|
+
const o0 = v3[a2] + v3[b2];
|
|
16394
|
+
let o1 = v3[a2 + 1] + v3[b2 + 1];
|
|
16637
16395
|
if (o0 >= 4294967296) {
|
|
16638
16396
|
o1++;
|
|
16639
16397
|
}
|
|
16640
|
-
|
|
16641
|
-
|
|
16398
|
+
v3[a2] = o0;
|
|
16399
|
+
v3[a2 + 1] = o1;
|
|
16642
16400
|
}
|
|
16643
|
-
function ADD64AC(
|
|
16644
|
-
let o0 =
|
|
16401
|
+
function ADD64AC(v3, a2, b0, b1) {
|
|
16402
|
+
let o0 = v3[a2] + b0;
|
|
16645
16403
|
if (b0 < 0) {
|
|
16646
16404
|
o0 += 4294967296;
|
|
16647
16405
|
}
|
|
16648
|
-
let o1 =
|
|
16406
|
+
let o1 = v3[a2 + 1] + b1;
|
|
16649
16407
|
if (o0 >= 4294967296) {
|
|
16650
16408
|
o1++;
|
|
16651
16409
|
}
|
|
16652
|
-
|
|
16653
|
-
|
|
16410
|
+
v3[a2] = o0;
|
|
16411
|
+
v3[a2 + 1] = o1;
|
|
16654
16412
|
}
|
|
16655
16413
|
function B2B_GET32(arr, i3) {
|
|
16656
16414
|
return arr[i3] ^ arr[i3 + 1] << 8 ^ arr[i3 + 2] << 16 ^ arr[i3 + 3] << 24;
|
|
@@ -16660,28 +16418,28 @@ function requireBlake2b() {
|
|
|
16660
16418
|
const x1 = m3[ix + 1];
|
|
16661
16419
|
const y0 = m3[iy];
|
|
16662
16420
|
const y1 = m3[iy + 1];
|
|
16663
|
-
ADD64AA(
|
|
16664
|
-
ADD64AC(
|
|
16665
|
-
let xor0 =
|
|
16666
|
-
let xor1 =
|
|
16667
|
-
|
|
16668
|
-
|
|
16669
|
-
ADD64AA(
|
|
16670
|
-
xor0 =
|
|
16671
|
-
xor1 =
|
|
16672
|
-
|
|
16673
|
-
|
|
16674
|
-
ADD64AA(
|
|
16675
|
-
ADD64AC(
|
|
16676
|
-
xor0 =
|
|
16677
|
-
xor1 =
|
|
16678
|
-
|
|
16679
|
-
|
|
16680
|
-
ADD64AA(
|
|
16681
|
-
xor0 =
|
|
16682
|
-
xor1 =
|
|
16683
|
-
|
|
16684
|
-
|
|
16421
|
+
ADD64AA(v2, a2, b2);
|
|
16422
|
+
ADD64AC(v2, a2, x0, x1);
|
|
16423
|
+
let xor0 = v2[d3] ^ v2[a2];
|
|
16424
|
+
let xor1 = v2[d3 + 1] ^ v2[a2 + 1];
|
|
16425
|
+
v2[d3] = xor1;
|
|
16426
|
+
v2[d3 + 1] = xor0;
|
|
16427
|
+
ADD64AA(v2, c2, d3);
|
|
16428
|
+
xor0 = v2[b2] ^ v2[c2];
|
|
16429
|
+
xor1 = v2[b2 + 1] ^ v2[c2 + 1];
|
|
16430
|
+
v2[b2] = xor0 >>> 24 ^ xor1 << 8;
|
|
16431
|
+
v2[b2 + 1] = xor1 >>> 24 ^ xor0 << 8;
|
|
16432
|
+
ADD64AA(v2, a2, b2);
|
|
16433
|
+
ADD64AC(v2, a2, y0, y1);
|
|
16434
|
+
xor0 = v2[d3] ^ v2[a2];
|
|
16435
|
+
xor1 = v2[d3 + 1] ^ v2[a2 + 1];
|
|
16436
|
+
v2[d3] = xor0 >>> 16 ^ xor1 << 16;
|
|
16437
|
+
v2[d3 + 1] = xor1 >>> 16 ^ xor0 << 16;
|
|
16438
|
+
ADD64AA(v2, c2, d3);
|
|
16439
|
+
xor0 = v2[b2] ^ v2[c2];
|
|
16440
|
+
xor1 = v2[b2 + 1] ^ v2[c2 + 1];
|
|
16441
|
+
v2[b2] = xor1 >>> 31 ^ xor0 << 1;
|
|
16442
|
+
v2[b2 + 1] = xor0 >>> 31 ^ xor1 << 1;
|
|
16685
16443
|
}
|
|
16686
16444
|
const BLAKE2B_IV32 = new Uint32Array([
|
|
16687
16445
|
4089235720,
|
|
@@ -16900,19 +16658,19 @@ function requireBlake2b() {
|
|
|
16900
16658
|
return x2 * 2;
|
|
16901
16659
|
})
|
|
16902
16660
|
);
|
|
16903
|
-
const
|
|
16661
|
+
const v2 = new Uint32Array(32);
|
|
16904
16662
|
const m3 = new Uint32Array(32);
|
|
16905
16663
|
function blake2bCompress(ctx, last) {
|
|
16906
16664
|
let i3 = 0;
|
|
16907
16665
|
for (i3 = 0; i3 < 16; i3++) {
|
|
16908
|
-
|
|
16909
|
-
|
|
16666
|
+
v2[i3] = ctx.h[i3];
|
|
16667
|
+
v2[i3 + 16] = BLAKE2B_IV32[i3];
|
|
16910
16668
|
}
|
|
16911
|
-
|
|
16912
|
-
|
|
16669
|
+
v2[24] = v2[24] ^ ctx.t;
|
|
16670
|
+
v2[25] = v2[25] ^ ctx.t / 4294967296;
|
|
16913
16671
|
if (last) {
|
|
16914
|
-
|
|
16915
|
-
|
|
16672
|
+
v2[28] = ~v2[28];
|
|
16673
|
+
v2[29] = ~v2[29];
|
|
16916
16674
|
}
|
|
16917
16675
|
for (i3 = 0; i3 < 32; i3++) {
|
|
16918
16676
|
m3[i3] = B2B_GET32(ctx.b, 4 * i3);
|
|
@@ -16928,7 +16686,7 @@ function requireBlake2b() {
|
|
|
16928
16686
|
B2B_G(6, 8, 18, 28, SIGMA82[i3 * 16 + 14], SIGMA82[i3 * 16 + 15]);
|
|
16929
16687
|
}
|
|
16930
16688
|
for (i3 = 0; i3 < 16; i3++) {
|
|
16931
|
-
ctx.h[i3] = ctx.h[i3] ^
|
|
16689
|
+
ctx.h[i3] = ctx.h[i3] ^ v2[i3] ^ v2[i3 + 16];
|
|
16932
16690
|
}
|
|
16933
16691
|
}
|
|
16934
16692
|
const parameterBlock = new Uint8Array([
|
|
@@ -17106,18 +16864,18 @@ function requireBlake2s() {
|
|
|
17106
16864
|
if (hasRequiredBlake2s) return blake2s_1;
|
|
17107
16865
|
hasRequiredBlake2s = 1;
|
|
17108
16866
|
const util2 = requireUtil();
|
|
17109
|
-
function B2S_GET32(
|
|
17110
|
-
return
|
|
16867
|
+
function B2S_GET32(v3, i3) {
|
|
16868
|
+
return v3[i3] ^ v3[i3 + 1] << 8 ^ v3[i3 + 2] << 16 ^ v3[i3 + 3] << 24;
|
|
17111
16869
|
}
|
|
17112
16870
|
function B2S_G(a2, b2, c2, d3, x2, y3) {
|
|
17113
|
-
|
|
17114
|
-
|
|
17115
|
-
|
|
17116
|
-
|
|
17117
|
-
|
|
17118
|
-
|
|
17119
|
-
|
|
17120
|
-
|
|
16871
|
+
v2[a2] = v2[a2] + v2[b2] + x2;
|
|
16872
|
+
v2[d3] = ROTR32(v2[d3] ^ v2[a2], 16);
|
|
16873
|
+
v2[c2] = v2[c2] + v2[d3];
|
|
16874
|
+
v2[b2] = ROTR32(v2[b2] ^ v2[c2], 12);
|
|
16875
|
+
v2[a2] = v2[a2] + v2[b2] + y3;
|
|
16876
|
+
v2[d3] = ROTR32(v2[d3] ^ v2[a2], 8);
|
|
16877
|
+
v2[c2] = v2[c2] + v2[d3];
|
|
16878
|
+
v2[b2] = ROTR32(v2[b2] ^ v2[c2], 7);
|
|
17121
16879
|
}
|
|
17122
16880
|
function ROTR32(x2, y3) {
|
|
17123
16881
|
return x2 >>> y3 ^ x2 << 32 - y3;
|
|
@@ -17294,18 +17052,18 @@ function requireBlake2s() {
|
|
|
17294
17052
|
13,
|
|
17295
17053
|
0
|
|
17296
17054
|
]);
|
|
17297
|
-
const
|
|
17055
|
+
const v2 = new Uint32Array(16);
|
|
17298
17056
|
const m3 = new Uint32Array(16);
|
|
17299
17057
|
function blake2sCompress(ctx, last) {
|
|
17300
17058
|
let i3 = 0;
|
|
17301
17059
|
for (i3 = 0; i3 < 8; i3++) {
|
|
17302
|
-
|
|
17303
|
-
|
|
17060
|
+
v2[i3] = ctx.h[i3];
|
|
17061
|
+
v2[i3 + 8] = BLAKE2S_IV[i3];
|
|
17304
17062
|
}
|
|
17305
|
-
|
|
17306
|
-
|
|
17063
|
+
v2[12] ^= ctx.t;
|
|
17064
|
+
v2[13] ^= ctx.t / 4294967296;
|
|
17307
17065
|
if (last) {
|
|
17308
|
-
|
|
17066
|
+
v2[14] = ~v2[14];
|
|
17309
17067
|
}
|
|
17310
17068
|
for (i3 = 0; i3 < 16; i3++) {
|
|
17311
17069
|
m3[i3] = B2S_GET32(ctx.b, 4 * i3);
|
|
@@ -17321,7 +17079,7 @@ function requireBlake2s() {
|
|
|
17321
17079
|
B2S_G(3, 4, 9, 14, m3[SIGMA[i3 * 16 + 14]], m3[SIGMA[i3 * 16 + 15]]);
|
|
17322
17080
|
}
|
|
17323
17081
|
for (i3 = 0; i3 < 8; i3++) {
|
|
17324
|
-
ctx.h[i3] ^=
|
|
17082
|
+
ctx.h[i3] ^= v2[i3] ^ v2[i3 + 8];
|
|
17325
17083
|
}
|
|
17326
17084
|
}
|
|
17327
17085
|
function blake2sInit(outlen, key) {
|
|
@@ -17981,12 +17739,12 @@ let dn$1 = class dn extends qr$1 {
|
|
|
17981
17739
|
process(e2, n3) {
|
|
17982
17740
|
for (let R3 = 0; R3 < 16; R3++, n3 += 4) Tt$2[R3] = e2.getUint32(n3), Ct$2[R3] = e2.getUint32(n3 += 4);
|
|
17983
17741
|
for (let R3 = 16; R3 < 80; R3++) {
|
|
17984
|
-
const Z2 = Tt$2[R3 - 15] | 0, H2 = Ct$2[R3 - 15] | 0,
|
|
17742
|
+
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]);
|
|
17985
17743
|
Tt$2[R3] = p2 | 0, Ct$2[R3] = _3 | 0;
|
|
17986
17744
|
}
|
|
17987
17745
|
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;
|
|
17988
17746
|
for (let R3 = 0; R3 < 80; R3++) {
|
|
17989
|
-
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),
|
|
17747
|
+
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;
|
|
17990
17748
|
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;
|
|
17991
17749
|
const g2 = fn$1(T2, _3, b2);
|
|
17992
17750
|
r2 = an$1(g2, O3, C2, p2), o3 = g2 | 0;
|
|
@@ -18233,7 +17991,7 @@ const ro$1 = (t2, e2) => {
|
|
|
18233
17991
|
if (!t2.aud && !t2.uri) throw new Error("Either `aud` or `uri` is required to construct the message");
|
|
18234
17992
|
let s2 = t2.statement || void 0;
|
|
18235
17993
|
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) => `
|
|
18236
|
-
- ${w2}`).join("")}` : void 0, m3 =
|
|
17994
|
+
- ${w2}`).join("")}` : void 0, m3 = je2(t2.resources);
|
|
18237
17995
|
if (m3) {
|
|
18238
17996
|
const w2 = kt$2(m3);
|
|
18239
17997
|
s2 = wn$1(s2, w2);
|
|
@@ -18341,7 +18099,7 @@ function Yc(t2) {
|
|
|
18341
18099
|
});
|
|
18342
18100
|
}), [...new Set(n3.flat())];
|
|
18343
18101
|
}
|
|
18344
|
-
function
|
|
18102
|
+
function je2(t2) {
|
|
18345
18103
|
if (!t2) return;
|
|
18346
18104
|
const e2 = t2?.[t2.length - 1];
|
|
18347
18105
|
return mn$1(e2) ? e2 : void 0;
|
|
@@ -18510,27 +18268,27 @@ class hf {
|
|
|
18510
18268
|
for (let a2 = 0; a2 < 8; a2++) this.pad[a2] = W$2(e2, 16 + 2 * a2);
|
|
18511
18269
|
}
|
|
18512
18270
|
process(e2, n3, r2 = false) {
|
|
18513
|
-
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),
|
|
18514
|
-
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 |
|
|
18515
|
-
|
|
18516
|
-
let A2 =
|
|
18517
|
-
|
|
18518
|
-
let N2 =
|
|
18519
|
-
|
|
18520
|
-
let D2 =
|
|
18521
|
-
|
|
18522
|
-
let P3 =
|
|
18523
|
-
|
|
18524
|
-
let $2 =
|
|
18525
|
-
|
|
18526
|
-
let V3 =
|
|
18527
|
-
|
|
18528
|
-
let
|
|
18529
|
-
|
|
18530
|
-
let G2 =
|
|
18531
|
-
|
|
18532
|
-
let M3 =
|
|
18533
|
-
|
|
18271
|
+
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);
|
|
18272
|
+
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);
|
|
18273
|
+
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;
|
|
18274
|
+
let A2 = v2 + O3 * f4 + T2 * c2 + C2 * (5 * w2) + _3 * (5 * m3) + p2 * (5 * y3);
|
|
18275
|
+
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;
|
|
18276
|
+
let N2 = v2 + O3 * u2 + T2 * f4 + C2 * c2 + _3 * (5 * w2) + p2 * (5 * m3);
|
|
18277
|
+
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;
|
|
18278
|
+
let D2 = v2 + O3 * a2 + T2 * u2 + C2 * f4 + _3 * c2 + p2 * (5 * w2);
|
|
18279
|
+
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;
|
|
18280
|
+
let P3 = v2 + O3 * l2 + T2 * a2 + C2 * u2 + _3 * f4 + p2 * c2;
|
|
18281
|
+
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;
|
|
18282
|
+
let $2 = v2 + O3 * d3 + T2 * l2 + C2 * a2 + _3 * u2 + p2 * f4;
|
|
18283
|
+
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;
|
|
18284
|
+
let V3 = v2 + O3 * h4 + T2 * d3 + C2 * l2 + _3 * a2 + p2 * u2;
|
|
18285
|
+
v2 = V3 >>> 13, V3 &= 8191, V3 += b2 * f4 + g2 * c2 + x2 * (5 * w2) + E2 * (5 * m3) + I2 * (5 * y3), v2 += V3 >>> 13, V3 &= 8191;
|
|
18286
|
+
let q3 = v2 + O3 * y3 + T2 * h4 + C2 * d3 + _3 * l2 + p2 * a2;
|
|
18287
|
+
v2 = q3 >>> 13, q3 &= 8191, q3 += b2 * u2 + g2 * f4 + x2 * c2 + E2 * (5 * w2) + I2 * (5 * m3), v2 += q3 >>> 13, q3 &= 8191;
|
|
18288
|
+
let G2 = v2 + O3 * m3 + T2 * y3 + C2 * h4 + _3 * d3 + p2 * l2;
|
|
18289
|
+
v2 = G2 >>> 13, G2 &= 8191, G2 += b2 * a2 + g2 * u2 + x2 * f4 + E2 * c2 + I2 * (5 * w2), v2 += G2 >>> 13, G2 &= 8191;
|
|
18290
|
+
let M3 = v2 + O3 * w2 + T2 * m3 + C2 * y3 + _3 * h4 + p2 * d3;
|
|
18291
|
+
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;
|
|
18534
18292
|
}
|
|
18535
18293
|
finalize() {
|
|
18536
18294
|
const { h: e2, pad: n3 } = this, r2 = new Uint16Array(10);
|
|
@@ -18592,10 +18350,10 @@ function pf(t2) {
|
|
|
18592
18350
|
}
|
|
18593
18351
|
const gf = pf((t2) => new hf(t2));
|
|
18594
18352
|
function bf(t2, e2, n3, r2, o3, s2 = 20) {
|
|
18595
|
-
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],
|
|
18596
|
-
for (let D2 = 0; D2 < s2; D2 += 2)
|
|
18353
|
+
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;
|
|
18354
|
+
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);
|
|
18597
18355
|
let N2 = 0;
|
|
18598
|
-
r2[N2++] = i3 +
|
|
18356
|
+
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;
|
|
18599
18357
|
}
|
|
18600
18358
|
const yf = df(bf, { counterRight: false, counterLength: 4, allowShortKeys: false }), mf = new Uint8Array(16), xo$1 = (t2, e2) => {
|
|
18601
18359
|
t2.update(e2);
|
|
@@ -19089,33 +18847,33 @@ function Mf(t2) {
|
|
|
19089
18847
|
if (g2 === we$2) throw new Error("invalid private or public key received");
|
|
19090
18848
|
return F2(g2);
|
|
19091
18849
|
}
|
|
19092
|
-
function
|
|
18850
|
+
function j2(p2) {
|
|
19093
18851
|
return H2(p2, U2);
|
|
19094
18852
|
}
|
|
19095
|
-
function
|
|
18853
|
+
function L2(p2, b2, g2) {
|
|
19096
18854
|
const x2 = w2(p2 * (b2 - g2));
|
|
19097
18855
|
return b2 = w2(b2 - x2), g2 = w2(g2 + x2), { x_2: b2, x_3: g2 };
|
|
19098
18856
|
}
|
|
19099
18857
|
function k2(p2, b2) {
|
|
19100
18858
|
Rn$1("u", p2, we$2, n3), Rn$1("scalar", b2, h4, m3);
|
|
19101
18859
|
const g2 = b2, x2 = p2;
|
|
19102
|
-
let
|
|
18860
|
+
let E2 = ee$2, I2 = we$2, v2 = p2, B2 = ee$2, A2 = we$2;
|
|
19103
18861
|
for (let D2 = BigInt(u2 - 1); D2 >= we$2; D2--) {
|
|
19104
18862
|
const P3 = g2 >> D2 & ee$2;
|
|
19105
|
-
A2 ^= P3, { x_2:
|
|
19106
|
-
const $2 =
|
|
19107
|
-
|
|
18863
|
+
A2 ^= P3, { x_2: E2, x_3: v2 } = L2(A2, E2, v2), { x_2: I2, x_3: B2 } = L2(A2, I2, B2), A2 = P3;
|
|
18864
|
+
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;
|
|
18865
|
+
v2 = w2(Qn2 * Qn2), B2 = w2(x2 * w2(tr2 * tr2)), E2 = w2(V3 * G2), I2 = w2(M3 * (V3 + w2(d3 * M3)));
|
|
19108
18866
|
}
|
|
19109
|
-
({ x_2:
|
|
18867
|
+
({ x_2: E2, x_3: v2 } = L2(A2, E2, v2)), { x_2: I2, x_3: B2 } = L2(A2, I2, B2);
|
|
19110
18868
|
const N2 = s2(I2);
|
|
19111
|
-
return w2(
|
|
18869
|
+
return w2(E2 * N2);
|
|
19112
18870
|
}
|
|
19113
18871
|
const O3 = { secretKey: a2, publicKey: a2, seed: a2 }, T2 = (p2 = f4(a2)) => (ht$1(p2, O3.seed), p2);
|
|
19114
18872
|
function C2(p2) {
|
|
19115
18873
|
const b2 = T2(p2);
|
|
19116
|
-
return { secretKey: b2, publicKey:
|
|
18874
|
+
return { secretKey: b2, publicKey: j2(b2) };
|
|
19117
18875
|
}
|
|
19118
|
-
return { keygen: C2, getSharedSecret: (p2, b2) => H2(p2, b2), getPublicKey: (p2) =>
|
|
18876
|
+
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 };
|
|
19119
18877
|
}
|
|
19120
18878
|
const Kf = BigInt(1), Go$1 = BigInt(2), qf = BigInt(3), Ff = BigInt(5);
|
|
19121
18879
|
BigInt(8);
|
|
@@ -19234,23 +18992,23 @@ function ta$1(t2, e2 = {}) {
|
|
|
19234
18992
|
if (!r2.isOdd) throw new Error("compression is not supported: Field does not have .isOdd()");
|
|
19235
18993
|
}
|
|
19236
18994
|
function l2(_3, p2, b2) {
|
|
19237
|
-
const { x: g2, y: x2 } = p2.toAffine(),
|
|
18995
|
+
const { x: g2, y: x2 } = p2.toAffine(), E2 = r2.toBytes(g2);
|
|
19238
18996
|
if (He$2(b2, "isCompressed"), b2) {
|
|
19239
18997
|
a2();
|
|
19240
18998
|
const I2 = !r2.isOdd(x2);
|
|
19241
|
-
return _t$2(Xo$1(I2),
|
|
19242
|
-
} else return _t$2(Uint8Array.of(4),
|
|
18999
|
+
return _t$2(Xo$1(I2), E2);
|
|
19000
|
+
} else return _t$2(Uint8Array.of(4), E2, r2.toBytes(x2));
|
|
19243
19001
|
}
|
|
19244
19002
|
function d3(_3) {
|
|
19245
19003
|
Kt$2(_3, void 0, "Point");
|
|
19246
|
-
const { publicKey: p2, publicKeyUncompressed: b2 } = u2, g2 = _3.length, x2 = _3[0],
|
|
19004
|
+
const { publicKey: p2, publicKeyUncompressed: b2 } = u2, g2 = _3.length, x2 = _3[0], E2 = _3.subarray(1);
|
|
19247
19005
|
if (g2 === p2 && (x2 === 2 || x2 === 3)) {
|
|
19248
|
-
const I2 = r2.fromBytes(
|
|
19006
|
+
const I2 = r2.fromBytes(E2);
|
|
19249
19007
|
if (!r2.isValid(I2)) throw new Error("bad point: is not on curve, wrong x");
|
|
19250
|
-
const
|
|
19008
|
+
const v2 = m3(I2);
|
|
19251
19009
|
let B2;
|
|
19252
19010
|
try {
|
|
19253
|
-
B2 = r2.sqrt(
|
|
19011
|
+
B2 = r2.sqrt(v2);
|
|
19254
19012
|
} catch (D2) {
|
|
19255
19013
|
const P3 = D2 instanceof Error ? ": " + D2.message : "";
|
|
19256
19014
|
throw new Error("bad point: is not on curve, sqrt error" + P3);
|
|
@@ -19259,9 +19017,9 @@ function ta$1(t2, e2 = {}) {
|
|
|
19259
19017
|
const A2 = r2.isOdd(B2);
|
|
19260
19018
|
return (x2 & 1) === 1 !== A2 && (B2 = r2.neg(B2)), { x: I2, y: B2 };
|
|
19261
19019
|
} else if (g2 === b2 && x2 === 4) {
|
|
19262
|
-
const I2 = r2.BYTES,
|
|
19263
|
-
if (!w2(
|
|
19264
|
-
return { x:
|
|
19020
|
+
const I2 = r2.BYTES, v2 = r2.fromBytes(E2.subarray(0, I2)), B2 = r2.fromBytes(E2.subarray(I2, I2 * 2));
|
|
19021
|
+
if (!w2(v2, B2)) throw new Error("bad point: is not on curve");
|
|
19022
|
+
return { x: v2, y: B2 };
|
|
19265
19023
|
} else throw new Error(`bad point: got length ${g2}, expected compressed=${p2} or uncompressed=${b2}`);
|
|
19266
19024
|
}
|
|
19267
19025
|
const h4 = e2.toBytes || l2, y3 = e2.fromBytes || d3;
|
|
@@ -19287,16 +19045,16 @@ function ta$1(t2, e2 = {}) {
|
|
|
19287
19045
|
if (!f4 || !f4.basises) throw new Error("no endo");
|
|
19288
19046
|
return Xf(_3, f4.basises, o3.ORDER);
|
|
19289
19047
|
}
|
|
19290
|
-
const
|
|
19048
|
+
const j2 = No$1((_3, p2) => {
|
|
19291
19049
|
const { X: b2, Y: g2, Z: x2 } = _3;
|
|
19292
19050
|
if (r2.eql(x2, r2.ONE)) return { x: b2, y: g2 };
|
|
19293
|
-
const
|
|
19294
|
-
p2 == null && (p2 =
|
|
19295
|
-
const I2 = r2.mul(b2, p2),
|
|
19296
|
-
if (
|
|
19051
|
+
const E2 = _3.is0();
|
|
19052
|
+
p2 == null && (p2 = E2 ? r2.ONE : r2.inv(x2));
|
|
19053
|
+
const I2 = r2.mul(b2, p2), v2 = r2.mul(g2, p2), B2 = r2.mul(x2, p2);
|
|
19054
|
+
if (E2) return { x: r2.ZERO, y: r2.ZERO };
|
|
19297
19055
|
if (!r2.eql(B2, r2.ONE)) throw new Error("invZ was invalid");
|
|
19298
|
-
return { x: I2, y:
|
|
19299
|
-
}),
|
|
19056
|
+
return { x: I2, y: v2 };
|
|
19057
|
+
}), L2 = No$1((_3) => {
|
|
19300
19058
|
if (_3.is0()) {
|
|
19301
19059
|
if (e2.allowInfinityPoint && !r2.is0(_3.Y)) return;
|
|
19302
19060
|
throw new Error("bad point: ZERO");
|
|
@@ -19340,7 +19098,7 @@ function ta$1(t2, e2 = {}) {
|
|
|
19340
19098
|
return C2.createCache(this, p2), b2 || this.multiply(Ze$2), this;
|
|
19341
19099
|
}
|
|
19342
19100
|
assertValidity() {
|
|
19343
|
-
|
|
19101
|
+
L2(this);
|
|
19344
19102
|
}
|
|
19345
19103
|
hasEvenY() {
|
|
19346
19104
|
const { y: p2 } = this.toAffine();
|
|
@@ -19349,26 +19107,26 @@ function ta$1(t2, e2 = {}) {
|
|
|
19349
19107
|
}
|
|
19350
19108
|
equals(p2) {
|
|
19351
19109
|
Z2(p2);
|
|
19352
|
-
const { X: b2, Y: g2, Z: x2 } = this, { X:
|
|
19110
|
+
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));
|
|
19353
19111
|
return B2 && A2;
|
|
19354
19112
|
}
|
|
19355
19113
|
negate() {
|
|
19356
19114
|
return new O3(this.X, r2.neg(this.Y), this.Z);
|
|
19357
19115
|
}
|
|
19358
19116
|
double() {
|
|
19359
|
-
const { a: p2, b: b2 } = s2, g2 = r2.mul(b2, Ze$2), { X: x2, Y:
|
|
19360
|
-
let
|
|
19361
|
-
return $2 = r2.add($2, $2), A2 = r2.mul(x2, I2), A2 = r2.add(A2, A2),
|
|
19117
|
+
const { a: p2, b: b2 } = s2, g2 = r2.mul(b2, Ze$2), { X: x2, Y: E2, Z: I2 } = this;
|
|
19118
|
+
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);
|
|
19119
|
+
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);
|
|
19362
19120
|
}
|
|
19363
19121
|
add(p2) {
|
|
19364
19122
|
Z2(p2);
|
|
19365
|
-
const { X: b2, Y: g2, Z: x2 } = this, { X:
|
|
19123
|
+
const { X: b2, Y: g2, Z: x2 } = this, { X: E2, Y: I2, Z: v2 } = p2;
|
|
19366
19124
|
let B2 = r2.ZERO, A2 = r2.ZERO, N2 = r2.ZERO;
|
|
19367
19125
|
const D2 = s2.a, P3 = r2.mul(s2.b, Ze$2);
|
|
19368
|
-
let $2 = r2.mul(b2,
|
|
19126
|
+
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);
|
|
19369
19127
|
G2 = r2.mul(G2, M3), M3 = r2.add($2, V3), G2 = r2.sub(G2, M3), M3 = r2.add(b2, x2);
|
|
19370
|
-
let Y2 = r2.add(
|
|
19371
|
-
return M3 = r2.mul(M3, Y2), Y2 = r2.add($2,
|
|
19128
|
+
let Y2 = r2.add(E2, v2);
|
|
19129
|
+
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);
|
|
19372
19130
|
}
|
|
19373
19131
|
subtract(p2) {
|
|
19374
19132
|
return this.add(p2.negate());
|
|
@@ -19380,13 +19138,13 @@ function ta$1(t2, e2 = {}) {
|
|
|
19380
19138
|
const { endo: b2 } = e2;
|
|
19381
19139
|
if (!o3.isValidNot0(p2)) throw new Error("invalid scalar: out of range");
|
|
19382
19140
|
let g2, x2;
|
|
19383
|
-
const
|
|
19141
|
+
const E2 = (I2) => C2.cached(this, I2, (v2) => Tn$1(O3, v2));
|
|
19384
19142
|
if (b2) {
|
|
19385
|
-
const { k1neg: I2, k1:
|
|
19143
|
+
const { k1neg: I2, k1: v2, k2neg: B2, k2: A2 } = H2(p2), { p: N2, f: D2 } = E2(v2), { p: P3, f: $2 } = E2(A2);
|
|
19386
19144
|
x2 = D2.add($2), g2 = k2(b2.beta, N2, P3, I2, B2);
|
|
19387
19145
|
} else {
|
|
19388
|
-
const { p: I2, f:
|
|
19389
|
-
g2 = I2, x2 =
|
|
19146
|
+
const { p: I2, f: v2 } = E2(p2);
|
|
19147
|
+
g2 = I2, x2 = v2;
|
|
19390
19148
|
}
|
|
19391
19149
|
return Tn$1(O3, [g2, x2])[0];
|
|
19392
19150
|
}
|
|
@@ -19397,7 +19155,7 @@ function ta$1(t2, e2 = {}) {
|
|
|
19397
19155
|
if (p2 === ne$1) return g2;
|
|
19398
19156
|
if (C2.hasCache(this)) return this.multiply(p2);
|
|
19399
19157
|
if (b2) {
|
|
19400
|
-
const { k1neg: x2, k1:
|
|
19158
|
+
const { k1neg: x2, k1: E2, k2neg: I2, k2: v2 } = H2(p2), { p1: B2, p2: A2 } = Pf(O3, g2, E2, v2);
|
|
19401
19159
|
return k2(b2.beta, B2, A2, x2, I2);
|
|
19402
19160
|
} else return C2.unsafe(g2, p2);
|
|
19403
19161
|
}
|
|
@@ -19406,7 +19164,7 @@ function ta$1(t2, e2 = {}) {
|
|
|
19406
19164
|
return x2.is0() ? void 0 : x2;
|
|
19407
19165
|
}
|
|
19408
19166
|
toAffine(p2) {
|
|
19409
|
-
return
|
|
19167
|
+
return j2(this, p2);
|
|
19410
19168
|
}
|
|
19411
19169
|
isTorsionFree() {
|
|
19412
19170
|
const { isTorsionFree: p2 } = e2;
|
|
@@ -19522,23 +19280,23 @@ function na(t2, e2, n3 = {}) {
|
|
|
19522
19280
|
}
|
|
19523
19281
|
function F2(b2, g2) {
|
|
19524
19282
|
Pn$1(g2);
|
|
19525
|
-
const x2 = h4.signature,
|
|
19526
|
-
return Kt$2(b2,
|
|
19283
|
+
const x2 = h4.signature, E2 = g2 === "compact" ? x2 : g2 === "recovered" ? x2 + 1 : void 0;
|
|
19284
|
+
return Kt$2(b2, E2, `${g2} signature`);
|
|
19527
19285
|
}
|
|
19528
19286
|
class R3 {
|
|
19529
|
-
constructor(g2, x2,
|
|
19530
|
-
this.r = U2("r", g2), this.s = U2("s", x2),
|
|
19287
|
+
constructor(g2, x2, E2) {
|
|
19288
|
+
this.r = U2("r", g2), this.s = U2("s", x2), E2 != null && (this.recovery = E2), Object.freeze(this);
|
|
19531
19289
|
}
|
|
19532
19290
|
static fromBytes(g2, x2 = m3) {
|
|
19533
19291
|
F2(g2, x2);
|
|
19534
|
-
let
|
|
19292
|
+
let E2;
|
|
19535
19293
|
if (x2 === "der") {
|
|
19536
19294
|
const { r: A2, s: N2 } = xt$2.toSig(Kt$2(g2));
|
|
19537
19295
|
return new R3(A2, N2);
|
|
19538
19296
|
}
|
|
19539
|
-
x2 === "recovered" && (
|
|
19540
|
-
const I2 = i3.BYTES,
|
|
19541
|
-
return new R3(i3.fromBytes(
|
|
19297
|
+
x2 === "recovered" && (E2 = g2[0], x2 = "compact", g2 = g2.subarray(1));
|
|
19298
|
+
const I2 = i3.BYTES, v2 = g2.subarray(0, I2), B2 = g2.subarray(I2, I2 * 2);
|
|
19299
|
+
return new R3(i3.fromBytes(v2), i3.fromBytes(B2), E2);
|
|
19542
19300
|
}
|
|
19543
19301
|
static fromHex(g2, x2) {
|
|
19544
19302
|
return this.fromBytes(Re$1(g2), x2);
|
|
@@ -19547,12 +19305,12 @@ function na(t2, e2, n3 = {}) {
|
|
|
19547
19305
|
return new R3(this.r, this.s, g2);
|
|
19548
19306
|
}
|
|
19549
19307
|
recoverPublicKey(g2) {
|
|
19550
|
-
const x2 = s2.ORDER, { r:
|
|
19551
|
-
if (
|
|
19552
|
-
if (c2 * Wo$1 < x2 &&
|
|
19553
|
-
const A2 =
|
|
19308
|
+
const x2 = s2.ORDER, { r: E2, s: I2, recovery: v2 } = this;
|
|
19309
|
+
if (v2 == null || ![0, 1, 2, 3].includes(v2)) throw new Error("recovery id invalid");
|
|
19310
|
+
if (c2 * Wo$1 < x2 && v2 > 1) throw new Error("recovery id is ambiguous for h>1 curve");
|
|
19311
|
+
const A2 = v2 === 2 || v2 === 3 ? E2 + c2 : E2;
|
|
19554
19312
|
if (!s2.isValid(A2)) throw new Error("recovery id 2 or 3 invalid");
|
|
19555
|
-
const N2 = s2.toBytes(A2), D2 = t2.fromBytes(_t$2(Xo$1((
|
|
19313
|
+
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));
|
|
19556
19314
|
if (G2.is0()) throw new Error("point at infinify");
|
|
19557
19315
|
return G2.assertValidity(), G2;
|
|
19558
19316
|
}
|
|
@@ -19561,12 +19319,12 @@ function na(t2, e2, n3 = {}) {
|
|
|
19561
19319
|
}
|
|
19562
19320
|
toBytes(g2 = m3) {
|
|
19563
19321
|
if (Pn$1(g2), g2 === "der") return Re$1(xt$2.hexFromSig(this));
|
|
19564
|
-
const x2 = i3.toBytes(this.r),
|
|
19322
|
+
const x2 = i3.toBytes(this.r), E2 = i3.toBytes(this.s);
|
|
19565
19323
|
if (g2 === "recovered") {
|
|
19566
19324
|
if (this.recovery == null) throw new Error("recovery bit must be present");
|
|
19567
|
-
return _t$2(Uint8Array.of(this.recovery), x2,
|
|
19325
|
+
return _t$2(Uint8Array.of(this.recovery), x2, E2);
|
|
19568
19326
|
}
|
|
19569
|
-
return _t$2(x2,
|
|
19327
|
+
return _t$2(x2, E2);
|
|
19570
19328
|
}
|
|
19571
19329
|
toHex(g2) {
|
|
19572
19330
|
return Jt$2(this.toBytes(g2));
|
|
@@ -19597,49 +19355,49 @@ function na(t2, e2, n3 = {}) {
|
|
|
19597
19355
|
}
|
|
19598
19356
|
const Z2 = n3.bits2int || function(g2) {
|
|
19599
19357
|
if (g2.length > 8192) throw new Error("input is too large");
|
|
19600
|
-
const x2 = Ve$2(g2),
|
|
19601
|
-
return
|
|
19358
|
+
const x2 = Ve$2(g2), E2 = g2.length * 8 - f4;
|
|
19359
|
+
return E2 > 0 ? x2 >> BigInt(E2) : x2;
|
|
19602
19360
|
}, H2 = n3.bits2int_modN || function(g2) {
|
|
19603
19361
|
return i3.create(Z2(g2));
|
|
19604
|
-
},
|
|
19605
|
-
function
|
|
19606
|
-
return Rn$1("num < 2^" + f4, b2, Et$3,
|
|
19362
|
+
}, j2 = me$2(f4);
|
|
19363
|
+
function L2(b2) {
|
|
19364
|
+
return Rn$1("num < 2^" + f4, b2, Et$3, j2), i3.toBytes(b2);
|
|
19607
19365
|
}
|
|
19608
19366
|
function k2(b2, g2) {
|
|
19609
19367
|
return Kt$2(b2, void 0, "message"), g2 ? Kt$2(e2(b2), void 0, "prehashed message") : b2;
|
|
19610
19368
|
}
|
|
19611
19369
|
function O3(b2, g2, x2) {
|
|
19612
19370
|
if (["recovered", "canonical"].some((V3) => V3 in x2)) throw new Error("sign() legacy options not supported");
|
|
19613
|
-
const { lowS:
|
|
19371
|
+
const { lowS: E2, prehash: I2, extraEntropy: v2 } = Hn$1(x2, y3);
|
|
19614
19372
|
b2 = k2(b2, I2);
|
|
19615
|
-
const B2 = H2(b2), A2 = re$1(i3, g2), N2 = [
|
|
19616
|
-
if (
|
|
19617
|
-
const V3 =
|
|
19373
|
+
const B2 = H2(b2), A2 = re$1(i3, g2), N2 = [L2(A2), L2(B2)];
|
|
19374
|
+
if (v2 != null && v2 !== false) {
|
|
19375
|
+
const V3 = v2 === true ? r2(h4.secretKey) : v2;
|
|
19618
19376
|
N2.push(tt$2("extraEntropy", V3));
|
|
19619
19377
|
}
|
|
19620
19378
|
const D2 = _t$2(...N2), P3 = B2;
|
|
19621
19379
|
function $2(V3) {
|
|
19622
|
-
const
|
|
19623
|
-
if (!i3.isValidNot0(
|
|
19624
|
-
const G2 = i3.inv(
|
|
19380
|
+
const q3 = Z2(V3);
|
|
19381
|
+
if (!i3.isValidNot0(q3)) return;
|
|
19382
|
+
const G2 = i3.inv(q3), M3 = t2.BASE.multiply(q3).toAffine(), Y2 = i3.create(M3.x);
|
|
19625
19383
|
if (Y2 === Et$3) return;
|
|
19626
19384
|
const Yt2 = i3.create(G2 * i3.create(P3 + Y2 * A2));
|
|
19627
19385
|
if (Yt2 === Et$3) return;
|
|
19628
19386
|
let ce2 = (M3.x === Y2 ? 0 : 2) | Number(M3.y & ne$1), fe2 = Yt2;
|
|
19629
|
-
return
|
|
19387
|
+
return E2 && w2(Yt2) && (fe2 = i3.neg(Yt2), ce2 ^= 1), new R3(Y2, fe2, ce2);
|
|
19630
19388
|
}
|
|
19631
19389
|
return { seed: D2, k2sig: $2 };
|
|
19632
19390
|
}
|
|
19633
19391
|
function T2(b2, g2, x2 = {}) {
|
|
19634
19392
|
b2 = tt$2("message", b2);
|
|
19635
|
-
const { seed:
|
|
19636
|
-
return Af(e2.outputLen, i3.BYTES, o3)(
|
|
19393
|
+
const { seed: E2, k2sig: I2 } = O3(b2, g2, x2);
|
|
19394
|
+
return Af(e2.outputLen, i3.BYTES, o3)(E2, I2);
|
|
19637
19395
|
}
|
|
19638
19396
|
function C2(b2) {
|
|
19639
19397
|
let g2;
|
|
19640
|
-
const x2 = typeof b2 == "string" || Ue$3(b2),
|
|
19641
|
-
if (!x2 && !
|
|
19642
|
-
if (
|
|
19398
|
+
const x2 = typeof b2 == "string" || Ue$3(b2), E2 = !x2 && b2 !== null && typeof b2 == "object" && typeof b2.r == "bigint" && typeof b2.s == "bigint";
|
|
19399
|
+
if (!x2 && !E2) throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");
|
|
19400
|
+
if (E2) g2 = new R3(b2.r, b2.s);
|
|
19643
19401
|
else if (x2) {
|
|
19644
19402
|
try {
|
|
19645
19403
|
g2 = R3.fromBytes(tt$2("sig", b2), "der");
|
|
@@ -19654,23 +19412,23 @@ function na(t2, e2, n3 = {}) {
|
|
|
19654
19412
|
}
|
|
19655
19413
|
return g2 || false;
|
|
19656
19414
|
}
|
|
19657
|
-
function _3(b2, g2, x2,
|
|
19658
|
-
const { lowS: I2, prehash:
|
|
19659
|
-
if (x2 = tt$2("publicKey", x2), g2 = k2(tt$2("message", g2),
|
|
19415
|
+
function _3(b2, g2, x2, E2 = {}) {
|
|
19416
|
+
const { lowS: I2, prehash: v2, format: B2 } = Hn$1(E2, y3);
|
|
19417
|
+
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");
|
|
19660
19418
|
const A2 = B2 === void 0 ? C2(b2) : R3.fromBytes(tt$2("sig", b2), B2);
|
|
19661
19419
|
if (A2 === false) return false;
|
|
19662
19420
|
try {
|
|
19663
19421
|
const N2 = t2.fromBytes(x2);
|
|
19664
19422
|
if (I2 && A2.hasHighS()) return false;
|
|
19665
|
-
const { r: D2, s: P3 } = A2, $2 = H2(g2), V3 = i3.inv(P3),
|
|
19423
|
+
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));
|
|
19666
19424
|
return M3.is0() ? false : i3.create(M3.x) === D2;
|
|
19667
19425
|
} catch {
|
|
19668
19426
|
return false;
|
|
19669
19427
|
}
|
|
19670
19428
|
}
|
|
19671
19429
|
function p2(b2, g2, x2 = {}) {
|
|
19672
|
-
const { prehash:
|
|
19673
|
-
return g2 = k2(g2,
|
|
19430
|
+
const { prehash: E2 } = Hn$1(x2, y3);
|
|
19431
|
+
return g2 = k2(g2, E2), R3.fromBytes(b2, "recovered").recoverPublicKey(g2).toBytes();
|
|
19674
19432
|
}
|
|
19675
19433
|
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 });
|
|
19676
19434
|
}
|
|
@@ -19698,7 +19456,7 @@ function Dn$1(t2, e2) {
|
|
|
19698
19456
|
}
|
|
19699
19457
|
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);
|
|
19700
19458
|
Dn$1({ ...ts$1, Fp: fa, lowS: false }, wc), Dn$1({ ...es$1, Fp: aa, lowS: false, allowedPrivateKeyLengths: [130, 131, 132] }, mc);
|
|
19701
|
-
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,
|
|
19459
|
+
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;
|
|
19702
19460
|
function ha() {
|
|
19703
19461
|
const t2 = kn$1.utils.randomPrivateKey(), e2 = kn$1.getPublicKey(t2);
|
|
19704
19462
|
return { privateKey: toString(t2, rt$1), publicKey: toString(e2, rt$1) };
|
|
@@ -19735,7 +19493,7 @@ function os(t2) {
|
|
|
19735
19493
|
function ma(t2) {
|
|
19736
19494
|
const e2 = qn$1(typeof t2.type < "u" ? t2.type : Mn$1);
|
|
19737
19495
|
if (Zt$2(e2) === ie$1 && typeof t2.senderPublicKey > "u") throw new Error("Missing sender public key for type 1 envelope");
|
|
19738
|
-
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(
|
|
19496
|
+
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 });
|
|
19739
19497
|
return t2.encoding === Ge$3 ? rs(i3) : i3;
|
|
19740
19498
|
}
|
|
19741
19499
|
function wa(t2) {
|
|
@@ -19744,7 +19502,7 @@ function wa(t2) {
|
|
|
19744
19502
|
return toString(o3, se$2);
|
|
19745
19503
|
}
|
|
19746
19504
|
function va(t2, e2) {
|
|
19747
|
-
const n3 = qn$1(ve$2), r2 = Mt$2(
|
|
19505
|
+
const n3 = qn$1(ve$2), r2 = Mt$2(xe2), o3 = fromString(t2, se$2), s2 = Fn$1({ type: n3, sealed: o3, iv: r2 });
|
|
19748
19506
|
return e2 === Ge$3 ? rs(s2) : s2;
|
|
19749
19507
|
}
|
|
19750
19508
|
function xa(t2, e2) {
|
|
@@ -19762,14 +19520,14 @@ function Fn$1(t2) {
|
|
|
19762
19520
|
function ze$1(t2) {
|
|
19763
19521
|
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;
|
|
19764
19522
|
if (Zt$2(r2) === ie$1) {
|
|
19765
|
-
const f4 = o3 + Kn$1, u2 = f4 +
|
|
19523
|
+
const f4 = o3 + Kn$1, u2 = f4 + xe2, a2 = n3.slice(o3, f4), l2 = n3.slice(f4, u2), d3 = n3.slice(u2);
|
|
19766
19524
|
return { type: r2, sealed: d3, iv: l2, senderPublicKey: a2 };
|
|
19767
19525
|
}
|
|
19768
19526
|
if (Zt$2(r2) === ve$2) {
|
|
19769
|
-
const f4 = n3.slice(o3), u2 = Mt$2(
|
|
19527
|
+
const f4 = n3.slice(o3), u2 = Mt$2(xe2);
|
|
19770
19528
|
return { type: r2, sealed: f4, iv: u2 };
|
|
19771
19529
|
}
|
|
19772
|
-
const s2 = o3 +
|
|
19530
|
+
const s2 = o3 + xe2, i3 = n3.slice(o3, s2), c2 = n3.slice(s2);
|
|
19773
19531
|
return { type: r2, sealed: c2, iv: i3 };
|
|
19774
19532
|
}
|
|
19775
19533
|
function Ea(t2, e2) {
|
|
@@ -20262,7 +20020,7 @@ function Bu(t2) {
|
|
|
20262
20020
|
return Hs$1(o3);
|
|
20263
20021
|
}
|
|
20264
20022
|
function Iu({ logger: t2, name: e2 }) {
|
|
20265
|
-
const n3 = typeof t2 == "string" ?
|
|
20023
|
+
const n3 = typeof t2 == "string" ? Ue$5({ opts: { level: t2, name: e2 } }).logger : t2;
|
|
20266
20024
|
return n3.level = typeof t2 == "string" ? t2 : t2.level, n3;
|
|
20267
20025
|
}
|
|
20268
20026
|
const PARSE_ERROR = "PARSE_ERROR";
|
|
@@ -20607,7 +20365,7 @@ let f$2 = class f2 {
|
|
|
20607
20365
|
return this.events.emit("register_error", t2), t2;
|
|
20608
20366
|
}
|
|
20609
20367
|
};
|
|
20610
|
-
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.
|
|
20368
|
+
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";
|
|
20611
20369
|
function cr(r2, e2) {
|
|
20612
20370
|
if (r2.length >= 255) throw new TypeError("Alphabet too long");
|
|
20613
20371
|
for (var t2 = new Uint8Array(256), i3 = 0; i3 < t2.length; i3++) t2[i3] = 255;
|
|
@@ -20620,14 +20378,14 @@ function cr(r2, e2) {
|
|
|
20620
20378
|
function g2(u2) {
|
|
20621
20379
|
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");
|
|
20622
20380
|
if (u2.length === 0) return "";
|
|
20623
|
-
for (var m3 = 0, D2 = 0, w2 = 0,
|
|
20624
|
-
for (var
|
|
20625
|
-
for (var k2 = u2[w2], T2 = 0,
|
|
20381
|
+
for (var m3 = 0, D2 = 0, w2 = 0, E2 = u2.length; w2 !== E2 && u2[w2] === 0; ) w2++, m3++;
|
|
20382
|
+
for (var L2 = (E2 - w2) * l2 + 1 >>> 0, I2 = new Uint8Array(L2); w2 !== E2; ) {
|
|
20383
|
+
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;
|
|
20626
20384
|
if (k2 !== 0) throw new Error("Non-zero carry");
|
|
20627
20385
|
D2 = T2, w2++;
|
|
20628
20386
|
}
|
|
20629
|
-
for (var O3 =
|
|
20630
|
-
for (var te2 = c2.repeat(m3); O3 <
|
|
20387
|
+
for (var O3 = L2 - D2; O3 !== L2 && I2[O3] === 0; ) O3++;
|
|
20388
|
+
for (var te2 = c2.repeat(m3); O3 < L2; ++O3) te2 += r2.charAt(I2[O3]);
|
|
20631
20389
|
return te2;
|
|
20632
20390
|
}
|
|
20633
20391
|
function y3(u2) {
|
|
@@ -20636,16 +20394,16 @@ function cr(r2, e2) {
|
|
|
20636
20394
|
var m3 = 0;
|
|
20637
20395
|
if (u2[m3] !== " ") {
|
|
20638
20396
|
for (var D2 = 0, w2 = 0; u2[m3] === c2; ) D2++, m3++;
|
|
20639
|
-
for (var
|
|
20397
|
+
for (var E2 = (u2.length - m3) * h4 + 1 >>> 0, L2 = new Uint8Array(E2); u2[m3]; ) {
|
|
20640
20398
|
var I2 = t2[u2.charCodeAt(m3)];
|
|
20641
20399
|
if (I2 === 255) return;
|
|
20642
|
-
for (var k2 = 0, T2 =
|
|
20400
|
+
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;
|
|
20643
20401
|
if (I2 !== 0) throw new Error("Non-zero carry");
|
|
20644
20402
|
w2 = k2, m3++;
|
|
20645
20403
|
}
|
|
20646
20404
|
if (u2[m3] !== " ") {
|
|
20647
|
-
for (var
|
|
20648
|
-
for (var O3 = new Uint8Array(D2 + (
|
|
20405
|
+
for (var S3 = E2 - w2; S3 !== E2 && L2[S3] === 0; ) S3++;
|
|
20406
|
+
for (var O3 = new Uint8Array(D2 + (E2 - S3)), te2 = D2; S3 !== E2; ) O3[te2++] = L2[S3++];
|
|
20649
20407
|
return O3;
|
|
20650
20408
|
}
|
|
20651
20409
|
}
|
|
@@ -20863,10 +20621,10 @@ class _i {
|
|
|
20863
20621
|
return s2;
|
|
20864
20622
|
}), J$1(this, "del", async (i3) => {
|
|
20865
20623
|
this.isInitialized(), this.keychain.delete(i3), await this.persist();
|
|
20866
|
-
}), this.core = e2, this.logger =
|
|
20624
|
+
}), this.core = e2, this.logger = Re$3(t2, this.name);
|
|
20867
20625
|
}
|
|
20868
20626
|
get context() {
|
|
20869
|
-
return
|
|
20627
|
+
return ee$3(this.logger);
|
|
20870
20628
|
}
|
|
20871
20629
|
get storageKey() {
|
|
20872
20630
|
return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name;
|
|
@@ -20950,10 +20708,10 @@ class wi {
|
|
|
20950
20708
|
}), R2(this, "getPayloadSenderPublicKey", (s2, n3 = oe$2) => {
|
|
20951
20709
|
const o3 = ze$1({ encoded: s2, encoding: n3 });
|
|
20952
20710
|
return o3.senderPublicKey ? toString(o3.senderPublicKey, rt$1) : void 0;
|
|
20953
|
-
}), this.core = e2, this.logger =
|
|
20711
|
+
}), this.core = e2, this.logger = Re$3(t2, this.name), this.keychain = i3 || new _i(this.core, this.logger);
|
|
20954
20712
|
}
|
|
20955
20713
|
get context() {
|
|
20956
|
-
return
|
|
20714
|
+
return ee$3(this.logger);
|
|
20957
20715
|
}
|
|
20958
20716
|
async setPrivateKey(e2, t2) {
|
|
20959
20717
|
return await this.keychain.set(e2, t2), e2;
|
|
@@ -21035,10 +20793,10 @@ class Ii extends y$2 {
|
|
|
21035
20793
|
delete n3[o3], Object.keys(n3).length === 0 ? this.messagesWithoutClientAck.delete(i3) : this.messagesWithoutClientAck.set(i3, n3), await this.persist();
|
|
21036
20794
|
}), K$1(this, "del", async (i3) => {
|
|
21037
20795
|
this.isInitialized(), this.messages.delete(i3), this.messagesWithoutClientAck.delete(i3), await this.persist();
|
|
21038
|
-
}), this.logger =
|
|
20796
|
+
}), this.logger = Re$3(e2, this.name), this.core = t2;
|
|
21039
20797
|
}
|
|
21040
20798
|
get context() {
|
|
21041
|
-
return
|
|
20799
|
+
return ee$3(this.logger);
|
|
21042
20800
|
}
|
|
21043
20801
|
get storageKey() {
|
|
21044
20802
|
return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name;
|
|
@@ -21083,15 +20841,15 @@ class Yn extends m$1 {
|
|
|
21083
20841
|
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}`;
|
|
21084
20842
|
try {
|
|
21085
20843
|
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);
|
|
21086
|
-
const
|
|
20844
|
+
const E2 = new Promise(async (L2) => {
|
|
21087
20845
|
const I2 = ({ id: T2 }) => {
|
|
21088
|
-
var
|
|
21089
|
-
((
|
|
20846
|
+
var S3;
|
|
20847
|
+
((S3 = D2.id) == null ? void 0 : S3.toString()) === T2.toString() && (this.removeRequestFromQueue(T2), this.relayer.events.removeListener(C$1.publish, I2), L2());
|
|
21090
20848
|
};
|
|
21091
20849
|
this.relayer.events.on(C$1.publish, I2);
|
|
21092
|
-
const k2 = Si$1(new Promise((T2,
|
|
20850
|
+
const k2 = Si$1(new Promise((T2, S3) => {
|
|
21093
20851
|
this.rpcPublish(D2, n3).then(T2).catch((O3) => {
|
|
21094
|
-
this.logger.warn(O3, O3?.message),
|
|
20852
|
+
this.logger.warn(O3, O3?.message), S3(O3);
|
|
21095
20853
|
});
|
|
21096
20854
|
}), this.initialPublishTimeout, `Failed initial publish, retrying.... id:${u2} tag:${_3}`);
|
|
21097
20855
|
try {
|
|
@@ -21100,29 +20858,29 @@ class Yn extends m$1 {
|
|
|
21100
20858
|
this.queue.set(u2, { request: D2, opts: n3, attempt: 1 }), this.logger.warn(T2, T2?.message);
|
|
21101
20859
|
}
|
|
21102
20860
|
});
|
|
21103
|
-
this.logger.trace({ type: "method", method: "publish", params: { id: u2, topic: i3, message: s2, opts: n3 } }), await Si$1(
|
|
21104
|
-
} catch (
|
|
21105
|
-
if (this.logger.debug("Failed to Publish Payload"), this.logger.error(
|
|
20861
|
+
this.logger.trace({ type: "method", method: "publish", params: { id: u2, topic: i3, message: s2, opts: n3 } }), await Si$1(E2, this.publishTimeout, w2);
|
|
20862
|
+
} catch (E2) {
|
|
20863
|
+
if (this.logger.debug("Failed to Publish Payload"), this.logger.error(E2), (l2 = n3?.internal) != null && l2.throwOnFailedPublish) throw E2;
|
|
21106
20864
|
} finally {
|
|
21107
20865
|
this.queue.delete(u2);
|
|
21108
20866
|
}
|
|
21109
20867
|
}), G$1(this, "publishCustom", async (i3) => {
|
|
21110
20868
|
var s2, n3, o3, a2, c2;
|
|
21111
20869
|
this.logger.debug("Publishing custom payload"), this.logger.trace({ type: "method", method: "publishCustom", params: i3 });
|
|
21112
|
-
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(),
|
|
20870
|
+
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}`;
|
|
21113
20871
|
try {
|
|
21114
20872
|
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);
|
|
21115
|
-
const T2 = new Promise(async (
|
|
20873
|
+
const T2 = new Promise(async (S3) => {
|
|
21116
20874
|
const O3 = ({ id: Z2 }) => {
|
|
21117
20875
|
var we2;
|
|
21118
|
-
((we2 = I2.id) == null ? void 0 : we2.toString()) === Z2.toString() && (this.removeRequestFromQueue(Z2), this.relayer.events.removeListener(C$1.publish, O3),
|
|
20876
|
+
((we2 = I2.id) == null ? void 0 : we2.toString()) === Z2.toString() && (this.removeRequestFromQueue(Z2), this.relayer.events.removeListener(C$1.publish, O3), S3());
|
|
21119
20877
|
};
|
|
21120
20878
|
this.relayer.events.on(C$1.publish, O3);
|
|
21121
20879
|
const te2 = Si$1(new Promise((Z2, we2) => {
|
|
21122
20880
|
this.rpcPublish(I2, l2).then(Z2).catch((Ee2) => {
|
|
21123
20881
|
this.logger.warn(Ee2, Ee2?.message), we2(Ee2);
|
|
21124
20882
|
});
|
|
21125
|
-
}), this.initialPublishTimeout, `Failed initial custom payload publish, retrying.... method:${
|
|
20883
|
+
}), this.initialPublishTimeout, `Failed initial custom payload publish, retrying.... method:${L2} id:${w2} tag:${m3}`);
|
|
21126
20884
|
try {
|
|
21127
20885
|
await te2, this.events.removeListener(C$1.publish, O3);
|
|
21128
20886
|
} catch (Z2) {
|
|
@@ -21143,10 +20901,10 @@ class Yn extends m$1 {
|
|
|
21143
20901
|
this.events.off(i3, s2);
|
|
21144
20902
|
}), G$1(this, "removeListener", (i3, s2) => {
|
|
21145
20903
|
this.events.removeListener(i3, s2);
|
|
21146
|
-
}), this.relayer = e2, this.logger =
|
|
20904
|
+
}), this.relayer = e2, this.logger = Re$3(t2, this.name), this.registerEventListeners();
|
|
21147
20905
|
}
|
|
21148
20906
|
get context() {
|
|
21149
|
-
return
|
|
20907
|
+
return ee$3(this.logger);
|
|
21150
20908
|
}
|
|
21151
20909
|
async rpcPublish(e2, t2) {
|
|
21152
20910
|
this.logger.debug("Outgoing Relay Payload"), this.logger.trace({ type: "message", direction: "outgoing", request: e2 });
|
|
@@ -21259,10 +21017,10 @@ class Si extends P$3 {
|
|
|
21259
21017
|
const s2 = j$2.deleted;
|
|
21260
21018
|
this.logger.info(`Emitting ${s2}`), this.logger.debug({ type: "event", event: s2, data: i3 }), await this.persist();
|
|
21261
21019
|
});
|
|
21262
|
-
}), this.relayer = e2, this.logger =
|
|
21020
|
+
}), this.relayer = e2, this.logger = Re$3(t2, this.name), this.clientId = "";
|
|
21263
21021
|
}
|
|
21264
21022
|
get context() {
|
|
21265
|
-
return
|
|
21023
|
+
return ee$3(this.logger);
|
|
21266
21024
|
}
|
|
21267
21025
|
get storageKey() {
|
|
21268
21026
|
return this.storagePrefix + this.version + this.relayer.core.customStoragePrefix + "//" + this.name;
|
|
@@ -21521,7 +21279,7 @@ class Ai extends d$4 {
|
|
|
21521
21279
|
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));
|
|
21522
21280
|
}
|
|
21523
21281
|
get context() {
|
|
21524
|
-
return
|
|
21282
|
+
return ee$3(this.logger);
|
|
21525
21283
|
}
|
|
21526
21284
|
get connected() {
|
|
21527
21285
|
var e2, t2, i3;
|
|
@@ -21871,10 +21629,10 @@ class ji extends f$3 {
|
|
|
21871
21629
|
this.map.set(o3, c2), await this.persist();
|
|
21872
21630
|
}), U$1(this, "delete", async (o3, a2) => {
|
|
21873
21631
|
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());
|
|
21874
|
-
}), this.logger =
|
|
21632
|
+
}), this.logger = Re$3(t2, this.name), this.storagePrefix = s2, this.getKey = n3;
|
|
21875
21633
|
}
|
|
21876
21634
|
get context() {
|
|
21877
|
-
return
|
|
21635
|
+
return ee$3(this.logger);
|
|
21878
21636
|
}
|
|
21879
21637
|
get storageKey() {
|
|
21880
21638
|
return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name;
|
|
@@ -21935,7 +21693,7 @@ class ji extends f$3 {
|
|
|
21935
21693
|
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);
|
|
21936
21694
|
class Ui {
|
|
21937
21695
|
constructor(e2, t2) {
|
|
21938
|
-
this.core = e2, this.logger = t2, d$2(this, "name", Kt$1), d$2(this, "version", Bt$1), d$2(this, "events", new xe$
|
|
21696
|
+
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 () => {
|
|
21939
21697
|
this.initialized || (await this.pairings.init(), await this.cleanup(), this.registerRelayerEvents(), this.registerExpirerEvents(), this.initialized = true, this.logger.trace("Initialized"));
|
|
21940
21698
|
}), d$2(this, "register", ({ methods: i3 }) => {
|
|
21941
21699
|
this.isInitialized(), this.registeredMethods = [.../* @__PURE__ */ new Set([...this.registeredMethods, ...i3])];
|
|
@@ -22106,10 +21864,10 @@ class Ui {
|
|
|
22106
21864
|
const { message: s2 } = Bt$2("EXPIRED", `pairing topic: ${i3}`);
|
|
22107
21865
|
throw new Error(s2);
|
|
22108
21866
|
}
|
|
22109
|
-
}), this.core = e2, this.logger =
|
|
21867
|
+
}), this.core = e2, this.logger = Re$3(t2, this.name), this.pairings = new ji(this.core, this.logger, this.name, this.storagePrefix);
|
|
22110
21868
|
}
|
|
22111
21869
|
get context() {
|
|
22112
|
-
return
|
|
21870
|
+
return ee$3(this.logger);
|
|
22113
21871
|
}
|
|
22114
21872
|
isInitialized() {
|
|
22115
21873
|
if (!this.initialized) {
|
|
@@ -22129,7 +21887,7 @@ class Ui {
|
|
|
22129
21887
|
});
|
|
22130
21888
|
}
|
|
22131
21889
|
registerExpirerEvents() {
|
|
22132
|
-
this.core.expirer.on(
|
|
21890
|
+
this.core.expirer.on(q2.expired, async (e2) => {
|
|
22133
21891
|
const { topic: t2 } = Ui$1(e2.target);
|
|
22134
21892
|
t2 && this.pairings.keys.includes(t2) && (await this.deletePairing(t2, true), this.events.emit(ae$1.expire, { topic: t2 }));
|
|
22135
21893
|
});
|
|
@@ -22163,10 +21921,10 @@ class Fi extends I {
|
|
|
22163
21921
|
this.events.off(i3, s2);
|
|
22164
21922
|
}), N$2(this, "removeListener", (i3, s2) => {
|
|
22165
21923
|
this.events.removeListener(i3, s2);
|
|
22166
|
-
}), this.logger =
|
|
21924
|
+
}), this.logger = Re$3(t2, this.name);
|
|
22167
21925
|
}
|
|
22168
21926
|
get context() {
|
|
22169
|
-
return
|
|
21927
|
+
return ee$3(this.logger);
|
|
22170
21928
|
}
|
|
22171
21929
|
get storageKey() {
|
|
22172
21930
|
return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name;
|
|
@@ -22266,7 +22024,7 @@ class Mi extends S$2 {
|
|
|
22266
22024
|
}), z$1(this, "set", (i3, s2) => {
|
|
22267
22025
|
this.isInitialized();
|
|
22268
22026
|
const n3 = this.formatTarget(i3), o3 = { target: n3, expiry: s2 };
|
|
22269
|
-
this.expirations.set(n3, o3), this.checkExpiry(n3, o3), this.events.emit(
|
|
22027
|
+
this.expirations.set(n3, o3), this.checkExpiry(n3, o3), this.events.emit(q2.created, { target: n3, expiration: o3 });
|
|
22270
22028
|
}), z$1(this, "get", (i3) => {
|
|
22271
22029
|
this.isInitialized();
|
|
22272
22030
|
const s2 = this.formatTarget(i3);
|
|
@@ -22274,7 +22032,7 @@ class Mi extends S$2 {
|
|
|
22274
22032
|
}), z$1(this, "del", (i3) => {
|
|
22275
22033
|
if (this.isInitialized(), this.has(i3)) {
|
|
22276
22034
|
const s2 = this.formatTarget(i3), n3 = this.getExpiration(s2);
|
|
22277
|
-
this.expirations.delete(s2), this.events.emit(
|
|
22035
|
+
this.expirations.delete(s2), this.events.emit(q2.deleted, { target: s2, expiration: n3 });
|
|
22278
22036
|
}
|
|
22279
22037
|
}), z$1(this, "on", (i3, s2) => {
|
|
22280
22038
|
this.events.on(i3, s2);
|
|
@@ -22284,10 +22042,10 @@ class Mi extends S$2 {
|
|
|
22284
22042
|
this.events.off(i3, s2);
|
|
22285
22043
|
}), z$1(this, "removeListener", (i3, s2) => {
|
|
22286
22044
|
this.events.removeListener(i3, s2);
|
|
22287
|
-
}), this.logger =
|
|
22045
|
+
}), this.logger = Re$3(t2, this.name);
|
|
22288
22046
|
}
|
|
22289
22047
|
get context() {
|
|
22290
|
-
return
|
|
22048
|
+
return ee$3(this.logger);
|
|
22291
22049
|
}
|
|
22292
22050
|
get storageKey() {
|
|
22293
22051
|
return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name;
|
|
@@ -22314,7 +22072,7 @@ class Mi extends S$2 {
|
|
|
22314
22072
|
return await this.core.storage.getItem(this.storageKey);
|
|
22315
22073
|
}
|
|
22316
22074
|
async persist() {
|
|
22317
|
-
await this.setExpirations(this.values), this.events.emit(
|
|
22075
|
+
await this.setExpirations(this.values), this.events.emit(q2.sync);
|
|
22318
22076
|
}
|
|
22319
22077
|
async restore() {
|
|
22320
22078
|
try {
|
|
@@ -22342,20 +22100,20 @@ class Mi extends S$2 {
|
|
|
22342
22100
|
cjsExports$3.toMiliseconds(i3) - Date.now() <= 0 && this.expire(e2, t2);
|
|
22343
22101
|
}
|
|
22344
22102
|
expire(e2, t2) {
|
|
22345
|
-
this.expirations.delete(e2), this.events.emit(
|
|
22103
|
+
this.expirations.delete(e2), this.events.emit(q2.expired, { target: e2, expiration: t2 });
|
|
22346
22104
|
}
|
|
22347
22105
|
checkExpirations() {
|
|
22348
22106
|
this.core.relayer.connected && this.expirations.forEach((e2, t2) => this.checkExpiry(t2, e2));
|
|
22349
22107
|
}
|
|
22350
22108
|
registerEventListeners() {
|
|
22351
|
-
this.core.heartbeat.on(r$1.pulse, () => this.checkExpirations()), this.events.on(
|
|
22352
|
-
const t2 =
|
|
22109
|
+
this.core.heartbeat.on(r$1.pulse, () => this.checkExpirations()), this.events.on(q2.created, (e2) => {
|
|
22110
|
+
const t2 = q2.created;
|
|
22353
22111
|
this.logger.info(`Emitting ${t2}`), this.logger.debug({ type: "event", event: t2, data: e2 }), this.persist();
|
|
22354
|
-
}), this.events.on(
|
|
22355
|
-
const t2 =
|
|
22112
|
+
}), this.events.on(q2.expired, (e2) => {
|
|
22113
|
+
const t2 = q2.expired;
|
|
22356
22114
|
this.logger.info(`Emitting ${t2}`), this.logger.debug({ type: "event", event: t2, data: e2 }), this.persist();
|
|
22357
|
-
}), this.events.on(
|
|
22358
|
-
const t2 =
|
|
22115
|
+
}), this.events.on(q2.deleted, (e2) => {
|
|
22116
|
+
const t2 = q2.deleted;
|
|
22359
22117
|
this.logger.info(`Emitting ${t2}`), this.logger.debug({ type: "event", event: t2, data: e2 }), this.persist();
|
|
22360
22118
|
});
|
|
22361
22119
|
}
|
|
@@ -22385,13 +22143,13 @@ class Ki extends M$3 {
|
|
|
22385
22143
|
m3.src = c2, m3.style.display = "none", m3.addEventListener("error", u2, { signal: this.abortController.signal });
|
|
22386
22144
|
const D2 = (w2) => {
|
|
22387
22145
|
if (w2.data && typeof w2.data == "string") try {
|
|
22388
|
-
const
|
|
22389
|
-
if (
|
|
22390
|
-
if (sn$1(
|
|
22391
|
-
clearInterval(l2), h4.body.removeChild(m3), this.abortController.signal.removeEventListener("abort", u2), window.removeEventListener("message", D2), y3(
|
|
22146
|
+
const E2 = JSON.parse(w2.data);
|
|
22147
|
+
if (E2.type === "verify_attestation") {
|
|
22148
|
+
if (sn$1(E2.attestation).payload.id !== o3) return;
|
|
22149
|
+
clearInterval(l2), h4.body.removeChild(m3), this.abortController.signal.removeEventListener("abort", u2), window.removeEventListener("message", D2), y3(E2.attestation === null ? "" : E2.attestation);
|
|
22392
22150
|
}
|
|
22393
|
-
} catch (
|
|
22394
|
-
this.logger.warn(
|
|
22151
|
+
} catch (E2) {
|
|
22152
|
+
this.logger.warn(E2);
|
|
22395
22153
|
}
|
|
22396
22154
|
};
|
|
22397
22155
|
h4.body.appendChild(m3), window.addEventListener("message", D2, { signal: this.abortController.signal });
|
|
@@ -22466,13 +22224,13 @@ class Ki extends M$3 {
|
|
|
22466
22224
|
const o3 = Aa(s2, n3.publicKey), a2 = { hasExpired: cjsExports$3.toMiliseconds(o3.exp) < Date.now(), payload: o3 };
|
|
22467
22225
|
if (a2.hasExpired) throw this.logger.warn("resolve: jwt attestation expired"), new Error("JWT attestation expired");
|
|
22468
22226
|
return { origin: a2.payload.origin, isScam: a2.payload.isScam, isVerified: a2.payload.isVerified };
|
|
22469
|
-
}), this.logger =
|
|
22227
|
+
}), this.logger = Re$3(t2, this.name), this.abortController = new AbortController(), this.isDevEnv = ki$1(), this.init();
|
|
22470
22228
|
}
|
|
22471
22229
|
get storeKey() {
|
|
22472
22230
|
return this.storagePrefix + this.version + this.core.customStoragePrefix + "//verify:public:key";
|
|
22473
22231
|
}
|
|
22474
22232
|
get context() {
|
|
22475
|
-
return
|
|
22233
|
+
return ee$3(this.logger);
|
|
22476
22234
|
}
|
|
22477
22235
|
startAbortTimer(e2) {
|
|
22478
22236
|
return this.abortController = new AbortController(), setTimeout(() => this.abortController.abort(), cjsExports$3.toMiliseconds(e2));
|
|
@@ -22484,7 +22242,7 @@ class Vi extends O$1 {
|
|
|
22484
22242
|
super(e2, t2), this.projectId = e2, this.logger = t2, Bi(this, "context", Zt$1), Bi(this, "registerDeviceToken", async (i3) => {
|
|
22485
22243
|
const { clientId: s2, token: n3, notificationType: o3, enableEncrypted: a2 = false } = i3, c2 = `${Qt$1}/${this.projectId}/clients`;
|
|
22486
22244
|
await fetch(c2, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ client_id: s2, type: o3, token: n3, always_raw: a2 }) });
|
|
22487
|
-
}), this.logger =
|
|
22245
|
+
}), this.logger = Re$3(t2, this.context);
|
|
22488
22246
|
}
|
|
22489
22247
|
}
|
|
22490
22248
|
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) => {
|
|
@@ -22548,7 +22306,7 @@ class Gi extends R$1 {
|
|
|
22548
22306
|
}), A$1(this, "sendEvent", async (s2) => {
|
|
22549
22307
|
const n3 = this.getAppDomain() ? "" : "&sp=desktop";
|
|
22550
22308
|
return await fetch(`${si}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${Pe$1}${n3}`, { method: "POST", body: JSON.stringify(s2) });
|
|
22551
|
-
}), A$1(this, "getAppDomain", () => br$1().url), this.logger =
|
|
22309
|
+
}), A$1(this, "getAppDomain", () => br$1().url), this.logger = Re$3(t2, this.context), this.telemetryEnabled = i3, i3 ? this.restore().then(async () => {
|
|
22552
22310
|
await this.submit(), this.setEventListeners();
|
|
22553
22311
|
}) : this.persist();
|
|
22554
22312
|
}
|
|
@@ -22576,11 +22334,11 @@ let Oe$1 = class Oe extends h$2 {
|
|
|
22576
22334
|
console.warn("Failed to copy global core", a2);
|
|
22577
22335
|
}
|
|
22578
22336
|
this.projectId = e2?.projectId, this.relayUrl = e2?.relayUrl || Ke$2, this.customStoragePrefix = e2 != null && e2.customStoragePrefix ? `:${e2.customStoragePrefix}` : "";
|
|
22579
|
-
const s2 =
|
|
22337
|
+
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 });
|
|
22580
22338
|
this.logChunkController = o3, (t2 = this.logChunkController) != null && t2.downloadLogsBlobInBrowser && (window.downloadLogsBlobInBrowser = async () => {
|
|
22581
22339
|
var a2, c2;
|
|
22582
22340
|
(a2 = this.logChunkController) != null && a2.downloadLogsBlobInBrowser && ((c2 = this.logChunkController) == null || c2.downloadLogsBlobInBrowser({ clientId: await this.crypto.getClientId() }));
|
|
22583
|
-
}), this.logger =
|
|
22341
|
+
}), 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);
|
|
22584
22342
|
}
|
|
22585
22343
|
static async init(e2) {
|
|
22586
22344
|
const t2 = new Oe(e2);
|
|
@@ -22589,7 +22347,7 @@ let Oe$1 = class Oe extends h$2 {
|
|
|
22589
22347
|
return await t2.storage.setItem(Ut$1, i3), t2;
|
|
22590
22348
|
}
|
|
22591
22349
|
get context() {
|
|
22592
|
-
return
|
|
22350
|
+
return ee$3(this.logger);
|
|
22593
22351
|
}
|
|
22594
22352
|
async start() {
|
|
22595
22353
|
this.initialized || await this.initialize();
|
|
@@ -22639,14 +22397,14 @@ let Oe$1 = class Oe extends h$2 {
|
|
|
22639
22397
|
};
|
|
22640
22398
|
const ta = Oe$1;
|
|
22641
22399
|
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`;
|
|
22642
|
-
var As = Object.defineProperty, xs = Object.defineProperties, Cs = Object.getOwnPropertyDescriptors, Rt$1 = Object.getOwnPropertySymbols, Vs = Object.prototype.hasOwnProperty, ks = Object.prototype.propertyIsEnumerable, Ue$1 = (
|
|
22643
|
-
for (var e2 in o3 || (o3 = {})) Vs.call(o3, e2) && Ue$1(
|
|
22644
|
-
if (Rt$1) for (var e2 of Rt$1(o3)) ks.call(o3, e2) && Ue$1(
|
|
22645
|
-
return
|
|
22646
|
-
}, b$1 = (
|
|
22400
|
+
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) => {
|
|
22401
|
+
for (var e2 in o3 || (o3 = {})) Vs.call(o3, e2) && Ue$1(S3, e2, o3[e2]);
|
|
22402
|
+
if (Rt$1) for (var e2 of Rt$1(o3)) ks.call(o3, e2) && Ue$1(S3, e2, o3[e2]);
|
|
22403
|
+
return S3;
|
|
22404
|
+
}, b$1 = (S3, o3) => xs(S3, Cs(o3)), c$2 = (S3, o3, e2) => Ue$1(S3, typeof o3 != "symbol" ? o3 + "" : o3, e2);
|
|
22647
22405
|
class Ds extends V$1 {
|
|
22648
22406
|
constructor(o3) {
|
|
22649
|
-
super(o3), c$2(this, "name", gt$1), c$2(this, "events", new xe$
|
|
22407
|
+
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 () => {
|
|
22650
22408
|
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 () => {
|
|
22651
22409
|
await this.processPendingMessageEvents(), this.sessionRequestQueue.queue = this.getPendingSessionRequests(), this.processSessionRequestQueue();
|
|
22652
22410
|
}, cjsExports$3.toMiliseconds(this.requestQueueDelay)));
|
|
@@ -22667,21 +22425,21 @@ class Ds extends V$1 {
|
|
|
22667
22425
|
throw this.client.logger.error(`connect() -> pairing.get(${u2}) failed`), R3;
|
|
22668
22426
|
}
|
|
22669
22427
|
if (!u2 || !g2) {
|
|
22670
|
-
const { topic: R3, uri:
|
|
22671
|
-
u2 = R3, w2 =
|
|
22428
|
+
const { topic: R3, uri: q3 } = await this.client.core.pairing.create({ internal: { skipSubscribe: true } });
|
|
22429
|
+
u2 = R3, w2 = q3;
|
|
22672
22430
|
}
|
|
22673
22431
|
if (!u2) {
|
|
22674
22432
|
const { message: R3 } = Bt$2("NO_MATCHING_KEY", `connect() pairing topic: ${u2}`);
|
|
22675
22433
|
throw new Error(R3);
|
|
22676
22434
|
}
|
|
22677
|
-
const f4 = await this.client.core.crypto.generateKeyPair(),
|
|
22678
|
-
const { domain:
|
|
22679
|
-
return { domain:
|
|
22435
|
+
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) => {
|
|
22436
|
+
const { domain: q3, chains: ve2, nonce: ce2, uri: Y2, exp: ie2, nbf: le2, type: J4, statement: pe2, requestId: he2, resources: C2, signatureTypes: D2 } = R3;
|
|
22437
|
+
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 };
|
|
22680
22438
|
}), walletPay: y3 } }), A2 = $i$1("session_connect", T2.id), { reject: V3, resolve: x2, done: U2 } = Ai$1(d3, Ke$1), z2 = ({ id: R3 }) => {
|
|
22681
22439
|
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 } }));
|
|
22682
22440
|
};
|
|
22683
|
-
return this.client.events.on("proposal_expire", z2), this.events.once(A2, ({ error: R3, session:
|
|
22684
|
-
this.client.events.off("proposal_expire", z2), R3 ? V3(R3) :
|
|
22441
|
+
return this.client.events.on("proposal_expire", z2), this.events.once(A2, ({ error: R3, session: q3 }) => {
|
|
22442
|
+
this.client.events.off("proposal_expire", z2), R3 ? V3(R3) : q3 && x2(q3);
|
|
22685
22443
|
}), await this.setProposal(T2.id, T2), await this.sendProposeSession({ proposal: T2, publishOpts: { internal: { throwOnFailedPublish: true }, tvf: { correlationId: T2.id } } }).catch((R3) => {
|
|
22686
22444
|
throw this.deleteProposal(T2.id), R3;
|
|
22687
22445
|
}), { uri: w2, approval: U2 };
|
|
@@ -22697,38 +22455,38 @@ class Ds extends V$1 {
|
|
|
22697
22455
|
const r2 = this.client.core.eventClient.createEvent({ properties: { topic: (t2 = e2?.id) == null ? void 0 : t2.toString(), trace: [rr.session_approve_started] } });
|
|
22698
22456
|
try {
|
|
22699
22457
|
this.isInitialized(), await this.confirmOnlineStateOrThrow();
|
|
22700
|
-
} catch (
|
|
22701
|
-
throw r2.setError(nr.no_internet_connection),
|
|
22458
|
+
} catch (q3) {
|
|
22459
|
+
throw r2.setError(nr.no_internet_connection), q3;
|
|
22702
22460
|
}
|
|
22703
22461
|
try {
|
|
22704
22462
|
await this.isValidProposalId(e2?.id);
|
|
22705
|
-
} catch (
|
|
22706
|
-
throw this.client.logger.error(`approve() -> proposal.get(${e2?.id}) failed`), r2.setError(nr.proposal_not_found),
|
|
22463
|
+
} catch (q3) {
|
|
22464
|
+
throw this.client.logger.error(`approve() -> proposal.get(${e2?.id}) failed`), r2.setError(nr.proposal_not_found), q3;
|
|
22707
22465
|
}
|
|
22708
22466
|
try {
|
|
22709
22467
|
await this.isValidApprove(e2);
|
|
22710
|
-
} catch (
|
|
22711
|
-
throw this.client.logger.error("approve() -> isValidApprove() failed"), r2.setError(nr.session_approve_namespace_validation_failure),
|
|
22468
|
+
} catch (q3) {
|
|
22469
|
+
throw this.client.logger.error("approve() -> isValidApprove() failed"), r2.setError(nr.session_approve_namespace_validation_failure), q3;
|
|
22712
22470
|
}
|
|
22713
22471
|
const { id: n3, relayProtocol: a2, namespaces: l2, sessionProperties: h4, scopedProperties: p2, sessionConfig: y3, proposalRequestsResponses: d3 } = e2, u2 = this.client.proposal.get(n3);
|
|
22714
22472
|
this.client.core.eventClient.deleteEvent({ eventId: r2.eventId });
|
|
22715
|
-
const { pairingTopic: w2, proposer: g2, requiredNamespaces: f4, optionalNamespaces:
|
|
22473
|
+
const { pairingTopic: w2, proposer: g2, requiredNamespaces: f4, optionalNamespaces: v2 } = u2;
|
|
22716
22474
|
let T2 = (s2 = this.client.core.eventClient) == null ? void 0 : s2.getEvent({ topic: w2 });
|
|
22717
22475
|
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] } }));
|
|
22718
22476
|
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;
|
|
22719
22477
|
T2.addTrace(rr.subscribing_session_topic);
|
|
22720
22478
|
try {
|
|
22721
22479
|
await this.client.core.relayer.subscribe(x2, { transportType: z2, internal: { skipSubscribe: true } });
|
|
22722
|
-
} catch (
|
|
22723
|
-
throw T2.setError(nr.subscribe_session_topic_failure),
|
|
22480
|
+
} catch (q3) {
|
|
22481
|
+
throw T2.setError(nr.subscribe_session_topic_failure), q3;
|
|
22724
22482
|
}
|
|
22725
22483
|
T2.addTrace(rr.subscribe_session_topic_success);
|
|
22726
|
-
const R3 = b$1(E$2({}, U2), { topic: x2, requiredNamespaces: f4, optionalNamespaces:
|
|
22484
|
+
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 });
|
|
22727
22485
|
await this.client.session.set(x2, R3), T2.addTrace(rr.store_session);
|
|
22728
22486
|
try {
|
|
22729
22487
|
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);
|
|
22730
|
-
} catch (
|
|
22731
|
-
throw this.client.logger.error(
|
|
22488
|
+
} catch (q3) {
|
|
22489
|
+
throw this.client.logger.error(q3), this.client.session.delete(x2, zt$2("USER_DISCONNECTED")), await this.client.core.relayer.unsubscribe(x2), q3;
|
|
22732
22490
|
}
|
|
22733
22491
|
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)) };
|
|
22734
22492
|
}), c$2(this, "reject", async (e2) => {
|
|
@@ -22793,8 +22551,8 @@ class Ds extends V$1 {
|
|
|
22793
22551
|
}), new Promise(async (g2) => {
|
|
22794
22552
|
var f4;
|
|
22795
22553
|
if (!((f4 = n3.sessionConfig) != null && f4.disableDeepLink)) {
|
|
22796
|
-
const
|
|
22797
|
-
await Ti$1({ id: a2, topic: i3, wcDeepLink:
|
|
22554
|
+
const v2 = await Ci$1(this.client.core.storage, $e$1);
|
|
22555
|
+
await Ti$1({ id: a2, topic: i3, wcDeepLink: v2 });
|
|
22798
22556
|
}
|
|
22799
22557
|
g2();
|
|
22800
22558
|
}), h4()]).then((g2) => g2[2]);
|
|
@@ -22848,27 +22606,27 @@ class Ds extends V$1 {
|
|
|
22848
22606
|
this.isInitialized(), this.isValidAuthenticate(e2);
|
|
22849
22607
|
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;
|
|
22850
22608
|
r2 === ee$1.relay && await this.confirmOnlineStateOrThrow();
|
|
22851
|
-
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:
|
|
22852
|
-
this.client.logger.info({ message: "Generated new pairing", pairing: { topic:
|
|
22609
|
+
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 });
|
|
22610
|
+
this.client.logger.info({ message: "Generated new pairing", pairing: { topic: v2, uri: T2 } });
|
|
22853
22611
|
const A2 = await this.client.core.crypto.generateKeyPair(), V3 = ba(A2);
|
|
22854
|
-
if (await Promise.all([this.client.auth.authKeys.set(_e, { responseTopic: V3, publicKey: A2 }), this.client.auth.pairingTopics.set(V3, { topic: V3, pairingTopic:
|
|
22612
|
+
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) {
|
|
22855
22613
|
const { namespace: C2 } = Je$2(n3[0]);
|
|
22856
22614
|
let D2 = Zc(C2, "request", w2);
|
|
22857
|
-
|
|
22615
|
+
je2(f4) && (D2 = Gc(D2, f4.pop())), f4.push(D2);
|
|
22858
22616
|
}
|
|
22859
|
-
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:
|
|
22617
|
+
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 }) => {
|
|
22860
22618
|
this.events.off(le2, pe2), C2 ? ce2(C2) : D2 && ve2({ session: D2 });
|
|
22861
22619
|
}, pe2 = async (C2) => {
|
|
22862
22620
|
var D2, je$12, Fe2;
|
|
22863
22621
|
if (await this.deletePendingAuthRequest(Y2, { message: "fulfilled", code: 0 }), C2.error) {
|
|
22864
22622
|
const ue2 = zt$2("WC_METHOD_UNSUPPORTED", "wc_sessionAuthenticate");
|
|
22865
|
-
return C2.error.code === ue2.code ? void 0 : (this.events.off(ie2,
|
|
22623
|
+
return C2.error.code === ue2.code ? void 0 : (this.events.off(ie2, J4), ce2(C2.error.message));
|
|
22866
22624
|
}
|
|
22867
|
-
await this.deleteProposal(R3.id), this.events.off(ie2,
|
|
22625
|
+
await this.deleteProposal(R3.id), this.events.off(ie2, J4);
|
|
22868
22626
|
const { cacaos: He2, responder: X2 } = C2.result, Pe2 = [], Qe2 = [];
|
|
22869
22627
|
for (const ue2 of He2) {
|
|
22870
22628
|
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")));
|
|
22871
|
-
const { p: Ne2 } = ue2, Oe3 =
|
|
22629
|
+
const { p: Ne2 } = ue2, Oe3 = je2(Ne2.resources), ze2 = [no$1(Ne2.iss)], Tt2 = bn$1(Ne2.iss);
|
|
22872
22630
|
if (Oe3) {
|
|
22873
22631
|
const be2 = zc(Oe3), qt2 = Yc(Oe3);
|
|
22874
22632
|
Pe2.push(...be2), ze2.push(...qt2);
|
|
@@ -22877,21 +22635,21 @@ class Ds extends V$1 {
|
|
|
22877
22635
|
}
|
|
22878
22636
|
const de2 = await this.client.core.crypto.generateSharedKey(A2, X2.publicKey);
|
|
22879
22637
|
let Se2;
|
|
22880
|
-
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:
|
|
22638
|
+
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 });
|
|
22881
22639
|
};
|
|
22882
|
-
this.events.once(ie2,
|
|
22640
|
+
this.events.once(ie2, J4), this.events.once(le2, pe2);
|
|
22883
22641
|
let he2;
|
|
22884
22642
|
try {
|
|
22885
22643
|
if (i3) {
|
|
22886
22644
|
const C2 = formatJsonRpcRequest("wc_sessionAuthenticate", U2, Y2);
|
|
22887
|
-
this.client.core.history.set(
|
|
22645
|
+
this.client.core.history.set(v2, C2);
|
|
22888
22646
|
const D2 = await this.client.core.crypto.encode("", C2, { type: ve$2, encoding: Ge$3 });
|
|
22889
|
-
he2 = La(t2,
|
|
22890
|
-
} else await Promise.all([this.sendRequest({ topic:
|
|
22647
|
+
he2 = La(t2, v2, D2);
|
|
22648
|
+
} 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 })]);
|
|
22891
22649
|
} catch (C2) {
|
|
22892
|
-
throw this.events.off(ie2,
|
|
22650
|
+
throw this.events.off(ie2, J4), this.events.off(le2, pe2), C2;
|
|
22893
22651
|
}
|
|
22894
|
-
return await this.setProposal(R3.id, R3), await this.setAuthRequest(Y2, { request: b$1(E$2({}, U2), { verifyContext: {} }), pairingTopic:
|
|
22652
|
+
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 };
|
|
22895
22653
|
}), c$2(this, "approveSessionAuthenticate", async (e2) => {
|
|
22896
22654
|
const { id: t2, auths: s2 } = e2, i3 = this.client.core.eventClient.createEvent({ properties: { topic: t2.toString(), trace: [or.authenticated_session_approve_started] } });
|
|
22897
22655
|
try {
|
|
@@ -22911,9 +22669,9 @@ class Ds extends V$1 {
|
|
|
22911
22669
|
throw await this.sendError({ id: t2, topic: h4, error: V3, encodeOpts: p2 }), new Error(V3.message);
|
|
22912
22670
|
}
|
|
22913
22671
|
i3.addTrace(or.cacaos_verified);
|
|
22914
|
-
const { p: f4 } = g2,
|
|
22915
|
-
if (
|
|
22916
|
-
const V3 = zc(
|
|
22672
|
+
const { p: f4 } = g2, v2 = je2(f4.resources), T2 = [no$1(f4.iss)], A2 = bn$1(f4.iss);
|
|
22673
|
+
if (v2) {
|
|
22674
|
+
const V3 = zc(v2), x2 = Yc(v2);
|
|
22917
22675
|
y3.push(...V3), T2.push(...x2);
|
|
22918
22676
|
}
|
|
22919
22677
|
for (const V3 of T2) d3.push(`${V3}:${A2}`);
|
|
@@ -22998,21 +22756,21 @@ class Ds extends V$1 {
|
|
|
22998
22756
|
let u2;
|
|
22999
22757
|
const w2 = !!h4;
|
|
23000
22758
|
try {
|
|
23001
|
-
const
|
|
23002
|
-
u2 = await this.client.core.crypto.encode(t2, d3, { encoding:
|
|
23003
|
-
} catch (
|
|
23004
|
-
throw await this.cleanup(), this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${t2} failed`),
|
|
22759
|
+
const v2 = w2 ? Ge$3 : oe$2;
|
|
22760
|
+
u2 = await this.client.core.crypto.encode(t2, d3, { encoding: v2 });
|
|
22761
|
+
} catch (v2) {
|
|
22762
|
+
throw await this.cleanup(), this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${t2} failed`), v2;
|
|
23005
22763
|
}
|
|
23006
22764
|
let g2;
|
|
23007
22765
|
if (wt$1.includes(s2)) {
|
|
23008
|
-
const
|
|
23009
|
-
g2 = await this.client.core.verify.register({ id: T2, decryptedId:
|
|
22766
|
+
const v2 = ya(JSON.stringify(d3)), T2 = ya(u2);
|
|
22767
|
+
g2 = await this.client.core.verify.register({ id: T2, decryptedId: v2 });
|
|
23010
22768
|
}
|
|
23011
22769
|
const f4 = E$2(E$2({}, N$1[s2].req), y3);
|
|
23012
22770
|
if (f4.attestation = g2, r2 && (f4.ttl = r2), n3 && (f4.id = n3), this.client.core.history.set(t2, d3), w2) {
|
|
23013
|
-
const
|
|
23014
|
-
await global.Linking.openURL(
|
|
23015
|
-
} 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((
|
|
22771
|
+
const v2 = La(h4, t2, u2);
|
|
22772
|
+
await global.Linking.openURL(v2, this.client.name);
|
|
22773
|
+
} 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));
|
|
23016
22774
|
return d3.id;
|
|
23017
22775
|
}), c$2(this, "sendProposeSession", async (e2) => {
|
|
23018
22776
|
const { proposal: t2, publishOpts: s2 } = e2, i3 = formatJsonRpcRequest("wc_sessionPropose", t2, t2.id);
|
|
@@ -23647,7 +23405,7 @@ class Ds extends V$1 {
|
|
|
23647
23405
|
}
|
|
23648
23406
|
}
|
|
23649
23407
|
registerExpirerEvents() {
|
|
23650
|
-
this.client.core.expirer.on(
|
|
23408
|
+
this.client.core.expirer.on(q2.expired, async (o3) => {
|
|
23651
23409
|
const { topic: e2, id: t2 } = Ui$1(o3.target);
|
|
23652
23410
|
if (t2 && this.client.pendingRequest.keys.includes(t2)) return await this.deletePendingSessionRequest(t2, Bt$2("EXPIRED"), true);
|
|
23653
23411
|
if (t2 && this.client.auth.requests.keys.includes(t2)) return await this.deletePendingAuthRequest(t2, Bt$2("EXPIRED"), true);
|
|
@@ -23755,7 +23513,7 @@ class Us extends ji {
|
|
|
23755
23513
|
super(o3, e2, ft$1, we$1, (t2) => t2.id), this.core = o3, this.logger = e2;
|
|
23756
23514
|
}
|
|
23757
23515
|
}
|
|
23758
|
-
var Gs = Object.defineProperty, js = (
|
|
23516
|
+
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);
|
|
23759
23517
|
class Fs {
|
|
23760
23518
|
constructor(o3, e2) {
|
|
23761
23519
|
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);
|
|
@@ -23764,7 +23522,7 @@ class Fs {
|
|
|
23764
23522
|
await this.authKeys.init(), await this.pairingTopics.init(), await this.requests.init();
|
|
23765
23523
|
}
|
|
23766
23524
|
}
|
|
23767
|
-
var Hs = Object.defineProperty, Qs = (
|
|
23525
|
+
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);
|
|
23768
23526
|
class qe extends J$4 {
|
|
23769
23527
|
constructor(o3) {
|
|
23770
23528
|
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) => {
|
|
@@ -23878,7 +23636,7 @@ class qe extends J$4 {
|
|
|
23878
23636
|
return await e2.initialize(), e2;
|
|
23879
23637
|
}
|
|
23880
23638
|
get context() {
|
|
23881
|
-
return
|
|
23639
|
+
return ee$3(this.logger);
|
|
23882
23640
|
}
|
|
23883
23641
|
get pairing() {
|
|
23884
23642
|
return this.core.pairing.pairings;
|
|
@@ -24555,7 +24313,7 @@ function Z(t2) {
|
|
|
24555
24313
|
function T(t2) {
|
|
24556
24314
|
return t2 == null ? t2 === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(t2);
|
|
24557
24315
|
}
|
|
24558
|
-
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]",
|
|
24316
|
+
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]";
|
|
24559
24317
|
function x(t2) {
|
|
24560
24318
|
return ArrayBuffer.isView(t2) && !(t2 instanceof DataView);
|
|
24561
24319
|
}
|
|
@@ -24649,7 +24407,7 @@ function tt(t2) {
|
|
|
24649
24407
|
case He:
|
|
24650
24408
|
case Je:
|
|
24651
24409
|
case Ke:
|
|
24652
|
-
case
|
|
24410
|
+
case Ve2:
|
|
24653
24411
|
case Ye:
|
|
24654
24412
|
return true;
|
|
24655
24413
|
default:
|
|
@@ -24756,8 +24514,8 @@ function $(t2, e2, s2, i3) {
|
|
|
24756
24514
|
function ot(t2, ...e2) {
|
|
24757
24515
|
return ct(t2, ...e2, it);
|
|
24758
24516
|
}
|
|
24759
|
-
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`,
|
|
24760
|
-
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,
|
|
24517
|
+
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" };
|
|
24518
|
+
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) => {
|
|
24761
24519
|
for (var s2 in e2 || (e2 = {})) gt.call(e2, s2) && ue(t2, s2, e2[s2]);
|
|
24762
24520
|
if (le) for (var s2 of le(e2)) yt.call(e2, s2) && ue(t2, s2, e2[s2]);
|
|
24763
24521
|
return t2;
|
|
@@ -24798,7 +24556,7 @@ function ge(t2) {
|
|
|
24798
24556
|
if (!Ye$2(t2)) return n3;
|
|
24799
24557
|
for (const [c2, o3] of Object.entries(t2)) {
|
|
24800
24558
|
const p2 = Gn$1(c2) ? [c2] : o3.chains, l2 = o3.methods || [], h4 = o3.events || [], f4 = o3.rpcMap || {}, u2 = ms(c2);
|
|
24801
|
-
n3[u2] = vt(
|
|
24559
|
+
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));
|
|
24802
24560
|
}
|
|
24803
24561
|
return n3;
|
|
24804
24562
|
}
|
|
@@ -24850,8 +24608,8 @@ const Ie = "eip155", $t = ["atomic", "flow-control", "paymasterService", "sessio
|
|
|
24850
24608
|
return Object.keys(a2).length > 0 ? a2 : void 0;
|
|
24851
24609
|
};
|
|
24852
24610
|
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);
|
|
24853
|
-
let
|
|
24854
|
-
class
|
|
24611
|
+
let L;
|
|
24612
|
+
class J3 {
|
|
24855
24613
|
constructor(e2) {
|
|
24856
24614
|
qt(this, "storage"), this.storage = e2;
|
|
24857
24615
|
}
|
|
@@ -24865,7 +24623,7 @@ class J2 {
|
|
|
24865
24623
|
return await this.storage.removeItem(e2);
|
|
24866
24624
|
}
|
|
24867
24625
|
static getStorage(e2) {
|
|
24868
|
-
return
|
|
24626
|
+
return L || (L = new J3(e2)), L;
|
|
24869
24627
|
}
|
|
24870
24628
|
}
|
|
24871
24629
|
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) => {
|
|
@@ -24884,19 +24642,19 @@ async function Lt(t2, e2, s2) {
|
|
|
24884
24642
|
return await s2(parseInt(t2)).request(formatJsonRpcRequest("eth_getTransactionReceipt", [e2]));
|
|
24885
24643
|
}
|
|
24886
24644
|
async function Mt({ sendCalls: t2, storage: e2 }) {
|
|
24887
|
-
const s2 = await e2.getItem(
|
|
24888
|
-
await e2.setItem(
|
|
24645
|
+
const s2 = await e2.getItem(v);
|
|
24646
|
+
await e2.setItem(v, Ut(Ht({}, s2), { [t2.result.id]: { request: t2.request, result: t2.result, expiry: _i$1(ut) } }));
|
|
24889
24647
|
}
|
|
24890
24648
|
async function zt({ resultId: t2, storage: e2 }) {
|
|
24891
|
-
const s2 = await e2.getItem(
|
|
24649
|
+
const s2 = await e2.getItem(v);
|
|
24892
24650
|
if (s2) {
|
|
24893
|
-
delete s2[t2], await e2.setItem(
|
|
24651
|
+
delete s2[t2], await e2.setItem(v, s2);
|
|
24894
24652
|
for (const i3 in s2) Ri$1(s2[i3].expiry) && delete s2[i3];
|
|
24895
|
-
await e2.setItem(
|
|
24653
|
+
await e2.setItem(v, s2);
|
|
24896
24654
|
}
|
|
24897
24655
|
}
|
|
24898
24656
|
async function Gt({ resultId: t2, storage: e2 }) {
|
|
24899
|
-
const s2 = await e2.getItem(
|
|
24657
|
+
const s2 = await e2.getItem(v), i3 = s2?.[t2];
|
|
24900
24658
|
if (i3 && !Ri$1(i3.expiry)) return i3;
|
|
24901
24659
|
await zt({ resultId: t2, storage: e2 });
|
|
24902
24660
|
}
|
|
@@ -24907,7 +24665,7 @@ var Wt = Object.defineProperty, Jt = Object.defineProperties, Kt = Object.getOwn
|
|
|
24907
24665
|
}, G = (t2, e2) => Jt(t2, Kt(e2)), g = (t2, e2, s2) => M2(t2, typeof e2 != "symbol" ? e2 + "" : e2, s2);
|
|
24908
24666
|
class Xt {
|
|
24909
24667
|
constructor(e2) {
|
|
24910
|
-
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 =
|
|
24668
|
+
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);
|
|
24911
24669
|
}
|
|
24912
24670
|
async request(e2) {
|
|
24913
24671
|
switch (e2.request.method) {
|
|
@@ -24993,15 +24751,15 @@ class Xt {
|
|
|
24993
24751
|
let u2;
|
|
24994
24752
|
try {
|
|
24995
24753
|
u2 = Ct(p2, c2, o3);
|
|
24996
|
-
} catch (
|
|
24997
|
-
console.warn("Failed to extract capabilities from session",
|
|
24754
|
+
} catch (q3) {
|
|
24755
|
+
console.warn("Failed to extract capabilities from session", q3);
|
|
24998
24756
|
}
|
|
24999
24757
|
if (u2) return u2;
|
|
25000
24758
|
const K3 = await this.client.request(e2);
|
|
25001
24759
|
try {
|
|
25002
24760
|
await this.client.session.update(e2.topic, { sessionProperties: G(z({}, p2.sessionProperties || {}), { capabilities: G(z({}, l2 || {}), { [h4]: K3 }) }) });
|
|
25003
|
-
} catch (
|
|
25004
|
-
console.warn("Failed to update session with capabilities",
|
|
24761
|
+
} catch (q3) {
|
|
24762
|
+
console.warn("Failed to update session with capabilities", q3);
|
|
25005
24763
|
}
|
|
25006
24764
|
return K3;
|
|
25007
24765
|
}
|
|
@@ -25105,14 +24863,14 @@ class Zt {
|
|
|
25105
24863
|
return new o$1(new f3(i3, w("disableProviderPing")));
|
|
25106
24864
|
}
|
|
25107
24865
|
}
|
|
25108
|
-
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,
|
|
24866
|
+
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) => {
|
|
25109
24867
|
for (var s2 in e2 || (e2 = {})) ss.call(e2, s2) && W(t2, s2, e2[s2]);
|
|
25110
24868
|
if (Ce) for (var s2 of Ce(e2)) is.call(e2, s2) && W(t2, s2, e2[s2]);
|
|
25111
24869
|
return t2;
|
|
25112
|
-
},
|
|
24870
|
+
}, j = (t2, e2) => es(t2, ts(e2)), d2 = (t2, e2, s2) => W(t2, typeof e2 != "symbol" ? e2 + "" : e2, s2);
|
|
25113
24871
|
class N {
|
|
25114
24872
|
constructor(e2) {
|
|
25115
|
-
d2(this, "client"), d2(this, "namespaces"), d2(this, "optionalNamespaces"), d2(this, "sessionProperties"), d2(this, "scopedProperties"), d2(this, "events", new xe$
|
|
24873
|
+
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");
|
|
25116
24874
|
var s2, i3;
|
|
25117
24875
|
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;
|
|
25118
24876
|
}
|
|
@@ -25123,7 +24881,7 @@ class N {
|
|
|
25123
24881
|
async request(e2, s2, i3) {
|
|
25124
24882
|
const [r2, a2] = this.validateChain(s2);
|
|
25125
24883
|
if (!this.session) throw new Error("Please call connect() before request()");
|
|
25126
|
-
return await this.getProvider(r2).request({ request:
|
|
24884
|
+
return await this.getProvider(r2).request({ request: S2({}, e2), chainId: `${r2}:${a2}`, topic: this.session.topic, expiry: i3 });
|
|
25127
24885
|
}
|
|
25128
24886
|
sendAsync(e2, s2, i3, r2) {
|
|
25129
24887
|
const a2 = (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -25228,7 +24986,7 @@ class N {
|
|
|
25228
24986
|
if (!this.session) return;
|
|
25229
24987
|
const i3 = bt(s2, this.session);
|
|
25230
24988
|
if (i3?.length === 0) return;
|
|
25231
|
-
const r2 = fe(i3), a2 = C(this.namespaces, this.optionalNamespaces), n3 =
|
|
24989
|
+
const r2 = fe(i3), a2 = C(this.namespaces, this.optionalNamespaces), n3 = j(S2({}, a2[s2]), { accounts: i3, chains: r2 });
|
|
25232
24990
|
switch (s2) {
|
|
25233
24991
|
case "eip155":
|
|
25234
24992
|
this.rpcProviders[s2] = new Xt({ namespace: n3 });
|
|
@@ -25261,12 +25019,12 @@ class N {
|
|
|
25261
25019
|
var i3, r2;
|
|
25262
25020
|
if (e2 !== ((i3 = this.session) == null ? void 0 : i3.topic)) return;
|
|
25263
25021
|
const { namespaces: a2 } = s2, n3 = (r2 = this.client) == null ? void 0 : r2.session.get(e2);
|
|
25264
|
-
this.session =
|
|
25022
|
+
this.session = j(S2({}, n3), { namespaces: a2 }), this.onSessionUpdate(), this.events.emit("session_update", { topic: e2, params: s2 });
|
|
25265
25023
|
}), this.client.on("session_delete", async (e2) => {
|
|
25266
25024
|
var s2;
|
|
25267
|
-
e2.topic === ((s2 = this.session) == null ? void 0 : s2.topic) && (await this.cleanup(), this.events.emit("session_delete", e2), this.events.emit("disconnect",
|
|
25025
|
+
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 })));
|
|
25268
25026
|
}), this.on(F.DEFAULT_CHAIN_CHANGED, (e2) => {
|
|
25269
|
-
this.onChainChanged(
|
|
25027
|
+
this.onChainChanged(j(S2({}, e2), { internal: true }));
|
|
25270
25028
|
});
|
|
25271
25029
|
}
|
|
25272
25030
|
getProvider(e2) {
|
|
@@ -25505,10 +25263,10 @@ const buildProxyFunction = (objectIs = Object.is, newProxy = (target, handler) =
|
|
|
25505
25263
|
}
|
|
25506
25264
|
let nextValue = value;
|
|
25507
25265
|
if (value instanceof Promise) {
|
|
25508
|
-
value.then((
|
|
25266
|
+
value.then((v2) => {
|
|
25509
25267
|
value.status = "fulfilled";
|
|
25510
|
-
value.value =
|
|
25511
|
-
notifyUpdate(["resolve", [prop],
|
|
25268
|
+
value.value = v2;
|
|
25269
|
+
notifyUpdate(["resolve", [prop], v2]);
|
|
25512
25270
|
}).catch((e2) => {
|
|
25513
25271
|
value.status = "rejected";
|
|
25514
25272
|
value.reason = e2;
|
|
@@ -26138,7 +25896,7 @@ class WalletConnectModal {
|
|
|
26138
25896
|
}
|
|
26139
25897
|
async initUi() {
|
|
26140
25898
|
if (typeof window !== "undefined") {
|
|
26141
|
-
await Promise.resolve().then(() => require("./index-
|
|
25899
|
+
await Promise.resolve().then(() => require("./index-CsqeJOar.cjs"));
|
|
26142
25900
|
const modal = document.createElement("wcm-modal");
|
|
26143
25901
|
document.body.insertAdjacentElement("beforeend", modal);
|
|
26144
25902
|
OptionsCtrl.setIsUiLoaded(true);
|
|
@@ -26361,34 +26119,6 @@ function useTronWalletConnect(projectId) {
|
|
|
26361
26119
|
signTransaction
|
|
26362
26120
|
};
|
|
26363
26121
|
}
|
|
26364
|
-
function parseBridgeUrlParams(source) {
|
|
26365
|
-
if (source && typeof source === "object") {
|
|
26366
|
-
return source;
|
|
26367
|
-
}
|
|
26368
|
-
const queryString = typeof source === "string" ? source : typeof window !== "undefined" ? window.location.search : "";
|
|
26369
|
-
const searchParams = new URLSearchParams(queryString);
|
|
26370
|
-
return {
|
|
26371
|
-
srcToken: searchParams.get("srcToken") || void 0,
|
|
26372
|
-
srcChain: searchParams.get("srcChain") || void 0,
|
|
26373
|
-
dstChain: searchParams.get("dstChain") || void 0,
|
|
26374
|
-
amount: searchParams.get("amount") || void 0
|
|
26375
|
-
};
|
|
26376
|
-
}
|
|
26377
|
-
function buildQueryString(params) {
|
|
26378
|
-
const searchParams = new URLSearchParams();
|
|
26379
|
-
if (params.srcToken) searchParams.set("srcToken", params.srcToken);
|
|
26380
|
-
if (params.srcChain) searchParams.set("srcChain", params.srcChain);
|
|
26381
|
-
if (params.dstChain) searchParams.set("dstChain", params.dstChain);
|
|
26382
|
-
if (params.amount) searchParams.set("amount", params.amount);
|
|
26383
|
-
const queryString = searchParams.toString();
|
|
26384
|
-
return queryString ? `?${queryString}` : "";
|
|
26385
|
-
}
|
|
26386
|
-
function updateBridgeUrlNative(params) {
|
|
26387
|
-
if (typeof window === "undefined" || !window.history) return;
|
|
26388
|
-
const queryString = buildQueryString(params);
|
|
26389
|
-
const newUrl = `${window.location.pathname}${queryString}${window.location.hash}`;
|
|
26390
|
-
window.history.replaceState(null, "", newUrl);
|
|
26391
|
-
}
|
|
26392
26122
|
function useUrlSync(options) {
|
|
26393
26123
|
const {
|
|
26394
26124
|
enabled = true,
|
|
@@ -26888,4 +26618,4 @@ exports.useSettingsStore = useSettingsStore;
|
|
|
26888
26618
|
exports.useSwapModel = useSwapModel;
|
|
26889
26619
|
exports.useTokensStore = useTokensStore;
|
|
26890
26620
|
exports.useTransactionStore = useTransactionStore;
|
|
26891
|
-
//# sourceMappingURL=index-
|
|
26621
|
+
//# sourceMappingURL=index-BpblK2_8.cjs.map
|